@ainyc/canonry 1.25.1 → 1.25.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.
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function pk(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const c=Object.getOwnPropertyDescriptor(a,r);c&&Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(r){if(r.ep)return;r.ep=!0;const c=s(r);fetch(r.href,c)}})();function Yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xh={exports:{}},Do={};var Iv;function gk(){if(Iv)return Do;Iv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var f in r)f!=="key"&&(c[f]=r[f])}else c=r;return r=c.ref,{$$typeof:e,type:a,key:d,ref:r!==void 0?r:null,props:c}}return Do.Fragment=t,Do.jsx=s,Do.jsxs=s,Do}var Bv;function yk(){return Bv||(Bv=1,xh.exports=gk()),xh.exports}var o=yk(),bh={exports:{}},Ee={};var qv;function vk(){if(qv)return Ee;qv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(O,F,ie){this.props=O,this.context=F,this.refs=C,this.updater=ie||w}k.prototype.isReactComponent={},k.prototype.setState=function(O,F){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,F,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=k.prototype;function R(O,F,ie){this.props=O,this.context=F,this.refs=C,this.updater=ie||w}var _=R.prototype=new E;_.constructor=R,S(_,k.prototype),_.isPureReactComponent=!0;var D=Array.isArray;function M(){}var T={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(O,F,ie){var re=ie.ref;return{$$typeof:e,type:O,key:F,ref:re!==void 0?re:null,props:ie}}function J(O,F){return P(O.type,F,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function se(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ie){return F[ie]})}var pe=/\/+/g;function ke(O,F){return typeof O=="object"&&O!==null&&O.key!=null?se(""+O.key):F.toString(36)}function je(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(M,M):(O.status="pending",O.then(function(F){O.status==="pending"&&(O.status="fulfilled",O.value=F)},function(F){O.status==="pending"&&(O.status="rejected",O.reason=F)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function B(O,F,ie,re,ue){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case t:de=!0;break;case v:return de=O._init,B(de(O._payload),F,ie,re,ue)}}if(de)return ue=ue(O),de=re===""?"."+ke(O,0):re,D(ue)?(ie="",de!=null&&(ie=de.replace(pe,"$&/")+"/"),B(ue,F,ie,"",function(Ze){return Ze})):ue!=null&&(Q(ue)&&(ue=J(ue,ie+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(pe,"$&/")+"/")+de)),F.push(ue)),1;de=0;var Me=re===""?".":re+":";if(D(O))for(var ge=0;ge<O.length;ge++)re=O[ge],he=Me+ke(re,ge),de+=B(re,F,ie,he,ue);else if(ge=b(O),typeof ge=="function")for(O=ge.call(O),ge=0;!(re=O.next()).done;)re=re.value,he=Me+ke(re,ge++),de+=B(re,F,ie,he,ue);else if(he==="object"){if(typeof O.then=="function")return B(je(O),F,ie,re,ue);throw F=String(O),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(O,F,ie){if(O==null)return O;var re=[],ue=0;return B(O,re,"","",function(he){return F.call(ie,he,ue++)}),re}function oe(O){if(O._status===-1){var F=O._result;F=F(),F.then(function(ie){(O._status===0||O._status===-1)&&(O._status=1,O._result=ie)},function(ie){(O._status===0||O._status===-1)&&(O._status=2,O._result=ie)}),O._status===-1&&(O._status=0,O._result=F)}if(O._status===1)return O._result.default;throw O._result}var q=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},X={map:G,forEach:function(O,F,ie){G(O,function(){F.apply(this,arguments)},ie)},count:function(O){var F=0;return G(O,function(){F++}),F},toArray:function(O){return G(O,function(F){return F})||[]},only:function(O){if(!Q(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ee.Activity=y,Ee.Children=X,Ee.Component=k,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=R,Ee.StrictMode=a,Ee.Suspense=m,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(O){return T.H.useMemoCache(O)}},Ee.cache=function(O){return function(){return O.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(O,F,ie){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var re=S({},O.props),ue=O.key;if(F!=null)for(he in F.key!==void 0&&(ue=""+F.key),F)!A.call(F,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&F.ref===void 0||(re[he]=F[he]);var he=arguments.length-2;if(he===1)re.children=ie;else if(1<he){for(var de=Array(he),Me=0;Me<he;Me++)de[Me]=arguments[Me+2];re.children=de}return P(O.type,ue,re)},Ee.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},Ee.createElement=function(O,F,ie){var re,ue={},he=null;if(F!=null)for(re in F.key!==void 0&&(he=""+F.key),F)A.call(F,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=F[re]);var de=arguments.length-2;if(de===1)ue.children=ie;else if(1<de){for(var Me=Array(de),ge=0;ge<de;ge++)Me[ge]=arguments[ge+2];ue.children=Me}if(O&&O.defaultProps)for(re in de=O.defaultProps,de)ue[re]===void 0&&(ue[re]=de[re]);return P(O,he,ue)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(O){return{$$typeof:f,render:O}},Ee.isValidElement=Q,Ee.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:oe}},Ee.memo=function(O,F){return{$$typeof:p,type:O,compare:F===void 0?null:F}},Ee.startTransition=function(O){var F=T.T,ie={};T.T=ie;try{var re=O(),ue=T.S;ue!==null&&ue(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,q)}catch(he){q(he)}finally{F!==null&&ie.types!==null&&(F.types=ie.types),T.T=F}},Ee.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ee.use=function(O){return T.H.use(O)},Ee.useActionState=function(O,F,ie){return T.H.useActionState(O,F,ie)},Ee.useCallback=function(O,F){return T.H.useCallback(O,F)},Ee.useContext=function(O){return T.H.useContext(O)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(O,F){return T.H.useDeferredValue(O,F)},Ee.useEffect=function(O,F){return T.H.useEffect(O,F)},Ee.useEffectEvent=function(O){return T.H.useEffectEvent(O)},Ee.useId=function(){return T.H.useId()},Ee.useImperativeHandle=function(O,F,ie){return T.H.useImperativeHandle(O,F,ie)},Ee.useInsertionEffect=function(O,F){return T.H.useInsertionEffect(O,F)},Ee.useLayoutEffect=function(O,F){return T.H.useLayoutEffect(O,F)},Ee.useMemo=function(O,F){return T.H.useMemo(O,F)},Ee.useOptimistic=function(O,F){return T.H.useOptimistic(O,F)},Ee.useReducer=function(O,F,ie){return T.H.useReducer(O,F,ie)},Ee.useRef=function(O){return T.H.useRef(O)},Ee.useState=function(O){return T.H.useState(O)},Ee.useSyncExternalStore=function(O,F,ie){return T.H.useSyncExternalStore(O,F,ie)},Ee.useTransition=function(){return T.H.useTransition()},Ee.version="19.2.4",Ee}var Hv;function ol(){return Hv||(Hv=1,bh.exports=vk()),bh.exports}var N=ol();const is=Yb(N),Gm=pk({__proto__:null,default:is},[N]);var Sh={exports:{}},Mo={},jh={exports:{}},wh={};var Gv;function xk(){return Gv||(Gv=1,(function(e){function t(B,G){var oe=B.length;B.push(G);e:for(;0<oe;){var q=oe-1>>>1,X=B[q];if(0<r(X,G))B[q]=G,B[oe]=X,oe=q;else break e}}function s(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var G=B[0],oe=B.pop();if(oe!==G){B[0]=oe;e:for(var q=0,X=B.length,O=X>>>1;q<O;){var F=2*(q+1)-1,ie=B[F],re=F+1,ue=B[re];if(0>r(ie,oe))re<X&&0>r(ue,ie)?(B[q]=ue,B[re]=oe,q=re):(B[q]=ie,B[F]=oe,q=F);else if(re<X&&0>r(ue,oe))B[q]=ue,B[re]=oe,q=re;else break e}}return G}function r(B,G){var oe=B.sortIndex-G.sortIndex;return oe!==0?oe:B.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],p=[],v=1,y=null,x=3,b=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function _(B){for(var G=s(p);G!==null;){if(G.callback===null)a(p);else if(G.startTime<=B)a(p),G.sortIndex=G.expirationTime,t(m,G);else break;G=s(p)}}function D(B){if(S=!1,_(B),!w)if(s(m)!==null)w=!0,M||(M=!0,se());else{var G=s(p);G!==null&&je(D,G.startTime-B)}}var M=!1,T=-1,A=5,P=-1;function J(){return C?!0:!(e.unstable_now()-P<A)}function Q(){if(C=!1,M){var B=e.unstable_now();P=B;var G=!0;try{e:{w=!1,S&&(S=!1,E(T),T=-1),b=!0;var oe=x;try{t:{for(_(B),y=s(m);y!==null&&!(y.expirationTime>B&&J());){var q=y.callback;if(typeof q=="function"){y.callback=null,x=y.priorityLevel;var X=q(y.expirationTime<=B);if(B=e.unstable_now(),typeof X=="function"){y.callback=X,_(B),G=!0;break t}y===s(m)&&a(m),_(B)}else a(m);y=s(m)}if(y!==null)G=!0;else{var O=s(p);O!==null&&je(D,O.startTime-B),G=!1}}break e}finally{y=null,x=oe,b=!1}G=void 0}}finally{G?se():M=!1}}}var se;if(typeof R=="function")se=function(){R(Q)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ke=pe.port2;pe.port1.onmessage=Q,se=function(){ke.postMessage(null)}}else se=function(){k(Q,0)};function je(B,G){T=k(function(){B(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(B){switch(x){case 1:case 2:case 3:var G=3;break;default:G=x}var oe=x;x=G;try{return B()}finally{x=oe}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var oe=x;x=B;try{return G()}finally{x=oe}},e.unstable_scheduleCallback=function(B,G,oe){var q=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?q+oe:q):oe=q,B){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=oe+X,B={id:v++,callback:G,priorityLevel:B,startTime:oe,expirationTime:X,sortIndex:-1},oe>q?(B.sortIndex=oe,t(p,B),s(m)===null&&B===s(p)&&(S?(E(T),T=-1):S=!0,je(D,oe-q))):(B.sortIndex=X,t(m,B),w||b||(w=!0,M||(M=!0,se()))),B},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(B){var G=x;return function(){var oe=x;x=G;try{return B.apply(this,arguments)}finally{x=oe}}}})(wh)),wh}var Kv;function bk(){return Kv||(Kv=1,jh.exports=xk()),jh.exports}var Nh={exports:{}},tn={};var Fv;function Sk(){if(Fv)return tn;Fv=1;var e=ol();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(m,p,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:m,containerInfo:p,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},tn.flushSync=function(m){var p=d.T,v=a.p;try{if(d.T=null,a.p=2,m)return m()}finally{d.T=p,a.p=v,a.d.f()}},tn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},tn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},tn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:b}):v==="script"&&a.d.X(m,{crossOrigin:y,integrity:x,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},tn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=f(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},tn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin);a.d.L(m,v,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},tn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=f(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},tn.requestFormReset=function(m){a.d.r(m)},tn.unstable_batchedUpdates=function(m,p){return m(p)},tn.useFormState=function(m,p,v){return d.H.useFormState(m,p,v)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var Zv;function Jb(){if(Zv)return Nh.exports;Zv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Nh.exports=Sk(),Nh.exports}var Vv;function jk(){if(Vv)return Mo;Vv=1;var e=bk(),t=ol(),s=Jb();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function m(n){if(c(n)!==n)throw Error(a(188))}function p(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var l=n,u=i;;){var h=l.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){l=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===l)return m(h),n;if(g===u)return m(h),i;g=g.sibling}throw Error(a(188))}if(l.return!==u.return)l=h,u=g;else{for(var j=!1,z=h.child;z;){if(z===l){j=!0,l=h,u=g;break}if(z===u){j=!0,u=h,l=g;break}z=z.sibling}if(!j){for(z=g.child;z;){if(z===l){j=!0,l=g,u=h;break}if(z===u){j=!0,u=g,l=h;break}z=z.sibling}if(!j)throw Error(a(189))}}if(l.alternate!==u)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function ke(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case D:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case R:return n.displayName||"Context";case E:return(n._context.displayName||"Context")+".Consumer";case _:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case T:return i=n.displayName||null,i!==null?i:ke(n.type)||"Memo";case A:i=n._payload,n=n._init;try{return ke(n(i))}catch{}}return null}var je=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},q=[],X=-1;function O(n){return{current:n}}function F(n){0>X||(n.current=q[X],q[X]=null,X--)}function ie(n,i){X++,q[X]=n.current,n.current=i}var re=O(null),ue=O(null),he=O(null),de=O(null);function Me(n,i){switch(ie(he,i),ie(ue,n),ie(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?cv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=cv(i),n=uv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}F(re),ie(re,n)}function ge(){F(re),F(ue),F(he)}function Ze(n){n.memoizedState!==null&&ie(de,n);var i=re.current,l=uv(i,n.type);i!==l&&(ie(ue,n),ie(re,l))}function it(n){ue.current===n&&(F(re),F(ue)),de.current===n&&(F(de),To._currentValue=oe)}var me,We;function dt(n){if(me===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);me=i&&i[1]||"",We=-1<l.stack.indexOf(`
|
|
1
|
+
function pk(e,t){for(var s=0;s<t.length;s++){const a=t[s];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const c=Object.getOwnPropertyDescriptor(a,r);c&&Object.defineProperty(e,r,c.get?c:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&a(d)}).observe(document,{childList:!0,subtree:!0});function s(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(r){if(r.ep)return;r.ep=!0;const c=s(r);fetch(r.href,c)}})();function Yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var xh={exports:{}},Lo={};var Bv;function gk(){if(Bv)return Lo;Bv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var f in r)f!=="key"&&(c[f]=r[f])}else c=r;return r=c.ref,{$$typeof:e,type:a,key:d,ref:r!==void 0?r:null,props:c}}return Lo.Fragment=t,Lo.jsx=s,Lo.jsxs=s,Lo}var qv;function yk(){return qv||(qv=1,xh.exports=gk()),xh.exports}var o=yk(),bh={exports:{}},Ee={};var Hv;function vk(){if(Hv)return Ee;Hv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function b(O){return O===null||typeof O!="object"?null:(O=x&&O[x]||O["@@iterator"],typeof O=="function"?O:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(O,F,ie){this.props=O,this.context=F,this.refs=C,this.updater=ie||w}k.prototype.isReactComponent={},k.prototype.setState=function(O,F){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,F,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=k.prototype;function R(O,F,ie){this.props=O,this.context=F,this.refs=C,this.updater=ie||w}var _=R.prototype=new E;_.constructor=R,S(_,k.prototype),_.isPureReactComponent=!0;var L=Array.isArray;function M(){}var T={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function P(O,F,ie){var re=ie.ref;return{$$typeof:e,type:O,key:F,ref:re!==void 0?re:null,props:ie}}function J(O,F){return P(O.type,F,O.props)}function Q(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function se(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ie){return F[ie]})}var pe=/\/+/g;function ke(O,F){return typeof O=="object"&&O!==null&&O.key!=null?se(""+O.key):F.toString(36)}function je(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(M,M):(O.status="pending",O.then(function(F){O.status==="pending"&&(O.status="fulfilled",O.value=F)},function(F){O.status==="pending"&&(O.status="rejected",O.reason=F)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function B(O,F,ie,re,ue){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var de=!1;if(O===null)de=!0;else switch(he){case"bigint":case"string":case"number":de=!0;break;case"object":switch(O.$$typeof){case e:case t:de=!0;break;case v:return de=O._init,B(de(O._payload),F,ie,re,ue)}}if(de)return ue=ue(O),de=re===""?"."+ke(O,0):re,L(ue)?(ie="",de!=null&&(ie=de.replace(pe,"$&/")+"/"),B(ue,F,ie,"",function(Ze){return Ze})):ue!=null&&(Q(ue)&&(ue=J(ue,ie+(ue.key==null||O&&O.key===ue.key?"":(""+ue.key).replace(pe,"$&/")+"/")+de)),F.push(ue)),1;de=0;var Me=re===""?".":re+":";if(L(O))for(var ge=0;ge<O.length;ge++)re=O[ge],he=Me+ke(re,ge),de+=B(re,F,ie,he,ue);else if(ge=b(O),typeof ge=="function")for(O=ge.call(O),ge=0;!(re=O.next()).done;)re=re.value,he=Me+ke(re,ge++),de+=B(re,F,ie,he,ue);else if(he==="object"){if(typeof O.then=="function")return B(je(O),F,ie,re,ue);throw F=String(O),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(O,F,ie){if(O==null)return O;var re=[],ue=0;return B(O,re,"","",function(he){return F.call(ie,he,ue++)}),re}function oe(O){if(O._status===-1){var F=O._result;F=F(),F.then(function(ie){(O._status===0||O._status===-1)&&(O._status=1,O._result=ie)},function(ie){(O._status===0||O._status===-1)&&(O._status=2,O._result=ie)}),O._status===-1&&(O._status=0,O._result=F)}if(O._status===1)return O._result.default;throw O._result}var q=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},X={map:G,forEach:function(O,F,ie){G(O,function(){F.apply(this,arguments)},ie)},count:function(O){var F=0;return G(O,function(){F++}),F},toArray:function(O){return G(O,function(F){return F})||[]},only:function(O){if(!Q(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ee.Activity=y,Ee.Children=X,Ee.Component=k,Ee.Fragment=s,Ee.Profiler=r,Ee.PureComponent=R,Ee.StrictMode=a,Ee.Suspense=m,Ee.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ee.__COMPILER_RUNTIME={__proto__:null,c:function(O){return T.H.useMemoCache(O)}},Ee.cache=function(O){return function(){return O.apply(null,arguments)}},Ee.cacheSignal=function(){return null},Ee.cloneElement=function(O,F,ie){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var re=S({},O.props),ue=O.key;if(F!=null)for(he in F.key!==void 0&&(ue=""+F.key),F)!A.call(F,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&F.ref===void 0||(re[he]=F[he]);var he=arguments.length-2;if(he===1)re.children=ie;else if(1<he){for(var de=Array(he),Me=0;Me<he;Me++)de[Me]=arguments[Me+2];re.children=de}return P(O.type,ue,re)},Ee.createContext=function(O){return O={$$typeof:d,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},Ee.createElement=function(O,F,ie){var re,ue={},he=null;if(F!=null)for(re in F.key!==void 0&&(he=""+F.key),F)A.call(F,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(ue[re]=F[re]);var de=arguments.length-2;if(de===1)ue.children=ie;else if(1<de){for(var Me=Array(de),ge=0;ge<de;ge++)Me[ge]=arguments[ge+2];ue.children=Me}if(O&&O.defaultProps)for(re in de=O.defaultProps,de)ue[re]===void 0&&(ue[re]=de[re]);return P(O,he,ue)},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(O){return{$$typeof:f,render:O}},Ee.isValidElement=Q,Ee.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:oe}},Ee.memo=function(O,F){return{$$typeof:p,type:O,compare:F===void 0?null:F}},Ee.startTransition=function(O){var F=T.T,ie={};T.T=ie;try{var re=O(),ue=T.S;ue!==null&&ue(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(M,q)}catch(he){q(he)}finally{F!==null&&ie.types!==null&&(F.types=ie.types),T.T=F}},Ee.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ee.use=function(O){return T.H.use(O)},Ee.useActionState=function(O,F,ie){return T.H.useActionState(O,F,ie)},Ee.useCallback=function(O,F){return T.H.useCallback(O,F)},Ee.useContext=function(O){return T.H.useContext(O)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(O,F){return T.H.useDeferredValue(O,F)},Ee.useEffect=function(O,F){return T.H.useEffect(O,F)},Ee.useEffectEvent=function(O){return T.H.useEffectEvent(O)},Ee.useId=function(){return T.H.useId()},Ee.useImperativeHandle=function(O,F,ie){return T.H.useImperativeHandle(O,F,ie)},Ee.useInsertionEffect=function(O,F){return T.H.useInsertionEffect(O,F)},Ee.useLayoutEffect=function(O,F){return T.H.useLayoutEffect(O,F)},Ee.useMemo=function(O,F){return T.H.useMemo(O,F)},Ee.useOptimistic=function(O,F){return T.H.useOptimistic(O,F)},Ee.useReducer=function(O,F,ie){return T.H.useReducer(O,F,ie)},Ee.useRef=function(O){return T.H.useRef(O)},Ee.useState=function(O){return T.H.useState(O)},Ee.useSyncExternalStore=function(O,F,ie){return T.H.useSyncExternalStore(O,F,ie)},Ee.useTransition=function(){return T.H.useTransition()},Ee.version="19.2.4",Ee}var Gv;function ol(){return Gv||(Gv=1,bh.exports=vk()),bh.exports}var N=ol();const is=Yb(N),Km=pk({__proto__:null,default:is},[N]);var Sh={exports:{}},Mo={},jh={exports:{}},wh={};var Kv;function xk(){return Kv||(Kv=1,(function(e){function t(B,G){var oe=B.length;B.push(G);e:for(;0<oe;){var q=oe-1>>>1,X=B[q];if(0<r(X,G))B[q]=G,B[oe]=X,oe=q;else break e}}function s(B){return B.length===0?null:B[0]}function a(B){if(B.length===0)return null;var G=B[0],oe=B.pop();if(oe!==G){B[0]=oe;e:for(var q=0,X=B.length,O=X>>>1;q<O;){var F=2*(q+1)-1,ie=B[F],re=F+1,ue=B[re];if(0>r(ie,oe))re<X&&0>r(ue,ie)?(B[q]=ue,B[re]=oe,q=re):(B[q]=ie,B[F]=oe,q=F);else if(re<X&&0>r(ue,oe))B[q]=ue,B[re]=oe,q=re;else break e}}return G}function r(B,G){var oe=B.sortIndex-G.sortIndex;return oe!==0?oe:B.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],p=[],v=1,y=null,x=3,b=!1,w=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function _(B){for(var G=s(p);G!==null;){if(G.callback===null)a(p);else if(G.startTime<=B)a(p),G.sortIndex=G.expirationTime,t(m,G);else break;G=s(p)}}function L(B){if(S=!1,_(B),!w)if(s(m)!==null)w=!0,M||(M=!0,se());else{var G=s(p);G!==null&&je(L,G.startTime-B)}}var M=!1,T=-1,A=5,P=-1;function J(){return C?!0:!(e.unstable_now()-P<A)}function Q(){if(C=!1,M){var B=e.unstable_now();P=B;var G=!0;try{e:{w=!1,S&&(S=!1,E(T),T=-1),b=!0;var oe=x;try{t:{for(_(B),y=s(m);y!==null&&!(y.expirationTime>B&&J());){var q=y.callback;if(typeof q=="function"){y.callback=null,x=y.priorityLevel;var X=q(y.expirationTime<=B);if(B=e.unstable_now(),typeof X=="function"){y.callback=X,_(B),G=!0;break t}y===s(m)&&a(m),_(B)}else a(m);y=s(m)}if(y!==null)G=!0;else{var O=s(p);O!==null&&je(L,O.startTime-B),G=!1}}break e}finally{y=null,x=oe,b=!1}G=void 0}}finally{G?se():M=!1}}}var se;if(typeof R=="function")se=function(){R(Q)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ke=pe.port2;pe.port1.onmessage=Q,se=function(){ke.postMessage(null)}}else se=function(){k(Q,0)};function je(B,G){T=k(function(){B(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(B){switch(x){case 1:case 2:case 3:var G=3;break;default:G=x}var oe=x;x=G;try{return B()}finally{x=oe}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var oe=x;x=B;try{return G()}finally{x=oe}},e.unstable_scheduleCallback=function(B,G,oe){var q=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?q+oe:q):oe=q,B){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=oe+X,B={id:v++,callback:G,priorityLevel:B,startTime:oe,expirationTime:X,sortIndex:-1},oe>q?(B.sortIndex=oe,t(p,B),s(m)===null&&B===s(p)&&(S?(E(T),T=-1):S=!0,je(L,oe-q))):(B.sortIndex=X,t(m,B),w||b||(w=!0,M||(M=!0,se()))),B},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(B){var G=x;return function(){var oe=x;x=G;try{return B.apply(this,arguments)}finally{x=oe}}}})(wh)),wh}var Fv;function bk(){return Fv||(Fv=1,jh.exports=xk()),jh.exports}var Nh={exports:{}},tn={};var Zv;function Sk(){if(Zv)return tn;Zv=1;var e=ol();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function c(m,p,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:m,containerInfo:p,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(m,p,null,v)},tn.flushSync=function(m){var p=d.T,v=a.p;try{if(d.T=null,a.p=2,m)return m()}finally{d.T=p,a.p=v,a.d.f()}},tn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},tn.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},tn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:b}):v==="script"&&a.d.X(m,{crossOrigin:y,integrity:x,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},tn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=f(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},tn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin);a.d.L(m,v,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},tn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=f(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},tn.requestFormReset=function(m){a.d.r(m)},tn.unstable_batchedUpdates=function(m,p){return m(p)},tn.useFormState=function(m,p,v){return d.H.useFormState(m,p,v)},tn.useFormStatus=function(){return d.H.useHostTransitionStatus()},tn.version="19.2.4",tn}var Vv;function Jb(){if(Vv)return Nh.exports;Vv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Nh.exports=Sk(),Nh.exports}var Qv;function jk(){if(Qv)return Mo;Qv=1;var e=bk(),t=ol(),s=Jb();function a(n){var i="https://react.dev/errors/"+n;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function d(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function f(n){if(n.tag===31){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function m(n){if(c(n)!==n)throw Error(a(188))}function p(n){var i=n.alternate;if(!i){if(i=c(n),i===null)throw Error(a(188));return i!==n?null:n}for(var l=n,u=i;;){var h=l.return;if(h===null)break;var g=h.alternate;if(g===null){if(u=h.return,u!==null){l=u;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===l)return m(h),n;if(g===u)return m(h),i;g=g.sibling}throw Error(a(188))}if(l.return!==u.return)l=h,u=g;else{for(var j=!1,z=h.child;z;){if(z===l){j=!0,l=h,u=g;break}if(z===u){j=!0,u=h,l=g;break}z=z.sibling}if(!j){for(z=g.child;z;){if(z===l){j=!0,l=g,u=h;break}if(z===u){j=!0,u=g,l=h;break}z=z.sibling}if(!j)throw Error(a(189))}}if(l.alternate!==u)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?n:i}function v(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n;for(n=n.child;n!==null;){if(i=v(n),i!==null)return i;n=n.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function se(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function ke(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case L:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case w:return"Portal";case R:return n.displayName||"Context";case E:return(n._context.displayName||"Context")+".Consumer";case _:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case T:return i=n.displayName||null,i!==null?i:ke(n.type)||"Memo";case A:i=n._payload,n=n._init;try{return ke(n(i))}catch{}}return null}var je=Array.isArray,B=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},q=[],X=-1;function O(n){return{current:n}}function F(n){0>X||(n.current=q[X],q[X]=null,X--)}function ie(n,i){X++,q[X]=n.current,n.current=i}var re=O(null),ue=O(null),he=O(null),de=O(null);function Me(n,i){switch(ie(he,i),ie(ue,n),ie(re,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?uv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=uv(i),n=dv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}F(re),ie(re,n)}function ge(){F(re),F(ue),F(he)}function Ze(n){n.memoizedState!==null&&ie(de,n);var i=re.current,l=dv(i,n.type);i!==l&&(ie(ue,n),ie(re,l))}function it(n){ue.current===n&&(F(re),F(ue)),de.current===n&&(F(de),To._currentValue=oe)}var me,We;function dt(n){if(me===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);me=i&&i[1]||"",We=-1<l.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+me+n+We}var sn=!1;function kt(n,i){if(!n||sn)return"";sn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Y){var V=Y}Reflect.construct(n,[],ne)}else{try{ne.call()}catch(Y){V=Y}n.call(ne.prototype)}}else{try{throw Error()}catch(Y){V=Y}(ne=n())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Y){if(Y&&V&&typeof Y.stack=="string")return[Y.stack,V.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),j=g[0],z=g[1];if(j&&z){var
|
|
3
|
+
`+me+n+We}var sn=!1;function kt(n,i){if(!n||sn)return"";sn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(i){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Y){var V=Y}Reflect.construct(n,[],ne)}else{try{ne.call()}catch(Y){V=Y}n.call(ne.prototype)}}else{try{throw Error()}catch(Y){V=Y}(ne=n())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Y){if(Y&&V&&typeof Y.stack=="string")return[Y.stack,V.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),j=g[0],z=g[1];if(j&&z){var D=j.split(`
|
|
4
4
|
`),K=z.split(`
|
|
5
|
-
`);for(h=u=0;u<
|
|
6
|
-
`+
|
|
5
|
+
`);for(h=u=0;u<D.length&&!D[u].includes("DetermineComponentFrameRoot");)u++;for(;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;if(u===D.length||h===K.length)for(u=D.length-1,h=K.length-1;1<=u&&0<=h&&D[u]!==K[h];)h--;for(;1<=u&&0<=h;u--,h--)if(D[u]!==K[h]){if(u!==1||h!==1)do if(u--,h--,0>h||D[u]!==K[h]){var W=`
|
|
6
|
+
`+D[u].replace(" at new "," at ");return n.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",n.displayName)),W}while(1<=u&&0<=h);break}}}finally{sn=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?dt(l):""}function an(n,i){switch(n.tag){case 26:case 27:case 5:return dt(n.type);case 16:return dt("Lazy");case 13:return n.child!==i&&i!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return kt(n.type,!1);case 11:return kt(n.type.render,!1);case 1:return kt(n.type,!0);case 31:return dt("Activity");default:return""}}function Vt(n){try{var i="",l=null;do i+=an(n,l),l=n,n=n.return;while(n);return i}catch(u){return`
|
|
7
7
|
Error generating stack: `+u.message+`
|
|
8
|
-
`+u.stack}}var _t=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,le=e.unstable_shouldYield,Ie=e.unstable_requestPaint,Be=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,$e=e.unstable_ImmediatePriority,pt=e.unstable_UserBlockingPriority,rn=e.unstable_NormalPriority,js=e.unstable_LowPriority,Vs=e.unstable_IdlePriority,ws=e.log,Qs=e.unstable_setDisableYieldValue,ls=null,_e=null;function Ht(n){if(typeof ws=="function"&&Qs(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(ls,n)}catch{}}var Ve=Math.clz32?Math.clz32:gl,ae=Math.log,Jn=Math.LN2;function gl(n){return n>>>=0,n===0?32:31-(ae(n)/Jn|0)|0}var Ys=256,Ns=262144,Ki=4194304;function cs(n){var i=n&42;if(i!==0)return i;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Aa(n,i,l){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var z=u&134217727;return z!==0?(u=z&~g,u!==0?h=cs(u):(j&=z,j!==0?h=cs(j):l||(l=z&~n,l!==0&&(h=cs(l))))):(z=u&~g,z!==0?h=cs(z):j!==0?h=cs(j):l||(l=u&~n,l!==0&&(h=cs(l)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,l=i&-i,g>=l||g===32&&(l&4194048)!==0)?i:h}function us(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function yl(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vl(){var n=Ki;return Ki<<=1,(Ki&62914560)===0&&(Ki=4194304),n}function Oa(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Fi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function cd(n,i,l,u,h,g){var j=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var z=n.entanglements,L=n.expirationTimes,K=n.hiddenUpdates;for(l=j&~l;0<l;){var W=31-Ve(l),ne=1<<W;z[W]=0,L[W]=-1;var V=K[W];if(V!==null)for(K[W]=null,W=0;W<V.length;W++){var Y=V[W];Y!==null&&(Y.lane&=-536870913)}l&=~ne}u!==0&&xl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~i))}function xl(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-Ve(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|l&261930}function bl(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var u=31-Ve(l),h=1<<u;h&i|n[u]&i&&(n[u]|=i),l&=~h}}function Kr(n,i){var l=i&-i;return l=(l&42)!==0?1:U(l),(l&(n.suspendedLanes|i))!==0?0:l}function U(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function fe(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function at(){var n=G.p;return n!==0?n:(n=window.event,n===void 0?32:Ov(n.type))}function Qt(n,i){var l=G.p;try{return G.p=n,i()}finally{G.p=l}}var Dt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Dt,wt="__reactProps$"+Dt,Cn="__reactContainer$"+Dt,en="__reactEvents$"+Dt,ud="__reactListeners$"+Dt,Js="__reactHandles$"+Dt,Xs="__reactResources$"+Dt,ds="__reactMarker$"+Dt;function La(n){delete n[Et],delete n[wt],delete n[en],delete n[ud],delete n[Js]}function Ws(n){var i=n[Et];if(i)return i;for(var l=n.parentNode;l;){if(i=l[Cn]||l[Et]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=yv(n);n!==null;){if(l=n[Et])return l;n=yv(n)}return i}n=l,l=n.parentNode}return null}function Xn(n){if(n=n[Et]||n[Cn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function fs(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function ei(n){var i=n[Xs];return i||(i=n[Xs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Mt(n){n[ds]=!0}var qe=new Set,rt={};function Gt(n,i){on(n,i),on(n+"Capture",i)}function on(n,i){for(rt[n]=i,n=0;n<i.length;n++)qe.add(i[n])}var Da=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Fr={},eg={};function o1(n){return _t.call(eg,n)?!0:_t.call(Fr,n)?!1:Da.test(n)?eg[n]=!0:(Fr[n]=!0,!1)}function Sl(n,i,l){if(o1(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function jl(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function Cs(n,i,l,u){if(u===null)n.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+u)}}function On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function tg(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function l1(n,i,l){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,g=u.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(j){l=""+j,g.call(this,j)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function dd(n){if(!n._valueTracker){var i=tg(n)?"checked":"value";n._valueTracker=l1(n,i,""+n[i])}}function ng(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),u="";return n&&(u=tg(n)?n.checked?"true":"false":n.value),n=u,n!==l?(i.setValue(n),!0):!1}function wl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var c1=/[\n"\\]/g;function Ln(n){return n.replace(c1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function fd(n,i,l,u,h,g,j,z){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),i!=null?j==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+On(i)):n.value!==""+On(i)&&(n.value=""+On(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?hd(n,j,On(i)):l!=null?hd(n,j,On(l)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?n.name=""+On(z):n.removeAttribute("name")}function sg(n,i,l,u,h,g,j,z){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){dd(n);return}l=l!=null?""+On(l):"",i=i!=null?""+On(i):l,z||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=z?n.checked:!!u,n.defaultChecked=!!u,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),dd(n)}function hd(n,i,l){i==="number"&&wl(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function Ma(n,i,l,u){if(n=n.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<n.length;l++)h=i.hasOwnProperty("$"+n[l].value),n[l].selected!==h&&(n[l].selected=h),h&&u&&(n[l].defaultSelected=!0)}else{for(l=""+On(l),i=null,h=0;h<n.length;h++){if(n[h].value===l){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function ig(n,i,l){if(i!=null&&(i=""+On(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+On(l):""}function ag(n,i,l,u){if(i==null){if(u!=null){if(l!=null)throw Error(a(92));if(je(u)){if(1<u.length)throw Error(a(93));u=u[0]}l=u}l==null&&(l=""),i=l}l=On(i),n.defaultValue=l,u=n.textContent,u===l&&u!==""&&u!==null&&(n.value=u),dd(n)}function $a(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var u1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function rg(n,i,l){var u=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":u?n.setProperty(i,l):typeof l!="number"||l===0||u1.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function og(n,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var h in i)u=i[h],i.hasOwnProperty(h)&&l[h]!==u&&rg(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&rg(n,g,i[g])}function md(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var d1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),f1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Nl(n){return f1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ks(){}var pd=null;function gd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ua=null,Pa=null;function lg(n){var i=Xn(n);if(i&&(n=i.stateNode)){var l=n[wt]||null;e:switch(n=i.stateNode,i.type){case"input":if(fd(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Ln(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var u=l[i];if(u!==n&&u.form===n.form){var h=u[wt]||null;if(!h)throw Error(a(90));fd(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)u=l[i],u.form===n.form&&ng(u)}break e;case"textarea":ig(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ma(n,!!l.multiple,i,!1)}}}var yd=!1;function cg(n,i,l){if(yd)return n(i,l);yd=!0;try{var u=n(i);return u}finally{if(yd=!1,(Ua!==null||Pa!==null)&&(dc(),Ua&&(i=Ua,n=Pa,Pa=Ua=null,lg(i),n)))for(i=0;i<n.length;i++)lg(n[i])}}function Zr(n,i){var l=n.stateNode;if(l===null)return null;var u=l[wt]||null;if(u===null)return null;l=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var _s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vd=!1;if(_s)try{var Vr={};Object.defineProperty(Vr,"passive",{get:function(){vd=!0}}),window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{vd=!1}var ti=null,xd=null,Cl=null;function ug(){if(Cl)return Cl;var n,i=xd,l=i.length,u,h="value"in ti?ti.value:ti.textContent,g=h.length;for(n=0;n<l&&i[n]===h[n];n++);var j=l-n;for(u=1;u<=j&&i[l-u]===h[g-u];u++);return Cl=h.slice(n,1<u?1-u:void 0)}function kl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function _l(){return!0}function dg(){return!1}function pn(n){function i(l,u,h,g,j){this._reactName=l,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var z in n)n.hasOwnProperty(z)&&(l=n[z],this[z]=l?l(g):g[z]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?_l:dg,this.isPropagationStopped=dg,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=_l)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=_l)},persist:function(){},isPersistent:_l}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zl=pn(Zi),Qr=y({},Zi,{view:0,detail:0}),h1=pn(Qr),bd,Sd,Yr,El=y({},Qr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Yr&&(Yr&&n.type==="mousemove"?(bd=n.screenX-Yr.screenX,Sd=n.screenY-Yr.screenY):Sd=bd=0,Yr=n),bd)},movementY:function(n){return"movementY"in n?n.movementY:Sd}}),fg=pn(El),m1=y({},El,{dataTransfer:0}),p1=pn(m1),g1=y({},Qr,{relatedTarget:0}),jd=pn(g1),y1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),v1=pn(y1),x1=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),b1=pn(x1),S1=y({},Zi,{data:0}),hg=pn(S1),j1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},N1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=N1[n])?!!i[n]:!1}function wd(){return C1}var k1=y({},Qr,{key:function(n){if(n.key){var i=j1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=kl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?w1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wd,charCode:function(n){return n.type==="keypress"?kl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?kl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),_1=pn(k1),z1=y({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mg=pn(z1),E1=y({},Qr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wd}),R1=pn(E1),T1=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),A1=pn(T1),O1=y({},El,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),L1=pn(O1),D1=y({},Zi,{newState:0,oldState:0}),M1=pn(D1),$1=[9,13,27,32],Nd=_s&&"CompositionEvent"in window,Jr=null;_s&&"documentMode"in document&&(Jr=document.documentMode);var U1=_s&&"TextEvent"in window&&!Jr,pg=_s&&(!Nd||Jr&&8<Jr&&11>=Jr),gg=" ",yg=!1;function vg(n,i){switch(n){case"keyup":return $1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ia=!1;function P1(n,i){switch(n){case"compositionend":return xg(i);case"keypress":return i.which!==32?null:(yg=!0,gg);case"textInput":return n=i.data,n===gg&&yg?null:n;default:return null}}function I1(n,i){if(Ia)return n==="compositionend"||!Nd&&vg(n,i)?(n=ug(),Cl=xd=ti=null,Ia=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return pg&&i.locale!=="ko"?null:i.data;default:return null}}var B1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function bg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!B1[n.type]:i==="textarea"}function Sg(n,i,l,u){Ua?Pa?Pa.push(u):Pa=[u]:Ua=u,i=vc(i,"onChange"),0<i.length&&(l=new zl("onChange","change",null,l,u),n.push({event:l,listeners:i}))}var Xr=null,Wr=null;function q1(n){sv(n,0)}function Rl(n){var i=fs(n);if(ng(i))return n}function jg(n,i){if(n==="change")return i}var wg=!1;if(_s){var Cd;if(_s){var kd="oninput"in document;if(!kd){var Ng=document.createElement("div");Ng.setAttribute("oninput","return;"),kd=typeof Ng.oninput=="function"}Cd=kd}else Cd=!1;wg=Cd&&(!document.documentMode||9<document.documentMode)}function Cg(){Xr&&(Xr.detachEvent("onpropertychange",kg),Wr=Xr=null)}function kg(n){if(n.propertyName==="value"&&Rl(Wr)){var i=[];Sg(i,Wr,n,gd(n)),cg(q1,i)}}function H1(n,i,l){n==="focusin"?(Cg(),Xr=i,Wr=l,Xr.attachEvent("onpropertychange",kg)):n==="focusout"&&Cg()}function G1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Rl(Wr)}function K1(n,i){if(n==="click")return Rl(i)}function F1(n,i){if(n==="input"||n==="change")return Rl(i)}function Z1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var kn=typeof Object.is=="function"?Object.is:Z1;function eo(n,i){if(kn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),u=Object.keys(i);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var h=l[u];if(!_t.call(i,h)||!kn(n[h],i[h]))return!1}return!0}function _g(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function zg(n,i){var l=_g(n);n=0;for(var u;l;){if(l.nodeType===3){if(u=n+l.textContent.length,n<=i&&u>=i)return{node:l,offset:i-n};n=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=_g(l)}}function Eg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Eg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Rg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=wl(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=wl(n.document)}return i}function _d(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var V1=_s&&"documentMode"in document&&11>=document.documentMode,Ba=null,zd=null,to=null,Ed=!1;function Tg(n,i,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ed||Ba==null||Ba!==wl(u)||(u=Ba,"selectionStart"in u&&_d(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),to&&eo(to,u)||(to=u,u=vc(zd,"onSelect"),0<u.length&&(i=new zl("onSelect","select",null,i,l),n.push({event:i,listeners:u}),i.target=Ba)))}function Vi(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var qa={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},Rd={},Ag={};_s&&(Ag=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function Qi(n){if(Rd[n])return Rd[n];if(!qa[n])return n;var i=qa[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Ag)return Rd[n]=i[l];return n}var Og=Qi("animationend"),Lg=Qi("animationiteration"),Dg=Qi("animationstart"),Q1=Qi("transitionrun"),Y1=Qi("transitionstart"),J1=Qi("transitioncancel"),Mg=Qi("transitionend"),$g=new Map,Td="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Td.push("scrollEnd");function Wn(n,i){$g.set(n,i),Gt(i,[n])}var Tl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Dn=[],Ha=0,Ad=0;function Al(){for(var n=Ha,i=Ad=Ha=0;i<n;){var l=Dn[i];Dn[i++]=null;var u=Dn[i];Dn[i++]=null;var h=Dn[i];Dn[i++]=null;var g=Dn[i];if(Dn[i++]=null,u!==null&&h!==null){var j=u.pending;j===null?h.next=h:(h.next=j.next,j.next=h),u.pending=h}g!==0&&Ug(l,h,g)}}function Ol(n,i,l,u){Dn[Ha++]=n,Dn[Ha++]=i,Dn[Ha++]=l,Dn[Ha++]=u,Ad|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Od(n,i,l,u){return Ol(n,i,l,u),Ll(n)}function Yi(n,i){return Ol(n,null,null,i),Ll(n)}function Ug(n,i,l){n.lanes|=l;var u=n.alternate;u!==null&&(u.lanes|=l);for(var h=!1,g=n.return;g!==null;)g.childLanes|=l,u=g.alternate,u!==null&&(u.childLanes|=l),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-Ve(l),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=l|536870912),g):null}function Ll(n){if(50<No)throw No=0,Hf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ga={};function X1(n,i,l,u){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(n,i,l,u){return new X1(n,i,l,u)}function Ld(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zs(n,i){var l=n.alternate;return l===null?(l=_n(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function Pg(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Dl(n,i,l,u,h,g){var j=0;if(u=n,typeof n=="function")Ld(n)&&(j=1);else if(typeof n=="string")j=sk(n,l,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=_n(31,l,i,h),n.elementType=P,n.lanes=g,n;case S:return Ji(l.children,h,g,i);case C:j=8,h|=24;break;case k:return n=_n(12,l,i,h|2),n.elementType=k,n.lanes=g,n;case D:return n=_n(13,l,i,h),n.elementType=D,n.lanes=g,n;case M:return n=_n(19,l,i,h),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:j=10;break e;case E:j=9;break e;case _:j=11;break e;case T:j=14;break e;case A:j=16,u=null;break e}j=29,l=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=_n(j,l,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Ji(n,i,l,u){return n=_n(7,n,u,i),n.lanes=l,n}function Dd(n,i,l){return n=_n(6,n,null,i),n.lanes=l,n}function Ig(n){var i=_n(18,null,null,0);return i.stateNode=n,i}function Md(n,i,l){return i=_n(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Bg=new WeakMap;function Mn(n,i){if(typeof n=="object"&&n!==null){var l=Bg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:Vt(i)},Bg.set(n,i),i)}return{value:n,source:i,stack:Vt(i)}}var Ka=[],Fa=0,Ml=null,no=0,$n=[],Un=0,ni=null,hs=1,ms="";function Es(n,i){Ka[Fa++]=no,Ka[Fa++]=Ml,Ml=n,no=i}function qg(n,i,l){$n[Un++]=hs,$n[Un++]=ms,$n[Un++]=ni,ni=n;var u=hs;n=ms;var h=32-Ve(u)-1;u&=~(1<<h),l+=1;var g=32-Ve(i)+h;if(30<g){var j=h-h%5;g=(u&(1<<j)-1).toString(32),u>>=j,h-=j,hs=1<<32-Ve(i)+h|l<<h|u,ms=g+n}else hs=1<<g|l<<h|u,ms=n}function $d(n){n.return!==null&&(Es(n,1),qg(n,1,0))}function Ud(n){for(;n===Ml;)Ml=Ka[--Fa],Ka[Fa]=null,no=Ka[--Fa],Ka[Fa]=null;for(;n===ni;)ni=$n[--Un],$n[Un]=null,ms=$n[--Un],$n[Un]=null,hs=$n[--Un],$n[Un]=null}function Hg(n,i){$n[Un++]=hs,$n[Un++]=ms,$n[Un++]=ni,hs=i.id,ms=i.overflow,ni=n}var Yt=null,ht=null,Ke=!1,si=null,Pn=!1,Pd=Error(a(519));function ii(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(Mn(i,n)),Pd}function Gg(n){var i=n.stateNode,l=n.type,u=n.memoizedProps;switch(i[Et]=n,i[wt]=u,l){case"dialog":Pe("cancel",i),Pe("close",i);break;case"iframe":case"object":case"embed":Pe("load",i);break;case"video":case"audio":for(l=0;l<ko.length;l++)Pe(ko[l],i);break;case"source":Pe("error",i);break;case"img":case"image":case"link":Pe("error",i),Pe("load",i);break;case"details":Pe("toggle",i);break;case"input":Pe("invalid",i),sg(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Pe("invalid",i);break;case"textarea":Pe("invalid",i),ag(i,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||u.suppressHydrationWarning===!0||ov(i.textContent,l)?(u.popover!=null&&(Pe("beforetoggle",i),Pe("toggle",i)),u.onScroll!=null&&Pe("scroll",i),u.onScrollEnd!=null&&Pe("scrollend",i),u.onClick!=null&&(i.onclick=ks),i=!0):i=!1,i||ii(n,!0)}function Kg(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Yt=Yt.return}}function Za(n){if(n!==Yt)return!1;if(!Ke)return Kg(n),Ke=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||ih(n.type,n.memoizedProps)),l=!l),l&&ht&&ii(n),Kg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=gv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=gv(n)}else i===27?(i=ht,vi(n.type)?(n=ch,ch=null,ht=n):ht=i):ht=Yt?Bn(n.stateNode.nextSibling):null;return!0}function Xi(){ht=Yt=null,Ke=!1}function Id(){var n=si;return n!==null&&(xn===null?xn=n:xn.push.apply(xn,n),si=null),n}function so(n){si===null?si=[n]:si.push(n)}var Bd=O(null),Wi=null,Rs=null;function ai(n,i,l){ie(Bd,i._currentValue),i._currentValue=l}function Ts(n){n._currentValue=Bd.current,F(Bd)}function qd(n,i,l){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===l)break;n=n.return}}function Hd(n,i,l,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var z=g;g=h;for(var L=0;L<i.length;L++)if(z.context===i[L]){g.lanes|=l,z=g.alternate,z!==null&&(z.lanes|=l),qd(g.return,l,n),u||(j=null);break e}g=z.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(a(341));j.lanes|=l,g=j.alternate,g!==null&&(g.lanes|=l),qd(j,l,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function Va(n,i,l,u){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var z=h.type;kn(h.pendingProps.value,j.value)||(n!==null?n.push(z):n=[z])}}else if(h===de.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(To):n=[To])}h=h.return}n!==null&&Hd(i,n,l,u),i.flags|=262144}function $l(n){for(n=n.firstContext;n!==null;){if(!kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ea(n){Wi=n,Rs=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return Fg(Wi,n)}function Ul(n,i){return Wi===null&&ea(n),Fg(n,i)}function Fg(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Rs===null){if(n===null)throw Error(a(308));Rs=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Rs=Rs.next=i;return l}var W1=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,u){n.push(u)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},eC=e.unstable_scheduleCallback,tC=e.unstable_NormalPriority,$t={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gd(){return{controller:new W1,data:new Map,refCount:0}}function io(n){n.refCount--,n.refCount===0&&eC(tC,function(){n.controller.abort()})}var ao=null,Kd=0,Qa=0,Ya=null;function nC(n,i){if(ao===null){var l=ao=[];Kd=0,Qa=Qf(),Ya={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Kd++,i.then(Zg,Zg),i}function Zg(){if(--Kd===0&&ao!==null){Ya!==null&&(Ya.status="fulfilled");var n=ao;ao=null,Qa=0,Ya=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function sC(n,i){var l=[],u={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return n.then(function(){u.status="fulfilled",u.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(u.status="rejected",u.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),u}var Vg=B.S;B.S=function(n,i){T0=Be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&nC(n,i),Vg!==null&&Vg(n,i)};var ta=O(null);function Fd(){var n=ta.current;return n!==null?n:ut.pooledCache}function Pl(n,i){i===null?ie(ta,ta.current):ie(ta,i.pool)}function Qg(){var n=Fd();return n===null?null:{parent:$t._currentValue,pool:n}}var Ja=Error(a(460)),Zd=Error(a(474)),Il=Error(a(542)),Bl={then:function(){}};function Yg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Jg(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(ks,ks),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n;default:if(typeof i.status=="string")i.then(ks,ks);else{if(n=ut,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(u){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=u}},function(u){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,Wg(n),n}throw sa=i,Ja}}function na(n){try{var i=n._init;return i(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(sa=l,Ja):l}}var sa=null;function Xg(){if(sa===null)throw Error(a(459));var n=sa;return sa=null,n}function Wg(n){if(n===Ja||n===Il)throw Error(a(483))}var Xa=null,ro=0;function ql(n){var i=ro;return ro+=1,Xa===null&&(Xa=[]),Jg(Xa,n,i)}function oo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Hl(n,i){throw i.$$typeof===x?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ey(n){function i(I,$){if(n){var H=I.deletions;H===null?(I.deletions=[$],I.flags|=16):H.push($)}}function l(I,$){if(!n)return null;for(;$!==null;)i(I,$),$=$.sibling;return null}function u(I){for(var $=new Map;I!==null;)I.key!==null?$.set(I.key,I):$.set(I.index,I),I=I.sibling;return $}function h(I,$){return I=zs(I,$),I.index=0,I.sibling=null,I}function g(I,$,H){return I.index=H,n?(H=I.alternate,H!==null?(H=H.index,H<$?(I.flags|=67108866,$):H):(I.flags|=67108866,$)):(I.flags|=1048576,$)}function j(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function z(I,$,H,ee){return $===null||$.tag!==6?($=Dd(H,I.mode,ee),$.return=I,$):($=h($,H),$.return=I,$)}function L(I,$,H,ee){var Ne=H.type;return Ne===S?W(I,$,H.props.children,ee,H.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&na(Ne)===$.type)?($=h($,H.props),oo($,H),$.return=I,$):($=Dl(H.type,H.key,H.props,null,I.mode,ee),oo($,H),$.return=I,$)}function K(I,$,H,ee){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=Md(H,I.mode,ee),$.return=I,$):($=h($,H.children||[]),$.return=I,$)}function W(I,$,H,ee,Ne){return $===null||$.tag!==7?($=Ji(H,I.mode,ee,Ne),$.return=I,$):($=h($,H),$.return=I,$)}function ne(I,$,H){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Dd(""+$,I.mode,H),$.return=I,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return H=Dl($.type,$.key,$.props,null,I.mode,H),oo(H,$),H.return=I,H;case w:return $=Md($,I.mode,H),$.return=I,$;case A:return $=na($),ne(I,$,H)}if(je($)||se($))return $=Ji($,I.mode,H,null),$.return=I,$;if(typeof $.then=="function")return ne(I,ql($),H);if($.$$typeof===R)return ne(I,Ul(I,$),H);Hl(I,$)}return null}function V(I,$,H,ee){var Ne=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ne!==null?null:z(I,$,""+H,ee);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===Ne?L(I,$,H,ee):null;case w:return H.key===Ne?K(I,$,H,ee):null;case A:return H=na(H),V(I,$,H,ee)}if(je(H)||se(H))return Ne!==null?null:W(I,$,H,ee,null);if(typeof H.then=="function")return V(I,$,ql(H),ee);if(H.$$typeof===R)return V(I,$,Ul(I,H),ee);Hl(I,H)}return null}function Y(I,$,H,ee,Ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return I=I.get(H)||null,z($,I,""+ee,Ne);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return I=I.get(ee.key===null?H:ee.key)||null,L($,I,ee,Ne);case w:return I=I.get(ee.key===null?H:ee.key)||null,K($,I,ee,Ne);case A:return ee=na(ee),Y(I,$,H,ee,Ne)}if(je(ee)||se(ee))return I=I.get(H)||null,W($,I,ee,Ne,null);if(typeof ee.then=="function")return Y(I,$,H,ql(ee),Ne);if(ee.$$typeof===R)return Y(I,$,H,Ul($,ee),Ne);Hl($,ee)}return null}function ve(I,$,H,ee){for(var Ne=null,Ye=null,Se=$,Ae=$=0,Ge=null;Se!==null&&Ae<H.length;Ae++){Se.index>Ae?(Ge=Se,Se=null):Ge=Se.sibling;var Je=V(I,Se,H[Ae],ee);if(Je===null){Se===null&&(Se=Ge);break}n&&Se&&Je.alternate===null&&i(I,Se),$=g(Je,$,Ae),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je,Se=Ge}if(Ae===H.length)return l(I,Se),Ke&&Es(I,Ae),Ne;if(Se===null){for(;Ae<H.length;Ae++)Se=ne(I,H[Ae],ee),Se!==null&&($=g(Se,$,Ae),Ye===null?Ne=Se:Ye.sibling=Se,Ye=Se);return Ke&&Es(I,Ae),Ne}for(Se=u(Se);Ae<H.length;Ae++)Ge=Y(Se,I,Ae,H[Ae],ee),Ge!==null&&(n&&Ge.alternate!==null&&Se.delete(Ge.key===null?Ae:Ge.key),$=g(Ge,$,Ae),Ye===null?Ne=Ge:Ye.sibling=Ge,Ye=Ge);return n&&Se.forEach(function(wi){return i(I,wi)}),Ke&&Es(I,Ae),Ne}function Ce(I,$,H,ee){if(H==null)throw Error(a(151));for(var Ne=null,Ye=null,Se=$,Ae=$=0,Ge=null,Je=H.next();Se!==null&&!Je.done;Ae++,Je=H.next()){Se.index>Ae?(Ge=Se,Se=null):Ge=Se.sibling;var wi=V(I,Se,Je.value,ee);if(wi===null){Se===null&&(Se=Ge);break}n&&Se&&wi.alternate===null&&i(I,Se),$=g(wi,$,Ae),Ye===null?Ne=wi:Ye.sibling=wi,Ye=wi,Se=Ge}if(Je.done)return l(I,Se),Ke&&Es(I,Ae),Ne;if(Se===null){for(;!Je.done;Ae++,Je=H.next())Je=ne(I,Je.value,ee),Je!==null&&($=g(Je,$,Ae),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return Ke&&Es(I,Ae),Ne}for(Se=u(Se);!Je.done;Ae++,Je=H.next())Je=Y(Se,I,Ae,Je.value,ee),Je!==null&&(n&&Je.alternate!==null&&Se.delete(Je.key===null?Ae:Je.key),$=g(Je,$,Ae),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return n&&Se.forEach(function(mk){return i(I,mk)}),Ke&&Es(I,Ae),Ne}function ct(I,$,H,ee){if(typeof H=="object"&&H!==null&&H.type===S&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var Ne=H.key;$!==null;){if($.key===Ne){if(Ne=H.type,Ne===S){if($.tag===7){l(I,$.sibling),ee=h($,H.props.children),ee.return=I,I=ee;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&na(Ne)===$.type){l(I,$.sibling),ee=h($,H.props),oo(ee,H),ee.return=I,I=ee;break e}l(I,$);break}else i(I,$);$=$.sibling}H.type===S?(ee=Ji(H.props.children,I.mode,ee,H.key),ee.return=I,I=ee):(ee=Dl(H.type,H.key,H.props,null,I.mode,ee),oo(ee,H),ee.return=I,I=ee)}return j(I);case w:e:{for(Ne=H.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===H.containerInfo&&$.stateNode.implementation===H.implementation){l(I,$.sibling),ee=h($,H.children||[]),ee.return=I,I=ee;break e}else{l(I,$);break}else i(I,$);$=$.sibling}ee=Md(H,I.mode,ee),ee.return=I,I=ee}return j(I);case A:return H=na(H),ct(I,$,H,ee)}if(je(H))return ve(I,$,H,ee);if(se(H)){if(Ne=se(H),typeof Ne!="function")throw Error(a(150));return H=Ne.call(H),Ce(I,$,H,ee)}if(typeof H.then=="function")return ct(I,$,ql(H),ee);if(H.$$typeof===R)return ct(I,$,Ul(I,H),ee);Hl(I,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,$!==null&&$.tag===6?(l(I,$.sibling),ee=h($,H),ee.return=I,I=ee):(l(I,$),ee=Dd(H,I.mode,ee),ee.return=I,I=ee),j(I)):l(I,$)}return function(I,$,H,ee){try{ro=0;var Ne=ct(I,$,H,ee);return Xa=null,Ne}catch(Se){if(Se===Ja||Se===Il)throw Se;var Ye=_n(29,Se,null,I.mode);return Ye.lanes=ee,Ye.return=I,Ye}}}var ia=ey(!0),ty=ey(!1),ri=!1;function Vd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function oi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function li(n,i,l){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Xe&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Ll(n),Ug(n,null,l),i}return Ol(n,u,i,l),Ll(n)}function lo(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,bl(n,l)}}function Yd(n,i){var l=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var h=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,l=l.next}while(l!==null);g===null?h=g=i:g=g.next=i}else h=g=i;l={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var Jd=!1;function co(){if(Jd){var n=Ya;if(n!==null)throw n}}function uo(n,i,l,u){Jd=!1;var h=n.updateQueue;ri=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,z=h.shared.pending;if(z!==null){h.shared.pending=null;var L=z,K=L.next;L.next=null,j===null?g=K:j.next=K,j=L;var W=n.alternate;W!==null&&(W=W.updateQueue,z=W.lastBaseUpdate,z!==j&&(z===null?W.firstBaseUpdate=K:z.next=K,W.lastBaseUpdate=L))}if(g!==null){var ne=h.baseState;j=0,W=K=L=null,z=g;do{var V=z.lane&-536870913,Y=V!==z.lane;if(Y?(He&V)===V:(u&V)===V){V!==0&&V===Qa&&(Jd=!0),W!==null&&(W=W.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ve=n,Ce=z;V=i;var ct=l;switch(Ce.tag){case 1:if(ve=Ce.payload,typeof ve=="function"){ne=ve.call(ct,ne,V);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ce.payload,V=typeof ve=="function"?ve.call(ct,ne,V):ve,V==null)break e;ne=y({},ne,V);break e;case 2:ri=!0}}V=z.callback,V!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[V]:Y.push(V))}else Y={lane:V,tag:z.tag,payload:z.payload,callback:z.callback,next:null},W===null?(K=W=Y,L=ne):W=W.next=Y,j|=V;if(z=z.next,z===null){if(z=h.shared.pending,z===null)break;Y=z,z=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);W===null&&(L=ne),h.baseState=L,h.firstBaseUpdate=K,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),hi|=j,n.lanes=j,n.memoizedState=ne}}function ny(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function sy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)ny(l[n],i)}var Wa=O(null),Gl=O(0);function iy(n,i){n=Is,ie(Gl,n),ie(Wa,i),Is=n|i.baseLanes}function Xd(){ie(Gl,Is),ie(Wa,Wa.current)}function Wd(){Is=Gl.current,F(Wa),F(Gl)}var zn=O(null),In=null;function ci(n){var i=n.alternate;ie(Rt,Rt.current&1),ie(zn,n),In===null&&(i===null||Wa.current!==null||i.memoizedState!==null)&&(In=n)}function ef(n){ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)}function ay(n){n.tag===22?(ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)):ui()}function ui(){ie(Rt,Rt.current),ie(zn,zn.current)}function En(n){F(zn),In===n&&(In=null),F(Rt)}var Rt=O(0);function Kl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||oh(l)||lh(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var As=0,Te=null,ot=null,Ut=null,Fl=!1,er=!1,aa=!1,Zl=0,fo=0,tr=null,iC=0;function Nt(){throw Error(a(321))}function tf(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!kn(n[l],i[l]))return!1;return!0}function nf(n,i,l,u,h,g){return As=g,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?qy:vf,aa=!1,g=l(u,h),aa=!1,er&&(g=oy(i,l,u,h)),ry(n),g}function ry(n){B.H=po;var i=ot!==null&&ot.next!==null;if(As=0,Ut=ot=Te=null,Fl=!1,fo=0,tr=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&$l(n)&&(Pt=!0))}function oy(n,i,l,u){Te=n;var h=0;do{if(er&&(tr=null),fo=0,er=!1,25<=h)throw Error(a(301));if(h+=1,Ut=ot=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}B.H=Hy,g=i(l,u)}while(er);return g}function aC(){var n=B.H,i=n.useState()[0];return i=typeof i.then=="function"?ho(i):i,n=n.useState()[0],(ot!==null?ot.memoizedState:null)!==n&&(Te.flags|=1024),i}function sf(){var n=Zl!==0;return Zl=0,n}function af(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function rf(n){if(Fl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Fl=!1}As=0,Ut=ot=Te=null,er=!1,fo=Zl=0,tr=null}function ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Te.memoizedState=Ut=n:Ut=Ut.next=n,Ut}function Tt(){if(ot===null){var n=Te.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var i=Ut===null?Te.memoizedState:Ut.next;if(i!==null)Ut=i,ot=n;else{if(n===null)throw Te.alternate===null?Error(a(467)):Error(a(310));ot=n,n={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ut===null?Te.memoizedState=Ut=n:Ut=Ut.next=n}return Ut}function Vl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ho(n){var i=fo;return fo+=1,tr===null&&(tr=[]),n=Jg(tr,n,i),i=Te,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?qy:vf),n}function Ql(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return ho(n);if(n.$$typeof===R)return Jt(n)}throw Error(a(438,String(n)))}function of(n){var i=null,l=Te.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var u=Te.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Vl(),Te.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),u=0;u<n;u++)l[u]=J;return i.index++,l}function Os(n,i){return typeof i=="function"?i(n):i}function Yl(n){var i=Tt();return lf(i,ot,n)}function lf(n,i,l){var u=n.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=l;var h=n.baseQueue,g=u.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var z=j=null,L=null,K=i,W=!1;do{var ne=K.lane&-536870913;if(ne!==K.lane?(He&ne)===ne:(As&ne)===ne){var V=K.revertLane;if(V===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ne===Qa&&(W=!0);else if((As&V)===V){K=K.next,V===Qa&&(W=!0);continue}else ne={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},L===null?(z=L=ne,j=g):L=L.next=ne,Te.lanes|=V,hi|=V;ne=K.action,aa&&l(g,ne),g=K.hasEagerState?K.eagerState:l(g,ne)}else V={lane:ne,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},L===null?(z=L=V,j=g):L=L.next=V,Te.lanes|=ne,hi|=ne;K=K.next}while(K!==null&&K!==i);if(L===null?j=g:L.next=z,!kn(g,n.memoizedState)&&(Pt=!0,W&&(l=Ya,l!==null)))throw l;n.memoizedState=g,n.baseState=j,n.baseQueue=L,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function cf(n){var i=Tt(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=n;var u=l.dispatch,h=l.pending,g=i.memoizedState;if(h!==null){l.pending=null;var j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);kn(g,i.memoizedState)||(Pt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,u]}function ly(n,i,l){var u=Te,h=Tt(),g=Ke;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var j=!kn((ot||h).memoizedState,l);if(j&&(h.memoizedState=l,Pt=!0),h=h.queue,ff(dy.bind(null,u,h,n),[n]),h.getSnapshot!==i||j||Ut!==null&&Ut.memoizedState.tag&1){if(u.flags|=2048,nr(9,{destroy:void 0},uy.bind(null,u,h,l,i),null),ut===null)throw Error(a(349));g||(As&127)!==0||cy(u,i,l)}return l}function cy(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=Vl(),Te.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function uy(n,i,l,u){i.value=l,i.getSnapshot=u,fy(i)&&hy(n)}function dy(n,i,l){return l(function(){fy(i)&&hy(n)})}function fy(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!kn(n,l)}catch{return!0}}function hy(n){var i=Yi(n,2);i!==null&&bn(i,n,2)}function uf(n){var i=ln();if(typeof n=="function"){var l=n;if(n=l(),aa){Ht(!0);try{l()}finally{Ht(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:n},i}function my(n,i,l,u){return n.baseState=l,lf(n,ot,typeof u=="function"?u:Os)}function rC(n,i,l,u,h){if(Wl(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};B.T!==null?l(!0):g.isTransition=!1,u(g),l=i.pending,l===null?(g.next=i.pending=g,py(i,g)):(g.next=l.next,i.pending=l.next=g)}}function py(n,i){var l=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=B.T,j={};B.T=j;try{var z=l(h,u),L=B.S;L!==null&&L(j,z),gy(n,i,z)}catch(K){df(n,i,K)}finally{g!==null&&j.types!==null&&(g.types=j.types),B.T=g}}else try{g=l(h,u),gy(n,i,g)}catch(K){df(n,i,K)}}function gy(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){yy(n,i,u)},function(u){return df(n,i,u)}):yy(n,i,l)}function yy(n,i,l){i.status="fulfilled",i.value=l,vy(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,py(n,l)))}function df(n,i,l){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=l,vy(i),i=i.next;while(i!==u)}n.action=null}function vy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function xy(n,i){return i}function by(n,i){if(Ke){var l=ut.formState;if(l!==null){e:{var u=Te;if(Ke){if(ht){t:{for(var h=ht,g=Pn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Bn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ht=Bn(h.nextSibling),u=h.data==="F!";break e}}ii(u)}u=!1}u&&(i=l[0])}}return l=ln(),l.memoizedState=l.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xy,lastRenderedState:i},l.queue=u,l=Py.bind(null,Te,u),u.dispatch=l,u=uf(!1),g=yf.bind(null,Te,!1,u.queue),u=ln(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,l=rC.bind(null,Te,h,g,l),h.dispatch=l,u.memoizedState=n,[i,l,!1]}function Sy(n){var i=Tt();return jy(i,ot,n)}function jy(n,i,l){if(i=lf(n,i,xy)[0],n=Yl(Os)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=ho(i)}catch(j){throw j===Ja?Il:j}else u=i;i=Tt();var h=i.queue,g=h.dispatch;return l!==i.memoizedState&&(Te.flags|=2048,nr(9,{destroy:void 0},oC.bind(null,h,l),null)),[u,g,n]}function oC(n,i){n.action=i}function wy(n){var i=Tt(),l=ot;if(l!==null)return jy(i,l,n);Tt(),i=i.memoizedState,l=Tt();var u=l.queue.dispatch;return l.memoizedState=n,[i,u,!1]}function nr(n,i,l,u){return n={tag:n,create:l,deps:u,inst:i,next:null},i=Te.updateQueue,i===null&&(i=Vl(),Te.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(u=l.next,l.next=n,n.next=u,i.lastEffect=n),n}function Ny(){return Tt().memoizedState}function Jl(n,i,l,u){var h=ln();Te.flags|=n,h.memoizedState=nr(1|i,{destroy:void 0},l,u===void 0?null:u)}function Xl(n,i,l,u){var h=Tt();u=u===void 0?null:u;var g=h.memoizedState.inst;ot!==null&&u!==null&&tf(u,ot.memoizedState.deps)?h.memoizedState=nr(i,g,l,u):(Te.flags|=n,h.memoizedState=nr(1|i,g,l,u))}function Cy(n,i){Jl(8390656,8,n,i)}function ff(n,i){Xl(2048,8,n,i)}function lC(n){Te.flags|=4;var i=Te.updateQueue;if(i===null)i=Vl(),Te.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function ky(n){var i=Tt().memoizedState;return lC({ref:i,nextImpl:n}),function(){if((Xe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function _y(n,i){return Xl(4,2,n,i)}function zy(n,i){return Xl(4,4,n,i)}function Ey(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Ry(n,i,l){l=l!=null?l.concat([n]):null,Xl(4,4,Ey.bind(null,i,n),l)}function hf(){}function Ty(n,i){var l=Tt();i=i===void 0?null:i;var u=l.memoizedState;return i!==null&&tf(i,u[1])?u[0]:(l.memoizedState=[n,i],n)}function Ay(n,i){var l=Tt();i=i===void 0?null:i;var u=l.memoizedState;if(i!==null&&tf(i,u[1]))return u[0];if(u=n(),aa){Ht(!0);try{n()}finally{Ht(!1)}}return l.memoizedState=[u,i],u}function mf(n,i,l){return l===void 0||(As&1073741824)!==0&&(He&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=O0(),Te.lanes|=n,hi|=n,l)}function Oy(n,i,l,u){return kn(l,i)?l:Wa.current!==null?(n=mf(n,l,u),kn(n,i)||(Pt=!0),n):(As&42)===0||(As&1073741824)!==0&&(He&261930)===0?(Pt=!0,n.memoizedState=l):(n=O0(),Te.lanes|=n,hi|=n,i)}function Ly(n,i,l,u,h){var g=G.p;G.p=g!==0&&8>g?g:8;var j=B.T,z={};B.T=z,yf(n,!1,i,l);try{var L=h(),K=B.S;if(K!==null&&K(z,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var W=sC(L,u);mo(n,i,W,An(n))}else mo(n,i,u,An(n))}catch(ne){mo(n,i,{then:function(){},status:"rejected",reason:ne},An())}finally{G.p=g,j!==null&&z.types!==null&&(j.types=z.types),B.T=j}}function cC(){}function pf(n,i,l,u){if(n.tag!==5)throw Error(a(476));var h=Dy(n).queue;Ly(n,h,i,oe,l===null?cC:function(){return My(n),l(u)})}function Dy(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:oe},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function My(n){var i=Dy(n);i.next===null&&(i=n.alternate.memoizedState),mo(n,i.next.queue,{},An())}function gf(){return Jt(To)}function $y(){return Tt().memoizedState}function Uy(){return Tt().memoizedState}function uC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=An();n=oi(l);var u=li(i,n,l);u!==null&&(bn(u,i,l),lo(u,i,l)),i={cache:Gd()},n.payload=i;return}i=i.return}}function dC(n,i,l){var u=An();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Wl(n)?Iy(i,l):(l=Od(n,i,l,u),l!==null&&(bn(l,n,u),By(l,i,u)))}function Py(n,i,l){var u=An();mo(n,i,l,u)}function mo(n,i,l,u){var h={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Wl(n))Iy(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var j=i.lastRenderedState,z=g(j,l);if(h.hasEagerState=!0,h.eagerState=z,kn(z,j))return Ol(n,i,h,0),ut===null&&Al(),!1}catch{}if(l=Od(n,i,h,u),l!==null)return bn(l,n,u),By(l,i,u),!0}return!1}function yf(n,i,l,u){if(u={lane:2,revertLane:Qf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Wl(n)){if(i)throw Error(a(479))}else i=Od(n,l,u,2),i!==null&&bn(i,n,2)}function Wl(n){var i=n.alternate;return n===Te||i!==null&&i===Te}function Iy(n,i){er=Fl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function By(n,i,l){if((l&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,bl(n,l)}}var po={readContext:Jt,use:Ql,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};po.useEffectEvent=Nt;var qy={readContext:Jt,use:Ql,useCallback:function(n,i){return ln().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:Cy,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,Jl(4194308,4,Ey.bind(null,i,n),l)},useLayoutEffect:function(n,i){return Jl(4194308,4,n,i)},useInsertionEffect:function(n,i){Jl(4,2,n,i)},useMemo:function(n,i){var l=ln();i=i===void 0?null:i;var u=n();if(aa){Ht(!0);try{n()}finally{Ht(!1)}}return l.memoizedState=[u,i],u},useReducer:function(n,i,l){var u=ln();if(l!==void 0){var h=l(i);if(aa){Ht(!0);try{l(i)}finally{Ht(!1)}}}else h=i;return u.memoizedState=u.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},u.queue=n,n=n.dispatch=dC.bind(null,Te,n),[u.memoizedState,n]},useRef:function(n){var i=ln();return n={current:n},i.memoizedState=n},useState:function(n){n=uf(n);var i=n.queue,l=Py.bind(null,Te,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:hf,useDeferredValue:function(n,i){var l=ln();return mf(l,n,i)},useTransition:function(){var n=uf(!1);return n=Ly.bind(null,Te,n.queue,!0,!1),ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var u=Te,h=ln();if(Ke){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),ut===null)throw Error(a(349));(He&127)!==0||cy(u,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,Cy(dy.bind(null,u,g,n),[n]),u.flags|=2048,nr(9,{destroy:void 0},uy.bind(null,u,g,l,i),null),l},useId:function(){var n=ln(),i=ut.identifierPrefix;if(Ke){var l=ms,u=hs;l=(u&~(1<<32-Ve(u)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Zl++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=iC++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:gf,useFormState:by,useActionState:by,useOptimistic:function(n){var i=ln();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=yf.bind(null,Te,!0,l),l.dispatch=i,[n,i]},useMemoCache:of,useCacheRefresh:function(){return ln().memoizedState=uC.bind(null,Te)},useEffectEvent:function(n){var i=ln(),l={impl:n};return i.memoizedState=l,function(){if((Xe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},vf={readContext:Jt,use:Ql,useCallback:Ty,useContext:Jt,useEffect:ff,useImperativeHandle:Ry,useInsertionEffect:_y,useLayoutEffect:zy,useMemo:Ay,useReducer:Yl,useRef:Ny,useState:function(){return Yl(Os)},useDebugValue:hf,useDeferredValue:function(n,i){var l=Tt();return Oy(l,ot.memoizedState,n,i)},useTransition:function(){var n=Yl(Os)[0],i=Tt().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:ly,useId:$y,useHostTransitionStatus:gf,useFormState:Sy,useActionState:Sy,useOptimistic:function(n,i){var l=Tt();return my(l,ot,n,i)},useMemoCache:of,useCacheRefresh:Uy};vf.useEffectEvent=ky;var Hy={readContext:Jt,use:Ql,useCallback:Ty,useContext:Jt,useEffect:ff,useImperativeHandle:Ry,useInsertionEffect:_y,useLayoutEffect:zy,useMemo:Ay,useReducer:cf,useRef:Ny,useState:function(){return cf(Os)},useDebugValue:hf,useDeferredValue:function(n,i){var l=Tt();return ot===null?mf(l,n,i):Oy(l,ot.memoizedState,n,i)},useTransition:function(){var n=cf(Os)[0],i=Tt().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:ly,useId:$y,useHostTransitionStatus:gf,useFormState:wy,useActionState:wy,useOptimistic:function(n,i){var l=Tt();return ot!==null?my(l,ot,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:of,useCacheRefresh:Uy};Hy.useEffectEvent=ky;function xf(n,i,l,u){i=n.memoizedState,l=l(u,i),l=l==null?i:y({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var bf={enqueueSetState:function(n,i,l){n=n._reactInternals;var u=An(),h=oi(u);h.payload=i,l!=null&&(h.callback=l),i=li(n,h,u),i!==null&&(bn(i,n,u),lo(i,n,u))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var u=An(),h=oi(u);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=li(n,h,u),i!==null&&(bn(i,n,u),lo(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=An(),u=oi(l);u.tag=2,i!=null&&(u.callback=i),i=li(n,u,l),i!==null&&(bn(i,n,l),lo(i,n,l))}};function Gy(n,i,l,u,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,j):i.prototype&&i.prototype.isPureReactComponent?!eo(l,u)||!eo(h,g):!0}function Ky(n,i,l,u){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,u),i.state!==n&&bf.enqueueReplaceState(i,i.state,null)}function ra(n,i){var l=i;if("ref"in i){l={};for(var u in i)u!=="ref"&&(l[u]=i[u])}if(n=n.defaultProps){l===i&&(l=y({},l));for(var h in n)l[h]===void 0&&(l[h]=n[h])}return l}function Fy(n){Tl(n)}function Zy(n){console.error(n)}function Vy(n){Tl(n)}function ec(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Qy(n,i,l){try{var u=n.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Sf(n,i,l){return l=oi(l),l.tag=3,l.payload={element:null},l.callback=function(){ec(n,i)},l}function Yy(n){return n=oi(n),n.tag=3,n}function Jy(n,i,l,u){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var g=u.value;n.payload=function(){return h(g)},n.callback=function(){Qy(i,l,u)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){Qy(i,l,u),typeof h!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var z=u.stack;this.componentDidCatch(u.value,{componentStack:z!==null?z:""})})}function fC(n,i,l,u,h){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=l.alternate,i!==null&&Va(i,l,h,!0),l=zn.current,l!==null){switch(l.tag){case 31:case 13:return In===null?fc():l.alternate===null&&Ct===0&&(Ct=3),l.flags&=-257,l.flags|=65536,l.lanes=h,u===Bl?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([u]):i.add(u),Ff(n,u,h)),!1;case 22:return l.flags|=65536,u===Bl?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([u]):l.add(u)),Ff(n,u,h)),!1}throw Error(a(435,l.tag))}return Ff(n,u,h),fc(),!1}if(Ke)return i=zn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==Pd&&(n=Error(a(422),{cause:u}),so(Mn(n,l)))):(u!==Pd&&(i=Error(a(423),{cause:u}),so(Mn(i,l))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Mn(u,l),h=Sf(n.stateNode,u,h),Yd(n,h),Ct!==4&&(Ct=2)),!1;var g=Error(a(520),{cause:u});if(g=Mn(g,l),wo===null?wo=[g]:wo.push(g),Ct!==4&&(Ct=2),i===null)return!0;u=Mn(u,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=h&-h,l.lanes|=n,n=Sf(l.stateNode,u,n),Yd(l,n),!1;case 1:if(i=l.type,g=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(mi===null||!mi.has(g))))return l.flags|=65536,h&=-h,l.lanes|=h,h=Yy(h),Jy(h,n,l,u),Yd(l,h),!1}l=l.return}while(l!==null);return!1}var jf=Error(a(461)),Pt=!1;function Xt(n,i,l,u){i.child=n===null?ty(i,null,l,u):ia(i,n.child,l,u)}function Xy(n,i,l,u,h){l=l.render;var g=i.ref;if("ref"in u){var j={};for(var z in u)z!=="ref"&&(j[z]=u[z])}else j=u;return ea(i),u=nf(n,i,l,j,g,h),z=sf(),n!==null&&!Pt?(af(n,i,h),Ls(n,i,h)):(Ke&&z&&$d(i),i.flags|=1,Xt(n,i,u,h),i.child)}function Wy(n,i,l,u,h){if(n===null){var g=l.type;return typeof g=="function"&&!Ld(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,e0(n,i,g,u,h)):(n=Dl(l.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Rf(n,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:eo,l(j,u)&&n.ref===i.ref)return Ls(n,i,h)}return i.flags|=1,n=zs(g,u),n.ref=i.ref,n.return=i,i.child=n}function e0(n,i,l,u,h){if(n!==null){var g=n.memoizedProps;if(eo(g,u)&&n.ref===i.ref)if(Pt=!1,i.pendingProps=u=g,Rf(n,h))(n.flags&131072)!==0&&(Pt=!0);else return i.lanes=n.lanes,Ls(n,i,h)}return wf(n,i,l,u,h)}function t0(n,i,l,u){var h=u.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,n!==null){for(u=i.child=n.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~g}else u=0,i.child=null;return n0(n,i,g,l,u)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Pl(i,g!==null?g.cachePool:null),g!==null?iy(i,g):Xd(),ay(i);else return u=i.lanes=536870912,n0(n,i,g!==null?g.baseLanes|l:l,l,u)}else g!==null?(Pl(i,g.cachePool),iy(i,g),ui(),i.memoizedState=null):(n!==null&&Pl(i,null),Xd(),ui());return Xt(n,i,h,l),i.child}function go(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function n0(n,i,l,u,h){var g=Fd();return g=g===null?null:{parent:$t._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Pl(i,null),Xd(),ay(i),n!==null&&Va(n,i,u,!0),i.childLanes=h,null}function tc(n,i){return i=sc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function s0(n,i,l){return ia(i,n.child,null,l),n=tc(i,i.pendingProps),n.flags|=2,En(i),i.memoizedState=null,n}function hC(n,i,l){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Ke){if(u.mode==="hidden")return n=tc(i,u),i.lanes=536870912,go(null,n);if(ef(i),(n=ht)?(n=pv(n,Pn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},l=Ig(n),l.return=i,i.child=l,Yt=i,ht=null)):n=null,n===null)throw ii(i);return i.lanes=536870912,null}return tc(i,u)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(ef(i),h)if(i.flags&256)i.flags&=-257,i=s0(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Pt||Va(n,i,l,!1),h=(l&n.childLanes)!==0,Pt||h){if(u=ut,u!==null&&(j=Kr(u,l),j!==0&&j!==g.retryLane))throw g.retryLane=j,Yi(n,j),bn(u,n,j),jf;fc(),i=s0(n,i,l)}else n=g.treeContext,ht=Bn(j.nextSibling),Yt=i,Ke=!0,si=null,Pn=!1,n!==null&&Hg(i,n),i=tc(i,u),i.flags|=4096;return i}return n=zs(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function nc(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function wf(n,i,l,u,h){return ea(i),l=nf(n,i,l,u,void 0,h),u=sf(),n!==null&&!Pt?(af(n,i,h),Ls(n,i,h)):(Ke&&u&&$d(i),i.flags|=1,Xt(n,i,l,h),i.child)}function i0(n,i,l,u,h,g){return ea(i),i.updateQueue=null,l=oy(i,u,l,h),ry(n),u=sf(),n!==null&&!Pt?(af(n,i,g),Ls(n,i,g)):(Ke&&u&&$d(i),i.flags|=1,Xt(n,i,l,g),i.child)}function a0(n,i,l,u,h){if(ea(i),i.stateNode===null){var g=Ga,j=l.contextType;typeof j=="object"&&j!==null&&(g=Jt(j)),g=new l(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=bf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Vd(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Ga,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(xf(i,l,j,u),g.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&bf.enqueueReplaceState(g,g.state,null),uo(i,u,g,h),co(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var z=i.memoizedProps,L=ra(l,z);g.props=L;var K=g.context,W=l.contextType;j=Ga,typeof W=="object"&&W!==null&&(j=Jt(W));var ne=l.getDerivedStateFromProps;W=typeof ne=="function"||typeof g.getSnapshotBeforeUpdate=="function",z=i.pendingProps!==z,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(z||K!==j)&&Ky(i,g,u,j),ri=!1;var V=i.memoizedState;g.state=V,uo(i,u,g,h),co(),K=i.memoizedState,z||V!==K||ri?(typeof ne=="function"&&(xf(i,l,ne,u),K=i.memoizedState),(L=ri||Gy(i,l,L,u,V,K,j))?(W||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=K),g.props=u,g.state=K,g.context=j,u=L):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Qd(n,i),j=i.memoizedProps,W=ra(l,j),g.props=W,ne=i.pendingProps,V=g.context,K=l.contextType,L=Ga,typeof K=="object"&&K!==null&&(L=Jt(K)),z=l.getDerivedStateFromProps,(K=typeof z=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ne||V!==L)&&Ky(i,g,u,L),ri=!1,V=i.memoizedState,g.state=V,uo(i,u,g,h),co();var Y=i.memoizedState;j!==ne||V!==Y||ri||n!==null&&n.dependencies!==null&&$l(n.dependencies)?(typeof z=="function"&&(xf(i,l,z,u),Y=i.memoizedState),(W=ri||Gy(i,l,W,u,V,Y,L)||n!==null&&n.dependencies!==null&&$l(n.dependencies))?(K||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,Y,L),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,Y,L)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=Y),g.props=u,g.state=Y,g.context=L,u=W):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),u=!1)}return g=u,nc(n,i),u=(i.flags&128)!==0,g||u?(g=i.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&u?(i.child=ia(i,n.child,null,h),i.child=ia(i,null,l,h)):Xt(n,i,l,h),i.memoizedState=g.state,n=i.child):n=Ls(n,i,h),n}function r0(n,i,l,u){return Xi(),i.flags|=256,Xt(n,i,l,u),i.child}var Nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cf(n){return{baseLanes:n,cachePool:Qg()}}function kf(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=Tn),n}function o0(n,i,l){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(Rt.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(Ke){if(h?ci(i):ui(),(n=ht)?(n=pv(n,Pn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},l=Ig(n),l.return=i,i.child=l,Yt=i,ht=null)):n=null,n===null)throw ii(i);return lh(n)?i.lanes=32:i.lanes=536870912,null}var z=u.children;return u=u.fallback,h?(ui(),h=i.mode,z=sc({mode:"hidden",children:z},h),u=Ji(u,h,l,null),z.return=i,u.return=i,z.sibling=u,i.child=z,u=i.child,u.memoizedState=Cf(l),u.childLanes=kf(n,j,l),i.memoizedState=Nf,go(null,u)):(ci(i),_f(i,z))}var L=n.memoizedState;if(L!==null&&(z=L.dehydrated,z!==null)){if(g)i.flags&256?(ci(i),i.flags&=-257,i=zf(n,i,l)):i.memoizedState!==null?(ui(),i.child=n.child,i.flags|=128,i=null):(ui(),z=u.fallback,h=i.mode,u=sc({mode:"visible",children:u.children},h),z=Ji(z,h,l,null),z.flags|=2,u.return=i,z.return=i,u.sibling=z,i.child=u,ia(i,n.child,null,l),u=i.child,u.memoizedState=Cf(l),u.childLanes=kf(n,j,l),i.memoizedState=Nf,i=go(null,u));else if(ci(i),lh(z)){if(j=z.nextSibling&&z.nextSibling.dataset,j)var K=j.dgst;j=K,u=Error(a(419)),u.stack="",u.digest=j,so({value:u,source:null,stack:null}),i=zf(n,i,l)}else if(Pt||Va(n,i,l,!1),j=(l&n.childLanes)!==0,Pt||j){if(j=ut,j!==null&&(u=Kr(j,l),u!==0&&u!==L.retryLane))throw L.retryLane=u,Yi(n,u),bn(j,n,u),jf;oh(z)||fc(),i=zf(n,i,l)}else oh(z)?(i.flags|=192,i.child=n.child,i=null):(n=L.treeContext,ht=Bn(z.nextSibling),Yt=i,Ke=!0,si=null,Pn=!1,n!==null&&Hg(i,n),i=_f(i,u.children),i.flags|=4096);return i}return h?(ui(),z=u.fallback,h=i.mode,L=n.child,K=L.sibling,u=zs(L,{mode:"hidden",children:u.children}),u.subtreeFlags=L.subtreeFlags&65011712,K!==null?z=zs(K,z):(z=Ji(z,h,l,null),z.flags|=2),z.return=i,u.return=i,u.sibling=z,i.child=u,go(null,u),u=i.child,z=n.child.memoizedState,z===null?z=Cf(l):(h=z.cachePool,h!==null?(L=$t._currentValue,h=h.parent!==L?{parent:L,pool:L}:h):h=Qg(),z={baseLanes:z.baseLanes|l,cachePool:h}),u.memoizedState=z,u.childLanes=kf(n,j,l),i.memoizedState=Nf,go(n.child,u)):(ci(i),l=n.child,n=l.sibling,l=zs(l,{mode:"visible",children:u.children}),l.return=i,l.sibling=null,n!==null&&(j=i.deletions,j===null?(i.deletions=[n],i.flags|=16):j.push(n)),i.child=l,i.memoizedState=null,l)}function _f(n,i){return i=sc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function sc(n,i){return n=_n(22,n,null,i),n.lanes=0,n}function zf(n,i,l){return ia(i,n.child,null,l),n=_f(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function l0(n,i,l){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),qd(n.return,i,l)}function Ef(n,i,l,u,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=u,j.tail=l,j.tailMode=h,j.treeForkCount=g)}function c0(n,i,l){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var j=Rt.current,z=(j&2)!==0;if(z?(j=j&1|2,i.flags|=128):j&=1,ie(Rt,j),Xt(n,i,u,l),u=Ke?no:0,!z&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&l0(n,l,i);else if(n.tag===19)l0(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)n=l.alternate,n!==null&&Kl(n)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Ef(i,!1,h,l,g,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Kl(n)===null){i.child=h;break}n=h.sibling,h.sibling=l,l=h,h=n}Ef(i,!0,l,null,g,u);break;case"together":Ef(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Ls(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),hi|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(Va(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,l=zs(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=zs(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Rf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&$l(n)))}function mC(n,i,l){switch(i.tag){case 3:Me(i,i.stateNode.containerInfo),ai(i,$t,n.memoizedState.cache),Xi();break;case 27:case 5:Ze(i);break;case 4:Me(i,i.stateNode.containerInfo);break;case 10:ai(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ef(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(ci(i),i.flags|=128,null):(l&i.child.childLanes)!==0?o0(n,i,l):(ci(i),n=Ls(n,i,l),n!==null?n.sibling:null);ci(i);break;case 19:var h=(n.flags&128)!==0;if(u=(l&i.childLanes)!==0,u||(Va(n,i,l,!1),u=(l&i.childLanes)!==0),h){if(u)return c0(n,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ie(Rt,Rt.current),u)break;return null;case 22:return i.lanes=0,t0(n,i,l,i.pendingProps);case 24:ai(i,$t,n.memoizedState.cache)}return Ls(n,i,l)}function u0(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)Pt=!0;else{if(!Rf(n,l)&&(i.flags&128)===0)return Pt=!1,mC(n,i,l);Pt=(n.flags&131072)!==0}else Pt=!1,Ke&&(i.flags&1048576)!==0&&qg(i,no,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=na(i.elementType),i.type=n,typeof n=="function")Ld(n)?(u=ra(n,u),i.tag=1,i=a0(null,i,n,u,l)):(i.tag=0,i=wf(null,i,n,u,l));else{if(n!=null){var h=n.$$typeof;if(h===_){i.tag=11,i=Xy(null,i,n,u,l);break e}else if(h===T){i.tag=14,i=Wy(null,i,n,u,l);break e}}throw i=ke(n)||n,Error(a(306,i,""))}}return i;case 0:return wf(n,i,i.type,i.pendingProps,l);case 1:return u=i.type,h=ra(u,i.pendingProps),a0(n,i,u,h,l);case 3:e:{if(Me(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Qd(n,i),uo(i,u,null,l);var j=i.memoizedState;if(u=j.cache,ai(i,$t,u),u!==g.cache&&Hd(i,[$t],l,!0),co(),u=j.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=r0(n,i,u,l);break e}else if(u!==h){h=Mn(Error(a(424)),i),so(h),i=r0(n,i,u,l);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ht=Bn(n.firstChild),Yt=i,Ke=!0,si=null,Pn=!0,l=ty(i,null,u,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Xi(),u===h){i=Ls(n,i,l);break e}Xt(n,i,u,l)}i=i.child}return i;case 26:return nc(n,i),n===null?(l=Sv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Ke||(l=i.type,n=i.pendingProps,u=xc(he.current).createElement(l),u[Et]=i,u[wt]=n,Wt(u,l,n),Mt(u),i.stateNode=u):i.memoizedState=Sv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ze(i),n===null&&Ke&&(u=i.stateNode=vv(i.type,i.pendingProps,he.current),Yt=i,Pn=!0,h=ht,vi(i.type)?(ch=h,ht=Bn(u.firstChild)):ht=h),Xt(n,i,i.pendingProps.children,l),nc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Ke&&((h=u=ht)&&(u=GC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Yt=i,ht=Bn(u.firstChild),Pn=!1,h=!0):h=!1),h||ii(i)),Ze(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,u=g.children,ih(h,g)?u=null:j!==null&&ih(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=nf(n,i,aC,null,null,l),To._currentValue=h),nc(n,i),Xt(n,i,u,l),i.child;case 6:return n===null&&Ke&&((n=l=ht)&&(l=KC(l,i.pendingProps,Pn),l!==null?(i.stateNode=l,Yt=i,ht=null,n=!0):n=!1),n||ii(i)),null;case 13:return o0(n,i,l);case 4:return Me(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=ia(i,null,u,l):Xt(n,i,u,l),i.child;case 11:return Xy(n,i,i.type,i.pendingProps,l);case 7:return Xt(n,i,i.pendingProps,l),i.child;case 8:return Xt(n,i,i.pendingProps.children,l),i.child;case 12:return Xt(n,i,i.pendingProps.children,l),i.child;case 10:return u=i.pendingProps,ai(i,i.type,u.value),Xt(n,i,u.children,l),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,ea(i),h=Jt(h),u=u(h),i.flags|=1,Xt(n,i,u,l),i.child;case 14:return Wy(n,i,i.type,i.pendingProps,l);case 15:return e0(n,i,i.type,i.pendingProps,l);case 19:return c0(n,i,l);case 31:return hC(n,i,l);case 22:return t0(n,i,l,i.pendingProps);case 24:return ea(i),u=Jt($t),n===null?(h=Fd(),h===null&&(h=ut,g=Gd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:u,cache:h},Vd(i),ai(i,$t,h)):((n.lanes&l)!==0&&(Qd(n,i),uo(i,null,null,l),co()),h=n.memoizedState,g=i.memoizedState,h.parent!==u?(h={parent:u,cache:u},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ai(i,$t,u)):(u=g.cache,ai(i,$t,u),u!==h.cache&&Hd(i,[$t],l,!0))),Xt(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ds(n){n.flags|=4}function Tf(n,i,l,u,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if($0())n.flags|=8192;else throw sa=Bl,Zd}else n.flags&=-16777217}function d0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!kv(i))if($0())n.flags|=8192;else throw sa=Bl,Zd}function ic(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?vl():536870912,n.lanes|=i,rr|=i)}function yo(n,i){if(!Ke)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function mt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,u=0;if(i)for(var h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=u,n.childLanes=l,i}function pC(n,i,l){var u=i.pendingProps;switch(Ud(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(i),null;case 1:return mt(i),null;case 3:return l=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ts($t),ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Za(i)?Ds(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Id())),mt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(Ds(i),g!==null?(mt(i),d0(i,g)):(mt(i),Tf(i,h,null,u,l))):g?g!==n.memoizedState?(Ds(i),mt(i),d0(i,g)):(mt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ds(i),mt(i),Tf(i,h,n,u,l)),null;case 27:if(it(i),l=he.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}n=re.current,Za(i)?Gg(i):(n=vv(h,u,l),i.stateNode=n,Ds(i))}return mt(i),null;case 5:if(it(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}if(g=re.current,Za(i))Gg(i);else{var j=xc(he.current);switch(g){case 1:g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=j.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?j.createElement("select",{is:u.is}):j.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?j.createElement(h,{is:u.is}):j.createElement(h)}}g[Et]=i,g[wt]=u;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)g.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=g;e:switch(Wt(g,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ds(i)}}return mt(i),Tf(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&Ds(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Za(i)){if(n=i.stateNode,l=i.memoizedProps,u=null,h=Yt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[Et]=i,n=!!(n.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||ov(n.nodeValue,l)),n||ii(i,!0)}else n=xc(n).createTextNode(u),n[Et]=i,i.stateNode=n}return mt(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(u=Za(i),l!==null){if(n===null){if(!u)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),n=!1}else l=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(En(i),i):(En(i),null);if((i.flags&128)!==0)throw Error(a(558))}return mt(i),null;case 13:if(u=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Za(i),u!==null&&u.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Et]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),h=!1}else h=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(En(i),i):(En(i),null)}return En(i),(i.flags&128)!==0?(i.lanes=l,i):(l=u!==null,n=n!==null&&n.memoizedState!==null,l&&(u=i.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),ic(i,i.updateQueue),mt(i),null);case 4:return ge(),n===null&&Wf(i.stateNode.containerInfo),mt(i),null;case 10:return Ts(i.type),mt(i),null;case 19:if(F(Rt),u=i.memoizedState,u===null)return mt(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)yo(u,!1);else{if(Ct!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Kl(n),g!==null){for(i.flags|=128,yo(u,!1),n=g.updateQueue,i.updateQueue=n,ic(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)Pg(l,n),l=l.sibling;return ie(Rt,Rt.current&1|2),Ke&&Es(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&Be()>cc&&(i.flags|=128,h=!0,yo(u,!1),i.lanes=4194304)}else{if(!h)if(n=Kl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,ic(i,n),yo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Ke)return mt(i),null}else 2*Be()-u.renderingStartTime>cc&&l!==536870912&&(i.flags|=128,h=!0,yo(u,!1),i.lanes=4194304);u.isBackwards?(g.sibling=i.child,i.child=g):(n=u.last,n!==null?n.sibling=g:i.child=g,u.last=g)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=Be(),n.sibling=null,l=Rt.current,ie(Rt,h?l&1|2:l&1),Ke&&Es(i,u.treeForkCount),n):(mt(i),null);case 22:case 23:return En(i),Wd(),u=i.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(l&536870912)!==0&&(i.flags&128)===0&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(i),l=i.updateQueue,l!==null&&ic(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==l&&(i.flags|=2048),n!==null&&F(ta),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ts($t),mt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function gC(n,i){switch(Ud(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ts($t),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return it(i),null;case 31:if(i.memoizedState!==null){if(En(i),i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(En(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return F(Rt),null;case 4:return ge(),null;case 10:return Ts(i.type),null;case 22:case 23:return En(i),Wd(),n!==null&&F(ta),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Ts($t),null;case 25:return null;default:return null}}function f0(n,i){switch(Ud(i),i.tag){case 3:Ts($t),ge();break;case 26:case 27:case 5:it(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&En(i);break;case 13:En(i);break;case 19:F(Rt);break;case 10:Ts(i.type);break;case 22:case 23:En(i),Wd(),n!==null&&F(ta);break;case 24:Ts($t)}}function vo(n,i){try{var l=i.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var h=u.next;l=h;do{if((l.tag&n)===n){u=void 0;var g=l.create,j=l.inst;u=g(),j.destroy=u}l=l.next}while(l!==h)}}catch(z){tt(i,i.return,z)}}function di(n,i,l){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&n)===n){var j=u.inst,z=j.destroy;if(z!==void 0){j.destroy=void 0,h=i;var L=l,K=z;try{K()}catch(W){tt(h,L,W)}}}u=u.next}while(u!==g)}}catch(W){tt(i,i.return,W)}}function h0(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{sy(i,l)}catch(u){tt(n,n.return,u)}}}function m0(n,i,l){l.props=ra(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(u){tt(n,i,u)}}function xo(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof l=="function"?n.refCleanup=l(u):l.current=u}}catch(h){tt(n,i,h)}}function ps(n,i){var l=n.ref,u=n.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(h){tt(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){tt(n,i,h)}else l.current=null}function p0(n){var i=n.type,l=n.memoizedProps,u=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(h){tt(n,n.return,h)}}function Af(n,i,l){try{var u=n.stateNode;UC(u,n.type,l,i),u[wt]=i}catch(h){tt(n,n.return,h)}}function g0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&vi(n.type)||n.tag===4}function Of(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||g0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&vi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Lf(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=ks));else if(u!==4&&(u===27&&vi(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Lf(n,i,l),n=n.sibling;n!==null;)Lf(n,i,l),n=n.sibling}function ac(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(u!==4&&(u===27&&vi(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(ac(n,i,l),n=n.sibling;n!==null;)ac(n,i,l),n=n.sibling}function y0(n){var i=n.stateNode,l=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Wt(i,u,l),i[Et]=n,i[wt]=l}catch(g){tt(n,n.return,g)}}var Ms=!1,It=!1,Df=!1,v0=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function yC(n,i){if(n=n.containerInfo,nh=kc,n=Rg(n),_d(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var j=0,z=-1,L=-1,K=0,W=0,ne=n,V=null;t:for(;;){for(var Y;ne!==l||h!==0&&ne.nodeType!==3||(z=j+h),ne!==g||u!==0&&ne.nodeType!==3||(L=j+u),ne.nodeType===3&&(j+=ne.nodeValue.length),(Y=ne.firstChild)!==null;)V=ne,ne=Y;for(;;){if(ne===n)break t;if(V===l&&++K===h&&(z=j),V===g&&++W===u&&(L=j),(Y=ne.nextSibling)!==null)break;ne=V,V=ne.parentNode}ne=Y}l=z===-1||L===-1?null:{start:z,end:L}}else l=null}l=l||{start:0,end:0}}else l=null;for(sh={focusedElem:n,selectionRange:l},kc=!1,Zt=i;Zt!==null;)if(i=Zt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Zt=n;else for(;Zt!==null;){switch(i=Zt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)h=n[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,l=i,h=g.memoizedProps,g=g.memoizedState,u=l.stateNode;try{var ve=ra(l.type,h);n=u.getSnapshotBeforeUpdate(ve,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){tt(l,l.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)rh(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":rh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Zt=n;break}Zt=i.return}}function x0(n,i,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Us(n,l),u&4&&vo(5,l);break;case 1:if(Us(n,l),u&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(j){tt(l,l.return,j)}else{var h=ra(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){tt(l,l.return,j)}}u&64&&h0(l),u&512&&xo(l,l.return);break;case 3:if(Us(n,l),u&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{sy(n,i)}catch(j){tt(l,l.return,j)}}break;case 27:i===null&&u&4&&y0(l);case 26:case 5:Us(n,l),i===null&&u&4&&p0(l),u&512&&xo(l,l.return);break;case 12:Us(n,l);break;case 31:Us(n,l),u&4&&j0(n,l);break;case 13:Us(n,l),u&4&&w0(n,l),u&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=kC.bind(null,l),FC(n,l))));break;case 22:if(u=l.memoizedState!==null||Ms,!u){i=i!==null&&i.memoizedState!==null||It,h=Ms;var g=It;Ms=u,(It=i)&&!g?Ps(n,l,(l.subtreeFlags&8772)!==0):Us(n,l),Ms=h,It=g}break;case 30:break;default:Us(n,l)}}function b0(n){var i=n.alternate;i!==null&&(n.alternate=null,b0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&La(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var gt=null,gn=!1;function $s(n,i,l){for(l=l.child;l!==null;)S0(n,i,l),l=l.sibling}function S0(n,i,l){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(ls,l)}catch{}switch(l.tag){case 26:It||ps(l,i),$s(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:It||ps(l,i);var u=gt,h=gn;vi(l.type)&&(gt=l.stateNode,gn=!1),$s(n,i,l),zo(l.stateNode),gt=u,gn=h;break;case 5:It||ps(l,i);case 6:if(u=gt,h=gn,gt=null,$s(n,i,l),gt=u,gn=h,gt!==null)if(gn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(l.stateNode)}catch(g){tt(l,i,g)}else try{gt.removeChild(l.stateNode)}catch(g){tt(l,i,g)}break;case 18:gt!==null&&(gn?(n=gt,hv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),mr(n)):hv(gt,l.stateNode));break;case 4:u=gt,h=gn,gt=l.stateNode.containerInfo,gn=!0,$s(n,i,l),gt=u,gn=h;break;case 0:case 11:case 14:case 15:di(2,l,i),It||di(4,l,i),$s(n,i,l);break;case 1:It||(ps(l,i),u=l.stateNode,typeof u.componentWillUnmount=="function"&&m0(l,i,u)),$s(n,i,l);break;case 21:$s(n,i,l);break;case 22:It=(u=It)||l.memoizedState!==null,$s(n,i,l),It=u;break;default:$s(n,i,l)}}function j0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{mr(n)}catch(l){tt(i,i.return,l)}}}function w0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{mr(n)}catch(l){tt(i,i.return,l)}}function vC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new v0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new v0),i;default:throw Error(a(435,n.tag))}}function rc(n,i){var l=vC(n);i.forEach(function(u){if(!l.has(u)){l.add(u);var h=_C.bind(null,n,u);u.then(h,h)}})}function yn(n,i){var l=i.deletions;if(l!==null)for(var u=0;u<l.length;u++){var h=l[u],g=n,j=i,z=j;e:for(;z!==null;){switch(z.tag){case 27:if(vi(z.type)){gt=z.stateNode,gn=!1;break e}break;case 5:gt=z.stateNode,gn=!1;break e;case 3:case 4:gt=z.stateNode.containerInfo,gn=!0;break e}z=z.return}if(gt===null)throw Error(a(160));S0(g,j,h),gt=null,gn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)N0(i,n),i=i.sibling}var es=null;function N0(n,i){var l=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:yn(i,n),vn(n),u&4&&(di(3,n,n.return),vo(3,n),di(5,n,n.return));break;case 1:yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),u&64&&Ms&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var h=es;if(yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),u&4){var g=l!==null?l.memoizedState:null;if(u=n.memoizedState,l===null)if(u===null)if(n.stateNode===null){e:{u=n.type,l=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ds]||g[Et]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(u),h.head.insertBefore(g,h.querySelector("head > title"))),Wt(g,u,l),g[Et]=n,Mt(g),u=g;break e;case"link":var j=Nv("link","href",h).get(u+(l.href||""));if(j){for(var z=0;z<j.length;z++)if(g=j[z],g.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&g.getAttribute("rel")===(l.rel==null?null:l.rel)&&g.getAttribute("title")===(l.title==null?null:l.title)&&g.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(z,1);break t}}g=h.createElement(u),Wt(g,u,l),h.head.appendChild(g);break;case"meta":if(j=Nv("meta","content",h).get(u+(l.content||""))){for(z=0;z<j.length;z++)if(g=j[z],g.getAttribute("content")===(l.content==null?null:""+l.content)&&g.getAttribute("name")===(l.name==null?null:l.name)&&g.getAttribute("property")===(l.property==null?null:l.property)&&g.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&g.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(z,1);break t}}g=h.createElement(u),Wt(g,u,l),h.head.appendChild(g);break;default:throw Error(a(468,u))}g[Et]=n,Mt(g),u=g}n.stateNode=u}else Cv(h,n.type,n.stateNode);else n.stateNode=wv(h,u,n.memoizedProps);else g!==u?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,u===null?Cv(h,n.type,n.stateNode):wv(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Af(n,n.memoizedProps,l.memoizedProps)}break;case 27:yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),l!==null&&u&4&&Af(n,n.memoizedProps,l.memoizedProps);break;case 5:if(yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),n.flags&32){h=n.stateNode;try{$a(h,"")}catch(ve){tt(n,n.return,ve)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Af(n,h,l!==null?l.memoizedProps:h)),u&1024&&(Df=!0);break;case 6:if(yn(i,n),vn(n),u&4){if(n.stateNode===null)throw Error(a(162));u=n.memoizedProps,l=n.stateNode;try{l.nodeValue=u}catch(ve){tt(n,n.return,ve)}}break;case 3:if(jc=null,h=es,es=bc(i.containerInfo),yn(i,n),es=h,vn(n),u&4&&l!==null&&l.memoizedState.isDehydrated)try{mr(i.containerInfo)}catch(ve){tt(n,n.return,ve)}Df&&(Df=!1,C0(n));break;case 4:u=es,es=bc(n.stateNode.containerInfo),yn(i,n),vn(n),es=u;break;case 12:yn(i,n),vn(n);break;case 31:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 13:yn(i,n),vn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(lc=Be()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 22:h=n.memoizedState!==null;var L=l!==null&&l.memoizedState!==null,K=Ms,W=It;if(Ms=K||h,It=W||L,yn(i,n),It=W,Ms=K,vn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||L||Ms||It||oa(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){L=l=i;try{if(g=L.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{z=L.stateNode;var ne=L.memoizedProps.style,V=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;z.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(ve){tt(L,L.return,ve)}}}else if(i.tag===6){if(l===null){L=i;try{L.stateNode.nodeValue=h?"":L.memoizedProps}catch(ve){tt(L,L.return,ve)}}}else if(i.tag===18){if(l===null){L=i;try{var Y=L.stateNode;h?mv(Y,!0):mv(L.stateNode,!1)}catch(ve){tt(L,L.return,ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,rc(n,l))));break;case 19:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 30:break;case 21:break;default:yn(i,n),vn(n)}}function vn(n){var i=n.flags;if(i&2){try{for(var l,u=n.return;u!==null;){if(g0(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=Of(n);ac(n,g,h);break;case 5:var j=l.stateNode;l.flags&32&&($a(j,""),l.flags&=-33);var z=Of(n);ac(n,z,j);break;case 3:case 4:var L=l.stateNode.containerInfo,K=Of(n);Lf(n,K,L);break;default:throw Error(a(161))}}catch(W){tt(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function C0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;C0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Us(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)x0(n,i.alternate,i),i=i.sibling}function oa(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:di(4,i,i.return),oa(i);break;case 1:ps(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&m0(i,i.return,l),oa(i);break;case 27:zo(i.stateNode);case 26:case 5:ps(i,i.return),oa(i);break;case 22:i.memoizedState===null&&oa(i);break;case 30:oa(i);break;default:oa(i)}n=n.sibling}}function Ps(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:Ps(h,g,l),vo(4,g);break;case 1:if(Ps(h,g,l),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(K){tt(u,u.return,K)}if(u=g,h=u.updateQueue,h!==null){var z=u.stateNode;try{var L=h.shared.hiddenCallbacks;if(L!==null)for(h.shared.hiddenCallbacks=null,h=0;h<L.length;h++)ny(L[h],z)}catch(K){tt(u,u.return,K)}}l&&j&64&&h0(g),xo(g,g.return);break;case 27:y0(g);case 26:case 5:Ps(h,g,l),l&&u===null&&j&4&&p0(g),xo(g,g.return);break;case 12:Ps(h,g,l);break;case 31:Ps(h,g,l),l&&j&4&&j0(h,g);break;case 13:Ps(h,g,l),l&&j&4&&w0(h,g);break;case 22:g.memoizedState===null&&Ps(h,g,l),xo(g,g.return);break;case 30:break;default:Ps(h,g,l)}i=i.sibling}}function Mf(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&io(l))}function $f(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&io(n))}function ts(n,i,l,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)k0(n,i,l,u),i=i.sibling}function k0(n,i,l,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:ts(n,i,l,u),h&2048&&vo(9,i);break;case 1:ts(n,i,l,u);break;case 3:ts(n,i,l,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&io(n)));break;case 12:if(h&2048){ts(n,i,l,u),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,z=g.onPostCommit;typeof z=="function"&&z(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(L){tt(i,i.return,L)}}else ts(n,i,l,u);break;case 31:ts(n,i,l,u);break;case 13:ts(n,i,l,u);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?ts(n,i,l,u):bo(n,i):g._visibility&2?ts(n,i,l,u):(g._visibility|=2,sr(n,i,l,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Mf(j,i);break;case 24:ts(n,i,l,u),h&2048&&$f(i.alternate,i);break;default:ts(n,i,l,u)}}function sr(n,i,l,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,z=l,L=u,K=j.flags;switch(j.tag){case 0:case 11:case 15:sr(g,j,z,L,h),vo(8,j);break;case 23:break;case 22:var W=j.stateNode;j.memoizedState!==null?W._visibility&2?sr(g,j,z,L,h):bo(g,j):(W._visibility|=2,sr(g,j,z,L,h)),h&&K&2048&&Mf(j.alternate,j);break;case 24:sr(g,j,z,L,h),h&&K&2048&&$f(j.alternate,j);break;default:sr(g,j,z,L,h)}i=i.sibling}}function bo(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,u=i,h=u.flags;switch(u.tag){case 22:bo(l,u),h&2048&&Mf(u.alternate,u);break;case 24:bo(l,u),h&2048&&$f(u.alternate,u);break;default:bo(l,u)}i=i.sibling}}var So=8192;function ir(n,i,l){if(n.subtreeFlags&So)for(n=n.child;n!==null;)_0(n,i,l),n=n.sibling}function _0(n,i,l){switch(n.tag){case 26:ir(n,i,l),n.flags&So&&n.memoizedState!==null&&ik(l,es,n.memoizedState,n.memoizedProps);break;case 5:ir(n,i,l);break;case 3:case 4:var u=es;es=bc(n.stateNode.containerInfo),ir(n,i,l),es=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=So,So=16777216,ir(n,i,l),So=u):ir(n,i,l));break;default:ir(n,i,l)}}function z0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function jo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Zt=u,R0(u,n)}z0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)E0(n),n=n.sibling}function E0(n){switch(n.tag){case 0:case 11:case 15:jo(n),n.flags&2048&&di(9,n,n.return);break;case 3:jo(n);break;case 12:jo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,oc(n)):jo(n);break;default:jo(n)}}function oc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Zt=u,R0(u,n)}z0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:di(8,i,i.return),oc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,oc(i));break;default:oc(i)}n=n.sibling}}function R0(n,i){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:di(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:io(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Zt=u;else e:for(l=n;Zt!==null;){u=Zt;var h=u.sibling,g=u.return;if(b0(u),u===l){Zt=null;break e}if(h!==null){h.return=g,Zt=h;break e}Zt=g}}}var xC={getCacheForType:function(n){var i=Jt($t),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return Jt($t).controller.signal}},bC=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ut=null,Ue=null,He=0,et=0,Rn=null,fi=!1,ar=!1,Uf=!1,Is=0,Ct=0,hi=0,la=0,Pf=0,Tn=0,rr=0,wo=null,xn=null,If=!1,lc=0,T0=0,cc=1/0,uc=null,mi=null,Kt=0,pi=null,or=null,Bs=0,Bf=0,qf=null,A0=null,No=0,Hf=null;function An(){return(Xe&2)!==0&&He!==0?He&-He:B.T!==null?Qf():at()}function O0(){if(Tn===0)if((He&536870912)===0||Ke){var n=Ns;Ns<<=1,(Ns&3932160)===0&&(Ns=262144),Tn=n}else Tn=536870912;return n=zn.current,n!==null&&(n.flags|=32),Tn}function bn(n,i,l){(n===ut&&(et===2||et===9)||n.cancelPendingCommit!==null)&&(lr(n,0),gi(n,He,Tn,!1)),Fi(n,l),((Xe&2)===0||n!==ut)&&(n===ut&&((Xe&2)===0&&(la|=l),Ct===4&&gi(n,He,Tn,!1)),gs(n))}function L0(n,i,l){if((Xe&6)!==0)throw Error(a(327));var u=!l&&(i&127)===0&&(i&n.expiredLanes)===0||us(n,i),h=u?wC(n,i):Kf(n,i,!0),g=u;do{if(h===0){ar&&!u&&gi(n,i,0,!1);break}else{if(l=n.current.alternate,g&&!SC(l)){h=Kf(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var z=n;h=wo;var L=z.current.memoizedState.isDehydrated;if(L&&(lr(z,j).flags|=256),j=Kf(z,j,!1),j!==2){if(Uf&&!L){z.errorRecoveryDisabledLanes|=g,la|=g,h=4;break e}g=xn,xn=h,g!==null&&(xn===null?xn=g:xn.push.apply(xn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){lr(n,0),gi(n,i,0,!0);break}e:{switch(u=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:gi(u,i,Tn,!fi);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=lc+300-Be(),10<h)){if(gi(u,i,Tn,!fi),Aa(u,0,!0)!==0)break e;Bs=i,u.timeoutHandle=dv(D0.bind(null,u,l,xn,uc,If,i,Tn,la,rr,fi,g,"Throttled",-0,0),h);break e}D0(u,l,xn,uc,If,i,Tn,la,rr,fi,g,null,-0,0)}}break}while(!0);gs(n)}function D0(n,i,l,u,h,g,j,z,L,K,W,ne,V,Y){if(n.timeoutHandle=-1,ne=i.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ks},_0(i,g,ne);var ve=(g&62914560)===g?lc-Be():(g&4194048)===g?T0-Be():0;if(ve=ak(ne,ve),ve!==null){Bs=g,n.cancelPendingCommit=ve(H0.bind(null,n,i,g,l,u,h,j,z,L,W,ne,null,V,Y)),gi(n,g,j,!K);return}}H0(n,i,g,l,u,h,j,z,L)}function SC(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var h=l[u],g=h.getSnapshot;h=h.value;try{if(!kn(g(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function gi(n,i,l,u){i&=~Pf,i&=~la,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-Ve(h),j=1<<g;u[g]=-1,h&=~j}l!==0&&xl(n,l,i)}function dc(){return(Xe&6)===0?(Co(0),!1):!0}function Gf(){if(Ue!==null){if(et===0)var n=Ue.return;else n=Ue,Rs=Wi=null,rf(n),Xa=null,ro=0,n=Ue;for(;n!==null;)f0(n.alternate,n),n=n.return;Ue=null}}function lr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,BC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Bs=0,Gf(),ut=n,Ue=l=zs(n.current,null),He=i,et=0,Rn=null,fi=!1,ar=us(n,i),Uf=!1,rr=Tn=Pf=la=hi=Ct=0,xn=wo=null,If=!1,(i&8)!==0&&(i|=i&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=i;0<u;){var h=31-Ve(u),g=1<<h;i|=n[h],u&=~g}return Is=i,Al(),l}function M0(n,i){Te=null,B.H=po,i===Ja||i===Il?(i=Xg(),et=3):i===Zd?(i=Xg(),et=4):et=i===jf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Rn=i,Ue===null&&(Ct=1,ec(n,Mn(i,n.current)))}function $0(){var n=zn.current;return n===null?!0:(He&4194048)===He?In===null:(He&62914560)===He||(He&536870912)!==0?n===In:!1}function U0(){var n=B.H;return B.H=po,n===null?po:n}function P0(){var n=B.A;return B.A=xC,n}function fc(){Ct=4,fi||(He&4194048)!==He&&zn.current!==null||(ar=!0),(hi&134217727)===0&&(la&134217727)===0||ut===null||gi(ut,He,Tn,!1)}function Kf(n,i,l){var u=Xe;Xe|=2;var h=U0(),g=P0();(ut!==n||He!==i)&&(uc=null,lr(n,i)),i=!1;var j=Ct;e:do try{if(et!==0&&Ue!==null){var z=Ue,L=Rn;switch(et){case 8:Gf(),j=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(i=!0);var K=et;if(et=0,Rn=null,cr(n,z,L,K),l&&ar){j=0;break e}break;default:K=et,et=0,Rn=null,cr(n,z,L,K)}}jC(),j=Ct;break}catch(W){M0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Rs=Wi=null,Xe=u,B.H=h,B.A=g,Ue===null&&(ut=null,He=0,Al()),j}function jC(){for(;Ue!==null;)I0(Ue)}function wC(n,i){var l=Xe;Xe|=2;var u=U0(),h=P0();ut!==n||He!==i?(uc=null,cc=Be()+500,lr(n,i)):ar=us(n,i);e:do try{if(et!==0&&Ue!==null){i=Ue;var g=Rn;t:switch(et){case 1:et=0,Rn=null,cr(n,i,g,1);break;case 2:case 9:if(Yg(g)){et=0,Rn=null,B0(i);break}i=function(){et!==2&&et!==9||ut!==n||(et=7),gs(n)},g.then(i,i);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Yg(g)?(et=0,Rn=null,B0(i)):(et=0,Rn=null,cr(n,i,g,7));break;case 5:var j=null;switch(Ue.tag){case 26:j=Ue.memoizedState;case 5:case 27:var z=Ue;if(j?kv(j):z.stateNode.complete){et=0,Rn=null;var L=z.sibling;if(L!==null)Ue=L;else{var K=z.return;K!==null?(Ue=K,hc(K)):Ue=null}break t}}et=0,Rn=null,cr(n,i,g,5);break;case 6:et=0,Rn=null,cr(n,i,g,6);break;case 8:Gf(),Ct=6;break e;default:throw Error(a(462))}}NC();break}catch(W){M0(n,W)}while(!0);return Rs=Wi=null,B.H=u,B.A=h,Xe=l,Ue!==null?0:(ut=null,He=0,Al(),Ct)}function NC(){for(;Ue!==null&&!le();)I0(Ue)}function I0(n){var i=u0(n.alternate,n,Is);n.memoizedProps=n.pendingProps,i===null?hc(n):Ue=i}function B0(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=i0(l,i,i.pendingProps,i.type,void 0,He);break;case 11:i=i0(l,i,i.pendingProps,i.type.render,i.ref,He);break;case 5:rf(i);default:f0(l,i),i=Ue=Pg(i,Is),i=u0(l,i,Is)}n.memoizedProps=n.pendingProps,i===null?hc(n):Ue=i}function cr(n,i,l,u){Rs=Wi=null,rf(i),Xa=null,ro=0;var h=i.return;try{if(fC(n,h,i,l,He)){Ct=1,ec(n,Mn(l,n.current)),Ue=null;return}}catch(g){if(h!==null)throw Ue=h,g;Ct=1,ec(n,Mn(l,n.current)),Ue=null;return}i.flags&32768?(Ke||u===1?n=!0:ar||(He&536870912)!==0?n=!1:(fi=n=!0,(u===2||u===9||u===3||u===6)&&(u=zn.current,u!==null&&u.tag===13&&(u.flags|=16384))),q0(i,n)):hc(i)}function hc(n){var i=n;do{if((i.flags&32768)!==0){q0(i,fi);return}n=i.return;var l=pC(i.alternate,i,Is);if(l!==null){Ue=l;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=n}while(i!==null);Ct===0&&(Ct=5)}function q0(n,i){do{var l=gC(n.alternate,n);if(l!==null){l.flags&=32767,Ue=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){Ue=n;return}Ue=n=l}while(n!==null);Ct=6,Ue=null}function H0(n,i,l,u,h,g,j,z,L){n.cancelPendingCommit=null;do mc();while(Kt!==0);if((Xe&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Ad,cd(n,l,g,j,z,L),n===ut&&(Ue=ut=null,He=0),or=i,pi=n,Bs=l,Bf=g,qf=h,A0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,zC(rn,function(){return V0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,h=G.p,G.p=2,j=Xe,Xe|=4;try{yC(n,i,l)}finally{Xe=j,G.p=h,B.T=u}}Kt=1,G0(),K0(),F0()}}function G0(){if(Kt===1){Kt=0;var n=pi,i=or,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{N0(i,n);var g=sh,j=Rg(n.containerInfo),z=g.focusedElem,L=g.selectionRange;if(j!==z&&z&&z.ownerDocument&&Eg(z.ownerDocument.documentElement,z)){if(L!==null&&_d(z)){var K=L.start,W=L.end;if(W===void 0&&(W=K),"selectionStart"in z)z.selectionStart=K,z.selectionEnd=Math.min(W,z.value.length);else{var ne=z.ownerDocument||document,V=ne&&ne.defaultView||window;if(V.getSelection){var Y=V.getSelection(),ve=z.textContent.length,Ce=Math.min(L.start,ve),ct=L.end===void 0?Ce:Math.min(L.end,ve);!Y.extend&&Ce>ct&&(j=ct,ct=Ce,Ce=j);var I=zg(z,Ce),$=zg(z,ct);if(I&&$&&(Y.rangeCount!==1||Y.anchorNode!==I.node||Y.anchorOffset!==I.offset||Y.focusNode!==$.node||Y.focusOffset!==$.offset)){var H=ne.createRange();H.setStart(I.node,I.offset),Y.removeAllRanges(),Ce>ct?(Y.addRange(H),Y.extend($.node,$.offset)):(H.setEnd($.node,$.offset),Y.addRange(H))}}}}for(ne=[],Y=z;Y=Y.parentNode;)Y.nodeType===1&&ne.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<ne.length;z++){var ee=ne[z];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}kc=!!nh,sh=nh=null}finally{Xe=h,G.p=u,B.T=l}}n.current=i,Kt=2}}function K0(){if(Kt===2){Kt=0;var n=pi,i=or,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{x0(n,i.alternate,i)}finally{Xe=h,G.p=u,B.T=l}}Kt=3}}function F0(){if(Kt===4||Kt===3){Kt=0,Ie();var n=pi,i=or,l=Bs,u=A0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,or=pi=null,Z0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(mi=null),fe(l),i=i.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(ls,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=B.T,h=G.p,G.p=2,B.T=null;try{for(var g=n.onRecoverableError,j=0;j<u.length;j++){var z=u[j];g(z.value,{componentStack:z.stack})}}finally{B.T=i,G.p=h}}(Bs&3)!==0&&mc(),gs(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===Hf?No++:(No=0,Hf=n):No=0,Co(0)}}function Z0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,io(i)))}function mc(){return G0(),K0(),F0(),V0()}function V0(){if(Kt!==5)return!1;var n=pi,i=Bf;Bf=0;var l=fe(Bs),u=B.T,h=G.p;try{G.p=32>l?32:l,B.T=null,l=qf,qf=null;var g=pi,j=Bs;if(Kt=0,or=pi=null,Bs=0,(Xe&6)!==0)throw Error(a(331));var z=Xe;if(Xe|=4,E0(g.current),k0(g,g.current,j,l),Xe=z,Co(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(ls,g)}catch{}return!0}finally{G.p=h,B.T=u,Z0(n,i)}}function Q0(n,i,l){i=Mn(l,i),i=Sf(n.stateNode,i,2),n=li(n,i,2),n!==null&&(Fi(n,2),gs(n))}function tt(n,i,l){if(n.tag===3)Q0(n,n,l);else for(;i!==null;){if(i.tag===3){Q0(i,n,l);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(mi===null||!mi.has(u))){n=Mn(l,n),l=Yy(2),u=li(i,l,2),u!==null&&(Jy(l,u,i,n),Fi(u,2),gs(u));break}}i=i.return}}function Ff(n,i,l){var u=n.pingCache;if(u===null){u=n.pingCache=new bC;var h=new Set;u.set(i,h)}else h=u.get(i),h===void 0&&(h=new Set,u.set(i,h));h.has(l)||(Uf=!0,h.add(l),n=CC.bind(null,n,i,l),i.then(n,n))}function CC(n,i,l){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,ut===n&&(He&l)===l&&(Ct===4||Ct===3&&(He&62914560)===He&&300>Be()-lc?(Xe&2)===0&&lr(n,0):Pf|=l,rr===He&&(rr=0)),gs(n)}function Y0(n,i){i===0&&(i=vl()),n=Yi(n,i),n!==null&&(Fi(n,i),gs(n))}function kC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),Y0(n,l)}function _C(n,i){var l=0;switch(n.tag){case 31:case 13:var u=n.stateNode,h=n.memoizedState;h!==null&&(l=h.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),Y0(n,l)}function zC(n,i){return zt(n,i)}var pc=null,ur=null,Zf=!1,gc=!1,Vf=!1,yi=0;function gs(n){n!==ur&&n.next===null&&(ur===null?pc=ur=n:ur=ur.next=n),gc=!0,Zf||(Zf=!0,RC())}function Co(n,i){if(!Vf&&gc){Vf=!0;do for(var l=!1,u=pc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var g=0;else{var j=u.suspendedLanes,z=u.pingedLanes;g=(1<<31-Ve(42|n)+1)-1,g&=h&~(j&~z),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,ev(u,g))}else g=He,g=Aa(u,u===ut?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||us(u,g)||(l=!0,ev(u,g));u=u.next}while(l);Vf=!1}}function EC(){J0()}function J0(){gc=Zf=!1;var n=0;yi!==0&&IC()&&(n=yi);for(var i=Be(),l=null,u=pc;u!==null;){var h=u.next,g=X0(u,i);g===0?(u.next=null,l===null?pc=h:l.next=h,h===null&&(ur=l)):(l=u,(n!==0||(g&3)!==0)&&(gc=!0)),u=h}Kt!==0&&Kt!==5||Co(n),yi!==0&&(yi=0)}function X0(n,i){for(var l=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-Ve(g),z=1<<j,L=h[j];L===-1?((z&l)===0||(z&u)!==0)&&(h[j]=yl(z,i)):L<=i&&(n.expiredLanes|=z),g&=~z}if(i=ut,l=He,l=Aa(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,l===0||n===i&&(et===2||et===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&mn(u),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||us(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(u!==null&&mn(u),fe(l)){case 2:case 8:l=pt;break;case 32:l=rn;break;case 268435456:l=Vs;break;default:l=rn}return u=W0.bind(null,n),l=zt(l,u),n.callbackPriority=i,n.callbackNode=l,i}return u!==null&&u!==null&&mn(u),n.callbackPriority=2,n.callbackNode=null,2}function W0(n,i){if(Kt!==0&&Kt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(mc()&&n.callbackNode!==l)return null;var u=He;return u=Aa(n,n===ut?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(L0(n,u,i),X0(n,Be()),n.callbackNode!=null&&n.callbackNode===l?W0.bind(null,n):null)}function ev(n,i){if(mc())return null;L0(n,i,!0)}function RC(){qC(function(){(Xe&6)!==0?zt($e,EC):J0()})}function Qf(){if(yi===0){var n=Qa;n===0&&(n=Ys,Ys<<=1,(Ys&261888)===0&&(Ys=256)),yi=n}return yi}function tv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Nl(""+n)}function nv(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function TC(n,i,l,u,h){if(i==="submit"&&l&&l.stateNode===h){var g=tv((h[wt]||null).action),j=u.submitter;j&&(i=(i=j[wt]||null)?tv(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var z=new zl("action","action",null,u,h);n.push({event:z,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(yi!==0){var L=j?nv(h,j):new FormData(h);pf(l,{pending:!0,data:L,method:h.method,action:g},null,L)}}else typeof g=="function"&&(z.preventDefault(),L=j?nv(h,j):new FormData(h),pf(l,{pending:!0,data:L,method:h.method,action:g},g,L))},currentTarget:h}]})}}for(var Yf=0;Yf<Td.length;Yf++){var Jf=Td[Yf],AC=Jf.toLowerCase(),OC=Jf[0].toUpperCase()+Jf.slice(1);Wn(AC,"on"+OC)}Wn(Og,"onAnimationEnd"),Wn(Lg,"onAnimationIteration"),Wn(Dg,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(Q1,"onTransitionRun"),Wn(Y1,"onTransitionStart"),Wn(J1,"onTransitionCancel"),Wn(Mg,"onTransitionEnd"),on("onMouseEnter",["mouseout","mouseover"]),on("onMouseLeave",["mouseout","mouseover"]),on("onPointerEnter",["pointerout","pointerover"]),on("onPointerLeave",["pointerout","pointerover"]),Gt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),LC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function sv(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var u=n[l],h=u.event;u=u.listeners;e:{var g=void 0;if(i)for(var j=u.length-1;0<=j;j--){var z=u[j],L=z.instance,K=z.currentTarget;if(z=z.listener,L!==g&&h.isPropagationStopped())break e;g=z,h.currentTarget=K;try{g(h)}catch(W){Tl(W)}h.currentTarget=null,g=L}else for(j=0;j<u.length;j++){if(z=u[j],L=z.instance,K=z.currentTarget,z=z.listener,L!==g&&h.isPropagationStopped())break e;g=z,h.currentTarget=K;try{g(h)}catch(W){Tl(W)}h.currentTarget=null,g=L}}}}function Pe(n,i){var l=i[en];l===void 0&&(l=i[en]=new Set);var u=n+"__bubble";l.has(u)||(iv(i,n,2,!1),l.add(u))}function Xf(n,i,l){var u=0;i&&(u|=4),iv(l,n,u,i)}var yc="_reactListening"+Math.random().toString(36).slice(2);function Wf(n){if(!n[yc]){n[yc]=!0,qe.forEach(function(l){l!=="selectionchange"&&(LC.has(l)||Xf(l,!1,n),Xf(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[yc]||(i[yc]=!0,Xf("selectionchange",!1,i))}}function iv(n,i,l,u){switch(Ov(i)){case 2:var h=lk;break;case 8:h=ck;break;default:h=mh}l=h.bind(null,i,l,n),h=void 0,!vd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,l,{capture:!0,passive:h}):n.addEventListener(i,l,!0):h!==void 0?n.addEventListener(i,l,{passive:h}):n.addEventListener(i,l,!1)}function eh(n,i,l,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var j=u.tag;if(j===3||j===4){var z=u.stateNode.containerInfo;if(z===h)break;if(j===4)for(j=u.return;j!==null;){var L=j.tag;if((L===3||L===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;z!==null;){if(j=Ws(z),j===null)return;if(L=j.tag,L===5||L===6||L===26||L===27){u=g=j;continue e}z=z.parentNode}}u=u.return}cg(function(){var K=g,W=gd(l),ne=[];e:{var V=$g.get(n);if(V!==void 0){var Y=zl,ve=n;switch(n){case"keypress":if(kl(l)===0)break e;case"keydown":case"keyup":Y=_1;break;case"focusin":ve="focus",Y=jd;break;case"focusout":ve="blur",Y=jd;break;case"beforeblur":case"afterblur":Y=jd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=fg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=p1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=R1;break;case Og:case Lg:case Dg:Y=v1;break;case Mg:Y=A1;break;case"scroll":case"scrollend":Y=h1;break;case"wheel":Y=L1;break;case"copy":case"cut":case"paste":Y=b1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=mg;break;case"toggle":case"beforetoggle":Y=M1}var Ce=(i&4)!==0,ct=!Ce&&(n==="scroll"||n==="scrollend"),I=Ce?V!==null?V+"Capture":null:V;Ce=[];for(var $=K,H;$!==null;){var ee=$;if(H=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||H===null||I===null||(ee=Zr($,I),ee!=null&&Ce.push(_o($,ee,H))),ct)break;$=$.return}0<Ce.length&&(V=new Y(V,ve,null,l,W),ne.push({event:V,listeners:Ce}))}}if((i&7)===0){e:{if(V=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",V&&l!==pd&&(ve=l.relatedTarget||l.fromElement)&&(Ws(ve)||ve[Cn]))break e;if((Y||V)&&(V=W.window===W?W:(V=W.ownerDocument)?V.defaultView||V.parentWindow:window,Y?(ve=l.relatedTarget||l.toElement,Y=K,ve=ve?Ws(ve):null,ve!==null&&(ct=c(ve),Ce=ve.tag,ve!==ct||Ce!==5&&Ce!==27&&Ce!==6)&&(ve=null)):(Y=null,ve=K),Y!==ve)){if(Ce=fg,ee="onMouseLeave",I="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=mg,ee="onPointerLeave",I="onPointerEnter",$="pointer"),ct=Y==null?V:fs(Y),H=ve==null?V:fs(ve),V=new Ce(ee,$+"leave",Y,l,W),V.target=ct,V.relatedTarget=H,ee=null,Ws(W)===K&&(Ce=new Ce(I,$+"enter",ve,l,W),Ce.target=H,Ce.relatedTarget=ct,ee=Ce),ct=ee,Y&&ve)t:{for(Ce=DC,I=Y,$=ve,H=0,ee=I;ee;ee=Ce(ee))H++;ee=0;for(var Ne=$;Ne;Ne=Ce(Ne))ee++;for(;0<H-ee;)I=Ce(I),H--;for(;0<ee-H;)$=Ce($),ee--;for(;H--;){if(I===$||$!==null&&I===$.alternate){Ce=I;break t}I=Ce(I),$=Ce($)}Ce=null}else Ce=null;Y!==null&&av(ne,V,Y,Ce,!1),ve!==null&&ct!==null&&av(ne,ct,ve,Ce,!0)}}e:{if(V=K?fs(K):window,Y=V.nodeName&&V.nodeName.toLowerCase(),Y==="select"||Y==="input"&&V.type==="file")var Ye=jg;else if(bg(V))if(wg)Ye=F1;else{Ye=G1;var Se=H1}else Y=V.nodeName,!Y||Y.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?K&&md(K.elementType)&&(Ye=jg):Ye=K1;if(Ye&&(Ye=Ye(n,K))){Sg(ne,Ye,l,W);break e}Se&&Se(n,V,K),n==="focusout"&&K&&V.type==="number"&&K.memoizedProps.value!=null&&hd(V,"number",V.value)}switch(Se=K?fs(K):window,n){case"focusin":(bg(Se)||Se.contentEditable==="true")&&(Ba=Se,zd=K,to=null);break;case"focusout":to=zd=Ba=null;break;case"mousedown":Ed=!0;break;case"contextmenu":case"mouseup":case"dragend":Ed=!1,Tg(ne,l,W);break;case"selectionchange":if(V1)break;case"keydown":case"keyup":Tg(ne,l,W)}var Ae;if(Nd)e:{switch(n){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else Ia?vg(n,l)&&(Ge="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(Ge="onCompositionStart");Ge&&(pg&&l.locale!=="ko"&&(Ia||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Ia&&(Ae=ug()):(ti=W,xd="value"in ti?ti.value:ti.textContent,Ia=!0)),Se=vc(K,Ge),0<Se.length&&(Ge=new hg(Ge,n,null,l,W),ne.push({event:Ge,listeners:Se}),Ae?Ge.data=Ae:(Ae=xg(l),Ae!==null&&(Ge.data=Ae)))),(Ae=U1?P1(n,l):I1(n,l))&&(Ge=vc(K,"onBeforeInput"),0<Ge.length&&(Se=new hg("onBeforeInput","beforeinput",null,l,W),ne.push({event:Se,listeners:Ge}),Se.data=Ae)),TC(ne,n,K,l,W)}sv(ne,i)})}function _o(n,i,l){return{instance:n,listener:i,currentTarget:l}}function vc(n,i){for(var l=i+"Capture",u=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Zr(n,l),h!=null&&u.unshift(_o(n,h,g)),h=Zr(n,i),h!=null&&u.push(_o(n,h,g))),n.tag===3)return u;n=n.return}return[]}function DC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function av(n,i,l,u,h){for(var g=i._reactName,j=[];l!==null&&l!==u;){var z=l,L=z.alternate,K=z.stateNode;if(z=z.tag,L!==null&&L===u)break;z!==5&&z!==26&&z!==27||K===null||(L=K,h?(K=Zr(l,g),K!=null&&j.unshift(_o(l,K,L))):h||(K=Zr(l,g),K!=null&&j.push(_o(l,K,L)))),l=l.return}j.length!==0&&n.push({event:i,listeners:j})}var MC=/\r\n?/g,$C=/\u0000|\uFFFD/g;function rv(n){return(typeof n=="string"?n:""+n).replace(MC,`
|
|
9
|
-
`).replace($C,"")}function ov(n,i){return i=rv(i),rv(n)===i}function lt(n,i,l,u,h,g){switch(l){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||$a(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&$a(n,""+u);break;case"className":jl(n,"class",u);break;case"tabIndex":jl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":jl(n,l,u);break;case"style":og(n,u,g);break;case"data":if(i!=="object"){jl(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Nl(""+u),n.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(l==="formAction"?(i!=="input"&<(n,i,"name",h.name,h,null),lt(n,i,"formEncType",h.formEncType,h,null),lt(n,i,"formMethod",h.formMethod,h,null),lt(n,i,"formTarget",h.formTarget,h,null)):(lt(n,i,"encType",h.encType,h,null),lt(n,i,"method",h.method,h,null),lt(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Nl(""+u),n.setAttribute(l,u);break;case"onClick":u!=null&&(n.onclick=ks);break;case"onScroll":u!=null&&Pe("scroll",n);break;case"onScrollEnd":u!=null&&Pe("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}l=Nl(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""+u):n.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":u===!0?n.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,u):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(l,u):n.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(l):n.setAttribute(l,u);break;case"popover":Pe("beforetoggle",n),Pe("toggle",n),Sl(n,"popover",u);break;case"xlinkActuate":Cs(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Cs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Cs(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Cs(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Cs(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Cs(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Sl(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=d1.get(l)||l,Sl(n,l,u))}}function th(n,i,l,u,h,g){switch(l){case"style":og(n,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"children":typeof u=="string"?$a(n,u):(typeof u=="number"||typeof u=="bigint")&&$a(n,""+u);break;case"onScroll":u!=null&&Pe("scroll",n);break;case"onScrollEnd":u!=null&&Pe("scrollend",n);break;case"onClick":u!=null&&(n.onclick=ks);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rt.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),i=l.slice(2,h?l.length-7:void 0),g=n[wt]||null,g=g!=null?g[l]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof u=="function")){typeof g!="function"&&g!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,u,h);break e}l in n?n[l]=u:u===!0?n.setAttribute(l,""):Sl(n,l,u)}}}function Wt(n,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",n),Pe("load",n);var u=!1,h=!1,g;for(g in l)if(l.hasOwnProperty(g)){var j=l[g];if(j!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,g,j,l,null)}}h&<(n,i,"srcSet",l.srcSet,l,null),u&<(n,i,"src",l.src,l,null);return;case"input":Pe("invalid",n);var z=g=j=h=null,L=null,K=null;for(u in l)if(l.hasOwnProperty(u)){var W=l[u];if(W!=null)switch(u){case"name":h=W;break;case"type":j=W;break;case"checked":L=W;break;case"defaultChecked":K=W;break;case"value":g=W;break;case"defaultValue":z=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:lt(n,i,u,W,l,null)}}sg(n,g,z,L,K,j,h,!1);return;case"select":Pe("invalid",n),u=j=g=null;for(h in l)if(l.hasOwnProperty(h)&&(z=l[h],z!=null))switch(h){case"value":g=z;break;case"defaultValue":j=z;break;case"multiple":u=z;default:lt(n,i,h,z,l,null)}i=g,l=j,n.multiple=!!u,i!=null?Ma(n,!!u,i,!1):l!=null&&Ma(n,!!u,l,!0);return;case"textarea":Pe("invalid",n),g=h=u=null;for(j in l)if(l.hasOwnProperty(j)&&(z=l[j],z!=null))switch(j){case"value":u=z;break;case"defaultValue":h=z;break;case"children":g=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(a(91));break;default:lt(n,i,j,z,l,null)}ag(n,u,h,g);return;case"option":for(L in l)l.hasOwnProperty(L)&&(u=l[L],u!=null)&&(L==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":lt(n,i,L,u,l,null));return;case"dialog":Pe("beforetoggle",n),Pe("toggle",n),Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":Pe("load",n);break;case"video":case"audio":for(u=0;u<ko.length;u++)Pe(ko[u],n);break;case"image":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"embed":case"source":case"link":Pe("error",n),Pe("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in l)if(l.hasOwnProperty(K)&&(u=l[K],u!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,K,u,l,null)}return;default:if(md(i)){for(W in l)l.hasOwnProperty(W)&&(u=l[W],u!==void 0&&th(n,i,W,u,l,void 0));return}}for(z in l)l.hasOwnProperty(z)&&(u=l[z],u!=null&<(n,i,z,u,l,null))}function UC(n,i,l,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,j=null,z=null,L=null,K=null,W=null;for(Y in l){var ne=l[Y];if(l.hasOwnProperty(Y)&&ne!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":L=ne;default:u.hasOwnProperty(Y)||lt(n,i,Y,null,u,ne)}}for(var V in u){var Y=u[V];if(ne=l[V],u.hasOwnProperty(V)&&(Y!=null||ne!=null))switch(V){case"type":g=Y;break;case"name":h=Y;break;case"checked":K=Y;break;case"defaultChecked":W=Y;break;case"value":j=Y;break;case"defaultValue":z=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==ne&<(n,i,V,Y,u,ne)}}fd(n,j,z,L,K,W,g,h);return;case"select":Y=j=z=V=null;for(g in l)if(L=l[g],l.hasOwnProperty(g)&&L!=null)switch(g){case"value":break;case"multiple":Y=L;default:u.hasOwnProperty(g)||lt(n,i,g,null,u,L)}for(h in u)if(g=u[h],L=l[h],u.hasOwnProperty(h)&&(g!=null||L!=null))switch(h){case"value":V=g;break;case"defaultValue":z=g;break;case"multiple":j=g;default:g!==L&<(n,i,h,g,u,L)}i=z,l=j,u=Y,V!=null?Ma(n,!!l,V,!1):!!u!=!!l&&(i!=null?Ma(n,!!l,i,!0):Ma(n,!!l,l?[]:"",!1));return;case"textarea":Y=V=null;for(z in l)if(h=l[z],l.hasOwnProperty(z)&&h!=null&&!u.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:lt(n,i,z,null,u,h)}for(j in u)if(h=u[j],g=l[j],u.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){case"value":V=h;break;case"defaultValue":Y=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&<(n,i,j,h,u,g)}ig(n,V,Y);return;case"option":for(var ve in l)V=l[ve],l.hasOwnProperty(ve)&&V!=null&&!u.hasOwnProperty(ve)&&(ve==="selected"?n.selected=!1:lt(n,i,ve,null,u,V));for(L in u)V=u[L],Y=l[L],u.hasOwnProperty(L)&&V!==Y&&(V!=null||Y!=null)&&(L==="selected"?n.selected=V&&typeof V!="function"&&typeof V!="symbol":lt(n,i,L,V,u,Y));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in l)V=l[Ce],l.hasOwnProperty(Ce)&&V!=null&&!u.hasOwnProperty(Ce)&<(n,i,Ce,null,u,V);for(K in u)if(V=u[K],Y=l[K],u.hasOwnProperty(K)&&V!==Y&&(V!=null||Y!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:lt(n,i,K,V,u,Y)}return;default:if(md(i)){for(var ct in l)V=l[ct],l.hasOwnProperty(ct)&&V!==void 0&&!u.hasOwnProperty(ct)&&th(n,i,ct,void 0,u,V);for(W in u)V=u[W],Y=l[W],!u.hasOwnProperty(W)||V===Y||V===void 0&&Y===void 0||th(n,i,W,V,u,Y);return}}for(var I in l)V=l[I],l.hasOwnProperty(I)&&V!=null&&!u.hasOwnProperty(I)&<(n,i,I,null,u,V);for(ne in u)V=u[ne],Y=l[ne],!u.hasOwnProperty(ne)||V===Y||V==null&&Y==null||lt(n,i,ne,V,u,Y)}function lv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function PC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var h=l[u],g=h.transferSize,j=h.initiatorType,z=h.duration;if(g&&z&&lv(j)){for(j=0,z=h.responseEnd,u+=1;u<l.length;u++){var L=l[u],K=L.startTime;if(K>z)break;var W=L.transferSize,ne=L.initiatorType;W&&lv(ne)&&(L=L.responseEnd,j+=W*(L<z?1:(z-K)/(L-K)))}if(--u,i+=8*(g+j)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var nh=null,sh=null;function xc(n){return n.nodeType===9?n:n.ownerDocument}function cv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function uv(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function ih(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ah=null;function IC(){var n=window.event;return n&&n.type==="popstate"?n===ah?!1:(ah=n,!0):(ah=null,!1)}var dv=typeof setTimeout=="function"?setTimeout:void 0,BC=typeof clearTimeout=="function"?clearTimeout:void 0,fv=typeof Promise=="function"?Promise:void 0,qC=typeof queueMicrotask=="function"?queueMicrotask:typeof fv<"u"?function(n){return fv.resolve(null).then(n).catch(HC)}:dv;function HC(n){setTimeout(function(){throw n})}function vi(n){return n==="head"}function hv(n,i){var l=i,u=0;do{var h=l.nextSibling;if(n.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(u===0){n.removeChild(h),mr(i);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")zo(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,zo(l);for(var g=l.firstChild;g;){var j=g.nextSibling,z=g.nodeName;g[ds]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=j}}else l==="body"&&zo(n.ownerDocument.body);l=h}while(l);mr(i)}function mv(n,i){var l=n;n=0;do{var u=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=u}while(l)}function rh(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":rh(l),La(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function GC(n,i,l,u){for(;n.nodeType===1;){var h=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ds])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Bn(n.nextSibling),n===null)break}return null}function KC(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Bn(n.nextSibling),n===null))return null;return n}function pv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Bn(n.nextSibling),n===null))return null;return n}function oh(n){return n.data==="$?"||n.data==="$~"}function lh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function FC(n,i){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||l.readyState!=="loading")i();else{var u=function(){i(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Bn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var ch=null;function gv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(i===0)return Bn(n.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}n=n.nextSibling}return null}function yv(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return n;i--}else l!=="/$"&&l!=="/&"||i++}n=n.previousSibling}return null}function vv(n,i,l){switch(i=xc(l),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function zo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);La(n)}var qn=new Map,xv=new Set;function bc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var qs=G.d;G.d={f:ZC,r:VC,D:QC,C:YC,L:JC,m:XC,X:ek,S:WC,M:tk};function ZC(){var n=qs.f(),i=dc();return n||i}function VC(n){var i=Xn(n);i!==null&&i.tag===5&&i.type==="form"?My(i):qs.r(n)}var dr=typeof document>"u"?null:document;function bv(n,i,l){var u=dr;if(u&&typeof i=="string"&&i){var h=Ln(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),xv.has(h)||(xv.add(h),n={rel:n,crossOrigin:l,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function QC(n){qs.D(n),bv("dns-prefetch",n,null)}function YC(n,i){qs.C(n,i),bv("preconnect",n,i)}function JC(n,i,l){qs.L(n,i,l);var u=dr;if(u&&n&&i){var h='link[rel="preload"][as="'+Ln(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+Ln(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+Ln(l.imageSizes)+'"]')):h+='[href="'+Ln(n)+'"]';var g=h;switch(i){case"style":g=fr(n);break;case"script":g=hr(n)}qn.has(g)||(n=y({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),qn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(Eo(g))||i==="script"&&u.querySelector(Ro(g))||(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function XC(n,i){qs.m(n,i);var l=dr;if(l&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Ln(u)+'"][href="'+Ln(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=hr(n)}if(!qn.has(g)&&(n=y({rel:"modulepreload",href:n},i),qn.set(g,n),l.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ro(g)))return}u=l.createElement("link"),Wt(u,"link",n),Mt(u),l.head.appendChild(u)}}}function WC(n,i,l){qs.S(n,i,l);var u=dr;if(u&&n){var h=ei(u).hoistableStyles,g=fr(n);i=i||"default";var j=h.get(g);if(!j){var z={loading:0,preload:null};if(j=u.querySelector(Eo(g)))z.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},l),(l=qn.get(g))&&uh(n,l);var L=j=u.createElement("link");Mt(L),Wt(L,"link",n),L._p=new Promise(function(K,W){L.onload=K,L.onerror=W}),L.addEventListener("load",function(){z.loading|=1}),L.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Sc(j,i,u)}j={type:"stylesheet",instance:j,count:1,state:z},h.set(g,j)}}}function ek(n,i){qs.X(n,i);var l=dr;if(l&&n){var u=ei(l).hoistableScripts,h=hr(n),g=u.get(h);g||(g=l.querySelector(Ro(h)),g||(n=y({src:n,async:!0},i),(i=qn.get(h))&&dh(n,i),g=l.createElement("script"),Mt(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function tk(n,i){qs.M(n,i);var l=dr;if(l&&n){var u=ei(l).hoistableScripts,h=hr(n),g=u.get(h);g||(g=l.querySelector(Ro(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=qn.get(h))&&dh(n,i),g=l.createElement("script"),Mt(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function Sv(n,i,l,u){var h=(h=he.current)?bc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=fr(l.href),l=ei(h).hoistableStyles,u=l.get(i),u||(u={type:"style",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=fr(l.href);var g=ei(h).hoistableStyles,j=g.get(n);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,j),(g=h.querySelector(Eo(n)))&&!g._p&&(j.instance=g,j.state.loading=5),qn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},qn.set(n,l),g||nk(h,n,l,j.state))),i&&u===null)throw Error(a(528,""));return j}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=hr(l),l=ei(h).hoistableScripts,u=l.get(i),u||(u={type:"script",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function fr(n){return'href="'+Ln(n)+'"'}function Eo(n){return'link[rel="stylesheet"]['+n+"]"}function jv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function nk(n,i,l,u){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=n.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Wt(i,"link",l),Mt(i),n.head.appendChild(i))}function hr(n){return'[src="'+Ln(n)+'"]'}function Ro(n){return"script[async]"+n}function wv(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Ln(l.href)+'"]');if(u)return i.instance=u,Mt(u),u;var h=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Mt(u),Wt(u,"style",h),Sc(u,l.precedence,n),i.instance=u;case"stylesheet":h=fr(l.href);var g=n.querySelector(Eo(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=jv(l),(h=qn.get(h))&&uh(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var j=g;return j._p=new Promise(function(z,L){j.onload=z,j.onerror=L}),Wt(g,"link",u),i.state.loading|=4,Sc(g,l.precedence,n),i.instance=g;case"script":return g=hr(l.src),(h=n.querySelector(Ro(g)))?(i.instance=h,Mt(h),h):(u=l,(h=qn.get(g))&&(u=y({},l),dh(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Mt(h),Wt(h,"link",u),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,Sc(u,l.precedence,n));return i.instance}function Sc(n,i,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,g=h,j=0;j<u.length;j++){var z=u[j];if(z.dataset.precedence===i)g=z;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(n,i.firstChild))}function uh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function dh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var jc=null;function Nv(n,i,l){if(jc===null){var u=new Map,h=jc=new Map;h.set(l,u)}else h=jc,u=h.get(l),u||(u=new Map,h.set(l,u));if(u.has(n))return u;for(u.set(n,null),l=l.getElementsByTagName(n),h=0;h<l.length;h++){var g=l[h];if(!(g[ds]||g[Et]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=n+j;var z=u.get(j);z?z.push(g):u.set(j,[g])}}return u}function Cv(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function sk(n,i,l){if(l===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function kv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function ik(n,i,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=fr(u.href),g=i.querySelector(Eo(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=wc.bind(n),i.then(n,n)),l.state.loading|=4,l.instance=g,Mt(g);return}g=i.ownerDocument||i,u=jv(u),(h=qn.get(h))&&uh(u,h),g=g.createElement("link"),Mt(g);var j=g;j._p=new Promise(function(z,L){j.onload=z,j.onerror=L}),Wt(g,"link",u),l.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=wc.bind(n),i.addEventListener("load",l),i.addEventListener("error",l))}}var fh=0;function ak(n,i){return n.stylesheets&&n.count===0&&Cc(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var u=setTimeout(function(){if(n.stylesheets&&Cc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&fh===0&&(fh=62500*PC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Cc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>fh?50:800)+i);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Nc=null;function Cc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Nc=new Map,i.forEach(rk,n),Nc=null,wc.call(n))}function rk(n,i){if(!(i.state.loading&4)){var l=Nc.get(n);if(l)var u=l.get(null);else{l=new Map,Nc.set(n,l);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var j=h[g];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),u=j)}u&&l.set(null,u)}h=i.instance,j=h.getAttribute("data-precedence"),g=l.get(j)||u,g===u&&l.set(null,h),l.set(j,h),this.count++,u=wc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var To={$$typeof:R,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function ok(n,i,l,u,h,g,j,z,L){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Oa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.hiddenUpdates=Oa(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function _v(n,i,l,u,h,g,j,z,L,K,W,ne){return n=new ok(n,i,l,j,L,K,W,ne,z),i=1,g===!0&&(i|=24),g=_n(3,null,null,i),n.current=g,g.stateNode=n,i=Gd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:l,cache:i},Vd(g),n}function zv(n){return n?(n=Ga,n):Ga}function Ev(n,i,l,u,h,g){h=zv(h),u.context===null?u.context=h:u.pendingContext=h,u=oi(i),u.payload={element:l},g=g===void 0?null:g,g!==null&&(u.callback=g),l=li(n,u,i),l!==null&&(bn(l,n,i),lo(l,n,i))}function Rv(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function hh(n,i){Rv(n,i),(n=n.alternate)&&Rv(n,i)}function Tv(n){if(n.tag===13||n.tag===31){var i=Yi(n,67108864);i!==null&&bn(i,n,67108864),hh(n,67108864)}}function Av(n){if(n.tag===13||n.tag===31){var i=An();i=U(i);var l=Yi(n,i);l!==null&&bn(l,n,i),hh(n,i)}}var kc=!0;function lk(n,i,l,u){var h=B.T;B.T=null;var g=G.p;try{G.p=2,mh(n,i,l,u)}finally{G.p=g,B.T=h}}function ck(n,i,l,u){var h=B.T;B.T=null;var g=G.p;try{G.p=8,mh(n,i,l,u)}finally{G.p=g,B.T=h}}function mh(n,i,l,u){if(kc){var h=ph(u);if(h===null)eh(n,i,u,_c,l),Lv(n,u);else if(dk(h,n,i,l,u))u.stopPropagation();else if(Lv(n,u),i&4&&-1<uk.indexOf(n)){for(;h!==null;){var g=Xn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=cs(g.pendingLanes);if(j!==0){var z=g;for(z.pendingLanes|=2,z.entangledLanes|=2;j;){var L=1<<31-Ve(j);z.entanglements[1]|=L,j&=~L}gs(g),(Xe&6)===0&&(cc=Be()+500,Co(0))}}break;case 31:case 13:z=Yi(g,2),z!==null&&bn(z,g,2),dc(),hh(g,2)}if(g=ph(u),g===null&&eh(n,i,u,_c,l),g===h)break;h=g}h!==null&&u.stopPropagation()}else eh(n,i,u,null,l)}}function ph(n){return n=gd(n),gh(n)}var _c=null;function gh(n){if(_c=null,n=Ws(n),n!==null){var i=c(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=d(i),n!==null)return n;n=null}else if(l===31){if(n=f(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return _c=n,null}function Ov(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ze()){case $e:return 2;case pt:return 8;case rn:case js:return 32;case Vs:return 268435456;default:return 32}default:return 32}}var yh=!1,xi=null,bi=null,Si=null,Ao=new Map,Oo=new Map,ji=[],uk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lv(n,i){switch(n){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":bi=null;break;case"mouseover":case"mouseout":Si=null;break;case"pointerover":case"pointerout":Ao.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(i.pointerId)}}function Lo(n,i,l,u,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:l,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Xn(i),i!==null&&Tv(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function dk(n,i,l,u,h){switch(i){case"focusin":return xi=Lo(xi,n,i,l,u,h),!0;case"dragenter":return bi=Lo(bi,n,i,l,u,h),!0;case"mouseover":return Si=Lo(Si,n,i,l,u,h),!0;case"pointerover":var g=h.pointerId;return Ao.set(g,Lo(Ao.get(g)||null,n,i,l,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Oo.set(g,Lo(Oo.get(g)||null,n,i,l,u,h)),!0}return!1}function Dv(n){var i=Ws(n.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=d(l),i!==null){n.blockedOn=i,Qt(n.priority,function(){Av(l)});return}}else if(i===31){if(i=f(l),i!==null){n.blockedOn=i,Qt(n.priority,function(){Av(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function zc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=ph(n.nativeEvent);if(l===null){l=n.nativeEvent;var u=new l.constructor(l.type,l);pd=u,l.target.dispatchEvent(u),pd=null}else return i=Xn(l),i!==null&&Tv(i),n.blockedOn=l,!1;i.shift()}return!0}function Mv(n,i,l){zc(n)&&l.delete(i)}function fk(){yh=!1,xi!==null&&zc(xi)&&(xi=null),bi!==null&&zc(bi)&&(bi=null),Si!==null&&zc(Si)&&(Si=null),Ao.forEach(Mv),Oo.forEach(Mv)}function Ec(n,i){n.blockedOn===i&&(n.blockedOn=null,yh||(yh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fk)))}var Rc=null;function $v(n){Rc!==n&&(Rc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rc===n&&(Rc=null);for(var i=0;i<n.length;i+=3){var l=n[i],u=n[i+1],h=n[i+2];if(typeof u!="function"){if(gh(u||l)===null)continue;break}var g=Xn(l);g!==null&&(n.splice(i,3),i-=3,pf(g,{pending:!0,data:h,method:l.method,action:u},u,h))}}))}function mr(n){function i(L){return Ec(L,n)}xi!==null&&Ec(xi,n),bi!==null&&Ec(bi,n),Si!==null&&Ec(Si,n),Ao.forEach(i),Oo.forEach(i);for(var l=0;l<ji.length;l++){var u=ji[l];u.blockedOn===n&&(u.blockedOn=null)}for(;0<ji.length&&(l=ji[0],l.blockedOn===null);)Dv(l),l.blockedOn===null&&ji.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var h=l[u],g=l[u+1],j=h[wt]||null;if(typeof g=="function")j||$v(l);else if(j){var z=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[wt]||null)z=j.formAction;else if(gh(h)!==null)continue}else z=j.action;typeof z=="function"?l[u+1]=z:(l.splice(u,3),u-=3),$v(l)}}}function Uv(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function vh(n){this._internalRoot=n}Tc.prototype.render=vh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,u=An();Ev(l,u,n,i,null,null)},Tc.prototype.unmount=vh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Ev(n.current,2,null,n,null,null),dc(),i[Cn]=null}};function Tc(n){this._internalRoot=n}Tc.prototype.unstable_scheduleHydration=function(n){if(n){var i=at();n={blockedOn:null,target:n,priority:i};for(var l=0;l<ji.length&&i!==0&&i<ji[l].priority;l++);ji.splice(l,0,n),l===0&&Dv(n)}};var Pv=t.version;if(Pv!=="19.2.4")throw Error(a(527,Pv,"19.2.4"));G.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=p(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var hk={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ac.isDisabled&&Ac.supportsFiber)try{ls=Ac.inject(hk),_e=Ac}catch{}}return Mo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var l=!1,u="",h=Fy,g=Zy,j=Vy;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=_v(n,1,!1,null,null,l,u,null,h,g,j,Uv),n[Cn]=i.current,Wf(n),new vh(i)},Mo.hydrateRoot=function(n,i,l){if(!r(n))throw Error(a(299));var u=!1,h="",g=Fy,j=Zy,z=Vy,L=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(z=l.onRecoverableError),l.formState!==void 0&&(L=l.formState)),i=_v(n,1,!0,i,l??null,u,h,L,g,j,z,Uv),i.context=zv(null),l=i.current,u=An(),u=U(u),h=oi(u),h.callback=null,li(l,h,u),l=u,i.current.lanes=l,Fi(i,l),gs(i),n[Cn]=i.current,Wf(n),new Tc(i)},Mo.version="19.2.4",Mo}var Qv;function wk(){if(Qv)return Sh.exports;Qv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sh.exports=jk(),Sh.exports}var Nk=wk(),$r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ck={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kk=class{#t=Ck;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},ha=new kk;function _k(e){setTimeout(e,0)}var wa=typeof window>"u"||"Deno"in globalThis;function un(){}function zk(e,t){return typeof e=="function"?e(t):e}function im(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oi(e,t){return typeof e=="function"?e(t):e}function Hn(e,t){return typeof e=="function"?e(t):e}function Yv(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Km(d,t.options))return!1}else if(!Jo(t.queryKey,d))return!1}if(s!=="all"){const m=t.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function Jv(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Yo(t.options.mutationKey)!==Yo(c))return!1}else if(!Jo(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Km(e,t){return(t?.queryKeyHashFn||Yo)(e)}function Yo(e){return JSON.stringify(e,(t,s)=>am(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Jo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Jo(e[s],t[s])):!1}var Ek=Object.prototype.hasOwnProperty;function Fm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=Xv(e)&&Xv(t);if(!a&&!(am(e)&&am(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,m=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const y=a?v:d[v],x=e[y],b=t[y];if(x===b){m[y]=x,(a?v<c:Ek.call(e,y))&&p++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){m[y]=b;continue}const w=Fm(x,b,s+1);m[y]=w,w===x&&p++}return c===f&&p===c?e:m}function cu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Xv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function am(e){if(!Wv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!Wv(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Wv(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rk(e){return new Promise(t=>{ha.setTimeout(t,e)})}function rm(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Fm(e,t):t}function Tk(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function Ak(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Zm=Symbol();function Wb(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Zm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eS(e,t){return typeof e=="function"?e(...t):!!e}function Ok(e,t,s){let a=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),a||(a=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}var Lk=class extends $r{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Vm=new Lk;function om(){let e,t;const s=new Promise((r,c)=>{e=r,t=c});s.status="pending",s.catch(()=>{});function a(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{a({status:"fulfilled",value:r}),e(r)},s.reject=r=>{a({status:"rejected",reason:r}),t(r)},s}var Dk=_k;function Mk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=Dk;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(m=>{s(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||d()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var Bt=Mk(),$k=class extends $r{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},uu=new $k;function Uk(e){return Math.min(1e3*2**e,3e4)}function tS(e){return(e??"online")==="online"?uu.isOnline():!0}var lm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function nS(e){let t=!1,s=0,a;const r=om(),c=()=>r.status!=="pending",d=S=>{if(!c()){const C=new lm(S);x(C),e.onCancel?.(C)}},f=()=>{t=!0},m=()=>{t=!1},p=()=>Vm.isFocused()&&(e.networkMode==="always"||uu.isOnline())&&e.canRun(),v=()=>tS(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},x=S=>{c()||(a?.(),r.reject(S))},b=()=>new Promise(S=>{a=C=>{(c()||p())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),w=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(y).catch(k=>{if(c())return;const E=e.retry??(wa?0:3),R=e.retryDelay??Uk,_=typeof R=="function"?R(s,k):R,D=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,k);if(t||!D){x(k);return}s++,e.onFail?.(s,k),Rk(_).then(()=>p()?void 0:b()).then(()=>{t?x(k):w()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?w():b().then(w),r)}}var sS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),im(this.gcTime)&&(this.#t=ha.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wa?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ha.clearTimeout(this.#t),this.#t=void 0)}},Pk=class extends sS{#t;#e;#n;#i;#s;#r;#o;constructor(e){super(),this.#o=!1,this.#r=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=tx(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=tx(this.options);t.data!==void 0&&(this.setState(ex(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=rm(this.state.data,e,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Hn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Zm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Xb(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(m=>m.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=Wb(this.options,t),p=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,p,this):f(p)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=nS({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof lm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,m)=>{this.#a({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof lm){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#a({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#a(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...iS(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...ex(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const r=e.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Bt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function iS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ex(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function tx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,a=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Qm=class extends $r{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=om(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#o;#a;#m;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),nx(this.#e,this.options)?this.#p():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cm(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cm(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!cu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&sx(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||Oi(this.options.staleTime,this.#e)!==Oi(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return Bk(this,s)&&(this.#i=s,this.#r=this.options,this.#s=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#p(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(un)),t}#g(){this.#b();const e=Oi(this.options.staleTime,this.#e);if(wa||this.#i.isStale||!im(e))return;const s=Xb(this.#i.dataUpdatedAt,e)+1;this.#c=ha.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(wa||Hn(this.options.enabled,this.#e)===!1||!im(this.#l)||this.#l===0)&&(this.#u=ha.setInterval(()=>{(this.options.refetchIntervalInBackground||Vm.isFocused())&&this.#p()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(ha.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ha.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,m=e!==s?e.state:this.#n,{state:p}=e;let v={...p},y=!1,x;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&nx(e,t),J=A&&sx(e,s,t,a);(P||J)&&(v={...v,...iS(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&S==="pending"){let A;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(A=r.data,C=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,A!==void 0&&(S="success",x=rm(r?.data,A,t),y=!0)}if(t.select&&x!==void 0&&!C)if(r&&x===c?.data&&t.select===this.#m)x=this.#d;else try{this.#m=t.select,x=t.select(x),x=rm(r?.data,x,t),this.#d=x,this.#a=null}catch(A){this.#a=A}this.#a&&(b=this.#a,x=this.#d,w=Date.now(),S="error");const k=v.fetchStatus==="fetching",E=S==="pending",R=S==="error",_=E&&k,D=x!==void 0,T={status:S,fetchStatus:v.fetchStatus,isPending:E,isSuccess:S==="success",isError:R,isInitialLoading:_,isLoading:_,data:x,dataUpdatedAt:v.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:R&&!D,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&D,isStale:Ym(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=T.data!==void 0,P=T.status==="error"&&!A,J=pe=>{P?pe.reject(T.error):A&&pe.resolve(T.data)},Q=()=>{const pe=this.#o=T.promise=om();J(pe)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&J(se);break;case"fulfilled":(P||T.data!==se.value)&&Q();break;case"rejected":(!P||T.error!==se.reason)&&Q();break}}return T}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#e),cu(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(d=>{const f=d;return this.#i[f]!==e[f]&&c.has(f)})};this.#w({listeners:s()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#w(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ik(e,t){return Hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function nx(e,t){return Ik(e,t)||e.state.data!==void 0&&cm(e,t,t.refetchOnMount)}function cm(e,t,s){if(Hn(t.enabled,e)!==!1&&Oi(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Ym(e,t)}return!1}function sx(e,t,s,a){return(e!==t||Hn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Ym(e,s)}function Ym(e,t){return Hn(t.enabled,e)!==!1&&e.isStaleByTime(Oi(t.staleTime,e))}function Bk(e,t){return!cu(e.getCurrentResult(),t)}function ix(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const y=w=>{Ok(w,()=>t.signal,()=>v=!0)},x=Wb(t.options,t.fetchOptions),b=async(w,S,C)=>{if(v)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(M),M})(),R=await x(E),{maxPages:_}=t.options,D=C?Ak:Tk;return{pages:D(w.pages,R,_),pageParams:D(w.pageParams,S,_)}};if(r&&c.length){const w=r==="backward",S=w?qk:ax,C={pages:c,pageParams:d},k=S(a,C);f=await b(C,k,w)}else{const w=e??c.length;do{const S=m===0?d[0]??a.initialPageParam:ax(a,f);if(m>0&&S==null)break;f=await b(f,S),m++}while(m<w)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=p}}}function ax(e,{pages:t,pageParams:s}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,s[a],s):void 0}function qk(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Hk=class extends sS{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||Gk(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=nS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",r=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#s({type:"pending",context:d,variables:e,isPaused:r})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Bt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Gk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aS=class extends $r{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,s){const a=new Hk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);const t=Oc(e);if(typeof t=="string"){const s=this.#e.get(t);s?s.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Oc(e);if(typeof t=="string"){const s=this.#e.get(t);if(s)if(s.length>1){const a=s.indexOf(e);a!==-1&&s.splice(a,1)}else s[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Oc(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(r=>r.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Oc(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Jv(t,s))}findAll(e={}){return this.getAll().filter(t=>Jv(e,t))}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Bt.batch(()=>Promise.all(e.map(t=>t.continue().catch(un))))}};function Oc(e){return e.options.scope?.id}function rx(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function Kk(e,t,s){const a=e.slice(0);return a[t]=s,a}var Fk=class extends $r{#t;#e;#n;#i;#s;#r;#o;#a;#m;#d=[];constructor(e,t,s){super(),this.#t=e,this.#i=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Bt.batch(()=>{const s=this.#s,a=this.#u(this.#n);a.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const r=a.map(v=>v.observer),c=r.map(v=>v.getCurrentResult()),d=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),m=d||f,p=m?!0:c.some((v,y)=>{const x=this.#e[y];return!x||!cu(v,x)});!m&&!p||(m&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(m&&(rx(s,r).forEach(v=>{v.destroy()}),rx(r,s).forEach(v=>{v.subscribe(y=>{this.#l(v,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Fm(this.#r,t(e))),this.#r}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const r=a.options.queryHash;if(!r)return;const c=t.get(r);c?c.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{const r=this.#t.defaultQueryOptions(a),d=t.get(r.queryHash)?.shift()??new Qm(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=Kk(this.#e,s,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#r,t=this.#f(this.#e,this.#d),s=this.#c(t,this.#i?.combine);e!==s&&Bt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},Zk=class extends $r{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Km(a,t);let c=this.get(r);return c||(c=new Pk({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Bt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Yv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Yv(e,s)):t}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vk=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new Zk,this.#e=e.mutationCache||new aS,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=Vm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=uu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#t.build(this,t),a=s.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Oi(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:s})=>{const a=s.data;return[t,a]})}setQueryData(e,t,s){const a=this.defaultQueryOptions({queryKey:e}),c=this.#t.get(a.queryHash)?.state.data,d=zk(t,c);if(d!==void 0)return this.#t.build(this,a).setData(d,{...s,manual:!0})}setQueriesData(e,t,s){return Bt.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Bt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return Bt.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=Bt.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(un).catch(un)}invalidateQueries(e,t={}){return Bt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let c=r.fetch(void 0,s);return s.throwOnError||(c=c.catch(un)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Oi(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=ix(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=ix(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Yo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Jo(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Yo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Jo(e,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Km(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Zm&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},rS=N.createContext(void 0),oS=e=>{const t=N.useContext(rS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qk=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(rS.Provider,{value:e,children:t})),lS=N.createContext(!1),cS=()=>N.useContext(lS);lS.Provider;function Yk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Jk=N.createContext(Yk()),uS=()=>N.useContext(Jk),dS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?eS(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},fS=e=>{N.useEffect(()=>{e.clearReset()},[e])},hS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||eS(s,[e.error,a])),mS=e=>{if(e.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...r)=>s(a(...r)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Xk=(e,t)=>e.isLoading&&e.isFetching&&!t,um=(e,t)=>e?.suspense&&t.isPending,dm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Wk({queries:e,...t},s){const a=oS(),r=cS(),c=uS(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{mS(S);const C=a.getQueryCache().get(S.queryHash);dS(S,c,C)}),fS(c);const[f]=N.useState(()=>new Fk(a,d,t)),[m,p,v]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):un,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const b=m.some((S,C)=>um(d[C],S))?m.flatMap((S,C)=>{const k=d[C];if(k&&um(k,S)){const E=new Qm(a,k);return dm(k,E,c)}return[]}):[];if(b.length>0)throw Promise.all(b);const w=m.find((S,C)=>{const k=d[C];return k&&hS({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return p(v())}function e_(e,t,s){const a=cS(),r=uS(),c=oS(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",mS(d),dS(d,r,f),fS(r);const m=!c.getQueryCache().get(d.queryHash),[p]=N.useState(()=>new t(c,d)),v=p.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(x=>{const b=y?p.subscribe(Bt.batchCalls(x)):un;return p.updateResult(),b},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),N.useEffect(()=>{p.setOptions(d)},[d,p]),um(d,v))throw dm(d,p,r);if(hS({result:v,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!wa&&Xk(v,a)&&(m?dm(d,p,r):f?.promise)?.catch(un).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?v:p.trackResult(v)}function Ko(e,t){return e_(e,Qm)}var Lc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function Ch(e){const t=N.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function t_(e,t,s={},a={}){N.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},s);return r.observe(e.current),()=>{r.disconnect()}},[t,s,a.disabled,e])}function n_(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var s_=!1;function Xo(e){return e[e.length-1]}function i_(e){return typeof e=="function"}function Ei(e,t){return i_(e)?e(t):e}var a_=Object.prototype.hasOwnProperty,ox=Object.prototype.propertyIsEnumerable,r_=()=>Object.create(null),ca=(e,t)=>ma(e,t,r_);function ma(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=ux(e)&&ux(r);if(!c&&!(du(e)&&du(r)))return r;const d=c?e:lx(e);if(!d)return r;const f=c?r:lx(r);if(!f)return r;const m=d.length,p=f.length,v=c?new Array(p):s();let y=0;for(let x=0;x<p;x++){const b=c?x:f[x],w=e[b],S=r[b];if(w===S){v[b]=w,(c?x<m:a_.call(e,b))&&y++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){v[b]=S;continue}const C=ma(w,S,s,a+1);v[b]=C,C===w&&y++}return m===p&&y===m?e:v}function lx(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!ox.call(e,r))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const r of s){if(!ox.call(e,r))return!1;a.push(r)}return a}function du(e){if(!cx(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!cx(s)||!s.hasOwnProperty("isPrototypeOf"))}function cx(e){return Object.prototype.toString.call(e)==="[object Object]"}function ux(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xa(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(!xa(e[a],t[a],s))return!1;return!0}if(du(e)&&du(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!xa(e[d],t[d],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&r++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>r||!xa(e[d],t[d],s)))return!1;return r===c}return!1}function Tr(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function Wo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function o_(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function dx(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return o_(t)}var l_=["http:","https:","mailto:","tel:"];function fu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function $o(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let s=0,a="",r;for(;(r=t.exec(e))!==null;)a+=dx(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+dx(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function c_(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function hu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const d=t.get(c);if(d)return r(d),d.value},set(c,d){if(t.size>=e&&s){const m=s;t.delete(m.key),m.next&&(s=m.next,m.next.prev=void 0),m===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const m={key:c,value:d,prev:a};a&&(a.next=m),a=m,s||(s=m),t.set(c,m)}},clear(){t.clear(),s=void 0,a=void 0}}}var u_="Invariant failed";function Ui(e,t){if(!e)throw new Error(u_)}var pa=4,pS=5;function d_(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function Jm(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),r=a===-1?e.length:a,c=e.substring(t,r);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s;if(c==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(c.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=r,s[4]=r,s[5]=r,s;const d=d_(c);if(d){const[f,m]=d,p=c.charCodeAt(f+1);if(p===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=m;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=r,s}}else if(p===36){const v=f+1,y=f+2;return y===m?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+m,s[4]=t+m+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Ru(e,t,s,a,r,c,d){d?.(s);let f=a;{const m=s.fullPath??s.from,p=m.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<p;){const b=Jm(m,f,t);let w;const S=f,C=b[5];switch(f=C+1,c++,b[0]){case 0:{const k=m.substring(b[2],b[3]);if(v){const E=r.static?.get(k);if(E)w=E;else{r.static??=new Map;const R=ga(s.fullPath??s.from);R.parent=r,R.depth=c,w=R,r.static.set(k,R)}}else{const E=k.toLowerCase(),R=r.staticInsensitive?.get(E);if(R)w=R;else{r.staticInsensitive??=new Map;const _=ga(s.fullPath??s.from);_.parent=r,_.depth=c,w=_,r.staticInsensitive.set(E,_)}}break}case 1:{const k=m.substring(S,b[1]),E=m.substring(b[4],C),R=v&&!!(k||E),_=k?R?k:k.toLowerCase():void 0,D=E?R?E:E.toLowerCase():void 0,M=!y&&r.dynamic?.find(T=>!T.skipOnParamError&&T.caseSensitive===R&&T.prefix===_&&T.suffix===D);if(M)w=M;else{const T=_h(1,s.fullPath??s.from,R,_,D);w=T,T.depth=c,T.parent=r,r.dynamic??=[],r.dynamic.push(T)}break}case 3:{const k=m.substring(S,b[1]),E=m.substring(b[4],C),R=v&&!!(k||E),_=k?R?k:k.toLowerCase():void 0,D=E?R?E:E.toLowerCase():void 0,M=!y&&r.optional?.find(T=>!T.skipOnParamError&&T.caseSensitive===R&&T.prefix===_&&T.suffix===D);if(M)w=M;else{const T=_h(3,s.fullPath??s.from,R,_,D);w=T,T.parent=r,T.depth=c,r.optional??=[],r.optional.push(T)}break}case 2:{const k=m.substring(S,b[1]),E=m.substring(b[4],C),R=v&&!!(k||E),_=k?R?k:k.toLowerCase():void 0,D=E?R?E:E.toLowerCase():void 0,M=_h(2,s.fullPath??s.from,R,_,D);w=M,M.parent=r,M.depth=c,r.wildcard??=[],r.wildcard.push(M)}}r=w}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const b=ga(s.fullPath??s.from);b.kind=pS,b.parent=r,c++,b.depth=c,r.pathless??=[],r.pathless.push(b),r=b}const x=(s.path||!s.children)&&!s.isRoot;if(x&&m.endsWith("/")){const b=ga(s.fullPath??s.from);b.kind=pa,b.parent=r,c++,b.depth=c,r.index=b,r=b}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,x&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const m of s.children)Ru(e,t,m,f,r,c,d)}function kh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function _i(e){if(e.pathless)for(const t of e.pathless)_i(t);if(e.static)for(const t of e.static.values())_i(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())_i(t);if(e.dynamic?.length){e.dynamic.sort(kh);for(const t of e.dynamic)_i(t)}if(e.optional?.length){e.optional.sort(kh);for(const t of e.optional)_i(t)}if(e.wildcard?.length){e.wildcard.sort(kh);for(const t of e.wildcard)_i(t)}}function ga(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function _h(e,t,s,a,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:a,suffix:r}}function f_(e,t){const s=ga("/"),a=new Uint16Array(6);for(const r of e)Ru(!1,a,r,1,s,0);_i(s),t.masksTree=s,t.flatCache=hu(1e3)}function h_(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=Xm(e,t.masksTree);return t.flatCache.set(e,a),a}function m_(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=ga("/"),Ru(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),Xm(a,d,s)}function p_(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,r=t.matchCache.get(a);if(r!==void 0)return r;e||="/";let c;try{c=Xm(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=v_(c.route)),t.matchCache.set(a,c),c}function g_(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function y_(e,t=!1,s){const a=ga(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Ru(t,r,e,1,a,0,m=>{if(s?.(m,f),Ui(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,f!==0&&m.path){const p=g_(m.fullPath);(!d[p]||m.fullPath.endsWith("/"))&&(d[p]=m)}f++}),_i(a),{processedTree:{segmentTree:a,singleCache:hu(1e3),matchCache:hu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function Xm(e,t,s=!1){const a=e.split("/"),r=b_(e,a,t,s);if(!r)return null;const[c]=gS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function gS(e,t,s){const a=x_(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,m=s.extract?.path??0,p=s.extract?.segment??0;for(;f<a.length;d++,f++,m++,p++){const v=a[f];if(v.kind===pa)break;if(v.kind===pS){p--,d--,m--;continue}const y=t[d],x=m;if(y&&(m+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const b=r[p],w=v.prefix?.length??0;if(b.charCodeAt(w)===123){const S=v.suffix?.length??0,C=b.substring(w+2,b.length-S-1),k=y.substring(w,y.length-S);c[C]=decodeURIComponent(k)}else{const S=b.substring(1);c[S]=decodeURIComponent(y)}}else if(v.kind===3){if(s.skipped&1<<f){d--,m=x-1;continue}r??=s.node.fullPath.split("/");const b=r[p],w=v.prefix?.length??0,S=v.suffix?.length??0,C=b.substring(w+3,b.length-S-1),k=v.suffix||v.prefix?y.substring(w,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const b=v,w=e.substring(x+(b.prefix?.length??0),e.length-(b.suffix?.length??0)),S=decodeURIComponent(w);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:m,segment:p}]}function v_(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function x_(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function b_(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Xo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let m=null,p=null,v=null;for(;f.length;){const y=f.pop(),{node:x,index:b,skipped:w,depth:S,statics:C,dynamics:k,optionals:E}=y;let{extract:R,rawParams:_,parsedParams:D}=y;if(x.skipOnParamError){if(!zh(e,t,y))continue;_=y.rawParams,R=y.extract,D=y.parsedParams}a&&x.route&&x.kind!==pa&&Uo(p,y)&&(p=y);const M=b===d;if(M&&(x.route&&!c&&Uo(v,y)&&(v=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const T=M?void 0:t[b];let A;if(M&&x.index){const P={node:x.index,index:b,skipped:w,depth:S+1,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:D};let J=!0;if(x.index.skipOnParamError&&(zh(e,t,P)||(J=!1)),J){if(C===d&&!k&&!E&&!w)return P;Uo(v,P)&&(v=P)}}if(x.wildcard&&Uo(m,y))for(const P of x.wildcard){const{prefix:J,suffix:Q}=P;if(J&&(M||!(P.caseSensitive?T:A??=T.toLowerCase()).startsWith(J)))continue;if(Q){if(M)continue;const pe=t.slice(b).join("/").slice(-Q.length);if((P.caseSensitive?pe:pe.toLowerCase())!==Q)continue}const se={node:P,index:d,skipped:w,depth:S,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:D};if(!(P.skipOnParamError&&!zh(e,t,se))){m=se;break}}if(x.optional){const P=w|1<<S,J=S+1;for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q];f.push({node:se,index:b,skipped:P,depth:J,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:D})}if(!M)for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q],{prefix:pe,suffix:ke}=se;if(pe||ke){const je=se.caseSensitive?T:A??=T.toLowerCase();if(pe&&!je.startsWith(pe)||ke&&!je.endsWith(ke))continue}f.push({node:se,index:b+1,skipped:w,depth:J,statics:C,dynamics:k,optionals:E+1,extract:R,rawParams:_,parsedParams:D})}}if(!M&&x.dynamic&&T)for(let P=x.dynamic.length-1;P>=0;P--){const J=x.dynamic[P],{prefix:Q,suffix:se}=J;if(Q||se){const pe=J.caseSensitive?T:A??=T.toLowerCase();if(Q&&!pe.startsWith(Q)||se&&!pe.endsWith(se))continue}f.push({node:J,index:b+1,skipped:w,depth:S+1,statics:C,dynamics:k+1,optionals:E,extract:R,rawParams:_,parsedParams:D})}if(!M&&x.staticInsensitive){const P=x.staticInsensitive.get(A??=T.toLowerCase());P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:D})}if(!M&&x.static){const P=x.static.get(T);P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:D})}if(x.pathless){const P=S+1;for(let J=x.pathless.length-1;J>=0;J--){const Q=x.pathless[J];f.push({node:Q,index:b,skipped:w,depth:P,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:D})}}}if(v&&m)return Uo(m,v)?v:m;if(v)return v;if(m)return m;if(a&&p){let y=p.index;for(let b=0;b<p.index;b++)y+=t[b].length;const x=y===e.length?"/":e.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(x),p}return null}function zh(e,t,s){try{const[a,r]=gS(e,t,s);s.rawParams=a,s.extract=r;const c=s.node.parse(a);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,c),!0}catch{return null}}function Uo(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===pa)>(e.node.kind===pa)||t.node.kind===pa==(e.node.kind===pa)&&t.depth>e.depth))):!0}function eu(e){return Wm(e.filter(t=>t!==void 0).join("/"))}function Wm(e){return e.replace(/\/{2,}/g,"/")}function yS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Li(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function vS(e){return Li(yS(e))}function mu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function S_(e,t,s){return mu(e,s)===mu(t,s)}function j_({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let d;if(a){d=r?t:c?e:e+"\0"+t;const y=a.get(d);if(y)return y}let f;if(c)f=e.split("/");else if(r)f=t.split("/");else{for(f=e.split("/");f.length>1&&Xo(f)==="";)f.pop();const y=t.split("/");for(let x=0,b=y.length;x<b;x++){const w=y[x];w===""?x?x===b-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}f.length>1&&(Xo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let m,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const x=f[y];if(!x)continue;m=Jm(x,0,m);const b=m[0];if(b===0){p+=x;continue}const w=m[5],S=x.substring(0,m[1]),C=x.substring(m[4],w),k=x.substring(m[2],m[3]);b===1?p+=S||C?`${S}{$${k}}${C}`:`$${k}`:b===2?p+=S||C?`${S}{$}${C}`:"$":p+=`${S}{-$${k}}${C}`}p=Wm(p);const v=p||"/";return d&&a&&a.set(d,v),v}function w_(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function Eh(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>hx(r,s)).join("/"):hx(a,s)}function fx({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,m,p="";for(;f<d;){const v=f;m=Jm(e,v,m);const y=m[5];if(f=y+1,v===y)continue;const x=m[0];if(x===0){p+="/"+e.substring(v,y);continue}if(x===2){const b=t._splat;c._splat=b,c["*"]=b;const w=e.substring(v,m[1]),S=e.substring(m[4],y);if(!b){r=!0,(w||S)&&(p+="/"+w+S);continue}const C=Eh("_splat",t,s);p+="/"+w+C+S;continue}if(x===1){const b=e.substring(m[2],m[3]);!r&&!(b in t)&&(r=!0),c[b]=t[b];const w=e.substring(v,m[1]),S=e.substring(m[4],y),C=Eh(b,t,s)??"undefined";p+="/"+w+C+S;continue}if(x===3){const b=e.substring(m[2],m[3]),w=t[b];if(w==null)continue;c[b]=w;const S=e.substring(v,m[1]),C=e.substring(m[4],y),k=Eh(b,t,s)??"";p+="/"+S+k+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:r}}function hx(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function fn(e){return!!e?.isNotFound}function N_(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var fm="tsr-scroll-restoration-v1_3",C_=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function k_(){const e=N_();if(!e)return null;const t=e.getItem(fm);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=Ei(a,s)||s;try{e.setItem(fm,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Dc=k_(),__=e=>e.state.__TSR_key||e.href;function z_(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}var pu=!1;function E_({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,m=d[f];pu=!0;e:{if(a&&m&&Object.keys(m).length>0){for(const y in m){const x=m[y];if(y==="window")window.scrollTo({top:x.scrollY,left:x.scrollX,behavior:s});else if(y){const b=document.querySelector(y);b&&(b.scrollLeft=x.scrollX,b.scrollTop=x.scrollY)}}break e}const p=(c??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const x=document.getElementById(p);x&&x.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),r)for(const y of r){if(y==="window")continue;const x=typeof y=="function"?y():document.querySelector(y);x&&x.scrollTo(v)}}pu=!1}function R_(e,t){if(!Dc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Dc))return;e.isScrollRestorationSetup=!0,pu=!1;const s=e.options.getScrollRestorationKey||__;window.history.scrollRestoration="manual";const a=r=>{if(pu||!e.isScrollRestoring)return;let c="";if(r.target===document||r.target===window)c="window";else{const f=r.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=z_(r.target)}const d=s(e.state.location);Dc.set(f=>{const m=f[d]||={},p=m[c]||={};if(c==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",C_(a,100),!0),e.subscribe("onRendered",r=>{const c=s(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(E_({storageKey:fm,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Dc.set(d=>(d[c]||={},d)))})}function T_(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(t)}}}function A_(e,t=String){const s=new URLSearchParams;for(const a in e){const r=e[a];r!==void 0&&s.set(a,t(r))}return s.toString()}function Rh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function O_(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,r]of t.entries()){const c=s[a];c==null?s[a]=Rh(r):Array.isArray(c)?c.push(Rh(r)):s[a]=[c,Rh(r)]}return s}var L_=M_(JSON.parse),D_=$_(JSON.stringify,JSON.parse);function M_(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=O_(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function $_(e,t){const s=typeof t=="function";function a(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(s&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const c=A_(r,a);return c?`?${c}`:""}}var ba="__root__";function ep(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function Sn(e){return e instanceof Response&&!!e.options}function U_(e){return{input:({url:t})=>{for(const s of e)t=hm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=xS(e[s],t);return t}}}function P_(e){const t=vS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:d})=>{const f=e.caseSensitive?d.pathname:d.pathname.toLowerCase();return f===r?d.pathname="/":f.startsWith(c)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=eu(["/",t,d.pathname]),d)}}function hm(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function xS(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}var vt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(vt||{});function bS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(p,v,y){const x=v.depsTail;if(x!==void 0&&x.dep===p)return;const b=x!==void 0?x.nextDep:v.deps;if(b!==void 0&&b.dep===p){b.version=y,v.depsTail=b;return}const w=p.subsTail;if(w!==void 0&&w.version===y&&w.sub===v)return;const S=v.depsTail=p.subsTail={version:y,dep:p,sub:v,prevDep:x,nextDep:b,prevSub:w,nextSub:void 0};b!==void 0&&(b.prevDep=S),x!==void 0?x.nextDep=S:v.deps=S,w!==void 0?w.nextSub=S:p.subs=S}function r(p,v=p.sub){const y=p.dep,x=p.prevDep,b=p.nextDep,w=p.nextSub,S=p.prevSub;return b!==void 0?b.prevDep=x:v.depsTail=x,x!==void 0?x.nextDep=b:v.deps=b,w!==void 0?w.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=w:(y.subs=w)===void 0&&s(y),b}function c(p){let v=p.nextSub,y;e:do{const x=p.sub;let b=x.flags;if(b&60?b&12?b&4?!(b&48)&&m(p,x)?(x.flags=b|40,b&=1):b=0:x.flags=b&-9|32:b=0:x.flags=b|32,b&2&&t(x),b&1){const w=x.subs;if(w!==void 0){const S=(p=w).nextSub;S!==void 0&&(y={value:v,prev:y},v=S);continue}}if((p=v)!==void 0){v=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){v=p.nextSub;continue e}break}while(!0)}function d(p,v){let y,x=0,b=!1;e:do{const w=p.dep,S=w.flags;if(v.flags&16)b=!0;else if((S&17)===17){if(e(w)){const C=w.subs;C.nextSub!==void 0&&f(C),b=!0}}else if((S&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=w.deps,v=w,++x;continue}if(!b){const C=p.nextDep;if(C!==void 0){p=C;continue}}for(;x--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(p=y.value,y=y.prev):p=C,b){if(e(v)){k&&f(C),v=p.sub;continue}b=!1}else v.flags&=-33;v=p.sub;const E=p.nextDep;if(E!==void 0){p=E;continue e}}return b}while(!0)}function f(p){do{const v=p.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((p=p.nextSub)!==void 0)}function m(p,v){let y=v.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let tp=0,ua=0,Fo=0;const Gs=[],{link:I4,unlink:SS,propagate:B4,checkDirty:I_,shallowPropagate:q4}=bS({update(e){return e.depsTail!==void 0?G_(e):K_(e)},notify(e){let t=Fo,s=t;do if(Gs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Fo=t;s<--t;){const a=Gs[s];Gs[s++]=Gs[t],Gs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Tu(e)):V_.call(e)}});function B_(){return tp}function q_(){++tp}function H_(){--tp||Z_()}function G_(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Tu(e)}}function K_(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function F_(e){const t=e.flags;if(t&16||t&32&&I_(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Tu(e)}}else e.flags=2}function Z_(){try{for(;ua<Fo;){const e=Gs[ua];Gs[ua++]=void 0,F_(e)}}finally{for(;ua<Fo;){const e=Gs[ua];Gs[ua++]=void 0,e.flags|=10}ua=0,Fo=0}}function V_(){this.depsTail=void 0,this.flags=0,Tu(this);const e=this.subs;e!==void 0&&SS(e)}function Tu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=SS(s,e)}function np(e,t,s){const a=typeof e=="object",r=a?e:void 0;return{next:(a?e.next:e)?.bind(r),error:(a?e.error:t)?.bind(r),complete:(a?e.complete:s)?.bind(r)}}const mm=[];let tu=0;const{link:mx,unlink:Q_,propagate:Y_,checkDirty:jS,shallowPropagate:px}=bS({update(e){return e._update()},notify(e){mm[pm++]=e,e.flags&=~vt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=vt.Mutable|vt.Dirty,gu(e))}});let Mc=0,pm=0,ys;function gu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Q_(s,e)}function wS(){if(!(B_()>0)){for(;Mc<pm;){const e=mm[Mc];mm[Mc++]=void 0,e.notify()}Mc=0,pm=0}}function NS(e,t){const s=typeof e=="function",a=e,r={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?vt.None:vt.Mutable,get(){return ys!==void 0&&mx(r,ys,tu),r._snapshot},subscribe(c){const d=np(c),f={current:!1},m=J_(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(c){const d=ys,f=Object.is;if(s)ys=r,++tu,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=vt.Mutable|vt.RecursedCheck);try{const m=r._snapshot,p=typeof c=="function"?c(m):c===void 0&&s?a(m):c;return m===void 0||!f(m,p)?(r._snapshot=p,!0):!1}finally{ys=d,s&&(r.flags&=~vt.RecursedCheck),gu(r)}}};return s?(r.flags=vt.Mutable|vt.Dirty,r.get=function(){const c=r.flags;if(c&vt.Dirty||c&vt.Pending&&jS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&px(d)}}else c&vt.Pending&&(r.flags=c&~vt.Pending);return ys!==void 0&&mx(r,ys,tu),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(Y_(d),px(d),wS())}},r}function J_(e){const t=()=>{const a=ys;ys=s,++tu,s.depsTail=void 0,s.flags=vt.Watching|vt.RecursedCheck;try{return e()}finally{ys=a,s.flags&=~vt.RecursedCheck,gu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:vt.Watching|vt.RecursedCheck,notify(){const a=this.flags;a&vt.Dirty||a&vt.Pending&&jS(this.deps,this)?t():this.flags=vt.Watching},stop(){this.flags=vt.None,this.depsTail=void 0,gu(this)}};return t(),s}class X_{constructor(t){this.atom=NS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(np(t))}}class W_{constructor(t){this.atom=NS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(np(t))}}function ez(e){return typeof e=="function"?new W_(e):new X_(e)}function tz(e){try{q_(),e()}finally{H_(),wS()}}function Zo(e){let t;return tz(()=>{t=e()}),t}var gm=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Au=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),Sa=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const d=e.matches[c];if(!d)continue;const f=e.router.getMatch(d.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},gx=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let d=c;d>=0;d--){const f=e.matches[d];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return d}return s?c:r},Ri=(e,t,s)=>{if(!(!Sn(s)&&!fn(s)))throw Sn(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,a=>({...a,status:Sn(s)?"redirected":a.status==="pending"?"success":a.status,context:Sa(e,t.index),isFetching:!1,error:s})),fn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Sn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},CS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},yx=(e,t,s)=>{const a=Sa(e,s);e.updateMatch(t,r=>({...r,context:a}))},Po=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],d=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,Ri(e,e.router.getMatch(r),s);try{d.options.onError?.(s)}catch(f){s=f,Ri(e,e.router.getMatch(r),s)}e.updateMatch(r,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Sn(s)&&!fn(s)&&(e.serialError??=s)},kS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Au(e,t)&&(s.options.loader||s.options.beforeLoad||zS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{gm(e)},r);a._nonReactive.pendingTimeout=c}},nz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;kS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ri(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},sz=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Tr(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Po(e,s,d,"PARSE_PARAMS"),f&&Po(e,s,f,"VALIDATE_SEARCH"),kS(e,t,a,r);const m=new AbortController;let p=!1;const v=()=>{p||(p=!0,e.updateMatch(t,_=>({..._,isFetching:"beforeLoad",fetchCount:_.fetchCount+1,abortController:m})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!a.options.beforeLoad){Zo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=Tr();const x={...Sa(e,s,!1),...r.__routeContext},{search:b,params:w,cause:S}=r,C=Au(e,t),k={search:b,abortController:m,params:w,preload:C,context:x,location:e.location,navigate:_=>e.router.navigate({..._,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},E=_=>{if(_===void 0){Zo(()=>{v(),y()});return}(Sn(_)||fn(_))&&(v(),Po(e,s,_,"BEFORE_LOAD")),Zo(()=>{v(),e.updateMatch(t,D=>({...D,__beforeLoadContext:_})),y()})};let R;try{if(R=a.options.beforeLoad(k),Wo(R))return v(),R.catch(_=>{Po(e,s,_,"BEFORE_LOAD")}).then(E)}catch(_){v(),Po(e,s,_,"BEFORE_LOAD")}E(R)},iz=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>sz(e,s,t,r),f=()=>{if(CS(e,s))return;const m=nz(e,s,r);return Wo(m)?m.then(d):d()};return c()},az=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([c,d,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:d,styles:c?.styles}))},_S=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:m,cause:p}=e.router.getMatch(s),v=Sa(e,a),y=Au(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:m,context:v,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:y?"preload":p,route:r,...e.router.options.additionalContext}},vx=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(s_??e.router.isServer)||c.ssr===!0)&&el(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,m=f?.(_S(e,t,s,a,r)),p=!!f&&Wo(m);if((p||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=p?await m:m;Ri(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,x=>({...x,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:Sa(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let f=d;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:Sa(e,a)}));return}const m=c._nonReactive.minPendingPromise;m&&await m,fn(d)&&await r.options.notFoundComponent?.preload?.(),Ri(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(p){f=p,Ri(e,e.router.getMatch(s),p)}!Sn(f)&&!fn(f)&&await el(r,["errorComponent"]),e.updateMatch(s,p=>({...p,error:f,context:Sa(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),Ri(e,d,c)}},rz=async(e,t,s)=>{async function a(b,w,S,C,k){const E=Date.now()-w.updatedAt,R=b?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,_=k.options.shouldReload,D=typeof _=="function"?_(_S(e,t,r,s,k)):_,{status:M,invalid:T}=C,A=E>R&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=M==="success"&&(T||(D??A)),b&&k.options.preload===!1||(d&&!e.sync&&v?(f=!0,(async()=>{try{await vx(e,t,r,s,k);const P=e.router.getMatch(r);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){Sn(P)&&await e.router.navigate(P.options)}})()):M!=="success"||d?await vx(e,t,r,s,k):yx(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const m=e.router.looseRoutesById[c],p=m.options.loader,v=((typeof p=="function"?void 0:p?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(CS(e,r)){if(!e.router.getMatch(r))return e.matches[s];yx(e,r,s)}else{const b=e.router.getMatch(r),w=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Au(e,r);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload&&v)return b;await b._nonReactive.loaderPromise;const C=e.router.getMatch(r),k=C._nonReactive.error||C.error;k&&Ri(e,C,k),C.status==="pending"&&await a(S,b,w,C,m)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=Tr(),C!==k.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,b,w,k,m)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const x=f?y.isFetching:!1;return x!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,b=>({...b,isFetching:x,invalid:!1})),e.router.getMatch(r)):y};async function xx(e){const t=e,s=[];t.router.state.matches.some(x=>x._forcePending)&&gm(t);let a;for(let x=0;x<t.matches.length;x++){try{const b=iz(t,x);Wo(b)&&await b}catch(b){if(Sn(b))throw b;if(fn(b))a=b;else if(!t.preload)throw b;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?gx(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,m;for(let x=0;x<d;x++)s.push(rz(t,s,x));try{await Promise.all(s)}catch{const x=await Promise.allSettled(s);for(const b of x){if(b.status!=="rejected")continue;const w=b.reason;if(Sn(w))throw w;fn(w)?f??=w:m??=w}if(m!==void 0)throw m}const p=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!p&&a&&t.preload)return t.matches;if(p){const x=gx(t,p);Ui(x!==void 0);const b=t.matches[x],w=t.router.looseRoutesById[b.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),p.routeId=b.routeId;const C=b.routeId===t.router.routeTree.id;t.updateMatch(b.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),v=x,await el(w,["notFoundComponent"])}else if(!t.preload){const x=t.matches[0];x.globalNotFound||t.router.getMatch(x.id)?.globalNotFound&&t.updateMatch(x.id,b=>({...b,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const x=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await el(x,["errorComponent"])}for(let x=0;x<=v;x++){const{id:b,routeId:w}=t.matches[x],S=t.router.looseRoutesById[w];try{const C=az(t,b,S);if(C){const k=await C;t.updateMatch(b,E=>({...E,...k}))}}catch(C){console.error(`Error executing head for route ${w}:`,C)}}const y=gm(t);if(Wo(y)&&await y,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function bx(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function el(e,t=nu){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:r,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===nu?(()=>{if(e._componentsPromise===void 0){const a=bx(e,nu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():bx(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function zS(e){for(const t of nu)if(e.options[t]?.preload)return!0;return!1}var nu=["component","errorComponent","pendingComponent","notFoundComponent"],Di="__TSR_index",Sx="popstate",jx="beforeunload";function oz(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...m})=>{if(f?.ignoreBlocker??!1){d();return}const p=e.getBlockers?.()??[],v=m.type==="PUSH"||m.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const y of p){const x=yu(m.path,m.state);if(await y.blockerFn({currentLocation:t,nextLocation:x,action:m.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,m)=>{const p=t.state[Di];f=wx(p+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:d,state:f})},replace:(d,f,m)=>{const p=t.state[Di];f=wx(p,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:m,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),r({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>t.state[Di]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const m=e.getBlockers?.()??[];e.setBlockers?.(m.filter(p=>p!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function wx(e,t){t||(t={});const s=sp();return{...t,key:s,__TSR_key:s,[Di]:e}}function lz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=A=>r=A,f=(A=>A),m=(()=>yu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=sp();t.history.replaceState({[Di]:0,key:A,__TSR_key:A},"")}let p=m(),v,y=!1,x=!1,b=!1,w=!1;const S=()=>p;let C,k;const E=()=>{C&&(T._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),T._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},R=(A,P,J)=>{const Q=f(P);k||(v=p),p=yu(P,J),C={href:Q,state:J,isPush:C?.isPush||A==="push"},k||(k=Promise.resolve().then(()=>E()))},_=A=>{p=m(),T.notify({type:A})},D=async()=>{if(x){x=!1;return}const A=m(),P=A.state[Di]-p.state[Di],J=P===1,Q=P===-1,se=!J&&!Q||y;y=!1;const pe=se?"GO":Q?"BACK":"FORWARD",ke=se?{type:"GO",index:P}:{type:Q?"BACK":"FORWARD"};if(b)b=!1;else{const je=c();if(typeof document<"u"&&je.length){for(const B of je)if(await B.blockerFn({currentLocation:p,nextLocation:A,action:pe})){x=!0,t.history.go(1),T.notify(ke);return}}}p=m(),T.notify(ke)},M=A=>{if(w){w=!1;return}let P=!1;const J=c();if(typeof document<"u"&&J.length)for(const Q of J){const se=Q.enableBeforeUnload??!0;if(se===!0){P=!0;break}if(typeof se=="function"&&se()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},T=oz({getLocation:S,getLength:()=>t.history.length,pushState:(A,P)=>R("push",A,P),replaceState:(A,P)=>R("replace",A,P),back:A=>(A&&(b=!0),w=!0,t.history.back()),forward:A=>{A&&(b=!0),w=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(jx,M,{capture:!0}),t.removeEventListener(Sx,D)},onBlocked:()=>{v&&p!==v&&(p=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(jx,M,{capture:!0}),t.addEventListener(Sx,D),t.history.pushState=function(...A){const P=s.apply(t.history,A);return T._ignoreSubscribers||_("PUSH"),P},t.history.replaceState=function(...A){const P=a.apply(t.history,A);return T._ignoreSubscribers||_("REPLACE"),P},T}function cz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function yu(e,t){const s=cz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=sp();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Di]:0,key:c,__TSR_key:c}}}function sp(){return(Math.random()+1).toString(36).substring(7)}function ja(e){const t=e.resolvedLocation,s=e.location;return{fromLocation:t,toLocation:s,pathChanged:t?.pathname!==s.pathname,hrefChanged:t?.href!==s.href,hashChanged:t?.hash!==s.hash}}function uz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var dz=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const s=this.options,a=this.basepath??s?.basepath??"/",r=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=w_(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=lz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=hu(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=ez(hz(this.latestLocation)),R_(this));let d=!1;const f=this.options.basepath??"/",m=this.options.rewrite;if(r||a!==f||c!==m){this.basepath=f;const p=[],v=vS(f);v&&v!=="/"&&p.push(P_({basepath:f})),m&&p.push(m),this.rewrite=p.length===0?void 0:p.length===1?p[0]:U_(p),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(p=>({...p,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=y_(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&f_(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:m,hash:p,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(m),k=this.options.stringifySearch(C);return{href:f+k+p,publicHref:v,pathname:$o(f).path,external:!1,searchStr:k,search:ca(s?.search,C),hash:$o(p.slice(1)).path,state:ma(s?.state,y)}}const x=new URL(v,this.origin),b=hm(this.rewrite,x),w=this.options.parseSearch(b.search),S=this.options.stringifySearch(w);return b.search=S,{href:b.href.replace(b.origin,""),publicHref:v,pathname:$o(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:S,search:ca(s?.search,w),hash:$o(b.hash.slice(1)).path,state:ma(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:d}=r.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>j_({base:t,to:Wm(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,a)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},a):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>mz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,m=this.resolvePathWithBase(f,"."),p=d.search,v=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(m,`${r.to}`):this.resolvePathWithBase(m,"."),x=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?v:Object.assign(v,Ei(r.params,v)),b=this.getMatchedRoutes(y);let w=b.matchedRoutes;if((!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(x).length>0)for(const P of w){const J=P.options.params?.stringify??P.options.stringifyParams;if(J)try{Object.assign(x,J(x))}catch{}}const S=t.leaveParams?y:$o(fx({path:y,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=p;if(t._includeValidateSearch&&this.options.search?.strict){const P={};w.forEach(J=>{if(J.options.validateSearch)try{Object.assign(P,su(J.options.validateSearch,{...P,...C}))}catch{}}),C=P}C=pz({search:C,dest:r,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),C=ca(p,C);const k=this.options.stringifySearch(C),E=r.hash===!0?c.hash:r.hash?Ei(r.hash,c.hash):void 0,R=E?`#${E}`:"";let _=r.state===!0?c.state:r.state?Ei(r.state,c.state):{};_=ma(c.state,_);const D=`${S}${k}${R}`;let M,T,A=!1;if(this.rewrite){const P=new URL(D,this.origin),J=xS(this.rewrite,P);M=P.href.replace(P.origin,""),J.origin!==this.origin?(T=J.href,A=!0):T=J.pathname+J.search+J.hash}else M=c_(D),T=M;return{publicHref:T,href:M,pathname:S,search:C,searchStr:k,state:_,hash:E??"",external:A,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const d=s(r);let f=c?s(c):void 0;if(!f){const m=Object.create(null);if(this.options.routeMasks){const p=h_(d.pathname,this.processedTree);if(p){Object.assign(m,p.rawParams);const{from:v,params:y,...x}=p.route,b=y===!1||y===null?Object.create(null):(y??!0)===!0?m:Object.assign(m,Ei(y,m));c={from:t.from,...x,params:b},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const m=xa(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),m},c=Li(this.latestLocation.href)===Li(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Tr(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:m,...p}=a;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const v=this.history.location.state.__TSR_index,y=yu(d,{__TSR_index:t?v:v+1}),x=new URL(y.pathname,this.origin);f.to=hm(this.rewrite,x).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const m=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const p=this.commitLocation({...m,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const m=this.buildLocation({to:t,...c});a=a??m.publicHref,r=r??m.publicHref}const f=!d&&r?r:a;if(fu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const m=this.history.getBlockers?.()??[];for(const p of m)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const m=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ja({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...ja({resolvedLocation:p,location:m})}),await xx({router:this,sync:t?.sync,forceStaleReload:c.href===m.href,matches:this.state.pendingMatches,location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],x=[],b=[];Zo(()=>{this.__store.setState(w=>{const S=w.matches,C=w.pendingMatches||w.matches;return v=S.filter(k=>!C.some(E=>E.id===k.id)),y=S.filter(k=>!C.some(E=>E.routeId===k.routeId)),x=C.filter(k=>!S.some(E=>E.routeId===k.routeId)),b=C.filter(k=>S.some(E=>E.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[x,"onEnter"],[b,"onStay"]].forEach(([w,S])=>{w.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(m){Sn(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):fn(m)&&(a=m),this.__store.setState(p=>({...p,statusCode:s?s.status:a?404:p.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(ja({resolvedLocation:c,location:r})):s.types;if(d===!1){t();return}a={update:t,types:d}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:uz(r.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(r=>({...r,[a]:r[a]?.map(c=>c.id===t?s(c):c)})))})},this.getMatch=t=>{const s=a=>a.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=a=>t?.filter?.(a)??!0?{...a,invalid:!0,...t?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(s),cachedMatches:a.cachedMatches.map(s),pendingMatches:a.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),r=this.getParsedLocationHref(a);t.options.href=r,t.headers.set("Location",r)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const r=a.pathname+a.search+a.hash;t.options.href=r,t.headers.set("Location",r)}}catch{}if(t.options.href&&!t.options._builtLocation&&fu(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const s=t?.filter;s!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(r=>!s(r))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const r=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:t})},this.loadRouteChunk=el,this.preloadRoute=async t=>{const s=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),c=new Set([...r,...this.state.cachedMatches.map(d=>d.id)]);Zo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await xx({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(m=>m.id===d?f(m):m):this.updateMatch(d,f)}}),a}catch(d){if(Sn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});fn(d)||console.error(d);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=m_(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!xa(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?xa(c.search,r.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??D_,parseSearch:e.parseSearch??L_,protocolAllowlist:e.protocolAllowlist??l_}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const s=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:r,parsedParams:c}=s;let{matchedRoutes:d}=s,f=!1;(a?a.path!=="/"&&r["**"]:Li(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const m=f?yz(this.options.notFoundMode,d):void 0,p=new Array(d.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const x=d[y],b=p[y-1];let w,S,C;{const pe=b?.search??e.search,ke=b?._strictSearch??void 0;try{const je=su(x.options.validateSearch,{...pe})??void 0;w={...pe,...je},S={...ke,...je},C=void 0}catch(je){let B=je;if(je instanceof vu||(B=new vu(je.message,{cause:je})),t?.throwOnError)throw B;w=pe,S={},C=B}}const k=x.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:_}=fx({path:x.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),D=x.id+R+E,M=this.getMatch(D),T=v.get(x.id),A=M?._strictParams??_;let P;if(!M)try{Nx(x,_,c,A)}catch(pe){if(fn(pe)||Sn(pe)?P=pe:P=new fz(pe.message,{cause:pe}),t?.throwOnError)throw P}Object.assign(r,A);const J=T?"stay":"enter";let Q;if(M)Q={...M,cause:J,params:T?.params??r,_strictParams:A,search:ca(T?T.search:M.search,w),_strictSearch:S};else{const pe=x.options.loader||x.options.beforeLoad||x.lazyFn||zS(x)?"pending":"success";Q={id:D,ssr:x.options.ssr,index:y,routeId:x.id,params:T?.params??r,_strictParams:A,pathname:R,updatedAt:Date.now(),search:T?ca(T.search,w):w,_strictSearch:S,searchError:void 0,status:pe,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Tr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:J,loaderDeps:T?ma(T.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}t?.preload||(Q.globalNotFound=m===x.id),Q.searchError=C;const se=this.getParentContext(b);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},p[y]=Q}for(let y=0;y<p.length;y++){const x=p[y],b=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),S=v.get(x.routeId);if(x.params=S?ca(S.params,r):r,!w){const C=p[y-1],k=this.getParentContext(C);if(b.options.context){const E={deps:x.loaderDeps,params:x.params,context:k??{},location:e,navigate:R=>this.navigate({...R,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:p,routeId:b.id};x.__routeContext=b.options.context(E)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext}}}return p}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Xo(t),c={...e.search};for(const p of t)try{Object.assign(c,su(p.options.validateSearch,c))}catch{}const d=Xo(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let m;if(f)m=d.params;else{const p=Object.assign(Object.create(null),s);for(const v of t)try{Nx(v,s,a??{},p)}catch{}m=p}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:m}}},vu=class extends Error{},fz=class extends Error{};function hz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function su(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new vu("Async validation not supported");if(s.issues)throw new vu(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function mz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Li(e);let c,d;const f=p_(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),d=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:d}}function pz({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return gz(s)(e,t,a??!1)}function gz(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let m=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(m=r.options.preSearchFilters.reduce((v,y)=>y(v),d));const p=f(m);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),p):p};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const m=f(d);if(!t._includeValidateSearch)return m;try{return{...m,...su(r.options.validateSearch,m)??void 0}}catch{return m}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:Ei(c.search,r):{}};t.middlewares.push(s);const a=(r,c,d)=>{if(r>=d.length)return c;const f=d[r];return f({search:c,next:p=>a(r+1,p,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function yz(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const a=t[s];if(a.children)return a.id}return ba}function Nx(e,t,s,a){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=r(a);Object.assign(a,c)}}var vz="Error preloading route! ☝️",ES=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,a=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=ba:this.parentRoute||Ui(!1);let r=a?ba:s?.path;r&&r!=="/"&&(r=yS(r));const c=s?.id||r;let d=a?ba:eu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=eu(["/",d]));const f=d==="__root__"?"/":eu([this.parentRoute.fullPath,r]);this._path=r,this._id=d,this._fullPath=f,this._to=Li(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>ep({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},xz=class extends ES{constructor(e){super(e)}};function ip(e){const t=e.errorComponent??ap;return o.jsx(bz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var bz=class extends N.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function ap({error:e}){const[t,s]=N.useState(!1);return o.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[o.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),o.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(a=>!a),children:t?"Hide Error":"Show Error"})]}),o.jsx("div",{style:{height:".25rem"}}),t?o.jsx("div",{children:o.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?o.jsx("code",{children:e.message}):null})}):null]})}function Sz({children:e,fallback:t=null}){return RS()?o.jsx(is.Fragment,{children:e}):o.jsx(is.Fragment,{children:t})}function RS(){return is.useSyncExternalStore(jz,()=>!0,()=>!1)}function jz(){return()=>{}}var TS=N.createContext(null);function Zn(e){const t=N.useContext(TS);return e?.warn,t}var Th={exports:{}},Ah={},Oh={exports:{}},Lh={};var Cx;function wz(){if(Cx)return Lh;Cx=1;var e=ol();function t(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),S=w[0].inst,C=w[1];return c(function(){S.value=b,S.getSnapshot=x,m(S)&&C({inst:S})},[y,b,x]),r(function(){return m(S)&&C({inst:S}),y(function(){m(S)&&C({inst:S})})},[y]),d(b),b}function m(y){var x=y.getSnapshot;y=y.value;try{var b=x();return!s(y,b)}catch{return!0}}function p(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Lh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Lh}var kx;function Nz(){return kx||(kx=1,Oh.exports=wz()),Oh.exports}var _x;function Cz(){if(_x)return Ah;_x=1;var e=ol(),t=Nz();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,m=e.useDebugValue;return Ah.useSyncExternalStoreWithSelector=function(p,v,y,x,b){var w=c(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=f(function(){function k(M){if(!E){if(E=!0,R=M,M=x(M),b!==void 0&&S.hasValue){var T=S.value;if(b(T,M))return _=T}return _=M}if(T=_,a(R,M))return T;var A=x(M);return b!==void 0&&b(T,A)?(R=M,T):(R=M,_=A)}var E=!1,R,_,D=y===void 0?null:y;return[function(){return k(v())},D===null?void 0:function(){return k(D())}]},[v,y,x,b]);var C=r(p,w[0],w[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),m(C),C},Ah}var zx;function kz(){return zx||(zx=1,Th.exports=Cz()),Th.exports}var _z=kz();function zz(e,t){return e===t}function Ez(e,t,s=zz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return _z.useSyncExternalStoreWithSelector(a,r,r,t,s)}function jn(e){const t=Zn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return Ez(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ma(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Ou=N.createContext(void 0),Rz=N.createContext(void 0);function Bi(e){const t=N.useContext(e.from?Rz:Ou);return jn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Ui(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function rp(e){return Bi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function op(e){const{select:t,...s}=e;return Bi({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Lu(e){return Bi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Du(e){return Bi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ka(e){const t=Zn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function lp(e){return Bi({...e,select:t=>e.select?e.select(t.context):t.context})}var cp=Jb();const Tz=Yb(cp);function Az(e,t){const s=Zn(),a=n_(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:m,preloadDelay:p,hashScrollIntoView:v,replace:y,startTransition:x,resetScroll:b,viewTransition:w,children:S,target:C,disabled:k,style:E,className:R,onClick:_,onBlur:D,onFocus:M,onMouseEnter:T,onMouseLeave:A,onTouchStart:P,ignoreBlocker:J,params:Q,search:se,hash:pe,state:ke,mask:je,reloadDocument:B,unsafeRelative:G,from:oe,_fromLocation:q,...X}=e,O=RS(),F=jn({select:ze=>{const $e=ze.matches[ze.matches.length-1];return{search:$e?.search,hash:ze.location.hash,path:$e?.pathname}},structuralSharing:!0}),ie=e.from,re=N.useMemo(()=>({...e,from:ie}),[s,F,ie,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=N.useMemo(()=>s.buildLocation({...re}),[s,re]),he=ue.maskedLocation?ue.maskedLocation.publicHref:ue.publicHref,de=ue.maskedLocation?ue.maskedLocation.external:ue.external,Me=N.useMemo(()=>Uz(he,de,s.history,k),[k,de,he,s.history]),ge=N.useMemo(()=>{if(Me?.external)return fu(Me.href,s.protocolAllowlist)?void 0:Me.href;if(!Pz(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),fu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Me,s.protocolAllowlist]),Ze=jn({select:ze=>{if(ge)return!1;if(d?.exact){if(!S_(ze.location.pathname,ue.pathname,s.basepath))return!1}else{const $e=mu(ze.location.pathname,s.basepath),pt=mu(ue.pathname,s.basepath);if(!($e.startsWith(pt)&&($e.length===pt.length||$e[pt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!xa(ze.location.search,ue.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?O&&ze.location.hash===ue.hash:!0}}),it=Ze?Ei(r,{})??Oz:Dh,me=Ze?Dh:Ei(c,{})??Dh,We=[R,it.className,me.className].filter(Boolean).join(" "),dt=(E||it.style||me.style)&&{...E,...it.style,...me.style},[sn,kt]=N.useState(!1),an=N.useRef(!1),Vt=e.reloadDocument||ge?!1:m??s.options.defaultPreload,_t=p??s.options.defaultPreloadDelay??0,zt=N.useCallback(()=>{s.preloadRoute({...re,_builtLocation:ue}).catch(ze=>{console.warn(ze),console.warn(vz)})},[s,re,ue]);t_(a,N.useCallback(ze=>{ze?.isIntersecting&&zt()},[zt]),$z,{disabled:!!k||Vt!=="viewport"}),N.useEffect(()=>{an.current||!k&&Vt==="render"&&(zt(),an.current=!0)},[k,zt,Vt]);const mn=ze=>{const $e=ze.currentTarget.getAttribute("target"),pt=C!==void 0?C:$e;if(!k&&!Iz(ze)&&!ze.defaultPrevented&&(!pt||pt==="_self")&&ze.button===0){ze.preventDefault(),cp.flushSync(()=>{kt(!0)});const rn=s.subscribe("onResolved",()=>{rn(),kt(!1)});s.navigate({...re,replace:y,resetScroll:b,hashScrollIntoView:v,startTransition:x,viewTransition:w,ignoreBlocker:J})}};if(ge)return{...X,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...E&&{style:E},...R&&{className:R},..._&&{onClick:_},...D&&{onBlur:D},...M&&{onFocus:M},...T&&{onMouseEnter:T},...A&&{onMouseLeave:A},...P&&{onTouchStart:P}};const le=ze=>{if(k||Vt!=="intent")return;if(!_t){zt();return}const $e=ze.currentTarget;if(Io.has($e))return;const pt=setTimeout(()=>{Io.delete($e),zt()},_t);Io.set($e,pt)},Ie=ze=>{k||Vt!=="intent"||zt()},Be=ze=>{if(k||!Vt||!_t)return;const $e=ze.currentTarget,pt=Io.get($e);pt&&(clearTimeout(pt),Io.delete($e))};return{...X,...it,...me,href:Me?.href,ref:a,onClick:pr([_,mn]),onBlur:pr([D,Be]),onFocus:pr([M,le]),onMouseEnter:pr([T,le]),onMouseLeave:pr([A,Be]),onTouchStart:pr([P,Ie]),disabled:!!k,target:C,...dt&&{style:dt},...We&&{className:We},...k&&Lz,...Ze&&Dz,...O&&sn&&Mz}}var Dh={},Oz={className:"active"},Lz={role:"link","aria-disabled":!0},Dz={"data-status":"active","aria-current":"page"},Mz={"data-transitioning":"transitioning"},Io=new WeakMap,$z={rootMargin:"100px"},pr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function Uz(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function Pz(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var yt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=Az(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...m}=c;return N.createElement("a",m,d)}return N.createElement(s,c,d)});function Iz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Bz=class extends ES{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>lp({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>op({...t,from:this.id}),this.useLoaderData=t=>rp({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>o.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Vn(e){return new Bz(e)}function qz(){return e=>Gz(e)}var Hz=class extends xz{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>lp({...t,from:this.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>op({...t,from:this.id}),this.useLoaderData=t=>rp({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>o.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Gz(e){return new Hz(e)}function Ex(e){return typeof e=="object"?new Rx(e,{silent:!0}).createRoute(e):new Rx(e,{silent:!0}).createRoute}var Rx=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=Vn(s);return a.isRoot=!1,a},this.silent=t?.silent}},Tx=class{constructor(e){this.useMatch=t=>Bi({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>lp({...t,from:this.options.id}),this.useSearch=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>op({...t,from:this.options.id}),this.useLoaderData=t=>rp({...t,from:this.options.id}),this.useNavigate=()=>ka({from:Zn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Ax(e){return typeof e=="object"?new Tx(e):t=>new Tx({id:e,...t})}function Kz(e){const t=jn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return o.jsx(ip,{getResetKey:()=>t,onCatch:(s,a)=>{if(fn(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(fn(s))return e.fallback?.(s);throw s},children:e.children})}function Fz(){return o.jsx("p",{children:"Not Found"})}function Sr(e){return o.jsx(o.Fragment,{children:e.children})}function AS(e,t,s){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{...s}):o.jsx(Fz,{})}function Zz(){return Zn().isScrollRestoring,null}var OS=N.memo(function({matchId:t}){const s=Zn(),a=jn({select:w=>{const S=w.matches.findIndex(k=>k.id===t),C=w.matches[S];return Ui(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?o.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,m=r.options.onCatch??s.options.defaultOnCatch,p=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||v)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||v))?N.Suspense:Sr,x=f?ip:Sr,b=p?Kz:Sr;return o.jsxs(r.isRoot?r.options.shellComponent??Sr:Sr,{children:[o.jsx(Ou.Provider,{value:t,children:o.jsx(y,{fallback:d,children:o.jsx(x,{getResetKey:()=>a.resetKey,errorComponent:f||ap,onCatch:(w,S)=>{if(fn(w))throw w;m?.(w,S)},children:o.jsx(b,{fallback:w=>{if(!p||w.routeId&&w.routeId!==a.routeId||!w.routeId&&!r.isRoot)throw w;return N.createElement(p,w)},children:v||a._displayPending?o.jsx(Sz,{fallback:d,children:o.jsx(Ox,{matchId:t})}):o.jsx(Ox,{matchId:t})})})})}),a.parentRouteId===ba&&s.options.scrollRestoration?o.jsxs(o.Fragment,{children:[o.jsx(Vz,{}),o.jsx(Zz,{})]}):null]})});function Vz(){const e=Zn(),t=N.useRef(void 0);return o.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ja(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Ox=N.memo(function({matchId:t}){const s=Zn(),{match:a,key:r,routeId:c}=jn({select:m=>{const p=m.matches.find(x=>x.id===t),v=p.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:p.id,status:p.status,error:p.error,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const m=d.options.component??s.options.defaultComponent;return m?o.jsx(m,{},r):o.jsx(up,{})},[r,d.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const m=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(m){const p=s.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const v=Tr();p._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Ui(fn(a.error)),AS(s,d,a.error);if(a.status==="redirected")throw Ui(Sn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),up=N.memo(function(){const t=Zn(),s=N.useContext(Ou),a=jn({select:p=>p.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=jn({select:p=>{const v=p.matches.find(y=>y.id===s);return Ui(v),v.globalNotFound}}),d=jn({select:p=>{const v=p.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?o.jsx(t.options.defaultPendingComponent,{}):null;if(c)return AS(t,r,void 0);if(!d)return null;const m=o.jsx(OS,{matchId:d});return a===ba?o.jsx(N.Suspense,{fallback:f,children:m}):m});function Qz(){const e=Zn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=jn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(x=>x.status==="pending")}),structuralSharing:!0}),d=Ch(c),f=c||s||r,m=Ch(f),p=c||r,v=Ch(p);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),x=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Li(e.latestLocation.publicHref)!==Li(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{y()}},[e,e.history]),Lc(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(x){console.error(x)}})()},[e]),Lc(()=>{d&&!c&&e.emit({type:"onLoad",...ja(e.state)})},[d,e,c]),Lc(()=>{v&&!p&&e.emit({type:"onBeforeRouteMount",...ja(e.state)})},[p,v,e]),Lc(()=>{if(m&&!f){const y=ja(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(x=>({...x,status:"idle",resolvedLocation:x.location})),y.hrefChanged&&T_(e)}},[f,m,e]),null}function Yz(){const e=Zn(),t=e.routesById[ba].options.pendingComponent??e.options.defaultPendingComponent,s=t?o.jsx(t,{}):null,a=o.jsxs(typeof document<"u"&&e.ssr?Sr:N.Suspense,{fallback:s,children:[o.jsx(Qz,{}),o.jsx(Jz,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:a}):a}function Jz(){const e=Zn(),t=jn({select:r=>r.matches[0]?.id}),s=jn({select:r=>r.loadedAt}),a=t?o.jsx(OS,{matchId:t}):null;return o.jsx(Ou.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:o.jsx(ip,{getResetKey:()=>s,errorComponent:ap,onCatch:void 0,children:a})})}var Xz=e=>new Wz(e),Wz=class extends dz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Ex,globalThis.createLazyFileRoute=Ax):typeof window<"u"&&(window.createFileRoute=Ex,window.createLazyFileRoute=Ax);function e2({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=o.jsx(TS.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:a}):a}function t2({router:e,...t}){return o.jsx(e2,{router:e,...t,children:o.jsx(Yz,{})})}function n2(e){return jn({select:t=>t.location})}let Ti=[],s2=0;const ym=new Set;function LS(){const e=[...Ti];for(const t of ym)t(e)}function i2(e,t="negative",s=6e3){const a=String(++s2),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return Ti=[...Ti,r],LS(),setTimeout(()=>{DS(a)},s),a}function DS(e){const t=Ti.length;Ti=Ti.filter(s=>s.id!==e),Ti.length!==t&&LS()}function a2(e){return ym.add(e),()=>{ym.delete(e)}}function Lx(){return Ti}function r2(){return new Vk({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new aS({onError:e=>{i2(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const o2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Dx=e=>{const t=l2(e);return t.charAt(0).toUpperCase()+t.slice(1)},MS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),c2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var u2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const d2=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},m)=>N.createElement("svg",{ref:m,...u2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:MS("lucide",r),...!c&&!c2(f)&&{"aria-hidden":"true"},...f},[...d.map(([p,v])=>N.createElement(p,v)),...Array.isArray(c)?c:[c]]));const nn=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(d2,{ref:c,iconNode:t,className:MS(`lucide-${o2(Dx(e))}`,`lucide-${e}`,a),...r}));return s.displayName=Dx(e),s};const f2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Mu=nn("chevron-right",f2);const h2=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],m2=nn("download",h2);const p2=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],g2=nn("github",p2);const y2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v2=nn("globe",y2);const x2=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],b2=nn("layout-dashboard",x2);const S2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],j2=nn("menu",S2);const w2=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],N2=nn("play",w2);const C2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mx=nn("plus",C2);const k2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],$x=nn("refresh-cw",k2);const _2=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],z2=nn("rocket",_2);const E2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],R2=nn("rotate-ccw",E2);const T2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],A2=nn("settings",T2);const O2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],L2=nn("trash-2",O2);const D2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],M2=nn("triangle-alert",D2);const $2=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],U2=nn("unplug",$2);const P2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$u=nn("x",P2);function I2(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],r=a.indexOf("{");if(r>=0){const c=a.slice(0,r).trim(),d=a.slice(r);try{const f=JSON.parse(d);return`${s} ${c}
|
|
8
|
+
`+u.stack}}var _t=Object.prototype.hasOwnProperty,zt=e.unstable_scheduleCallback,mn=e.unstable_cancelCallback,le=e.unstable_shouldYield,Be=e.unstable_requestPaint,qe=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,$e=e.unstable_ImmediatePriority,pt=e.unstable_UserBlockingPriority,rn=e.unstable_NormalPriority,js=e.unstable_LowPriority,Vs=e.unstable_IdlePriority,ws=e.log,Qs=e.unstable_setDisableYieldValue,ls=null,_e=null;function Ht(n){if(typeof ws=="function"&&Qs(n),_e&&typeof _e.setStrictMode=="function")try{_e.setStrictMode(ls,n)}catch{}}var Qe=Math.clz32?Math.clz32:gl,ae=Math.log,Jn=Math.LN2;function gl(n){return n>>>=0,n===0?32:31-(ae(n)/Jn|0)|0}var Ys=256,Ns=262144,Ki=4194304;function cs(n){var i=n&42;if(i!==0)return i;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Aa(n,i,l){var u=n.pendingLanes;if(u===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var z=u&134217727;return z!==0?(u=z&~g,u!==0?h=cs(u):(j&=z,j!==0?h=cs(j):l||(l=z&~n,l!==0&&(h=cs(l))))):(z=u&~g,z!==0?h=cs(z):j!==0?h=cs(j):l||(l=u&~n,l!==0&&(h=cs(l)))),h===0?0:i!==0&&i!==h&&(i&g)===0&&(g=h&-h,l=i&-i,g>=l||g===32&&(l&4194048)!==0)?i:h}function us(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function yl(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function vl(){var n=Ki;return Ki<<=1,(Ki&62914560)===0&&(Ki=4194304),n}function Oa(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Fi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function cd(n,i,l,u,h,g){var j=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var z=n.entanglements,D=n.expirationTimes,K=n.hiddenUpdates;for(l=j&~l;0<l;){var W=31-Qe(l),ne=1<<W;z[W]=0,D[W]=-1;var V=K[W];if(V!==null)for(K[W]=null,W=0;W<V.length;W++){var Y=V[W];Y!==null&&(Y.lane&=-536870913)}l&=~ne}u!==0&&xl(n,u,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~i))}function xl(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var u=31-Qe(i);n.entangledLanes|=i,n.entanglements[u]=n.entanglements[u]|1073741824|l&261930}function bl(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var u=31-Qe(l),h=1<<u;h&i|n[u]&i&&(n[u]|=i),l&=~h}}function Kr(n,i){var l=i&-i;return l=(l&42)!==0?1:U(l),(l&(n.suspendedLanes|i))!==0?0:l}function U(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function fe(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function at(){var n=G.p;return n!==0?n:(n=window.event,n===void 0?32:Dv(n.type))}function Qt(n,i){var l=G.p;try{return G.p=n,i()}finally{G.p=l}}var Lt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Lt,wt="__reactProps$"+Lt,Cn="__reactContainer$"+Lt,en="__reactEvents$"+Lt,ud="__reactListeners$"+Lt,Js="__reactHandles$"+Lt,Xs="__reactResources$"+Lt,ds="__reactMarker$"+Lt;function Da(n){delete n[Et],delete n[wt],delete n[en],delete n[ud],delete n[Js]}function Ws(n){var i=n[Et];if(i)return i;for(var l=n.parentNode;l;){if(i=l[Cn]||l[Et]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=vv(n);n!==null;){if(l=n[Et])return l;n=vv(n)}return i}n=l,l=n.parentNode}return null}function Xn(n){if(n=n[Et]||n[Cn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function fs(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function ei(n){var i=n[Xs];return i||(i=n[Xs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Mt(n){n[ds]=!0}var He=new Set,rt={};function Gt(n,i){on(n,i),on(n+"Capture",i)}function on(n,i){for(rt[n]=i,n=0;n<i.length;n++)He.add(i[n])}var La=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Fr={},tg={};function o1(n){return _t.call(tg,n)?!0:_t.call(Fr,n)?!1:La.test(n)?tg[n]=!0:(Fr[n]=!0,!1)}function Sl(n,i,l){if(o1(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var u=i.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function jl(n,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttribute(i,""+l)}}function Cs(n,i,l,u){if(u===null)n.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+u)}}function On(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ng(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function l1(n,i,l){var u=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var h=u.get,g=u.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return h.call(this)},set:function(j){l=""+j,g.call(this,j)}}),Object.defineProperty(n,i,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function dd(n){if(!n._valueTracker){var i=ng(n)?"checked":"value";n._valueTracker=l1(n,i,""+n[i])}}function sg(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),u="";return n&&(u=ng(n)?n.checked?"true":"false":n.value),n=u,n!==l?(i.setValue(n),!0):!1}function wl(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var c1=/[\n"\\]/g;function Dn(n){return n.replace(c1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function fd(n,i,l,u,h,g,j,z){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),i!=null?j==="number"?(i===0&&n.value===""||n.value!=i)&&(n.value=""+On(i)):n.value!==""+On(i)&&(n.value=""+On(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?hd(n,j,On(i)):l!=null?hd(n,j,On(l)):u!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?n.name=""+On(z):n.removeAttribute("name")}function ig(n,i,l,u,h,g,j,z){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),i!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){dd(n);return}l=l!=null?""+On(l):"",i=i!=null?""+On(i):l,z||i===n.value||(n.value=i),n.defaultValue=i}u=u??h,u=typeof u!="function"&&typeof u!="symbol"&&!!u,n.checked=z?n.checked:!!u,n.defaultChecked=!!u,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),dd(n)}function hd(n,i,l){i==="number"&&wl(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function Ma(n,i,l,u){if(n=n.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<n.length;l++)h=i.hasOwnProperty("$"+n[l].value),n[l].selected!==h&&(n[l].selected=h),h&&u&&(n[l].defaultSelected=!0)}else{for(l=""+On(l),i=null,h=0;h<n.length;h++){if(n[h].value===l){n[h].selected=!0,u&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function ag(n,i,l){if(i!=null&&(i=""+On(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+On(l):""}function rg(n,i,l,u){if(i==null){if(u!=null){if(l!=null)throw Error(a(92));if(je(u)){if(1<u.length)throw Error(a(93));u=u[0]}l=u}l==null&&(l=""),i=l}l=On(i),n.defaultValue=l,u=n.textContent,u===l&&u!==""&&u!==null&&(n.value=u),dd(n)}function $a(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var u1=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function og(n,i,l){var u=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":u?n.setProperty(i,l):typeof l!="number"||l===0||u1.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function lg(n,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||i!=null&&i.hasOwnProperty(u)||(u.indexOf("--")===0?n.setProperty(u,""):u==="float"?n.cssFloat="":n[u]="");for(var h in i)u=i[h],i.hasOwnProperty(h)&&l[h]!==u&&og(n,h,u)}else for(var g in i)i.hasOwnProperty(g)&&og(n,g,i[g])}function md(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var d1=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),f1=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Nl(n){return f1.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ks(){}var pd=null;function gd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ua=null,Pa=null;function cg(n){var i=Xn(n);if(i&&(n=i.stateNode)){var l=n[wt]||null;e:switch(n=i.stateNode,i.type){case"input":if(fd(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Dn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var u=l[i];if(u!==n&&u.form===n.form){var h=u[wt]||null;if(!h)throw Error(a(90));fd(u,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)u=l[i],u.form===n.form&&sg(u)}break e;case"textarea":ag(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ma(n,!!l.multiple,i,!1)}}}var yd=!1;function ug(n,i,l){if(yd)return n(i,l);yd=!0;try{var u=n(i);return u}finally{if(yd=!1,(Ua!==null||Pa!==null)&&(dc(),Ua&&(i=Ua,n=Pa,Pa=Ua=null,cg(i),n)))for(i=0;i<n.length;i++)cg(n[i])}}function Zr(n,i){var l=n.stateNode;if(l===null)return null;var u=l[wt]||null;if(u===null)return null;l=u[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(n=n.type,u=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!u;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var _s=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vd=!1;if(_s)try{var Vr={};Object.defineProperty(Vr,"passive",{get:function(){vd=!0}}),window.addEventListener("test",Vr,Vr),window.removeEventListener("test",Vr,Vr)}catch{vd=!1}var ti=null,xd=null,Cl=null;function dg(){if(Cl)return Cl;var n,i=xd,l=i.length,u,h="value"in ti?ti.value:ti.textContent,g=h.length;for(n=0;n<l&&i[n]===h[n];n++);var j=l-n;for(u=1;u<=j&&i[l-u]===h[g-u];u++);return Cl=h.slice(n,1<u?1-u:void 0)}function kl(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function _l(){return!0}function fg(){return!1}function pn(n){function i(l,u,h,g,j){this._reactName=l,this._targetInst=h,this.type=u,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var z in n)n.hasOwnProperty(z)&&(l=n[z],this[z]=l?l(g):g[z]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?_l:fg,this.isPropagationStopped=fg,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=_l)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=_l)},persist:function(){},isPersistent:_l}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zl=pn(Zi),Qr=y({},Zi,{view:0,detail:0}),h1=pn(Qr),bd,Sd,Yr,El=y({},Qr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wd,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Yr&&(Yr&&n.type==="mousemove"?(bd=n.screenX-Yr.screenX,Sd=n.screenY-Yr.screenY):Sd=bd=0,Yr=n),bd)},movementY:function(n){return"movementY"in n?n.movementY:Sd}}),hg=pn(El),m1=y({},El,{dataTransfer:0}),p1=pn(m1),g1=y({},Qr,{relatedTarget:0}),jd=pn(g1),y1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),v1=pn(y1),x1=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),b1=pn(x1),S1=y({},Zi,{data:0}),mg=pn(S1),j1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},w1={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},N1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=N1[n])?!!i[n]:!1}function wd(){return C1}var k1=y({},Qr,{key:function(n){if(n.key){var i=j1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=kl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?w1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wd,charCode:function(n){return n.type==="keypress"?kl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?kl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),_1=pn(k1),z1=y({},El,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pg=pn(z1),E1=y({},Qr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wd}),R1=pn(E1),T1=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),A1=pn(T1),O1=y({},El,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),D1=pn(O1),L1=y({},Zi,{newState:0,oldState:0}),M1=pn(L1),$1=[9,13,27,32],Nd=_s&&"CompositionEvent"in window,Jr=null;_s&&"documentMode"in document&&(Jr=document.documentMode);var U1=_s&&"TextEvent"in window&&!Jr,gg=_s&&(!Nd||Jr&&8<Jr&&11>=Jr),yg=" ",vg=!1;function xg(n,i){switch(n){case"keyup":return $1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ia=!1;function P1(n,i){switch(n){case"compositionend":return bg(i);case"keypress":return i.which!==32?null:(vg=!0,yg);case"textInput":return n=i.data,n===yg&&vg?null:n;default:return null}}function I1(n,i){if(Ia)return n==="compositionend"||!Nd&&xg(n,i)?(n=dg(),Cl=xd=ti=null,Ia=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return gg&&i.locale!=="ko"?null:i.data;default:return null}}var B1={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Sg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!B1[n.type]:i==="textarea"}function jg(n,i,l,u){Ua?Pa?Pa.push(u):Pa=[u]:Ua=u,i=vc(i,"onChange"),0<i.length&&(l=new zl("onChange","change",null,l,u),n.push({event:l,listeners:i}))}var Xr=null,Wr=null;function q1(n){iv(n,0)}function Rl(n){var i=fs(n);if(sg(i))return n}function wg(n,i){if(n==="change")return i}var Ng=!1;if(_s){var Cd;if(_s){var kd="oninput"in document;if(!kd){var Cg=document.createElement("div");Cg.setAttribute("oninput","return;"),kd=typeof Cg.oninput=="function"}Cd=kd}else Cd=!1;Ng=Cd&&(!document.documentMode||9<document.documentMode)}function kg(){Xr&&(Xr.detachEvent("onpropertychange",_g),Wr=Xr=null)}function _g(n){if(n.propertyName==="value"&&Rl(Wr)){var i=[];jg(i,Wr,n,gd(n)),ug(q1,i)}}function H1(n,i,l){n==="focusin"?(kg(),Xr=i,Wr=l,Xr.attachEvent("onpropertychange",_g)):n==="focusout"&&kg()}function G1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Rl(Wr)}function K1(n,i){if(n==="click")return Rl(i)}function F1(n,i){if(n==="input"||n==="change")return Rl(i)}function Z1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var kn=typeof Object.is=="function"?Object.is:Z1;function eo(n,i){if(kn(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),u=Object.keys(i);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var h=l[u];if(!_t.call(i,h)||!kn(n[h],i[h]))return!1}return!0}function zg(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Eg(n,i){var l=zg(n);n=0;for(var u;l;){if(l.nodeType===3){if(u=n+l.textContent.length,n<=i&&u>=i)return{node:l,offset:i-n};n=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=zg(l)}}function Rg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Rg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Tg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=wl(n.document);i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=wl(n.document)}return i}function _d(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var V1=_s&&"documentMode"in document&&11>=document.documentMode,Ba=null,zd=null,to=null,Ed=!1;function Ag(n,i,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ed||Ba==null||Ba!==wl(u)||(u=Ba,"selectionStart"in u&&_d(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),to&&eo(to,u)||(to=u,u=vc(zd,"onSelect"),0<u.length&&(i=new zl("onSelect","select",null,i,l),n.push({event:i,listeners:u}),i.target=Ba)))}function Vi(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var qa={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},Rd={},Og={};_s&&(Og=document.createElement("div").style,"AnimationEvent"in window||(delete qa.animationend.animation,delete qa.animationiteration.animation,delete qa.animationstart.animation),"TransitionEvent"in window||delete qa.transitionend.transition);function Qi(n){if(Rd[n])return Rd[n];if(!qa[n])return n;var i=qa[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Og)return Rd[n]=i[l];return n}var Dg=Qi("animationend"),Lg=Qi("animationiteration"),Mg=Qi("animationstart"),Q1=Qi("transitionrun"),Y1=Qi("transitionstart"),J1=Qi("transitioncancel"),$g=Qi("transitionend"),Ug=new Map,Td="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Td.push("scrollEnd");function Wn(n,i){Ug.set(n,i),Gt(i,[n])}var Tl=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},Ln=[],Ha=0,Ad=0;function Al(){for(var n=Ha,i=Ad=Ha=0;i<n;){var l=Ln[i];Ln[i++]=null;var u=Ln[i];Ln[i++]=null;var h=Ln[i];Ln[i++]=null;var g=Ln[i];if(Ln[i++]=null,u!==null&&h!==null){var j=u.pending;j===null?h.next=h:(h.next=j.next,j.next=h),u.pending=h}g!==0&&Pg(l,h,g)}}function Ol(n,i,l,u){Ln[Ha++]=n,Ln[Ha++]=i,Ln[Ha++]=l,Ln[Ha++]=u,Ad|=u,n.lanes|=u,n=n.alternate,n!==null&&(n.lanes|=u)}function Od(n,i,l,u){return Ol(n,i,l,u),Dl(n)}function Yi(n,i){return Ol(n,null,null,i),Dl(n)}function Pg(n,i,l){n.lanes|=l;var u=n.alternate;u!==null&&(u.lanes|=l);for(var h=!1,g=n.return;g!==null;)g.childLanes|=l,u=g.alternate,u!==null&&(u.childLanes|=l),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&i!==null&&(h=31-Qe(l),n=g.hiddenUpdates,u=n[h],u===null?n[h]=[i]:u.push(i),i.lane=l|536870912),g):null}function Dl(n){if(50<No)throw No=0,Hf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ga={};function X1(n,i,l,u){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(n,i,l,u){return new X1(n,i,l,u)}function Dd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function zs(n,i){var l=n.alternate;return l===null?(l=_n(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function Ig(n,i){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=i,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,i=l.dependencies,n.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),n}function Ll(n,i,l,u,h,g){var j=0;if(u=n,typeof n=="function")Dd(n)&&(j=1);else if(typeof n=="string")j=sk(n,l,re.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case P:return n=_n(31,l,i,h),n.elementType=P,n.lanes=g,n;case S:return Ji(l.children,h,g,i);case C:j=8,h|=24;break;case k:return n=_n(12,l,i,h|2),n.elementType=k,n.lanes=g,n;case L:return n=_n(13,l,i,h),n.elementType=L,n.lanes=g,n;case M:return n=_n(19,l,i,h),n.elementType=M,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case R:j=10;break e;case E:j=9;break e;case _:j=11;break e;case T:j=14;break e;case A:j=16,u=null;break e}j=29,l=Error(a(130,n===null?"null":typeof n,"")),u=null}return i=_n(j,l,i,h),i.elementType=n,i.type=u,i.lanes=g,i}function Ji(n,i,l,u){return n=_n(7,n,u,i),n.lanes=l,n}function Ld(n,i,l){return n=_n(6,n,null,i),n.lanes=l,n}function Bg(n){var i=_n(18,null,null,0);return i.stateNode=n,i}function Md(n,i,l){return i=_n(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var qg=new WeakMap;function Mn(n,i){if(typeof n=="object"&&n!==null){var l=qg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:Vt(i)},qg.set(n,i),i)}return{value:n,source:i,stack:Vt(i)}}var Ka=[],Fa=0,Ml=null,no=0,$n=[],Un=0,ni=null,hs=1,ms="";function Es(n,i){Ka[Fa++]=no,Ka[Fa++]=Ml,Ml=n,no=i}function Hg(n,i,l){$n[Un++]=hs,$n[Un++]=ms,$n[Un++]=ni,ni=n;var u=hs;n=ms;var h=32-Qe(u)-1;u&=~(1<<h),l+=1;var g=32-Qe(i)+h;if(30<g){var j=h-h%5;g=(u&(1<<j)-1).toString(32),u>>=j,h-=j,hs=1<<32-Qe(i)+h|l<<h|u,ms=g+n}else hs=1<<g|l<<h|u,ms=n}function $d(n){n.return!==null&&(Es(n,1),Hg(n,1,0))}function Ud(n){for(;n===Ml;)Ml=Ka[--Fa],Ka[Fa]=null,no=Ka[--Fa],Ka[Fa]=null;for(;n===ni;)ni=$n[--Un],$n[Un]=null,ms=$n[--Un],$n[Un]=null,hs=$n[--Un],$n[Un]=null}function Gg(n,i){$n[Un++]=hs,$n[Un++]=ms,$n[Un++]=ni,hs=i.id,ms=i.overflow,ni=n}var Yt=null,ht=null,Fe=!1,si=null,Pn=!1,Pd=Error(a(519));function ii(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw so(Mn(i,n)),Pd}function Kg(n){var i=n.stateNode,l=n.type,u=n.memoizedProps;switch(i[Et]=n,i[wt]=u,l){case"dialog":Ie("cancel",i),Ie("close",i);break;case"iframe":case"object":case"embed":Ie("load",i);break;case"video":case"audio":for(l=0;l<ko.length;l++)Ie(ko[l],i);break;case"source":Ie("error",i);break;case"img":case"image":case"link":Ie("error",i),Ie("load",i);break;case"details":Ie("toggle",i);break;case"input":Ie("invalid",i),ig(i,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ie("invalid",i);break;case"textarea":Ie("invalid",i),rg(i,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||u.suppressHydrationWarning===!0||lv(i.textContent,l)?(u.popover!=null&&(Ie("beforetoggle",i),Ie("toggle",i)),u.onScroll!=null&&Ie("scroll",i),u.onScrollEnd!=null&&Ie("scrollend",i),u.onClick!=null&&(i.onclick=ks),i=!0):i=!1,i||ii(n,!0)}function Fg(n){for(Yt=n.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Yt=Yt.return}}function Za(n){if(n!==Yt)return!1;if(!Fe)return Fg(n),Fe=!0,!1;var i=n.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||ih(n.type,n.memoizedProps)),l=!l),l&&ht&&ii(n),Fg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=yv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));ht=yv(n)}else i===27?(i=ht,vi(n.type)?(n=ch,ch=null,ht=n):ht=i):ht=Yt?Bn(n.stateNode.nextSibling):null;return!0}function Xi(){ht=Yt=null,Fe=!1}function Id(){var n=si;return n!==null&&(xn===null?xn=n:xn.push.apply(xn,n),si=null),n}function so(n){si===null?si=[n]:si.push(n)}var Bd=O(null),Wi=null,Rs=null;function ai(n,i,l){ie(Bd,i._currentValue),i._currentValue=l}function Ts(n){n._currentValue=Bd.current,F(Bd)}function qd(n,i,l){for(;n!==null;){var u=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,u!==null&&(u.childLanes|=i)):u!==null&&(u.childLanes&i)!==i&&(u.childLanes|=i),n===l)break;n=n.return}}function Hd(n,i,l,u){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var z=g;g=h;for(var D=0;D<i.length;D++)if(z.context===i[D]){g.lanes|=l,z=g.alternate,z!==null&&(z.lanes|=l),qd(g.return,l,n),u||(j=null);break e}g=z.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(a(341));j.lanes|=l,g=j.alternate,g!==null&&(g.lanes|=l),qd(j,l,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function Va(n,i,l,u){n=null;for(var h=i,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var z=h.type;kn(h.pendingProps.value,j.value)||(n!==null?n.push(z):n=[z])}}else if(h===de.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(To):n=[To])}h=h.return}n!==null&&Hd(i,n,l,u),i.flags|=262144}function $l(n){for(n=n.firstContext;n!==null;){if(!kn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ea(n){Wi=n,Rs=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Jt(n){return Zg(Wi,n)}function Ul(n,i){return Wi===null&&ea(n),Zg(n,i)}function Zg(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Rs===null){if(n===null)throw Error(a(308));Rs=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Rs=Rs.next=i;return l}var W1=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,u){n.push(u)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},eC=e.unstable_scheduleCallback,tC=e.unstable_NormalPriority,$t={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gd(){return{controller:new W1,data:new Map,refCount:0}}function io(n){n.refCount--,n.refCount===0&&eC(tC,function(){n.controller.abort()})}var ao=null,Kd=0,Qa=0,Ya=null;function nC(n,i){if(ao===null){var l=ao=[];Kd=0,Qa=Qf(),Ya={status:"pending",value:void 0,then:function(u){l.push(u)}}}return Kd++,i.then(Vg,Vg),i}function Vg(){if(--Kd===0&&ao!==null){Ya!==null&&(Ya.status="fulfilled");var n=ao;ao=null,Qa=0,Ya=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function sC(n,i){var l=[],u={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return n.then(function(){u.status="fulfilled",u.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(u.status="rejected",u.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),u}var Qg=B.S;B.S=function(n,i){A0=qe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&nC(n,i),Qg!==null&&Qg(n,i)};var ta=O(null);function Fd(){var n=ta.current;return n!==null?n:ut.pooledCache}function Pl(n,i){i===null?ie(ta,ta.current):ie(ta,i.pool)}function Yg(){var n=Fd();return n===null?null:{parent:$t._currentValue,pool:n}}var Ja=Error(a(460)),Zd=Error(a(474)),Il=Error(a(542)),Bl={then:function(){}};function Jg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Xg(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(ks,ks),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ey(n),n;default:if(typeof i.status=="string")i.then(ks,ks);else{if(n=ut,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(u){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=u}},function(u){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=u}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ey(n),n}throw sa=i,Ja}}function na(n){try{var i=n._init;return i(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(sa=l,Ja):l}}var sa=null;function Wg(){if(sa===null)throw Error(a(459));var n=sa;return sa=null,n}function ey(n){if(n===Ja||n===Il)throw Error(a(483))}var Xa=null,ro=0;function ql(n){var i=ro;return ro+=1,Xa===null&&(Xa=[]),Xg(Xa,n,i)}function oo(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Hl(n,i){throw i.$$typeof===x?Error(a(525)):(n=Object.prototype.toString.call(i),Error(a(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n)))}function ty(n){function i(I,$){if(n){var H=I.deletions;H===null?(I.deletions=[$],I.flags|=16):H.push($)}}function l(I,$){if(!n)return null;for(;$!==null;)i(I,$),$=$.sibling;return null}function u(I){for(var $=new Map;I!==null;)I.key!==null?$.set(I.key,I):$.set(I.index,I),I=I.sibling;return $}function h(I,$){return I=zs(I,$),I.index=0,I.sibling=null,I}function g(I,$,H){return I.index=H,n?(H=I.alternate,H!==null?(H=H.index,H<$?(I.flags|=67108866,$):H):(I.flags|=67108866,$)):(I.flags|=1048576,$)}function j(I){return n&&I.alternate===null&&(I.flags|=67108866),I}function z(I,$,H,ee){return $===null||$.tag!==6?($=Ld(H,I.mode,ee),$.return=I,$):($=h($,H),$.return=I,$)}function D(I,$,H,ee){var Ne=H.type;return Ne===S?W(I,$,H.props.children,ee,H.key):$!==null&&($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&na(Ne)===$.type)?($=h($,H.props),oo($,H),$.return=I,$):($=Ll(H.type,H.key,H.props,null,I.mode,ee),oo($,H),$.return=I,$)}function K(I,$,H,ee){return $===null||$.tag!==4||$.stateNode.containerInfo!==H.containerInfo||$.stateNode.implementation!==H.implementation?($=Md(H,I.mode,ee),$.return=I,$):($=h($,H.children||[]),$.return=I,$)}function W(I,$,H,ee,Ne){return $===null||$.tag!==7?($=Ji(H,I.mode,ee,Ne),$.return=I,$):($=h($,H),$.return=I,$)}function ne(I,$,H){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Ld(""+$,I.mode,H),$.return=I,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return H=Ll($.type,$.key,$.props,null,I.mode,H),oo(H,$),H.return=I,H;case w:return $=Md($,I.mode,H),$.return=I,$;case A:return $=na($),ne(I,$,H)}if(je($)||se($))return $=Ji($,I.mode,H,null),$.return=I,$;if(typeof $.then=="function")return ne(I,ql($),H);if($.$$typeof===R)return ne(I,Ul(I,$),H);Hl(I,$)}return null}function V(I,$,H,ee){var Ne=$!==null?$.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return Ne!==null?null:z(I,$,""+H,ee);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case b:return H.key===Ne?D(I,$,H,ee):null;case w:return H.key===Ne?K(I,$,H,ee):null;case A:return H=na(H),V(I,$,H,ee)}if(je(H)||se(H))return Ne!==null?null:W(I,$,H,ee,null);if(typeof H.then=="function")return V(I,$,ql(H),ee);if(H.$$typeof===R)return V(I,$,Ul(I,H),ee);Hl(I,H)}return null}function Y(I,$,H,ee,Ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return I=I.get(H)||null,z($,I,""+ee,Ne);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return I=I.get(ee.key===null?H:ee.key)||null,D($,I,ee,Ne);case w:return I=I.get(ee.key===null?H:ee.key)||null,K($,I,ee,Ne);case A:return ee=na(ee),Y(I,$,H,ee,Ne)}if(je(ee)||se(ee))return I=I.get(H)||null,W($,I,ee,Ne,null);if(typeof ee.then=="function")return Y(I,$,H,ql(ee),Ne);if(ee.$$typeof===R)return Y(I,$,H,Ul($,ee),Ne);Hl($,ee)}return null}function ve(I,$,H,ee){for(var Ne=null,Ye=null,Se=$,Ae=$=0,Ke=null;Se!==null&&Ae<H.length;Ae++){Se.index>Ae?(Ke=Se,Se=null):Ke=Se.sibling;var Je=V(I,Se,H[Ae],ee);if(Je===null){Se===null&&(Se=Ke);break}n&&Se&&Je.alternate===null&&i(I,Se),$=g(Je,$,Ae),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je,Se=Ke}if(Ae===H.length)return l(I,Se),Fe&&Es(I,Ae),Ne;if(Se===null){for(;Ae<H.length;Ae++)Se=ne(I,H[Ae],ee),Se!==null&&($=g(Se,$,Ae),Ye===null?Ne=Se:Ye.sibling=Se,Ye=Se);return Fe&&Es(I,Ae),Ne}for(Se=u(Se);Ae<H.length;Ae++)Ke=Y(Se,I,Ae,H[Ae],ee),Ke!==null&&(n&&Ke.alternate!==null&&Se.delete(Ke.key===null?Ae:Ke.key),$=g(Ke,$,Ae),Ye===null?Ne=Ke:Ye.sibling=Ke,Ye=Ke);return n&&Se.forEach(function(wi){return i(I,wi)}),Fe&&Es(I,Ae),Ne}function Ce(I,$,H,ee){if(H==null)throw Error(a(151));for(var Ne=null,Ye=null,Se=$,Ae=$=0,Ke=null,Je=H.next();Se!==null&&!Je.done;Ae++,Je=H.next()){Se.index>Ae?(Ke=Se,Se=null):Ke=Se.sibling;var wi=V(I,Se,Je.value,ee);if(wi===null){Se===null&&(Se=Ke);break}n&&Se&&wi.alternate===null&&i(I,Se),$=g(wi,$,Ae),Ye===null?Ne=wi:Ye.sibling=wi,Ye=wi,Se=Ke}if(Je.done)return l(I,Se),Fe&&Es(I,Ae),Ne;if(Se===null){for(;!Je.done;Ae++,Je=H.next())Je=ne(I,Je.value,ee),Je!==null&&($=g(Je,$,Ae),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return Fe&&Es(I,Ae),Ne}for(Se=u(Se);!Je.done;Ae++,Je=H.next())Je=Y(Se,I,Ae,Je.value,ee),Je!==null&&(n&&Je.alternate!==null&&Se.delete(Je.key===null?Ae:Je.key),$=g(Je,$,Ae),Ye===null?Ne=Je:Ye.sibling=Je,Ye=Je);return n&&Se.forEach(function(mk){return i(I,mk)}),Fe&&Es(I,Ae),Ne}function ct(I,$,H,ee){if(typeof H=="object"&&H!==null&&H.type===S&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case b:e:{for(var Ne=H.key;$!==null;){if($.key===Ne){if(Ne=H.type,Ne===S){if($.tag===7){l(I,$.sibling),ee=h($,H.props.children),ee.return=I,I=ee;break e}}else if($.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===A&&na(Ne)===$.type){l(I,$.sibling),ee=h($,H.props),oo(ee,H),ee.return=I,I=ee;break e}l(I,$);break}else i(I,$);$=$.sibling}H.type===S?(ee=Ji(H.props.children,I.mode,ee,H.key),ee.return=I,I=ee):(ee=Ll(H.type,H.key,H.props,null,I.mode,ee),oo(ee,H),ee.return=I,I=ee)}return j(I);case w:e:{for(Ne=H.key;$!==null;){if($.key===Ne)if($.tag===4&&$.stateNode.containerInfo===H.containerInfo&&$.stateNode.implementation===H.implementation){l(I,$.sibling),ee=h($,H.children||[]),ee.return=I,I=ee;break e}else{l(I,$);break}else i(I,$);$=$.sibling}ee=Md(H,I.mode,ee),ee.return=I,I=ee}return j(I);case A:return H=na(H),ct(I,$,H,ee)}if(je(H))return ve(I,$,H,ee);if(se(H)){if(Ne=se(H),typeof Ne!="function")throw Error(a(150));return H=Ne.call(H),Ce(I,$,H,ee)}if(typeof H.then=="function")return ct(I,$,ql(H),ee);if(H.$$typeof===R)return ct(I,$,Ul(I,H),ee);Hl(I,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,$!==null&&$.tag===6?(l(I,$.sibling),ee=h($,H),ee.return=I,I=ee):(l(I,$),ee=Ld(H,I.mode,ee),ee.return=I,I=ee),j(I)):l(I,$)}return function(I,$,H,ee){try{ro=0;var Ne=ct(I,$,H,ee);return Xa=null,Ne}catch(Se){if(Se===Ja||Se===Il)throw Se;var Ye=_n(29,Se,null,I.mode);return Ye.lanes=ee,Ye.return=I,Ye}}}var ia=ty(!0),ny=ty(!1),ri=!1;function Vd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qd(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function oi(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function li(n,i,l){var u=n.updateQueue;if(u===null)return null;if(u=u.shared,(Xe&2)!==0){var h=u.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),u.pending=i,i=Dl(n),Pg(n,null,l),i}return Ol(n,u,i,l),Dl(n)}function lo(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,bl(n,l)}}function Yd(n,i){var l=n.updateQueue,u=n.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var h=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var j={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,l=l.next}while(l!==null);g===null?h=g=i:g=g.next=i}else h=g=i;l={baseState:u.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var Jd=!1;function co(){if(Jd){var n=Ya;if(n!==null)throw n}}function uo(n,i,l,u){Jd=!1;var h=n.updateQueue;ri=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,z=h.shared.pending;if(z!==null){h.shared.pending=null;var D=z,K=D.next;D.next=null,j===null?g=K:j.next=K,j=D;var W=n.alternate;W!==null&&(W=W.updateQueue,z=W.lastBaseUpdate,z!==j&&(z===null?W.firstBaseUpdate=K:z.next=K,W.lastBaseUpdate=D))}if(g!==null){var ne=h.baseState;j=0,W=K=D=null,z=g;do{var V=z.lane&-536870913,Y=V!==z.lane;if(Y?(Ge&V)===V:(u&V)===V){V!==0&&V===Qa&&(Jd=!0),W!==null&&(W=W.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ve=n,Ce=z;V=i;var ct=l;switch(Ce.tag){case 1:if(ve=Ce.payload,typeof ve=="function"){ne=ve.call(ct,ne,V);break e}ne=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ce.payload,V=typeof ve=="function"?ve.call(ct,ne,V):ve,V==null)break e;ne=y({},ne,V);break e;case 2:ri=!0}}V=z.callback,V!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[V]:Y.push(V))}else Y={lane:V,tag:z.tag,payload:z.payload,callback:z.callback,next:null},W===null?(K=W=Y,D=ne):W=W.next=Y,j|=V;if(z=z.next,z===null){if(z=h.shared.pending,z===null)break;Y=z,z=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);W===null&&(D=ne),h.baseState=D,h.firstBaseUpdate=K,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),hi|=j,n.lanes=j,n.memoizedState=ne}}function sy(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function iy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)sy(l[n],i)}var Wa=O(null),Gl=O(0);function ay(n,i){n=Is,ie(Gl,n),ie(Wa,i),Is=n|i.baseLanes}function Xd(){ie(Gl,Is),ie(Wa,Wa.current)}function Wd(){Is=Gl.current,F(Wa),F(Gl)}var zn=O(null),In=null;function ci(n){var i=n.alternate;ie(Rt,Rt.current&1),ie(zn,n),In===null&&(i===null||Wa.current!==null||i.memoizedState!==null)&&(In=n)}function ef(n){ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)}function ry(n){n.tag===22?(ie(Rt,Rt.current),ie(zn,n),In===null&&(In=n)):ui()}function ui(){ie(Rt,Rt.current),ie(zn,zn.current)}function En(n){F(zn),In===n&&(In=null),F(Rt)}var Rt=O(0);function Kl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||oh(l)||lh(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var As=0,Te=null,ot=null,Ut=null,Fl=!1,er=!1,aa=!1,Zl=0,fo=0,tr=null,iC=0;function Nt(){throw Error(a(321))}function tf(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!kn(n[l],i[l]))return!1;return!0}function nf(n,i,l,u,h,g){return As=g,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=n===null||n.memoizedState===null?Hy:vf,aa=!1,g=l(u,h),aa=!1,er&&(g=ly(i,l,u,h)),oy(n),g}function oy(n){B.H=po;var i=ot!==null&&ot.next!==null;if(As=0,Ut=ot=Te=null,Fl=!1,fo=0,tr=null,i)throw Error(a(300));n===null||Pt||(n=n.dependencies,n!==null&&$l(n)&&(Pt=!0))}function ly(n,i,l,u){Te=n;var h=0;do{if(er&&(tr=null),fo=0,er=!1,25<=h)throw Error(a(301));if(h+=1,Ut=ot=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}B.H=Gy,g=i(l,u)}while(er);return g}function aC(){var n=B.H,i=n.useState()[0];return i=typeof i.then=="function"?ho(i):i,n=n.useState()[0],(ot!==null?ot.memoizedState:null)!==n&&(Te.flags|=1024),i}function sf(){var n=Zl!==0;return Zl=0,n}function af(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function rf(n){if(Fl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Fl=!1}As=0,Ut=ot=Te=null,er=!1,fo=Zl=0,tr=null}function ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Te.memoizedState=Ut=n:Ut=Ut.next=n,Ut}function Tt(){if(ot===null){var n=Te.alternate;n=n!==null?n.memoizedState:null}else n=ot.next;var i=Ut===null?Te.memoizedState:Ut.next;if(i!==null)Ut=i,ot=n;else{if(n===null)throw Te.alternate===null?Error(a(467)):Error(a(310));ot=n,n={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Ut===null?Te.memoizedState=Ut=n:Ut=Ut.next=n}return Ut}function Vl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ho(n){var i=fo;return fo+=1,tr===null&&(tr=[]),n=Xg(tr,n,i),i=Te,(Ut===null?i.memoizedState:Ut.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?Hy:vf),n}function Ql(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return ho(n);if(n.$$typeof===R)return Jt(n)}throw Error(a(438,String(n)))}function of(n){var i=null,l=Te.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var u=Te.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(i={data:u.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Vl(),Te.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),u=0;u<n;u++)l[u]=J;return i.index++,l}function Os(n,i){return typeof i=="function"?i(n):i}function Yl(n){var i=Tt();return lf(i,ot,n)}function lf(n,i,l){var u=n.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=l;var h=n.baseQueue,g=u.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,u.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var z=j=null,D=null,K=i,W=!1;do{var ne=K.lane&-536870913;if(ne!==K.lane?(Ge&ne)===ne:(As&ne)===ne){var V=K.revertLane;if(V===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ne===Qa&&(W=!0);else if((As&V)===V){K=K.next,V===Qa&&(W=!0);continue}else ne={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(z=D=ne,j=g):D=D.next=ne,Te.lanes|=V,hi|=V;ne=K.action,aa&&l(g,ne),g=K.hasEagerState?K.eagerState:l(g,ne)}else V={lane:ne,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(z=D=V,j=g):D=D.next=V,Te.lanes|=ne,hi|=ne;K=K.next}while(K!==null&&K!==i);if(D===null?j=g:D.next=z,!kn(g,n.memoizedState)&&(Pt=!0,W&&(l=Ya,l!==null)))throw l;n.memoizedState=g,n.baseState=j,n.baseQueue=D,u.lastRenderedState=g}return h===null&&(u.lanes=0),[n.memoizedState,u.dispatch]}function cf(n){var i=Tt(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=n;var u=l.dispatch,h=l.pending,g=i.memoizedState;if(h!==null){l.pending=null;var j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);kn(g,i.memoizedState)||(Pt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,u]}function cy(n,i,l){var u=Te,h=Tt(),g=Fe;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var j=!kn((ot||h).memoizedState,l);if(j&&(h.memoizedState=l,Pt=!0),h=h.queue,ff(fy.bind(null,u,h,n),[n]),h.getSnapshot!==i||j||Ut!==null&&Ut.memoizedState.tag&1){if(u.flags|=2048,nr(9,{destroy:void 0},dy.bind(null,u,h,l,i),null),ut===null)throw Error(a(349));g||(As&127)!==0||uy(u,i,l)}return l}function uy(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=Vl(),Te.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function dy(n,i,l,u){i.value=l,i.getSnapshot=u,hy(i)&&my(n)}function fy(n,i,l){return l(function(){hy(i)&&my(n)})}function hy(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!kn(n,l)}catch{return!0}}function my(n){var i=Yi(n,2);i!==null&&bn(i,n,2)}function uf(n){var i=ln();if(typeof n=="function"){var l=n;if(n=l(),aa){Ht(!0);try{l()}finally{Ht(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:n},i}function py(n,i,l,u){return n.baseState=l,lf(n,ot,typeof u=="function"?u:Os)}function rC(n,i,l,u,h){if(Wl(n))throw Error(a(485));if(n=i.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};B.T!==null?l(!0):g.isTransition=!1,u(g),l=i.pending,l===null?(g.next=i.pending=g,gy(i,g)):(g.next=l.next,i.pending=l.next=g)}}function gy(n,i){var l=i.action,u=i.payload,h=n.state;if(i.isTransition){var g=B.T,j={};B.T=j;try{var z=l(h,u),D=B.S;D!==null&&D(j,z),yy(n,i,z)}catch(K){df(n,i,K)}finally{g!==null&&j.types!==null&&(g.types=j.types),B.T=g}}else try{g=l(h,u),yy(n,i,g)}catch(K){df(n,i,K)}}function yy(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){vy(n,i,u)},function(u){return df(n,i,u)}):vy(n,i,l)}function vy(n,i,l){i.status="fulfilled",i.value=l,xy(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,gy(n,l)))}function df(n,i,l){var u=n.pending;if(n.pending=null,u!==null){u=u.next;do i.status="rejected",i.reason=l,xy(i),i=i.next;while(i!==u)}n.action=null}function xy(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function by(n,i){return i}function Sy(n,i){if(Fe){var l=ut.formState;if(l!==null){e:{var u=Te;if(Fe){if(ht){t:{for(var h=ht,g=Pn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Bn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){ht=Bn(h.nextSibling),u=h.data==="F!";break e}}ii(u)}u=!1}u&&(i=l[0])}}return l=ln(),l.memoizedState=l.baseState=i,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:by,lastRenderedState:i},l.queue=u,l=Iy.bind(null,Te,u),u.dispatch=l,u=uf(!1),g=yf.bind(null,Te,!1,u.queue),u=ln(),h={state:i,dispatch:null,action:n,pending:null},u.queue=h,l=rC.bind(null,Te,h,g,l),h.dispatch=l,u.memoizedState=n,[i,l,!1]}function jy(n){var i=Tt();return wy(i,ot,n)}function wy(n,i,l){if(i=lf(n,i,by)[0],n=Yl(Os)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var u=ho(i)}catch(j){throw j===Ja?Il:j}else u=i;i=Tt();var h=i.queue,g=h.dispatch;return l!==i.memoizedState&&(Te.flags|=2048,nr(9,{destroy:void 0},oC.bind(null,h,l),null)),[u,g,n]}function oC(n,i){n.action=i}function Ny(n){var i=Tt(),l=ot;if(l!==null)return wy(i,l,n);Tt(),i=i.memoizedState,l=Tt();var u=l.queue.dispatch;return l.memoizedState=n,[i,u,!1]}function nr(n,i,l,u){return n={tag:n,create:l,deps:u,inst:i,next:null},i=Te.updateQueue,i===null&&(i=Vl(),Te.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(u=l.next,l.next=n,n.next=u,i.lastEffect=n),n}function Cy(){return Tt().memoizedState}function Jl(n,i,l,u){var h=ln();Te.flags|=n,h.memoizedState=nr(1|i,{destroy:void 0},l,u===void 0?null:u)}function Xl(n,i,l,u){var h=Tt();u=u===void 0?null:u;var g=h.memoizedState.inst;ot!==null&&u!==null&&tf(u,ot.memoizedState.deps)?h.memoizedState=nr(i,g,l,u):(Te.flags|=n,h.memoizedState=nr(1|i,g,l,u))}function ky(n,i){Jl(8390656,8,n,i)}function ff(n,i){Xl(2048,8,n,i)}function lC(n){Te.flags|=4;var i=Te.updateQueue;if(i===null)i=Vl(),Te.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function _y(n){var i=Tt().memoizedState;return lC({ref:i,nextImpl:n}),function(){if((Xe&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function zy(n,i){return Xl(4,2,n,i)}function Ey(n,i){return Xl(4,4,n,i)}function Ry(n,i){if(typeof i=="function"){n=n();var l=i(n);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function Ty(n,i,l){l=l!=null?l.concat([n]):null,Xl(4,4,Ry.bind(null,i,n),l)}function hf(){}function Ay(n,i){var l=Tt();i=i===void 0?null:i;var u=l.memoizedState;return i!==null&&tf(i,u[1])?u[0]:(l.memoizedState=[n,i],n)}function Oy(n,i){var l=Tt();i=i===void 0?null:i;var u=l.memoizedState;if(i!==null&&tf(i,u[1]))return u[0];if(u=n(),aa){Ht(!0);try{n()}finally{Ht(!1)}}return l.memoizedState=[u,i],u}function mf(n,i,l){return l===void 0||(As&1073741824)!==0&&(Ge&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=D0(),Te.lanes|=n,hi|=n,l)}function Dy(n,i,l,u){return kn(l,i)?l:Wa.current!==null?(n=mf(n,l,u),kn(n,i)||(Pt=!0),n):(As&42)===0||(As&1073741824)!==0&&(Ge&261930)===0?(Pt=!0,n.memoizedState=l):(n=D0(),Te.lanes|=n,hi|=n,i)}function Ly(n,i,l,u,h){var g=G.p;G.p=g!==0&&8>g?g:8;var j=B.T,z={};B.T=z,yf(n,!1,i,l);try{var D=h(),K=B.S;if(K!==null&&K(z,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var W=sC(D,u);mo(n,i,W,An(n))}else mo(n,i,u,An(n))}catch(ne){mo(n,i,{then:function(){},status:"rejected",reason:ne},An())}finally{G.p=g,j!==null&&z.types!==null&&(j.types=z.types),B.T=j}}function cC(){}function pf(n,i,l,u){if(n.tag!==5)throw Error(a(476));var h=My(n).queue;Ly(n,h,i,oe,l===null?cC:function(){return $y(n),l(u)})}function My(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:oe},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Os,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function $y(n){var i=My(n);i.next===null&&(i=n.alternate.memoizedState),mo(n,i.next.queue,{},An())}function gf(){return Jt(To)}function Uy(){return Tt().memoizedState}function Py(){return Tt().memoizedState}function uC(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=An();n=oi(l);var u=li(i,n,l);u!==null&&(bn(u,i,l),lo(u,i,l)),i={cache:Gd()},n.payload=i;return}i=i.return}}function dC(n,i,l){var u=An();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Wl(n)?By(i,l):(l=Od(n,i,l,u),l!==null&&(bn(l,n,u),qy(l,i,u)))}function Iy(n,i,l){var u=An();mo(n,i,l,u)}function mo(n,i,l,u){var h={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Wl(n))By(i,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var j=i.lastRenderedState,z=g(j,l);if(h.hasEagerState=!0,h.eagerState=z,kn(z,j))return Ol(n,i,h,0),ut===null&&Al(),!1}catch{}if(l=Od(n,i,h,u),l!==null)return bn(l,n,u),qy(l,i,u),!0}return!1}function yf(n,i,l,u){if(u={lane:2,revertLane:Qf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Wl(n)){if(i)throw Error(a(479))}else i=Od(n,l,u,2),i!==null&&bn(i,n,2)}function Wl(n){var i=n.alternate;return n===Te||i!==null&&i===Te}function By(n,i){er=Fl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function qy(n,i,l){if((l&4194048)!==0){var u=i.lanes;u&=n.pendingLanes,l|=u,i.lanes=l,bl(n,l)}}var po={readContext:Jt,use:Ql,useCallback:Nt,useContext:Nt,useEffect:Nt,useImperativeHandle:Nt,useLayoutEffect:Nt,useInsertionEffect:Nt,useMemo:Nt,useReducer:Nt,useRef:Nt,useState:Nt,useDebugValue:Nt,useDeferredValue:Nt,useTransition:Nt,useSyncExternalStore:Nt,useId:Nt,useHostTransitionStatus:Nt,useFormState:Nt,useActionState:Nt,useOptimistic:Nt,useMemoCache:Nt,useCacheRefresh:Nt};po.useEffectEvent=Nt;var Hy={readContext:Jt,use:Ql,useCallback:function(n,i){return ln().memoizedState=[n,i===void 0?null:i],n},useContext:Jt,useEffect:ky,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,Jl(4194308,4,Ry.bind(null,i,n),l)},useLayoutEffect:function(n,i){return Jl(4194308,4,n,i)},useInsertionEffect:function(n,i){Jl(4,2,n,i)},useMemo:function(n,i){var l=ln();i=i===void 0?null:i;var u=n();if(aa){Ht(!0);try{n()}finally{Ht(!1)}}return l.memoizedState=[u,i],u},useReducer:function(n,i,l){var u=ln();if(l!==void 0){var h=l(i);if(aa){Ht(!0);try{l(i)}finally{Ht(!1)}}}else h=i;return u.memoizedState=u.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},u.queue=n,n=n.dispatch=dC.bind(null,Te,n),[u.memoizedState,n]},useRef:function(n){var i=ln();return n={current:n},i.memoizedState=n},useState:function(n){n=uf(n);var i=n.queue,l=Iy.bind(null,Te,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:hf,useDeferredValue:function(n,i){var l=ln();return mf(l,n,i)},useTransition:function(){var n=uf(!1);return n=Ly.bind(null,Te,n.queue,!0,!1),ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var u=Te,h=ln();if(Fe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),ut===null)throw Error(a(349));(Ge&127)!==0||uy(u,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,ky(fy.bind(null,u,g,n),[n]),u.flags|=2048,nr(9,{destroy:void 0},dy.bind(null,u,g,l,i),null),l},useId:function(){var n=ln(),i=ut.identifierPrefix;if(Fe){var l=ms,u=hs;l=(u&~(1<<32-Qe(u)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Zl++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=iC++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:gf,useFormState:Sy,useActionState:Sy,useOptimistic:function(n){var i=ln();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=yf.bind(null,Te,!0,l),l.dispatch=i,[n,i]},useMemoCache:of,useCacheRefresh:function(){return ln().memoizedState=uC.bind(null,Te)},useEffectEvent:function(n){var i=ln(),l={impl:n};return i.memoizedState=l,function(){if((Xe&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},vf={readContext:Jt,use:Ql,useCallback:Ay,useContext:Jt,useEffect:ff,useImperativeHandle:Ty,useInsertionEffect:zy,useLayoutEffect:Ey,useMemo:Oy,useReducer:Yl,useRef:Cy,useState:function(){return Yl(Os)},useDebugValue:hf,useDeferredValue:function(n,i){var l=Tt();return Dy(l,ot.memoizedState,n,i)},useTransition:function(){var n=Yl(Os)[0],i=Tt().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:cy,useId:Uy,useHostTransitionStatus:gf,useFormState:jy,useActionState:jy,useOptimistic:function(n,i){var l=Tt();return py(l,ot,n,i)},useMemoCache:of,useCacheRefresh:Py};vf.useEffectEvent=_y;var Gy={readContext:Jt,use:Ql,useCallback:Ay,useContext:Jt,useEffect:ff,useImperativeHandle:Ty,useInsertionEffect:zy,useLayoutEffect:Ey,useMemo:Oy,useReducer:cf,useRef:Cy,useState:function(){return cf(Os)},useDebugValue:hf,useDeferredValue:function(n,i){var l=Tt();return ot===null?mf(l,n,i):Dy(l,ot.memoizedState,n,i)},useTransition:function(){var n=cf(Os)[0],i=Tt().memoizedState;return[typeof n=="boolean"?n:ho(n),i]},useSyncExternalStore:cy,useId:Uy,useHostTransitionStatus:gf,useFormState:Ny,useActionState:Ny,useOptimistic:function(n,i){var l=Tt();return ot!==null?py(l,ot,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:of,useCacheRefresh:Py};Gy.useEffectEvent=_y;function xf(n,i,l,u){i=n.memoizedState,l=l(u,i),l=l==null?i:y({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var bf={enqueueSetState:function(n,i,l){n=n._reactInternals;var u=An(),h=oi(u);h.payload=i,l!=null&&(h.callback=l),i=li(n,h,u),i!==null&&(bn(i,n,u),lo(i,n,u))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var u=An(),h=oi(u);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=li(n,h,u),i!==null&&(bn(i,n,u),lo(i,n,u))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=An(),u=oi(l);u.tag=2,i!=null&&(u.callback=i),i=li(n,u,l),i!==null&&(bn(i,n,l),lo(i,n,l))}};function Ky(n,i,l,u,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(u,g,j):i.prototype&&i.prototype.isPureReactComponent?!eo(l,u)||!eo(h,g):!0}function Fy(n,i,l,u){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,u),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,u),i.state!==n&&bf.enqueueReplaceState(i,i.state,null)}function ra(n,i){var l=i;if("ref"in i){l={};for(var u in i)u!=="ref"&&(l[u]=i[u])}if(n=n.defaultProps){l===i&&(l=y({},l));for(var h in n)l[h]===void 0&&(l[h]=n[h])}return l}function Zy(n){Tl(n)}function Vy(n){console.error(n)}function Qy(n){Tl(n)}function ec(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(u){setTimeout(function(){throw u})}}function Yy(n,i,l){try{var u=n.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Sf(n,i,l){return l=oi(l),l.tag=3,l.payload={element:null},l.callback=function(){ec(n,i)},l}function Jy(n){return n=oi(n),n.tag=3,n}function Xy(n,i,l,u){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var g=u.value;n.payload=function(){return h(g)},n.callback=function(){Yy(i,l,u)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){Yy(i,l,u),typeof h!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var z=u.stack;this.componentDidCatch(u.value,{componentStack:z!==null?z:""})})}function fC(n,i,l,u,h){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(i=l.alternate,i!==null&&Va(i,l,h,!0),l=zn.current,l!==null){switch(l.tag){case 31:case 13:return In===null?fc():l.alternate===null&&Ct===0&&(Ct=3),l.flags&=-257,l.flags|=65536,l.lanes=h,u===Bl?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([u]):i.add(u),Ff(n,u,h)),!1;case 22:return l.flags|=65536,u===Bl?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([u]):l.add(u)),Ff(n,u,h)),!1}throw Error(a(435,l.tag))}return Ff(n,u,h),fc(),!1}if(Fe)return i=zn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,u!==Pd&&(n=Error(a(422),{cause:u}),so(Mn(n,l)))):(u!==Pd&&(i=Error(a(423),{cause:u}),so(Mn(i,l))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,u=Mn(u,l),h=Sf(n.stateNode,u,h),Yd(n,h),Ct!==4&&(Ct=2)),!1;var g=Error(a(520),{cause:u});if(g=Mn(g,l),wo===null?wo=[g]:wo.push(g),Ct!==4&&(Ct=2),i===null)return!0;u=Mn(u,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=h&-h,l.lanes|=n,n=Sf(l.stateNode,u,n),Yd(l,n),!1;case 1:if(i=l.type,g=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(mi===null||!mi.has(g))))return l.flags|=65536,h&=-h,l.lanes|=h,h=Jy(h),Xy(h,n,l,u),Yd(l,h),!1}l=l.return}while(l!==null);return!1}var jf=Error(a(461)),Pt=!1;function Xt(n,i,l,u){i.child=n===null?ny(i,null,l,u):ia(i,n.child,l,u)}function Wy(n,i,l,u,h){l=l.render;var g=i.ref;if("ref"in u){var j={};for(var z in u)z!=="ref"&&(j[z]=u[z])}else j=u;return ea(i),u=nf(n,i,l,j,g,h),z=sf(),n!==null&&!Pt?(af(n,i,h),Ds(n,i,h)):(Fe&&z&&$d(i),i.flags|=1,Xt(n,i,u,h),i.child)}function e0(n,i,l,u,h){if(n===null){var g=l.type;return typeof g=="function"&&!Dd(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,t0(n,i,g,u,h)):(n=Ll(l.type,null,u,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Rf(n,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:eo,l(j,u)&&n.ref===i.ref)return Ds(n,i,h)}return i.flags|=1,n=zs(g,u),n.ref=i.ref,n.return=i,i.child=n}function t0(n,i,l,u,h){if(n!==null){var g=n.memoizedProps;if(eo(g,u)&&n.ref===i.ref)if(Pt=!1,i.pendingProps=u=g,Rf(n,h))(n.flags&131072)!==0&&(Pt=!0);else return i.lanes=n.lanes,Ds(n,i,h)}return wf(n,i,l,u,h)}function n0(n,i,l,u){var h=u.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,n!==null){for(u=i.child=n.child,h=0;u!==null;)h=h|u.lanes|u.childLanes,u=u.sibling;u=h&~g}else u=0,i.child=null;return s0(n,i,g,l,u)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Pl(i,g!==null?g.cachePool:null),g!==null?ay(i,g):Xd(),ry(i);else return u=i.lanes=536870912,s0(n,i,g!==null?g.baseLanes|l:l,l,u)}else g!==null?(Pl(i,g.cachePool),ay(i,g),ui(),i.memoizedState=null):(n!==null&&Pl(i,null),Xd(),ui());return Xt(n,i,h,l),i.child}function go(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function s0(n,i,l,u,h){var g=Fd();return g=g===null?null:{parent:$t._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Pl(i,null),Xd(),ry(i),n!==null&&Va(n,i,u,!0),i.childLanes=h,null}function tc(n,i){return i=sc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function i0(n,i,l){return ia(i,n.child,null,l),n=tc(i,i.pendingProps),n.flags|=2,En(i),i.memoizedState=null,n}function hC(n,i,l){var u=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Fe){if(u.mode==="hidden")return n=tc(i,u),i.lanes=536870912,go(null,n);if(ef(i),(n=ht)?(n=gv(n,Pn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},l=Bg(n),l.return=i,i.child=l,Yt=i,ht=null)):n=null,n===null)throw ii(i);return i.lanes=536870912,null}return tc(i,u)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(ef(i),h)if(i.flags&256)i.flags&=-257,i=i0(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Pt||Va(n,i,l,!1),h=(l&n.childLanes)!==0,Pt||h){if(u=ut,u!==null&&(j=Kr(u,l),j!==0&&j!==g.retryLane))throw g.retryLane=j,Yi(n,j),bn(u,n,j),jf;fc(),i=i0(n,i,l)}else n=g.treeContext,ht=Bn(j.nextSibling),Yt=i,Fe=!0,si=null,Pn=!1,n!==null&&Gg(i,n),i=tc(i,u),i.flags|=4096;return i}return n=zs(n.child,{mode:u.mode,children:u.children}),n.ref=i.ref,i.child=n,n.return=i,n}function nc(n,i){var l=i.ref;if(l===null)n!==null&&n.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(n===null||n.ref!==l)&&(i.flags|=4194816)}}function wf(n,i,l,u,h){return ea(i),l=nf(n,i,l,u,void 0,h),u=sf(),n!==null&&!Pt?(af(n,i,h),Ds(n,i,h)):(Fe&&u&&$d(i),i.flags|=1,Xt(n,i,l,h),i.child)}function a0(n,i,l,u,h,g){return ea(i),i.updateQueue=null,l=ly(i,u,l,h),oy(n),u=sf(),n!==null&&!Pt?(af(n,i,g),Ds(n,i,g)):(Fe&&u&&$d(i),i.flags|=1,Xt(n,i,l,g),i.child)}function r0(n,i,l,u,h){if(ea(i),i.stateNode===null){var g=Ga,j=l.contextType;typeof j=="object"&&j!==null&&(g=Jt(j)),g=new l(u,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=bf,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=u,g.state=i.memoizedState,g.refs={},Vd(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Jt(j):Ga,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(xf(i,l,j,u),g.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&bf.enqueueReplaceState(g,g.state,null),uo(i,u,g,h),co(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!0}else if(n===null){g=i.stateNode;var z=i.memoizedProps,D=ra(l,z);g.props=D;var K=g.context,W=l.contextType;j=Ga,typeof W=="object"&&W!==null&&(j=Jt(W));var ne=l.getDerivedStateFromProps;W=typeof ne=="function"||typeof g.getSnapshotBeforeUpdate=="function",z=i.pendingProps!==z,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(z||K!==j)&&Fy(i,g,u,j),ri=!1;var V=i.memoizedState;g.state=V,uo(i,u,g,h),co(),K=i.memoizedState,z||V!==K||ri?(typeof ne=="function"&&(xf(i,l,ne,u),K=i.memoizedState),(D=ri||Ky(i,l,D,u,V,K,j))?(W||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=u,i.memoizedState=K),g.props=u,g.state=K,g.context=j,u=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),u=!1)}else{g=i.stateNode,Qd(n,i),j=i.memoizedProps,W=ra(l,j),g.props=W,ne=i.pendingProps,V=g.context,K=l.contextType,D=Ga,typeof K=="object"&&K!==null&&(D=Jt(K)),z=l.getDerivedStateFromProps,(K=typeof z=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ne||V!==D)&&Fy(i,g,u,D),ri=!1,V=i.memoizedState,g.state=V,uo(i,u,g,h),co();var Y=i.memoizedState;j!==ne||V!==Y||ri||n!==null&&n.dependencies!==null&&$l(n.dependencies)?(typeof z=="function"&&(xf(i,l,z,u),Y=i.memoizedState),(W=ri||Ky(i,l,W,u,V,Y,D)||n!==null&&n.dependencies!==null&&$l(n.dependencies))?(K||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,Y,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,Y,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),i.memoizedProps=u,i.memoizedState=Y),g.props=u,g.state=Y,g.context=D,u=W):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&V===n.memoizedState||(i.flags|=1024),u=!1)}return g=u,nc(n,i),u=(i.flags&128)!==0,g||u?(g=i.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&u?(i.child=ia(i,n.child,null,h),i.child=ia(i,null,l,h)):Xt(n,i,l,h),i.memoizedState=g.state,n=i.child):n=Ds(n,i,h),n}function o0(n,i,l,u){return Xi(),i.flags|=256,Xt(n,i,l,u),i.child}var Nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cf(n){return{baseLanes:n,cachePool:Yg()}}function kf(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=Tn),n}function l0(n,i,l){var u=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(Rt.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(Fe){if(h?ci(i):ui(),(n=ht)?(n=gv(n,Pn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ni!==null?{id:hs,overflow:ms}:null,retryLane:536870912,hydrationErrors:null},l=Bg(n),l.return=i,i.child=l,Yt=i,ht=null)):n=null,n===null)throw ii(i);return lh(n)?i.lanes=32:i.lanes=536870912,null}var z=u.children;return u=u.fallback,h?(ui(),h=i.mode,z=sc({mode:"hidden",children:z},h),u=Ji(u,h,l,null),z.return=i,u.return=i,z.sibling=u,i.child=z,u=i.child,u.memoizedState=Cf(l),u.childLanes=kf(n,j,l),i.memoizedState=Nf,go(null,u)):(ci(i),_f(i,z))}var D=n.memoizedState;if(D!==null&&(z=D.dehydrated,z!==null)){if(g)i.flags&256?(ci(i),i.flags&=-257,i=zf(n,i,l)):i.memoizedState!==null?(ui(),i.child=n.child,i.flags|=128,i=null):(ui(),z=u.fallback,h=i.mode,u=sc({mode:"visible",children:u.children},h),z=Ji(z,h,l,null),z.flags|=2,u.return=i,z.return=i,u.sibling=z,i.child=u,ia(i,n.child,null,l),u=i.child,u.memoizedState=Cf(l),u.childLanes=kf(n,j,l),i.memoizedState=Nf,i=go(null,u));else if(ci(i),lh(z)){if(j=z.nextSibling&&z.nextSibling.dataset,j)var K=j.dgst;j=K,u=Error(a(419)),u.stack="",u.digest=j,so({value:u,source:null,stack:null}),i=zf(n,i,l)}else if(Pt||Va(n,i,l,!1),j=(l&n.childLanes)!==0,Pt||j){if(j=ut,j!==null&&(u=Kr(j,l),u!==0&&u!==D.retryLane))throw D.retryLane=u,Yi(n,u),bn(j,n,u),jf;oh(z)||fc(),i=zf(n,i,l)}else oh(z)?(i.flags|=192,i.child=n.child,i=null):(n=D.treeContext,ht=Bn(z.nextSibling),Yt=i,Fe=!0,si=null,Pn=!1,n!==null&&Gg(i,n),i=_f(i,u.children),i.flags|=4096);return i}return h?(ui(),z=u.fallback,h=i.mode,D=n.child,K=D.sibling,u=zs(D,{mode:"hidden",children:u.children}),u.subtreeFlags=D.subtreeFlags&65011712,K!==null?z=zs(K,z):(z=Ji(z,h,l,null),z.flags|=2),z.return=i,u.return=i,u.sibling=z,i.child=u,go(null,u),u=i.child,z=n.child.memoizedState,z===null?z=Cf(l):(h=z.cachePool,h!==null?(D=$t._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=Yg(),z={baseLanes:z.baseLanes|l,cachePool:h}),u.memoizedState=z,u.childLanes=kf(n,j,l),i.memoizedState=Nf,go(n.child,u)):(ci(i),l=n.child,n=l.sibling,l=zs(l,{mode:"visible",children:u.children}),l.return=i,l.sibling=null,n!==null&&(j=i.deletions,j===null?(i.deletions=[n],i.flags|=16):j.push(n)),i.child=l,i.memoizedState=null,l)}function _f(n,i){return i=sc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function sc(n,i){return n=_n(22,n,null,i),n.lanes=0,n}function zf(n,i,l){return ia(i,n.child,null,l),n=_f(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function c0(n,i,l){n.lanes|=i;var u=n.alternate;u!==null&&(u.lanes|=i),qd(n.return,i,l)}function Ef(n,i,l,u,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=u,j.tail=l,j.tailMode=h,j.treeForkCount=g)}function u0(n,i,l){var u=i.pendingProps,h=u.revealOrder,g=u.tail;u=u.children;var j=Rt.current,z=(j&2)!==0;if(z?(j=j&1|2,i.flags|=128):j&=1,ie(Rt,j),Xt(n,i,u,l),u=Fe?no:0,!z&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&c0(n,l,i);else if(n.tag===19)c0(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)n=l.alternate,n!==null&&Kl(n)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Ef(i,!1,h,l,g,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Kl(n)===null){i.child=h;break}n=h.sibling,h.sibling=l,l=h,h=n}Ef(i,!0,l,null,g,u);break;case"together":Ef(i,!1,null,null,void 0,u);break;default:i.memoizedState=null}return i.child}function Ds(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),hi|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(Va(n,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(n!==null&&i.child!==n.child)throw Error(a(153));if(i.child!==null){for(n=i.child,l=zs(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=zs(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Rf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&$l(n)))}function mC(n,i,l){switch(i.tag){case 3:Me(i,i.stateNode.containerInfo),ai(i,$t,n.memoizedState.cache),Xi();break;case 27:case 5:Ze(i);break;case 4:Me(i,i.stateNode.containerInfo);break;case 10:ai(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ef(i),null;break;case 13:var u=i.memoizedState;if(u!==null)return u.dehydrated!==null?(ci(i),i.flags|=128,null):(l&i.child.childLanes)!==0?l0(n,i,l):(ci(i),n=Ds(n,i,l),n!==null?n.sibling:null);ci(i);break;case 19:var h=(n.flags&128)!==0;if(u=(l&i.childLanes)!==0,u||(Va(n,i,l,!1),u=(l&i.childLanes)!==0),h){if(u)return u0(n,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),ie(Rt,Rt.current),u)break;return null;case 22:return i.lanes=0,n0(n,i,l,i.pendingProps);case 24:ai(i,$t,n.memoizedState.cache)}return Ds(n,i,l)}function d0(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)Pt=!0;else{if(!Rf(n,l)&&(i.flags&128)===0)return Pt=!1,mC(n,i,l);Pt=(n.flags&131072)!==0}else Pt=!1,Fe&&(i.flags&1048576)!==0&&Hg(i,no,i.index);switch(i.lanes=0,i.tag){case 16:e:{var u=i.pendingProps;if(n=na(i.elementType),i.type=n,typeof n=="function")Dd(n)?(u=ra(n,u),i.tag=1,i=r0(null,i,n,u,l)):(i.tag=0,i=wf(null,i,n,u,l));else{if(n!=null){var h=n.$$typeof;if(h===_){i.tag=11,i=Wy(null,i,n,u,l);break e}else if(h===T){i.tag=14,i=e0(null,i,n,u,l);break e}}throw i=ke(n)||n,Error(a(306,i,""))}}return i;case 0:return wf(n,i,i.type,i.pendingProps,l);case 1:return u=i.type,h=ra(u,i.pendingProps),r0(n,i,u,h,l);case 3:e:{if(Me(i,i.stateNode.containerInfo),n===null)throw Error(a(387));u=i.pendingProps;var g=i.memoizedState;h=g.element,Qd(n,i),uo(i,u,null,l);var j=i.memoizedState;if(u=j.cache,ai(i,$t,u),u!==g.cache&&Hd(i,[$t],l,!0),co(),u=j.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=o0(n,i,u,l);break e}else if(u!==h){h=Mn(Error(a(424)),i),so(h),i=o0(n,i,u,l);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,ht=Bn(n.firstChild),Yt=i,Fe=!0,si=null,Pn=!0,l=ny(i,null,u,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Xi(),u===h){i=Ds(n,i,l);break e}Xt(n,i,u,l)}i=i.child}return i;case 26:return nc(n,i),n===null?(l=jv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Fe||(l=i.type,n=i.pendingProps,u=xc(he.current).createElement(l),u[Et]=i,u[wt]=n,Wt(u,l,n),Mt(u),i.stateNode=u):i.memoizedState=jv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ze(i),n===null&&Fe&&(u=i.stateNode=xv(i.type,i.pendingProps,he.current),Yt=i,Pn=!0,h=ht,vi(i.type)?(ch=h,ht=Bn(u.firstChild)):ht=h),Xt(n,i,i.pendingProps.children,l),nc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Fe&&((h=u=ht)&&(u=GC(u,i.type,i.pendingProps,Pn),u!==null?(i.stateNode=u,Yt=i,ht=Bn(u.firstChild),Pn=!1,h=!0):h=!1),h||ii(i)),Ze(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,u=g.children,ih(h,g)?u=null:j!==null&&ih(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=nf(n,i,aC,null,null,l),To._currentValue=h),nc(n,i),Xt(n,i,u,l),i.child;case 6:return n===null&&Fe&&((n=l=ht)&&(l=KC(l,i.pendingProps,Pn),l!==null?(i.stateNode=l,Yt=i,ht=null,n=!0):n=!1),n||ii(i)),null;case 13:return l0(n,i,l);case 4:return Me(i,i.stateNode.containerInfo),u=i.pendingProps,n===null?i.child=ia(i,null,u,l):Xt(n,i,u,l),i.child;case 11:return Wy(n,i,i.type,i.pendingProps,l);case 7:return Xt(n,i,i.pendingProps,l),i.child;case 8:return Xt(n,i,i.pendingProps.children,l),i.child;case 12:return Xt(n,i,i.pendingProps.children,l),i.child;case 10:return u=i.pendingProps,ai(i,i.type,u.value),Xt(n,i,u.children,l),i.child;case 9:return h=i.type._context,u=i.pendingProps.children,ea(i),h=Jt(h),u=u(h),i.flags|=1,Xt(n,i,u,l),i.child;case 14:return e0(n,i,i.type,i.pendingProps,l);case 15:return t0(n,i,i.type,i.pendingProps,l);case 19:return u0(n,i,l);case 31:return hC(n,i,l);case 22:return n0(n,i,l,i.pendingProps);case 24:return ea(i),u=Jt($t),n===null?(h=Fd(),h===null&&(h=ut,g=Gd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:u,cache:h},Vd(i),ai(i,$t,h)):((n.lanes&l)!==0&&(Qd(n,i),uo(i,null,null,l),co()),h=n.memoizedState,g=i.memoizedState,h.parent!==u?(h={parent:u,cache:u},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ai(i,$t,u)):(u=g.cache,ai(i,$t,u),u!==h.cache&&Hd(i,[$t],l,!0))),Xt(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ls(n){n.flags|=4}function Tf(n,i,l,u,h){if((i=(n.mode&32)!==0)&&(i=!1),i){if(n.flags|=16777216,(h&335544128)===h)if(n.stateNode.complete)n.flags|=8192;else if(U0())n.flags|=8192;else throw sa=Bl,Zd}else n.flags&=-16777217}function f0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!_v(i))if(U0())n.flags|=8192;else throw sa=Bl,Zd}function ic(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?vl():536870912,n.lanes|=i,rr|=i)}function yo(n,i){if(!Fe)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:u.sibling=null}}function mt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,u=0;if(i)for(var h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags&65011712,u|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)l|=h.lanes|h.childLanes,u|=h.subtreeFlags,u|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=u,n.childLanes=l,i}function pC(n,i,l){var u=i.pendingProps;switch(Ud(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(i),null;case 1:return mt(i),null;case 3:return l=i.stateNode,u=null,n!==null&&(u=n.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Ts($t),ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Za(i)?Ls(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Id())),mt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?(Ls(i),g!==null?(mt(i),f0(i,g)):(mt(i),Tf(i,h,null,u,l))):g?g!==n.memoizedState?(Ls(i),mt(i),f0(i,g)):(mt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==u&&Ls(i),mt(i),Tf(i,h,n,u,l)),null;case 27:if(it(i),l=he.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ls(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}n=re.current,Za(i)?Kg(i):(n=xv(h,u,l),i.stateNode=n,Ls(i))}return mt(i),null;case 5:if(it(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==u&&Ls(i);else{if(!u){if(i.stateNode===null)throw Error(a(166));return mt(i),null}if(g=re.current,Za(i))Kg(i);else{var j=xc(he.current);switch(g){case 1:g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":g=j.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":g=j.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":g=j.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?j.createElement("select",{is:u.is}):j.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?j.createElement(h,{is:u.is}):j.createElement(h)}}g[Et]=i,g[wt]=u;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)g.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=g;e:switch(Wt(g,h,u),h){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ls(i)}}return mt(i),Tf(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==u&&Ls(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(a(166));if(n=he.current,Za(i)){if(n=i.stateNode,l=i.memoizedProps,u=null,h=Yt,h!==null)switch(h.tag){case 27:case 5:u=h.memoizedProps}n[Et]=i,n=!!(n.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||lv(n.nodeValue,l)),n||ii(i,!0)}else n=xc(n).createTextNode(u),n[Et]=i,i.stateNode=n}return mt(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(u=Za(i),l!==null){if(n===null){if(!u)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[Et]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),n=!1}else l=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(En(i),i):(En(i),null);if((i.flags&128)!==0)throw Error(a(558))}return mt(i),null;case 13:if(u=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Za(i),u!==null&&u.dehydrated!==null){if(n===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[Et]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mt(i),h=!1}else h=Id(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(En(i),i):(En(i),null)}return En(i),(i.flags&128)!==0?(i.lanes=l,i):(l=u!==null,n=n!==null&&n.memoizedState!==null,l&&(u=i.child,h=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(h=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),ic(i,i.updateQueue),mt(i),null);case 4:return ge(),n===null&&Wf(i.stateNode.containerInfo),mt(i),null;case 10:return Ts(i.type),mt(i),null;case 19:if(F(Rt),u=i.memoizedState,u===null)return mt(i),null;if(h=(i.flags&128)!==0,g=u.rendering,g===null)if(h)yo(u,!1);else{if(Ct!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Kl(n),g!==null){for(i.flags|=128,yo(u,!1),n=g.updateQueue,i.updateQueue=n,ic(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)Ig(l,n),l=l.sibling;return ie(Rt,Rt.current&1|2),Fe&&Es(i,u.treeForkCount),i.child}n=n.sibling}u.tail!==null&&qe()>cc&&(i.flags|=128,h=!0,yo(u,!1),i.lanes=4194304)}else{if(!h)if(n=Kl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,ic(i,n),yo(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Fe)return mt(i),null}else 2*qe()-u.renderingStartTime>cc&&l!==536870912&&(i.flags|=128,h=!0,yo(u,!1),i.lanes=4194304);u.isBackwards?(g.sibling=i.child,i.child=g):(n=u.last,n!==null?n.sibling=g:i.child=g,u.last=g)}return u.tail!==null?(n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=qe(),n.sibling=null,l=Rt.current,ie(Rt,h?l&1|2:l&1),Fe&&Es(i,u.treeForkCount),n):(mt(i),null);case 22:case 23:return En(i),Wd(),u=i.memoizedState!==null,n!==null?n.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(l&536870912)!==0&&(i.flags&128)===0&&(mt(i),i.subtreeFlags&6&&(i.flags|=8192)):mt(i),l=i.updateQueue,l!==null&&ic(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==l&&(i.flags|=2048),n!==null&&F(ta),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ts($t),mt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function gC(n,i){switch(Ud(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ts($t),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return it(i),null;case 31:if(i.memoizedState!==null){if(En(i),i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(En(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Xi()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return F(Rt),null;case 4:return ge(),null;case 10:return Ts(i.type),null;case 22:case 23:return En(i),Wd(),n!==null&&F(ta),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Ts($t),null;case 25:return null;default:return null}}function h0(n,i){switch(Ud(i),i.tag){case 3:Ts($t),ge();break;case 26:case 27:case 5:it(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&En(i);break;case 13:En(i);break;case 19:F(Rt);break;case 10:Ts(i.type);break;case 22:case 23:En(i),Wd(),n!==null&&F(ta);break;case 24:Ts($t)}}function vo(n,i){try{var l=i.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var h=u.next;l=h;do{if((l.tag&n)===n){u=void 0;var g=l.create,j=l.inst;u=g(),j.destroy=u}l=l.next}while(l!==h)}}catch(z){tt(i,i.return,z)}}function di(n,i,l){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var g=h.next;u=g;do{if((u.tag&n)===n){var j=u.inst,z=j.destroy;if(z!==void 0){j.destroy=void 0,h=i;var D=l,K=z;try{K()}catch(W){tt(h,D,W)}}}u=u.next}while(u!==g)}}catch(W){tt(i,i.return,W)}}function m0(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{iy(i,l)}catch(u){tt(n,n.return,u)}}}function p0(n,i,l){l.props=ra(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(u){tt(n,i,u)}}function xo(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var u=n.stateNode;break;case 30:u=n.stateNode;break;default:u=n.stateNode}typeof l=="function"?n.refCleanup=l(u):l.current=u}}catch(h){tt(n,i,h)}}function ps(n,i){var l=n.ref,u=n.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(h){tt(n,i,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){tt(n,i,h)}else l.current=null}function g0(n){var i=n.type,l=n.memoizedProps,u=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(h){tt(n,n.return,h)}}function Af(n,i,l){try{var u=n.stateNode;UC(u,n.type,l,i),u[wt]=i}catch(h){tt(n,n.return,h)}}function y0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&vi(n.type)||n.tag===4}function Of(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||y0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&vi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Df(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(n),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=ks));else if(u!==4&&(u===27&&vi(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Df(n,i,l),n=n.sibling;n!==null;)Df(n,i,l),n=n.sibling}function ac(n,i,l){var u=n.tag;if(u===5||u===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(u!==4&&(u===27&&vi(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(ac(n,i,l),n=n.sibling;n!==null;)ac(n,i,l),n=n.sibling}function v0(n){var i=n.stateNode,l=n.memoizedProps;try{for(var u=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);Wt(i,u,l),i[Et]=n,i[wt]=l}catch(g){tt(n,n.return,g)}}var Ms=!1,It=!1,Lf=!1,x0=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function yC(n,i){if(n=n.containerInfo,nh=kc,n=Tg(n),_d(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var h=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var j=0,z=-1,D=-1,K=0,W=0,ne=n,V=null;t:for(;;){for(var Y;ne!==l||h!==0&&ne.nodeType!==3||(z=j+h),ne!==g||u!==0&&ne.nodeType!==3||(D=j+u),ne.nodeType===3&&(j+=ne.nodeValue.length),(Y=ne.firstChild)!==null;)V=ne,ne=Y;for(;;){if(ne===n)break t;if(V===l&&++K===h&&(z=j),V===g&&++W===u&&(D=j),(Y=ne.nextSibling)!==null)break;ne=V,V=ne.parentNode}ne=Y}l=z===-1||D===-1?null:{start:z,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(sh={focusedElem:n,selectionRange:l},kc=!1,Zt=i;Zt!==null;)if(i=Zt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Zt=n;else for(;Zt!==null;){switch(i=Zt,g=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)h=n[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,l=i,h=g.memoizedProps,g=g.memoizedState,u=l.stateNode;try{var ve=ra(l.type,h);n=u.getSnapshotBeforeUpdate(ve,g),u.__reactInternalSnapshotBeforeUpdate=n}catch(Ce){tt(l,l.return,Ce)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)rh(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":rh(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(a(163))}if(n=i.sibling,n!==null){n.return=i.return,Zt=n;break}Zt=i.return}}function b0(n,i,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Us(n,l),u&4&&vo(5,l);break;case 1:if(Us(n,l),u&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(j){tt(l,l.return,j)}else{var h=ra(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){tt(l,l.return,j)}}u&64&&m0(l),u&512&&xo(l,l.return);break;case 3:if(Us(n,l),u&64&&(n=l.updateQueue,n!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{iy(n,i)}catch(j){tt(l,l.return,j)}}break;case 27:i===null&&u&4&&v0(l);case 26:case 5:Us(n,l),i===null&&u&4&&g0(l),u&512&&xo(l,l.return);break;case 12:Us(n,l);break;case 31:Us(n,l),u&4&&w0(n,l);break;case 13:Us(n,l),u&4&&N0(n,l),u&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=kC.bind(null,l),FC(n,l))));break;case 22:if(u=l.memoizedState!==null||Ms,!u){i=i!==null&&i.memoizedState!==null||It,h=Ms;var g=It;Ms=u,(It=i)&&!g?Ps(n,l,(l.subtreeFlags&8772)!==0):Us(n,l),Ms=h,It=g}break;case 30:break;default:Us(n,l)}}function S0(n){var i=n.alternate;i!==null&&(n.alternate=null,S0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Da(i)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var gt=null,gn=!1;function $s(n,i,l){for(l=l.child;l!==null;)j0(n,i,l),l=l.sibling}function j0(n,i,l){if(_e&&typeof _e.onCommitFiberUnmount=="function")try{_e.onCommitFiberUnmount(ls,l)}catch{}switch(l.tag){case 26:It||ps(l,i),$s(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:It||ps(l,i);var u=gt,h=gn;vi(l.type)&&(gt=l.stateNode,gn=!1),$s(n,i,l),zo(l.stateNode),gt=u,gn=h;break;case 5:It||ps(l,i);case 6:if(u=gt,h=gn,gt=null,$s(n,i,l),gt=u,gn=h,gt!==null)if(gn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(l.stateNode)}catch(g){tt(l,i,g)}else try{gt.removeChild(l.stateNode)}catch(g){tt(l,i,g)}break;case 18:gt!==null&&(gn?(n=gt,mv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),mr(n)):mv(gt,l.stateNode));break;case 4:u=gt,h=gn,gt=l.stateNode.containerInfo,gn=!0,$s(n,i,l),gt=u,gn=h;break;case 0:case 11:case 14:case 15:di(2,l,i),It||di(4,l,i),$s(n,i,l);break;case 1:It||(ps(l,i),u=l.stateNode,typeof u.componentWillUnmount=="function"&&p0(l,i,u)),$s(n,i,l);break;case 21:$s(n,i,l);break;case 22:It=(u=It)||l.memoizedState!==null,$s(n,i,l),It=u;break;default:$s(n,i,l)}}function w0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{mr(n)}catch(l){tt(i,i.return,l)}}}function N0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{mr(n)}catch(l){tt(i,i.return,l)}}function vC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new x0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new x0),i;default:throw Error(a(435,n.tag))}}function rc(n,i){var l=vC(n);i.forEach(function(u){if(!l.has(u)){l.add(u);var h=_C.bind(null,n,u);u.then(h,h)}})}function yn(n,i){var l=i.deletions;if(l!==null)for(var u=0;u<l.length;u++){var h=l[u],g=n,j=i,z=j;e:for(;z!==null;){switch(z.tag){case 27:if(vi(z.type)){gt=z.stateNode,gn=!1;break e}break;case 5:gt=z.stateNode,gn=!1;break e;case 3:case 4:gt=z.stateNode.containerInfo,gn=!0;break e}z=z.return}if(gt===null)throw Error(a(160));j0(g,j,h),gt=null,gn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)C0(i,n),i=i.sibling}var es=null;function C0(n,i){var l=n.alternate,u=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:yn(i,n),vn(n),u&4&&(di(3,n,n.return),vo(3,n),di(5,n,n.return));break;case 1:yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),u&64&&Ms&&(n=n.updateQueue,n!==null&&(u=n.callbacks,u!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var h=es;if(yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),u&4){var g=l!==null?l.memoizedState:null;if(u=n.memoizedState,l===null)if(u===null)if(n.stateNode===null){e:{u=n.type,l=n.memoizedProps,h=h.ownerDocument||h;t:switch(u){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ds]||g[Et]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(u),h.head.insertBefore(g,h.querySelector("head > title"))),Wt(g,u,l),g[Et]=n,Mt(g),u=g;break e;case"link":var j=Cv("link","href",h).get(u+(l.href||""));if(j){for(var z=0;z<j.length;z++)if(g=j[z],g.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&g.getAttribute("rel")===(l.rel==null?null:l.rel)&&g.getAttribute("title")===(l.title==null?null:l.title)&&g.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){j.splice(z,1);break t}}g=h.createElement(u),Wt(g,u,l),h.head.appendChild(g);break;case"meta":if(j=Cv("meta","content",h).get(u+(l.content||""))){for(z=0;z<j.length;z++)if(g=j[z],g.getAttribute("content")===(l.content==null?null:""+l.content)&&g.getAttribute("name")===(l.name==null?null:l.name)&&g.getAttribute("property")===(l.property==null?null:l.property)&&g.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&g.getAttribute("charset")===(l.charSet==null?null:l.charSet)){j.splice(z,1);break t}}g=h.createElement(u),Wt(g,u,l),h.head.appendChild(g);break;default:throw Error(a(468,u))}g[Et]=n,Mt(g),u=g}n.stateNode=u}else kv(h,n.type,n.stateNode);else n.stateNode=Nv(h,u,n.memoizedProps);else g!==u?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,u===null?kv(h,n.type,n.stateNode):Nv(h,u,n.memoizedProps)):u===null&&n.stateNode!==null&&Af(n,n.memoizedProps,l.memoizedProps)}break;case 27:yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),l!==null&&u&4&&Af(n,n.memoizedProps,l.memoizedProps);break;case 5:if(yn(i,n),vn(n),u&512&&(It||l===null||ps(l,l.return)),n.flags&32){h=n.stateNode;try{$a(h,"")}catch(ve){tt(n,n.return,ve)}}u&4&&n.stateNode!=null&&(h=n.memoizedProps,Af(n,h,l!==null?l.memoizedProps:h)),u&1024&&(Lf=!0);break;case 6:if(yn(i,n),vn(n),u&4){if(n.stateNode===null)throw Error(a(162));u=n.memoizedProps,l=n.stateNode;try{l.nodeValue=u}catch(ve){tt(n,n.return,ve)}}break;case 3:if(jc=null,h=es,es=bc(i.containerInfo),yn(i,n),es=h,vn(n),u&4&&l!==null&&l.memoizedState.isDehydrated)try{mr(i.containerInfo)}catch(ve){tt(n,n.return,ve)}Lf&&(Lf=!1,k0(n));break;case 4:u=es,es=bc(n.stateNode.containerInfo),yn(i,n),vn(n),es=u;break;case 12:yn(i,n),vn(n);break;case 31:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 13:yn(i,n),vn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(lc=qe()),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 22:h=n.memoizedState!==null;var D=l!==null&&l.memoizedState!==null,K=Ms,W=It;if(Ms=K||h,It=W||D,yn(i,n),It=W,Ms=K,vn(n),u&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||D||Ms||It||oa(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){D=l=i;try{if(g=D.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{z=D.stateNode;var ne=D.memoizedProps.style,V=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;z.style.display=V==null||typeof V=="boolean"?"":(""+V).trim()}}catch(ve){tt(D,D.return,ve)}}}else if(i.tag===6){if(l===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ve){tt(D,D.return,ve)}}}else if(i.tag===18){if(l===null){D=i;try{var Y=D.stateNode;h?pv(Y,!0):pv(D.stateNode,!1)}catch(ve){tt(D,D.return,ve)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===n)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}u&4&&(u=n.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,rc(n,l))));break;case 19:yn(i,n),vn(n),u&4&&(u=n.updateQueue,u!==null&&(n.updateQueue=null,rc(n,u)));break;case 30:break;case 21:break;default:yn(i,n),vn(n)}}function vn(n){var i=n.flags;if(i&2){try{for(var l,u=n.return;u!==null;){if(y0(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=Of(n);ac(n,g,h);break;case 5:var j=l.stateNode;l.flags&32&&($a(j,""),l.flags&=-33);var z=Of(n);ac(n,z,j);break;case 3:case 4:var D=l.stateNode.containerInfo,K=Of(n);Df(n,K,D);break;default:throw Error(a(161))}}catch(W){tt(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function k0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;k0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Us(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)b0(n,i.alternate,i),i=i.sibling}function oa(n){for(n=n.child;n!==null;){var i=n;switch(i.tag){case 0:case 11:case 14:case 15:di(4,i,i.return),oa(i);break;case 1:ps(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&p0(i,i.return,l),oa(i);break;case 27:zo(i.stateNode);case 26:case 5:ps(i,i.return),oa(i);break;case 22:i.memoizedState===null&&oa(i);break;case 30:oa(i);break;default:oa(i)}n=n.sibling}}function Ps(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var u=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:Ps(h,g,l),vo(4,g);break;case 1:if(Ps(h,g,l),u=g,h=u.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(K){tt(u,u.return,K)}if(u=g,h=u.updateQueue,h!==null){var z=u.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)sy(D[h],z)}catch(K){tt(u,u.return,K)}}l&&j&64&&m0(g),xo(g,g.return);break;case 27:v0(g);case 26:case 5:Ps(h,g,l),l&&u===null&&j&4&&g0(g),xo(g,g.return);break;case 12:Ps(h,g,l);break;case 31:Ps(h,g,l),l&&j&4&&w0(h,g);break;case 13:Ps(h,g,l),l&&j&4&&N0(h,g);break;case 22:g.memoizedState===null&&Ps(h,g,l),xo(g,g.return);break;case 30:break;default:Ps(h,g,l)}i=i.sibling}}function Mf(n,i){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(n=i.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&io(l))}function $f(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&io(n))}function ts(n,i,l,u){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)_0(n,i,l,u),i=i.sibling}function _0(n,i,l,u){var h=i.flags;switch(i.tag){case 0:case 11:case 15:ts(n,i,l,u),h&2048&&vo(9,i);break;case 1:ts(n,i,l,u);break;case 3:ts(n,i,l,u),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&io(n)));break;case 12:if(h&2048){ts(n,i,l,u),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,z=g.onPostCommit;typeof z=="function"&&z(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){tt(i,i.return,D)}}else ts(n,i,l,u);break;case 31:ts(n,i,l,u);break;case 13:ts(n,i,l,u);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?ts(n,i,l,u):bo(n,i):g._visibility&2?ts(n,i,l,u):(g._visibility|=2,sr(n,i,l,u,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Mf(j,i);break;case 24:ts(n,i,l,u),h&2048&&$f(i.alternate,i);break;default:ts(n,i,l,u)}}function sr(n,i,l,u,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,z=l,D=u,K=j.flags;switch(j.tag){case 0:case 11:case 15:sr(g,j,z,D,h),vo(8,j);break;case 23:break;case 22:var W=j.stateNode;j.memoizedState!==null?W._visibility&2?sr(g,j,z,D,h):bo(g,j):(W._visibility|=2,sr(g,j,z,D,h)),h&&K&2048&&Mf(j.alternate,j);break;case 24:sr(g,j,z,D,h),h&&K&2048&&$f(j.alternate,j);break;default:sr(g,j,z,D,h)}i=i.sibling}}function bo(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,u=i,h=u.flags;switch(u.tag){case 22:bo(l,u),h&2048&&Mf(u.alternate,u);break;case 24:bo(l,u),h&2048&&$f(u.alternate,u);break;default:bo(l,u)}i=i.sibling}}var So=8192;function ir(n,i,l){if(n.subtreeFlags&So)for(n=n.child;n!==null;)z0(n,i,l),n=n.sibling}function z0(n,i,l){switch(n.tag){case 26:ir(n,i,l),n.flags&So&&n.memoizedState!==null&&ik(l,es,n.memoizedState,n.memoizedProps);break;case 5:ir(n,i,l);break;case 3:case 4:var u=es;es=bc(n.stateNode.containerInfo),ir(n,i,l),es=u;break;case 22:n.memoizedState===null&&(u=n.alternate,u!==null&&u.memoizedState!==null?(u=So,So=16777216,ir(n,i,l),So=u):ir(n,i,l));break;default:ir(n,i,l)}}function E0(n){var i=n.alternate;if(i!==null&&(n=i.child,n!==null)){i.child=null;do i=n.sibling,n.sibling=null,n=i;while(n!==null)}}function jo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Zt=u,T0(u,n)}E0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)R0(n),n=n.sibling}function R0(n){switch(n.tag){case 0:case 11:case 15:jo(n),n.flags&2048&&di(9,n,n.return);break;case 3:jo(n);break;case 12:jo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,oc(n)):jo(n);break;default:jo(n)}}function oc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var u=i[l];Zt=u,T0(u,n)}E0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:di(8,i,i.return),oc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,oc(i));break;default:oc(i)}n=n.sibling}}function T0(n,i){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:di(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:io(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Zt=u;else e:for(l=n;Zt!==null;){u=Zt;var h=u.sibling,g=u.return;if(S0(u),u===l){Zt=null;break e}if(h!==null){h.return=g,Zt=h;break e}Zt=g}}}var xC={getCacheForType:function(n){var i=Jt($t),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return Jt($t).controller.signal}},bC=typeof WeakMap=="function"?WeakMap:Map,Xe=0,ut=null,Pe=null,Ge=0,et=0,Rn=null,fi=!1,ar=!1,Uf=!1,Is=0,Ct=0,hi=0,la=0,Pf=0,Tn=0,rr=0,wo=null,xn=null,If=!1,lc=0,A0=0,cc=1/0,uc=null,mi=null,Kt=0,pi=null,or=null,Bs=0,Bf=0,qf=null,O0=null,No=0,Hf=null;function An(){return(Xe&2)!==0&&Ge!==0?Ge&-Ge:B.T!==null?Qf():at()}function D0(){if(Tn===0)if((Ge&536870912)===0||Fe){var n=Ns;Ns<<=1,(Ns&3932160)===0&&(Ns=262144),Tn=n}else Tn=536870912;return n=zn.current,n!==null&&(n.flags|=32),Tn}function bn(n,i,l){(n===ut&&(et===2||et===9)||n.cancelPendingCommit!==null)&&(lr(n,0),gi(n,Ge,Tn,!1)),Fi(n,l),((Xe&2)===0||n!==ut)&&(n===ut&&((Xe&2)===0&&(la|=l),Ct===4&&gi(n,Ge,Tn,!1)),gs(n))}function L0(n,i,l){if((Xe&6)!==0)throw Error(a(327));var u=!l&&(i&127)===0&&(i&n.expiredLanes)===0||us(n,i),h=u?wC(n,i):Kf(n,i,!0),g=u;do{if(h===0){ar&&!u&&gi(n,i,0,!1);break}else{if(l=n.current.alternate,g&&!SC(l)){h=Kf(n,i,!1),g=!1;continue}if(h===2){if(g=i,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var z=n;h=wo;var D=z.current.memoizedState.isDehydrated;if(D&&(lr(z,j).flags|=256),j=Kf(z,j,!1),j!==2){if(Uf&&!D){z.errorRecoveryDisabledLanes|=g,la|=g,h=4;break e}g=xn,xn=h,g!==null&&(xn===null?xn=g:xn.push.apply(xn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){lr(n,0),gi(n,i,0,!0);break}e:{switch(u=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:gi(u,i,Tn,!fi);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=lc+300-qe(),10<h)){if(gi(u,i,Tn,!fi),Aa(u,0,!0)!==0)break e;Bs=i,u.timeoutHandle=fv(M0.bind(null,u,l,xn,uc,If,i,Tn,la,rr,fi,g,"Throttled",-0,0),h);break e}M0(u,l,xn,uc,If,i,Tn,la,rr,fi,g,null,-0,0)}}break}while(!0);gs(n)}function M0(n,i,l,u,h,g,j,z,D,K,W,ne,V,Y){if(n.timeoutHandle=-1,ne=i.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ks},z0(i,g,ne);var ve=(g&62914560)===g?lc-qe():(g&4194048)===g?A0-qe():0;if(ve=ak(ne,ve),ve!==null){Bs=g,n.cancelPendingCommit=ve(G0.bind(null,n,i,g,l,u,h,j,z,D,W,ne,null,V,Y)),gi(n,g,j,!K);return}}G0(n,i,g,l,u,h,j,z,D)}function SC(n){for(var i=n;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var h=l[u],g=h.getSnapshot;h=h.value;try{if(!kn(g(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function gi(n,i,l,u){i&=~Pf,i&=~la,n.suspendedLanes|=i,n.pingedLanes&=~i,u&&(n.warmLanes|=i),u=n.expirationTimes;for(var h=i;0<h;){var g=31-Qe(h),j=1<<g;u[g]=-1,h&=~j}l!==0&&xl(n,l,i)}function dc(){return(Xe&6)===0?(Co(0),!1):!0}function Gf(){if(Pe!==null){if(et===0)var n=Pe.return;else n=Pe,Rs=Wi=null,rf(n),Xa=null,ro=0,n=Pe;for(;n!==null;)h0(n.alternate,n),n=n.return;Pe=null}}function lr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,BC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Bs=0,Gf(),ut=n,Pe=l=zs(n.current,null),Ge=i,et=0,Rn=null,fi=!1,ar=us(n,i),Uf=!1,rr=Tn=Pf=la=hi=Ct=0,xn=wo=null,If=!1,(i&8)!==0&&(i|=i&32);var u=n.entangledLanes;if(u!==0)for(n=n.entanglements,u&=i;0<u;){var h=31-Qe(u),g=1<<h;i|=n[h],u&=~g}return Is=i,Al(),l}function $0(n,i){Te=null,B.H=po,i===Ja||i===Il?(i=Wg(),et=3):i===Zd?(i=Wg(),et=4):et=i===jf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Rn=i,Pe===null&&(Ct=1,ec(n,Mn(i,n.current)))}function U0(){var n=zn.current;return n===null?!0:(Ge&4194048)===Ge?In===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?n===In:!1}function P0(){var n=B.H;return B.H=po,n===null?po:n}function I0(){var n=B.A;return B.A=xC,n}function fc(){Ct=4,fi||(Ge&4194048)!==Ge&&zn.current!==null||(ar=!0),(hi&134217727)===0&&(la&134217727)===0||ut===null||gi(ut,Ge,Tn,!1)}function Kf(n,i,l){var u=Xe;Xe|=2;var h=P0(),g=I0();(ut!==n||Ge!==i)&&(uc=null,lr(n,i)),i=!1;var j=Ct;e:do try{if(et!==0&&Pe!==null){var z=Pe,D=Rn;switch(et){case 8:Gf(),j=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(i=!0);var K=et;if(et=0,Rn=null,cr(n,z,D,K),l&&ar){j=0;break e}break;default:K=et,et=0,Rn=null,cr(n,z,D,K)}}jC(),j=Ct;break}catch(W){$0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Rs=Wi=null,Xe=u,B.H=h,B.A=g,Pe===null&&(ut=null,Ge=0,Al()),j}function jC(){for(;Pe!==null;)B0(Pe)}function wC(n,i){var l=Xe;Xe|=2;var u=P0(),h=I0();ut!==n||Ge!==i?(uc=null,cc=qe()+500,lr(n,i)):ar=us(n,i);e:do try{if(et!==0&&Pe!==null){i=Pe;var g=Rn;t:switch(et){case 1:et=0,Rn=null,cr(n,i,g,1);break;case 2:case 9:if(Jg(g)){et=0,Rn=null,q0(i);break}i=function(){et!==2&&et!==9||ut!==n||(et=7),gs(n)},g.then(i,i);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Jg(g)?(et=0,Rn=null,q0(i)):(et=0,Rn=null,cr(n,i,g,7));break;case 5:var j=null;switch(Pe.tag){case 26:j=Pe.memoizedState;case 5:case 27:var z=Pe;if(j?_v(j):z.stateNode.complete){et=0,Rn=null;var D=z.sibling;if(D!==null)Pe=D;else{var K=z.return;K!==null?(Pe=K,hc(K)):Pe=null}break t}}et=0,Rn=null,cr(n,i,g,5);break;case 6:et=0,Rn=null,cr(n,i,g,6);break;case 8:Gf(),Ct=6;break e;default:throw Error(a(462))}}NC();break}catch(W){$0(n,W)}while(!0);return Rs=Wi=null,B.H=u,B.A=h,Xe=l,Pe!==null?0:(ut=null,Ge=0,Al(),Ct)}function NC(){for(;Pe!==null&&!le();)B0(Pe)}function B0(n){var i=d0(n.alternate,n,Is);n.memoizedProps=n.pendingProps,i===null?hc(n):Pe=i}function q0(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=a0(l,i,i.pendingProps,i.type,void 0,Ge);break;case 11:i=a0(l,i,i.pendingProps,i.type.render,i.ref,Ge);break;case 5:rf(i);default:h0(l,i),i=Pe=Ig(i,Is),i=d0(l,i,Is)}n.memoizedProps=n.pendingProps,i===null?hc(n):Pe=i}function cr(n,i,l,u){Rs=Wi=null,rf(i),Xa=null,ro=0;var h=i.return;try{if(fC(n,h,i,l,Ge)){Ct=1,ec(n,Mn(l,n.current)),Pe=null;return}}catch(g){if(h!==null)throw Pe=h,g;Ct=1,ec(n,Mn(l,n.current)),Pe=null;return}i.flags&32768?(Fe||u===1?n=!0:ar||(Ge&536870912)!==0?n=!1:(fi=n=!0,(u===2||u===9||u===3||u===6)&&(u=zn.current,u!==null&&u.tag===13&&(u.flags|=16384))),H0(i,n)):hc(i)}function hc(n){var i=n;do{if((i.flags&32768)!==0){H0(i,fi);return}n=i.return;var l=pC(i.alternate,i,Is);if(l!==null){Pe=l;return}if(i=i.sibling,i!==null){Pe=i;return}Pe=i=n}while(i!==null);Ct===0&&(Ct=5)}function H0(n,i){do{var l=gC(n.alternate,n);if(l!==null){l.flags&=32767,Pe=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(n=n.sibling,n!==null)){Pe=n;return}Pe=n=l}while(n!==null);Ct=6,Pe=null}function G0(n,i,l,u,h,g,j,z,D){n.cancelPendingCommit=null;do mc();while(Kt!==0);if((Xe&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Ad,cd(n,l,g,j,z,D),n===ut&&(Pe=ut=null,Ge=0),or=i,pi=n,Bs=l,Bf=g,qf=h,O0=u,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,zC(rn,function(){return Q0(),null})):(n.callbackNode=null,n.callbackPriority=0),u=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,h=G.p,G.p=2,j=Xe,Xe|=4;try{yC(n,i,l)}finally{Xe=j,G.p=h,B.T=u}}Kt=1,K0(),F0(),Z0()}}function K0(){if(Kt===1){Kt=0;var n=pi,i=or,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{C0(i,n);var g=sh,j=Tg(n.containerInfo),z=g.focusedElem,D=g.selectionRange;if(j!==z&&z&&z.ownerDocument&&Rg(z.ownerDocument.documentElement,z)){if(D!==null&&_d(z)){var K=D.start,W=D.end;if(W===void 0&&(W=K),"selectionStart"in z)z.selectionStart=K,z.selectionEnd=Math.min(W,z.value.length);else{var ne=z.ownerDocument||document,V=ne&&ne.defaultView||window;if(V.getSelection){var Y=V.getSelection(),ve=z.textContent.length,Ce=Math.min(D.start,ve),ct=D.end===void 0?Ce:Math.min(D.end,ve);!Y.extend&&Ce>ct&&(j=ct,ct=Ce,Ce=j);var I=Eg(z,Ce),$=Eg(z,ct);if(I&&$&&(Y.rangeCount!==1||Y.anchorNode!==I.node||Y.anchorOffset!==I.offset||Y.focusNode!==$.node||Y.focusOffset!==$.offset)){var H=ne.createRange();H.setStart(I.node,I.offset),Y.removeAllRanges(),Ce>ct?(Y.addRange(H),Y.extend($.node,$.offset)):(H.setEnd($.node,$.offset),Y.addRange(H))}}}}for(ne=[],Y=z;Y=Y.parentNode;)Y.nodeType===1&&ne.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<ne.length;z++){var ee=ne[z];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}kc=!!nh,sh=nh=null}finally{Xe=h,G.p=u,B.T=l}}n.current=i,Kt=2}}function F0(){if(Kt===2){Kt=0;var n=pi,i=or,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var u=G.p;G.p=2;var h=Xe;Xe|=4;try{b0(n,i.alternate,i)}finally{Xe=h,G.p=u,B.T=l}}Kt=3}}function Z0(){if(Kt===4||Kt===3){Kt=0,Be();var n=pi,i=or,l=Bs,u=O0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Kt=5:(Kt=0,or=pi=null,V0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(mi=null),fe(l),i=i.stateNode,_e&&typeof _e.onCommitFiberRoot=="function")try{_e.onCommitFiberRoot(ls,i,void 0,(i.current.flags&128)===128)}catch{}if(u!==null){i=B.T,h=G.p,G.p=2,B.T=null;try{for(var g=n.onRecoverableError,j=0;j<u.length;j++){var z=u[j];g(z.value,{componentStack:z.stack})}}finally{B.T=i,G.p=h}}(Bs&3)!==0&&mc(),gs(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===Hf?No++:(No=0,Hf=n):No=0,Co(0)}}function V0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,io(i)))}function mc(){return K0(),F0(),Z0(),Q0()}function Q0(){if(Kt!==5)return!1;var n=pi,i=Bf;Bf=0;var l=fe(Bs),u=B.T,h=G.p;try{G.p=32>l?32:l,B.T=null,l=qf,qf=null;var g=pi,j=Bs;if(Kt=0,or=pi=null,Bs=0,(Xe&6)!==0)throw Error(a(331));var z=Xe;if(Xe|=4,R0(g.current),_0(g,g.current,j,l),Xe=z,Co(0,!1),_e&&typeof _e.onPostCommitFiberRoot=="function")try{_e.onPostCommitFiberRoot(ls,g)}catch{}return!0}finally{G.p=h,B.T=u,V0(n,i)}}function Y0(n,i,l){i=Mn(l,i),i=Sf(n.stateNode,i,2),n=li(n,i,2),n!==null&&(Fi(n,2),gs(n))}function tt(n,i,l){if(n.tag===3)Y0(n,n,l);else for(;i!==null;){if(i.tag===3){Y0(i,n,l);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(mi===null||!mi.has(u))){n=Mn(l,n),l=Jy(2),u=li(i,l,2),u!==null&&(Xy(l,u,i,n),Fi(u,2),gs(u));break}}i=i.return}}function Ff(n,i,l){var u=n.pingCache;if(u===null){u=n.pingCache=new bC;var h=new Set;u.set(i,h)}else h=u.get(i),h===void 0&&(h=new Set,u.set(i,h));h.has(l)||(Uf=!0,h.add(l),n=CC.bind(null,n,i,l),i.then(n,n))}function CC(n,i,l){var u=n.pingCache;u!==null&&u.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,ut===n&&(Ge&l)===l&&(Ct===4||Ct===3&&(Ge&62914560)===Ge&&300>qe()-lc?(Xe&2)===0&&lr(n,0):Pf|=l,rr===Ge&&(rr=0)),gs(n)}function J0(n,i){i===0&&(i=vl()),n=Yi(n,i),n!==null&&(Fi(n,i),gs(n))}function kC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),J0(n,l)}function _C(n,i){var l=0;switch(n.tag){case 31:case 13:var u=n.stateNode,h=n.memoizedState;h!==null&&(l=h.retryLane);break;case 19:u=n.stateNode;break;case 22:u=n.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(i),J0(n,l)}function zC(n,i){return zt(n,i)}var pc=null,ur=null,Zf=!1,gc=!1,Vf=!1,yi=0;function gs(n){n!==ur&&n.next===null&&(ur===null?pc=ur=n:ur=ur.next=n),gc=!0,Zf||(Zf=!0,RC())}function Co(n,i){if(!Vf&&gc){Vf=!0;do for(var l=!1,u=pc;u!==null;){if(n!==0){var h=u.pendingLanes;if(h===0)var g=0;else{var j=u.suspendedLanes,z=u.pingedLanes;g=(1<<31-Qe(42|n)+1)-1,g&=h&~(j&~z),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,tv(u,g))}else g=Ge,g=Aa(u,u===ut?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||us(u,g)||(l=!0,tv(u,g));u=u.next}while(l);Vf=!1}}function EC(){X0()}function X0(){gc=Zf=!1;var n=0;yi!==0&&IC()&&(n=yi);for(var i=qe(),l=null,u=pc;u!==null;){var h=u.next,g=W0(u,i);g===0?(u.next=null,l===null?pc=h:l.next=h,h===null&&(ur=l)):(l=u,(n!==0||(g&3)!==0)&&(gc=!0)),u=h}Kt!==0&&Kt!==5||Co(n),yi!==0&&(yi=0)}function W0(n,i){for(var l=n.suspendedLanes,u=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-Qe(g),z=1<<j,D=h[j];D===-1?((z&l)===0||(z&u)!==0)&&(h[j]=yl(z,i)):D<=i&&(n.expiredLanes|=z),g&=~z}if(i=ut,l=Ge,l=Aa(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u=n.callbackNode,l===0||n===i&&(et===2||et===9)||n.cancelPendingCommit!==null)return u!==null&&u!==null&&mn(u),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||us(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(u!==null&&mn(u),fe(l)){case 2:case 8:l=pt;break;case 32:l=rn;break;case 268435456:l=Vs;break;default:l=rn}return u=ev.bind(null,n),l=zt(l,u),n.callbackPriority=i,n.callbackNode=l,i}return u!==null&&u!==null&&mn(u),n.callbackPriority=2,n.callbackNode=null,2}function ev(n,i){if(Kt!==0&&Kt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(mc()&&n.callbackNode!==l)return null;var u=Ge;return u=Aa(n,n===ut?u:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),u===0?null:(L0(n,u,i),W0(n,qe()),n.callbackNode!=null&&n.callbackNode===l?ev.bind(null,n):null)}function tv(n,i){if(mc())return null;L0(n,i,!0)}function RC(){qC(function(){(Xe&6)!==0?zt($e,EC):X0()})}function Qf(){if(yi===0){var n=Qa;n===0&&(n=Ys,Ys<<=1,(Ys&261888)===0&&(Ys=256)),yi=n}return yi}function nv(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Nl(""+n)}function sv(n,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,n.id&&l.setAttribute("form",n.id),i.parentNode.insertBefore(l,i),n=new FormData(n),l.parentNode.removeChild(l),n}function TC(n,i,l,u,h){if(i==="submit"&&l&&l.stateNode===h){var g=nv((h[wt]||null).action),j=u.submitter;j&&(i=(i=j[wt]||null)?nv(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var z=new zl("action","action",null,u,h);n.push({event:z,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(yi!==0){var D=j?sv(h,j):new FormData(h);pf(l,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(z.preventDefault(),D=j?sv(h,j):new FormData(h),pf(l,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var Yf=0;Yf<Td.length;Yf++){var Jf=Td[Yf],AC=Jf.toLowerCase(),OC=Jf[0].toUpperCase()+Jf.slice(1);Wn(AC,"on"+OC)}Wn(Dg,"onAnimationEnd"),Wn(Lg,"onAnimationIteration"),Wn(Mg,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(Q1,"onTransitionRun"),Wn(Y1,"onTransitionStart"),Wn(J1,"onTransitionCancel"),Wn($g,"onTransitionEnd"),on("onMouseEnter",["mouseout","mouseover"]),on("onMouseLeave",["mouseout","mouseover"]),on("onPointerEnter",["pointerout","pointerover"]),on("onPointerLeave",["pointerout","pointerover"]),Gt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Gt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Gt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Gt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Gt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ko="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),DC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ko));function iv(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var u=n[l],h=u.event;u=u.listeners;e:{var g=void 0;if(i)for(var j=u.length-1;0<=j;j--){var z=u[j],D=z.instance,K=z.currentTarget;if(z=z.listener,D!==g&&h.isPropagationStopped())break e;g=z,h.currentTarget=K;try{g(h)}catch(W){Tl(W)}h.currentTarget=null,g=D}else for(j=0;j<u.length;j++){if(z=u[j],D=z.instance,K=z.currentTarget,z=z.listener,D!==g&&h.isPropagationStopped())break e;g=z,h.currentTarget=K;try{g(h)}catch(W){Tl(W)}h.currentTarget=null,g=D}}}}function Ie(n,i){var l=i[en];l===void 0&&(l=i[en]=new Set);var u=n+"__bubble";l.has(u)||(av(i,n,2,!1),l.add(u))}function Xf(n,i,l){var u=0;i&&(u|=4),av(l,n,u,i)}var yc="_reactListening"+Math.random().toString(36).slice(2);function Wf(n){if(!n[yc]){n[yc]=!0,He.forEach(function(l){l!=="selectionchange"&&(DC.has(l)||Xf(l,!1,n),Xf(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[yc]||(i[yc]=!0,Xf("selectionchange",!1,i))}}function av(n,i,l,u){switch(Dv(i)){case 2:var h=lk;break;case 8:h=ck;break;default:h=mh}l=h.bind(null,i,l,n),h=void 0,!vd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),u?h!==void 0?n.addEventListener(i,l,{capture:!0,passive:h}):n.addEventListener(i,l,!0):h!==void 0?n.addEventListener(i,l,{passive:h}):n.addEventListener(i,l,!1)}function eh(n,i,l,u,h){var g=u;if((i&1)===0&&(i&2)===0&&u!==null)e:for(;;){if(u===null)return;var j=u.tag;if(j===3||j===4){var z=u.stateNode.containerInfo;if(z===h)break;if(j===4)for(j=u.return;j!==null;){var D=j.tag;if((D===3||D===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;z!==null;){if(j=Ws(z),j===null)return;if(D=j.tag,D===5||D===6||D===26||D===27){u=g=j;continue e}z=z.parentNode}}u=u.return}ug(function(){var K=g,W=gd(l),ne=[];e:{var V=Ug.get(n);if(V!==void 0){var Y=zl,ve=n;switch(n){case"keypress":if(kl(l)===0)break e;case"keydown":case"keyup":Y=_1;break;case"focusin":ve="focus",Y=jd;break;case"focusout":ve="blur",Y=jd;break;case"beforeblur":case"afterblur":Y=jd;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=hg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=p1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=R1;break;case Dg:case Lg:case Mg:Y=v1;break;case $g:Y=A1;break;case"scroll":case"scrollend":Y=h1;break;case"wheel":Y=D1;break;case"copy":case"cut":case"paste":Y=b1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=pg;break;case"toggle":case"beforetoggle":Y=M1}var Ce=(i&4)!==0,ct=!Ce&&(n==="scroll"||n==="scrollend"),I=Ce?V!==null?V+"Capture":null:V;Ce=[];for(var $=K,H;$!==null;){var ee=$;if(H=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||H===null||I===null||(ee=Zr($,I),ee!=null&&Ce.push(_o($,ee,H))),ct)break;$=$.return}0<Ce.length&&(V=new Y(V,ve,null,l,W),ne.push({event:V,listeners:Ce}))}}if((i&7)===0){e:{if(V=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",V&&l!==pd&&(ve=l.relatedTarget||l.fromElement)&&(Ws(ve)||ve[Cn]))break e;if((Y||V)&&(V=W.window===W?W:(V=W.ownerDocument)?V.defaultView||V.parentWindow:window,Y?(ve=l.relatedTarget||l.toElement,Y=K,ve=ve?Ws(ve):null,ve!==null&&(ct=c(ve),Ce=ve.tag,ve!==ct||Ce!==5&&Ce!==27&&Ce!==6)&&(ve=null)):(Y=null,ve=K),Y!==ve)){if(Ce=hg,ee="onMouseLeave",I="onMouseEnter",$="mouse",(n==="pointerout"||n==="pointerover")&&(Ce=pg,ee="onPointerLeave",I="onPointerEnter",$="pointer"),ct=Y==null?V:fs(Y),H=ve==null?V:fs(ve),V=new Ce(ee,$+"leave",Y,l,W),V.target=ct,V.relatedTarget=H,ee=null,Ws(W)===K&&(Ce=new Ce(I,$+"enter",ve,l,W),Ce.target=H,Ce.relatedTarget=ct,ee=Ce),ct=ee,Y&&ve)t:{for(Ce=LC,I=Y,$=ve,H=0,ee=I;ee;ee=Ce(ee))H++;ee=0;for(var Ne=$;Ne;Ne=Ce(Ne))ee++;for(;0<H-ee;)I=Ce(I),H--;for(;0<ee-H;)$=Ce($),ee--;for(;H--;){if(I===$||$!==null&&I===$.alternate){Ce=I;break t}I=Ce(I),$=Ce($)}Ce=null}else Ce=null;Y!==null&&rv(ne,V,Y,Ce,!1),ve!==null&&ct!==null&&rv(ne,ct,ve,Ce,!0)}}e:{if(V=K?fs(K):window,Y=V.nodeName&&V.nodeName.toLowerCase(),Y==="select"||Y==="input"&&V.type==="file")var Ye=wg;else if(Sg(V))if(Ng)Ye=F1;else{Ye=G1;var Se=H1}else Y=V.nodeName,!Y||Y.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?K&&md(K.elementType)&&(Ye=wg):Ye=K1;if(Ye&&(Ye=Ye(n,K))){jg(ne,Ye,l,W);break e}Se&&Se(n,V,K),n==="focusout"&&K&&V.type==="number"&&K.memoizedProps.value!=null&&hd(V,"number",V.value)}switch(Se=K?fs(K):window,n){case"focusin":(Sg(Se)||Se.contentEditable==="true")&&(Ba=Se,zd=K,to=null);break;case"focusout":to=zd=Ba=null;break;case"mousedown":Ed=!0;break;case"contextmenu":case"mouseup":case"dragend":Ed=!1,Ag(ne,l,W);break;case"selectionchange":if(V1)break;case"keydown":case"keyup":Ag(ne,l,W)}var Ae;if(Nd)e:{switch(n){case"compositionstart":var Ke="onCompositionStart";break e;case"compositionend":Ke="onCompositionEnd";break e;case"compositionupdate":Ke="onCompositionUpdate";break e}Ke=void 0}else Ia?xg(n,l)&&(Ke="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(Ke="onCompositionStart");Ke&&(gg&&l.locale!=="ko"&&(Ia||Ke!=="onCompositionStart"?Ke==="onCompositionEnd"&&Ia&&(Ae=dg()):(ti=W,xd="value"in ti?ti.value:ti.textContent,Ia=!0)),Se=vc(K,Ke),0<Se.length&&(Ke=new mg(Ke,n,null,l,W),ne.push({event:Ke,listeners:Se}),Ae?Ke.data=Ae:(Ae=bg(l),Ae!==null&&(Ke.data=Ae)))),(Ae=U1?P1(n,l):I1(n,l))&&(Ke=vc(K,"onBeforeInput"),0<Ke.length&&(Se=new mg("onBeforeInput","beforeinput",null,l,W),ne.push({event:Se,listeners:Ke}),Se.data=Ae)),TC(ne,n,K,l,W)}iv(ne,i)})}function _o(n,i,l){return{instance:n,listener:i,currentTarget:l}}function vc(n,i){for(var l=i+"Capture",u=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Zr(n,l),h!=null&&u.unshift(_o(n,h,g)),h=Zr(n,i),h!=null&&u.push(_o(n,h,g))),n.tag===3)return u;n=n.return}return[]}function LC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function rv(n,i,l,u,h){for(var g=i._reactName,j=[];l!==null&&l!==u;){var z=l,D=z.alternate,K=z.stateNode;if(z=z.tag,D!==null&&D===u)break;z!==5&&z!==26&&z!==27||K===null||(D=K,h?(K=Zr(l,g),K!=null&&j.unshift(_o(l,K,D))):h||(K=Zr(l,g),K!=null&&j.push(_o(l,K,D)))),l=l.return}j.length!==0&&n.push({event:i,listeners:j})}var MC=/\r\n?/g,$C=/\u0000|\uFFFD/g;function ov(n){return(typeof n=="string"?n:""+n).replace(MC,`
|
|
9
|
+
`).replace($C,"")}function lv(n,i){return i=ov(i),ov(n)===i}function lt(n,i,l,u,h,g){switch(l){case"children":typeof u=="string"?i==="body"||i==="textarea"&&u===""||$a(n,u):(typeof u=="number"||typeof u=="bigint")&&i!=="body"&&$a(n,""+u);break;case"className":jl(n,"class",u);break;case"tabIndex":jl(n,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":jl(n,l,u);break;case"style":lg(n,u,g);break;case"data":if(i!=="object"){jl(n,"data",u);break}case"src":case"href":if(u===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Nl(""+u),n.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){n.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(l==="formAction"?(i!=="input"&<(n,i,"name",h.name,h,null),lt(n,i,"formEncType",h.formEncType,h,null),lt(n,i,"formMethod",h.formMethod,h,null),lt(n,i,"formTarget",h.formTarget,h,null)):(lt(n,i,"encType",h.encType,h,null),lt(n,i,"method",h.method,h,null),lt(n,i,"target",h.target,h,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){n.removeAttribute(l);break}u=Nl(""+u),n.setAttribute(l,u);break;case"onClick":u!=null&&(n.onclick=ks);break;case"onScroll":u!=null&&Ie("scroll",n);break;case"onScrollEnd":u!=null&&Ie("scrollend",n);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"multiple":n.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":n.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){n.removeAttribute("xlink:href");break}l=Nl(""+u),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""+u):n.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":u===!0?n.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?n.setAttribute(l,u):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?n.setAttribute(l,u):n.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?n.removeAttribute(l):n.setAttribute(l,u);break;case"popover":Ie("beforetoggle",n),Ie("toggle",n),Sl(n,"popover",u);break;case"xlinkActuate":Cs(n,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Cs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Cs(n,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Cs(n,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Cs(n,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Cs(n,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Cs(n,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Sl(n,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=d1.get(l)||l,Sl(n,l,u))}}function th(n,i,l,u,h,g){switch(l){case"style":lg(n,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"children":typeof u=="string"?$a(n,u):(typeof u=="number"||typeof u=="bigint")&&$a(n,""+u);break;case"onScroll":u!=null&&Ie("scroll",n);break;case"onScrollEnd":u!=null&&Ie("scrollend",n);break;case"onClick":u!=null&&(n.onclick=ks);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rt.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),i=l.slice(2,h?l.length-7:void 0),g=n[wt]||null,g=g!=null?g[l]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof u=="function")){typeof g!="function"&&g!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,u,h);break e}l in n?n[l]=u:u===!0?n.setAttribute(l,""):Sl(n,l,u)}}}function Wt(n,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",n),Ie("load",n);var u=!1,h=!1,g;for(g in l)if(l.hasOwnProperty(g)){var j=l[g];if(j!=null)switch(g){case"src":u=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,g,j,l,null)}}h&<(n,i,"srcSet",l.srcSet,l,null),u&<(n,i,"src",l.src,l,null);return;case"input":Ie("invalid",n);var z=g=j=h=null,D=null,K=null;for(u in l)if(l.hasOwnProperty(u)){var W=l[u];if(W!=null)switch(u){case"name":h=W;break;case"type":j=W;break;case"checked":D=W;break;case"defaultChecked":K=W;break;case"value":g=W;break;case"defaultValue":z=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:lt(n,i,u,W,l,null)}}ig(n,g,z,D,K,j,h,!1);return;case"select":Ie("invalid",n),u=j=g=null;for(h in l)if(l.hasOwnProperty(h)&&(z=l[h],z!=null))switch(h){case"value":g=z;break;case"defaultValue":j=z;break;case"multiple":u=z;default:lt(n,i,h,z,l,null)}i=g,l=j,n.multiple=!!u,i!=null?Ma(n,!!u,i,!1):l!=null&&Ma(n,!!u,l,!0);return;case"textarea":Ie("invalid",n),g=h=u=null;for(j in l)if(l.hasOwnProperty(j)&&(z=l[j],z!=null))switch(j){case"value":u=z;break;case"defaultValue":h=z;break;case"children":g=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(a(91));break;default:lt(n,i,j,z,l,null)}rg(n,u,h,g);return;case"option":for(D in l)l.hasOwnProperty(D)&&(u=l[D],u!=null)&&(D==="selected"?n.selected=u&&typeof u!="function"&&typeof u!="symbol":lt(n,i,D,u,l,null));return;case"dialog":Ie("beforetoggle",n),Ie("toggle",n),Ie("cancel",n),Ie("close",n);break;case"iframe":case"object":Ie("load",n);break;case"video":case"audio":for(u=0;u<ko.length;u++)Ie(ko[u],n);break;case"image":Ie("error",n),Ie("load",n);break;case"details":Ie("toggle",n);break;case"embed":case"source":case"link":Ie("error",n),Ie("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in l)if(l.hasOwnProperty(K)&&(u=l[K],u!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:lt(n,i,K,u,l,null)}return;default:if(md(i)){for(W in l)l.hasOwnProperty(W)&&(u=l[W],u!==void 0&&th(n,i,W,u,l,void 0));return}}for(z in l)l.hasOwnProperty(z)&&(u=l[z],u!=null&<(n,i,z,u,l,null))}function UC(n,i,l,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,j=null,z=null,D=null,K=null,W=null;for(Y in l){var ne=l[Y];if(l.hasOwnProperty(Y)&&ne!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":D=ne;default:u.hasOwnProperty(Y)||lt(n,i,Y,null,u,ne)}}for(var V in u){var Y=u[V];if(ne=l[V],u.hasOwnProperty(V)&&(Y!=null||ne!=null))switch(V){case"type":g=Y;break;case"name":h=Y;break;case"checked":K=Y;break;case"defaultChecked":W=Y;break;case"value":j=Y;break;case"defaultValue":z=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==ne&<(n,i,V,Y,u,ne)}}fd(n,j,z,D,K,W,g,h);return;case"select":Y=j=z=V=null;for(g in l)if(D=l[g],l.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":Y=D;default:u.hasOwnProperty(g)||lt(n,i,g,null,u,D)}for(h in u)if(g=u[h],D=l[h],u.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":V=g;break;case"defaultValue":z=g;break;case"multiple":j=g;default:g!==D&<(n,i,h,g,u,D)}i=z,l=j,u=Y,V!=null?Ma(n,!!l,V,!1):!!u!=!!l&&(i!=null?Ma(n,!!l,i,!0):Ma(n,!!l,l?[]:"",!1));return;case"textarea":Y=V=null;for(z in l)if(h=l[z],l.hasOwnProperty(z)&&h!=null&&!u.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:lt(n,i,z,null,u,h)}for(j in u)if(h=u[j],g=l[j],u.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){case"value":V=h;break;case"defaultValue":Y=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&<(n,i,j,h,u,g)}ag(n,V,Y);return;case"option":for(var ve in l)V=l[ve],l.hasOwnProperty(ve)&&V!=null&&!u.hasOwnProperty(ve)&&(ve==="selected"?n.selected=!1:lt(n,i,ve,null,u,V));for(D in u)V=u[D],Y=l[D],u.hasOwnProperty(D)&&V!==Y&&(V!=null||Y!=null)&&(D==="selected"?n.selected=V&&typeof V!="function"&&typeof V!="symbol":lt(n,i,D,V,u,Y));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ce in l)V=l[Ce],l.hasOwnProperty(Ce)&&V!=null&&!u.hasOwnProperty(Ce)&<(n,i,Ce,null,u,V);for(K in u)if(V=u[K],Y=l[K],u.hasOwnProperty(K)&&V!==Y&&(V!=null||Y!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(a(137,i));break;default:lt(n,i,K,V,u,Y)}return;default:if(md(i)){for(var ct in l)V=l[ct],l.hasOwnProperty(ct)&&V!==void 0&&!u.hasOwnProperty(ct)&&th(n,i,ct,void 0,u,V);for(W in u)V=u[W],Y=l[W],!u.hasOwnProperty(W)||V===Y||V===void 0&&Y===void 0||th(n,i,W,V,u,Y);return}}for(var I in l)V=l[I],l.hasOwnProperty(I)&&V!=null&&!u.hasOwnProperty(I)&<(n,i,I,null,u,V);for(ne in u)V=u[ne],Y=l[ne],!u.hasOwnProperty(ne)||V===Y||V==null&&Y==null||lt(n,i,ne,V,u,Y)}function cv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function PC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var h=l[u],g=h.transferSize,j=h.initiatorType,z=h.duration;if(g&&z&&cv(j)){for(j=0,z=h.responseEnd,u+=1;u<l.length;u++){var D=l[u],K=D.startTime;if(K>z)break;var W=D.transferSize,ne=D.initiatorType;W&&cv(ne)&&(D=D.responseEnd,j+=W*(D<z?1:(z-K)/(D-K)))}if(--u,i+=8*(g+j)/(h.duration/1e3),n++,10<n)break}}if(0<n)return i/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var nh=null,sh=null;function xc(n){return n.nodeType===9?n:n.ownerDocument}function uv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dv(n,i){if(n===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&i==="foreignObject"?0:n}function ih(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ah=null;function IC(){var n=window.event;return n&&n.type==="popstate"?n===ah?!1:(ah=n,!0):(ah=null,!1)}var fv=typeof setTimeout=="function"?setTimeout:void 0,BC=typeof clearTimeout=="function"?clearTimeout:void 0,hv=typeof Promise=="function"?Promise:void 0,qC=typeof queueMicrotask=="function"?queueMicrotask:typeof hv<"u"?function(n){return hv.resolve(null).then(n).catch(HC)}:fv;function HC(n){setTimeout(function(){throw n})}function vi(n){return n==="head"}function mv(n,i){var l=i,u=0;do{var h=l.nextSibling;if(n.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(u===0){n.removeChild(h),mr(i);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")zo(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,zo(l);for(var g=l.firstChild;g;){var j=g.nextSibling,z=g.nodeName;g[ds]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=j}}else l==="body"&&zo(n.ownerDocument.body);l=h}while(l);mr(i)}function pv(n,i){var l=n;n=0;do{var u=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=u}while(l)}function rh(n){var i=n.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":rh(l),Da(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function GC(n,i,l,u){for(;n.nodeType===1;){var h=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!u&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(u){if(!n[ds])switch(i){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(i==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Bn(n.nextSibling),n===null)break}return null}function KC(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Bn(n.nextSibling),n===null))return null;return n}function gv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Bn(n.nextSibling),n===null))return null;return n}function oh(n){return n.data==="$?"||n.data==="$~"}function lh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function FC(n,i){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||l.readyState!=="loading")i();else{var u=function(){i(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),n._reactRetry=u}}function Bn(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return n}var ch=null;function yv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(i===0)return Bn(n.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}n=n.nextSibling}return null}function vv(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return n;i--}else l!=="/$"&&l!=="/&"||i++}n=n.previousSibling}return null}function xv(n,i,l){switch(i=xc(l),n){case"html":if(n=i.documentElement,!n)throw Error(a(452));return n;case"head":if(n=i.head,!n)throw Error(a(453));return n;case"body":if(n=i.body,!n)throw Error(a(454));return n;default:throw Error(a(451))}}function zo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Da(n)}var qn=new Map,bv=new Set;function bc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var qs=G.d;G.d={f:ZC,r:VC,D:QC,C:YC,L:JC,m:XC,X:ek,S:WC,M:tk};function ZC(){var n=qs.f(),i=dc();return n||i}function VC(n){var i=Xn(n);i!==null&&i.tag===5&&i.type==="form"?$y(i):qs.r(n)}var dr=typeof document>"u"?null:document;function Sv(n,i,l){var u=dr;if(u&&typeof i=="string"&&i){var h=Dn(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),bv.has(h)||(bv.add(h),n={rel:n,crossOrigin:l,href:i},u.querySelector(h)===null&&(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function QC(n){qs.D(n),Sv("dns-prefetch",n,null)}function YC(n,i){qs.C(n,i),Sv("preconnect",n,i)}function JC(n,i,l){qs.L(n,i,l);var u=dr;if(u&&n&&i){var h='link[rel="preload"][as="'+Dn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+Dn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+Dn(l.imageSizes)+'"]')):h+='[href="'+Dn(n)+'"]';var g=h;switch(i){case"style":g=fr(n);break;case"script":g=hr(n)}qn.has(g)||(n=y({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),qn.set(g,n),u.querySelector(h)!==null||i==="style"&&u.querySelector(Eo(g))||i==="script"&&u.querySelector(Ro(g))||(i=u.createElement("link"),Wt(i,"link",n),Mt(i),u.head.appendChild(i)))}}function XC(n,i){qs.m(n,i);var l=dr;if(l&&n){var u=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Dn(u)+'"][href="'+Dn(n)+'"]',g=h;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=hr(n)}if(!qn.has(g)&&(n=y({rel:"modulepreload",href:n},i),qn.set(g,n),l.querySelector(h)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Ro(g)))return}u=l.createElement("link"),Wt(u,"link",n),Mt(u),l.head.appendChild(u)}}}function WC(n,i,l){qs.S(n,i,l);var u=dr;if(u&&n){var h=ei(u).hoistableStyles,g=fr(n);i=i||"default";var j=h.get(g);if(!j){var z={loading:0,preload:null};if(j=u.querySelector(Eo(g)))z.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},l),(l=qn.get(g))&&uh(n,l);var D=j=u.createElement("link");Mt(D),Wt(D,"link",n),D._p=new Promise(function(K,W){D.onload=K,D.onerror=W}),D.addEventListener("load",function(){z.loading|=1}),D.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Sc(j,i,u)}j={type:"stylesheet",instance:j,count:1,state:z},h.set(g,j)}}}function ek(n,i){qs.X(n,i);var l=dr;if(l&&n){var u=ei(l).hoistableScripts,h=hr(n),g=u.get(h);g||(g=l.querySelector(Ro(h)),g||(n=y({src:n,async:!0},i),(i=qn.get(h))&&dh(n,i),g=l.createElement("script"),Mt(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function tk(n,i){qs.M(n,i);var l=dr;if(l&&n){var u=ei(l).hoistableScripts,h=hr(n),g=u.get(h);g||(g=l.querySelector(Ro(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=qn.get(h))&&dh(n,i),g=l.createElement("script"),Mt(g),Wt(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(h,g))}}function jv(n,i,l,u){var h=(h=he.current)?bc(h):null;if(!h)throw Error(a(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=fr(l.href),l=ei(h).hoistableStyles,u=l.get(i),u||(u={type:"style",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=fr(l.href);var g=ei(h).hoistableStyles,j=g.get(n);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,j),(g=h.querySelector(Eo(n)))&&!g._p&&(j.instance=g,j.state.loading=5),qn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},qn.set(n,l),g||nk(h,n,l,j.state))),i&&u===null)throw Error(a(528,""));return j}if(i&&u!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=hr(l),l=ei(h).hoistableScripts,u=l.get(i),u||(u={type:"script",instance:null,count:0,state:null},l.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function fr(n){return'href="'+Dn(n)+'"'}function Eo(n){return'link[rel="stylesheet"]['+n+"]"}function wv(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function nk(n,i,l,u){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=n.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Wt(i,"link",l),Mt(i),n.head.appendChild(i))}function hr(n){return'[src="'+Dn(n)+'"]'}function Ro(n){return"script[async]"+n}function Nv(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var u=n.querySelector('style[data-href~="'+Dn(l.href)+'"]');if(u)return i.instance=u,Mt(u),u;var h=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(n.ownerDocument||n).createElement("style"),Mt(u),Wt(u,"style",h),Sc(u,l.precedence,n),i.instance=u;case"stylesheet":h=fr(l.href);var g=n.querySelector(Eo(h));if(g)return i.state.loading|=4,i.instance=g,Mt(g),g;u=wv(l),(h=qn.get(h))&&uh(u,h),g=(n.ownerDocument||n).createElement("link"),Mt(g);var j=g;return j._p=new Promise(function(z,D){j.onload=z,j.onerror=D}),Wt(g,"link",u),i.state.loading|=4,Sc(g,l.precedence,n),i.instance=g;case"script":return g=hr(l.src),(h=n.querySelector(Ro(g)))?(i.instance=h,Mt(h),h):(u=l,(h=qn.get(g))&&(u=y({},l),dh(u,h)),n=n.ownerDocument||n,h=n.createElement("script"),Mt(h),Wt(h,"link",u),n.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,Sc(u,l.precedence,n));return i.instance}function Sc(n,i,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=u.length?u[u.length-1]:null,g=h,j=0;j<u.length;j++){var z=u[j];if(z.dataset.precedence===i)g=z;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(n,i.firstChild))}function uh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function dh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var jc=null;function Cv(n,i,l){if(jc===null){var u=new Map,h=jc=new Map;h.set(l,u)}else h=jc,u=h.get(l),u||(u=new Map,h.set(l,u));if(u.has(n))return u;for(u.set(n,null),l=l.getElementsByTagName(n),h=0;h<l.length;h++){var g=l[h];if(!(g[ds]||g[Et]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=n+j;var z=u.get(j);z?z.push(g):u.set(j,[g])}}return u}function kv(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function sk(n,i,l){if(l===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(n=i.disabled,typeof i.precedence=="string"&&n==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function _v(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function ik(n,i,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=fr(u.href),g=i.querySelector(Eo(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=wc.bind(n),i.then(n,n)),l.state.loading|=4,l.instance=g,Mt(g);return}g=i.ownerDocument||i,u=wv(u),(h=qn.get(h))&&uh(u,h),g=g.createElement("link"),Mt(g);var j=g;j._p=new Promise(function(z,D){j.onload=z,j.onerror=D}),Wt(g,"link",u),l.instance=g}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=wc.bind(n),i.addEventListener("load",l),i.addEventListener("error",l))}}var fh=0;function ak(n,i){return n.stylesheets&&n.count===0&&Cc(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var u=setTimeout(function(){if(n.stylesheets&&Cc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&fh===0&&(fh=62500*PC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Cc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>fh?50:800)+i);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(u),clearTimeout(h)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Nc=null;function Cc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Nc=new Map,i.forEach(rk,n),Nc=null,wc.call(n))}function rk(n,i){if(!(i.state.loading&4)){var l=Nc.get(n);if(l)var u=l.get(null);else{l=new Map,Nc.set(n,l);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var j=h[g];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(l.set(j.dataset.precedence,j),u=j)}u&&l.set(null,u)}h=i.instance,j=h.getAttribute("data-precedence"),g=l.get(j)||u,g===u&&l.set(null,h),l.set(j,h),this.count++,u=wc.bind(this),h.addEventListener("load",u),h.addEventListener("error",u),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var To={$$typeof:R,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function ok(n,i,l,u,h,g,j,z,D){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Oa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oa(0),this.hiddenUpdates=Oa(null),this.identifierPrefix=u,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function zv(n,i,l,u,h,g,j,z,D,K,W,ne){return n=new ok(n,i,l,j,D,K,W,ne,z),i=1,g===!0&&(i|=24),g=_n(3,null,null,i),n.current=g,g.stateNode=n,i=Gd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:u,isDehydrated:l,cache:i},Vd(g),n}function Ev(n){return n?(n=Ga,n):Ga}function Rv(n,i,l,u,h,g){h=Ev(h),u.context===null?u.context=h:u.pendingContext=h,u=oi(i),u.payload={element:l},g=g===void 0?null:g,g!==null&&(u.callback=g),l=li(n,u,i),l!==null&&(bn(l,n,i),lo(l,n,i))}function Tv(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function hh(n,i){Tv(n,i),(n=n.alternate)&&Tv(n,i)}function Av(n){if(n.tag===13||n.tag===31){var i=Yi(n,67108864);i!==null&&bn(i,n,67108864),hh(n,67108864)}}function Ov(n){if(n.tag===13||n.tag===31){var i=An();i=U(i);var l=Yi(n,i);l!==null&&bn(l,n,i),hh(n,i)}}var kc=!0;function lk(n,i,l,u){var h=B.T;B.T=null;var g=G.p;try{G.p=2,mh(n,i,l,u)}finally{G.p=g,B.T=h}}function ck(n,i,l,u){var h=B.T;B.T=null;var g=G.p;try{G.p=8,mh(n,i,l,u)}finally{G.p=g,B.T=h}}function mh(n,i,l,u){if(kc){var h=ph(u);if(h===null)eh(n,i,u,_c,l),Lv(n,u);else if(dk(h,n,i,l,u))u.stopPropagation();else if(Lv(n,u),i&4&&-1<uk.indexOf(n)){for(;h!==null;){var g=Xn(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=cs(g.pendingLanes);if(j!==0){var z=g;for(z.pendingLanes|=2,z.entangledLanes|=2;j;){var D=1<<31-Qe(j);z.entanglements[1]|=D,j&=~D}gs(g),(Xe&6)===0&&(cc=qe()+500,Co(0))}}break;case 31:case 13:z=Yi(g,2),z!==null&&bn(z,g,2),dc(),hh(g,2)}if(g=ph(u),g===null&&eh(n,i,u,_c,l),g===h)break;h=g}h!==null&&u.stopPropagation()}else eh(n,i,u,null,l)}}function ph(n){return n=gd(n),gh(n)}var _c=null;function gh(n){if(_c=null,n=Ws(n),n!==null){var i=c(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=d(i),n!==null)return n;n=null}else if(l===31){if(n=f(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}return _c=n,null}function Dv(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ze()){case $e:return 2;case pt:return 8;case rn:case js:return 32;case Vs:return 268435456;default:return 32}default:return 32}}var yh=!1,xi=null,bi=null,Si=null,Ao=new Map,Oo=new Map,ji=[],uk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lv(n,i){switch(n){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":bi=null;break;case"mouseover":case"mouseout":Si=null;break;case"pointerover":case"pointerout":Ao.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(i.pointerId)}}function Do(n,i,l,u,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:l,eventSystemFlags:u,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Xn(i),i!==null&&Av(i)),n):(n.eventSystemFlags|=u,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function dk(n,i,l,u,h){switch(i){case"focusin":return xi=Do(xi,n,i,l,u,h),!0;case"dragenter":return bi=Do(bi,n,i,l,u,h),!0;case"mouseover":return Si=Do(Si,n,i,l,u,h),!0;case"pointerover":var g=h.pointerId;return Ao.set(g,Do(Ao.get(g)||null,n,i,l,u,h)),!0;case"gotpointercapture":return g=h.pointerId,Oo.set(g,Do(Oo.get(g)||null,n,i,l,u,h)),!0}return!1}function Mv(n){var i=Ws(n.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=d(l),i!==null){n.blockedOn=i,Qt(n.priority,function(){Ov(l)});return}}else if(i===31){if(i=f(l),i!==null){n.blockedOn=i,Qt(n.priority,function(){Ov(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function zc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=ph(n.nativeEvent);if(l===null){l=n.nativeEvent;var u=new l.constructor(l.type,l);pd=u,l.target.dispatchEvent(u),pd=null}else return i=Xn(l),i!==null&&Av(i),n.blockedOn=l,!1;i.shift()}return!0}function $v(n,i,l){zc(n)&&l.delete(i)}function fk(){yh=!1,xi!==null&&zc(xi)&&(xi=null),bi!==null&&zc(bi)&&(bi=null),Si!==null&&zc(Si)&&(Si=null),Ao.forEach($v),Oo.forEach($v)}function Ec(n,i){n.blockedOn===i&&(n.blockedOn=null,yh||(yh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,fk)))}var Rc=null;function Uv(n){Rc!==n&&(Rc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rc===n&&(Rc=null);for(var i=0;i<n.length;i+=3){var l=n[i],u=n[i+1],h=n[i+2];if(typeof u!="function"){if(gh(u||l)===null)continue;break}var g=Xn(l);g!==null&&(n.splice(i,3),i-=3,pf(g,{pending:!0,data:h,method:l.method,action:u},u,h))}}))}function mr(n){function i(D){return Ec(D,n)}xi!==null&&Ec(xi,n),bi!==null&&Ec(bi,n),Si!==null&&Ec(Si,n),Ao.forEach(i),Oo.forEach(i);for(var l=0;l<ji.length;l++){var u=ji[l];u.blockedOn===n&&(u.blockedOn=null)}for(;0<ji.length&&(l=ji[0],l.blockedOn===null);)Mv(l),l.blockedOn===null&&ji.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var h=l[u],g=l[u+1],j=h[wt]||null;if(typeof g=="function")j||Uv(l);else if(j){var z=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[wt]||null)z=j.formAction;else if(gh(h)!==null)continue}else z=j.action;typeof z=="function"?l[u+1]=z:(l.splice(u,3),u-=3),Uv(l)}}}function Pv(){function n(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(j){return h=j})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function vh(n){this._internalRoot=n}Tc.prototype.render=vh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,u=An();Rv(l,u,n,i,null,null)},Tc.prototype.unmount=vh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Rv(n.current,2,null,n,null,null),dc(),i[Cn]=null}};function Tc(n){this._internalRoot=n}Tc.prototype.unstable_scheduleHydration=function(n){if(n){var i=at();n={blockedOn:null,target:n,priority:i};for(var l=0;l<ji.length&&i!==0&&i<ji[l].priority;l++);ji.splice(l,0,n),l===0&&Mv(n)}};var Iv=t.version;if(Iv!=="19.2.4")throw Error(a(527,Iv,"19.2.4"));G.findDOMNode=function(n){var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(a(188)):(n=Object.keys(n).join(","),Error(a(268,n)));return n=p(i),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var hk={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ac=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ac.isDisabled&&Ac.supportsFiber)try{ls=Ac.inject(hk),_e=Ac}catch{}}return Mo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var l=!1,u="",h=Zy,g=Vy,j=Qy;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=zv(n,1,!1,null,null,l,u,null,h,g,j,Pv),n[Cn]=i.current,Wf(n),new vh(i)},Mo.hydrateRoot=function(n,i,l){if(!r(n))throw Error(a(299));var u=!1,h="",g=Zy,j=Vy,z=Qy,D=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(j=l.onCaughtError),l.onRecoverableError!==void 0&&(z=l.onRecoverableError),l.formState!==void 0&&(D=l.formState)),i=zv(n,1,!0,i,l??null,u,h,D,g,j,z,Pv),i.context=Ev(null),l=i.current,u=An(),u=U(u),h=oi(u),h.callback=null,li(l,h,u),l=u,i.current.lanes=l,Fi(i,l),gs(i),n[Cn]=i.current,Wf(n),new Tc(i)},Mo.version="19.2.4",Mo}var Yv;function wk(){if(Yv)return Sh.exports;Yv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sh.exports=jk(),Sh.exports}var Nk=wk(),$r=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ck={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kk=class{#t=Ck;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},ha=new kk;function _k(e){setTimeout(e,0)}var wa=typeof window>"u"||"Deno"in globalThis;function un(){}function zk(e,t){return typeof e=="function"?e(t):e}function am(e){return typeof e=="number"&&e>=0&&e!==1/0}function Xb(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oi(e,t){return typeof e=="function"?e(t):e}function Hn(e,t){return typeof e=="function"?e(t):e}function Jv(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:d,stale:f}=e;if(d){if(a){if(t.queryHash!==Fm(d,t.options))return!1}else if(!Jo(t.queryKey,d))return!1}if(s!=="all"){const m=t.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||r&&r!==t.state.fetchStatus||c&&!c(t))}function Xv(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Yo(t.options.mutationKey)!==Yo(c))return!1}else if(!Jo(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function Fm(e,t){return(t?.queryKeyHashFn||Yo)(e)}function Yo(e){return JSON.stringify(e,(t,s)=>rm(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function Jo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>Jo(e[s],t[s])):!1}var Ek=Object.prototype.hasOwnProperty;function Zm(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=Wv(e)&&Wv(t);if(!a&&!(rm(e)&&rm(t)))return t;const c=(a?e:Object.keys(e)).length,d=a?t:Object.keys(t),f=d.length,m=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const y=a?v:d[v],x=e[y],b=t[y];if(x===b){m[y]=x,(a?v<c:Ek.call(e,y))&&p++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){m[y]=b;continue}const w=Zm(x,b,s+1);m[y]=w,w===x&&p++}return c===f&&p===c?e:m}function cu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}function Wv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function rm(e){if(!ex(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!ex(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ex(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rk(e){return new Promise(t=>{ha.setTimeout(t,e)})}function om(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?Zm(e,t):t}function Tk(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function Ak(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var Vm=Symbol();function Wb(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Vm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function eS(e,t){return typeof e=="function"?e(...t):!!e}function Ok(e,t,s){let a=!1,r;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),a||(a=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}var Dk=class extends $r{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},Qm=new Dk;function lm(){let e,t;const s=new Promise((r,c)=>{e=r,t=c});s.status="pending",s.catch(()=>{});function a(r){Object.assign(s,r),delete s.resolve,delete s.reject}return s.resolve=r=>{a({status:"fulfilled",value:r}),e(r)},s.reject=r=>{a({status:"rejected",reason:r}),t(r)},s}var Lk=_k;function Mk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=Lk;const c=f=>{t?e.push(f):r(()=>{s(f)})},d=()=>{const f=e;e=[],f.length&&r(()=>{a(()=>{f.forEach(m=>{s(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||d()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var Bt=Mk(),$k=class extends $r{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!wa&&window.addEventListener){const t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(s=>{s(e)}))}isOnline(){return this.#t}},uu=new $k;function Uk(e){return Math.min(1e3*2**e,3e4)}function tS(e){return(e??"online")==="online"?uu.isOnline():!0}var cm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function nS(e){let t=!1,s=0,a;const r=lm(),c=()=>r.status!=="pending",d=S=>{if(!c()){const C=new cm(S);x(C),e.onCancel?.(C)}},f=()=>{t=!0},m=()=>{t=!1},p=()=>Qm.isFocused()&&(e.networkMode==="always"||uu.isOnline())&&e.canRun(),v=()=>tS(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),r.resolve(S))},x=S=>{c()||(a?.(),r.reject(S))},b=()=>new Promise(S=>{a=C=>{(c()||p())&&S(C)},e.onPause?.()}).then(()=>{a=void 0,c()||e.onContinue?.()}),w=()=>{if(c())return;let S;const C=s===0?e.initialPromise:void 0;try{S=C??e.fn()}catch(k){S=Promise.reject(k)}Promise.resolve(S).then(y).catch(k=>{if(c())return;const E=e.retry??(wa?0:3),R=e.retryDelay??Uk,_=typeof R=="function"?R(s,k):R,L=E===!0||typeof E=="number"&&s<E||typeof E=="function"&&E(s,k);if(t||!L){x(k);return}s++,e.onFail?.(s,k),Rk(_).then(()=>p()?void 0:b()).then(()=>{t?x(k):w()})})};return{promise:r,status:()=>r.status,cancel:d,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?w():b().then(w),r)}}var sS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),am(this.gcTime)&&(this.#t=ha.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wa?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ha.clearTimeout(this.#t),this.#t=void 0)}},Pk=class extends sS{#t;#e;#n;#i;#s;#r;#o;constructor(e){super(),this.#o=!1,this.#r=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=nx(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#s?.promise}setOptions(e){if(this.options={...this.#r,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=nx(this.options);t.data!==void 0&&(this.setState(tx(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=om(this.state.data,e,this.options);return this.#a({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#a({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(un).catch(un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Hn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Xb(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#s?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#s?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#s&&(this.#o?this.#s.cancel({revert:!0}):this.#s.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#a({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#s?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#s)return this.#s.continueRetry(),this.#s.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(m=>m.options.queryFn);f&&this.setOptions(f.options)}const s=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,s.signal)})},r=()=>{const f=Wb(this.options,t),p=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(v),v})();return this.#o=!1,this.options.persister?this.options.persister(f,p,this):f(p)},d=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:r};return a(f),f})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#a({type:"fetch",meta:d.fetchOptions?.meta}),this.#s=nS({initialPromise:t?.initialPromise,fn:d.fetchFn,onCancel:f=>{f instanceof cm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,m)=>{this.#a({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#a({type:"pause"})},onContinue:()=>{this.#a({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const f=await this.#s.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof cm){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#a({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#a(e){const t=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...iS(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...tx(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const r=e.error;return{...s,error:r,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=t(this.state),Bt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function iS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nx(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,s=t!==void 0,a=s?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Ym=class extends $r{constructor(e,t){super(),this.options=t,this.#t=e,this.#a=null,this.#o=lm(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#r;#o;#a;#m;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),sx(this.#e,this.options)?this.#p():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return um(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return um(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,s=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Hn(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!cu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&ix(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||Oi(this.options.staleTime,this.#e)!==Oi(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Hn(this.options.enabled,this.#e)!==Hn(t.enabled,this.#e)||r!==this.#l)&&this.#v(r)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),s=this.createResult(t,e);return Bk(this,s)&&(this.#i=s,this.#r=this.options,this.#s=this.#e.state),s}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(s,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),s=this.#t.getQueryCache().build(this.#t,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#p(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(un)),t}#g(){this.#b();const e=Oi(this.options.staleTime,this.#e);if(wa||this.#i.isStale||!am(e))return;const s=Xb(this.#i.dataUpdatedAt,e)+1;this.#c=ha.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(wa||Hn(this.options.enabled,this.#e)===!1||!am(this.#l)||this.#l===0)&&(this.#u=ha.setInterval(()=>{(this.options.refetchIntervalInBackground||Qm.isFocused())&&this.#p()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(ha.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ha.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const s=this.#e,a=this.options,r=this.#i,c=this.#s,d=this.#r,m=e!==s?e.state:this.#n,{state:p}=e;let v={...p},y=!1,x;if(t._optimisticResults){const A=this.hasListeners(),P=!A&&sx(e,t),J=A&&ix(e,s,t,a);(P||J)&&(v={...v,...iS(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:w,status:S}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&S==="pending"){let A;r?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(A=r.data,C=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,A!==void 0&&(S="success",x=om(r?.data,A,t),y=!0)}if(t.select&&x!==void 0&&!C)if(r&&x===c?.data&&t.select===this.#m)x=this.#d;else try{this.#m=t.select,x=t.select(x),x=om(r?.data,x,t),this.#d=x,this.#a=null}catch(A){this.#a=A}this.#a&&(b=this.#a,x=this.#d,w=Date.now(),S="error");const k=v.fetchStatus==="fetching",E=S==="pending",R=S==="error",_=E&&k,L=x!==void 0,T={status:S,fetchStatus:v.fetchStatus,isPending:E,isSuccess:S==="success",isError:R,isInitialLoading:_,isLoading:_,data:x,dataUpdatedAt:v.dataUpdatedAt,error:b,errorUpdatedAt:w,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:R&&!L,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&L,isStale:Jm(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Hn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=T.data!==void 0,P=T.status==="error"&&!A,J=pe=>{P?pe.reject(T.error):A&&pe.resolve(T.data)},Q=()=>{const pe=this.#o=T.promise=lm();J(pe)},se=this.#o;switch(se.status){case"pending":e.queryHash===s.queryHash&&J(se);break;case"fulfilled":(P||T.data!==se.value)&&Q();break;case"rejected":(!P||T.error!==se.reason)&&Q();break}}return T}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#r=this.options,this.#s.data!==void 0&&(this.#f=this.#e),cu(t,e))return;this.#i=t;const s=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,r=typeof a=="function"?a():a;if(r==="all"||!r&&!this.#h.size)return!0;const c=new Set(r??this.#h);return this.options.throwOnError&&c.add("error"),Object.keys(this.#i).some(d=>{const f=d;return this.#i[f]!==e[f]&&c.has(f)})};this.#w({listeners:s()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#w(e){Bt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Ik(e,t){return Hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sx(e,t){return Ik(e,t)||e.state.data!==void 0&&um(e,t,t.refetchOnMount)}function um(e,t,s){if(Hn(t.enabled,e)!==!1&&Oi(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&Jm(e,t)}return!1}function ix(e,t,s,a){return(e!==t||Hn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&Jm(e,s)}function Jm(e,t){return Hn(t.enabled,e)!==!1&&e.isStaleByTime(Oi(t.staleTime,e))}function Bk(e,t){return!cu(e.getCurrentResult(),t)}function ax(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const y=w=>{Ok(w,()=>t.signal,()=>v=!0)},x=Wb(t.options,t.fetchOptions),b=async(w,S,C)=>{if(v)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const M={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y(M),M})(),R=await x(E),{maxPages:_}=t.options,L=C?Ak:Tk;return{pages:L(w.pages,R,_),pageParams:L(w.pageParams,S,_)}};if(r&&c.length){const w=r==="backward",S=w?qk:rx,C={pages:c,pageParams:d},k=S(a,C);f=await b(C,k,w)}else{const w=e??c.length;do{const S=m===0?d[0]??a.initialPageParam:rx(a,f);if(m>0&&S==null)break;f=await b(f,S),m++}while(m<w)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},s):t.fetchFn=p}}}function rx(e,{pages:t,pageParams:s}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,s[a],s):void 0}function qk(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Hk=class extends sS{#t;#e;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||Gk(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#s({type:"continue"})},s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=nS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",r=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,s);const d=await this.options.onMutate?.(e,s);d!==this.state.context&&this.#s({type:"pending",context:d,variables:e,isPaused:r})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,s),await this.options.onSuccess?.(c,e,this.state.context,s),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(c,null,e,this.state.context,s),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Bt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function Gk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var aS=class extends $r{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,s){const a=new Hk({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:s});return this.add(a),a}add(e){this.#t.add(e);const t=Oc(e);if(typeof t=="string"){const s=this.#e.get(t);s?s.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Oc(e);if(typeof t=="string"){const s=this.#e.get(t);if(s)if(s.length>1){const a=s.indexOf(e);a!==-1&&s.splice(a,1)}else s[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Oc(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(r=>r.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Oc(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bt.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Xv(t,s))}findAll(e={}){return this.getAll().filter(t=>Xv(e,t))}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Bt.batch(()=>Promise.all(e.map(t=>t.continue().catch(un))))}};function Oc(e){return e.options.scope?.id}function ox(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function Kk(e,t,s){const a=e.slice(0);return a[t]=s,a}var Fk=class extends $r{#t;#e;#n;#i;#s;#r;#o;#a;#m;#d=[];constructor(e,t,s){super(),this.#t=e,this.#i=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Bt.batch(()=>{const s=this.#s,a=this.#u(this.#n);a.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const r=a.map(v=>v.observer),c=r.map(v=>v.getCurrentResult()),d=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),m=d||f,p=m?!0:c.some((v,y)=>{const x=this.#e[y];return!x||!cu(v,x)});!m&&!p||(m&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(m&&(ox(s,r).forEach(v=>{v.destroy()}),ox(r,s).forEach(v=>{v.subscribe(y=>{this.#l(v,y)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(e=>e.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(e,t){const s=this.#u(e),a=s.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),r=s.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,r),()=>this.#f(a,s)]}#f(e,t){return t.map((s,a)=>{const r=e[a];return s.defaultedQueryOptions.notifyOnChangeProps?r:s.observer.trackResult(r,c=>{t.forEach(d=>{d.observer.trackProp(c)})})})}#c(e,t,s){if(t){const a=this.#m,r=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((c,d)=>c!==a[d]));return(!this.#r||this.#e!==this.#a||r||t!==this.#o)&&(this.#o=t,this.#a=this.#e,s!==void 0&&(this.#m=s),this.#r=Zm(this.#r,t(e))),this.#r}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const r=a.options.queryHash;if(!r)return;const c=t.get(r);c?c.push(a):t.set(r,[a])});const s=[];return e.forEach(a=>{const r=this.#t.defaultQueryOptions(a),d=t.get(r.queryHash)?.shift()??new Ym(this.#t,r);s.push({defaultedQueryOptions:r,observer:d})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=Kk(this.#e,s,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#r,t=this.#f(this.#e,this.#d),s=this.#c(t,this.#i?.combine);e!==s&&Bt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},Zk=class extends $r{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??Fm(a,t);let c=this.get(r);return c||(c=new Pk({client:e,queryKey:a,queryHash:r,options:e.defaultQueryOptions(t),state:s,defaultOptions:e.getQueryDefaults(a)}),this.add(c)),c}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Bt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(s=>Jv(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>Jv(e,s)):t}notify(e){Bt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Vk=class{#t;#e;#n;#i;#s;#r;#o;#a;constructor(e={}){this.#t=e.queryCache||new Zk,this.#e=e.mutationCache||new aS,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=Qm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#a=uu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#a?.(),this.#a=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),s=this.#t.build(this,t),a=s.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&s.isStaleByTime(Oi(t.staleTime,s))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:s})=>{const a=s.data;return[t,a]})}setQueryData(e,t,s){const a=this.defaultQueryOptions({queryKey:e}),c=this.#t.get(a.queryHash)?.state.data,d=zk(t,c);if(d!==void 0)return this.#t.build(this,a).setData(d,{...s,manual:!0})}setQueriesData(e,t,s){return Bt.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,s)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Bt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return Bt.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=Bt.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(un).catch(un)}invalidateQueries(e,t={}){return Bt.batch(()=>(this.#t.findAll(e).forEach(s=>{s.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const s={...t,cancelRefetch:t.cancelRefetch??!0},a=Bt.batch(()=>this.#t.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let c=r.fetch(void 0,s);return s.throwOnError||(c=c.catch(un)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Oi(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(un).catch(un)}fetchInfiniteQuery(e){return e.behavior=ax(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(un).catch(un)}ensureInfiniteQueryData(e){return e.behavior=ax(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(Yo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{Jo(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Yo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{Jo(e,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Vm&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},rS=N.createContext(void 0),oS=e=>{const t=N.useContext(rS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qk=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(rS.Provider,{value:e,children:t})),lS=N.createContext(!1),cS=()=>N.useContext(lS);lS.Provider;function Yk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Jk=N.createContext(Yk()),uS=()=>N.useContext(Jk),dS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?eS(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},fS=e=>{N.useEffect(()=>{e.clearReset()},[e])},hS=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||eS(s,[e.error,a])),mS=e=>{if(e.suspense){const s=r=>r==="static"?r:Math.max(r??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...r)=>s(a(...r)):s(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Xk=(e,t)=>e.isLoading&&e.isFetching&&!t,dm=(e,t)=>e?.suspense&&t.isPending,fm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Wk({queries:e,...t},s){const a=oS(),r=cS(),c=uS(),d=N.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);d.forEach(S=>{mS(S);const C=a.getQueryCache().get(S.queryHash);dS(S,c,C)}),fS(c);const[f]=N.useState(()=>new Fk(a,d,t)),[m,p,v]=f.getOptimisticResult(d,t.combine),y=!r&&t.subscribed!==!1;N.useSyncExternalStore(N.useCallback(S=>y?f.subscribe(Bt.batchCalls(S)):un,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setQueries(d,t)},[d,t,f]);const b=m.some((S,C)=>dm(d[C],S))?m.flatMap((S,C)=>{const k=d[C];if(k&&dm(k,S)){const E=new Ym(a,k);return fm(k,E,c)}return[]}):[];if(b.length>0)throw Promise.all(b);const w=m.find((S,C)=>{const k=d[C];return k&&hS({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return p(v())}function e_(e,t,s){const a=cS(),r=uS(),c=oS(),d=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=c.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",mS(d),dS(d,r,f),fS(r);const m=!c.getQueryCache().get(d.queryHash),[p]=N.useState(()=>new t(c,d)),v=p.getOptimisticResult(d),y=!a&&e.subscribed!==!1;if(N.useSyncExternalStore(N.useCallback(x=>{const b=y?p.subscribe(Bt.batchCalls(x)):un;return p.updateResult(),b},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),N.useEffect(()=>{p.setOptions(d)},[d,p]),dm(d,v))throw fm(d,p,r);if(hS({result:v,errorResetBoundary:r,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(d,v),d.experimental_prefetchInRender&&!wa&&Xk(v,a)&&(m?fm(d,p,r):f?.promise)?.catch(un).finally(()=>{p.updateResult()}),d.notifyOnChangeProps?v:p.trackResult(v)}function Ko(e,t){return e_(e,Ym)}var Dc=typeof window<"u"?N.useLayoutEffect:N.useEffect;function Ch(e){const t=N.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function t_(e,t,s={},a={}){N.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const r=new IntersectionObserver(([c])=>{t(c)},s);return r.observe(e.current),()=>{r.disconnect()}},[t,s,a.disabled,e])}function n_(e){const t=N.useRef(null);return N.useImperativeHandle(e,()=>t.current,[]),t}var s_=!1;function Xo(e){return e[e.length-1]}function i_(e){return typeof e=="function"}function Ei(e,t){return i_(e)?e(t):e}var a_=Object.prototype.hasOwnProperty,lx=Object.prototype.propertyIsEnumerable,r_=()=>Object.create(null),ca=(e,t)=>ma(e,t,r_);function ma(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=dx(e)&&dx(r);if(!c&&!(du(e)&&du(r)))return r;const d=c?e:cx(e);if(!d)return r;const f=c?r:cx(r);if(!f)return r;const m=d.length,p=f.length,v=c?new Array(p):s();let y=0;for(let x=0;x<p;x++){const b=c?x:f[x],w=e[b],S=r[b];if(w===S){v[b]=w,(c?x<m:a_.call(e,b))&&y++;continue}if(w===null||S===null||typeof w!="object"||typeof S!="object"){v[b]=S;continue}const C=ma(w,S,s,a+1);v[b]=C,C===w&&y++}return m===p&&y===m?e:v}function cx(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!lx.call(e,r))return!1;const s=Object.getOwnPropertySymbols(e);if(s.length===0)return t;const a=t;for(const r of s){if(!lx.call(e,r))return!1;a.push(r)}return a}function du(e){if(!ux(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!ux(s)||!s.hasOwnProperty("isPrototypeOf"))}function ux(e){return Object.prototype.toString.call(e)==="[object Object]"}function dx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xa(e,t,s){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let a=0,r=e.length;a<r;a++)if(!xa(e[a],t[a],s))return!1;return!0}if(du(e)&&du(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const d in t)if((!a||t[d]!==void 0)&&!xa(e[d],t[d],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const d in e)e[d]!==void 0&&r++;let c=0;for(const d in t)if((!a||t[d]!==void 0)&&(c++,c>r||!xa(e[d],t[d],s)))return!1;return r===c}return!1}function Tr(e){let t,s;const a=new Promise((r,c)=>{t=r,s=c});return a.status="pending",a.resolve=r=>{a.status="resolved",a.value=r,t(r),e?.(r)},a.reject=r=>{a.status="rejected",s(r)},a}function Wo(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function o_(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function fx(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,s=>{try{return decodeURI(s)}catch{return s}})}return o_(t)}var l_=["http:","https:","mailto:","tel:"];function fu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function $o(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let s=0,a="",r;for(;(r=t.exec(e))!==null;)a+=fx(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+fx(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function c_(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function hu(e){const t=new Map;let s,a;const r=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,a&&(a.next=c,c.prev=a)):(c.next.prev=void 0,s=c.next,c.next=void 0,a&&(c.prev=a,a.next=c)),a=c)};return{get(c){const d=t.get(c);if(d)return r(d),d.value},set(c,d){if(t.size>=e&&s){const m=s;t.delete(m.key),m.next&&(s=m.next,m.next.prev=void 0),m===a&&(a=void 0)}const f=t.get(c);if(f)f.value=d,r(f);else{const m={key:c,value:d,prev:a};a&&(a.next=m),a=m,s||(s=m),t.set(c,m)}},clear(){t.clear(),s=void 0,a=void 0}}}var u_="Invariant failed";function Ui(e,t){if(!e)throw new Error(u_)}var pa=4,pS=5;function d_(e){const t=e.indexOf("{");if(t===-1)return null;const s=e.indexOf("}",t);return s===-1||t+1>=e.length?null:[t,s]}function Xm(e,t,s=new Uint16Array(6)){const a=e.indexOf("/",t),r=a===-1?e.length:a,c=e.substring(t,r);if(!c||!c.includes("$"))return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s;if(c==="$"){const f=e.length;return s[0]=2,s[1]=t,s[2]=t,s[3]=f,s[4]=f,s[5]=f,s}if(c.charCodeAt(0)===36)return s[0]=1,s[1]=t,s[2]=t+1,s[3]=r,s[4]=r,s[5]=r,s;const d=d_(c);if(d){const[f,m]=d,p=c.charCodeAt(f+1);if(p===45){if(f+2<c.length&&c.charCodeAt(f+2)===36){const v=f+3,y=m;if(v<y)return s[0]=3,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=r,s}}else if(p===36){const v=f+1,y=f+2;return y===m?(s[0]=2,s[1]=t+f,s[2]=t+v,s[3]=t+y,s[4]=t+m+1,s[5]=e.length,s):(s[0]=1,s[1]=t+f,s[2]=t+y,s[3]=t+m,s[4]=t+m+1,s[5]=r,s)}}return s[0]=0,s[1]=t,s[2]=t,s[3]=r,s[4]=r,s[5]=r,s}function Ru(e,t,s,a,r,c,d){d?.(s);let f=a;{const m=s.fullPath??s.from,p=m.length,v=s.options?.caseSensitive??e,y=!!(s.options?.params?.parse&&s.options?.skipRouteOnParseError?.params);for(;f<p;){const b=Xm(m,f,t);let w;const S=f,C=b[5];switch(f=C+1,c++,b[0]){case 0:{const k=m.substring(b[2],b[3]);if(v){const E=r.static?.get(k);if(E)w=E;else{r.static??=new Map;const R=ga(s.fullPath??s.from);R.parent=r,R.depth=c,w=R,r.static.set(k,R)}}else{const E=k.toLowerCase(),R=r.staticInsensitive?.get(E);if(R)w=R;else{r.staticInsensitive??=new Map;const _=ga(s.fullPath??s.from);_.parent=r,_.depth=c,w=_,r.staticInsensitive.set(E,_)}}break}case 1:{const k=m.substring(S,b[1]),E=m.substring(b[4],C),R=v&&!!(k||E),_=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=!y&&r.dynamic?.find(T=>!T.skipOnParamError&&T.caseSensitive===R&&T.prefix===_&&T.suffix===L);if(M)w=M;else{const T=_h(1,s.fullPath??s.from,R,_,L);w=T,T.depth=c,T.parent=r,r.dynamic??=[],r.dynamic.push(T)}break}case 3:{const k=m.substring(S,b[1]),E=m.substring(b[4],C),R=v&&!!(k||E),_=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=!y&&r.optional?.find(T=>!T.skipOnParamError&&T.caseSensitive===R&&T.prefix===_&&T.suffix===L);if(M)w=M;else{const T=_h(3,s.fullPath??s.from,R,_,L);w=T,T.parent=r,T.depth=c,r.optional??=[],r.optional.push(T)}break}case 2:{const k=m.substring(S,b[1]),E=m.substring(b[4],C),R=v&&!!(k||E),_=k?R?k:k.toLowerCase():void 0,L=E?R?E:E.toLowerCase():void 0,M=_h(2,s.fullPath??s.from,R,_,L);w=M,M.parent=r,M.depth=c,r.wildcard??=[],r.wildcard.push(M)}}r=w}if(y&&s.children&&!s.isRoot&&s.id&&s.id.charCodeAt(s.id.lastIndexOf("/")+1)===95){const b=ga(s.fullPath??s.from);b.kind=pS,b.parent=r,c++,b.depth=c,r.pathless??=[],r.pathless.push(b),r=b}const x=(s.path||!s.children)&&!s.isRoot;if(x&&m.endsWith("/")){const b=ga(s.fullPath??s.from);b.kind=pa,b.parent=r,c++,b.depth=c,r.index=b,r=b}r.parse=s.options?.params?.parse??null,r.skipOnParamError=y,r.parsingPriority=s.options?.skipRouteOnParseError?.priority??0,x&&!r.route&&(r.route=s,r.fullPath=s.fullPath??s.from)}if(s.children)for(const m of s.children)Ru(e,t,m,f,r,c,d)}function kh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function _i(e){if(e.pathless)for(const t of e.pathless)_i(t);if(e.static)for(const t of e.static.values())_i(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())_i(t);if(e.dynamic?.length){e.dynamic.sort(kh);for(const t of e.dynamic)_i(t)}if(e.optional?.length){e.optional.sort(kh);for(const t of e.optional)_i(t)}if(e.wildcard?.length){e.wildcard.sort(kh);for(const t of e.wildcard)_i(t)}}function ga(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function _h(e,t,s,a,r){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:s,prefix:a,suffix:r}}function f_(e,t){const s=ga("/"),a=new Uint16Array(6);for(const r of e)Ru(!1,a,r,1,s,0);_i(s),t.masksTree=s,t.flatCache=hu(1e3)}function h_(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=Wm(e,t.masksTree);return t.flatCache.set(e,a),a}function m_(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let d=r.singleCache.get(c);return d||(d=ga("/"),Ru(t,new Uint16Array(6),{from:e},1,d,0),r.singleCache.set(c,d)),Wm(a,d,s)}function p_(e,t,s=!1){const a=s?e:`nofuzz\0${e}`,r=t.matchCache.get(a);if(r!==void 0)return r;e||="/";let c;try{c=Wm(e,t.segmentTree,s)}catch(d){if(d instanceof URIError)c=null;else throw d}return c&&(c.branch=v_(c.route)),t.matchCache.set(a,c),c}function g_(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function y_(e,t=!1,s){const a=ga(e.fullPath),r=new Uint16Array(6),c={},d={};let f=0;return Ru(t,r,e,1,a,0,m=>{if(s?.(m,f),Ui(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,f!==0&&m.path){const p=g_(m.fullPath);(!d[p]||m.fullPath.endsWith("/"))&&(d[p]=m)}f++}),_i(a),{processedTree:{segmentTree:a,singleCache:hu(1e3),matchCache:hu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:d}}function Wm(e,t,s=!1){const a=e.split("/"),r=b_(e,a,t,s);if(!r)return null;const[c]=gS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function gS(e,t,s){const a=x_(s.node);let r=null;const c=Object.create(null);let d=s.extract?.part??0,f=s.extract?.node??0,m=s.extract?.path??0,p=s.extract?.segment??0;for(;f<a.length;d++,f++,m++,p++){const v=a[f];if(v.kind===pa)break;if(v.kind===pS){p--,d--,m--;continue}const y=t[d],x=m;if(y&&(m+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const b=r[p],w=v.prefix?.length??0;if(b.charCodeAt(w)===123){const S=v.suffix?.length??0,C=b.substring(w+2,b.length-S-1),k=y.substring(w,y.length-S);c[C]=decodeURIComponent(k)}else{const S=b.substring(1);c[S]=decodeURIComponent(y)}}else if(v.kind===3){if(s.skipped&1<<f){d--,m=x-1;continue}r??=s.node.fullPath.split("/");const b=r[p],w=v.prefix?.length??0,S=v.suffix?.length??0,C=b.substring(w+3,b.length-S-1),k=v.suffix||v.prefix?y.substring(w,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const b=v,w=e.substring(x+(b.prefix?.length??0),e.length-(b.suffix?.length??0)),S=decodeURIComponent(w);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:d,node:f,path:m,segment:p}]}function v_(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function x_(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function b_(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!Xo(t),c=r&&e!=="/",d=t.length-(r?1:0),f=[{node:s,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let m=null,p=null,v=null;for(;f.length;){const y=f.pop(),{node:x,index:b,skipped:w,depth:S,statics:C,dynamics:k,optionals:E}=y;let{extract:R,rawParams:_,parsedParams:L}=y;if(x.skipOnParamError){if(!zh(e,t,y))continue;_=y.rawParams,R=y.extract,L=y.parsedParams}a&&x.route&&x.kind!==pa&&Uo(p,y)&&(p=y);const M=b===d;if(M&&(x.route&&!c&&Uo(v,y)&&(v=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const T=M?void 0:t[b];let A;if(M&&x.index){const P={node:x.index,index:b,skipped:w,depth:S+1,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:L};let J=!0;if(x.index.skipOnParamError&&(zh(e,t,P)||(J=!1)),J){if(C===d&&!k&&!E&&!w)return P;Uo(v,P)&&(v=P)}}if(x.wildcard&&Uo(m,y))for(const P of x.wildcard){const{prefix:J,suffix:Q}=P;if(J&&(M||!(P.caseSensitive?T:A??=T.toLowerCase()).startsWith(J)))continue;if(Q){if(M)continue;const pe=t.slice(b).join("/").slice(-Q.length);if((P.caseSensitive?pe:pe.toLowerCase())!==Q)continue}const se={node:P,index:d,skipped:w,depth:S,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:L};if(!(P.skipOnParamError&&!zh(e,t,se))){m=se;break}}if(x.optional){const P=w|1<<S,J=S+1;for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q];f.push({node:se,index:b,skipped:P,depth:J,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:L})}if(!M)for(let Q=x.optional.length-1;Q>=0;Q--){const se=x.optional[Q],{prefix:pe,suffix:ke}=se;if(pe||ke){const je=se.caseSensitive?T:A??=T.toLowerCase();if(pe&&!je.startsWith(pe)||ke&&!je.endsWith(ke))continue}f.push({node:se,index:b+1,skipped:w,depth:J,statics:C,dynamics:k,optionals:E+1,extract:R,rawParams:_,parsedParams:L})}}if(!M&&x.dynamic&&T)for(let P=x.dynamic.length-1;P>=0;P--){const J=x.dynamic[P],{prefix:Q,suffix:se}=J;if(Q||se){const pe=J.caseSensitive?T:A??=T.toLowerCase();if(Q&&!pe.startsWith(Q)||se&&!pe.endsWith(se))continue}f.push({node:J,index:b+1,skipped:w,depth:S+1,statics:C,dynamics:k+1,optionals:E,extract:R,rawParams:_,parsedParams:L})}if(!M&&x.staticInsensitive){const P=x.staticInsensitive.get(A??=T.toLowerCase());P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:L})}if(!M&&x.static){const P=x.static.get(T);P&&f.push({node:P,index:b+1,skipped:w,depth:S+1,statics:C+1,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:L})}if(x.pathless){const P=S+1;for(let J=x.pathless.length-1;J>=0;J--){const Q=x.pathless[J];f.push({node:Q,index:b,skipped:w,depth:P,statics:C,dynamics:k,optionals:E,extract:R,rawParams:_,parsedParams:L})}}}if(v&&m)return Uo(m,v)?v:m;if(v)return v;if(m)return m;if(a&&p){let y=p.index;for(let b=0;b<p.index;b++)y+=t[b].length;const x=y===e.length?"/":e.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(x),p}return null}function zh(e,t,s){try{const[a,r]=gS(e,t,s);s.rawParams=a,s.extract=r;const c=s.node.parse(a);return s.parsedParams=Object.assign(Object.create(null),s.parsedParams,c),!0}catch{return null}}function Uo(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===pa)>(e.node.kind===pa)||t.node.kind===pa==(e.node.kind===pa)&&t.depth>e.depth))):!0}function eu(e){return ep(e.filter(t=>t!==void 0).join("/"))}function ep(e){return e.replace(/\/{2,}/g,"/")}function yS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Di(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function vS(e){return Di(yS(e))}function mu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function S_(e,t,s){return mu(e,s)===mu(t,s)}function j_({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let d;if(a){d=r?t:c?e:e+"\0"+t;const y=a.get(d);if(y)return y}let f;if(c)f=e.split("/");else if(r)f=t.split("/");else{for(f=e.split("/");f.length>1&&Xo(f)==="";)f.pop();const y=t.split("/");for(let x=0,b=y.length;x<b;x++){const w=y[x];w===""?x?x===b-1&&f.push(w):f=[w]:w===".."?f.pop():w==="."||f.push(w)}}f.length>1&&(Xo(f)===""?s==="never"&&f.pop():s==="always"&&f.push(""));let m,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const x=f[y];if(!x)continue;m=Xm(x,0,m);const b=m[0];if(b===0){p+=x;continue}const w=m[5],S=x.substring(0,m[1]),C=x.substring(m[4],w),k=x.substring(m[2],m[3]);b===1?p+=S||C?`${S}{$${k}}${C}`:`$${k}`:b===2?p+=S||C?`${S}{$}${C}`:"$":p+=`${S}{-$${k}}${C}`}p=ep(p);const v=p||"/";return d&&a&&a.set(d,v),v}function w_(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),s=Array.from(t.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(s,"g");return r=>r.replace(a,c=>t.get(c)??c)}function Eh(e,t,s){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(r=>mx(r,s)).join("/"):mx(a,s)}function hx({path:e,params:t,decoder:s,...a}){let r=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:r};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:r};const d=e.length;let f=0,m,p="";for(;f<d;){const v=f;m=Xm(e,v,m);const y=m[5];if(f=y+1,v===y)continue;const x=m[0];if(x===0){p+="/"+e.substring(v,y);continue}if(x===2){const b=t._splat;c._splat=b,c["*"]=b;const w=e.substring(v,m[1]),S=e.substring(m[4],y);if(!b){r=!0,(w||S)&&(p+="/"+w+S);continue}const C=Eh("_splat",t,s);p+="/"+w+C+S;continue}if(x===1){const b=e.substring(m[2],m[3]);!r&&!(b in t)&&(r=!0),c[b]=t[b];const w=e.substring(v,m[1]),S=e.substring(m[4],y),C=Eh(b,t,s)??"undefined";p+="/"+w+C+S;continue}if(x===3){const b=e.substring(m[2],m[3]),w=t[b];if(w==null)continue;c[b]=w;const S=e.substring(v,m[1]),C=e.substring(m[4],y),k=Eh(b,t,s)??"";p+="/"+S+k+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:r}}function mx(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function fn(e){return!!e?.isNotFound}function N_(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var hm="tsr-scroll-restoration-v1_3",C_=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function k_(){const e=N_();if(!e)return null;const t=e.getItem(hm);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=Ei(a,s)||s;try{e.setItem(hm,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Lc=k_(),__=e=>e.state.__TSR_key||e.href;function z_(e){const t=[];let s;for(;s=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(s.children,e)+1})`),e=s;return`${t.reverse().join(" > ")}`.toLowerCase()}var pu=!1;function E_({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let d;try{d=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,m=d[f];pu=!0;e:{if(a&&m&&Object.keys(m).length>0){for(const y in m){const x=m[y];if(y==="window")window.scrollTo({top:x.scrollY,left:x.scrollX,behavior:s});else if(y){const b=document.querySelector(y);b&&(b.scrollLeft=x.scrollX,b.scrollTop=x.scrollY)}}break e}const p=(c??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const x=document.getElementById(p);x&&x.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:s};if(window.scrollTo(v),r)for(const y of r){if(y==="window")continue;const x=typeof y=="function"?y():document.querySelector(y);x&&x.scrollTo(v)}}pu=!1}function R_(e,t){if(!Lc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Lc))return;e.isScrollRestorationSetup=!0,pu=!1;const s=e.options.getScrollRestorationKey||__;window.history.scrollRestoration="manual";const a=r=>{if(pu||!e.isScrollRestoring)return;let c="";if(r.target===document||r.target===window)c="window";else{const f=r.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=z_(r.target)}const d=s(e.state.location);Lc.set(f=>{const m=f[d]||={},p=m[c]||={};if(c==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(c){const v=document.querySelector(c);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",C_(a,100),!0),e.subscribe("onRendered",r=>{const c=s(r.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(E_({storageKey:hm,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Lc.set(d=>(d[c]||={},d)))})}function T_(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const s=document.getElementById(e.state.location.hash);s&&s.scrollIntoView(t)}}}function A_(e,t=String){const s=new URLSearchParams;for(const a in e){const r=e[a];r!==void 0&&s.set(a,t(r))}return s.toString()}function Rh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function O_(e){const t=new URLSearchParams(e),s=Object.create(null);for(const[a,r]of t.entries()){const c=s[a];c==null?s[a]=Rh(r):Array.isArray(c)?c.push(Rh(r)):s[a]=[c,Rh(r)]}return s}var D_=M_(JSON.parse),L_=$_(JSON.stringify,JSON.parse);function M_(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=O_(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function $_(e,t){const s=typeof t=="function";function a(r){if(typeof r=="object"&&r!==null)try{return e(r)}catch{}else if(s&&typeof r=="string")try{return t(r),e(r)}catch{}return r}return r=>{const c=A_(r,a);return c?`?${c}`:""}}var ba="__root__";function tp(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const s=new Response(null,{status:e.statusCode,headers:t});if(s.options=e,e.throw)throw s;return s}function Sn(e){return e instanceof Response&&!!e.options}function U_(e){return{input:({url:t})=>{for(const s of e)t=mm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=xS(e[s],t);return t}}}function P_(e){const t=vS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:d})=>{const f=e.caseSensitive?d.pathname:d.pathname.toLowerCase();return f===r?d.pathname="/":f.startsWith(c)&&(d.pathname=d.pathname.slice(s.length)),d},output:({url:d})=>(d.pathname=eu(["/",t,d.pathname]),d)}}function mm(e,t){const s=e?.input?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}function xS(e,t){const s=e?.output?.({url:t});if(s){if(typeof s=="string")return new URL(s);if(s instanceof URL)return s}return t}var vt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(vt||{});function bS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:d,shallowPropagate:f};function a(p,v,y){const x=v.depsTail;if(x!==void 0&&x.dep===p)return;const b=x!==void 0?x.nextDep:v.deps;if(b!==void 0&&b.dep===p){b.version=y,v.depsTail=b;return}const w=p.subsTail;if(w!==void 0&&w.version===y&&w.sub===v)return;const S=v.depsTail=p.subsTail={version:y,dep:p,sub:v,prevDep:x,nextDep:b,prevSub:w,nextSub:void 0};b!==void 0&&(b.prevDep=S),x!==void 0?x.nextDep=S:v.deps=S,w!==void 0?w.nextSub=S:p.subs=S}function r(p,v=p.sub){const y=p.dep,x=p.prevDep,b=p.nextDep,w=p.nextSub,S=p.prevSub;return b!==void 0?b.prevDep=x:v.depsTail=x,x!==void 0?x.nextDep=b:v.deps=b,w!==void 0?w.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=w:(y.subs=w)===void 0&&s(y),b}function c(p){let v=p.nextSub,y;e:do{const x=p.sub;let b=x.flags;if(b&60?b&12?b&4?!(b&48)&&m(p,x)?(x.flags=b|40,b&=1):b=0:x.flags=b&-9|32:b=0:x.flags=b|32,b&2&&t(x),b&1){const w=x.subs;if(w!==void 0){const S=(p=w).nextSub;S!==void 0&&(y={value:v,prev:y},v=S);continue}}if((p=v)!==void 0){v=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){v=p.nextSub;continue e}break}while(!0)}function d(p,v){let y,x=0,b=!1;e:do{const w=p.dep,S=w.flags;if(v.flags&16)b=!0;else if((S&17)===17){if(e(w)){const C=w.subs;C.nextSub!==void 0&&f(C),b=!0}}else if((S&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=w.deps,v=w,++x;continue}if(!b){const C=p.nextDep;if(C!==void 0){p=C;continue}}for(;x--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(p=y.value,y=y.prev):p=C,b){if(e(v)){k&&f(C),v=p.sub;continue}b=!1}else v.flags&=-33;v=p.sub;const E=p.nextDep;if(E!==void 0){p=E;continue e}}return b}while(!0)}function f(p){do{const v=p.sub,y=v.flags;(y&48)===32&&(v.flags=y|16,(y&6)===2&&t(v))}while((p=p.nextSub)!==void 0)}function m(p,v){let y=v.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let np=0,ua=0,Fo=0;const Gs=[],{link:I4,unlink:SS,propagate:B4,checkDirty:I_,shallowPropagate:q4}=bS({update(e){return e.depsTail!==void 0?G_(e):K_(e)},notify(e){let t=Fo,s=t;do if(Gs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Fo=t;s<--t;){const a=Gs[s];Gs[s++]=Gs[t],Gs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Tu(e)):V_.call(e)}});function B_(){return np}function q_(){++np}function H_(){--np||Z_()}function G_(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Tu(e)}}function K_(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function F_(e){const t=e.flags;if(t&16||t&32&&I_(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Tu(e)}}else e.flags=2}function Z_(){try{for(;ua<Fo;){const e=Gs[ua];Gs[ua++]=void 0,F_(e)}}finally{for(;ua<Fo;){const e=Gs[ua];Gs[ua++]=void 0,e.flags|=10}ua=0,Fo=0}}function V_(){this.depsTail=void 0,this.flags=0,Tu(this);const e=this.subs;e!==void 0&&SS(e)}function Tu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=SS(s,e)}function sp(e,t,s){const a=typeof e=="object",r=a?e:void 0;return{next:(a?e.next:e)?.bind(r),error:(a?e.error:t)?.bind(r),complete:(a?e.complete:s)?.bind(r)}}const pm=[];let tu=0;const{link:px,unlink:Q_,propagate:Y_,checkDirty:jS,shallowPropagate:gx}=bS({update(e){return e._update()},notify(e){pm[gm++]=e,e.flags&=~vt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=vt.Mutable|vt.Dirty,gu(e))}});let Mc=0,gm=0,ys;function gu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Q_(s,e)}function wS(){if(!(B_()>0)){for(;Mc<gm;){const e=pm[Mc];pm[Mc++]=void 0,e.notify()}Mc=0,gm=0}}function NS(e,t){const s=typeof e=="function",a=e,r={_snapshot:s?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:s?vt.None:vt.Mutable,get(){return ys!==void 0&&px(r,ys,tu),r._snapshot},subscribe(c){const d=sp(c),f={current:!1},m=J_(()=>{r.get(),f.current?d.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(c){const d=ys,f=Object.is;if(s)ys=r,++tu,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=vt.Mutable|vt.RecursedCheck);try{const m=r._snapshot,p=typeof c=="function"?c(m):c===void 0&&s?a(m):c;return m===void 0||!f(m,p)?(r._snapshot=p,!0):!1}finally{ys=d,s&&(r.flags&=~vt.RecursedCheck),gu(r)}}};return s?(r.flags=vt.Mutable|vt.Dirty,r.get=function(){const c=r.flags;if(c&vt.Dirty||c&vt.Pending&&jS(r.deps,r)){if(r._update()){const d=r.subs;d!==void 0&&gx(d)}}else c&vt.Pending&&(r.flags=c&~vt.Pending);return ys!==void 0&&px(r,ys,tu),r._snapshot}):r.set=function(c){if(r._update(c)){const d=r.subs;d!==void 0&&(Y_(d),gx(d),wS())}},r}function J_(e){const t=()=>{const a=ys;ys=s,++tu,s.depsTail=void 0,s.flags=vt.Watching|vt.RecursedCheck;try{return e()}finally{ys=a,s.flags&=~vt.RecursedCheck,gu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:vt.Watching|vt.RecursedCheck,notify(){const a=this.flags;a&vt.Dirty||a&vt.Pending&&jS(this.deps,this)?t():this.flags=vt.Watching},stop(){this.flags=vt.None,this.depsTail=void 0,gu(this)}};return t(),s}class X_{constructor(t){this.atom=NS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(sp(t))}}class W_{constructor(t){this.atom=NS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(sp(t))}}function ez(e){return typeof e=="function"?new W_(e):new X_(e)}function tz(e){try{q_(),e()}finally{H_(),wS()}}function Zo(e){let t;return tz(()=>{t=e()}),t}var ym=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Au=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),Sa=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const d=e.matches[c];if(!d)continue;const f=e.router.getMatch(d.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},yx=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(d=>d.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(d=>d.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let d=c;d>=0;d--){const f=e.matches[d];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return d}return s?c:r},Ri=(e,t,s)=>{if(!(!Sn(s)&&!fn(s)))throw Sn(s)&&s.redirectHandled&&!s.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=s,e.updateMatch(t.id,a=>({...a,status:Sn(s)?"redirected":a.status==="pending"?"success":a.status,context:Sa(e,t.index),isFetching:!1,error:s})),fn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Sn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},CS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},vx=(e,t,s)=>{const a=Sa(e,s);e.updateMatch(t,r=>({...r,context:a}))},Po=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],d=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,Ri(e,e.router.getMatch(r),s);try{d.options.onError?.(s)}catch(f){s=f,Ri(e,e.router.getMatch(r),s)}e.updateMatch(r,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:s,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Sn(s)&&!fn(s)&&(e.serialError??=s)},kS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Au(e,t)&&(s.options.loader||s.options.beforeLoad||zS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{ym(e)},r);a._nonReactive.pendingTimeout=c}},nz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;kS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ri(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},sz=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=Tr(()=>{c?.resolve(),c=void 0});const{paramsError:d,searchError:f}=r;d&&Po(e,s,d,"PARSE_PARAMS"),f&&Po(e,s,f,"VALIDATE_SEARCH"),kS(e,t,a,r);const m=new AbortController;let p=!1;const v=()=>{p||(p=!0,e.updateMatch(t,_=>({..._,isFetching:"beforeLoad",fetchCount:_.fetchCount+1,abortController:m})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,_=>({..._,isFetching:!1}))};if(!a.options.beforeLoad){Zo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=Tr();const x={...Sa(e,s,!1),...r.__routeContext},{search:b,params:w,cause:S}=r,C=Au(e,t),k={search:b,abortController:m,params:w,preload:C,context:x,location:e.location,navigate:_=>e.router.navigate({..._,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},E=_=>{if(_===void 0){Zo(()=>{v(),y()});return}(Sn(_)||fn(_))&&(v(),Po(e,s,_,"BEFORE_LOAD")),Zo(()=>{v(),e.updateMatch(t,L=>({...L,__beforeLoadContext:_})),y()})};let R;try{if(R=a.options.beforeLoad(k),Wo(R))return v(),R.catch(_=>{Po(e,s,_,"BEFORE_LOAD")}).then(E)}catch(_){v(),Po(e,s,_,"BEFORE_LOAD")}E(R)},iz=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),d=()=>sz(e,s,t,r),f=()=>{if(CS(e,s))return;const m=nz(e,s,r);return Wo(m)?m.then(d):d()};return c()},az=(e,t,s)=>{const a=e.router.getMatch(t);if(!a||!s.options.head&&!s.options.scripts&&!s.options.headers)return;const r={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([s.options.head?.(r),s.options.scripts?.(r),s.options.headers?.(r)]).then(([c,d,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:d,styles:c?.styles}))},_S=(e,t,s,a,r)=>{const c=t[a-1],{params:d,loaderDeps:f,abortController:m,cause:p}=e.router.getMatch(s),v=Sa(e,a),y=Au(e,s);return{params:d,deps:f,preload:!!y,parentMatchPromise:c,abortController:m,context:v,location:e.location,navigate:x=>e.router.navigate({...x,_fromLocation:e.location}),cause:y?"preload":p,route:r,...e.router.options.additionalContext}},xx=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(s_??e.router.isServer)||c.ssr===!0)&&el(r);const d=r.options.loader,f=typeof d=="function"?d:d?.handler,m=f?.(_S(e,t,s,a,r)),p=!!f&&Wo(m);if((p||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(s,y=>({...y,isFetching:"loader"})),f){const y=p?await m:m;Ri(e,e.router.getMatch(s),y),y!==void 0&&e.updateMatch(s,x=>({...x,loaderData:y}))}r._lazyPromise&&await r._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,r._componentsPromise&&await r._componentsPromise,e.updateMatch(s,y=>({...y,error:void 0,context:Sa(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(d){let f=d;if(f?.name==="AbortError"){if(c.abortController.signal.aborted){c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loaderPromise=void 0;return}e.updateMatch(s,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:Sa(e,a)}));return}const m=c._nonReactive.minPendingPromise;m&&await m,fn(d)&&await r.options.notFoundComponent?.preload?.(),Ri(e,e.router.getMatch(s),d);try{r.options.onError?.(d)}catch(p){f=p,Ri(e,e.router.getMatch(s),p)}!Sn(f)&&!fn(f)&&await el(r,["errorComponent"]),e.updateMatch(s,p=>({...p,error:f,context:Sa(e,a),status:"error",isFetching:!1}))}}catch(c){const d=e.router.getMatch(s);d&&(d._nonReactive.loaderPromise=void 0),Ri(e,d,c)}},rz=async(e,t,s)=>{async function a(b,w,S,C,k){const E=Date.now()-w.updatedAt,R=b?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,_=k.options.shouldReload,L=typeof _=="function"?_(_S(e,t,r,s,k)):_,{status:M,invalid:T}=C,A=E>R&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);d=M==="success"&&(T||(L??A)),b&&k.options.preload===!1||(d&&!e.sync&&v?(f=!0,(async()=>{try{await xx(e,t,r,s,k);const P=e.router.getMatch(r);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0,P._nonReactive.loadPromise=void 0}catch(P){Sn(P)&&await e.router.navigate(P.options)}})()):M!=="success"||d?await xx(e,t,r,s,k):vx(e,r,s))}const{id:r,routeId:c}=e.matches[s];let d=!1,f=!1;const m=e.router.looseRoutesById[c],p=m.options.loader,v=((typeof p=="function"?void 0:p?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(CS(e,r)){if(!e.router.getMatch(r))return e.matches[s];vx(e,r,s)}else{const b=e.router.getMatch(r),w=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Au(e,r);if(b._nonReactive.loaderPromise){if(b.status==="success"&&!e.sync&&!b.preload&&v)return b;await b._nonReactive.loaderPromise;const C=e.router.getMatch(r),k=C._nonReactive.error||C.error;k&&Ri(e,C,k),C.status==="pending"&&await a(S,b,w,C,m)}else{const C=S&&!e.router.state.matches.some(E=>E.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=Tr(),C!==k.preload&&e.updateMatch(r,E=>({...E,preload:C})),await a(S,b,w,k,m)}}const y=e.router.getMatch(r);f||(y._nonReactive.loaderPromise?.resolve(),y._nonReactive.loadPromise?.resolve(),y._nonReactive.loadPromise=void 0),clearTimeout(y._nonReactive.pendingTimeout),y._nonReactive.pendingTimeout=void 0,f||(y._nonReactive.loaderPromise=void 0),y._nonReactive.dehydrated=void 0;const x=f?y.isFetching:!1;return x!==y.isFetching||y.invalid!==!1?(e.updateMatch(r,b=>({...b,isFetching:x,invalid:!1})),e.router.getMatch(r)):y};async function bx(e){const t=e,s=[];t.router.state.matches.some(x=>x._forcePending)&&ym(t);let a;for(let x=0;x<t.matches.length;x++){try{const b=iz(t,x);Wo(b)&&await b}catch(b){if(Sn(b))throw b;if(fn(b))a=b;else if(!t.preload)throw b;break}if(t.serialError)break}const r=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?yx(t,a):void 0,d=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,m;for(let x=0;x<d;x++)s.push(rz(t,s,x));try{await Promise.all(s)}catch{const x=await Promise.allSettled(s);for(const b of x){if(b.status!=="rejected")continue;const w=b.reason;if(Sn(w))throw w;fn(w)?f??=w:m??=w}if(m!==void 0)throw m}const p=f??(a&&!t.preload?a:void 0);let v=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!p&&a&&t.preload)return t.matches;if(p){const x=yx(t,p);Ui(x!==void 0);const b=t.matches[x],w=t.router.looseRoutesById[b.routeId],S=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&S&&(w.options.notFoundComponent=S),p.routeId=b.routeId;const C=b.routeId===t.router.routeTree.id;t.updateMatch(b.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),v=x,await el(w,["notFoundComponent"])}else if(!t.preload){const x=t.matches[0];x.globalNotFound||t.router.getMatch(x.id)?.globalNotFound&&t.updateMatch(x.id,b=>({...b,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const x=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await el(x,["errorComponent"])}for(let x=0;x<=v;x++){const{id:b,routeId:w}=t.matches[x],S=t.router.looseRoutesById[w];try{const C=az(t,b,S);if(C){const k=await C;t.updateMatch(b,E=>({...E,...k}))}}catch(C){console.error(`Error executing head for route ${w}:`,C)}}const y=ym(t);if(Wo(y)&&await y,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Sx(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function el(e,t=nu){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:r,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const s=()=>e._componentsLoaded?void 0:t===nu?(()=>{if(e._componentsPromise===void 0){const a=Sx(e,nu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Sx(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function zS(e){for(const t of nu)if(e.options[t]?.preload)return!0;return!1}var nu=["component","errorComponent","pendingComponent","notFoundComponent"],Li="__TSR_index",jx="popstate",wx="beforeunload";function oz(e){let t=e.getLocation();const s=new Set,a=d=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:d}))},r=d=>{e.notifyOnIndexChange??!0?a(d):t=e.getLocation()},c=async({task:d,navigateOpts:f,...m})=>{if(f?.ignoreBlocker??!1){d();return}const p=e.getBlockers?.()??[],v=m.type==="PUSH"||m.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const y of p){const x=yu(m.path,m.state);if(await y.blockerFn({currentLocation:t,nextLocation:x,action:m.type})){e.onBlocked?.();return}}d()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:d=>(s.add(d),()=>{s.delete(d)}),push:(d,f,m)=>{const p=t.state[Li];f=Nx(p+1,f),c({task:()=>{e.pushState(d,f),a({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:d,state:f})},replace:(d,f,m)=>{const p=t.state[Li];f=Nx(p,f),c({task:()=>{e.replaceState(d,f),a({type:"REPLACE"})},navigateOpts:m,type:"REPLACE",path:d,state:f})},go:(d,f)=>{c({task:()=>{e.go(d),r({type:"GO",index:d})},navigateOpts:f,type:"GO"})},back:d=>{c({task:()=>{e.back(d?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:d,type:"BACK"})},forward:d=>{c({task:()=>{e.forward(d?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:d,type:"FORWARD"})},canGoBack:()=>t.state[Li]!==0,createHref:d=>e.createHref(d),block:d=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,d]),()=>{const m=e.getBlockers?.()??[];e.setBlockers?.(m.filter(p=>p!==d))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function Nx(e,t){t||(t={});const s=ip();return{...t,key:s,__TSR_key:s,[Li]:e}}function lz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,d=A=>r=A,f=(A=>A),m=(()=>yu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=ip();t.history.replaceState({[Li]:0,key:A,__TSR_key:A},"")}let p=m(),v,y=!1,x=!1,b=!1,w=!1;const S=()=>p;let C,k;const E=()=>{C&&(T._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),T._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},R=(A,P,J)=>{const Q=f(P);k||(v=p),p=yu(P,J),C={href:Q,state:J,isPush:C?.isPush||A==="push"},k||(k=Promise.resolve().then(()=>E()))},_=A=>{p=m(),T.notify({type:A})},L=async()=>{if(x){x=!1;return}const A=m(),P=A.state[Li]-p.state[Li],J=P===1,Q=P===-1,se=!J&&!Q||y;y=!1;const pe=se?"GO":Q?"BACK":"FORWARD",ke=se?{type:"GO",index:P}:{type:Q?"BACK":"FORWARD"};if(b)b=!1;else{const je=c();if(typeof document<"u"&&je.length){for(const B of je)if(await B.blockerFn({currentLocation:p,nextLocation:A,action:pe})){x=!0,t.history.go(1),T.notify(ke);return}}}p=m(),T.notify(ke)},M=A=>{if(w){w=!1;return}let P=!1;const J=c();if(typeof document<"u"&&J.length)for(const Q of J){const se=Q.enableBeforeUnload??!0;if(se===!0){P=!0;break}if(typeof se=="function"&&se()===!0){P=!0;break}}if(P)return A.preventDefault(),A.returnValue=""},T=oz({getLocation:S,getLength:()=>t.history.length,pushState:(A,P)=>R("push",A,P),replaceState:(A,P)=>R("replace",A,P),back:A=>(A&&(b=!0),w=!0,t.history.back()),forward:A=>{A&&(b=!0),w=!0,t.history.forward()},go:A=>{y=!0,t.history.go(A)},createHref:A=>f(A),flush:E,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(wx,M,{capture:!0}),t.removeEventListener(jx,L)},onBlocked:()=>{v&&p!==v&&(p=v)},getBlockers:c,setBlockers:d,notifyOnIndexChange:!1});return t.addEventListener(wx,M,{capture:!0}),t.addEventListener(jx,L),t.history.pushState=function(...A){const P=s.apply(t.history,A);return T._ignoreSubscribers||_("PUSH"),P},t.history.replaceState=function(...A){const P=a.apply(t.history,A);return T._ignoreSubscribers||_("REPLACE"),P},T}function cz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function yu(e,t){const s=cz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=ip();return{href:s,pathname:s.substring(0,a>0?r>0?Math.min(a,r):a:r>0?r:s.length),hash:a>-1?s.substring(a):"",search:r>-1?s.slice(r,a===-1?void 0:a):"",state:t||{[Li]:0,key:c,__TSR_key:c}}}function ip(){return(Math.random()+1).toString(36).substring(7)}function ja(e){const t=e.resolvedLocation,s=e.location;return{fromLocation:t,toLocation:s,pathChanged:t?.pathname!==s.pathname,hrefChanged:t?.href!==s.href,hashChanged:t?.hash!==s.hash}}function uz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var dz=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=t=>t(),this.update=t=>{const s=this.options,a=this.basepath??s?.basepath??"/",r=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=w_(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=lz()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let p;this.resolvePathCache=hu(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=ez(hz(this.latestLocation)),R_(this));let d=!1;const f=this.options.basepath??"/",m=this.options.rewrite;if(r||a!==f||c!==m){this.basepath=f;const p=[],v=vS(f);v&&v!=="/"&&p.push(P_({basepath:f})),m&&p.push(m),this.rewrite=p.length===0?void 0:p.length===1?p[0]:U_(p),this.history&&this.updateLatestLocation(),d=!0}d&&this.__store&&this.__store.setState(p=>({...p,location:this.latestLocation})),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const t=y_(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&f_(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,s)=>{const a={eventType:t,fn:s};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(s=>{s.eventType===t.type&&s.fn(t)})},this.parseLocation=(t,s)=>{const a=({pathname:f,search:m,hash:p,href:v,state:y})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(m),k=this.options.stringifySearch(C);return{href:f+k+p,publicHref:v,pathname:$o(f).path,external:!1,searchStr:k,search:ca(s?.search,C),hash:$o(p.slice(1)).path,state:ma(s?.state,y)}}const x=new URL(v,this.origin),b=mm(this.rewrite,x),w=this.options.parseSearch(b.search),S=this.options.stringifySearch(w);return b.search=S,{href:b.href.replace(b.origin,""),publicHref:v,pathname:$o(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:S,search:ca(s?.search,w),hash:$o(b.hash.slice(1)).path,state:ma(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:d}=r.state;if(c&&(!d||d===this.tempLocationKey)){const f=a(c);return f.state.key=r.state.key,f.state.__TSR_key=r.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:r}}return r},this.resolvePathWithBase=(t,s)=>j_({base:t,to:ep(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,s,a)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:s},a):this.matchRoutesInternal(t,s),this.getMatchedRoutes=t=>mz({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const s=this.getMatch(t);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const s=(r={})=>{const c=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??d.fullPath,m=this.resolvePathWithBase(f,"."),p=d.search,v=Object.assign(Object.create(null),d.params),y=r.to?this.resolvePathWithBase(m,`${r.to}`):this.resolvePathWithBase(m,"."),x=r.params===!1||r.params===null?Object.create(null):(r.params??!0)===!0?v:Object.assign(v,Ei(r.params,v)),b=this.getMatchedRoutes(y);let w=b.matchedRoutes;if((!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(x).length>0)for(const P of w){const J=P.options.params?.stringify??P.options.stringifyParams;if(J)try{Object.assign(x,J(x))}catch{}}const S=t.leaveParams?y:$o(hx({path:y,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=p;if(t._includeValidateSearch&&this.options.search?.strict){const P={};w.forEach(J=>{if(J.options.validateSearch)try{Object.assign(P,su(J.options.validateSearch,{...P,...C}))}catch{}}),C=P}C=pz({search:C,dest:r,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),C=ca(p,C);const k=this.options.stringifySearch(C),E=r.hash===!0?c.hash:r.hash?Ei(r.hash,c.hash):void 0,R=E?`#${E}`:"";let _=r.state===!0?c.state:r.state?Ei(r.state,c.state):{};_=ma(c.state,_);const L=`${S}${k}${R}`;let M,T,A=!1;if(this.rewrite){const P=new URL(L,this.origin),J=xS(this.rewrite,P);M=P.href.replace(P.origin,""),J.origin!==this.origin?(T=J.href,A=!0):T=J.pathname+J.search+J.hash}else M=c_(L),T=M;return{publicHref:T,href:M,pathname:S,search:C,searchStr:k,state:_,hash:E??"",external:A,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const d=s(r);let f=c?s(c):void 0;if(!f){const m=Object.create(null);if(this.options.routeMasks){const p=h_(d.pathname,this.processedTree);if(p){Object.assign(m,p.rawParams);const{from:v,params:y,...x}=p.route,b=y===!1||y===null?Object.create(null):(y??!0)===!0?m:Object.assign(m,Ei(y,m));c={from:t.from,...x,params:b},f=s(c)}}}return f&&(d.maskedLocation=f),d};return t.mask?a(t,{from:t.from,...t.mask}):a(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:s,...a})=>{const r=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const m=xa(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),m},c=Di(this.latestLocation.href)===Di(a.href);let d=this.commitLocationPromise;if(this.commitLocationPromise=Tr(()=>{d?.resolve(),d=void 0}),c&&r())this.load();else{let{maskedLocation:f,hashScrollIntoView:m,...p}=a;f&&(p={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=m??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[a.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:s})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:s,hashScrollIntoView:a,viewTransition:r,ignoreBlocker:c,href:d,...f}={})=>{if(d){const v=this.history.location.state.__TSR_index,y=yu(d,{__TSR_index:t?v:v+1}),x=new URL(y.pathname,this.origin);f.to=mm(this.rewrite,x).pathname,f.search=this.options.parseSearch(y.search),f.hash=y.hash.slice(1)}const m=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=m;const p=this.commitLocation({...m,viewTransition:r,replace:t,resetScroll:s,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:t,reloadDocument:s,href:a,publicHref:r,...c})=>{let d=!1;if(a)try{new URL(`${a}`),d=!0}catch{}if(d&&!s&&(s=!0),s){if(t!==void 0||!a){const m=this.buildLocation({to:t,...c});a=a??m.publicHref,r=r??m.publicHref}const f=!d&&r?r:a;if(fu(f,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const m=this.history.getBlockers?.()??[];for(const p of m)if(p?.blockerFn&&await p.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...c,href:a,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:s.cachedMatches.filter(a=>!t.some(r=>r.id===a.id))}))},this.load=async t=>{let s,a,r;const c=this.state.resolvedLocation??this.state.location;for(r=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const m=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ja({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...ja({resolvedLocation:p,location:m})}),await bx({router:this,sync:t?.sync,forceStaleReload:c.href===m.href,matches:this.state.pendingMatches,location:m,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let v=[],y=[],x=[],b=[];Zo(()=>{this.__store.setState(w=>{const S=w.matches,C=w.pendingMatches||w.matches;return v=S.filter(k=>!C.some(E=>E.id===k.id)),y=S.filter(k=>!C.some(E=>E.routeId===k.routeId)),x=C.filter(k=>!S.some(E=>E.routeId===k.routeId)),b=C.filter(k=>S.some(E=>E.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[x,"onEnter"],[b,"onStay"]].forEach(([w,S])=>{w.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(m){Sn(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):fn(m)&&(a=m),this.__store.setState(p=>({...p,statusCode:s?s.status:a?404:p.matches.some(v=>v.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let d;this.hasNotFoundMatch()?d=404:this.__store.state.matches.some(f=>f.status==="error")&&(d=500),d!==void 0&&this.__store.setState(f=>({...f,statusCode:d}))},this.startViewTransition=t=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,c=this.state.resolvedLocation,d=typeof s.types=="function"?s.types(ja({resolvedLocation:c,location:r})):s.types;if(d===!1){t();return}a={update:t,types:d}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,s)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(r=>r.id===t)?"pendingMatches":this.state.matches.some(r=>r.id===t)?"matches":this.state.cachedMatches.some(r=>r.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(r=>({...r,cachedMatches:uz(r.cachedMatches.map(c=>c.id===t?s(c):c))})):this.__store.setState(r=>({...r,[a]:r[a]?.map(c=>c.id===t?s(c):c)})))})},this.getMatch=t=>{const s=a=>a.id===t;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=t=>{const s=a=>t?.filter?.(a)??!0?{...a,invalid:!0,...t?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(s),cachedMatches:a.cachedMatches.map(s),pendingMatches:a.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const s=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),r=this.getParsedLocationHref(a);t.options.href=r,t.headers.set("Location",r)}else if(s)try{const a=new URL(s);if(this.origin&&a.origin===this.origin){const r=a.pathname+a.search+a.hash;t.options.href=r,t.headers.set("Location",r)}}catch{}if(t.options.href&&!t.options._builtLocation&&fu(t.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return t.headers.get("Location")||t.headers.set("Location",t.options.href),t},this.clearCache=t=>{const s=t?.filter;s!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(r=>!s(r))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=s=>{const a=this.looseRoutesById[s.routeId];if(!a.options.loader)return!0;const r=(s.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:t})},this.loadRouteChunk=el,this.preloadRoute=async t=>{const s=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:t});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(d=>d.id)),c=new Set([...r,...this.state.cachedMatches.map(d=>d.id)]);Zo(()=>{a.forEach(d=>{c.has(d.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,d]}))})});try{return a=await bx({router:this,matches:a,location:s,preload:!0,updateMatch:(d,f)=>{r.has(d)?a=a.map(m=>m.id===d?f(m):m):this.updateMatch(d,f)}}),a}catch(d){if(Sn(d))return d.options.reloadDocument?void 0:await this.preloadRoute({...d.options,_fromLocation:s});fn(d)||console.error(d);return}},this.matchRoute=(t,s)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},r=this.buildLocation(a);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=m_(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!d||t.params&&!xa(d.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?xa(c.search,r.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(t=>t.status==="notFound"||t.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??L_,parseSearch:e.parseSearch??D_,protocolAllowlist:e.protocolAllowlist??l_}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:s}){this.routesById=e,this.routesByPath=t,this.processedTree=s;const a=this.options.notFoundRoute;a&&(a.init({originalIndex:99999999999}),this.routesById[a.id]=a)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){const s=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:r,parsedParams:c}=s;let{matchedRoutes:d}=s,f=!1;(a?a.path!=="/"&&r["**"]:Di(e.pathname))&&(this.options.notFoundRoute?d=[...d,this.options.notFoundRoute]:f=!0);const m=f?yz(this.options.notFoundMode,d):void 0,p=new Array(d.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<d.length;y++){const x=d[y],b=p[y-1];let w,S,C;{const pe=b?.search??e.search,ke=b?._strictSearch??void 0;try{const je=su(x.options.validateSearch,{...pe})??void 0;w={...pe,...je},S={...ke,...je},C=void 0}catch(je){let B=je;if(je instanceof vu||(B=new vu(je.message,{cause:je})),t?.throwOnError)throw B;w=pe,S={},C=B}}const k=x.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:R,usedParams:_}=hx({path:x.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+R+E,M=this.getMatch(L),T=v.get(x.id),A=M?._strictParams??_;let P;if(!M)try{Cx(x,_,c,A)}catch(pe){if(fn(pe)||Sn(pe)?P=pe:P=new fz(pe.message,{cause:pe}),t?.throwOnError)throw P}Object.assign(r,A);const J=T?"stay":"enter";let Q;if(M)Q={...M,cause:J,params:T?.params??r,_strictParams:A,search:ca(T?T.search:M.search,w),_strictSearch:S};else{const pe=x.options.loader||x.options.beforeLoad||x.lazyFn||zS(x)?"pending":"success";Q={id:L,ssr:x.options.ssr,index:y,routeId:x.id,params:T?.params??r,_strictParams:A,pathname:R,updatedAt:Date.now(),search:T?ca(T.search,w):w,_strictSearch:S,searchError:void 0,status:pe,isFetching:!1,error:void 0,paramsError:P,__routeContext:void 0,_nonReactive:{loadPromise:Tr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:J,loaderDeps:T?ma(T.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}t?.preload||(Q.globalNotFound=m===x.id),Q.searchError=C;const se=this.getParentContext(b);Q.context={...se,...Q.__routeContext,...Q.__beforeLoadContext},p[y]=Q}for(let y=0;y<p.length;y++){const x=p[y],b=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),S=v.get(x.routeId);if(x.params=S?ca(S.params,r):r,!w){const C=p[y-1],k=this.getParentContext(C);if(b.options.context){const E={deps:x.loaderDeps,params:x.params,context:k??{},location:e,navigate:R=>this.navigate({...R,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:p,routeId:b.id};x.__routeContext=b.options.context(E)??void 0}x.context={...k,...x.__routeContext,...x.__beforeLoadContext}}}return p}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:s,parsedParams:a}=this.getMatchedRoutes(e.pathname),r=Xo(t),c={...e.search};for(const p of t)try{Object.assign(c,su(p.options.validateSearch,c))}catch{}const d=Xo(this.state.matches),f=d&&d.routeId===r.id&&e.pathname===this.state.location.pathname;let m;if(f)m=d.params;else{const p=Object.assign(Object.create(null),s);for(const v of t)try{Cx(v,s,a??{},p)}catch{}m=p}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:m}}},vu=class extends Error{},fz=class extends Error{};function hz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function su(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new vu("Async validation not supported");if(s.issues)throw new vu(JSON.stringify(s.issues,void 0,2),{cause:s});return s.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function mz({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Di(e);let c,d;const f=p_(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),d=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:d}}function pz({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return gz(s)(e,t,a??!1)}function gz(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const r of e){if("search"in r.options)r.options.search?.middlewares&&t.middlewares.push(...r.options.search.middlewares);else if(r.options.preSearchFilters||r.options.postSearchFilters){const c=({search:d,next:f})=>{let m=d;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(m=r.options.preSearchFilters.reduce((v,y)=>y(v),d));const p=f(m);return"postSearchFilters"in r.options&&r.options.postSearchFilters?r.options.postSearchFilters.reduce((v,y)=>y(v),p):p};t.middlewares.push(c)}if(r.options.validateSearch){const c=({search:d,next:f})=>{const m=f(d);if(!t._includeValidateSearch)return m;try{return{...m,...su(r.options.validateSearch,m)??void 0}}catch{return m}};t.middlewares.push(c)}}const s=({search:r})=>{const c=t.dest;return c.search?c.search===!0?r:Ei(c.search,r):{}};t.middlewares.push(s);const a=(r,c,d)=>{if(r>=d.length)return c;const f=d[r];return f({search:c,next:p=>a(r+1,p,d)})};return function(c,d,f){return t.dest=d,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function yz(e,t){if(e!=="root")for(let s=t.length-1;s>=0;s--){const a=t[s];if(a.children)return a.id}return ba}function Cx(e,t,s,a){const r=e.options.params?.parse??e.options.parseParams;if(r)if(e.options.skipRouteOnParseError)for(const c in t)c in s&&(a[c]=s[c]);else{const c=r(a);Object.assign(a,c)}}var vz="Error preloading route! ☝️",ES=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{this.originalIndex=t.originalIndex;const s=this.options,a=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=ba:this.parentRoute||Ui(!1);let r=a?ba:s?.path;r&&r!=="/"&&(r=yS(r));const c=s?.id||r;let d=a?ba:eu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),d!=="__root__"&&(d=eu(["/",d]));const f=d==="__root__"?"/":eu([this.parentRoute.fullPath,r]);this._path=r,this._id=d,this._fullPath=f,this._to=Di(f)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>tp({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}},xz=class extends ES{constructor(e){super(e)}};function ap(e){const t=e.errorComponent??rp;return o.jsx(bz,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?N.createElement(t,{error:s,reset:a}):e.children})}var bz=class extends N.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}};function rp({error:e}){const[t,s]=N.useState(!1);return o.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[o.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),o.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>s(a=>!a),children:t?"Hide Error":"Show Error"})]}),o.jsx("div",{style:{height:".25rem"}}),t?o.jsx("div",{children:o.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?o.jsx("code",{children:e.message}):null})}):null]})}function Sz({children:e,fallback:t=null}){return RS()?o.jsx(is.Fragment,{children:e}):o.jsx(is.Fragment,{children:t})}function RS(){return is.useSyncExternalStore(jz,()=>!0,()=>!1)}function jz(){return()=>{}}var TS=N.createContext(null);function Zn(e){const t=N.useContext(TS);return e?.warn,t}var Th={exports:{}},Ah={},Oh={exports:{}},Dh={};var kx;function wz(){if(kx)return Dh;kx=1;var e=ol();function t(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var s=typeof Object.is=="function"?Object.is:t,a=e.useState,r=e.useEffect,c=e.useLayoutEffect,d=e.useDebugValue;function f(y,x){var b=x(),w=a({inst:{value:b,getSnapshot:x}}),S=w[0].inst,C=w[1];return c(function(){S.value=b,S.getSnapshot=x,m(S)&&C({inst:S})},[y,b,x]),r(function(){return m(S)&&C({inst:S}),y(function(){m(S)&&C({inst:S})})},[y]),d(b),b}function m(y){var x=y.getSnapshot;y=y.value;try{var b=x();return!s(y,b)}catch{return!0}}function p(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Dh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Dh}var _x;function Nz(){return _x||(_x=1,Oh.exports=wz()),Oh.exports}var zx;function Cz(){if(zx)return Ah;zx=1;var e=ol(),t=Nz();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=t.useSyncExternalStore,c=e.useRef,d=e.useEffect,f=e.useMemo,m=e.useDebugValue;return Ah.useSyncExternalStoreWithSelector=function(p,v,y,x,b){var w=c(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=f(function(){function k(M){if(!E){if(E=!0,R=M,M=x(M),b!==void 0&&S.hasValue){var T=S.value;if(b(T,M))return _=T}return _=M}if(T=_,a(R,M))return T;var A=x(M);return b!==void 0&&b(T,A)?(R=M,T):(R=M,_=A)}var E=!1,R,_,L=y===void 0?null:y;return[function(){return k(v())},L===null?void 0:function(){return k(L())}]},[v,y,x,b]);var C=r(p,w[0],w[1]);return d(function(){S.hasValue=!0,S.value=C},[C]),m(C),C},Ah}var Ex;function kz(){return Ex||(Ex=1,Th.exports=Cz()),Th.exports}var _z=kz();function zz(e,t){return e===t}function Ez(e,t,s=zz){const a=N.useCallback(d=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(d);return f},[e]),r=N.useCallback(()=>e?.get(),[e]);return _z.useSyncExternalStoreWithSelector(a,r,r,t,s)}function jn(e){const t=Zn({warn:e?.router===void 0}),s=e?.router||t,a=N.useRef(void 0);return Ez(s.__store,r=>{if(e?.select){if(e.structuralSharing??s.options.defaultStructuralSharing){const c=ma(a.current,e.select(r));return a.current=c,c}return e.select(r)}return r})}var Ou=N.createContext(void 0),Rz=N.createContext(void 0);function Bi(e){const t=N.useContext(e.from?Rz:Ou);return jn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Ui(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function op(e){return Bi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function lp(e){const{select:t,...s}=e;return Bi({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Du(e){return Bi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const s=e.strict===!1?t.params:t._strictParams;return e.select?e.select(s):s}})}function Lu(e){return Bi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function ka(e){const t=Zn();return N.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function cp(e){return Bi({...e,select:t=>e.select?e.select(t.context):t.context})}var up=Jb();const Tz=Yb(up);function Az(e,t){const s=Zn(),a=n_(t),{activeProps:r,inactiveProps:c,activeOptions:d,to:f,preload:m,preloadDelay:p,hashScrollIntoView:v,replace:y,startTransition:x,resetScroll:b,viewTransition:w,children:S,target:C,disabled:k,style:E,className:R,onClick:_,onBlur:L,onFocus:M,onMouseEnter:T,onMouseLeave:A,onTouchStart:P,ignoreBlocker:J,params:Q,search:se,hash:pe,state:ke,mask:je,reloadDocument:B,unsafeRelative:G,from:oe,_fromLocation:q,...X}=e,O=RS(),F=jn({select:ze=>{const $e=ze.matches[ze.matches.length-1];return{search:$e?.search,hash:ze.location.hash,path:$e?.pathname}},structuralSharing:!0}),ie=e.from,re=N.useMemo(()=>({...e,from:ie}),[s,F,ie,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ue=N.useMemo(()=>s.buildLocation({...re}),[s,re]),he=ue.maskedLocation?ue.maskedLocation.publicHref:ue.publicHref,de=ue.maskedLocation?ue.maskedLocation.external:ue.external,Me=N.useMemo(()=>Uz(he,de,s.history,k),[k,de,he,s.history]),ge=N.useMemo(()=>{if(Me?.external)return fu(Me.href,s.protocolAllowlist)?void 0:Me.href;if(!Pz(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),fu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Me,s.protocolAllowlist]),Ze=jn({select:ze=>{if(ge)return!1;if(d?.exact){if(!S_(ze.location.pathname,ue.pathname,s.basepath))return!1}else{const $e=mu(ze.location.pathname,s.basepath),pt=mu(ue.pathname,s.basepath);if(!($e.startsWith(pt)&&($e.length===pt.length||$e[pt.length]==="/")))return!1}return(d?.includeSearch??!0)&&!xa(ze.location.search,ue.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?O&&ze.location.hash===ue.hash:!0}}),it=Ze?Ei(r,{})??Oz:Lh,me=Ze?Lh:Ei(c,{})??Lh,We=[R,it.className,me.className].filter(Boolean).join(" "),dt=(E||it.style||me.style)&&{...E,...it.style,...me.style},[sn,kt]=N.useState(!1),an=N.useRef(!1),Vt=e.reloadDocument||ge?!1:m??s.options.defaultPreload,_t=p??s.options.defaultPreloadDelay??0,zt=N.useCallback(()=>{s.preloadRoute({...re,_builtLocation:ue}).catch(ze=>{console.warn(ze),console.warn(vz)})},[s,re,ue]);t_(a,N.useCallback(ze=>{ze?.isIntersecting&&zt()},[zt]),$z,{disabled:!!k||Vt!=="viewport"}),N.useEffect(()=>{an.current||!k&&Vt==="render"&&(zt(),an.current=!0)},[k,zt,Vt]);const mn=ze=>{const $e=ze.currentTarget.getAttribute("target"),pt=C!==void 0?C:$e;if(!k&&!Iz(ze)&&!ze.defaultPrevented&&(!pt||pt==="_self")&&ze.button===0){ze.preventDefault(),up.flushSync(()=>{kt(!0)});const rn=s.subscribe("onResolved",()=>{rn(),kt(!1)});s.navigate({...re,replace:y,resetScroll:b,hashScrollIntoView:v,startTransition:x,viewTransition:w,ignoreBlocker:J})}};if(ge)return{...X,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...E&&{style:E},...R&&{className:R},..._&&{onClick:_},...L&&{onBlur:L},...M&&{onFocus:M},...T&&{onMouseEnter:T},...A&&{onMouseLeave:A},...P&&{onTouchStart:P}};const le=ze=>{if(k||Vt!=="intent")return;if(!_t){zt();return}const $e=ze.currentTarget;if(Io.has($e))return;const pt=setTimeout(()=>{Io.delete($e),zt()},_t);Io.set($e,pt)},Be=ze=>{k||Vt!=="intent"||zt()},qe=ze=>{if(k||!Vt||!_t)return;const $e=ze.currentTarget,pt=Io.get($e);pt&&(clearTimeout(pt),Io.delete($e))};return{...X,...it,...me,href:Me?.href,ref:a,onClick:pr([_,mn]),onBlur:pr([L,qe]),onFocus:pr([M,le]),onMouseEnter:pr([T,le]),onMouseLeave:pr([A,qe]),onTouchStart:pr([P,Be]),disabled:!!k,target:C,...dt&&{style:dt},...We&&{className:We},...k&&Dz,...Ze&&Lz,...O&&sn&&Mz}}var Lh={},Oz={className:"active"},Dz={role:"link","aria-disabled":!0},Lz={"data-status":"active","aria-current":"page"},Mz={"data-transitioning":"transitioning"},Io=new WeakMap,$z={rootMargin:"100px"},pr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function Uz(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function Pz(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var yt=N.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=Az(a,t),d=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...m}=c;return N.createElement("a",m,d)}return N.createElement(s,c,d)});function Iz(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Bz=class extends ES{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>cp({...t,from:this.id}),this.useSearch=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>lp({...t,from:this.id}),this.useLoaderData=t=>op({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>o.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Vn(e){return new Bz(e)}function qz(){return e=>Gz(e)}var Hz=class extends xz{constructor(e){super(e),this.useMatch=t=>Bi({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>cp({...t,from:this.id}),this.useSearch=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>lp({...t,from:this.id}),this.useLoaderData=t=>op({...t,from:this.id}),this.useNavigate=()=>ka({from:this.fullPath}),this.Link=is.forwardRef((t,s)=>o.jsx(yt,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Gz(e){return new Hz(e)}function Rx(e){return typeof e=="object"?new Tx(e,{silent:!0}).createRoute(e):new Tx(e,{silent:!0}).createRoute}var Tx=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=Vn(s);return a.isRoot=!1,a},this.silent=t?.silent}},Ax=class{constructor(e){this.useMatch=t=>Bi({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>cp({...t,from:this.options.id}),this.useSearch=t=>Lu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Du({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>lp({...t,from:this.options.id}),this.useLoaderData=t=>op({...t,from:this.options.id}),this.useNavigate=()=>ka({from:Zn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Ox(e){return typeof e=="object"?new Ax(e):t=>new Ax({id:e,...t})}function Kz(e){const t=jn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return o.jsx(ap,{getResetKey:()=>t,onCatch:(s,a)=>{if(fn(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(fn(s))return e.fallback?.(s);throw s},children:e.children})}function Fz(){return o.jsx("p",{children:"Not Found"})}function Sr(e){return o.jsx(o.Fragment,{children:e.children})}function AS(e,t,s){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{...s}):o.jsx(Fz,{})}function Zz(){return Zn().isScrollRestoring,null}var OS=N.memo(function({matchId:t}){const s=Zn(),a=jn({select:w=>{const S=w.matches.findIndex(k=>k.id===t),C=w.matches[S];return Ui(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,d=c?o.jsx(c,{}):null,f=r.options.errorComponent??s.options.defaultErrorComponent,m=r.options.onCatch??s.options.defaultOnCatch,p=r.isRoot?r.options.notFoundComponent??s.options.notFoundRoute?.options.component:r.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!r.isRoot||r.options.wrapInSuspense||v)&&(r.options.wrapInSuspense??c??(r.options.errorComponent?.preload||v))?N.Suspense:Sr,x=f?ap:Sr,b=p?Kz:Sr;return o.jsxs(r.isRoot?r.options.shellComponent??Sr:Sr,{children:[o.jsx(Ou.Provider,{value:t,children:o.jsx(y,{fallback:d,children:o.jsx(x,{getResetKey:()=>a.resetKey,errorComponent:f||rp,onCatch:(w,S)=>{if(fn(w))throw w;m?.(w,S)},children:o.jsx(b,{fallback:w=>{if(!p||w.routeId&&w.routeId!==a.routeId||!w.routeId&&!r.isRoot)throw w;return N.createElement(p,w)},children:v||a._displayPending?o.jsx(Sz,{fallback:d,children:o.jsx(Dx,{matchId:t})}):o.jsx(Dx,{matchId:t})})})})}),a.parentRouteId===ba&&s.options.scrollRestoration?o.jsxs(o.Fragment,{children:[o.jsx(Vz,{}),o.jsx(Zz,{})]}):null]})});function Vz(){const e=Zn(),t=N.useRef(void 0);return o.jsx("script",{suppressHydrationWarning:!0,ref:s=>{s&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ja(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Dx=N.memo(function({matchId:t}){const s=Zn(),{match:a,key:r,routeId:c}=jn({select:m=>{const p=m.matches.find(x=>x.id===t),v=p.routeId,y=(s.routesById[v].options.remountDeps??s.options.defaultRemountDeps)?.({routeId:v,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:y?JSON.stringify(y):void 0,routeId:v,match:{id:p.id,status:p.status,error:p.error,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),d=s.routesById[c],f=N.useMemo(()=>{const m=d.options.component??s.options.defaultComponent;return m?o.jsx(m,{},r):o.jsx(dp,{})},[r,d.options.component,s.options.defaultComponent]);if(a._displayPending)throw s.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw s.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const m=d.options.pendingMinMs??s.options.defaultPendingMinMs;if(m){const p=s.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const v=Tr();p._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw s.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Ui(fn(a.error)),AS(s,d,a.error);if(a.status==="redirected")throw Ui(Sn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),dp=N.memo(function(){const t=Zn(),s=N.useContext(Ou),a=jn({select:p=>p.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=jn({select:p=>{const v=p.matches.find(y=>y.id===s);return Ui(v),v.globalNotFound}}),d=jn({select:p=>{const v=p.matches;return v[v.findIndex(y=>y.id===s)+1]?.id}}),f=t.options.defaultPendingComponent?o.jsx(t.options.defaultPendingComponent,{}):null;if(c)return AS(t,r,void 0);if(!d)return null;const m=o.jsx(OS,{matchId:d});return a===ba?o.jsx(N.Suspense,{fallback:f,children:m}):m});function Qz(){const e=Zn(),t=N.useRef({router:e,mounted:!1}),[s,a]=N.useState(!1),{hasPendingMatches:r,isLoading:c}=jn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(x=>x.status==="pending")}),structuralSharing:!0}),d=Ch(c),f=c||s||r,m=Ch(f),p=c||r,v=Ch(p);return e.startTransition=y=>{a(!0),N.startTransition(()=>{y(),a(!1)})},N.useEffect(()=>{const y=e.history.subscribe(e.load),x=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Di(e.latestLocation.publicHref)!==Di(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{y()}},[e,e.history]),Dc(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(x){console.error(x)}})()},[e]),Dc(()=>{d&&!c&&e.emit({type:"onLoad",...ja(e.state)})},[d,e,c]),Dc(()=>{v&&!p&&e.emit({type:"onBeforeRouteMount",...ja(e.state)})},[p,v,e]),Dc(()=>{if(m&&!f){const y=ja(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(x=>({...x,status:"idle",resolvedLocation:x.location})),y.hrefChanged&&T_(e)}},[f,m,e]),null}function Yz(){const e=Zn(),t=e.routesById[ba].options.pendingComponent??e.options.defaultPendingComponent,s=t?o.jsx(t,{}):null,a=o.jsxs(typeof document<"u"&&e.ssr?Sr:N.Suspense,{fallback:s,children:[o.jsx(Qz,{}),o.jsx(Jz,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:a}):a}function Jz(){const e=Zn(),t=jn({select:r=>r.matches[0]?.id}),s=jn({select:r=>r.loadedAt}),a=t?o.jsx(OS,{matchId:t}):null;return o.jsx(Ou.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:o.jsx(ap,{getResetKey:()=>s,errorComponent:rp,onCatch:void 0,children:a})})}var Xz=e=>new Wz(e),Wz=class extends dz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Rx,globalThis.createLazyFileRoute=Ox):typeof window<"u"&&(window.createFileRoute=Rx,window.createLazyFileRoute=Ox);function e2({router:e,children:t,...s}){Object.keys(s).length>0&&e.update({...e.options,...s,context:{...e.options.context,...s.context}});const a=o.jsx(TS.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:a}):a}function t2({router:e,...t}){return o.jsx(e2,{router:e,...t,children:o.jsx(Yz,{})})}function n2(e){return jn({select:t=>t.location})}let Ti=[],s2=0;const vm=new Set;function DS(){const e=[...Ti];for(const t of vm)t(e)}function i2(e,t="negative",s=6e3){const a=String(++s2),r={id:a,message:e,tone:t,expiresAt:Date.now()+s};return Ti=[...Ti,r],DS(),setTimeout(()=>{LS(a)},s),a}function LS(e){const t=Ti.length;Ti=Ti.filter(s=>s.id!==e),Ti.length!==t&&DS()}function a2(e){return vm.add(e),()=>{vm.delete(e)}}function Lx(){return Ti}function r2(){return new Vk({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new aS({onError:e=>{i2(e instanceof Error?e.message:"An unexpected error occurred","negative")}})})}const o2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Mx=e=>{const t=l2(e);return t.charAt(0).toUpperCase()+t.slice(1)},MS=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),c2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var u2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const d2=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:d,...f},m)=>N.createElement("svg",{ref:m,...u2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:MS("lucide",r),...!c&&!c2(f)&&{"aria-hidden":"true"},...f},[...d.map(([p,v])=>N.createElement(p,v)),...Array.isArray(c)?c:[c]]));const nn=(e,t)=>{const s=N.forwardRef(({className:a,...r},c)=>N.createElement(d2,{ref:c,iconNode:t,className:MS(`lucide-${o2(Mx(e))}`,`lucide-${e}`,a),...r}));return s.displayName=Mx(e),s};const f2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Mu=nn("chevron-right",f2);const h2=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],m2=nn("download",h2);const p2=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],g2=nn("github",p2);const y2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],v2=nn("globe",y2);const x2=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],b2=nn("layout-dashboard",x2);const S2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],j2=nn("menu",S2);const w2=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],N2=nn("play",w2);const C2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$x=nn("plus",C2);const k2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ux=nn("refresh-cw",k2);const _2=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],z2=nn("rocket",_2);const E2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],R2=nn("rotate-ccw",E2);const T2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],A2=nn("settings",T2);const O2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],D2=nn("trash-2",O2);const L2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],M2=nn("triangle-alert",L2);const $2=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],U2=nn("unplug",$2);const P2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],$u=nn("x",P2);function I2(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const s=t[1],a=t[2],r=a.indexOf("{");if(r>=0){const c=a.slice(0,r).trim(),d=a.slice(r);try{const f=JSON.parse(d);return`${s} ${c}
|
|
10
10
|
|
|
11
11
|
${JSON.stringify(f,null,2)}`}catch{}}return`${s}
|
|
12
|
-
${a}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}function Uu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function vs(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Ux(e){return e===null?"Unknown":e?"Pass":"Fail"}function vm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function B2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function q2(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const s=e.match(/^daily(?:@(\d+))?$/);if(s)return{freq:"daily",hour:s[1]?parseInt(s[1]):6,customCron:""};const a=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return a?{freq:a[1],hour:a[2]?parseInt(a[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function H2(e,t,s){const a=s==="UTC"?"UTC":s.split("/").pop()?.replace(/_/g," ")??s;if(!e)return`Custom: ${t} · ${a}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${a}`;const r=e.match(/^daily(?:@(\d+))?$/);if(r){const d=r[1]?parseInt(r[1]):6;return`Every day at ${vm(d)} · ${a}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},f=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${vm(f)} · ${a}`}return`${e} · ${a}`}function Px(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=Px(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<a.length;r++){const c=a[r];typeof c=="function"?c():Px(e[r],null)}}}}function _a(...e){return N.useCallback(dp(...e),e)}var G2=Symbol.for("react.lazy"),xu=Gm[" use ".trim().toString()];function K2(e){return typeof e=="object"&&e!==null&&"then"in e}function $S(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===G2&&"_payload"in e&&K2(e._payload)}function F2(e){const t=V2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;$S(c)&&typeof xu=="function"&&(c=xu(c._payload));const f=N.Children.toArray(c),m=f.find(Y2);if(m){const p=m.props.children,v=f.map(y=>y===m?N.Children.count(p)>1?N.Children.only(null):N.isValidElement(p)?p.props.children:null:y);return o.jsx(t,{...d,ref:r,children:N.isValidElement(p)?N.cloneElement(p,void 0,v):null})}return o.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var Z2=F2("Slot");function V2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if($S(r)&&typeof xu=="function"&&(r=xu(r._payload)),N.isValidElement(r)){const d=X2(r),f=J2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?dp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Q2=Symbol("radix.slottable");function Y2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Q2}function J2(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const m=c(...f);return r(...f),m}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function X2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function US(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=US(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function PS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=US(e))&&(a&&(a+=" "),a+=t);return a}const Ix=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Bx=PS,IS=(e,t)=>s=>{var a;if(t?.variants==null)return Bx(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(p=>{const v=s?.[p],y=c?.[p];if(v===null)return null;const x=Ix(v)||Ix(y);return r[p][x]}),f=s&&Object.entries(s).reduce((p,v)=>{let[y,x]=v;return x===void 0||(p[y]=x),p},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((p,v)=>{let{class:y,className:x,...b}=v;return Object.entries(b).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...p,y,x]:p},[]);return Bx(e,d,m,s?.class,s?.className)},W2=(e,t)=>{const s=new Array(e.length+t.length);for(let a=0;a<e.length;a++)s[a]=e[a];for(let a=0;a<t.length;a++)s[e.length+a]=t[a];return s},eE=(e,t)=>({classGroupId:e,validator:t}),BS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),bu="-",qx=[],tE="arbitrary..",nE=e=>{const t=iE(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return sE(d);const f=d.split(bu),m=f[0]===""&&f.length>1?1:0;return qS(f,m,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const m=a[d],p=s[d];return m?p?W2(p,m):m:p||qx}return s[d]||qx}}},qS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const p=qS(e,t+1,c);if(p)return p}const d=s.validators;if(d===null)return;const f=t===0?e.join(bu):e.slice(t).join(bu),m=d.length;for(let p=0;p<m;p++){const v=d[p];if(v.validator(f))return v.classGroupId}},sE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?tE+a:void 0})(),iE=e=>{const{theme:t,classGroups:s}=e;return aE(s,t)},aE=(e,t)=>{const s=BS();for(const a in e){const r=e[a];fp(r,s,a,t)}return s},fp=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];rE(d,t,s,a)}},rE=(e,t,s,a)=>{if(typeof e=="string"){oE(e,t,s);return}if(typeof e=="function"){lE(e,t,s,a);return}cE(e,t,s,a)},oE=(e,t,s)=>{const a=e===""?t:HS(t,e);a.classGroupId=s},lE=(e,t,s,a)=>{if(uE(e)){fp(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(eE(s,e))},cE=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,m]=r[d];fp(m,HS(t,f),s,a)}},HS=(e,t)=>{let s=e;const a=t.split(bu),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=BS(),s.nextPart.set(d,f)),s=f}return s},uE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(c,d)=>{s[c]=d,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(c){let d=s[c];if(d!==void 0)return d;if((d=a[c])!==void 0)return r(c,d),d},set(c,d){c in s?s[c]=d:r(c,d)}}},xm="!",Hx=":",fE=[],Gx=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),hE=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,m=0,p;const v=r.length;for(let S=0;S<v;S++){const C=r[S];if(d===0&&f===0){if(C===Hx){c.push(r.slice(m,S)),m=S+1;continue}if(C==="/"){p=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const y=c.length===0?r:r.slice(m);let x=y,b=!1;y.endsWith(xm)?(x=y.slice(0,-1),b=!0):y.startsWith(xm)&&(x=y.slice(1),b=!0);const w=p&&p>m?p-m:void 0;return Gx(c,b,x,w)};if(t){const r=t+Hx,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Gx(fE,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},mE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",m=t.has(d);f||m?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(d)):r.push(d)}return r.length>0&&(r.sort(),a.push(...r)),a}},pE=e=>({cache:dE(e.cacheSize),parseClassName:hE(e),sortModifiers:mE(e),...nE(e)}),gE=/\s+/,yE=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(gE);let m="";for(let p=f.length-1;p>=0;p-=1){const v=f[p],{isExternal:y,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}=s(v);if(y){m=v+(m.length>0?" "+m:m);continue}let C=!!S,k=a(C?w.substring(0,S):w);if(!k){if(!C){m=v+(m.length>0?" "+m:m);continue}if(k=a(w),!k){m=v+(m.length>0?" "+m:m);continue}C=!1}const E=x.length===0?"":x.length===1?x[0]:c(x).join(":"),R=b?E+xm:E,_=R+k;if(d.indexOf(_)>-1)continue;d.push(_);const D=r(k,C);for(let M=0;M<D.length;++M){const T=D[M];d.push(R+T)}m=v+(m.length>0?" "+m:m)}return m},vE=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=GS(s))&&(r&&(r+=" "),r+=a);return r},GS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=GS(e[a]))&&(s&&(s+=" "),s+=t);return s},xE=(e,...t)=>{let s,a,r,c;const d=m=>{const p=t.reduce((v,y)=>y(v),e());return s=pE(p),a=s.cache.get,r=s.cache.set,c=f,f(m)},f=m=>{const p=a(m);if(p)return p;const v=yE(m,s);return r(m,v),v};return c=d,(...m)=>c(vE(...m))},bE=[],Ft=e=>{const t=s=>s[e]||bE;return t.isThemeGetter=!0,t},KS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wE=/\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$/,NE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,CE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ni=e=>SE.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Ci=e=>!!e&&Number.isInteger(Number(e)),Mh=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Hs=e=>jE.test(e),ZS=()=>!0,_E=e=>wE.test(e)&&!NE.test(e),hp=()=>!1,zE=e=>CE.test(e),EE=e=>kE.test(e),RE=e=>!xe(e)&&!be(e),TE=e=>qi(e,YS,hp),xe=e=>KS.test(e),da=e=>qi(e,JS,_E),Kx=e=>qi(e,PE,Oe),AE=e=>qi(e,WS,ZS),OE=e=>qi(e,XS,hp),Fx=e=>qi(e,VS,hp),LE=e=>qi(e,QS,EE),$c=e=>qi(e,ej,zE),be=e=>FS.test(e),Bo=e=>za(e,JS),DE=e=>za(e,XS),Zx=e=>za(e,VS),ME=e=>za(e,YS),$E=e=>za(e,QS),Uc=e=>za(e,ej,!0),UE=e=>za(e,WS,!0),qi=(e,t,s)=>{const a=KS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},za=(e,t,s=!1)=>{const a=FS.exec(e);return a?a[1]?t(a[1]):s:!1},VS=e=>e==="position"||e==="percentage",QS=e=>e==="image"||e==="url",YS=e=>e==="length"||e==="size"||e==="bg-size",JS=e=>e==="length",PE=e=>e==="number",XS=e=>e==="family-name",WS=e=>e==="number"||e==="weight",ej=e=>e==="shadow",IE=()=>{const e=Ft("color"),t=Ft("font"),s=Ft("text"),a=Ft("font-weight"),r=Ft("tracking"),c=Ft("leading"),d=Ft("breakpoint"),f=Ft("container"),m=Ft("spacing"),p=Ft("radius"),v=Ft("shadow"),y=Ft("inset-shadow"),x=Ft("text-shadow"),b=Ft("drop-shadow"),w=Ft("blur"),S=Ft("perspective"),C=Ft("aspect"),k=Ft("ease"),E=Ft("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[..._(),be,xe],M=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[be,xe,m],P=()=>[Ni,"full","auto",...A()],J=()=>[Ci,"none","subgrid",be,xe],Q=()=>["auto",{span:["full",Ci,be,xe]},Ci,be,xe],se=()=>[Ci,"auto",be,xe],pe=()=>["auto","min","max","fr",be,xe],ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],je=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],G=()=>[Ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],oe=()=>[Ni,"screen","full","dvw","lvw","svw","min","max","fit",...A()],q=()=>[Ni,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],X=()=>[e,be,xe],O=()=>[..._(),Zx,Fx,{position:[be,xe]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",ME,TE,{size:[be,xe]}],re=()=>[Mh,Bo,da],ue=()=>["","none","full",p,be,xe],he=()=>["",Oe,Bo,da],de=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Oe,Mh,Zx,Fx],Ze=()=>["","none",w,be,xe],it=()=>["none",Oe,be,xe],me=()=>["none",Oe,be,xe],We=()=>[Oe,be,xe],dt=()=>[Ni,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[ZS],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[RE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Oe],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ni,xe,be,C]}],container:["container"],columns:[{columns:[Oe,xe,be,f]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:D()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ci,"auto",be,xe]}],basis:[{basis:[Ni,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Ni,"auto","initial","none",xe]}],grow:[{grow:["",Oe,be,xe]}],shrink:[{shrink:["",Oe,be,xe]}],order:[{order:[Ci,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...ke(),"normal"]}],"justify-items":[{"justify-items":[...je(),"normal"]}],"justify-self":[{"justify-self":["auto",...je()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...je(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...je(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...je(),"baseline"]}],"place-self":[{"place-self":["auto",...je()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[f,"screen",...G()]}],"min-w":[{"min-w":[f,"screen","none",...G()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",s,Bo,da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,UE,AE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mh,xe]}],"font-family":[{font:[DE,OE,t]}],"font-features":[{"font-features":[xe]}],"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:[r,be,xe]}],"line-clamp":[{"line-clamp":[Oe,"none",be,Kx]}],leading:[{leading:[c,...A()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",be,da]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Oe,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],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",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ci,be,xe],radial:["",be,xe],conic:[Ci,be,xe]},$E,LE]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,be,xe]}],"outline-w":[{outline:["",Oe,Bo,da]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",v,Uc,$c]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",y,Uc,$c]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Oe,da]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",x,Uc,$c]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Oe,be,xe]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:Ze()}],brightness:[{brightness:[Oe,be,xe]}],contrast:[{contrast:[Oe,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,Uc,$c]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Oe,be,xe]}],"hue-rotate":[{"hue-rotate":[Oe,be,xe]}],invert:[{invert:["",Oe,be,xe]}],saturate:[{saturate:[Oe,be,xe]}],sepia:[{sepia:["",Oe,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",be,xe]}],ease:[{ease:["linear","initial",k,be,xe]}],delay:[{delay:[Oe,be,xe]}],animate:[{animate:["none",E,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:it()}],"rotate-x":[{"rotate-x":it()}],"rotate-y":[{"rotate-y":it()}],"rotate-z":[{"rotate-z":it()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:We()}],"skew-x":[{"skew-x":We()}],"skew-y":[{"skew-y":We()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dt()}],"translate-x":[{"translate-x":dt()}],"translate-y":[{"translate-y":dt()}],"translate-z":[{"translate-z":dt()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"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",be,xe]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",be,xe]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Oe,Bo,da,Kx]}],stroke:[{stroke:["none",...X()]}],"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"]}},BE=xE(IE);function Qn(...e){return BE(PS(e))}const qE=IS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),ce=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?Z2:"button";return o.jsx(d,{ref:c,className:Qn(qE({variant:t,size:s,className:e})),...r})});ce.displayName="Button";const HE=IS("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function tj({className:e,variant:t,...s}){return o.jsx("div",{className:Qn(HE({variant:t}),e),...s})}function Vx({compact:e=!1}){return o.jsxs(yt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[o.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"brand-copy",children:[o.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:o.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function tl({provider:e}){const t={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return o.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Su(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function nj(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function GE(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function KE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function nt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return o.jsx(tj,{variant:s,children:t})}function Pu({status:e}){return o.jsx(nt,{tone:nj(e),children:Uu(e)})}function Mi(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function FE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,m=N.useMemo(()=>f,Object.values(f));return o.jsx(s.Provider,{value:m,children:d})};a.displayName=e+"Provider";function r(c){const d=N.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function ZE(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),m=s.length;s=[...s,d];const p=y=>{const{scope:x,children:b,...w}=y,S=x?.[e]?.[m]||f,C=N.useMemo(()=>w,Object.values(w));return o.jsx(S.Provider,{value:C,children:b})};p.displayName=c+"Provider";function v(y,x){const b=x?.[e]?.[m]||f,w=N.useContext(b);if(w)return w;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[p,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const m=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return r.scopeName=e,[a,VE(r,...t)]}function VE(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(c){const d=a.reduce((f,{useScope:m,scopeName:p})=>{const y=m(c)[`__scope${p}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var nl=globalThis?.document?N.useLayoutEffect:()=>{},QE=Gm[" useId ".trim().toString()]||(()=>{}),YE=0;function $h(e){const[t,s]=N.useState(QE());return nl(()=>{s(a=>a??String(YE++))},[e]),e||(t?`radix-${t}`:"")}var JE=Gm[" useInsertionEffect ".trim().toString()]||nl;function XE({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=WE({defaultProp:t,onChange:s}),f=e!==void 0,m=f?e:r;{const v=N.useRef(e!==void 0);N.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=f},[f,a])}const p=N.useCallback(v=>{if(f){const y=eR(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[f,e,c,d]);return[m,p]}function WE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return JE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function eR(e){return typeof e=="function"}function sj(e){const t=tR(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),m=f.find(sR);if(m){const p=m.props.children,v=f.map(y=>y===m?N.Children.count(p)>1?N.Children.only(null):N.isValidElement(p)?p.props.children:null:y);return o.jsx(t,{...d,ref:r,children:N.isValidElement(p)?N.cloneElement(p,void 0,v):null})}return o.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function tR(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=aR(r),f=iR(c,r.props);return r.type!==N.Fragment&&(f.ref=a?dp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nR=Symbol("radix.slottable");function sR(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nR}function iR(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const m=c(...f);return r(...f),m}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function aR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var rR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=rR.reduce((e,t)=>{const s=sj(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,m=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(m,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function oR(e,t){e&&cp.flushSync(()=>e.dispatchEvent(t))}function sl(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...s)=>t.current?.(...s),[])}function lR(e,t=globalThis?.document){const s=sl(e);N.useEffect(()=>{const a=r=>{r.key==="Escape"&&s(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[s,t])}var cR="DismissableLayer",bm="dismissableLayer.update",uR="dismissableLayer.pointerDownOutside",dR="dismissableLayer.focusOutside",Qx,ij=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aj=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...m}=e,p=N.useContext(ij),[v,y]=N.useState(null),x=v?.ownerDocument??globalThis?.document,[,b]=N.useState({}),w=_a(t,T=>y(T)),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=v?S.indexOf(v):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,_=E>=k,D=mR(T=>{const A=T.target,P=[...p.branches].some(J=>J.contains(A));!_||P||(r?.(T),d?.(T),T.defaultPrevented||f?.())},x),M=pR(T=>{const A=T.target;[...p.branches].some(J=>J.contains(A))||(c?.(T),d?.(T),T.defaultPrevented||f?.())},x);return lR(T=>{E===p.layers.size-1&&(a?.(T),!T.defaultPrevented&&f&&(T.preventDefault(),f()))},x),N.useEffect(()=>{if(v)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Qx=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),Yx(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Qx)}},[v,x,s,p]),N.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),Yx())},[v,p]),N.useEffect(()=>{const T=()=>b({});return document.addEventListener(bm,T),()=>document.removeEventListener(bm,T)},[]),o.jsx(Zs.div,{...m,ref:w,style:{pointerEvents:R?_?"auto":"none":void 0,...e.style},onFocusCapture:Mi(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Mi(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Mi(e.onPointerDownCapture,D.onPointerDownCapture)})});aj.displayName=cR;var fR="DismissableLayerBranch",hR=N.forwardRef((e,t)=>{const s=N.useContext(ij),a=N.useRef(null),r=_a(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),o.jsx(Zs.div,{...e,ref:r})});hR.displayName=fR;function mR(e,t=globalThis?.document){const s=sl(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let m=function(){rj(uR,s,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=m,t.addEventListener("click",r.current,{once:!0})):m()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function pR(e,t=globalThis?.document){const s=sl(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&rj(dR,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Yx(){const e=new CustomEvent(bm);document.dispatchEvent(e)}function rj(e,t,s,{discrete:a}){const r=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&r.addEventListener(e,t,{once:!0}),a?oR(r,c):r.dispatchEvent(c)}var Uh="focusScope.autoFocusOnMount",Ph="focusScope.autoFocusOnUnmount",Jx={bubbles:!1,cancelable:!0},gR="FocusScope",oj=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,m]=N.useState(null),p=sl(r),v=sl(c),y=N.useRef(null),x=_a(t,S=>m(S)),b=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let S=function(R){if(b.paused||!f)return;const _=R.target;f.contains(_)?y.current=_:ki(y.current,{select:!0})},C=function(R){if(b.paused||!f)return;const _=R.relatedTarget;_!==null&&(f.contains(_)||ki(y.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const D of R)D.removedNodes.length>0&&ki(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[a,f,b.paused]),N.useEffect(()=>{if(f){Wx.add(b);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Uh,Jx);f.addEventListener(Uh,p),f.dispatchEvent(k),k.defaultPrevented||(yR(jR(lj(f)),{select:!0}),document.activeElement===S&&ki(f))}return()=>{f.removeEventListener(Uh,p),setTimeout(()=>{const k=new CustomEvent(Ph,Jx);f.addEventListener(Ph,v),f.dispatchEvent(k),k.defaultPrevented||ki(S??document.body,{select:!0}),f.removeEventListener(Ph,v),Wx.remove(b)},0)}}},[f,p,v,b]);const w=N.useCallback(S=>{if(!s&&!a||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const E=S.currentTarget,[R,_]=vR(E);R&&_?!S.shiftKey&&k===_?(S.preventDefault(),s&&ki(R,{select:!0})):S.shiftKey&&k===R&&(S.preventDefault(),s&&ki(_,{select:!0})):k===E&&S.preventDefault()}},[s,a,b.paused]);return o.jsx(Zs.div,{tabIndex:-1,...d,ref:x,onKeyDown:w})});oj.displayName=gR;function yR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ki(a,{select:t}),document.activeElement!==s)return}function vR(e){const t=lj(e),s=Xx(t,e),a=Xx(t.reverse(),e);return[s,a]}function lj(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Xx(e,t){for(const s of e)if(!xR(s,{upTo:t}))return s}function xR(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function bR(e){return e instanceof HTMLInputElement&&"select"in e}function ki(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&bR(e)&&t&&e.select()}}var Wx=SR();function SR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=eb(e,t),e.unshift(t)},remove(t){e=eb(e,t),e[0]?.resume()}}}function eb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function jR(e){return e.filter(t=>t.tagName!=="A")}var wR="Portal",cj=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);nl(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?Tz.createPortal(o.jsx(Zs.div,{...a,ref:t}),d):null});cj.displayName=wR;function NR(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Iu=e=>{const{present:t,children:s}=e,a=CR(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=_a(a.ref,kR(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Iu.displayName="Presence";function CR(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,m]=NR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const p=Pc(a.current);c.current=f==="mounted"?p:"none"},[f]),nl(()=>{const p=a.current,v=r.current;if(v!==e){const x=c.current,b=Pc(p);e?m("MOUNT"):b==="none"||p?.display==="none"?m("UNMOUNT"):m(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,m]),nl(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,y=b=>{const S=Pc(a.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(m("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=b=>{b.target===t&&(c.current=Pc(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(p),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(p=>{a.current=p?getComputedStyle(p):null,s(p)},[])}}function Pc(e){return e?.animationName||"none"}function kR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Ih=0;function _R(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tb()),document.body.insertAdjacentElement("beforeend",e[1]??tb()),Ih++,()=>{Ih===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ih--}},[])}function tb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xs=function(){return xs=Object.assign||function(t){for(var s,a=1,r=arguments.length;a<r;a++){s=arguments[a];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},xs.apply(this,arguments)};function uj(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s}function zR(e,t,s){if(s||arguments.length===2)for(var a=0,r=t.length,c;a<r;a++)(c||!(a in t))&&(c||(c=Array.prototype.slice.call(t,0,a)),c[a]=t[a]);return e.concat(c||Array.prototype.slice.call(t))}var iu="right-scroll-bar-position",au="width-before-scroll-bar",ER="with-scroll-bars-hidden",RR="--removed-body-scroll-bar-size";function Bh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function TR(e,t){var s=N.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var r=s.value;r!==a&&(s.value=a,s.callback(a,r))}}}})[0];return s.callback=t,s.facade}var AR=typeof window<"u"?N.useLayoutEffect:N.useEffect,nb=new WeakMap;function OR(e,t){var s=TR(null,function(a){return e.forEach(function(r){return Bh(r,a)})});return AR(function(){var a=nb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||Bh(f,null)}),c.forEach(function(f){r.has(f)||Bh(f,d)})}nb.set(s,e)},[e]),s}function LR(e){return e}function DR(e,t){t===void 0&&(t=LR);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var m=function(){var v=d;d=[],v.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(v){d.push(v),p()},filter:function(v){return d=d.filter(v),s}}}};return r}function MR(e){e===void 0&&(e={});var t=DR(null);return t.options=xs({async:!0,ssr:!1},e),t}var dj=function(e){var t=e.sideCar,s=uj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return N.createElement(a,xs({},s))};dj.isSideCarExport=!0;function $R(e,t){return e.useMedium(t),dj}var fj=MR(),qh=function(){},Bu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:qh,onWheelCapture:qh,onTouchMoveCapture:qh}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,m=e.className,p=e.removeScrollBar,v=e.enabled,y=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,R=e.gapMode,_=uj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=x,M=OR([s,t]),T=xs(xs({},_),r);return N.createElement(N.Fragment,null,v&&N.createElement(D,{sideCar:fj,removeScrollBar:p,shards:y,noRelative:b,noIsolation:w,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:R}),d?N.cloneElement(N.Children.only(f),xs(xs({},T),{ref:M})):N.createElement(E,xs({},T,{className:m,ref:M}),f))});Bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bu.classNames={fullWidth:au,zeroRight:iu};var UR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UR();return t&&e.setAttribute("nonce",t),e}function IR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function BR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qR=function(){var e=0,t=null;return{add:function(s){e==0&&(t=PR())&&(IR(t,s),BR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HR=function(){var e=qR();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},hj=function(){var e=HR(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},GR={left:0,top:0,right:0,gap:0},Hh=function(e){return parseInt(e||"",10)||0},KR=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Hh(s),Hh(a),Hh(r)]},FR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GR;var t=KR(e),s=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-s+t[2]-t[0])}},ZR=hj(),_r="data-scroll-locked",VR=function(e,t,s,a){var r=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
|
|
12
|
+
${a}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}function Uu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function vs(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Px(e){return e===null?"Unknown":e?"Pass":"Fail"}function xm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function B2(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function q2(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const s=e.match(/^daily(?:@(\d+))?$/);if(s)return{freq:"daily",hour:s[1]?parseInt(s[1]):6,customCron:""};const a=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return a?{freq:a[1],hour:a[2]?parseInt(a[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function H2(e,t,s){const a=s==="UTC"?"UTC":s.split("/").pop()?.replace(/_/g," ")??s;if(!e)return`Custom: ${t} · ${a}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${a}`;const r=e.match(/^daily(?:@(\d+))?$/);if(r){const d=r[1]?parseInt(r[1]):6;return`Every day at ${xm(d)} · ${a}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const d={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},f=c[2]?parseInt(c[2]):6;return`Every ${d[c[1]]} at ${xm(f)} · ${a}`}return`${e} · ${a}`}function Ix(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function fp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=Ix(r,t);return!s&&typeof c=="function"&&(s=!0),c});if(s)return()=>{for(let r=0;r<a.length;r++){const c=a[r];typeof c=="function"?c():Ix(e[r],null)}}}}function _a(...e){return N.useCallback(fp(...e),e)}var G2=Symbol.for("react.lazy"),xu=Km[" use ".trim().toString()];function K2(e){return typeof e=="object"&&e!==null&&"then"in e}function $S(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===G2&&"_payload"in e&&K2(e._payload)}function F2(e){const t=V2(e),s=N.forwardRef((a,r)=>{let{children:c,...d}=a;$S(c)&&typeof xu=="function"&&(c=xu(c._payload));const f=N.Children.toArray(c),m=f.find(Y2);if(m){const p=m.props.children,v=f.map(y=>y===m?N.Children.count(p)>1?N.Children.only(null):N.isValidElement(p)?p.props.children:null:y);return o.jsx(t,{...d,ref:r,children:N.isValidElement(p)?N.cloneElement(p,void 0,v):null})}return o.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var Z2=F2("Slot");function V2(e){const t=N.forwardRef((s,a)=>{let{children:r,...c}=s;if($S(r)&&typeof xu=="function"&&(r=xu(r._payload)),N.isValidElement(r)){const d=X2(r),f=J2(c,r.props);return r.type!==N.Fragment&&(f.ref=a?fp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Q2=Symbol("radix.slottable");function Y2(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Q2}function J2(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const m=c(...f);return r(...f),m}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function X2(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}function US(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(s=US(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function PS(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=US(e))&&(a&&(a+=" "),a+=t);return a}const Bx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,qx=PS,IS=(e,t)=>s=>{var a;if(t?.variants==null)return qx(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,d=Object.keys(r).map(p=>{const v=s?.[p],y=c?.[p];if(v===null)return null;const x=Bx(v)||Bx(y);return r[p][x]}),f=s&&Object.entries(s).reduce((p,v)=>{let[y,x]=v;return x===void 0||(p[y]=x),p},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((p,v)=>{let{class:y,className:x,...b}=v;return Object.entries(b).every(w=>{let[S,C]=w;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...p,y,x]:p},[]);return qx(e,d,m,s?.class,s?.className)},W2=(e,t)=>{const s=new Array(e.length+t.length);for(let a=0;a<e.length;a++)s[a]=e[a];for(let a=0;a<t.length;a++)s[e.length+a]=t[a];return s},eE=(e,t)=>({classGroupId:e,validator:t}),BS=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),bu="-",Hx=[],tE="arbitrary..",nE=e=>{const t=iE(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return sE(d);const f=d.split(bu),m=f[0]===""&&f.length>1?1:0;return qS(f,m,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const m=a[d],p=s[d];return m?p?W2(p,m):m:p||Hx}return s[d]||Hx}}},qS=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const p=qS(e,t+1,c);if(p)return p}const d=s.validators;if(d===null)return;const f=t===0?e.join(bu):e.slice(t).join(bu),m=d.length;for(let p=0;p<m;p++){const v=d[p];if(v.validator(f))return v.classGroupId}},sE=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?tE+a:void 0})(),iE=e=>{const{theme:t,classGroups:s}=e;return aE(s,t)},aE=(e,t)=>{const s=BS();for(const a in e){const r=e[a];hp(r,s,a,t)}return s},hp=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const d=e[c];rE(d,t,s,a)}},rE=(e,t,s,a)=>{if(typeof e=="string"){oE(e,t,s);return}if(typeof e=="function"){lE(e,t,s,a);return}cE(e,t,s,a)},oE=(e,t,s)=>{const a=e===""?t:HS(t,e);a.classGroupId=s},lE=(e,t,s,a)=>{if(uE(e)){hp(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(eE(s,e))},cE=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let d=0;d<c;d++){const[f,m]=r[d];hp(m,HS(t,f),s,a)}},HS=(e,t)=>{let s=e;const a=t.split(bu),r=a.length;for(let c=0;c<r;c++){const d=a[c];let f=s.nextPart.get(d);f||(f=BS(),s.nextPart.set(d,f)),s=f}return s},uE=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,dE=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(c,d)=>{s[c]=d,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(c){let d=s[c];if(d!==void 0)return d;if((d=a[c])!==void 0)return r(c,d),d},set(c,d){c in s?s[c]=d:r(c,d)}}},bm="!",Gx=":",fE=[],Kx=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),hE=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let d=0,f=0,m=0,p;const v=r.length;for(let S=0;S<v;S++){const C=r[S];if(d===0&&f===0){if(C===Gx){c.push(r.slice(m,S)),m=S+1;continue}if(C==="/"){p=S;continue}}C==="["?d++:C==="]"?d--:C==="("?f++:C===")"&&f--}const y=c.length===0?r:r.slice(m);let x=y,b=!1;y.endsWith(bm)?(x=y.slice(0,-1),b=!0):y.startsWith(bm)&&(x=y.slice(1),b=!0);const w=p&&p>m?p-m:void 0;return Kx(c,b,x,w)};if(t){const r=t+Gx,c=a;a=d=>d.startsWith(r)?c(d.slice(r.length)):Kx(fE,!1,d,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},mE=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let r=[];for(let c=0;c<s.length;c++){const d=s[c],f=d[0]==="[",m=t.has(d);f||m?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(d)):r.push(d)}return r.length>0&&(r.sort(),a.push(...r)),a}},pE=e=>({cache:dE(e.cacheSize),parseClassName:hE(e),sortModifiers:mE(e),...nE(e)}),gE=/\s+/,yE=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,d=[],f=e.trim().split(gE);let m="";for(let p=f.length-1;p>=0;p-=1){const v=f[p],{isExternal:y,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:S}=s(v);if(y){m=v+(m.length>0?" "+m:m);continue}let C=!!S,k=a(C?w.substring(0,S):w);if(!k){if(!C){m=v+(m.length>0?" "+m:m);continue}if(k=a(w),!k){m=v+(m.length>0?" "+m:m);continue}C=!1}const E=x.length===0?"":x.length===1?x[0]:c(x).join(":"),R=b?E+bm:E,_=R+k;if(d.indexOf(_)>-1)continue;d.push(_);const L=r(k,C);for(let M=0;M<L.length;++M){const T=L[M];d.push(R+T)}m=v+(m.length>0?" "+m:m)}return m},vE=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=GS(s))&&(r&&(r+=" "),r+=a);return r},GS=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=GS(e[a]))&&(s&&(s+=" "),s+=t);return s},xE=(e,...t)=>{let s,a,r,c;const d=m=>{const p=t.reduce((v,y)=>y(v),e());return s=pE(p),a=s.cache.get,r=s.cache.set,c=f,f(m)},f=m=>{const p=a(m);if(p)return p;const v=yE(m,s);return r(m,v),v};return c=d,(...m)=>c(vE(...m))},bE=[],Ft=e=>{const t=s=>s[e]||bE;return t.isThemeGetter=!0,t},KS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,FS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,SE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,jE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wE=/\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$/,NE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,CE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ni=e=>SE.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Ci=e=>!!e&&Number.isInteger(Number(e)),Mh=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Hs=e=>jE.test(e),ZS=()=>!0,_E=e=>wE.test(e)&&!NE.test(e),mp=()=>!1,zE=e=>CE.test(e),EE=e=>kE.test(e),RE=e=>!xe(e)&&!be(e),TE=e=>qi(e,YS,mp),xe=e=>KS.test(e),da=e=>qi(e,JS,_E),Fx=e=>qi(e,PE,Oe),AE=e=>qi(e,WS,ZS),OE=e=>qi(e,XS,mp),Zx=e=>qi(e,VS,mp),DE=e=>qi(e,QS,EE),$c=e=>qi(e,ej,zE),be=e=>FS.test(e),Bo=e=>za(e,JS),LE=e=>za(e,XS),Vx=e=>za(e,VS),ME=e=>za(e,YS),$E=e=>za(e,QS),Uc=e=>za(e,ej,!0),UE=e=>za(e,WS,!0),qi=(e,t,s)=>{const a=KS.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},za=(e,t,s=!1)=>{const a=FS.exec(e);return a?a[1]?t(a[1]):s:!1},VS=e=>e==="position"||e==="percentage",QS=e=>e==="image"||e==="url",YS=e=>e==="length"||e==="size"||e==="bg-size",JS=e=>e==="length",PE=e=>e==="number",XS=e=>e==="family-name",WS=e=>e==="number"||e==="weight",ej=e=>e==="shadow",IE=()=>{const e=Ft("color"),t=Ft("font"),s=Ft("text"),a=Ft("font-weight"),r=Ft("tracking"),c=Ft("leading"),d=Ft("breakpoint"),f=Ft("container"),m=Ft("spacing"),p=Ft("radius"),v=Ft("shadow"),y=Ft("inset-shadow"),x=Ft("text-shadow"),b=Ft("drop-shadow"),w=Ft("blur"),S=Ft("perspective"),C=Ft("aspect"),k=Ft("ease"),E=Ft("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[..._(),be,xe],M=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[be,xe,m],P=()=>[Ni,"full","auto",...A()],J=()=>[Ci,"none","subgrid",be,xe],Q=()=>["auto",{span:["full",Ci,be,xe]},Ci,be,xe],se=()=>[Ci,"auto",be,xe],pe=()=>["auto","min","max","fr",be,xe],ke=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],je=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...A()],G=()=>[Ni,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],oe=()=>[Ni,"screen","full","dvw","lvw","svw","min","max","fit",...A()],q=()=>[Ni,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],X=()=>[e,be,xe],O=()=>[..._(),Vx,Zx,{position:[be,xe]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",ME,TE,{size:[be,xe]}],re=()=>[Mh,Bo,da],ue=()=>["","none","full",p,be,xe],he=()=>["",Oe,Bo,da],de=()=>["solid","dashed","dotted","double"],Me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Oe,Mh,Vx,Zx],Ze=()=>["","none",w,be,xe],it=()=>["none",Oe,be,xe],me=()=>["none",Oe,be,xe],We=()=>[Oe,be,xe],dt=()=>[Ni,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[ZS],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[RE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Oe],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ni,xe,be,C]}],container:["container"],columns:[{columns:[Oe,xe,be,f]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:L()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{"inset-s":P(),start:P()}],end:[{"inset-e":P(),end:P()}],"inset-bs":[{"inset-bs":P()}],"inset-be":[{"inset-be":P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[Ci,"auto",be,xe]}],basis:[{basis:[Ni,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,Ni,"auto","initial","none",xe]}],grow:[{grow:["",Oe,be,xe]}],shrink:[{shrink:["",Oe,be,xe]}],order:[{order:[Ci,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":se()}],"col-end":[{"col-end":se()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":se()}],"row-end":[{"row-end":se()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...ke(),"normal"]}],"justify-items":[{"justify-items":[...je(),"normal"]}],"justify-self":[{"justify-self":["auto",...je()]}],"align-content":[{content:["normal",...ke()]}],"align-items":[{items:[...je(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...je(),{baseline:["","last"]}]}],"place-content":[{"place-content":ke()}],"place-items":[{"place-items":[...je(),"baseline"]}],"place-self":[{"place-self":["auto",...je()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mbs:[{mbs:B()}],mbe:[{mbe:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[f,"screen",...G()]}],"min-w":[{"min-w":[f,"screen","none",...G()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",s,Bo,da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,UE,AE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mh,xe]}],"font-family":[{font:[LE,OE,t]}],"font-features":[{"font-features":[xe]}],"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:[r,be,xe]}],"line-clamp":[{"line-clamp":[Oe,"none",be,Fx]}],leading:[{leading:[c,...A()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",be,da]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Oe,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],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",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ci,be,xe],radial:["",be,xe],conic:[Ci,be,xe]},$E,DE]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:he()}],"border-w-x":[{"border-x":he()}],"border-w-y":[{"border-y":he()}],"border-w-s":[{"border-s":he()}],"border-w-e":[{"border-e":he()}],"border-w-bs":[{"border-bs":he()}],"border-w-be":[{"border-be":he()}],"border-w-t":[{"border-t":he()}],"border-w-r":[{"border-r":he()}],"border-w-b":[{"border-b":he()}],"border-w-l":[{"border-l":he()}],"divide-x":[{"divide-x":he()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":he()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,be,xe]}],"outline-w":[{outline:["",Oe,Bo,da]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",v,Uc,$c]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",y,Uc,$c]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:he()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Oe,da]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":he()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",x,Uc,$c]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Oe,be,xe]}],"mix-blend":[{"mix-blend":[...Me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Me()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"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":_()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:Ze()}],brightness:[{brightness:[Oe,be,xe]}],contrast:[{contrast:[Oe,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,Uc,$c]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Oe,be,xe]}],"hue-rotate":[{"hue-rotate":[Oe,be,xe]}],invert:[{invert:["",Oe,be,xe]}],saturate:[{saturate:[Oe,be,xe]}],sepia:[{sepia:["",Oe,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",be,xe]}],ease:[{ease:["linear","initial",k,be,xe]}],delay:[{delay:[Oe,be,xe]}],animate:[{animate:["none",E,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:it()}],"rotate-x":[{"rotate-x":it()}],"rotate-y":[{"rotate-y":it()}],"rotate-z":[{"rotate-z":it()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:We()}],"skew-x":[{"skew-x":We()}],"skew-y":[{"skew-y":We()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:dt()}],"translate-x":[{"translate-x":dt()}],"translate-y":[{"translate-y":dt()}],"translate-z":[{"translate-z":dt()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"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",be,xe]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",be,xe]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Oe,Bo,da,Fx]}],stroke:[{stroke:["none",...X()]}],"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"]}},BE=xE(IE);function Qn(...e){return BE(PS(e))}const qE=IS("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 focus-visible:ring-offset-2 focus-visible:ring-offset-black disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-zinc-50 text-black hover:bg-zinc-200",secondary:"border border-zinc-800 bg-zinc-950 text-zinc-100 hover:bg-zinc-900",ghost:"text-zinc-400 hover:bg-zinc-900 hover:text-zinc-50",outline:"border border-zinc-800 bg-transparent text-zinc-100 hover:bg-zinc-900",destructive:"bg-rose-600 text-white hover:bg-rose-700"},size:{default:"h-9 px-4",sm:"h-8 px-3 text-xs",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),ce=N.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const d=a?Z2:"button";return o.jsx(d,{ref:c,className:Qn(qE({variant:t,size:s,className:e})),...r})});ce.displayName="Button";const HE=IS("inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium tracking-wide",{variants:{variant:{neutral:"border-zinc-800 bg-zinc-950 text-zinc-300",success:"border-emerald-500/25 bg-emerald-500/10 text-emerald-300",warning:"border-amber-500/25 bg-amber-500/10 text-amber-300",destructive:"border-rose-500/25 bg-rose-500/10 text-rose-300"}},defaultVariants:{variant:"neutral"}});function tj({className:e,variant:t,...s}){return o.jsx("div",{className:Qn(HE({variant:t}),e),...s})}function Qx({compact:e=!1}){return o.jsxs(yt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[o.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),o.jsxs("span",{className:"brand-copy",children:[o.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:o.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function tl({provider:e}){const t={gemini:"border-blue-800/50 bg-blue-950/40 text-blue-300",openai:"border-green-800/50 bg-green-950/40 text-green-300",claude:"border-amber-800/50 bg-amber-950/40 text-amber-300",perplexity:"border-teal-800/50 bg-teal-950/40 text-teal-300",local:"border-purple-800/50 bg-purple-950/40 text-purple-300"};return o.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ${t[e]??"border-zinc-700 bg-zinc-800 text-zinc-300"}`,children:e})}function Su(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function nj(e){switch(e){case"completed":return"positive";case"partial":return"caution";case"failed":return"negative";case"cancelled":return"caution";case"queued":case"running":return"neutral";default:return"neutral"}}function GE(e){switch(e){case"cited":return"positive";case"emerging":return"caution";case"not-cited":return"caution";case"lost":return"negative";case"pending":return"neutral";default:return"neutral"}}function KE(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function nt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return o.jsx(tj,{variant:s,children:t})}function Pu({status:e}){return o.jsx(nt,{tone:nj(e),children:Uu(e)})}function Mi(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function FE(e,t){const s=N.createContext(t),a=c=>{const{children:d,...f}=c,m=N.useMemo(()=>f,Object.values(f));return o.jsx(s.Provider,{value:m,children:d})};a.displayName=e+"Provider";function r(c){const d=N.useContext(s);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function ZE(e,t=[]){let s=[];function a(c,d){const f=N.createContext(d),m=s.length;s=[...s,d];const p=y=>{const{scope:x,children:b,...w}=y,S=x?.[e]?.[m]||f,C=N.useMemo(()=>w,Object.values(w));return o.jsx(S.Provider,{value:C,children:b})};p.displayName=c+"Provider";function v(y,x){const b=x?.[e]?.[m]||f,w=N.useContext(b);if(w)return w;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[p,v]}const r=()=>{const c=s.map(d=>N.createContext(d));return function(f){const m=f?.[e]||c;return N.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return r.scopeName=e,[a,VE(r,...t)]}function VE(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(c){const d=a.reduce((f,{useScope:m,scopeName:p})=>{const y=m(c)[`__scope${p}`];return{...f,...y}},{});return N.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return s.scopeName=t.scopeName,s}var nl=globalThis?.document?N.useLayoutEffect:()=>{},QE=Km[" useId ".trim().toString()]||(()=>{}),YE=0;function $h(e){const[t,s]=N.useState(QE());return nl(()=>{s(a=>a??String(YE++))},[e]),e||(t?`radix-${t}`:"")}var JE=Km[" useInsertionEffect ".trim().toString()]||nl;function XE({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,d]=WE({defaultProp:t,onChange:s}),f=e!==void 0,m=f?e:r;{const v=N.useRef(e!==void 0);N.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${a} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=f},[f,a])}const p=N.useCallback(v=>{if(f){const y=eR(v)?v(e):v;y!==e&&d.current?.(y)}else c(v)},[f,e,c,d]);return[m,p]}function WE({defaultProp:e,onChange:t}){const[s,a]=N.useState(e),r=N.useRef(s),c=N.useRef(t);return JE(()=>{c.current=t},[t]),N.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function eR(e){return typeof e=="function"}function sj(e){const t=tR(e),s=N.forwardRef((a,r)=>{const{children:c,...d}=a,f=N.Children.toArray(c),m=f.find(sR);if(m){const p=m.props.children,v=f.map(y=>y===m?N.Children.count(p)>1?N.Children.only(null):N.isValidElement(p)?p.props.children:null:y);return o.jsx(t,{...d,ref:r,children:N.isValidElement(p)?N.cloneElement(p,void 0,v):null})}return o.jsx(t,{...d,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function tR(e){const t=N.forwardRef((s,a)=>{const{children:r,...c}=s;if(N.isValidElement(r)){const d=aR(r),f=iR(c,r.props);return r.type!==N.Fragment&&(f.ref=a?fp(a,d):d),N.cloneElement(r,f)}return N.Children.count(r)>1?N.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nR=Symbol("radix.slottable");function sR(e){return N.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nR}function iR(e,t){const s={...t};for(const a in t){const r=e[a],c=t[a];/^on[A-Z]/.test(a)?r&&c?s[a]=(...f)=>{const m=c(...f);return r(...f),m}:r&&(s[a]=r):a==="style"?s[a]={...r,...c}:a==="className"&&(s[a]=[r,c].filter(Boolean).join(" "))}return{...e,...s}}function aR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var rR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zs=rR.reduce((e,t)=>{const s=sj(`Primitive.${t}`),a=N.forwardRef((r,c)=>{const{asChild:d,...f}=r,m=d?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(m,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function oR(e,t){e&&up.flushSync(()=>e.dispatchEvent(t))}function sl(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...s)=>t.current?.(...s),[])}function lR(e,t=globalThis?.document){const s=sl(e);N.useEffect(()=>{const a=r=>{r.key==="Escape"&&s(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[s,t])}var cR="DismissableLayer",Sm="dismissableLayer.update",uR="dismissableLayer.pointerDownOutside",dR="dismissableLayer.focusOutside",Yx,ij=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),aj=N.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:d,onDismiss:f,...m}=e,p=N.useContext(ij),[v,y]=N.useState(null),x=v?.ownerDocument??globalThis?.document,[,b]=N.useState({}),w=_a(t,T=>y(T)),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),E=v?S.indexOf(v):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,_=E>=k,L=mR(T=>{const A=T.target,P=[...p.branches].some(J=>J.contains(A));!_||P||(r?.(T),d?.(T),T.defaultPrevented||f?.())},x),M=pR(T=>{const A=T.target;[...p.branches].some(J=>J.contains(A))||(c?.(T),d?.(T),T.defaultPrevented||f?.())},x);return lR(T=>{E===p.layers.size-1&&(a?.(T),!T.defaultPrevented&&f&&(T.preventDefault(),f()))},x),N.useEffect(()=>{if(v)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Yx=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),Jx(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=Yx)}},[v,x,s,p]),N.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),Jx())},[v,p]),N.useEffect(()=>{const T=()=>b({});return document.addEventListener(Sm,T),()=>document.removeEventListener(Sm,T)},[]),o.jsx(Zs.div,{...m,ref:w,style:{pointerEvents:R?_?"auto":"none":void 0,...e.style},onFocusCapture:Mi(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Mi(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Mi(e.onPointerDownCapture,L.onPointerDownCapture)})});aj.displayName=cR;var fR="DismissableLayerBranch",hR=N.forwardRef((e,t)=>{const s=N.useContext(ij),a=N.useRef(null),r=_a(t,a);return N.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),o.jsx(Zs.div,{...e,ref:r})});hR.displayName=fR;function mR(e,t=globalThis?.document){const s=sl(e),a=N.useRef(!1),r=N.useRef(()=>{});return N.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let m=function(){rj(uR,s,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=m,t.addEventListener("click",r.current,{once:!0})):m()}else t.removeEventListener("click",r.current);a.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function pR(e,t=globalThis?.document){const s=sl(e),a=N.useRef(!1);return N.useEffect(()=>{const r=c=>{c.target&&!a.current&&rj(dR,s,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,s]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Jx(){const e=new CustomEvent(Sm);document.dispatchEvent(e)}function rj(e,t,s,{discrete:a}){const r=s.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&r.addEventListener(e,t,{once:!0}),a?oR(r,c):r.dispatchEvent(c)}var Uh="focusScope.autoFocusOnMount",Ph="focusScope.autoFocusOnUnmount",Xx={bubbles:!1,cancelable:!0},gR="FocusScope",oj=N.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...d}=e,[f,m]=N.useState(null),p=sl(r),v=sl(c),y=N.useRef(null),x=_a(t,S=>m(S)),b=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(a){let S=function(R){if(b.paused||!f)return;const _=R.target;f.contains(_)?y.current=_:ki(y.current,{select:!0})},C=function(R){if(b.paused||!f)return;const _=R.relatedTarget;_!==null&&(f.contains(_)||ki(y.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const L of R)L.removedNodes.length>0&&ki(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const E=new MutationObserver(k);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),E.disconnect()}}},[a,f,b.paused]),N.useEffect(()=>{if(f){eb.add(b);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Uh,Xx);f.addEventListener(Uh,p),f.dispatchEvent(k),k.defaultPrevented||(yR(jR(lj(f)),{select:!0}),document.activeElement===S&&ki(f))}return()=>{f.removeEventListener(Uh,p),setTimeout(()=>{const k=new CustomEvent(Ph,Xx);f.addEventListener(Ph,v),f.dispatchEvent(k),k.defaultPrevented||ki(S??document.body,{select:!0}),f.removeEventListener(Ph,v),eb.remove(b)},0)}}},[f,p,v,b]);const w=N.useCallback(S=>{if(!s&&!a||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const E=S.currentTarget,[R,_]=vR(E);R&&_?!S.shiftKey&&k===_?(S.preventDefault(),s&&ki(R,{select:!0})):S.shiftKey&&k===R&&(S.preventDefault(),s&&ki(_,{select:!0})):k===E&&S.preventDefault()}},[s,a,b.paused]);return o.jsx(Zs.div,{tabIndex:-1,...d,ref:x,onKeyDown:w})});oj.displayName=gR;function yR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(ki(a,{select:t}),document.activeElement!==s)return}function vR(e){const t=lj(e),s=Wx(t,e),a=Wx(t.reverse(),e);return[s,a]}function lj(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Wx(e,t){for(const s of e)if(!xR(s,{upTo:t}))return s}function xR(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function bR(e){return e instanceof HTMLInputElement&&"select"in e}function ki(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&bR(e)&&t&&e.select()}}var eb=SR();function SR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=tb(e,t),e.unshift(t)},remove(t){e=tb(e,t),e[0]?.resume()}}}function tb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function jR(e){return e.filter(t=>t.tagName!=="A")}var wR="Portal",cj=N.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=N.useState(!1);nl(()=>c(!0),[]);const d=s||r&&globalThis?.document?.body;return d?Tz.createPortal(o.jsx(Zs.div,{...a,ref:t}),d):null});cj.displayName=wR;function NR(e,t){return N.useReducer((s,a)=>t[s][a]??s,e)}var Iu=e=>{const{present:t,children:s}=e,a=CR(t),r=typeof s=="function"?s({present:a.isPresent}):N.Children.only(s),c=_a(a.ref,kR(r));return typeof s=="function"||a.isPresent?N.cloneElement(r,{ref:c}):null};Iu.displayName="Presence";function CR(e){const[t,s]=N.useState(),a=N.useRef(null),r=N.useRef(e),c=N.useRef("none"),d=e?"mounted":"unmounted",[f,m]=NR(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const p=Pc(a.current);c.current=f==="mounted"?p:"none"},[f]),nl(()=>{const p=a.current,v=r.current;if(v!==e){const x=c.current,b=Pc(p);e?m("MOUNT"):b==="none"||p?.display==="none"?m("UNMOUNT"):m(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,m]),nl(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,y=b=>{const S=Pc(a.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(m("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},x=b=>{b.target===t&&(c.current=Pc(a.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(p),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:N.useCallback(p=>{a.current=p?getComputedStyle(p):null,s(p)},[])}}function Pc(e){return e?.animationName||"none"}function kR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var Ih=0;function _R(){N.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nb()),document.body.insertAdjacentElement("beforeend",e[1]??nb()),Ih++,()=>{Ih===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ih--}},[])}function nb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var xs=function(){return xs=Object.assign||function(t){for(var s,a=1,r=arguments.length;a<r;a++){s=arguments[a];for(var c in s)Object.prototype.hasOwnProperty.call(s,c)&&(t[c]=s[c])}return t},xs.apply(this,arguments)};function uj(e,t){var s={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(s[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(s[a[r]]=e[a[r]]);return s}function zR(e,t,s){if(s||arguments.length===2)for(var a=0,r=t.length,c;a<r;a++)(c||!(a in t))&&(c||(c=Array.prototype.slice.call(t,0,a)),c[a]=t[a]);return e.concat(c||Array.prototype.slice.call(t))}var iu="right-scroll-bar-position",au="width-before-scroll-bar",ER="with-scroll-bars-hidden",RR="--removed-body-scroll-bar-size";function Bh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function TR(e,t){var s=N.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(a){var r=s.value;r!==a&&(s.value=a,s.callback(a,r))}}}})[0];return s.callback=t,s.facade}var AR=typeof window<"u"?N.useLayoutEffect:N.useEffect,sb=new WeakMap;function OR(e,t){var s=TR(null,function(a){return e.forEach(function(r){return Bh(r,a)})});return AR(function(){var a=sb.get(s);if(a){var r=new Set(a),c=new Set(e),d=s.current;r.forEach(function(f){c.has(f)||Bh(f,null)}),c.forEach(function(f){r.has(f)||Bh(f,d)})}sb.set(s,e)},[e]),s}function DR(e){return e}function LR(e,t){t===void 0&&(t=DR);var s=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(c){var d=t(c,a);return s.push(d),function(){s=s.filter(function(f){return f!==d})}},assignSyncMedium:function(c){for(a=!0;s.length;){var d=s;s=[],d.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var d=[];if(s.length){var f=s;s=[],f.forEach(c),d=s}var m=function(){var v=d;d=[],v.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(v){d.push(v),p()},filter:function(v){return d=d.filter(v),s}}}};return r}function MR(e){e===void 0&&(e={});var t=LR(null);return t.options=xs({async:!0,ssr:!1},e),t}var dj=function(e){var t=e.sideCar,s=uj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return N.createElement(a,xs({},s))};dj.isSideCarExport=!0;function $R(e,t){return e.useMedium(t),dj}var fj=MR(),qh=function(){},Bu=N.forwardRef(function(e,t){var s=N.useRef(null),a=N.useState({onScrollCapture:qh,onWheelCapture:qh,onTouchMoveCapture:qh}),r=a[0],c=a[1],d=e.forwardProps,f=e.children,m=e.className,p=e.removeScrollBar,v=e.enabled,y=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,R=e.gapMode,_=uj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=x,M=OR([s,t]),T=xs(xs({},_),r);return N.createElement(N.Fragment,null,v&&N.createElement(L,{sideCar:fj,removeScrollBar:p,shards:y,noRelative:b,noIsolation:w,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:R}),d?N.cloneElement(N.Children.only(f),xs(xs({},T),{ref:M})):N.createElement(E,xs({},T,{className:m,ref:M}),f))});Bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bu.classNames={fullWidth:au,zeroRight:iu};var UR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=UR();return t&&e.setAttribute("nonce",t),e}function IR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function BR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qR=function(){var e=0,t=null;return{add:function(s){e==0&&(t=PR())&&(IR(t,s),BR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HR=function(){var e=qR();return function(t,s){N.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},hj=function(){var e=HR(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},GR={left:0,top:0,right:0,gap:0},Hh=function(e){return parseInt(e||"",10)||0},KR=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Hh(s),Hh(a),Hh(r)]},FR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return GR;var t=KR(e),s=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-s+t[2]-t[0])}},ZR=hj(),_r="data-scroll-locked",VR=function(e,t,s,a){var r=e.left,c=e.top,d=e.right,f=e.gap;return s===void 0&&(s="margin"),`
|
|
13
13
|
.`.concat(ER,` {
|
|
14
14
|
overflow: hidden `).concat(a,`;
|
|
15
15
|
padding-right: `).concat(f,"px ").concat(a,`;
|
|
@@ -46,121 +46,121 @@ ${a}`}try{const s=JSON.parse(e);return JSON.stringify(s,null,2)}catch{return e}}
|
|
|
46
46
|
body[`).concat(_r,`] {
|
|
47
47
|
`).concat(RR,": ").concat(f,`px;
|
|
48
48
|
}
|
|
49
|
-
`)},
|
|
49
|
+
`)},ib=function(){var e=parseInt(document.body.getAttribute(_r)||"0",10);return isFinite(e)?e:0},QR=function(){N.useEffect(function(){return document.body.setAttribute(_r,(ib()+1).toString()),function(){var e=ib()-1;e<=0?document.body.removeAttribute(_r):document.body.setAttribute(_r,e.toString())}},[])},YR=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;QR();var c=N.useMemo(function(){return FR(r)},[r]);return N.createElement(ZR,{styles:VR(c,!t,r,s?"":"!important")})},jm=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return jm=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{jm=!1}var gr=jm?{passive:!1}:!1,JR=function(e){return e.tagName==="TEXTAREA"},mj=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!JR(e)&&s[t]==="visible")},XR=function(e){return mj(e,"overflowY")},WR=function(e){return mj(e,"overflowX")},ab=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=pj(e,a);if(r){var c=gj(e,a),d=c[1],f=c[2];if(d>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},eT=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},tT=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},pj=function(e,t){return e==="v"?XR(t):WR(t)},gj=function(e,t){return e==="v"?eT(t):tT(t)},nT=function(e,t){return e==="h"&&t==="rtl"?-1:1},sT=function(e,t,s,a,r){var c=nT(e,window.getComputedStyle(t).direction),d=c*a,f=s.target,m=t.contains(f),p=!1,v=d>0,y=0,x=0;do{if(!f)break;var b=gj(e,f),w=b[0],S=b[1],C=b[2],k=S-C-c*w;(w||k)&&pj(e,f)&&(y+=k,x+=w);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(x)<1)&&(p=!0),p},Bc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},rb=function(e){return[e.deltaX,e.deltaY]},ob=function(e){return e&&"current"in e?e.current:e},iT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},aT=function(e){return`
|
|
50
50
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
51
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
-
`)},rT=0,yr=[];function oT(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(rT++)[0],c=N.useState(hj)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=zR([e.lockRef.current],(e.shards||[]).map(
|
|
52
|
+
`)},rT=0,yr=[];function oT(e){var t=N.useRef([]),s=N.useRef([0,0]),a=N.useRef(),r=N.useState(rT++)[0],c=N.useState(hj)[0],d=N.useRef(e);N.useEffect(function(){d.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=zR([e.lockRef.current],(e.shards||[]).map(ob),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var f=N.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var k=Bc(S),E=s.current,R="deltaX"in S?S.deltaX:E[0]-k[0],_="deltaY"in S?S.deltaY:E[1]-k[1],L,M=S.target,T=Math.abs(R)>Math.abs(_)?"h":"v";if("touches"in S&&T==="h"&&M.type==="range")return!1;var A=window.getSelection(),P=A&&A.anchorNode,J=P?P===M||P.contains(M):!1;if(J)return!1;var Q=ab(T,M);if(!Q)return!0;if(Q?L=T:(L=T==="v"?"h":"v",Q=ab(T,M)),!Q)return!1;if(!a.current&&"changedTouches"in S&&(R||_)&&(a.current=L),!L)return!0;var se=a.current||L;return sT(se,C,S,se==="h"?R:_)},[]),m=N.useCallback(function(S){var C=S;if(!(!yr.length||yr[yr.length-1]!==c)){var k="deltaY"in C?rb(C):Bc(C),E=t.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&iT(L.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(d.current.shards||[]).map(ob).filter(Boolean).filter(function(L){return L.contains(C.target)}),_=R.length>0?f(C,R[0]):!d.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=N.useCallback(function(S,C,k,E){var R={name:S,delta:C,target:k,should:E,shadowParent:lT(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(_){return _!==R})},1)},[]),v=N.useCallback(function(S){s.current=Bc(S),a.current=void 0},[]),y=N.useCallback(function(S){p(S.type,rb(S),S.target,f(S,e.lockRef.current))},[]),x=N.useCallback(function(S){p(S.type,Bc(S),S.target,f(S,e.lockRef.current))},[]);N.useEffect(function(){return yr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",m,gr),document.addEventListener("touchmove",m,gr),document.addEventListener("touchstart",v,gr),function(){yr=yr.filter(function(S){return S!==c}),document.removeEventListener("wheel",m,gr),document.removeEventListener("touchmove",m,gr),document.removeEventListener("touchstart",v,gr)}},[]);var b=e.removeScrollBar,w=e.inert;return N.createElement(N.Fragment,null,w?N.createElement(c,{styles:aT(r)}):null,b?N.createElement(YR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const cT=$R(fj,oT);var yj=N.forwardRef(function(e,t){return N.createElement(Bu,xs({},e,{ref:t,sideCar:cT}))});yj.classNames=Bu.classNames;var uT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vr=new WeakMap,qc=new WeakMap,Hc={},Gh=0,vj=function(e){return e&&(e.host||vj(e.parentNode))},dT=function(e,t){return t.map(function(s){if(e.contains(s))return s;var a=vj(s);return a&&e.contains(a)?a:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},fT=function(e,t,s,a){var r=dT(t,Array.isArray(e)?e:[e]);Hc[s]||(Hc[s]=new WeakMap);var c=Hc[s],d=[],f=new Set,m=new Set(r),p=function(y){!y||f.has(y)||(f.add(y),p(y.parentNode))};r.forEach(p);var v=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(x){if(f.has(x))v(x);else try{var b=x.getAttribute(a),w=b!==null&&b!=="false",S=(vr.get(x)||0)+1,C=(c.get(x)||0)+1;vr.set(x,S),c.set(x,C),d.push(x),S===1&&w&&qc.set(x,!0),C===1&&x.setAttribute(s,"true"),w||x.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",x,k)}})};return v(t),f.clear(),Gh++,function(){d.forEach(function(y){var x=vr.get(y)-1,b=c.get(y)-1;vr.set(y,x),c.set(y,b),x||(qc.has(y)||y.removeAttribute(a),qc.delete(y)),b||y.removeAttribute(s)}),Gh--,Gh||(vr=new WeakMap,vr=new WeakMap,qc=new WeakMap,Hc={})}},hT=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=uT(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),fT(a,r,s,"aria-hidden")):function(){return null}},qu="Dialog",[xj]=ZE(qu),[mT,rs]=xj(qu),bj=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:d=!0}=e,f=N.useRef(null),m=N.useRef(null),[p,v]=XE({prop:a,defaultProp:r??!1,onChange:c,caller:qu});return o.jsx(mT,{scope:t,triggerRef:f,contentRef:m,contentId:$h(),titleId:$h(),descriptionId:$h(),open:p,onOpenChange:v,onOpenToggle:N.useCallback(()=>v(y=>!y),[v]),modal:d,children:s})};bj.displayName=qu;var Sj="DialogTrigger",pT=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Sj,s),c=_a(t,r.triggerRef);return o.jsx(Zs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":yp(r.open),...a,ref:c,onClick:Mi(e.onClick,r.onOpenToggle)})});pT.displayName=Sj;var pp="DialogPortal",[gT,jj]=xj(pp,{forceMount:void 0}),wj=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=rs(pp,t);return o.jsx(gT,{scope:t,forceMount:s,children:N.Children.map(a,d=>o.jsx(Iu,{present:s||c.open,children:o.jsx(cj,{asChild:!0,container:r,children:d})}))})};wj.displayName=pp;var ju="DialogOverlay",Nj=N.forwardRef((e,t)=>{const s=jj(ju,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(ju,e.__scopeDialog);return c.modal?o.jsx(Iu,{present:a||c.open,children:o.jsx(vT,{...r,ref:t})}):null});Nj.displayName=ju;var yT=sj("DialogOverlay.RemoveScroll"),vT=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(ju,s);return o.jsx(yj,{as:yT,allowPinchZoom:!0,shards:[r.contentRef],children:o.jsx(Zs.div,{"data-state":yp(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),Na="DialogContent",Cj=N.forwardRef((e,t)=>{const s=jj(Na,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=rs(Na,e.__scopeDialog);return o.jsx(Iu,{present:a||c.open,children:c.modal?o.jsx(xT,{...r,ref:t}):o.jsx(bT,{...r,ref:t})})});Cj.displayName=Na;var xT=N.forwardRef((e,t)=>{const s=rs(Na,e.__scopeDialog),a=N.useRef(null),r=_a(t,s.contentRef,a);return N.useEffect(()=>{const c=a.current;if(c)return hT(c)},[]),o.jsx(kj,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mi(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Mi(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&c.preventDefault()}),onFocusOutside:Mi(e.onFocusOutside,c=>c.preventDefault())})}),bT=N.forwardRef((e,t)=>{const s=rs(Na,e.__scopeDialog),a=N.useRef(!1),r=N.useRef(!1);return o.jsx(kj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(a.current||s.triggerRef.current?.focus(),c.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const d=c.target;s.triggerRef.current?.contains(d)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&r.current&&c.preventDefault()}})}),kj=N.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...d}=e,f=rs(Na,s),m=N.useRef(null),p=_a(t,m);return _R(),o.jsxs(o.Fragment,{children:[o.jsx(oj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:o.jsx(aj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":yp(f.open),...d,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(ST,{titleId:f.titleId}),o.jsx(wT,{contentRef:m,descriptionId:f.descriptionId})]})]})}),gp="DialogTitle",_j=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(gp,s);return o.jsx(Zs.h2,{id:r.titleId,...a,ref:t})});_j.displayName=gp;var zj="DialogDescription",Ej=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(zj,s);return o.jsx(Zs.p,{id:r.descriptionId,...a,ref:t})});Ej.displayName=zj;var Rj="DialogClose",Tj=N.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=rs(Rj,s);return o.jsx(Zs.button,{type:"button",...a,ref:t,onClick:Mi(e.onClick,()=>r.onOpenChange(!1))})});Tj.displayName=Rj;function yp(e){return e?"open":"closed"}var Aj="DialogTitleWarning",[H4,Oj]=FE(Aj,{contentName:Na,titleName:gp,docsSlug:"dialog"}),ST=({titleId:e})=>{const t=Oj(Aj),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
53
53
|
|
|
54
54
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
55
55
|
|
|
56
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},jT="DialogDescriptionWarning",wT=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oj(jT).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Lj=bj,Dj=wj,yp=Nj,vp=Cj,xp=_j,Mj=Ej,$j=Tj;const NT=Lj,CT=Dj,Uj=N.forwardRef(({className:e,...t},s)=>o.jsx(yp,{ref:s,className:Qn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));Uj.displayName=yp.displayName;const kT=400,_T=1200,zT=720,Pj=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(zT),d=N.useRef(!1),f=N.useRef(0),m=N.useRef(0),p=N.useCallback(x=>{d.current=!0,f.current=x.clientX,m.current=r,x.target.setPointerCapture(x.pointerId),x.preventDefault()},[r]),v=N.useCallback(x=>{if(!d.current)return;const b=f.current-x.clientX,w=Math.min(_T,Math.max(kT,m.current+b));c(w)},[]),y=N.useCallback(()=>{d.current=!1},[]);return o.jsxs(CT,{children:[o.jsx(Uj,{}),o.jsxs(vp,{ref:a,className:Qn("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${r}px, 100vw)`},...s,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:p,onPointerMove:v,onPointerUp:y}),t,o.jsxs($j,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[o.jsx($u,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Pj.displayName=vp.displayName;const ET=({className:e,...t})=>o.jsx("div",{className:Qn("flex flex-col gap-1.5 pr-10",e),...t}),Ij=N.forwardRef(({className:e,...t},s)=>o.jsx(xp,{ref:s,className:Qn("text-lg font-medium text-zinc-50",e),...t}));Ij.displayName=xp.displayName;const Bj=N.forwardRef(({className:e,...t},s)=>o.jsx(Mj,{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));Bj.displayName=Mj.displayName;function RT({title:e,subtitle:t,children:s,open:a,onClose:r}){return o.jsx(NT,{open:a,onOpenChange:c=>c?void 0:r(),children:o.jsxs(Pj,{children:[o.jsxs(ET,{className:"drawer-head",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),o.jsx(Ij,{id:"drawer-title",children:e}),o.jsx(Bj,{className:"sr-only",children:t})]}),o.jsx("div",{className:"drawer-body",children:s})]})})}function te(e,t,s){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const p=d.prototype,v=Object.keys(p);for(let y=0;y<v.length;y++){const x=v[y];x in f||(f[x]=p[x].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var m;const p=s?.Parent?new c:this;a(p,f),(m=p._zod).deferred??(m.deferred=[]);for(const v of p._zod.deferred)v();return p}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class zr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Hj={};function Pi(e){return Hj}function Gj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,r])=>t.indexOf(+a)===-1).map(([a,r])=>r)}function jm(e,t){return typeof t=="bigint"?t.toString():t}function bp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Sp(e){return e==null}function jp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function TT(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m?.[1]&&(r=Number.parseInt(m[1]))}const c=s>r?s:r,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const ob=Symbol("evaluating");function st(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==ob)return a===void 0&&(a=ob,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ea(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Hi(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function lb(e){return JSON.stringify(e)}function AT(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Kj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const OT=bp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ar(e){if(wu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(wu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Fj(e){return Ar(e)?{...e}:Array.isArray(e)?[...e]:e}const LT=new Set(["string","number","symbol"]);function Or(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function we(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function DT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const MT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $T(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Hi(e._zod.def,{get shape(){const d={};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(d[f]=s.shape[f])}return Ea(this,"shape",d),d},checks:[]});return Gi(e,c)}function UT(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Hi(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete d[f]}return Ea(this,"shape",d),d},checks:[]});return Gi(e,c)}function PT(e,t){if(!Ar(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const c=e._zod.def.shape;for(const d in t)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Hi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ea(this,"shape",c),c}});return Gi(e,r)}function IT(e,t){if(!Ar(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=Hi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ea(this,"shape",a),a}});return Gi(e,s)}function BT(e,t){const s=Hi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ea(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Gi(e,s)}function qT(e,t,s){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Hi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(s)for(const p in s){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);s[p]&&(m[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)m[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return Ea(this,"shape",m),m},checks:[]});return Gi(t,d)}function HT(e,t,s){const a=Hi(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const d in s){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(c[d]=new e({type:"nonoptional",innerType:r[d]}))}else for(const d in r)c[d]=new e({type:"nonoptional",innerType:r[d]});return Ea(this,"shape",c),c}});return Gi(t,a)}function jr(e,t=0){if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(e.issues[s]?.continue!==!0)return!0;return!1}function wr(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Gc(e){return typeof e=="string"?e:e?.message}function Ii(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Gc(e.inst?._zod.def?.error?.(e))??Gc(t?.error?.(e))??Gc(s.customError?.(e))??Gc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function wp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function il(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const Zj=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,jm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vj=te("$ZodError",Zj),Qj=te("$ZodError",Zj,{Parent:Error});function GT(e,t=s=>s.message){const s={},a=[];for(const r of e.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:s}}function KT(e,t=s=>s.message){const s={_errors:[]},a=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>a({issues:d}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)s._errors.push(t(c));else{let d=s,f=0;for(;f<c.path.length;){const m=c.path[f];f===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(t(c))):d[m]=d[m]||{_errors:[]},d=d[m],f++}}};return a(e),s}const Np=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new zr;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(m=>Ii(m,c,Pi())));throw Kj(f,r?.callee),f}return d.value},Cp=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(r?.Err??e)(d.issues.map(m=>Ii(m,c,Pi())));throw Kj(f,r?.callee),f}return d.value},Hu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new zr;return c.issues.length?{success:!1,error:new(e??Vj)(c.issues.map(d=>Ii(d,r,Pi())))}:{success:!0,data:c.value}},FT=Hu(Qj),Gu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ii(d,r,Pi())))}:{success:!0,data:c.value}},ZT=Gu(Qj),VT=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Np(e)(t,s,r)},QT=e=>(t,s,a)=>Np(e)(t,s,a),YT=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Cp(e)(t,s,r)},JT=e=>async(t,s,a)=>Cp(e)(t,s,a),XT=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hu(e)(t,s,r)},WT=e=>(t,s,a)=>Hu(e)(t,s,a),eA=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gu(e)(t,s,r)},tA=e=>async(t,s,a)=>Gu(e)(t,s,a),nA=/^[cC][^\s-]{8,}$/,sA=/^[0-9a-z]+$/,iA=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aA=/^[0-9a-vA-V]{20}$/,rA=/^[A-Za-z0-9]{27}$/,oA=/^[a-zA-Z0-9_-]{21}$/,lA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cA=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cb=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,uA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fA(){return new RegExp(dA,"u")}const hA=/^(?:(?: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])$/,mA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,pA=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yj=/^[A-Za-z0-9_-]*$/,vA=/^\+[1-9]\d{6,14}$/,Jj="(?:(?:\\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])))",xA=new RegExp(`^${Jj}$`);function Xj(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bA(e){return new RegExp(`^${Xj(e)}$`)}function SA(e){const t=Xj({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${s.join("|")})`;return new RegExp(`^${Jj}T(?:${a})$`)}const jA=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},wA=/^-?\d+$/,Wj=/^-?\d+(?:\.\d+)?$/,NA=/^(?:true|false)$/i,CA=/^[^A-Z]*$/,kA=/^[^a-z]*$/,Nn=te("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),ew={number:"number",bigint:"bigint",object:"date"},tw=te("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:s,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nw=te("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:s,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_A=te("$ZodCheckMultipleOf",(e,t)=>{Nn.init(e,t),e._zod.onattach.push(s=>{var a;(a=s._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=s=>{if(typeof s.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%t.value===BigInt(0):TT(s.value,t.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:t.value,input:s.value,inst:e,continue:!t.abort})}}),zA=te("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=MT[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=r,f.maximum=c,s&&(f.pattern=wA)}),e._zod.check=d=>{const f=d.value;if(s){if(!Number.isInteger(f)){d.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}f<r&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),f>c&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),EA=te("$ZodCheckMaxLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!Sp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const d=wp(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),RA=te("$ZodCheckMinLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!Sp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const d=wp(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),TA=te("$ZodCheckLengthEquals",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!Sp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,c=r.length;if(c===t.length)return;const d=wp(r),f=c>t.length;a.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Ku=te("$ZodCheckStringFormat",(e,t)=>{var s,a;Nn.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(s=e._zod).check??(s.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),AA=te("$ZodCheckRegex",(e,t)=>{Ku.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),OA=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=CA),Ku.init(e,t)}),LA=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kA),Ku.init(e,t)}),DA=te("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const s=Or(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${s}`:s);t.pattern=a,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),MA=te("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`^${Or(t.prefix)}.*`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),$A=te("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`.*${Or(t.suffix)}$`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),UA=te("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class PA{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
56
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return N.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},jT="DialogDescriptionWarning",wT=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oj(jT).contentName}}.`;return N.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},Dj=bj,Lj=wj,vp=Nj,xp=Cj,bp=_j,Mj=Ej,$j=Tj;const NT=Dj,CT=Lj,Uj=N.forwardRef(({className:e,...t},s)=>o.jsx(vp,{ref:s,className:Qn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));Uj.displayName=vp.displayName;const kT=400,_T=1200,zT=720,Pj=N.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=N.useState(zT),d=N.useRef(!1),f=N.useRef(0),m=N.useRef(0),p=N.useCallback(x=>{d.current=!0,f.current=x.clientX,m.current=r,x.target.setPointerCapture(x.pointerId),x.preventDefault()},[r]),v=N.useCallback(x=>{if(!d.current)return;const b=f.current-x.clientX,w=Math.min(_T,Math.max(kT,m.current+b));c(w)},[]),y=N.useCallback(()=>{d.current=!1},[]);return o.jsxs(CT,{children:[o.jsx(Uj,{}),o.jsxs(xp,{ref:a,className:Qn("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${r}px, 100vw)`},...s,children:[o.jsx("div",{className:"absolute inset-y-0 left-0 w-1.5 cursor-col-resize hover:bg-zinc-700/50 active:bg-zinc-600/50 transition-colors max-md:hidden",onPointerDown:p,onPointerMove:v,onPointerUp:y}),t,o.jsxs($j,{className:"absolute right-4 top-4 inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-900 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[o.jsx($u,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Pj.displayName=xp.displayName;const ET=({className:e,...t})=>o.jsx("div",{className:Qn("flex flex-col gap-1.5 pr-10",e),...t}),Ij=N.forwardRef(({className:e,...t},s)=>o.jsx(bp,{ref:s,className:Qn("text-lg font-medium text-zinc-50",e),...t}));Ij.displayName=bp.displayName;const Bj=N.forwardRef(({className:e,...t},s)=>o.jsx(Mj,{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));Bj.displayName=Mj.displayName;function RT({title:e,subtitle:t,children:s,open:a,onClose:r}){return o.jsx(NT,{open:a,onOpenChange:c=>c?void 0:r(),children:o.jsxs(Pj,{children:[o.jsxs(ET,{className:"drawer-head",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),o.jsx(Ij,{id:"drawer-title",children:e}),o.jsx(Bj,{className:"sr-only",children:t})]}),o.jsx("div",{className:"drawer-body",children:s})]})})}function te(e,t,s){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:d,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const p=d.prototype,v=Object.keys(p);for(let y=0;y<v.length;y++){const x=v[y];x in f||(f[x]=p[x].bind(f))}}const r=s?.Parent??Object;class c extends r{}Object.defineProperty(c,"name",{value:e});function d(f){var m;const p=s?.Parent?new c:this;a(p,f),(m=p._zod).deferred??(m.deferred=[]);for(const v of p._zod.deferred)v();return p}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class zr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class qj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Hj={};function Pi(e){return Hj}function Gj(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,r])=>t.indexOf(+a)===-1).map(([a,r])=>r)}function wm(e,t){return typeof t=="bigint"?t.toString():t}function Sp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function jp(e){return e==null}function wp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function TT(e,t){const s=(e.toString().split(".")[1]||"").length,a=t.toString();let r=(a.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m?.[1]&&(r=Number.parseInt(m[1]))}const c=s>r?s:r,d=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return d%f/10**c}const lb=Symbol("evaluating");function st(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==lb)return a===void 0&&(a=lb,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ea(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function Hi(...e){const t={};for(const s of e){const a=Object.getOwnPropertyDescriptors(s);Object.assign(t,a)}return Object.defineProperties({},t)}function cb(e){return JSON.stringify(e)}function AT(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Kj="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const OT=Sp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ar(e){if(wu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(wu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function Fj(e){return Ar(e)?{...e}:Array.isArray(e)?[...e]:e}const DT=new Set(["string","number","symbol"]);function Or(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function we(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function LT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const MT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $T(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Hi(e._zod.def,{get shape(){const d={};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(d[f]=s.shape[f])}return Ea(this,"shape",d),d},checks:[]});return Gi(e,c)}function UT(e,t){const s=e._zod.def,a=s.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Hi(e._zod.def,{get shape(){const d={...e._zod.def.shape};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete d[f]}return Ea(this,"shape",d),d},checks:[]});return Gi(e,c)}function PT(e,t){if(!Ar(t))throw new Error("Invalid input to extend: expected a plain object");const s=e._zod.def.checks;if(s&&s.length>0){const c=e._zod.def.shape;for(const d in t)if(Object.getOwnPropertyDescriptor(c,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=Hi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ea(this,"shape",c),c}});return Gi(e,r)}function IT(e,t){if(!Ar(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=Hi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ea(this,"shape",a),a}});return Gi(e,s)}function BT(e,t){const s=Hi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ea(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Gi(e,s)}function qT(e,t,s){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=Hi(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(s)for(const p in s){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);s[p]&&(m[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)m[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return Ea(this,"shape",m),m},checks:[]});return Gi(t,d)}function HT(e,t,s){const a=Hi(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const d in s){if(!(d in c))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(c[d]=new e({type:"nonoptional",innerType:r[d]}))}else for(const d in r)c[d]=new e({type:"nonoptional",innerType:r[d]});return Ea(this,"shape",c),c}});return Gi(t,a)}function jr(e,t=0){if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(e.issues[s]?.continue!==!0)return!0;return!1}function wr(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Gc(e){return typeof e=="string"?e:e?.message}function Ii(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Gc(e.inst?._zod.def?.error?.(e))??Gc(t?.error?.(e))??Gc(s.customError?.(e))??Gc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Np(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function il(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const Zj=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,wm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Vj=te("$ZodError",Zj),Qj=te("$ZodError",Zj,{Parent:Error});function GT(e,t=s=>s.message){const s={},a=[];for(const r of e.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:s}}function KT(e,t=s=>s.message){const s={_errors:[]},a=r=>{for(const c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(d=>a({issues:d}));else if(c.code==="invalid_key")a({issues:c.issues});else if(c.code==="invalid_element")a({issues:c.issues});else if(c.path.length===0)s._errors.push(t(c));else{let d=s,f=0;for(;f<c.path.length;){const m=c.path[f];f===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(t(c))):d[m]=d[m]||{_errors:[]},d=d[m],f++}}};return a(e),s}const Cp=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise)throw new zr;if(d.issues.length){const f=new(r?.Err??e)(d.issues.map(m=>Ii(m,c,Pi())));throw Kj(f,r?.callee),f}return d.value},kp=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let d=t._zod.run({value:s,issues:[]},c);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(r?.Err??e)(d.issues.map(m=>Ii(m,c,Pi())));throw Kj(f,r?.callee),f}return d.value},Hu=e=>(t,s,a)=>{const r=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new zr;return c.issues.length?{success:!1,error:new(e??Vj)(c.issues.map(d=>Ii(d,r,Pi())))}:{success:!0,data:c.value}},FT=Hu(Qj),Gu=e=>async(t,s,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:s,issues:[]},r);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(d=>Ii(d,r,Pi())))}:{success:!0,data:c.value}},ZT=Gu(Qj),VT=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Cp(e)(t,s,r)},QT=e=>(t,s,a)=>Cp(e)(t,s,a),YT=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return kp(e)(t,s,r)},JT=e=>async(t,s,a)=>kp(e)(t,s,a),XT=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Hu(e)(t,s,r)},WT=e=>(t,s,a)=>Hu(e)(t,s,a),eA=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Gu(e)(t,s,r)},tA=e=>async(t,s,a)=>Gu(e)(t,s,a),nA=/^[cC][^\s-]{8,}$/,sA=/^[0-9a-z]+$/,iA=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,aA=/^[0-9a-vA-V]{20}$/,rA=/^[A-Za-z0-9]{27}$/,oA=/^[a-zA-Z0-9_-]{21}$/,lA=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cA=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ub=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,uA=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,dA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function fA(){return new RegExp(dA,"u")}const hA=/^(?:(?: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])$/,mA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,pA=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,gA=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,yA=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yj=/^[A-Za-z0-9_-]*$/,vA=/^\+[1-9]\d{6,14}$/,Jj="(?:(?:\\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])))",xA=new RegExp(`^${Jj}$`);function Xj(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bA(e){return new RegExp(`^${Xj(e)}$`)}function SA(e){const t=Xj({precision:e.precision}),s=["Z"];e.local&&s.push(""),e.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${s.join("|")})`;return new RegExp(`^${Jj}T(?:${a})$`)}const jA=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},wA=/^-?\d+$/,Wj=/^-?\d+(?:\.\d+)?$/,NA=/^(?:true|false)$/i,CA=/^[^A-Z]*$/,kA=/^[^a-z]*$/,Nn=te("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),ew={number:"number",bigint:"bigint",object:"date"},tw=te("$ZodCheckLessThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:s,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nw=te("$ZodCheckGreaterThan",(e,t)=>{Nn.init(e,t);const s=ew[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,c=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:s,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_A=te("$ZodCheckMultipleOf",(e,t)=>{Nn.init(e,t),e._zod.onattach.push(s=>{var a;(a=s._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=s=>{if(typeof s.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%t.value===BigInt(0):TT(s.value,t.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:t.value,input:s.value,inst:e,continue:!t.abort})}}),zA=te("$ZodCheckNumberFormat",(e,t)=>{Nn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=MT[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=r,f.maximum=c,s&&(f.pattern=wA)}),e._zod.check=d=>{const f=d.value;if(s){if(!Number.isInteger(f)){d.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}f<r&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),f>c&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),EA=te("$ZodCheckMaxLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!jp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const d=Np(r);a.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),RA=te("$ZodCheckMinLength",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!jp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const d=Np(r);a.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),TA=te("$ZodCheckLengthEquals",(e,t)=>{var s;Nn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!jp(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,c=r.length;if(c===t.length)return;const d=Np(r),f=c>t.length;a.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Ku=te("$ZodCheckStringFormat",(e,t)=>{var s,a;Nn.init(e,t),e._zod.onattach.push(r=>{const c=r._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(s=e._zod).check??(s.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),AA=te("$ZodCheckRegex",(e,t)=>{Ku.init(e,t),e._zod.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),OA=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=CA),Ku.init(e,t)}),DA=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kA),Ku.init(e,t)}),LA=te("$ZodCheckIncludes",(e,t)=>{Nn.init(e,t);const s=Or(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${s}`:s);t.pattern=a,e._zod.onattach.push(r=>{const c=r._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),MA=te("$ZodCheckStartsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`^${Or(t.prefix)}.*`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),$A=te("$ZodCheckEndsWith",(e,t)=>{Nn.init(e,t);const s=new RegExp(`.*${Or(t.suffix)}$`);t.pattern??(t.pattern=s),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(s)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),UA=te("$ZodCheckOverwrite",(e,t)=>{Nn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class PA{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
|
|
57
57
|
`).filter(d=>d),r=Math.min(...a.map(d=>d.length-d.trimStart().length)),c=a.map(d=>d.slice(r)).map(d=>" ".repeat(this.indent*2)+d);for(const d of c)this.content.push(d)}compile(){const t=Function,s=this?.args,r=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...s,r.join(`
|
|
58
|
-
`))}}const IA={major:4,minor:3,patch:6},bt=te("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=IA;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const c of r._zod.onattach)c(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(d,f,m)=>{let p=jr(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(p)continue;const x=d.issues.length,b=y._zod.check(d);if(b instanceof Promise&&m?.async===!1)throw new zr;if(v||b instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await b,d.issues.length!==x&&(p||(p=jr(d,x)))});else{if(d.issues.length===x)continue;p||(p=jr(d,x))}}return v?v.then(()=>d):d},c=(d,f,m)=>{if(jr(d))return d.aborted=!0,d;const p=r(f,a,m);if(p instanceof Promise){if(m.async===!1)throw new zr;return p.then(v=>e._zod.parse(v,m))}return e._zod.parse(p,m)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const p=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(v=>c(v,d,f)):c(p,d,f)}const m=e._zod.parse(d,f);if(m instanceof Promise){if(f.async===!1)throw new zr;return m.then(p=>r(p,a,f))}return r(m,a,f)}}st(e,"~standard",()=>({validate:r=>{try{const c=FT(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return ZT(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),
|
|
58
|
+
`))}}const IA={major:4,minor:3,patch:6},bt=te("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=IA;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const c of r._zod.onattach)c(e);if(a.length===0)(s=e._zod).deferred??(s.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(d,f,m)=>{let p=jr(d),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(d))continue}else if(p)continue;const x=d.issues.length,b=y._zod.check(d);if(b instanceof Promise&&m?.async===!1)throw new zr;if(v||b instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await b,d.issues.length!==x&&(p||(p=jr(d,x)))});else{if(d.issues.length===x)continue;p||(p=jr(d,x))}}return v?v.then(()=>d):d},c=(d,f,m)=>{if(jr(d))return d.aborted=!0,d;const p=r(f,a,m);if(p instanceof Promise){if(m.async===!1)throw new zr;return p.then(v=>e._zod.parse(v,m))}return e._zod.parse(p,m)};e._zod.run=(d,f)=>{if(f.skipChecks)return e._zod.parse(d,f);if(f.direction==="backward"){const p=e._zod.parse({value:d.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(v=>c(v,d,f)):c(p,d,f)}const m=e._zod.parse(d,f);if(m instanceof Promise){if(f.async===!1)throw new zr;return m.then(p=>r(p,a,f))}return r(m,a,f)}}st(e,"~standard",()=>({validate:r=>{try{const c=FT(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return ZT(e,r).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),_p=te("$ZodString",(e,t)=>{bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??jA(e._zod.bag),e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),xt=te("$ZodStringFormat",(e,t)=>{Ku.init(e,t),_p.init(e,t)}),BA=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=cA),xt.init(e,t)}),qA=te("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ub(a))}else t.pattern??(t.pattern=ub());xt.init(e,t)}),HA=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=uA),xt.init(e,t)}),GA=te("$ZodURL",(e,t)=>{xt.init(e,t),e._zod.check=s=>{try{const a=s.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:s.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:s.value,inst:e,continue:!t.abort})),t.normalize?s.value=r.href:s.value=a;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:e,continue:!t.abort})}}}),KA=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=fA()),xt.init(e,t)}),FA=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=oA),xt.init(e,t)}),ZA=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nA),xt.init(e,t)}),VA=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=sA),xt.init(e,t)}),QA=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=iA),xt.init(e,t)}),YA=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=aA),xt.init(e,t)}),JA=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=rA),xt.init(e,t)}),XA=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=SA(t)),xt.init(e,t)}),WA=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xA),xt.init(e,t)}),eO=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=bA(t)),xt.init(e,t)}),tO=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=lA),xt.init(e,t)}),nO=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hA),xt.init(e,t),e._zod.bag.format="ipv4"}),sO=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mA),xt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:e,continue:!t.abort})}}}),iO=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pA),xt.init(e,t)}),aO=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gA),xt.init(e,t),e._zod.check=s=>{const a=s.value.split("/");try{if(a.length!==2)throw new Error;const[r,c]=a;if(!c)throw new Error;const d=Number(c);if(`${d}`!==c)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${r}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:e,continue:!t.abort})}}});function sw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const rO=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yA),xt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{sw(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function oO(e){if(!Yj.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return sw(s)}const lO=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yj),xt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{oO(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),cO=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vA),xt.init(e,t)});function uO(e,t=null){try{const s=e.split(".");if(s.length!==3)return!1;const[a]=s;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}const dO=te("$ZodJWT",(e,t)=>{xt.init(e,t),e._zod.check=s=>{uO(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),iw=te("$ZodNumber",(e,t)=>{bt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wj,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=Number(s.value)}catch{}const r=s.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return s;const c=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...c?{received:c}:{}}),s}}),fO=te("$ZodNumberFormat",(e,t)=>{zA.init(e,t),iw.init(e,t)}),hO=te("$ZodBoolean",(e,t)=>{bt.init(e,t),e._zod.pattern=NA,e._zod.parse=(s,a)=>{if(t.coerce)try{s.value=!!s.value}catch{}const r=s.value;return typeof r=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),s}}),mO=te("$ZodUnknown",(e,t)=>{bt.init(e,t),e._zod.parse=s=>s}),pO=te("$ZodNever",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function db(e,t,s){e.issues.length&&t.issues.push(...wr(s,e.issues)),t.value[s]=e.value}const gO=te("$ZodArray",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Array.isArray(r))return s.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),s;s.value=Array(r.length);const c=[];for(let d=0;d<r.length;d++){const f=r[d],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?c.push(m.then(p=>db(p,s,d))):db(m,s,d)}return c.length?Promise.all(c).then(()=>s):s}});function Nu(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...wr(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function aw(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const s=LT(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function rw(e,t,s,a,r,c){const d=[],f=r.keySet,m=r.catchall._zod,p=m.def.type,v=m.optout==="optional";for(const y in t){if(f.has(y))continue;if(p==="never"){d.push(y);continue}const x=m.run({value:t[y],issues:[]},a);x instanceof Promise?e.push(x.then(b=>Nu(b,s,y,t,v))):Nu(x,s,y,t,v)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const yO=te("$ZodObject",(e,t)=>{if(bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const m={...f};return Object.defineProperty(t,"shape",{value:m}),m}})}const a=Sp(()=>aw(t));st(e._zod,"propValues",()=>{const f=t.shape,m={};for(const p in f){const v=f[p]._zod;if(v.values){m[p]??(m[p]=new Set);for(const y of v.values)m[p].add(y)}}return m});const r=wu,c=t.catchall;let d;e._zod.parse=(f,m)=>{d??(d=a.value);const p=f.value;if(!r(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const v=[],y=d.shape;for(const x of d.keys){const b=y[x],w=b._zod.optout==="optional",S=b._zod.run({value:p[x],issues:[]},m);S instanceof Promise?v.push(S.then(C=>Nu(C,f,x,p,w))):Nu(S,f,x,p,w)}return c?rw(v,p,f,m,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),vO=te("$ZodObjectJIT",(e,t)=>{yO.init(e,t);const s=e._zod.parse,a=Sp(()=>aw(t)),r=x=>{const b=new PA(["shape","payload","ctx"]),w=a.value,S=R=>{const _=cb(R);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};b.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const R of w.keys)C[R]=`key_${k++}`;b.write("const newResult = {};");for(const R of w.keys){const _=C[R],L=cb(R),T=x[R]?._zod?.optout==="optional";b.write(`const ${_} = ${S(R)};`),T?b.write(`
|
|
59
59
|
if (${_}.issues.length) {
|
|
60
|
-
if (${
|
|
60
|
+
if (${L} in input) {
|
|
61
61
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
62
62
|
...iss,
|
|
63
|
-
path: iss.path ? [${
|
|
63
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
64
64
|
})));
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
if (${_}.value === undefined) {
|
|
69
|
-
if (${
|
|
70
|
-
newResult[${
|
|
69
|
+
if (${L} in input) {
|
|
70
|
+
newResult[${L}] = undefined;
|
|
71
71
|
}
|
|
72
72
|
} else {
|
|
73
|
-
newResult[${
|
|
73
|
+
newResult[${L}] = ${_}.value;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
`):b.write(`
|
|
77
77
|
if (${_}.issues.length) {
|
|
78
78
|
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
|
|
79
79
|
...iss,
|
|
80
|
-
path: iss.path ? [${
|
|
80
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
81
81
|
})));
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
if (${_}.value === undefined) {
|
|
85
|
-
if (${
|
|
86
|
-
newResult[${
|
|
85
|
+
if (${L} in input) {
|
|
86
|
+
newResult[${L}] = undefined;
|
|
87
87
|
}
|
|
88
88
|
} else {
|
|
89
|
-
newResult[${
|
|
89
|
+
newResult[${L}] = ${_}.value;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const E=b.compile();return(R,_)=>E(x,R,_)};let c;const d=wu,f=!Hj.jitless,p=f&&OT.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const w=x.value;return d(w)?f&&p&&b?.async===!1&&b.jitless!==!0?(c||(c=r(t.shape)),x=c(x,b),v?rw([],w,x,b,y,e):x):s(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),x)}});function db(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!jr(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(d=>Ii(d,a,Pi())))}),t)}const xO=te("$ZodUnion",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),st(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),st(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),st(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>jp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let d=!1;const f=[];for(const m of t.options){const p=m._zod.run({value:r.value,issues:[]},c);if(p instanceof Promise)f.push(p),d=!0;else{if(p.issues.length===0)return p;f.push(p)}}return d?Promise.all(f).then(m=>db(m,r,e,c)):db(f,r,e,c)}}),bO=te("$ZodIntersection",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),d=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([m,p])=>fb(s,m,p)):fb(s,c,d)}});function wm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ar(e)&&Ar(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const d=wm(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};r[c]=d.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let a=0;a<e.length;a++){const r=e[a],c=t[a],d=wm(r,c);if(!d.valid)return{valid:!1,mergeErrorPath:[a,...d.mergeErrorPath]};s.push(d.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function fb(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),jr(e))return e;const d=wm(t.value,s.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const SO=te("$ZodRecord",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Ar(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const p of d)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const v=t.valueType._zod.run({value:r[p],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(p,y.issues)),s.value[p]=y.value})):(v.issues.length&&s.issues.push(...wr(p,v.issues)),s.value[p]=v.value)}let m;for(const p in r)f.has(p)||(m=m??[],m.push(p));m&&m.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:m})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Wj.test(f)&&m.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(m=y)}if(m.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>Ii(y,a,Pi())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:r[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(f,y.issues)),s.value[m.value]=y.value})):(v.issues.length&&s.issues.push(...wr(f,v.issues)),s.value[m.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),jO=te("$ZodEnum",(e,t)=>{bt.init(e,t);const s=Gj(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>LT.has(typeof r)).map(r=>typeof r=="string"?Or(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const d=r.value;return a.has(d)||r.issues.push({code:"invalid_value",values:s,input:d,inst:e}),r}}),wO=te("$ZodLiteral",(e,t)=>{if(bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(t.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Or(a):a?Or(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),NO=te("$ZodTransform",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(d=>(s.value=d,s));if(r instanceof Promise)throw new zr;return s.value=r,s}});function hb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ow=te("$ZodOptional",(e,t)=>{bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${jp(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>hb(c,s.value)):hb(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),CO=te("$ZodExactOptional",(e,t)=>{ow.init(e,t),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),kO=te("$ZodNullable",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${jp(s.source)}|null)$`):void 0}),st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(s,a)=>s.value===null?s:t.innerType._zod.run(s,a)}),_O=te("$ZodDefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);if(s.value===void 0)return s.value=t.defaultValue,s;const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>mb(c,t)):mb(r,t)}});function mb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zO=te("$ZodPrefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>(a.direction==="backward"||s.value===void 0&&(s.value=t.defaultValue),t.innerType._zod.run(s,a))}),EO=te("$ZodNonOptional",(e,t)=>{bt.init(e,t),st(e._zod,"values",()=>{const s=t.innerType._zod.values;return s?new Set([...s].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,a)=>{const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>pb(c,e)):pb(r,e)}});function pb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const RO=te("$ZodCatch",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(d=>Ii(d,a,Pi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Ii(c,a,Pi()))},input:s.value}),s.issues=[]),s)}}),TO=te("$ZodPipe",(e,t)=>{bt.init(e,t),st(e._zod,"values",()=>t.in._zod.values),st(e._zod,"optin",()=>t.in._zod.optin),st(e._zod,"optout",()=>t.out._zod.optout),st(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(s,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(s,a);return c instanceof Promise?c.then(d=>Kc(d,t.in,a)):Kc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Kc(c,t.out,a)):Kc(r,t.out,a)}});function Kc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const AO=te("$ZodReadonly",(e,t)=>{bt.init(e,t),st(e._zod,"propValues",()=>t.innerType._zod.propValues),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"optin",()=>t.innerType?._zod?.optin),st(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(gb):gb(r)}});function gb(e){return e.value=Object.freeze(e.value),e}const OO=te("$ZodCustom",(e,t)=>{Nn.init(e,t),bt.init(e,t),e._zod.parse=(s,a)=>s,e._zod.check=s=>{const a=s.value,r=t.fn(a);if(r instanceof Promise)return r.then(c=>yb(c,s,a,e));yb(r,s,a,e)}});function yb(e,t,s,a){if(!e){const r={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(il(r))}}var vb;class LO{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const a=s[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const a={...this.get(s)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function DO(){return new LO}(vb=globalThis).__zod_globalRegistry??(vb.__zod_globalRegistry=DO());const Ho=globalThis.__zod_globalRegistry;function MO(e,t){return new e({type:"string",...we(t)})}function $O(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function xb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function UO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function PO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function IO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function BO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function qO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function HO(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function GO(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function KO(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function FO(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function ZO(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function VO(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function QO(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function YO(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function JO(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function XO(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function WO(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function e5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function t5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function n5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function s5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function i5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function a5(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function r5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function o5(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function l5(e,t){return new e({type:"number",checks:[],...we(t)})}function c5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function u5(e,t){return new e({type:"boolean",...we(t)})}function d5(e){return new e({type:"unknown"})}function f5(e,t){return new e({type:"never",...we(t)})}function bb(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!1})}function Kh(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!0})}function Sb(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!1})}function Fh(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!0})}function jb(e,t){return new _A({check:"multiple_of",...we(t),value:e})}function lw(e,t){return new EA({check:"max_length",...we(t),maximum:e})}function Cu(e,t){return new RA({check:"min_length",...we(t),minimum:e})}function cw(e,t){return new TA({check:"length_equals",...we(t),length:e})}function h5(e,t){return new AA({check:"string_format",format:"regex",...we(t),pattern:e})}function m5(e){return new OA({check:"string_format",format:"lowercase",...we(e)})}function p5(e){return new LA({check:"string_format",format:"uppercase",...we(e)})}function g5(e,t){return new DA({check:"string_format",format:"includes",...we(t),includes:e})}function y5(e,t){return new MA({check:"string_format",format:"starts_with",...we(t),prefix:e})}function v5(e,t){return new $A({check:"string_format",format:"ends_with",...we(t),suffix:e})}function Ur(e){return new UA({check:"overwrite",tx:e})}function x5(e){return Ur(t=>t.normalize(e))}function b5(){return Ur(e=>e.trim())}function S5(){return Ur(e=>e.toLowerCase())}function j5(){return Ur(e=>e.toUpperCase())}function w5(){return Ur(e=>AT(e))}function N5(e,t,s){return new e({type:"array",element:t,...we(s)})}function C5(e,t,s){return new e({type:"custom",check:"custom",fn:t,...we(s)})}function k5(e){const t=_5(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(il(a,s.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=s.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),s.issues.push(il(r))}},e(s.value,s)));return t}function _5(e,t){const s=new Nn({check:"custom",...we(t)});return s._zod.check=e,s}function uw(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ho,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function qt(e,t,s={path:[],schemaPath:[]}){var a;const r=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,d);const f=e._zod.toJSONSchema?.();if(f)d.schema=f;else{const v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,v);else{const x=d.schema,b=t.processors[r.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);b(e,t,x,v)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),qt(y,t,v),t.seen.get(y).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(d.schema,m),t.io==="input"&&cn(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&d.schema._prefault&&((a=d.schema).default??(a.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function dw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const m=a.get(f);if(m&&m!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,x=e.external.uri??(w=>w);if(y)return{ref:x(y)};const b=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=b,{defId:b,ref:`${x("__shared")}#/${f}/${b}`}}if(d[1]===s)return{ref:"#"};const p=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:m,defId:p}=r(d);f.def={...f.schema},p&&(f.defId=p);const v=f.schema;for(const y in v)delete v[y];v.$ref=m};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
92
|
+
`)}b.write("payload.value = newResult;"),b.write("return payload;");const E=b.compile();return(R,_)=>E(x,R,_)};let c;const d=wu,f=!Hj.jitless,p=f&&OT.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const w=x.value;return d(w)?f&&p&&b?.async===!1&&b.jitless!==!0?(c||(c=r(t.shape)),x=c(x,b),v?rw([],w,x,b,y,e):x):s(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),x)}});function fb(e,t,s,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const r=e.filter(c=>!jr(c));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:s,errors:e.map(c=>c.issues.map(d=>Ii(d,a,Pi())))}),t)}const xO=te("$ZodUnion",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),st(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),st(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),st(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${r.map(c=>wp(c.source)).join("|")})$`)}});const s=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,c)=>{if(s)return a(r,c);let d=!1;const f=[];for(const m of t.options){const p=m._zod.run({value:r.value,issues:[]},c);if(p instanceof Promise)f.push(p),d=!0;else{if(p.issues.length===0)return p;f.push(p)}}return d?Promise.all(f).then(m=>fb(m,r,e,c)):fb(f,r,e,c)}}),bO=te("$ZodIntersection",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),d=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||d instanceof Promise?Promise.all([c,d]).then(([m,p])=>hb(s,m,p)):hb(s,c,d)}});function Nm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ar(e)&&Ar(t)){const s=Object.keys(t),a=Object.keys(e).filter(c=>s.indexOf(c)!==-1),r={...e,...t};for(const c of a){const d=Nm(e[c],t[c]);if(!d.valid)return{valid:!1,mergeErrorPath:[c,...d.mergeErrorPath]};r[c]=d.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let a=0;a<e.length;a++){const r=e[a],c=t[a],d=Nm(r,c);if(!d.valid)return{valid:!1,mergeErrorPath:[a,...d.mergeErrorPath]};s.push(d.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function hb(e,t,s){const a=new Map;let r;for(const f of t.issues)if(f.code==="unrecognized_keys"){r??(r=f);for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).l=!0}else e.issues.push(f);for(const f of s.issues)if(f.code==="unrecognized_keys")for(const m of f.keys)a.has(m)||a.set(m,{}),a.get(m).r=!0;else e.issues.push(f);const c=[...a].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(c.length&&r&&e.issues.push({...r,keys:c}),jr(e))return e;const d=Nm(t.value,s.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return e.value=d.data,e}const SO=te("$ZodRecord",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Ar(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],d=t.keyType._zod.values;if(d){s.value={};const f=new Set;for(const p of d)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const v=t.valueType._zod.run({value:r[p],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(p,y.issues)),s.value[p]=y.value})):(v.issues.length&&s.issues.push(...wr(p,v.issues)),s.value[p]=v.value)}let m;for(const p in r)f.has(p)||(m=m??[],m.push(p));m&&m.length>0&&s.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:m})}else{s.value={};for(const f of Reflect.ownKeys(r)){if(f==="__proto__")continue;let m=t.keyType._zod.run({value:f,issues:[]},a);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Wj.test(f)&&m.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},a);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(m=y)}if(m.issues.length){t.mode==="loose"?s.value[f]=r[f]:s.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>Ii(y,a,Pi())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:r[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&s.issues.push(...wr(f,y.issues)),s.value[m.value]=y.value})):(v.issues.length&&s.issues.push(...wr(f,v.issues)),s.value[m.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),jO=te("$ZodEnum",(e,t)=>{bt.init(e,t);const s=Gj(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>DT.has(typeof r)).map(r=>typeof r=="string"?Or(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const d=r.value;return a.has(d)||r.issues.push({code:"invalid_value",values:s,input:d,inst:e}),r}}),wO=te("$ZodLiteral",(e,t)=>{if(bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(t.values);e._zod.values=s,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Or(a):a?Or(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,r)=>{const c=a.value;return s.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),NO=te("$ZodTransform",(e,t)=>{bt.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(d=>(s.value=d,s));if(r instanceof Promise)throw new zr;return s.value=r,s}});function mb(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ow=te("$ZodOptional",(e,t)=>{bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${wp(s.source)})?$`):void 0}),e._zod.parse=(s,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>mb(c,s.value)):mb(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),CO=te("$ZodExactOptional",(e,t)=>{ow.init(e,t),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),kO=te("$ZodNullable",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${wp(s.source)}|null)$`):void 0}),st(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(s,a)=>s.value===null?s:t.innerType._zod.run(s,a)}),_O=te("$ZodDefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);if(s.value===void 0)return s.value=t.defaultValue,s;const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>pb(c,t)):pb(r,t)}});function pb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const zO=te("$ZodPrefault",(e,t)=>{bt.init(e,t),e._zod.optin="optional",st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>(a.direction==="backward"||s.value===void 0&&(s.value=t.defaultValue),t.innerType._zod.run(s,a))}),EO=te("$ZodNonOptional",(e,t)=>{bt.init(e,t),st(e._zod,"values",()=>{const s=t.innerType._zod.values;return s?new Set([...s].filter(a=>a!==void 0)):void 0}),e._zod.parse=(s,a)=>{const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>gb(c,e)):gb(r,e)}});function gb(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const RO=te("$ZodCatch",(e,t)=>{bt.init(e,t),st(e._zod,"optin",()=>t.innerType._zod.optin),st(e._zod,"optout",()=>t.innerType._zod.optout),st(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(c=>(s.value=c.value,c.issues.length&&(s.value=t.catchValue({...s,error:{issues:c.issues.map(d=>Ii(d,a,Pi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>Ii(c,a,Pi()))},input:s.value}),s.issues=[]),s)}}),TO=te("$ZodPipe",(e,t)=>{bt.init(e,t),st(e._zod,"values",()=>t.in._zod.values),st(e._zod,"optin",()=>t.in._zod.optin),st(e._zod,"optout",()=>t.out._zod.optout),st(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(s,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(s,a);return c instanceof Promise?c.then(d=>Kc(d,t.in,a)):Kc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Kc(c,t.out,a)):Kc(r,t.out,a)}});function Kc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const AO=te("$ZodReadonly",(e,t)=>{bt.init(e,t),st(e._zod,"propValues",()=>t.innerType._zod.propValues),st(e._zod,"values",()=>t.innerType._zod.values),st(e._zod,"optin",()=>t.innerType?._zod?.optin),st(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(s,a)=>{if(a.direction==="backward")return t.innerType._zod.run(s,a);const r=t.innerType._zod.run(s,a);return r instanceof Promise?r.then(yb):yb(r)}});function yb(e){return e.value=Object.freeze(e.value),e}const OO=te("$ZodCustom",(e,t)=>{Nn.init(e,t),bt.init(e,t),e._zod.parse=(s,a)=>s,e._zod.check=s=>{const a=s.value,r=t.fn(a);if(r instanceof Promise)return r.then(c=>vb(c,s,a,e));vb(r,s,a,e)}});function vb(e,t,s,a){if(!e){const r={code:"custom",input:s,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(il(r))}}var xb;class DO{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...s){const a=s[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const s=this._map.get(t);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(t),this}get(t){const s=t._zod.parent;if(s){const a={...this.get(s)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function LO(){return new DO}(xb=globalThis).__zod_globalRegistry??(xb.__zod_globalRegistry=LO());const Ho=globalThis.__zod_globalRegistry;function MO(e,t){return new e({type:"string",...we(t)})}function $O(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...we(t)})}function bb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...we(t)})}function UO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...we(t)})}function PO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...we(t)})}function IO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...we(t)})}function BO(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...we(t)})}function qO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...we(t)})}function HO(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...we(t)})}function GO(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...we(t)})}function KO(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...we(t)})}function FO(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...we(t)})}function ZO(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...we(t)})}function VO(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...we(t)})}function QO(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...we(t)})}function YO(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...we(t)})}function JO(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...we(t)})}function XO(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...we(t)})}function WO(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...we(t)})}function e5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...we(t)})}function t5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...we(t)})}function n5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...we(t)})}function s5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...we(t)})}function i5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...we(t)})}function a5(e,t){return new e({type:"string",format:"date",check:"string_format",...we(t)})}function r5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...we(t)})}function o5(e,t){return new e({type:"string",format:"duration",check:"string_format",...we(t)})}function l5(e,t){return new e({type:"number",checks:[],...we(t)})}function c5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...we(t)})}function u5(e,t){return new e({type:"boolean",...we(t)})}function d5(e){return new e({type:"unknown"})}function f5(e,t){return new e({type:"never",...we(t)})}function Sb(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!1})}function Kh(e,t){return new tw({check:"less_than",...we(t),value:e,inclusive:!0})}function jb(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!1})}function Fh(e,t){return new nw({check:"greater_than",...we(t),value:e,inclusive:!0})}function wb(e,t){return new _A({check:"multiple_of",...we(t),value:e})}function lw(e,t){return new EA({check:"max_length",...we(t),maximum:e})}function Cu(e,t){return new RA({check:"min_length",...we(t),minimum:e})}function cw(e,t){return new TA({check:"length_equals",...we(t),length:e})}function h5(e,t){return new AA({check:"string_format",format:"regex",...we(t),pattern:e})}function m5(e){return new OA({check:"string_format",format:"lowercase",...we(e)})}function p5(e){return new DA({check:"string_format",format:"uppercase",...we(e)})}function g5(e,t){return new LA({check:"string_format",format:"includes",...we(t),includes:e})}function y5(e,t){return new MA({check:"string_format",format:"starts_with",...we(t),prefix:e})}function v5(e,t){return new $A({check:"string_format",format:"ends_with",...we(t),suffix:e})}function Ur(e){return new UA({check:"overwrite",tx:e})}function x5(e){return Ur(t=>t.normalize(e))}function b5(){return Ur(e=>e.trim())}function S5(){return Ur(e=>e.toLowerCase())}function j5(){return Ur(e=>e.toUpperCase())}function w5(){return Ur(e=>AT(e))}function N5(e,t,s){return new e({type:"array",element:t,...we(s)})}function C5(e,t,s){return new e({type:"custom",check:"custom",fn:t,...we(s)})}function k5(e){const t=_5(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(il(a,s.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=s.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),s.issues.push(il(r))}},e(s.value,s)));return t}function _5(e,t){const s=new Nn({check:"custom",...we(t)});return s._zod.check=e,s}function uw(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ho,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function qt(e,t,s={path:[],schemaPath:[]}){var a;const r=e._zod.def,c=t.seen.get(e);if(c)return c.count++,s.schemaPath.includes(e)&&(c.cycle=s.path),c.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,d);const f=e._zod.toJSONSchema?.();if(f)d.schema=f;else{const v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,d.schema,v);else{const x=d.schema,b=t.processors[r.type];if(!b)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);b(e,t,x,v)}const y=e._zod.parent;y&&(d.ref||(d.ref=y),qt(y,t,v),t.seen.get(y).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(d.schema,m),t.io==="input"&&cn(e)&&(delete d.schema.examples,delete d.schema.default),t.io==="input"&&d.schema._prefault&&((a=d.schema).default??(a.default=d.schema._prefault)),delete d.schema._prefault,t.seen.get(e).schema}function dw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const d of e.seen.entries()){const f=e.metadataRegistry.get(d[0])?.id;if(f){const m=a.get(f);if(m&&m!==d[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(f,d[0])}}const r=d=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(d[0])?.id,x=e.external.uri??(w=>w);if(y)return{ref:x(y)};const b=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=b,{defId:b,ref:`${x("__shared")}#/${f}/${b}`}}if(d[1]===s)return{ref:"#"};const p=`#/${f}/`,v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+v}},c=d=>{if(d[1].schema.$ref)return;const f=d[1],{ref:m,defId:p}=r(d);f.def={...f.schema},p&&(f.defId=p);const v=f.schema;for(const y in v)delete v[y];v.$ref=m};if(e.cycles==="throw")for(const d of e.seen.entries()){const f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
93
93
|
|
|
94
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const p=e.external.registry.get(d[0])?.id;if(t!==d[0]&&p){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function fw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const m=f.def??f.schema,p={...m},v=f.ref;if(f.ref=null,v){a(v);const x=e.seen.get(v),b=x.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(b)):Object.assign(m,b),Object.assign(m,p),d._zod.parent===v)for(const S in m)S==="$ref"||S==="allOf"||S in p||delete m[S];if(b.$ref&&x.def)for(const S in m)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(m[S])===JSON.stringify(x.def[S])&&delete m[S]}const y=d._zod.parent;if(y&&y!==v){a(y);const x=e.seen.get(y);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const b in m)b==="$ref"||b==="allOf"||b in x.def&&JSON.stringify(m[b])===JSON.stringify(x.def[b])&&delete m[b]}e.override({zodSchema:d,jsonSchema:m,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:ku(t,"input",e.processors),output:ku(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function cn(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return cn(a.element,s);if(a.type==="set")return cn(a.valueType,s);if(a.type==="lazy")return cn(a.getter(),s);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return cn(a.innerType,s);if(a.type==="intersection")return cn(a.left,s)||cn(a.right,s);if(a.type==="record"||a.type==="map")return cn(a.keyType,s)||cn(a.valueType,s);if(a.type==="pipe")return cn(a.in,s)||cn(a.out,s);if(a.type==="object"){for(const r in a.shape)if(cn(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(cn(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(cn(r,s))return!0;return!!(a.rest&&cn(a.rest,s))}return!1}const z5=(e,t={})=>s=>{const a=uw({...s,processors:t});return qt(e,a),dw(a,e),fw(a,e)},ku=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=uw({...r??{},target:c,io:t,processors:s});return qt(e,d),dw(d,e),fw(d,e)},E5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},R5=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=E5[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),p&&(r.contentEncoding=p),m&&m.size>0){const v=[...m];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},T5=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=p,r.exclusiveMaximum=!0):r.exclusiveMaximum=p),typeof d=="number"&&(r.maximum=d,typeof p=="number"&&t.target!=="draft-04"&&(p<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof m=="number"&&(r.multipleOf=m)},A5=(e,t,s,a)=>{s.type="boolean"},O5=(e,t,s,a)=>{s.not={}},L5=(e,t,s,a)=>{},D5=(e,t,s,a)=>{const r=e._zod.def,c=Gj(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},M5=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const d of r.values)if(d===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];s.type=d===null?"null":typeof d,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[d]:s.const=d}else c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),c.every(d=>typeof d=="boolean")&&(s.type="boolean"),c.every(d=>d===null)&&(s.type="null"),s.enum=c},$5=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},U5=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},P5=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},I5=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const p in d)r.properties[p]=qt(d[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(d)),m=new Set([...f].filter(p=>{const v=c.shape[p]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));m.size>0&&(r.required=Array.from(m)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},B5=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,m)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?s.oneOf=d:s.anyOf=d},q5=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),d=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,m=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=m},H5=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,m=d._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of m)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const p=d._zod.values;if(p){const v=[...p].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},G5=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.innerType,t,a),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},K5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},F5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},Z5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},V5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},Q5=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const d=t.seen.get(e);d.ref=c},Y5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},hw=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},J5=te("ZodISODateTime",(e,t)=>{XA.init(e,t),jt.init(e,t)});function X5(e){return i5(J5,e)}const W5=te("ZodISODate",(e,t)=>{WA.init(e,t),jt.init(e,t)});function eL(e){return a5(W5,e)}const tL=te("ZodISOTime",(e,t)=>{eO.init(e,t),jt.init(e,t)});function nL(e){return r5(tL,e)}const sL=te("ZodISODuration",(e,t)=>{tO.init(e,t),jt.init(e,t)});function iL(e){return o5(sL,e)}const aL=(e,t)=>{Vj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>KT(e,s)},flatten:{value:s=>GT(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,jm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,jm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yn=te("ZodError",aL,{Parent:Error}),rL=Np(Yn),oL=Cp(Yn),lL=Hu(Yn),cL=Gu(Yn),uL=VT(Yn),dL=QT(Yn),fL=YT(Yn),hL=JT(Yn),mL=XT(Yn),pL=WT(Yn),gL=eA(Yn),yL=tA(Yn),St=te("ZodType",(e,t)=>(bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ku(e,"input"),output:ku(e,"output")}}),e.toJSONSchema=z5(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(Hi(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Gi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>rL(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>lL(e,s,a),e.parseAsync=async(s,a)=>oL(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>cL(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>uL(e,s,a),e.decode=(s,a)=>dL(e,s,a),e.encodeAsync=async(s,a)=>fL(e,s,a),e.decodeAsync=async(s,a)=>hL(e,s,a),e.safeEncode=(s,a)=>mL(e,s,a),e.safeDecode=(s,a)=>pL(e,s,a),e.safeEncodeAsync=async(s,a)=>gL(e,s,a),e.safeDecodeAsync=async(s,a)=>yL(e,s,a),e.refine=(s,a)=>e.check(dD(s,a)),e.superRefine=s=>e.check(fD(s)),e.overwrite=s=>e.check(Ur(s)),e.optional=()=>Cb(e),e.exactOptional=()=>XL(e),e.nullable=()=>kb(e),e.nullish=()=>Cb(kb(e)),e.nonoptional=s=>iD(e,s),e.array=()=>Qe(e),e.or=s=>GL([e,s]),e.and=s=>FL(e,s),e.transform=s=>_b(e,YL(s)),e.default=s=>tD(e,s),e.prefault=s=>sD(e,s),e.catch=s=>rD(e,s),e.pipe=s=>_b(e,s),e.readonly=()=>cD(e),e.describe=s=>{const a=e.clone();return Ho.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Ho.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Ho.get(e);const a=e.clone();return Ho.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),mw=te("_ZodString",(e,t)=>{kp.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>R5(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(h5(...a)),e.includes=(...a)=>e.check(g5(...a)),e.startsWith=(...a)=>e.check(y5(...a)),e.endsWith=(...a)=>e.check(v5(...a)),e.min=(...a)=>e.check(Cu(...a)),e.max=(...a)=>e.check(lw(...a)),e.length=(...a)=>e.check(cw(...a)),e.nonempty=(...a)=>e.check(Cu(1,...a)),e.lowercase=a=>e.check(m5(a)),e.uppercase=a=>e.check(p5(a)),e.trim=()=>e.check(b5()),e.normalize=(...a)=>e.check(x5(...a)),e.toLowerCase=()=>e.check(S5()),e.toUpperCase=()=>e.check(j5()),e.slugify=()=>e.check(w5())}),vL=te("ZodString",(e,t)=>{kp.init(e,t),mw.init(e,t),e.email=s=>e.check($O(xL,s)),e.url=s=>e.check(qO(bL,s)),e.jwt=s=>e.check(s5(DL,s)),e.emoji=s=>e.check(HO(SL,s)),e.guid=s=>e.check(xb(wb,s)),e.uuid=s=>e.check(UO(Fc,s)),e.uuidv4=s=>e.check(PO(Fc,s)),e.uuidv6=s=>e.check(IO(Fc,s)),e.uuidv7=s=>e.check(BO(Fc,s)),e.nanoid=s=>e.check(GO(jL,s)),e.guid=s=>e.check(xb(wb,s)),e.cuid=s=>e.check(KO(wL,s)),e.cuid2=s=>e.check(FO(NL,s)),e.ulid=s=>e.check(ZO(CL,s)),e.base64=s=>e.check(e5(AL,s)),e.base64url=s=>e.check(t5(OL,s)),e.xid=s=>e.check(VO(kL,s)),e.ksuid=s=>e.check(QO(_L,s)),e.ipv4=s=>e.check(YO(zL,s)),e.ipv6=s=>e.check(JO(EL,s)),e.cidrv4=s=>e.check(XO(RL,s)),e.cidrv6=s=>e.check(WO(TL,s)),e.e164=s=>e.check(n5(LL,s)),e.datetime=s=>e.check(X5(s)),e.date=s=>e.check(eL(s)),e.time=s=>e.check(nL(s)),e.duration=s=>e.check(iL(s))});function Z(e){return MO(vL,e)}const jt=te("ZodStringFormat",(e,t)=>{xt.init(e,t),mw.init(e,t)}),xL=te("ZodEmail",(e,t)=>{HA.init(e,t),jt.init(e,t)}),wb=te("ZodGUID",(e,t)=>{BA.init(e,t),jt.init(e,t)}),Fc=te("ZodUUID",(e,t)=>{qA.init(e,t),jt.init(e,t)}),bL=te("ZodURL",(e,t)=>{GA.init(e,t),jt.init(e,t)}),SL=te("ZodEmoji",(e,t)=>{KA.init(e,t),jt.init(e,t)}),jL=te("ZodNanoID",(e,t)=>{FA.init(e,t),jt.init(e,t)}),wL=te("ZodCUID",(e,t)=>{ZA.init(e,t),jt.init(e,t)}),NL=te("ZodCUID2",(e,t)=>{VA.init(e,t),jt.init(e,t)}),CL=te("ZodULID",(e,t)=>{QA.init(e,t),jt.init(e,t)}),kL=te("ZodXID",(e,t)=>{YA.init(e,t),jt.init(e,t)}),_L=te("ZodKSUID",(e,t)=>{JA.init(e,t),jt.init(e,t)}),zL=te("ZodIPv4",(e,t)=>{nO.init(e,t),jt.init(e,t)}),EL=te("ZodIPv6",(e,t)=>{sO.init(e,t),jt.init(e,t)}),RL=te("ZodCIDRv4",(e,t)=>{iO.init(e,t),jt.init(e,t)}),TL=te("ZodCIDRv6",(e,t)=>{aO.init(e,t),jt.init(e,t)}),AL=te("ZodBase64",(e,t)=>{rO.init(e,t),jt.init(e,t)}),OL=te("ZodBase64URL",(e,t)=>{lO.init(e,t),jt.init(e,t)}),LL=te("ZodE164",(e,t)=>{cO.init(e,t),jt.init(e,t)}),DL=te("ZodJWT",(e,t)=>{dO.init(e,t),jt.init(e,t)}),pw=te("ZodNumber",(e,t)=>{iw.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>T5(e,a,r),e.gt=(a,r)=>e.check(Sb(a,r)),e.gte=(a,r)=>e.check(Fh(a,r)),e.min=(a,r)=>e.check(Fh(a,r)),e.lt=(a,r)=>e.check(bb(a,r)),e.lte=(a,r)=>e.check(Kh(a,r)),e.max=(a,r)=>e.check(Kh(a,r)),e.int=a=>e.check(Nb(a)),e.safe=a=>e.check(Nb(a)),e.positive=a=>e.check(Sb(0,a)),e.nonnegative=a=>e.check(Fh(0,a)),e.negative=a=>e.check(bb(0,a)),e.nonpositive=a=>e.check(Kh(0,a)),e.multipleOf=(a,r)=>e.check(jb(a,r)),e.step=(a,r)=>e.check(jb(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Fe(e){return l5(pw,e)}const ML=te("ZodNumberFormat",(e,t)=>{fO.init(e,t),pw.init(e,t)});function Nb(e){return c5(ML,e)}const $L=te("ZodBoolean",(e,t)=>{hO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>A5(e,s,a)});function Pr(e){return u5($L,e)}const UL=te("ZodUnknown",(e,t)=>{mO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>L5()});function Nm(){return d5(UL)}const PL=te("ZodNever",(e,t)=>{pO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>O5(e,s,a)});function IL(e){return f5(PL,e)}const BL=te("ZodArray",(e,t)=>{gO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>P5(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Cu(s,a)),e.nonempty=s=>e.check(Cu(1,s)),e.max=(s,a)=>e.check(lw(s,a)),e.length=(s,a)=>e.check(cw(s,a)),e.unwrap=()=>e.element});function Qe(e,t){return N5(BL,e,t)}const qL=te("ZodObject",(e,t)=>{vO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>I5(e,s,a,r),st(e,"shape",()=>t.shape),e.keyof=()=>wn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Nm()}),e.loose=()=>e.clone({...e._zod.def,catchall:Nm()}),e.strict=()=>e.clone({...e._zod.def,catchall:IL()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>PT(e,s),e.safeExtend=s=>IT(e,s),e.merge=s=>BT(e,s),e.pick=s=>$T(e,s),e.omit=s=>UT(e,s),e.partial=(...s)=>qT(gw,e,s[0]),e.required=(...s)=>HT(yw,e,s[0])});function De(e,t){const s={type:"object",shape:e??{},...we(t)};return new qL(s)}const HL=te("ZodUnion",(e,t)=>{xO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>B5(e,s,a,r),e.options=t.options});function GL(e,t){return new HL({type:"union",options:e,...we(t)})}const KL=te("ZodIntersection",(e,t)=>{bO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>q5(e,s,a,r)});function FL(e,t){return new KL({type:"intersection",left:e,right:t})}const ZL=te("ZodRecord",(e,t)=>{SO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>H5(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function Fu(e,t,s){return new ZL({type:"record",keyType:e,valueType:t,...we(s)})}const Cm=te("ZodEnum",(e,t)=>{jO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>D5(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const d of a)if(s.has(d))c[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new Cm({...t,checks:[],...we(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const d of a)if(s.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new Cm({...t,checks:[],...we(r),entries:c})}});function wn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Cm({type:"enum",entries:s,...we(t)})}const VL=te("ZodLiteral",(e,t)=>{wO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>M5(e,s,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function _u(e,t){return new VL({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const QL=te("ZodTransform",(e,t)=>{NO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>U5(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(il(c,s.value,t));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=e),s.issues.push(il(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function YL(e){return new QL({type:"transform",transform:e})}const gw=te("ZodOptional",(e,t)=>{ow.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Cb(e){return new gw({type:"optional",innerType:e})}const JL=te("ZodExactOptional",(e,t)=>{CO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function XL(e){return new JL({type:"optional",innerType:e})}const WL=te("ZodNullable",(e,t)=>{kO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>G5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function kb(e){return new WL({type:"nullable",innerType:e})}const eD=te("ZodDefault",(e,t)=>{_O.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>F5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tD(e,t){return new eD({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Fj(t)}})}const nD=te("ZodPrefault",(e,t)=>{zO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Z5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function sD(e,t){return new nD({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Fj(t)}})}const yw=te("ZodNonOptional",(e,t)=>{EO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>K5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function iD(e,t){return new yw({type:"nonoptional",innerType:e,...we(t)})}const aD=te("ZodCatch",(e,t)=>{RO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>V5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rD(e,t){return new aD({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const oD=te("ZodPipe",(e,t)=>{TO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Q5(e,s,a,r),e.in=t.in,e.out=t.out});function _b(e,t){return new oD({type:"pipe",in:e,out:t})}const lD=te("ZodReadonly",(e,t)=>{AO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Y5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function cD(e){return new lD({type:"readonly",innerType:e})}const uD=te("ZodCustom",(e,t)=>{OO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$5(e,s)});function dD(e,t={}){return C5(uD,e,t)}function fD(e){return k5(e)}De({maxConcurrency:Fe().int().positive(),maxRequestsPerMinute:Fe().int().positive(),maxRequestsPerDay:Fe().int().positive()});const Ir=Z().min(1);Z().min(1);const _p=De({label:Z().min(1),city:Z().min(1),region:Z().min(1),country:Z().length(2),timezone:Z().optional()}),vw=wn(["citation.lost","citation.gained","run.completed","run.failed"]);De({id:Z(),projectId:Z(),channel:_u("webhook"),url:Z().url(),events:Qe(vw),enabled:Pr().default(!0),webhookSecret:Z().optional(),createdAt:Z(),updatedAt:Z()});const xw=wn(["cli","api","config-file"]);function hD(e){const t=new Set,s=new Set;for(const a of e){if(t.has(a.label)){s.add(a.label);continue}t.add(a.label)}return[...s]}function mD(e,t){return t?e.some(s=>s.label===t):!0}De({displayName:Z().min(1),canonicalDomain:Z().min(1),ownedDomains:Qe(Z().min(1)).optional(),country:Z().length(2),language:Z().min(2),tags:Qe(Z()).optional(),labels:Fu(Z(),Z()).optional(),providers:Qe(Ir).optional(),locations:Qe(_p).optional(),defaultLocation:Z().nullable().optional(),configSource:xw.optional()});De({id:Z(),name:Z(),displayName:Z().optional(),canonicalDomain:Z(),ownedDomains:Qe(Z()).default([]),country:Z().length(2),language:Z().min(2),tags:Qe(Z()).default([]),labels:Fu(Z(),Z()).default({}),locations:Qe(_p).default([]),defaultLocation:Z().nullable().optional(),configSource:xw.default("cli"),configRevision:Fe().int().positive().default(1),createdAt:Z().optional(),updatedAt:Z().optional()});function km(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function pD(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const d=km(c);s.has(d)||(s.add(d),a.push(c))}return a}const gD=De({name:Z().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:Fu(Z(),Z()).optional().default({})}),yD=De({preset:Z().optional(),cron:Z().optional(),timezone:Z().optional().default("UTC"),providers:Qe(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),vD=De({channel:_u("webhook"),url:Z().url(),events:Qe(vw).min(1)}),xD=De({gsc:De({propertyUrl:Z()}).optional(),syncSchedule:De({preset:Z().optional(),cron:Z().optional()}).optional()}).optional(),bD=De({displayName:Z().min(1),canonicalDomain:Z().min(1),ownedDomains:Qe(Z().min(1)).optional().default([]),country:Z().length(2),language:Z().min(2),keywords:Qe(Z().min(1)).optional().default([]),competitors:Qe(Z().min(1)).optional().default([]),providers:Qe(Ir).optional().default([]),locations:Qe(_p).optional().default([]),defaultLocation:Z().optional(),schedule:yD,notifications:Qe(vD).optional().default([]),google:xD}).superRefine((e,t)=>{const s=hD(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),mD(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});De({apiVersion:_u("canonry/v1"),kind:_u("Project"),metadata:gD,spec:bD});const SD=wn(["gsc","ga4"]);De({id:Z(),domain:Z(),connectionType:SD,propertyId:Z().nullable().optional(),sitemapUrl:Z().nullable().optional(),scopes:Qe(Z()).default([]),createdAt:Z(),updatedAt:Z()});De({date:Z(),query:Z(),page:Z(),country:Z().nullable().optional(),device:Z().nullable().optional(),clicks:Fe(),impressions:Fe(),ctr:Fe(),position:Fe()});const _m=De({id:Z(),url:Z(),indexingState:Z().nullable().optional(),verdict:Z().nullable().optional(),coverageState:Z().nullable().optional(),pageFetchState:Z().nullable().optional(),robotsTxtState:Z().nullable().optional(),crawlTime:Z().nullable().optional(),lastCrawlResult:Z().nullable().optional(),isMobileFriendly:Pr().nullable().optional(),richResults:Qe(Z()).default([]),inspectedAt:Z()});wn(["stable","reindexed","deindexed","still-missing","new"]);const jD=De({url:Z(),previousState:Z().nullable(),currentState:Z().nullable(),transitionDate:Z()}),wD=De({reason:Z(),count:Fe(),urls:Qe(_m).default([])});De({summary:De({total:Fe(),indexed:Fe(),notIndexed:Fe(),deindexed:Fe(),percentage:Fe()}),lastInspectedAt:Z().nullable(),indexed:Qe(_m).default([]),notIndexed:Qe(_m).default([]),deindexed:Qe(jD).default([]),reasonGroups:Qe(wD).default([])});De({url:Z(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:Z()});De({url:Z(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:Z(),status:wn(["success","error"]),error:Z().optional()});De({date:Z(),indexed:Fe(),notIndexed:Fe(),reasonBreakdown:Fu(Z(),Fe()).default({})});De({id:Z(),domain:Z(),siteUrl:Z().nullable().optional(),createdAt:Z(),updatedAt:Z()});const zb=De({id:Z(),url:Z(),httpCode:Fe().nullable().optional(),inIndex:Pr().nullable().optional(),lastCrawledDate:Z().nullable().optional(),inIndexDate:Z().nullable().optional(),inspectedAt:Z()});De({summary:De({total:Fe(),indexed:Fe(),notIndexed:Fe(),percentage:Fe()}),lastInspectedAt:Z().nullable(),indexed:Qe(zb).default([]),notIndexed:Qe(zb).default([])});De({query:Z(),impressions:Fe(),clicks:Fe(),ctr:Fe(),averagePosition:Fe()});De({url:Z(),status:wn(["success","error"]),submittedAt:Z(),error:Z().optional()});const ND=wn(["queued","running","completed","partial","failed","cancelled"]),CD=wn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),kD=wn(["manual","scheduled","config-apply"]),_D=wn(["cited","not-cited"]),zD=wn(["new","cited","lost","emerging","not-cited"]);De({id:Z(),projectId:Z(),kind:CD,status:ND,trigger:kD.default("manual"),location:Z().nullable().optional(),startedAt:Z().nullable().optional(),finishedAt:Z().nullable().optional(),error:Z().nullable().optional(),createdAt:Z()});const ED=De({uri:Z(),title:Z()});De({id:Z(),runId:Z(),keywordId:Z(),keyword:Z().optional(),provider:Ir,citationState:_D,transition:zD.optional(),answerText:Z().nullable().optional(),citedDomains:Qe(Z()).default([]),competitorOverlap:Qe(Z()).default([]),groundingSources:Qe(ED).default([]),searchQueries:Qe(Z()).default([]),model:Z().nullable().optional(),location:Z().nullable().optional(),createdAt:Z()});De({id:Z(),projectId:Z().nullable().optional(),actor:Z(),action:Z(),entityType:Z(),entityId:Z().nullable().optional(),diff:Nm().optional(),createdAt:Z()});De({id:Z(),projectId:Z(),cronExpr:Z(),preset:Z().nullable().optional(),timezone:Z().default("UTC"),enabled:Pr().default(!0),providers:Qe(Ir).default([]),lastRunAt:Z().nullable().optional(),nextRunAt:Z().nullable().optional(),createdAt:Z(),updatedAt:Z()});De({preset:Z().optional(),cron:Z().optional(),timezone:Z().optional().default("UTC"),enabled:Pr().optional().default(!0),providers:Qe(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});De({id:Z(),projectId:Z(),propertyId:Z(),clientEmail:Z(),connected:Pr(),createdAt:Z(),updatedAt:Z()});De({date:Z(),landingPage:Z(),sessions:Fe(),organicSessions:Fe(),users:Fe()});De({totalSessions:Fe(),totalOrganicSessions:Fe(),totalUsers:Fe(),topPages:Qe(De({landingPage:Z(),sessions:Fe(),organicSessions:Fe(),users:Fe()})),lastSyncedAt:Z().nullable()});function zm({state:e}){return o.jsx(nt,{tone:GE(e),children:Uu(e)})}function Eb(e,t){const s=t.filter(d=>d.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(d=>d.startsWith("**")&&d.endsWith("**")?{type:"bold",value:d.slice(2,-2)}:{type:"text",value:d});if(s.length===0)return a.map((d,f)=>d.type==="bold"?is.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((p,v)=>p?v%2===1?d.type==="bold"?is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},is.createElement("strong",{className:"text-zinc-200 font-semibold"},p)):is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},p):d.type==="bold"?is.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},p):p:null)).filter(Boolean)}class bw extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function RD(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const TD=RD();function AD(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function ye(e,t){const s=AD(),a=await fetch(`${TD}${e}`,{...t,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...t?.headers}});if(!a.ok){const r=await a.text();let c=`API ${a.status}: ${a.statusText}`,d;if(r)try{const f=JSON.parse(r);typeof f.error=="string"?c=f.error:f.error?.message?(c=f.error.message,d=f.error.code):f.message&&(c=f.message)}catch{c=r}throw new bw(c,a.status,d)}if(a.status!==204)return a.json()}function Sw(){return ye("/projects")}function zp(e){return ye(`/projects/${encodeURIComponent(e)}`)}function jw(){return ye("/runs")}function Lr(e){return ye(`/runs/${encodeURIComponent(e)}`)}function ww(e){return ye(`/projects/${encodeURIComponent(e)}/keywords`)}function Ep(e){return ye(`/projects/${encodeURIComponent(e)}/competitors`)}function Rp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return ye(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function ll(e,t){return ye(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Nw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function Cw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function Tp(e,t){return ye(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Em(e,t){const s=await zp(e);return ll(e,{displayName:s.displayName,canonicalDomain:s.canonicalDomain,ownedDomains:t,country:s.country,language:s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:s.locations,defaultLocation:s.defaultLocation})}async function kw(e,t){const s=await zp(e);return ll(e,{displayName:t.displayName??s.displayName,canonicalDomain:t.canonicalDomain??s.canonicalDomain,ownedDomains:t.ownedDomains??s.ownedDomains,country:t.country??s.country,language:t.language??s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:t.locations??s.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:s.defaultLocation})}function Ap(e,t){const s={};return ye(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function _w(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function zw(e,t){await ye(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function Ew(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function Rw(e){await ye(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function Tw(e){return ye(`/projects/${encodeURIComponent(e)}/export`)}function Zu(){return ye("/settings")}function Aw(e,t){return ye(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Ow(e){return ye("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Lw(e){try{return await ye(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Rm(e,t){return ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Dw(e){await ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function Mw(e){return ye(`/projects/${encodeURIComponent(e)}/notifications`)}function $w(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function Uw(e,t){await ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Pw(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Iw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Bw(e){return ye("/apply",{method:"POST",body:JSON.stringify(e)})}function OD(e){return ye("/runs",{method:"POST",body:JSON.stringify(e??{})})}function Op(e){return ye(`/projects/${encodeURIComponent(e)}/google/connections`)}function qw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Hw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Gw(e){return ye(`/projects/${encodeURIComponent(e)}/google/properties`)}function Kw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Fw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Lp(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Zw(e,t){const s=new URLSearchParams;t?.startDate&&s.set("startDate",t.startDate),t?.endDate&&s.set("endDate",t.endDate),t?.query&&s.set("query",t.query),t?.page&&s.set("page",t.page),t?.limit!==void 0&&s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function Vw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Qw(e,t){const s=new URLSearchParams;t?.url&&s.set("url",t.url),s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function Yw(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Vu(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Jw(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Xw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Ww(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function eN(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Tm(){return ye("/cdp/status")}function tN(e,t){return ye("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Am(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Dp(e){return ye(`/projects/${encodeURIComponent(e)}/bing/status`)}function nN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function sN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function iN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/sites`)}function aN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Qu(e){return ye(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function Mp(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function $p(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Om(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function rN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/performance`)}function oN(e){return ye("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function lN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function cN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function uN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}function Lm(e){return ye(`/projects/${encodeURIComponent(e)}/ga/status`)}function Dm(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function dN(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function fN(e){return ye(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function hN(e,t){try{const s=await fetch(e);if(!s.ok)return{label:t,state:"error",detail:`HTTP ${s.status}`};const a=await s.json(),r=typeof a.version=="string"?a.version:"unknown",c=typeof a.databaseUrlConfigured=="boolean"?a.databaseUrlConfigured:void 0,d=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:d}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const LD=Object.freeze(Object.defineProperty({__proto__:null,ApiError:bw,addLocation:_w,addNotification:$w,appendKeywords:Cw,applyProjectConfig:Bw,bingConnect:nN,bingDisconnect:sN,bingRequestIndexing:Om,bingSetSite:aN,configureCdp:tN,createProject:ll,deleteProject:Rw,disconnectGa:fN,fetchAllRuns:jw,fetchAnalyticsGaps:cN,fetchAnalyticsMetrics:lN,fetchAnalyticsSources:uN,fetchBingCoverage:Qu,fetchBingInspections:Mp,fetchBingPerformance:rN,fetchBingSites:iN,fetchBingStatus:Dp,fetchCdpStatus:Tm,fetchCompetitors:Ep,fetchExport:Tw,fetchGaStatus:Lm,fetchGaTraffic:Dm,fetchGoogleConnections:Op,fetchGoogleProperties:Gw,fetchGscCoverage:Vu,fetchGscCoverageHistory:Jw,fetchGscDeindexed:Yw,fetchGscInspections:Qw,fetchGscPerformance:Zw,fetchGscSitemaps:Ww,fetchKeywords:ww,fetchProject:zp,fetchProjects:Sw,fetchRunDetail:Lr,fetchSchedule:Lw,fetchServiceStatus:hN,fetchSettings:Zu,fetchTimeline:Rp,generateKeywords:Iw,googleConnect:qw,googleDisconnect:Hw,inspectBingUrl:$p,inspectGscUrl:Vw,listNotifications:Mw,removeLocation:zw,removeNotification:Uw,removeSchedule:Dw,requestIndexing:Am,saveGoogleProperty:Kw,saveSchedule:Rm,saveSitemapUrl:Fw,sendTestNotification:Pw,setCompetitors:Tp,setDefaultLocation:Ew,setKeywords:Nw,triggerAllRuns:OD,triggerDiscoverSitemaps:eN,triggerGaSync:dN,triggerGscSync:Lp,triggerInspectSitemap:Xw,triggerRun:Ap,updateBingApiKey:oN,updateGoogleAuthConfig:Ow,updateOwnedDomains:Em,updateProject:kw,updateProviderConfig:Aw},Symbol.toStringTag,{value:"Module"}));function DD({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,m]=N.useState(null),[p,v]=N.useState(!1),[y,x]=N.useState({}),b=pD(t.project),w=new Set(b.map(km)),S=e.runHistory,C=S.length>1,k=c>=0&&f!==null,E=k?f:{citationState:e.citationState,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.changeLabel,summary:e.summary},R=E.citationState==="cited"||E.citationState==="emerging",D=E.citedDomains.findIndex(G=>w.has(G.toLowerCase().replace(/^www\./,"")))+1,M=E.citedDomains.length,T=t.project.displayName||t.project.name,A=[...b.map(km),T,T.split(" ").slice(0,2).join(" ")].filter(G=>G.trim().length>2),P=R?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",J=N.useRef(0),Q=N.useCallback(async G=>{const oe=++J.current;if(G===-1||G===S.length-1){d(-1),m(null),r(!1);return}d(G),r(!1);const q=S[G],X=`${q.runId}::${e.keyword}::${e.provider}`;if(y[X]){m(y[X]);return}v(!0);try{const O=await Lr(q.runId);if(oe!==J.current)return;const F=O.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??O.snapshots.find(re=>re.keyword===e.keyword),ie=F?{citationState:F.citationState,provider:F.provider,model:F.model??null,answerSnippet:F.answerText??"",citedDomains:F.citedDomains,competitorDomains:F.competitorOverlap,groundingSources:F.groundingSources,evidenceUrls:[],changeLabel:q.citationState,summary:""}:{citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Snapshot data not available for this run."};x(re=>({...re,[X]:ie})),m(ie)}catch{if(oe!==J.current)return;m({citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Failed to load historical run data."})}finally{oe===J.current&&v(!1)}},[S,e.keyword,e.provider,y]),pe=(k||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,ke=!k&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",je=R&&D>0?{label:"Citation confirmed",title:`Cited #${D} of ${M} domain${M!==1?"s":""}`,meta:pe}:R?{label:"Citation confirmed",title:"Cited in this answer",meta:pe}:E.citationState==="lost"?{label:"Citation lost",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:pe}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No domains cited for this query",meta:pe},B=()=>{if(!E.answerSnippet)return null;const G=E.answerSnippet.split(`
|
|
95
|
-
`),oe=[];let q=[],X=0;const O=()=>{if(q.length===0)return;const F=q.join(" ").trim();F&&oe.push(o.jsx("p",{className:oe.length>0?"mt-2.5":"",children:Eb(F,A)},X++)),q=[]};for(const F of G){const ie=F.trim();if(/^[-\u2013\u2014]{3,}$/.test(ie)){O(),oe.push(o.jsx("hr",{className:"border-zinc-800/60 my-3"},X++));continue}const re=ie.match(/^(#{1,3})\s+(.+)$/);if(re){O();const ue=re[1].length,he=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],de=ue===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ue===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(o.jsx("p",{className:de,children:Eb(he,A)},X++));continue}if(ie===""){O();continue}q.push(ie)}return O(),oe};return o.jsx(Lj,{open:!0,onOpenChange:G=>{G||s()},children:o.jsxs(Dj,{children:[o.jsx(yp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),o.jsxs(vp,{className:"evidence-modal","aria-describedby":void 0,children:[o.jsxs("div",{className:"evidence-modal-header",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," \\u00b7 ",E.provider||"All providers"]}),o.jsx(xp,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),o.jsxs($j,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[o.jsx($u,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&o.jsxs("div",{className:"evidence-modal-timeline",children:[o.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),o.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:S.map((G,oe)=>{const q=c===-1&&oe===S.length-1||c===oe,X=G.citationState==="cited"?"bg-emerald-400":G.citationState==="emerging"?"bg-amber-400":G.citationState==="lost"?"bg-rose-400":"bg-zinc-600",F=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ie=!!(G.model&&oe>0&&S[oe-1]?.model&&S[oe-1].model!==G.model);return o.jsxs("button",{type:"button",className:`evidence-run-dot ${q?"evidence-run-dot--selected":""}`,onClick:()=>Q(oe===S.length-1?-1:oe),"aria-label":[`Run ${F}: ${G.citationState}`,G.model?`model ${G.model}`:null,ie?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":q,children:[o.jsx("span",{className:`size-2 rounded-full ${X} ${ie?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),o.jsx("span",{className:"text-[10px] text-zinc-500",children:F})]},oe)})}),c>=0&&c<S.length&&o.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",o.jsx("span",{className:"capitalize",children:S[c].citationState}),o.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>Q(-1),children:"\\u2190 Back to latest"})]}),!k&&(e.modelTransitions?.length??0)>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(G=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${G.fromModel??"unknown"} -> ${G.toModel??"unknown"} on ${new Date(G.createdAt).toLocaleDateString()}`},`${G.runId}:${G.toModel??"unknown"}`))})]}),o.jsxs("div",{className:"evidence-modal-body",children:[p&&o.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!p&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"evidence-modal-main",children:[o.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${P}`,children:[o.jsx("p",{className:`evidence-position-label evidence-position-label--${P}`,children:je.label}),o.jsx("p",{className:`evidence-position-title evidence-position-title--${P}`,children:je.title}),o.jsx("p",{className:"evidence-position-meta",children:je.meta}),ke&&o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ke})]}),E.answerSnippet&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),o.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:B()}),E.answerSnippet.length>280&&o.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!p&&o.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!k&&e.relatedTechnicalSignals.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:R?"Why you're cited":"What to fix"}),o.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,oe)=>o.jsxs("div",{className:"action-item",children:[o.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?o.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):o.jsxs(o.Fragment,{children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),o.jsx("span",{className:"action-item-text",children:G})]},oe))})]}),E.summary&&o.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),o.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),o.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((G,oe)=>{const q=G.toLowerCase().replace(/^www\./,""),X=w.has(q),O=!X&&E.competitorDomains.some(ie=>ie.toLowerCase().replace(/^www\./,"")===q),F=X?"you":O?"competitor":"other";return o.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${F}`,children:[o.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),o.jsx("span",{className:"citation-leaderboard-domain",children:G}),X&&o.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),O&&o.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)}),!R&&o.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[o.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"\\u2014"}),o.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),o.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),o.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((G,oe)=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},oe))})]}),E.evidenceUrls.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),o.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(G=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&o.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",k?"for this run":"yet"]})]})]})]})]})]})})}function ss(e){const t=new Date("2026-02-20");return e.map((s,a)=>({runId:`run_mock_${a+1}`,citationState:s,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const Zh=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function Yu(e){return{id:e.id,projectId:e.projectId,projectName:e.projectName,kind:e.kind,kindLabel:e.kindLabel,status:e.status,trigger:e.trigger??"manual",createdAt:e.createdAt,startedAt:e.startedAt,duration:e.duration,statusDetail:e.statusDetail,summary:e.summary,triggerLabel:e.triggerLabel}}const MD=Yu({id:"run_citypoint_visibility_20260308",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T12:15:00.000Z",startedAt:"Mar 8, 12:15 PM",duration:"6m 12s",statusDetail:"18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.",summary:"Citation losses on emergency-intent prompts",triggerLabel:"Scheduled"}),$D=Yu({id:"run_citypoint_queued_20260309",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"queued",createdAt:"2026-03-09T08:05:00.000Z",startedAt:"Mar 9, 8:05 AM",duration:"Waiting for slot",statusDetail:"Ready to enqueue after the next provider rate window clears.",summary:"Queued follow-up after local ranking movement",triggerLabel:"Manual"}),UD=Yu({id:"run_harbor_visibility_20260308",projectId:"project_harbor",projectName:"Harbor Legal Group",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T11:05:00.000Z",startedAt:"Mar 8, 11:05 AM",duration:"5m 07s",statusDetail:"12 tracked queries checked; local-intent visibility held steady across branded prompts.",summary:"Branded prompts remain stable",triggerLabel:"Scheduled"}),PD=Yu({id:"run_northstar_visibility_20260308",projectId:"project_northstar",projectName:"Northstar Orthopedics",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"running",createdAt:"2026-03-08T13:40:00.000Z",startedAt:"Mar 8, 1:40 PM",duration:"3m 10s",statusDetail:"Provider responses still in flight for 9 multi-location prompts.",summary:"Mid-run on treatment-location prompts",triggerLabel:"Manual"}),ID=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:ss(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Zh[0],Zh[1],ss(["cited","cited","cited","cited","cited"]),Zh[2],2/7,ss(["not-cited","not-cited","not-cited","cited"]);function BD(e,t){return e.projects.find(s=>s.project.id===t)}function qD(e,t){return e.runs.find(s=>s.id===t)}function HD(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(r=>r.id===t);if(a)return{project:s,evidence:a}}}function mN(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Rb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function GD(e,t){if(!e)return"Waiting";if(!t)return"Running";const s=new Date(t).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const r=Math.floor(a/60),c=a%60;return`${r}m ${c}s`}function pN(e){return e==="answer-visibility"?"Answer visibility sweep":e}function KD(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Up(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:pN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Rb(e.startedAt):Rb(e.createdAt),duration:GD(e.startedAt,e.finishedAt),statusDetail:e.error?gN(e.error):FD(e),summary:ZD(e),triggerLabel:KD(e.trigger)}}function gN(e){try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null){const a=s.message??s.error?.message??s[0]?.error?.message;if(typeof a=="string"&&a.length>0)return a.length>200?a.slice(0,200)+"…":a}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const s=t[1];return s.length>200?s.slice(0,200)+"…":s}return e.length>200?e.slice(0,200)+"…":e}function FD(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?gN(e.error):"Run failed.";default:return""}}function ZD(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function yN(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const c of e){const d=c.keyword??c.id;t.has(d)||t.set(d,!1),c.citationState==="cited"&&t.set(d,!0)}const s=t.size,a=[...t.values()].filter(Boolean).length;return{score:s>0?Math.round(a/s*100):0,citedCount:a,totalCount:s}}function VD(e){return e>=70?"positive":e>=40?"caution":"negative"}function QD(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function YD(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function JD(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const c of e){const d=c.keywordId,f=t.get(d)??{cited:!1,competitorOverlap:new Set};c.citationState==="cited"&&(f.cited=!0);for(const m of c.competitorOverlap)f.competitorOverlap.add(m);t.set(d,f)}const s=t.size,a=[...t.values()].filter(c=>!c.cited&&c.competitorOverlap.size>0).length,r=a===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${a}`,delta:`${a} of ${s} key phrases at risk`,tone:YD(a,s),description:a>0?`${a} tracked ${r} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:s>0?a/s:0}}function XD(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function WD(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function eM(e,t){const s=XD(e,t);if(!s||s.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const a=s.notIndexed===1?"URL is":"URLs are",r=s.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(s.percentage)}`,delta:`${s.provider} · ${s.indexed} of ${s.total} indexed`,tone:WD(s),description:s.provider==="Google"&&s.deindexed>0?`${s.deindexed} deindexed ${r} detected in the latest Google Search Console inspection.`:`${s.notIndexed} ${a} not indexed in ${s.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function vN(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const s=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(d=>s.has(d))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function tM(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const p of s.snapshots)if(p.keyword){const v=`${p.keyword}::${p.provider}`;f.set(v,p)}const m=[...new Set(s.snapshots.map(p=>p.provider))].sort();m.length===0&&m.push("gemini");for(const p of t){if(p.runs.length===0)continue;d.add(p.keyword);const y=p.runs.at(-1)?.transition??"not-cited",x=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const b of m){const w=f.get(`${p.keyword}::${b}`);if(!w&&m.length>1)continue;const S=w?.model??null,C=S?`${b}:${S}`:null,k=C?p.modelRuns?.[C]:void 0,E=p.providerRuns?.[b],R=(E?.length?E:null)??(k?.length?k:null),_=E?.length?"provider":k?.length?"model":"keyword",D=R?R.at(-1).transition:y,M=D==="lost"?"lost":D==="emerging"?"emerging":w?w.citationState==="cited"?"cited":"not-cited":x,T=Mm(R||p.runs),A=nM(p,b),P=(R??p.runs).map(pe=>({runId:pe.runId,citationState:pe.citationState,createdAt:pe.createdAt,model:A.get(pe.runId)??null})),J=sM(P),Q=_==="provider"&&J.length<=1?"model":_,se=iM(P);r.push({id:`evidence_${e}_${c++}`,keyword:p.keyword,provider:w?.provider??b,model:w?.model??null,location:w?.location??null,citationState:M,changeLabel:aM(D,T),answerSnippet:w?.answerText??"",citedDomains:w?.citedDomains??[],evidenceUrls:[],competitorDomains:w?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:w?.groundingSources??[],summary:rM(M,p.keyword),runHistory:P,historyScope:Q,modelsSeen:J,modelTransitions:se})}}}for(const f of a)d.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function nM(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const d=r.slice(a.length),f=d==="unknown"?null:d;for(const m of c)s.set(m.runId,f)}return s}function sM(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function iM(e){const t=[];let s=null;for(const a of e){const r=a.model??null;r!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:r}),s=r}return t}function Mm(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let s=0;for(let a=e.length-1;a>=0&&e[a].citationState===t;a--)s++;return s}function aM(e,t){switch(e){case"new":return"First observation";case"cited":return t<=1?"Cited in latest run":`Cited for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return"First citation";case"not-cited":return t<=1?"Not cited in latest run":`Not cited across ${t} runs`;default:return e}}function rM(e,t){switch(e){case"cited":return`Your domain is cited in AI answers for "${t}".`;case"lost":return`Citation was lost for "${t}". Competitors may have gained ground.`;case"emerging":return`Your domain is starting to appear in answers for "${t}".`;case"not-cited":return`No citation detected for "${t}".`;case"pending":return`"${t}" has been added but no visibility run has been triggered yet.`}}function Tb(e,t){const s=new Set(t),a=new Map;for(const r of e)if(r.keyword)for(const c of r.competitorOverlap){if(!s.has(c))continue;const d=a.get(c)??new Set;d.add(r.keyword),a.set(c,d)}return a}const Vh=3;function oM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],m=new Set;for(const k of t)k.citationState==="lost"&&(m.has(k.keyword)||(m.add(k.keyword),f.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));f.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} key phrase${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const p=Tb(a,c),v=Tb(r,c);for(const k of c){const E=p.get(k)??new Set,R=v.get(k)??new Set,_=[...E].filter(D=>!R.has(D));_.length>0&&d.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:_.map(D=>{const M=t.find(T=>T.keyword===D);return{keyword:D,evidenceId:M?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of s){const E=k.runs.at(-1);E&&y.set(k.keyword,{transition:E.transition,citationState:E.citationState})}const x=[],b=[],w=new Set;for(const[k,{transition:E,citationState:R}]of y){if(!(E==="emerging"||E==="new"&&R==="cited"))continue;w.add(k);const D=t.find(M=>M.keyword===k&&(M.citationState==="emerging"||M.citationState==="cited"));x.push({keyword:k,evidenceId:D?.id??"",provider:D?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(w.has(k.keyword)||b.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(b.length>0){const k=new Set(b.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} key phrase${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:b})}x.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} key phrase${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:x});const S=new Set(t.map(k=>k.keyword)),C=[];for(const k of s){if(!S.has(k.keyword)||k.runs.length<Vh||k.runs.at(-1)?.citationState!=="not-cited")continue;if(Mm(k.runs)>=Vh){const _=t.find(D=>D.keyword===k.keyword);C.push({keyword:k.keyword,evidenceId:_?.id??"",citationState:"not-cited"})}}C.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} key phrase${C.length>1?"s":""} uncited for ${Vh}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const k of c){const E=p.get(k)??new Set,_=[...v.get(k)??new Set].filter(D=>!E.has(D));_.length>0&&d.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:_.map(D=>{const M=t.find(T=>T.keyword===D);return{keyword:D,evidenceId:M?.id??"",citationState:"not-cited"}})})}return d.length===0&&d.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),d}function lM(e,t){if(t.length===0){const m=new Set(e.filter(p=>p.citationState==="cited").map(p=>p.keyword)).size;return{gained:m,lost:0,tone:m>0?"positive":"neutral",hasPreviousRun:!1}}const s=m=>{const p=new Set;for(const v of m)v.citationState==="cited"&&v.keyword&&p.add(v.keyword);return p},a=s(e),r=s(t);let c=0,d=0;for(const m of a)r.has(m)||c++;for(const m of r)a.has(m)||d++;const f=d>c?"negative":c>d?"positive":"neutral";return{gained:c,lost:d,tone:f,hasPreviousRun:!0}}function cM(e){const t=e[0];if(!t)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const s=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",a=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:s,delta:`${e.length} total runs`,tone:a,description:`Latest: ${pN(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function uM(e){const t=mN(e.project),s=tM(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=yN(a),c=JD(a),d=eM(e.gscCoverage,e.bingCoverage),f=vN(a,e.competitors.map(b=>b.domain)),m=oM({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(b=>b.domain)}),p=[...e.runs].sort((b,w)=>w.createdAt.localeCompare(b.createdAt)),v=p.map(b=>Up(b,e.project.displayName||e.project.name)),y=new Map;for(const b of a){const w=b.provider||"gemini",S=b.model??null,C=`${w}::${S??"unknown"}`,k=y.get(C)??{provider:w,model:S,cited:0,total:0};k.total++,b.citationState==="cited"&&k.cited++,y.set(C,k)}const x=[...y.values()].sort((b,w)=>b.provider.localeCompare(w.provider)||(b.model??"").localeCompare(w.model??"")).map(({provider:b,model:w,cited:S,total:C})=>({provider:b,model:w,score:C>0?Math.round(S/C*100):0,cited:S,total:C}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?VD(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},keywordCounts:{cited:r.citedCount,total:r.totalCount},gapKeyPhrases:c,indexCoverage:d,providerScores:x,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:QD(f.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:cM(p),movementSummary:lM(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:s,competitors:e.competitors.map((b,w)=>{const S=new Set;for(const _ of a)(_.competitorOverlap.includes(b.domain)||_.citedDomains.includes(b.domain))&&_.keyword&&S.add(_.keyword);const C=[...S],k=new Set(a.map(_=>_.keyword).filter(Boolean)),E=k.size>0?C.length/k.size:0,R=E>=.5?"High":E>=.2?"Moderate":C.length>0?"Low":"None";return{id:b.id||`comp_${w}`,domain:b.domain,citationCount:C.length,totalKeywords:k.size,pressureLabel:R,citedKeywords:C,movement:"",notes:""}}),recentRuns:v.slice(0,5)}}function dM(e){const t=mN(e.project),s=e.latestRunDetail?.snapshots??[],a=yN(s),r=vN(s,e.competitors.map(m=>m.domain)),d=[...e.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt))[0],f=d?Up(d,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(m=>m.provider)).size} provider${new Set(s.map(m=>m.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function fM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(uM(d)),r.push(dM(d));const f=[...d.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt));for(const m of f)s.push(Up(m,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?hM(a):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:s.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...c?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:a,runs:s,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:c,ctaLabel:c?"Trigger run":"Create a project first",summary:c?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(d=>({name:d.name,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,model:d.model,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function hM(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Ai={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},xN=N.createContext(null);xN.Provider;function cl(){return N.useContext(xN)}function Ra(e){const s=cl()?.dashboard??null,a=Ko({queryKey:Ai.projects.all,queryFn:Sw,enabled:!s}),r=Ko({queryKey:Ai.runs.all,queryFn:jw,enabled:!s,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=Ko({queryKey:Ai.settings,queryFn:()=>Zu().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],m=Wk({queries:d.map(w=>{const S=f.filter(k=>k.projectId===w.id),C=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:Ai.projects.detail(w.id,C[0]?.id),queryFn:async()=>{const[k,E,R,_,D,M,T]=await Promise.all([ww(w.name).catch(()=>[]),Ep(w.name).catch(()=>[]),Rp(w.name).catch(()=>[]),C[0]?Lr(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Lr(C[1].id).catch(()=>null):Promise.resolve(null),Vu(w.name).catch(()=>null),Qu(w.name).catch(()=>null)]);return{project:w,runs:S,keywords:k,competitors:E,timeline:R,latestRunDetail:_,previousRunDetail:D,gscCoverage:M,bingCoverage:T}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),p=m.every(w=>w.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!p)return null;const w=m.map(S=>S.data).filter(S=>S!=null);return fM(w,c.data??null)},[s,a.data,r.data,c.data,p,m,d.length]),y=!s&&(a.isError||r.isError),x=!s&&!v&&!y,b=N.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:v,isLoading:x,isError:y,refetch:b}}function mM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Ab=mM(),$m=Ab==="/"?"":Ab.replace(/\/$/,"");async function pM(){const e=$m?`${$m}/health`:"/health",t=await hN(e,"API"),s=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:s}}function Ju(e,t){return Ko({queryKey:Ai.health,queryFn:pM,enabled:e,refetchInterval:15e3,initialData:t})}function gM(e){return Ko({queryKey:Ai.runs.detail(e??""),queryFn:()=>Lr(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function ul(){const e=ka(),t=Du({strict:!1}),s=jn({select:m=>m.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:m=>e({to:s,from:as.to,search:p=>({...p,runId:m,evidenceId:void 0})}),openEvidence:m=>e({to:s,from:as.to,search:p=>({...p,evidenceId:m,runId:void 0})}),closeDrawer:()=>e({to:s,from:as.to,search:m=>({...m,runId:void 0,evidenceId:void 0})})}}const Ob=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],Lb=e=>({label:e,state:"checking",detail:"Checking service health"}),yM={apiStatus:Lb("API"),workerStatus:Lb("Worker")};function vM(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),d=Ju(!e,e?.health).data??e?.health??yM,f=n2(),{runId:m,evidenceId:p,closeDrawer:v}=ul(),[y,x]=N.useState(!1),b=gM(m),w=b.data??null,S=b.isLoading;N.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&a()},[w?.status,a]),N.useEffect(()=>{x(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!m&&!p)return;const _=D=>{D.key==="Escape"&&v()};return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[m,p,v]);const C=t??e?.dashboard??null,k=m&&C?qD(C,m):void 0,E=p&&C?HD(C,p):void 0,R=(()=>{const _=f.pathname;if(_==="/")return"Portfolio";if(_==="/projects")return"Projects";if(_==="/runs")return"Runs";if(_==="/settings")return"Settings";if(_==="/setup")return"Setup";if(_.startsWith("/projects/")){const M=_.split("/").filter(Boolean)[1];if(M&&C){const T=C.projects.find(A=>A.project.id===M);if(T)return T.project.name}return"Project"}return"Not found"})();return o.jsxs("div",{className:"app-shell",children:[o.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),o.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[o.jsx("div",{className:"sidebar-brand",children:o.jsx(Vx,{})}),o.jsxs("nav",{className:"sidebar-nav",children:[o.jsxs(yt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(b2,{className:"sidebar-icon"}),o.jsx("span",{children:"Overview"})]}),o.jsxs(yt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[o.jsx(v2,{className:"sidebar-icon"}),o.jsx("span",{children:"Projects"})]}),o.jsxs(yt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(N2,{className:"sidebar-icon"}),o.jsx("span",{children:"Runs"})]}),o.jsxs(yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(A2,{className:"sidebar-icon"}),o.jsx("span",{children:"Settings"})]}),s?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(_=>o.jsxs("div",{className:"sidebar-skeleton-item",children:[o.jsx("span",{className:"skeleton-circle size-2"}),o.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+_*15}%`}})]},_))]}):C&&C.projects.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(_=>{const D=_.visibilitySummary.tone;return o.jsxs(yt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[o.jsx("span",{className:`sidebar-dot sidebar-dot-${D}`}),o.jsx("span",{children:_.project.name})]},_.project.id)})]}):s?null:o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Resources"}),o.jsxs(yt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(z2,{className:"sidebar-icon"}),o.jsx("span",{children:"Setup"})]})]})]}),o.jsx("div",{className:"sidebar-footer",children:Ob.map(_=>o.jsx("a",{className:"sidebar-footer-link",href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.href))})]}),o.jsxs("div",{className:"main-area",children:[o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"topbar-left",children:[o.jsx("div",{className:"topbar-brand-mobile",children:o.jsx(Vx,{compact:!0})}),o.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[o.jsx(yt,{to:"/",children:"Home"}),o.jsx(Mu,{className:"breadcrumb-sep size-3"}),o.jsx("span",{className:"breadcrumb-current",children:R})]})]}),o.jsxs("div",{className:"topbar-actions",children:[o.jsxs("div",{className:"health-pill-row",children:[o.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),o.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),o.jsxs(ce,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>x(_=>!_),children:[o.jsx(j2,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),o.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[o.jsxs(ce,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>x(!1),children:[o.jsx($u,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Close navigation"})]}),o.jsx(yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),o.jsx(yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),o.jsx(yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),o.jsx(yt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C&&C.projects.length>0?o.jsxs("div",{className:"mobile-nav-section",children:[o.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(_=>o.jsx(yt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"mobile-nav-link",children:_.project.name},_.project.id))]}):null]}),o.jsx("main",{id:"content",className:"page-shell",children:s&&!e?o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-40"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(_=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text w-full"}),o.jsx("div",{className:"skeleton-text-sm w-3/4"})]},_))}),o.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(_=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-20"}),o.jsx("div",{className:"space-y-2",children:[1,2,3].map(D=>o.jsx("div",{className:"skeleton-text-sm w-full"},D))})]},_))})]}):o.jsx(up,{})}),o.jsxs("footer",{className:"footer",children:[o.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[o.jsx(g2,{className:"size-3.5"}),o.jsx("span",{children:"Canonry"})]}),o.jsx("div",{className:"footer-links",children:Ob.map(_=>o.jsx("a",{href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.href))})]})]}),k?o.jsxs(RT,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[o.jsx(Pu,{status:k.status}),o.jsx("span",{className:"text-zinc-400",children:k.startedAt}),o.jsx("span",{className:"text-zinc-500",children:k.duration}),o.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&o.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?o.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(_=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:_.keyword??"Unknown key phrase"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(tl,{provider:_.provider}),o.jsx(tj,{variant:_.citationState==="cited"?"success":"neutral",children:_.citationState})]})]}),_.model&&o.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:_.model}),_.citedDomains.length>0&&o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[o.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",_.citedDomains.join(", ")]}),_.competitorOverlap.length>0&&o.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",_.competitorOverlap.join(", ")]}),_.groundingSources&&_.groundingSources.length>0&&o.jsxs("details",{className:"mt-2",children:[o.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[_.groundingSources.length," grounding source",_.groundingSources.length!==1?"s":""]}),o.jsx("ul",{className:"mt-1 space-y-0.5",children:_.groundingSources.map((D,M)=>o.jsx("li",{className:"text-xs text-zinc-500 truncate",children:o.jsx("a",{href:D.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:D.title||D.uri})},M))})]}),_.answerText&&o.jsxs("details",{className:"mt-1",children:[o.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),o.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:_.answerText})]})]},_.id)),w.status==="running"&&o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?o.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[o.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),o.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:I2(w.error)})]}):o.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?o.jsx(DD,{evidence:E.evidence,project:E.project,onClose:v}):null]})}class xM extends N.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?o.jsx("div",{className:"page-container",children:o.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[o.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:o.jsx(M2,{className:"size-6 text-rose-400"})}),o.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),o.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),o.jsxs("div",{className:"flex gap-3 mt-2",children:[o.jsxs(ce,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[o.jsx(R2,{className:"size-3.5 mr-1.5"}),"Try again"]}),o.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Le=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));Le.displayName="Card";const bM=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("flex flex-col gap-1.5 p-5",e),...t}));bM.displayName="CardHeader";const SM=N.forwardRef(({className:e,...t},s)=>o.jsx("h3",{ref:s,className:Qn("font-medium tracking-tight text-zinc-50",e),...t}));SM.displayName="CardTitle";const jM=N.forwardRef(({className:e,...t},s)=>o.jsx("p",{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));jM.displayName="CardDescription";const wM=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("p-5 pt-0",e),...t}));wM.displayName="CardContent";function NM({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),m=Math.max(...e)-d||1,p=r-c*2,v=a-c*2,y=e.map((x,b)=>{const w=c+b/Math.max(e.length-1,1)*p,S=c+(1-(x-d)/m)*v;return`${w},${S}`}).join(" ");return o.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[o.jsx("defs",{children:o.jsx("clipPath",{id:s,children:o.jsx("rect",{x:c,y:c,width:p,height:v,rx:"8"})})}),o.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),o.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function CM(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function kM(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:Su(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:Su(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(m=>m.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(m=>m.state==="ready").map(m=>CM(m)).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function _M(e,t){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!t.providerStatuses.some(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function zM(e,t,s){const a=_M(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}function EM({project:e}){return o.jsxs(yt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[o.jsxs("div",{className:"project-row-primary",children:[o.jsxs("div",{children:[o.jsx("p",{className:"project-name",children:e.project.name}),o.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),o.jsx("p",{className:"project-insight",children:e.insight})]}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),o.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),o.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),o.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),o.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Uu(e.lastRun.status)]})]})}),o.jsx("div",{className:"project-row-chart",children:o.jsx(NM,{points:e.trend,tone:nj(e.lastRun.status)})}),o.jsx("span",{className:"project-row-link",children:o.jsx(Mu,{className:"h-4 w-4 text-zinc-500"})})]})}function RM(){const e=cl(),{dashboard:t,isLoading:s}=Ra(),a=t??e?.dashboard;if(!a||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-32"}),o.jsx("div",{className:"skeleton-text-sm w-64"})]}),o.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("div",{className:"skeleton-text w-36"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const r=a.portfolioOverview,f=Ju(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},m=kM(r.systemHealth,f,a.settings),{openRun:p}=ul();return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Portfolio"}),o.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),o.jsx("div",{className:"page-header-right",children:o.jsx("p",{className:"text-[11px] text-zinc-600",children:r.lastUpdatedAt})})]}),r.projects.length>0?o.jsx("div",{className:"project-list project-list-scrollable",children:r.projects.map(v=>o.jsx(EM,{project:v},v.project.id))}):o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h3",{children:r.emptyState?.title??"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:r.emptyState?.detail}),o.jsx(ce,{size:"sm",asChild:!0,children:o.jsx(yt,{to:r.emptyState?.ctaHref==="/setup"||!r.emptyState?.ctaHref?"/setup":"/",children:r.emptyState?.ctaLabel??"Launch setup"})})]}),o.jsxs("div",{className:"overview-secondary-grid",children:[r.attentionItems.length>0&&o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),o.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),o.jsx("div",{className:"attention-list attention-list-scrollable",children:r.attentionItems.map(v=>o.jsxs(yt,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[o.jsxs("div",{children:[o.jsx("p",{className:"attention-title",children:v.title}),o.jsx("p",{className:"attention-detail",children:v.detail})]}),o.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.id))})]}),o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),o.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),o.jsx("div",{className:"compact-stack compact-stack-scrollable",children:r.recentRuns.length>0?r.recentRuns.map(v=>o.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(v.id),children:[o.jsxs("div",{children:[o.jsx("p",{className:"compact-run-title",children:v.projectName}),o.jsx("p",{className:"compact-run-detail",children:v.summary})]}),o.jsx(Pu,{status:v.status})]},v.id)):o.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),o.jsxs("section",{className:"page-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),o.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),o.jsx("div",{className:"health-grid",children:m.map(v=>o.jsxs(Le,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:v.label}),o.jsx("h3",{children:v.detail})]}),o.jsx(nt,{tone:v.tone,children:v.label})]}),o.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Pp=Symbol.for("yaml.alias"),Um=Symbol.for("yaml.document"),$i=Symbol.for("yaml.map"),bN=Symbol.for("yaml.pair"),Ss=Symbol.for("yaml.scalar"),Br=Symbol.for("yaml.seq"),Fn=Symbol.for("yaml.node.type"),Ta=e=>!!e&&typeof e=="object"&&e[Fn]===Pp,Xu=e=>!!e&&typeof e=="object"&&e[Fn]===Um,dl=e=>!!e&&typeof e=="object"&&e[Fn]===$i,Lt=e=>!!e&&typeof e=="object"&&e[Fn]===bN,ft=e=>!!e&&typeof e=="object"&&e[Fn]===Ss,fl=e=>!!e&&typeof e=="object"&&e[Fn]===Br;function At(e){if(e&&typeof e=="object")switch(e[Fn]){case $i:case Br:return!0}return!1}function Ot(e){if(e&&typeof e=="object")switch(e[Fn]){case Pp:case $i:case Ss:case Br:return!0}return!1}const SN=e=>(ft(e)||At(e))&&!!e.anchor,fa=Symbol("break visit"),TM=Symbol("skip children"),Vo=Symbol("remove node");function qr(e,t){const s=AM(t);Xu(e)?Nr(null,e.contents,s,Object.freeze([e]))===Vo&&(e.contents=null):Nr(null,e,s,Object.freeze([]))}qr.BREAK=fa;qr.SKIP=TM;qr.REMOVE=Vo;function Nr(e,t,s,a){const r=OM(e,t,s,a);if(Ot(r)||Lt(r))return LM(e,a,r),Nr(e,r,s,a);if(typeof r!="symbol"){if(At(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const d=Nr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===fa)return fa;d===Vo&&(t.items.splice(c,1),c-=1)}}}else if(Lt(t)){a=Object.freeze(a.concat(t));const c=Nr("key",t.key,s,a);if(c===fa)return fa;c===Vo&&(t.key=null);const d=Nr("value",t.value,s,a);if(d===fa)return fa;d===Vo&&(t.value=null)}}return r}function AM(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function OM(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(dl(t))return s.Map?.(e,t,a);if(fl(t))return s.Seq?.(e,t,a);if(Lt(t))return s.Pair?.(e,t,a);if(ft(t))return s.Scalar?.(e,t,a);if(Ta(t))return s.Alias?.(e,t,a)}function LM(e,t,s){const a=t[t.length-1];if(At(a))a.items[e]=s;else if(Lt(a))e==="key"?a.key=s:a.value=s;else if(Xu(a))a.contents=s;else{const r=Ta(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const DM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},MM=e=>e.replace(/[!,[\]{}]/g,t=>DM[t]);class dn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},dn.defaultYaml,t),this.tags=Object.assign({},dn.defaultTags,s)}clone(){const t=new dn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new dn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:dn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},dn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:dn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},dn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,d]=a;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,d),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const d=t.slice(2,-1);return d==="!"||d==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),d)}const[,a,r]=t.match(/^(.*!)([^!]*)$/s);r||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(d){return s(String(d)),null}return a==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,a]of Object.entries(this.tags))if(t.startsWith(a))return s+MM(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(t&&a.length>0&&Ot(t.contents)){const c={};qr(t.contents,(d,f)=>{Ot(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,d]of a)c==="!!"&&d==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(d)))&&s.push(`%TAG ${c} ${d}`);return s.join(`
|
|
96
|
-
`)}}dn.defaultYaml={explicit:!1,version:"1.2"};dn.defaultTags={"!!":"tag:yaml.org,2002:"};function jN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function wN(e){const t=new Set;return qr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function NN(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function $M(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=wN(e));const d=NN(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(ft(d.node)||At(d.node)))d.node.anchor=d.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=c,f}}},sourceObjects:a}}function Cr(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const d=a[r],f=Cr(e,a,String(r),d);f===void 0?delete a[r]:f!==d&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),d=Cr(e,a,r,c);d===void 0?a.delete(r):d!==c&&a.set(r,d)}else if(a instanceof Set)for(const r of Array.from(a)){const c=Cr(e,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const d=Cr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Kn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Kn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!SN(e))return e.toJSON(t,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const r=e.toJSON(t,s);return s.onCreate&&s.onCreate(r),r}return typeof e=="bigint"&&!s?.keep?Number(e):e}class
|
|
94
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const f=d[1];if(t===d[0]){c(d);continue}if(e.external){const p=e.external.registry.get(d[0])?.id;if(t!==d[0]&&p){c(d);continue}}if(e.metadataRegistry.get(d[0])?.id){c(d);continue}if(f.cycle){c(d);continue}if(f.count>1&&e.reused==="ref"){c(d);continue}}}function fw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=d=>{const f=e.seen.get(d);if(f.ref===null)return;const m=f.def??f.schema,p={...m},v=f.ref;if(f.ref=null,v){a(v);const x=e.seen.get(v),b=x.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(b)):Object.assign(m,b),Object.assign(m,p),d._zod.parent===v)for(const S in m)S==="$ref"||S==="allOf"||S in p||delete m[S];if(b.$ref&&x.def)for(const S in m)S==="$ref"||S==="allOf"||S in x.def&&JSON.stringify(m[S])===JSON.stringify(x.def[S])&&delete m[S]}const y=d._zod.parent;if(y&&y!==v){a(y);const x=e.seen.get(y);if(x?.schema.$ref&&(m.$ref=x.schema.$ref,x.def))for(const b in m)b==="$ref"||b==="allOf"||b in x.def&&JSON.stringify(m[b])===JSON.stringify(x.def[b])&&delete m[b]}e.override({zodSchema:d,jsonSchema:m,path:f.path??[]})};for(const d of[...e.seen.entries()].reverse())a(d[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const d=e.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(d)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const d of e.seen.entries()){const f=d[1];f.def&&f.defId&&(c[f.defId]=f.def)}e.external||Object.keys(c).length>0&&(e.target==="draft-2020-12"?r.$defs=c:r.definitions=c);try{const d=JSON.parse(JSON.stringify(r));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:ku(t,"input",e.processors),output:ku(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function cn(e,t){const s=t??{seen:new Set};if(s.seen.has(e))return!1;s.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return cn(a.element,s);if(a.type==="set")return cn(a.valueType,s);if(a.type==="lazy")return cn(a.getter(),s);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return cn(a.innerType,s);if(a.type==="intersection")return cn(a.left,s)||cn(a.right,s);if(a.type==="record"||a.type==="map")return cn(a.keyType,s)||cn(a.valueType,s);if(a.type==="pipe")return cn(a.in,s)||cn(a.out,s);if(a.type==="object"){for(const r in a.shape)if(cn(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(cn(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(cn(r,s))return!0;return!!(a.rest&&cn(a.rest,s))}return!1}const z5=(e,t={})=>s=>{const a=uw({...s,processors:t});return qt(e,a),dw(a,e),fw(a,e)},ku=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},d=uw({...r??{},target:c,io:t,processors:s});return qt(e,d),dw(d,e),fw(d,e)},E5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},R5=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:d,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof d=="number"&&(r.maxLength=d),f&&(r.format=E5[f]??f,r.format===""&&delete r.format,f==="time"&&delete r.format),p&&(r.contentEncoding=p),m&&m.size>0){const v=[...m];v.length===1?r.pattern=v[0].source:v.length>1&&(r.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},T5=(e,t,s,a)=>{const r=s,{minimum:c,maximum:d,format:f,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?r.type="integer":r.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=v,r.exclusiveMinimum=!0):r.exclusiveMinimum=v),typeof c=="number"&&(r.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete r.minimum:delete r.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=p,r.exclusiveMaximum=!0):r.exclusiveMaximum=p),typeof d=="number"&&(r.maximum=d,typeof p=="number"&&t.target!=="draft-04"&&(p<=d?delete r.maximum:delete r.exclusiveMaximum)),typeof m=="number"&&(r.multipleOf=m)},A5=(e,t,s,a)=>{s.type="boolean"},O5=(e,t,s,a)=>{s.not={}},D5=(e,t,s,a)=>{},L5=(e,t,s,a)=>{const r=e._zod.def,c=Gj(r.entries);c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),s.enum=c},M5=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const d of r.values)if(d===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(d))}else c.push(d);if(c.length!==0)if(c.length===1){const d=c[0];s.type=d===null?"null":typeof d,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[d]:s.const=d}else c.every(d=>typeof d=="number")&&(s.type="number"),c.every(d=>typeof d=="string")&&(s.type="string"),c.every(d=>typeof d=="boolean")&&(s.type="boolean"),c.every(d=>d===null)&&(s.type="null"),s.enum=c},$5=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},U5=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},P5=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:d,maximum:f}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=qt(c.element,t,{...a,path:[...a.path,"items"]})},I5=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const d=c.shape;for(const p in d)r.properties[p]=qt(d[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(d)),m=new Set([...f].filter(p=>{const v=c.shape[p]._zod;return t.io==="input"?v.optin===void 0:v.optout===void 0}));m.size>0&&(r.required=Array.from(m)),c.catchall?._zod.def.type==="never"?r.additionalProperties=!1:c.catchall?c.catchall&&(r.additionalProperties=qt(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},B5=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,d=r.options.map((f,m)=>qt(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?s.oneOf=d:s.anyOf=d},q5=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.left,t,{...a,path:[...a.path,"allOf",0]}),d=qt(r.right,t,{...a,path:[...a.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,m=[...f(c)?c.allOf:[c],...f(d)?d.allOf:[d]];s.allOf=m},H5=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const d=c.keyType,m=d._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const v=qt(c.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});r.patternProperties={};for(const y of m)r.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qt(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=qt(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const p=d._zod.values;if(p){const v=[...p].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},G5=(e,t,s,a)=>{const r=e._zod.def,c=qt(r.innerType,t,a),d=t.seen.get(e);t.target==="openapi-3.0"?(d.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},K5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},F5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},Z5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,t.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},V5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let d;try{d=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},Q5=(e,t,s,a)=>{const r=e._zod.def,c=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qt(c,t,a);const d=t.seen.get(e);d.ref=c},Y5=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.readOnly=!0},hw=(e,t,s,a)=>{const r=e._zod.def;qt(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},J5=te("ZodISODateTime",(e,t)=>{XA.init(e,t),jt.init(e,t)});function X5(e){return i5(J5,e)}const W5=te("ZodISODate",(e,t)=>{WA.init(e,t),jt.init(e,t)});function eD(e){return a5(W5,e)}const tD=te("ZodISOTime",(e,t)=>{eO.init(e,t),jt.init(e,t)});function nD(e){return r5(tD,e)}const sD=te("ZodISODuration",(e,t)=>{tO.init(e,t),jt.init(e,t)});function iD(e){return o5(sD,e)}const aD=(e,t)=>{Vj.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>KT(e,s)},flatten:{value:s=>GT(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,wm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,wm,2)}},isEmpty:{get(){return e.issues.length===0}}})},Yn=te("ZodError",aD,{Parent:Error}),rD=Cp(Yn),oD=kp(Yn),lD=Hu(Yn),cD=Gu(Yn),uD=VT(Yn),dD=QT(Yn),fD=YT(Yn),hD=JT(Yn),mD=XT(Yn),pD=WT(Yn),gD=eA(Yn),yD=tA(Yn),St=te("ZodType",(e,t)=>(bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ku(e,"input"),output:ku(e,"output")}}),e.toJSONSchema=z5(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(Hi(t,{checks:[...t.checks??[],...s.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(s,a)=>Gi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>rD(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>lD(e,s,a),e.parseAsync=async(s,a)=>oD(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>cD(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>uD(e,s,a),e.decode=(s,a)=>dD(e,s,a),e.encodeAsync=async(s,a)=>fD(e,s,a),e.decodeAsync=async(s,a)=>hD(e,s,a),e.safeEncode=(s,a)=>mD(e,s,a),e.safeDecode=(s,a)=>pD(e,s,a),e.safeEncodeAsync=async(s,a)=>gD(e,s,a),e.safeDecodeAsync=async(s,a)=>yD(e,s,a),e.refine=(s,a)=>e.check(dL(s,a)),e.superRefine=s=>e.check(fL(s)),e.overwrite=s=>e.check(Ur(s)),e.optional=()=>kb(e),e.exactOptional=()=>XD(e),e.nullable=()=>_b(e),e.nullish=()=>kb(_b(e)),e.nonoptional=s=>iL(e,s),e.array=()=>Ve(e),e.or=s=>GD([e,s]),e.and=s=>FD(e,s),e.transform=s=>zb(e,YD(s)),e.default=s=>tL(e,s),e.prefault=s=>sL(e,s),e.catch=s=>rL(e,s),e.pipe=s=>zb(e,s),e.readonly=()=>cL(e),e.describe=s=>{const a=e.clone();return Ho.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Ho.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Ho.get(e);const a=e.clone();return Ho.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),mw=te("_ZodString",(e,t)=>{_p.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>R5(e,a,r);const s=e._zod.bag;e.format=s.format??null,e.minLength=s.minimum??null,e.maxLength=s.maximum??null,e.regex=(...a)=>e.check(h5(...a)),e.includes=(...a)=>e.check(g5(...a)),e.startsWith=(...a)=>e.check(y5(...a)),e.endsWith=(...a)=>e.check(v5(...a)),e.min=(...a)=>e.check(Cu(...a)),e.max=(...a)=>e.check(lw(...a)),e.length=(...a)=>e.check(cw(...a)),e.nonempty=(...a)=>e.check(Cu(1,...a)),e.lowercase=a=>e.check(m5(a)),e.uppercase=a=>e.check(p5(a)),e.trim=()=>e.check(b5()),e.normalize=(...a)=>e.check(x5(...a)),e.toLowerCase=()=>e.check(S5()),e.toUpperCase=()=>e.check(j5()),e.slugify=()=>e.check(w5())}),vD=te("ZodString",(e,t)=>{_p.init(e,t),mw.init(e,t),e.email=s=>e.check($O(xD,s)),e.url=s=>e.check(qO(bD,s)),e.jwt=s=>e.check(s5(LD,s)),e.emoji=s=>e.check(HO(SD,s)),e.guid=s=>e.check(bb(Nb,s)),e.uuid=s=>e.check(UO(Fc,s)),e.uuidv4=s=>e.check(PO(Fc,s)),e.uuidv6=s=>e.check(IO(Fc,s)),e.uuidv7=s=>e.check(BO(Fc,s)),e.nanoid=s=>e.check(GO(jD,s)),e.guid=s=>e.check(bb(Nb,s)),e.cuid=s=>e.check(KO(wD,s)),e.cuid2=s=>e.check(FO(ND,s)),e.ulid=s=>e.check(ZO(CD,s)),e.base64=s=>e.check(e5(AD,s)),e.base64url=s=>e.check(t5(OD,s)),e.xid=s=>e.check(VO(kD,s)),e.ksuid=s=>e.check(QO(_D,s)),e.ipv4=s=>e.check(YO(zD,s)),e.ipv6=s=>e.check(JO(ED,s)),e.cidrv4=s=>e.check(XO(RD,s)),e.cidrv6=s=>e.check(WO(TD,s)),e.e164=s=>e.check(n5(DD,s)),e.datetime=s=>e.check(X5(s)),e.date=s=>e.check(eD(s)),e.time=s=>e.check(nD(s)),e.duration=s=>e.check(iD(s))});function Z(e){return MO(vD,e)}const jt=te("ZodStringFormat",(e,t)=>{xt.init(e,t),mw.init(e,t)}),xD=te("ZodEmail",(e,t)=>{HA.init(e,t),jt.init(e,t)}),Nb=te("ZodGUID",(e,t)=>{BA.init(e,t),jt.init(e,t)}),Fc=te("ZodUUID",(e,t)=>{qA.init(e,t),jt.init(e,t)}),bD=te("ZodURL",(e,t)=>{GA.init(e,t),jt.init(e,t)}),SD=te("ZodEmoji",(e,t)=>{KA.init(e,t),jt.init(e,t)}),jD=te("ZodNanoID",(e,t)=>{FA.init(e,t),jt.init(e,t)}),wD=te("ZodCUID",(e,t)=>{ZA.init(e,t),jt.init(e,t)}),ND=te("ZodCUID2",(e,t)=>{VA.init(e,t),jt.init(e,t)}),CD=te("ZodULID",(e,t)=>{QA.init(e,t),jt.init(e,t)}),kD=te("ZodXID",(e,t)=>{YA.init(e,t),jt.init(e,t)}),_D=te("ZodKSUID",(e,t)=>{JA.init(e,t),jt.init(e,t)}),zD=te("ZodIPv4",(e,t)=>{nO.init(e,t),jt.init(e,t)}),ED=te("ZodIPv6",(e,t)=>{sO.init(e,t),jt.init(e,t)}),RD=te("ZodCIDRv4",(e,t)=>{iO.init(e,t),jt.init(e,t)}),TD=te("ZodCIDRv6",(e,t)=>{aO.init(e,t),jt.init(e,t)}),AD=te("ZodBase64",(e,t)=>{rO.init(e,t),jt.init(e,t)}),OD=te("ZodBase64URL",(e,t)=>{lO.init(e,t),jt.init(e,t)}),DD=te("ZodE164",(e,t)=>{cO.init(e,t),jt.init(e,t)}),LD=te("ZodJWT",(e,t)=>{dO.init(e,t),jt.init(e,t)}),pw=te("ZodNumber",(e,t)=>{iw.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>T5(e,a,r),e.gt=(a,r)=>e.check(jb(a,r)),e.gte=(a,r)=>e.check(Fh(a,r)),e.min=(a,r)=>e.check(Fh(a,r)),e.lt=(a,r)=>e.check(Sb(a,r)),e.lte=(a,r)=>e.check(Kh(a,r)),e.max=(a,r)=>e.check(Kh(a,r)),e.int=a=>e.check(Cb(a)),e.safe=a=>e.check(Cb(a)),e.positive=a=>e.check(jb(0,a)),e.nonnegative=a=>e.check(Fh(0,a)),e.negative=a=>e.check(Sb(0,a)),e.nonpositive=a=>e.check(Kh(0,a)),e.multipleOf=(a,r)=>e.check(wb(a,r)),e.step=(a,r)=>e.check(wb(a,r)),e.finite=()=>e;const s=e._zod.bag;e.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),e.isFinite=!0,e.format=s.format??null});function Ue(e){return l5(pw,e)}const MD=te("ZodNumberFormat",(e,t)=>{fO.init(e,t),pw.init(e,t)});function Cb(e){return c5(MD,e)}const $D=te("ZodBoolean",(e,t)=>{hO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>A5(e,s,a)});function Pr(e){return u5($D,e)}const UD=te("ZodUnknown",(e,t)=>{mO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>D5()});function Cm(){return d5(UD)}const PD=te("ZodNever",(e,t)=>{pO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>O5(e,s,a)});function ID(e){return f5(PD,e)}const BD=te("ZodArray",(e,t)=>{gO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>P5(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Cu(s,a)),e.nonempty=s=>e.check(Cu(1,s)),e.max=(s,a)=>e.check(lw(s,a)),e.length=(s,a)=>e.check(cw(s,a)),e.unwrap=()=>e.element});function Ve(e,t){return N5(BD,e,t)}const qD=te("ZodObject",(e,t)=>{vO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>I5(e,s,a,r),st(e,"shape",()=>t.shape),e.keyof=()=>wn(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Cm()}),e.loose=()=>e.clone({...e._zod.def,catchall:Cm()}),e.strict=()=>e.clone({...e._zod.def,catchall:ID()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>PT(e,s),e.safeExtend=s=>IT(e,s),e.merge=s=>BT(e,s),e.pick=s=>$T(e,s),e.omit=s=>UT(e,s),e.partial=(...s)=>qT(gw,e,s[0]),e.required=(...s)=>HT(yw,e,s[0])});function Le(e,t){const s={type:"object",shape:e??{},...we(t)};return new qD(s)}const HD=te("ZodUnion",(e,t)=>{xO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>B5(e,s,a,r),e.options=t.options});function GD(e,t){return new HD({type:"union",options:e,...we(t)})}const KD=te("ZodIntersection",(e,t)=>{bO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>q5(e,s,a,r)});function FD(e,t){return new KD({type:"intersection",left:e,right:t})}const ZD=te("ZodRecord",(e,t)=>{SO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>H5(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function Fu(e,t,s){return new ZD({type:"record",keyType:e,valueType:t,...we(s)})}const km=te("ZodEnum",(e,t)=>{jO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(a,r,c)=>L5(e,a,r),e.enum=t.entries,e.options=Object.values(t.entries);const s=new Set(Object.keys(t.entries));e.extract=(a,r)=>{const c={};for(const d of a)if(s.has(d))c[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new km({...t,checks:[],...we(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const d of a)if(s.has(d))delete c[d];else throw new Error(`Key ${d} not found in enum`);return new km({...t,checks:[],...we(r),entries:c})}});function wn(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new km({type:"enum",entries:s,...we(t)})}const VD=te("ZodLiteral",(e,t)=>{wO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>M5(e,s,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function _u(e,t){return new VD({type:"literal",values:Array.isArray(e)?e:[e],...we(t)})}const QD=te("ZodTransform",(e,t)=>{NO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>U5(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new qj(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(il(c,s.value,t));else{const d=c;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=e),s.issues.push(il(d))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function YD(e){return new QD({type:"transform",transform:e})}const gw=te("ZodOptional",(e,t)=>{ow.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function kb(e){return new gw({type:"optional",innerType:e})}const JD=te("ZodExactOptional",(e,t)=>{CO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function XD(e){return new JD({type:"optional",innerType:e})}const WD=te("ZodNullable",(e,t)=>{kO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>G5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function _b(e){return new WD({type:"nullable",innerType:e})}const eL=te("ZodDefault",(e,t)=>{_O.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>F5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function tL(e,t){return new eL({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Fj(t)}})}const nL=te("ZodPrefault",(e,t)=>{zO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Z5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function sL(e,t){return new nL({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Fj(t)}})}const yw=te("ZodNonOptional",(e,t)=>{EO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>K5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function iL(e,t){return new yw({type:"nonoptional",innerType:e,...we(t)})}const aL=te("ZodCatch",(e,t)=>{RO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>V5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function rL(e,t){return new aL({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const oL=te("ZodPipe",(e,t)=>{TO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Q5(e,s,a,r),e.in=t.in,e.out=t.out});function zb(e,t){return new oL({type:"pipe",in:e,out:t})}const lL=te("ZodReadonly",(e,t)=>{AO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Y5(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function cL(e){return new lL({type:"readonly",innerType:e})}const uL=te("ZodCustom",(e,t)=>{OO.init(e,t),St.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$5(e,s)});function dL(e,t={}){return C5(uL,e,t)}function fL(e){return k5(e)}Le({maxConcurrency:Ue().int().positive(),maxRequestsPerMinute:Ue().int().positive(),maxRequestsPerDay:Ue().int().positive()});const Ir=Z().min(1);Z().min(1);const zp=Le({label:Z().min(1),city:Z().min(1),region:Z().min(1),country:Z().length(2),timezone:Z().optional()}),vw=wn(["citation.lost","citation.gained","run.completed","run.failed"]);Le({id:Z(),projectId:Z(),channel:_u("webhook"),url:Z().url(),events:Ve(vw),enabled:Pr().default(!0),webhookSecret:Z().optional(),createdAt:Z(),updatedAt:Z()});const xw=wn(["cli","api","config-file"]);function hL(e){const t=new Set,s=new Set;for(const a of e){if(t.has(a.label)){s.add(a.label);continue}t.add(a.label)}return[...s]}function mL(e,t){return t?e.some(s=>s.label===t):!0}Le({displayName:Z().min(1),canonicalDomain:Z().min(1),ownedDomains:Ve(Z().min(1)).optional(),country:Z().length(2),language:Z().min(2),tags:Ve(Z()).optional(),labels:Fu(Z(),Z()).optional(),providers:Ve(Ir).optional(),locations:Ve(zp).optional(),defaultLocation:Z().nullable().optional(),configSource:xw.optional()});Le({id:Z(),name:Z(),displayName:Z().optional(),canonicalDomain:Z(),ownedDomains:Ve(Z()).default([]),country:Z().length(2),language:Z().min(2),tags:Ve(Z()).default([]),labels:Fu(Z(),Z()).default({}),locations:Ve(zp).default([]),defaultLocation:Z().nullable().optional(),configSource:xw.default("cli"),configRevision:Ue().int().positive().default(1),createdAt:Z().optional(),updatedAt:Z().optional()});function _m(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function pL(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const d=_m(c);s.has(d)||(s.add(d),a.push(c))}return a}const gL=Le({name:Z().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:Fu(Z(),Z()).optional().default({})}),yL=Le({preset:Z().optional(),cron:Z().optional(),timezone:Z().optional().default("UTC"),providers:Ve(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),vL=Le({channel:_u("webhook"),url:Z().url(),events:Ve(vw).min(1)}),xL=Le({gsc:Le({propertyUrl:Z()}).optional(),syncSchedule:Le({preset:Z().optional(),cron:Z().optional()}).optional()}).optional(),bL=Le({displayName:Z().min(1),canonicalDomain:Z().min(1),ownedDomains:Ve(Z().min(1)).optional().default([]),country:Z().length(2),language:Z().min(2),keywords:Ve(Z().min(1)).optional().default([]),competitors:Ve(Z().min(1)).optional().default([]),providers:Ve(Ir).optional().default([]),locations:Ve(zp).optional().default([]),defaultLocation:Z().optional(),schedule:yL,notifications:Ve(vL).optional().default([]),google:xL}).superRefine((e,t)=>{const s=hL(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),mL(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});Le({apiVersion:_u("canonry/v1"),kind:_u("Project"),metadata:gL,spec:bL});const SL=wn(["gsc","ga4"]);Le({id:Z(),domain:Z(),connectionType:SL,propertyId:Z().nullable().optional(),sitemapUrl:Z().nullable().optional(),scopes:Ve(Z()).default([]),createdAt:Z(),updatedAt:Z()});Le({date:Z(),query:Z(),page:Z(),country:Z().nullable().optional(),device:Z().nullable().optional(),clicks:Ue(),impressions:Ue(),ctr:Ue(),position:Ue()});const zm=Le({id:Z(),url:Z(),indexingState:Z().nullable().optional(),verdict:Z().nullable().optional(),coverageState:Z().nullable().optional(),pageFetchState:Z().nullable().optional(),robotsTxtState:Z().nullable().optional(),crawlTime:Z().nullable().optional(),lastCrawlResult:Z().nullable().optional(),isMobileFriendly:Pr().nullable().optional(),richResults:Ve(Z()).default([]),inspectedAt:Z()});wn(["stable","reindexed","deindexed","still-missing","new"]);const jL=Le({url:Z(),previousState:Z().nullable(),currentState:Z().nullable(),transitionDate:Z()}),wL=Le({reason:Z(),count:Ue(),urls:Ve(zm).default([])});Le({summary:Le({total:Ue(),indexed:Ue(),notIndexed:Ue(),deindexed:Ue(),percentage:Ue()}),lastInspectedAt:Z().nullable(),indexed:Ve(zm).default([]),notIndexed:Ve(zm).default([]),deindexed:Ve(jL).default([]),reasonGroups:Ve(wL).default([])});Le({url:Z(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:Z()});Le({url:Z(),type:wn(["URL_UPDATED","URL_DELETED"]),notifiedAt:Z(),status:wn(["success","error"]),error:Z().optional()});Le({date:Z(),indexed:Ue(),notIndexed:Ue(),reasonBreakdown:Fu(Z(),Ue()).default({})});Le({id:Z(),domain:Z(),siteUrl:Z().nullable().optional(),createdAt:Z(),updatedAt:Z()});const Zh=Le({id:Z(),url:Z(),httpCode:Ue().nullable().optional(),inIndex:Pr().nullable().optional(),lastCrawledDate:Z().nullable().optional(),inIndexDate:Z().nullable().optional(),inspectedAt:Z(),documentSize:Ue().nullable().optional(),anchorCount:Ue().nullable().optional(),discoveryDate:Z().nullable().optional()});Le({summary:Le({total:Ue(),indexed:Ue(),notIndexed:Ue(),unknown:Ue().optional(),percentage:Ue()}),lastInspectedAt:Z().nullable(),indexed:Ve(Zh).default([]),notIndexed:Ve(Zh).default([]),unknown:Ve(Zh).default([]).optional()});Le({query:Z(),impressions:Ue(),clicks:Ue(),ctr:Ue(),averagePosition:Ue()});Le({url:Z(),status:wn(["success","error"]),submittedAt:Z(),error:Z().optional()});const NL=wn(["queued","running","completed","partial","failed","cancelled"]),CL=wn(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),kL=wn(["manual","scheduled","config-apply"]),_L=wn(["cited","not-cited"]),zL=wn(["new","cited","lost","emerging","not-cited"]);Le({id:Z(),projectId:Z(),kind:CL,status:NL,trigger:kL.default("manual"),location:Z().nullable().optional(),startedAt:Z().nullable().optional(),finishedAt:Z().nullable().optional(),error:Z().nullable().optional(),createdAt:Z()});const EL=Le({uri:Z(),title:Z()});Le({id:Z(),runId:Z(),keywordId:Z(),keyword:Z().optional(),provider:Ir,citationState:_L,transition:zL.optional(),answerText:Z().nullable().optional(),citedDomains:Ve(Z()).default([]),competitorOverlap:Ve(Z()).default([]),groundingSources:Ve(EL).default([]),searchQueries:Ve(Z()).default([]),model:Z().nullable().optional(),location:Z().nullable().optional(),createdAt:Z()});Le({id:Z(),projectId:Z().nullable().optional(),actor:Z(),action:Z(),entityType:Z(),entityId:Z().nullable().optional(),diff:Cm().optional(),createdAt:Z()});Le({id:Z(),projectId:Z(),cronExpr:Z(),preset:Z().nullable().optional(),timezone:Z().default("UTC"),enabled:Pr().default(!0),providers:Ve(Ir).default([]),lastRunAt:Z().nullable().optional(),nextRunAt:Z().nullable().optional(),createdAt:Z(),updatedAt:Z()});Le({preset:Z().optional(),cron:Z().optional(),timezone:Z().optional().default("UTC"),enabled:Pr().optional().default(!0),providers:Ve(Ir).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});Le({id:Z(),projectId:Z(),propertyId:Z(),clientEmail:Z(),connected:Pr(),createdAt:Z(),updatedAt:Z()});Le({date:Z(),landingPage:Z(),sessions:Ue(),organicSessions:Ue(),users:Ue()});Le({totalSessions:Ue(),totalOrganicSessions:Ue(),totalUsers:Ue(),topPages:Ve(Le({landingPage:Z(),sessions:Ue(),organicSessions:Ue(),users:Ue()})),lastSyncedAt:Z().nullable()});function Em({state:e}){return o.jsx(nt,{tone:GE(e),children:Uu(e)})}function Eb(e,t){const s=t.filter(d=>d.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(d=>d.startsWith("**")&&d.endsWith("**")?{type:"bold",value:d.slice(2,-2)}:{type:"text",value:d});if(s.length===0)return a.map((d,f)=>d.type==="bold"?is.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},d.value):d.value).filter(Boolean);const r=s.map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((d,f)=>d.value.split(c).map((p,v)=>p?v%2===1?d.type==="bold"?is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},is.createElement("strong",{className:"text-zinc-200 font-semibold"},p)):is.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},p):d.type==="bold"?is.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},p):p:null)).filter(Boolean)}class bw extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function RL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const TL=RL();function AL(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.apiKey?window.__CANONRY_CONFIG__.apiKey:""}async function ye(e,t){const s=AL(),a=await fetch(`${TL}${e}`,{...t,headers:{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{},...t?.headers}});if(!a.ok){const r=await a.text();let c=`API ${a.status}: ${a.statusText}`,d;if(r)try{const f=JSON.parse(r);typeof f.error=="string"?c=f.error:f.error?.message?(c=f.error.message,d=f.error.code):f.message&&(c=f.message)}catch{c=r}throw new bw(c,a.status,d)}if(a.status!==204)return a.json()}function Sw(){return ye("/projects")}function Ep(e){return ye(`/projects/${encodeURIComponent(e)}`)}function jw(){return ye("/runs")}function Dr(e){return ye(`/runs/${encodeURIComponent(e)}`)}function ww(e){return ye(`/projects/${encodeURIComponent(e)}/keywords`)}function Rp(e){return ye(`/projects/${encodeURIComponent(e)}/competitors`)}function Tp(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return ye(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function ll(e,t){return ye(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Nw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function Cw(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function Ap(e,t){return ye(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Rm(e,t){const s=await Ep(e);return ll(e,{displayName:s.displayName,canonicalDomain:s.canonicalDomain,ownedDomains:t,country:s.country,language:s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:s.locations,defaultLocation:s.defaultLocation})}async function kw(e,t){const s=await Ep(e);return ll(e,{displayName:t.displayName??s.displayName,canonicalDomain:t.canonicalDomain??s.canonicalDomain,ownedDomains:t.ownedDomains??s.ownedDomains,country:t.country??s.country,language:t.language??s.language,tags:s.tags,labels:s.labels,providers:s.providers,locations:t.locations??s.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:s.defaultLocation})}function Op(e,t){const s={};return ye(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function _w(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function zw(e,t){await ye(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function Ew(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function Rw(e){await ye(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function Tw(e){return ye(`/projects/${encodeURIComponent(e)}/export`)}function Zu(){return ye("/settings")}function Aw(e,t){return ye(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Ow(e){return ye("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function Dw(e){try{return await ye(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Tm(e,t){return ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function Lw(e){await ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function Mw(e){return ye(`/projects/${encodeURIComponent(e)}/notifications`)}function $w(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function Uw(e,t){await ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Pw(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function Iw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function Bw(e){return ye("/apply",{method:"POST",body:JSON.stringify(e)})}function OL(e){return ye("/runs",{method:"POST",body:JSON.stringify(e??{})})}function Dp(e){return ye(`/projects/${encodeURIComponent(e)}/google/connections`)}function qw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function Hw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function Gw(e){return ye(`/projects/${encodeURIComponent(e)}/google/properties`)}function Kw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function Fw(e,t,s){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function Lp(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function Zw(e,t){const s=new URLSearchParams;t?.startDate&&s.set("startDate",t.startDate),t?.endDate&&s.set("endDate",t.endDate),t?.query&&s.set("query",t.query),t?.page&&s.set("page",t.page),t?.limit!==void 0&&s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function Vw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function Qw(e,t){const s=new URLSearchParams;t?.url&&s.set("url",t.url),s.set("limit",String(t.limit));const a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function Yw(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function Vu(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function Jw(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function Xw(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function Ww(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function eN(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Am(){return ye("/cdp/status")}function tN(e,t){return ye("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Om(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function Mp(e){return ye(`/projects/${encodeURIComponent(e)}/bing/status`)}function nN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function sN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function iN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/sites`)}function aN(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function Qu(e){return ye(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function $p(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function Up(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Dm(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function rN(e){return ye(`/projects/${encodeURIComponent(e)}/bing/performance`)}function oN(e){return ye("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function lN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function cN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function uN(e,t){const s=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}function Lm(e){return ye(`/projects/${encodeURIComponent(e)}/ga/status`)}function Mm(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function dN(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function fN(e){return ye(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function hN(e,t){try{const s=await fetch(e);if(!s.ok)return{label:t,state:"error",detail:`HTTP ${s.status}`};const a=await s.json(),r=typeof a.version=="string"?a.version:"unknown",c=typeof a.databaseUrlConfigured=="boolean"?a.databaseUrlConfigured:void 0,d=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",d?`heartbeat ${d}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:d}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const DL=Object.freeze(Object.defineProperty({__proto__:null,ApiError:bw,addLocation:_w,addNotification:$w,appendKeywords:Cw,applyProjectConfig:Bw,bingConnect:nN,bingDisconnect:sN,bingRequestIndexing:Dm,bingSetSite:aN,configureCdp:tN,createProject:ll,deleteProject:Rw,disconnectGa:fN,fetchAllRuns:jw,fetchAnalyticsGaps:cN,fetchAnalyticsMetrics:lN,fetchAnalyticsSources:uN,fetchBingCoverage:Qu,fetchBingInspections:$p,fetchBingPerformance:rN,fetchBingSites:iN,fetchBingStatus:Mp,fetchCdpStatus:Am,fetchCompetitors:Rp,fetchExport:Tw,fetchGaStatus:Lm,fetchGaTraffic:Mm,fetchGoogleConnections:Dp,fetchGoogleProperties:Gw,fetchGscCoverage:Vu,fetchGscCoverageHistory:Jw,fetchGscDeindexed:Yw,fetchGscInspections:Qw,fetchGscPerformance:Zw,fetchGscSitemaps:Ww,fetchKeywords:ww,fetchProject:Ep,fetchProjects:Sw,fetchRunDetail:Dr,fetchSchedule:Dw,fetchServiceStatus:hN,fetchSettings:Zu,fetchTimeline:Tp,generateKeywords:Iw,googleConnect:qw,googleDisconnect:Hw,inspectBingUrl:Up,inspectGscUrl:Vw,listNotifications:Mw,removeLocation:zw,removeNotification:Uw,removeSchedule:Lw,requestIndexing:Om,saveGoogleProperty:Kw,saveSchedule:Tm,saveSitemapUrl:Fw,sendTestNotification:Pw,setCompetitors:Ap,setDefaultLocation:Ew,setKeywords:Nw,triggerAllRuns:OL,triggerDiscoverSitemaps:eN,triggerGaSync:dN,triggerGscSync:Lp,triggerInspectSitemap:Xw,triggerRun:Op,updateBingApiKey:oN,updateGoogleAuthConfig:Ow,updateOwnedDomains:Rm,updateProject:kw,updateProviderConfig:Aw},Symbol.toStringTag,{value:"Module"}));function LL({evidence:e,project:t,onClose:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(-1),[f,m]=N.useState(null),[p,v]=N.useState(!1),[y,x]=N.useState({}),b=pL(t.project),w=new Set(b.map(_m)),S=e.runHistory,C=S.length>1,k=c>=0&&f!==null,E=k?f:{citationState:e.citationState,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.changeLabel,summary:e.summary},R=E.citationState==="cited"||E.citationState==="emerging",L=E.citedDomains.findIndex(G=>w.has(G.toLowerCase().replace(/^www\./,"")))+1,M=E.citedDomains.length,T=t.project.displayName||t.project.name,A=[...b.map(_m),T,T.split(" ").slice(0,2).join(" ")].filter(G=>G.trim().length>2),P=R?"cited":E.citationState==="lost"?"lost":E.citationState==="pending"?"pending":"not-cited",J=N.useRef(0),Q=N.useCallback(async G=>{const oe=++J.current;if(G===-1||G===S.length-1){d(-1),m(null),r(!1);return}d(G),r(!1);const q=S[G],X=`${q.runId}::${e.keyword}::${e.provider}`;if(y[X]){m(y[X]);return}v(!0);try{const O=await Dr(q.runId);if(oe!==J.current)return;const F=O.snapshots.find(re=>re.keyword===e.keyword&&re.provider===e.provider)??O.snapshots.find(re=>re.keyword===e.keyword),ie=F?{citationState:F.citationState,provider:F.provider,model:F.model??null,answerSnippet:F.answerText??"",citedDomains:F.citedDomains,competitorDomains:F.competitorOverlap,groundingSources:F.groundingSources,evidenceUrls:[],changeLabel:q.citationState,summary:""}:{citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Snapshot data not available for this run."};x(re=>({...re,[X]:ie})),m(ie)}catch{if(oe!==J.current)return;m({citationState:q.citationState,provider:e.provider,model:q.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:q.citationState,summary:"Failed to load historical run data."})}finally{oe===J.current&&v(!1)}},[S,e.keyword,e.provider,y]),pe=(k||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,ke=!k&&e.historyScope==="provider"?[e.model?`Current model: ${e.model}`:null,e.modelsSeen&&e.modelsSeen.length>1?`History spans ${e.modelsSeen.length} models`:null].filter(Boolean).join(" · "):"",je=R&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${M} domain${M!==1?"s":""}`,meta:pe}:R?{label:"Citation confirmed",title:"Cited in this answer",meta:pe}:E.citationState==="lost"?{label:"Citation lost",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:pe}:E.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:M>0?`${M} domain${M!==1?"s":""} cited instead`:"No domains cited for this query",meta:pe},B=()=>{if(!E.answerSnippet)return null;const G=E.answerSnippet.split(`
|
|
95
|
+
`),oe=[];let q=[],X=0;const O=()=>{if(q.length===0)return;const F=q.join(" ").trim();F&&oe.push(o.jsx("p",{className:oe.length>0?"mt-2.5":"",children:Eb(F,A)},X++)),q=[]};for(const F of G){const ie=F.trim();if(/^[-\u2013\u2014]{3,}$/.test(ie)){O(),oe.push(o.jsx("hr",{className:"border-zinc-800/60 my-3"},X++));continue}const re=ie.match(/^(#{1,3})\s+(.+)$/);if(re){O();const ue=re[1].length,he=re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||re[2],de=ue===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ue===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(o.jsx("p",{className:de,children:Eb(he,A)},X++));continue}if(ie===""){O();continue}q.push(ie)}return O(),oe};return o.jsx(Dj,{open:!0,onOpenChange:G=>{G||s()},children:o.jsxs(Lj,{children:[o.jsx(vp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),o.jsxs(xp,{className:"evidence-modal","aria-describedby":void 0,children:[o.jsxs("div",{className:"evidence-modal-header",children:[o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," \\u00b7 ",E.provider||"All providers"]}),o.jsx(bp,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),o.jsxs($j,{className:"inline-flex size-8 items-center justify-center rounded-md text-zinc-500 transition hover:bg-zinc-800 hover:text-zinc-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400 shrink-0",children:[o.jsx($u,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]}),C&&o.jsxs("div",{className:"evidence-modal-timeline",children:[o.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),o.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:S.map((G,oe)=>{const q=c===-1&&oe===S.length-1||c===oe,X=G.citationState==="cited"?"bg-emerald-400":G.citationState==="emerging"?"bg-amber-400":G.citationState==="lost"?"bg-rose-400":"bg-zinc-600",F=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ie=!!(G.model&&oe>0&&S[oe-1]?.model&&S[oe-1].model!==G.model);return o.jsxs("button",{type:"button",className:`evidence-run-dot ${q?"evidence-run-dot--selected":""}`,onClick:()=>Q(oe===S.length-1?-1:oe),"aria-label":[`Run ${F}: ${G.citationState}`,G.model?`model ${G.model}`:null,ie?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":q,children:[o.jsx("span",{className:`size-2 rounded-full ${X} ${ie?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),o.jsx("span",{className:"text-[10px] text-zinc-500",children:F})]},oe)})}),c>=0&&c<S.length&&o.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(S[c].createdAt).toLocaleString()," \\u2014 ",o.jsx("span",{className:"capitalize",children:S[c].citationState}),o.jsx("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>Q(-1),children:"\\u2190 Back to latest"})]}),!k&&(e.modelTransitions?.length??0)>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(G=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${G.fromModel??"unknown"} -> ${G.toModel??"unknown"} on ${new Date(G.createdAt).toLocaleDateString()}`},`${G.runId}:${G.toModel??"unknown"}`))})]}),o.jsxs("div",{className:"evidence-modal-body",children:[p&&o.jsx("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:"Loading historical run data\\u2026"}),!p&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"evidence-modal-main",children:[o.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${P}`,children:[o.jsx("p",{className:`evidence-position-label evidence-position-label--${P}`,children:je.label}),o.jsx("p",{className:`evidence-position-title evidence-position-title--${P}`,children:je.title}),o.jsx("p",{className:"evidence-position-meta",children:je.meta}),ke&&o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ke})]}),E.answerSnippet&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),o.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:B()}),E.answerSnippet.length>280&&o.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>r(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!p&&o.jsx("div",{className:"rounded-lg border border-zinc-800/40 bg-zinc-900/20 px-4 py-8 text-center text-zinc-600 text-sm",children:"No answer text recorded for this run"}),!k&&e.relatedTechnicalSignals.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:R?"Why you're cited":"What to fix"}),o.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,oe)=>o.jsxs("div",{className:"action-item",children:[o.jsx("svg",{className:`action-item-icon ${R?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:R?o.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):o.jsxs(o.Fragment,{children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),o.jsx("span",{className:"action-item-text",children:G})]},oe))})]}),E.summary&&o.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),o.jsxs("div",{className:"evidence-modal-sidebar",children:[E.citedDomains.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Who was cited \\u2014 in order"}),o.jsxs("div",{className:"citation-leaderboard",children:[E.citedDomains.map((G,oe)=>{const q=G.toLowerCase().replace(/^www\./,""),X=w.has(q),O=!X&&E.competitorDomains.some(ie=>ie.toLowerCase().replace(/^www\./,"")===q),F=X?"you":O?"competitor":"other";return o.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${F}`,children:[o.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),o.jsx("span",{className:"citation-leaderboard-domain",children:G}),X&&o.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),O&&o.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)}),!R&&o.jsxs("div",{className:"citation-leaderboard-item citation-leaderboard-item--not-cited border-dashed",children:[o.jsx("span",{className:"citation-leaderboard-rank text-zinc-600",children:"\\u2014"}),o.jsx("span",{className:"citation-leaderboard-domain text-zinc-600",children:t.project.canonicalDomain}),o.jsx("span",{className:"citation-leaderboard-tag text-zinc-600",children:"Not cited"})]})]})]}),E.groundingSources.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",E.groundingSources.length,")"]}),o.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((G,oe)=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},oe))})]}),E.evidenceUrls.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),o.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(G=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:G,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&o.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",k?"for this run":"yet"]})]})]})]})]})]})})}function ss(e){const t=new Date("2026-02-20");return e.map((s,a)=>({runId:`run_mock_${a+1}`,citationState:s,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const Vh=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_harbor",name:"Harbor Legal Group",canonicalDomain:"harborlegal.com",ownedDomains:[],country:"US",language:"en",tags:["lead gen"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1},{id:"project_northstar",name:"Northstar Orthopedics",canonicalDomain:"northstarortho.com",ownedDomains:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,configSource:"cli",configRevision:1}];function Yu(e){return{id:e.id,projectId:e.projectId,projectName:e.projectName,kind:e.kind,kindLabel:e.kindLabel,status:e.status,trigger:e.trigger??"manual",createdAt:e.createdAt,startedAt:e.startedAt,duration:e.duration,statusDetail:e.statusDetail,summary:e.summary,triggerLabel:e.triggerLabel}}const ML=Yu({id:"run_citypoint_visibility_20260308",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T12:15:00.000Z",startedAt:"Mar 8, 12:15 PM",duration:"6m 12s",statusDetail:"18 tracked queries checked; 3 citation losses detected on emergency-intent prompts.",summary:"Citation losses on emergency-intent prompts",triggerLabel:"Scheduled"}),$L=Yu({id:"run_citypoint_queued_20260309",projectId:"project_citypoint",projectName:"Citypoint Dental NYC",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"queued",createdAt:"2026-03-09T08:05:00.000Z",startedAt:"Mar 9, 8:05 AM",duration:"Waiting for slot",statusDetail:"Ready to enqueue after the next provider rate window clears.",summary:"Queued follow-up after local ranking movement",triggerLabel:"Manual"}),UL=Yu({id:"run_harbor_visibility_20260308",projectId:"project_harbor",projectName:"Harbor Legal Group",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"completed",createdAt:"2026-03-08T11:05:00.000Z",startedAt:"Mar 8, 11:05 AM",duration:"5m 07s",statusDetail:"12 tracked queries checked; local-intent visibility held steady across branded prompts.",summary:"Branded prompts remain stable",triggerLabel:"Scheduled"}),PL=Yu({id:"run_northstar_visibility_20260308",projectId:"project_northstar",projectName:"Northstar Orthopedics",kind:"answer-visibility",kindLabel:"Answer visibility sweep",status:"running",createdAt:"2026-03-08T13:40:00.000Z",startedAt:"Mar 8, 1:40 PM",duration:"3m 10s",statusDetail:"Provider responses still in flight for 9 multi-location prompts.",summary:"Mid-run on treatment-location prompts",triggerLabel:"Manual"}),IL=[{id:"evidence_citypoint_emergency_gemini",keyword:"emergency dentist brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"lost",changeLabel:"Lost since Mar 5",answerSnippet:"For urgent dental care in Brooklyn, Downtown Smiles and Harbor Dental are now cited first for emergency availability and same-day booking.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:["https://downtownsmiles.com/emergency-dentist-brooklyn","https://harbordental.com/same-day-emergency-care"],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing on the emergency service page","llms.txt not found during latest site audit","Location pages link weakly into the emergency care hub"],summary:"AI answers now cite two competitors while your emergency page is no longer grounded.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",keyword:"emergency dentist brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"Cited for 6 runs",answerSnippet:"Citypoint Dental is listed as a top emergency dentist in Brooklyn for same-day appointments and walk-in availability.",citedDomains:["citypointdental.com","downtownsmiles.com"],evidenceUrls:["https://citypointdental.com/emergency-dentist-brooklyn"],competitorDomains:["downtownsmiles.com"],groundingSources:[],relatedTechnicalSignals:["Emergency page indexed with structured data"],summary:"OpenAI cites your emergency page consistently alongside one competitor.",runHistory:ss(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",keyword:"emergency dentist brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"Based on the search results, top-rated emergency dental practices in Brooklyn include Downtown Smiles and Harbor Dental.",citedDomains:["downtownsmiles.com","harbordental.com"],evidenceUrls:[],competitorDomains:["downtownsmiles.com","harbordental.com"],groundingSources:[],relatedTechnicalSignals:["FAQ schema missing","llms.txt not found"],summary:"Claude does not cite your domain for this emergency query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_invisalign_openai",keyword:"best invisalign dentist downtown brooklyn",provider:"openai",model:"gpt-5.4",location:null,citationState:"emerging",changeLabel:"First citation in 7 days",answerSnippet:"Citypoint Dental appears as an emerging recommendation for Invisalign in Downtown Brooklyn, supported by recent before-and-after case pages.",citedDomains:["citypointdental.com","clearlineortho.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn","https://citypointdental.com/case-studies/invisalign-open-bite"],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["Structured data now present on two case-study pages","Internal links from service pages to case studies improved crawl depth"],summary:"Fresh case-study content is starting to earn citations on Invisalign prompts.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",keyword:"best invisalign dentist downtown brooklyn",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"cited",changeLabel:"Cited for 8 runs",answerSnippet:"Citypoint Dental in Downtown Brooklyn is highlighted for its Invisalign expertise and patient outcomes.",citedDomains:["citypointdental.com"],evidenceUrls:["https://citypointdental.com/invisalign-downtown-brooklyn"],competitorDomains:[],groundingSources:[],relatedTechnicalSignals:["Case study pages well-indexed"],summary:"Gemini consistently cites your Invisalign page with no competitor overlap.",runHistory:ss(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",keyword:"best invisalign dentist downtown brooklyn",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For Invisalign in Downtown Brooklyn, Clear Line Ortho and Brooklyn Smiles are frequently recommended for their experienced orthodontists.",citedDomains:["clearlineortho.com","brooklynsmiles.com"],evidenceUrls:[],competitorDomains:["clearlineortho.com"],groundingSources:[],relatedTechnicalSignals:["No before/after schema on case study pages"],summary:"Claude does not surface your Invisalign content despite strong page quality.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_claude",keyword:"pediatric dentist brooklyn heights",provider:"claude",model:"claude-sonnet-4-6",location:null,citationState:"not-cited",changeLabel:"No citation across 4 runs",answerSnippet:"Answers cite neighborhood-specific pediatric practices with stronger family-focused FAQ content and clearer insurance details.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:["https://brightkidsdental.com/pediatric-dentist-brooklyn-heights","https://parkpediatricdental.com/insurance"],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric service page exists for Brooklyn Heights","Insurance content is buried three clicks deep"],summary:"Coverage gap is content-driven, not purely technical.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",keyword:"pediatric dentist brooklyn heights",provider:"gemini",model:"gemini-3-flash",location:null,citationState:"not-cited",changeLabel:"No citation across 12 runs",answerSnippet:"For pediatric dentistry in Brooklyn Heights, Bright Kids Dental and Park Pediatric Dental are cited for family-friendly care.",citedDomains:["brightkidsdental.com","parkpediatricdental.com"],evidenceUrls:[],competitorDomains:["brightkidsdental.com","parkpediatricdental.com"],groundingSources:[],relatedTechnicalSignals:["No dedicated pediatric page for Brooklyn Heights"],summary:"Gemini does not surface your domain for pediatric queries in this area.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_openai",keyword:"pediatric dentist brooklyn heights",provider:"openai",model:"gpt-5.4",location:null,citationState:"cited",changeLabel:"First citation this month",answerSnippet:"Citypoint Dental is mentioned as offering pediatric services in Brooklyn, though specialized pediatric-only practices are also highlighted.",citedDomains:["citypointdental.com","brightkidsdental.com"],evidenceUrls:["https://citypointdental.com/family-dentistry"],competitorDomains:["brightkidsdental.com"],groundingSources:[],relatedTechnicalSignals:["Family dentistry page recently updated"],summary:"OpenAI recently started citing your family dentistry page for this query.",runHistory:ss(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Vh[0],Vh[1],ss(["cited","cited","cited","cited","cited"]),Vh[2],2/7,ss(["not-cited","not-cited","not-cited","cited"]);function BL(e,t){return e.projects.find(s=>s.project.id===t)}function qL(e,t){return e.runs.find(s=>s.id===t)}function HL(e,t){for(const s of e.projects){const a=s.visibilityEvidence.find(r=>r.id===t);if(a)return{project:s,evidence:a}}}function mN(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],country:e.country,language:e.language,tags:e.tags,labels:e.labels,locations:e.locations??[],defaultLocation:e.defaultLocation??null,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function Rb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function GL(e,t){if(!e)return"Waiting";if(!t)return"Running";const s=new Date(t).getTime()-new Date(e).getTime();if(s<1e3)return"<1s";const a=Math.floor(s/1e3);if(a<60)return`${a}s`;const r=Math.floor(a/60),c=a%60;return`${r}m ${c}s`}function pN(e){return e==="answer-visibility"?"Answer visibility sweep":e}function KL(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Pp(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:pN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Rb(e.startedAt):Rb(e.createdAt),duration:GL(e.startedAt,e.finishedAt),statusDetail:e.error?gN(e.error):FL(e),summary:ZL(e),triggerLabel:KL(e.trigger)}}function gN(e){try{const s=JSON.parse(e);if(typeof s=="object"&&s!==null){const a=s.message??s.error?.message??s[0]?.error?.message;if(typeof a=="string"&&a.length>0)return a.length>200?a.slice(0,200)+"…":a}}catch{}const t=e.match(/\[.*?\]\s*(.+)/);if(t){const s=t[1];return s.length>200?s.slice(0,200)+"…":s}return e.length>200?e.slice(0,200)+"…":e}function FL(e){switch(e.status){case"queued":return"Waiting for execution slot.";case"running":return"Provider queries in progress.";case"completed":return"All key phrases checked.";case"partial":return"Run completed with some key phrases skipped.";case"failed":return e.error?gN(e.error):"Run failed.";default:return""}}function ZL(e){switch(e.status){case"queued":return"Queued for execution";case"running":return"In progress";case"completed":return"Visibility sweep completed";case"partial":return"Partial completion";case"failed":return"Run failed";default:return e.status}}function yN(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const c of e){const d=c.keyword??c.id;t.has(d)||t.set(d,!1),c.citationState==="cited"&&t.set(d,!0)}const s=t.size,a=[...t.values()].filter(Boolean).length;return{score:s>0?Math.round(a/s*100):0,citedCount:a,totalCount:s}}function VL(e){return e>=70?"positive":e>=40?"caution":"negative"}function QL(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function YL(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function JL(e){if(e.length===0)return{label:"Gap Key Phrases",value:"No data",delta:"Run a sweep first",tone:"neutral",description:"Run a visibility sweep to identify key phrases where competitors are cited and your domain is not.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[]};const t=new Map;for(const c of e){const d=c.keywordId,f=t.get(d)??{cited:!1,competitorOverlap:new Set};c.citationState==="cited"&&(f.cited=!0);for(const m of c.competitorOverlap)f.competitorOverlap.add(m);t.set(d,f)}const s=t.size,a=[...t.values()].filter(c=>!c.cited&&c.competitorOverlap.size>0).length,r=a===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${a}`,delta:`${a} of ${s} key phrases at risk`,tone:YL(a,s),description:a>0?`${a} tracked ${r} currently cite competitors without citing your domain.`:"No competitive key phrase gaps detected in the latest visibility run.",tooltip:"Tracked key phrases where a competitor is cited in the latest run but your domain is not.",trend:[],progress:s>0?a/s:0}}function XL(e,t){return e&&e.summary.total>0?{provider:"Google",...e.summary}:t&&t.summary.total>0?{provider:"Bing",...t.summary,deindexed:0}:e?{provider:"Google",...e.summary}:t?{provider:"Bing",...t.summary,deindexed:0}:null}function WL(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function eM(e,t){const s=XL(e,t);if(!s||s.total===0)return{label:"Index Coverage",value:"No data",delta:"Connect GSC or Bing",tone:"neutral",description:"Connect Google Search Console or Bing Webmaster Tools and inspect your sitemap to populate coverage.",tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]};const a=s.notIndexed===1?"URL is":"URLs are",r=s.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(s.percentage)}`,delta:`${s.provider} · ${s.indexed} of ${s.total} indexed`,tone:WL(s),description:s.provider==="Google"&&s.deindexed>0?`${s.deindexed} deindexed ${r} detected in the latest Google Search Console inspection.`:`${s.notIndexed} ${a} not indexed in ${s.provider==="Google"?"Google Search Console":"Bing Webmaster Tools"}.`,tooltip:"Percentage of inspected URLs currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used.",trend:[]}}function vN(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const s=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(d=>s.has(d))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function tM(e,t,s,a){const r=[];let c=0;const d=new Set;if(s){const f=new Map;for(const p of s.snapshots)if(p.keyword){const v=`${p.keyword}::${p.provider}`;f.set(v,p)}const m=[...new Set(s.snapshots.map(p=>p.provider))].sort();m.length===0&&m.push("gemini");for(const p of t){if(p.runs.length===0)continue;d.add(p.keyword);const y=p.runs.at(-1)?.transition??"not-cited",x=y==="lost"?"lost":y==="emerging"?"emerging":y==="cited"?"cited":"not-cited";for(const b of m){const w=f.get(`${p.keyword}::${b}`);if(!w&&m.length>1)continue;const S=w?.model??null,C=S?`${b}:${S}`:null,k=C?p.modelRuns?.[C]:void 0,E=p.providerRuns?.[b],R=(E?.length?E:null)??(k?.length?k:null),_=E?.length?"provider":k?.length?"model":"keyword",L=R?R.at(-1).transition:y,M=L==="lost"?"lost":L==="emerging"?"emerging":w?w.citationState==="cited"?"cited":"not-cited":x,T=$m(R||p.runs),A=nM(p,b),P=(R??p.runs).map(pe=>({runId:pe.runId,citationState:pe.citationState,createdAt:pe.createdAt,model:A.get(pe.runId)??null})),J=sM(P),Q=_==="provider"&&J.length<=1?"model":_,se=iM(P);r.push({id:`evidence_${e}_${c++}`,keyword:p.keyword,provider:w?.provider??b,model:w?.model??null,location:w?.location??null,citationState:M,changeLabel:aM(L,T),answerSnippet:w?.answerText??"",citedDomains:w?.citedDomains??[],evidenceUrls:[],competitorDomains:w?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:w?.groundingSources??[],summary:rM(M,p.keyword),runHistory:P,historyScope:Q,modelsSeen:J,modelTransitions:se})}}}for(const f of a)d.has(f.keyword)||r.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return r}function nM(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const d=r.slice(a.length),f=d==="unknown"?null:d;for(const m of c)s.set(m.runId,f)}return s}function sM(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function iM(e){const t=[];let s=null;for(const a of e){const r=a.model??null;r!==s&&s!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:s,toModel:r}),s=r}return t}function $m(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let s=0;for(let a=e.length-1;a>=0&&e[a].citationState===t;a--)s++;return s}function aM(e,t){switch(e){case"new":return"First observation";case"cited":return t<=1?"Cited in latest run":`Cited for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return"First citation";case"not-cited":return t<=1?"Not cited in latest run":`Not cited across ${t} runs`;default:return e}}function rM(e,t){switch(e){case"cited":return`Your domain is cited in AI answers for "${t}".`;case"lost":return`Citation was lost for "${t}". Competitors may have gained ground.`;case"emerging":return`Your domain is starting to appear in answers for "${t}".`;case"not-cited":return`No citation detected for "${t}".`;case"pending":return`"${t}" has been added but no visibility run has been triggered yet.`}}function Tb(e,t){const s=new Set(t),a=new Map;for(const r of e)if(r.keyword)for(const c of r.competitorOverlap){if(!s.has(c))continue;const d=a.get(c)??new Set;d.add(r.keyword),a.set(c,d)}return a}const Qh=3;function oM(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,d=[],f=[],m=new Set;for(const k of t)k.citationState==="lost"&&(m.has(k.keyword)||(m.add(k.keyword),f.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"lost"})));f.length>0&&d.push({id:"insight_lost",tone:"negative",title:`Lost citation on ${f.length} key phrase${f.length>1?"s":""}`,detail:"Citations dropped since the last run.",actionLabel:"Lost",affectedPhrases:f});const p=Tb(a,c),v=Tb(r,c);for(const k of c){const E=p.get(k)??new Set,R=v.get(k)??new Set,_=[...E].filter(L=>!R.has(L));_.length>0&&d.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:_.map(L=>{const M=t.find(T=>T.keyword===L);return{keyword:L,evidenceId:M?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of s){const E=k.runs.at(-1);E&&y.set(k.keyword,{transition:E.transition,citationState:E.citationState})}const x=[],b=[],w=new Set;for(const[k,{transition:E,citationState:R}]of y){if(!(E==="emerging"||E==="new"&&R==="cited"))continue;w.add(k);const L=t.find(M=>M.keyword===k&&(M.citationState==="emerging"||M.citationState==="cited"));x.push({keyword:k,evidenceId:L?.id??"",provider:L?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(w.has(k.keyword)||b.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(b.length>0){const k=new Set(b.map(E=>E.keyword)).size;d.push({id:"insight_provider_pickup",tone:"positive",title:`Picked up by new provider on ${k} key phrase${k>1?"s":""}`,detail:"Your domain started appearing on additional providers.",actionLabel:"Pickup",affectedPhrases:b})}x.length>0&&d.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${w.size} key phrase${w.size>1?"s":""}`,detail:"Your domain appeared in AI answers for the first time.",actionLabel:"New",affectedPhrases:x});const S=new Set(t.map(k=>k.keyword)),C=[];for(const k of s){if(!S.has(k.keyword)||k.runs.length<Qh||k.runs.at(-1)?.citationState!=="not-cited")continue;if($m(k.runs)>=Qh){const _=t.find(L=>L.keyword===k.keyword);C.push({keyword:k.keyword,evidenceId:_?.id??"",citationState:"not-cited"})}}C.length>0&&d.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} key phrase${C.length>1?"s":""} uncited for ${Qh}+ runs`,detail:"These key phrases have not been cited by any provider across multiple consecutive runs.",actionLabel:"Gap",affectedPhrases:C});for(const k of c){const E=p.get(k)??new Set,_=[...v.get(k)??new Set].filter(L=>!E.has(L));_.length>0&&d.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${_.length} key phrase${_.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:_.map(L=>{const M=t.find(T=>T.keyword===L);return{keyword:L,evidenceId:M?.id??"",citationState:"not-cited"}})})}return d.length===0&&d.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),d}function lM(e,t){if(t.length===0){const m=new Set(e.filter(p=>p.citationState==="cited").map(p=>p.keyword)).size;return{gained:m,lost:0,tone:m>0?"positive":"neutral",hasPreviousRun:!1}}const s=m=>{const p=new Set;for(const v of m)v.citationState==="cited"&&v.keyword&&p.add(v.keyword);return p},a=s(e),r=s(t);let c=0,d=0;for(const m of a)r.has(m)||c++;for(const m of r)a.has(m)||d++;const f=d>c?"negative":c>d?"positive":"neutral";return{gained:c,lost:d,tone:f,hasPreviousRun:!0}}function cM(e){const t=e[0];if(!t)return{label:"Run Status",value:"None",delta:"No runs yet",tone:"neutral",description:"Trigger a visibility sweep to start tracking.",tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]};const s=t.status==="completed"?"Healthy":t.status==="running"?"Running":t.status==="queued"?"Queued":t.status==="partial"?"Partial":"Failed",a=t.status==="completed"?"positive":t.status==="failed"?"negative":t.status==="partial"?"caution":"neutral";return{label:"Run Status",value:s,delta:`${e.length} total runs`,tone:a,description:`Latest: ${pN(t.kind)} — ${t.status}`,tooltip:"Current execution state of visibility sweeps. Shows the status of the most recent run and total run count.",trend:[]}}function uM(e){const t=mN(e.project),s=tM(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=yN(a),c=JL(a),d=eM(e.gscCoverage,e.bingCoverage),f=vN(a,e.competitors.map(b=>b.domain)),m=oM({evidence:s,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(b=>b.domain)}),p=[...e.runs].sort((b,w)=>w.createdAt.localeCompare(b.createdAt)),v=p.map(b=>Pp(b,e.project.displayName||e.project.name)),y=new Map;for(const b of a){const w=b.provider||"gemini",S=b.model??null,C=`${w}::${S??"unknown"}`,k=y.get(C)??{provider:w,model:S,cited:0,total:0};k.total++,b.citationState==="cited"&&k.cited++,y.set(C,k)}const x=[...y.values()].sort((b,w)=>b.provider.localeCompare(w.provider)||(b.model??"").localeCompare(w.model??"")).map(({provider:b,model:w,cited:S,total:C})=>({provider:b,model:w,score:C>0?Math.round(S/C*100):0,cited:S,total:C}));return{project:t,dateRangeLabel:"All time",contextLabel:`${t.country} / ${t.language.toUpperCase()}`,visibilitySummary:{label:"Answer Visibility",value:a.length>0?`${r.score}`:"No data",delta:a.length>0?`${r.citedCount} of ${r.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?VL(r.score):"neutral",description:a.length>0?`${r.citedCount} of ${r.totalCount} tracked key phrases found your domain in at least one AI answer engine.`:"No visibility data yet. Trigger a run to start tracking.",tooltip:'Percentage of tracked key phrases where your domain is cited by at least one AI answer engine. A key phrase is "visible" if any configured provider includes your site in its response.',trend:[]},keywordCounts:{cited:r.citedCount,total:r.totalCount},gapKeyPhrases:c,indexCoverage:d,providerScores:x,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:QL(f.label),description:e.competitors.length>0?`${e.competitors.length} competitor${e.competitors.length>1?"s":""} tracked.`:"No competitors configured.",tooltip:"How often competitor domains appear alongside yours in AI answers. High pressure means competitors are frequently cited for the same key phrases.",trend:[]},runStatus:cM(p),movementSummary:lM(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:s,competitors:e.competitors.map((b,w)=>{const S=new Set;for(const _ of a)(_.competitorOverlap.includes(b.domain)||_.citedDomains.includes(b.domain))&&_.keyword&&S.add(_.keyword);const C=[...S],k=new Set(a.map(_=>_.keyword).filter(Boolean)),E=k.size>0?C.length/k.size:0,R=E>=.5?"High":E>=.2?"Moderate":C.length>0?"Low":"None";return{id:b.id||`comp_${w}`,domain:b.domain,citationCount:C.length,totalKeywords:k.size,pressureLabel:R,citedKeywords:C,movement:"",notes:""}}),recentRuns:v.slice(0,5)}}function dM(e){const t=mN(e.project),s=e.latestRunDetail?.snapshots??[],a=yN(s),r=vN(s,e.competitors.map(m=>m.domain)),d=[...e.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt))[0],f=d?Pp(d,e.project.displayName||e.project.name):{id:"none",projectId:e.project.id,projectName:e.project.displayName||e.project.name,kind:"answer-visibility",kindLabel:"No runs yet",status:"queued",trigger:"manual",createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""};return{project:t,visibilityScore:a.score,visibilityDelta:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:s.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(s.map(m=>m.provider)).size} provider${new Set(s.map(m=>m.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:r.label}}function fM(e,t){const s=[],a=[],r=[];for(const d of e){a.push(uM(d)),r.push(dM(d));const f=[...d.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt));for(const m of f)s.push(Pp(m,d.project.displayName||d.project.name))}s.sort((d,f)=>f.createdAt.localeCompare(d.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?hM(a):[{id:"attention_setup",tone:"neutral",title:"No projects yet",detail:"Create your first project using the setup wizard, CLI, or API.",actionLabel:"Open setup",href:"/setup"}],recentRuns:s.slice(0,5),systemHealth:[{id:"api",label:"API",tone:"positive",detail:"Connected",meta:"Real-time data"},{id:"provider",label:"Gemini",tone:"positive",detail:"Configured",meta:"Provider active"}],lastUpdatedAt:new Date().toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),...c?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small key phrase set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:a,runs:s,setup:{healthChecks:[{id:"api",label:"API reachable",detail:"API is responding.",state:"ready",guidance:"Required for project creation and run history."},{id:"provider",label:"Provider configured",detail:"Gemini key is configured.",state:"ready",guidance:"Required for answer-visibility sweeps."}],projectDraft:{name:"",canonicalDomain:"",country:"US",language:"en"},keywordImportState:{mode:"paste",keywordCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:c,ctaLabel:c?"Trigger run":"Create a project first",summary:c?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(d=>({name:d.name,displayName:d.displayName,keyUrl:d.keyUrl,modelHint:d.modelHint,model:d.model,state:d.configured?"ready":"needs-config",detail:d.configured?"Provider is configured.":"API key is missing.",quota:d.quota})),google:{state:t?.google?.configured?"ready":"needs-config",detail:t?.google?.configured?"Google OAuth app credentials are configured. Project-level GSC connections can be created from the dashboard.":"Google OAuth client ID and client secret are not configured yet."},bing:{state:t?.bing?.configured?"ready":"needs-config",detail:t?.bing?.configured?"Bing Webmaster Tools API key is configured. Project-level Bing connections can be created from the dashboard.":"Bing Webmaster Tools API key is not configured yet."},selfHostNotes:["Configuration is stored in ~/.canonry/config.yaml.","The local config file is the source of truth for authentication credentials.","Google OAuth app credentials and per-domain Google tokens are stored in local config, not the database.","Database is SQLite at ~/.canonry/data.db.","API key was auto-generated during canonry init."],bootstrapNote:"Use the UI, CLI, or ~/.canonry/config.yaml to manage settings. Authentication credentials persist to local config."}}}function hM(e){const t=[];for(const s of e){const a=s.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${s.project.id}_lost`,tone:"negative",title:`${s.project.displayName||s.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${s.project.id}`});const r=s.recentRuns.filter(c=>c.status==="running"||c.status==="queued");r.length>0&&t.push({id:`attention_${s.project.id}_active`,tone:"neutral",title:`${s.project.displayName||s.project.name} has active runs`,detail:`${r.length} run${r.length>1?"s":""} in progress.`,actionLabel:"View runs",href:"/runs"})}return t.length===0&&t.push({id:"attention_stable",tone:"positive",title:"All projects stable",detail:"No citation losses or active runs to flag.",actionLabel:"View portfolio",href:"/"}),t}const Ai={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],keywords:e=>["projects",e,"keywords"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"]},xN=N.createContext(null);xN.Provider;function cl(){return N.useContext(xN)}function Ra(e){const s=cl()?.dashboard??null,a=Ko({queryKey:Ai.projects.all,queryFn:Sw,enabled:!s}),r=Ko({queryKey:Ai.runs.all,queryFn:jw,enabled:!s,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=Ko({queryKey:Ai.settings,queryFn:()=>Zu().catch(()=>null),enabled:!s}),d=a.data??[],f=r.data??[],m=Wk({queries:d.map(w=>{const S=f.filter(k=>k.projectId===w.id),C=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:Ai.projects.detail(w.id,C[0]?.id),queryFn:async()=>{const[k,E,R,_,L,M,T]=await Promise.all([ww(w.name).catch(()=>[]),Rp(w.name).catch(()=>[]),Tp(w.name).catch(()=>[]),C[0]?Dr(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Dr(C[1].id).catch(()=>null):Promise.resolve(null),Vu(w.name).catch(()=>null),Qu(w.name).catch(()=>null)]);return{project:w,runs:S,keywords:k,competitors:E,timeline:R,latestRunDetail:_,previousRunDetail:L,gscCoverage:M,bingCoverage:T}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),p=m.every(w=>w.isSuccess),v=N.useMemo(()=>{if(s)return s;if(!a.data||!r.data||d.length>0&&!p)return null;const w=m.map(S=>S.data).filter(S=>S!=null);return fM(w,c.data??null)},[s,a.data,r.data,c.data,p,m,d.length]),y=!s&&(a.isError||r.isError),x=!s&&!v&&!y,b=N.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch(),c.refetch()])},[a.refetch,r.refetch,c.refetch]);return{dashboard:v,isLoading:x,isError:y,refetch:b}}function mM(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Ab=mM(),Um=Ab==="/"?"":Ab.replace(/\/$/,"");async function pM(){const e=Um?`${Um}/health`:"/health",t=await hN(e,"API"),s=t.state==="ok"?{label:"Runner",state:"ok",detail:"In-process job runner"}:{label:"Runner",state:t.state,detail:"Depends on API"};return{apiStatus:t,workerStatus:s}}function Ju(e,t){return Ko({queryKey:Ai.health,queryFn:pM,enabled:e,refetchInterval:15e3,initialData:t})}function gM(e){return Ko({queryKey:Ai.runs.detail(e??""),queryFn:()=>Dr(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function ul(){const e=ka(),t=Lu({strict:!1}),s=jn({select:m=>m.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:m=>e({to:s,from:as.to,search:p=>({...p,runId:m,evidenceId:void 0})}),openEvidence:m=>e({to:s,from:as.to,search:p=>({...p,evidenceId:m,runId:void 0})}),closeDrawer:()=>e({to:s,from:as.to,search:m=>({...m,runId:void 0,evidenceId:void 0})})}}const Ob=[{label:"Architecture",href:"https://github.com/AINYC/canonry/blob/main/docs/architecture.md"},{label:"Testing Guide",href:"https://github.com/AINYC/canonry/blob/main/docs/testing.md"}],Db=e=>({label:e,state:"checking",detail:"Checking service health"}),yM={apiStatus:Db("API"),workerStatus:Db("Worker")};function vM(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),d=Ju(!e,e?.health).data??e?.health??yM,f=n2(),{runId:m,evidenceId:p,closeDrawer:v}=ul(),[y,x]=N.useState(!1),b=gM(m),w=b.data??null,S=b.isLoading;N.useEffect(()=>{w&&w.status!=="running"&&w.status!=="queued"&&a()},[w?.status,a]),N.useEffect(()=>{x(!1)},[f.pathname]),N.useEffect(()=>{if(typeof window>"u"||!m&&!p)return;const _=L=>{L.key==="Escape"&&v()};return window.addEventListener("keydown",_),()=>{window.removeEventListener("keydown",_)}},[m,p,v]);const C=t??e?.dashboard??null,k=m&&C?qL(C,m):void 0,E=p&&C?HL(C,p):void 0,R=(()=>{const _=f.pathname;if(_==="/")return"Portfolio";if(_==="/projects")return"Projects";if(_==="/runs")return"Runs";if(_==="/settings")return"Settings";if(_==="/setup")return"Setup";if(_.startsWith("/projects/")){const M=_.split("/").filter(Boolean)[1];if(M&&C){const T=C.projects.find(A=>A.project.id===M);if(T)return T.project.name}return"Project"}return"Not found"})();return o.jsxs("div",{className:"app-shell",children:[o.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),o.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[o.jsx("div",{className:"sidebar-brand",children:o.jsx(Qx,{})}),o.jsxs("nav",{className:"sidebar-nav",children:[o.jsxs(yt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(b2,{className:"sidebar-icon"}),o.jsx("span",{children:"Overview"})]}),o.jsxs(yt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[o.jsx(v2,{className:"sidebar-icon"}),o.jsx("span",{children:"Projects"})]}),o.jsxs(yt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(N2,{className:"sidebar-icon"}),o.jsx("span",{children:"Runs"})]}),o.jsxs(yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(A2,{className:"sidebar-icon"}),o.jsx("span",{children:"Settings"})]}),s?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(_=>o.jsxs("div",{className:"sidebar-skeleton-item",children:[o.jsx("span",{className:"skeleton-circle size-2"}),o.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+_*15}%`}})]},_))]}):C&&C.projects.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(_=>{const L=_.visibilitySummary.tone;return o.jsxs(yt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[o.jsx("span",{className:`sidebar-dot sidebar-dot-${L}`}),o.jsx("span",{children:_.project.name})]},_.project.id)})]}):s?null:o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Resources"}),o.jsxs(yt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(z2,{className:"sidebar-icon"}),o.jsx("span",{children:"Setup"})]})]})]}),o.jsx("div",{className:"sidebar-footer",children:Ob.map(_=>o.jsx("a",{className:"sidebar-footer-link",href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.href))})]}),o.jsxs("div",{className:"main-area",children:[o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"topbar-left",children:[o.jsx("div",{className:"topbar-brand-mobile",children:o.jsx(Qx,{compact:!0})}),o.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[o.jsx(yt,{to:"/",children:"Home"}),o.jsx(Mu,{className:"breadcrumb-sep size-3"}),o.jsx("span",{className:"breadcrumb-current",children:R})]})]}),o.jsxs("div",{className:"topbar-actions",children:[o.jsxs("div",{className:"health-pill-row",children:[o.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),o.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),o.jsxs(ce,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>x(_=>!_),children:[o.jsx(j2,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),o.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[o.jsxs(ce,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>x(!1),children:[o.jsx($u,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Close navigation"})]}),o.jsx(yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),o.jsx(yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),o.jsx(yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),o.jsx(yt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),C&&C.projects.length>0?o.jsxs("div",{className:"mobile-nav-section",children:[o.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(_=>o.jsx(yt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"mobile-nav-link",children:_.project.name},_.project.id))]}):null]}),o.jsx("main",{id:"content",className:"page-shell",children:s&&!e?o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-40"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(_=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text w-full"}),o.jsx("div",{className:"skeleton-text-sm w-3/4"})]},_))}),o.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(_=>o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-20"}),o.jsx("div",{className:"space-y-2",children:[1,2,3].map(L=>o.jsx("div",{className:"skeleton-text-sm w-full"},L))})]},_))})]}):o.jsx(dp,{})}),o.jsxs("footer",{className:"footer",children:[o.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[o.jsx(g2,{className:"size-3.5"}),o.jsx("span",{children:"Canonry"})]}),o.jsx("div",{className:"footer-links",children:Ob.map(_=>o.jsx("a",{href:_.href,target:"_blank",rel:"noreferrer",children:_.label},_.href))})]})]}),k?o.jsxs(RT,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[o.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[o.jsx(Pu,{status:k.status}),o.jsx("span",{className:"text-zinc-400",children:k.startedAt}),o.jsx("span",{className:"text-zinc-500",children:k.duration}),o.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&o.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),o.jsxs("div",{className:"mt-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):w&&w.snapshots.length>0?o.jsxs("div",{className:"space-y-2",children:[w.snapshots.map(_=>o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:_.keyword??"Unknown key phrase"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(tl,{provider:_.provider}),o.jsx(tj,{variant:_.citationState==="cited"?"success":"neutral",children:_.citationState})]})]}),_.model&&o.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:_.model}),_.citedDomains.length>0&&o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[o.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",_.citedDomains.join(", ")]}),_.competitorOverlap.length>0&&o.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",_.competitorOverlap.join(", ")]}),_.groundingSources&&_.groundingSources.length>0&&o.jsxs("details",{className:"mt-2",children:[o.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[_.groundingSources.length," grounding source",_.groundingSources.length!==1?"s":""]}),o.jsx("ul",{className:"mt-1 space-y-0.5",children:_.groundingSources.map((L,M)=>o.jsx("li",{className:"text-xs text-zinc-500 truncate",children:o.jsx("a",{href:L.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:L.title||L.uri})},M))})]}),_.answerText&&o.jsxs("details",{className:"mt-1",children:[o.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),o.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:_.answerText})]})]},_.id)),w.status==="running"&&o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):w&&w.status==="running"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first key phrase result..."]}):w&&w.status==="queued"?o.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[o.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):w&&w.error?o.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[o.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),o.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:I2(w.error)})]}):o.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?o.jsx(LL,{evidence:E.evidence,project:E.project,onClose:v}):null]})}class xM extends N.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,s){console.error("[ErrorBoundary]",t,s.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?o.jsx("div",{className:"page-container",children:o.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[o.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:o.jsx(M2,{className:"size-6 text-rose-400"})}),o.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),o.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),o.jsxs("div",{className:"flex gap-3 mt-2",children:[o.jsxs(ce,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[o.jsx(R2,{className:"size-3.5 mr-1.5"}),"Try again"]}),o.jsx(ce,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const De=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));De.displayName="Card";const bM=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("flex flex-col gap-1.5 p-5",e),...t}));bM.displayName="CardHeader";const SM=N.forwardRef(({className:e,...t},s)=>o.jsx("h3",{ref:s,className:Qn("font-medium tracking-tight text-zinc-50",e),...t}));SM.displayName="CardTitle";const jM=N.forwardRef(({className:e,...t},s)=>o.jsx("p",{ref:s,className:Qn("text-sm text-zinc-500",e),...t}));jM.displayName="CardDescription";const wM=N.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Qn("p-5 pt-0",e),...t}));wM.displayName="CardContent";function NM({points:e,tone:t}){const s=N.useId();if(e.length===0)return null;const a=42,r=132,c=5,d=Math.min(...e),m=Math.max(...e)-d||1,p=r-c*2,v=a-c*2,y=e.map((x,b)=>{const w=c+b/Math.max(e.length-1,1)*p,S=c+(1-(x-d)/m)*v;return`${w},${S}`}).join(" ");return o.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${r} ${a}`,"aria-hidden":"true",children:[o.jsx("defs",{children:o.jsx("clipPath",{id:s,children:o.jsx("rect",{x:c,y:c,width:p,height:v,rx:"8"})})}),o.jsx("line",{className:"sparkline-guide",x1:c,x2:r-c,y1:a-c,y2:a-c}),o.jsx("polyline",{clipPath:`url(#${s})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function CM(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function kM(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:Su(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:Su(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const r=s.providerStatuses.filter(m=>m.state==="ready").length,c=s.providerStatuses.length,d=r>0,f=s.providerStatuses.filter(m=>m.state==="ready").map(m=>CM(m)).join(" · ");return{...a,label:"Providers",tone:d?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function _M(e,t){if(e.apiStatus.state!=="ok")return"Launch is blocked until the API responds cleanly.";if(e.apiStatus.databaseConfigured===!1)return"Launch is blocked until the API has a database connection configured.";if(e.workerStatus.state!=="ok")return"Launch is blocked until the worker is healthy and heartbeats are current.";if(!t.providerStatuses.some(s=>s.state==="ready"))return"Launch is blocked until at least one provider is configured."}function zM(e,t,s){const a=_M(t,s),r=structuredClone(e);return r.healthChecks=r.healthChecks.map(c=>{if(c.id==="api")return{...c,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(c.id==="worker")return{...c,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const d=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:d?"At least one provider configured.":"No providers configured.",state:d?"ready":"attention"}}),r.launchState.enabled=a===void 0,r.launchState.blockedReason=a,r.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",r}function EM({project:e}){return o.jsxs(yt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[o.jsxs("div",{className:"project-row-primary",children:[o.jsxs("div",{children:[o.jsx("p",{className:"project-name",children:e.project.name}),o.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),o.jsx("p",{className:"project-insight",children:e.insight})]}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),o.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),o.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),o.jsx("div",{className:"project-row-stat",children:o.jsxs("div",{className:"metric-inline-block",children:[o.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),o.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),o.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Uu(e.lastRun.status)]})]})}),o.jsx("div",{className:"project-row-chart",children:o.jsx(NM,{points:e.trend,tone:nj(e.lastRun.status)})}),o.jsx("span",{className:"project-row-link",children:o.jsx(Mu,{className:"h-4 w-4 text-zinc-500"})})]})}function RM(){const e=cl(),{dashboard:t,isLoading:s}=Ra(),a=t??e?.dashboard;if(!a||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-32"}),o.jsx("div",{className:"skeleton-text-sm w-64"})]}),o.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[o.jsxs("div",{className:"flex-1 space-y-2",children:[o.jsx("div",{className:"skeleton-text w-36"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton-text w-16"}),o.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const r=a.portfolioOverview,f=Ju(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},m=kM(r.systemHealth,f,a.settings),{openRun:p}=ul();return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Portfolio"}),o.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),o.jsx("div",{className:"page-header-right",children:o.jsx("p",{className:"text-[11px] text-zinc-600",children:r.lastUpdatedAt})})]}),r.projects.length>0?o.jsx("div",{className:"project-list project-list-scrollable",children:r.projects.map(v=>o.jsx(EM,{project:v},v.project.id))}):o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h3",{children:r.emptyState?.title??"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:r.emptyState?.detail}),o.jsx(ce,{size:"sm",asChild:!0,children:o.jsx(yt,{to:r.emptyState?.ctaHref==="/setup"||!r.emptyState?.ctaHref?"/setup":"/",children:r.emptyState?.ctaLabel??"Launch setup"})})]}),o.jsxs("div",{className:"overview-secondary-grid",children:[r.attentionItems.length>0&&o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),o.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),o.jsx("div",{className:"attention-list attention-list-scrollable",children:r.attentionItems.map(v=>o.jsxs(yt,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[o.jsxs("div",{children:[o.jsx("p",{className:"attention-title",children:v.title}),o.jsx("p",{className:"attention-detail",children:v.detail})]}),o.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.id))})]}),o.jsxs("section",{className:"overview-secondary-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),o.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),o.jsx("div",{className:"compact-stack compact-stack-scrollable",children:r.recentRuns.length>0?r.recentRuns.map(v=>o.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(v.id),children:[o.jsxs("div",{children:[o.jsx("p",{className:"compact-run-title",children:v.projectName}),o.jsx("p",{className:"compact-run-detail",children:v.summary})]}),o.jsx(Pu,{status:v.status})]},v.id)):o.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),o.jsxs("section",{className:"page-section",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),o.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),o.jsx("div",{className:"health-grid",children:m.map(v=>o.jsxs(De,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:v.label}),o.jsx("h3",{children:v.detail})]}),o.jsx(nt,{tone:v.tone,children:v.label})]}),o.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Ip=Symbol.for("yaml.alias"),Pm=Symbol.for("yaml.document"),$i=Symbol.for("yaml.map"),bN=Symbol.for("yaml.pair"),Ss=Symbol.for("yaml.scalar"),Br=Symbol.for("yaml.seq"),Fn=Symbol.for("yaml.node.type"),Ta=e=>!!e&&typeof e=="object"&&e[Fn]===Ip,Xu=e=>!!e&&typeof e=="object"&&e[Fn]===Pm,dl=e=>!!e&&typeof e=="object"&&e[Fn]===$i,Dt=e=>!!e&&typeof e=="object"&&e[Fn]===bN,ft=e=>!!e&&typeof e=="object"&&e[Fn]===Ss,fl=e=>!!e&&typeof e=="object"&&e[Fn]===Br;function At(e){if(e&&typeof e=="object")switch(e[Fn]){case $i:case Br:return!0}return!1}function Ot(e){if(e&&typeof e=="object")switch(e[Fn]){case Ip:case $i:case Ss:case Br:return!0}return!1}const SN=e=>(ft(e)||At(e))&&!!e.anchor,fa=Symbol("break visit"),TM=Symbol("skip children"),Vo=Symbol("remove node");function qr(e,t){const s=AM(t);Xu(e)?Nr(null,e.contents,s,Object.freeze([e]))===Vo&&(e.contents=null):Nr(null,e,s,Object.freeze([]))}qr.BREAK=fa;qr.SKIP=TM;qr.REMOVE=Vo;function Nr(e,t,s,a){const r=OM(e,t,s,a);if(Ot(r)||Dt(r))return DM(e,a,r),Nr(e,r,s,a);if(typeof r!="symbol"){if(At(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const d=Nr(c,t.items[c],s,a);if(typeof d=="number")c=d-1;else{if(d===fa)return fa;d===Vo&&(t.items.splice(c,1),c-=1)}}}else if(Dt(t)){a=Object.freeze(a.concat(t));const c=Nr("key",t.key,s,a);if(c===fa)return fa;c===Vo&&(t.key=null);const d=Nr("value",t.value,s,a);if(d===fa)return fa;d===Vo&&(t.value=null)}}return r}function AM(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function OM(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(dl(t))return s.Map?.(e,t,a);if(fl(t))return s.Seq?.(e,t,a);if(Dt(t))return s.Pair?.(e,t,a);if(ft(t))return s.Scalar?.(e,t,a);if(Ta(t))return s.Alias?.(e,t,a)}function DM(e,t,s){const a=t[t.length-1];if(At(a))a.items[e]=s;else if(Dt(a))e==="key"?a.key=s:a.value=s;else if(Xu(a))a.contents=s;else{const r=Ta(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const LM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},MM=e=>e.replace(/[!,[\]{}]/g,t=>LM[t]);class dn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},dn.defaultYaml,t),this.tags=Object.assign({},dn.defaultTags,s)}clone(){const t=new dn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new dn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:dn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},dn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:dn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},dn.defaultTags),this.atNextDocument=!1);const a=t.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[c,d]=a;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,d),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(t,s){if(t==="!")return"!";if(t[0]!=="!")return s(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const d=t.slice(2,-1);return d==="!"||d==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),d)}const[,a,r]=t.match(/^(.*!)([^!]*)$/s);r||s(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(d){return s(String(d)),null}return a==="!"?t:(s(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[s,a]of Object.entries(this.tags))if(t.startsWith(a))return s+MM(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(t&&a.length>0&&Ot(t.contents)){const c={};qr(t.contents,(d,f)=>{Ot(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,d]of a)c==="!!"&&d==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(d)))&&s.push(`%TAG ${c} ${d}`);return s.join(`
|
|
96
|
+
`)}}dn.defaultYaml={explicit:!1,version:"1.2"};dn.defaultTags={"!!":"tag:yaml.org,2002:"};function jN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function wN(e){const t=new Set;return qr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function NN(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function $M(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=wN(e));const d=NN(t,r);return r.add(d),d},setAnchors:()=>{for(const c of s){const d=a.get(c);if(typeof d=="object"&&d.anchor&&(ft(d.node)||At(d.node)))d.node.anchor=d.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=c,f}}},sourceObjects:a}}function Cr(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const d=a[r],f=Cr(e,a,String(r),d);f===void 0?delete a[r]:f!==d&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),d=Cr(e,a,r,c);d===void 0?a.delete(r):d!==c&&a.set(r,d)}else if(a instanceof Set)for(const r of Array.from(a)){const c=Cr(e,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const d=Cr(e,a,r,c);d===void 0?delete a[r]:d!==c&&(a[r]=d)}return e.call(t,s,a)}function Kn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Kn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!SN(e))return e.toJSON(t,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const r=e.toJSON(t,s);return s.onCreate&&s.onCreate(r),r}return typeof e=="bigint"&&!s?.keep?Number(e):e}class Bp{constructor(t){Object.defineProperty(this,Fn,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:s,maxAliasCount:a,onAnchor:r,reviver:c}={}){if(!Xu(t))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Kn(this,"",d);if(typeof r=="function")for(const{count:m,res:p}of d.anchors.values())r(p,m);return typeof c=="function"?Cr(c,{"":f},"",f):f}}class qp extends Bp{constructor(t){super(Ip),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,s){let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],qr(t,{Node:(c,d)=>{(Ta(d)||SN(d))&&a.push(d)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(t,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,d=this.resolve(r,s);if(!d){const m=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(m)}let f=a.get(d);if(f||(Kn(d,null,s),f=a.get(d)),f?.res===void 0){const m="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(m)}if(c>=0&&(f.count+=1,f.aliasCount===0&&(f.aliasCount=ru(r,d,a)),f.count*f.aliasCount>c)){const m="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(m)}return f.res}toString(t,s,a){const r=`*${this.source}`;if(t){if(jN(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(t.implicitKey)return`${r} `}return r}}function ru(e,t,s){if(Ta(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(At(t)){let a=0;for(const r of t.items){const c=ru(e,r,s);c>a&&(a=c)}return a}else if(Dt(t)){const a=ru(e,t.key,s),r=ru(e,t.value,s);return Math.max(a,r)}return 1}const CN=e=>!e||typeof e!="function"&&typeof e!="object";class Re extends Bp{constructor(t){super(Ss),this.value=t}toJSON(t,s){return s?.keep?this.value:Kn(this.value,t,s)}toString(){return String(this.value)}}Re.BLOCK_FOLDED="BLOCK_FOLDED";Re.BLOCK_LITERAL="BLOCK_LITERAL";Re.PLAIN="PLAIN";Re.QUOTE_DOUBLE="QUOTE_DOUBLE";Re.QUOTE_SINGLE="QUOTE_SINGLE";const UM="tag:yaml.org,2002:";function PM(e,t,s){if(t){const a=s.filter(c=>c.tag===t),r=a.find(c=>!c.format)??a[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return s.find(a=>a.identify?.(e)&&!a.format)}function al(e,t,s){if(Xu(e)&&(e=e.contents),Ot(e))return e;if(Dt(e)){const y=s.schema[$i].createNode?.(s.schema,null,s);return y.items.push(e),y}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:c,schema:d,sourceObjects:f}=s;let m;if(a&&e&&typeof e=="object"){if(m=f.get(e),m)return m.anchor??(m.anchor=r(e)),new qp(m.anchor);m={anchor:null,node:null},f.set(e,m)}t?.startsWith("!!")&&(t=UM+t.slice(2));let p=PM(e,t,d.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Re(e);return m&&(m.node=y),y}p=e instanceof Map?d[$i]:Symbol.iterator in Object(e)?d[Br]:d[$i]}c&&(c(p),delete s.onTagObj);const v=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new Re(e);return t?v.tag=t:p.default||(v.tag=p.tag),m&&(m.node=v),v}function zu(e,t,s){let a=s;for(let r=t.length-1;r>=0;--r){const c=t[r];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=a,a=d}else a=new Map([[c,a]])}return al(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Go=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class kN extends Bp{constructor(t,s){super(t),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(t){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(s.schema=t),s.items=s.items.map(a=>Ot(a)||Dt(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if(Go(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(At(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,zu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(t){const[s,...a]=t;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(At(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(t,s){const[a,...r]=t,c=this.get(a,!0);return r.length===0?!s&&ft(c)?c.value:c:At(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!Dt(s))return!1;const a=s.value;return a==null||t&&ft(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[s,...a]=t;if(a.length===0)return this.has(s);const r=this.get(s,!0);return At(r)?r.hasIn(a):!1}setIn(t,s){const[a,...r]=t;if(r.length===0)this.set(a,s);else{const c=this.get(a,!0);if(At(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,zu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const IM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ks(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ya=(e,t,s)=>e.endsWith(`
|
|
97
97
|
`)?Ks(s,t):s.includes(`
|
|
98
98
|
`)?`
|
|
99
|
-
`+Ks(s,t):(e.endsWith(" ")?"":" ")+s,_N="flow",
|
|
100
|
-
`)s===
|
|
99
|
+
`+Ks(s,t):(e.endsWith(" ")?"":" ")+s,_N="flow",Im="block",ou="quoted";function Wu(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:d,onOverflow:f}={}){if(!r||r<0)return e;r<c&&(c=0);const m=Math.max(1+c,1+r-t.length);if(e.length<=m)return e;const p=[],v={};let y=r-t.length;typeof a=="number"&&(a>r-Math.max(2,c)?p.push(0):y=r-a);let x,b,w=!1,S=-1,C=-1,k=-1;s===Im&&(S=Lb(e,S,t.length),S!==-1&&(y=S+m));for(let R;R=e[S+=1];){if(s===ou&&R==="\\"){switch(C=S,e[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}k=S}if(R===`
|
|
100
|
+
`)s===Im&&(S=Lb(e,S,t.length)),y=S+t.length+m,x=void 0;else{if(R===" "&&b&&b!==" "&&b!==`
|
|
101
101
|
`&&b!==" "){const _=e[S+1];_&&_!==" "&&_!==`
|
|
102
|
-
`&&_!==" "&&(x=S)}if(S>=y)if(x)p.push(x),y=x+m,x=void 0;else if(s===ou){for(;b===" "||b===" ";)b=R,R=e[S+=1],w=!0;const _=S>k+1?S-2:C-1;if(v[_])return e;p.push(_),v[_]=!0,y=_+m,x=void 0}else w=!0}b=R}if(w&&f&&f(),p.length===0)return e;d&&d();let E=e.slice(0,p[0]);for(let R=0;R<p.length;++R){const _=p[R],
|
|
103
|
-
${t}${e.slice(0,
|
|
104
|
-
${t}${e.slice(_+1,
|
|
102
|
+
`&&_!==" "&&(x=S)}if(S>=y)if(x)p.push(x),y=x+m,x=void 0;else if(s===ou){for(;b===" "||b===" ";)b=R,R=e[S+=1],w=!0;const _=S>k+1?S-2:C-1;if(v[_])return e;p.push(_),v[_]=!0,y=_+m,x=void 0}else w=!0}b=R}if(w&&f&&f(),p.length===0)return e;d&&d();let E=e.slice(0,p[0]);for(let R=0;R<p.length;++R){const _=p[R],L=p[R+1]||e.length;_===0?E=`
|
|
103
|
+
${t}${e.slice(0,L)}`:(s===ou&&v[_]&&(E+=`${e[_]}\\`),E+=`
|
|
104
|
+
${t}${e.slice(_+1,L)}`)}return E}function Lb(e,t,s){let a=t,r=t+1,c=e[r];for(;c===" "||c===" ";)if(t<r+s)c=e[++t];else{do c=e[++t];while(c&&c!==`
|
|
105
105
|
`);a=t,r=t+1,c=e[r]}return a}const ed=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),td=e=>/^(%|---|\.\.\.)/m.test(e);function BM(e,t,s){if(!t||t<0)return!1;const a=t-s,r=e.length;if(r<=a)return!1;for(let c=0,d=0;c<r;++c)if(e[c]===`
|
|
106
106
|
`){if(c-d>a)return!0;if(d=c+1,r-d<=a)return!1}return!0}function Qo(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(td(e)?" ":"");let d="",f=0;for(let m=0,p=s[m];p;p=s[++m])if(p===" "&&s[m+1]==="\\"&&s[m+2]==="n"&&(d+=s.slice(f,m)+"\\ ",m+=1,f=m,p="\\"),p==="\\")switch(s[m+1]){case"u":{d+=s.slice(f,m);const v=s.substr(m+2,4);switch(v){case"0000":d+="\\0";break;case"0007":d+="\\a";break;case"000b":d+="\\v";break;case"001b":d+="\\e";break;case"0085":d+="\\N";break;case"00a0":d+="\\_";break;case"2028":d+="\\L";break;case"2029":d+="\\P";break;default:v.substr(0,2)==="00"?d+="\\x"+v.substr(2):d+=s.substr(m,6)}m+=5,f=m+1}break;case"n":if(a||s[m+2]==='"'||s.length<r)m+=1;else{for(d+=s.slice(f,m)+`
|
|
107
107
|
|
|
108
108
|
`;s[m+2]==="\\"&&s[m+3]==="n"&&s[m+4]!=='"';)d+=`
|
|
109
|
-
`,m+=2;d+=c,s[m+2]===" "&&(d+="\\"),m+=1,f=m+1}break;default:m+=1}return d=f?d+s.slice(f):s,a?d:Wu(d,c,ou,ed(t,!1))}function
|
|
109
|
+
`,m+=2;d+=c,s[m+2]===" "&&(d+="\\"),m+=1,f=m+1}break;default:m+=1}return d=f?d+s.slice(f):s,a?d:Wu(d,c,ou,ed(t,!1))}function Bm(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
110
110
|
`)||/[ \t]\n|\n[ \t]/.test(e))return Qo(e,t);const s=t.indent||(td(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
-
${s}`)+"'";return t.implicitKey?a:Wu(a,s,_N,ed(t,!1))}function kr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Qo;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=
|
|
111
|
+
${s}`)+"'";return t.implicitKey?a:Wu(a,s,_N,ed(t,!1))}function kr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Qo;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=Bm:c&&!r?a=Qo:a=s?Bm:Qo}return a(e,t)}let qm;try{qm=new RegExp(`(^|(?<!
|
|
112
112
|
))
|
|
113
113
|
+(?!
|
|
114
|
-
|$)`,"g")}catch{
|
|
114
|
+
|$)`,"g")}catch{qm=/\n+(?!\n|$)/g}function lu({comment:e,type:t,value:s},a,r,c){const{blockQuote:d,commentString:f,lineWidth:m}=a.options;if(!d||/\n[\t ]+$/.test(s))return kr(s,a);const p=a.indent||(a.forceBlockIndent||td(s)?" ":""),v=d==="literal"?!0:d==="folded"||t===Re.BLOCK_FOLDED?!1:t===Re.BLOCK_LITERAL?!0:!BM(s,m,p.length);if(!s)return v?`|
|
|
115
115
|
`:`>
|
|
116
|
-
`;let y,x;for(x=s.length;x>0;--x){const
|
|
117
|
-
`&&
|
|
116
|
+
`;let y,x;for(x=s.length;x>0;--x){const L=s[x-1];if(L!==`
|
|
117
|
+
`&&L!==" "&&L!==" ")break}let b=s.substring(x);const w=b.indexOf(`
|
|
118
118
|
`);w===-1?y="-":s===b||w!==b.length-1?(y="+",c&&c()):y="",b&&(s=s.slice(0,-b.length),b[b.length-1]===`
|
|
119
|
-
`&&(b=b.slice(0,-1)),b=b.replace(
|
|
120
|
-
`)k=C;else break}let E=s.substring(0,k<C?k+1:C);E&&(s=s.substring(E.length),E=E.replace(/\n+/g,`$&${p}`));let _=(S?p?"2":"1":"")+y;if(e&&(_+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const
|
|
121
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let M=!1;const T=ed(a,!0);d!=="folded"&&t!==Re.BLOCK_FOLDED&&(T.onOverflow=()=>{M=!0});const A=Wu(`${E}${
|
|
119
|
+
`&&(b=b.slice(0,-1)),b=b.replace(qm,`$&${p}`));let S=!1,C,k=-1;for(C=0;C<s.length;++C){const L=s[C];if(L===" ")S=!0;else if(L===`
|
|
120
|
+
`)k=C;else break}let E=s.substring(0,k<C?k+1:C);E&&(s=s.substring(E.length),E=E.replace(/\n+/g,`$&${p}`));let _=(S?p?"2":"1":"")+y;if(e&&(_+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const L=s.replace(/\n+/g,`
|
|
121
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let M=!1;const T=ed(a,!0);d!=="folded"&&t!==Re.BLOCK_FOLDED&&(T.onOverflow=()=>{M=!0});const A=Wu(`${E}${L}${b}`,p,Im,T);if(!M)return`>${_}
|
|
122
122
|
${p}${A}`}return s=s.replace(/\n+/g,`$&${p}`),`|${_}
|
|
123
123
|
${p}${E}${s}${b}`}function qM(e,t,s,a){const{type:r,value:c}=e,{actualString:d,implicitKey:f,indent:m,indentStep:p,inFlow:v}=t;if(f&&c.includes(`
|
|
124
124
|
`)||v&&/[[\]{},]/.test(c))return kr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
|
|
125
125
|
`)?kr(c,t):lu(e,t,s,a);if(!f&&!v&&r!==Re.PLAIN&&c.includes(`
|
|
126
126
|
`))return lu(e,t,s,a);if(td(c)){if(m==="")return t.forceBlockIndent=!0,lu(e,t,s,a);if(f&&m===p)return kr(c,t)}const y=c.replace(/\n+/g,`$&
|
|
127
|
-
${m}`);if(d){const x=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:b,tags:w}=t.doc.schema;if(w.some(x)||b?.some(x))return kr(c,t)}return f?y:Wu(y,m,_N,ed(t,!1))}function
|
|
128
|
-
${t.indent}${f}`:f}function KM({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:m,options:{commentString:p,indentSeq:v,simpleKeys:y}}=s;let x=Ot(e)&&e.comment||null;if(y){if(x)throw new Error("With simple keys, key nodes cannot have comments");if(At(e)||!Ot(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let b=!y&&(!e||x&&t==null&&!s.inFlow||At(e)||(ft(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!b&&(y||!c),indent:f+m});let w=!1,S=!1,C=
|
|
129
|
-
${f}:`):(C=`${C}:`,x&&(C+=ya(C,s.indent,p(x))));let k,E,R;Ot(t)?(k=!!t.spaceBefore,E=t.commentBefore,R=t.comment):(k=!1,E=null,R=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!b&&!x&&ft(t)&&(s.indentAtStart=C.length+1),S=!1,!v&&m.length>=2&&!s.inFlow&&!b&&fl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let _=!1;const
|
|
127
|
+
${m}`);if(d){const x=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:b,tags:w}=t.doc.schema;if(w.some(x)||b?.some(x))return kr(c,t)}return f?y:Wu(y,m,_N,ed(t,!1))}function Hp(e,t,s,a){const{implicitKey:r,inFlow:c}=t,d=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Re.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(d.value)&&(f=Re.QUOTE_DOUBLE);const m=v=>{switch(v){case Re.BLOCK_FOLDED:case Re.BLOCK_LITERAL:return r||c?kr(d.value,t):lu(d,t,s,a);case Re.QUOTE_DOUBLE:return Qo(d.value,t);case Re.QUOTE_SINGLE:return Bm(d.value,t);case Re.PLAIN:return qM(d,t,s,a);default:return null}};let p=m(f);if(p===null){const{defaultKeyType:v,defaultStringType:y}=t.options,x=r&&v||y;if(p=m(x),p===null)throw new Error(`Unsupported default string type ${x}`)}return p}function zN(e,t){const s=Object.assign({blockQuote:!0,commentString:IM,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function HM(e,t){if(t.tag){const r=e.filter(c=>c.tag===t.tag);if(r.length>0)return r.find(c=>c.format===t.format)??r[0]}let s,a;if(ft(t)){a=t.value;let r=e.filter(c=>c.identify?.(a));if(r.length>1){const c=r.filter(d=>d.test);c.length>0&&(r=c)}s=r.find(c=>c.format===t.format)??r.find(c=>!c.format)}else a=t,s=e.find(r=>r.nodeClass&&a instanceof r.nodeClass);if(!s){const r=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${r} value`)}return s}function GM(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(ft(e)||At(e))&&e.anchor;c&&jN(c)&&(s.add(c),r.push(`&${c}`));const d=e.tag??(t.default?null:t.tag);return d&&r.push(a.directives.tagString(d)),r.join(" ")}function Lr(e,t,s,a){if(Dt(e))return e.toString(t,s,a);if(Ta(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const c=Ot(e)?e:t.doc.createNode(e,{onTagObj:m=>r=m});r??(r=HM(t.doc.schema.tags,c));const d=GM(c,r,t);d.length>0&&(t.indentAtStart=(t.indentAtStart??0)+d.length+1);const f=typeof r.stringify=="function"?r.stringify(c,t,s,a):ft(c)?Hp(c,t,s,a):c.toString(t,s,a);return d?ft(c)||f[0]==="{"||f[0]==="["?`${d} ${f}`:`${d}
|
|
128
|
+
${t.indent}${f}`:f}function KM({key:e,value:t},s,a,r){const{allNullValues:c,doc:d,indent:f,indentStep:m,options:{commentString:p,indentSeq:v,simpleKeys:y}}=s;let x=Ot(e)&&e.comment||null;if(y){if(x)throw new Error("With simple keys, key nodes cannot have comments");if(At(e)||!Ot(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let b=!y&&(!e||x&&t==null&&!s.inFlow||At(e)||(ft(e)?e.type===Re.BLOCK_FOLDED||e.type===Re.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!b&&(y||!c),indent:f+m});let w=!1,S=!1,C=Lr(e,s,()=>w=!0,()=>S=!0);if(!b&&!s.inFlow&&C.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(s.inFlow){if(c||t==null)return w&&a&&a(),C===""?"?":b?`? ${C}`:C}else if(c&&!y||t==null&&b)return C=`? ${C}`,x&&!w?C+=ya(C,s.indent,p(x)):S&&r&&r(),C;w&&(x=null),b?(x&&(C+=ya(C,s.indent,p(x))),C=`? ${C}
|
|
129
|
+
${f}:`):(C=`${C}:`,x&&(C+=ya(C,s.indent,p(x))));let k,E,R;Ot(t)?(k=!!t.spaceBefore,E=t.commentBefore,R=t.comment):(k=!1,E=null,R=null,t&&typeof t=="object"&&(t=d.createNode(t))),s.implicitKey=!1,!b&&!x&&ft(t)&&(s.indentAtStart=C.length+1),S=!1,!v&&m.length>=2&&!s.inFlow&&!b&&fl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let _=!1;const L=Lr(t,s,()=>_=!0,()=>S=!0);let M=" ";if(x||k||E){if(M=k?`
|
|
130
130
|
`:"",E){const T=p(E);M+=`
|
|
131
|
-
${Ks(T,s.indent)}`}
|
|
131
|
+
${Ks(T,s.indent)}`}L===""&&!s.inFlow?M===`
|
|
132
132
|
`&&R&&(M=`
|
|
133
133
|
|
|
134
134
|
`):M+=`
|
|
135
|
-
${s.indent}`}else if(!b&&At(t)){const T=
|
|
136
|
-
`),P=A!==-1,J=s.inFlow??t.flow??t.items.length===0;if(P||!J){let Q=!1;if(P&&(T==="&"||T==="!")){let se=
|
|
137
|
-
${s.indent}`)}}else(
|
|
138
|
-
`)&&(M="");return C+=M+
|
|
135
|
+
${s.indent}`}else if(!b&&At(t)){const T=L[0],A=L.indexOf(`
|
|
136
|
+
`),P=A!==-1,J=s.inFlow??t.flow??t.items.length===0;if(P||!J){let Q=!1;if(P&&(T==="&"||T==="!")){let se=L.indexOf(" ");T==="&"&&se!==-1&&se<A&&L[se+1]==="!"&&(se=L.indexOf(" ",se+1)),(se===-1||A<se)&&(Q=!0)}Q||(M=`
|
|
137
|
+
${s.indent}`)}}else(L===""||L[0]===`
|
|
138
|
+
`)&&(M="");return C+=M+L,s.inFlow?_&&a&&a():R&&!_?C+=ya(C,s.indent,p(R)):S&&r&&r(),C}function FM(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Zc="<<",Fs={identify:e=>e===Zc||typeof e=="symbol"&&e.description===Zc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Re(Symbol(Zc)),{addToJSMap:EN}),stringify:()=>Zc},ZM=(e,t)=>(Fs.identify(t)||ft(t)&&(!t.type||t.type===Re.PLAIN)&&Fs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Fs.tag&&s.default);function EN(e,t,s){if(s=e&&Ta(s)?s.resolve(e.doc):s,fl(s))for(const a of s.items)Yh(e,t,a);else if(Array.isArray(s))for(const a of s)Yh(e,t,a);else Yh(e,t,s)}function Yh(e,t,s){const a=e&&Ta(s)?s.resolve(e.doc):s;if(!dl(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,e,Map);for(const[c,d]of r)t instanceof Map?t.has(c)||t.set(c,d):t instanceof Set?t.add(c):Object.prototype.hasOwnProperty.call(t,c)||Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0});return t}function RN(e,t,{key:s,value:a}){if(Ot(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(ZM(e,s))EN(e,t,a);else{const r=Kn(s,"",e);if(t instanceof Map)t.set(r,Kn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=VM(s,r,e),d=Kn(a,c,e);c in t?Object.defineProperty(t,c,{value:d,writable:!0,enumerable:!0,configurable:!0}):t[c]=d}}return t}function VM(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Ot(e)&&s?.doc){const a=zN(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(r);c.length>40&&(c=c.substring(0,36)+'..."'),FM(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(t)}function Gp(e,t,s){const a=al(e,void 0,s),r=al(t,void 0,s);return new hn(a,r)}class hn{constructor(t,s=null){Object.defineProperty(this,Fn,{value:bN}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return Ot(s)&&(s=s.clone(t)),Ot(a)&&(a=a.clone(t)),new hn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return RN(s,a,this)}toString(t,s,a){return t?.doc?KM(this,t,s,a):JSON.stringify(this)}}function TN(e,t,s){return(t.inFlow??e.flow?YM:QM)(e,t,s)}function QM({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:d,onComment:f}){const{indent:m,options:{commentString:p}}=s,v=Object.assign({},s,{indent:c,type:null});let y=!1;const x=[];for(let w=0;w<t.length;++w){const S=t[w];let C=null;if(Ot(S))!y&&S.spaceBefore&&x.push(""),Eu(s,x,S.commentBefore,y),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(!y&&E.spaceBefore&&x.push(""),Eu(s,x,E.commentBefore,y))}y=!1;let k=Lr(S,v,()=>C=null,()=>y=!0);C&&(k+=ya(k,c,p(C))),y&&C&&(y=!1),x.push(a+k)}let b;if(x.length===0)b=r.start+r.end;else{b=x[0];for(let w=1;w<x.length;++w){const S=x[w];b+=S?`
|
|
139
139
|
${m}${S}`:`
|
|
140
140
|
`}}return e?(b+=`
|
|
141
|
-
`+Ks(p(e),m),f&&f()):y&&d&&d(),b}function YM({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const m=Object.assign({},t,{indent:a,inFlow:!0,type:null});let p=!1,v=0;const y=[];for(let w=0;w<e.length;++w){const S=e[w];let C=null;if(Ot(S))S.spaceBefore&&y.push(""),Eu(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(
|
|
141
|
+
`+Ks(p(e),m),f&&f()):y&&d&&d(),b}function YM({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:d,options:{commentString:f}}=t;a+=c;const m=Object.assign({},t,{indent:a,inFlow:!0,type:null});let p=!1,v=0;const y=[];for(let w=0;w<e.length;++w){const S=e[w];let C=null;if(Ot(S))S.spaceBefore&&y.push(""),Eu(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(Dt(S)){const E=Ot(S.key)?S.key:null;E&&(E.spaceBefore&&y.push(""),Eu(t,y,E.commentBefore,!1),E.comment&&(p=!0));const R=Ot(S.value)?S.value:null;R?(R.comment&&(C=R.comment),R.commentBefore&&(p=!0)):S.value==null&&E?.comment&&(C=E.comment)}C&&(p=!0);let k=Lr(S,m,()=>C=null);w<e.length-1&&(k+=","),C&&(k+=ya(k,a,f(C))),!p&&(y.length>v||k.includes(`
|
|
142
142
|
`))&&(p=!0),y.push(k),v=y.length}const{start:x,end:b}=s;if(y.length===0)return x+b;if(!p){const w=y.reduce((S,C)=>S+C.length+2,2);p=t.options.lineWidth>0&&w>t.options.lineWidth}if(p){let w=x;for(const S of y)w+=S?`
|
|
143
143
|
${c}${r}${S}`:`
|
|
144
144
|
`;return`${w}
|
|
145
|
-
${r}${b}`}else return`${x}${d}${y.join(" ")}${d}${b}`}function Eu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=Ks(t(a),e);s.push(c.trimStart())}}function va(e,t){const s=ft(t)?t.value:t;for(const a of e)if(
|
|
146
|
-
`:" ")}return
|
|
145
|
+
${r}${b}`}else return`${x}${d}${y.join(" ")}${d}${b}`}function Eu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=Ks(t(a),e);s.push(c.trimStart())}}function va(e,t){const s=ft(t)?t.value:t;for(const a of e)if(Dt(a)&&(a.key===t||a.key===s||ft(a.key)&&a.key.value===s))return a}class Gn extends kN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($i,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,d=new this(t),f=(m,p)=>{if(typeof c=="function")p=c.call(s,m,p);else if(Array.isArray(c)&&!c.includes(m))return;(p!==void 0||r)&&d.items.push(Gp(m,p,a))};if(s instanceof Map)for(const[m,p]of s)f(m,p);else if(s&&typeof s=="object")for(const m of Object.keys(s))f(m,s[m]);return typeof t.sortMapEntries=="function"&&d.items.sort(t.sortMapEntries),d}add(t,s){let a;Dt(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new hn(t,t?.value):a=new hn(t.key,t.value);const r=va(this.items,a.key),c=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);ft(r.value)&&CN(a.value)?r.value.value=a.value:r.value=a.value}else if(c){const d=this.items.findIndex(f=>c(a,f)<0);d===-1?this.items.push(a):this.items.splice(d,0,a)}else this.items.push(a)}delete(t){const s=va(this.items,t);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(t,s){const r=va(this.items,t)?.value;return(!s&&ft(r)?r.value:r)??void 0}has(t){return!!va(this.items,t)}set(t,s){this.add(new hn(t,s),!0)}toJSON(t,s,a){const r=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(r);for(const c of this.items)RN(s,r,c);return r}toString(t,s,a){if(!t)return JSON.stringify(this);for(const r of this.items)if(!Dt(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),TN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Hr={collection:"map",default:!0,nodeClass:Gn,tag:"tag:yaml.org,2002:map",resolve(e,t){return dl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Gn.from(e,t,s)};class Ca extends kN{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Br,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=Vc(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=Vc(t);if(typeof a!="number")return;const r=this.items[a];return!s&&ft(r)?r.value:r}has(t){const s=Vc(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=Vc(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];ft(r)&&CN(s)?r.value=s:this.items[a]=s}toJSON(t,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const c of this.items)a.push(Kn(c,String(r++),s));return a}toString(t,s,a){return t?TN(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s)){let d=0;for(let f of s){if(typeof r=="function"){const m=s instanceof Set?f:String(d++);f=r.call(s,m,f)}c.items.push(al(f,void 0,a))}}return c}}function Vc(e){let t=ft(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Gr={collection:"seq",default:!0,nodeClass:Ca,tag:"tag:yaml.org,2002:seq",resolve(e,t){return fl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>Ca.from(e,t,s)},nd={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,s,a){return t=Object.assign({actualString:!0},t),Hp(e,t,s,a)}},sd={identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Re(null),stringify:({source:e},t)=>typeof e=="string"&&sd.test.test(e)?e:t.options.nullStr},Kp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Re(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Kp.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(t===a)return e}return t?s.options.trueStr:s.options.falseStr}};function os({format:e,minFractionDigits:t,tag:s,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&t&&(!s||s==="tag:yaml.org,2002:float")&&/^\d/.test(c)){let d=c.indexOf(".");d<0&&(d=c.length,c+=".");let f=t-(c.length-d-1);for(;f-- >0;)c+="0"}return c}const AN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:os},ON={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():os(e)}},DN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new Re(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:os},id=e=>typeof e=="bigint"||Number.isInteger(e),Fp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function LN(e,t,s){const{value:a}=e;return id(a)&&a>=0?s+a.toString(t):os(e)}const MN={identify:e=>id(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Fp(e,2,8,s),stringify:e=>LN(e,8,"0o")},$N={identify:id,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Fp(e,0,10,s),stringify:os},UN={identify:e=>id(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Fp(e,2,16,s),stringify:e=>LN(e,16,"0x")},JM=[Hr,Gr,nd,sd,Kp,MN,$N,UN,AN,ON,DN];function Mb(e){return typeof e=="bigint"||Number.isInteger(e)}const Qc=({value:e})=>JSON.stringify(e),XM=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Qc},{identify:e=>e==null,createNode:()=>new Re(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Qc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Qc},{identify:Mb,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Mb(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Qc}],WM={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},e3=[Hr,Gr].concat(XM,WM),Zp={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:s},a,r,c){if(!s)return"";const d=s;let f;if(typeof btoa=="function"){let m="";for(let p=0;p<d.length;++p)m+=String.fromCharCode(d[p]);f=btoa(m)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=Re.BLOCK_LITERAL),t!==Re.QUOTE_DOUBLE){const m=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),p=Math.ceil(f.length/m),v=new Array(p);for(let y=0,x=0;y<p;++y,x+=m)v[y]=f.substr(x,m);f=v.join(t===Re.BLOCK_LITERAL?`
|
|
146
|
+
`:" ")}return Hp({comment:e,type:t,value:f},a,r,c)}};function PN(e,t){if(fl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!Dt(a)){if(dl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const r=a.items[0]||new hn(new Re(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
|
|
147
147
|
${r.key.commentBefore}`:a.commentBefore),a.comment){const c=r.value??r.key;c.comment=c.comment?`${a.comment}
|
|
148
|
-
${c.comment}`:a.comment}a=r}e.items[s]=
|
|
148
|
+
${c.comment}`:a.comment}a=r}e.items[s]=Dt(a)?a:new hn(a)}}else t("Expected a sequence for this tag");return e}function IN(e,t,s){const{replacer:a}=s,r=new Ca(e);r.tag="tag:yaml.org,2002:pairs";let c=0;if(t&&Symbol.iterator in Object(t))for(let d of t){typeof a=="function"&&(d=a.call(t,String(c++),d));let f,m;if(Array.isArray(d))if(d.length===2)f=d[0],m=d[1];else throw new TypeError(`Expected [key, value] tuple: ${d}`);else if(d&&d instanceof Object){const p=Object.keys(d);if(p.length===1)f=p[0],m=d[f];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else f=d;r.items.push(Gp(f,m,s))}return r}const Vp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:PN,createNode:IN};class Er extends Ca{constructor(){super(),this.add=Gn.prototype.add.bind(this),this.delete=Gn.prototype.delete.bind(this),this.get=Gn.prototype.get.bind(this),this.has=Gn.prototype.has.bind(this),this.set=Gn.prototype.set.bind(this),this.tag=Er.tag}toJSON(t,s){if(!s)return super.toJSON(t);const a=new Map;s?.onCreate&&s.onCreate(a);for(const r of this.items){let c,d;if(Dt(r)?(c=Kn(r.key,"",s),d=Kn(r.value,c,s)):c=Kn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,d)}return a}static from(t,s,a){const r=IN(t,s,a),c=new this;return c.items=r.items,c}}Er.tag="tag:yaml.org,2002:omap";const Qp={collection:"seq",identify:e=>e instanceof Map,nodeClass:Er,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=PN(e,t),a=[];for(const{key:r}of s.items)ft(r)&&(a.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new Er,s)},createNode:(e,t,s)=>Er.from(e,t,s)};function BN({value:e,source:t},s){return t&&(e?qN:HN).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const qN={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Re(!0),stringify:BN},HN={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Re(!1),stringify:BN},t3={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:os},n3={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():os(e)}},s3={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new Re(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(t.minFractionDigits=a.length)}return t},stringify:os},hl=e=>typeof e=="bigint"||Number.isInteger(e);function ad(e,t,s,{intAsBigInt:a}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const d=BigInt(e);return r==="-"?BigInt(-1)*d:d}const c=parseInt(e,s);return r==="-"?-1*c:c}function Yp(e,t,s){const{value:a}=e;if(hl(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return os(e)}const i3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>ad(e,2,2,s),stringify:e=>Yp(e,2,"0b")},a3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>ad(e,1,8,s),stringify:e=>Yp(e,8,"0")},r3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>ad(e,0,10,s),stringify:os},o3={identify:hl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>ad(e,2,16,s),stringify:e=>Yp(e,16,"0x")};class Rr extends Gn{constructor(t){super(t),this.tag=Rr.tag}add(t){let s;Dt(t)?s=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?s=new hn(t.key,null):s=new hn(t,null),va(this.items,s.key)||this.items.push(s)}get(t,s){const a=va(this.items,t);return!s&&Dt(a)?ft(a.key)?a.key.value:a.key:a}set(t,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=va(this.items,t);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new hn(t))}toJSON(t,s){return super.toJSON(t,s,Set)}toString(t,s,a){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(t,s,a){const{replacer:r}=a,c=new this(t);if(s&&Symbol.iterator in Object(s))for(let d of s)typeof r=="function"&&(d=r.call(s,d,d)),c.items.push(Gp(d,null,a));return c}}Rr.tag="tag:yaml.org,2002:set";const Jp={collection:"map",identify:e=>e instanceof Set,nodeClass:Rr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>Rr.from(e,t,s),resolve(e,t){if(dl(e)){if(e.hasAllNullValues(!0))return Object.assign(new Rr,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Xp(e,t){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,r=d=>t?BigInt(d):Number(d),c=a.replace(/_/g,"").split(":").reduce((d,f)=>d*r(60)+r(f),r(0));return s==="-"?r(-1)*c:c}function GN(e){let{value:t}=e,s=d=>d;if(typeof t=="bigint")s=d=>BigInt(d);else if(isNaN(t)||!isFinite(t))return os(e);let a="";t<0&&(a="-",t*=s(-1));const r=s(60),c=[t%r];return t<60?c.unshift(0):(t=(t-c[0])/r,c.unshift(t%r),t>=60&&(t=(t-c[0])/r,c.unshift(t))),a+c.map(d=>String(d).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const KN={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:s})=>Xp(e,s),stringify:GN},FN={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Xp(e,!1),stringify:GN},rd={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(rd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,d,f]=t.map(Number),m=t[7]?Number((t[7]+"00").substr(1,3)):0;let p=Date.UTC(s,a-1,r,c||0,d||0,f||0,m);const v=t[8];if(v&&v!=="Z"){let y=Xp(v,!1);Math.abs(y)<30&&(y*=60),p-=6e4*y}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},$b=[Hr,Gr,nd,sd,qN,HN,i3,a3,r3,o3,t3,n3,s3,Zp,Fs,Qp,Vp,Jp,KN,FN,rd],Ub=new Map([["core",JM],["failsafe",[Hr,Gr,nd]],["json",e3],["yaml11",$b],["yaml-1.1",$b]]),Pb={binary:Zp,bool:Kp,float:DN,floatExp:ON,floatNaN:AN,floatTime:FN,int:$N,intHex:UN,intOct:MN,intTime:KN,map:Hr,merge:Fs,null:sd,omap:Qp,pairs:Vp,seq:Gr,set:Jp,timestamp:rd},l3={"tag:yaml.org,2002:binary":Zp,"tag:yaml.org,2002:merge":Fs,"tag:yaml.org,2002:omap":Qp,"tag:yaml.org,2002:pairs":Vp,"tag:yaml.org,2002:set":Jp,"tag:yaml.org,2002:timestamp":rd};function Jh(e,t,s){const a=Ub.get(t);if(a&&!e)return s&&!a.includes(Fs)?a.concat(Fs):a.slice();let r=a;if(!r)if(Array.isArray(e))r=[];else{const c=Array.from(Ub.keys()).filter(d=>d!=="yaml11").map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)r=r.concat(c);else typeof e=="function"&&(r=e(r.slice()));return s&&(r=r.concat(Fs)),r.reduce((c,d)=>{const f=typeof d=="string"?Pb[d]:d;if(!f){const m=JSON.stringify(d),p=Object.keys(Pb).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${m}; use one of ${p}`)}return c.includes(f)||c.push(f),c},[])}const c3=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Wp{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(t)?Jh(t,"compat"):t?Jh(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?l3:{},this.tags=Jh(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,$i,{value:Hr}),Object.defineProperty(this,Ss,{value:nd}),Object.defineProperty(this,Br,{value:Gr}),this.sortMapEntries=typeof d=="function"?d:d===!0?c3:null}clone(){const t=Object.create(Wp.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function u3(e,t){const s=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const m=e.directives.toString(e);m?(s.push(m),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const r=zN(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const m=c(e.commentBefore);s.unshift(Ks(m,""))}let d=!1,f=null;if(e.contents){if(Ot(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(Ks(v,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const m=f?void 0:()=>d=!0;let p=Lr(e.contents,r,()=>f=null,m);f&&(p+=ya(p,"",c(f))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(Lr(e.contents,r));if(e.directives?.docEnd)if(e.comment){const m=c(e.comment);m.includes(`
|
|
149
149
|
`)?(s.push("..."),s.push(Ks(m,""))):s.push(`... ${m}`)}else s.push("...");else{let m=e.comment;m&&d&&(m=m.replace(/^\n+/,"")),m&&((!d||f)&&s[s.length-1]!==""&&s.push(""),s.push(Ks(c(m),"")))}return s.join(`
|
|
150
150
|
`)+`
|
|
151
|
-
`}class od{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Fn,{value:
|
|
151
|
+
`}class od{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Fn,{value:Pm});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:d}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(d=this.directives.yaml.version)):this.directives=new dn({version:d}),this.setSchema(d,a),this.contents=t===void 0?null:this.createNode(t,r,a)}clone(){const t=Object.create(od.prototype,{[Fn]:{value:Pm}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Ot(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){xr(this.contents)&&this.contents.add(t)}addIn(t,s){xr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=wN(this);t.anchor=!s||a.has(s)?NN(s||"a",a):s}return new qp(t.anchor)}createNode(t,s,a){let r;if(typeof s=="function")t=s.call({"":t},"",t),r=s;else if(Array.isArray(s)){const C=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=s.filter(C).map(String);k.length>0&&(s=s.concat(k)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:d,flow:f,keepUndefined:m,onTagObj:p,tag:v}=a??{},{onAnchor:y,setAnchors:x,sourceObjects:b}=$M(this,d||"a"),w={aliasDuplicateObjects:c??!0,keepUndefined:m??!1,onAnchor:y,onTagObj:p,replacer:r,schema:this.schema,sourceObjects:b},S=al(t,v,w);return f&&At(S)&&(S.flow=!0),x(),S}createPair(t,s,a={}){const r=this.createNode(t,null,a),c=this.createNode(s,null,a);return new hn(r,c)}delete(t){return xr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Go(t)?this.contents==null?!1:(this.contents=null,!0):xr(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return At(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return Go(t)?!s&&ft(this.contents)?this.contents.value:this.contents:At(this.contents)?this.contents.getIn(t,s):void 0}has(t){return At(this.contents)?this.contents.has(t):!1}hasIn(t){return Go(t)?this.contents!==void 0:At(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=zu(this.schema,[t],s):xr(this.contents)&&this.contents.set(t,s)}setIn(t,s){Go(t)?this.contents=s:this.contents==null?this.contents=zu(this.schema,Array.from(t),s):xr(this.contents)&&this.contents.setIn(t,s)}setSchema(t,s={}){typeof t=="number"&&(t=String(t));let a;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new dn({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new dn({version:t}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Wp(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:c,reviver:d}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},m=Kn(this.contents,s??"",f);if(typeof c=="function")for(const{count:p,res:v}of f.anchors.values())c(v,p);return typeof d=="function"?Cr(d,{"":m},"",m):m}toJSON(t,s){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:s})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const s=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return u3(this,t)}}function xr(e){if(At(e))return!0;throw new Error("Expected a YAML collection as document contents")}class ZN extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class Yc extends ZN{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class d3 extends ZN{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const Ib=(e,t)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(f=>t.linePos(f));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let c=r-1,d=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&d.length>80){const f=Math.min(c-39,d.length-79);d="…"+d.substring(f),c-=f-1}if(d.length>80&&(d=d.substring(0,79)+"…"),a>1&&/^ *$/.test(d.substring(0,c))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
|
|
152
152
|
`),d=f+d}if(/[^ ]/.test(d)){let f=1;const m=s.linePos[1];m?.line===a&&m.col>r&&(f=Math.max(1,Math.min(m.col-r,80-c)));const p=" ".repeat(c)+"^".repeat(f);s.message+=`:
|
|
153
153
|
|
|
154
154
|
${d}
|
|
155
155
|
${p}
|
|
156
|
-
`}};function Mr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let m=!1,p=f,v=f,y="",x="",b=!1,w=!1,S=null,C=null,k=null,E=null,R=null,_=null,
|
|
157
|
-
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const s of t.start)if(s.type==="newline")return!0;if(t.sep){for(const s of t.sep)if(s.type==="newline")return!0}if(rl(t.key)||rl(t.value))return!0}return!1;default:return!0}}function
|
|
158
|
-
`+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||rl(x))&&r(x??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&r(m,"BAD_INDENT",Bb);s.atKey=!0;const k=S.end,E=x?e(s,x,S,r):t(s,k,y,null,S,r);s.schema.compat&&
|
|
159
|
-
`+R.comment:E.comment=R.comment);const _=new hn(E);s.options.keepSourceTokens&&(_.srcToken=v),f.items.push(_)}}return p&&p<m&&r(p,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,m,p??m],f}function h3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Ca,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let m=a.offset,p=null;for(const{start:v,value:y}of a.items){const x=Mr(v,{indicator:"seq-item-ind",next:y,offset:m,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!x.found)if(x.anchor||x.tag||y)y?.type==="block-seq"?r(x.end,"BAD_INDENT","All sequence items must start at the same column"):r(m,"MISSING_CHAR","Sequence item without - indicator");else{p=x.end,x.comment&&(f.comment=x.comment);continue}const b=y?e(s,y,x,r):t(s,x.end,v,null,x,r);s.schema.compat&&
|
|
160
|
-
`+M.comment:p.comment=M.comment),y=M.end;continue}!d&&s.options.strict&&rl(R)&&r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)M.comma&&r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(M.comma||r(M.start,"MISSING_CHAR",`Missing , between ${f} items`),M.comment){let T="";e:for(const A of E)switch(A.type){case"comma":case"space":break;case"comment":T=A.source.substring(1);break e;default:break e}if(T){let A=p.items[p.items.length-1];
|
|
161
|
-
`+T:A.comment=T,M.comment=M.comment.substring(T.length+1)}}if(!d&&!_&&!M.found){const T=
|
|
156
|
+
`}};function Mr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:d,startOnNewline:f}){let m=!1,p=f,v=f,y="",x="",b=!1,w=!1,S=null,C=null,k=null,E=null,R=null,_=null,L=null;for(const A of e)switch(w&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&c(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),S&&(p&&A.type!=="comment"&&A.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),A.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&A.source.includes(" ")&&(S=A),v=!0;break;case"comment":{v||c(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const P=A.source.substring(1)||" ";y?y+=x+P:y=P,x="",p=!1;break}case"newline":p?y?y+=A.source:(!_||s!=="seq-item-ind")&&(m=!0):x+=A.source,p=!0,b=!0,(C||k)&&(E=A),v=!0;break;case"anchor":C&&c(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&c(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=A,L??(L=A.offset),p=!1,v=!1,w=!0;break;case"tag":{k&&c(A,"MULTIPLE_TAGS","A node can have at most one tag"),k=A,L??(L=A.offset),p=!1,v=!1,w=!0;break}case s:(C||k)&&c(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),_&&c(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${t??"collection"}`),_=A,p=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(t){R&&c(A,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),R=A,p=!1,v=!1;break}default:c(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),p=!1,v=!1}const M=e[e.length-1],T=M?M.offset+M.source.length:r;return w&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(p&&S.indent<=d||a?.type==="block-map"||a?.type==="block-seq")&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:R,found:_,spaceBefore:m,comment:y,hasNewline:b,anchor:C,tag:k,newlineAfterProp:E,end:T,start:L??T}}function rl(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
157
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const s of t.start)if(s.type==="newline")return!0;if(t.sep){for(const s of t.sep)if(s.type==="newline")return!0}if(rl(t.key)||rl(t.value))return!0}return!1;default:return!0}}function Hm(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&rl(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function VN(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,d)=>c===d||ft(c)&&ft(d)&&c.value===d.value;return t.some(c=>r(c.key,s))}const Bb="All mapping items must start at the same column";function f3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Gn,f=new d(s.schema);s.atRoot&&(s.atRoot=!1);let m=a.offset,p=null;for(const v of a.items){const{start:y,key:x,sep:b,value:w}=v,S=Mr(y,{indicator:"explicit-key-ind",next:x??b?.[0],offset:m,onError:r,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(x&&(x.type==="block-seq"?r(m,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==a.indent&&r(m,"BAD_INDENT",Bb)),!S.anchor&&!S.tag&&!b){p=S.end,S.comment&&(f.comment?f.comment+=`
|
|
158
|
+
`+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||rl(x))&&r(x??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&r(m,"BAD_INDENT",Bb);s.atKey=!0;const k=S.end,E=x?e(s,x,S,r):t(s,k,y,null,S,r);s.schema.compat&&Hm(a.indent,x,r),s.atKey=!1,VN(s,f.items,E)&&r(k,"DUPLICATE_KEY","Map keys must be unique");const R=Mr(b??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:r,parentIndent:a.indent,startOnNewline:!x||x.type==="block-scalar"});if(m=R.end,R.found){C&&(w?.type==="block-map"&&!R.hasNewline&&r(m,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<R.found.offset-1024&&r(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const _=w?e(s,w,R,r):t(s,m,b,null,R,r);s.schema.compat&&Hm(a.indent,w,r),m=_.range[2];const L=new hn(E,_);s.options.keepSourceTokens&&(L.srcToken=v),f.items.push(L)}else{C&&r(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),R.comment&&(E.comment?E.comment+=`
|
|
159
|
+
`+R.comment:E.comment=R.comment);const _=new hn(E);s.options.keepSourceTokens&&(_.srcToken=v),f.items.push(_)}}return p&&p<m&&r(p,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,m,p??m],f}function h3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=c?.nodeClass??Ca,f=new d(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let m=a.offset,p=null;for(const{start:v,value:y}of a.items){const x=Mr(v,{indicator:"seq-item-ind",next:y,offset:m,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!x.found)if(x.anchor||x.tag||y)y?.type==="block-seq"?r(x.end,"BAD_INDENT","All sequence items must start at the same column"):r(m,"MISSING_CHAR","Sequence item without - indicator");else{p=x.end,x.comment&&(f.comment=x.comment);continue}const b=y?e(s,y,x,r):t(s,x.end,v,null,x,r);s.schema.compat&&Hm(a.indent,y,r),m=b.range[2],f.items.push(b)}return f.range=[a.offset,m,p??m],f}function ml(e,t,s,a){let r="";if(e){let c=!1,d="";for(const f of e){const{source:m,type:p}=f;switch(p){case"space":c=!0;break;case"comment":{s&&!c&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=m.substring(1)||" ";r?r+=d+v:r=v,d="";break}case"newline":r&&(d+=m),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}t+=m.length}}return{comment:r,offset:t}}const Xh="Block collections are not allowed within flow collections",Wh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function m3({composeNode:e,composeEmptyNode:t},s,a,r,c){const d=a.start.source==="{",f=d?"flow map":"flow sequence",m=c?.nodeClass??(d?Gn:Ca),p=new m(s.schema);p.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let y=a.offset+a.start.source.length;for(let C=0;C<a.items.length;++C){const k=a.items[C],{start:E,key:R,sep:_,value:L}=k,M=Mr(E,{flow:f,indicator:"explicit-key-ind",next:R??_?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!M.found){if(!M.anchor&&!M.tag&&!_&&!L){C===0&&M.comma?r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r(M.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),M.comment&&(p.comment?p.comment+=`
|
|
160
|
+
`+M.comment:p.comment=M.comment),y=M.end;continue}!d&&s.options.strict&&rl(R)&&r(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)M.comma&&r(M.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if(M.comma||r(M.start,"MISSING_CHAR",`Missing , between ${f} items`),M.comment){let T="";e:for(const A of E)switch(A.type){case"comma":case"space":break;case"comment":T=A.source.substring(1);break e;default:break e}if(T){let A=p.items[p.items.length-1];Dt(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
161
|
+
`+T:A.comment=T,M.comment=M.comment.substring(T.length+1)}}if(!d&&!_&&!M.found){const T=L?e(s,L,M,r):t(s,M.end,_,null,M,r);p.items.push(T),y=T.range[2],Wh(L)&&r(T.range,"BLOCK_IN_FLOW",Xh)}else{s.atKey=!0;const T=M.end,A=R?e(s,R,M,r):t(s,T,E,null,M,r);Wh(R)&&r(A.range,"BLOCK_IN_FLOW",Xh),s.atKey=!1;const P=Mr(_??[],{flow:f,indicator:"map-value-ind",next:L,offset:A.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(P.found){if(!d&&!M.found&&s.options.strict){if(_)for(const se of _){if(se===P.found)break;if(se.type==="newline"){r(se,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}M.start<P.found.offset-1024&&r(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source?.[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${f}`):r(P.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const J=L?e(s,L,P,r):P.found?t(s,P.end,_,null,P,r):null;J?Wh(L)&&r(J.range,"BLOCK_IN_FLOW",Xh):P.comment&&(A.comment?A.comment+=`
|
|
162
162
|
`+P.comment:A.comment=P.comment);const Q=new hn(A,J);if(s.options.keepSourceTokens&&(Q.srcToken=k),d){const se=p;VN(s,se.items,A)&&r(T,"DUPLICATE_KEY","Map keys must be unique"),se.items.push(Q)}else{const se=new Gn(s.schema);se.flow=!0,se.items.push(Q);const pe=(J??A).range;se.range=[A.range[0],pe[1],pe[2]],p.items.push(se)}y=J?J.range[2]:P.end}}const x=d?"}":"]",[b,...w]=a.end;let S=y;if(b?.source===x)S=b.offset+b.source.length;else{const C=f[0].toUpperCase()+f.substring(1),k=v?`${C} must end with a ${x}`:`${C} in block collection must be sufficiently indented and end with a ${x}`;r(y,v?"MISSING_CHAR":"BAD_INDENT",k),b&&b.source.length!==1&&w.unshift(b)}if(w.length>0){const C=ml(w,S,s.options.strict,r);C.comment&&(p.comment?p.comment+=`
|
|
163
|
-
`+C.comment:p.comment=C.comment),p.range=[a.offset,S,C.offset]}else p.range=[a.offset,S,S];return p}function
|
|
163
|
+
`+C.comment:p.comment=C.comment),p.range=[a.offset,S,C.offset]}else p.range=[a.offset,S,S];return p}function em(e,t,s,a,r,c){const d=s.type==="block-map"?f3(e,t,s,a,c):s.type==="block-seq"?h3(e,t,s,a,c):m3(e,t,s,a,c),f=d.constructor;return r==="!"||r===f.tagName?(d.tag=f.tagName,d):(r&&(d.tag=r),d)}function p3(e,t,s,a,r){const c=a.tag,d=c?t.directives.tagName(c.source,x=>r(c,"TAG_RESOLVE_FAILED",x)):null;if(s.type==="block-seq"){const{anchor:x,newlineAfterProp:b}=a,w=x&&c?x.offset>c.offset?x:c:x??c;w&&(!b||b.offset<w.offset)&&r(w,"MISSING_CHAR","Missing newline after block sequence props")}const f=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!d||d==="!"||d===Gn.tagName&&f==="map"||d===Ca.tagName&&f==="seq")return em(e,t,s,r,d);let m=t.schema.tags.find(x=>x.tag===d&&x.collection===f);if(!m){const x=t.schema.knownTags[d];if(x?.collection===f)t.schema.tags.push(Object.assign({},x,{default:!1})),m=x;else return x?r(c,"BAD_COLLECTION_TYPE",`${x.tag} used for ${f} collection, but expects ${x.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${d}`,!0),em(e,t,s,r,d)}const p=em(e,t,s,r,d,m),v=m.resolve?.(p,x=>r(c,"TAG_RESOLVE_FAILED",x),t.options)??p,y=Ot(v)?v:new Re(v);return y.range=p.range,y.tag=d,m?.format&&(y.format=m.format),y}function g3(e,t,s){const a=t.offset,r=y3(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Re.BLOCK_FOLDED:Re.BLOCK_LITERAL,d=t.source?v3(t.source):[];let f=d.length;for(let S=d.length-1;S>=0;--S){const C=d[S][1];if(C===""||C==="\r")f=S;else break}if(f===0){const S=r.chomp==="+"&&d.length>0?`
|
|
164
164
|
`.repeat(Math.max(1,d.length-1)):"";let C=a+r.length;return t.source&&(C+=t.source.length),{value:S,type:c,comment:r.comment,range:[a,C,C]}}let m=t.indent+r.indent,p=t.offset+r.length,v=0;for(let S=0;S<f;++S){const[C,k]=d[S];if(k===""||k==="\r")r.indent===0&&C.length>m&&(m=C.length);else{C.length<m&&s(p+C.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(m=C.length),v=S,m===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=C.length+k.length+1}for(let S=d.length-1;S>=f;--S)d[S][0].length>m&&(f=S+1);let y="",x="",b=!1;for(let S=0;S<v;++S)y+=d[S][0].slice(m)+`
|
|
165
165
|
`;for(let S=v;S<f;++S){let[C,k]=d[S];p+=C.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&C.length<m){const _=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(p-k.length-(E?2:1),"BAD_INDENT",_),C=""}c===Re.BLOCK_LITERAL?(y+=x+C.slice(m)+k,x=`
|
|
166
166
|
`):C.length>m||k[0]===" "?(x===" "?x=`
|
|
@@ -190,33 +190,33 @@ ${p}
|
|
|
190
190
|
`);)a===`
|
|
191
191
|
`&&(s+=`
|
|
192
192
|
`),t+=1,a=e[t+1];return s||(s=" "),{fold:s,offset:t}}const N3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function C3(e,t,s,a){const r=e.substr(t,s),d=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(d)){const f=e.substr(t-2,s+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(d)}function YN(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?g3(e,t,a):x3(t,e.options.strict,a),m=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[Ss]:m?p=k3(e.schema,r,m,s,a):t.type==="scalar"?p=_3(e,r,t,a):p=e.schema[Ss];let v;try{const y=p.resolve(r,x=>a(s??t,"TAG_RESOLVE_FAILED",x),e.options);v=ft(y)?y:new Re(y)}catch(y){const x=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",x),v=new Re(r)}return v.range=f,v.source=r,c&&(v.type=c),m&&(v.tag=m),p.format&&(v.format=p.format),d&&(v.comment=d),v}function k3(e,t,s,a,r){if(s==="!")return e[Ss];const c=[];for(const f of e.tags)if(!f.collection&&f.tag===s)if(f.default&&f.test)c.push(f);else return f;for(const f of c)if(f.test?.test(t))return f;const d=e.knownTags[s];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[Ss])}function _3({atKey:e,directives:t,schema:s},a,r,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[Ss];if(s.compat){const f=s.compat.find(m=>m.default&&m.test?.test(a))??s[Ss];if(d.tag!==f.tag){const m=t.tagString(d.tag),p=t.tagString(f.tag),v=`Value may be parsed as either ${m} or ${p}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return d}function z3(e,t,s){if(t){s??(s=t.length);for(let a=s-1;a>=0;--a){let r=t[a];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++a];r?.type==="space";)e+=r.source.length,r=t[++a];break}}return e}const E3={composeNode:JN,composeEmptyNode:
|
|
193
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function C3(e,t,s,a){const r=e.substr(t,s),d=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(d)){const f=e.substr(t-2,s+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(d)}function YN(e,t,s,a){const{value:r,type:c,comment:d,range:f}=t.type==="block-scalar"?g3(e,t,a):x3(t,e.options.strict,a),m=s?e.directives.tagName(s.source,y=>a(s,"TAG_RESOLVE_FAILED",y)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[Ss]:m?p=k3(e.schema,r,m,s,a):t.type==="scalar"?p=_3(e,r,t,a):p=e.schema[Ss];let v;try{const y=p.resolve(r,x=>a(s??t,"TAG_RESOLVE_FAILED",x),e.options);v=ft(y)?y:new Re(y)}catch(y){const x=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",x),v=new Re(r)}return v.range=f,v.source=r,c&&(v.type=c),m&&(v.tag=m),p.format&&(v.format=p.format),d&&(v.comment=d),v}function k3(e,t,s,a,r){if(s==="!")return e[Ss];const c=[];for(const f of e.tags)if(!f.collection&&f.tag===s)if(f.default&&f.test)c.push(f);else return f;for(const f of c)if(f.test?.test(t))return f;const d=e.knownTags[s];return d&&!d.collection?(e.tags.push(Object.assign({},d,{default:!1,test:void 0})),d):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[Ss])}function _3({atKey:e,directives:t,schema:s},a,r,c){const d=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[Ss];if(s.compat){const f=s.compat.find(m=>m.default&&m.test?.test(a))??s[Ss];if(d.tag!==f.tag){const m=t.tagString(d.tag),p=t.tagString(f.tag),v=`Value may be parsed as either ${m} or ${p}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return d}function z3(e,t,s){if(t){s??(s=t.length);for(let a=s-1;a>=0;--a){let r=t[a];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++a];r?.type==="space";)e+=r.source.length,r=t[++a];break}}return e}const E3={composeNode:JN,composeEmptyNode:eg};function JN(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:d,anchor:f,tag:m}=s;let p,v=!0;switch(t.type){case"alias":p=R3(e,t,a),(f||m)&&a(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=YN(e,t,m,a),f&&(p.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":p=p3(E3,e,t,s,a),f&&(p.anchor=f.source.substring(1));break;default:{const y=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;a(t,"UNEXPECTED_TOKEN",y),p=eg(e,t.offset,void 0,null,s,a),v=!1}}return f&&p.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!ft(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&a(m??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(p.spaceBefore=!0),d&&(t.type==="scalar"&&t.source===""?p.comment=d:p.commentBefore=d),e.options.keepSourceTokens&&v&&(p.srcToken=t),p}function eg(e,t,s,a,{spaceBefore:r,comment:c,anchor:d,tag:f,end:m},p){const v={type:"scalar",offset:z3(t,s,a),indent:-1,source:""},y=YN(e,v,f,p);return d&&(y.anchor=d.source.substring(1),y.anchor===""&&p(d,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=m),y}function R3({options:e},{offset:t,source:s,end:a},r){const c=new qp(s.substring(1));c.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&r(t+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const d=t+s.length,f=ml(a,d,e.strict,r);return c.range=[t,d,f.offset],f.comment&&(c.comment=f.comment),c}function T3(e,t,{offset:s,start:a,value:r,end:c},d){const f=Object.assign({_directives:t},e),m=new od(void 0,f),p={atKey:!1,atRoot:!0,directives:m.directives,options:m.options,schema:m.schema},v=Mr(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:d,parentIndent:0,startOnNewline:!0});v.found&&(m.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&d(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),m.contents=r?JN(p,r,v,d):eg(p,v.end,a,null,v,d);const y=m.contents.range[2],x=ml(c,y,!1,d);return x.comment&&(m.comment=x.comment),m.range=[s,y,x.offset],m}function qo(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:s}=e;return[t,t+(typeof s=="string"?s.length:1)]}function qb(e){let t="",s=!1,a=!1;for(let r=0;r<e.length;++r){const c=e[r];switch(c[0]){case"#":t+=(t===""?"":a?`
|
|
194
194
|
|
|
195
195
|
`:`
|
|
196
196
|
`)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[r+1]?.[0]!=="#"&&(r+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:t,afterEmptyLine:a}}class A3{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const d=qo(s);c?this.warnings.push(new d3(d,a,r)):this.errors.push(new Yc(d,a,r))},this.directives=new dn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=qb(this.prelude);if(a){const c=t.contents;if(s)t.comment=t.comment?`${t.comment}
|
|
197
|
-
${a}`:a;else if(r||t.directives.docStart||!c)t.commentBefore=a;else if(At(c)&&!c.flow&&c.items.length>0){let d=c.items[0];
|
|
197
|
+
${a}`:a;else if(r||t.directives.docStart||!c)t.commentBefore=a;else if(At(c)&&!c.flow&&c.items.length>0){let d=c.items[0];Dt(d)&&(d=d.key);const f=d.commentBefore;d.commentBefore=f?`${a}
|
|
198
198
|
${f}`:a}else{const d=c.commentBefore;c.commentBefore=d?`${a}
|
|
199
199
|
${d}`:a}}s?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:qb(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,s=!1,a=-1){for(const r of t)yield*this.next(r);yield*this.end(s,a)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(s,a,r)=>{const c=qo(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=T3(this.options,this.directives,t,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const s=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,a=new Yc(qo(t),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Yc(qo(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=ml(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
|
|
200
|
-
${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Yc(qo(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const a=Object.assign({_directives:this.directives},this.options),r=new od(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}const XN="\uFEFF",WN="",e1="",
|
|
200
|
+
${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new Yc(qo(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const a=Object.assign({_directives:this.directives},this.options),r=new od(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}const XN="\uFEFF",WN="",e1="",Gm="";function O3(e){switch(e){case XN:return"byte-order-mark";case WN:return"doc-mode";case e1:return"flow-error-end";case Gm:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
201
201
|
`:case`\r
|
|
202
202
|
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ns(e){switch(e){case void 0:case" ":case`
|
|
203
|
-
`:case"\r":case" ":return!0;default:return!1}}const Hb=new Set("0123456789ABCDEFabcdef"),
|
|
204
|
-
\r `),
|
|
203
|
+
`:case"\r":case" ":return!0;default:return!1}}const Hb=new Set("0123456789ABCDEFabcdef"),D3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Jc=new Set(",[]{}"),L3=new Set(` ,[]{}
|
|
204
|
+
\r `),tm=e=>!e||L3.has(e);class M3{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,s=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let t=this.pos,s=this.buffer[t];for(;s===" "||s===" ";)s=this.buffer[++t];return!s||s==="#"||s===`
|
|
205
205
|
`?!0:s==="\r"?this.buffer[t+1]===`
|
|
206
206
|
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let s=this.buffer[t];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+t];if(s==="\r"){const r=this.buffer[a+t+1];if(r===`
|
|
207
207
|
`||!r&&!this.atEnd)return t+a+1}return s===`
|
|
208
208
|
`||a>=this.indentNext||!s&&!this.atEnd?t+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(t,3);if((a==="---"||a==="...")&&ns(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
209
|
-
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===XN&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let s=t.length,a=t.indexOf("#");for(;a!==-1;){const c=t[a-1];if(c===" "||c===" "){s=a-1;break}else a=t.indexOf("#",a+1)}for(;;){const c=t[s-1];if(c===" "||c===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-s),yield*this.pushNewline(),"stream"}return yield WN,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&ns(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ns(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ns(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(t[s]){case"#":yield*this.pushCount(t.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(
|
|
209
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===XN&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let s=t.length,a=t.indexOf("#");for(;a!==-1;){const c=t[a-1];if(c===" "||c===" "){s=a-1;break}else a=t.indexOf("#",a+1)}for(;;){const c=t[s-1];if(c===" "||c===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-s),yield*this.pushNewline(),"stream"}return yield WN,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&ns(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ns(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ns(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(t[s]){case"#":yield*this.pushCount(t.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(tm),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,s,a=-1;do t=yield*this.pushNewline(),t>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(t+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&ns(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield e1,yield*this.parseLineStart();let c=0;for(;r[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),r[c]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-c),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(tm),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const d=this.charAt(1);if(this.flowKey||ns(d)||d===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let s=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
|
|
210
210
|
`,this.pos);if(r!==-1){for(;r!==-1;){const c=this.continueScalar(r+1);if(c===-1)break;r=a.indexOf(`
|
|
211
211
|
`,c)}r!==-1&&(s=r-(a[r-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const s=this.buffer[++t];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>ns(s)||s==="#")}*parseBlockScalar(){let t=this.pos-1,s=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
|
|
212
212
|
`:t=c,s=0;break;case"\r":{const d=this.buffer[c+1];if(!d&&!this.atEnd)return this.setNext("block-scalar");if(d===`
|
|
213
213
|
`)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const c=this.continueScalar(t+1);if(c===-1)break;t=this.buffer.indexOf(`
|
|
214
214
|
`,c)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
215
215
|
`;)a=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let c=t-1,d=this.buffer[c];d==="\r"&&(d=this.buffer[--c]);const f=c;for(;d===" ";)d=this.buffer[--c];if(d===`
|
|
216
|
-
`&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield
|
|
216
|
+
`&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield Gm,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const c=this.buffer[a+1];if(ns(c)||t&&Jc.has(c))break;s=a}else if(ns(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
|
|
217
217
|
`?(a+=1,r=`
|
|
218
218
|
`,c=this.buffer[a+1]):s=a),c==="#"||t&&Jc.has(c))break;if(r===`
|
|
219
|
-
`){const d=this.continueScalar(a+1);if(d===-1)break;a=Math.max(a,d-2)}}else{if(t&&Jc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield
|
|
219
|
+
`){const d=this.continueScalar(a+1);if(d===-1)break;a=Math.max(a,d-2)}}else{if(t&&Jc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Gm,yield*this.pushToIndex(s+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,s){const a=this.buffer.slice(this.pos,t);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(tm))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(ns(s)||t&&Jc.has(s))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,s=this.buffer[t];for(;!ns(s)&&s!==">";)s=this.buffer[++t];return yield*this.pushToIndex(s===">"?t+1:t,!1)}else{let t=this.pos+1,s=this.buffer[t];for(;s;)if(D3.has(s))s=this.buffer[++t];else if(s==="%"&&Hb.has(this.buffer[t+1])&&Hb.has(this.buffer[t+2]))s=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
220
220
|
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
221
221
|
`?yield*this.pushCount(2):0}*pushSpaces(t){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||t&&a===" ");const r=s-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=s),r}*pushUntil(t){let s=this.pos,a=this.buffer[s];for(;!t(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class $3{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<t?s=c+1:a=c}if(this.lineStarts[s]===t)return{line:s+1,col:1};if(s===0)return{line:0,col:t};const r=this.lineStarts[s-1];return{line:s,col:t-r+1}}}}function zi(e,t){for(let s=0;s<e.length;++s)if(e[s].type===t)return!0;return!1}function Gb(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function t1(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Xc(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function br(e){if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function Kb(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!zi(t.start,"explicit-key-ind")&&!zi(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,t1(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class U3{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new M3,this.onNewLine=t}*parse(t,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(t,s))yield*this.next(a);s||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const s=O3(t);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const a=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&t?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const s=t??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&Kb(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=s;else{Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:s}):r.value=s;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:s,sep:[]}):r.sep?r.value=s:Object.assign(r,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const r=s.items[s.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Gb(r.start)===-1&&(s.indent===0||r.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Gb(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const s=Xc(this.peek(2)),a=br(s);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
|
|
222
222
|
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
@@ -230,17 +230,17 @@ spec:
|
|
|
230
230
|
canonicalDomain: example.com
|
|
231
231
|
country: US
|
|
232
232
|
language: en
|
|
233
|
-
keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>o.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>o.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),o.jsx("div",{className:"mt-3",children:o.jsx(ce,{type:"button",disabled:!t.trim()||a,onClick:p,children:a?"Applying...":"Apply"})})]})}function q3(){const{dashboard:e,isLoading:t,refetch:s}=Ra();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-28"}),o.jsx("div",{className:"skeleton-text-sm w-40"})]}),o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[o.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(T=>o.jsx("div",{className:"skeleton-text-sm w-16"},T))}),[1,2,3].map(T=>o.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"skeleton-text-sm w-16"})]}),o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),o.jsx("div",{className:"skeleton-text-sm w-8"})]},T))]})]});const a=e.projects,r=ka(),[c,d]=N.useState(!1),[f,m]=N.useState(""),[p,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState("US"),[S,C]=N.useState("en"),[k,E]=N.useState(!1),[R,_]=N.useState(null),D=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),M=async()=>{if(!(!D||!y)){E(!0),_(null);try{const T=await ll(D,{displayName:p||f,canonicalDomain:y,country:b,language:S});s(),m(""),v(""),x(""),w("US"),C("en"),d(!1),r({to:"/projects/$projectId",params:{projectId:T.id}})}catch(T){_(T instanceof Error?T.message:"Failed to create project")}finally{E(!1)}}};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Projects"}),o.jsxs("p",{className:"page-subtitle",children:[a.length," project",a.length!==1?"s":""," tracked"]})]}),o.jsx("div",{className:"page-header-right",children:o.jsxs(ce,{type:"button",onClick:()=>d(T=>!T),children:[o.jsx(Mx,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?o.jsxs(Le,{className:"surface-card mb-6",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),o.jsxs("div",{className:"compact-stack mt-4",children:[o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),o.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:f,onChange:T=>m(T.target.value)}),D&&D!==f?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",D]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),o.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:T=>v(T.target.value)})]})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),o.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:y,onChange:T=>x(T.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),o.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:b,onChange:T=>w(T.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),o.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:T=>C(T.target.value.toLowerCase())})]})]})]}),R?o.jsx("p",{className:"text-rose-400 text-sm mt-3",children:R}):null,o.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[o.jsx(ce,{type:"button",disabled:!D||!y||k,onClick:M,children:k?"Creating...":"Create project"}),o.jsx(ce,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,a.length>0?o.jsx("div",{className:"data-table-wrapper",children:o.jsxs("table",{className:"data-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Visibility"}),o.jsx("th",{children:"Last run"}),o.jsx("th",{className:"text-right",children:"Country"})]})}),o.jsx("tbody",{children:a.map(T=>{const A=T.recentRuns[0];return o.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:T.project.id}}),children:[o.jsxs("td",{children:[o.jsx(yt,{to:"/projects/$projectId",params:{projectId:T.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:P=>P.stopPropagation(),children:T.project.displayName||T.project.name}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:T.project.name})]}),o.jsx("td",{className:"text-zinc-400",children:T.project.canonicalDomain}),o.jsx("td",{children:o.jsx(nt,{tone:T.visibilitySummary.tone,children:T.visibilitySummary.value})}),o.jsx("td",{className:"text-zinc-500 text-sm",children:A?o.jsx(Pu,{status:A.status}):o.jsx("span",{className:"text-zinc-600",children:"No runs"})}),o.jsx("td",{className:"text-right text-zinc-500",children:T.project.country})]},T.project.id)})})]})}):c?null:o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h3",{children:"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),o.jsxs(ce,{type:"button",onClick:()=>d(!0),children:[o.jsx(Mx,{className:"size-4 mr-1.5"}),"Add project"]})]}),o.jsx(B3,{onApplied:()=>{s()}})]})}function bs({text:e}){return o.jsxs("span",{className:"info-tooltip-wrapper",children:[o.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),o.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function n1({run:e}){const{openRun:t}=ul();return o.jsxs("article",{className:"run-row",children:[o.jsxs("div",{className:"run-row-main",children:[o.jsxs("div",{className:"run-row-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:e.summary}),o.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),o.jsx(Pu,{status:e.status})]}),o.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),o.jsxs("dl",{className:"run-row-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:e.startedAt})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Duration"}),o.jsx("dd",{children:e.duration})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Trigger"}),o.jsx("dd",{children:e.triggerLabel})]})]}),o.jsx(ce,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function s1({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0,progress:f}){const v=2*Math.PI*48,y=Number.parseInt(e,10),x=typeof f=="number"&&Number.isFinite(f)?Math.min(Math.max(f,0),1):d&&!Number.isNaN(y)?Math.min(y/100,1):.5,b=v*(1-x);return o.jsxs("div",{className:"score-gauge",children:[o.jsxs("div",{className:"gauge-ring-wrapper",children:[o.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[o.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),o.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:v,strokeDashoffset:b,transform:"rotate(-90 60 60)"})]}),o.jsx("div",{className:"gauge-center",children:o.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),o.jsxs("p",{className:"gauge-label",children:[t,c&&o.jsx(bs,{text:c})]}),o.jsx("p",{className:"gauge-delta",children:s}),o.jsx("p",{className:"gauge-description",children:r})]})}function Fb({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return o.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const a={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},r=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(s[s.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:r}),o.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,f)=>o.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[d.citationState]??"bg-zinc-700"} ${d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[d.citationState,new Date(d.createdAt).toLocaleDateString(),d.model?`model ${d.model}`:null,d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"model changed":null].filter(Boolean).join(" — ")},f))}),o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function H3(e){const t=new Map;for(const a of e)for(const r of a.runHistory){const c=t.get(r.createdAt);c?c.states.push(r.citationState):t.set(r.createdAt,{states:[r.citationState],runId:r.runId})}return[...t.entries()].sort(([a],[r])=>a.localeCompare(r)).map(([a,{states:r,runId:c}])=>({runId:c,createdAt:a,citationState:r.includes("cited")?"cited":r.includes("emerging")?"emerging":"not-cited"}))}function G3({evidence:e}){const{openEvidence:t}=ul(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const m=d.get(f.keyword)??[];d.set(f.keyword,[...m,f])}return[...d.entries()].map(([f,m])=>({phrase:f,items:m}))},[e]),c=d=>{a(f=>{const m=new Set(f);return m.has(d)?m.delete(d):m.add(d),m})};return o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{width:"2rem"}}),o.jsx("th",{children:"Key Phrase"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Citation History"}),o.jsx("th",{children:"Change"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:r.map(({phrase:d,items:f})=>{const m=s.has(d),p=f.map(w=>w.citationState),v=p.includes("cited")?"cited":p.includes("emerging")?"emerging":p.includes("lost")?"lost":p.every(w=>w==="pending")?"pending":"not-cited",y=H3(f),x=f.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,b=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const w=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===w;k--)C++;return w==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return o.jsxs(N.Fragment,{children:[o.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":m,children:[o.jsx("td",{children:o.jsx(Mu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${m?"rotate-90":""}`})}),o.jsx("td",{className:"evidence-keyword-cell",children:o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-zinc-100",children:d}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(w=>o.jsx(tl,{provider:w.provider},w.id))})]})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(zm,{state:v}),o.jsxs("span",{className:"text-[11px] text-zinc-500",children:[x,"/",f.length]})]})}),o.jsx("td",{children:o.jsx(Fb,{history:y})}),o.jsx("td",{className:"evidence-change-cell",children:b}),o.jsx("td",{})]}),m&&f.map(w=>o.jsxs("tr",{className:"bg-zinc-900/30",children:[o.jsx("td",{}),o.jsx("td",{className:"evidence-keyword-cell pl-5",children:o.jsx(tl,{provider:w.provider})}),o.jsx("td",{children:o.jsx(zm,{state:w.citationState})}),o.jsx("td",{children:o.jsx(Fb,{history:w.runHistory})}),o.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),o.jsx("td",{children:o.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},d)})})]})})}function K3({competitors:e}){return e.length===0?o.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):o.jsx("div",{className:"competitor-table-wrap",children:o.jsxs("table",{className:"competitor-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Pressure"}),o.jsx("th",{children:"Citations"}),o.jsx("th",{children:"Key Phrases"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),o.jsx("td",{children:o.jsx(nt,{tone:KE(t.pressureLabel),children:t.pressureLabel})}),o.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),o.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const F3=["7d","30d","90d","all"],Z3=["gap","cited","uncited"],i1={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"};function V3({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,m]=N.useState(null),[p,v]=N.useState(null),[y,x]=N.useState(!0);return N.useEffect(()=>{let b=!1;return x(!0),Promise.all([lN(e,t),cN(e,t),uN(e,t)]).then(([w,S,C])=>{b||(r(w),d(S),m(C),x(!1))}).catch(()=>{b||x(!1)}),()=>{b=!0}},[e,t]),y&&!a?o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):o.jsxs(o.Fragment,{children:[o.jsxs("section",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",o.jsx(bs,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),o.jsx("div",{className:"flex gap-1",children:F3.map(b=>o.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===b?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>s(b),children:b==="all"?"All":b},b))})]}),a&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx(s1,{value:`${Math.round(a.overall.citationRate*100)}`,label:"Citation Rate",delta:`${a.overall.cited} / ${a.overall.total}`,tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",description:`Trend: ${a.trend}`,isNumeric:!0}),o.jsxs("div",{className:"flex-1 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),o.jsx(nt,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),o.jsx("tbody",{children:Object.entries(a.byProvider).map(([b,w])=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300",children:b}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(w.citationRate*100).toFixed(1),"%"]}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[w.cited," / ",w.total]})]},b))})]})]})]}),a.buckets.length>=1&&o.jsx(Q3,{buckets:a.buckets,keywordChanges:a.keywordChanges??[]})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsx("div",{className:"flex items-center justify-between mb-4",children:o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",o.jsx(bs,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex gap-1 mb-4",children:Z3.map(b=>{const w=b==="cited"?c.cited.length:b==="gap"?c.gap.length:c.uncited.length,S=p===b;return o.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?b==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":b==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>v(S?null:b),children:[b==="gap"?"Gap":b==="cited"?"Cited":"Not Cited"," (",w,")"]},b)})}),o.jsx(Y3,{gaps:c,filter:p})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",o.jsx(bs,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&o.jsxs("div",{className:"space-y-4",children:[o.jsx(J3,{categories:f.overall}),o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),o.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),o.jsx("tbody",{children:f.overall.map(b=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[o.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${i1[b.category]??"bg-zinc-600"}`}),b.label]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:b.count}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(b.percentage*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:b.topDomains.slice(0,3).map(w=>w.domain).join(", ")})]},b.category))})]})]}),f&&f.overall.length===0&&o.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function Q3({buckets:e,keywordChanges:t}){const[s,a]=N.useState(null),r=600,c=140,d={top:30,right:10,bottom:20,left:40},f=r-d.left-d.right,m=c-d.top-d.bottom,p=1,v=e.map((b,w)=>{const S=d.left+(e.length>1?w/(e.length-1)*f:f/2),C=d.top+m-b.citationRate/p*m;return{x:S,y:C}}),y=N.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const b=new Date(e[0].startDate).getTime(),S=new Date(e[e.length-1].startDate).getTime()-b;return S<=0?[]:t.map(C=>{const E=(new Date(C.date).getTime()-b)/S;return E<0||E>1?null:{...C,x:d.left+E*f}}).filter(C=>C!==null)},[e,t,d.left,f]),x=v.map(b=>`${b.x},${b.y}`).join(" ");return o.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[o.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),o.jsxs("svg",{viewBox:`0 0 ${r} ${c}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>a(null),children:[o.jsxs("text",{x:d.left-4,y:d.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),o.jsx("text",{x:d.left-4,y:d.top+m+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),o.jsx("line",{x1:d.left,y1:d.top+m,x2:d.left+f,y2:d.top+m,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),o.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:x}),y.map((b,w)=>o.jsxs("g",{children:[o.jsx("line",{x1:b.x,y1:d.top,x2:b.x,y2:d.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),o.jsx("text",{x:b.x,y:d.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:b.label})]},`kw-change-${w}`)),s!==null&&o.jsx("line",{x1:v[s].x,y1:d.top,x2:v[s].x,y2:d.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((b,w)=>{const{x:S,y:C}=v[w],k=s===w;return o.jsxs("g",{children:[o.jsx("circle",{cx:S,cy:C,r:"10",fill:"transparent",onMouseEnter:()=>a(w),style:{cursor:"pointer"}}),o.jsx("circle",{cx:S,cy:C,r:k?5:3,className:k?"fill-emerald-400":"fill-emerald-500"})]},w)}),s!==null&&(()=>{const b=e[s],{x:w,y:S}=v[s],C=`${(b.citationRate*100).toFixed(1)}%`,k=b.keywordCount?`${b.keywordCount} kp`:"",E=56,R=30,_=Math.max(d.left,Math.min(w-E/2,r-d.right-E)),D=S-R-8;return o.jsxs("g",{children:[o.jsx("rect",{x:_,y:D,width:E,height:R,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),o.jsx("text",{x:_+E/2,y:D+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:C}),k&&o.jsx("text",{x:_+E/2,y:D+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:k})]})})(),e.map((b,w)=>({b,i:w})).filter(({i:b})=>b===0||b===e.length-1||e.length<=7).map(({b,i:w})=>{const S=v[w].x;return o.jsx("text",{x:S,y:c-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:b.startDate.slice(5,10)},w)})]})]})}function Y3({gaps:e,filter:t}){const s=N.useMemo(()=>{const a=[...e.gap.map(r=>({...r,_sort:0})),...e.cited.map(r=>({...r,_sort:1})),...e.uncited.map(r=>({...r,_sort:2}))];return t?a.filter(r=>r.category===t):a.sort((r,c)=>r._sort-c._sort)},[e,t]);return s.length===0?o.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",t?` with status "${t}"`:"","."]}):o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),o.jsx("tbody",{children:s.map(a=>{const r=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return o.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[o.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),o.jsx("td",{className:"py-1.5",children:o.jsx(nt,{tone:r,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:a.consistency.totalRuns>0?`${a.consistency.citedRuns}/${a.consistency.totalRuns} runs`:"—"})]},a.keywordId)})})]})}function J3({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:o.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(s=>{const a=s.count/t*100;return a<.5?null:o.jsx("div",{className:`${i1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function tm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function X3(e){const t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function W3({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState(null),[c,d]=N.useState(!0),[f,m]=N.useState(!1),[p,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState(null),[S,C]=N.useState("sessions"),[k,E]=N.useState("desc");function R(P){d(!0),Lm(e).then(J=>{if(!P.current)return s(J),J.connected?Dm(e):null}).then(J=>{P.current||(J&&r(J),d(!1))}).catch(J=>{P.current||(x(J instanceof Error?J.message:"Failed to load GA4 data"),d(!1))})}N.useEffect(()=>{const P={current:!1};return R(P),()=>{P.current=!0}},[e]);async function _(){m(!0),x(null),w(null);try{const P=await dN(e);w(`Synced ${P.rowCount.toLocaleString()} rows (${P.days} days)`);const J=await Dm(e);r(J);const Q=await Lm(e);s(Q)}catch(P){x(P instanceof Error?P.message:"Sync failed")}finally{m(!1)}}async function D(){v(!0),x(null),w(null);try{await fN(e),s({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),r(null),w("GA4 disconnected")}catch(P){x(P instanceof Error?P.message:"Disconnect failed")}finally{v(!1)}}function M(P){S===P?E(J=>J==="desc"?"asc":"desc"):(C(P),E("desc"))}const T=N.useMemo(()=>a?.topPages?[...a.topPages].sort((P,J)=>{const Q=P[S],se=J[S];return typeof Q=="string"&&typeof se=="string"?k==="asc"?Q.localeCompare(se):se.localeCompare(Q):k==="asc"?Q-se:se-Q}):[],[a?.topPages,S,k]);if(c&&!t)return o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return o.jsxs(Le,{className:"surface-card p-6",children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-2",children:"Google Analytics 4"}),o.jsx("p",{className:"text-sm text-zinc-400 mb-4",children:"Connect a GA4 property via the CLI to see traffic data for this project."}),o.jsx("div",{className:"bg-zinc-900/60 rounded-lg p-3 border border-zinc-800/60",children:o.jsxs("code",{className:"text-sm text-zinc-300",children:["canonry ga connect ",e," --key-file service-account.json --property-id 123456789"]})})]});const A=a&&a.totalSessions>0?Math.round(a.totalOrganicSessions/a.totalSessions*100):0;return o.jsxs(o.Fragment,{children:[y&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:y}),b&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:b}),o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",o.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&o.jsxs(o.Fragment,{children:[" · ",o.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ce,{variant:"outline",size:"sm",disabled:f,onClick:_,children:[o.jsx($x,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),o.jsxs(ce,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:D,children:[o.jsx(U2,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",o.jsx(bs,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),a?o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(nm,{value:tm(a.totalSessions),label:"Total Sessions",subtitle:a.totalSessions.toLocaleString(),tone:"neutral"}),o.jsx(nm,{value:tm(a.totalOrganicSessions),label:"Organic Sessions",subtitle:`${A}% of total`,tone:"positive"}),o.jsx(nm,{value:tm(a.totalUsers),label:"Total Users",subtitle:a.totalUsers.toLocaleString(),tone:"neutral"})]}):o.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),o.jsxs(ce,{variant:"outline",size:"sm",disabled:f,onClick:_,children:[o.jsx($x,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),"Sync from GA4"]})]})]}),a&&a.topPages.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",o.jsx(bs,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(Wc,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:M,align:"left"}),o.jsx(Wc,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx(Wc,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),o.jsx(Wc,{label:"Users",sortKey:"users",current:S,dir:k,onSort:M,align:"right"})]})}),o.jsx("tbody",{children:T.map(P=>o.jsx(t4,{page:P},P.landingPage))})]})})]})]}),o.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[o.jsx("span",{children:a?.lastSyncedAt?`Last synced ${X3(a.lastSyncedAt)}`:"Never synced"}),o.jsx("span",{children:a?`${a.topPages.length} pages shown`:""})]})]})}function Wc({label:e,sortKey:t,current:s,dir:a,onSort:r,align:c}){const d=s===t;return o.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${c==="right"?"text-right":"text-left"}`,onClick:()=>r(t),children:[e,d&&o.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}const e4={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function nm({value:e,label:t,subtitle:s,tone:a}){return o.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),o.jsx("p",{className:`text-2xl font-bold tabular-nums ${e4[a]}`,children:e}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:s})]})}function t4({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),o.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function n4({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,m]=N.useState([]),[p,v]=N.useState([]),[y,x]=N.useState([]),[b,w]=N.useState(null),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,_]=N.useState("30"),[D,M]=N.useState(!1),[T,A]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[P,J]=N.useState(""),[Q,se]=N.useState(!0),[pe,ke]=N.useState(!1),[je,B]=N.useState(!1),[G,oe]=N.useState(!1),[q,X]=N.useState(!1),[O,F]=N.useState(!1),[ie,re]=N.useState(!1),[ue,he]=N.useState(!1),[de,Me]=N.useState(null),[ge,Ze]=N.useState(!1),[it,me]=N.useState(!1),[We,dt]=N.useState(!1),[sn,kt]=N.useState(!1),[an,Vt]=N.useState(null),[_t,zt]=N.useState(""),[mn,le]=N.useState(!1),[Ie,Be]=N.useState(!1),[ze,$e]=N.useState("indexed"),[pt,rn]=N.useState([]),[js,Vs]=N.useState(null),[ws,Qs]=N.useState(!1),[ls,_e]=N.useState(null),[Ht,Ve]=N.useState(null),ae=a.find(U=>U.connectionType==="gsc"),Jn=f.length>0||p.length>0||y.length>0;async function gl(U){if(!U){d([]),C("");return}oe(!0);try{const{sites:fe}=await Gw(e);d(fe),C(U.propertyId??fe[0]?.siteUrl??"")}catch(fe){d([]),_e(fe instanceof Error?fe.message:"Failed to load Search Console properties")}finally{oe(!1)}}async function Ys(){F(!0);try{const U=await Zw(e,{startDate:T.startDate||void 0,endDate:T.endDate||void 0,query:T.query||void 0,page:T.page||void 0,limit:parseInt(T.limit,10)||20});m(U)}catch(U){m([]),_e(U instanceof Error?U.message:"Failed to load GSC performance data")}finally{F(!1)}}async function Ns(){re(!0);try{const[U,fe]=await Promise.all([Qw(e,{url:P.trim()||void 0,limit:20}),Yw(e)]);v(U),x(fe)}catch(U){v([]),x([]),_e(U instanceof Error?U.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function Ki(){Ze(!0);try{const[U,fe]=await Promise.all([Vu(e),Jw(e).catch(()=>[])]);Me(U),rn(fe)}catch(U){Me(null),rn([]),_e(U instanceof Error?U.message:"Failed to load coverage data")}finally{Ze(!1)}}async function cs(U){Qs(!0),_e(null);try{const fe=await Am(e,{urls:U}),{succeeded:at,failed:Qt,total:Dt}=fe.summary;Ve(Qt===0?`Indexing requested for ${at} URL${at!==1?"s":""}.`:`Indexing requested: ${at}/${Dt} succeeded, ${Qt} failed.`)}catch(fe){_e(fe instanceof Error?fe.message:"Failed to request indexing")}finally{Qs(!1)}}async function Aa(){Qs(!0),_e(null);try{const U=await Am(e,{urls:[],allUnindexed:!0}),{succeeded:fe,failed:at,total:Qt}=U.summary;Ve(at===0?`Indexing requested for ${fe} unindexed URL${fe!==1?"s":""}.`:`Indexing requested: ${fe}/${Qt} succeeded, ${at} failed.`)}catch(U){_e(U instanceof Error?U.message:"Failed to request indexing")}finally{Qs(!1)}}async function us(){if(_t.trim()){le(!0),_e(null);try{await Fw(e,"gsc",_t.trim()),r(U=>U.map(fe=>fe.connectionType==="gsc"?{...fe,sitemapUrl:_t.trim()}:fe)),Ve("Sitemap URL saved."),zt("")}catch(U){_e(U instanceof Error?U.message:"Failed to save sitemap URL")}finally{le(!1)}}}async function yl(){dt(!0),_e(null);try{const U=await eN(e);Vt(U.sitemaps),r(fe=>fe.map(at=>at.connectionType==="gsc"?{...at,sitemapUrl:U.primarySitemapUrl}:at)),Ve(`Discovered ${U.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${U.run.id}).`)}catch(U){_e(U instanceof Error?U.message:"Failed to discover sitemaps")}finally{dt(!1)}}async function vl(){kt(!0),_e(null);try{const U=await Ww(e);Vt(U.sitemaps),U.sitemaps.length===0&&Ve("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(U){_e(U instanceof Error?U.message:"Failed to list sitemaps")}finally{kt(!1)}}async function Oa(){se(!0),_e(null);try{const[U,fe]=await Promise.all([Zu().catch(()=>null),Op(e).catch(()=>[])]);s(!!U?.google?.configured),r(fe);const at=fe.find(Qt=>Qt.connectionType==="gsc");await Promise.all([gl(at),Ys(),Ns(),Ki()])}finally{se(!1)}}N.useEffect(()=>{Oa()},[e]);async function Fi(){if(!t){_e("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ke(!0),_e(null),Ve(null);try{const{authUrl:U}=await qw(e,"gsc");if(!U.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const fe=window.open(U,"_blank","width=600,height=700");if(!fe){window.location.assign(U);return}Ve("Finish the Google consent flow in the popup, then close it to refresh this project.");const at=window.setInterval(()=>{fe.closed&&(window.clearInterval(at),Ve(null),Oa())},1e3)}catch(U){_e(U instanceof Error?U.message:"Failed to start OAuth flow")}finally{ke(!1)}}async function cd(){_e(null),Ve(null);try{await Hw(e,"gsc"),r(U=>U.filter(fe=>fe.connectionType!=="gsc")),d([]),C("")}catch(U){_e(U instanceof Error?U.message:"Failed to disconnect")}}async function xl(){if(S){X(!0),_e(null);try{await Kw(e,"gsc",S),r(U=>U.map(fe=>fe.connectionType==="gsc"?{...fe,propertyId:S}:fe)),Ve("GSC property updated.")}catch(U){_e(U instanceof Error?U.message:"Failed to save GSC property")}finally{X(!1)}}}async function bl(){B(!0),_e(null),Ve(null);try{await Lp(e,{days:parseInt(R,10)||void 0,full:D||void 0}),Ve("GSC sync queued. Refresh after the run completes to see imported data.")}catch(U){_e(U instanceof Error?U.message:"Failed to trigger sync")}finally{B(!1)}}async function Kr(){if(k.trim()){he(!0),_e(null),Ve(null);try{const U=await Vw(e,k.trim());w(U),E(""),await Ns()}catch(U){_e(U instanceof Error?U.message:"Failed to inspect URL")}finally{he(!1)}}}return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),o.jsx("h2",{children:"Google Search Console"})]}),o.jsx("div",{className:"flex items-center gap-2",children:ae&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Refreshing…":"Refresh data"})})]}),ls&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[ls,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>_e(null),children:"×"})]}),Ht&&o.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[Ht,o.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Ve(null),children:"×"})]}),Q?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(nt,{tone:ae?"positive":t?"caution":"negative",children:ae?"Connected":t?"Ready to connect":"App credentials missing"})]}),ae?o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:ae.domain}),o.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:cd,children:"Disconnect"})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",o.jsx("code",{children:ae.domain}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ae.propertyId??"No property selected yet"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:vs(ae.updatedAt)})]})]})]}):o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[o.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:Fi,children:pe?"Opening…":"Connect Google Search Console"}):o.jsx(ce,{type:"button",variant:"outline",size:"sm",asChild:!0,children:o.jsx(yt,{to:"/settings",children:"Open Settings"})}),!t&&o.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ae&&!ae.sitemapUrl&&o.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"mt-0.5 text-amber-400",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),o.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),o.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx(ce,{type:"button",size:"sm",disabled:We||!ae.propertyId,onClick:yl,children:We?"Discovering…":"Auto-discover from GSC"}),o.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:_t,onChange:U=>zt(U.target.value),onKeyDown:U=>U.key==="Enter"&&void us()}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:mn||!_t.trim(),onClick:us,children:mn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ae||Jn)&&o.jsxs(o.Fragment,{children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index coverage"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[de&&de.notIndexed.length>0&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{Aa()},children:ws?"Requesting…":`Request indexing (${de.notIndexed.length})`}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{Ki()},children:ge?"Loading…":"Refresh coverage"})]})]}),de&&de.summary.total>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const U=de.summary.indexed+de.summary.notIndexed,fe=U>0?de.summary.indexed/U:0,at=U>0?de.summary.notIndexed/U:0,Qt=54,Dt=2*Math.PI*Qt,Et=Dt*(1-fe),wt=Dt*at,Cn=Dt*fe;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative h-48 w-48",children:[o.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Dt,strokeDashoffset:Et,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),de.summary.notIndexed>0&&o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${wt} ${Dt-wt}`,strokeDashoffset:-Cn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[o.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(fe*100).toFixed(0),"%"]}),o.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.indexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.notIndexed.toLocaleString()}),o.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&o.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.summary.deindexed>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.deindexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),o.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(U=>{const fe=U==="indexed"?de.indexed.length:U==="notIndexed"?de.notIndexed.length:de.deindexed.length,at=U==="indexed"?"Indexed":U==="notIndexed"?"Not Indexed":"Deindexed";return o.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ze===U?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{$e(U),Vs(null)},children:[at," (",fe,")"]},U)})}),o.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ze==="indexed"&&de.indexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"text-left",children:"Mobile"})]})}),o.jsx("tbody",{children:de.indexed.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.crawlTime?U.crawlTime.split("T")[0]:"—"}),o.jsx("td",{className:"text-zinc-400",children:U.isMobileFriendly===!0?"Yes":U.isMobileFriendly===!1?"No":"—"})]},U.id))})]}),ze==="notIndexed"&&!js&&(de.reasonGroups??[]).length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Reason"}),o.jsx("th",{className:"text-right",children:"Pages"})]})}),o.jsx("tbody",{children:(de.reasonGroups??[]).map(U=>o.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Vs(U.reason),children:[o.jsx("td",{className:"text-zinc-200",children:U.reason}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:U.count})]},U.reason))})]}),ze==="notIndexed"&&!js&&(de.reasonGroups??[]).length===0&&de.notIndexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing State"}),o.jsx("th",{className:"text-left",children:"Coverage"})]})}),o.jsx("tbody",{children:de.notIndexed.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.coverageState??"Unknown"})]},U.id))})]}),ze==="notIndexed"&&js&&(()=>{const U=(de.reasonGroups??[]).find(fe=>fe.reason===js);return U?o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-2 mb-3",children:o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Vs(null),children:"\\u2190 Back to reasons"})}),o.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:U.reason}),o.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[U.count," affected page",U.count!==1?"s":""]})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{cs(U.urls.map(fe=>fe.url))},children:ws?"Requesting…":`Request indexing (${U.count})`})]}),o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"w-8"})]})}),o.jsx("tbody",{children:U.urls.map(fe=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:fe.url}),o.jsx("td",{className:"text-zinc-400",children:fe.crawlTime?fe.crawlTime.split("T")[0]:"—"}),o.jsx("td",{children:o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:ws,onClick:()=>{cs([fe.url])},title:"Request indexing",children:"Index"})})]},fe.id))})]})]}):null})(),ze==="deindexed"&&de.deindexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Detected"})]})}),o.jsx("tbody",{children:de.deindexed.map((U,fe)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.previousState}),o.jsx("td",{className:"text-zinc-400",children:U.currentState}),o.jsx("td",{className:"text-zinc-400",children:U.transitionDate.split("T")[0]})]},`${U.url}-${fe}`))})]}),(ze==="indexed"&&de.indexed.length===0||ze==="notIndexed"&&!js&&de.notIndexed.length===0||ze==="deindexed"&&de.deindexed.length===0)&&o.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),o.jsx("h3",{children:"Search performance"})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const U=new Map;for(const qe of f){const rt=U.get(qe.date);rt?(rt.clicks+=qe.clicks,rt.impressions+=qe.impressions):U.set(qe.date,{clicks:qe.clicks,impressions:qe.impressions})}const fe=[...U.entries()].sort(([qe],[rt])=>qe.localeCompare(rt));if(fe.length===0)return null;const at=Math.max(...fe.map(([,qe])=>qe.impressions),1),Qt=fe.reduce((qe,[,rt])=>qe+rt.clicks,0),Dt=fe.reduce((qe,[,rt])=>qe+rt.impressions,0),Et=Dt>0?(Qt/Dt*100).toFixed(1):"0.0",wt=700,Cn=220,en={top:12,bottom:36,left:48,right:12},ud=wt-en.left-en.right,Js=Cn-en.top-en.bottom,Xs=ud/fe.length,ds=Math.max(Math.min(Xs*.35,24),4),La=Math.max(ds*.15,1),Ws=qe=>{if(qe<=0)return 1;const rt=Math.pow(10,Math.floor(Math.log10(qe))),Gt=qe/rt,on=Gt<=1.5?1.5:Gt<=3?3:Gt<=5?5:10;return Math.ceil(on*rt)},Xn=4,fs=Math.ceil(Ws(at)/Xn)*Xn,ei=Array.from({length:Xn+1},(qe,rt)=>fs/Xn*rt),Mt=qe=>qe>=1e3?`${(qe/1e3).toFixed(qe>=1e4?0:1)}k`:String(qe);return o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Qt.toLocaleString()})]})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Dt.toLocaleString()})]})]}),o.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",o.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Et,"%"]})]})]}),o.jsx("div",{className:"relative w-full",style:{aspectRatio:`${wt} / ${Cn}`},children:o.jsxs("svg",{viewBox:`0 0 ${wt} ${Cn}`,className:"h-full w-full",children:[ei.map((qe,rt)=>{const Gt=en.top+Js-qe/fs*Js;return o.jsxs("g",{children:[o.jsx("line",{x1:en.left,y1:Gt,x2:wt-en.right,y2:Gt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),o.jsx("text",{x:en.left-6,y:Gt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt(qe)})]},`t-${rt}`)}),fe.map(([qe,rt],Gt)=>{const on=en.left+Xs*Gt+Xs/2,Da=rt.impressions/fs*Js,Fr=rt.clicks/fs*Js;return o.jsxs("g",{children:[o.jsx("title",{children:`${qe}
|
|
233
|
+
keywords: []`,value:t,onChange:v=>s(v.target.value)}),c.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>o.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&o.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>o.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),o.jsx("div",{className:"mt-3",children:o.jsx(ce,{type:"button",disabled:!t.trim()||a,onClick:p,children:a?"Applying...":"Apply"})})]})}function q3(){const{dashboard:e,isLoading:t,refetch:s}=Ra();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-28"}),o.jsx("div",{className:"skeleton-text-sm w-40"})]}),o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[o.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(T=>o.jsx("div",{className:"skeleton-text-sm w-16"},T))}),[1,2,3].map(T=>o.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[o.jsxs("div",{className:"flex-1 space-y-1",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"skeleton-text-sm w-16"})]}),o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),o.jsx("div",{className:"skeleton-text-sm w-8"})]},T))]})]});const a=e.projects,r=ka(),[c,d]=N.useState(!1),[f,m]=N.useState(""),[p,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState("US"),[S,C]=N.useState("en"),[k,E]=N.useState(!1),[R,_]=N.useState(null),L=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),M=async()=>{if(!(!L||!y)){E(!0),_(null);try{const T=await ll(L,{displayName:p||f,canonicalDomain:y,country:b,language:S});s(),m(""),v(""),x(""),w("US"),C("en"),d(!1),r({to:"/projects/$projectId",params:{projectId:T.id}})}catch(T){_(T instanceof Error?T.message:"Failed to create project")}finally{E(!1)}}};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Projects"}),o.jsxs("p",{className:"page-subtitle",children:[a.length," project",a.length!==1?"s":""," tracked"]})]}),o.jsx("div",{className:"page-header-right",children:o.jsxs(ce,{type:"button",onClick:()=>d(T=>!T),children:[o.jsx($x,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?o.jsxs(De,{className:"surface-card mb-6",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),o.jsxs("div",{className:"compact-stack mt-4",children:[o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),o.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:f,onChange:T=>m(T.target.value)}),L&&L!==f?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",L]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),o.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:T=>v(T.target.value)})]})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),o.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:y,onChange:T=>x(T.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),o.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:b,onChange:T=>w(T.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),o.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:T=>C(T.target.value.toLowerCase())})]})]})]}),R?o.jsx("p",{className:"text-rose-400 text-sm mt-3",children:R}):null,o.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[o.jsx(ce,{type:"button",disabled:!L||!y||k,onClick:M,children:k?"Creating...":"Create project"}),o.jsx(ce,{type:"button",variant:"ghost",onClick:()=>d(!1),children:"Cancel"})]})]}):null,a.length>0?o.jsx("div",{className:"data-table-wrapper",children:o.jsxs("table",{className:"data-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Visibility"}),o.jsx("th",{children:"Last run"}),o.jsx("th",{className:"text-right",children:"Country"})]})}),o.jsx("tbody",{children:a.map(T=>{const A=T.recentRuns[0];return o.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:T.project.id}}),children:[o.jsxs("td",{children:[o.jsx(yt,{to:"/projects/$projectId",params:{projectId:T.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:P=>P.stopPropagation(),children:T.project.displayName||T.project.name}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:T.project.name})]}),o.jsx("td",{className:"text-zinc-400",children:T.project.canonicalDomain}),o.jsx("td",{children:o.jsx(nt,{tone:T.visibilitySummary.tone,children:T.visibilitySummary.value})}),o.jsx("td",{className:"text-zinc-500 text-sm",children:A?o.jsx(Pu,{status:A.status}):o.jsx("span",{className:"text-zinc-600",children:"No runs"})}),o.jsx("td",{className:"text-right text-zinc-500",children:T.project.country})]},T.project.id)})})]})}):c?null:o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h3",{children:"No projects yet"}),o.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),o.jsxs(ce,{type:"button",onClick:()=>d(!0),children:[o.jsx($x,{className:"size-4 mr-1.5"}),"Add project"]})]}),o.jsx(B3,{onApplied:()=>{s()}})]})}function bs({text:e}){return o.jsxs("span",{className:"info-tooltip-wrapper",children:[o.jsxs("svg",{className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),o.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),o.jsx("span",{className:"info-tooltip-bubble",role:"tooltip",children:e})]})}function n1({run:e}){const{openRun:t}=ul();return o.jsxs("article",{className:"run-row",children:[o.jsxs("div",{className:"run-row-main",children:[o.jsxs("div",{className:"run-row-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:e.summary}),o.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),o.jsx(Pu,{status:e.status})]}),o.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),o.jsxs("dl",{className:"run-row-meta",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Started"}),o.jsx("dd",{children:e.startedAt})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Duration"}),o.jsx("dd",{children:e.duration})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Trigger"}),o.jsx("dd",{children:e.triggerLabel})]})]}),o.jsx(ce,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function s1({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:d=!0,progress:f}){const v=2*Math.PI*48,y=Number.parseInt(e,10),x=typeof f=="number"&&Number.isFinite(f)?Math.min(Math.max(f,0),1):d&&!Number.isNaN(y)?Math.min(y/100,1):.5,b=v*(1-x);return o.jsxs("div",{className:"score-gauge",children:[o.jsxs("div",{className:"gauge-ring-wrapper",children:[o.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[o.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),o.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:v,strokeDashoffset:b,transform:"rotate(-90 60 60)"})]}),o.jsx("div",{className:"gauge-center",children:o.jsx("span",{className:d?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),o.jsxs("p",{className:"gauge-label",children:[t,c&&o.jsx(bs,{text:c})]}),o.jsx("p",{className:"gauge-delta",children:s}),o.jsx("p",{className:"gauge-description",children:r})]})}function Fb({history:e,maxDots:t=12}){const s=e.slice(-t);if(s.length===0)return o.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const a={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},r=new Date(s[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(s[s.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:r}),o.jsx("div",{className:"flex items-center gap-[3px]",title:`${s.length} runs`,children:s.map((d,f)=>o.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[d.citationState]??"bg-zinc-700"} ${d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[d.citationState,new Date(d.createdAt).toLocaleDateString(),d.model?`model ${d.model}`:null,d.model&&f>0&&s[f-1]?.model&&s[f-1].model!==d.model?"model changed":null].filter(Boolean).join(" — ")},f))}),o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function H3(e){const t=new Map;for(const a of e)for(const r of a.runHistory){const c=t.get(r.createdAt);c?c.states.push(r.citationState):t.set(r.createdAt,{states:[r.citationState],runId:r.runId})}return[...t.entries()].sort(([a],[r])=>a.localeCompare(r)).map(([a,{states:r,runId:c}])=>({runId:c,createdAt:a,citationState:r.includes("cited")?"cited":r.includes("emerging")?"emerging":"not-cited"}))}function G3({evidence:e}){const{openEvidence:t}=ul(),[s,a]=N.useState(new Set),r=N.useMemo(()=>{const d=new Map;for(const f of e){const m=d.get(f.keyword)??[];d.set(f.keyword,[...m,f])}return[...d.entries()].map(([f,m])=>({phrase:f,items:m}))},[e]),c=d=>{a(f=>{const m=new Set(f);return m.has(d)?m.delete(d):m.add(d),m})};return o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{style:{width:"2rem"}}),o.jsx("th",{children:"Key Phrase"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Citation History"}),o.jsx("th",{children:"Change"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:r.map(({phrase:d,items:f})=>{const m=s.has(d),p=f.map(w=>w.citationState),v=p.includes("cited")?"cited":p.includes("emerging")?"emerging":p.includes("lost")?"lost":p.every(w=>w==="pending")?"pending":"not-cited",y=H3(f),x=f.filter(w=>w.citationState==="cited"||w.citationState==="emerging").length,b=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const w=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&w==="cited")return"Newly cited";if(S==="cited"&&w!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===w;k--)C++;return w==="cited"?C<=1?"Cited in latest run":`Cited for ${C} runs`:C<=1?"Not cited in latest run":`Not cited across ${C} runs`})();return o.jsxs(N.Fragment,{children:[o.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(d),"aria-expanded":m,children:[o.jsx("td",{children:o.jsx(Mu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${m?"rotate-90":""}`})}),o.jsx("td",{className:"evidence-keyword-cell",children:o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-zinc-100",children:d}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(w=>o.jsx(tl,{provider:w.provider},w.id))})]})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Em,{state:v}),o.jsxs("span",{className:"text-[11px] text-zinc-500",children:[x,"/",f.length]})]})}),o.jsx("td",{children:o.jsx(Fb,{history:y})}),o.jsx("td",{className:"evidence-change-cell",children:b}),o.jsx("td",{})]}),m&&f.map(w=>o.jsxs("tr",{className:"bg-zinc-900/30",children:[o.jsx("td",{}),o.jsx("td",{className:"evidence-keyword-cell pl-5",children:o.jsx(tl,{provider:w.provider})}),o.jsx("td",{children:o.jsx(Em,{state:w.citationState})}),o.jsx("td",{children:o.jsx(Fb,{history:w.runHistory})}),o.jsx("td",{className:"evidence-change-cell",children:w.changeLabel}),o.jsx("td",{children:o.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(w.id)},children:"View"})})]},w.id))]},d)})})]})})}function K3({competitors:e}){return e.length===0?o.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):o.jsx("div",{className:"competitor-table-wrap",children:o.jsxs("table",{className:"competitor-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Domain"}),o.jsx("th",{children:"Pressure"}),o.jsx("th",{children:"Citations"}),o.jsx("th",{children:"Key Phrases"})]})}),o.jsx("tbody",{children:e.map(t=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),o.jsx("td",{children:o.jsx(nt,{tone:KE(t.pressureLabel),children:t.pressureLabel})}),o.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),o.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const F3=["7d","30d","90d","all"],Z3=["gap","cited","uncited"],i1={forum:"bg-amber-500",social:"bg-blue-500",news:"bg-zinc-400",reference:"bg-purple-500",blog:"bg-emerald-500",ecommerce:"bg-orange-500",video:"bg-red-500",academic:"bg-cyan-500",other:"bg-zinc-600"};function V3({projectName:e}){const[t,s]=N.useState("30d"),[a,r]=N.useState(null),[c,d]=N.useState(null),[f,m]=N.useState(null),[p,v]=N.useState(null),[y,x]=N.useState(!0);return N.useEffect(()=>{let b=!1;return x(!0),Promise.all([lN(e,t),cN(e,t),uN(e,t)]).then(([w,S,C])=>{b||(r(w),d(S),m(C),x(!1))}).catch(()=>{b||x(!1)}),()=>{b=!0}},[e,t]),y&&!a?o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):o.jsxs(o.Fragment,{children:[o.jsxs("section",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",o.jsx(bs,{text:"Citation rate over time across all runs within the selected window. Each data point represents the percentage of queries where your brand was cited by AI providers."})]})]}),o.jsx("div",{className:"flex gap-1",children:F3.map(b=>o.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===b?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>s(b),children:b==="all"?"All":b},b))})]}),a&&o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-6",children:[o.jsx(s1,{value:`${Math.round(a.overall.citationRate*100)}`,label:"Citation Rate",delta:`${a.overall.cited} / ${a.overall.total}`,tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",description:`Trend: ${a.trend}`,isNumeric:!0}),o.jsxs("div",{className:"flex-1 space-y-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),o.jsx(nt,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),o.jsx("tbody",{children:Object.entries(a.byProvider).map(([b,w])=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300",children:b}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(w.citationRate*100).toFixed(1),"%"]}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[w.cited," / ",w.total]})]},b))})]})]})]}),a.buckets.length>=1&&o.jsx(Q3,{buckets:a.buckets,keywordChanges:a.keywordChanges??[]})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsx("div",{className:"flex items-center justify-between mb-4",children:o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",o.jsx(bs,{text:"Classification based on the most recent completed run. Cited: your brand appeared in the AI answer. Gap: a competitor was cited but you were not. Not Cited: neither mentioned. Consistency shows how often each key phrase was cited across all runs in the selected window."})]})]})}),c&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex gap-1 mb-4",children:Z3.map(b=>{const w=b==="cited"?c.cited.length:b==="gap"?c.gap.length:c.uncited.length,S=p===b;return o.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?b==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":b==="cited"?"bg-emerald-900/40 border-emerald-700/60 text-emerald-300":"bg-zinc-800/40 border-zinc-700 text-zinc-300":"border-zinc-800 text-zinc-400 hover:border-zinc-700"}`,onClick:()=>v(S?null:b),children:[b==="gap"?"Gap":b==="cited"?"Cited":"Not Cited"," (",w,")"]},b)})}),o.jsx(Y3,{gaps:c,filter:p})]})]}),o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",o.jsx(bs,{text:"Aggregated across all runs in the selected window. Shows what types of websites AI engines cite as grounding sources. More runs = more statistically meaningful breakdown."})]})]}),f&&f.overall.length>0&&o.jsxs("div",{className:"space-y-4",children:[o.jsx(J3,{categories:f.overall}),o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),o.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),o.jsx("tbody",{children:f.overall.map(b=>o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[o.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${i1[b.category]??"bg-zinc-600"}`}),b.label]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:b.count}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(b.percentage*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:b.topDomains.slice(0,3).map(w=>w.domain).join(", ")})]},b.category))})]})]}),f&&f.overall.length===0&&o.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function Q3({buckets:e,keywordChanges:t}){const[s,a]=N.useState(null),r=600,c=140,d={top:30,right:10,bottom:20,left:40},f=r-d.left-d.right,m=c-d.top-d.bottom,p=1,v=e.map((b,w)=>{const S=d.left+(e.length>1?w/(e.length-1)*f:f/2),C=d.top+m-b.citationRate/p*m;return{x:S,y:C}}),y=N.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const b=new Date(e[0].startDate).getTime(),S=new Date(e[e.length-1].startDate).getTime()-b;return S<=0?[]:t.map(C=>{const E=(new Date(C.date).getTime()-b)/S;return E<0||E>1?null:{...C,x:d.left+E*f}}).filter(C=>C!==null)},[e,t,d.left,f]),x=v.map(b=>`${b.x},${b.y}`).join(" ");return o.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[o.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),o.jsxs("svg",{viewBox:`0 0 ${r} ${c}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>a(null),children:[o.jsxs("text",{x:d.left-4,y:d.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),o.jsx("text",{x:d.left-4,y:d.top+m+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),o.jsx("line",{x1:d.left,y1:d.top+m,x2:d.left+f,y2:d.top+m,stroke:"currentColor",className:"text-zinc-800",strokeWidth:"0.5"}),o.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:x}),y.map((b,w)=>o.jsxs("g",{children:[o.jsx("line",{x1:b.x,y1:d.top,x2:b.x,y2:d.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),o.jsx("text",{x:b.x,y:d.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:b.label})]},`kw-change-${w}`)),s!==null&&o.jsx("line",{x1:v[s].x,y1:d.top,x2:v[s].x,y2:d.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((b,w)=>{const{x:S,y:C}=v[w],k=s===w;return o.jsxs("g",{children:[o.jsx("circle",{cx:S,cy:C,r:"10",fill:"transparent",onMouseEnter:()=>a(w),style:{cursor:"pointer"}}),o.jsx("circle",{cx:S,cy:C,r:k?5:3,className:k?"fill-emerald-400":"fill-emerald-500"})]},w)}),s!==null&&(()=>{const b=e[s],{x:w,y:S}=v[s],C=`${(b.citationRate*100).toFixed(1)}%`,k=b.keywordCount?`${b.keywordCount} kp`:"",E=56,R=30,_=Math.max(d.left,Math.min(w-E/2,r-d.right-E)),L=S-R-8;return o.jsxs("g",{children:[o.jsx("rect",{x:_,y:L,width:E,height:R,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),o.jsx("text",{x:_+E/2,y:L+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:C}),k&&o.jsx("text",{x:_+E/2,y:L+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:k})]})})(),e.map((b,w)=>({b,i:w})).filter(({i:b})=>b===0||b===e.length-1||e.length<=7).map(({b,i:w})=>{const S=v[w].x;return o.jsx("text",{x:S,y:c-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:b.startDate.slice(5,10)},w)})]})]})}function Y3({gaps:e,filter:t}){const s=N.useMemo(()=>{const a=[...e.gap.map(r=>({...r,_sort:0})),...e.cited.map(r=>({...r,_sort:1})),...e.uncited.map(r=>({...r,_sort:2}))];return t?a.filter(r=>r.category===t):a.sort((r,c)=>r._sort-c._sort)},[e,t]);return s.length===0?o.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",t?` with status "${t}"`:"","."]}):o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),o.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),o.jsx("tbody",{children:s.map(a=>{const r=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return o.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[o.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),o.jsx("td",{className:"py-1.5",children:o.jsx(nt,{tone:r,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),o.jsx("td",{className:"py-1.5 text-right text-zinc-400 text-xs",children:a.consistency.totalRuns>0?`${a.consistency.citedRuns}/${a.consistency.totalRuns} runs`:"—"})]},a.keywordId)})})]})}function J3({categories:e}){const t=e.reduce((s,a)=>s+a.count,0);return t===0?null:o.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(s=>{const a=s.count/t*100;return a<.5?null:o.jsx("div",{className:`${i1[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function nm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function X3(e){const t=Date.now()-new Date(e).getTime(),s=Math.floor(t/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function W3({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState(null),[c,d]=N.useState(!0),[f,m]=N.useState(!1),[p,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState(null),[S,C]=N.useState("sessions"),[k,E]=N.useState("desc");function R(P){d(!0),Lm(e).then(J=>{if(!P.current)return s(J),J.connected?Mm(e):null}).then(J=>{P.current||(J&&r(J),d(!1))}).catch(J=>{P.current||(x(J instanceof Error?J.message:"Failed to load GA4 data"),d(!1))})}N.useEffect(()=>{const P={current:!1};return R(P),()=>{P.current=!0}},[e]);async function _(){m(!0),x(null),w(null);try{const P=await dN(e);w(`Synced ${P.rowCount.toLocaleString()} rows (${P.days} days)`);const J=await Mm(e);r(J);const Q=await Lm(e);s(Q)}catch(P){x(P instanceof Error?P.message:"Sync failed")}finally{m(!1)}}async function L(){v(!0),x(null),w(null);try{await fN(e),s({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),r(null),w("GA4 disconnected")}catch(P){x(P instanceof Error?P.message:"Disconnect failed")}finally{v(!1)}}function M(P){S===P?E(J=>J==="desc"?"asc":"desc"):(C(P),E("desc"))}const T=N.useMemo(()=>a?.topPages?[...a.topPages].sort((P,J)=>{const Q=P[S],se=J[S];return typeof Q=="string"&&typeof se=="string"?k==="asc"?Q.localeCompare(se):se.localeCompare(Q):k==="asc"?Q-se:se-Q}):[],[a?.topPages,S,k]);if(c&&!t)return o.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return o.jsxs(De,{className:"surface-card p-6",children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-2",children:"Google Analytics 4"}),o.jsx("p",{className:"text-sm text-zinc-400 mb-4",children:"Connect a GA4 property via the CLI to see traffic data for this project."}),o.jsx("div",{className:"bg-zinc-900/60 rounded-lg p-3 border border-zinc-800/60",children:o.jsxs("code",{className:"text-sm text-zinc-300",children:["canonry ga connect ",e," --key-file service-account.json --property-id 123456789"]})})]});const A=a&&a.totalSessions>0?Math.round(a.totalOrganicSessions/a.totalSessions*100):0;return o.jsxs(o.Fragment,{children:[y&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-rose-900/20 border border-rose-800/60 text-sm text-rose-300",children:y}),b&&o.jsx("div",{className:"mb-4 px-4 py-2 rounded-lg bg-emerald-900/20 border border-emerald-800/60 text-sm text-emerald-300",children:b}),o.jsxs("div",{className:"flex items-center justify-between mb-6",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",o.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&o.jsxs(o.Fragment,{children:[" · ",o.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(ce,{variant:"outline",size:"sm",disabled:f,onClick:_,children:[o.jsx(Ux,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),o.jsxs(ce,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:L,children:[o.jsx(U2,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",o.jsx(bs,{text:"Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across all synced dates. Organic sessions are Google organic search sessions specifically."})]})]}),a?o.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[o.jsx(sm,{value:nm(a.totalSessions),label:"Total Sessions",subtitle:a.totalSessions.toLocaleString(),tone:"neutral"}),o.jsx(sm,{value:nm(a.totalOrganicSessions),label:"Organic Sessions",subtitle:`${A}% of total`,tone:"positive"}),o.jsx(sm,{value:nm(a.totalUsers),label:"Total Users",subtitle:a.totalUsers.toLocaleString(),tone:"neutral"})]}):o.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[o.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),o.jsxs(ce,{variant:"outline",size:"sm",disabled:f,onClick:_,children:[o.jsx(Ux,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),"Sync from GA4"]})]})]}),a&&a.topPages.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-section-divider"}),o.jsxs("section",{children:[o.jsxs("div",{className:"mb-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),o.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",o.jsx(bs,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[o.jsx(Wc,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:M,align:"left"}),o.jsx(Wc,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx(Wc,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:M,align:"right"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),o.jsx(Wc,{label:"Users",sortKey:"users",current:S,dir:k,onSort:M,align:"right"})]})}),o.jsx("tbody",{children:T.map(P=>o.jsx(t4,{page:P},P.landingPage))})]})})]})]}),o.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[o.jsx("span",{children:a?.lastSyncedAt?`Last synced ${X3(a.lastSyncedAt)}`:"Never synced"}),o.jsx("span",{children:a?`${a.topPages.length} pages shown`:""})]})]})}function Wc({label:e,sortKey:t,current:s,dir:a,onSort:r,align:c}){const d=s===t;return o.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${c==="right"?"text-right":"text-left"}`,onClick:()=>r(t),children:[e,d&&o.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}const e4={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function sm({value:e,label:t,subtitle:s,tone:a}){return o.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[o.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),o.jsx("p",{className:`text-2xl font-bold tabular-nums ${e4[a]}`,children:e}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:s})]})}function t4({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return o.jsxs("tr",{className:"border-t border-zinc-800/40",children:[o.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),o.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),o.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function n4({projectName:e}){const[t,s]=N.useState(!1),[a,r]=N.useState([]),[c,d]=N.useState([]),[f,m]=N.useState([]),[p,v]=N.useState([]),[y,x]=N.useState([]),[b,w]=N.useState(null),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,_]=N.useState("30"),[L,M]=N.useState(!1),[T,A]=N.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[P,J]=N.useState(""),[Q,se]=N.useState(!0),[pe,ke]=N.useState(!1),[je,B]=N.useState(!1),[G,oe]=N.useState(!1),[q,X]=N.useState(!1),[O,F]=N.useState(!1),[ie,re]=N.useState(!1),[ue,he]=N.useState(!1),[de,Me]=N.useState(null),[ge,Ze]=N.useState(!1),[it,me]=N.useState(!1),[We,dt]=N.useState(!1),[sn,kt]=N.useState(!1),[an,Vt]=N.useState(null),[_t,zt]=N.useState(""),[mn,le]=N.useState(!1),[Be,qe]=N.useState(!1),[ze,$e]=N.useState("indexed"),[pt,rn]=N.useState([]),[js,Vs]=N.useState(null),[ws,Qs]=N.useState(!1),[ls,_e]=N.useState(null),[Ht,Qe]=N.useState(null),ae=a.find(U=>U.connectionType==="gsc"),Jn=f.length>0||p.length>0||y.length>0;async function gl(U){if(!U){d([]),C("");return}oe(!0);try{const{sites:fe}=await Gw(e);d(fe),C(U.propertyId??fe[0]?.siteUrl??"")}catch(fe){d([]),_e(fe instanceof Error?fe.message:"Failed to load Search Console properties")}finally{oe(!1)}}async function Ys(){F(!0);try{const U=await Zw(e,{startDate:T.startDate||void 0,endDate:T.endDate||void 0,query:T.query||void 0,page:T.page||void 0,limit:parseInt(T.limit,10)||20});m(U)}catch(U){m([]),_e(U instanceof Error?U.message:"Failed to load GSC performance data")}finally{F(!1)}}async function Ns(){re(!0);try{const[U,fe]=await Promise.all([Qw(e,{url:P.trim()||void 0,limit:20}),Yw(e)]);v(U),x(fe)}catch(U){v([]),x([]),_e(U instanceof Error?U.message:"Failed to load GSC inspection history")}finally{re(!1)}}async function Ki(){Ze(!0);try{const[U,fe]=await Promise.all([Vu(e),Jw(e).catch(()=>[])]);Me(U),rn(fe)}catch(U){Me(null),rn([]),_e(U instanceof Error?U.message:"Failed to load coverage data")}finally{Ze(!1)}}async function cs(U){Qs(!0),_e(null);try{const fe=await Om(e,{urls:U}),{succeeded:at,failed:Qt,total:Lt}=fe.summary;Qe(Qt===0?`Indexing requested for ${at} URL${at!==1?"s":""}.`:`Indexing requested: ${at}/${Lt} succeeded, ${Qt} failed.`)}catch(fe){_e(fe instanceof Error?fe.message:"Failed to request indexing")}finally{Qs(!1)}}async function Aa(){Qs(!0),_e(null);try{const U=await Om(e,{urls:[],allUnindexed:!0}),{succeeded:fe,failed:at,total:Qt}=U.summary;Qe(at===0?`Indexing requested for ${fe} unindexed URL${fe!==1?"s":""}.`:`Indexing requested: ${fe}/${Qt} succeeded, ${at} failed.`)}catch(U){_e(U instanceof Error?U.message:"Failed to request indexing")}finally{Qs(!1)}}async function us(){if(_t.trim()){le(!0),_e(null);try{await Fw(e,"gsc",_t.trim()),r(U=>U.map(fe=>fe.connectionType==="gsc"?{...fe,sitemapUrl:_t.trim()}:fe)),Qe("Sitemap URL saved."),zt("")}catch(U){_e(U instanceof Error?U.message:"Failed to save sitemap URL")}finally{le(!1)}}}async function yl(){dt(!0),_e(null);try{const U=await eN(e);Vt(U.sitemaps),r(fe=>fe.map(at=>at.connectionType==="gsc"?{...at,sitemapUrl:U.primarySitemapUrl}:at)),Qe(`Discovered ${U.sitemaps.length} sitemap(s). Primary sitemap saved and inspection queued (run ${U.run.id}).`)}catch(U){_e(U instanceof Error?U.message:"Failed to discover sitemaps")}finally{dt(!1)}}async function vl(){kt(!0),_e(null);try{const U=await Ww(e);Vt(U.sitemaps),U.sitemaps.length===0&&Qe("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(U){_e(U instanceof Error?U.message:"Failed to list sitemaps")}finally{kt(!1)}}async function Oa(){se(!0),_e(null);try{const[U,fe]=await Promise.all([Zu().catch(()=>null),Dp(e).catch(()=>[])]);s(!!U?.google?.configured),r(fe);const at=fe.find(Qt=>Qt.connectionType==="gsc");await Promise.all([gl(at),Ys(),Ns(),Ki()])}finally{se(!1)}}N.useEffect(()=>{Oa()},[e]);async function Fi(){if(!t){_e("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}ke(!0),_e(null),Qe(null);try{const{authUrl:U}=await qw(e,"gsc");if(!U.startsWith("https://accounts.google.com/")){_e("Unexpected OAuth redirect URL. Please try again.");return}const fe=window.open(U,"_blank","width=600,height=700");if(!fe){window.location.assign(U);return}Qe("Finish the Google consent flow in the popup, then close it to refresh this project.");const at=window.setInterval(()=>{fe.closed&&(window.clearInterval(at),Qe(null),Oa())},1e3)}catch(U){_e(U instanceof Error?U.message:"Failed to start OAuth flow")}finally{ke(!1)}}async function cd(){_e(null),Qe(null);try{await Hw(e,"gsc"),r(U=>U.filter(fe=>fe.connectionType!=="gsc")),d([]),C("")}catch(U){_e(U instanceof Error?U.message:"Failed to disconnect")}}async function xl(){if(S){X(!0),_e(null);try{await Kw(e,"gsc",S),r(U=>U.map(fe=>fe.connectionType==="gsc"?{...fe,propertyId:S}:fe)),Qe("GSC property updated.")}catch(U){_e(U instanceof Error?U.message:"Failed to save GSC property")}finally{X(!1)}}}async function bl(){B(!0),_e(null),Qe(null);try{await Lp(e,{days:parseInt(R,10)||void 0,full:L||void 0}),Qe("GSC sync queued. Refresh after the run completes to see imported data.")}catch(U){_e(U instanceof Error?U.message:"Failed to trigger sync")}finally{B(!1)}}async function Kr(){if(k.trim()){he(!0),_e(null),Qe(null);try{const U=await Vw(e,k.trim());w(U),E(""),await Ns()}catch(U){_e(U instanceof Error?U.message:"Failed to inspect URL")}finally{he(!1)}}}return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),o.jsx("h2",{children:"Google Search Console"})]}),o.jsx("div",{className:"flex items-center gap-2",children:ae&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Refreshing…":"Refresh data"})})]}),ls&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[ls,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>_e(null),children:"×"})]}),Ht&&o.jsxs("div",{className:"mb-3 rounded-lg border border-emerald-800/40 bg-emerald-950/20 px-3 py-2 text-sm text-emerald-300",children:[Ht,o.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Qe(null),children:"×"})]}),Q?o.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(nt,{tone:ae?"positive":t?"caution":"negative",children:ae?"Connected":t?"Ready to connect":"App credentials missing"})]}),ae?o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:ae.domain}),o.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:cd,children:"Disconnect"})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",o.jsx("code",{children:ae.domain}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ae.propertyId??"No property selected yet"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:vs(ae.updatedAt)})]})]})]}):o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[o.jsx("p",{className:"text-sm text-zinc-300",children:t?"Generate a Google OAuth link for this project and have the client sign in with a Google account that already has access to the correct Search Console property.":"Set Google OAuth client credentials first. Once configured, you can generate a consent link for this project domain."}),o.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:Fi,children:pe?"Opening…":"Connect Google Search Console"}):o.jsx(ce,{type:"button",variant:"outline",size:"sm",asChild:!0,children:o.jsx(yt,{to:"/settings",children:"Open Settings"})}),!t&&o.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ae&&!ae.sitemapUrl&&o.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("span",{className:"mt-0.5 text-amber-400",children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})})}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),o.jsx("p",{className:"mt-1 text-xs text-amber-400/70",children:"Canonry uses your sitemap to discover URLs for index coverage inspection. Auto-discover from GSC or enter it manually."}),o.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx(ce,{type:"button",size:"sm",disabled:We||!ae.propertyId,onClick:yl,children:We?"Discovering…":"Auto-discover from GSC"}),o.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:_t,onChange:U=>zt(U.target.value),onKeyDown:U=>U.key==="Enter"&&void us()}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:mn||!_t.trim(),onClick:us,children:mn?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ae||Jn)&&o.jsxs(o.Fragment,{children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index coverage"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[de&&de.notIndexed.length>0&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{Aa()},children:ws?"Requesting…":`Request indexing (${de.notIndexed.length})`}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{Ki()},children:ge?"Loading…":"Refresh coverage"})]})]}),de&&de.summary.total>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const U=de.summary.indexed+de.summary.notIndexed,fe=U>0?de.summary.indexed/U:0,at=U>0?de.summary.notIndexed/U:0,Qt=54,Lt=2*Math.PI*Qt,Et=Lt*(1-fe),wt=Lt*at,Cn=Lt*fe;return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"relative h-48 w-48",children:[o.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Lt,strokeDashoffset:Et,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),de.summary.notIndexed>0&&o.jsx("circle",{cx:"64",cy:"64",r:Qt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${wt} ${Lt-wt}`,strokeDashoffset:-Cn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),o.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[o.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(fe*100).toFixed(0),"%"]}),o.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),o.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.indexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.notIndexed.toLocaleString()}),o.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(de.reasonGroups??[]).length>0&&o.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(de.reasonGroups??[]).length," ",(de.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),de.summary.deindexed>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-8 w-px bg-zinc-800"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:de.summary.deindexed.toLocaleString()}),o.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),o.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(U=>{const fe=U==="indexed"?de.indexed.length:U==="notIndexed"?de.notIndexed.length:de.deindexed.length,at=U==="indexed"?"Indexed":U==="notIndexed"?"Not Indexed":"Deindexed";return o.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ze===U?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{$e(U),Vs(null)},children:[at," (",fe,")"]},U)})}),o.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ze==="indexed"&&de.indexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"text-left",children:"Mobile"})]})}),o.jsx("tbody",{children:de.indexed.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.crawlTime?U.crawlTime.split("T")[0]:"—"}),o.jsx("td",{className:"text-zinc-400",children:U.isMobileFriendly===!0?"Yes":U.isMobileFriendly===!1?"No":"—"})]},U.id))})]}),ze==="notIndexed"&&!js&&(de.reasonGroups??[]).length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Reason"}),o.jsx("th",{className:"text-right",children:"Pages"})]})}),o.jsx("tbody",{children:(de.reasonGroups??[]).map(U=>o.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Vs(U.reason),children:[o.jsx("td",{className:"text-zinc-200",children:U.reason}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:U.count})]},U.reason))})]}),ze==="notIndexed"&&!js&&(de.reasonGroups??[]).length===0&&de.notIndexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing State"}),o.jsx("th",{className:"text-left",children:"Coverage"})]})}),o.jsx("tbody",{children:de.notIndexed.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.coverageState??"Unknown"})]},U.id))})]}),ze==="notIndexed"&&js&&(()=>{const U=(de.reasonGroups??[]).find(fe=>fe.reason===js);return U?o.jsxs("div",{children:[o.jsx("div",{className:"flex items-center gap-2 mb-3",children:o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Vs(null),children:"\\u2190 Back to reasons"})}),o.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:U.reason}),o.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[U.count," affected page",U.count!==1?"s":""]})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ws,onClick:()=>{cs(U.urls.map(fe=>fe.url))},children:ws?"Requesting…":`Request indexing (${U.count})`})]}),o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Last Crawl"}),o.jsx("th",{className:"w-8"})]})}),o.jsx("tbody",{children:U.urls.map(fe=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:fe.url}),o.jsx("td",{className:"text-zinc-400",children:fe.crawlTime?fe.crawlTime.split("T")[0]:"—"}),o.jsx("td",{children:o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:ws,onClick:()=>{cs([fe.url])},title:"Request indexing",children:"Index"})})]},fe.id))})]})]}):null})(),ze==="deindexed"&&de.deindexed.length>0&&o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Detected"})]})}),o.jsx("tbody",{children:de.deindexed.map((U,fe)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.previousState}),o.jsx("td",{className:"text-zinc-400",children:U.currentState}),o.jsx("td",{className:"text-zinc-400",children:U.transitionDate.split("T")[0]})]},`${U.url}-${fe}`))})]}),(ze==="indexed"&&de.indexed.length===0||ze==="notIndexed"&&!js&&de.notIndexed.length===0||ze==="deindexed"&&de.deindexed.length===0)&&o.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),o.jsx("h3",{children:"Search performance"})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:O,onClick:()=>{Ys()},children:O?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const U=new Map;for(const He of f){const rt=U.get(He.date);rt?(rt.clicks+=He.clicks,rt.impressions+=He.impressions):U.set(He.date,{clicks:He.clicks,impressions:He.impressions})}const fe=[...U.entries()].sort(([He],[rt])=>He.localeCompare(rt));if(fe.length===0)return null;const at=Math.max(...fe.map(([,He])=>He.impressions),1),Qt=fe.reduce((He,[,rt])=>He+rt.clicks,0),Lt=fe.reduce((He,[,rt])=>He+rt.impressions,0),Et=Lt>0?(Qt/Lt*100).toFixed(1):"0.0",wt=700,Cn=220,en={top:12,bottom:36,left:48,right:12},ud=wt-en.left-en.right,Js=Cn-en.top-en.bottom,Xs=ud/fe.length,ds=Math.max(Math.min(Xs*.35,24),4),Da=Math.max(ds*.15,1),Ws=He=>{if(He<=0)return 1;const rt=Math.pow(10,Math.floor(Math.log10(He))),Gt=He/rt,on=Gt<=1.5?1.5:Gt<=3?3:Gt<=5?5:10;return Math.ceil(on*rt)},Xn=4,fs=Math.ceil(Ws(at)/Xn)*Xn,ei=Array.from({length:Xn+1},(He,rt)=>fs/Xn*rt),Mt=He=>He>=1e3?`${(He/1e3).toFixed(He>=1e4?0:1)}k`:String(He);return o.jsxs("div",{className:"mt-3",children:[o.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Qt.toLocaleString()})]})]}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),o.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",o.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Lt.toLocaleString()})]})]}),o.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",o.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Et,"%"]})]})]}),o.jsx("div",{className:"relative w-full",style:{aspectRatio:`${wt} / ${Cn}`},children:o.jsxs("svg",{viewBox:`0 0 ${wt} ${Cn}`,className:"h-full w-full",children:[ei.map((He,rt)=>{const Gt=en.top+Js-He/fs*Js;return o.jsxs("g",{children:[o.jsx("line",{x1:en.left,y1:Gt,x2:wt-en.right,y2:Gt,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),o.jsx("text",{x:en.left-6,y:Gt+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Mt(He)})]},`t-${rt}`)}),fe.map(([He,rt],Gt)=>{const on=en.left+Xs*Gt+Xs/2,La=rt.impressions/fs*Js,Fr=rt.clicks/fs*Js;return o.jsxs("g",{children:[o.jsx("title",{children:`${He}
|
|
234
234
|
Clicks: ${rt.clicks}
|
|
235
235
|
Impressions: ${rt.impressions}
|
|
236
|
-
CTR: ${rt.impressions>0?(rt.clicks/rt.impressions*100).toFixed(1):0}%`}),o.jsx("rect",{x:on-ds-La/2,y:en.top+Js-Da,width:ds,height:Math.max(Da,1),rx:2,fill:"#3b82f6",opacity:.85}),o.jsx("rect",{x:on+La/2,y:en.top+Js-Fr,width:ds,height:Math.max(Fr,1),rx:2,fill:"#10b981",opacity:.85})]},qe)}),(()=>{const qe=Math.min(fe.length,7);return Array.from({length:qe},(rt,Gt)=>{const on=fe.length===1?0:Math.round(Gt/(qe-1)*(fe.length-1)),Da=en.left+Xs*on+Xs/2;return o.jsx("text",{x:Da,y:Cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:fe[on][0].slice(5)},`xl-${on}`)})})()]})})]})})(),o.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:T.startDate,onChange:U=>A(fe=>({...fe,startDate:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:T.endDate,onChange:U=>A(fe=>({...fe,endDate:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:T.query,onChange:U=>A(fe=>({...fe,query:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:T.page,onChange:U=>A(fe=>({...fe,page:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:T.limit,onChange:U=>A(fe=>({...fe,limit:U.target.value}))})]}),f.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Date"}),o.jsx("th",{className:"text-left",children:"Query"}),o.jsx("th",{className:"text-left",children:"Page"}),o.jsx("th",{className:"text-right",children:"Clicks"}),o.jsx("th",{className:"text-right",children:"Impressions"}),o.jsx("th",{className:"text-right",children:"CTR"}),o.jsx("th",{className:"text-right",children:"Position"})]})}),o.jsx("tbody",{children:f.map((U,fe)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-zinc-400",children:U.date}),o.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:U.query}),o.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:U.page}),o.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:U.clicks.toLocaleString()}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:U.impressions.toLocaleString()}),o.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(U.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:U.position.toFixed(1)})]},`${U.date}:${U.query}:${U.page}:${fe}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),o.jsx("h3",{children:"Inspect a URL"})]})}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:k,onChange:U=>E(U.target.value),onKeyDown:U=>U.key==="Enter"&&void Kr()}),o.jsx(ce,{type:"button",size:"sm",disabled:ue||!ae?.propertyId||!k.trim(),onClick:Kr,children:ue?"Inspecting…":"Inspect URL"})]}),b&&o.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.indexingState??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.verdict??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Ux(b.isMobileFriendly)})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:vs(b.crawlTime)})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),o.jsx("h3",{children:"Inspection log"})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ie,onClick:()=>{Ns()},children:ie?"Loading…":"Refresh history"})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:P,onChange:U=>J(U.target.value)}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:ie,onClick:()=>{Ns()},children:"Apply filter"})]}),p.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Coverage"}),o.jsx("th",{className:"text-left",children:"Mobile"}),o.jsx("th",{className:"text-left",children:"Inspected"})]})}),o.jsx("tbody",{children:p.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-300",children:U.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.coverageState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Ux(U.isMobileFriendly)}),o.jsx("td",{className:"text-zinc-400",children:vs(U.inspectedAt)})]},U.id))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),o.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Changed at"})]})}),o.jsx("tbody",{children:y.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.previousState??"Unknown"}),o.jsx("td",{className:"text-zinc-300",children:U.currentState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:vs(U.transitionDate)})]},`${U.url}:${U.transitionDate}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ae&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:o.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Be(U=>!U),children:[o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${Ie?"rotate-90":""}`,"aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),o.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Ie&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),o.jsx("h3",{children:"Pick the Search Console property"})]})}),o.jsxs("div",{className:"mt-3 space-y-2",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),o.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:G||c.length===0,onChange:U=>C(U.target.value),children:c.length===0?o.jsx("option",{value:"",children:G?"Loading properties…":"No properties available"}):c.map(U=>o.jsxs("option",{value:U.siteUrl,children:[U.siteUrl," · ",U.permissionLevel]},U.siteUrl))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{gl(ae)},children:G?"Refreshing…":"Refresh properties"}),o.jsx(ce,{type:"button",size:"sm",disabled:!S||q,onClick:xl,children:q?"Saving…":"Save property"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),o.jsx("h3",{children:"Import GSC performance data"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),o.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:R,onChange:U=>_(U.target.value)})]}),o.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[o.jsx("input",{type:"checkbox",checked:D,onChange:U=>M(U.target.checked)}),"Replace existing imported rows for the requested range"]})]}),o.jsx(ce,{type:"button",size:"sm",disabled:je||!ae.propertyId,onClick:bl,children:je?"Queueing…":"Queue sync"}),!ae.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),o.jsx("h3",{children:"Sitemap configuration"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[ae.sitemapUrl&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ae.sitemapUrl})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:sn||!ae.propertyId,onClick:()=>{vl()},children:sn?"Loading…":"Browse sitemaps from GSC"}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:We||!ae.propertyId,onClick:yl,children:We?"Discovering…":"Auto-discover and queue inspection"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),an&&an.length>0&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[o.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",an.length,")"]}),an.map(U=>{const fe=U.contents?.[0];return o.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-200 break-all",children:U.path}),U.lastSubmitted&&o.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",U.lastSubmitted.split("T")[0]]})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[fe&&o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-zinc-300",children:[fe.indexed," / ",fe.submitted]}),o.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>zt(U.path),children:"Use"})]})]},U.path)})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ae.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:_t,onChange:U=>zt(U.target.value),onKeyDown:U=>U.key==="Enter"&&_t.trim()&&void us()}),o.jsx(ce,{type:"button",size:"sm",disabled:mn||!_t.trim(),onClick:us,children:mn?"Saving…":ae.sitemapUrl?"Update":"Save"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:it||!ae.propertyId,onClick:()=>{const fe=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ae.sitemapUrl||void 0;me(!0),Xw(e,{sitemapUrl:fe}).then(at=>{Ve(`Sitemap inspection queued (run ${at.id}). Refresh coverage after the run completes.`)}).catch(at=>{_e(at instanceof Error?at.message:"Failed to queue sitemap inspection")}).finally(()=>me(!1))},children:it?"Queueing…":"Inspect sitemap"})]}),!ae.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function s4({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,m]=N.useState(null),[p,v]=N.useState(e.displayName),[y,x]=N.useState(e.canonicalDomain),[b,w]=N.useState(e.country),[S,C]=N.useState(e.language),[k,E]=N.useState(e.ownedDomains??[]),[R,_]=N.useState(""),[D,M]=N.useState(null),[T,A]=N.useState(!1),[P,J]=N.useState(!1),[Q,se]=N.useState(""),[pe,ke]=N.useState(""),[je,B]=N.useState(""),[G,oe]=N.useState(""),[q,X]=N.useState("");N.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function O(){r(!1),m(null),v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]),_("")}function F(){const me=R.trim();me&&(k.includes(me)||E([...k,me]),_(""))}function ie(me){E(k.filter(We=>We!==me))}async function re(){if(!(!p.trim()||!y.trim()||!b.trim()||!S.trim())){d(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),r(!1)}catch(me){m(me instanceof Error?me.message:"Failed to save")}finally{d(!1)}}}async function ue(){const me=Q.trim(),We=pe.trim(),dt=je.trim(),sn=G.trim();if(!(!me||!We||!dt||!sn)){A(!0),M(null);try{const kt={label:me,city:We,region:dt,country:sn};q.trim()&&(kt.timezone=q.trim()),await _w(e.name,kt),s(),se(""),ke(""),B(""),oe(""),X(""),J(!1)}catch(kt){M(kt instanceof Error?kt.message:"Failed to add location")}finally{A(!1)}}}async function he(me){A(!0),M(null);try{await zw(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to remove location")}finally{A(!1)}}async function de(me){A(!0),M(null);try{await Ew(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to set default location")}finally{A(!1)}}const Me=p!==e.displayName||y!==e.canonicalDomain||b!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ge="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",Ze="block text-xs font-medium text-zinc-400 mb-1",it=Q.trim()&&pe.trim()&&je.trim()&&G.trim();return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),o.jsx("h2",{children:"Project settings"})]}),!a&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[f,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>m(null),children:"×"})]}),a?o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Display name"}),o.jsx("input",{className:ge,type:"text",value:p,onChange:me=>v(me.target.value),placeholder:"My Project"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Canonical domain"}),o.jsx("input",{className:ge,type:"text",value:y,onChange:me=>x(me.target.value),placeholder:"example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Country"}),o.jsx("input",{className:ge,type:"text",value:b,onChange:me=>w(me.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Language"}),o.jsx("input",{className:ge,type:"text",value:S,onChange:me=>C(me.target.value),placeholder:"en"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Owned domains"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(me=>o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[me,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ie(me),"aria-label":`Remove ${me}`,children:"×"})]},me))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:me=>_(me.target.value),onKeyDown:me=>me.key==="Enter"&&(me.preventDefault(),F())}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:F,children:"Add"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[o.jsx(ce,{type:"button",disabled:c||!Me||!p.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),o.jsx(ce,{type:"button",variant:"outline",disabled:c,onClick:O,children:"Cancel"})]})]}):o.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:o.jsx("table",{className:"w-full text-sm",children:o.jsxs("tbody",{children:[o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),o.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?o.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(me=>o.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:me},me))}):o.jsx("span",{className:"text-zinc-500",children:"\\u2014"})})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),o.jsxs("td",{className:"px-4 py-2.5",children:[D&&o.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[D,o.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(null),children:"×"})]}),(e.locations??[]).length>0?o.jsxs("table",{className:"w-full text-xs mb-2",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-zinc-600",children:[o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),o.jsx("th",{className:"pb-1"})]})}),o.jsx("tbody",{children:e.locations.map(me=>o.jsxs("tr",{className:"border-t border-zinc-800/30",children:[o.jsx("td",{className:"py-1.5 pr-3",children:o.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${me.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[me.label,me.label===e.defaultLocation?" ★":""]})}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.city}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.region}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.country}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:me.timezone??"—"}),o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[me.label!==e.defaultLocation&&o.jsx("button",{type:"button",disabled:T,onClick:()=>de(me.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${me.label} as default location`,children:"Set default"}),o.jsx("button",{type:"button",disabled:T,onClick:()=>he(me.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${me.label}`,children:"Remove"})]})})]},me.label))})]}):o.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),P?o.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),o.jsx("input",{className:ge,type:"text",value:Q,onChange:me=>se(me.target.value),placeholder:"nyc"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),o.jsx("input",{className:ge,type:"text",value:pe,onChange:me=>ke(me.target.value),placeholder:"New York"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),o.jsx("input",{className:ge,type:"text",value:je,onChange:me=>B(me.target.value),placeholder:"NY"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),o.jsx("input",{className:ge,type:"text",value:G,onChange:me=>oe(me.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),o.jsx("input",{className:ge,type:"text",value:q,onChange:me=>X(me.target.value),placeholder:"America/New_York"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(ce,{type:"button",size:"sm",disabled:T||!it,onClick:ue,children:T?"Adding...":"Add location"}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:T,onClick:()=>{J(!1),M(null)},children:"Cancel"})]})]}):o.jsx(ce,{type:"button",size:"sm",variant:"outline",onClick:()=>J(!0),children:"+ Add location"})]})]})]})})})]})}const i4=[{value:"daily",label:"Every day"},{value:"weekly@mon",label:"Every Monday"},{value:"weekly@wed",label:"Every Wednesday"},{value:"weekly@fri",label:"Every Friday"},{value:"twice-daily",label:"Twice a day (6am & 6pm)"},{value:"custom",label:"Custom cron expression"}],Zb=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function a4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,m]=N.useState(6),[p,v]=N.useState(""),[y,x]=N.useState("UTC"),[b,w]=N.useState(!1),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,_]=N.useState(!1),[D,M]=N.useState(null);N.useEffect(()=>{Lw(e).then(s).catch(()=>s(null))},[e]);const T=()=>{if(t&&t!=="loading"){const Q=q2(t.preset??null,t.cronExpr);d(Q.freq),m(Q.hour),v(Q.customCron);const se=Zb.includes(t.timezone);x(se?t.timezone:"Other"),w(!se),C(se?"":t.timezone)}else d("daily"),m(6),v(""),x("UTC"),w(!1),C("");M(null),r(!0)},A=async()=>{E(!0),M(null);try{const se={timezone:b?S.trim()||"UTC":y};c==="custom"?se.cron=p.trim():se.preset=B2(c,f);const pe=await Rm(e,se);s(pe),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},P=async()=>{if(!(!t||t==="loading")){E(!0),M(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await Rm(e,Q))}catch(Q){M(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},J=async()=>{_(!0),M(null);try{await Dw(e),s(null),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{_(!1)}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:T,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&o.jsx(Le,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&o.jsxs(Le,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:H2(t.preset??null,t.cronExpr,t.timezone)}),o.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",o.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsx(nt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:P,children:t.enabled?"Pause":"Resume"}),o.jsx(ce,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:J,children:R?"Removing...":"Remove"})]})]}),D&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:D})]}),a&&o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:c,onChange:Q=>d(Q.target.value),children:i4.map(Q=>o.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>m(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>o.jsx("option",{value:se,children:vm(se)},se))})]})]}),c==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:p,onChange:Q=>v(Q.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),o.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:b?"Other":y,onChange:Q=>{Q.target.value==="Other"?(w(!0),x("Other")):(w(!1),x(Q.target.value))},children:[Zb.map(Q=>o.jsx("option",{value:Q,children:Q},Q)),o.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),b&&o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:Q=>C(Q.target.value)})]}),D&&o.jsx("p",{className:"text-rose-400 text-sm",children:D}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),M(null)},children:"Cancel"}),o.jsx(ce,{type:"button",size:"sm",disabled:k||c==="custom"&&!p.trim(),onClick:A,children:k?"Saving...":"Save schedule"})]})]})]})}const r4=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function o4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,m]=N.useState(["citation.lost","citation.gained"]),[p,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState({});N.useEffect(()=>{Mw(e).then(s).catch(()=>s([]))},[e]);const S=R=>{m(_=>_.includes(R)?_.filter(D=>D!==R):[..._,R])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),x(null);try{const R=await $w(e,{channel:"webhook",url:c.trim(),events:f});s(_=>_==="loading"?[R]:[..._,R]),d(""),m(["citation.lost","citation.gained"]),r(!1)}catch(R){x(R instanceof Error?R.message:"Failed to add webhook")}finally{v(!1)}}},k=async R=>{try{await Uw(e,R),s(_=>_==="loading"?_:_.filter(D=>D.id!==R))}catch(_){x(_ instanceof Error?_.message:"Failed to remove webhook")}},E=async R=>{w(_=>({..._,[R]:{state:"testing"}}));try{const _=await Pw(e,R);w(D=>({...D,[R]:{state:_.ok?"ok":"fail",status:_.status}}))}catch{w(_=>({..._,[R]:{state:"fail"}}))}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),x(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:c,onChange:R=>d(R.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),o.jsx("div",{className:"flex flex-wrap gap-3",children:r4.map(R=>o.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[o.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),o.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm",children:y}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),x(null)},children:"Cancel"}),o.jsx(ce,{type:"button",size:"sm",disabled:p||!c.trim()||f.length===0,onClick:C,children:p?"Adding...":"Add webhook"})]})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&o.jsx(Le,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&o.jsxs("div",{className:"evidence-table-wrap",children:[o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"URL"}),o.jsx("th",{children:"Events"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:t.map(R=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-keyword-cell",children:o.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:R.url})}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(_=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:_.replace("."," ")},_))})}),o.jsx("td",{children:o.jsx(nt,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[b[R.id]&&(()=>{const _=b[R.id],D=_.state==="testing"?"Sending…":_.state==="ok"?`Delivered${_.status?` (${_.status})`:""}`:`Failed${_.status?` (${_.status})`:""}`;return o.jsx(nt,{tone:_.state==="ok"?"positive":_.state==="fail"?"negative":"neutral",children:D})})(),o.jsx(ce,{variant:"ghost",size:"sm",type:"button",disabled:b[R.id]?.state==="testing",onClick:()=>E(R.id),children:"Test"}),o.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(R.id),children:"Remove"})]})})]},R.id))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function Vb({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:d,note:f,updatedAt:m,active:p,onClick:v}){return o.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${p?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),o.jsx("h3",{children:t})]}),o.jsx(nt,{tone:a,children:s})]}),o.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:r}),o.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:d})]})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx("span",{children:f}),o.jsx("span",{children:m?`Updated ${vs(m)}`:"No recent sync yet"})]})]})}function sm({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="negative"?"text-rose-400":"text-zinc-200";return o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),o.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function l4({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState([]),[c,d]=N.useState(null),[f,m]=N.useState([]),[p,v]=N.useState([]),[y,x]=N.useState(null),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,_]=N.useState(!0),[D,M]=N.useState(null),[T,A]=N.useState(null),[P,J]=N.useState("coverage");N.useEffect(()=>{Q()},[e]);async function Q(){_(!0),M(null);try{const q=await Dp(e);if(s(q),q.connected){const[X,O,F]=await Promise.all([Qu(e).catch(()=>null),Mp(e).catch(()=>[]),rN(e).catch(()=>[])]);X&&d(X),m(O),v(F)}}catch(q){M(q instanceof Error?q.message:"Failed to load Bing data")}finally{_(!1)}}async function se(){if(S.trim()){M(null);try{const q=await nN(e,S.trim());C(""),q.availableSites.length>0&&r(q.availableSites),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to connect")}}}async function pe(){try{await sN(e),s(null),r([]),d(null),m([]),v([]),x(null),E(""),M(null)}catch(q){M(q instanceof Error?q.message:"Failed to disconnect")}}async function ke(){if(k)try{await aN(e,k),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to set site")}}async function je(){if(b.trim())try{const q=await $p(e,b.trim());x(q),m(X=>[q,...X])}catch(q){M(q instanceof Error?q.message:"Inspection failed")}}async function B(q){try{await Om(e,{urls:[q]}),M(null),A(`Submitted to Bing: ${q}`),setTimeout(()=>A(null),4e3)}catch(X){M(X instanceof Error?X.message:"Submission failed")}}async function G(){try{const q=await Om(e,{allUnindexed:!0});M(null);const{succeeded:X,total:O}=q.summary;A(`Submitted ${X}/${O} URL${O!==1?"s":""} to Bing`),setTimeout(()=>A(null),4e3)}catch(q){M(q instanceof Error?q.message:"Batch submission failed")}}if(R)return o.jsx(Le,{className:"surface-card",children:o.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(nt,{tone:"caution",children:"Not connected"})]}),o.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),o.jsxs("div",{className:"mt-3",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:S,onChange:q=>C(q.target.value),onKeyDown:q=>q.key==="Enter"&&se()}),o.jsx(ce,{size:"sm",disabled:!S.trim(),onClick:se,children:"Connect"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),D&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:D})]});if(!t.siteUrl)return o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nt,{tone:"positive",children:"Connected"}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.domain})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?vs(t.updatedAt):"—"})]})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:k,onChange:q=>E(q.target.value),children:[o.jsx("option",{value:"",children:"Select a site..."}),a.map(q=>o.jsxs("option",{value:q.url,children:[q.url,q.verified?" (verified)":""]},q.url))]}),o.jsx(ce,{size:"sm",disabled:!k,onClick:ke,children:"Set Site"})]}):o.jsx("div",{className:"mt-3",children:o.jsx(ce,{size:"sm",onClick:async()=>{const q=await iN(e);r(q.sites)},children:"Load Sites"})})]})]}),D&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:D})]});const oe=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nt,{tone:"positive",children:"Connected"}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),D&&o.jsx("p",{className:"mb-3 text-xs text-rose-400",children:D}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",o.jsx("code",{children:t.siteUrl}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.siteUrl})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?vs(t.updatedAt):"—"})]})]})]})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index monitoring"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${vs(c.lastInspectedAt)}`:"No inspection history yet"})]}),o.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:oe.map(q=>o.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${P===q.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>J(q.key),children:q.label},q.key))}),P==="coverage"&&c&&o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsx(sm,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),o.jsx(sm,{label:"Not indexed",value:c.summary.notIndexed,tone:"negative"}),o.jsx(sm,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[T&&o.jsx("span",{className:"text-xs text-emerald-400",children:T}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:G,children:"Submit all to Bing"})]})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:c.notIndexed.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>B(q.url),children:"Submit"})})]},q.id))})]})})]}),c.indexed.length>0&&o.jsxs("div",{children:[o.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),o.jsx("tbody",{children:c.indexed.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?vs(q.lastCrawledDate):"—"})]},q.id))})]})})]})]}),P==="coverage"&&!c&&o.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),P==="inspections"&&o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:q=>w(q.target.value),onKeyDown:q=>q.key==="Enter"&&je()}),o.jsx(ce,{size:"sm",disabled:!b.trim(),onClick:je,children:"Inspect"})]}),y&&o.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[o.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),o.jsxs("div",{className:"text-zinc-400",children:["In Index: ",o.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),o.jsx("tbody",{children:f.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3",children:o.jsx(nt,{tone:q.inIndex?"positive":"negative",children:q.inIndex?"Yes":"No"})}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:vs(q.inspectedAt)})]},q.id))})]})})]}),P==="performance"&&o.jsx("div",{className:"mt-4",children:p.length===0?o.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),o.jsx("tbody",{children:p.map((q,X)=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.query}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:q.clicks}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.impressions}),o.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(q.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.averagePosition.toFixed(1)})]},X))})]})})})]})]})}function c4({projectName:e}){const[t,s]=N.useState("google"),[a,r]=N.useState(!0),[c,d]=N.useState("idle"),[f,m]=N.useState(null),p=N.useRef(null),[v,y]=N.useState(!1),[x,b]=N.useState(null),[w,S]=N.useState(null),[C,k]=N.useState(!1),[E,R]=N.useState(null),[_,D]=N.useState(null);async function M(oe=!1){oe||r(!0),m(null);try{const[q,X,O]=await Promise.all([Zu().catch(()=>null),Op(e).catch(()=>[]),Dp(e).catch(()=>null)]),F=X.find(ue=>ue.connectionType==="gsc")??null;y(!!q?.google?.configured),k(!!q?.bing?.configured),b(F),R(O);const[ie,re]=await Promise.all([F?Vu(e).catch(()=>null):Promise.resolve(null),O?.connected?Qu(e).catch(()=>null):Promise.resolve(null)]);S(ie),D(re)}catch(q){m(q instanceof Error?q.message:"Failed to load search console overview")}finally{r(!1)}}async function T(){if(c!=="idle")return;p.current?.abort();const oe=new AbortController;p.current=oe;const q=oe.signal;d("syncing"),m(null);const X=[];try{async function O(){if(!x)return;const ue=await Lp(e);if(!ue?.id)return;const he=2e3,Me=Date.now()+12e4;for(;Date.now()<Me;){if(q.aborted||(await new Promise(Ze=>setTimeout(Ze,he)),q.aborted))return;const ge=await Lr(ue.id).catch(()=>null);if(!ge)break;if(["completed","failed","cancelled"].includes(ge.status)){ge.status!=="completed"&&X.push(`Google sync ${ge.status}`);break}}}const F=10;async function ie(){if(!E?.connected)return;const ue=await Mp(e).catch(()=>[]),he=[...new Set(ue.map(de=>de.url))];if(he.length!==0)for(let de=0;de<he.length;de+=F){if(q.aborted)return;const Me=he.slice(de,de+F),Ze=(await Promise.allSettled(Me.map(it=>$p(e,it)))).filter(it=>it.status==="rejected").length;Ze>0&&X.push(`${Ze} Bing inspection(s) failed`)}}const re=await Promise.allSettled([O(),ie()]);for(const ue of re)ue.status==="rejected"&&X.push(ue.reason instanceof Error?ue.reason.message:"Sync failed");if(q.aborted)return;d("reloading"),await M(!0),X.length>0&&m(`Partial refresh: ${X.join("; ")}`)}catch(O){q.aborted||m(O instanceof Error?O.message:"Refresh failed")}finally{q.aborted||d("idle")}}N.useEffect(()=>(M(),()=>{p.current?.abort()}),[e]);const A=x?"positive":v?"caution":"negative",P=x?"Connected":v?"Ready to connect":"Needs setup",J=w?`${w.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",se=w?.lastInspectedAt??x?.updatedAt??null,pe=E?.connected?"positive":C?"caution":"negative",ke=E?.connected?"Connected":C?"Ready to connect":"Needs setup",je=_?`${_.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",B=_?`${_.summary.notIndexed} not indexed`:E?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",G=_?.lastInspectedAt??E?.updatedAt??null;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),o.jsx("h2",{children:"Search Engine Intelligence"}),o.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{T()},children:a?"Loading…":c==="syncing"?"Querying Google & Bing…":c==="reloading"?"Reloading…":"Refresh overview"})]}),f&&o.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:f}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsx(Vb,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":P,tone:a?"neutral":A,targetLabel:"Selected property",targetValue:x?.propertyId??"No property selected",coverageValue:a?"Loading…":J,note:a?"Loading overview…":Q,updatedAt:se,active:t==="google",onClick:()=>s("google")}),o.jsx(Vb,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ke,tone:a?"neutral":pe,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:a?"Loading…":je,note:a?"Loading overview…":B,updatedAt:G,active:t==="bing",onClick:()=>s("bing")})]})]}),o.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([oe,q])=>o.jsx("button",{type:"button",role:"tab","aria-selected":t===oe,className:`project-subnav-link ${t===oe?"project-subnav-link-active":""}`,onClick:()=>s(oe),children:q},oe))}),t==="google"&&o.jsx(n4,{projectName:e}),t==="bing"&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),o.jsx("h2",{children:"Bing Webmaster Tools"})]})}),o.jsx(l4,{projectName:e})]})]})}function u4({insights:e}){const{openEvidence:t}=ul(),[s,a]=N.useState(null);return o.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,d=r.affectedPhrases.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:`insight-row insight-row-${r.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>a(c?null:r.id):void 0,children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&o.jsx(Mu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),o.jsx(nt,{tone:r.tone,children:r.actionLabel}),o.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),o.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),d&&o.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&o.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(zm,{state:f.citationState}),o.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),o.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&o.jsx(tl,{provider:f.provider})})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:m=>{m.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function ld({tab:e}){const{projectId:t}=Lu({from:"/projects/$projectId"}),s=ka(),{dashboard:a,isLoading:r,refetch:c}=Ra();if(!a||r)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-48"}),o.jsx("div",{className:"skeleton-text-sm w-32"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(le=>o.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[o.jsx("div",{className:"skeleton-circle size-20"}),o.jsx("div",{className:"skeleton-text w-16 mt-3"})]},le))}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(le=>o.jsx("div",{className:"skeleton-text-sm w-full"},le))})]})]});const d=BD(a,t),[f,m]=N.useState(!1),[p,v]=N.useState(!1),[y,x]=N.useState(!1),[b,w]=N.useState(null),[S,C]=N.useState(!1),[k,E]=N.useState(""),[R,_]=N.useState(!1),[D,M]=N.useState(!1),[T,A]=N.useState(""),[P,J]=N.useState(!1),[Q,se]=N.useState(!1),[pe,ke]=N.useState(""),[je,B]=N.useState(!1),[G,oe]=N.useState(void 0),[q,X]=N.useState(!1),[O,F]=N.useState(null),[ie,re]=N.useState(!1),ue=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ue.map(le=>le.location??"")),[ue]),Me=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(G===void 0||G===""||!he){F(null),re(!1);return}re(!0),Rp(he,G).then(le=>{F(le),re(!1)}).catch(()=>{F(null),re(!1)})},[G,he]);const Ze=N.useMemo(()=>{if(!O)return null;const le=new Map;for(const Ie of O){for(const[Be,ze]of Object.entries(Ie.providerRuns??{}))le.set(`${Ie.keyword}::${Be}`,ze.map($e=>({runId:$e.runId,citationState:$e.citationState,createdAt:$e.createdAt})));(!Ie.providerRuns||Object.keys(Ie.providerRuns).length===0)&&le.set(`${Ie.keyword}::`,Ie.runs.map(Be=>({runId:Be.runId,citationState:Be.citationState,createdAt:Be.createdAt})))}return le},[O]),it=N.useMemo(()=>{const le=G!==void 0?ue.filter(Ie=>G===""?!Ie.location:Ie.location===G):ue;return Ze?le.map(Ie=>{const Be=Ze.get(`${Ie.keyword}::${Ie.provider}`)??Ze.get(`${Ie.keyword}::`);return Be?{...Ie,runHistory:Be}:Ie}):le},[ue,G,Ze]);if(!d)return o.jsx("div",{className:"page-container",children:o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Project not found"}),o.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),o.jsx(ce,{asChild:!0,children:o.jsx(yt,{to:"/",children:"Return to overview"})})]})});async function me(){x(!0),w(null);try{await Ap(he),c()}catch(le){w(le instanceof Error?le.message:"Failed to trigger run")}finally{x(!1)}}async function We(){v(!0);try{await Rw(he),s({to:"/"}),c()}catch(le){console.error("Failed to delete project:",le)}finally{v(!1)}}async function dt(){const le=await Tw(he),Ie=typeof le=="string"?le:JSON.stringify(le,null,2),Be=new Blob([Ie],{type:"text/yaml"}),ze=URL.createObjectURL(Be),$e=document.createElement("a");$e.href=ze,$e.download=`${he}.yaml`,$e.click()}async function sn(){const le=k.split(`
|
|
237
|
-
`).map(Ie=>Ie.trim()).filter(Boolean);if(le.length!==0){_(!0);try{await Cw(he,le),c(),E(""),C(!1)}finally{_(!1)}}}async function kt(){const le=T.trim();if(le){J(!0);try{const Be=(await Ep(he)).map($e=>$e.domain),ze=[...new Set([...Be,le])];await Tp(he,ze),c(),A(""),M(!1)}finally{J(!1)}}}async function an(){const le=pe.trim();if(le){B(!0);try{const Ie=d?.project.ownedDomains??[];await Em(he,[...Ie,le]),c(),ke(""),se(!1)}finally{B(!1)}}}async function Vt(le){B(!0);try{const Ie=d?.project.ownedDomains??[];await Em(he,Ie.filter(Be=>Be!==le)),c()}finally{B(!1)}}async function _t(le,Ie){await kw(le,Ie),c()}const zt=le=>!Number.isNaN(Number.parseInt(le,10)),mn=[{key:"overview",label:"Overview",href:`/projects/${d.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${d.project.id}/search-console`},{key:"analytics",label:"Analytics",href:`/projects/${d.project.id}/analytics`},{key:"traffic",label:"Traffic",href:`/projects/${d.project.id}/traffic`}];return o.jsxs("div",{className:"page-container",children:[f?o.jsxs(Le,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[o.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),o.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",o.jsx("strong",{className:"text-zinc-200",children:d.project.displayName||d.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ce,{type:"button",variant:"destructive",disabled:p,onClick:We,children:p?"Deleting...":"Yes, delete project"}),o.jsx(ce,{type:"button",variant:"outline",disabled:p,onClick:()=>m(!1),children:"Cancel"})]})]}):null,o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),o.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&o.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>se(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),o.jsxs("div",{className:"tag-row",children:[o.jsx("span",{className:"tag",children:d.project.country}),o.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(le=>o.jsx("span",{className:"tag",children:le},le))]}),((d.project.ownedDomains??[]).length>0||Q)&&o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(d.project.ownedDomains??[]).map(le=>o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[le,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:je,onClick:()=>Vt(le),"aria-label":`Remove ${le}`,children:"×"})]},le)),Q?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:pe,onChange:le=>ke(le.target.value),onKeyDown:le=>le.key==="Enter"&&an(),autoFocus:!0}),o.jsx(ce,{type:"button",size:"sm",disabled:!pe.trim()||je,onClick:an,children:je?"...":"Add"}),o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!1),ke("")},children:"Cancel"})]}):o.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>se(!0),children:"+ domain"})]})]}),o.jsxs("div",{className:"page-header-right",children:[o.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:dt,"aria-label":"Export project as YAML",children:o.jsx(m2,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:()=>m(!0),"aria-label":"Delete project",children:o.jsx(L2,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(ce,{type:"button",disabled:y,onClick:me,children:y?"Starting...":"Run now"})]})]})]}),b&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[b,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>w(null),children:"×"})]}),o.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:mn.map(le=>o.jsx(yt,{to:le.href,className:`project-subnav-link ${le.key===e?"project-subnav-link-active":""}`,"aria-current":le.key===e?"page":void 0,children:le.label},le.key))}),e==="overview"?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"gauge-row",children:[o.jsx(s1,{value:d.visibilitySummary.value,label:d.visibilitySummary.label,delta:d.visibilitySummary.delta,tone:d.visibilitySummary.tone,description:d.visibilitySummary.description,tooltip:d.visibilitySummary.tooltip,isNumeric:zt(d.visibilitySummary.value),progress:d.visibilitySummary.progress}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",o.jsx(bs,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:d.gapKeyPhrases.value}),o.jsxs("span",{className:"text-zinc-600",children:[" / ",d.keywordCounts.total]})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${d.gapKeyPhrases.tone}`,style:{width:d.gapKeyPhrases.progress!==void 0?`${d.gapKeyPhrases.progress*100}%`:"0%"}})}),o.jsx("p",{className:"metric-card-detail",children:d.gapKeyPhrases.delta}),o.jsx("p",{className:"metric-card-sub",children:d.gapKeyPhrases.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",o.jsx(bs,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:d.indexCoverage.value}),o.jsx("span",{className:"text-zinc-600",children:"%"})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${d.indexCoverage.tone}`,style:{width:`${Number.parseInt(d.indexCoverage.value,10)||0}%`}})}),o.jsx("p",{className:"metric-card-detail",children:d.indexCoverage.delta}),o.jsx("p",{className:"metric-card-sub",children:d.indexCoverage.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",o.jsx(bs,{text:"Keyword-level citation changes compared to the previous completed run."})]}),d.movementSummary.hasPreviousRun?o.jsxs("div",{className:"metric-card-movement",children:[o.jsxs("span",{className:d.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",d.movementSummary.gained," gained"]}),o.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),o.jsxs("span",{className:d.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",d.movementSummary.lost," lost"]})]}):o.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),o.jsx("p",{className:"metric-card-sub mt-auto",children:d.movementSummary.gained===0&&d.movementSummary.lost===0&&d.movementSummary.hasPreviousRun?"No changes since last run":d.movementSummary.gained>d.movementSummary.lost?"Visibility improving":d.movementSummary.lost>d.movementSummary.gained?"Visibility declining":""})]})]}),d.providerScores.length>1&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),o.jsxs("h2",{children:["Visibility by model ",o.jsx(bs,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Model"}),o.jsx("th",{children:"Score"}),o.jsx("th",{children:"Cited key phrases"})]})}),o.jsx("tbody",{children:d.providerScores.map(le=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[o.jsx(tl,{provider:le.provider}),le.model&&o.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:le.model})]})}),o.jsx("td",{children:o.jsxs("span",{className:`font-semibold ${le.score>=70?"text-emerald-400":le.score>=40?"text-amber-400":"text-rose-400"}`,children:[le.score,"%"]})}),o.jsxs("td",{className:"text-zinc-500",children:[le.cited," of ",le.total]})]},`${le.provider}::${le.model??"unknown"}`))})]})})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),o.jsx("h2",{children:"Citation signals"})]})}),o.jsx(u4,{insights:d.insights})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),o.jsx("h2",{children:"Key phrase citation tracking"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(le=>le.keyword)).size," key phrases tracked"]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!S),children:S?"Cancel":"+ Add key phrases"})]})]}),S&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:k,onChange:le=>E(le.target.value)}),o.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[o.jsxs("p",{className:"text-xs text-zinc-500",children:[k.split(`
|
|
238
|
-
`).filter(le=>le.trim()).length," key phrases"]}),o.jsx(ce,{type:"button",size:"sm",disabled:!k.trim()||R,onClick:sn,children:R?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.project.locations.length>0&&o.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[o.jsx("button",{className:`filter-chip ${G===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":G===void 0,onClick:()=>{oe(void 0)},children:"All locations"}),d.project.locations.map(le=>de.has(le.label)&&o.jsx("button",{className:`filter-chip ${G===le.label?"filter-chip-active":""}`,type:"button","aria-pressed":G===le.label,onClick:()=>{oe(le.label),X(!1)},children:le.label},le.label)),Me&&o.jsx("button",{className:`filter-chip ${G===""?"filter-chip-active":""}`,type:"button","aria-pressed":G==="",onClick:()=>{oe(""),X(!1)},children:"No location"}),ge.length>1&&G===void 0&&o.jsx("button",{className:`filter-chip filter-chip-compare ${q?"filter-chip-active":""}`,type:"button","aria-pressed":q,onClick:()=>X(le=>!le),title:"Side-by-side location comparison",children:"Compare"})]}),o.jsx(G3,{evidence:it})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),o.jsx("h2",{children:"Competitive landscape"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[d.competitors.length," tracked"]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>M(!D),children:D?"Cancel":"+ Add competitor"})]})]}),D&&o.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:T,onChange:le=>A(le.target.value),onKeyDown:le=>le.key==="Enter"&&kt()}),o.jsx(ce,{type:"button",size:"sm",disabled:!T.trim()||P,onClick:kt,children:P?"Adding...":"Add"})]}),o.jsx(K3,{competitors:d.competitors})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),o.jsx("h2",{children:"Recent execution history"})]})}),o.jsx("div",{className:"run-list",children:d.recentRuns.map(le=>o.jsx(n1,{run:le},le.id))})]}),o.jsx(s4,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:_t,onRefresh:()=>{c()}}),o.jsx(a4,{projectName:d.project.name}),o.jsx(o4,{projectName:d.project.name})]}):e==="analytics"?o.jsx(V3,{projectName:d.project.name}):e==="traffic"?o.jsx(W3,{projectName:d.project.name}):o.jsx(c4,{projectName:d.project.name})]})}const d4="modulepreload",f4=function(e,t){return new URL(e,t).href},Qb={},h4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let p=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),m=f?.nonce||f?.getAttribute("nonce");r=p(s.map(v=>{if(v=f4(v,a),v in Qb)return;Qb[v]=!0;const y=v.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(a)for(let w=d.length-1;w>=0;w--){const S=d[w];if(S.href===v&&(!y||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${x}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":d4,y||(b.as="script"),b.crossOrigin="",b.href=v,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((w,S)=>{b.addEventListener("load",w),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return r.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function m4(){const{dashboard:e,isLoading:t}=Ra();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-20"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 space-y-1.5",children:[o.jsx("div",{className:"skeleton-text w-40"}),o.jsx("div",{className:"skeleton-text-sm w-56"})]}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const s=e.runs,[a,r]=N.useState("all"),c=a==="all"?s:s.filter(f=>f.status===a),d=()=>{h4(async()=>{const{triggerAllRuns:f}=await Promise.resolve().then(()=>LD);return{triggerAllRuns:f}},void 0,import.meta.url).then(({triggerAllRuns:f})=>f().catch(m=>{console.error("Failed to trigger all runs",m)}))};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Runs"}),o.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:d,children:"Run all projects"})]}),o.jsxs("section",{children:[o.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>o.jsx("button",{className:`filter-chip ${a===f?"filter-chip-active":""}`,type:"button","aria-pressed":a===f,onClick:()=>r(f),children:f==="all"?"All runs":Uu(f)},f))}),o.jsx("div",{className:"run-list",children:c.length>0?c.map(f=>o.jsx(n1,{run:f},f.id)):o.jsxs(Le,{className:"surface-card empty-card",children:[o.jsx("h2",{children:"No runs match this filter"}),o.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function p4({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,d]=N.useState(""),[f,m]=N.useState(""),[p,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,_]=N.useState(null),[D,M]=N.useState(!1),T=r?f.trim().length>0:c.trim().length>0;async function A(){if(T){E(!0),_(null),M(!1);try{const J=je=>{const B=parseInt(je.trim(),10);return Number.isFinite(B)&&B>0?B:void 0},Q={},se=J(y);se!==void 0&&(Q.maxConcurrency=se);const pe=J(b);pe!==void 0&&(Q.maxRequestsPerMinute=pe);const ke=J(S);ke!==void 0&&(Q.maxRequestsPerDay=ke),await Aw(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...p.trim()?{model:p.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),d(""),m(""),v(""),x(""),w(""),C(""),M(!0),a()}catch(J){_(J instanceof Error?J.message:"Failed to update provider")}finally{E(!1)}}}const P=s??"Use default model";return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r&&o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),o.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:f,onChange:J=>m(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",r?" (optional)":""]}),t&&o.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),o.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:r?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:J=>d(J.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),o.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:P,value:p,onChange:J=>v(J.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),o.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:y,onChange:J=>x(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:b,onChange:J=>w(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:J=>C(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),R&&o.jsx("p",{className:"text-xs text-rose-400",children:R}),D&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!T||k,onClick:A,children:k?"Saving...":"Save"})]})}function g4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,m]=N.useState(null),[p,v]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function x(){if(y){d(!0),m(null),v(!1);try{await Ow({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(b){m(b instanceof Error?b.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),o.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Google Cloud \\u2197"})]}),o.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:b=>s(b.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),o.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:a,onChange:b=>r(b.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&o.jsx("p",{className:"text-xs text-rose-400",children:f}),p&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!y||c,onClick:x,children:c?"Saving...":"Save Google OAuth app"})]})}function y4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[m,p]=N.useState("9222"),[v,y]=N.useState(!1);return N.useEffect(()=>{Tm().then(t).catch(x=>{const b=x instanceof Error?x.message:String(x);b.includes("501")||a(b)})},[]),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),o.jsx("h2",{children:"ChatGPT (CDP)"})]}),o.jsx(nt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&o.jsxs("div",{children:[o.jsx("dt",{children:"Endpoint"}),o.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&o.jsxs("div",{children:[o.jsx("dt",{children:"Browser"}),o.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:"Tabs"}),o.jsx("dd",{children:e.targets.map(x=>o.jsxs("span",{className:"mr-2",children:[x.name,": ",x.alive?"● alive":"○ idle"]},x.name))})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&o.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async x=>{x.preventDefault(),y(!0);try{await tN(d,parseInt(m,10)||9222);const b=await Tm().catch(()=>null);b&&t(b),c(!1)}catch(b){a(b instanceof Error?b.message:String(b))}finally{y(!1)}},children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:d,onChange:x=>f(x.target.value),"aria-label":"CDP host"}),o.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:m,onChange:x=>p(x.target.value),"aria-label":"CDP port"})]}),o.jsx("div",{children:o.jsx(ce,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const v4={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function x4(){const e=cl(),{dashboard:t}=Ra(),s=t?.settings??e?.dashboard?.settings,c=Ju(!e,e?.health).data??e?.health??v4,[d,f]=N.useState(null),[m,p]=N.useState(!1),[v,y]=N.useState(!1),[x,b]=N.useState(""),[w,S]=N.useState(!1),[C,k]=N.useState(null),[E,R]=N.useState(!1);return s?o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Settings"}),o.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),o.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(_=>o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),o.jsx("h2",{children:_.displayName??_.name})]}),o.jsx(nt,{tone:_.state==="ready"?"positive":"caution",children:_.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Model"}),o.jsx("dd",{className:"font-mono text-xs",children:_.model})]}),_.quota&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Concurrency"}),o.jsx("dd",{children:_.quota.maxConcurrency})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Rate limit"}),o.jsxs("dd",{children:[_.quota.maxRequestsPerMinute,"/min · ",_.quota.maxRequestsPerDay,"/day"]})]})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:_.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>f(d===_.name?null:_.name),children:d===_.name?"Cancel":_.state==="ready"?_.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===_.name&&o.jsx(p4,{providerName:_.name,keyUrl:_.keyUrl,modelHint:_.modelHint,onSaved:()=>{f(null)}})]},_.name)),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),o.jsx("h2",{children:"Search Console OAuth"})]}),o.jsx(nt,{tone:s.google.state==="ready"?"positive":"caution",children:s.google.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.google.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!m),children:m?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),m&&o.jsx(g4,{onSaved:()=>{p(!1)}})]}),o.jsxs(Le,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),o.jsx("h2",{children:"Webmaster Tools"})]}),o.jsx(nt,{tone:s.bing.state==="ready"?"positive":"caution",children:s.bing.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.bing.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!v),children:v?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),o.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:x,onChange:_=>b(_.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&o.jsx("p",{className:"text-xs text-rose-400",children:C}),E&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!x.trim()||w,onClick:async()=>{if(x.trim()){S(!0),k(null),R(!1);try{await oN(x.trim()),b(""),R(!0),y(!1)}catch(_){k(_ instanceof Error?_.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),o.jsx(y4,{}),o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),o.jsx("h2",{children:"API and worker"})]})}),o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"API"}),o.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),o.jsx(nt,{tone:Su(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"Worker"}),o.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),o.jsx(nt,{tone:Su(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),o.jsx("section",{className:"page-section",children:o.jsxs(Le,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),o.jsx("h2",{children:"Operational guidance"})]})}),o.jsx("ul",{className:"detail-list",children:s.selfHostNotes.map(_=>o.jsx("li",{children:_},_))}),o.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const b4=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function S4({current:e,labels:t}){return o.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const r=a<e,c=a===e;return o.jsxs("div",{className:`setup-step ${r?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[o.jsx("span",{className:"setup-step-number",children:r?"✓":a+1}),o.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function j4(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),r=t??e?.dashboard;if(!r||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-24"}),o.jsx("div",{className:"skeleton-text-sm w-80"})]}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-32"}),o.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ae=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1 flex-1",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ae))})]})]});const c=r.settings,m=Ju(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=zM(r.setup,m,c),v=ka(),[y,x]=N.useState(0),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,_]=N.useState("US"),[D,M]=N.useState("en"),[T,A]=N.useState(null),[P,J]=N.useState(null),[Q,se]=N.useState(null),[pe,ke]=N.useState(!1),[je,B]=N.useState(""),[G,oe]=N.useState(!1),[q,X]=N.useState(null),[O,F]=N.useState(!1),ie=c.providerStatuses.filter(ae=>ae.state==="ready"),[re,ue]=N.useState(ie[0]?.name??""),[he,de]=N.useState(5),[Me,ge]=N.useState(!1),[Ze,it]=N.useState(null),[me,We]=N.useState(""),[dt,sn]=N.useState(!1),[kt,an]=N.useState(null),[Vt,_t]=N.useState(!1),[zt,mn]=N.useState(!1),[le,Ie]=N.useState(null),[Be,ze]=N.useState(!1),$e=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=je.split(`
|
|
236
|
+
CTR: ${rt.impressions>0?(rt.clicks/rt.impressions*100).toFixed(1):0}%`}),o.jsx("rect",{x:on-ds-Da/2,y:en.top+Js-La,width:ds,height:Math.max(La,1),rx:2,fill:"#3b82f6",opacity:.85}),o.jsx("rect",{x:on+Da/2,y:en.top+Js-Fr,width:ds,height:Math.max(Fr,1),rx:2,fill:"#10b981",opacity:.85})]},He)}),(()=>{const He=Math.min(fe.length,7);return Array.from({length:He},(rt,Gt)=>{const on=fe.length===1?0:Math.round(Gt/(He-1)*(fe.length-1)),La=en.left+Xs*on+Xs/2;return o.jsx("text",{x:La,y:Cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:fe[on][0].slice(5)},`xl-${on}`)})})()]})})]})})(),o.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:T.startDate,onChange:U=>A(fe=>({...fe,startDate:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"date",value:T.endDate,onChange:U=>A(fe=>({...fe,endDate:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter query",value:T.query,onChange:U=>A(fe=>({...fe,query:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter page",value:T.page,onChange:U=>A(fe=>({...fe,page:U.target.value}))}),o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"number",min:"1",placeholder:"Limit",value:T.limit,onChange:U=>A(fe=>({...fe,limit:U.target.value}))})]}),f.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"Date"}),o.jsx("th",{className:"text-left",children:"Query"}),o.jsx("th",{className:"text-left",children:"Page"}),o.jsx("th",{className:"text-right",children:"Clicks"}),o.jsx("th",{className:"text-right",children:"Impressions"}),o.jsx("th",{className:"text-right",children:"CTR"}),o.jsx("th",{className:"text-right",children:"Position"})]})}),o.jsx("tbody",{children:f.map((U,fe)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-zinc-400",children:U.date}),o.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:U.query}),o.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:U.page}),o.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:U.clicks.toLocaleString()}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:U.impressions.toLocaleString()}),o.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(U.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:U.position.toFixed(1)})]},`${U.date}:${U.query}:${U.page}:${fe}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),o.jsx("h3",{children:"Inspect a URL"})]})}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://example.com/page",value:k,onChange:U=>E(U.target.value),onKeyDown:U=>U.key==="Enter"&&void Kr()}),o.jsx(ce,{type:"button",size:"sm",disabled:ue||!ae?.propertyId||!k.trim(),onClick:Kr,children:ue?"Inspecting…":"Inspect URL"})]}),b&&o.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.indexingState??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:b.verdict??"Unknown"})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:Px(b.isMobileFriendly)})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:vs(b.crawlTime)})]})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),o.jsx("h3",{children:"Inspection log"})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:ie,onClick:()=>{Ns()},children:ie?"Loading…":"Refresh history"})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"Filter exact URL",value:P,onChange:U=>J(U.target.value)}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:ie,onClick:()=>{Ns()},children:"Apply filter"})]}),p.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Indexing"}),o.jsx("th",{className:"text-left",children:"Verdict"}),o.jsx("th",{className:"text-left",children:"Coverage"}),o.jsx("th",{className:"text-left",children:"Mobile"}),o.jsx("th",{className:"text-left",children:"Inspected"})]})}),o.jsx("tbody",{children:p.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-300",children:U.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:U.coverageState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Px(U.isMobileFriendly)}),o.jsx("td",{className:"text-zinc-400",children:vs(U.inspectedAt)})]},U.id))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),o.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?o.jsx("div",{className:"mt-3 overflow-x-auto",children:o.jsxs("table",{className:"data-table w-full text-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{className:"text-left",children:"URL"}),o.jsx("th",{className:"text-left",children:"Previous"}),o.jsx("th",{className:"text-left",children:"Current"}),o.jsx("th",{className:"text-left",children:"Changed at"})]})}),o.jsx("tbody",{children:y.map(U=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:U.url}),o.jsx("td",{className:"text-zinc-400",children:U.previousState??"Unknown"}),o.jsx("td",{className:"text-zinc-300",children:U.currentState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:vs(U.transitionDate)})]},`${U.url}:${U.transitionDate}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ae&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:o.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>qe(U=>!U),children:[o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:`h-4 w-4 text-zinc-500 transition-transform ${Be?"rotate-90":""}`,"aria-hidden":"true",children:o.jsx("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),o.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Be&&o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),o.jsx("h3",{children:"Pick the Search Console property"})]})}),o.jsxs("div",{className:"mt-3 space-y-2",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),o.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:G||c.length===0,onChange:U=>C(U.target.value),children:c.length===0?o.jsx("option",{value:"",children:G?"Loading properties…":"No properties available"}):c.map(U=>o.jsxs("option",{value:U.siteUrl,children:[U.siteUrl," · ",U.permissionLevel]},U.siteUrl))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{gl(ae)},children:G?"Refreshing…":"Refresh properties"}),o.jsx(ce,{type:"button",size:"sm",disabled:!S||q,onClick:xl,children:q?"Saving…":"Save property"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),o.jsx("h3",{children:"Import GSC performance data"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),o.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:R,onChange:U=>_(U.target.value)})]}),o.jsxs("label",{className:"flex items-center gap-2 rounded border border-zinc-800/60 bg-zinc-900/20 px-3 py-2 text-sm text-zinc-300",children:[o.jsx("input",{type:"checkbox",checked:L,onChange:U=>M(U.target.checked)}),"Replace existing imported rows for the requested range"]})]}),o.jsx(ce,{type:"button",size:"sm",disabled:je||!ae.propertyId,onClick:bl,children:je?"Queueing…":"Queue sync"}),!ae.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),o.jsx("h3",{children:"Sitemap configuration"})]})}),o.jsxs("div",{className:"mt-3 space-y-3",children:[ae.sitemapUrl&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ae.sitemapUrl})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:sn||!ae.propertyId,onClick:()=>{vl()},children:sn?"Loading…":"Browse sitemaps from GSC"}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:We||!ae.propertyId,onClick:yl,children:We?"Discovering…":"Auto-discover and queue inspection"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:"Browse lists available sitemaps without queueing a run. Auto-discover saves the primary sitemap and queues an inspection."}),an&&an.length>0&&o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[o.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",an.length,")"]}),an.map(U=>{const fe=U.contents?.[0];return o.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-zinc-200 break-all",children:U.path}),U.lastSubmitted&&o.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",U.lastSubmitted.split("T")[0]]})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[fe&&o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-zinc-300",children:[fe.indexed," / ",fe.submitted]}),o.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>zt(U.path),children:"Use"})]})]},U.path)})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:ae.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:_t,onChange:U=>zt(U.target.value),onKeyDown:U=>U.key==="Enter"&&_t.trim()&&void us()}),o.jsx(ce,{type:"button",size:"sm",disabled:mn||!_t.trim(),onClick:us,children:mn?"Saving…":ae.sitemapUrl?"Update":"Save"})]}),o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"Sitemap URL for inspection (leave empty for saved default)",id:`gsc-sitemap-inspect-${e}`}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:it||!ae.propertyId,onClick:()=>{const fe=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ae.sitemapUrl||void 0;me(!0),Xw(e,{sitemapUrl:fe}).then(at=>{Qe(`Sitemap inspection queued (run ${at.id}). Refresh coverage after the run completes.`)}).catch(at=>{_e(at instanceof Error?at.message:"Failed to queue sitemap inspection")}).finally(()=>me(!1))},children:it?"Queueing…":"Inspect sitemap"})]}),!ae.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function s4({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=N.useState(!1),[c,d]=N.useState(!1),[f,m]=N.useState(null),[p,v]=N.useState(e.displayName),[y,x]=N.useState(e.canonicalDomain),[b,w]=N.useState(e.country),[S,C]=N.useState(e.language),[k,E]=N.useState(e.ownedDomains??[]),[R,_]=N.useState(""),[L,M]=N.useState(null),[T,A]=N.useState(!1),[P,J]=N.useState(!1),[Q,se]=N.useState(""),[pe,ke]=N.useState(""),[je,B]=N.useState(""),[G,oe]=N.useState(""),[q,X]=N.useState("");N.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]))},[e,a]);function O(){r(!1),m(null),v(e.displayName),x(e.canonicalDomain),w(e.country),C(e.language),E(e.ownedDomains??[]),_("")}function F(){const me=R.trim();me&&(k.includes(me)||E([...k,me]),_(""))}function ie(me){E(k.filter(We=>We!==me))}async function re(){if(!(!p.trim()||!y.trim()||!b.trim()||!S.trim())){d(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),r(!1)}catch(me){m(me instanceof Error?me.message:"Failed to save")}finally{d(!1)}}}async function ue(){const me=Q.trim(),We=pe.trim(),dt=je.trim(),sn=G.trim();if(!(!me||!We||!dt||!sn)){A(!0),M(null);try{const kt={label:me,city:We,region:dt,country:sn};q.trim()&&(kt.timezone=q.trim()),await _w(e.name,kt),s(),se(""),ke(""),B(""),oe(""),X(""),J(!1)}catch(kt){M(kt instanceof Error?kt.message:"Failed to add location")}finally{A(!1)}}}async function he(me){A(!0),M(null);try{await zw(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to remove location")}finally{A(!1)}}async function de(me){A(!0),M(null);try{await Ew(e.name,me),s()}catch(We){M(We instanceof Error?We.message:"Failed to set default location")}finally{A(!1)}}const Me=p!==e.displayName||y!==e.canonicalDomain||b!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ge="w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",Ze="block text-xs font-medium text-zinc-400 mb-1",it=Q.trim()&&pe.trim()&&je.trim()&&G.trim();return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),o.jsx("h2",{children:"Project settings"})]}),!a&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:"Edit settings"})]}),f&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[f,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>m(null),children:"×"})]}),a?o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Display name"}),o.jsx("input",{className:ge,type:"text",value:p,onChange:me=>v(me.target.value),placeholder:"My Project"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Canonical domain"}),o.jsx("input",{className:ge,type:"text",value:y,onChange:me=>x(me.target.value),placeholder:"example.com"})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Country"}),o.jsx("input",{className:ge,type:"text",value:b,onChange:me=>w(me.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Language"}),o.jsx("input",{className:ge,type:"text",value:S,onChange:me=>C(me.target.value),placeholder:"en"})]})]}),o.jsxs("div",{children:[o.jsx("label",{className:Ze,children:"Owned domains"}),o.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(me=>o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[me,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ie(me),"aria-label":`Remove ${me}`,children:"×"})]},me))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:R,onChange:me=>_(me.target.value),onKeyDown:me=>me.key==="Enter"&&(me.preventDefault(),F())}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:!R.trim(),onClick:F,children:"Add"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[o.jsx(ce,{type:"button",disabled:c||!Me||!p.trim()||!y.trim(),onClick:re,children:c?"Saving...":"Save changes"}),o.jsx(ce,{type:"button",variant:"outline",disabled:c,onClick:O,children:"Cancel"})]})]}):o.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:o.jsx("table",{className:"w-full text-sm",children:o.jsxs("tbody",{children:[o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),o.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?o.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(me=>o.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:me},me))}):o.jsx("span",{className:"text-zinc-500",children:"\\u2014"})})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),o.jsxs("tr",{className:"border-b border-zinc-800/40",children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),o.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),o.jsxs("tr",{children:[o.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),o.jsxs("td",{className:"px-4 py-2.5",children:[L&&o.jsxs("div",{className:"mb-2 rounded border border-rose-800/40 bg-rose-950/20 px-2 py-1 text-xs text-rose-300",children:[L,o.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>M(null),children:"×"})]}),(e.locations??[]).length>0?o.jsxs("table",{className:"w-full text-xs mb-2",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"text-zinc-600",children:[o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),o.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),o.jsx("th",{className:"pb-1"})]})}),o.jsx("tbody",{children:e.locations.map(me=>o.jsxs("tr",{className:"border-t border-zinc-800/30",children:[o.jsx("td",{className:"py-1.5 pr-3",children:o.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${me.label===e.defaultLocation?"border-emerald-700/60 bg-emerald-950/30 text-emerald-300":"border-zinc-700/60 bg-zinc-800/40 text-zinc-300"}`,children:[me.label,me.label===e.defaultLocation?" ★":""]})}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.city}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.region}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:me.country}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:me.timezone??"—"}),o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[me.label!==e.defaultLocation&&o.jsx("button",{type:"button",disabled:T,onClick:()=>de(me.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${me.label} as default location`,children:"Set default"}),o.jsx("button",{type:"button",disabled:T,onClick:()=>he(me.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${me.label}`,children:"Remove"})]})})]},me.label))})]}):o.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),P?o.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),o.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),o.jsx("input",{className:ge,type:"text",value:Q,onChange:me=>se(me.target.value),placeholder:"nyc"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),o.jsx("input",{className:ge,type:"text",value:pe,onChange:me=>ke(me.target.value),placeholder:"New York"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),o.jsx("input",{className:ge,type:"text",value:je,onChange:me=>B(me.target.value),placeholder:"NY"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),o.jsx("input",{className:ge,type:"text",value:G,onChange:me=>oe(me.target.value),placeholder:"US",maxLength:2})]}),o.jsxs("div",{className:"col-span-2",children:[o.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),o.jsx("input",{className:ge,type:"text",value:q,onChange:me=>X(me.target.value),placeholder:"America/New_York"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(ce,{type:"button",size:"sm",disabled:T||!it,onClick:ue,children:T?"Adding...":"Add location"}),o.jsx(ce,{type:"button",size:"sm",variant:"outline",disabled:T,onClick:()=>{J(!1),M(null)},children:"Cancel"})]})]}):o.jsx(ce,{type:"button",size:"sm",variant:"outline",onClick:()=>J(!0),children:"+ Add location"})]})]})]})})})]})}const i4=[{value:"daily",label:"Every day"},{value:"weekly@mon",label:"Every Monday"},{value:"weekly@wed",label:"Every Wednesday"},{value:"weekly@fri",label:"Every Friday"},{value:"twice-daily",label:"Twice a day (6am & 6pm)"},{value:"custom",label:"Custom cron expression"}],Zb=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Toronto","America/Vancouver","Europe/London","Europe/Paris","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function a4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState("daily"),[f,m]=N.useState(6),[p,v]=N.useState(""),[y,x]=N.useState("UTC"),[b,w]=N.useState(!1),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,_]=N.useState(!1),[L,M]=N.useState(null);N.useEffect(()=>{Dw(e).then(s).catch(()=>s(null))},[e]);const T=()=>{if(t&&t!=="loading"){const Q=q2(t.preset??null,t.cronExpr);d(Q.freq),m(Q.hour),v(Q.customCron);const se=Zb.includes(t.timezone);x(se?t.timezone:"Other"),w(!se),C(se?"":t.timezone)}else d("daily"),m(6),v(""),x("UTC"),w(!1),C("");M(null),r(!0)},A=async()=>{E(!0),M(null);try{const se={timezone:b?S.trim()||"UTC":y};c==="custom"?se.cron=p.trim():se.preset=B2(c,f);const pe=await Tm(e,se);s(pe),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to save schedule")}finally{E(!1)}},P=async()=>{if(!(!t||t==="loading")){E(!0),M(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr,s(await Tm(e,Q))}catch(Q){M(Q instanceof Error?Q.message:"Failed to update schedule")}finally{E(!1)}}},J=async()=>{_(!0),M(null);try{await Lw(e),s(null),r(!1)}catch(Q){M(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{_(!1)}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:T,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&o.jsx(De,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&o.jsxs(De,{className:"surface-card compact-card",children:[o.jsxs("div",{className:"flex items-start justify-between gap-4",children:[o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-sm font-medium text-zinc-200",children:H2(t.preset??null,t.cronExpr,t.timezone)}),o.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",o.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&o.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[o.jsx(nt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:P,children:t.enabled?"Pause":"Resume"}),o.jsx(ce,{type:"button",variant:"ghost",size:"sm",disabled:R,onClick:J,children:R?"Removing...":"Remove"})]})]}),L&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:L})]}),a&&o.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:c,onChange:Q=>d(Q.target.value),children:i4.map(Q=>o.jsx("option",{value:Q.value,children:Q.label},Q.value))})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),o.jsx("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none disabled:opacity-40",value:f,disabled:c==="twice-daily"||c==="custom",onChange:Q=>m(parseInt(Q.target.value)),children:Array.from({length:24},(Q,se)=>o.jsx("option",{value:se,children:xm(se)},se))})]})]}),c==="custom"&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 font-mono focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"0 9 * * 1-5",value:p,onChange:Q=>v(Q.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),o.jsxs("select",{className:"w-full rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:b?"Other":y,onChange:Q=>{Q.target.value==="Other"?(w(!0),x("Other")):(w(!1),x(Q.target.value))},children:[Zb.map(Q=>o.jsx("option",{value:Q,children:Q},Q)),o.jsx("option",{value:"Other",children:"Other (enter manually)\\u2026"})]}),b&&o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"e.g. America/New_York",value:S,onChange:Q=>C(Q.target.value)})]}),L&&o.jsx("p",{className:"text-rose-400 text-sm",children:L}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),M(null)},children:"Cancel"}),o.jsx(ce,{type:"button",size:"sm",disabled:k||c==="custom"&&!p.trim(),onClick:A,children:k?"Saving...":"Save schedule"})]})]})]})}const r4=[{value:"citation.lost",label:"Citation lost"},{value:"citation.gained",label:"Citation gained"},{value:"run.completed",label:"Run completed"},{value:"run.failed",label:"Run failed"}];function o4({projectName:e}){const[t,s]=N.useState("loading"),[a,r]=N.useState(!1),[c,d]=N.useState(""),[f,m]=N.useState(["citation.lost","citation.gained"]),[p,v]=N.useState(!1),[y,x]=N.useState(null),[b,w]=N.useState({});N.useEffect(()=>{Mw(e).then(s).catch(()=>s([]))},[e]);const S=R=>{m(_=>_.includes(R)?_.filter(L=>L!==R):[..._,R])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),x(null);try{const R=await $w(e,{channel:"webhook",url:c.trim(),events:f});s(_=>_==="loading"?[R]:[..._,R]),d(""),m(["citation.lost","citation.gained"]),r(!1)}catch(R){x(R instanceof Error?R.message:"Failed to add webhook")}finally{v(!1)}}},k=async R=>{try{await Uw(e,R),s(_=>_==="loading"?_:_.filter(L=>L.id!==R))}catch(_){x(_ instanceof Error?_.message:"Failed to remove webhook")}},E=async R=>{w(_=>({..._,[R]:{state:"testing"}}));try{const _=await Pw(e,R);w(L=>({...L,[R]:{state:_.ok?"ok":"fail",status:_.status}}))}catch{w(_=>({..._,[R]:{state:"fail"}}))}};return o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),o.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!a),x(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),o.jsx("input",{className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"url",placeholder:"https://hooks.example.com/canonry",value:c,onChange:R=>d(R.target.value)})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),o.jsx("div",{className:"flex flex-wrap gap-3",children:r4.map(R=>o.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[o.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(R.value),onChange:()=>S(R.value)}),o.jsx("span",{className:"text-sm text-zinc-300",children:R.label})]},R.value))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm",children:y}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),x(null)},children:"Cancel"}),o.jsx(ce,{type:"button",size:"sm",disabled:p||!c.trim()||f.length===0,onClick:C,children:p?"Adding...":"Add webhook"})]})]}),t==="loading"&&o.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&o.jsx(De,{className:"surface-card compact-card",children:o.jsx("p",{className:"supporting-copy",children:"No webhooks configured. Add one to get alerted when citations change or runs complete."})}),t!=="loading"&&t.length>0&&o.jsxs("div",{className:"evidence-table-wrap",children:[o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"URL"}),o.jsx("th",{children:"Events"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:t.map(R=>o.jsxs("tr",{children:[o.jsx("td",{className:"evidence-keyword-cell",children:o.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",children:R.url})}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:R.events.map(_=>o.jsx("span",{className:"inline-flex items-center rounded-full border border-zinc-700 bg-zinc-800/60 px-2 py-0.5 text-[10px] font-medium text-zinc-400 uppercase tracking-wide",children:_.replace("."," ")},_))})}),o.jsx("td",{children:o.jsx(nt,{tone:R.enabled?"positive":"neutral",children:R.enabled?"Active":"Paused"})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[b[R.id]&&(()=>{const _=b[R.id],L=_.state==="testing"?"Sending…":_.state==="ok"?`Delivered${_.status?` (${_.status})`:""}`:`Failed${_.status?` (${_.status})`:""}`;return o.jsx(nt,{tone:_.state==="ok"?"positive":_.state==="fail"?"negative":"neutral",children:L})})(),o.jsx(ce,{variant:"ghost",size:"sm",type:"button",disabled:b[R.id]?.state==="testing",onClick:()=>E(R.id),children:"Test"}),o.jsx(ce,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(R.id),children:"Remove"})]})})]},R.id))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function Vb({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:d,note:f,updatedAt:m,active:p,onClick:v}){return o.jsxs("button",{type:"button",onClick:v,className:`surface-card w-full text-left transition-colors ${p?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),o.jsx("h3",{children:t})]}),o.jsx(nt,{tone:a,children:s})]}),o.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:r}),o.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:d})]})]}),o.jsxs("div",{className:"mt-3 flex flex-col gap-1 text-xs text-zinc-500 sm:flex-row sm:items-center sm:justify-between",children:[o.jsx("span",{children:f}),o.jsx("span",{children:m?`Updated ${vs(m)}`:"No recent sync yet"})]})]})}function im({label:e,value:t,tone:s}){const a=s==="positive"?"text-emerald-400":s==="negative"?"text-rose-400":"text-zinc-200";return o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),o.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function l4({projectName:e}){const[t,s]=N.useState(null),[a,r]=N.useState([]),[c,d]=N.useState(null),[f,m]=N.useState([]),[p,v]=N.useState([]),[y,x]=N.useState(null),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,_]=N.useState(!0),[L,M]=N.useState(null),[T,A]=N.useState(null),[P,J]=N.useState("coverage");N.useEffect(()=>{Q()},[e]);async function Q(){_(!0),M(null);try{const q=await Mp(e);if(s(q),q.connected){const[X,O,F]=await Promise.all([Qu(e).catch(()=>null),$p(e).catch(()=>[]),rN(e).catch(()=>[])]);X&&d(X),m(O),v(F)}}catch(q){M(q instanceof Error?q.message:"Failed to load Bing data")}finally{_(!1)}}async function se(){if(S.trim()){M(null);try{const q=await nN(e,S.trim());C(""),q.availableSites.length>0&&r(q.availableSites),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to connect")}}}async function pe(){try{await sN(e),s(null),r([]),d(null),m([]),v([]),x(null),E(""),M(null)}catch(q){M(q instanceof Error?q.message:"Failed to disconnect")}}async function ke(){if(k)try{await aN(e,k),await Q()}catch(q){M(q instanceof Error?q.message:"Failed to set site")}}async function je(){if(b.trim())try{const q=await Up(e,b.trim());x(q),m(X=>[q,...X])}catch(q){M(q instanceof Error?q.message:"Inspection failed")}}async function B(q){try{await Dm(e,{urls:[q]}),M(null),A(`Submitted to Bing: ${q}`),setTimeout(()=>A(null),4e3)}catch(X){M(X instanceof Error?X.message:"Submission failed")}}async function G(){try{const q=await Dm(e,{allUnindexed:!0});M(null);const{succeeded:X,total:O}=q.summary;A(`Submitted ${X}/${O} URL${O!==1?"s":""} to Bing`),setTimeout(()=>A(null),4e3)}catch(q){M(q instanceof Error?q.message:"Batch submission failed")}}if(R)return o.jsx(De,{className:"surface-card",children:o.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!t?.connected)return o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsx(nt,{tone:"caution",children:"Not connected"})]}),o.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),o.jsxs("div",{className:"mt-3",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[o.jsx("input",{id:"bing-api-key",type:"password",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:S,onChange:q=>C(q.target.value),onKeyDown:q=>q.key==="Enter"&&se()}),o.jsx(ce,{size:"sm",disabled:!S.trim(),onClick:se,children:"Connect"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),L&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});if(!t.siteUrl)return o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nt,{tone:"positive",children:"Connected"}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:"The API key is connected, but no Bing site is selected yet. Pick the verified site that should receive inspections and indexing requests."})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.domain})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?vs(t.updatedAt):"—"})]})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?o.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[o.jsxs("select",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:k,onChange:q=>E(q.target.value),children:[o.jsx("option",{value:"",children:"Select a site..."}),a.map(q=>o.jsxs("option",{value:q.url,children:[q.url,q.verified?" (verified)":""]},q.url))]}),o.jsx(ce,{size:"sm",disabled:!k,onClick:ke,children:"Set Site"})]}):o.jsx("div",{className:"mt-3",children:o.jsx(ce,{size:"sm",onClick:async()=>{const q=await iN(e);r(q.sites)},children:"Load Sites"})})]})]}),L&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:L})]});const oe=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return o.jsxs("div",{className:"space-y-3",children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),o.jsx("h3",{children:"Domain authorization"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(nt,{tone:"positive",children:"Connected"}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:pe,children:"Disconnect"})]})]}),L&&o.jsx("p",{className:"mb-3 text-xs text-rose-400",children:L}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),o.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),o.jsx("span",{className:"text-xs text-zinc-500",children:t.domain})]}),o.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",o.jsx("code",{children:t.siteUrl}),"."]})]}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.siteUrl})]}),o.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[o.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),o.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:t.updatedAt?vs(t.updatedAt):"—"})]})]})]})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),o.jsx("h3",{children:"Index monitoring"})]}),o.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${vs(c.lastInspectedAt)}`:"No inspection history yet"})]}),o.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:oe.map(q=>o.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${P===q.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>J(q.key),children:q.label},q.key))}),P==="coverage"&&c&&o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[o.jsx(im,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),o.jsx(im,{label:"Not indexed",value:c.summary.notIndexed,tone:"negative"}),o.jsx(im,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),o.jsxs("div",{className:"flex items-center gap-2",children:[T&&o.jsx("span",{className:"text-xs text-emerald-400",children:T}),o.jsx(ce,{size:"sm",variant:"ghost",onClick:G,children:"Submit all to Bing"})]})]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),o.jsx("tbody",{children:c.notIndexed.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-right",children:o.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",onClick:()=>B(q.url),children:"Submit"})})]},q.id))})]})})]}),c.indexed.length>0&&o.jsxs("div",{children:[o.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),o.jsx("tbody",{children:c.indexed.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.lastCrawledDate?vs(q.lastCrawledDate):"—"})]},q.id))})]})})]})]}),P==="coverage"&&!c&&o.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),P==="inspections"&&o.jsxs("div",{className:"mt-4 space-y-3",children:[o.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[o.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:q=>w(q.target.value),onKeyDown:q=>q.key==="Enter"&&je()}),o.jsx(ce,{size:"sm",disabled:!b.trim(),onClick:je,children:"Inspect"})]}),y&&o.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[o.jsx("div",{className:"font-medium text-zinc-200",children:y.url}),o.jsxs("div",{className:"text-zinc-400",children:["In Index: ",o.jsx("span",{className:y.inIndex?"text-emerald-400":"text-rose-400",children:y.inIndex?"Yes":"No"})," · ","HTTP: ",y.httpCode??"—"," · ","Crawled: ",y.lastCrawledDate??"—"]})]}),f.length>0&&o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),o.jsx("tbody",{children:f.map(q=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.url}),o.jsx("td",{className:"py-1.5 px-3",children:o.jsx(nt,{tone:q.inIndex?"positive":"negative",children:q.inIndex?"Yes":"No"})}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:q.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:vs(q.inspectedAt)})]},q.id))})]})})]}),P==="performance"&&o.jsx("div",{className:"mt-4",children:p.length===0?o.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):o.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:o.jsxs("table",{className:"w-full text-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-zinc-800",children:[o.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),o.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),o.jsx("tbody",{children:p.map((q,X)=>o.jsxs("tr",{className:"border-b border-zinc-800/50",children:[o.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:q.query}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:q.clicks}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.impressions}),o.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(q.ctr*100).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:q.averagePosition.toFixed(1)})]},X))})]})})})]})]})}function c4({projectName:e}){const[t,s]=N.useState("google"),[a,r]=N.useState(!0),[c,d]=N.useState("idle"),[f,m]=N.useState(null),p=N.useRef(null),[v,y]=N.useState(!1),[x,b]=N.useState(null),[w,S]=N.useState(null),[C,k]=N.useState(!1),[E,R]=N.useState(null),[_,L]=N.useState(null);async function M(oe=!1){oe||r(!0),m(null);try{const[q,X,O]=await Promise.all([Zu().catch(()=>null),Dp(e).catch(()=>[]),Mp(e).catch(()=>null)]),F=X.find(ue=>ue.connectionType==="gsc")??null;y(!!q?.google?.configured),k(!!q?.bing?.configured),b(F),R(O);const[ie,re]=await Promise.all([F?Vu(e).catch(()=>null):Promise.resolve(null),O?.connected?Qu(e).catch(()=>null):Promise.resolve(null)]);S(ie),L(re)}catch(q){m(q instanceof Error?q.message:"Failed to load search console overview")}finally{r(!1)}}async function T(){if(c!=="idle")return;p.current?.abort();const oe=new AbortController;p.current=oe;const q=oe.signal;d("syncing"),m(null);const X=[];try{async function O(){if(!x)return;const ue=await Lp(e);if(!ue?.id)return;const he=2e3,Me=Date.now()+12e4;for(;Date.now()<Me;){if(q.aborted||(await new Promise(Ze=>setTimeout(Ze,he)),q.aborted))return;const ge=await Dr(ue.id).catch(()=>null);if(!ge)break;if(["completed","failed","cancelled"].includes(ge.status)){ge.status!=="completed"&&X.push(`Google sync ${ge.status}`);break}}}const F=10;async function ie(){if(!E?.connected)return;const ue=await $p(e).catch(()=>[]),he=[...new Set(ue.map(de=>de.url))];if(he.length!==0)for(let de=0;de<he.length;de+=F){if(q.aborted)return;const Me=he.slice(de,de+F),Ze=(await Promise.allSettled(Me.map(it=>Up(e,it)))).filter(it=>it.status==="rejected").length;Ze>0&&X.push(`${Ze} Bing inspection(s) failed`)}}const re=await Promise.allSettled([O(),ie()]);for(const ue of re)ue.status==="rejected"&&X.push(ue.reason instanceof Error?ue.reason.message:"Sync failed");if(q.aborted)return;d("reloading"),await M(!0),X.length>0&&m(`Partial refresh: ${X.join("; ")}`)}catch(O){q.aborted||m(O instanceof Error?O.message:"Refresh failed")}finally{q.aborted||d("idle")}}N.useEffect(()=>(M(),()=>{p.current?.abort()}),[e]);const A=x?"positive":v?"caution":"negative",P=x?"Connected":v?"Ready to connect":"Needs setup",J=w?`${w.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=w?`${w.summary.notIndexed} not indexed${w.summary.deindexed>0?` · ${w.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",se=w?.lastInspectedAt??x?.updatedAt??null,pe=E?.connected?"positive":C?"caution":"negative",ke=E?.connected?"Connected":C?"Ready to connect":"Needs setup",je=_?`${_.summary.percentage}% indexed`:E?.connected?"Awaiting coverage":"No coverage data",B=_?`${_.summary.notIndexed} not indexed`:E?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",G=_?.lastInspectedAt??E?.updatedAt??null;return o.jsxs("div",{className:"space-y-6",children:[o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),o.jsx("h2",{children:"Search Engine Intelligence"}),o.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Scan both engines at a glance, then open the Google or Bing workspace when you need to inspect coverage or take action."})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{T()},children:a?"Loading…":c==="syncing"?"Querying Google & Bing…":c==="reloading"?"Reloading…":"Refresh overview"})]}),f&&o.jsx("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:f}),o.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[o.jsx(Vb,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":P,tone:a?"neutral":A,targetLabel:"Selected property",targetValue:x?.propertyId??"No property selected",coverageValue:a?"Loading…":J,note:a?"Loading overview…":Q,updatedAt:se,active:t==="google",onClick:()=>s("google")}),o.jsx(Vb,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":ke,tone:a?"neutral":pe,targetLabel:"Selected site",targetValue:E?.siteUrl??"No site selected",coverageValue:a?"Loading…":je,note:a?"Loading overview…":B,updatedAt:G,active:t==="bing",onClick:()=>s("bing")})]})]}),o.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([oe,q])=>o.jsx("button",{type:"button",role:"tab","aria-selected":t===oe,className:`project-subnav-link ${t===oe?"project-subnav-link-active":""}`,onClick:()=>s(oe),children:q},oe))}),t==="google"&&o.jsx(n4,{projectName:e}),t==="bing"&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),o.jsx("h2",{children:"Bing Webmaster Tools"})]})}),o.jsx(l4,{projectName:e})]})]})}function u4({insights:e}){const{openEvidence:t}=ul(),[s,a]=N.useState(null);return o.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,d=r.affectedPhrases.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:`insight-row insight-row-${r.tone} ${d?"cursor-pointer":""}`,onClick:d?()=>a(c?null:r.id):void 0,children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[d&&o.jsx(Mu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),o.jsx(nt,{tone:r.tone,children:r.actionLabel}),o.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:r.title}),o.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:r.detail})]}),d&&o.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[r.affectedPhrases.length," phrase",r.affectedPhrases.length>1?"s":""]})]}),c&&o.jsx("div",{className:"divide-y divide-zinc-800/20",children:r.affectedPhrases.map(f=>o.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(Em,{state:f.citationState}),o.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),o.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&o.jsx(tl,{provider:f.provider})})]}),o.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:m=>{m.stopPropagation(),t(f.evidenceId)},children:"View →"})]},f.evidenceId))})]},r.id)})})}function ld({tab:e}){const{projectId:t}=Du({from:"/projects/$projectId"}),s=ka(),{dashboard:a,isLoading:r,refetch:c}=Ra();if(!a||r)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-48"}),o.jsx("div",{className:"skeleton-text-sm w-32"})]}),o.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(le=>o.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[o.jsx("div",{className:"skeleton-circle size-20"}),o.jsx("div",{className:"skeleton-text w-16 mt-3"})]},le))}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-28"}),o.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(le=>o.jsx("div",{className:"skeleton-text-sm w-full"},le))})]})]});const d=BL(a,t),[f,m]=N.useState(!1),[p,v]=N.useState(!1),[y,x]=N.useState(!1),[b,w]=N.useState(null),[S,C]=N.useState(!1),[k,E]=N.useState(""),[R,_]=N.useState(!1),[L,M]=N.useState(!1),[T,A]=N.useState(""),[P,J]=N.useState(!1),[Q,se]=N.useState(!1),[pe,ke]=N.useState(""),[je,B]=N.useState(!1),[G,oe]=N.useState(void 0),[q,X]=N.useState(!1),[O,F]=N.useState(null),[ie,re]=N.useState(!1),ue=d?.visibilityEvidence??[],he=d?.project.name??"",de=N.useMemo(()=>new Set(ue.map(le=>le.location??"")),[ue]),Me=de.has(""),ge=N.useMemo(()=>[...de].filter(Boolean),[de]);N.useEffect(()=>{if(G===void 0||G===""||!he){F(null),re(!1);return}re(!0),Tp(he,G).then(le=>{F(le),re(!1)}).catch(()=>{F(null),re(!1)})},[G,he]);const Ze=N.useMemo(()=>{if(!O)return null;const le=new Map;for(const Be of O){for(const[qe,ze]of Object.entries(Be.providerRuns??{}))le.set(`${Be.keyword}::${qe}`,ze.map($e=>({runId:$e.runId,citationState:$e.citationState,createdAt:$e.createdAt})));(!Be.providerRuns||Object.keys(Be.providerRuns).length===0)&&le.set(`${Be.keyword}::`,Be.runs.map(qe=>({runId:qe.runId,citationState:qe.citationState,createdAt:qe.createdAt})))}return le},[O]),it=N.useMemo(()=>{const le=G!==void 0?ue.filter(Be=>G===""?!Be.location:Be.location===G):ue;return Ze?le.map(Be=>{const qe=Ze.get(`${Be.keyword}::${Be.provider}`)??Ze.get(`${Be.keyword}::`);return qe?{...Be,runHistory:qe}:Be}):le},[ue,G,Ze]);if(!d)return o.jsx("div",{className:"page-container",children:o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Project not found"}),o.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),o.jsx(ce,{asChild:!0,children:o.jsx(yt,{to:"/",children:"Return to overview"})})]})});async function me(){x(!0),w(null);try{await Op(he),c()}catch(le){w(le instanceof Error?le.message:"Failed to trigger run")}finally{x(!1)}}async function We(){v(!0);try{await Rw(he),s({to:"/"}),c()}catch(le){console.error("Failed to delete project:",le)}finally{v(!1)}}async function dt(){const le=await Tw(he),Be=typeof le=="string"?le:JSON.stringify(le,null,2),qe=new Blob([Be],{type:"text/yaml"}),ze=URL.createObjectURL(qe),$e=document.createElement("a");$e.href=ze,$e.download=`${he}.yaml`,$e.click()}async function sn(){const le=k.split(`
|
|
237
|
+
`).map(Be=>Be.trim()).filter(Boolean);if(le.length!==0){_(!0);try{await Cw(he,le),c(),E(""),C(!1)}finally{_(!1)}}}async function kt(){const le=T.trim();if(le){J(!0);try{const qe=(await Rp(he)).map($e=>$e.domain),ze=[...new Set([...qe,le])];await Ap(he,ze),c(),A(""),M(!1)}finally{J(!1)}}}async function an(){const le=pe.trim();if(le){B(!0);try{const Be=d?.project.ownedDomains??[];await Rm(he,[...Be,le]),c(),ke(""),se(!1)}finally{B(!1)}}}async function Vt(le){B(!0);try{const Be=d?.project.ownedDomains??[];await Rm(he,Be.filter(qe=>qe!==le)),c()}finally{B(!1)}}async function _t(le,Be){await kw(le,Be),c()}const zt=le=>!Number.isNaN(Number.parseInt(le,10)),mn=[{key:"overview",label:"Overview",href:`/projects/${d.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${d.project.id}/search-console`},{key:"analytics",label:"Analytics",href:`/projects/${d.project.id}/analytics`},{key:"traffic",label:"Traffic",href:`/projects/${d.project.id}/traffic`}];return o.jsxs("div",{className:"page-container",children:[f?o.jsxs(De,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[o.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),o.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",o.jsx("strong",{className:"text-zinc-200",children:d.project.displayName||d.project.name})," and all its key phrases, competitors, runs, and snapshots. This cannot be undone."]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ce,{type:"button",variant:"destructive",disabled:p,onClick:We,children:p?"Deleting...":"Yes, delete project"}),o.jsx(ce,{type:"button",variant:"outline",disabled:p,onClick:()=>m(!1),children:"Cancel"})]})]}):null,o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:d.project.displayName||d.project.name}),o.jsxs("p",{className:"page-subtitle",children:[d.project.canonicalDomain,(d.project.ownedDomains??[]).length===0&&!Q&&o.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>se(!0),children:"+ add domain"})," "," · ",d.contextLabel]}),o.jsxs("div",{className:"tag-row",children:[o.jsx("span",{className:"tag",children:d.project.country}),o.jsx("span",{className:"tag",children:d.project.language.toUpperCase()}),d.project.tags.map(le=>o.jsx("span",{className:"tag",children:le},le))]}),((d.project.ownedDomains??[]).length>0||Q)&&o.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[o.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(d.project.ownedDomains??[]).map(le=>o.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-700/60 bg-zinc-800/40 px-2 py-0.5 text-xs text-zinc-300",children:[le,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:je,onClick:()=>Vt(le),"aria-label":`Remove ${le}`,children:"×"})]},le)),Q?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx("input",{className:"rounded border border-zinc-700 bg-transparent px-1.5 py-0.5 text-xs text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none w-40",type:"text",placeholder:"docs.example.com",value:pe,onChange:le=>ke(le.target.value),onKeyDown:le=>le.key==="Enter"&&an(),autoFocus:!0}),o.jsx(ce,{type:"button",size:"sm",disabled:!pe.trim()||je,onClick:an,children:je?"...":"Add"}),o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{se(!1),ke("")},children:"Cancel"})]}):o.jsx("button",{type:"button",className:"rounded-full border border-dashed border-zinc-700 px-2 py-0.5 text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 hover:border-zinc-500 transition-colors",onClick:()=>se(!0),children:"+ domain"})]})]}),o.jsxs("div",{className:"page-header-right",children:[o.jsx("p",{className:"text-sm text-zinc-500",children:d.dateRangeLabel}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:dt,"aria-label":"Export project as YAML",children:o.jsx(m2,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(ce,{type:"button",variant:"outline",size:"icon",onClick:()=>m(!0),"aria-label":"Delete project",children:o.jsx(D2,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(ce,{type:"button",disabled:y,onClick:me,children:y?"Starting...":"Run now"})]})]})]}),b&&o.jsxs("div",{className:"mb-3 rounded-lg border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:[b,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>w(null),children:"×"})]}),o.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:mn.map(le=>o.jsx(yt,{to:le.href,className:`project-subnav-link ${le.key===e?"project-subnav-link-active":""}`,"aria-current":le.key===e?"page":void 0,children:le.label},le.key))}),e==="overview"?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"gauge-row",children:[o.jsx(s1,{value:d.visibilitySummary.value,label:d.visibilitySummary.label,delta:d.visibilitySummary.delta,tone:d.visibilitySummary.tone,description:d.visibilitySummary.description,tooltip:d.visibilitySummary.tooltip,isNumeric:zt(d.visibilitySummary.value),progress:d.visibilitySummary.progress}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",o.jsx(bs,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:d.gapKeyPhrases.value}),o.jsxs("span",{className:"text-zinc-600",children:[" / ",d.keywordCounts.total]})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${d.gapKeyPhrases.tone}`,style:{width:d.gapKeyPhrases.progress!==void 0?`${d.gapKeyPhrases.progress*100}%`:"0%"}})}),o.jsx("p",{className:"metric-card-detail",children:d.gapKeyPhrases.delta}),o.jsx("p",{className:"metric-card-sub",children:d.gapKeyPhrases.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",o.jsx(bs,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),o.jsxs("p",{className:"metric-card-big-value",children:[o.jsx("span",{className:"text-zinc-50",children:d.indexCoverage.value}),o.jsx("span",{className:"text-zinc-600",children:"%"})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${d.indexCoverage.tone}`,style:{width:`${Number.parseInt(d.indexCoverage.value,10)||0}%`}})}),o.jsx("p",{className:"metric-card-detail",children:d.indexCoverage.delta}),o.jsx("p",{className:"metric-card-sub",children:d.indexCoverage.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",o.jsx(bs,{text:"Keyword-level citation changes compared to the previous completed run."})]}),d.movementSummary.hasPreviousRun?o.jsxs("div",{className:"metric-card-movement",children:[o.jsxs("span",{className:d.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",d.movementSummary.gained," gained"]}),o.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),o.jsxs("span",{className:d.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",d.movementSummary.lost," lost"]})]}):o.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),o.jsx("p",{className:"metric-card-sub mt-auto",children:d.movementSummary.gained===0&&d.movementSummary.lost===0&&d.movementSummary.hasPreviousRun?"No changes since last run":d.movementSummary.gained>d.movementSummary.lost?"Visibility improving":d.movementSummary.lost>d.movementSummary.gained?"Visibility declining":""})]})]}),d.providerScores.length>1&&o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),o.jsxs("h2",{children:["Visibility by model ",o.jsx(bs,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked key phrases. Switching models can significantly affect citation rates."})]})]})}),o.jsx("div",{className:"evidence-table-wrap",children:o.jsxs("table",{className:"evidence-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Model"}),o.jsx("th",{children:"Score"}),o.jsx("th",{children:"Cited key phrases"})]})}),o.jsx("tbody",{children:d.providerScores.map(le=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[o.jsx(tl,{provider:le.provider}),le.model&&o.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:le.model})]})}),o.jsx("td",{children:o.jsxs("span",{className:`font-semibold ${le.score>=70?"text-emerald-400":le.score>=40?"text-amber-400":"text-rose-400"}`,children:[le.score,"%"]})}),o.jsxs("td",{className:"text-zinc-500",children:[le.cited," of ",le.total]})]},`${le.provider}::${le.model??"unknown"}`))})]})})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),o.jsx("h2",{children:"Citation signals"})]})}),o.jsx(u4,{insights:d.insights})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),o.jsx("h2",{children:"Key phrase citation tracking"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[new Set(d.visibilityEvidence.map(le=>le.keyword)).size," key phrases tracked"]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>C(!S),children:S?"Cancel":"+ Add key phrases"})]})]}),S&&o.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsx("textarea",{className:"w-full resize-none rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",rows:3,placeholder:"Enter key phrases, one per line",value:k,onChange:le=>E(le.target.value)}),o.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[o.jsxs("p",{className:"text-xs text-zinc-500",children:[k.split(`
|
|
238
|
+
`).filter(le=>le.trim()).length," key phrases"]}),o.jsx(ce,{type:"button",size:"sm",disabled:!k.trim()||R,onClick:sn,children:R?"Adding...":"Add key phrases"})]})]}),d.project.locations&&d.project.locations.length>0&&o.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[o.jsx("button",{className:`filter-chip ${G===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":G===void 0,onClick:()=>{oe(void 0)},children:"All locations"}),d.project.locations.map(le=>de.has(le.label)&&o.jsx("button",{className:`filter-chip ${G===le.label?"filter-chip-active":""}`,type:"button","aria-pressed":G===le.label,onClick:()=>{oe(le.label),X(!1)},children:le.label},le.label)),Me&&o.jsx("button",{className:`filter-chip ${G===""?"filter-chip-active":""}`,type:"button","aria-pressed":G==="",onClick:()=>{oe(""),X(!1)},children:"No location"}),ge.length>1&&G===void 0&&o.jsx("button",{className:`filter-chip filter-chip-compare ${q?"filter-chip-active":""}`,type:"button","aria-pressed":q,onClick:()=>X(le=>!le),title:"Side-by-side location comparison",children:"Compare"})]}),o.jsx(G3,{evidence:it})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsxs("div",{className:"section-head section-head-inline",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),o.jsx("h2",{children:"Competitive landscape"})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("p",{className:"supporting-copy",children:[d.competitors.length," tracked"]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>M(!L),children:L?"Cancel":"+ Add competitor"})]})]}),L&&o.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:T,onChange:le=>A(le.target.value),onKeyDown:le=>le.key==="Enter"&&kt()}),o.jsx(ce,{type:"button",size:"sm",disabled:!T.trim()||P,onClick:kt,children:P?"Adding...":"Add"})]}),o.jsx(K3,{competitors:d.competitors})]}),o.jsxs("section",{className:"page-section-divider",children:[o.jsx("div",{className:"section-head section-head-inline",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),o.jsx("h2",{children:"Recent execution history"})]})}),o.jsx("div",{className:"run-list",children:d.recentRuns.map(le=>o.jsx(n1,{run:le},le.id))})]}),o.jsx(s4,{project:{...d.project,displayName:d.project.displayName??d.project.name,defaultLocation:d.project.defaultLocation??null},onUpdateProject:_t,onRefresh:()=>{c()}}),o.jsx(a4,{projectName:d.project.name}),o.jsx(o4,{projectName:d.project.name})]}):e==="analytics"?o.jsx(V3,{projectName:d.project.name}):e==="traffic"?o.jsx(W3,{projectName:d.project.name}):o.jsx(c4,{projectName:d.project.name})]})}const d4="modulepreload",f4=function(e,t){return new URL(e,t).href},Qb={},h4=function(t,s,a){let r=Promise.resolve();if(s&&s.length>0){let p=function(v){return Promise.all(v.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};const d=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),m=f?.nonce||f?.getAttribute("nonce");r=p(s.map(v=>{if(v=f4(v,a),v in Qb)return;Qb[v]=!0;const y=v.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(a)for(let w=d.length-1;w>=0;w--){const S=d[w];if(S.href===v&&(!y||S.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${v}"]${x}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":d4,y||(b.as="script"),b.crossOrigin="",b.href=v,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((w,S)=>{b.addEventListener("load",w),b.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=d,window.dispatchEvent(f),!f.defaultPrevented)throw d}return r.then(d=>{for(const f of d||[])f.status==="rejected"&&c(f.reason);return t().catch(c)})};function m4(){const{dashboard:e,isLoading:t}=Ra();if(!e||t)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-20"}),o.jsx("div",{className:"skeleton-text-sm w-72"})]}),o.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(f=>o.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[o.jsxs("div",{className:"flex-1 space-y-1.5",children:[o.jsx("div",{className:"skeleton-text w-40"}),o.jsx("div",{className:"skeleton-text-sm w-56"})]}),o.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},f))})]});const s=e.runs,[a,r]=N.useState("all"),c=a==="all"?s:s.filter(f=>f.status===a),d=()=>{h4(async()=>{const{triggerAllRuns:f}=await Promise.resolve().then(()=>DL);return{triggerAllRuns:f}},void 0,import.meta.url).then(({triggerAllRuns:f})=>f().catch(m=>{console.error("Failed to trigger all runs",m)}))};return o.jsxs("div",{className:"page-container",children:[o.jsxs("div",{className:"page-header",children:[o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Runs"}),o.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:d,children:"Run all projects"})]}),o.jsxs("section",{children:[o.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(f=>o.jsx("button",{className:`filter-chip ${a===f?"filter-chip-active":""}`,type:"button","aria-pressed":a===f,onClick:()=>r(f),children:f==="all"?"All runs":Uu(f)},f))}),o.jsx("div",{className:"run-list",children:c.length>0?c.map(f=>o.jsx(n1,{run:f},f.id)):o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h2",{children:"No runs match this filter"}),o.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function p4({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,d]=N.useState(""),[f,m]=N.useState(""),[p,v]=N.useState(""),[y,x]=N.useState(""),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(!1),[R,_]=N.useState(null),[L,M]=N.useState(!1),T=r?f.trim().length>0:c.trim().length>0;async function A(){if(T){E(!0),_(null),M(!1);try{const J=je=>{const B=parseInt(je.trim(),10);return Number.isFinite(B)&&B>0?B:void 0},Q={},se=J(y);se!==void 0&&(Q.maxConcurrency=se);const pe=J(b);pe!==void 0&&(Q.maxRequestsPerMinute=pe);const ke=J(S);ke!==void 0&&(Q.maxRequestsPerDay=ke),await Aw(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...p.trim()?{model:p.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),d(""),m(""),v(""),x(""),w(""),C(""),M(!0),a()}catch(J){_(J instanceof Error?J.message:"Failed to update provider")}finally{E(!1)}}}const P=s??"Use default model";return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r&&o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),o.jsx("input",{id:`base-url-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"http://localhost:11434/v1",value:f,onChange:J=>m(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",r?" (optional)":""]}),t&&o.jsxs("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:["Get API key ","↗"]})]}),o.jsx("input",{id:`api-key-${e}`,type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:r?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:J=>d(J.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),o.jsx("input",{id:`model-${e}`,type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:P,value:p,onChange:J=>v(J.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),o.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Concurrent",value:y,onChange:J=>x(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/min",value:b,onChange:J=>w(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),o.jsxs("div",{children:[o.jsx("input",{type:"number",min:"1",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"/day",value:S,onChange:J=>C(J.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),R&&o.jsx("p",{className:"text-xs text-rose-400",children:R}),L&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!T||k,onClick:A,children:k?"Saving...":"Save"})]})}function g4({onSaved:e}){const[t,s]=N.useState(""),[a,r]=N.useState(""),[c,d]=N.useState(!1),[f,m]=N.useState(null),[p,v]=N.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function x(){if(y){d(!0),m(null),v(!1);try{await Ow({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),e()}catch(b){m(b instanceof Error?b.message:"Failed to update Google OAuth credentials")}finally{d(!1)}}}return o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),o.jsx("a",{href:"https://console.cloud.google.com/apis/credentials",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Google Cloud \\u2197"})]}),o.jsx("input",{id:"google-client-id",type:"text",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client ID",value:t,onChange:b=>s(b.target.value)})]}),o.jsxs("div",{children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),o.jsx("input",{id:"google-client-secret",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Google OAuth client secret",value:a,onChange:b=>r(b.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&o.jsx("p",{className:"text-xs text-rose-400",children:f}),p&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!y||c,onClick:x,children:c?"Saving...":"Save Google OAuth app"})]})}function y4(){const[e,t]=N.useState(null),[s,a]=N.useState(null),[r,c]=N.useState(!1),[d,f]=N.useState("localhost"),[m,p]=N.useState("9222"),[v,y]=N.useState(!1);return N.useEffect(()=>{Am().then(t).catch(x=>{const b=x instanceof Error?x.message:String(x);b.includes("501")||a(b)})},[]),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),o.jsx("h2",{children:"ChatGPT (CDP)"})]}),o.jsx(nt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&o.jsxs("div",{children:[o.jsx("dt",{children:"Endpoint"}),o.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&o.jsxs("div",{children:[o.jsx("dt",{children:"Browser"}),o.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&o.jsxs("div",{children:[o.jsx("dt",{children:"Tabs"}),o.jsx("dd",{children:e.targets.map(x=>o.jsxs("span",{className:"mr-2",children:[x.name,": ",x.alive?"● alive":"○ idle"]},x.name))})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:e?.connected?"Connected to Chrome via CDP. Launch Chrome with --remote-debugging-port to use this provider.":s||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!r),children:r?"Cancel":e?.connected?"Update endpoint":"Configure"})}),r&&o.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async x=>{x.preventDefault(),y(!0);try{await tN(d,parseInt(m,10)||9222);const b=await Am().catch(()=>null);b&&t(b),c(!1)}catch(b){a(b instanceof Error?b.message:String(b))}finally{y(!1)}},children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"localhost",value:d,onChange:x=>f(x.target.value),"aria-label":"CDP host"}),o.jsx("input",{className:"w-24 rounded border border-zinc-700 bg-zinc-900 px-2 py-1 text-sm text-zinc-100 placeholder-zinc-500 focus:outline-none focus:ring-1 focus:ring-zinc-500",placeholder:"9222",value:m,onChange:x=>p(x.target.value),"aria-label":"CDP port"})]}),o.jsx("div",{children:o.jsx(ce,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const v4={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function x4(){const e=cl(),{dashboard:t}=Ra(),s=t?.settings??e?.dashboard?.settings,c=Ju(!e,e?.health).data??e?.health??v4,[d,f]=N.useState(null),[m,p]=N.useState(!1),[v,y]=N.useState(!1),[x,b]=N.useState(""),[w,S]=N.useState(!1),[C,k]=N.useState(null),[E,R]=N.useState(!1);return s?o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Settings"}),o.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),o.jsxs("section",{className:"settings-grid",children:[s.providerStatuses.map(_=>o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),o.jsx("h2",{children:_.displayName??_.name})]}),o.jsx(nt,{tone:_.state==="ready"?"positive":"caution",children:_.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Model"}),o.jsx("dd",{className:"font-mono text-xs",children:_.model})]}),_.quota&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Concurrency"}),o.jsx("dd",{children:_.quota.maxConcurrency})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Rate limit"}),o.jsxs("dd",{children:[_.quota.maxRequestsPerMinute,"/min · ",_.quota.maxRequestsPerDay,"/day"]})]})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:_.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>f(d===_.name?null:_.name),children:d===_.name?"Cancel":_.state==="ready"?_.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),d===_.name&&o.jsx(p4,{providerName:_.name,keyUrl:_.keyUrl,modelHint:_.modelHint,onSaved:()=>{f(null)}})]},_.name)),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),o.jsx("h2",{children:"Search Console OAuth"})]}),o.jsx(nt,{tone:s.google.state==="ready"?"positive":"caution",children:s.google.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.google.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!m),children:m?"Cancel":s.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),m&&o.jsx(g4,{onSaved:()=>{p(!1)}})]}),o.jsxs(De,{className:"surface-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),o.jsx("h2",{children:"Webmaster Tools"})]}),o.jsx(nt,{tone:s.bing.state==="ready"?"positive":"caution",children:s.bing.state==="ready"?"Ready":"Needs config"})]}),o.jsxs("dl",{className:"definition-list mt-3",children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Auth model"}),o.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Storage"}),o.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:s.bing.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(ce,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!v),children:v?"Cancel":s.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&o.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),o.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]}),o.jsx("input",{id:"bing-api-key",type:"password",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"Bing Webmaster Tools API key",value:x,onChange:_=>b(_.target.value)})]}),o.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",o.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&o.jsx("p",{className:"text-xs text-rose-400",children:C}),E&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),o.jsx(ce,{type:"button",size:"sm",disabled:!x.trim()||w,onClick:async()=>{if(x.trim()){S(!0),k(null),R(!1);try{await oN(x.trim()),b(""),R(!0),y(!1)}catch(_){k(_ instanceof Error?_.message:"Failed to update Bing API key")}finally{S(!1)}}},children:w?"Saving...":"Save Bing API key"})]})]}),o.jsx(y4,{}),o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),o.jsx("h2",{children:"API and worker"})]})}),o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"API"}),o.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),o.jsx(nt,{tone:Su(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),o.jsxs("div",{className:"health-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:"Worker"}),o.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),o.jsx(nt,{tone:Su(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),o.jsx("section",{className:"page-section",children:o.jsxs(De,{className:"surface-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),o.jsx("h2",{children:"Operational guidance"})]})}),o.jsx("ul",{className:"detail-list",children:s.selfHostNotes.map(_=>o.jsx("li",{children:_},_))}),o.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const b4=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Key phrases",description:"Add key phrases to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function S4({current:e,labels:t}){return o.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((s,a)=>{const r=a<e,c=a===e;return o.jsxs("div",{className:`setup-step ${r?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[o.jsx("span",{className:"setup-step-number",children:r?"✓":a+1}),o.jsx("span",{className:"setup-step-label",children:s.label})]},s.label)})})}function j4(){const e=cl(),{dashboard:t,isLoading:s,refetch:a}=Ra(),r=t??e?.dashboard;if(!r||s)return o.jsxs("div",{className:"page-skeleton",children:[o.jsxs("div",{className:"page-skeleton-header",children:[o.jsx("div",{className:"skeleton-text h-6 w-24"}),o.jsx("div",{className:"skeleton-text-sm w-80"})]}),o.jsxs("div",{className:"page-skeleton-card",children:[o.jsx("div",{className:"skeleton-text w-32"}),o.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ae=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-1 flex-1",children:[o.jsx("div",{className:"skeleton-text w-24"}),o.jsx("div",{className:"skeleton-text-sm w-48"})]}),o.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ae))})]})]});const c=r.settings,m=Ju(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},p=zM(r.setup,m,c),v=ka(),[y,x]=N.useState(0),[b,w]=N.useState(""),[S,C]=N.useState(""),[k,E]=N.useState(""),[R,_]=N.useState("US"),[L,M]=N.useState("en"),[T,A]=N.useState(null),[P,J]=N.useState(null),[Q,se]=N.useState(null),[pe,ke]=N.useState(!1),[je,B]=N.useState(""),[G,oe]=N.useState(!1),[q,X]=N.useState(null),[O,F]=N.useState(!1),ie=c.providerStatuses.filter(ae=>ae.state==="ready"),[re,ue]=N.useState(ie[0]?.name??""),[he,de]=N.useState(5),[Me,ge]=N.useState(!1),[Ze,it]=N.useState(null),[me,We]=N.useState(""),[dt,sn]=N.useState(!1),[kt,an]=N.useState(null),[Vt,_t]=N.useState(!1),[zt,mn]=N.useState(!1),[le,Be]=N.useState(null),[qe,ze]=N.useState(!1),$e=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=je.split(`
|
|
239
239
|
`).map(ae=>ae.trim()).filter(Boolean),rn=me.split(`
|
|
240
|
-
`).map(ae=>ae.trim()).filter(Boolean),js=p.healthChecks.some(ae=>ae.id==="api"&&ae.state==="ready"),Vs=async()=>{if(!(!$e||!k)){ke(!0),se(null);try{const ae=await ll($e,{displayName:S||b,canonicalDomain:k,country:R,language:
|
|
240
|
+
`).map(ae=>ae.trim()).filter(Boolean),js=p.healthChecks.some(ae=>ae.id==="api"&&ae.state==="ready"),Vs=async()=>{if(!(!$e||!k)){ke(!0),se(null);try{const ae=await ll($e,{displayName:S||b,canonicalDomain:k,country:R,language:L});A($e),J(ae.id),a(),x(2)}catch(ae){se(ae instanceof Error?ae.message:"Failed to create project")}finally{ke(!1)}}},ws=async()=>{if(!T)return;const ae=pt;if(ae.length!==0){F(!0),X(null);try{await Nw(T,ae),oe(!0),a(),x(3)}catch(Jn){X(Jn instanceof Error?Jn.message:"Failed to save key phrases")}finally{F(!1)}}},Qs=async()=>{if(!(!T||!re)){ge(!0),it(null);try{const ae=await Iw(T,re,he);if(ae.keywords.length>0){const Jn=je?je.trimEnd()+`
|
|
241
241
|
`+ae.keywords.join(`
|
|
242
242
|
`):ae.keywords.join(`
|
|
243
|
-
`);B(Jn)}}catch(ae){it(ae instanceof Error?ae.message:"Failed to generate key phrases")}finally{ge(!1)}}},ls=async()=>{if(!T)return;const ae=rn;if(ae.length!==0){_t(!0),an(null);try{await
|
|
243
|
+
`);B(Jn)}}catch(ae){it(ae instanceof Error?ae.message:"Failed to generate key phrases")}finally{ge(!1)}}},ls=async()=>{if(!T)return;const ae=rn;if(ae.length!==0){_t(!0),an(null);try{await Ap(T,ae),sn(!0),a(),x(4)}catch(Jn){an(Jn instanceof Error?Jn.message:"Failed to save competitors")}finally{_t(!1)}}},_e=async()=>{if(T){ze(!0),Be(null);try{await Op(T),mn(!0),a()}catch(ae){Be(ae instanceof Error?ae.message:"Failed to trigger run")}finally{ze(!1)}}},Ht=()=>x(ae=>Math.max(0,ae-1)),Qe=(()=>{switch(y){case 0:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsx("div",{className:"section-head",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),o.jsx("h2",{children:"System ready"})]})}),o.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),o.jsx("div",{className:"compact-stack",children:p.healthChecks.map(ae=>o.jsxs("div",{className:"health-check-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:ae.label}),o.jsx("p",{className:"supporting-copy",children:ae.detail}),ae.id==="provider"&&ae.state!=="ready"&&o.jsx(yt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),o.jsx(nt,{tone:ae.state==="ready"?"positive":"caution",children:ae.state==="ready"?"Ready":"Attention"})]},ae.id))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx("span",{}),o.jsx(ce,{type:"button",disabled:!js,onClick:()=>x(1),children:"Continue"})]})]});case 1:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),o.jsx("h2",{children:"Create project"})]}),T?o.jsx(nt,{tone:"positive",children:"Created"}):null]}),T?o.jsxs("div",{className:"compact-stack",children:[o.jsxs("p",{className:"text-zinc-300",children:["Project ",o.jsx("span",{className:"text-zinc-100 font-medium",children:T})," created successfully."]}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",onClick:()=>x(2),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),o.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:b,onChange:ae=>w(ae.target.value)}),$e&&$e!==b?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",$e]}):null]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),o.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:ae=>C(ae.target.value)})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),o.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:ae=>E(ae.target.value)})]}),o.jsxs("div",{className:"setup-field-row",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),o.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:R,onChange:ae=>_(ae.target.value.toUpperCase())})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),o.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:L,onChange:ae=>M(ae.target.value.toLowerCase())})]})]}),Q?o.jsx("p",{className:"text-rose-400 text-sm",children:Q}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",disabled:!$e||!k||pe,onClick:Vs,children:pe?"Creating...":"Create project"})]})]})]});case 2:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),o.jsx("h2",{children:"Add key phrases"})]}),G?o.jsxs(nt,{tone:"positive",children:[pt.length," saved"]}):o.jsxs(nt,{tone:"neutral",children:[pt.length," key phrase",pt.length!==1?"s":""]})]}),o.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),G?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:pt.map(ae=>o.jsx("li",{children:ae},ae))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",onClick:()=>x(3),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[ie.length>0?o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[o.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",o.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("div",{className:"setup-field flex-1",children:[o.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),o.jsx("select",{id:"gen-provider",className:"setup-input",value:re,onChange:ae=>ue(ae.target.value),children:ie.map(ae=>o.jsxs("option",{value:ae.name,children:[ae.displayName??ae.name,ae.model?` (${ae.model})`:""]},ae.name))})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),o.jsx("select",{id:"gen-count",className:"setup-input",value:he,onChange:ae=>de(Number(ae.target.value)),children:[3,5,10,15,20].map(ae=>o.jsx("option",{value:ae,children:ae},ae))})]}),o.jsx(ce,{type:"button",variant:"outline",disabled:Me||!re,onClick:Qs,children:Me?"Analyzing site...":"Generate"})]}),Ze?o.jsx("p",{className:"text-rose-400 text-sm",children:Ze}):null]}):null,o.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[o.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",o.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),o.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
244
244
|
best invisalign downtown brooklyn
|
|
245
|
-
pediatric dentist brooklyn heights`,value:je,onChange:ae=>B(ae.target.value)})]}),q?o.jsx("p",{className:"text-rose-400 text-sm",children:q}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",disabled:pt.length===0||O,onClick:ws,children:O?"Saving...":`Save ${pt.length} key phrase${pt.length!==1?"s":""}`})]})]})]});case 3:return o.jsxs(
|
|
246
|
-
competitor2.com`,value:me,onChange:ae=>We(ae.target.value)})]}),kt?o.jsx("p",{className:"text-rose-400 text-sm",children:kt}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:()=>x(4),children:"Skip"}),o.jsx(ce,{type:"button",disabled:rn.length===0||Vt,onClick:ls,children:Vt?"Saving...":`Save ${rn.length} competitor${rn.length!==1?"s":""}`})]})]})]})]});case 4:return o.jsxs(
|
|
245
|
+
pediatric dentist brooklyn heights`,value:je,onChange:ae=>B(ae.target.value)})]}),q?o.jsx("p",{className:"text-rose-400 text-sm",children:q}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",disabled:pt.length===0||O,onClick:ws,children:O?"Saving...":`Save ${pt.length} key phrase${pt.length!==1?"s":""}`})]})]})]});case 3:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),o.jsx("h2",{children:"Add competitors"})]}),dt?o.jsx(nt,{tone:"positive",children:"Saved"}):null]}),o.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),dt?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:rn.map(ae=>o.jsx("li",{children:ae},ae))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",onClick:()=>x(4),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),o.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
246
|
+
competitor2.com`,value:me,onChange:ae=>We(ae.target.value)})]}),kt?o.jsx("p",{className:"text-rose-400 text-sm",children:kt}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:()=>x(4),children:"Skip"}),o.jsx(ce,{type:"button",disabled:rn.length===0||Vt,onClick:ls,children:Vt?"Saving...":`Save ${rn.length} competitor${rn.length!==1?"s":""}`})]})]})]})]});case 4:return o.jsxs(De,{className:"surface-card step-card",children:[o.jsxs("div",{className:"section-head",children:[o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),o.jsx("h2",{children:"Launch first run"})]}),zt?o.jsx(nt,{tone:"positive",children:"Queued"}):null]}),zt?o.jsxs("div",{className:"compact-stack",children:[o.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),o.jsxs("div",{className:"setup-nav",children:[o.jsx("span",{}),o.jsx(ce,{type:"button",onClick:()=>v({to:P?`/projects/${P}`:"/"}),children:"Open project"})]})]}):o.jsxs("div",{className:"compact-stack",children:[o.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",o.jsx("span",{className:"text-zinc-100 font-medium",children:T}),"."]}),le?o.jsx("p",{className:"text-rose-400 text-sm",children:le}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(ce,{type:"button",variant:"outline",onClick:Ht,children:"Back"}),o.jsx(ce,{type:"button",disabled:qe,onClick:_e,children:qe?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return o.jsxs("div",{className:"page-container",children:[o.jsx("div",{className:"page-header",children:o.jsxs("div",{className:"page-header-left",children:[o.jsx("h1",{className:"page-title",children:"Setup"}),o.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),o.jsx(S4,{current:y,labels:b4}),o.jsx("section",{className:"setup-wizard",children:Qe})]})}function w4(){return o.jsx("div",{className:"page-container",children:o.jsx("section",{className:"page-section",children:o.jsxs(De,{className:"surface-card empty-card",children:[o.jsx("h1",{children:"Route not found"}),o.jsx("p",{children:"The current path does not map to a dashboard view."}),o.jsx(ce,{asChild:!0,children:o.jsx(yt,{to:"/",children:"Return to overview"})})]})})})}function N4(){return o.jsx(xM,{children:o.jsx(vM,{})})}const as=qz()({component:N4,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),C4=Vn({getParentRoute:()=>as,path:"/",component:RM,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ai.projects.all);if(t&&t.length===0)throw tp({to:"/setup"})}}),k4=Vn({getParentRoute:()=>as,path:"/projects",component:q3}),pl=Vn({getParentRoute:()=>as,path:"/projects/$projectId",component:()=>o.jsx(dp,{})}),_4=Vn({getParentRoute:()=>pl,path:"/",component:()=>o.jsx(ld,{tab:"overview"})}),z4=Vn({getParentRoute:()=>pl,path:"/search-console",component:()=>o.jsx(ld,{tab:"search-console"})}),E4=Vn({getParentRoute:()=>pl,path:"/analytics",component:()=>o.jsx(ld,{tab:"analytics"})}),R4=Vn({getParentRoute:()=>pl,path:"/traffic",component:()=>o.jsx(ld,{tab:"traffic"})}),T4=Vn({getParentRoute:()=>as,path:"/runs",component:m4}),A4=Vn({getParentRoute:()=>as,path:"/settings",component:x4,beforeLoad:({context:e})=>{}}),O4=Vn({getParentRoute:()=>as,path:"/setup",component:j4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ai.projects.all);if(t&&t.length>0)throw tp({to:"/"})}}),D4=Vn({getParentRoute:()=>as,path:"*",component:w4}),L4=as.addChildren([C4,k4,pl.addChildren([_4,z4,E4,R4]),T4,A4,O4,D4]);function M4(e,t){return Xz({routeTree:L4,basepath:Um||"/",context:{queryClient:e},...t?.initialEntries})}const $4={negative:"border-rose-700/60 bg-rose-950/80 text-rose-200",caution:"border-amber-700/60 bg-amber-950/80 text-amber-200",positive:"border-emerald-700/60 bg-emerald-950/80 text-emerald-200",neutral:"border-zinc-700/60 bg-zinc-900/80 text-zinc-200"};function U4(){const e=N.useSyncExternalStore(a2,Lx,Lx),t=N.useCallback(s=>{LS(s)},[]);return e.length===0?null:o.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm",children:e.map(s=>o.jsxs("div",{role:"alert",className:`flex items-start gap-2 rounded-lg border px-3 py-2.5 text-sm shadow-lg backdrop-blur-sm animate-in slide-in-from-bottom-2 ${$4[s.tone]}`,children:[o.jsx("p",{className:"flex-1 leading-snug",children:s.message}),o.jsx("button",{type:"button",onClick:()=>t(s.id),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:o.jsx($u,{className:"size-3.5"})})]},s.id))})}const a1=r2(),P4=M4(a1),r1=document.getElementById("root");if(!r1)throw new Error("Expected #root element for web app bootstrap.");Nk.createRoot(r1).render(o.jsx(N.StrictMode,{children:o.jsxs(Qk,{client:a1,children:[o.jsx(t2,{router:P4}),o.jsx(U4,{})]})}));
|