@ainyc/canonry 1.29.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/assets/index-DmFB_uXa.js +246 -0
- package/assets/assets/{index-DwPC0zVy.css → index-r6biprHB.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-IWUQVYU3.js → chunk-LMSO32GF.js} +1068 -25
- package/dist/cli.js +376 -12
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/assets/assets/index-D1pCtUfW.js +0 -246
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
function tk(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 u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).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 hS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _h={exports:{}},Io={};var Fv;function nk(){if(Fv)return Io;Fv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(a,r,c){var u=null;if(c!==void 0&&(u=""+c),r.key!==void 0&&(u=""+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:u,ref:r!==void 0?r:null,props:c}}return Io.Fragment=t,Io.jsx=s,Io.jsxs=s,Io}var Zv;function sk(){return Zv||(Zv=1,_h.exports=nk()),_h.exports}var o=sk(),Eh={exports:{}},Re={};var Vv;function ik(){if(Vv)return Re;Vv=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"),u=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(T){return T===null||typeof T!="object"?null:(T=x&&T[x]||T["@@iterator"],typeof T=="function"?T:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(T,B,se){this.props=T,this.context=B,this.refs=C,this.updater=se||N}k.prototype.isReactComponent={},k.prototype.setState=function(T,B){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,B,"setState")},k.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function R(){}R.prototype=k.prototype;function A(T,B,se){this.props=T,this.context=B,this.refs=C,this.updater=se||N}var z=A.prototype=new R;z.constructor=A,S(z,k.prototype),z.isPureReactComponent=!0;var O=Array.isArray;function $(){}var E={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function U(T,B,se){var le=se.ref;return{$$typeof:e,type:T,key:B,ref:le!==void 0?le:null,props:se}}function X(T,B){return U(T.type,B,T.props)}function Q(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function ee(T){var B={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(se){return B[se]})}var ue=/\/+/g;function Ee(T,B){return typeof T=="object"&&T!==null&&T.key!=null?ee(""+T.key):B.toString(36)}function we(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then($,$):(T.status="pending",T.then(function(B){T.status==="pending"&&(T.status="fulfilled",T.value=B)},function(B){T.status==="pending"&&(T.status="rejected",T.reason=B)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function K(T,B,se,le,J){var fe=typeof T;(fe==="undefined"||fe==="boolean")&&(T=null);var ye=!1;if(T===null)ye=!0;else switch(fe){case"bigint":case"string":case"number":ye=!0;break;case"object":switch(T.$$typeof){case e:case t:ye=!0;break;case v:return ye=T._init,K(ye(T._payload),B,se,le,J)}}if(ye)return J=J(T),ye=le===""?"."+Ee(T,0):le,O(J)?(se="",ye!=null&&(se=ye.replace(ue,"$&/")+"/"),K(J,B,se,"",function(Ze){return Ze})):J!=null&&(Q(J)&&(J=X(J,se+(J.key==null||T&&T.key===J.key?"":(""+J.key).replace(ue,"$&/")+"/")+ye)),B.push(J)),1;ye=0;var Ae=le===""?".":le+":";if(O(T))for(var ge=0;ge<T.length;ge++)le=T[ge],fe=Ae+Ee(le,ge),ye+=K(le,B,se,fe,J);else if(ge=b(T),typeof ge=="function")for(T=ge.call(T),ge=0;!(le=T.next()).done;)le=le.value,fe=Ae+Ee(le,ge++),ye+=K(le,B,se,fe,J);else if(fe==="object"){if(typeof T.then=="function")return K(we(T),B,se,le,J);throw B=String(T),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ye}function ae(T,B,se){if(T==null)return T;var le=[],J=0;return K(T,le,"","",function(fe){return B.call(se,fe,J++)}),le}function me(T){if(T._status===-1){var B=T._result;B=B(),B.then(function(se){(T._status===0||T._status===-1)&&(T._status=1,T._result=se)},function(se){(T._status===0||T._status===-1)&&(T._status=2,T._result=se)}),T._status===-1&&(T._status=0,T._result=B)}if(T._status===1)return T._result.default;throw T._result}var V=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},H={map:ae,forEach:function(T,B,se){ae(T,function(){B.apply(this,arguments)},se)},count:function(T){var B=0;return ae(T,function(){B++}),B},toArray:function(T){return ae(T,function(B){return B})||[]},only:function(T){if(!Q(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Re.Activity=y,Re.Children=H,Re.Component=k,Re.Fragment=s,Re.Profiler=r,Re.PureComponent=A,Re.StrictMode=a,Re.Suspense=m,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Re.__COMPILER_RUNTIME={__proto__:null,c:function(T){return E.H.useMemoCache(T)}},Re.cache=function(T){return function(){return T.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(T,B,se){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var le=S({},T.props),J=T.key;if(B!=null)for(fe in B.key!==void 0&&(J=""+B.key),B)!L.call(B,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&B.ref===void 0||(le[fe]=B[fe]);var fe=arguments.length-2;if(fe===1)le.children=se;else if(1<fe){for(var ye=Array(fe),Ae=0;Ae<fe;Ae++)ye[Ae]=arguments[Ae+2];le.children=ye}return U(T.type,J,le)},Re.createContext=function(T){return T={$$typeof:u,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:c,_context:T},T},Re.createElement=function(T,B,se){var le,J={},fe=null;if(B!=null)for(le in B.key!==void 0&&(fe=""+B.key),B)L.call(B,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(J[le]=B[le]);var ye=arguments.length-2;if(ye===1)J.children=se;else if(1<ye){for(var Ae=Array(ye),ge=0;ge<ye;ge++)Ae[ge]=arguments[ge+2];J.children=Ae}if(T&&T.defaultProps)for(le in ye=T.defaultProps,ye)J[le]===void 0&&(J[le]=ye[le]);return U(T,fe,J)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(T){return{$$typeof:f,render:T}},Re.isValidElement=Q,Re.lazy=function(T){return{$$typeof:v,_payload:{_status:-1,_result:T},_init:me}},Re.memo=function(T,B){return{$$typeof:p,type:T,compare:B===void 0?null:B}},Re.startTransition=function(T){var B=E.T,se={};E.T=se;try{var le=T(),J=E.S;J!==null&&J(se,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then($,V)}catch(fe){V(fe)}finally{B!==null&&se.types!==null&&(B.types=se.types),E.T=B}},Re.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Re.use=function(T){return E.H.use(T)},Re.useActionState=function(T,B,se){return E.H.useActionState(T,B,se)},Re.useCallback=function(T,B){return E.H.useCallback(T,B)},Re.useContext=function(T){return E.H.useContext(T)},Re.useDebugValue=function(){},Re.useDeferredValue=function(T,B){return E.H.useDeferredValue(T,B)},Re.useEffect=function(T,B){return E.H.useEffect(T,B)},Re.useEffectEvent=function(T){return E.H.useEffectEvent(T)},Re.useId=function(){return E.H.useId()},Re.useImperativeHandle=function(T,B,se){return E.H.useImperativeHandle(T,B,se)},Re.useInsertionEffect=function(T,B){return E.H.useInsertionEffect(T,B)},Re.useLayoutEffect=function(T,B){return E.H.useLayoutEffect(T,B)},Re.useMemo=function(T,B){return E.H.useMemo(T,B)},Re.useOptimistic=function(T,B){return E.H.useOptimistic(T,B)},Re.useReducer=function(T,B,se){return E.H.useReducer(T,B,se)},Re.useRef=function(T){return E.H.useRef(T)},Re.useState=function(T){return E.H.useState(T)},Re.useSyncExternalStore=function(T,B,se){return E.H.useSyncExternalStore(T,B,se)},Re.useTransition=function(){return E.H.useTransition()},Re.version="19.2.4",Re}var Qv;function fl(){return Qv||(Qv=1,Eh.exports=ik()),Eh.exports}var w=fl();const cs=hS(w),Wm=tk({__proto__:null,default:cs},[w]);var Ah={exports:{}},Bo={},Rh={exports:{}},Th={};var Yv;function ak(){return Yv||(Yv=1,(function(e){function t(K,ae){var me=K.length;K.push(ae);e:for(;0<me;){var V=me-1>>>1,H=K[V];if(0<r(H,ae))K[V]=ae,K[me]=H,me=V;else break e}}function s(K){return K.length===0?null:K[0]}function a(K){if(K.length===0)return null;var ae=K[0],me=K.pop();if(me!==ae){K[0]=me;e:for(var V=0,H=K.length,T=H>>>1;V<T;){var B=2*(V+1)-1,se=K[B],le=B+1,J=K[le];if(0>r(se,me))le<H&&0>r(J,se)?(K[V]=J,K[le]=me,V=le):(K[V]=se,K[B]=me,V=B);else if(le<H&&0>r(J,me))K[V]=J,K[le]=me,V=le;else break e}}return ae}function r(K,ae){var me=K.sortIndex-ae.sortIndex;return me!==0?me:K.id-ae.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 u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var m=[],p=[],v=1,y=null,x=3,b=!1,N=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function z(K){for(var ae=s(p);ae!==null;){if(ae.callback===null)a(p);else if(ae.startTime<=K)a(p),ae.sortIndex=ae.expirationTime,t(m,ae);else break;ae=s(p)}}function O(K){if(S=!1,z(K),!N)if(s(m)!==null)N=!0,$||($=!0,ee());else{var ae=s(p);ae!==null&&we(O,ae.startTime-K)}}var $=!1,E=-1,L=5,U=-1;function X(){return C?!0:!(e.unstable_now()-U<L)}function Q(){if(C=!1,$){var K=e.unstable_now();U=K;var ae=!0;try{e:{N=!1,S&&(S=!1,R(E),E=-1),b=!0;var me=x;try{t:{for(z(K),y=s(m);y!==null&&!(y.expirationTime>K&&X());){var V=y.callback;if(typeof V=="function"){y.callback=null,x=y.priorityLevel;var H=V(y.expirationTime<=K);if(K=e.unstable_now(),typeof H=="function"){y.callback=H,z(K),ae=!0;break t}y===s(m)&&a(m),z(K)}else a(m);y=s(m)}if(y!==null)ae=!0;else{var T=s(p);T!==null&&we(O,T.startTime-K),ae=!1}}break e}finally{y=null,x=me,b=!1}ae=void 0}}finally{ae?ee():$=!1}}}var ee;if(typeof A=="function")ee=function(){A(Q)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,Ee=ue.port2;ue.port1.onmessage=Q,ee=function(){Ee.postMessage(null)}}else ee=function(){k(Q,0)};function we(K,ae){E=k(function(){K(e.unstable_now())},ae)}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(K){K.callback=null},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(K){switch(x){case 1:case 2:case 3:var ae=3;break;default:ae=x}var me=x;x=ae;try{return K()}finally{x=me}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(K,ae){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var me=x;x=K;try{return ae()}finally{x=me}},e.unstable_scheduleCallback=function(K,ae,me){var V=e.unstable_now();switch(typeof me=="object"&&me!==null?(me=me.delay,me=typeof me=="number"&&0<me?V+me:V):me=V,K){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=me+H,K={id:v++,callback:ae,priorityLevel:K,startTime:me,expirationTime:H,sortIndex:-1},me>V?(K.sortIndex=me,t(p,K),s(m)===null&&K===s(p)&&(S?(R(E),E=-1):S=!0,we(O,me-V))):(K.sortIndex=H,t(m,K),N||b||(N=!0,$||($=!0,ee()))),K},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(K){var ae=x;return function(){var me=x;x=ae;try{return K.apply(this,arguments)}finally{x=me}}}})(Th)),Th}var Jv;function rk(){return Jv||(Jv=1,Rh.exports=ak()),Rh.exports}var Oh={exports:{}},an={};var Xv;function ok(){if(Xv)return an;Xv=1;var e=fl();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 u=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 an.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,an.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)},an.flushSync=function(m){var p=u.T,v=a.p;try{if(u.T=null,a.p=2,m)return m()}finally{u.T=p,a.p=v,a.d.f()}},an.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))},an.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},an.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})}},an.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)},an.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})}},an.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)},an.requestFormReset=function(m){a.d.r(m)},an.unstable_batchedUpdates=function(m,p){return m(p)},an.useFormState=function(m,p,v){return u.H.useFormState(m,p,v)},an.useFormStatus=function(){return u.H.useHostTransitionStatus()},an.version="19.2.4",an}var Wv;function mS(){if(Wv)return Oh.exports;Wv=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(),Oh.exports=ok(),Oh.exports}var ex;function lk(){if(ex)return Bo;ex=1;var e=rk(),t=fl(),s=mS();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 u(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,d=i;;){var h=l.return;if(h===null)break;var g=h.alternate;if(g===null){if(d=h.return,d!==null){l=d;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===l)return m(h),n;if(g===d)return m(h),i;g=g.sibling}throw Error(a(188))}if(l.return!==d.return)l=h,d=g;else{for(var j=!1,_=h.child;_;){if(_===l){j=!0,l=h,d=g;break}if(_===d){j=!0,d=h,l=g;break}_=_.sibling}if(!j){for(_=g.child;_;){if(_===l){j=!0,l=g,d=h;break}if(_===d){j=!0,d=g,l=h;break}_=_.sibling}if(!j)throw Error(a(189))}}if(l.alternate!==d)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"),N=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),A=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function ee(n){return n===null||typeof n!="object"?null:(n=Q&&n[Q]||n["@@iterator"],typeof n=="function"?n:null)}var ue=Symbol.for("react.client.reference");function Ee(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===ue?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 O:return"Suspense";case $:return"SuspenseList";case U:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case N:return"Portal";case A:return n.displayName||"Context";case R:return(n._context.displayName||"Context")+".Consumer";case z:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case E:return i=n.displayName||null,i!==null?i:Ee(n.type)||"Memo";case L:i=n._payload,n=n._init;try{return Ee(n(i))}catch{}}return null}var we=Array.isArray,K=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},V=[],H=-1;function T(n){return{current:n}}function B(n){0>H||(n.current=V[H],V[H]=null,H--)}function se(n,i){H++,V[H]=n.current,n.current=i}var le=T(null),J=T(null),fe=T(null),ye=T(null);function Ae(n,i){switch(se(fe,i),se(J,n),se(le,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?pv(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=pv(i),n=gv(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}B(le),se(le,n)}function ge(){B(le),B(J),B(fe)}function Ze(n){n.memoizedState!==null&&se(ye,n);var i=le.current,l=gv(i,n.type);i!==l&&(se(J,n),se(le,l))}function et(n){J.current===n&&(B(le),B(J)),ye.current===n&&(B(ye),Mo._currentValue=me)}var de,Ve;function at(n){if(de===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);de=i&&i[1]||"",Ve=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+de+n+Ve}var Vt=!1;function Pt(n,i){if(!n||Vt)return"";Vt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(Y){var Z=Y}Reflect.construct(n,[],ie)}else{try{ie.call()}catch(Y){Z=Y}n.call(ie.prototype)}}else{try{throw Error()}catch(Y){Z=Y}(ie=n())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Y){if(Y&&Z&&typeof Y.stack=="string")return[Y.stack,Z.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=d.DetermineComponentFrameRoot(),j=g[0],_=g[1];if(j&&_){var M=j.split(`
|
|
4
|
-
`),F=_.split(`
|
|
5
|
-
`);for(h=d=0;d<M.length&&!M[d].includes("DetermineComponentFrameRoot");)d++;for(;h<F.length&&!F[h].includes("DetermineComponentFrameRoot");)h++;if(d===M.length||h===F.length)for(d=M.length-1,h=F.length-1;1<=d&&0<=h&&M[d]!==F[h];)h--;for(;1<=d&&0<=h;d--,h--)if(M[d]!==F[h]){if(d!==1||h!==1)do if(d--,h--,0>h||M[d]!==F[h]){var W=`
|
|
6
|
-
`+M[d].replace(" at new "," at ");return n.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",n.displayName)),W}while(1<=d&&0<=h);break}}}finally{Vt=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?at(l):""}function Dn(n,i){switch(n.tag){case 26:case 27:case 5:return at(n.type);case 16:return at("Lazy");case 13:return n.child!==i&&i!==null?at("Suspense Fallback"):at("Suspense");case 19:return at("SuspenseList");case 0:case 15:return Pt(n.type,!1);case 11:return Pt(n.type.render,!1);case 1:return Pt(n.type,!0);case 31:return at("Activity");default:return""}}function nn(n){try{var i="",l=null;do i+=Dn(n,l),l=n,n=n.return;while(n);return i}catch(d){return`
|
|
7
|
-
Error generating stack: `+d.message+`
|
|
8
|
-
`+d.stack}}var _t=Object.prototype.hasOwnProperty,re=e.unstable_scheduleCallback,Ge=e.unstable_cancelCallback,gt=e.unstable_shouldYield,Qt=e.unstable_requestPaint,Qe=e.unstable_now,Me=e.unstable_getCurrentPriorityLevel,Ye=e.unstable_ImmediatePriority,Nt=e.unstable_UserBlockingPriority,Be=e.unstable_NormalPriority,Da=e.unstable_LowPriority,pn=e.unstable_IdlePriority,nt=e.log,Yr=e.unstable_setDisableYieldValue,ts=null,ht=null;function gn(n){if(typeof nt=="function"&&Yr(n),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(ts,n)}catch{}}var ce=Math.clz32?Math.clz32:jl,kn=Math.log,Ma=Math.LN2;function jl(n){return n>>>=0,n===0?32:31-(kn(n)/Ma|0)|0}var Ki=256,$a=262144,Cs=4194304;function hs(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 Pa(n,i,l){var d=n.pendingLanes;if(d===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var _=d&134217727;return _!==0?(d=_&~g,d!==0?h=hs(d):(j&=_,j!==0?h=hs(j):l||(l=_&~n,l!==0&&(h=hs(l))))):(_=d&~g,_!==0?h=hs(_):j!==0?h=hs(j):l||(l=d&~n,l!==0&&(h=hs(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 Ys(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function xd(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 wl(){var n=Cs;return Cs<<=1,(Cs&62914560)===0&&(Cs=4194304),n}function Jr(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Gi(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Nl(n,i,l,d,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 _=n.entanglements,M=n.expirationTimes,F=n.hiddenUpdates;for(l=j&~l;0<l;){var W=31-ce(l),ie=1<<W;_[W]=0,M[W]=-1;var Z=F[W];if(Z!==null)for(F[W]=null,W=0;W<Z.length;W++){var Y=Z[W];Y!==null&&(Y.lane&=-536870913)}l&=~ie}d!==0&&I(n,d,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~i))}function I(n,i,l){n.pendingLanes|=i,n.suspendedLanes&=~i;var d=31-ce(i);n.entangledLanes|=i,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function he(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var d=31-ce(l),h=1<<d;h&i|n[d]&i&&(n[d]|=i),l&=~h}}function xt(n,i){var l=i&-i;return l=(l&42)!==0?1:Kt(l),(l&(n.suspendedLanes|i))!==0?0:l}function Kt(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 ln(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Ua(){var n=ae.p;return n!==0?n:(n=window.event,n===void 0?32:Uv(n.type))}function ms(n,i){var l=ae.p;try{return ae.p=n,i()}finally{ae.p=l}}var cn=Math.random().toString(36).slice(2),st="__reactFiber$"+cn,sn="__reactProps$"+cn,zn="__reactContainer$"+cn,ks="__reactEvents$"+cn,Ia="__reactListeners$"+cn,Cl="__reactHandles$"+cn,kl="__reactResources$"+cn,ps="__reactMarker$"+cn;function Js(n){delete n[st],delete n[sn],delete n[ks],delete n[Ia],delete n[Cl]}function Xs(n){var i=n[st];if(i)return i;for(var l=n.parentNode;l;){if(i=l[zn]||l[st]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=wv(n);n!==null;){if(l=n[st])return l;n=wv(n)}return i}n=l,l=n.parentNode}return null}function Ws(n){if(n=n[st]||n[zn]){var i=n.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return n}return null}function $e(n){var i=n.tag;if(i===5||i===26||i===27||i===6)return n.stateNode;throw Error(a(33))}function Je(n){var i=n[kl];return i||(i=n[kl]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function it(n){n[ps]=!0}var ns=new Set,Fi={};function gs(n,i){Ba(n,i),Ba(n+"Capture",i)}function Ba(n,i){for(Fi[n]=i,n=0;n<i.length;n++)ns.add(i[n])}var FN=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]*$"),ag={},rg={};function ZN(n){return _t.call(rg,n)?!0:_t.call(ag,n)?!1:FN.test(n)?rg[n]=!0:(ag[n]=!0,!1)}function zl(n,i,l){if(ZN(i))if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(i);return}}n.setAttribute(i,""+l)}}function _l(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 zs(n,i,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(i,l,""+d)}}function Mn(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function og(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function VN(n,i,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,i);if(!n.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var h=d.get,g=d.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:d.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function bd(n){if(!n._valueTracker){var i=og(n)?"checked":"value";n._valueTracker=VN(n,i,""+n[i])}}function lg(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return n&&(d=og(n)?n.checked?"true":"false":n.value),n=d,n!==l?(i.setValue(n),!0):!1}function El(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 QN=/[\n"\\]/g;function $n(n){return n.replace(QN,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Sd(n,i,l,d,h,g,j,_){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=""+Mn(i)):n.value!==""+Mn(i)&&(n.value=""+Mn(i)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),i!=null?jd(n,j,Mn(i)):l!=null?jd(n,j,Mn(l)):d!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?n.name=""+Mn(_):n.removeAttribute("name")}function cg(n,i,l,d,h,g,j,_){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)){bd(n);return}l=l!=null?""+Mn(l):"",i=i!=null?""+Mn(i):l,_||i===n.value||(n.value=i),n.defaultValue=i}d=d??h,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=_?n.checked:!!d,n.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j),bd(n)}function jd(n,i,l){i==="number"&&El(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function qa(n,i,l,d){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&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Mn(l),i=null,h=0;h<n.length;h++){if(n[h].value===l){n[h].selected=!0,d&&(n[h].defaultSelected=!0);return}i!==null||n[h].disabled||(i=n[h])}i!==null&&(i.selected=!0)}}function ug(n,i,l){if(i!=null&&(i=""+Mn(i),i!==n.value&&(n.value=i),l==null)){n.defaultValue!==i&&(n.defaultValue=i);return}n.defaultValue=l!=null?""+Mn(l):""}function dg(n,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(a(92));if(we(d)){if(1<d.length)throw Error(a(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=Mn(i),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),bd(n)}function Ha(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var YN=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 fg(n,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(i,""):i==="float"?n.cssFloat="":n[i]="":d?n.setProperty(i,l):typeof l!="number"||l===0||YN.has(i)?i==="float"?n.cssFloat=l:n[i]=(""+l).trim():n[i]=l+"px"}function hg(n,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var h in i)d=i[h],i.hasOwnProperty(h)&&l[h]!==d&&fg(n,h,d)}else for(var g in i)i.hasOwnProperty(g)&&fg(n,g,i[g])}function wd(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 JN=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"]]),XN=/^[\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 Al(n){return XN.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function _s(){}var Nd=null;function Cd(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ka=null,Ga=null;function mg(n){var i=Ws(n);if(i&&(n=i.stateNode)){var l=n[sn]||null;e:switch(n=i.stateNode,i.type){case"input":if(Sd(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="'+$n(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==n&&d.form===n.form){var h=d[sn]||null;if(!h)throw Error(a(90));Sd(d,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)d=l[i],d.form===n.form&&lg(d)}break e;case"textarea":ug(n,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&qa(n,!!l.multiple,i,!1)}}}var kd=!1;function pg(n,i,l){if(kd)return n(i,l);kd=!0;try{var d=n(i);return d}finally{if(kd=!1,(Ka!==null||Ga!==null)&&(yc(),Ka&&(i=Ka,n=Ga,Ga=Ka=null,mg(i),n)))for(i=0;i<n.length;i++)mg(n[i])}}function Xr(n,i){var l=n.stateNode;if(l===null)return null;var d=l[sn]||null;if(d===null)return null;l=d[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":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var Es=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zd=!1;if(Es)try{var Wr={};Object.defineProperty(Wr,"passive",{get:function(){zd=!0}}),window.addEventListener("test",Wr,Wr),window.removeEventListener("test",Wr,Wr)}catch{zd=!1}var ei=null,_d=null,Rl=null;function gg(){if(Rl)return Rl;var n,i=_d,l=i.length,d,h="value"in ei?ei.value:ei.textContent,g=h.length;for(n=0;n<l&&i[n]===h[n];n++);var j=l-n;for(d=1;d<=j&&i[l-d]===h[g-d];d++);return Rl=h.slice(n,1<d?1-d:void 0)}function Tl(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 Ol(){return!0}function yg(){return!1}function yn(n){function i(l,d,h,g,j){this._reactName=l,this._targetInst=h,this.type=d,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var _ in n)n.hasOwnProperty(_)&&(l=n[_],this[_]=l?l(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Ol:yg,this.isPropagationStopped=yg,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=Ol)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ol)},persist:function(){},isPersistent:Ol}),i}var Zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ll=yn(Zi),eo=y({},Zi,{view:0,detail:0}),WN=yn(eo),Ed,Ad,to,Dl=y({},eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Td,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!==to&&(to&&n.type==="mousemove"?(Ed=n.screenX-to.screenX,Ad=n.screenY-to.screenY):Ad=Ed=0,to=n),Ed)},movementY:function(n){return"movementY"in n?n.movementY:Ad}}),vg=yn(Dl),e1=y({},Dl,{dataTransfer:0}),t1=yn(e1),n1=y({},eo,{relatedTarget:0}),Rd=yn(n1),s1=y({},Zi,{animationName:0,elapsedTime:0,pseudoElement:0}),i1=yn(s1),a1=y({},Zi,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),r1=yn(a1),o1=y({},Zi,{data:0}),xg=yn(o1),l1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},c1={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"},u1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function d1(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=u1[n])?!!i[n]:!1}function Td(){return d1}var f1=y({},eo,{key:function(n){if(n.key){var i=l1[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=Tl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?c1[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Td,charCode:function(n){return n.type==="keypress"?Tl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Tl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),h1=yn(f1),m1=y({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bg=yn(m1),p1=y({},eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Td}),g1=yn(p1),y1=y({},Zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),v1=yn(y1),x1=y({},Dl,{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}),b1=yn(x1),S1=y({},Zi,{newState:0,oldState:0}),j1=yn(S1),w1=[9,13,27,32],Od=Es&&"CompositionEvent"in window,no=null;Es&&"documentMode"in document&&(no=document.documentMode);var N1=Es&&"TextEvent"in window&&!no,Sg=Es&&(!Od||no&&8<no&&11>=no),jg=" ",wg=!1;function Ng(n,i){switch(n){case"keyup":return w1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cg(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Fa=!1;function C1(n,i){switch(n){case"compositionend":return Cg(i);case"keypress":return i.which!==32?null:(wg=!0,jg);case"textInput":return n=i.data,n===jg&&wg?null:n;default:return null}}function k1(n,i){if(Fa)return n==="compositionend"||!Od&&Ng(n,i)?(n=gg(),Rl=_d=ei=null,Fa=!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 Sg&&i.locale!=="ko"?null:i.data;default:return null}}var z1={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 kg(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!z1[n.type]:i==="textarea"}function zg(n,i,l,d){Ka?Ga?Ga.push(d):Ga=[d]:Ka=d,i=Nc(i,"onChange"),0<i.length&&(l=new Ll("onChange","change",null,l,d),n.push({event:l,listeners:i}))}var so=null,io=null;function _1(n){cv(n,0)}function Ml(n){var i=$e(n);if(lg(i))return n}function _g(n,i){if(n==="change")return i}var Eg=!1;if(Es){var Ld;if(Es){var Dd="oninput"in document;if(!Dd){var Ag=document.createElement("div");Ag.setAttribute("oninput","return;"),Dd=typeof Ag.oninput=="function"}Ld=Dd}else Ld=!1;Eg=Ld&&(!document.documentMode||9<document.documentMode)}function Rg(){so&&(so.detachEvent("onpropertychange",Tg),io=so=null)}function Tg(n){if(n.propertyName==="value"&&Ml(io)){var i=[];zg(i,io,n,Cd(n)),pg(_1,i)}}function E1(n,i,l){n==="focusin"?(Rg(),so=i,io=l,so.attachEvent("onpropertychange",Tg)):n==="focusout"&&Rg()}function A1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ml(io)}function R1(n,i){if(n==="click")return Ml(i)}function T1(n,i){if(n==="input"||n==="change")return Ml(i)}function O1(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var _n=typeof Object.is=="function"?Object.is:O1;function ao(n,i){if(_n(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var h=l[d];if(!_t.call(i,h)||!_n(n[h],i[h]))return!1}return!0}function Og(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Lg(n,i){var l=Og(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=i&&d>=i)return{node:l,offset:i-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Og(l)}}function Dg(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Dg(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function Mg(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=El(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=El(n.document)}return i}function Md(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 L1=Es&&"documentMode"in document&&11>=document.documentMode,Za=null,$d=null,ro=null,Pd=!1;function $g(n,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pd||Za==null||Za!==El(d)||(d=Za,"selectionStart"in d&&Md(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ro&&ao(ro,d)||(ro=d,d=Nc($d,"onSelect"),0<d.length&&(i=new Ll("onSelect","select",null,i,l),n.push({event:i,listeners:d}),i.target=Za)))}function Vi(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var Va={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")},Ud={},Pg={};Es&&(Pg=document.createElement("div").style,"AnimationEvent"in window||(delete Va.animationend.animation,delete Va.animationiteration.animation,delete Va.animationstart.animation),"TransitionEvent"in window||delete Va.transitionend.transition);function Qi(n){if(Ud[n])return Ud[n];if(!Va[n])return n;var i=Va[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Pg)return Ud[n]=i[l];return n}var Ug=Qi("animationend"),Ig=Qi("animationiteration"),Bg=Qi("animationstart"),D1=Qi("transitionrun"),M1=Qi("transitionstart"),$1=Qi("transitioncancel"),qg=Qi("transitionend"),Hg=new Map,Id="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(" ");Id.push("scrollEnd");function ss(n,i){Hg.set(n,i),gs(i,[n])}var $l=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)},Pn=[],Qa=0,Bd=0;function Pl(){for(var n=Qa,i=Bd=Qa=0;i<n;){var l=Pn[i];Pn[i++]=null;var d=Pn[i];Pn[i++]=null;var h=Pn[i];Pn[i++]=null;var g=Pn[i];if(Pn[i++]=null,d!==null&&h!==null){var j=d.pending;j===null?h.next=h:(h.next=j.next,j.next=h),d.pending=h}g!==0&&Kg(l,h,g)}}function Ul(n,i,l,d){Pn[Qa++]=n,Pn[Qa++]=i,Pn[Qa++]=l,Pn[Qa++]=d,Bd|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function qd(n,i,l,d){return Ul(n,i,l,d),Il(n)}function Yi(n,i){return Ul(n,null,null,i),Il(n)}function Kg(n,i,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var h=!1,g=n.return;g!==null;)g.childLanes|=l,d=g.alternate,d!==null&&(d.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-ce(l),n=g.hiddenUpdates,d=n[h],d===null?n[h]=[i]:d.push(i),i.lane=l|536870912),g):null}function Il(n){if(50<Eo)throw Eo=0,Xf=null,Error(a(185));for(var i=n.return;i!==null;)n=i,i=n.return;return n.tag===3?n.stateNode:null}var Ya={};function P1(n,i,l,d){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=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(n,i,l,d){return new P1(n,i,l,d)}function Hd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function As(n,i){var l=n.alternate;return l===null?(l=En(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 Gg(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 Bl(n,i,l,d,h,g){var j=0;if(d=n,typeof n=="function")Hd(n)&&(j=1);else if(typeof n=="string")j=HC(n,l,le.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case U:return n=En(31,l,i,h),n.elementType=U,n.lanes=g,n;case S:return Ji(l.children,h,g,i);case C:j=8,h|=24;break;case k:return n=En(12,l,i,h|2),n.elementType=k,n.lanes=g,n;case O:return n=En(13,l,i,h),n.elementType=O,n.lanes=g,n;case $:return n=En(19,l,i,h),n.elementType=$,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case A:j=10;break e;case R:j=9;break e;case z:j=11;break e;case E:j=14;break e;case L:j=16,d=null;break e}j=29,l=Error(a(130,n===null?"null":typeof n,"")),d=null}return i=En(j,l,i,h),i.elementType=n,i.type=d,i.lanes=g,i}function Ji(n,i,l,d){return n=En(7,n,d,i),n.lanes=l,n}function Kd(n,i,l){return n=En(6,n,null,i),n.lanes=l,n}function Fg(n){var i=En(18,null,null,0);return i.stateNode=n,i}function Gd(n,i,l){return i=En(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}var Zg=new WeakMap;function Un(n,i){if(typeof n=="object"&&n!==null){var l=Zg.get(n);return l!==void 0?l:(i={value:n,source:i,stack:nn(i)},Zg.set(n,i),i)}return{value:n,source:i,stack:nn(i)}}var Ja=[],Xa=0,ql=null,oo=0,In=[],Bn=0,ti=null,ys=1,vs="";function Rs(n,i){Ja[Xa++]=oo,Ja[Xa++]=ql,ql=n,oo=i}function Vg(n,i,l){In[Bn++]=ys,In[Bn++]=vs,In[Bn++]=ti,ti=n;var d=ys;n=vs;var h=32-ce(d)-1;d&=~(1<<h),l+=1;var g=32-ce(i)+h;if(30<g){var j=h-h%5;g=(d&(1<<j)-1).toString(32),d>>=j,h-=j,ys=1<<32-ce(i)+h|l<<h|d,vs=g+n}else ys=1<<g|l<<h|d,vs=n}function Fd(n){n.return!==null&&(Rs(n,1),Vg(n,1,0))}function Zd(n){for(;n===ql;)ql=Ja[--Xa],Ja[Xa]=null,oo=Ja[--Xa],Ja[Xa]=null;for(;n===ti;)ti=In[--Bn],In[Bn]=null,vs=In[--Bn],In[Bn]=null,ys=In[--Bn],In[Bn]=null}function Qg(n,i){In[Bn++]=ys,In[Bn++]=vs,In[Bn++]=ti,ys=i.id,vs=i.overflow,ti=n}var Jt=null,yt=null,Fe=!1,ni=null,qn=!1,Vd=Error(a(519));function si(n){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lo(Un(i,n)),Vd}function Yg(n){var i=n.stateNode,l=n.type,d=n.memoizedProps;switch(i[st]=n,i[sn]=d,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<Ro.length;l++)Ie(Ro[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),cg(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ie("invalid",i);break;case"textarea":Ie("invalid",i),dg(i,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||d.suppressHydrationWarning===!0||hv(i.textContent,l)?(d.popover!=null&&(Ie("beforetoggle",i),Ie("toggle",i)),d.onScroll!=null&&Ie("scroll",i),d.onScrollEnd!=null&&Ie("scrollend",i),d.onClick!=null&&(i.onclick=_s),i=!0):i=!1,i||si(n,!0)}function Jg(n){for(Jt=n.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:qn=!1;return;case 27:case 3:qn=!0;return;default:Jt=Jt.return}}function Wa(n){if(n!==Jt)return!1;if(!Fe)return Jg(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")||hh(n.type,n.memoizedProps)),l=!l),l&&yt&&si(n),Jg(n),i===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));yt=jv(n)}else if(i===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(317));yt=jv(n)}else i===27?(i=yt,yi(n.type)?(n=vh,vh=null,yt=n):yt=i):yt=Jt?Kn(n.stateNode.nextSibling):null;return!0}function Xi(){yt=Jt=null,Fe=!1}function Qd(){var n=ni;return n!==null&&(Sn===null?Sn=n:Sn.push.apply(Sn,n),ni=null),n}function lo(n){ni===null?ni=[n]:ni.push(n)}var Yd=T(null),Wi=null,Ts=null;function ii(n,i,l){se(Yd,i._currentValue),i._currentValue=l}function Os(n){n._currentValue=Yd.current,B(Yd)}function Jd(n,i,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===l)break;n=n.return}}function Xd(n,i,l,d){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 _=g;g=h;for(var M=0;M<i.length;M++)if(_.context===i[M]){g.lanes|=l,_=g.alternate,_!==null&&(_.lanes|=l),Jd(g.return,l,n),d||(j=null);break e}g=_.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),Jd(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 er(n,i,l,d){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 _=h.type;_n(h.pendingProps.value,j.value)||(n!==null?n.push(_):n=[_])}}else if(h===ye.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(Mo):n=[Mo])}h=h.return}n!==null&&Xd(i,n,l,d),i.flags|=262144}function Hl(n){for(n=n.firstContext;n!==null;){if(!_n(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ea(n){Wi=n,Ts=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Xt(n){return Xg(Wi,n)}function Kl(n,i){return Wi===null&&ea(n),Xg(n,i)}function Xg(n,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Ts===null){if(n===null)throw Error(a(308));Ts=i,n.dependencies={lanes:0,firstContext:i},n.flags|=524288}else Ts=Ts.next=i;return l}var U1=typeof AbortController<"u"?AbortController:function(){var n=[],i=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){i.aborted=!0,n.forEach(function(l){return l()})}},I1=e.unstable_scheduleCallback,B1=e.unstable_NormalPriority,Ut={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wd(){return{controller:new U1,data:new Map,refCount:0}}function co(n){n.refCount--,n.refCount===0&&I1(B1,function(){n.controller.abort()})}var uo=null,ef=0,tr=0,nr=null;function q1(n,i){if(uo===null){var l=uo=[];ef=0,tr=ih(),nr={status:"pending",value:void 0,then:function(d){l.push(d)}}}return ef++,i.then(Wg,Wg),i}function Wg(){if(--ef===0&&uo!==null){nr!==null&&(nr.status="fulfilled");var n=uo;uo=null,tr=0,nr=null;for(var i=0;i<n.length;i++)(0,n[i])()}}function H1(n,i){var l=[],d={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return n.then(function(){d.status="fulfilled",d.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(d.status="rejected",d.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),d}var ey=K.S;K.S=function(n,i){$0=Qe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&q1(n,i),ey!==null&&ey(n,i)};var ta=T(null);function tf(){var n=ta.current;return n!==null?n:mt.pooledCache}function Gl(n,i){i===null?se(ta,ta.current):se(ta,i.pool)}function ty(){var n=tf();return n===null?null:{parent:Ut._currentValue,pool:n}}var sr=Error(a(460)),nf=Error(a(474)),Fl=Error(a(542)),Zl={then:function(){}};function ny(n){return n=n.status,n==="fulfilled"||n==="rejected"}function sy(n,i,l){switch(l=n[l],l===void 0?n.push(i):l!==i&&(i.then(_s,_s),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ay(n),n;default:if(typeof i.status=="string")i.then(_s,_s);else{if(n=mt,n!==null&&100<n.shellSuspendCounter)throw Error(a(482));n=i,n.status="pending",n.then(function(d){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=d}},function(d){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw n=i.reason,ay(n),n}throw sa=i,sr}}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,sr):l}}var sa=null;function iy(){if(sa===null)throw Error(a(459));var n=sa;return sa=null,n}function ay(n){if(n===sr||n===Fl)throw Error(a(483))}var ir=null,fo=0;function Vl(n){var i=fo;return fo+=1,ir===null&&(ir=[]),sy(ir,n,i)}function ho(n,i){i=i.props.ref,n.ref=i!==void 0?i:null}function Ql(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 ry(n){function i(q,P){if(n){var G=q.deletions;G===null?(q.deletions=[P],q.flags|=16):G.push(P)}}function l(q,P){if(!n)return null;for(;P!==null;)i(q,P),P=P.sibling;return null}function d(q){for(var P=new Map;q!==null;)q.key!==null?P.set(q.key,q):P.set(q.index,q),q=q.sibling;return P}function h(q,P){return q=As(q,P),q.index=0,q.sibling=null,q}function g(q,P,G){return q.index=G,n?(G=q.alternate,G!==null?(G=G.index,G<P?(q.flags|=67108866,P):G):(q.flags|=67108866,P)):(q.flags|=1048576,P)}function j(q){return n&&q.alternate===null&&(q.flags|=67108866),q}function _(q,P,G,te){return P===null||P.tag!==6?(P=Kd(G,q.mode,te),P.return=q,P):(P=h(P,G),P.return=q,P)}function M(q,P,G,te){var ke=G.type;return ke===S?W(q,P,G.props.children,te,G.key):P!==null&&(P.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===L&&na(ke)===P.type)?(P=h(P,G.props),ho(P,G),P.return=q,P):(P=Bl(G.type,G.key,G.props,null,q.mode,te),ho(P,G),P.return=q,P)}function F(q,P,G,te){return P===null||P.tag!==4||P.stateNode.containerInfo!==G.containerInfo||P.stateNode.implementation!==G.implementation?(P=Gd(G,q.mode,te),P.return=q,P):(P=h(P,G.children||[]),P.return=q,P)}function W(q,P,G,te,ke){return P===null||P.tag!==7?(P=Ji(G,q.mode,te,ke),P.return=q,P):(P=h(P,G),P.return=q,P)}function ie(q,P,G){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=Kd(""+P,q.mode,G),P.return=q,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case b:return G=Bl(P.type,P.key,P.props,null,q.mode,G),ho(G,P),G.return=q,G;case N:return P=Gd(P,q.mode,G),P.return=q,P;case L:return P=na(P),ie(q,P,G)}if(we(P)||ee(P))return P=Ji(P,q.mode,G,null),P.return=q,P;if(typeof P.then=="function")return ie(q,Vl(P),G);if(P.$$typeof===A)return ie(q,Kl(q,P),G);Ql(q,P)}return null}function Z(q,P,G,te){var ke=P!==null?P.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return ke!==null?null:_(q,P,""+G,te);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return G.key===ke?M(q,P,G,te):null;case N:return G.key===ke?F(q,P,G,te):null;case L:return G=na(G),Z(q,P,G,te)}if(we(G)||ee(G))return ke!==null?null:W(q,P,G,te,null);if(typeof G.then=="function")return Z(q,P,Vl(G),te);if(G.$$typeof===A)return Z(q,P,Kl(q,G),te);Ql(q,G)}return null}function Y(q,P,G,te,ke){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return q=q.get(G)||null,_(P,q,""+te,ke);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return q=q.get(te.key===null?G:te.key)||null,M(P,q,te,ke);case N:return q=q.get(te.key===null?G:te.key)||null,F(P,q,te,ke);case L:return te=na(te),Y(q,P,G,te,ke)}if(we(te)||ee(te))return q=q.get(G)||null,W(P,q,te,ke,null);if(typeof te.then=="function")return Y(q,P,G,Vl(te),ke);if(te.$$typeof===A)return Y(q,P,G,Kl(P,te),ke);Ql(P,te)}return null}function ve(q,P,G,te){for(var ke=null,Xe=null,Se=P,Le=P=0,He=null;Se!==null&&Le<G.length;Le++){Se.index>Le?(He=Se,Se=null):He=Se.sibling;var We=Z(q,Se,G[Le],te);if(We===null){Se===null&&(Se=He);break}n&&Se&&We.alternate===null&&i(q,Se),P=g(We,P,Le),Xe===null?ke=We:Xe.sibling=We,Xe=We,Se=He}if(Le===G.length)return l(q,Se),Fe&&Rs(q,Le),ke;if(Se===null){for(;Le<G.length;Le++)Se=ie(q,G[Le],te),Se!==null&&(P=g(Se,P,Le),Xe===null?ke=Se:Xe.sibling=Se,Xe=Se);return Fe&&Rs(q,Le),ke}for(Se=d(Se);Le<G.length;Le++)He=Y(Se,q,Le,G[Le],te),He!==null&&(n&&He.alternate!==null&&Se.delete(He.key===null?Le:He.key),P=g(He,P,Le),Xe===null?ke=He:Xe.sibling=He,Xe=He);return n&&Se.forEach(function(ji){return i(q,ji)}),Fe&&Rs(q,Le),ke}function ze(q,P,G,te){if(G==null)throw Error(a(151));for(var ke=null,Xe=null,Se=P,Le=P=0,He=null,We=G.next();Se!==null&&!We.done;Le++,We=G.next()){Se.index>Le?(He=Se,Se=null):He=Se.sibling;var ji=Z(q,Se,We.value,te);if(ji===null){Se===null&&(Se=He);break}n&&Se&&ji.alternate===null&&i(q,Se),P=g(ji,P,Le),Xe===null?ke=ji:Xe.sibling=ji,Xe=ji,Se=He}if(We.done)return l(q,Se),Fe&&Rs(q,Le),ke;if(Se===null){for(;!We.done;Le++,We=G.next())We=ie(q,We.value,te),We!==null&&(P=g(We,P,Le),Xe===null?ke=We:Xe.sibling=We,Xe=We);return Fe&&Rs(q,Le),ke}for(Se=d(Se);!We.done;Le++,We=G.next())We=Y(Se,q,Le,We.value,te),We!==null&&(n&&We.alternate!==null&&Se.delete(We.key===null?Le:We.key),P=g(We,P,Le),Xe===null?ke=We:Xe.sibling=We,Xe=We);return n&&Se.forEach(function(ek){return i(q,ek)}),Fe&&Rs(q,Le),ke}function ft(q,P,G,te){if(typeof G=="object"&&G!==null&&G.type===S&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case b:e:{for(var ke=G.key;P!==null;){if(P.key===ke){if(ke=G.type,ke===S){if(P.tag===7){l(q,P.sibling),te=h(P,G.props.children),te.return=q,q=te;break e}}else if(P.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===L&&na(ke)===P.type){l(q,P.sibling),te=h(P,G.props),ho(te,G),te.return=q,q=te;break e}l(q,P);break}else i(q,P);P=P.sibling}G.type===S?(te=Ji(G.props.children,q.mode,te,G.key),te.return=q,q=te):(te=Bl(G.type,G.key,G.props,null,q.mode,te),ho(te,G),te.return=q,q=te)}return j(q);case N:e:{for(ke=G.key;P!==null;){if(P.key===ke)if(P.tag===4&&P.stateNode.containerInfo===G.containerInfo&&P.stateNode.implementation===G.implementation){l(q,P.sibling),te=h(P,G.children||[]),te.return=q,q=te;break e}else{l(q,P);break}else i(q,P);P=P.sibling}te=Gd(G,q.mode,te),te.return=q,q=te}return j(q);case L:return G=na(G),ft(q,P,G,te)}if(we(G))return ve(q,P,G,te);if(ee(G)){if(ke=ee(G),typeof ke!="function")throw Error(a(150));return G=ke.call(G),ze(q,P,G,te)}if(typeof G.then=="function")return ft(q,P,Vl(G),te);if(G.$$typeof===A)return ft(q,P,Kl(q,G),te);Ql(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,P!==null&&P.tag===6?(l(q,P.sibling),te=h(P,G),te.return=q,q=te):(l(q,P),te=Kd(G,q.mode,te),te.return=q,q=te),j(q)):l(q,P)}return function(q,P,G,te){try{fo=0;var ke=ft(q,P,G,te);return ir=null,ke}catch(Se){if(Se===sr||Se===Fl)throw Se;var Xe=En(29,Se,null,q.mode);return Xe.lanes=te,Xe.return=q,Xe}}}var ia=ry(!0),oy=ry(!1),ai=!1;function sf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function af(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 ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function oi(n,i,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(tt&2)!==0){var h=d.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),d.pending=i,i=Il(n),Kg(n,null,l),i}return Ul(n,d,i,l),Il(n)}function mo(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,he(n,l)}}function rf(n,i){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){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:d.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}var of=!1;function po(){if(of){var n=nr;if(n!==null)throw n}}function go(n,i,l,d){of=!1;var h=n.updateQueue;ai=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var M=_,F=M.next;M.next=null,j===null?g=F:j.next=F,j=M;var W=n.alternate;W!==null&&(W=W.updateQueue,_=W.lastBaseUpdate,_!==j&&(_===null?W.firstBaseUpdate=F:_.next=F,W.lastBaseUpdate=M))}if(g!==null){var ie=h.baseState;j=0,W=F=M=null,_=g;do{var Z=_.lane&-536870913,Y=Z!==_.lane;if(Y?(qe&Z)===Z:(d&Z)===Z){Z!==0&&Z===tr&&(of=!0),W!==null&&(W=W.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=n,ze=_;Z=i;var ft=l;switch(ze.tag){case 1:if(ve=ze.payload,typeof ve=="function"){ie=ve.call(ft,ie,Z);break e}ie=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ze.payload,Z=typeof ve=="function"?ve.call(ft,ie,Z):ve,Z==null)break e;ie=y({},ie,Z);break e;case 2:ai=!0}}Z=_.callback,Z!==null&&(n.flags|=64,Y&&(n.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[Z]:Y.push(Z))}else Y={lane:Z,tag:_.tag,payload:_.payload,callback:_.callback,next:null},W===null?(F=W=Y,M=ie):W=W.next=Y,j|=Z;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);W===null&&(M=ie),h.baseState=M,h.firstBaseUpdate=F,h.lastBaseUpdate=W,g===null&&(h.shared.lanes=0),fi|=j,n.lanes=j,n.memoizedState=ie}}function ly(n,i){if(typeof n!="function")throw Error(a(191,n));n.call(i)}function cy(n,i){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)ly(l[n],i)}var ar=T(null),Yl=T(0);function uy(n,i){n=qs,se(Yl,n),se(ar,i),qs=n|i.baseLanes}function lf(){se(Yl,qs),se(ar,ar.current)}function cf(){qs=Yl.current,B(ar),B(Yl)}var An=T(null),Hn=null;function li(n){var i=n.alternate;se(Tt,Tt.current&1),se(An,n),Hn===null&&(i===null||ar.current!==null||i.memoizedState!==null)&&(Hn=n)}function uf(n){se(Tt,Tt.current),se(An,n),Hn===null&&(Hn=n)}function dy(n){n.tag===22?(se(Tt,Tt.current),se(An,n),Hn===null&&(Hn=n)):ci()}function ci(){se(Tt,Tt.current),se(An,An.current)}function Rn(n){B(An),Hn===n&&(Hn=null),B(Tt)}var Tt=T(0);function Jl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||gh(l)||yh(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 Ls=0,Oe=null,ut=null,It=null,Xl=!1,rr=!1,aa=!1,Wl=0,yo=0,or=null,K1=0;function Et(){throw Error(a(321))}function df(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!_n(n[l],i[l]))return!1;return!0}function ff(n,i,l,d,h,g){return Ls=g,Oe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,K.H=n===null||n.memoizedState===null?Vy:zf,aa=!1,g=l(d,h),aa=!1,rr&&(g=hy(i,l,d,h)),fy(n),g}function fy(n){K.H=bo;var i=ut!==null&&ut.next!==null;if(Ls=0,It=ut=Oe=null,Xl=!1,yo=0,or=null,i)throw Error(a(300));n===null||Bt||(n=n.dependencies,n!==null&&Hl(n)&&(Bt=!0))}function hy(n,i,l,d){Oe=n;var h=0;do{if(rr&&(or=null),yo=0,rr=!1,25<=h)throw Error(a(301));if(h+=1,It=ut=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}K.H=Qy,g=i(l,d)}while(rr);return g}function G1(){var n=K.H,i=n.useState()[0];return i=typeof i.then=="function"?vo(i):i,n=n.useState()[0],(ut!==null?ut.memoizedState:null)!==n&&(Oe.flags|=1024),i}function hf(){var n=Wl!==0;return Wl=0,n}function mf(n,i,l){i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~l}function pf(n){if(Xl){for(n=n.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Xl=!1}Ls=0,It=ut=Oe=null,rr=!1,yo=Wl=0,or=null}function un(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return It===null?Oe.memoizedState=It=n:It=It.next=n,It}function Ot(){if(ut===null){var n=Oe.alternate;n=n!==null?n.memoizedState:null}else n=ut.next;var i=It===null?Oe.memoizedState:It.next;if(i!==null)It=i,ut=n;else{if(n===null)throw Oe.alternate===null?Error(a(467)):Error(a(310));ut=n,n={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},It===null?Oe.memoizedState=It=n:It=It.next=n}return It}function ec(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function vo(n){var i=yo;return yo+=1,or===null&&(or=[]),n=sy(or,n,i),i=Oe,(It===null?i.memoizedState:It.next)===null&&(i=i.alternate,K.H=i===null||i.memoizedState===null?Vy:zf),n}function tc(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return vo(n);if(n.$$typeof===A)return Xt(n)}throw Error(a(438,String(n)))}function gf(n){var i=null,l=Oe.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=Oe.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=ec(),Oe.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(n),d=0;d<n;d++)l[d]=X;return i.index++,l}function Ds(n,i){return typeof i=="function"?i(n):i}function nc(n){var i=Ot();return yf(i,ut,n)}function yf(n,i,l){var d=n.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=l;var h=n.baseQueue,g=d.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}i.baseQueue=h=g,d.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{i=h.next;var _=j=null,M=null,F=i,W=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(qe&ie)===ie:(Ls&ie)===ie){var Z=F.revertLane;if(Z===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===tr&&(W=!0);else if((Ls&Z)===Z){F=F.next,Z===tr&&(W=!0);continue}else ie={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},M===null?(_=M=ie,j=g):M=M.next=ie,Oe.lanes|=Z,fi|=Z;ie=F.action,aa&&l(g,ie),g=F.hasEagerState?F.eagerState:l(g,ie)}else Z={lane:ie,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},M===null?(_=M=Z,j=g):M=M.next=Z,Oe.lanes|=ie,fi|=ie;F=F.next}while(F!==null&&F!==i);if(M===null?j=g:M.next=_,!_n(g,n.memoizedState)&&(Bt=!0,W&&(l=nr,l!==null)))throw l;n.memoizedState=g,n.baseState=j,n.baseQueue=M,d.lastRenderedState=g}return h===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function vf(n){var i=Ot(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=n;var d=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);_n(g,i.memoizedState)||(Bt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function my(n,i,l){var d=Oe,h=Ot(),g=Fe;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var j=!_n((ut||h).memoizedState,l);if(j&&(h.memoizedState=l,Bt=!0),h=h.queue,Sf(yy.bind(null,d,h,n),[n]),h.getSnapshot!==i||j||It!==null&&It.memoizedState.tag&1){if(d.flags|=2048,lr(9,{destroy:void 0},gy.bind(null,d,h,l,i),null),mt===null)throw Error(a(349));g||(Ls&127)!==0||py(d,i,l)}return l}function py(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=Oe.updateQueue,i===null?(i=ec(),Oe.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function gy(n,i,l,d){i.value=l,i.getSnapshot=d,vy(i)&&xy(n)}function yy(n,i,l){return l(function(){vy(i)&&xy(n)})}function vy(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!_n(n,l)}catch{return!0}}function xy(n){var i=Yi(n,2);i!==null&&jn(i,n,2)}function xf(n){var i=un();if(typeof n=="function"){var l=n;if(n=l(),aa){gn(!0);try{l()}finally{gn(!1)}}}return i.memoizedState=i.baseState=n,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:n},i}function by(n,i,l,d){return n.baseState=l,yf(n,ut,typeof d=="function"?d:Ds)}function F1(n,i,l,d,h){if(ac(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)}};K.T!==null?l(!0):g.isTransition=!1,d(g),l=i.pending,l===null?(g.next=i.pending=g,Sy(i,g)):(g.next=l.next,i.pending=l.next=g)}}function Sy(n,i){var l=i.action,d=i.payload,h=n.state;if(i.isTransition){var g=K.T,j={};K.T=j;try{var _=l(h,d),M=K.S;M!==null&&M(j,_),jy(n,i,_)}catch(F){bf(n,i,F)}finally{g!==null&&j.types!==null&&(g.types=j.types),K.T=g}}else try{g=l(h,d),jy(n,i,g)}catch(F){bf(n,i,F)}}function jy(n,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){wy(n,i,d)},function(d){return bf(n,i,d)}):wy(n,i,l)}function wy(n,i,l){i.status="fulfilled",i.value=l,Ny(i),n.state=l,i=n.pending,i!==null&&(l=i.next,l===i?n.pending=null:(l=l.next,i.next=l,Sy(n,l)))}function bf(n,i,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,Ny(i),i=i.next;while(i!==d)}n.action=null}function Ny(n){n=n.listeners;for(var i=0;i<n.length;i++)(0,n[i])()}function Cy(n,i){return i}function ky(n,i){if(Fe){var l=mt.formState;if(l!==null){e:{var d=Oe;if(Fe){if(yt){t:{for(var h=yt,g=qn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Kn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){yt=Kn(h.nextSibling),d=h.data==="F!";break e}}si(d)}d=!1}d&&(i=l[0])}}return l=un(),l.memoizedState=l.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cy,lastRenderedState:i},l.queue=d,l=Gy.bind(null,Oe,d),d.dispatch=l,d=xf(!1),g=kf.bind(null,Oe,!1,d.queue),d=un(),h={state:i,dispatch:null,action:n,pending:null},d.queue=h,l=F1.bind(null,Oe,h,g,l),h.dispatch=l,d.memoizedState=n,[i,l,!1]}function zy(n){var i=Ot();return _y(i,ut,n)}function _y(n,i,l){if(i=yf(n,i,Cy)[0],n=nc(Ds)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=vo(i)}catch(j){throw j===sr?Fl:j}else d=i;i=Ot();var h=i.queue,g=h.dispatch;return l!==i.memoizedState&&(Oe.flags|=2048,lr(9,{destroy:void 0},Z1.bind(null,h,l),null)),[d,g,n]}function Z1(n,i){n.action=i}function Ey(n){var i=Ot(),l=ut;if(l!==null)return _y(i,l,n);Ot(),i=i.memoizedState,l=Ot();var d=l.queue.dispatch;return l.memoizedState=n,[i,d,!1]}function lr(n,i,l,d){return n={tag:n,create:l,deps:d,inst:i,next:null},i=Oe.updateQueue,i===null&&(i=ec(),Oe.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,i.lastEffect=n),n}function Ay(){return Ot().memoizedState}function sc(n,i,l,d){var h=un();Oe.flags|=n,h.memoizedState=lr(1|i,{destroy:void 0},l,d===void 0?null:d)}function ic(n,i,l,d){var h=Ot();d=d===void 0?null:d;var g=h.memoizedState.inst;ut!==null&&d!==null&&df(d,ut.memoizedState.deps)?h.memoizedState=lr(i,g,l,d):(Oe.flags|=n,h.memoizedState=lr(1|i,g,l,d))}function Ry(n,i){sc(8390656,8,n,i)}function Sf(n,i){ic(2048,8,n,i)}function V1(n){Oe.flags|=4;var i=Oe.updateQueue;if(i===null)i=ec(),Oe.updateQueue=i,i.events=[n];else{var l=i.events;l===null?i.events=[n]:l.push(n)}}function Ty(n){var i=Ot().memoizedState;return V1({ref:i,nextImpl:n}),function(){if((tt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Oy(n,i){return ic(4,2,n,i)}function Ly(n,i){return ic(4,4,n,i)}function Dy(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 My(n,i,l){l=l!=null?l.concat([n]):null,ic(4,4,Dy.bind(null,i,n),l)}function jf(){}function $y(n,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&df(i,d[1])?d[0]:(l.memoizedState=[n,i],n)}function Py(n,i){var l=Ot();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&df(i,d[1]))return d[0];if(d=n(),aa){gn(!0);try{n()}finally{gn(!1)}}return l.memoizedState=[d,i],d}function wf(n,i,l){return l===void 0||(Ls&1073741824)!==0&&(qe&261930)===0?n.memoizedState=i:(n.memoizedState=l,n=U0(),Oe.lanes|=n,fi|=n,l)}function Uy(n,i,l,d){return _n(l,i)?l:ar.current!==null?(n=wf(n,l,d),_n(n,i)||(Bt=!0),n):(Ls&42)===0||(Ls&1073741824)!==0&&(qe&261930)===0?(Bt=!0,n.memoizedState=l):(n=U0(),Oe.lanes|=n,fi|=n,i)}function Iy(n,i,l,d,h){var g=ae.p;ae.p=g!==0&&8>g?g:8;var j=K.T,_={};K.T=_,kf(n,!1,i,l);try{var M=h(),F=K.S;if(F!==null&&F(_,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var W=H1(M,d);xo(n,i,W,Ln(n))}else xo(n,i,d,Ln(n))}catch(ie){xo(n,i,{then:function(){},status:"rejected",reason:ie},Ln())}finally{ae.p=g,j!==null&&_.types!==null&&(j.types=_.types),K.T=j}}function Q1(){}function Nf(n,i,l,d){if(n.tag!==5)throw Error(a(476));var h=By(n).queue;Iy(n,h,i,me,l===null?Q1:function(){return qy(n),l(d)})}function By(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:me},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:l},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function qy(n){var i=By(n);i.next===null&&(i=n.alternate.memoizedState),xo(n,i.next.queue,{},Ln())}function Cf(){return Xt(Mo)}function Hy(){return Ot().memoizedState}function Ky(){return Ot().memoizedState}function Y1(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var l=Ln();n=ri(l);var d=oi(i,n,l);d!==null&&(jn(d,i,l),mo(d,i,l)),i={cache:Wd()},n.payload=i;return}i=i.return}}function J1(n,i,l){var d=Ln();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ac(n)?Fy(i,l):(l=qd(n,i,l,d),l!==null&&(jn(l,n,d),Zy(l,i,d)))}function Gy(n,i,l){var d=Ln();xo(n,i,l,d)}function xo(n,i,l,d){var h={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ac(n))Fy(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,_=g(j,l);if(h.hasEagerState=!0,h.eagerState=_,_n(_,j))return Ul(n,i,h,0),mt===null&&Pl(),!1}catch{}if(l=qd(n,i,h,d),l!==null)return jn(l,n,d),Zy(l,i,d),!0}return!1}function kf(n,i,l,d){if(d={lane:2,revertLane:ih(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},ac(n)){if(i)throw Error(a(479))}else i=qd(n,l,d,2),i!==null&&jn(i,n,2)}function ac(n){var i=n.alternate;return n===Oe||i!==null&&i===Oe}function Fy(n,i){rr=Xl=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Zy(n,i,l){if((l&4194048)!==0){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,he(n,l)}}var bo={readContext:Xt,use:tc,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};bo.useEffectEvent=Et;var Vy={readContext:Xt,use:tc,useCallback:function(n,i){return un().memoizedState=[n,i===void 0?null:i],n},useContext:Xt,useEffect:Ry,useImperativeHandle:function(n,i,l){l=l!=null?l.concat([n]):null,sc(4194308,4,Dy.bind(null,i,n),l)},useLayoutEffect:function(n,i){return sc(4194308,4,n,i)},useInsertionEffect:function(n,i){sc(4,2,n,i)},useMemo:function(n,i){var l=un();i=i===void 0?null:i;var d=n();if(aa){gn(!0);try{n()}finally{gn(!1)}}return l.memoizedState=[d,i],d},useReducer:function(n,i,l){var d=un();if(l!==void 0){var h=l(i);if(aa){gn(!0);try{l(i)}finally{gn(!1)}}}else h=i;return d.memoizedState=d.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},d.queue=n,n=n.dispatch=J1.bind(null,Oe,n),[d.memoizedState,n]},useRef:function(n){var i=un();return n={current:n},i.memoizedState=n},useState:function(n){n=xf(n);var i=n.queue,l=Gy.bind(null,Oe,i);return i.dispatch=l,[n.memoizedState,l]},useDebugValue:jf,useDeferredValue:function(n,i){var l=un();return wf(l,n,i)},useTransition:function(){var n=xf(!1);return n=Iy.bind(null,Oe,n.queue,!0,!1),un().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,l){var d=Oe,h=un();if(Fe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),mt===null)throw Error(a(349));(qe&127)!==0||py(d,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,Ry(yy.bind(null,d,g,n),[n]),d.flags|=2048,lr(9,{destroy:void 0},gy.bind(null,d,g,l,i),null),l},useId:function(){var n=un(),i=mt.identifierPrefix;if(Fe){var l=vs,d=ys;l=(d&~(1<<32-ce(d)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Wl++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=K1++,i="_"+i+"r_"+l.toString(32)+"_";return n.memoizedState=i},useHostTransitionStatus:Cf,useFormState:ky,useActionState:ky,useOptimistic:function(n){var i=un();i.memoizedState=i.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=kf.bind(null,Oe,!0,l),l.dispatch=i,[n,i]},useMemoCache:gf,useCacheRefresh:function(){return un().memoizedState=Y1.bind(null,Oe)},useEffectEvent:function(n){var i=un(),l={impl:n};return i.memoizedState=l,function(){if((tt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},zf={readContext:Xt,use:tc,useCallback:$y,useContext:Xt,useEffect:Sf,useImperativeHandle:My,useInsertionEffect:Oy,useLayoutEffect:Ly,useMemo:Py,useReducer:nc,useRef:Ay,useState:function(){return nc(Ds)},useDebugValue:jf,useDeferredValue:function(n,i){var l=Ot();return Uy(l,ut.memoizedState,n,i)},useTransition:function(){var n=nc(Ds)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:my,useId:Hy,useHostTransitionStatus:Cf,useFormState:zy,useActionState:zy,useOptimistic:function(n,i){var l=Ot();return by(l,ut,n,i)},useMemoCache:gf,useCacheRefresh:Ky};zf.useEffectEvent=Ty;var Qy={readContext:Xt,use:tc,useCallback:$y,useContext:Xt,useEffect:Sf,useImperativeHandle:My,useInsertionEffect:Oy,useLayoutEffect:Ly,useMemo:Py,useReducer:vf,useRef:Ay,useState:function(){return vf(Ds)},useDebugValue:jf,useDeferredValue:function(n,i){var l=Ot();return ut===null?wf(l,n,i):Uy(l,ut.memoizedState,n,i)},useTransition:function(){var n=vf(Ds)[0],i=Ot().memoizedState;return[typeof n=="boolean"?n:vo(n),i]},useSyncExternalStore:my,useId:Hy,useHostTransitionStatus:Cf,useFormState:Ey,useActionState:Ey,useOptimistic:function(n,i){var l=Ot();return ut!==null?by(l,ut,n,i):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:gf,useCacheRefresh:Ky};Qy.useEffectEvent=Ty;function _f(n,i,l,d){i=n.memoizedState,l=l(d,i),l=l==null?i:y({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var Ef={enqueueSetState:function(n,i,l){n=n._reactInternals;var d=Ln(),h=ri(d);h.payload=i,l!=null&&(h.callback=l),i=oi(n,h,d),i!==null&&(jn(i,n,d),mo(i,n,d))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var d=Ln(),h=ri(d);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=oi(n,h,d),i!==null&&(jn(i,n,d),mo(i,n,d))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Ln(),d=ri(l);d.tag=2,i!=null&&(d.callback=i),i=oi(n,d,l),i!==null&&(jn(i,n,l),mo(i,n,l))}};function Yy(n,i,l,d,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,g,j):i.prototype&&i.prototype.isPureReactComponent?!ao(l,d)||!ao(h,g):!0}function Jy(n,i,l,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==n&&Ef.enqueueReplaceState(i,i.state,null)}function ra(n,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}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 Xy(n){$l(n)}function Wy(n){console.error(n)}function e0(n){$l(n)}function rc(n,i){try{var l=n.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function t0(n,i,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Af(n,i,l){return l=ri(l),l.tag=3,l.payload={element:null},l.callback=function(){rc(n,i)},l}function n0(n){return n=ri(n),n.tag=3,n}function s0(n,i,l,d){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var g=d.value;n.payload=function(){return h(g)},n.callback=function(){t0(i,l,d)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){t0(i,l,d),typeof h!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var _=d.stack;this.componentDidCatch(d.value,{componentStack:_!==null?_:""})})}function X1(n,i,l,d,h){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&er(i,l,h,!0),l=An.current,l!==null){switch(l.tag){case 31:case 13:return Hn===null?vc():l.alternate===null&&At===0&&(At=3),l.flags&=-257,l.flags|=65536,l.lanes=h,d===Zl?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),th(n,d,h)),!1;case 22:return l.flags|=65536,d===Zl?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([d]):l.add(d)),th(n,d,h)),!1}throw Error(a(435,l.tag))}return th(n,d,h),vc(),!1}if(Fe)return i=An.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,d!==Vd&&(n=Error(a(422),{cause:d}),lo(Un(n,l)))):(d!==Vd&&(i=Error(a(423),{cause:d}),lo(Un(i,l))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,d=Un(d,l),h=Af(n.stateNode,d,h),rf(n,h),At!==4&&(At=2)),!1;var g=Error(a(520),{cause:d});if(g=Un(g,l),_o===null?_o=[g]:_o.push(g),At!==4&&(At=2),i===null)return!0;d=Un(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,n=h&-h,l.lanes|=n,n=Af(l.stateNode,d,n),rf(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"&&(hi===null||!hi.has(g))))return l.flags|=65536,h&=-h,l.lanes|=h,h=n0(h),s0(h,n,l,d),rf(l,h),!1}l=l.return}while(l!==null);return!1}var Rf=Error(a(461)),Bt=!1;function Wt(n,i,l,d){i.child=n===null?oy(i,null,l,d):ia(i,n.child,l,d)}function i0(n,i,l,d,h){l=l.render;var g=i.ref;if("ref"in d){var j={};for(var _ in d)_!=="ref"&&(j[_]=d[_])}else j=d;return ea(i),d=ff(n,i,l,j,g,h),_=hf(),n!==null&&!Bt?(mf(n,i,h),Ms(n,i,h)):(Fe&&_&&Fd(i),i.flags|=1,Wt(n,i,d,h),i.child)}function a0(n,i,l,d,h){if(n===null){var g=l.type;return typeof g=="function"&&!Hd(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,r0(n,i,g,d,h)):(n=Bl(l.type,null,d,i,i.mode,h),n.ref=i.ref,n.return=i,i.child=n)}if(g=n.child,!Uf(n,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(j,d)&&n.ref===i.ref)return Ms(n,i,h)}return i.flags|=1,n=As(g,d),n.ref=i.ref,n.return=i,i.child=n}function r0(n,i,l,d,h){if(n!==null){var g=n.memoizedProps;if(ao(g,d)&&n.ref===i.ref)if(Bt=!1,i.pendingProps=d=g,Uf(n,h))(n.flags&131072)!==0&&(Bt=!0);else return i.lanes=n.lanes,Ms(n,i,h)}return Tf(n,i,l,d,h)}function o0(n,i,l,d){var h=d.children,g=n!==null?n.memoizedState:null;if(n===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,n!==null){for(d=i.child=n.child,h=0;d!==null;)h=h|d.lanes|d.childLanes,d=d.sibling;d=h&~g}else d=0,i.child=null;return l0(n,i,g,l,d)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},n!==null&&Gl(i,g!==null?g.cachePool:null),g!==null?uy(i,g):lf(),dy(i);else return d=i.lanes=536870912,l0(n,i,g!==null?g.baseLanes|l:l,l,d)}else g!==null?(Gl(i,g.cachePool),uy(i,g),ci(),i.memoizedState=null):(n!==null&&Gl(i,null),lf(),ci());return Wt(n,i,h,l),i.child}function So(n,i){return n!==null&&n.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function l0(n,i,l,d,h){var g=tf();return g=g===null?null:{parent:Ut._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},n!==null&&Gl(i,null),lf(),dy(i),n!==null&&er(n,i,d,!0),i.childLanes=h,null}function oc(n,i){return i=cc({mode:i.mode,children:i.children},n.mode),i.ref=n.ref,n.child=i,i.return=n,i}function c0(n,i,l){return ia(i,n.child,null,l),n=oc(i,i.pendingProps),n.flags|=2,Rn(i),i.memoizedState=null,n}function W1(n,i,l){var d=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,n===null){if(Fe){if(d.mode==="hidden")return n=oc(i,d),i.lanes=536870912,So(null,n);if(uf(i),(n=yt)?(n=Sv(n,qn),n=n!==null&&n.data==="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:ys,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},l=Fg(n),l.return=i,i.child=l,Jt=i,yt=null)):n=null,n===null)throw si(i);return i.lanes=536870912,null}return oc(i,d)}var g=n.memoizedState;if(g!==null){var j=g.dehydrated;if(uf(i),h)if(i.flags&256)i.flags&=-257,i=c0(n,i,l);else if(i.memoizedState!==null)i.child=n.child,i.flags|=128,i=null;else throw Error(a(558));else if(Bt||er(n,i,l,!1),h=(l&n.childLanes)!==0,Bt||h){if(d=mt,d!==null&&(j=xt(d,l),j!==0&&j!==g.retryLane))throw g.retryLane=j,Yi(n,j),jn(d,n,j),Rf;vc(),i=c0(n,i,l)}else n=g.treeContext,yt=Kn(j.nextSibling),Jt=i,Fe=!0,ni=null,qn=!1,n!==null&&Qg(i,n),i=oc(i,d),i.flags|=4096;return i}return n=As(n.child,{mode:d.mode,children:d.children}),n.ref=i.ref,i.child=n,n.return=i,n}function lc(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 Tf(n,i,l,d,h){return ea(i),l=ff(n,i,l,d,void 0,h),d=hf(),n!==null&&!Bt?(mf(n,i,h),Ms(n,i,h)):(Fe&&d&&Fd(i),i.flags|=1,Wt(n,i,l,h),i.child)}function u0(n,i,l,d,h,g){return ea(i),i.updateQueue=null,l=hy(i,d,l,h),fy(n),d=hf(),n!==null&&!Bt?(mf(n,i,g),Ms(n,i,g)):(Fe&&d&&Fd(i),i.flags|=1,Wt(n,i,l,g),i.child)}function d0(n,i,l,d,h){if(ea(i),i.stateNode===null){var g=Ya,j=l.contextType;typeof j=="object"&&j!==null&&(g=Xt(j)),g=new l(d,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Ef,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=d,g.state=i.memoizedState,g.refs={},sf(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Xt(j):Ya,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(_f(i,l,j,d),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&&Ef.enqueueReplaceState(g,g.state,null),go(i,d,g,h),po(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(n===null){g=i.stateNode;var _=i.memoizedProps,M=ra(l,_);g.props=M;var F=g.context,W=l.contextType;j=Ya,typeof W=="object"&&W!==null&&(j=Xt(W));var ie=l.getDerivedStateFromProps;W=typeof ie=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,W||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||F!==j)&&Jy(i,g,d,j),ai=!1;var Z=i.memoizedState;g.state=Z,go(i,d,g,h),po(),F=i.memoizedState,_||Z!==F||ai?(typeof ie=="function"&&(_f(i,l,ie,d),F=i.memoizedState),(M=ai||Yy(i,l,M,d,Z,F,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=d,i.memoizedState=F),g.props=d,g.state=F,g.context=j,d=M):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{g=i.stateNode,af(n,i),j=i.memoizedProps,W=ra(l,j),g.props=W,ie=i.pendingProps,Z=g.context,F=l.contextType,M=Ya,typeof F=="object"&&F!==null&&(M=Xt(F)),_=l.getDerivedStateFromProps,(F=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ie||Z!==M)&&Jy(i,g,d,M),ai=!1,Z=i.memoizedState,g.state=Z,go(i,d,g,h),po();var Y=i.memoizedState;j!==ie||Z!==Y||ai||n!==null&&n.dependencies!==null&&Hl(n.dependencies)?(typeof _=="function"&&(_f(i,l,_,d),Y=i.memoizedState),(W=ai||Yy(i,l,W,d,Z,Y,M)||n!==null&&n.dependencies!==null&&Hl(n.dependencies))?(F||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(d,Y,M),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(d,Y,M)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Y),g.props=d,g.state=Y,g.context=M,d=W):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&Z===n.memoizedState||(i.flags|=1024),d=!1)}return g=d,lc(n,i),d=(i.flags&128)!==0,g||d?(g=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,n!==null&&d?(i.child=ia(i,n.child,null,h),i.child=ia(i,null,l,h)):Wt(n,i,l,h),i.memoizedState=g.state,n=i.child):n=Ms(n,i,h),n}function f0(n,i,l,d){return Xi(),i.flags|=256,Wt(n,i,l,d),i.child}var Of={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lf(n){return{baseLanes:n,cachePool:ty()}}function Df(n,i,l){return n=n!==null?n.childLanes&~l:0,i&&(n|=On),n}function h0(n,i,l){var d=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(Tt.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,n===null){if(Fe){if(h?li(i):ci(),(n=yt)?(n=Sv(n,qn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(i.memoizedState={dehydrated:n,treeContext:ti!==null?{id:ys,overflow:vs}:null,retryLane:536870912,hydrationErrors:null},l=Fg(n),l.return=i,i.child=l,Jt=i,yt=null)):n=null,n===null)throw si(i);return yh(n)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,h?(ci(),h=i.mode,_=cc({mode:"hidden",children:_},h),d=Ji(d,h,l,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=Lf(l),d.childLanes=Df(n,j,l),i.memoizedState=Of,So(null,d)):(li(i),Mf(i,_))}var M=n.memoizedState;if(M!==null&&(_=M.dehydrated,_!==null)){if(g)i.flags&256?(li(i),i.flags&=-257,i=$f(n,i,l)):i.memoizedState!==null?(ci(),i.child=n.child,i.flags|=128,i=null):(ci(),_=d.fallback,h=i.mode,d=cc({mode:"visible",children:d.children},h),_=Ji(_,h,l,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,ia(i,n.child,null,l),d=i.child,d.memoizedState=Lf(l),d.childLanes=Df(n,j,l),i.memoizedState=Of,i=So(null,d));else if(li(i),yh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var F=j.dgst;j=F,d=Error(a(419)),d.stack="",d.digest=j,lo({value:d,source:null,stack:null}),i=$f(n,i,l)}else if(Bt||er(n,i,l,!1),j=(l&n.childLanes)!==0,Bt||j){if(j=mt,j!==null&&(d=xt(j,l),d!==0&&d!==M.retryLane))throw M.retryLane=d,Yi(n,d),jn(j,n,d),Rf;gh(_)||vc(),i=$f(n,i,l)}else gh(_)?(i.flags|=192,i.child=n.child,i=null):(n=M.treeContext,yt=Kn(_.nextSibling),Jt=i,Fe=!0,ni=null,qn=!1,n!==null&&Qg(i,n),i=Mf(i,d.children),i.flags|=4096);return i}return h?(ci(),_=d.fallback,h=i.mode,M=n.child,F=M.sibling,d=As(M,{mode:"hidden",children:d.children}),d.subtreeFlags=M.subtreeFlags&65011712,F!==null?_=As(F,_):(_=Ji(_,h,l,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,So(null,d),d=i.child,_=n.child.memoizedState,_===null?_=Lf(l):(h=_.cachePool,h!==null?(M=Ut._currentValue,h=h.parent!==M?{parent:M,pool:M}:h):h=ty(),_={baseLanes:_.baseLanes|l,cachePool:h}),d.memoizedState=_,d.childLanes=Df(n,j,l),i.memoizedState=Of,So(n.child,d)):(li(i),l=n.child,n=l.sibling,l=As(l,{mode:"visible",children:d.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 Mf(n,i){return i=cc({mode:"visible",children:i},n.mode),i.return=n,n.child=i}function cc(n,i){return n=En(22,n,null,i),n.lanes=0,n}function $f(n,i,l){return ia(i,n.child,null,l),n=Mf(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function m0(n,i,l){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),Jd(n.return,i,l)}function Pf(n,i,l,d,h,g){var j=n.memoizedState;j===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:h,treeForkCount:g}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=l,j.tailMode=h,j.treeForkCount=g)}function p0(n,i,l){var d=i.pendingProps,h=d.revealOrder,g=d.tail;d=d.children;var j=Tt.current,_=(j&2)!==0;if(_?(j=j&1|2,i.flags|=128):j&=1,se(Tt,j),Wt(n,i,d,l),d=Fe?oo:0,!_&&n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&m0(n,l,i);else if(n.tag===19)m0(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&&Jl(n)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Pf(i,!1,h,l,g,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(n=h.alternate,n!==null&&Jl(n)===null){i.child=h;break}n=h.sibling,h.sibling=l,l=h,h=n}Pf(i,!0,l,null,g,d);break;case"together":Pf(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Ms(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),fi|=i.lanes,(l&i.childLanes)===0)if(n!==null){if(er(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=As(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=As(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Uf(n,i){return(n.lanes&i)!==0?!0:(n=n.dependencies,!!(n!==null&&Hl(n)))}function eC(n,i,l){switch(i.tag){case 3:Ae(i,i.stateNode.containerInfo),ii(i,Ut,n.memoizedState.cache),Xi();break;case 27:case 5:Ze(i);break;case 4:Ae(i,i.stateNode.containerInfo);break;case 10:ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,uf(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(li(i),i.flags|=128,null):(l&i.child.childLanes)!==0?h0(n,i,l):(li(i),n=Ms(n,i,l),n!==null?n.sibling:null);li(i);break;case 19:var h=(n.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(er(n,i,l,!1),d=(l&i.childLanes)!==0),h){if(d)return p0(n,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),se(Tt,Tt.current),d)break;return null;case 22:return i.lanes=0,o0(n,i,l,i.pendingProps);case 24:ii(i,Ut,n.memoizedState.cache)}return Ms(n,i,l)}function g0(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps)Bt=!0;else{if(!Uf(n,l)&&(i.flags&128)===0)return Bt=!1,eC(n,i,l);Bt=(n.flags&131072)!==0}else Bt=!1,Fe&&(i.flags&1048576)!==0&&Vg(i,oo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(n=na(i.elementType),i.type=n,typeof n=="function")Hd(n)?(d=ra(n,d),i.tag=1,i=d0(null,i,n,d,l)):(i.tag=0,i=Tf(null,i,n,d,l));else{if(n!=null){var h=n.$$typeof;if(h===z){i.tag=11,i=i0(null,i,n,d,l);break e}else if(h===E){i.tag=14,i=a0(null,i,n,d,l);break e}}throw i=Ee(n)||n,Error(a(306,i,""))}}return i;case 0:return Tf(n,i,i.type,i.pendingProps,l);case 1:return d=i.type,h=ra(d,i.pendingProps),d0(n,i,d,h,l);case 3:e:{if(Ae(i,i.stateNode.containerInfo),n===null)throw Error(a(387));d=i.pendingProps;var g=i.memoizedState;h=g.element,af(n,i),go(i,d,null,l);var j=i.memoizedState;if(d=j.cache,ii(i,Ut,d),d!==g.cache&&Xd(i,[Ut],l,!0),po(),d=j.element,g.isDehydrated)if(g={element:d,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=f0(n,i,d,l);break e}else if(d!==h){h=Un(Error(a(424)),i),lo(h),i=f0(n,i,d,l);break e}else for(n=i.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,yt=Kn(n.firstChild),Jt=i,Fe=!0,ni=null,qn=!0,l=oy(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Xi(),d===h){i=Ms(n,i,l);break e}Wt(n,i,d,l)}i=i.child}return i;case 26:return lc(n,i),n===null?(l=zv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Fe||(l=i.type,n=i.pendingProps,d=Cc(fe.current).createElement(l),d[st]=i,d[sn]=n,en(d,l,n),it(d),i.stateNode=d):i.memoizedState=zv(i.type,n.memoizedProps,i.pendingProps,n.memoizedState),null;case 27:return Ze(i),n===null&&Fe&&(d=i.stateNode=Nv(i.type,i.pendingProps,fe.current),Jt=i,qn=!0,h=yt,yi(i.type)?(vh=h,yt=Kn(d.firstChild)):yt=h),Wt(n,i,i.pendingProps.children,l),lc(n,i),n===null&&(i.flags|=4194304),i.child;case 5:return n===null&&Fe&&((h=d=yt)&&(d=AC(d,i.type,i.pendingProps,qn),d!==null?(i.stateNode=d,Jt=i,yt=Kn(d.firstChild),qn=!1,h=!0):h=!1),h||si(i)),Ze(i),h=i.type,g=i.pendingProps,j=n!==null?n.memoizedProps:null,d=g.children,hh(h,g)?d=null:j!==null&&hh(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=ff(n,i,G1,null,null,l),Mo._currentValue=h),lc(n,i),Wt(n,i,d,l),i.child;case 6:return n===null&&Fe&&((n=l=yt)&&(l=RC(l,i.pendingProps,qn),l!==null?(i.stateNode=l,Jt=i,yt=null,n=!0):n=!1),n||si(i)),null;case 13:return h0(n,i,l);case 4:return Ae(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=ia(i,null,d,l):Wt(n,i,d,l),i.child;case 11:return i0(n,i,i.type,i.pendingProps,l);case 7:return Wt(n,i,i.pendingProps,l),i.child;case 8:return Wt(n,i,i.pendingProps.children,l),i.child;case 12:return Wt(n,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,ii(i,i.type,d.value),Wt(n,i,d.children,l),i.child;case 9:return h=i.type._context,d=i.pendingProps.children,ea(i),h=Xt(h),d=d(h),i.flags|=1,Wt(n,i,d,l),i.child;case 14:return a0(n,i,i.type,i.pendingProps,l);case 15:return r0(n,i,i.type,i.pendingProps,l);case 19:return p0(n,i,l);case 31:return W1(n,i,l);case 22:return o0(n,i,l,i.pendingProps);case 24:return ea(i),d=Xt(Ut),n===null?(h=tf(),h===null&&(h=mt,g=Wd(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:d,cache:h},sf(i),ii(i,Ut,h)):((n.lanes&l)!==0&&(af(n,i),go(i,null,null,l),po()),h=n.memoizedState,g=i.memoizedState,h.parent!==d?(h={parent:d,cache:d},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),ii(i,Ut,d)):(d=g.cache,ii(i,Ut,d),d!==h.cache&&Xd(i,[Ut],l,!0))),Wt(n,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function $s(n){n.flags|=4}function If(n,i,l,d,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(H0())n.flags|=8192;else throw sa=Zl,nf}else n.flags&=-16777217}function y0(n,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!Tv(i))if(H0())n.flags|=8192;else throw sa=Zl,nf}function uc(n,i){i!==null&&(n.flags|=4),n.flags&16384&&(i=n.tag!==22?wl():536870912,n.lanes|=i,fr|=i)}function jo(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 d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function vt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(i)for(var h=n.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags&65011712,d|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags,d|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=d,n.childLanes=l,i}function tC(n,i,l){var d=i.pendingProps;switch(Zd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(i),null;case 1:return vt(i),null;case 3:return l=i.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Os(Ut),ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(Wa(i)?$s(i):n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Qd())),vt(i),null;case 26:var h=i.type,g=i.memoizedState;return n===null?($s(i),g!==null?(vt(i),y0(i,g)):(vt(i),If(i,h,null,d,l))):g?g!==n.memoizedState?($s(i),vt(i),y0(i,g)):(vt(i),i.flags&=-16777217):(n=n.memoizedProps,n!==d&&$s(i),vt(i),If(i,h,n,d,l)),null;case 27:if(et(i),l=fe.current,h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}n=le.current,Wa(i)?Yg(i):(n=Nv(h,d,l),i.stateNode=n,$s(i))}return vt(i),null;case 5:if(et(i),h=i.type,n!==null&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}if(g=le.current,Wa(i))Yg(i);else{var j=Cc(fe.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 d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?g.multiple=!0:d.size&&(g.size=d.size);break;default:g=typeof d.is=="string"?j.createElement(h,{is:d.is}):j.createElement(h)}}g[st]=i,g[sn]=d;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(en(g,h,d),h){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&$s(i)}}return vt(i),If(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,l),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==d&&$s(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(n=fe.current,Wa(i)){if(n=i.stateNode,l=i.memoizedProps,d=null,h=Jt,h!==null)switch(h.tag){case 27:case 5:d=h.memoizedProps}n[st]=i,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||hv(n.nodeValue,l)),n||si(i,!0)}else n=Cc(n).createTextNode(d),n[st]=i,i.stateNode=n}return vt(i),null;case 31:if(l=i.memoizedState,n===null||n.memoizedState!==null){if(d=Wa(i),l!==null){if(n===null){if(!d)throw Error(a(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(a(557));n[st]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),n=!1}else l=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return i.flags&256?(Rn(i),i):(Rn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return vt(i),null;case 13:if(d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=Wa(i),d!==null&&d.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[st]=i}else Xi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),h=!1}else h=Qd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(Rn(i),i):(Rn(i),null)}return Rn(i),(i.flags&128)!==0?(i.lanes=l,i):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=i.child,h=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(h=d.alternate.memoizedState.cachePool.pool),g=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(g=d.memoizedState.cachePool.pool),g!==h&&(d.flags|=2048)),l!==n&&l&&(i.child.flags|=8192),uc(i,i.updateQueue),vt(i),null);case 4:return ge(),n===null&&lh(i.stateNode.containerInfo),vt(i),null;case 10:return Os(i.type),vt(i),null;case 19:if(B(Tt),d=i.memoizedState,d===null)return vt(i),null;if(h=(i.flags&128)!==0,g=d.rendering,g===null)if(h)jo(d,!1);else{if(At!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(g=Jl(n),g!==null){for(i.flags|=128,jo(d,!1),n=g.updateQueue,i.updateQueue=n,uc(i,n),i.subtreeFlags=0,n=l,l=i.child;l!==null;)Gg(l,n),l=l.sibling;return se(Tt,Tt.current&1|2),Fe&&Rs(i,d.treeForkCount),i.child}n=n.sibling}d.tail!==null&&Qe()>pc&&(i.flags|=128,h=!0,jo(d,!1),i.lanes=4194304)}else{if(!h)if(n=Jl(g),n!==null){if(i.flags|=128,h=!0,n=n.updateQueue,i.updateQueue=n,uc(i,n),jo(d,!0),d.tail===null&&d.tailMode==="hidden"&&!g.alternate&&!Fe)return vt(i),null}else 2*Qe()-d.renderingStartTime>pc&&l!==536870912&&(i.flags|=128,h=!0,jo(d,!1),i.lanes=4194304);d.isBackwards?(g.sibling=i.child,i.child=g):(n=d.last,n!==null?n.sibling=g:i.child=g,d.last=g)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Qe(),n.sibling=null,l=Tt.current,se(Tt,h?l&1|2:l&1),Fe&&Rs(i,d.treeForkCount),n):(vt(i),null);case 22:case 23:return Rn(i),cf(),d=i.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(l&536870912)!==0&&(i.flags&128)===0&&(vt(i),i.subtreeFlags&6&&(i.flags|=8192)):vt(i),l=i.updateQueue,l!==null&&uc(i,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),n!==null&&B(ta),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Os(Ut),vt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function nC(n,i){switch(Zd(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Os(Ut),ge(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return et(i),null;case 31:if(i.memoizedState!==null){if(Rn(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(Rn(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 B(Tt),null;case 4:return ge(),null;case 10:return Os(i.type),null;case 22:case 23:return Rn(i),cf(),n!==null&&B(ta),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Os(Ut),null;case 25:return null;default:return null}}function v0(n,i){switch(Zd(i),i.tag){case 3:Os(Ut),ge();break;case 26:case 27:case 5:et(i);break;case 4:ge();break;case 31:i.memoizedState!==null&&Rn(i);break;case 13:Rn(i);break;case 19:B(Tt);break;case 10:Os(i.type);break;case 22:case 23:Rn(i),cf(),n!==null&&B(ta);break;case 24:Os(Ut)}}function wo(n,i){try{var l=i.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var h=d.next;l=h;do{if((l.tag&n)===n){d=void 0;var g=l.create,j=l.inst;d=g(),j.destroy=d}l=l.next}while(l!==h)}}catch(_){ot(i,i.return,_)}}function ui(n,i,l){try{var d=i.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var g=h.next;d=g;do{if((d.tag&n)===n){var j=d.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,h=i;var M=l,F=_;try{F()}catch(W){ot(h,M,W)}}}d=d.next}while(d!==g)}}catch(W){ot(i,i.return,W)}}function x0(n){var i=n.updateQueue;if(i!==null){var l=n.stateNode;try{cy(i,l)}catch(d){ot(n,n.return,d)}}}function b0(n,i,l){l.props=ra(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){ot(n,i,d)}}function No(n,i){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(h){ot(n,i,h)}}function xs(n,i){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(h){ot(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){ot(n,i,h)}else l.current=null}function S0(n){var i=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(h){ot(n,n.return,h)}}function Bf(n,i,l){try{var d=n.stateNode;NC(d,n.type,l,i),d[sn]=i}catch(h){ot(n,n.return,h)}}function j0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&yi(n.type)||n.tag===4}function qf(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||j0(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&&yi(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 Hf(n,i,l){var d=n.tag;if(d===5||d===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=_s));else if(d!==4&&(d===27&&yi(n.type)&&(l=n.stateNode,i=null),n=n.child,n!==null))for(Hf(n,i,l),n=n.sibling;n!==null;)Hf(n,i,l),n=n.sibling}function dc(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(d!==4&&(d===27&&yi(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(dc(n,i,l),n=n.sibling;n!==null;)dc(n,i,l),n=n.sibling}function w0(n){var i=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);en(i,d,l),i[st]=n,i[sn]=l}catch(g){ot(n,n.return,g)}}var Ps=!1,qt=!1,Kf=!1,N0=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function sC(n,i){if(n=n.containerInfo,dh=Tc,n=Mg(n),Md(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var h=d.anchorOffset,g=d.focusNode;d=d.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var j=0,_=-1,M=-1,F=0,W=0,ie=n,Z=null;t:for(;;){for(var Y;ie!==l||h!==0&&ie.nodeType!==3||(_=j+h),ie!==g||d!==0&&ie.nodeType!==3||(M=j+d),ie.nodeType===3&&(j+=ie.nodeValue.length),(Y=ie.firstChild)!==null;)Z=ie,ie=Y;for(;;){if(ie===n)break t;if(Z===l&&++F===h&&(_=j),Z===g&&++W===d&&(M=j),(Y=ie.nextSibling)!==null)break;ie=Z,Z=ie.parentNode}ie=Y}l=_===-1||M===-1?null:{start:_,end:M}}else l=null}l=l||{start:0,end:0}}else l=null;for(fh={focusedElem:n,selectionRange:l},Tc=!1,Yt=i;Yt!==null;)if(i=Yt,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,Yt=n;else for(;Yt!==null;){switch(i=Yt,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,d=l.stateNode;try{var ve=ra(l.type,h);n=d.getSnapshotBeforeUpdate(ve,g),d.__reactInternalSnapshotBeforeUpdate=n}catch(ze){ot(l,l.return,ze)}}break;case 3:if((n&1024)!==0){if(n=i.stateNode.containerInfo,l=n.nodeType,l===9)ph(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":ph(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,Yt=n;break}Yt=i.return}}function C0(n,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Is(n,l),d&4&&wo(5,l);break;case 1:if(Is(n,l),d&4)if(n=l.stateNode,i===null)try{n.componentDidMount()}catch(j){ot(l,l.return,j)}else{var h=ra(l.type,i.memoizedProps);i=i.memoizedState;try{n.componentDidUpdate(h,i,n.__reactInternalSnapshotBeforeUpdate)}catch(j){ot(l,l.return,j)}}d&64&&x0(l),d&512&&No(l,l.return);break;case 3:if(Is(n,l),d&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{cy(n,i)}catch(j){ot(l,l.return,j)}}break;case 27:i===null&&d&4&&w0(l);case 26:case 5:Is(n,l),i===null&&d&4&&S0(l),d&512&&No(l,l.return);break;case 12:Is(n,l);break;case 31:Is(n,l),d&4&&_0(n,l);break;case 13:Is(n,l),d&4&&E0(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=fC.bind(null,l),TC(n,l))));break;case 22:if(d=l.memoizedState!==null||Ps,!d){i=i!==null&&i.memoizedState!==null||qt,h=Ps;var g=qt;Ps=d,(qt=i)&&!g?Bs(n,l,(l.subtreeFlags&8772)!==0):Is(n,l),Ps=h,qt=g}break;case 30:break;default:Is(n,l)}}function k0(n){var i=n.alternate;i!==null&&(n.alternate=null,k0(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&Js(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 bt=null,vn=!1;function Us(n,i,l){for(l=l.child;l!==null;)z0(n,i,l),l=l.sibling}function z0(n,i,l){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(ts,l)}catch{}switch(l.tag){case 26:qt||xs(l,i),Us(n,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:qt||xs(l,i);var d=bt,h=vn;yi(l.type)&&(bt=l.stateNode,vn=!1),Us(n,i,l),Oo(l.stateNode),bt=d,vn=h;break;case 5:qt||xs(l,i);case 6:if(d=bt,h=vn,bt=null,Us(n,i,l),bt=d,vn=h,bt!==null)if(vn)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(l.stateNode)}catch(g){ot(l,i,g)}else try{bt.removeChild(l.stateNode)}catch(g){ot(l,i,g)}break;case 18:bt!==null&&(vn?(n=bt,xv(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),br(n)):xv(bt,l.stateNode));break;case 4:d=bt,h=vn,bt=l.stateNode.containerInfo,vn=!0,Us(n,i,l),bt=d,vn=h;break;case 0:case 11:case 14:case 15:ui(2,l,i),qt||ui(4,l,i),Us(n,i,l);break;case 1:qt||(xs(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&b0(l,i,d)),Us(n,i,l);break;case 21:Us(n,i,l);break;case 22:qt=(d=qt)||l.memoizedState!==null,Us(n,i,l),qt=d;break;default:Us(n,i,l)}}function _0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{br(n)}catch(l){ot(i,i.return,l)}}}function E0(n,i){if(i.memoizedState===null&&(n=i.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{br(n)}catch(l){ot(i,i.return,l)}}function iC(n){switch(n.tag){case 31:case 13:case 19:var i=n.stateNode;return i===null&&(i=n.stateNode=new N0),i;case 22:return n=n.stateNode,i=n._retryCache,i===null&&(i=n._retryCache=new N0),i;default:throw Error(a(435,n.tag))}}function fc(n,i){var l=iC(n);i.forEach(function(d){if(!l.has(d)){l.add(d);var h=hC.bind(null,n,d);d.then(h,h)}})}function xn(n,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],g=n,j=i,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(yi(_.type)){bt=_.stateNode,vn=!1;break e}break;case 5:bt=_.stateNode,vn=!1;break e;case 3:case 4:bt=_.stateNode.containerInfo,vn=!0;break e}_=_.return}if(bt===null)throw Error(a(160));z0(g,j,h),bt=null,vn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)A0(i,n),i=i.sibling}var is=null;function A0(n,i){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:xn(i,n),bn(n),d&4&&(ui(3,n,n.return),wo(3,n),ui(5,n,n.return));break;case 1:xn(i,n),bn(n),d&512&&(qt||l===null||xs(l,l.return)),d&64&&Ps&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var h=is;if(xn(i,n),bn(n),d&512&&(qt||l===null||xs(l,l.return)),d&4){var g=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,h=h.ownerDocument||h;t:switch(d){case"title":g=h.getElementsByTagName("title")[0],(!g||g[ps]||g[st]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(d),h.head.insertBefore(g,h.querySelector("head > title"))),en(g,d,l),g[st]=n,it(g),d=g;break e;case"link":var j=Av("link","href",h).get(d+(l.href||""));if(j){for(var _=0;_<j.length;_++)if(g=j[_],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(_,1);break t}}g=h.createElement(d),en(g,d,l),h.head.appendChild(g);break;case"meta":if(j=Av("meta","content",h).get(d+(l.content||""))){for(_=0;_<j.length;_++)if(g=j[_],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(_,1);break t}}g=h.createElement(d),en(g,d,l),h.head.appendChild(g);break;default:throw Error(a(468,d))}g[st]=n,it(g),d=g}n.stateNode=d}else Rv(h,n.type,n.stateNode);else n.stateNode=Ev(h,d,n.memoizedProps);else g!==d?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,d===null?Rv(h,n.type,n.stateNode):Ev(h,d,n.memoizedProps)):d===null&&n.stateNode!==null&&Bf(n,n.memoizedProps,l.memoizedProps)}break;case 27:xn(i,n),bn(n),d&512&&(qt||l===null||xs(l,l.return)),l!==null&&d&4&&Bf(n,n.memoizedProps,l.memoizedProps);break;case 5:if(xn(i,n),bn(n),d&512&&(qt||l===null||xs(l,l.return)),n.flags&32){h=n.stateNode;try{Ha(h,"")}catch(ve){ot(n,n.return,ve)}}d&4&&n.stateNode!=null&&(h=n.memoizedProps,Bf(n,h,l!==null?l.memoizedProps:h)),d&1024&&(Kf=!0);break;case 6:if(xn(i,n),bn(n),d&4){if(n.stateNode===null)throw Error(a(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(ve){ot(n,n.return,ve)}}break;case 3:if(_c=null,h=is,is=kc(i.containerInfo),xn(i,n),is=h,bn(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{br(i.containerInfo)}catch(ve){ot(n,n.return,ve)}Kf&&(Kf=!1,R0(n));break;case 4:d=is,is=kc(n.stateNode.containerInfo),xn(i,n),bn(n),is=d;break;case 12:xn(i,n),bn(n);break;case 31:xn(i,n),bn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 13:xn(i,n),bn(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(mc=Qe()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 22:h=n.memoizedState!==null;var M=l!==null&&l.memoizedState!==null,F=Ps,W=qt;if(Ps=F||h,qt=W||M,xn(i,n),qt=W,Ps=F,bn(n),d&8192)e:for(i=n.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||M||Ps||qt||oa(n)),l=null,i=n;;){if(i.tag===5||i.tag===26){if(l===null){M=l=i;try{if(g=M.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=M.stateNode;var ie=M.memoizedProps.style,Z=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;_.style.display=Z==null||typeof Z=="boolean"?"":(""+Z).trim()}}catch(ve){ot(M,M.return,ve)}}}else if(i.tag===6){if(l===null){M=i;try{M.stateNode.nodeValue=h?"":M.memoizedProps}catch(ve){ot(M,M.return,ve)}}}else if(i.tag===18){if(l===null){M=i;try{var Y=M.stateNode;h?bv(Y,!0):bv(M.stateNode,!1)}catch(ve){ot(M,M.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}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,fc(n,l))));break;case 19:xn(i,n),bn(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,fc(n,d)));break;case 30:break;case 21:break;default:xn(i,n),bn(n)}}function bn(n){var i=n.flags;if(i&2){try{for(var l,d=n.return;d!==null;){if(j0(d)){l=d;break}d=d.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=qf(n);dc(n,g,h);break;case 5:var j=l.stateNode;l.flags&32&&(Ha(j,""),l.flags&=-33);var _=qf(n);dc(n,_,j);break;case 3:case 4:var M=l.stateNode.containerInfo,F=qf(n);Hf(n,F,M);break;default:throw Error(a(161))}}catch(W){ot(n,n.return,W)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function R0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var i=n;R0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),n=n.sibling}}function Is(n,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)C0(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:ui(4,i,i.return),oa(i);break;case 1:xs(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&b0(i,i.return,l),oa(i);break;case 27:Oo(i.stateNode);case 26:case 5:xs(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 Bs(n,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,h=n,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:Bs(h,g,l),wo(4,g);break;case 1:if(Bs(h,g,l),d=g,h=d.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(F){ot(d,d.return,F)}if(d=g,h=d.updateQueue,h!==null){var _=d.stateNode;try{var M=h.shared.hiddenCallbacks;if(M!==null)for(h.shared.hiddenCallbacks=null,h=0;h<M.length;h++)ly(M[h],_)}catch(F){ot(d,d.return,F)}}l&&j&64&&x0(g),No(g,g.return);break;case 27:w0(g);case 26:case 5:Bs(h,g,l),l&&d===null&&j&4&&S0(g),No(g,g.return);break;case 12:Bs(h,g,l);break;case 31:Bs(h,g,l),l&&j&4&&_0(h,g);break;case 13:Bs(h,g,l),l&&j&4&&E0(h,g);break;case 22:g.memoizedState===null&&Bs(h,g,l),No(g,g.return);break;case 30:break;default:Bs(h,g,l)}i=i.sibling}}function Gf(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&&co(l))}function Ff(n,i){n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&co(n))}function as(n,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)T0(n,i,l,d),i=i.sibling}function T0(n,i,l,d){var h=i.flags;switch(i.tag){case 0:case 11:case 15:as(n,i,l,d),h&2048&&wo(9,i);break;case 1:as(n,i,l,d);break;case 3:as(n,i,l,d),h&2048&&(n=null,i.alternate!==null&&(n=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==n&&(i.refCount++,n!=null&&co(n)));break;case 12:if(h&2048){as(n,i,l,d),n=i.stateNode;try{var g=i.memoizedProps,j=g.id,_=g.onPostCommit;typeof _=="function"&&_(j,i.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(M){ot(i,i.return,M)}}else as(n,i,l,d);break;case 31:as(n,i,l,d);break;case 13:as(n,i,l,d);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?as(n,i,l,d):Co(n,i):g._visibility&2?as(n,i,l,d):(g._visibility|=2,cr(n,i,l,d,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Gf(j,i);break;case 24:as(n,i,l,d),h&2048&&Ff(i.alternate,i);break;default:as(n,i,l,d)}}function cr(n,i,l,d,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=n,j=i,_=l,M=d,F=j.flags;switch(j.tag){case 0:case 11:case 15:cr(g,j,_,M,h),wo(8,j);break;case 23:break;case 22:var W=j.stateNode;j.memoizedState!==null?W._visibility&2?cr(g,j,_,M,h):Co(g,j):(W._visibility|=2,cr(g,j,_,M,h)),h&&F&2048&&Gf(j.alternate,j);break;case 24:cr(g,j,_,M,h),h&&F&2048&&Ff(j.alternate,j);break;default:cr(g,j,_,M,h)}i=i.sibling}}function Co(n,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=n,d=i,h=d.flags;switch(d.tag){case 22:Co(l,d),h&2048&&Gf(d.alternate,d);break;case 24:Co(l,d),h&2048&&Ff(d.alternate,d);break;default:Co(l,d)}i=i.sibling}}var ko=8192;function ur(n,i,l){if(n.subtreeFlags&ko)for(n=n.child;n!==null;)O0(n,i,l),n=n.sibling}function O0(n,i,l){switch(n.tag){case 26:ur(n,i,l),n.flags&ko&&n.memoizedState!==null&&KC(l,is,n.memoizedState,n.memoizedProps);break;case 5:ur(n,i,l);break;case 3:case 4:var d=is;is=kc(n.stateNode.containerInfo),ur(n,i,l),is=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=ko,ko=16777216,ur(n,i,l),ko=d):ur(n,i,l));break;default:ur(n,i,l)}}function L0(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 zo(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Yt=d,M0(d,n)}L0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)D0(n),n=n.sibling}function D0(n){switch(n.tag){case 0:case 11:case 15:zo(n),n.flags&2048&&ui(9,n,n.return);break;case 3:zo(n);break;case 12:zo(n);break;case 22:var i=n.stateNode;n.memoizedState!==null&&i._visibility&2&&(n.return===null||n.return.tag!==13)?(i._visibility&=-3,hc(n)):zo(n);break;default:zo(n)}}function hc(n){var i=n.deletions;if((n.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Yt=d,M0(d,n)}L0(n)}for(n=n.child;n!==null;){switch(i=n,i.tag){case 0:case 11:case 15:ui(8,i,i.return),hc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,hc(i));break;default:hc(i)}n=n.sibling}}function M0(n,i){for(;Yt!==null;){var l=Yt;switch(l.tag){case 0:case 11:case 15:ui(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:co(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Yt=d;else e:for(l=n;Yt!==null;){d=Yt;var h=d.sibling,g=d.return;if(k0(d),d===l){Yt=null;break e}if(h!==null){h.return=g,Yt=h;break e}Yt=g}}}var aC={getCacheForType:function(n){var i=Xt(Ut),l=i.data.get(n);return l===void 0&&(l=n(),i.data.set(n,l)),l},cacheSignal:function(){return Xt(Ut).controller.signal}},rC=typeof WeakMap=="function"?WeakMap:Map,tt=0,mt=null,Ue=null,qe=0,rt=0,Tn=null,di=!1,dr=!1,Zf=!1,qs=0,At=0,fi=0,la=0,Vf=0,On=0,fr=0,_o=null,Sn=null,Qf=!1,mc=0,$0=0,pc=1/0,gc=null,hi=null,Gt=0,mi=null,hr=null,Hs=0,Yf=0,Jf=null,P0=null,Eo=0,Xf=null;function Ln(){return(tt&2)!==0&&qe!==0?qe&-qe:K.T!==null?ih():Ua()}function U0(){if(On===0)if((qe&536870912)===0||Fe){var n=$a;$a<<=1,($a&3932160)===0&&($a=262144),On=n}else On=536870912;return n=An.current,n!==null&&(n.flags|=32),On}function jn(n,i,l){(n===mt&&(rt===2||rt===9)||n.cancelPendingCommit!==null)&&(mr(n,0),pi(n,qe,On,!1)),Gi(n,l),((tt&2)===0||n!==mt)&&(n===mt&&((tt&2)===0&&(la|=l),At===4&&pi(n,qe,On,!1)),bs(n))}function I0(n,i,l){if((tt&6)!==0)throw Error(a(327));var d=!l&&(i&127)===0&&(i&n.expiredLanes)===0||Ys(n,i),h=d?cC(n,i):eh(n,i,!0),g=d;do{if(h===0){dr&&!d&&pi(n,i,0,!1);break}else{if(l=n.current.alternate,g&&!oC(l)){h=eh(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 _=n;h=_o;var M=_.current.memoizedState.isDehydrated;if(M&&(mr(_,j).flags|=256),j=eh(_,j,!1),j!==2){if(Zf&&!M){_.errorRecoveryDisabledLanes|=g,la|=g,h=4;break e}g=Sn,Sn=h,g!==null&&(Sn===null?Sn=g:Sn.push.apply(Sn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){mr(n,0),pi(n,i,0,!0);break}e:{switch(d=n,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:pi(d,i,On,!di);break e;case 2:Sn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=mc+300-Qe(),10<h)){if(pi(d,i,On,!di),Pa(d,0,!0)!==0)break e;Hs=i,d.timeoutHandle=yv(B0.bind(null,d,l,Sn,gc,Qf,i,On,la,fr,di,g,"Throttled",-0,0),h);break e}B0(d,l,Sn,gc,Qf,i,On,la,fr,di,g,null,-0,0)}}break}while(!0);bs(n)}function B0(n,i,l,d,h,g,j,_,M,F,W,ie,Z,Y){if(n.timeoutHandle=-1,ie=i.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_s},O0(i,g,ie);var ve=(g&62914560)===g?mc-Qe():(g&4194048)===g?$0-Qe():0;if(ve=GC(ie,ve),ve!==null){Hs=g,n.cancelPendingCommit=ve(Q0.bind(null,n,i,g,l,d,h,j,_,M,W,ie,null,Z,Y)),pi(n,g,j,!F);return}}Q0(n,i,g,l,d,h,j,_,M)}function oC(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 d=0;d<l.length;d++){var h=l[d],g=h.getSnapshot;h=h.value;try{if(!_n(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 pi(n,i,l,d){i&=~Vf,i&=~la,n.suspendedLanes|=i,n.pingedLanes&=~i,d&&(n.warmLanes|=i),d=n.expirationTimes;for(var h=i;0<h;){var g=31-ce(h),j=1<<g;d[g]=-1,h&=~j}l!==0&&I(n,l,i)}function yc(){return(tt&6)===0?(Ao(0),!1):!0}function Wf(){if(Ue!==null){if(rt===0)var n=Ue.return;else n=Ue,Ts=Wi=null,pf(n),ir=null,fo=0,n=Ue;for(;n!==null;)v0(n.alternate,n),n=n.return;Ue=null}}function mr(n,i){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,zC(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),Hs=0,Wf(),mt=n,Ue=l=As(n.current,null),qe=i,rt=0,Tn=null,di=!1,dr=Ys(n,i),Zf=!1,fr=On=Vf=la=fi=At=0,Sn=_o=null,Qf=!1,(i&8)!==0&&(i|=i&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=i;0<d;){var h=31-ce(d),g=1<<h;i|=n[h],d&=~g}return qs=i,Pl(),l}function q0(n,i){Oe=null,K.H=bo,i===sr||i===Fl?(i=iy(),rt=3):i===nf?(i=iy(),rt=4):rt=i===Rf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Tn=i,Ue===null&&(At=1,rc(n,Un(i,n.current)))}function H0(){var n=An.current;return n===null?!0:(qe&4194048)===qe?Hn===null:(qe&62914560)===qe||(qe&536870912)!==0?n===Hn:!1}function K0(){var n=K.H;return K.H=bo,n===null?bo:n}function G0(){var n=K.A;return K.A=aC,n}function vc(){At=4,di||(qe&4194048)!==qe&&An.current!==null||(dr=!0),(fi&134217727)===0&&(la&134217727)===0||mt===null||pi(mt,qe,On,!1)}function eh(n,i,l){var d=tt;tt|=2;var h=K0(),g=G0();(mt!==n||qe!==i)&&(gc=null,mr(n,i)),i=!1;var j=At;e:do try{if(rt!==0&&Ue!==null){var _=Ue,M=Tn;switch(rt){case 8:Wf(),j=6;break e;case 3:case 2:case 9:case 6:An.current===null&&(i=!0);var F=rt;if(rt=0,Tn=null,pr(n,_,M,F),l&&dr){j=0;break e}break;default:F=rt,rt=0,Tn=null,pr(n,_,M,F)}}lC(),j=At;break}catch(W){q0(n,W)}while(!0);return i&&n.shellSuspendCounter++,Ts=Wi=null,tt=d,K.H=h,K.A=g,Ue===null&&(mt=null,qe=0,Pl()),j}function lC(){for(;Ue!==null;)F0(Ue)}function cC(n,i){var l=tt;tt|=2;var d=K0(),h=G0();mt!==n||qe!==i?(gc=null,pc=Qe()+500,mr(n,i)):dr=Ys(n,i);e:do try{if(rt!==0&&Ue!==null){i=Ue;var g=Tn;t:switch(rt){case 1:rt=0,Tn=null,pr(n,i,g,1);break;case 2:case 9:if(ny(g)){rt=0,Tn=null,Z0(i);break}i=function(){rt!==2&&rt!==9||mt!==n||(rt=7),bs(n)},g.then(i,i);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:ny(g)?(rt=0,Tn=null,Z0(i)):(rt=0,Tn=null,pr(n,i,g,7));break;case 5:var j=null;switch(Ue.tag){case 26:j=Ue.memoizedState;case 5:case 27:var _=Ue;if(j?Tv(j):_.stateNode.complete){rt=0,Tn=null;var M=_.sibling;if(M!==null)Ue=M;else{var F=_.return;F!==null?(Ue=F,xc(F)):Ue=null}break t}}rt=0,Tn=null,pr(n,i,g,5);break;case 6:rt=0,Tn=null,pr(n,i,g,6);break;case 8:Wf(),At=6;break e;default:throw Error(a(462))}}uC();break}catch(W){q0(n,W)}while(!0);return Ts=Wi=null,K.H=d,K.A=h,tt=l,Ue!==null?0:(mt=null,qe=0,Pl(),At)}function uC(){for(;Ue!==null&&!gt();)F0(Ue)}function F0(n){var i=g0(n.alternate,n,qs);n.memoizedProps=n.pendingProps,i===null?xc(n):Ue=i}function Z0(n){var i=n,l=i.alternate;switch(i.tag){case 15:case 0:i=u0(l,i,i.pendingProps,i.type,void 0,qe);break;case 11:i=u0(l,i,i.pendingProps,i.type.render,i.ref,qe);break;case 5:pf(i);default:v0(l,i),i=Ue=Gg(i,qs),i=g0(l,i,qs)}n.memoizedProps=n.pendingProps,i===null?xc(n):Ue=i}function pr(n,i,l,d){Ts=Wi=null,pf(i),ir=null,fo=0;var h=i.return;try{if(X1(n,h,i,l,qe)){At=1,rc(n,Un(l,n.current)),Ue=null;return}}catch(g){if(h!==null)throw Ue=h,g;At=1,rc(n,Un(l,n.current)),Ue=null;return}i.flags&32768?(Fe||d===1?n=!0:dr||(qe&536870912)!==0?n=!1:(di=n=!0,(d===2||d===9||d===3||d===6)&&(d=An.current,d!==null&&d.tag===13&&(d.flags|=16384))),V0(i,n)):xc(i)}function xc(n){var i=n;do{if((i.flags&32768)!==0){V0(i,di);return}n=i.return;var l=tC(i.alternate,i,qs);if(l!==null){Ue=l;return}if(i=i.sibling,i!==null){Ue=i;return}Ue=i=n}while(i!==null);At===0&&(At=5)}function V0(n,i){do{var l=nC(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);At=6,Ue=null}function Q0(n,i,l,d,h,g,j,_,M){n.cancelPendingCommit=null;do bc();while(Gt!==0);if((tt&6)!==0)throw Error(a(327));if(i!==null){if(i===n.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Bd,Nl(n,l,g,j,_,M),n===mt&&(Ue=mt=null,qe=0),hr=i,mi=n,Hs=l,Yf=g,Jf=h,P0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,mC(Be,function(){return ev(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=K.T,K.T=null,h=ae.p,ae.p=2,j=tt,tt|=4;try{sC(n,i,l)}finally{tt=j,ae.p=h,K.T=d}}Gt=1,Y0(),J0(),X0()}}function Y0(){if(Gt===1){Gt=0;var n=mi,i=hr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=K.T,K.T=null;var d=ae.p;ae.p=2;var h=tt;tt|=4;try{A0(i,n);var g=fh,j=Mg(n.containerInfo),_=g.focusedElem,M=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&Dg(_.ownerDocument.documentElement,_)){if(M!==null&&Md(_)){var F=M.start,W=M.end;if(W===void 0&&(W=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(W,_.value.length);else{var ie=_.ownerDocument||document,Z=ie&&ie.defaultView||window;if(Z.getSelection){var Y=Z.getSelection(),ve=_.textContent.length,ze=Math.min(M.start,ve),ft=M.end===void 0?ze:Math.min(M.end,ve);!Y.extend&&ze>ft&&(j=ft,ft=ze,ze=j);var q=Lg(_,ze),P=Lg(_,ft);if(q&&P&&(Y.rangeCount!==1||Y.anchorNode!==q.node||Y.anchorOffset!==q.offset||Y.focusNode!==P.node||Y.focusOffset!==P.offset)){var G=ie.createRange();G.setStart(q.node,q.offset),Y.removeAllRanges(),ze>ft?(Y.addRange(G),Y.extend(P.node,P.offset)):(G.setEnd(P.node,P.offset),Y.addRange(G))}}}}for(ie=[],Y=_;Y=Y.parentNode;)Y.nodeType===1&&ie.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ie.length;_++){var te=ie[_];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Tc=!!dh,fh=dh=null}finally{tt=h,ae.p=d,K.T=l}}n.current=i,Gt=2}}function J0(){if(Gt===2){Gt=0;var n=mi,i=hr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=K.T,K.T=null;var d=ae.p;ae.p=2;var h=tt;tt|=4;try{C0(n,i.alternate,i)}finally{tt=h,ae.p=d,K.T=l}}Gt=3}}function X0(){if(Gt===4||Gt===3){Gt=0,Qt();var n=mi,i=hr,l=Hs,d=P0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gt=5:(Gt=0,hr=mi=null,W0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(hi=null),ln(l),i=i.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(ts,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=K.T,h=ae.p,ae.p=2,K.T=null;try{for(var g=n.onRecoverableError,j=0;j<d.length;j++){var _=d[j];g(_.value,{componentStack:_.stack})}}finally{K.T=i,ae.p=h}}(Hs&3)!==0&&bc(),bs(n),h=n.pendingLanes,(l&261930)!==0&&(h&42)!==0?n===Xf?Eo++:(Eo=0,Xf=n):Eo=0,Ao(0)}}function W0(n,i){(n.pooledCacheLanes&=i)===0&&(i=n.pooledCache,i!=null&&(n.pooledCache=null,co(i)))}function bc(){return Y0(),J0(),X0(),ev()}function ev(){if(Gt!==5)return!1;var n=mi,i=Yf;Yf=0;var l=ln(Hs),d=K.T,h=ae.p;try{ae.p=32>l?32:l,K.T=null,l=Jf,Jf=null;var g=mi,j=Hs;if(Gt=0,hr=mi=null,Hs=0,(tt&6)!==0)throw Error(a(331));var _=tt;if(tt|=4,D0(g.current),T0(g,g.current,j,l),tt=_,Ao(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(ts,g)}catch{}return!0}finally{ae.p=h,K.T=d,W0(n,i)}}function tv(n,i,l){i=Un(l,i),i=Af(n.stateNode,i,2),n=oi(n,i,2),n!==null&&(Gi(n,2),bs(n))}function ot(n,i,l){if(n.tag===3)tv(n,n,l);else for(;i!==null;){if(i.tag===3){tv(i,n,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(hi===null||!hi.has(d))){n=Un(l,n),l=n0(2),d=oi(i,l,2),d!==null&&(s0(l,d,i,n),Gi(d,2),bs(d));break}}i=i.return}}function th(n,i,l){var d=n.pingCache;if(d===null){d=n.pingCache=new rC;var h=new Set;d.set(i,h)}else h=d.get(i),h===void 0&&(h=new Set,d.set(i,h));h.has(l)||(Zf=!0,h.add(l),n=dC.bind(null,n,i,l),i.then(n,n))}function dC(n,i,l){var d=n.pingCache;d!==null&&d.delete(i),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,mt===n&&(qe&l)===l&&(At===4||At===3&&(qe&62914560)===qe&&300>Qe()-mc?(tt&2)===0&&mr(n,0):Vf|=l,fr===qe&&(fr=0)),bs(n)}function nv(n,i){i===0&&(i=wl()),n=Yi(n,i),n!==null&&(Gi(n,i),bs(n))}function fC(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),nv(n,l)}function hC(n,i){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,h=n.memoizedState;h!==null&&(l=h.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),nv(n,l)}function mC(n,i){return re(n,i)}var Sc=null,gr=null,nh=!1,jc=!1,sh=!1,gi=0;function bs(n){n!==gr&&n.next===null&&(gr===null?Sc=gr=n:gr=gr.next=n),jc=!0,nh||(nh=!0,gC())}function Ao(n,i){if(!sh&&jc){sh=!0;do for(var l=!1,d=Sc;d!==null;){if(n!==0){var h=d.pendingLanes;if(h===0)var g=0;else{var j=d.suspendedLanes,_=d.pingedLanes;g=(1<<31-ce(42|n)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,rv(d,g))}else g=qe,g=Pa(d,d===mt?g:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(g&3)===0||Ys(d,g)||(l=!0,rv(d,g));d=d.next}while(l);sh=!1}}function pC(){sv()}function sv(){jc=nh=!1;var n=0;gi!==0&&kC()&&(n=gi);for(var i=Qe(),l=null,d=Sc;d!==null;){var h=d.next,g=iv(d,i);g===0?(d.next=null,l===null?Sc=h:l.next=h,h===null&&(gr=l)):(l=d,(n!==0||(g&3)!==0)&&(jc=!0)),d=h}Gt!==0&&Gt!==5||Ao(n),gi!==0&&(gi=0)}function iv(n,i){for(var l=n.suspendedLanes,d=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-ce(g),_=1<<j,M=h[j];M===-1?((_&l)===0||(_&d)!==0)&&(h[j]=xd(_,i)):M<=i&&(n.expiredLanes|=_),g&=~_}if(i=mt,l=qe,l=Pa(n,n===i?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===i&&(rt===2||rt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Ge(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||Ys(n,l)){if(i=l&-l,i===n.callbackPriority)return i;switch(d!==null&&Ge(d),ln(l)){case 2:case 8:l=Nt;break;case 32:l=Be;break;case 268435456:l=pn;break;default:l=Be}return d=av.bind(null,n),l=re(l,d),n.callbackPriority=i,n.callbackNode=l,i}return d!==null&&d!==null&&Ge(d),n.callbackPriority=2,n.callbackNode=null,2}function av(n,i){if(Gt!==0&&Gt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(bc()&&n.callbackNode!==l)return null;var d=qe;return d=Pa(n,n===mt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:(I0(n,d,i),iv(n,Qe()),n.callbackNode!=null&&n.callbackNode===l?av.bind(null,n):null)}function rv(n,i){if(bc())return null;I0(n,i,!0)}function gC(){_C(function(){(tt&6)!==0?re(Ye,pC):sv()})}function ih(){if(gi===0){var n=tr;n===0&&(n=Ki,Ki<<=1,(Ki&261888)===0&&(Ki=256)),gi=n}return gi}function ov(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Al(""+n)}function lv(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 yC(n,i,l,d,h){if(i==="submit"&&l&&l.stateNode===h){var g=ov((h[sn]||null).action),j=d.submitter;j&&(i=(i=j[sn]||null)?ov(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new Ll("action","action",null,d,h);n.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(gi!==0){var M=j?lv(h,j):new FormData(h);Nf(l,{pending:!0,data:M,method:h.method,action:g},null,M)}}else typeof g=="function"&&(_.preventDefault(),M=j?lv(h,j):new FormData(h),Nf(l,{pending:!0,data:M,method:h.method,action:g},g,M))},currentTarget:h}]})}}for(var ah=0;ah<Id.length;ah++){var rh=Id[ah],vC=rh.toLowerCase(),xC=rh[0].toUpperCase()+rh.slice(1);ss(vC,"on"+xC)}ss(Ug,"onAnimationEnd"),ss(Ig,"onAnimationIteration"),ss(Bg,"onAnimationStart"),ss("dblclick","onDoubleClick"),ss("focusin","onFocus"),ss("focusout","onBlur"),ss(D1,"onTransitionRun"),ss(M1,"onTransitionStart"),ss($1,"onTransitionCancel"),ss(qg,"onTransitionEnd"),Ba("onMouseEnter",["mouseout","mouseover"]),Ba("onMouseLeave",["mouseout","mouseover"]),Ba("onPointerEnter",["pointerout","pointerover"]),Ba("onPointerLeave",["pointerout","pointerover"]),gs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gs("onBeforeInput",["compositionend","keypress","textInput","paste"]),gs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),bC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ro));function cv(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],h=d.event;d=d.listeners;e:{var g=void 0;if(i)for(var j=d.length-1;0<=j;j--){var _=d[j],M=_.instance,F=_.currentTarget;if(_=_.listener,M!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){$l(W)}h.currentTarget=null,g=M}else for(j=0;j<d.length;j++){if(_=d[j],M=_.instance,F=_.currentTarget,_=_.listener,M!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(W){$l(W)}h.currentTarget=null,g=M}}}}function Ie(n,i){var l=i[ks];l===void 0&&(l=i[ks]=new Set);var d=n+"__bubble";l.has(d)||(uv(i,n,2,!1),l.add(d))}function oh(n,i,l){var d=0;i&&(d|=4),uv(l,n,d,i)}var wc="_reactListening"+Math.random().toString(36).slice(2);function lh(n){if(!n[wc]){n[wc]=!0,ns.forEach(function(l){l!=="selectionchange"&&(bC.has(l)||oh(l,!1,n),oh(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[wc]||(i[wc]=!0,oh("selectionchange",!1,i))}}function uv(n,i,l,d){switch(Uv(i)){case 2:var h=VC;break;case 8:h=QC;break;default:h=wh}l=h.bind(null,i,l,n),h=void 0,!zd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),d?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 ch(n,i,l,d,h){var g=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var _=d.stateNode.containerInfo;if(_===h)break;if(j===4)for(j=d.return;j!==null;){var M=j.tag;if((M===3||M===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;_!==null;){if(j=Xs(_),j===null)return;if(M=j.tag,M===5||M===6||M===26||M===27){d=g=j;continue e}_=_.parentNode}}d=d.return}pg(function(){var F=g,W=Cd(l),ie=[];e:{var Z=Hg.get(n);if(Z!==void 0){var Y=Ll,ve=n;switch(n){case"keypress":if(Tl(l)===0)break e;case"keydown":case"keyup":Y=h1;break;case"focusin":ve="focus",Y=Rd;break;case"focusout":ve="blur",Y=Rd;break;case"beforeblur":case"afterblur":Y=Rd;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=vg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=t1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=g1;break;case Ug:case Ig:case Bg:Y=i1;break;case qg:Y=v1;break;case"scroll":case"scrollend":Y=WN;break;case"wheel":Y=b1;break;case"copy":case"cut":case"paste":Y=r1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=bg;break;case"toggle":case"beforetoggle":Y=j1}var ze=(i&4)!==0,ft=!ze&&(n==="scroll"||n==="scrollend"),q=ze?Z!==null?Z+"Capture":null:Z;ze=[];for(var P=F,G;P!==null;){var te=P;if(G=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||G===null||q===null||(te=Xr(P,q),te!=null&&ze.push(To(P,te,G))),ft)break;P=P.return}0<ze.length&&(Z=new Y(Z,ve,null,l,W),ie.push({event:Z,listeners:ze}))}}if((i&7)===0){e:{if(Z=n==="mouseover"||n==="pointerover",Y=n==="mouseout"||n==="pointerout",Z&&l!==Nd&&(ve=l.relatedTarget||l.fromElement)&&(Xs(ve)||ve[zn]))break e;if((Y||Z)&&(Z=W.window===W?W:(Z=W.ownerDocument)?Z.defaultView||Z.parentWindow:window,Y?(ve=l.relatedTarget||l.toElement,Y=F,ve=ve?Xs(ve):null,ve!==null&&(ft=c(ve),ze=ve.tag,ve!==ft||ze!==5&&ze!==27&&ze!==6)&&(ve=null)):(Y=null,ve=F),Y!==ve)){if(ze=vg,te="onMouseLeave",q="onMouseEnter",P="mouse",(n==="pointerout"||n==="pointerover")&&(ze=bg,te="onPointerLeave",q="onPointerEnter",P="pointer"),ft=Y==null?Z:$e(Y),G=ve==null?Z:$e(ve),Z=new ze(te,P+"leave",Y,l,W),Z.target=ft,Z.relatedTarget=G,te=null,Xs(W)===F&&(ze=new ze(q,P+"enter",ve,l,W),ze.target=G,ze.relatedTarget=ft,te=ze),ft=te,Y&&ve)t:{for(ze=SC,q=Y,P=ve,G=0,te=q;te;te=ze(te))G++;te=0;for(var ke=P;ke;ke=ze(ke))te++;for(;0<G-te;)q=ze(q),G--;for(;0<te-G;)P=ze(P),te--;for(;G--;){if(q===P||P!==null&&q===P.alternate){ze=q;break t}q=ze(q),P=ze(P)}ze=null}else ze=null;Y!==null&&dv(ie,Z,Y,ze,!1),ve!==null&&ft!==null&&dv(ie,ft,ve,ze,!0)}}e:{if(Z=F?$e(F):window,Y=Z.nodeName&&Z.nodeName.toLowerCase(),Y==="select"||Y==="input"&&Z.type==="file")var Xe=_g;else if(kg(Z))if(Eg)Xe=T1;else{Xe=A1;var Se=E1}else Y=Z.nodeName,!Y||Y.toLowerCase()!=="input"||Z.type!=="checkbox"&&Z.type!=="radio"?F&&wd(F.elementType)&&(Xe=_g):Xe=R1;if(Xe&&(Xe=Xe(n,F))){zg(ie,Xe,l,W);break e}Se&&Se(n,Z,F),n==="focusout"&&F&&Z.type==="number"&&F.memoizedProps.value!=null&&jd(Z,"number",Z.value)}switch(Se=F?$e(F):window,n){case"focusin":(kg(Se)||Se.contentEditable==="true")&&(Za=Se,$d=F,ro=null);break;case"focusout":ro=$d=Za=null;break;case"mousedown":Pd=!0;break;case"contextmenu":case"mouseup":case"dragend":Pd=!1,$g(ie,l,W);break;case"selectionchange":if(L1)break;case"keydown":case"keyup":$g(ie,l,W)}var Le;if(Od)e:{switch(n){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Fa?Ng(n,l)&&(He="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(He="onCompositionStart");He&&(Sg&&l.locale!=="ko"&&(Fa||He!=="onCompositionStart"?He==="onCompositionEnd"&&Fa&&(Le=gg()):(ei=W,_d="value"in ei?ei.value:ei.textContent,Fa=!0)),Se=Nc(F,He),0<Se.length&&(He=new xg(He,n,null,l,W),ie.push({event:He,listeners:Se}),Le?He.data=Le:(Le=Cg(l),Le!==null&&(He.data=Le)))),(Le=N1?C1(n,l):k1(n,l))&&(He=Nc(F,"onBeforeInput"),0<He.length&&(Se=new xg("onBeforeInput","beforeinput",null,l,W),ie.push({event:Se,listeners:He}),Se.data=Le)),yC(ie,n,F,l,W)}cv(ie,i)})}function To(n,i,l){return{instance:n,listener:i,currentTarget:l}}function Nc(n,i){for(var l=i+"Capture",d=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Xr(n,l),h!=null&&d.unshift(To(n,h,g)),h=Xr(n,i),h!=null&&d.push(To(n,h,g))),n.tag===3)return d;n=n.return}return[]}function SC(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function dv(n,i,l,d,h){for(var g=i._reactName,j=[];l!==null&&l!==d;){var _=l,M=_.alternate,F=_.stateNode;if(_=_.tag,M!==null&&M===d)break;_!==5&&_!==26&&_!==27||F===null||(M=F,h?(F=Xr(l,g),F!=null&&j.unshift(To(l,F,M))):h||(F=Xr(l,g),F!=null&&j.push(To(l,F,M)))),l=l.return}j.length!==0&&n.push({event:i,listeners:j})}var jC=/\r\n?/g,wC=/\u0000|\uFFFD/g;function fv(n){return(typeof n=="string"?n:""+n).replace(jC,`
|
|
9
|
-
`).replace(wC,"")}function hv(n,i){return i=fv(i),fv(n)===i}function dt(n,i,l,d,h,g){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ha(n,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ha(n,""+d);break;case"className":_l(n,"class",d);break;case"tabIndex":_l(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":_l(n,l,d);break;case"style":hg(n,d,g);break;case"data":if(i!=="object"){_l(n,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Al(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="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"&&dt(n,i,"name",h.name,h,null),dt(n,i,"formEncType",h.formEncType,h,null),dt(n,i,"formMethod",h.formMethod,h,null),dt(n,i,"formTarget",h.formTarget,h,null)):(dt(n,i,"encType",h.encType,h,null),dt(n,i,"method",h.method,h,null),dt(n,i,"target",h.target,h,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=Al(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=_s);break;case"onScroll":d!=null&&Ie("scroll",n);break;case"onScrollEnd":d!=null&&Ie("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=Al(""+d),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":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":Ie("beforetoggle",n),Ie("toggle",n),zl(n,"popover",d);break;case"xlinkActuate":zs(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":zs(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":zs(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":zs(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":zs(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":zs(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":zs(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":zs(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":zs(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":zl(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=JN.get(l)||l,zl(n,l,d))}}function uh(n,i,l,d,h,g){switch(l){case"style":hg(n,d,g);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(l=d.__html,l!=null){if(h.children!=null)throw Error(a(60));n.innerHTML=l}}break;case"children":typeof d=="string"?Ha(n,d):(typeof d=="number"||typeof d=="bigint")&&Ha(n,""+d);break;case"onScroll":d!=null&&Ie("scroll",n);break;case"onScrollEnd":d!=null&&Ie("scrollend",n);break;case"onClick":d!=null&&(n.onclick=_s);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fi.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[sn]||null,g=g!=null?g[l]:null,typeof g=="function"&&n.removeEventListener(i,g,h),typeof d=="function")){typeof g!="function"&&g!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(i,d,h);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):zl(n,l,d)}}}function en(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 d=!1,h=!1,g;for(g in l)if(l.hasOwnProperty(g)){var j=l[g];if(j!=null)switch(g){case"src":d=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:dt(n,i,g,j,l,null)}}h&&dt(n,i,"srcSet",l.srcSet,l,null),d&&dt(n,i,"src",l.src,l,null);return;case"input":Ie("invalid",n);var _=g=j=h=null,M=null,F=null;for(d in l)if(l.hasOwnProperty(d)){var W=l[d];if(W!=null)switch(d){case"name":h=W;break;case"type":j=W;break;case"checked":M=W;break;case"defaultChecked":F=W;break;case"value":g=W;break;case"defaultValue":_=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,i));break;default:dt(n,i,d,W,l,null)}}cg(n,g,_,M,F,j,h,!1);return;case"select":Ie("invalid",n),d=j=g=null;for(h in l)if(l.hasOwnProperty(h)&&(_=l[h],_!=null))switch(h){case"value":g=_;break;case"defaultValue":j=_;break;case"multiple":d=_;default:dt(n,i,h,_,l,null)}i=g,l=j,n.multiple=!!d,i!=null?qa(n,!!d,i,!1):l!=null&&qa(n,!!d,l,!0);return;case"textarea":Ie("invalid",n),g=h=d=null;for(j in l)if(l.hasOwnProperty(j)&&(_=l[j],_!=null))switch(j){case"value":d=_;break;case"defaultValue":h=_;break;case"children":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:dt(n,i,j,_,l,null)}dg(n,d,h,g);return;case"option":for(M in l)l.hasOwnProperty(M)&&(d=l[M],d!=null)&&(M==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":dt(n,i,M,d,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(d=0;d<Ro.length;d++)Ie(Ro[d],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(F in l)if(l.hasOwnProperty(F)&&(d=l[F],d!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:dt(n,i,F,d,l,null)}return;default:if(wd(i)){for(W in l)l.hasOwnProperty(W)&&(d=l[W],d!==void 0&&uh(n,i,W,d,l,void 0));return}}for(_ in l)l.hasOwnProperty(_)&&(d=l[_],d!=null&&dt(n,i,_,d,l,null))}function NC(n,i,l,d){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,_=null,M=null,F=null,W=null;for(Y in l){var ie=l[Y];if(l.hasOwnProperty(Y)&&ie!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":M=ie;default:d.hasOwnProperty(Y)||dt(n,i,Y,null,d,ie)}}for(var Z in d){var Y=d[Z];if(ie=l[Z],d.hasOwnProperty(Z)&&(Y!=null||ie!=null))switch(Z){case"type":g=Y;break;case"name":h=Y;break;case"checked":F=Y;break;case"defaultChecked":W=Y;break;case"value":j=Y;break;case"defaultValue":_=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(a(137,i));break;default:Y!==ie&&dt(n,i,Z,Y,d,ie)}}Sd(n,j,_,M,F,W,g,h);return;case"select":Y=j=_=Z=null;for(g in l)if(M=l[g],l.hasOwnProperty(g)&&M!=null)switch(g){case"value":break;case"multiple":Y=M;default:d.hasOwnProperty(g)||dt(n,i,g,null,d,M)}for(h in d)if(g=d[h],M=l[h],d.hasOwnProperty(h)&&(g!=null||M!=null))switch(h){case"value":Z=g;break;case"defaultValue":_=g;break;case"multiple":j=g;default:g!==M&&dt(n,i,h,g,d,M)}i=_,l=j,d=Y,Z!=null?qa(n,!!l,Z,!1):!!d!=!!l&&(i!=null?qa(n,!!l,i,!0):qa(n,!!l,l?[]:"",!1));return;case"textarea":Y=Z=null;for(_ in l)if(h=l[_],l.hasOwnProperty(_)&&h!=null&&!d.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:dt(n,i,_,null,d,h)}for(j in d)if(h=d[j],g=l[j],d.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){case"value":Z=h;break;case"defaultValue":Y=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&dt(n,i,j,h,d,g)}ug(n,Z,Y);return;case"option":for(var ve in l)Z=l[ve],l.hasOwnProperty(ve)&&Z!=null&&!d.hasOwnProperty(ve)&&(ve==="selected"?n.selected=!1:dt(n,i,ve,null,d,Z));for(M in d)Z=d[M],Y=l[M],d.hasOwnProperty(M)&&Z!==Y&&(Z!=null||Y!=null)&&(M==="selected"?n.selected=Z&&typeof Z!="function"&&typeof Z!="symbol":dt(n,i,M,Z,d,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 ze in l)Z=l[ze],l.hasOwnProperty(ze)&&Z!=null&&!d.hasOwnProperty(ze)&&dt(n,i,ze,null,d,Z);for(F in d)if(Z=d[F],Y=l[F],d.hasOwnProperty(F)&&Z!==Y&&(Z!=null||Y!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(a(137,i));break;default:dt(n,i,F,Z,d,Y)}return;default:if(wd(i)){for(var ft in l)Z=l[ft],l.hasOwnProperty(ft)&&Z!==void 0&&!d.hasOwnProperty(ft)&&uh(n,i,ft,void 0,d,Z);for(W in d)Z=d[W],Y=l[W],!d.hasOwnProperty(W)||Z===Y||Z===void 0&&Y===void 0||uh(n,i,W,Z,d,Y);return}}for(var q in l)Z=l[q],l.hasOwnProperty(q)&&Z!=null&&!d.hasOwnProperty(q)&&dt(n,i,q,null,d,Z);for(ie in d)Z=d[ie],Y=l[ie],!d.hasOwnProperty(ie)||Z===Y||Z==null&&Y==null||dt(n,i,ie,Z,d,Y)}function mv(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function CC(){if(typeof performance.getEntriesByType=="function"){for(var n=0,i=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var h=l[d],g=h.transferSize,j=h.initiatorType,_=h.duration;if(g&&_&&mv(j)){for(j=0,_=h.responseEnd,d+=1;d<l.length;d++){var M=l[d],F=M.startTime;if(F>_)break;var W=M.transferSize,ie=M.initiatorType;W&&mv(ie)&&(M=M.responseEnd,j+=W*(M<_?1:(_-F)/(M-F)))}if(--d,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 dh=null,fh=null;function Cc(n){return n.nodeType===9?n:n.ownerDocument}function pv(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 gv(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 hh(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 mh=null;function kC(){var n=window.event;return n&&n.type==="popstate"?n===mh?!1:(mh=n,!0):(mh=null,!1)}var yv=typeof setTimeout=="function"?setTimeout:void 0,zC=typeof clearTimeout=="function"?clearTimeout:void 0,vv=typeof Promise=="function"?Promise:void 0,_C=typeof queueMicrotask=="function"?queueMicrotask:typeof vv<"u"?function(n){return vv.resolve(null).then(n).catch(EC)}:yv;function EC(n){setTimeout(function(){throw n})}function yi(n){return n==="head"}function xv(n,i){var l=i,d=0;do{var h=l.nextSibling;if(n.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(h),br(i);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Oo(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,Oo(l);for(var g=l.firstChild;g;){var j=g.nextSibling,_=g.nodeName;g[ps]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=j}}else l==="body"&&Oo(n.ownerDocument.body);l=h}while(l);br(i)}function bv(n,i){var l=n;n=0;do{var d=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||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function ph(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":ph(l),Js(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function AC(n,i,l,d){for(;n.nodeType===1;){var h=l;if(n.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[ps])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=Kn(n.nextSibling),n===null)break}return null}function RC(n,i,l){if(i==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=Kn(n.nextSibling),n===null))return null;return n}function Sv(n,i){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Kn(n.nextSibling),n===null))return null;return n}function gh(n){return n.data==="$?"||n.data==="$~"}function yh(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function TC(n,i){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=i;else if(n.data!=="$?"||l.readyState!=="loading")i();else{var d=function(){i(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function Kn(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 vh=null;function jv(n){n=n.nextSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(i===0)return Kn(n.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}n=n.nextSibling}return null}function wv(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 Nv(n,i,l){switch(i=Cc(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 Oo(n){for(var i=n.attributes;i.length;)n.removeAttributeNode(i[0]);Js(n)}var Gn=new Map,Cv=new Set;function kc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Ks=ae.d;ae.d={f:OC,r:LC,D:DC,C:MC,L:$C,m:PC,X:IC,S:UC,M:BC};function OC(){var n=Ks.f(),i=yc();return n||i}function LC(n){var i=Ws(n);i!==null&&i.tag===5&&i.type==="form"?qy(i):Ks.r(n)}var yr=typeof document>"u"?null:document;function kv(n,i,l){var d=yr;if(d&&typeof i=="string"&&i){var h=$n(i);h='link[rel="'+n+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),Cv.has(h)||(Cv.add(h),n={rel:n,crossOrigin:l,href:i},d.querySelector(h)===null&&(i=d.createElement("link"),en(i,"link",n),it(i),d.head.appendChild(i)))}}function DC(n){Ks.D(n),kv("dns-prefetch",n,null)}function MC(n,i){Ks.C(n,i),kv("preconnect",n,i)}function $C(n,i,l){Ks.L(n,i,l);var d=yr;if(d&&n&&i){var h='link[rel="preload"][as="'+$n(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+$n(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+$n(l.imageSizes)+'"]')):h+='[href="'+$n(n)+'"]';var g=h;switch(i){case"style":g=vr(n);break;case"script":g=xr(n)}Gn.has(g)||(n=y({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:n,as:i},l),Gn.set(g,n),d.querySelector(h)!==null||i==="style"&&d.querySelector(Lo(g))||i==="script"&&d.querySelector(Do(g))||(i=d.createElement("link"),en(i,"link",n),it(i),d.head.appendChild(i)))}}function PC(n,i){Ks.m(n,i);var l=yr;if(l&&n){var d=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+$n(d)+'"][href="'+$n(n)+'"]',g=h;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xr(n)}if(!Gn.has(g)&&(n=y({rel:"modulepreload",href:n},i),Gn.set(g,n),l.querySelector(h)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Do(g)))return}d=l.createElement("link"),en(d,"link",n),it(d),l.head.appendChild(d)}}}function UC(n,i,l){Ks.S(n,i,l);var d=yr;if(d&&n){var h=Je(d).hoistableStyles,g=vr(n);i=i||"default";var j=h.get(g);if(!j){var _={loading:0,preload:null};if(j=d.querySelector(Lo(g)))_.loading=5;else{n=y({rel:"stylesheet",href:n,"data-precedence":i},l),(l=Gn.get(g))&&xh(n,l);var M=j=d.createElement("link");it(M),en(M,"link",n),M._p=new Promise(function(F,W){M.onload=F,M.onerror=W}),M.addEventListener("load",function(){_.loading|=1}),M.addEventListener("error",function(){_.loading|=2}),_.loading|=4,zc(j,i,d)}j={type:"stylesheet",instance:j,count:1,state:_},h.set(g,j)}}}function IC(n,i){Ks.X(n,i);var l=yr;if(l&&n){var d=Je(l).hoistableScripts,h=xr(n),g=d.get(h);g||(g=l.querySelector(Do(h)),g||(n=y({src:n,async:!0},i),(i=Gn.get(h))&&bh(n,i),g=l.createElement("script"),it(g),en(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(h,g))}}function BC(n,i){Ks.M(n,i);var l=yr;if(l&&n){var d=Je(l).hoistableScripts,h=xr(n),g=d.get(h);g||(g=l.querySelector(Do(h)),g||(n=y({src:n,async:!0,type:"module"},i),(i=Gn.get(h))&&bh(n,i),g=l.createElement("script"),it(g),en(g,"link",n),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(h,g))}}function zv(n,i,l,d){var h=(h=fe.current)?kc(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=vr(l.href),l=Je(h).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=vr(l.href);var g=Je(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(Lo(n)))&&!g._p&&(j.instance=g,j.state.loading=5),Gn.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},Gn.set(n,l),g||qC(h,n,l,j.state))),i&&d===null)throw Error(a(528,""));return j}if(i&&d!==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=xr(l),l=Je(h).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,n))}}function vr(n){return'href="'+$n(n)+'"'}function Lo(n){return'link[rel="stylesheet"]['+n+"]"}function _v(n){return y({},n,{"data-precedence":n.precedence,precedence:null})}function qC(n,i,l,d){n.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=n.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),en(i,"link",l),it(i),n.head.appendChild(i))}function xr(n){return'[src="'+$n(n)+'"]'}function Do(n){return"script[async]"+n}function Ev(n,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=n.querySelector('style[data-href~="'+$n(l.href)+'"]');if(d)return i.instance=d,it(d),d;var h=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),it(d),en(d,"style",h),zc(d,l.precedence,n),i.instance=d;case"stylesheet":h=vr(l.href);var g=n.querySelector(Lo(h));if(g)return i.state.loading|=4,i.instance=g,it(g),g;d=_v(l),(h=Gn.get(h))&&xh(d,h),g=(n.ownerDocument||n).createElement("link"),it(g);var j=g;return j._p=new Promise(function(_,M){j.onload=_,j.onerror=M}),en(g,"link",d),i.state.loading|=4,zc(g,l.precedence,n),i.instance=g;case"script":return g=xr(l.src),(h=n.querySelector(Do(g)))?(i.instance=h,it(h),h):(d=l,(h=Gn.get(g))&&(d=y({},l),bh(d,h)),n=n.ownerDocument||n,h=n.createElement("script"),it(h),en(h,"link",d),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&&(d=i.instance,i.state.loading|=4,zc(d,l.precedence,n));return i.instance}function zc(n,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=d.length?d[d.length-1]:null,g=h,j=0;j<d.length;j++){var _=d[j];if(_.dataset.precedence===i)g=_;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 xh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.title==null&&(n.title=i.title)}function bh(n,i){n.crossOrigin==null&&(n.crossOrigin=i.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=i.referrerPolicy),n.integrity==null&&(n.integrity=i.integrity)}var _c=null;function Av(n,i,l){if(_c===null){var d=new Map,h=_c=new Map;h.set(l,d)}else h=_c,d=h.get(l),d||(d=new Map,h.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),h=0;h<l.length;h++){var g=l[h];if(!(g[ps]||g[st]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=n+j;var _=d.get(j);_?_.push(g):d.set(j,[g])}}return d}function Rv(n,i,l){n=n.ownerDocument||n,n.head.insertBefore(l,i==="title"?n.querySelector("head > title"):null)}function HC(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 Tv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function KC(n,i,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=vr(d.href),g=i.querySelector(Lo(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=Ec.bind(n),i.then(n,n)),l.state.loading|=4,l.instance=g,it(g);return}g=i.ownerDocument||i,d=_v(d),(h=Gn.get(h))&&xh(d,h),g=g.createElement("link"),it(g);var j=g;j._p=new Promise(function(_,M){j.onload=_,j.onerror=M}),en(g,"link",d),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=Ec.bind(n),i.addEventListener("load",l),i.addEventListener("error",l))}}var Sh=0;function GC(n,i){return n.stylesheets&&n.count===0&&Rc(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&Rc(n,n.stylesheets),n.unsuspend){var g=n.unsuspend;n.unsuspend=null,g()}},6e4+i);0<n.imgBytes&&Sh===0&&(Sh=62500*CC());var h=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&Rc(n,n.stylesheets),n.unsuspend)){var g=n.unsuspend;n.unsuspend=null,g()}},(n.imgBytes>Sh?50:800)+i);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(h)}}:null}function Ec(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Rc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var Ac=null;function Rc(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,Ac=new Map,i.forEach(FC,n),Ac=null,Ec.call(n))}function FC(n,i){if(!(i.state.loading&4)){var l=Ac.get(n);if(l)var d=l.get(null);else{l=new Map,Ac.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),d=j)}d&&l.set(null,d)}h=i.instance,j=h.getAttribute("data-precedence"),g=l.get(j)||d,g===d&&l.set(null,h),l.set(j,h),this.count++,d=Ec.bind(this),h.addEventListener("load",d),h.addEventListener("error",d),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),i.state.loading|=4}}var Mo={$$typeof:A,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function ZC(n,i,l,d,h,g,j,_,M){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=Jr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jr(0),this.hiddenUpdates=Jr(null),this.identifierPrefix=d,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function Ov(n,i,l,d,h,g,j,_,M,F,W,ie){return n=new ZC(n,i,l,j,M,F,W,ie,_),i=1,g===!0&&(i|=24),g=En(3,null,null,i),n.current=g,g.stateNode=n,i=Wd(),i.refCount++,n.pooledCache=i,i.refCount++,g.memoizedState={element:d,isDehydrated:l,cache:i},sf(g),n}function Lv(n){return n?(n=Ya,n):Ya}function Dv(n,i,l,d,h,g){h=Lv(h),d.context===null?d.context=h:d.pendingContext=h,d=ri(i),d.payload={element:l},g=g===void 0?null:g,g!==null&&(d.callback=g),l=oi(n,d,i),l!==null&&(jn(l,n,i),mo(l,n,i))}function Mv(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function jh(n,i){Mv(n,i),(n=n.alternate)&&Mv(n,i)}function $v(n){if(n.tag===13||n.tag===31){var i=Yi(n,67108864);i!==null&&jn(i,n,67108864),jh(n,67108864)}}function Pv(n){if(n.tag===13||n.tag===31){var i=Ln();i=Kt(i);var l=Yi(n,i);l!==null&&jn(l,n,i),jh(n,i)}}var Tc=!0;function VC(n,i,l,d){var h=K.T;K.T=null;var g=ae.p;try{ae.p=2,wh(n,i,l,d)}finally{ae.p=g,K.T=h}}function QC(n,i,l,d){var h=K.T;K.T=null;var g=ae.p;try{ae.p=8,wh(n,i,l,d)}finally{ae.p=g,K.T=h}}function wh(n,i,l,d){if(Tc){var h=Nh(d);if(h===null)ch(n,i,d,Oc,l),Iv(n,d);else if(JC(h,n,i,l,d))d.stopPropagation();else if(Iv(n,d),i&4&&-1<YC.indexOf(n)){for(;h!==null;){var g=Ws(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=hs(g.pendingLanes);if(j!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var M=1<<31-ce(j);_.entanglements[1]|=M,j&=~M}bs(g),(tt&6)===0&&(pc=Qe()+500,Ao(0))}}break;case 31:case 13:_=Yi(g,2),_!==null&&jn(_,g,2),yc(),jh(g,2)}if(g=Nh(d),g===null&&ch(n,i,d,Oc,l),g===h)break;h=g}h!==null&&d.stopPropagation()}else ch(n,i,d,null,l)}}function Nh(n){return n=Cd(n),Ch(n)}var Oc=null;function Ch(n){if(Oc=null,n=Xs(n),n!==null){var i=c(n);if(i===null)n=null;else{var l=i.tag;if(l===13){if(n=u(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 Oc=n,null}function Uv(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(Me()){case Ye:return 2;case Nt:return 8;case Be:case Da:return 32;case pn:return 268435456;default:return 32}default:return 32}}var kh=!1,vi=null,xi=null,bi=null,$o=new Map,Po=new Map,Si=[],YC="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 Iv(n,i){switch(n){case"focusin":case"focusout":vi=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":bi=null;break;case"pointerover":case"pointerout":$o.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Po.delete(i.pointerId)}}function Uo(n,i,l,d,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Ws(i),i!==null&&$v(i)),n):(n.eventSystemFlags|=d,i=n.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),n)}function JC(n,i,l,d,h){switch(i){case"focusin":return vi=Uo(vi,n,i,l,d,h),!0;case"dragenter":return xi=Uo(xi,n,i,l,d,h),!0;case"mouseover":return bi=Uo(bi,n,i,l,d,h),!0;case"pointerover":var g=h.pointerId;return $o.set(g,Uo($o.get(g)||null,n,i,l,d,h)),!0;case"gotpointercapture":return g=h.pointerId,Po.set(g,Uo(Po.get(g)||null,n,i,l,d,h)),!0}return!1}function Bv(n){var i=Xs(n.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){n.blockedOn=i,ms(n.priority,function(){Pv(l)});return}}else if(i===31){if(i=f(l),i!==null){n.blockedOn=i,ms(n.priority,function(){Pv(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 Lc(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=Nh(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);Nd=d,l.target.dispatchEvent(d),Nd=null}else return i=Ws(l),i!==null&&$v(i),n.blockedOn=l,!1;i.shift()}return!0}function qv(n,i,l){Lc(n)&&l.delete(i)}function XC(){kh=!1,vi!==null&&Lc(vi)&&(vi=null),xi!==null&&Lc(xi)&&(xi=null),bi!==null&&Lc(bi)&&(bi=null),$o.forEach(qv),Po.forEach(qv)}function Dc(n,i){n.blockedOn===i&&(n.blockedOn=null,kh||(kh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,XC)))}var Mc=null;function Hv(n){Mc!==n&&(Mc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Mc===n&&(Mc=null);for(var i=0;i<n.length;i+=3){var l=n[i],d=n[i+1],h=n[i+2];if(typeof d!="function"){if(Ch(d||l)===null)continue;break}var g=Ws(l);g!==null&&(n.splice(i,3),i-=3,Nf(g,{pending:!0,data:h,method:l.method,action:d},d,h))}}))}function br(n){function i(M){return Dc(M,n)}vi!==null&&Dc(vi,n),xi!==null&&Dc(xi,n),bi!==null&&Dc(bi,n),$o.forEach(i),Po.forEach(i);for(var l=0;l<Si.length;l++){var d=Si[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Si.length&&(l=Si[0],l.blockedOn===null);)Bv(l),l.blockedOn===null&&Si.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var h=l[d],g=l[d+1],j=h[sn]||null;if(typeof g=="function")j||Hv(l);else if(j){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[sn]||null)_=j.formAction;else if(Ch(h)!==null)continue}else _=j.action;typeof _=="function"?l[d+1]=_:(l.splice(d,3),d-=3),Hv(l)}}}function Kv(){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),d||setTimeout(l,20)}function l(){if(!d&&!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 d=!1,h=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function zh(n){this._internalRoot=n}$c.prototype.render=zh.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,d=Ln();Dv(l,d,n,i,null,null)},$c.prototype.unmount=zh.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Dv(n.current,2,null,n,null,null),yc(),i[zn]=null}};function $c(n){this._internalRoot=n}$c.prototype.unstable_scheduleHydration=function(n){if(n){var i=Ua();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Si.length&&i!==0&&i<Si[l].priority;l++);Si.splice(l,0,n),l===0&&Bv(n)}};var Gv=t.version;if(Gv!=="19.2.4")throw Error(a(527,Gv,"19.2.4"));ae.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 WC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pc.isDisabled&&Pc.supportsFiber)try{ts=Pc.inject(WC),ht=Pc}catch{}}return Bo.createRoot=function(n,i){if(!r(n))throw Error(a(299));var l=!1,d="",h=Xy,g=Wy,j=e0;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=Ov(n,1,!1,null,null,l,d,null,h,g,j,Kv),n[zn]=i.current,lh(n),new zh(i)},Bo.hydrateRoot=function(n,i,l){if(!r(n))throw Error(a(299));var d=!1,h="",g=Xy,j=Wy,_=e0,M=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!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&&(_=l.onRecoverableError),l.formState!==void 0&&(M=l.formState)),i=Ov(n,1,!0,i,l??null,d,h,M,g,j,_,Kv),i.context=Lv(null),l=i.current,d=Ln(),d=Kt(d),h=ri(d),h.callback=null,oi(l,h,d),l=d,i.current.lanes=l,Gi(i,l),bs(i),n[zn]=i.current,lh(n),new $c(i)},Bo.version="19.2.4",Bo}var tx;function ck(){if(tx)return Ah.exports;tx=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(),Ah.exports=lk(),Ah.exports}var uk=ck(),Ea=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(){}},dk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fk=class{#t=dk;#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 fk;function hk(e){setTimeout(e,0)}var Na=typeof window>"u"||"Deno"in globalThis;function rn(){}function mk(e,t){return typeof e=="function"?e(t):e}function mm(e){return typeof e=="number"&&e>=0&&e!==1/0}function pS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ai(e,t){return typeof e=="function"?e(t):e}function Fn(e,t){return typeof e=="function"?e(t):e}function nx(e,t){const{type:s="all",exact:a,fetchStatus:r,predicate:c,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==ep(u,t.options))return!1}else if(!el(t.queryKey,u))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 sx(e,t){const{exact:s,status:a,predicate:r,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(s){if(Ca(t.options.mutationKey)!==Ca(c))return!1}else if(!el(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||r&&!r(t))}function ep(e,t){return(t?.queryKeyHashFn||Ca)(e)}function Ca(e){return JSON.stringify(e,(t,s)=>pm(s)?Object.keys(s).sort().reduce((a,r)=>(a[r]=s[r],a),{}):s)}function el(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(s=>el(e[s],t[s])):!1}var pk=Object.prototype.hasOwnProperty;function tp(e,t,s=0){if(e===t)return e;if(s>500)return t;const a=ix(e)&&ix(t);if(!a&&!(pm(e)&&pm(t)))return t;const c=(a?e:Object.keys(e)).length,u=a?t:Object.keys(t),f=u.length,m=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const y=a?v:u[v],x=e[y],b=t[y];if(x===b){m[y]=x,(a?v<c:pk.call(e,y))&&p++;continue}if(x===null||b===null||typeof x!="object"||typeof b!="object"){m[y]=b;continue}const N=tp(x,b,s+1);m[y]=N,N===x&&p++}return c===f&&p===c?e:m}function tl(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 ix(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pm(e){if(!ax(e))return!1;const t=e.constructor;if(t===void 0)return!0;const s=t.prototype;return!(!ax(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function ax(e){return Object.prototype.toString.call(e)==="[object Object]"}function gk(e){return new Promise(t=>{ha.setTimeout(t,e)})}function gm(e,t,s){return typeof s.structuralSharing=="function"?s.structuralSharing(e,t):s.structuralSharing!==!1?tp(e,t):t}function yk(e,t,s=0){const a=[...e,t];return s&&a.length>s?a.slice(1):a}function vk(e,t,s=0){const a=[t,...e];return s&&a.length>s?a.slice(0,-1):a}var np=Symbol();function gS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===np?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sp(e,t){return typeof e=="function"?e(...t):!!e}function xk(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 bk=class extends Ea{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Na&&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"}},ip=new bk;function ym(){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 Sk=hk;function jk(){let e=[],t=0,s=f=>{f()},a=f=>{f()},r=Sk;const c=f=>{t?e.push(f):r(()=>{s(f)})},u=()=>{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||u()}return m},batchCalls:f=>(...m)=>{c(()=>{f(...m)})},schedule:c,setNotifyFunction:f=>{s=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{r=f}}}var Rt=jk(),wk=class extends Ea{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Na&&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}},yu=new wk;function Nk(e){return Math.min(1e3*2**e,3e4)}function yS(e){return(e??"online")==="online"?yu.isOnline():!0}var vm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function vS(e){let t=!1,s=0,a;const r=ym(),c=()=>r.status!=="pending",u=S=>{if(!c()){const C=new vm(S);x(C),e.onCancel?.(C)}},f=()=>{t=!0},m=()=>{t=!1},p=()=>ip.isFocused()&&(e.networkMode==="always"||yu.isOnline())&&e.canRun(),v=()=>yS(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?.()}),N=()=>{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 R=e.retry??(Na?0:3),A=e.retryDelay??Nk,z=typeof A=="function"?A(s,k):A,O=R===!0||typeof R=="number"&&s<R||typeof R=="function"&&R(s,k);if(t||!O){x(k);return}s++,e.onFail?.(s,k),gk(z).then(()=>p()?void 0:b()).then(()=>{t?x(k):N()})})};return{promise:r,status:()=>r.status,cancel:u,continue:()=>(a?.(),r),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?N():b().then(N),r)}}var xS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mm(this.gcTime)&&(this.#t=ha.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Na?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ha.clearTimeout(this.#t),this.#t=void 0)}},Ck=class extends xS{#t;#e;#n;#i;#s;#a;#o;constructor(e){super(),this.#o=!1,this.#a=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=ox(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.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=ox(this.options);t.data!==void 0&&(this.setState(rx(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const s=gm(this.state.data,e,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),s}setState(e,t){this.#r({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#s?.promise;return this.#s?.cancel(e),t?t.then(rn).catch(rn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Fn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===np||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ai(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:!pS(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.#r({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=gS(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)},u=(()=>{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(u,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#r({type:"fetch",meta:u.fetchOptions?.meta}),this.#s=vS({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof vm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),s.abort()},onFail:(f,m)=>{this.#r({type:"failed",failureCount:f,error:m})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.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 vm){if(f.silent)return this.#s.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#r({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#r(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,...bS(s.data,this.options),fetchMeta:e.meta??null};case"success":const a={...s,...rx(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),Rt.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function bS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function rx(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ox(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 ap=class extends Ea{constructor(e,t){super(),this.options=t,this.#t=e,this.#r=null,this.#o=ym(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#s;#a;#o;#r;#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),lx(this.#e,this.options)?this.#p():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return xm(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return xm(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 Fn(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&&!tl(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&cx(this.#e,s,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==s||Fn(this.options.enabled,this.#e)!==Fn(t.enabled,this.#e)||Ai(this.options.staleTime,this.#e)!==Ai(t.staleTime,this.#e))&&this.#g();const r=this.#y();a&&(this.#e!==s||Fn(this.options.enabled,this.#e)!==Fn(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 zk(this,s)&&(this.#i=s,this.#a=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(rn)),t}#g(){this.#b();const e=Ai(this.options.staleTime,this.#e);if(Na||this.#i.isStale||!mm(e))return;const s=pS(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,!(Na||Fn(this.options.enabled,this.#e)===!1||!mm(this.#l)||this.#l===0)&&(this.#u=ha.setInterval(()=>{(this.options.refetchIntervalInBackground||ip.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,u=this.#a,m=e!==s?e.state:this.#n,{state:p}=e;let v={...p},y=!1,x;if(t._optimisticResults){const L=this.hasListeners(),U=!L&&lx(e,t),X=L&&cx(e,s,t,a);(U||X)&&(v={...v,...bS(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:b,errorUpdatedAt:N,status:S}=v;x=v.data;let C=!1;if(t.placeholderData!==void 0&&x===void 0&&S==="pending"){let L;r?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(L=r.data,C=!0):L=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,L!==void 0&&(S="success",x=gm(r?.data,L,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=gm(r?.data,x,t),this.#d=x,this.#r=null}catch(L){this.#r=L}this.#r&&(b=this.#r,x=this.#d,N=Date.now(),S="error");const k=v.fetchStatus==="fetching",R=S==="pending",A=S==="error",z=R&&k,O=x!==void 0,E={status:S,fetchStatus:v.fetchStatus,isPending:R,isSuccess:S==="success",isError:A,isInitialLoading:z,isLoading:z,data:x,dataUpdatedAt:v.dataUpdatedAt,error:b,errorUpdatedAt:N,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&&!R,isLoadingError:A&&!O,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:A&&O,isStale:rp(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Fn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const L=E.data!==void 0,U=E.status==="error"&&!L,X=ue=>{U?ue.reject(E.error):L&&ue.resolve(E.data)},Q=()=>{const ue=this.#o=E.promise=ym();X(ue)},ee=this.#o;switch(ee.status){case"pending":e.queryHash===s.queryHash&&X(ee);break;case"fulfilled":(U||E.data!==ee.value)&&Q();break;case"rejected":(!U||E.error!==ee.reason)&&Q();break}}return E}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#s=this.#e.state,this.#a=this.options,this.#s.data!==void 0&&(this.#f=this.#e),tl(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(u=>{const f=u;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){Rt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function kk(e,t){return Fn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function lx(e,t){return kk(e,t)||e.state.data!==void 0&&xm(e,t,t.refetchOnMount)}function xm(e,t,s){if(Fn(t.enabled,e)!==!1&&Ai(t.staleTime,e)!=="static"){const a=typeof s=="function"?s(e):s;return a==="always"||a!==!1&&rp(e,t)}return!1}function cx(e,t,s,a){return(e!==t||Fn(a.enabled,e)===!1)&&(!s.suspense||e.state.status!=="error")&&rp(e,s)}function rp(e,t){return Fn(t.enabled,e)!==!1&&e.isStaleByTime(Ai(t.staleTime,e))}function zk(e,t){return!tl(e.getCurrentResult(),t)}function ux(e){return{onFetch:(t,s)=>{const a=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,c=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const y=N=>{xk(N,()=>t.signal,()=>v=!0)},x=gS(t.options,t.fetchOptions),b=async(N,S,C)=>{if(v)return Promise.reject();if(S==null&&N.pages.length)return Promise.resolve(N);const R=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y($),$})(),A=await x(R),{maxPages:z}=t.options,O=C?vk:yk;return{pages:O(N.pages,A,z),pageParams:O(N.pageParams,S,z)}};if(r&&c.length){const N=r==="backward",S=N?_k:dx,C={pages:c,pageParams:u},k=S(a,C);f=await b(C,k,N)}else{const N=e??c.length;do{const S=m===0?u[0]??a.initialPageParam:dx(a,f);if(m>0&&S==null)break;f=await b(f,S),m++}while(m<N)}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 dx(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 _k(e,{pages:t,pageParams:s}){return t.length>0?e.getPreviousPageParam?.(t[0],t,s[0],s):void 0}var Ek=class extends xS{#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||SS(),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=vS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(c,u)=>{this.#s({type:"failed",failureCount:c,error:u})},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 u=await this.options.onMutate?.(e,s);u!==this.state.context&&this.#s({type:"pending",context:u,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(u){Promise.reject(u)}try{await this.options.onError?.(c,e,this.state.context,s)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,s)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,s)}catch(u){Promise.reject(u)}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),Rt.batch(()=>{this.#e.forEach(s=>{s.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function SS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jS=class extends Ea{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 Ek({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=Uc(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=Uc(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=Uc(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=Uc(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Rt.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=>sx(t,s))}findAll(e={}){return this.getAll().filter(t=>sx(e,t))}notify(e){Rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Rt.batch(()=>Promise.all(e.map(t=>t.continue().catch(rn))))}};function Uc(e){return e.options.scope?.id}var Ak=class extends Ea{#t;#e=void 0;#n;#i;constructor(t,s){super(),this.#t=t,this.setOptions(s),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const s=this.options;this.options=this.#t.defaultMutationOptions(t),tl(this.options,s)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),s?.mutationKey&&this.options.mutationKey&&Ca(s.mutationKey)!==Ca(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#s(),this.#a(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#s(),this.#a()}mutate(t,s){return this.#i=s,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#s(){const t=this.#n?.state??SS();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Rt.batch(()=>{if(this.#i&&this.hasListeners()){const s=this.#e.variables,a=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,s,a,r)}catch(c){Promise.reject(c)}try{this.#i.onSettled?.(t.data,null,s,a,r)}catch(c){Promise.reject(c)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,s,a,r)}catch(c){Promise.reject(c)}try{this.#i.onSettled?.(void 0,t.error,s,a,r)}catch(c){Promise.reject(c)}}}this.listeners.forEach(s=>{s(this.#e)})})}};function fx(e,t){const s=new Set(t);return e.filter(a=>!s.has(a))}function Rk(e,t,s){const a=e.slice(0);return a[t]=s,a}var Tk=class extends Ea{#t;#e;#n;#i;#s;#a;#o;#r;#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,Rt.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()),u=s.length!==r.length,f=r.some((v,y)=>v!==s[y]),m=u||f,p=m?!0:c.some((v,y)=>{const x=this.#e[y];return!x||!tl(v,x)});!m&&!p||(m&&(this.#d=a,this.#s=r),this.#e=c,this.hasListeners()&&(m&&(fx(s,r).forEach(v=>{v.destroy()}),fx(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(u=>{u.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,u)=>c!==a[u]));return(!this.#a||this.#e!==this.#r||r||t!==this.#o)&&(this.#o=t,this.#r=this.#e,s!==void 0&&(this.#m=s),this.#a=tp(this.#a,t(e))),this.#a}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),u=t.get(r.queryHash)?.shift()??new ap(this.#t,r);s.push({defaultedQueryOptions:r,observer:u})}),s}#l(e,t){const s=this.#s.indexOf(e);s!==-1&&(this.#e=Rk(this.#e,s,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),s=this.#c(t,this.#i?.combine);e!==s&&Rt.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},Ok=class extends Ea{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,s){const a=t.queryKey,r=t.queryHash??ep(a,t);let c=this.get(r);return c||(c=new Ck({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(){Rt.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=>nx(t,s))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(s=>nx(e,s)):t}notify(e){Rt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Rt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Lk=class{#t;#e;#n;#i;#s;#a;#o;#r;constructor(e={}){this.#t=e.queryCache||new Ok,this.#e=e.mutationCache||new jS,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ip.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#r=yu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#r?.(),this.#r=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(Ai(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,u=mk(t,c);if(u!==void 0)return this.#t.build(this,a).setData(u,{...s,manual:!0})}setQueriesData(e,t,s){return Rt.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;Rt.batch(()=>{t.findAll(e).forEach(s=>{t.remove(s)})})}resetQueries(e,t){const s=this.#t;return Rt.batch(()=>(s.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const s={revert:!0,...t},a=Rt.batch(()=>this.#t.findAll(e).map(r=>r.cancel(s)));return Promise.all(a).then(rn).catch(rn)}invalidateQueries(e,t={}){return Rt.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=Rt.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(rn)),r.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(rn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const s=this.#t.build(this,t);return s.isStaleByTime(Ai(t.staleTime,s))?s.fetch(t):Promise.resolve(s.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(rn).catch(rn)}fetchInfiniteQuery(e){return e.behavior=ux(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rn).catch(rn)}ensureInfiniteQueryData(e){return e.behavior=ux(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yu.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(Ca(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],s={};return t.forEach(a=>{el(e,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(e,t){this.#s.set(Ca(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],s={};return t.forEach(a=>{el(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=ep(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===np&&(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()}},wS=w.createContext(void 0),Pi=e=>{const t=w.useContext(wS);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Dk=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(wS.Provider,{value:e,children:t})),NS=w.createContext(!1),CS=()=>w.useContext(NS);NS.Provider;function Mk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $k=w.createContext(Mk()),kS=()=>w.useContext($k),zS=(e,t,s)=>{const a=s?.state.error&&typeof e.throwOnError=="function"?sp(e.throwOnError,[s.state.error,s]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},_S=e=>{w.useEffect(()=>{e.clearReset()},[e])},ES=({result:e,errorResetBoundary:t,throwOnError:s,query:a,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(r&&e.data===void 0||sp(s,[e.error,a])),AS=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))}},Pk=(e,t)=>e.isLoading&&e.isFetching&&!t,bm=(e,t)=>e?.suspense&&t.isPending,Sm=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function Uk({queries:e,...t},s){const a=Pi(),r=CS(),c=kS(),u=w.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=r?"isRestoring":"optimistic",C}),[e,a,r]);u.forEach(S=>{AS(S);const C=a.getQueryCache().get(S.queryHash);zS(S,c,C)}),_S(c);const[f]=w.useState(()=>new Tk(a,u,t)),[m,p,v]=f.getOptimisticResult(u,t.combine),y=!r&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(S=>y?f.subscribe(Rt.batchCalls(S)):rn,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),w.useEffect(()=>{f.setQueries(u,t)},[u,t,f]);const b=m.some((S,C)=>bm(u[C],S))?m.flatMap((S,C)=>{const k=u[C];if(k&&bm(k,S)){const R=new ap(a,k);return Sm(k,R,c)}return[]}):[];if(b.length>0)throw Promise.all(b);const N=m.find((S,C)=>{const k=u[C];return k&&ES({result:S,errorResetBoundary:c,throwOnError:k.throwOnError,query:a.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(N?.error)throw N.error;return p(v())}function Ik(e,t,s){const a=CS(),r=kS(),c=Pi(),u=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=c.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",AS(u),zS(u,r,f),_S(r);const m=!c.getQueryCache().get(u.queryHash),[p]=w.useState(()=>new t(c,u)),v=p.getOptimisticResult(u),y=!a&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(x=>{const b=y?p.subscribe(Rt.batchCalls(x)):rn;return p.updateResult(),b},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),w.useEffect(()=>{p.setOptions(u)},[u,p]),bm(u,v))throw Sm(u,p,r);if(ES({result:v,errorResetBoundary:r,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(u,v),u.experimental_prefetchInRender&&!Na&&Pk(v,a)&&(m?Sm(u,p,r):f?.promise)?.catch(rn).finally(()=>{p.updateResult()}),u.notifyOnChangeProps?v:p.trackResult(v)}function xa(e,t){return Ik(e,ap)}function hl(e,t){const s=Pi(),[a]=w.useState(()=>new Ak(s,e));w.useEffect(()=>{a.setOptions(e)},[a,e]);const r=w.useSyncExternalStore(w.useCallback(u=>a.subscribe(Rt.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=w.useCallback((u,f)=>{a.mutate(u,f).catch(rn)},[a]);if(r.error&&sp(a.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:c,mutateAsync:r.mutate}}var Ic=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Lh(e){const t=w.useRef({value:e,prev:null}),s=t.current.value;return e!==s&&(t.current={value:e,prev:s}),t.current.prev}function Bk(e,t,s={},a={}){w.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 qk(e){const t=w.useRef(null);return w.useImperativeHandle(e,()=>t.current,[]),t}var Hk=!1;function nl(e){return e[e.length-1]}function Kk(e){return typeof e=="function"}function _i(e,t){return Kk(e)?e(t):e}var Gk=Object.prototype.hasOwnProperty,hx=Object.prototype.propertyIsEnumerable,Fk=()=>Object.create(null),ca=(e,t)=>ma(e,t,Fk);function ma(e,t,s=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const r=t,c=gx(e)&&gx(r);if(!c&&!(vu(e)&&vu(r)))return r;const u=c?e:mx(e);if(!u)return r;const f=c?r:mx(r);if(!f)return r;const m=u.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],N=e[b],S=r[b];if(N===S){v[b]=N,(c?x<m:Gk.call(e,b))&&y++;continue}if(N===null||S===null||typeof N!="object"||typeof S!="object"){v[b]=S;continue}const C=ma(N,S,s,a+1);v[b]=C,C===N&&y++}return m===p&&y===m?e:v}function mx(e){const t=Object.getOwnPropertyNames(e);for(const r of t)if(!hx.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(!hx.call(e,r))return!1;a.push(r)}return a}function vu(e){if(!px(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const s=t.prototype;return!(!px(s)||!s.hasOwnProperty("isPrototypeOf"))}function px(e){return Object.prototype.toString.call(e)==="[object Object]"}function gx(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ba(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(!ba(e[a],t[a],s))return!1;return!0}if(vu(e)&&vu(t)){const a=s?.ignoreUndefined??!0;if(s?.partial){for(const u in t)if((!a||t[u]!==void 0)&&!ba(e[u],t[u],s))return!1;return!0}let r=0;if(!a)r=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&r++;let c=0;for(const u in t)if((!a||t[u]!==void 0)&&(c++,c>r||!ba(e[u],t[u],s)))return!1;return r===c}return!1}function $r(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 sl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function Zk(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function yx(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 Zk(t)}var Vk=["http:","https:","mailto:","tel:"];function xu(e,t){if(!e)return!1;try{const s=new URL(e);return!t.has(s.protocol)}catch{return!1}}function qo(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+=yx(e.slice(s,r.index))+r[0],s=t.lastIndex;a=a+yx(s?e.slice(s):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function Qk(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function bu(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 u=t.get(c);if(u)return r(u),u.value},set(c,u){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=u,r(f);else{const m={key:c,value:u,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 Yk="Invariant failed";function Di(e,t){if(!e)throw new Error(Yk)}var pa=4,RS=5;function Jk(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 op(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 u=Jk(c);if(u){const[f,m]=u,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 Uu(e,t,s,a,r,c,u){u?.(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=op(m,f,t);let N;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 R=r.static?.get(k);if(R)N=R;else{r.static??=new Map;const A=ga(s.fullPath??s.from);A.parent=r,A.depth=c,N=A,r.static.set(k,A)}}else{const R=k.toLowerCase(),A=r.staticInsensitive?.get(R);if(A)N=A;else{r.staticInsensitive??=new Map;const z=ga(s.fullPath??s.from);z.parent=r,z.depth=c,N=z,r.staticInsensitive.set(R,z)}}break}case 1:{const k=m.substring(S,b[1]),R=m.substring(b[4],C),A=v&&!!(k||R),z=k?A?k:k.toLowerCase():void 0,O=R?A?R:R.toLowerCase():void 0,$=!y&&r.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===A&&E.prefix===z&&E.suffix===O);if($)N=$;else{const E=Mh(1,s.fullPath??s.from,A,z,O);N=E,E.depth=c,E.parent=r,r.dynamic??=[],r.dynamic.push(E)}break}case 3:{const k=m.substring(S,b[1]),R=m.substring(b[4],C),A=v&&!!(k||R),z=k?A?k:k.toLowerCase():void 0,O=R?A?R:R.toLowerCase():void 0,$=!y&&r.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===A&&E.prefix===z&&E.suffix===O);if($)N=$;else{const E=Mh(3,s.fullPath??s.from,A,z,O);N=E,E.parent=r,E.depth=c,r.optional??=[],r.optional.push(E)}break}case 2:{const k=m.substring(S,b[1]),R=m.substring(b[4],C),A=v&&!!(k||R),z=k?A?k:k.toLowerCase():void 0,O=R?A?R:R.toLowerCase():void 0,$=Mh(2,s.fullPath??s.from,A,z,O);N=$,$.parent=r,$.depth=c,r.wildcard??=[],r.wildcard.push($)}}r=N}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=RS,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)Uu(e,t,m,f,r,c,u)}function Dh(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 ki(e){if(e.pathless)for(const t of e.pathless)ki(t);if(e.static)for(const t of e.static.values())ki(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ki(t);if(e.dynamic?.length){e.dynamic.sort(Dh);for(const t of e.dynamic)ki(t)}if(e.optional?.length){e.optional.sort(Dh);for(const t of e.optional)ki(t)}if(e.wildcard?.length){e.wildcard.sort(Dh);for(const t of e.wildcard)ki(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 Mh(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 Xk(e,t){const s=ga("/"),a=new Uint16Array(6);for(const r of e)Uu(!1,a,r,1,s,0);ki(s),t.masksTree=s,t.flatCache=bu(1e3)}function Wk(e,t){e||="/";const s=t.flatCache.get(e);if(s)return s;const a=lp(e,t.masksTree);return t.flatCache.set(e,a),a}function ez(e,t,s,a,r){e||="/",a||="/";const c=t?`case\0${e}`:e;let u=r.singleCache.get(c);return u||(u=ga("/"),Uu(t,new Uint16Array(6),{from:e},1,u,0),r.singleCache.set(c,u)),lp(a,u,s)}function tz(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=lp(e,t.segmentTree,s)}catch(u){if(u instanceof URIError)c=null;else throw u}return c&&(c.branch=iz(c.route)),t.matchCache.set(a,c),c}function nz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function sz(e,t=!1,s){const a=ga(e.fullPath),r=new Uint16Array(6),c={},u={};let f=0;return Uu(t,r,e,1,a,0,m=>{if(s?.(m,f),Di(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,f!==0&&m.path){const p=nz(m.fullPath);(!u[p]||m.fullPath.endsWith("/"))&&(u[p]=m)}f++}),ki(a),{processedTree:{segmentTree:a,singleCache:bu(1e3),matchCache:bu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:u}}function lp(e,t,s=!1){const a=e.split("/"),r=rz(e,a,t,s);if(!r)return null;const[c]=TS(e,a,r);return{route:r.node.route,rawParams:c,parsedParams:r.parsedParams}}function TS(e,t,s){const a=az(s.node);let r=null;const c=Object.create(null);let u=s.extract?.part??0,f=s.extract?.node??0,m=s.extract?.path??0,p=s.extract?.segment??0;for(;f<a.length;u++,f++,m++,p++){const v=a[f];if(v.kind===pa)break;if(v.kind===RS){p--,u--,m--;continue}const y=t[u],x=m;if(y&&(m+=y.length),v.kind===1){r??=s.node.fullPath.split("/");const b=r[p],N=v.prefix?.length??0;if(b.charCodeAt(N)===123){const S=v.suffix?.length??0,C=b.substring(N+2,b.length-S-1),k=y.substring(N,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){u--,m=x-1;continue}r??=s.node.fullPath.split("/");const b=r[p],N=v.prefix?.length??0,S=v.suffix?.length??0,C=b.substring(N+3,b.length-S-1),k=v.suffix||v.prefix?y.substring(N,y.length-S):y;k&&(c[C]=decodeURIComponent(k))}else if(v.kind===2){const b=v,N=e.substring(x+(b.prefix?.length??0),e.length-(b.suffix?.length??0)),S=decodeURIComponent(N);c["*"]=S,c._splat=S;break}}return s.rawParams&&Object.assign(c,s.rawParams),[c,{part:u,node:f,path:m,segment:p}]}function iz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function az(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function rz(e,t,s,a){if(e==="/"&&s.index)return{node:s.index,skipped:0};const r=!nl(t),c=r&&e!=="/",u=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:N,depth:S,statics:C,dynamics:k,optionals:R}=y;let{extract:A,rawParams:z,parsedParams:O}=y;if(x.skipOnParamError){if(!$h(e,t,y))continue;z=y.rawParams,A=y.extract,O=y.parsedParams}a&&x.route&&x.kind!==pa&&Ho(p,y)&&(p=y);const $=b===u;if($&&(x.route&&!c&&Ho(v,y)&&(v=y),!x.optional&&!x.wildcard&&!x.index&&!x.pathless))continue;const E=$?void 0:t[b];let L;if($&&x.index){const U={node:x.index,index:b,skipped:N,depth:S+1,statics:C,dynamics:k,optionals:R,extract:A,rawParams:z,parsedParams:O};let X=!0;if(x.index.skipOnParamError&&($h(e,t,U)||(X=!1)),X){if(C===u&&!k&&!R&&!N)return U;Ho(v,U)&&(v=U)}}if(x.wildcard&&Ho(m,y))for(const U of x.wildcard){const{prefix:X,suffix:Q}=U;if(X&&($||!(U.caseSensitive?E:L??=E.toLowerCase()).startsWith(X)))continue;if(Q){if($)continue;const ue=t.slice(b).join("/").slice(-Q.length);if((U.caseSensitive?ue:ue.toLowerCase())!==Q)continue}const ee={node:U,index:u,skipped:N,depth:S,statics:C,dynamics:k,optionals:R,extract:A,rawParams:z,parsedParams:O};if(!(U.skipOnParamError&&!$h(e,t,ee))){m=ee;break}}if(x.optional){const U=N|1<<S,X=S+1;for(let Q=x.optional.length-1;Q>=0;Q--){const ee=x.optional[Q];f.push({node:ee,index:b,skipped:U,depth:X,statics:C,dynamics:k,optionals:R,extract:A,rawParams:z,parsedParams:O})}if(!$)for(let Q=x.optional.length-1;Q>=0;Q--){const ee=x.optional[Q],{prefix:ue,suffix:Ee}=ee;if(ue||Ee){const we=ee.caseSensitive?E:L??=E.toLowerCase();if(ue&&!we.startsWith(ue)||Ee&&!we.endsWith(Ee))continue}f.push({node:ee,index:b+1,skipped:N,depth:X,statics:C,dynamics:k,optionals:R+1,extract:A,rawParams:z,parsedParams:O})}}if(!$&&x.dynamic&&E)for(let U=x.dynamic.length-1;U>=0;U--){const X=x.dynamic[U],{prefix:Q,suffix:ee}=X;if(Q||ee){const ue=X.caseSensitive?E:L??=E.toLowerCase();if(Q&&!ue.startsWith(Q)||ee&&!ue.endsWith(ee))continue}f.push({node:X,index:b+1,skipped:N,depth:S+1,statics:C,dynamics:k+1,optionals:R,extract:A,rawParams:z,parsedParams:O})}if(!$&&x.staticInsensitive){const U=x.staticInsensitive.get(L??=E.toLowerCase());U&&f.push({node:U,index:b+1,skipped:N,depth:S+1,statics:C+1,dynamics:k,optionals:R,extract:A,rawParams:z,parsedParams:O})}if(!$&&x.static){const U=x.static.get(E);U&&f.push({node:U,index:b+1,skipped:N,depth:S+1,statics:C+1,dynamics:k,optionals:R,extract:A,rawParams:z,parsedParams:O})}if(x.pathless){const U=S+1;for(let X=x.pathless.length-1;X>=0;X--){const Q=x.pathless[X];f.push({node:Q,index:b,skipped:N,depth:U,statics:C,dynamics:k,optionals:R,extract:A,rawParams:z,parsedParams:O})}}}if(v&&m)return Ho(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 $h(e,t,s){try{const[a,r]=TS(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 Ho(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 ou(e){return cp(e.filter(t=>t!==void 0).join("/"))}function cp(e){return e.replace(/\/{2,}/g,"/")}function OS(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ri(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function LS(e){return Ri(OS(e))}function Su(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function oz(e,t,s){return Su(e,s)===Su(t,s)}function lz({base:e,to:t,trailingSlash:s="never",cache:a}){const r=t.startsWith("/"),c=!r&&t===".";let u;if(a){u=r?t:c?e:e+"\0"+t;const y=a.get(u);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&&nl(f)==="";)f.pop();const y=t.split("/");for(let x=0,b=y.length;x<b;x++){const N=y[x];N===""?x?x===b-1&&f.push(N):f=[N]:N===".."?f.pop():N==="."||f.push(N)}}f.length>1&&(nl(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=op(x,0,m);const b=m[0];if(b===0){p+=x;continue}const N=m[5],S=x.substring(0,m[1]),C=x.substring(m[4],N),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=cp(p);const v=p||"/";return u&&a&&a.set(u,v),v}function cz(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 Ph(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=>xx(r,s)).join("/"):xx(a,s)}function vx({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 u=e.length;let f=0,m,p="";for(;f<u;){const v=f;m=op(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 N=e.substring(v,m[1]),S=e.substring(m[4],y);if(!b){r=!0,(N||S)&&(p+="/"+N+S);continue}const C=Ph("_splat",t,s);p+="/"+N+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 N=e.substring(v,m[1]),S=e.substring(m[4],y),C=Ph(b,t,s)??"undefined";p+="/"+N+C+S;continue}if(x===3){const b=e.substring(m[2],m[3]),N=t[b];if(N==null)continue;c[b]=N;const S=e.substring(v,m[1]),C=e.substring(m[4],y),k=Ph(b,t,s)??"";p+="/"+S+k+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:r}}function xx(e,t){const s=encodeURIComponent(e);return t?.(s)??s}function hn(e){return!!e?.isNotFound}function uz(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var jm="tsr-scroll-restoration-v1_3",dz=(e,t)=>{let s;return(...a)=>{s||(s=setTimeout(()=>{e(...a),s=null},t))}};function fz(){const e=uz();if(!e)return null;const t=e.getItem(jm);let s=t?JSON.parse(t):{};return{state:s,set:a=>{s=_i(a,s)||s;try{e.setItem(jm,JSON.stringify(s))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Bc=fz(),hz=e=>e.state.__TSR_key||e.href;function mz(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 ju=!1;function pz({storageKey:e,key:t,behavior:s,shouldScrollRestoration:a,scrollToTopSelectors:r,location:c}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,m=u[f];ju=!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)}}ju=!1}function gz(e,t){if(!Bc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Bc))return;e.isScrollRestorationSetup=!0,ju=!1;const s=e.options.getScrollRestorationKey||hz;window.history.scrollRestoration="manual";const a=r=>{if(ju||!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=mz(r.target)}const u=s(e.state.location);Bc.set(f=>{const m=f[u]||={},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",dz(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})||(pz({storageKey:jm,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Bc.set(u=>(u[c]||={},u)))})}function yz(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 vz(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 Uh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function xz(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]=Uh(r):Array.isArray(c)?c.push(Uh(r)):s[a]=[c,Uh(r)]}return s}var bz=jz(JSON.parse),Sz=wz(JSON.stringify,JSON.parse);function jz(e){return t=>{t[0]==="?"&&(t=t.substring(1));const s=xz(t);for(const a in s){const r=s[a];if(typeof r=="string")try{s[a]=e(r)}catch{}}return s}}function wz(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=vz(r,a);return c?`?${c}`:""}}var Sa="__root__";function up(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 wn(e){return e instanceof Response&&!!e.options}function Nz(e){return{input:({url:t})=>{for(const s of e)t=wm(s,t);return t},output:({url:t})=>{for(let s=e.length-1;s>=0;s--)t=DS(e[s],t);return t}}}function Cz(e){const t=LS(e.basepath),s=`/${t}`,a=`${s}/`,r=e.caseSensitive?s:s.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===r?u.pathname="/":f.startsWith(c)&&(u.pathname=u.pathname.slice(s.length)),u},output:({url:u})=>(u.pathname=ou(["/",t,u.pathname]),u)}}function wm(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 DS(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 jt=(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))(jt||{});function MS({update:e,notify:t,unwatched:s}){return{link:a,unlink:r,propagate:c,checkDirty:u,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 N=p.subsTail;if(N!==void 0&&N.version===y&&N.sub===v)return;const S=v.depsTail=p.subsTail={version:y,dep:p,sub:v,prevDep:x,nextDep:b,prevSub:N,nextSub:void 0};b!==void 0&&(b.prevDep=S),x!==void 0?x.nextDep=S:v.deps=S,N!==void 0?N.nextSub=S:p.subs=S}function r(p,v=p.sub){const y=p.dep,x=p.prevDep,b=p.nextDep,N=p.nextSub,S=p.prevSub;return b!==void 0?b.prevDep=x:v.depsTail=x,x!==void 0?x.nextDep=b:v.deps=b,N!==void 0?N.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=N:(y.subs=N)===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 N=x.subs;if(N!==void 0){const S=(p=N).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 u(p,v){let y,x=0,b=!1;e:do{const N=p.dep,S=N.flags;if(v.flags&16)b=!0;else if((S&17)===17){if(e(N)){const C=N.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=N.deps,v=N,++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 R=p.nextDep;if(R!==void 0){p=R;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 dp=0,ua=0,Yo=0;const Fs=[],{link:nP,unlink:$S,propagate:sP,checkDirty:kz,shallowPropagate:iP}=MS({update(e){return e.depsTail!==void 0?Az(e):Rz(e)},notify(e){let t=Yo,s=t;do if(Fs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Yo=t;s<--t;){const a=Fs[s];Fs[s++]=Fs[t],Fs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Iu(e)):Lz.call(e)}});function zz(){return dp}function _z(){++dp}function Ez(){--dp||Oz()}function Az(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Iu(e)}}function Rz(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Tz(e){const t=e.flags;if(t&16||t&32&&kz(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Iu(e)}}else e.flags=2}function Oz(){try{for(;ua<Yo;){const e=Fs[ua];Fs[ua++]=void 0,Tz(e)}}finally{for(;ua<Yo;){const e=Fs[ua];Fs[ua++]=void 0,e.flags|=10}ua=0,Yo=0}}function Lz(){this.depsTail=void 0,this.flags=0,Iu(this);const e=this.subs;e!==void 0&&$S(e)}function Iu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=$S(s,e)}function fp(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 Nm=[];let lu=0;const{link:bx,unlink:Dz,propagate:Mz,checkDirty:PS,shallowPropagate:Sx}=MS({update(e){return e._update()},notify(e){Nm[Cm++]=e,e.flags&=~jt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=jt.Mutable|jt.Dirty,wu(e))}});let qc=0,Cm=0,Ss;function wu(e){const t=e.depsTail;let s=t!==void 0?t.nextDep:e.deps;for(;s!==void 0;)s=Dz(s,e)}function US(){if(!(zz()>0)){for(;qc<Cm;){const e=Nm[qc];Nm[qc++]=void 0,e.notify()}qc=0,Cm=0}}function IS(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?jt.None:jt.Mutable,get(){return Ss!==void 0&&bx(r,Ss,lu),r._snapshot},subscribe(c){const u=fp(c),f={current:!1},m=$z(()=>{r.get(),f.current?u.next?.(r._snapshot):f.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(c){const u=Ss,f=Object.is;if(s)Ss=r,++lu,r.depsTail=void 0;else if(c===void 0)return!1;s&&(r.flags=jt.Mutable|jt.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{Ss=u,s&&(r.flags&=~jt.RecursedCheck),wu(r)}}};return s?(r.flags=jt.Mutable|jt.Dirty,r.get=function(){const c=r.flags;if(c&jt.Dirty||c&jt.Pending&&PS(r.deps,r)){if(r._update()){const u=r.subs;u!==void 0&&Sx(u)}}else c&jt.Pending&&(r.flags=c&~jt.Pending);return Ss!==void 0&&bx(r,Ss,lu),r._snapshot}):r.set=function(c){if(r._update(c)){const u=r.subs;u!==void 0&&(Mz(u),Sx(u),US())}},r}function $z(e){const t=()=>{const a=Ss;Ss=s,++lu,s.depsTail=void 0,s.flags=jt.Watching|jt.RecursedCheck;try{return e()}finally{Ss=a,s.flags&=~jt.RecursedCheck,wu(s)}},s={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:jt.Watching|jt.RecursedCheck,notify(){const a=this.flags;a&jt.Dirty||a&jt.Pending&&PS(this.deps,this)?t():this.flags=jt.Watching},stop(){this.flags=jt.None,this.depsTail=void 0,wu(this)}};return t(),s}class Pz{constructor(t){this.atom=IS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(fp(t))}}class Uz{constructor(t){this.atom=IS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(fp(t))}}function Iz(e){return typeof e=="function"?new Uz(e):new Pz(e)}function Bz(e){try{_z(),e()}finally{Ez(),US()}}function Jo(e){let t;return Bz(()=>{t=e()}),t}var km=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Bu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(s=>s.id===t)),ja=(e,t,s=!0)=>{const a={...e.router.options.context??{}},r=s?t:t-1;for(let c=0;c<=r;c++){const u=e.matches[c];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(a,f.__routeContext,f.__beforeLoadContext)}return a},jx=(e,t)=>{if(!e.matches.length)return;const s=t.routeId,a=e.matches.findIndex(u=>u.routeId===e.router.routeTree.id),r=a>=0?a:0;let c=s?e.matches.findIndex(u=>u.routeId===s):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=r);for(let u=c;u>=0;u--){const f=e.matches[u];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return u}return s?c:r},Ei=(e,t,s)=>{if(!(!wn(s)&&!hn(s)))throw wn(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:wn(s)?"redirected":a.status==="pending"?"success":a.status,context:ja(e,t.index),isFetching:!1,error:s})),hn(s)&&!s.routeId&&(s.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),wn(s)&&(e.rendered=!0,s.options._fromLocation=e.location,s.redirectHandled=!0,s=e.router.resolveRedirect(s))),s},BS=(e,t)=>{const s=e.router.getMatch(t);return!!(!s||s._nonReactive.dehydrated)},wx=(e,t,s)=>{const a=ja(e,s);e.updateMatch(t,r=>({...r,context:a}))},Ko=(e,t,s,a)=>{const{id:r,routeId:c}=e.matches[t],u=e.router.looseRoutesById[c];if(s instanceof Promise)throw s;s.routerCode=a,e.firstBadMatchIndex??=t,Ei(e,e.router.getMatch(r),s);try{u.options.onError?.(s)}catch(f){s=f,Ei(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&&!wn(s)&&!hn(s)&&(e.serialError??=s)},qS=(e,t,s,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const r=s.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Bu(e,t)&&(s.options.loader||s.options.beforeLoad||KS(s))&&typeof r=="number"&&r!==1/0&&(s.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{km(e)},r);a._nonReactive.pendingTimeout=c}},qz=(e,t,s)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;qS(e,t,s,a);const r=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ei(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(r):r()},Hz=(e,t,s,a)=>{const r=e.router.getMatch(t);let c=r._nonReactive.loadPromise;r._nonReactive.loadPromise=$r(()=>{c?.resolve(),c=void 0});const{paramsError:u,searchError:f}=r;u&&Ko(e,s,u,"PARSE_PARAMS"),f&&Ko(e,s,f,"VALIDATE_SEARCH"),qS(e,t,a,r);const m=new AbortController;let p=!1;const v=()=>{p||(p=!0,e.updateMatch(t,z=>({...z,isFetching:"beforeLoad",fetchCount:z.fetchCount+1,abortController:m})))},y=()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){Jo(()=>{v(),y()});return}r._nonReactive.beforeLoadPromise=$r();const x={...ja(e,s,!1),...r.__routeContext},{search:b,params:N,cause:S}=r,C=Bu(e,t),k={search:b,abortController:m,params:N,preload:C,context:x,location:e.location,navigate:z=>e.router.navigate({...z,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:C?"preload":S,matches:e.matches,routeId:a.id,...e.router.options.additionalContext},R=z=>{if(z===void 0){Jo(()=>{v(),y()});return}(wn(z)||hn(z))&&(v(),Ko(e,s,z,"BEFORE_LOAD")),Jo(()=>{v(),e.updateMatch(t,O=>({...O,__beforeLoadContext:z})),y()})};let A;try{if(A=a.options.beforeLoad(k),sl(A))return v(),A.catch(z=>{Ko(e,s,z,"BEFORE_LOAD")}).then(R)}catch(z){v(),Ko(e,s,z,"BEFORE_LOAD")}R(A)},Kz=(e,t)=>{const{id:s,routeId:a}=e.matches[t],r=e.router.looseRoutesById[a],c=()=>f(),u=()=>Hz(e,s,t,r),f=()=>{if(BS(e,s))return;const m=qz(e,s,r);return sl(m)?m.then(u):u()};return c()},Gz=(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,u,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:u,styles:c?.styles}))},HS=(e,t,s,a,r)=>{const c=t[a-1],{params:u,loaderDeps:f,abortController:m,cause:p}=e.router.getMatch(s),v=ja(e,a),y=Bu(e,s);return{params:u,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}},Nx=async(e,t,s,a,r)=>{try{const c=e.router.getMatch(s);try{(!(Hk??e.router.isServer)||c.ssr===!0)&&il(r);const u=r.options.loader,f=typeof u=="function"?u:u?.handler,m=f?.(HS(e,t,s,a,r)),p=!!f&&sl(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;Ei(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:ja(e,a),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(u){let f=u;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:ja(e,a)}));return}const m=c._nonReactive.minPendingPromise;m&&await m,hn(u)&&await r.options.notFoundComponent?.preload?.(),Ei(e,e.router.getMatch(s),u);try{r.options.onError?.(u)}catch(p){f=p,Ei(e,e.router.getMatch(s),p)}!wn(f)&&!hn(f)&&await il(r,["errorComponent"]),e.updateMatch(s,p=>({...p,error:f,context:ja(e,a),status:"error",isFetching:!1}))}}catch(c){const u=e.router.getMatch(s);u&&(u._nonReactive.loaderPromise=void 0),Ei(e,u,c)}},Fz=async(e,t,s)=>{async function a(b,N,S,C,k){const R=Date.now()-N.updatedAt,A=b?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,z=k.options.shouldReload,O=typeof z=="function"?z(HS(e,t,r,s,k)):z,{status:$,invalid:E}=C,L=R>A&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);u=$==="success"&&(E||(O??L)),b&&k.options.preload===!1||(u&&!e.sync&&v?(f=!0,(async()=>{try{await Nx(e,t,r,s,k);const U=e.router.getMatch(r);U._nonReactive.loaderPromise?.resolve(),U._nonReactive.loadPromise?.resolve(),U._nonReactive.loaderPromise=void 0,U._nonReactive.loadPromise=void 0}catch(U){wn(U)&&await e.router.navigate(U.options)}})()):$!=="success"||u?await Nx(e,t,r,s,k):wx(e,r,s))}const{id:r,routeId:c}=e.matches[s];let u=!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(BS(e,r)){if(!e.router.getMatch(r))return e.matches[s];wx(e,r,s)}else{const b=e.router.getMatch(r),N=e.router.state.matches[s]?.routeId===c?e.router.state.matches[s].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Bu(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&&Ei(e,C,k),C.status==="pending"&&await a(S,b,N,C,m)}else{const C=S&&!e.router.state.matches.some(R=>R.id===r),k=e.router.getMatch(r);k._nonReactive.loaderPromise=$r(),C!==k.preload&&e.updateMatch(r,R=>({...R,preload:C})),await a(S,b,N,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 Cx(e){const t=e,s=[];t.router.state.matches.some(x=>x._forcePending)&&km(t);let a;for(let x=0;x<t.matches.length;x++){try{const b=Kz(t,x);sl(b)&&await b}catch(b){if(wn(b))throw b;if(hn(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?jx(t,a):void 0,u=a&&t.preload?0:c!==void 0?Math.min(c+1,r):r;let f,m;for(let x=0;x<u;x++)s.push(Fz(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 N=b.reason;if(wn(N))throw N;hn(N)?f??=N:m??=N}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=jx(t,p);Di(x!==void 0);const b=t.matches[x],N=t.router.looseRoutesById[b.routeId],S=t.router.options?.defaultNotFoundComponent;!N.options.notFoundComponent&&S&&(N.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 il(N,["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 il(x,["errorComponent"])}for(let x=0;x<=v;x++){const{id:b,routeId:N}=t.matches[x],S=t.router.looseRoutesById[N];try{const C=Gz(t,b,S);if(C){const k=await C;t.updateMatch(b,R=>({...R,...k}))}}catch(C){console.error(`Error executing head for route ${N}:`,C)}}const y=km(t);if(sl(y)&&await y,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function kx(e,t){const s=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(s.length!==0)return Promise.all(s)}function il(e,t=cu){!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===cu?(()=>{if(e._componentsPromise===void 0){const a=kx(e,cu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():kx(e,t);return e._lazyPromise?e._lazyPromise.then(s):s()}function KS(e){for(const t of cu)if(e.options[t]?.preload)return!0;return!1}var cu=["component","errorComponent","pendingComponent","notFoundComponent"],Ti="__TSR_index",zx="popstate",_x="beforeunload";function Zz(e){let t=e.getLocation();const s=new Set,a=u=>{t=e.getLocation(),s.forEach(f=>f({location:t,action:u}))},r=u=>{e.notifyOnIndexChange??!0?a(u):t=e.getLocation()},c=async({task:u,navigateOpts:f,...m})=>{if(f?.ignoreBlocker??!1){u();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=Nu(m.path,m.state);if(await y.blockerFn({currentLocation:t,nextLocation:x,action:m.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:s,subscribe:u=>(s.add(u),()=>{s.delete(u)}),push:(u,f,m)=>{const p=t.state[Ti];f=Ex(p+1,f),c({task:()=>{e.pushState(u,f),a({type:"PUSH"})},navigateOpts:m,type:"PUSH",path:u,state:f})},replace:(u,f,m)=>{const p=t.state[Ti];f=Ex(p,f),c({task:()=>{e.replaceState(u,f),a({type:"REPLACE"})},navigateOpts:m,type:"REPLACE",path:u,state:f})},go:(u,f)=>{c({task:()=>{e.go(u),r({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{c({task:()=>{e.back(u?.ignoreBlocker??!1),r({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{c({task:()=>{e.forward(u?.ignoreBlocker??!1),r({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Ti]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const m=e.getBlockers?.()??[];e.setBlockers?.(m.filter(p=>p!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:a}}function Ex(e,t){t||(t={});const s=hp();return{...t,key:s,__TSR_key:s,[Ti]:e}}function Vz(e){const t=typeof document<"u"?window:void 0,s=t.history.pushState,a=t.history.replaceState;let r=[];const c=()=>r,u=L=>r=L,f=(L=>L),m=(()=>Nu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const L=hp();t.history.replaceState({[Ti]:0,key:L,__TSR_key:L},"")}let p=m(),v,y=!1,x=!1,b=!1,N=!1;const S=()=>p;let C,k;const R=()=>{C&&(E._ignoreSubscribers=!0,(C.isPush?t.history.pushState:t.history.replaceState)(C.state,"",C.href),E._ignoreSubscribers=!1,C=void 0,k=void 0,v=void 0)},A=(L,U,X)=>{const Q=f(U);k||(v=p),p=Nu(U,X),C={href:Q,state:X,isPush:C?.isPush||L==="push"},k||(k=Promise.resolve().then(()=>R()))},z=L=>{p=m(),E.notify({type:L})},O=async()=>{if(x){x=!1;return}const L=m(),U=L.state[Ti]-p.state[Ti],X=U===1,Q=U===-1,ee=!X&&!Q||y;y=!1;const ue=ee?"GO":Q?"BACK":"FORWARD",Ee=ee?{type:"GO",index:U}:{type:Q?"BACK":"FORWARD"};if(b)b=!1;else{const we=c();if(typeof document<"u"&&we.length){for(const K of we)if(await K.blockerFn({currentLocation:p,nextLocation:L,action:ue})){x=!0,t.history.go(1),E.notify(Ee);return}}}p=m(),E.notify(Ee)},$=L=>{if(N){N=!1;return}let U=!1;const X=c();if(typeof document<"u"&&X.length)for(const Q of X){const ee=Q.enableBeforeUnload??!0;if(ee===!0){U=!0;break}if(typeof ee=="function"&&ee()===!0){U=!0;break}}if(U)return L.preventDefault(),L.returnValue=""},E=Zz({getLocation:S,getLength:()=>t.history.length,pushState:(L,U)=>A("push",L,U),replaceState:(L,U)=>A("replace",L,U),back:L=>(L&&(b=!0),N=!0,t.history.back()),forward:L=>{L&&(b=!0),N=!0,t.history.forward()},go:L=>{y=!0,t.history.go(L)},createHref:L=>f(L),flush:R,destroy:()=>{t.history.pushState=s,t.history.replaceState=a,t.removeEventListener(_x,$,{capture:!0}),t.removeEventListener(zx,O)},onBlocked:()=>{v&&p!==v&&(p=v)},getBlockers:c,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(_x,$,{capture:!0}),t.addEventListener(zx,O),t.history.pushState=function(...L){const U=s.apply(t.history,L);return E._ignoreSubscribers||z("PUSH"),U},t.history.replaceState=function(...L){const U=a.apply(t.history,L);return E._ignoreSubscribers||z("REPLACE"),U},E}function Qz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Nu(e,t){const s=Qz(e),a=s.indexOf("#"),r=s.indexOf("?"),c=hp();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||{[Ti]:0,key:c,__TSR_key:c}}}function hp(){return(Math.random()+1).toString(36).substring(7)}function wa(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 Yz(e){const t=e.filter(s=>s.status!=="redirected");return t.length===e.length?e:t}var Jz=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=cz(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Vz()),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=bu(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=Iz(Wz(this.latestLocation)),gz(this));let u=!1;const f=this.options.basepath??"/",m=this.options.rewrite;if(r||a!==f||c!==m){this.basepath=f;const p=[],v=LS(f);v&&v!=="/"&&p.push(Cz({basepath:f})),m&&p.push(m),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Nz(p),this.history&&this.updateLatestLocation(),u=!0}u&&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=sz(this.routeTree,this.options.caseSensitive,(s,a)=>{s.init({originalIndex:a})});return this.options.routeMasks&&Xk(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:qo(f).path,external:!1,searchStr:k,search:ca(s?.search,C),hash:qo(p.slice(1)).path,state:ma(s?.state,y)}}const x=new URL(v,this.origin),b=wm(this.rewrite,x),N=this.options.parseSearch(b.search),S=this.options.stringifySearch(N);return b.search=S,{href:b.href.replace(b.origin,""),publicHref:v,pathname:qo(b.pathname).path,external:!!this.rewrite&&b.origin!==this.origin,searchStr:S,search:ca(s?.search,N),hash:qo(b.hash.slice(1)).path,state:ma(s?.state,y)}},r=a(t),{__tempLocation:c,__tempKey:u}=r.state;if(c&&(!u||u===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)=>lz({base:t,to:cp(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=>e_({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,u=this.matchRoutesLightweight(c);r.from;const f=r.unsafeRelative==="path"?c.pathname:r.from??u.fullPath,m=this.resolvePathWithBase(f,"."),p=u.search,v=Object.assign(Object.create(null),u.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,_i(r.params,v)),b=this.getMatchedRoutes(y);let N=b.matchedRoutes;if((!b.foundRoute||b.foundRoute.path!=="/"&&b.routeParams["**"])&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]),Object.keys(x).length>0)for(const U of N){const X=U.options.params?.stringify??U.options.stringifyParams;if(X)try{Object.assign(x,X(x))}catch{}}const S=t.leaveParams?y:qo(vx({path:y,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=p;if(t._includeValidateSearch&&this.options.search?.strict){const U={};N.forEach(X=>{if(X.options.validateSearch)try{Object.assign(U,uu(X.options.validateSearch,{...U,...C}))}catch{}}),C=U}C=t_({search:C,dest:r,destRoutes:N,_includeValidateSearch:t._includeValidateSearch}),C=ca(p,C);const k=this.options.stringifySearch(C),R=r.hash===!0?c.hash:r.hash?_i(r.hash,c.hash):void 0,A=R?`#${R}`:"";let z=r.state===!0?c.state:r.state?_i(r.state,c.state):{};z=ma(c.state,z);const O=`${S}${k}${A}`;let $,E,L=!1;if(this.rewrite){const U=new URL(O,this.origin),X=DS(this.rewrite,U);$=U.href.replace(U.origin,""),X.origin!==this.origin?(E=X.href,L=!0):E=X.pathname+X.search+X.hash}else $=Qk(O),E=$;return{publicHref:E,href:$,pathname:S,search:C,searchStr:k,state:z,hash:R??"",external:L,unmaskOnReload:r.unmaskOnReload}},a=(r={},c)=>{const u=s(r);let f=c?s(c):void 0;if(!f){const m=Object.create(null);if(this.options.routeMasks){const p=Wk(u.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,_i(y,m));c={from:t.from,...x,params:b},f=s(c)}}}return f&&(u.maskedLocation=f),u};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=ba(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),m},c=Ri(this.latestLocation.href)===Ri(a.href);let u=this.commitLocationPromise;if(this.commitLocationPromise=$r(()=>{u?.resolve(),u=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:u,...f}={})=>{if(u){const v=this.history.location.state.__TSR_index,y=Nu(u,{__TSR_index:t?v:v+1}),x=new URL(y.pathname,this.origin);f.to=wm(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 u=!1;if(a)try{new URL(`${a}`),u=!0}catch{}if(u&&!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=!u&&r?r:a;if(xu(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",...wa({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...wa({resolvedLocation:p,location:m})}),await Cx({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=[];Jo(()=>{this.__store.setState(N=>{const S=N.matches,C=N.pendingMatches||N.matches;return v=S.filter(k=>!C.some(R=>R.id===k.id)),y=S.filter(k=>!C.some(R=>R.routeId===k.routeId)),x=C.filter(k=>!S.some(R=>R.routeId===k.routeId)),b=C.filter(k=>S.some(R=>R.routeId===k.routeId)),{...N,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...N.cachedMatches,...v.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[x,"onEnter"],[b,"onStay"]].forEach(([N,S])=>{N.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(m){wn(m)?(s=m,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):hn(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 u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(f=>f.status==="error")&&(u=500),u!==void 0&&this.__store.setState(f=>({...f,statusCode:u}))},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,u=typeof s.types=="function"?s.types(wa({resolvedLocation:c,location:r})):s.types;if(u===!1){t();return}a={update:t,types:u}}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:Yz(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&&xu(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=il,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(u=>u.id)),c=new Set([...r,...this.state.cachedMatches.map(u=>u.id)]);Jo(()=>{a.forEach(u=>{c.has(u.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,u]}))})});try{return a=await Cx({router:this,matches:a,location:s,preload:!0,updateMatch:(u,f)=>{r.has(u)?a=a.map(m=>m.id===u?f(m):m):this.updateMatch(u,f)}}),a}catch(u){if(wn(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:s});hn(u)||console.error(u);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,u=ez(r.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,c.pathname,this.processedTree);return!u||t.params&&!ba(u.rawParams,t.params,{partial:!0})?!1:s?.includeSearch??!0?ba(c.search,r.search,{partial:!0})?u.rawParams:!1:u.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??Sz,parseSearch:e.parseSearch??bz,protocolAllowlist:e.protocolAllowlist??Vk}),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:u}=s,f=!1;(a?a.path!=="/"&&r["**"]:Ri(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const m=f?s_(this.options.notFoundMode,u):void 0,p=new Array(u.length),v=new Map(this.state.matches.map(y=>[y.routeId,y]));for(let y=0;y<u.length;y++){const x=u[y],b=p[y-1];let N,S,C;{const ue=b?.search??e.search,Ee=b?._strictSearch??void 0;try{const we=uu(x.options.validateSearch,{...ue})??void 0;N={...ue,...we},S={...Ee,...we},C=void 0}catch(we){let K=we;if(we instanceof Cu||(K=new Cu(we.message,{cause:we})),t?.throwOnError)throw K;N=ue,S={},C=K}}const k=x.options.loaderDeps?.({search:N})??"",R=k?JSON.stringify(k):"",{interpolatedPath:A,usedParams:z}=vx({path:x.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),O=x.id+A+R,$=this.getMatch(O),E=v.get(x.id),L=$?._strictParams??z;let U;if(!$)try{Ax(x,z,c,L)}catch(ue){if(hn(ue)||wn(ue)?U=ue:U=new Xz(ue.message,{cause:ue}),t?.throwOnError)throw U}Object.assign(r,L);const X=E?"stay":"enter";let Q;if($)Q={...$,cause:X,params:E?.params??r,_strictParams:L,search:ca(E?E.search:$.search,N),_strictSearch:S};else{const ue=x.options.loader||x.options.beforeLoad||x.lazyFn||KS(x)?"pending":"success";Q={id:O,ssr:x.options.ssr,index:y,routeId:x.id,params:E?.params??r,_strictParams:L,pathname:A,updatedAt:Date.now(),search:E?ca(E.search,N):N,_strictSearch:S,searchError:void 0,status:ue,isFetching:!1,error:void 0,paramsError:U,__routeContext:void 0,_nonReactive:{loadPromise:$r()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:X,loaderDeps:E?ma(E.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 ee=this.getParentContext(b);Q.context={...ee,...Q.__routeContext,...Q.__beforeLoadContext},p[y]=Q}for(let y=0;y<p.length;y++){const x=p[y],b=this.looseRoutesById[x.routeId],N=this.getMatch(x.id),S=v.get(x.routeId);if(x.params=S?ca(S.params,r):r,!N){const C=p[y-1],k=this.getParentContext(C);if(b.options.context){const R={deps:x.loaderDeps,params:x.params,context:k??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:p,routeId:b.id};x.__routeContext=b.options.context(R)??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=nl(t),c={...e.search};for(const p of t)try{Object.assign(c,uu(p.options.validateSearch,c))}catch{}const u=nl(this.state.matches),f=u&&u.routeId===r.id&&e.pathname===this.state.location.pathname;let m;if(f)m=u.params;else{const p=Object.assign(Object.create(null),s);for(const v of t)try{Ax(v,s,a??{},p)}catch{}m=p}return{matchedRoutes:t,fullPath:r.fullPath,search:c,params:m}}},Cu=class extends Error{},Xz=class extends Error{};function Wz(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function uu(e,t){if(e==null)return{};if("~standard"in e){const s=e["~standard"].validate(t);if(s instanceof Promise)throw new Cu("Async validation not supported");if(s.issues)throw new Cu(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 e_({pathname:e,routesById:t,processedTree:s}){const a=Object.create(null),r=Ri(e);let c,u;const f=tz(r,s,!0);return f&&(c=f.route,Object.assign(a,f.rawParams),u=Object.assign(Object.create(null),f.parsedParams)),{matchedRoutes:f?.branch||[t.__root__],routeParams:a,foundRoute:c,parsedParams:u}}function t_({search:e,dest:t,destRoutes:s,_includeValidateSearch:a}){return n_(s)(e,t,a??!1)}function n_(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:u,next:f})=>{let m=u;"preSearchFilters"in r.options&&r.options.preSearchFilters&&(m=r.options.preSearchFilters.reduce((v,y)=>y(v),u));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:u,next:f})=>{const m=f(u);if(!t._includeValidateSearch)return m;try{return{...m,...uu(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:_i(c.search,r):{}};t.middlewares.push(s);const a=(r,c,u)=>{if(r>=u.length)return c;const f=u[r];return f({search:c,next:p=>a(r+1,p,u)})};return function(c,u,f){return t.dest=u,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function s_(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 Sa}function Ax(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 i_="Error preloading route! ☝️",GS=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=Sa:this.parentRoute||Di(!1);let r=a?Sa:s?.path;r&&r!=="/"&&(r=OS(r));const c=s?.id||r;let u=a?Sa:ou([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);r==="__root__"&&(r="/"),u!=="__root__"&&(u=ou(["/",u]));const f=u==="__root__"?"/":ou([this.parentRoute.fullPath,r]);this._path=r,this._id=u,this._fullPath=f,this._to=Ri(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=>up({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.")}},a_=class extends GS{constructor(e){super(e)}};function mp(e){const t=e.errorComponent??pp;return o.jsx(r_,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:s,reset:a})=>s?w.createElement(t,{error:s,reset:a}):e.children})}var r_=class extends w.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 pp({error:e}){const[t,s]=w.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 o_({children:e,fallback:t=null}){return FS()?o.jsx(cs.Fragment,{children:e}):o.jsx(cs.Fragment,{children:t})}function FS(){return cs.useSyncExternalStore(l_,()=>!0,()=>!1)}function l_(){return()=>{}}var ZS=w.createContext(null);function Jn(e){const t=w.useContext(ZS);return e?.warn,t}var Ih={exports:{}},Bh={},qh={exports:{}},Hh={};var Rx;function c_(){if(Rx)return Hh;Rx=1;var e=fl();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,u=e.useDebugValue;function f(y,x){var b=x(),N=a({inst:{value:b,getSnapshot:x}}),S=N[0].inst,C=N[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]),u(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 Hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Hh}var Tx;function u_(){return Tx||(Tx=1,qh.exports=c_()),qh.exports}var Ox;function d_(){if(Ox)return Bh;Ox=1;var e=fl(),t=u_();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,u=e.useEffect,f=e.useMemo,m=e.useDebugValue;return Bh.useSyncExternalStoreWithSelector=function(p,v,y,x,b){var N=c(null);if(N.current===null){var S={hasValue:!1,value:null};N.current=S}else S=N.current;N=f(function(){function k($){if(!R){if(R=!0,A=$,$=x($),b!==void 0&&S.hasValue){var E=S.value;if(b(E,$))return z=E}return z=$}if(E=z,a(A,$))return E;var L=x($);return b!==void 0&&b(E,L)?(A=$,E):(A=$,z=L)}var R=!1,A,z,O=y===void 0?null:y;return[function(){return k(v())},O===null?void 0:function(){return k(O())}]},[v,y,x,b]);var C=r(p,N[0],N[1]);return u(function(){S.hasValue=!0,S.value=C},[C]),m(C),C},Bh}var Lx;function f_(){return Lx||(Lx=1,Ih.exports=d_()),Ih.exports}var h_=f_();function m_(e,t){return e===t}function p_(e,t,s=m_){const a=w.useCallback(u=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(u);return f},[e]),r=w.useCallback(()=>e?.get(),[e]);return h_.useSyncExternalStoreWithSelector(a,r,r,t,s)}function Nn(e){const t=Jn({warn:e?.router===void 0}),s=e?.router||t,a=w.useRef(void 0);return p_(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 qu=w.createContext(void 0),g_=w.createContext(void 0);function Ui(e){const t=w.useContext(e.from?g_:qu);return Nn({select:s=>{const a=s.matches.find(r=>e.from?e.from===r.routeId:r.id===t);if(Di(!((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 gp(e){return Ui({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function yp(e){const{select:t,...s}=e;return Ui({...s,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Hu(e){return Ui({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 Ku(e){return Ui({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ii(e){const t=Jn();return w.useCallback(s=>t.navigate({...s,from:s.from??e?.from}),[e?.from,t])}function vp(e){return Ui({...e,select:t=>e.select?e.select(t.context):t.context})}var xp=mS();const y_=hS(xp);function v_(e,t){const s=Jn(),a=qk(t),{activeProps:r,inactiveProps:c,activeOptions:u,to:f,preload:m,preloadDelay:p,hashScrollIntoView:v,replace:y,startTransition:x,resetScroll:b,viewTransition:N,children:S,target:C,disabled:k,style:R,className:A,onClick:z,onBlur:O,onFocus:$,onMouseEnter:E,onMouseLeave:L,onTouchStart:U,ignoreBlocker:X,params:Q,search:ee,hash:ue,state:Ee,mask:we,reloadDocument:K,unsafeRelative:ae,from:me,_fromLocation:V,...H}=e,T=FS(),B=Nn({select:Me=>{const Ye=Me.matches[Me.matches.length-1];return{search:Ye?.search,hash:Me.location.hash,path:Ye?.pathname}},structuralSharing:!0}),se=e.from,le=w.useMemo(()=>({...e,from:se}),[s,B,se,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),J=w.useMemo(()=>s.buildLocation({...le}),[s,le]),fe=J.maskedLocation?J.maskedLocation.publicHref:J.publicHref,ye=J.maskedLocation?J.maskedLocation.external:J.external,Ae=w.useMemo(()=>N_(fe,ye,s.history,k),[k,ye,fe,s.history]),ge=w.useMemo(()=>{if(Ae?.external)return xu(Ae.href,s.protocolAllowlist)?void 0:Ae.href;if(!C_(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),xu(f,s.protocolAllowlist)?void 0:f}catch{}},[f,Ae,s.protocolAllowlist]),Ze=Nn({select:Me=>{if(ge)return!1;if(u?.exact){if(!oz(Me.location.pathname,J.pathname,s.basepath))return!1}else{const Ye=Su(Me.location.pathname,s.basepath),Nt=Su(J.pathname,s.basepath);if(!(Ye.startsWith(Nt)&&(Ye.length===Nt.length||Ye[Nt.length]==="/")))return!1}return(u?.includeSearch??!0)&&!ba(Me.location.search,J.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?T&&Me.location.hash===J.hash:!0}}),et=Ze?_i(r,{})??x_:Kh,de=Ze?Kh:_i(c,{})??Kh,Ve=[A,et.className,de.className].filter(Boolean).join(" "),at=(R||et.style||de.style)&&{...R,...et.style,...de.style},[Vt,Pt]=w.useState(!1),Dn=w.useRef(!1),nn=e.reloadDocument||ge?!1:m??s.options.defaultPreload,_t=p??s.options.defaultPreloadDelay??0,re=w.useCallback(()=>{s.preloadRoute({...le,_builtLocation:J}).catch(Me=>{console.warn(Me),console.warn(i_)})},[s,le,J]);Bk(a,w.useCallback(Me=>{Me?.isIntersecting&&re()},[re]),w_,{disabled:!!k||nn!=="viewport"}),w.useEffect(()=>{Dn.current||!k&&nn==="render"&&(re(),Dn.current=!0)},[k,re,nn]);const Ge=Me=>{const Ye=Me.currentTarget.getAttribute("target"),Nt=C!==void 0?C:Ye;if(!k&&!k_(Me)&&!Me.defaultPrevented&&(!Nt||Nt==="_self")&&Me.button===0){Me.preventDefault(),xp.flushSync(()=>{Pt(!0)});const Be=s.subscribe("onResolved",()=>{Be(),Pt(!1)});s.navigate({...le,replace:y,resetScroll:b,hashScrollIntoView:v,startTransition:x,viewTransition:N,ignoreBlocker:X})}};if(ge)return{...H,ref:a,href:ge,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...R&&{style:R},...A&&{className:A},...z&&{onClick:z},...O&&{onBlur:O},...$&&{onFocus:$},...E&&{onMouseEnter:E},...L&&{onMouseLeave:L},...U&&{onTouchStart:U}};const gt=Me=>{if(k||nn!=="intent")return;if(!_t){re();return}const Ye=Me.currentTarget;if(Go.has(Ye))return;const Nt=setTimeout(()=>{Go.delete(Ye),re()},_t);Go.set(Ye,Nt)},Qt=Me=>{k||nn!=="intent"||re()},Qe=Me=>{if(k||!nn||!_t)return;const Ye=Me.currentTarget,Nt=Go.get(Ye);Nt&&(clearTimeout(Nt),Go.delete(Ye))};return{...H,...et,...de,href:Ae?.href,ref:a,onClick:Sr([z,Ge]),onBlur:Sr([O,Qe]),onFocus:Sr([$,gt]),onMouseEnter:Sr([E,gt]),onMouseLeave:Sr([L,Qe]),onTouchStart:Sr([U,Qt]),disabled:!!k,target:C,...at&&{style:at},...Ve&&{className:Ve},...k&&b_,...Ze&&S_,...T&&Vt&&j_}}var Kh={},x_={className:"active"},b_={role:"link","aria-disabled":!0},S_={"data-status":"active","aria-current":"page"},j_={"data-transitioning":"transitioning"},Go=new WeakMap,w_={rootMargin:"100px"},Sr=e=>t=>{for(const s of e)if(s){if(t.defaultPrevented)return;s(t)}};function N_(e,t,s,a){if(!a)return t?{href:e,external:!0}:{href:s.createHref(e)||"/",external:!1}}function C_(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var St=w.forwardRef((e,t)=>{const{_asChild:s,...a}=e,{type:r,...c}=v_(a,t),u=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!s){const{disabled:f,...m}=c;return w.createElement("a",m,u)}return w.createElement(s,c,u)});function k_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var z_=class extends GS{constructor(e){super(e),this.useMatch=t=>Ui({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>vp({...t,from:this.id}),this.useSearch=t=>Ku({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Hu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>yp({...t,from:this.id}),this.useLoaderData=t=>gp({...t,from:this.id}),this.useNavigate=()=>Ii({from:this.fullPath}),this.Link=cs.forwardRef((t,s)=>o.jsx(St,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Xn(e){return new z_(e)}function __(){return e=>A_(e)}var E_=class extends a_{constructor(e){super(e),this.useMatch=t=>Ui({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>vp({...t,from:this.id}),this.useSearch=t=>Ku({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Hu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>yp({...t,from:this.id}),this.useLoaderData=t=>gp({...t,from:this.id}),this.useNavigate=()=>Ii({from:this.fullPath}),this.Link=cs.forwardRef((t,s)=>o.jsx(St,{ref:s,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function A_(e){return new E_(e)}function Dx(e){return typeof e=="object"?new Mx(e,{silent:!0}).createRoute(e):new Mx(e,{silent:!0}).createRoute}var Mx=class{constructor(e,t){this.path=e,this.createRoute=s=>{const a=Xn(s);return a.isRoot=!1,a},this.silent=t?.silent}},$x=class{constructor(e){this.useMatch=t=>Ui({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>vp({...t,from:this.options.id}),this.useSearch=t=>Ku({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Hu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>yp({...t,from:this.options.id}),this.useLoaderData=t=>gp({...t,from:this.options.id}),this.useNavigate=()=>Ii({from:Jn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Px(e){return typeof e=="object"?new $x(e):t=>new $x({id:e,...t})}function R_(e){const t=Nn({select:s=>`not-found-${s.location.pathname}-${s.status}`});return o.jsx(mp,{getResetKey:()=>t,onCatch:(s,a)=>{if(hn(s))e.onCatch?.(s,a);else throw s},errorComponent:({error:s})=>{if(hn(s))return e.fallback?.(s);throw s},children:e.children})}function T_(){return o.jsx("p",{children:"Not Found"})}function zr(e){return o.jsx(o.Fragment,{children:e.children})}function VS(e,t,s){return t.options.notFoundComponent?o.jsx(t.options.notFoundComponent,{...s}):e.options.defaultNotFoundComponent?o.jsx(e.options.defaultNotFoundComponent,{...s}):o.jsx(T_,{})}function O_(){return Jn().isScrollRestoring,null}var QS=w.memo(function({matchId:t}){const s=Jn(),a=Nn({select:N=>{const S=N.matches.findIndex(k=>k.id===t),C=N.matches[S];return Di(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:N.loadedAt,parentRouteId:N.matches[S-1]?.routeId}},structuralSharing:!0}),r=s.routesById[a.routeId],c=r.options.pendingComponent??s.options.defaultPendingComponent,u=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))?w.Suspense:zr,x=f?mp:zr,b=p?R_:zr;return o.jsxs(r.isRoot?r.options.shellComponent??zr:zr,{children:[o.jsx(qu.Provider,{value:t,children:o.jsx(y,{fallback:u,children:o.jsx(x,{getResetKey:()=>a.resetKey,errorComponent:f||pp,onCatch:(N,S)=>{if(hn(N))throw N;m?.(N,S)},children:o.jsx(b,{fallback:N=>{if(!p||N.routeId&&N.routeId!==a.routeId||!N.routeId&&!r.isRoot)throw N;return w.createElement(p,N)},children:v||a._displayPending?o.jsx(o_,{fallback:u,children:o.jsx(Ux,{matchId:t})}):o.jsx(Ux,{matchId:t})})})})}),a.parentRouteId===Sa&&s.options.scrollRestoration?o.jsxs(o.Fragment,{children:[o.jsx(L_,{}),o.jsx(O_,{})]}):null]})});function L_(){const e=Jn(),t=w.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",...wa(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Ux=w.memo(function({matchId:t}){const s=Jn(),{match:a,key:r,routeId:c}=Nn({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}),u=s.routesById[c],f=w.useMemo(()=>{const m=u.options.component??s.options.defaultComponent;return m?o.jsx(m,{},r):o.jsx(bp,{})},[r,u.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=u.options.pendingMinMs??s.options.defaultPendingMinMs;if(m){const p=s.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const v=$r();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 Di(hn(a.error)),VS(s,u,a.error);if(a.status==="redirected")throw Di(wn(a.error)),s.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),bp=w.memo(function(){const t=Jn(),s=w.useContext(qu),a=Nn({select:p=>p.matches.find(v=>v.id===s)?.routeId}),r=t.routesById[a],c=Nn({select:p=>{const v=p.matches.find(y=>y.id===s);return Di(v),v.globalNotFound}}),u=Nn({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 VS(t,r,void 0);if(!u)return null;const m=o.jsx(QS,{matchId:u});return a===Sa?o.jsx(w.Suspense,{fallback:f,children:m}):m});function D_(){const e=Jn(),t=w.useRef({router:e,mounted:!1}),[s,a]=w.useState(!1),{hasPendingMatches:r,isLoading:c}=Nn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(x=>x.status==="pending")}),structuralSharing:!0}),u=Lh(c),f=c||s||r,m=Lh(f),p=c||r,v=Lh(p);return e.startTransition=y=>{a(!0),w.startTransition(()=>{y(),a(!1)})},w.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 Ri(e.latestLocation.publicHref)!==Ri(x.publicHref)&&e.commitLocation({...x,replace:!0}),()=>{y()}},[e,e.history]),Ic(()=>{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]),Ic(()=>{u&&!c&&e.emit({type:"onLoad",...wa(e.state)})},[u,e,c]),Ic(()=>{v&&!p&&e.emit({type:"onBeforeRouteMount",...wa(e.state)})},[p,v,e]),Ic(()=>{if(m&&!f){const y=wa(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(x=>({...x,status:"idle",resolvedLocation:x.location})),y.hrefChanged&&yz(e)}},[f,m,e]),null}function M_(){const e=Jn(),t=e.routesById[Sa].options.pendingComponent??e.options.defaultPendingComponent,s=t?o.jsx(t,{}):null,a=o.jsxs(typeof document<"u"&&e.ssr?zr:w.Suspense,{fallback:s,children:[o.jsx(D_,{}),o.jsx($_,{})]});return e.options.InnerWrap?o.jsx(e.options.InnerWrap,{children:a}):a}function $_(){const e=Jn(),t=Nn({select:r=>r.matches[0]?.id}),s=Nn({select:r=>r.loadedAt}),a=t?o.jsx(QS,{matchId:t}):null;return o.jsx(qu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:o.jsx(mp,{getResetKey:()=>s,errorComponent:pp,onCatch:void 0,children:a})})}var P_=e=>new U_(e),U_=class extends Jz{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Dx,globalThis.createLazyFileRoute=Px):typeof window<"u"&&(window.createFileRoute=Dx,window.createLazyFileRoute=Px);function I_({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(ZS.Provider,{value:e,children:t});return e.options.Wrap?o.jsx(e.options.Wrap,{children:a}):a}function B_({router:e,...t}){return o.jsx(I_,{router:e,...t,children:o.jsx(M_,{})})}function q_(e){return Nn({select:t=>t.location})}class ku extends Error{code;statusCode;constructor(t,s,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=s}}function H_(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const K_=H_();function G_(){return""}function Ix(){return!!G_()}async function pe(e,t){const s=await fetch(`${K_}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!s.ok){const a=await s.text();let r=`API ${s.status}: ${s.statusText}`,c;if(a)try{const u=JSON.parse(a);typeof u.error=="string"?r=u.error:u.error?.message?(r=u.error.message,c=u.error.code):u.message&&(r=u.message)}catch{r=a}throw new ku(r,s.status,c)}if(s.status!==204)return s.json()}function YS(){return pe("/projects")}function JS(e){return pe(`/projects/${encodeURIComponent(e)}`)}function XS(){return pe("/runs")}function Pr(e){return pe(`/runs/${encodeURIComponent(e)}`)}function F_(e){return pe(`/projects/${encodeURIComponent(e)}/keywords`)}function WS(e){return pe(`/projects/${encodeURIComponent(e)}/competitors`)}function ej(e,t){const s=new URLSearchParams;t!==void 0&&s.set("location",t);const a=s.toString();return pe(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function Gu(e,t){return pe(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function Z_(e,t){return pe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function V_(e,t){return pe(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function tj(e,t){return pe(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Bx(e,t){const s=await JS(e);return Gu(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 Q_(e,t){const s=await JS(e);return Gu(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 Y_(e,t){const s={};return t?.location&&(s.location=t.location),t?.allLocations&&(s.allLocations=!0),t?.noLocation&&(s.noLocation=!0),pe(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(s)})}function J_(e,t){return pe(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function X_(e,t){await pe(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function W_(e,t){return pe(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function e2(e){await pe(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function t2(e){return pe(`/projects/${encodeURIComponent(e)}/export`)}function Sp(){return pe("/settings")}function n2(){return pe("/session")}function s2(e){return pe("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function i2(e){return pe("/session",{method:"POST",body:JSON.stringify({password:e})})}function a2(e,t){return pe(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function r2(e){return pe("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function o2(e){try{return await pe(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function qx(e,t){return pe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function l2(e){await pe(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function c2(e){return pe(`/projects/${encodeURIComponent(e)}/notifications`)}function u2(e,t){return pe(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function d2(e,t){await pe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function f2(e,t){return pe(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function h2(e,t,s){return pe(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:s})})}function m2(e){return pe("/apply",{method:"POST",body:JSON.stringify(e)})}function p2(e){return pe("/runs",{method:"POST",body:JSON.stringify(e??{})})}function nj(e){return pe(`/projects/${encodeURIComponent(e)}/google/connections`)}function g2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function y2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function v2(e){return pe(`/projects/${encodeURIComponent(e)}/google/properties`)}function x2(e,t,s){return pe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:s})})}function b2(e,t,s){return pe(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:s})})}function sj(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function S2(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 pe(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function j2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function w2(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 pe(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function N2(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function jp(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function C2(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return pe(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function k2(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function z2(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function _2(e){return pe(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Hx(){return pe("/cdp/status")}function E2(e,t){return pe("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Kx(e,t){return pe(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function ij(e){return pe(`/projects/${encodeURIComponent(e)}/bing/status`)}function A2(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function R2(e){return pe(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function T2(e){return pe(`/projects/${encodeURIComponent(e)}/bing/sites`)}function O2(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function wp(e){return pe(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function aj(e,t){const s=new URLSearchParams,a=s.toString()?`?${s.toString()}`:"";return pe(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function rj(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Gx(e,t){return pe(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function L2(e){return pe(`/projects/${encodeURIComponent(e)}/bing/performance`)}function D2(e){return pe("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function M2(e,t){const s=t?`?window=${t}`:"";return pe(`/projects/${encodeURIComponent(e)}/analytics/metrics${s}`)}function $2(e,t){const s=t?`?window=${t}`:"";return pe(`/projects/${encodeURIComponent(e)}/analytics/gaps${s}`)}function P2(e,t){const s=t?`?window=${t}`:"";return pe(`/projects/${encodeURIComponent(e)}/analytics/sources${s}`)}function Fx(e){return pe(`/projects/${encodeURIComponent(e)}/ga/status`)}function Zx(e,t){return pe(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function oj(e,t){return pe(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function U2(e,t){return pe(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function I2(e){return pe(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function B2(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,u=typeof a.lastHeartbeatAt=="string"?a.lastHeartbeatAt:void 0,f=[r,c===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:r,databaseConfigured:c,lastHeartbeatAt:u}}catch(s){return{label:t,state:"error",detail:s instanceof Error?s.message:"unreachable"}}}const q2=6e3,H2=5,K2=180;let on=[],G2=0;const zm=new Set,_m=new Map,Em=new Map;function zu(){const e=[...on];for(const t of zm)t(e)}function Np(e){const t=_m.get(e);t&&(clearTimeout(t),_m.delete(e));const s=Em.get(e);s&&(clearTimeout(s),Em.delete(e))}function lj(e){Np(e);const t=on.length;on=on.filter(s=>s.id!==e),on.length!==t&&zu()}function Vx(e){Np(e.id),_m.set(e.id,setTimeout(()=>{Am(e.id)},e.durationMs))}function F2(e,t,s){return typeof e=="string"?{title:e,tone:t,durationMs:s}:e}function Ke(e,t="negative",s=q2){const a=F2(e,t,s),r={id:String(++G2),title:a.title,detail:a.detail,tone:a.tone??t,durationMs:a.durationMs??s,dedupeKey:a.dedupeKey,cta:a.cta,state:"open"};if(a.dedupeKey){const c=on.find(u=>u.dedupeKey===a.dedupeKey);if(c){if((a.dedupeMode??"drop")==="drop")return c.id;const u={...c,title:r.title,detail:r.detail,tone:r.tone,durationMs:r.durationMs,cta:r.cta,state:"open"};return on=on.map(f=>f.id===c.id?u:f),zu(),Vx(u),c.id}}return on.length>=H2&&lj(on[0].id),on=[...on,r],zu(),Vx(r),r.id}function Am(e){const t=on.find(s=>s.id===e);!t||t.state==="closing"||(Np(e),on=on.map(s=>s.id===e?{...s,state:"closing"}:s),zu(),Em.set(e,setTimeout(()=>{lj(e)},K2)))}function Z2(e){return zm.add(e),()=>{zm.delete(e)}}function Qx(){return on}function V2(){return new Lk({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new jS({onError:(e,t,s,a)=>{a.meta?.skipGlobalErrorToast||Ke({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const Q2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Y2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,a)=>a?a.toUpperCase():s.toLowerCase()),Yx=e=>{const t=Y2(e);return t.charAt(0).toUpperCase()+t.slice(1)},cj=(...e)=>e.filter((t,s,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===s).join(" ").trim(),J2=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var X2={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 W2=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:r="",children:c,iconNode:u,...f},m)=>w.createElement("svg",{ref:m,...X2,width:t,height:t,stroke:e,strokeWidth:a?Number(s)*24/Number(t):s,className:cj("lucide",r),...!c&&!J2(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,v])=>w.createElement(p,v)),...Array.isArray(c)?c:[c]]));const tn=(e,t)=>{const s=w.forwardRef(({className:a,...r},c)=>w.createElement(W2,{ref:c,iconNode:t,className:cj(`lucide-${Q2(Yx(e))}`,`lucide-${e}`,a),...r}));return s.displayName=Yx(e),s};const eE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fu=tn("chevron-right",eE);const tE=[["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"}]],nE=tn("download",tE);const sE=[["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"}]],iE=tn("github",sE);const aE=[["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"}]],rE=tn("globe",aE);const oE=[["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"}]],lE=tn("layout-dashboard",oE);const cE=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],uE=tn("menu",cE);const dE=[["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"}]],fE=tn("play",dE);const hE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Jx=tn("plus",hE);const mE=[["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"}]],Xx=tn("refresh-cw",mE);const pE=[["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"}]],gE=tn("rocket",pE);const yE=[["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"}]],vE=tn("rotate-ccw",yE);const xE=[["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"}]],bE=tn("settings",xE);const SE=[["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"}]],jE=tn("trash-2",SE);const wE=[["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"}]],NE=tn("triangle-alert",wE);const CE=[["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"}]],kE=tn("unplug",CE);const zE=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],_E=tn("upload",zE);const EE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zu=tn("x",EE);function AE(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(),u=a.slice(r);try{const f=JSON.parse(u);return`${s} ${c}
|
|
10
|
-
|
|
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 Vu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ls(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Wx(e){return e===null?"Unknown":e?"Pass":"Fail"}function Rm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function RE(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function TE(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 Gh(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 u=r[1]?parseInt(r[1]):6;return`Every day at ${Rm(u)} · ${a}`}const c=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(c){const u={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},f=c[2]?parseInt(c[2]):6;return`Every ${u[c[1]]} at ${Rm(f)} · ${a}`}return`${e} · ${a}`}const uj="canonry.run-tracker",Tm=new Set;let eb=!1,OE=0,Qu={runs:{},batches:{}};function LE(){const e=ka();for(const t of Tm)t(e)}function DE(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function ME(){typeof window>"u"||window.sessionStorage.setItem(uj,JSON.stringify(Qu))}function dj(){eb||(eb=!0,!(typeof window>"u")&&(Qu=DE(window.sessionStorage.getItem(uj))))}function Yu(e){Qu=e,ME(),LE()}function ka(){return dj(),Qu}function $E(e){return dj(),Tm.add(e),()=>{Tm.delete(e)}}function fj(e){const t=ka();Yu({...t,runs:{...t.runs,[e.id]:{runId:e.id,projectId:e.projectId,projectLabel:e.projectLabel,kind:e.kind,sourceAction:e.sourceAction,lastAnnouncedStatus:e.lastAnnouncedStatus??"queued"}}})}function tb(e){const t=ka();if(!t.runs[e])return;const{[e]:s,...a}=t.runs;Yu({...t,runs:a})}function PE(e){const t=ka(),s=`batch_${Date.now()}_${++OE}`;return Yu({...t,batches:{...t.batches,[s]:{batchId:s,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),s}function UE(e){const t=ka();if(!t.batches[e])return;const{[e]:s,...a}=t.batches;Yu({...t,batches:a})}function IE(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function BE(e,t){let s=0,a=0,r=0,c=0,u=0;for(const f of e){const m=t[f]?.status;m==="completed"?s+=1:m==="partial"?a+=1:m==="failed"?r+=1:m==="cancelled"?c+=1:u+=1}return{completed:s,partial:a,failed:r,cancelled:c,pending:u,finished:u===0}}function nb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cp(...e){return t=>{let s=!1;const a=e.map(r=>{const c=nb(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():nb(e[r],null)}}}}function Aa(...e){return w.useCallback(Cp(...e),e)}var qE=Symbol.for("react.lazy"),_u=Wm[" use ".trim().toString()];function HE(e){return typeof e=="object"&&e!==null&&"then"in e}function hj(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===qE&&"_payload"in e&&HE(e._payload)}function KE(e){const t=FE(e),s=w.forwardRef((a,r)=>{let{children:c,...u}=a;hj(c)&&typeof _u=="function"&&(c=_u(c._payload));const f=w.Children.toArray(c),m=f.find(VE);if(m){const p=m.props.children,v=f.map(y=>y===m?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:y);return o.jsx(t,{...u,ref:r,children:w.isValidElement(p)?w.cloneElement(p,void 0,v):null})}return o.jsx(t,{...u,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}var GE=KE("Slot");function FE(e){const t=w.forwardRef((s,a)=>{let{children:r,...c}=s;if(hj(r)&&typeof _u=="function"&&(r=_u(r._payload)),w.isValidElement(r)){const u=YE(r),f=QE(c,r.props);return r.type!==w.Fragment&&(f.ref=a?Cp(a,u):u),w.cloneElement(r,f)}return w.Children.count(r)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ZE=Symbol("radix.slottable");function VE(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ZE}function QE(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 YE(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 mj(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=mj(e[t]))&&(a&&(a+=" "),a+=s)}else for(s in e)e[s]&&(a&&(a+=" "),a+=s);return a}function pj(){for(var e,t,s=0,a="",r=arguments.length;s<r;s++)(e=arguments[s])&&(t=mj(e))&&(a&&(a+=" "),a+=t);return a}const sb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ib=pj,gj=(e,t)=>s=>{var a;if(t?.variants==null)return ib(e,s?.class,s?.className);const{variants:r,defaultVariants:c}=t,u=Object.keys(r).map(p=>{const v=s?.[p],y=c?.[p];if(v===null)return null;const x=sb(v)||sb(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(N=>{let[S,C]=N;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...p,y,x]:p},[]);return ib(e,u,m,s?.class,s?.className)},JE=(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},XE=(e,t)=>({classGroupId:e,validator:t}),yj=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),Eu="-",ab=[],WE="arbitrary..",eA=e=>{const t=nA(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return tA(u);const f=u.split(Eu),m=f[0]===""&&f.length>1?1:0;return vj(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],p=s[u];return m?p?JE(p,m):m:p||ab}return s[u]||ab}}},vj=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const r=e[t],c=s.nextPart.get(r);if(c){const p=vj(e,t+1,c);if(p)return p}const u=s.validators;if(u===null)return;const f=t===0?e.join(Eu):e.slice(t).join(Eu),m=u.length;for(let p=0;p<m;p++){const v=u[p];if(v.validator(f))return v.classGroupId}},tA=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?WE+a:void 0})(),nA=e=>{const{theme:t,classGroups:s}=e;return sA(s,t)},sA=(e,t)=>{const s=yj();for(const a in e){const r=e[a];kp(r,s,a,t)}return s},kp=(e,t,s,a)=>{const r=e.length;for(let c=0;c<r;c++){const u=e[c];iA(u,t,s,a)}},iA=(e,t,s,a)=>{if(typeof e=="string"){aA(e,t,s);return}if(typeof e=="function"){rA(e,t,s,a);return}oA(e,t,s,a)},aA=(e,t,s)=>{const a=e===""?t:xj(t,e);a.classGroupId=s},rA=(e,t,s,a)=>{if(lA(e)){kp(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(XE(s,e))},oA=(e,t,s,a)=>{const r=Object.entries(e),c=r.length;for(let u=0;u<c;u++){const[f,m]=r[u];kp(m,xj(t,f),s,a)}},xj=(e,t)=>{let s=e;const a=t.split(Eu),r=a.length;for(let c=0;c<r;c++){const u=a[c];let f=s.nextPart.get(u);f||(f=yj(),s.nextPart.set(u,f)),s=f}return s},lA=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,cA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const r=(c,u)=>{s[c]=u,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(c){let u=s[c];if(u!==void 0)return u;if((u=a[c])!==void 0)return r(c,u),u},set(c,u){c in s?s[c]=u:r(c,u)}}},Om="!",rb=":",uA=[],ob=(e,t,s,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:r}),dA=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=r=>{const c=[];let u=0,f=0,m=0,p;const v=r.length;for(let S=0;S<v;S++){const C=r[S];if(u===0&&f===0){if(C===rb){c.push(r.slice(m,S)),m=S+1;continue}if(C==="/"){p=S;continue}}C==="["?u++:C==="]"?u--:C==="("?f++:C===")"&&f--}const y=c.length===0?r:r.slice(m);let x=y,b=!1;y.endsWith(Om)?(x=y.slice(0,-1),b=!0):y.startsWith(Om)&&(x=y.slice(1),b=!0);const N=p&&p>m?p-m:void 0;return ob(c,b,x,N)};if(t){const r=t+rb,c=a;a=u=>u.startsWith(r)?c(u.slice(r.length)):ob(uA,!1,u,void 0,!0)}if(s){const r=a;a=c=>s({className:c,parseClassName:r})}return a},fA=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 u=s[c],f=u[0]==="[",m=t.has(u);f||m?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(u)):r.push(u)}return r.length>0&&(r.sort(),a.push(...r)),a}},hA=e=>({cache:cA(e.cacheSize),parseClassName:dA(e),sortModifiers:fA(e),...eA(e)}),mA=/\s+/,pA=(e,t)=>{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:c}=t,u=[],f=e.trim().split(mA);let m="";for(let p=f.length-1;p>=0;p-=1){const v=f[p],{isExternal:y,modifiers:x,hasImportantModifier:b,baseClassName:N,maybePostfixModifierPosition:S}=s(v);if(y){m=v+(m.length>0?" "+m:m);continue}let C=!!S,k=a(C?N.substring(0,S):N);if(!k){if(!C){m=v+(m.length>0?" "+m:m);continue}if(k=a(N),!k){m=v+(m.length>0?" "+m:m);continue}C=!1}const R=x.length===0?"":x.length===1?x[0]:c(x).join(":"),A=b?R+Om:R,z=A+k;if(u.indexOf(z)>-1)continue;u.push(z);const O=r(k,C);for(let $=0;$<O.length;++$){const E=O[$];u.push(A+E)}m=v+(m.length>0?" "+m:m)}return m},gA=(...e)=>{let t=0,s,a,r="";for(;t<e.length;)(s=e[t++])&&(a=bj(s))&&(r&&(r+=" "),r+=a);return r},bj=e=>{if(typeof e=="string")return e;let t,s="";for(let a=0;a<e.length;a++)e[a]&&(t=bj(e[a]))&&(s&&(s+=" "),s+=t);return s},yA=(e,...t)=>{let s,a,r,c;const u=m=>{const p=t.reduce((v,y)=>y(v),e());return s=hA(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=pA(m,s);return r(m,v),v};return c=u,(...m)=>c(gA(...m))},vA=[],Ft=e=>{const t=s=>s[e]||vA;return t.isThemeGetter=!0,t},Sj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,xA=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,SA=/\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$/,jA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,wA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wi=e=>xA.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),Ni=e=>!!e&&Number.isInteger(Number(e)),Fh=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Gs=e=>bA.test(e),wj=()=>!0,CA=e=>SA.test(e)&&!jA.test(e),zp=()=>!1,kA=e=>wA.test(e),zA=e=>NA.test(e),_A=e=>!xe(e)&&!be(e),EA=e=>Bi(e,kj,zp),xe=e=>Sj.test(e),da=e=>Bi(e,zj,CA),lb=e=>Bi(e,$A,Pe),AA=e=>Bi(e,Ej,wj),RA=e=>Bi(e,_j,zp),cb=e=>Bi(e,Nj,zp),TA=e=>Bi(e,Cj,zA),Hc=e=>Bi(e,Aj,kA),be=e=>jj.test(e),Fo=e=>Ra(e,zj),OA=e=>Ra(e,_j),ub=e=>Ra(e,Nj),LA=e=>Ra(e,kj),DA=e=>Ra(e,Cj),Kc=e=>Ra(e,Aj,!0),MA=e=>Ra(e,Ej,!0),Bi=(e,t,s)=>{const a=Sj.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Ra=(e,t,s=!1)=>{const a=jj.exec(e);return a?a[1]?t(a[1]):s:!1},Nj=e=>e==="position"||e==="percentage",Cj=e=>e==="image"||e==="url",kj=e=>e==="length"||e==="size"||e==="bg-size",zj=e=>e==="length",$A=e=>e==="number",_j=e=>e==="family-name",Ej=e=>e==="number"||e==="weight",Aj=e=>e==="shadow",PA=()=>{const e=Ft("color"),t=Ft("font"),s=Ft("text"),a=Ft("font-weight"),r=Ft("tracking"),c=Ft("leading"),u=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"),N=Ft("blur"),S=Ft("perspective"),C=Ft("aspect"),k=Ft("ease"),R=Ft("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...z(),be,xe],$=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],L=()=>[be,xe,m],U=()=>[wi,"full","auto",...L()],X=()=>[Ni,"none","subgrid",be,xe],Q=()=>["auto",{span:["full",Ni,be,xe]},Ni,be,xe],ee=()=>[Ni,"auto",be,xe],ue=()=>["auto","min","max","fr",be,xe],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],we=()=>["start","end","center","stretch","center-safe","end-safe"],K=()=>["auto",...L()],ae=()=>[wi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],me=()=>[wi,"screen","full","dvw","lvw","svw","min","max","fit",...L()],V=()=>[wi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],H=()=>[e,be,xe],T=()=>[...z(),ub,cb,{position:[be,xe]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],se=()=>["auto","cover","contain",LA,EA,{size:[be,xe]}],le=()=>[Fh,Fo,da],J=()=>["","none","full",p,be,xe],fe=()=>["",Pe,Fo,da],ye=()=>["solid","dashed","dotted","double"],Ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Pe,Fh,ub,cb],Ze=()=>["","none",N,be,xe],et=()=>["none",Pe,be,xe],de=()=>["none",Pe,be,xe],Ve=()=>[Pe,be,xe],at=()=>[wi,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gs],breakpoint:[Gs],color:[wj],container:[Gs],"drop-shadow":[Gs],ease:["in","out","in-out"],font:[_A],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gs],shadow:[Gs],spacing:["px",Pe],text:[Gs],"text-shadow":[Gs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wi,xe,be,C]}],container:["container"],columns:[{columns:[Pe,xe,be,f]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:O()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{"inset-s":U(),start:U()}],end:[{"inset-e":U(),end:U()}],"inset-bs":[{"inset-bs":U()}],"inset-be":[{"inset-be":U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[Ni,"auto",be,xe]}],basis:[{basis:[wi,"full","auto",f,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,wi,"auto","initial","none",xe]}],grow:[{grow:["",Pe,be,xe]}],shrink:[{shrink:["",Pe,be,xe]}],order:[{order:[Ni,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":X()}],"col-start-end":[{col:Q()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":X()}],"row-start-end":[{row:Q()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ue()}],"auto-rows":[{"auto-rows":ue()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...we(),"normal"]}],"justify-self":[{"justify-self":["auto",...we()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...we(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...we(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...we(),"baseline"]}],"place-self":[{"place-self":["auto",...we()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:K()}],mx:[{mx:K()}],my:[{my:K()}],ms:[{ms:K()}],me:[{me:K()}],mbs:[{mbs:K()}],mbe:[{mbe:K()}],mt:[{mt:K()}],mr:[{mr:K()}],mb:[{mb:K()}],ml:[{ml:K()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],"inline-size":[{inline:["auto",...me()]}],"min-inline-size":[{"min-inline":["auto",...me()]}],"max-inline-size":[{"max-inline":["none",...me()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[f,"screen",...ae()]}],"min-w":[{"min-w":[f,"screen","none",...ae()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...ae()]}],h:[{h:["screen","lh",...ae()]}],"min-h":[{"min-h":["screen","lh","none",...ae()]}],"max-h":[{"max-h":["screen","lh",...ae()]}],"font-size":[{text:["base",s,Fo,da]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,MA,AA]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Fh,xe]}],"font-family":[{font:[OA,RA,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":[Pe,"none",be,lb]}],leading:[{leading:[c,...L()]}],"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:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",be,da]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Pe,"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:L()}],"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:T()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ni,be,xe],radial:["",be,xe],conic:[Ni,be,xe]},DA,TA]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ye(),"hidden","none"]}],"divide-style":[{divide:[...ye(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-bs":[{"border-bs":H()}],"border-color-be":[{"border-be":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,be,xe]}],"outline-w":[{outline:["",Pe,Fo,da]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",v,Kc,Hc]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",y,Kc,Hc]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Pe,da]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",x,Kc,Hc]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Pe,be,xe]}],"mix-blend":[{"mix-blend":[...Ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ae()}],"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":[Pe]}],"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":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"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":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"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":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"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":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"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":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"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":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"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":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"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":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":z()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"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":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:Ze()}],brightness:[{brightness:[Pe,be,xe]}],contrast:[{contrast:[Pe,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,Kc,Hc]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Pe,be,xe]}],"hue-rotate":[{"hue-rotate":[Pe,be,xe]}],invert:[{invert:["",Pe,be,xe]}],saturate:[{saturate:[Pe,be,xe]}],sepia:[{sepia:["",Pe,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Pe,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"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:[Pe,"initial",be,xe]}],ease:[{ease:["linear","initial",k,be,xe]}],delay:[{delay:[Pe,be,xe]}],animate:[{animate:["none",R,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,xe]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:et()}],"rotate-x":[{"rotate-x":et()}],"rotate-y":[{"rotate-y":et()}],"rotate-z":[{"rotate-z":et()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:Ve()}],"skew-x":[{"skew-x":Ve()}],"skew-y":[{"skew-y":Ve()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:at()}],"translate-x":[{"translate-x":at()}],"translate-y":[{"translate-y":at()}],"translate-z":[{"translate-z":at()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",...H()]}],"stroke-w":[{stroke:[Pe,Fo,da,lb]}],stroke:[{stroke:["none",...H()]}],"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"]}},UA=yA(PA);function Wn(...e){return UA(pj(e))}const IA=gj("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"}}),oe=w.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,...r},c)=>{const u=a?GE:"button";return o.jsx(u,{ref:c,className:Wn(IA({variant:t,size:s,className:e})),...r})});oe.displayName="Button";const BA=gj("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 Rj({className:e,variant:t,...s}){return o.jsx("div",{className:Wn(BA({variant:t}),e),...s})}function db({compact:e=!1}){return o.jsxs(St,{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 al({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 Au(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function Tj(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 qA(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 HA(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function lt({tone:e,children:t}){const s=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return o.jsx(Rj,{variant:s,children:t})}function Ju({status:e}){return o.jsx(lt,{tone:Tj(e),children:Vu(e)})}function Oi(e,t,{checkForDefaultPrevented:s=!0}={}){return function(r){if(e?.(r),s===!1||!r.defaultPrevented)return t?.(r)}}function KA(e,t){const s=w.createContext(t),a=c=>{const{children:u,...f}=c,m=w.useMemo(()=>f,Object.values(f));return o.jsx(s.Provider,{value:m,children:u})};a.displayName=e+"Provider";function r(c){const u=w.useContext(s);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,r]}function GA(e,t=[]){let s=[];function a(c,u){const f=w.createContext(u),m=s.length;s=[...s,u];const p=y=>{const{scope:x,children:b,...N}=y,S=x?.[e]?.[m]||f,C=w.useMemo(()=>N,Object.values(N));return o.jsx(S.Provider,{value:C,children:b})};p.displayName=c+"Provider";function v(y,x){const b=x?.[e]?.[m]||f,N=w.useContext(b);if(N)return N;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[p,v]}const r=()=>{const c=s.map(u=>w.createContext(u));return function(f){const m=f?.[e]||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return r.scopeName=e,[a,FA(r,...t)]}function FA(...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 u=a.reduce((f,{useScope:m,scopeName:p})=>{const y=m(c)[`__scope${p}`];return{...f,...y}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return s.scopeName=t.scopeName,s}var rl=globalThis?.document?w.useLayoutEffect:()=>{},ZA=Wm[" useId ".trim().toString()]||(()=>{}),VA=0;function Zh(e){const[t,s]=w.useState(ZA());return rl(()=>{s(a=>a??String(VA++))},[e]),e||(t?`radix-${t}`:"")}var QA=Wm[" useInsertionEffect ".trim().toString()]||rl;function YA({prop:e,defaultProp:t,onChange:s=()=>{},caller:a}){const[r,c,u]=JA({defaultProp:t,onChange:s}),f=e!==void 0,m=f?e:r;{const v=w.useRef(e!==void 0);w.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=w.useCallback(v=>{if(f){const y=XA(v)?v(e):v;y!==e&&u.current?.(y)}else c(v)},[f,e,c,u]);return[m,p]}function JA({defaultProp:e,onChange:t}){const[s,a]=w.useState(e),r=w.useRef(s),c=w.useRef(t);return QA(()=>{c.current=t},[t]),w.useEffect(()=>{r.current!==s&&(c.current?.(s),r.current=s)},[s,r]),[s,a,c]}function XA(e){return typeof e=="function"}function Oj(e){const t=WA(e),s=w.forwardRef((a,r)=>{const{children:c,...u}=a,f=w.Children.toArray(c),m=f.find(tR);if(m){const p=m.props.children,v=f.map(y=>y===m?w.Children.count(p)>1?w.Children.only(null):w.isValidElement(p)?p.props.children:null:y);return o.jsx(t,{...u,ref:r,children:w.isValidElement(p)?w.cloneElement(p,void 0,v):null})}return o.jsx(t,{...u,ref:r,children:c})});return s.displayName=`${e}.Slot`,s}function WA(e){const t=w.forwardRef((s,a)=>{const{children:r,...c}=s;if(w.isValidElement(r)){const u=sR(r),f=nR(c,r.props);return r.type!==w.Fragment&&(f.ref=a?Cp(a,u):u),w.cloneElement(r,f)}return w.Children.count(r)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eR=Symbol("radix.slottable");function tR(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eR}function nR(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 sR(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 iR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qs=iR.reduce((e,t)=>{const s=Oj(`Primitive.${t}`),a=w.forwardRef((r,c)=>{const{asChild:u,...f}=r,m=u?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 aR(e,t){e&&xp.flushSync(()=>e.dispatchEvent(t))}function ol(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...s)=>t.current?.(...s),[])}function rR(e,t=globalThis?.document){const s=ol(e);w.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 oR="DismissableLayer",Lm="dismissableLayer.update",lR="dismissableLayer.pointerDownOutside",cR="dismissableLayer.focusOutside",fb,Lj=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dj=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...m}=e,p=w.useContext(Lj),[v,y]=w.useState(null),x=v?.ownerDocument??globalThis?.document,[,b]=w.useState({}),N=Aa(t,E=>y(E)),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),R=v?S.indexOf(v):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,z=R>=k,O=fR(E=>{const L=E.target,U=[...p.branches].some(X=>X.contains(L));!z||U||(r?.(E),u?.(E),E.defaultPrevented||f?.())},x),$=hR(E=>{const L=E.target;[...p.branches].some(X=>X.contains(L))||(c?.(E),u?.(E),E.defaultPrevented||f?.())},x);return rR(E=>{R===p.layers.size-1&&(a?.(E),!E.defaultPrevented&&f&&(E.preventDefault(),f()))},x),w.useEffect(()=>{if(v)return s&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(fb=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),hb(),()=>{s&&p.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=fb)}},[v,x,s,p]),w.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),hb())},[v,p]),w.useEffect(()=>{const E=()=>b({});return document.addEventListener(Lm,E),()=>document.removeEventListener(Lm,E)},[]),o.jsx(Qs.div,{...m,ref:N,style:{pointerEvents:A?z?"auto":"none":void 0,...e.style},onFocusCapture:Oi(e.onFocusCapture,$.onFocusCapture),onBlurCapture:Oi(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Oi(e.onPointerDownCapture,O.onPointerDownCapture)})});Dj.displayName=oR;var uR="DismissableLayerBranch",dR=w.forwardRef((e,t)=>{const s=w.useContext(Lj),a=w.useRef(null),r=Aa(t,a);return w.useEffect(()=>{const c=a.current;if(c)return s.branches.add(c),()=>{s.branches.delete(c)}},[s.branches]),o.jsx(Qs.div,{...e,ref:r})});dR.displayName=uR;function fR(e,t=globalThis?.document){const s=ol(e),a=w.useRef(!1),r=w.useRef(()=>{});return w.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let m=function(){Mj(lR,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},u=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",c),t.removeEventListener("click",r.current)}},[t,s]),{onPointerDownCapture:()=>a.current=!0}}function hR(e,t=globalThis?.document){const s=ol(e),a=w.useRef(!1);return w.useEffect(()=>{const r=c=>{c.target&&!a.current&&Mj(cR,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 hb(){const e=new CustomEvent(Lm);document.dispatchEvent(e)}function Mj(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?aR(r,c):r.dispatchEvent(c)}var Vh="focusScope.autoFocusOnMount",Qh="focusScope.autoFocusOnUnmount",mb={bubbles:!1,cancelable:!0},mR="FocusScope",$j=w.forwardRef((e,t)=>{const{loop:s=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:c,...u}=e,[f,m]=w.useState(null),p=ol(r),v=ol(c),y=w.useRef(null),x=Aa(t,S=>m(S)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let S=function(A){if(b.paused||!f)return;const z=A.target;f.contains(z)?y.current=z:Ci(y.current,{select:!0})},C=function(A){if(b.paused||!f)return;const z=A.relatedTarget;z!==null&&(f.contains(z)||Ci(y.current,{select:!0}))},k=function(A){if(document.activeElement===document.body)for(const O of A)O.removedNodes.length>0&&Ci(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const R=new MutationObserver(k);return f&&R.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),R.disconnect()}}},[a,f,b.paused]),w.useEffect(()=>{if(f){gb.add(b);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Vh,mb);f.addEventListener(Vh,p),f.dispatchEvent(k),k.defaultPrevented||(pR(bR(Pj(f)),{select:!0}),document.activeElement===S&&Ci(f))}return()=>{f.removeEventListener(Vh,p),setTimeout(()=>{const k=new CustomEvent(Qh,mb);f.addEventListener(Qh,v),f.dispatchEvent(k),k.defaultPrevented||Ci(S??document.body,{select:!0}),f.removeEventListener(Qh,v),gb.remove(b)},0)}}},[f,p,v,b]);const N=w.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 R=S.currentTarget,[A,z]=gR(R);A&&z?!S.shiftKey&&k===z?(S.preventDefault(),s&&Ci(A,{select:!0})):S.shiftKey&&k===A&&(S.preventDefault(),s&&Ci(z,{select:!0})):k===R&&S.preventDefault()}},[s,a,b.paused]);return o.jsx(Qs.div,{tabIndex:-1,...u,ref:x,onKeyDown:N})});$j.displayName=mR;function pR(e,{select:t=!1}={}){const s=document.activeElement;for(const a of e)if(Ci(a,{select:t}),document.activeElement!==s)return}function gR(e){const t=Pj(e),s=pb(t,e),a=pb(t.reverse(),e);return[s,a]}function Pj(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 pb(e,t){for(const s of e)if(!yR(s,{upTo:t}))return s}function yR(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 vR(e){return e instanceof HTMLInputElement&&"select"in e}function Ci(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&vR(e)&&t&&e.select()}}var gb=xR();function xR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=yb(e,t),e.unshift(t)},remove(t){e=yb(e,t),e[0]?.resume()}}}function yb(e,t){const s=[...e],a=s.indexOf(t);return a!==-1&&s.splice(a,1),s}function bR(e){return e.filter(t=>t.tagName!=="A")}var SR="Portal",Uj=w.forwardRef((e,t)=>{const{container:s,...a}=e,[r,c]=w.useState(!1);rl(()=>c(!0),[]);const u=s||r&&globalThis?.document?.body;return u?y_.createPortal(o.jsx(Qs.div,{...a,ref:t}),u):null});Uj.displayName=SR;function jR(e,t){return w.useReducer((s,a)=>t[s][a]??s,e)}var Xu=e=>{const{present:t,children:s}=e,a=wR(t),r=typeof s=="function"?s({present:a.isPresent}):w.Children.only(s),c=Aa(a.ref,NR(r));return typeof s=="function"||a.isPresent?w.cloneElement(r,{ref:c}):null};Xu.displayName="Presence";function wR(e){const[t,s]=w.useState(),a=w.useRef(null),r=w.useRef(e),c=w.useRef("none"),u=e?"mounted":"unmounted",[f,m]=jR(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=Gc(a.current);c.current=f==="mounted"?p:"none"},[f]),rl(()=>{const p=a.current,v=r.current;if(v!==e){const x=c.current,b=Gc(p);e?m("MOUNT"):b==="none"||p?.display==="none"?m("UNMOUNT"):m(v&&x!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,m]),rl(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,y=b=>{const S=Gc(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=Gc(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:w.useCallback(p=>{a.current=p?getComputedStyle(p):null,s(p)},[])}}function Gc(e){return e?.animationName||"none"}function NR(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 Yh=0;function CR(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vb()),document.body.insertAdjacentElement("beforeend",e[1]??vb()),Yh++,()=>{Yh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Yh--}},[])}function vb(){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 js=function(){return js=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},js.apply(this,arguments)};function Ij(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 kR(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 du="right-scroll-bar-position",fu="width-before-scroll-bar",zR="with-scroll-bars-hidden",_R="--removed-body-scroll-bar-size";function Jh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ER(e,t){var s=w.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"?w.useLayoutEffect:w.useEffect,xb=new WeakMap;function RR(e,t){var s=ER(null,function(a){return e.forEach(function(r){return Jh(r,a)})});return AR(function(){var a=xb.get(s);if(a){var r=new Set(a),c=new Set(e),u=s.current;r.forEach(function(f){c.has(f)||Jh(f,null)}),c.forEach(function(f){r.has(f)||Jh(f,u)})}xb.set(s,e)},[e]),s}function TR(e){return e}function OR(e,t){t===void 0&&(t=TR);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 u=t(c,a);return s.push(u),function(){s=s.filter(function(f){return f!==u})}},assignSyncMedium:function(c){for(a=!0;s.length;){var u=s;s=[],u.forEach(c)}s={push:function(f){return c(f)},filter:function(){return s}}},assignMedium:function(c){a=!0;var u=[];if(s.length){var f=s;s=[],f.forEach(c),u=s}var m=function(){var v=u;u=[],v.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),s={push:function(v){u.push(v),p()},filter:function(v){return u=u.filter(v),s}}}};return r}function LR(e){e===void 0&&(e={});var t=OR(null);return t.options=js({async:!0,ssr:!1},e),t}var Bj=function(e){var t=e.sideCar,s=Ij(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 w.createElement(a,js({},s))};Bj.isSideCarExport=!0;function DR(e,t){return e.useMedium(t),Bj}var qj=LR(),Xh=function(){},Wu=w.forwardRef(function(e,t){var s=w.useRef(null),a=w.useState({onScrollCapture:Xh,onWheelCapture:Xh,onTouchMoveCapture:Xh}),r=a[0],c=a[1],u=e.forwardProps,f=e.children,m=e.className,p=e.removeScrollBar,v=e.enabled,y=e.shards,x=e.sideCar,b=e.noRelative,N=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,R=k===void 0?"div":k,A=e.gapMode,z=Ij(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=x,$=RR([s,t]),E=js(js({},z),r);return w.createElement(w.Fragment,null,v&&w.createElement(O,{sideCar:qj,removeScrollBar:p,shards:y,noRelative:b,noIsolation:N,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:s,gapMode:A}),u?w.cloneElement(w.Children.only(f),js(js({},E),{ref:$})):w.createElement(R,js({},E,{className:m,ref:$}),f))});Wu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Wu.classNames={fullWidth:fu,zeroRight:du};var MR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $R(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=MR();return t&&e.setAttribute("nonce",t),e}function PR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var IR=function(){var e=0,t=null;return{add:function(s){e==0&&(t=$R())&&(PR(t,s),UR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},BR=function(){var e=IR();return function(t,s){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},Hj=function(){var e=BR(),t=function(s){var a=s.styles,r=s.dynamic;return e(a,r),null};return t},qR={left:0,top:0,right:0,gap:0},Wh=function(e){return parseInt(e||"",10)||0},HR=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[Wh(s),Wh(a),Wh(r)]},KR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qR;var t=HR(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])}},GR=Hj(),Or="data-scroll-locked",FR=function(e,t,s,a){var r=e.left,c=e.top,u=e.right,f=e.gap;return s===void 0&&(s="margin"),`
|
|
13
|
-
.`.concat(zR,` {
|
|
14
|
-
overflow: hidden `).concat(a,`;
|
|
15
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
16
|
-
}
|
|
17
|
-
body[`).concat(Or,`] {
|
|
18
|
-
overflow: hidden `).concat(a,`;
|
|
19
|
-
overscroll-behavior: contain;
|
|
20
|
-
`).concat([t&&"position: relative ".concat(a,";"),s==="margin"&&`
|
|
21
|
-
padding-left: `.concat(r,`px;
|
|
22
|
-
padding-top: `).concat(c,`px;
|
|
23
|
-
padding-right: `).concat(u,`px;
|
|
24
|
-
margin-left:0;
|
|
25
|
-
margin-top:0;
|
|
26
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
27
|
-
`),s==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.`).concat(du,` {
|
|
31
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.`).concat(fu,` {
|
|
35
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.`).concat(du," .").concat(du,` {
|
|
39
|
-
right: 0 `).concat(a,`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.`).concat(fu," .").concat(fu,` {
|
|
43
|
-
margin-right: 0 `).concat(a,`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
body[`).concat(Or,`] {
|
|
47
|
-
`).concat(_R,": ").concat(f,`px;
|
|
48
|
-
}
|
|
49
|
-
`)},bb=function(){var e=parseInt(document.body.getAttribute(Or)||"0",10);return isFinite(e)?e:0},ZR=function(){w.useEffect(function(){return document.body.setAttribute(Or,(bb()+1).toString()),function(){var e=bb()-1;e<=0?document.body.removeAttribute(Or):document.body.setAttribute(Or,e.toString())}},[])},VR=function(e){var t=e.noRelative,s=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;ZR();var c=w.useMemo(function(){return KR(r)},[r]);return w.createElement(GR,{styles:FR(c,!t,r,s?"":"!important")})},Dm=!1;if(typeof window<"u")try{var Fc=Object.defineProperty({},"passive",{get:function(){return Dm=!0,!0}});window.addEventListener("test",Fc,Fc),window.removeEventListener("test",Fc,Fc)}catch{Dm=!1}var jr=Dm?{passive:!1}:!1,QR=function(e){return e.tagName==="TEXTAREA"},Kj=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!QR(e)&&s[t]==="visible")},YR=function(e){return Kj(e,"overflowY")},JR=function(e){return Kj(e,"overflowX")},Sb=function(e,t){var s=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=Gj(e,a);if(r){var c=Fj(e,a),u=c[1],f=c[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==s.body);return!1},XR=function(e){var t=e.scrollTop,s=e.scrollHeight,a=e.clientHeight;return[t,s,a]},WR=function(e){var t=e.scrollLeft,s=e.scrollWidth,a=e.clientWidth;return[t,s,a]},Gj=function(e,t){return e==="v"?YR(t):JR(t)},Fj=function(e,t){return e==="v"?XR(t):WR(t)},eT=function(e,t){return e==="h"&&t==="rtl"?-1:1},tT=function(e,t,s,a,r){var c=eT(e,window.getComputedStyle(t).direction),u=c*a,f=s.target,m=t.contains(f),p=!1,v=u>0,y=0,x=0;do{if(!f)break;var b=Fj(e,f),N=b[0],S=b[1],C=b[2],k=S-C-c*N;(N||k)&&Gj(e,f)&&(y+=k,x+=N);var R=f.parentNode;f=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}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},Zc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jb=function(e){return[e.deltaX,e.deltaY]},wb=function(e){return e&&"current"in e?e.current:e},nT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},sT=function(e){return`
|
|
50
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
-
`)},iT=0,wr=[];function aT(e){var t=w.useRef([]),s=w.useRef([0,0]),a=w.useRef(),r=w.useState(iT++)[0],c=w.useState(Hj)[0],u=w.useRef(e);w.useEffect(function(){u.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var S=kR([e.lockRef.current],(e.shards||[]).map(wb),!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=w.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!u.current.allowPinchZoom;var k=Zc(S),R=s.current,A="deltaX"in S?S.deltaX:R[0]-k[0],z="deltaY"in S?S.deltaY:R[1]-k[1],O,$=S.target,E=Math.abs(A)>Math.abs(z)?"h":"v";if("touches"in S&&E==="h"&&$.type==="range")return!1;var L=window.getSelection(),U=L&&L.anchorNode,X=U?U===$||U.contains($):!1;if(X)return!1;var Q=Sb(E,$);if(!Q)return!0;if(Q?O=E:(O=E==="v"?"h":"v",Q=Sb(E,$)),!Q)return!1;if(!a.current&&"changedTouches"in S&&(A||z)&&(a.current=O),!O)return!0;var ee=a.current||O;return tT(ee,C,S,ee==="h"?A:z)},[]),m=w.useCallback(function(S){var C=S;if(!(!wr.length||wr[wr.length-1]!==c)){var k="deltaY"in C?jb(C):Zc(C),R=t.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&nT(O.delta,k)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var A=(u.current.shards||[]).map(wb).filter(Boolean).filter(function(O){return O.contains(C.target)}),z=A.length>0?f(C,A[0]):!u.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),p=w.useCallback(function(S,C,k,R){var A={name:S,delta:C,target:k,should:R,shadowParent:rT(k)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(z){return z!==A})},1)},[]),v=w.useCallback(function(S){s.current=Zc(S),a.current=void 0},[]),y=w.useCallback(function(S){p(S.type,jb(S),S.target,f(S,e.lockRef.current))},[]),x=w.useCallback(function(S){p(S.type,Zc(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return wr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",m,jr),document.addEventListener("touchmove",m,jr),document.addEventListener("touchstart",v,jr),function(){wr=wr.filter(function(S){return S!==c}),document.removeEventListener("wheel",m,jr),document.removeEventListener("touchmove",m,jr),document.removeEventListener("touchstart",v,jr)}},[]);var b=e.removeScrollBar,N=e.inert;return w.createElement(w.Fragment,null,N?w.createElement(c,{styles:sT(r)}):null,b?w.createElement(VR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oT=DR(qj,aT);var Zj=w.forwardRef(function(e,t){return w.createElement(Wu,js({},e,{ref:t,sideCar:oT}))});Zj.classNames=Wu.classNames;var lT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Nr=new WeakMap,Vc=new WeakMap,Qc={},em=0,Vj=function(e){return e&&(e.host||Vj(e.parentNode))},cT=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})},uT=function(e,t,s,a){var r=cT(t,Array.isArray(e)?e:[e]);Qc[s]||(Qc[s]=new WeakMap);var c=Qc[s],u=[],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),N=b!==null&&b!=="false",S=(Nr.get(x)||0)+1,C=(c.get(x)||0)+1;Nr.set(x,S),c.set(x,C),u.push(x),S===1&&N&&Vc.set(x,!0),C===1&&x.setAttribute(s,"true"),N||x.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",x,k)}})};return v(t),f.clear(),em++,function(){u.forEach(function(y){var x=Nr.get(y)-1,b=c.get(y)-1;Nr.set(y,x),c.set(y,b),x||(Vc.has(y)||y.removeAttribute(a),Vc.delete(y)),b||y.removeAttribute(s)}),em--,em||(Nr=new WeakMap,Nr=new WeakMap,Vc=new WeakMap,Qc={})}},dT=function(e,t,s){s===void 0&&(s="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=lT(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),uT(a,r,s,"aria-hidden")):function(){return null}},ed="Dialog",[Qj]=GA(ed),[fT,ds]=Qj(ed),Yj=e=>{const{__scopeDialog:t,children:s,open:a,defaultOpen:r,onOpenChange:c,modal:u=!0}=e,f=w.useRef(null),m=w.useRef(null),[p,v]=YA({prop:a,defaultProp:r??!1,onChange:c,caller:ed});return o.jsx(fT,{scope:t,triggerRef:f,contentRef:m,contentId:Zh(),titleId:Zh(),descriptionId:Zh(),open:p,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(y=>!y),[v]),modal:u,children:s})};Yj.displayName=ed;var Jj="DialogTrigger",hT=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=ds(Jj,s),c=Aa(t,r.triggerRef);return o.jsx(Qs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Ap(r.open),...a,ref:c,onClick:Oi(e.onClick,r.onOpenToggle)})});hT.displayName=Jj;var _p="DialogPortal",[mT,Xj]=Qj(_p,{forceMount:void 0}),Wj=e=>{const{__scopeDialog:t,forceMount:s,children:a,container:r}=e,c=ds(_p,t);return o.jsx(mT,{scope:t,forceMount:s,children:w.Children.map(a,u=>o.jsx(Xu,{present:s||c.open,children:o.jsx(Uj,{asChild:!0,container:r,children:u})}))})};Wj.displayName=_p;var Ru="DialogOverlay",ew=w.forwardRef((e,t)=>{const s=Xj(Ru,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=ds(Ru,e.__scopeDialog);return c.modal?o.jsx(Xu,{present:a||c.open,children:o.jsx(gT,{...r,ref:t})}):null});ew.displayName=Ru;var pT=Oj("DialogOverlay.RemoveScroll"),gT=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=ds(Ru,s);return o.jsx(Zj,{as:pT,allowPinchZoom:!0,shards:[r.contentRef],children:o.jsx(Qs.div,{"data-state":Ap(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),za="DialogContent",tw=w.forwardRef((e,t)=>{const s=Xj(za,e.__scopeDialog),{forceMount:a=s.forceMount,...r}=e,c=ds(za,e.__scopeDialog);return o.jsx(Xu,{present:a||c.open,children:c.modal?o.jsx(yT,{...r,ref:t}):o.jsx(vT,{...r,ref:t})})});tw.displayName=za;var yT=w.forwardRef((e,t)=>{const s=ds(za,e.__scopeDialog),a=w.useRef(null),r=Aa(t,s.contentRef,a);return w.useEffect(()=>{const c=a.current;if(c)return dT(c)},[]),o.jsx(nw,{...e,ref:r,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oi(e.onCloseAutoFocus,c=>{c.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Oi(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&c.preventDefault()}),onFocusOutside:Oi(e.onFocusOutside,c=>c.preventDefault())})}),vT=w.forwardRef((e,t)=>{const s=ds(za,e.__scopeDialog),a=w.useRef(!1),r=w.useRef(!1);return o.jsx(nw,{...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 u=c.target;s.triggerRef.current?.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&r.current&&c.preventDefault()}})}),nw=w.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:c,...u}=e,f=ds(za,s),m=w.useRef(null),p=Aa(t,m);return CR(),o.jsxs(o.Fragment,{children:[o.jsx($j,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:c,children:o.jsx(Dj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Ap(f.open),...u,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(xT,{titleId:f.titleId}),o.jsx(ST,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Ep="DialogTitle",sw=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=ds(Ep,s);return o.jsx(Qs.h2,{id:r.titleId,...a,ref:t})});sw.displayName=Ep;var iw="DialogDescription",aw=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=ds(iw,s);return o.jsx(Qs.p,{id:r.descriptionId,...a,ref:t})});aw.displayName=iw;var rw="DialogClose",ow=w.forwardRef((e,t)=>{const{__scopeDialog:s,...a}=e,r=ds(rw,s);return o.jsx(Qs.button,{type:"button",...a,ref:t,onClick:Oi(e.onClick,()=>r.onOpenChange(!1))})});ow.displayName=rw;function Ap(e){return e?"open":"closed"}var lw="DialogTitleWarning",[aP,cw]=KA(lw,{contentName:za,titleName:Ep,docsSlug:"dialog"}),xT=({titleId:e})=>{const t=cw(lw),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
53
|
-
|
|
54
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
55
|
-
|
|
56
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},bT="DialogDescriptionWarning",ST=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${cw(bT).contentName}}.`;return w.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},uw=Yj,dw=Wj,Rp=ew,Tp=tw,Op=sw,fw=aw,hw=ow;const jT=uw,wT=dw,mw=w.forwardRef(({className:e,...t},s)=>o.jsx(Rp,{ref:s,className:Wn("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));mw.displayName=Rp.displayName;const NT=400,CT=1200,kT=720,pw=w.forwardRef(({className:e,children:t,...s},a)=>{const[r,c]=w.useState(kT),u=w.useRef(!1),f=w.useRef(0),m=w.useRef(0),p=w.useCallback(x=>{u.current=!0,f.current=x.clientX,m.current=r,x.target.setPointerCapture(x.pointerId),x.preventDefault()},[r]),v=w.useCallback(x=>{if(!u.current)return;const b=f.current-x.clientX,N=Math.min(CT,Math.max(NT,m.current+b));c(N)},[]),y=w.useCallback(()=>{u.current=!1},[]);return o.jsxs(wT,{children:[o.jsx(mw,{}),o.jsxs(Tp,{ref:a,className:Wn("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(hw,{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(Zu,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});pw.displayName=Tp.displayName;const zT=({className:e,...t})=>o.jsx("div",{className:Wn("flex flex-col gap-1.5 pr-10",e),...t}),gw=w.forwardRef(({className:e,...t},s)=>o.jsx(Op,{ref:s,className:Wn("text-lg font-medium text-zinc-50",e),...t}));gw.displayName=Op.displayName;const yw=w.forwardRef(({className:e,...t},s)=>o.jsx(fw,{ref:s,className:Wn("text-sm text-zinc-500",e),...t}));yw.displayName=fw.displayName;function _T({title:e,subtitle:t,children:s,open:a,onClose:r}){return o.jsx(jT,{open:a,onOpenChange:c=>c?void 0:r(),children:o.jsxs(pw,{children:[o.jsxs(zT,{className:"drawer-head",children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),o.jsx(gw,{id:"drawer-title",children:e}),o.jsx(yw,{className:"sr-only",children:t})]}),o.jsx("div",{className:"drawer-body",children:s})]})})}function ne(e,t,s){function a(f,m){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,m);const p=u.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 u(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(u,"init",{value:a}),Object.defineProperty(u,Symbol.hasInstance,{value:f=>s?.Parent&&f instanceof s.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class Lr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const xw={};function Mi(e){return xw}function bw(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 Mm(e,t){return typeof t=="bigint"?t.toString():t}function Lp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Dp(e){return e==null}function Mp(e){const t=e.startsWith("^")?1:0,s=e.endsWith("$")?e.length-1:e.length;return e.slice(t,s)}function ET(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,u=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return u%f/10**c}const Nb=Symbol("evaluating");function ct(e,t,s){let a;Object.defineProperty(e,t,{get(){if(a!==Nb)return a===void 0&&(a=Nb,a=s()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Ta(e,t,s){Object.defineProperty(e,t,{value:s,writable:!0,enumerable:!0,configurable:!0})}function qi(...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 Sw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Tu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const RT=Lp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ur(e){if(Tu(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const s=t.prototype;return!(Tu(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function jw(e){return Ur(e)?{...e}:Array.isArray(e)?[...e]:e}const TT=new Set(["string","number","symbol"]);function Ir(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hi(e,t,s){const a=new e._zod.constr(t??e._zod.def);return(!t||s?.parent)&&(a._zod.parent=e),a}function Ce(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 OT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const LT={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 DT(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=qi(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=s.shape[f])}return Ta(this,"shape",u),u},checks:[]});return Hi(e,c)}function MT(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=qi(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in s.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return Ta(this,"shape",u),u},checks:[]});return Hi(e,c)}function $T(e,t){if(!Ur(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 u in t)if(Object.getOwnPropertyDescriptor(c,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const r=qi(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Ta(this,"shape",c),c}});return Hi(e,r)}function PT(e,t){if(!Ur(t))throw new Error("Invalid input to safeExtend: expected a plain object");const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ta(this,"shape",a),a}});return Hi(e,s)}function UT(e,t){const s=qi(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Ta(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Hi(e,s)}function IT(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 u=qi(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 Ta(this,"shape",m),m},checks:[]});return Hi(t,u)}function BT(e,t,s){const a=qi(t._zod.def,{get shape(){const r=t._zod.def.shape,c={...r};if(s)for(const u in s){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);s[u]&&(c[u]=new e({type:"nonoptional",innerType:r[u]}))}else for(const u in r)c[u]=new e({type:"nonoptional",innerType:r[u]});return Ta(this,"shape",c),c}});return Hi(t,a)}function _r(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 Er(e,t){return t.map(s=>{var a;return(a=s).path??(a.path=[]),s.path.unshift(e),s})}function Yc(e){return typeof e=="string"?e:e?.message}function $i(e,t,s){const a={...e,path:e.path??[]};if(!e.message){const r=Yc(e.inst?._zod.def?.error?.(e))??Yc(t?.error?.(e))??Yc(s.customError?.(e))??Yc(s.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function $p(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ll(...e){const[t,s,a]=e;return typeof t=="string"?{message:t,code:"custom",input:s,inst:a}:{...t}}const ww=(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,Mm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Nw=ne("$ZodError",ww),Cw=ne("$ZodError",ww,{Parent:Error});function qT(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 HT(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(u=>a({issues:u}));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 u=s,f=0;for(;f<c.path.length;){const m=c.path[f];f===c.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(t(c))):u[m]=u[m]||{_errors:[]},u=u[m],f++}}};return a(e),s}const Pp=e=>(t,s,a,r)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:s,issues:[]},c);if(u instanceof Promise)throw new Lr;if(u.issues.length){const f=new(r?.Err??e)(u.issues.map(m=>$i(m,c,Mi())));throw Sw(f,r?.callee),f}return u.value},Up=e=>async(t,s,a,r)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:s,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new(r?.Err??e)(u.issues.map(m=>$i(m,c,Mi())));throw Sw(f,r?.callee),f}return u.value},td=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 Lr;return c.issues.length?{success:!1,error:new(e??Nw)(c.issues.map(u=>$i(u,r,Mi())))}:{success:!0,data:c.value}},KT=td(Cw),nd=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(u=>$i(u,r,Mi())))}:{success:!0,data:c.value}},GT=nd(Cw),FT=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Pp(e)(t,s,r)},ZT=e=>(t,s,a)=>Pp(e)(t,s,a),VT=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Up(e)(t,s,r)},QT=e=>async(t,s,a)=>Up(e)(t,s,a),YT=e=>(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return td(e)(t,s,r)},JT=e=>(t,s,a)=>td(e)(t,s,a),XT=e=>async(t,s,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return nd(e)(t,s,r)},WT=e=>async(t,s,a)=>nd(e)(t,s,a),eO=/^[cC][^\s-]{8,}$/,tO=/^[0-9a-z]+$/,nO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sO=/^[0-9a-vA-V]{20}$/,iO=/^[A-Za-z0-9]{27}$/,aO=/^[a-zA-Z0-9_-]{21}$/,rO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,oO=/^([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})$/,kb=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)$/,lO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function uO(){return new RegExp(cO,"u")}const dO=/^(?:(?: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])$/,fO=/^(([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}|:))$/,hO=/^((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])$/,mO=/^(([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])$/,pO=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kw=/^[A-Za-z0-9_-]*$/,gO=/^\+[1-9]\d{6,14}$/,zw="(?:(?:\\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])))",yO=new RegExp(`^${zw}$`);function _w(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 vO(e){return new RegExp(`^${_w(e)}$`)}function xO(e){const t=_w({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(`^${zw}T(?:${a})$`)}const bO=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},SO=/^-?\d+$/,Ew=/^-?\d+(?:\.\d+)?$/,jO=/^(?:true|false)$/i,wO=/^[^A-Z]*$/,NO=/^[^a-z]*$/,Cn=ne("$ZodCheck",(e,t)=>{var s;e._zod??(e._zod={}),e._zod.def=t,(s=e._zod).onattach??(s.onattach=[])}),Aw={number:"number",bigint:"bigint",object:"date"},Rw=ne("$ZodCheckLessThan",(e,t)=>{Cn.init(e,t);const s=Aw[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})}}),Tw=ne("$ZodCheckGreaterThan",(e,t)=>{Cn.init(e,t);const s=Aw[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})}}),CO=ne("$ZodCheckMultipleOf",(e,t)=>{Cn.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):ET(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})}}),kO=ne("$ZodCheckNumberFormat",(e,t)=>{Cn.init(e,t),t.format=t.format||"float64";const s=t.format?.includes("int"),a=s?"int":"number",[r,c]=LT[t.format];e._zod.onattach.push(u=>{const f=u._zod.bag;f.format=t.format,f.minimum=r,f.maximum=c,s&&(f.pattern=SO)}),e._zod.check=u=>{const f=u.value;if(s){if(!Number.isInteger(f)){u.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?u.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}):u.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&&u.issues.push({origin:"number",input:f,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),f>c&&u.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!t.abort})}}),zO=ne("$ZodCheckMaxLength",(e,t)=>{var s;Cn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!Dp(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 u=$p(r);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_O=ne("$ZodCheckMinLength",(e,t)=>{var s;Cn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!Dp(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 u=$p(r);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),EO=ne("$ZodCheckLengthEquals",(e,t)=>{var s;Cn.init(e,t),(s=e._zod.def).when??(s.when=a=>{const r=a.value;return!Dp(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 u=$p(r),f=c>t.length;a.issues.push({origin:u,...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})}}),sd=ne("$ZodCheckStringFormat",(e,t)=>{var s,a;Cn.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=()=>{})}),AO=ne("$ZodCheckRegex",(e,t)=>{sd.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})}}),RO=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=wO),sd.init(e,t)}),TO=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=NO),sd.init(e,t)}),OO=ne("$ZodCheckIncludes",(e,t)=>{Cn.init(e,t);const s=Ir(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})}}),LO=ne("$ZodCheckStartsWith",(e,t)=>{Cn.init(e,t);const s=new RegExp(`^${Ir(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})}}),DO=ne("$ZodCheckEndsWith",(e,t)=>{Cn.init(e,t);const s=new RegExp(`.*${Ir(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})}}),MO=ne("$ZodCheckOverwrite",(e,t)=>{Cn.init(e,t),e._zod.check=s=>{s.value=t.tx(s.value)}});class $O{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
|
-
`).filter(u=>u),r=Math.min(...a.map(u=>u.length-u.trimStart().length)),c=a.map(u=>u.slice(r)).map(u=>" ".repeat(this.indent*2)+u);for(const u of c)this.content.push(u)}compile(){const t=Function,s=this?.args,r=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...s,r.join(`
|
|
58
|
-
`))}}const PO={major:4,minor:3,patch:6},Ct=ne("$ZodType",(e,t)=>{var s;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=PO;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=(u,f,m)=>{let p=_r(u),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(u))continue}else if(p)continue;const x=u.issues.length,b=y._zod.check(u);if(b instanceof Promise&&m?.async===!1)throw new Lr;if(v||b instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await b,u.issues.length!==x&&(p||(p=_r(u,x)))});else{if(u.issues.length===x)continue;p||(p=_r(u,x))}}return v?v.then(()=>u):u},c=(u,f,m)=>{if(_r(u))return u.aborted=!0,u;const p=r(f,a,m);if(p instanceof Promise){if(m.async===!1)throw new Lr;return p.then(v=>e._zod.parse(v,m))}return e._zod.parse(p,m)};e._zod.run=(u,f)=>{if(f.skipChecks)return e._zod.parse(u,f);if(f.direction==="backward"){const p=e._zod.parse({value:u.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(v=>c(v,u,f)):c(p,u,f)}const m=e._zod.parse(u,f);if(m instanceof Promise){if(f.async===!1)throw new Lr;return m.then(p=>r(p,a,f))}return r(m,a,f)}}ct(e,"~standard",()=>({validate:r=>{try{const c=KT(e,r);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return GT(e,r).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),Ip=ne("$ZodString",(e,t)=>{Ct.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??bO(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}}),wt=ne("$ZodStringFormat",(e,t)=>{sd.init(e,t),Ip.init(e,t)}),UO=ne("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=oO),wt.init(e,t)}),IO=ne("$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=kb(a))}else t.pattern??(t.pattern=kb());wt.init(e,t)}),BO=ne("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=lO),wt.init(e,t)}),qO=ne("$ZodURL",(e,t)=>{wt.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})}}}),HO=ne("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=uO()),wt.init(e,t)}),KO=ne("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=aO),wt.init(e,t)}),GO=ne("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eO),wt.init(e,t)}),FO=ne("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tO),wt.init(e,t)}),ZO=ne("$ZodULID",(e,t)=>{t.pattern??(t.pattern=nO),wt.init(e,t)}),VO=ne("$ZodXID",(e,t)=>{t.pattern??(t.pattern=sO),wt.init(e,t)}),QO=ne("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=iO),wt.init(e,t)}),YO=ne("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xO(t)),wt.init(e,t)}),JO=ne("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=yO),wt.init(e,t)}),XO=ne("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vO(t)),wt.init(e,t)}),WO=ne("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=rO),wt.init(e,t)}),eL=ne("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=dO),wt.init(e,t),e._zod.bag.format="ipv4"}),tL=ne("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=fO),wt.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})}}}),nL=ne("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=hO),wt.init(e,t)}),sL=ne("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mO),wt.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 u=Number(c);if(`${u}`!==c)throw new Error;if(u<0||u>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 Ow(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const iL=ne("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=pO),wt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=s=>{Ow(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:e,continue:!t.abort})}});function aL(e){if(!kw.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),s=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ow(s)}const rL=ne("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=kw),wt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=s=>{aL(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:e,continue:!t.abort})}}),oL=ne("$ZodE164",(e,t)=>{t.pattern??(t.pattern=gO),wt.init(e,t)});function lL(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 cL=ne("$ZodJWT",(e,t)=>{wt.init(e,t),e._zod.check=s=>{lL(s.value,t.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:e,continue:!t.abort})}}),Lw=ne("$ZodNumber",(e,t)=>{Ct.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ew,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}}),uL=ne("$ZodNumberFormat",(e,t)=>{kO.init(e,t),Lw.init(e,t)}),dL=ne("$ZodBoolean",(e,t)=>{Ct.init(e,t),e._zod.pattern=jO,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}}),fL=ne("$ZodUnknown",(e,t)=>{Ct.init(e,t),e._zod.parse=s=>s}),hL=ne("$ZodNever",(e,t)=>{Ct.init(e,t),e._zod.parse=(s,a)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:e}),s)});function zb(e,t,s){e.issues.length&&t.issues.push(...Er(s,e.issues)),t.value[s]=e.value}const mL=ne("$ZodArray",(e,t)=>{Ct.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 u=0;u<r.length;u++){const f=r[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?c.push(m.then(p=>zb(p,s,u))):zb(m,s,u)}return c.length?Promise.all(c).then(()=>s):s}});function Ou(e,t,s,a,r){if(e.issues.length){if(r&&!(s in a))return;t.issues.push(...Er(s,e.issues))}e.value===void 0?s in a&&(t.value[s]=void 0):t.value[s]=e.value}function Dw(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=OT(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Mw(e,t,s,a,r,c){const u=[],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"){u.push(y);continue}const x=m.run({value:t[y],issues:[]},a);x instanceof Promise?e.push(x.then(b=>Ou(b,s,y,t,v))):Ou(x,s,y,t,v)}return u.length&&s.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:c}),e.length?Promise.all(e).then(()=>s):s}const pL=ne("$ZodObject",(e,t)=>{if(Ct.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=Lp(()=>Dw(t));ct(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=Tu,c=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=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=u.shape;for(const x of u.keys){const b=y[x],N=b._zod.optout==="optional",S=b._zod.run({value:p[x],issues:[]},m);S instanceof Promise?v.push(S.then(C=>Ou(C,f,x,p,N))):Ou(S,f,x,p,N)}return c?Mw(v,p,f,m,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),gL=ne("$ZodObjectJIT",(e,t)=>{pL.init(e,t);const s=e._zod.parse,a=Lp(()=>Dw(t)),r=x=>{const b=new $O(["shape","payload","ctx"]),N=a.value,S=A=>{const z=Cb(A);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};b.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const A of N.keys)C[A]=`key_${k++}`;b.write("const newResult = {};");for(const A of N.keys){const z=C[A],O=Cb(A),E=x[A]?._zod?.optout==="optional";b.write(`const ${z} = ${S(A)};`),E?b.write(`
|
|
59
|
-
if (${z}.issues.length) {
|
|
60
|
-
if (${O} in input) {
|
|
61
|
-
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
62
|
-
...iss,
|
|
63
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
64
|
-
})));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (${z}.value === undefined) {
|
|
69
|
-
if (${O} in input) {
|
|
70
|
-
newResult[${O}] = undefined;
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
newResult[${O}] = ${z}.value;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
`):b.write(`
|
|
77
|
-
if (${z}.issues.length) {
|
|
78
|
-
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
79
|
-
...iss,
|
|
80
|
-
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
81
|
-
})));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (${z}.value === undefined) {
|
|
85
|
-
if (${O} in input) {
|
|
86
|
-
newResult[${O}] = undefined;
|
|
87
|
-
}
|
|
88
|
-
} else {
|
|
89
|
-
newResult[${O}] = ${z}.value;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
`)}b.write("payload.value = newResult;"),b.write("return payload;");const R=b.compile();return(A,z)=>R(x,A,z)};let c;const u=Tu,f=!xw.jitless,p=f&&RT.value,v=t.catchall;let y;e._zod.parse=(x,b)=>{y??(y=a.value);const N=x.value;return u(N)?f&&p&&b?.async===!1&&b.jitless!==!0?(c||(c=r(t.shape)),x=c(x,b),v?Mw([],N,x,b,y,e):x):s(x,b):(x.issues.push({expected:"object",code:"invalid_type",input:N,inst:e}),x)}});function _b(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=>!_r(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(u=>$i(u,a,Mi())))}),t)}const yL=ne("$ZodUnion",(e,t)=>{Ct.init(e,t),ct(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ct(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ct(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ct(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=>Mp(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 u=!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),u=!0;else{if(p.issues.length===0)return p;f.push(p)}}return u?Promise.all(f).then(m=>_b(m,r,e,c)):_b(f,r,e,c)}}),vL=ne("$ZodIntersection",(e,t)=>{Ct.init(e,t),e._zod.parse=(s,a)=>{const r=s.value,c=t.left._zod.run({value:r,issues:[]},a),u=t.right._zod.run({value:r,issues:[]},a);return c instanceof Promise||u instanceof Promise?Promise.all([c,u]).then(([m,p])=>Eb(s,m,p)):Eb(s,c,u)}});function $m(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(Ur(e)&&Ur(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 u=$m(e[c],t[c]);if(!u.valid)return{valid:!1,mergeErrorPath:[c,...u.mergeErrorPath]};r[c]=u.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],u=$m(r,c);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};s.push(u.data)}return{valid:!0,data:s}}return{valid:!1,mergeErrorPath:[]}}function Eb(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}),_r(e))return e;const u=$m(t.value,s.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const xL=ne("$ZodRecord",(e,t)=>{Ct.init(e,t),e._zod.parse=(s,a)=>{const r=s.value;if(!Ur(r))return s.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),s;const c=[],u=t.keyType._zod.values;if(u){s.value={};const f=new Set;for(const p of u)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(...Er(p,y.issues)),s.value[p]=y.value})):(v.issues.length&&s.issues.push(...Er(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"&&Ew.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=>$i(y,a,Mi())),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(...Er(f,y.issues)),s.value[m.value]=y.value})):(v.issues.length&&s.issues.push(...Er(f,v.issues)),s.value[m.value]=v.value)}}return c.length?Promise.all(c).then(()=>s):s}}),bL=ne("$ZodEnum",(e,t)=>{Ct.init(e,t);const s=bw(t.entries),a=new Set(s);e._zod.values=a,e._zod.pattern=new RegExp(`^(${s.filter(r=>TT.has(typeof r)).map(r=>typeof r=="string"?Ir(r):r.toString()).join("|")})$`),e._zod.parse=(r,c)=>{const u=r.value;return a.has(u)||r.issues.push({code:"invalid_value",values:s,input:u,inst:e}),r}}),SL=ne("$ZodLiteral",(e,t)=>{if(Ct.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"?Ir(a):a?Ir(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}}),jL=ne("$ZodTransform",(e,t)=>{Ct.init(e,t),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new vw(e.constructor.name);const r=t.transform(s.value,s);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(u=>(s.value=u,s));if(r instanceof Promise)throw new Lr;return s.value=r,s}});function Ab(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const $w=ne("$ZodOptional",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ct(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${Mp(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=>Ab(c,s.value)):Ab(r,s.value)}return s.value===void 0?s:t.innerType._zod.run(s,a)}}),wL=ne("$ZodExactOptional",(e,t)=>{$w.init(e,t),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(s,a)=>t.innerType._zod.run(s,a)}),NL=ne("$ZodNullable",(e,t)=>{Ct.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(e._zod,"pattern",()=>{const s=t.innerType._zod.pattern;return s?new RegExp(`^(${Mp(s.source)}|null)$`):void 0}),ct(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)}),CL=ne("$ZodDefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",ct(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=>Rb(c,t)):Rb(r,t)}});function Rb(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const kL=ne("$ZodPrefault",(e,t)=>{Ct.init(e,t),e._zod.optin="optional",ct(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))}),zL=ne("$ZodNonOptional",(e,t)=>{Ct.init(e,t),ct(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=>Tb(c,e)):Tb(r,e)}});function Tb(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 _L=ne("$ZodCatch",(e,t)=>{Ct.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(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(u=>$i(u,a,Mi()))},input:s.value}),s.issues=[]),s)):(s.value=r.value,r.issues.length&&(s.value=t.catchValue({...s,error:{issues:r.issues.map(c=>$i(c,a,Mi()))},input:s.value}),s.issues=[]),s)}}),EL=ne("$ZodPipe",(e,t)=>{Ct.init(e,t),ct(e._zod,"values",()=>t.in._zod.values),ct(e._zod,"optin",()=>t.in._zod.optin),ct(e._zod,"optout",()=>t.out._zod.optout),ct(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(u=>Jc(u,t.in,a)):Jc(c,t.in,a)}const r=t.in._zod.run(s,a);return r instanceof Promise?r.then(c=>Jc(c,t.out,a)):Jc(r,t.out,a)}});function Jc(e,t,s){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},s)}const AL=ne("$ZodReadonly",(e,t)=>{Ct.init(e,t),ct(e._zod,"propValues",()=>t.innerType._zod.propValues),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"optin",()=>t.innerType?._zod?.optin),ct(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(Ob):Ob(r)}});function Ob(e){return e.value=Object.freeze(e.value),e}const RL=ne("$ZodCustom",(e,t)=>{Cn.init(e,t),Ct.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=>Lb(c,s,a,e));Lb(r,s,a,e)}});function Lb(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(ll(r))}}var Db;class TL{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 OL(){return new TL}(Db=globalThis).__zod_globalRegistry??(Db.__zod_globalRegistry=OL());const Vo=globalThis.__zod_globalRegistry;function LL(e,t){return new e({type:"string",...Ce(t)})}function DL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ce(t)})}function Mb(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ce(t)})}function ML(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ce(t)})}function $L(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ce(t)})}function PL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ce(t)})}function UL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ce(t)})}function IL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ce(t)})}function BL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ce(t)})}function qL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ce(t)})}function HL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ce(t)})}function KL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ce(t)})}function GL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ce(t)})}function FL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ce(t)})}function ZL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ce(t)})}function VL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ce(t)})}function QL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ce(t)})}function YL(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ce(t)})}function JL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ce(t)})}function XL(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ce(t)})}function WL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ce(t)})}function eD(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ce(t)})}function tD(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ce(t)})}function nD(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ce(t)})}function sD(e,t){return new e({type:"string",format:"date",check:"string_format",...Ce(t)})}function iD(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ce(t)})}function aD(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ce(t)})}function rD(e,t){return new e({type:"number",checks:[],...Ce(t)})}function oD(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ce(t)})}function lD(e,t){return new e({type:"boolean",...Ce(t)})}function cD(e){return new e({type:"unknown"})}function uD(e,t){return new e({type:"never",...Ce(t)})}function $b(e,t){return new Rw({check:"less_than",...Ce(t),value:e,inclusive:!1})}function tm(e,t){return new Rw({check:"less_than",...Ce(t),value:e,inclusive:!0})}function Pb(e,t){return new Tw({check:"greater_than",...Ce(t),value:e,inclusive:!1})}function nm(e,t){return new Tw({check:"greater_than",...Ce(t),value:e,inclusive:!0})}function Ub(e,t){return new CO({check:"multiple_of",...Ce(t),value:e})}function Pw(e,t){return new zO({check:"max_length",...Ce(t),maximum:e})}function Lu(e,t){return new _O({check:"min_length",...Ce(t),minimum:e})}function Uw(e,t){return new EO({check:"length_equals",...Ce(t),length:e})}function dD(e,t){return new AO({check:"string_format",format:"regex",...Ce(t),pattern:e})}function fD(e){return new RO({check:"string_format",format:"lowercase",...Ce(e)})}function hD(e){return new TO({check:"string_format",format:"uppercase",...Ce(e)})}function mD(e,t){return new OO({check:"string_format",format:"includes",...Ce(t),includes:e})}function pD(e,t){return new LO({check:"string_format",format:"starts_with",...Ce(t),prefix:e})}function gD(e,t){return new DO({check:"string_format",format:"ends_with",...Ce(t),suffix:e})}function Hr(e){return new MO({check:"overwrite",tx:e})}function yD(e){return Hr(t=>t.normalize(e))}function vD(){return Hr(e=>e.trim())}function xD(){return Hr(e=>e.toLowerCase())}function bD(){return Hr(e=>e.toUpperCase())}function SD(){return Hr(e=>AT(e))}function jD(e,t,s){return new e({type:"array",element:t,...Ce(s)})}function wD(e,t,s){return new e({type:"custom",check:"custom",fn:t,...Ce(s)})}function ND(e){const t=CD(s=>(s.addIssue=a=>{if(typeof a=="string")s.issues.push(ll(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(ll(r))}},e(s.value,s)));return t}function CD(e,t){const s=new Cn({check:"custom",...Ce(t)});return s._zod.check=e,s}function Iw(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??Vo,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 Ht(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 u={schema:{},count:1,cycle:void 0,path:s.path};t.seen.set(e,u);const f=e._zod.toJSONSchema?.();if(f)u.schema=f;else{const v={...s,schemaPath:[...s.schemaPath,e],path:s.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,v);else{const x=u.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&&(u.ref||(u.ref=y),Ht(y,t,v),t.seen.get(y).isParent=!0)}const m=t.metadataRegistry.get(e);return m&&Object.assign(u.schema,m),t.io==="input"&&dn(e)&&(delete u.schema.examples,delete u.schema.default),t.io==="input"&&u.schema._prefault&&((a=u.schema).default??(a.default=u.schema._prefault)),delete u.schema._prefault,t.seen.get(e).schema}function Bw(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 u of e.seen.entries()){const f=e.metadataRegistry.get(u[0])?.id;if(f){const m=a.get(f);if(m&&m!==u[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,u[0])}}const r=u=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(u[0])?.id,x=e.external.uri??(N=>N);if(y)return{ref:x(y)};const b=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=b,{defId:b,ref:`${x("__shared")}#/${f}/${b}`}}if(u[1]===s)return{ref:"#"};const p=`#/${f}/`,v=u[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+v}},c=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:m,defId:p}=r(u);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 u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
93
|
-
|
|
94
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(t===u[0]){c(u);continue}if(e.external){const p=e.external.registry.get(u[0])?.id;if(t!==u[0]&&p){c(u);continue}}if(e.metadataRegistry.get(u[0])?.id){c(u);continue}if(f.cycle){c(u);continue}if(f.count>1&&e.reused==="ref"){c(u);continue}}}function qw(e,t){const s=e.seen.get(t);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=u=>{const f=e.seen.get(u);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),u._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=u._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:u,jsonSchema:m,path:f.path??[]})};for(const u of[...e.seen.entries()].reverse())a(u[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 u=e.external.registry.get(t)?.id;if(!u)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(u)}Object.assign(r,s.def??s.schema);const c=e.external?.defs??{};for(const u of e.seen.entries()){const f=u[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 u=JSON.parse(JSON.stringify(r));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Du(t,"input",e.processors),output:Du(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function dn(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 dn(a.element,s);if(a.type==="set")return dn(a.valueType,s);if(a.type==="lazy")return dn(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 dn(a.innerType,s);if(a.type==="intersection")return dn(a.left,s)||dn(a.right,s);if(a.type==="record"||a.type==="map")return dn(a.keyType,s)||dn(a.valueType,s);if(a.type==="pipe")return dn(a.in,s)||dn(a.out,s);if(a.type==="object"){for(const r in a.shape)if(dn(a.shape[r],s))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(dn(r,s))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(dn(r,s))return!0;return!!(a.rest&&dn(a.rest,s))}return!1}const kD=(e,t={})=>s=>{const a=Iw({...s,processors:t});return Ht(e,a),Bw(a,e),qw(a,e)},Du=(e,t,s={})=>a=>{const{libraryOptions:r,target:c}=a??{},u=Iw({...r??{},target:c,io:t,processors:s});return Ht(e,u),Bw(u,e),qw(u,e)},zD={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_D=(e,t,s,a)=>{const r=s;r.type="string";const{minimum:c,maximum:u,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(r.minLength=c),typeof u=="number"&&(r.maxLength=u),f&&(r.format=zD[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}))])}},ED=(e,t,s,a)=>{const r=s,{minimum:c,maximum:u,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 u=="number"&&(r.maximum=u,typeof p=="number"&&t.target!=="draft-04"&&(p<=u?delete r.maximum:delete r.exclusiveMaximum)),typeof m=="number"&&(r.multipleOf=m)},AD=(e,t,s,a)=>{s.type="boolean"},RD=(e,t,s,a)=>{s.not={}},TD=(e,t,s,a)=>{},OD=(e,t,s,a)=>{const r=e._zod.def,c=bw(r.entries);c.every(u=>typeof u=="number")&&(s.type="number"),c.every(u=>typeof u=="string")&&(s.type="string"),s.enum=c},LD=(e,t,s,a)=>{const r=e._zod.def,c=[];for(const u of r.values)if(u===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(u))}else c.push(u);if(c.length!==0)if(c.length===1){const u=c[0];s.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?s.enum=[u]:s.const=u}else c.every(u=>typeof u=="number")&&(s.type="number"),c.every(u=>typeof u=="string")&&(s.type="string"),c.every(u=>typeof u=="boolean")&&(s.type="boolean"),c.every(u=>u===null)&&(s.type="null"),s.enum=c},DD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},MD=(e,t,s,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$D=(e,t,s,a)=>{const r=s,c=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(r.minItems=u),typeof f=="number"&&(r.maxItems=f),r.type="array",r.items=Ht(c.element,t,{...a,path:[...a.path,"items"]})},PD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object",r.properties={};const u=c.shape;for(const p in u)r.properties[p]=Ht(u[p],t,{...a,path:[...a.path,"properties",p]});const f=new Set(Object.keys(u)),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=Ht(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},UD=(e,t,s,a)=>{const r=e._zod.def,c=r.inclusive===!1,u=r.options.map((f,m)=>Ht(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?s.oneOf=u:s.anyOf=u},ID=(e,t,s,a)=>{const r=e._zod.def,c=Ht(r.left,t,{...a,path:[...a.path,"allOf",0]}),u=Ht(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(u)?u.allOf:[u]];s.allOf=m},BD=(e,t,s,a)=>{const r=s,c=e._zod.def;r.type="object";const u=c.keyType,m=u._zod.bag?.patterns;if(c.mode==="loose"&&m&&m.size>0){const v=Ht(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=Ht(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),r.additionalProperties=Ht(c.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const p=u._zod.values;if(p){const v=[...p].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(r.required=v)}},qD=(e,t,s,a)=>{const r=e._zod.def,c=Ht(r.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=r.innerType,s.nullable=!0):s.anyOf=[c,{type:"null"}]},HD=(e,t,s,a)=>{const r=e._zod.def;Ht(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},KD=(e,t,s,a)=>{const r=e._zod.def;Ht(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType,s.default=JSON.parse(JSON.stringify(r.defaultValue))},GD=(e,t,s,a)=>{const r=e._zod.def;Ht(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)))},FD=(e,t,s,a)=>{const r=e._zod.def;Ht(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType;let u;try{u=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=u},ZD=(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;Ht(c,t,a);const u=t.seen.get(e);u.ref=c},VD=(e,t,s,a)=>{const r=e._zod.def;Ht(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;Ht(r.innerType,t,a);const c=t.seen.get(e);c.ref=r.innerType},QD=ne("ZodISODateTime",(e,t)=>{YO.init(e,t),zt.init(e,t)});function YD(e){return nD(QD,e)}const JD=ne("ZodISODate",(e,t)=>{JO.init(e,t),zt.init(e,t)});function XD(e){return sD(JD,e)}const WD=ne("ZodISOTime",(e,t)=>{XO.init(e,t),zt.init(e,t)});function e5(e){return iD(WD,e)}const t5=ne("ZodISODuration",(e,t)=>{WO.init(e,t),zt.init(e,t)});function n5(e){return aD(t5,e)}const s5=(e,t)=>{Nw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:s=>HT(e,s)},flatten:{value:s=>qT(e,s)},addIssue:{value:s=>{e.issues.push(s),e.message=JSON.stringify(e.issues,Mm,2)}},addIssues:{value:s=>{e.issues.push(...s),e.message=JSON.stringify(e.issues,Mm,2)}},isEmpty:{get(){return e.issues.length===0}}})},es=ne("ZodError",s5,{Parent:Error}),i5=Pp(es),a5=Up(es),r5=td(es),o5=nd(es),l5=FT(es),c5=ZT(es),u5=VT(es),d5=QT(es),f5=YT(es),h5=JT(es),m5=XT(es),p5=WT(es),kt=ne("ZodType",(e,t)=>(Ct.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Du(e,"input"),output:Du(e,"output")}}),e.toJSONSchema=kD(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...s)=>e.clone(qi(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)=>Hi(e,s,a),e.brand=()=>e,e.register=((s,a)=>(s.add(e,a),e)),e.parse=(s,a)=>i5(e,s,a,{callee:e.parse}),e.safeParse=(s,a)=>r5(e,s,a),e.parseAsync=async(s,a)=>a5(e,s,a,{callee:e.parseAsync}),e.safeParseAsync=async(s,a)=>o5(e,s,a),e.spa=e.safeParseAsync,e.encode=(s,a)=>l5(e,s,a),e.decode=(s,a)=>c5(e,s,a),e.encodeAsync=async(s,a)=>u5(e,s,a),e.decodeAsync=async(s,a)=>d5(e,s,a),e.safeEncode=(s,a)=>f5(e,s,a),e.safeDecode=(s,a)=>h5(e,s,a),e.safeEncodeAsync=async(s,a)=>m5(e,s,a),e.safeDecodeAsync=async(s,a)=>p5(e,s,a),e.refine=(s,a)=>e.check(cM(s,a)),e.superRefine=s=>e.check(uM(s)),e.overwrite=s=>e.check(Hr(s)),e.optional=()=>qb(e),e.exactOptional=()=>Y5(e),e.nullable=()=>Hb(e),e.nullish=()=>qb(Hb(e)),e.nonoptional=s=>nM(e,s),e.array=()=>Ne(e),e.or=s=>q5([e,s]),e.and=s=>K5(e,s),e.transform=s=>Kb(e,V5(s)),e.default=s=>W5(e,s),e.prefault=s=>tM(e,s),e.catch=s=>iM(e,s),e.pipe=s=>Kb(e,s),e.readonly=()=>oM(e),e.describe=s=>{const a=e.clone();return Vo.add(a,{description:s}),a},Object.defineProperty(e,"description",{get(){return Vo.get(e)?.description},configurable:!0}),e.meta=(...s)=>{if(s.length===0)return Vo.get(e);const a=e.clone();return Vo.add(a,s[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=s=>s(e),e)),Kw=ne("_ZodString",(e,t)=>{Ip.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>_D(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(dD(...a)),e.includes=(...a)=>e.check(mD(...a)),e.startsWith=(...a)=>e.check(pD(...a)),e.endsWith=(...a)=>e.check(gD(...a)),e.min=(...a)=>e.check(Lu(...a)),e.max=(...a)=>e.check(Pw(...a)),e.length=(...a)=>e.check(Uw(...a)),e.nonempty=(...a)=>e.check(Lu(1,...a)),e.lowercase=a=>e.check(fD(a)),e.uppercase=a=>e.check(hD(a)),e.trim=()=>e.check(vD()),e.normalize=(...a)=>e.check(yD(...a)),e.toLowerCase=()=>e.check(xD()),e.toUpperCase=()=>e.check(bD()),e.slugify=()=>e.check(SD())}),g5=ne("ZodString",(e,t)=>{Ip.init(e,t),Kw.init(e,t),e.email=s=>e.check(DL(y5,s)),e.url=s=>e.check(IL(v5,s)),e.jwt=s=>e.check(tD(O5,s)),e.emoji=s=>e.check(BL(x5,s)),e.guid=s=>e.check(Mb(Ib,s)),e.uuid=s=>e.check(ML(Xc,s)),e.uuidv4=s=>e.check($L(Xc,s)),e.uuidv6=s=>e.check(PL(Xc,s)),e.uuidv7=s=>e.check(UL(Xc,s)),e.nanoid=s=>e.check(qL(b5,s)),e.guid=s=>e.check(Mb(Ib,s)),e.cuid=s=>e.check(HL(S5,s)),e.cuid2=s=>e.check(KL(j5,s)),e.ulid=s=>e.check(GL(w5,s)),e.base64=s=>e.check(XL(A5,s)),e.base64url=s=>e.check(WL(R5,s)),e.xid=s=>e.check(FL(N5,s)),e.ksuid=s=>e.check(ZL(C5,s)),e.ipv4=s=>e.check(VL(k5,s)),e.ipv6=s=>e.check(QL(z5,s)),e.cidrv4=s=>e.check(YL(_5,s)),e.cidrv6=s=>e.check(JL(E5,s)),e.e164=s=>e.check(eD(T5,s)),e.datetime=s=>e.check(YD(s)),e.date=s=>e.check(XD(s)),e.time=s=>e.check(e5(s)),e.duration=s=>e.check(n5(s))});function D(e){return LL(g5,e)}const zt=ne("ZodStringFormat",(e,t)=>{wt.init(e,t),Kw.init(e,t)}),y5=ne("ZodEmail",(e,t)=>{BO.init(e,t),zt.init(e,t)}),Ib=ne("ZodGUID",(e,t)=>{UO.init(e,t),zt.init(e,t)}),Xc=ne("ZodUUID",(e,t)=>{IO.init(e,t),zt.init(e,t)}),v5=ne("ZodURL",(e,t)=>{qO.init(e,t),zt.init(e,t)}),x5=ne("ZodEmoji",(e,t)=>{HO.init(e,t),zt.init(e,t)}),b5=ne("ZodNanoID",(e,t)=>{KO.init(e,t),zt.init(e,t)}),S5=ne("ZodCUID",(e,t)=>{GO.init(e,t),zt.init(e,t)}),j5=ne("ZodCUID2",(e,t)=>{FO.init(e,t),zt.init(e,t)}),w5=ne("ZodULID",(e,t)=>{ZO.init(e,t),zt.init(e,t)}),N5=ne("ZodXID",(e,t)=>{VO.init(e,t),zt.init(e,t)}),C5=ne("ZodKSUID",(e,t)=>{QO.init(e,t),zt.init(e,t)}),k5=ne("ZodIPv4",(e,t)=>{eL.init(e,t),zt.init(e,t)}),z5=ne("ZodIPv6",(e,t)=>{tL.init(e,t),zt.init(e,t)}),_5=ne("ZodCIDRv4",(e,t)=>{nL.init(e,t),zt.init(e,t)}),E5=ne("ZodCIDRv6",(e,t)=>{sL.init(e,t),zt.init(e,t)}),A5=ne("ZodBase64",(e,t)=>{iL.init(e,t),zt.init(e,t)}),R5=ne("ZodBase64URL",(e,t)=>{rL.init(e,t),zt.init(e,t)}),T5=ne("ZodE164",(e,t)=>{oL.init(e,t),zt.init(e,t)}),O5=ne("ZodJWT",(e,t)=>{cL.init(e,t),zt.init(e,t)}),Gw=ne("ZodNumber",(e,t)=>{Lw.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>ED(e,a,r),e.gt=(a,r)=>e.check(Pb(a,r)),e.gte=(a,r)=>e.check(nm(a,r)),e.min=(a,r)=>e.check(nm(a,r)),e.lt=(a,r)=>e.check($b(a,r)),e.lte=(a,r)=>e.check(tm(a,r)),e.max=(a,r)=>e.check(tm(a,r)),e.int=a=>e.check(Bb(a)),e.safe=a=>e.check(Bb(a)),e.positive=a=>e.check(Pb(0,a)),e.nonnegative=a=>e.check(nm(0,a)),e.negative=a=>e.check($b(0,a)),e.nonpositive=a=>e.check(tm(0,a)),e.multipleOf=(a,r)=>e.check(Ub(a,r)),e.step=(a,r)=>e.check(Ub(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 _e(e){return rD(Gw,e)}const L5=ne("ZodNumberFormat",(e,t)=>{uL.init(e,t),Gw.init(e,t)});function Bb(e){return oD(L5,e)}const D5=ne("ZodBoolean",(e,t)=>{dL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>AD(e,s,a)});function Lt(e){return lD(D5,e)}const M5=ne("ZodUnknown",(e,t)=>{fL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>TD()});function Mu(){return cD(M5)}const $5=ne("ZodNever",(e,t)=>{hL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>RD(e,s,a)});function P5(e){return uD($5,e)}const U5=ne("ZodArray",(e,t)=>{mL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>$D(e,s,a,r),e.element=t.element,e.min=(s,a)=>e.check(Lu(s,a)),e.nonempty=s=>e.check(Lu(1,s)),e.max=(s,a)=>e.check(Pw(s,a)),e.length=(s,a)=>e.check(Uw(s,a)),e.unwrap=()=>e.element});function Ne(e,t){return jD(U5,e,t)}const I5=ne("ZodObject",(e,t)=>{gL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>PD(e,s,a,r),ct(e,"shape",()=>t.shape),e.keyof=()=>Zt(Object.keys(e._zod.def.shape)),e.catchall=s=>e.clone({...e._zod.def,catchall:s}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Mu()}),e.loose=()=>e.clone({...e._zod.def,catchall:Mu()}),e.strict=()=>e.clone({...e._zod.def,catchall:P5()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=s=>$T(e,s),e.safeExtend=s=>PT(e,s),e.merge=s=>UT(e,s),e.pick=s=>DT(e,s),e.omit=s=>MT(e,s),e.partial=(...s)=>IT(Fw,e,s[0]),e.required=(...s)=>BT(Zw,e,s[0])});function je(e,t){const s={type:"object",shape:e??{},...Ce(t)};return new I5(s)}const B5=ne("ZodUnion",(e,t)=>{yL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>UD(e,s,a,r),e.options=t.options});function q5(e,t){return new B5({type:"union",options:e,...Ce(t)})}const H5=ne("ZodIntersection",(e,t)=>{vL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ID(e,s,a,r)});function K5(e,t){return new H5({type:"intersection",left:e,right:t})}const G5=ne("ZodRecord",(e,t)=>{xL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>BD(e,s,a,r),e.keyType=t.keyType,e.valueType=t.valueType});function ml(e,t,s){return new G5({type:"record",keyType:e,valueType:t,...Ce(s)})}const Pm=ne("ZodEnum",(e,t)=>{bL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(a,r,c)=>OD(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 u of a)if(s.has(u))c[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...t,checks:[],...Ce(r),entries:c})},e.exclude=(a,r)=>{const c={...t.entries};for(const u of a)if(s.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new Pm({...t,checks:[],...Ce(r),entries:c})}});function Zt(e,t){const s=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Pm({type:"enum",entries:s,...Ce(t)})}const F5=ne("ZodLiteral",(e,t)=>{SL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>LD(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 cl(e,t){return new F5({type:"literal",values:Array.isArray(e)?e:[e],...Ce(t)})}const Z5=ne("ZodTransform",(e,t)=>{jL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>MD(e,s),e._zod.parse=(s,a)=>{if(a.direction==="backward")throw new vw(e.constructor.name);s.addIssue=c=>{if(typeof c=="string")s.issues.push(ll(c,s.value,t));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=s.value),u.inst??(u.inst=e),s.issues.push(ll(u))}};const r=t.transform(s.value,s);return r instanceof Promise?r.then(c=>(s.value=c,s)):(s.value=r,s)}});function V5(e){return new Z5({type:"transform",transform:e})}const Fw=ne("ZodOptional",(e,t)=>{$w.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function qb(e){return new Fw({type:"optional",innerType:e})}const Q5=ne("ZodExactOptional",(e,t)=>{wL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>Hw(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Y5(e){return new Q5({type:"optional",innerType:e})}const J5=ne("ZodNullable",(e,t)=>{NL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>qD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function Hb(e){return new J5({type:"nullable",innerType:e})}const X5=ne("ZodDefault",(e,t)=>{CL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>KD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function W5(e,t){return new X5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jw(t)}})}const eM=ne("ZodPrefault",(e,t)=>{kL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>GD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function tM(e,t){return new eM({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jw(t)}})}const Zw=ne("ZodNonOptional",(e,t)=>{zL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>HD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function nM(e,t){return new Zw({type:"nonoptional",innerType:e,...Ce(t)})}const sM=ne("ZodCatch",(e,t)=>{_L.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>FD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function iM(e,t){return new sM({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const aM=ne("ZodPipe",(e,t)=>{EL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>ZD(e,s,a,r),e.in=t.in,e.out=t.out});function Kb(e,t){return new aM({type:"pipe",in:e,out:t})}const rM=ne("ZodReadonly",(e,t)=>{AL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>VD(e,s,a,r),e.unwrap=()=>e._zod.def.innerType});function oM(e){return new rM({type:"readonly",innerType:e})}const lM=ne("ZodCustom",(e,t)=>{RL.init(e,t),kt.init(e,t),e._zod.processJSONSchema=(s,a,r)=>DD(e,s)});function cM(e,t={}){return wD(lM,e,t)}function uM(e){return ND(e)}je({maxConcurrency:_e().int().positive(),maxRequestsPerMinute:_e().int().positive(),maxRequestsPerDay:_e().int().positive()});const Kr=D().min(1);D().min(1);const Bp=je({label:D().min(1),city:D().min(1),region:D().min(1),country:D().length(2),timezone:D().optional()}),Vw=Zt(["citation.lost","citation.gained","run.completed","run.failed"]);je({id:D(),projectId:D(),channel:cl("webhook"),url:D().url(),urlDisplay:D(),urlHost:D(),events:Ne(Vw),enabled:Lt().default(!0),webhookSecret:D().optional(),createdAt:D(),updatedAt:D()});const Qw=Zt(["cli","api","config-file"]);function dM(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 fM(e,t){return t?e.some(s=>s.label===t):!0}je({displayName:D().min(1),canonicalDomain:D().min(1),ownedDomains:Ne(D().min(1)).optional(),country:D().length(2),language:D().min(2),tags:Ne(D()).optional(),labels:ml(D(),D()).optional(),providers:Ne(Kr).optional(),locations:Ne(Bp).optional(),defaultLocation:D().nullable().optional(),configSource:Qw.optional()});je({id:D(),name:D(),displayName:D().optional(),canonicalDomain:D(),ownedDomains:Ne(D()).default([]),country:D().length(2),language:D().min(2),tags:Ne(D()).default([]),labels:ml(D(),D()).default({}),locations:Ne(Bp).default([]),defaultLocation:D().nullable().optional(),configSource:Qw.default("cli"),configRevision:_e().int().positive().default(1),createdAt:D().optional(),updatedAt:D().optional()});function Um(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function hM(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],s=new Set,a=[];for(const r of t){const c=r.trim();if(!c)continue;const u=Um(c);s.has(u)||(s.add(u),a.push(c))}return a}const mM=je({name:D().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:ml(D(),D()).optional().default({})}),pM=je({preset:D().optional(),cron:D().optional(),timezone:D().optional().default("UTC"),providers:Ne(Kr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),gM=je({channel:cl("webhook"),url:D().url(),events:Ne(Vw).min(1)}),yM=je({gsc:je({propertyUrl:D()}).optional(),syncSchedule:je({preset:D().optional(),cron:D().optional()}).optional()}).optional(),vM=je({displayName:D().min(1),canonicalDomain:D().min(1),ownedDomains:Ne(D().min(1)).optional().default([]),country:D().length(2),language:D().min(2),keywords:Ne(D().min(1)).optional().default([]),competitors:Ne(D().min(1)).optional().default([]),providers:Ne(Kr).optional().default([]),locations:Ne(Bp).optional().default([]),defaultLocation:D().optional(),schedule:pM,notifications:Ne(gM).optional().default([]),google:yM}).superRefine((e,t)=>{const s=dM(e.locations);s.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${s.join(", ")}`,path:["locations"]}),fM(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});je({apiVersion:cl("canonry/v1"),kind:cl("Project"),metadata:mM,spec:vM});const xM=Zt(["gsc","ga4"]);je({id:D(),domain:D(),connectionType:xM,propertyId:D().nullable().optional(),sitemapUrl:D().nullable().optional(),scopes:Ne(D()).default([]),createdAt:D(),updatedAt:D()});je({date:D(),query:D(),page:D(),country:D().nullable().optional(),device:D().nullable().optional(),clicks:_e(),impressions:_e(),ctr:_e(),position:_e()});const Im=je({id:D(),url:D(),indexingState:D().nullable().optional(),verdict:D().nullable().optional(),coverageState:D().nullable().optional(),pageFetchState:D().nullable().optional(),robotsTxtState:D().nullable().optional(),crawlTime:D().nullable().optional(),lastCrawlResult:D().nullable().optional(),isMobileFriendly:Lt().nullable().optional(),richResults:Ne(D()).default([]),inspectedAt:D()});Zt(["stable","reindexed","deindexed","still-missing","new"]);const bM=je({url:D(),previousState:D().nullable(),currentState:D().nullable(),transitionDate:D()}),SM=je({reason:D(),count:_e(),urls:Ne(Im).default([])});je({summary:je({total:_e(),indexed:_e(),notIndexed:_e(),deindexed:_e(),percentage:_e()}),lastInspectedAt:D().nullable(),indexed:Ne(Im).default([]),notIndexed:Ne(Im).default([]),deindexed:Ne(bM).default([]),reasonGroups:Ne(SM).default([])});je({url:D(),type:Zt(["URL_UPDATED","URL_DELETED"]),notifiedAt:D()});je({url:D(),type:Zt(["URL_UPDATED","URL_DELETED"]),notifiedAt:D(),status:Zt(["success","error"]),error:D().optional()});je({date:D(),indexed:_e(),notIndexed:_e(),reasonBreakdown:ml(D(),_e()).default({})});je({id:D(),domain:D(),siteUrl:D().nullable().optional(),createdAt:D(),updatedAt:D()});const sm=je({id:D(),url:D(),httpCode:_e().nullable().optional(),inIndex:Lt().nullable().optional(),lastCrawledDate:D().nullable().optional(),inIndexDate:D().nullable().optional(),inspectedAt:D(),documentSize:_e().nullable().optional(),anchorCount:_e().nullable().optional(),discoveryDate:D().nullable().optional()});je({summary:je({total:_e(),indexed:_e(),notIndexed:_e(),unknown:_e().optional(),percentage:_e()}),lastInspectedAt:D().nullable(),indexed:Ne(sm).default([]),notIndexed:Ne(sm).default([]),unknown:Ne(sm).default([]).optional()});je({query:D(),impressions:_e(),clicks:_e(),ctr:_e(),averagePosition:_e()});je({url:D(),status:Zt(["success","error"]),submittedAt:D(),error:D().optional()});const qp=Zt(["live","staging"]);je({projectName:D(),url:D(),stagingUrl:D().optional(),username:D(),defaultEnv:qp,createdAt:D(),updatedAt:D()});const Gb=je({url:D(),reachable:Lt(),pageCount:_e().nullable().optional(),version:D().nullable().optional(),error:D().nullable().optional(),plugins:Ne(D()).optional(),authenticatedUser:je({id:_e(),slug:D()}).nullable().optional()});je({connected:Lt(),projectName:D(),defaultEnv:qp,live:Gb.nullable(),staging:Gb.nullable(),adminUrl:D().nullable().optional()});const jM=je({id:_e(),slug:D(),title:D(),status:D(),modifiedAt:D().nullable().optional(),link:D().nullable().optional()}),Yw=je({title:D().nullable(),description:D().nullable(),noindex:Lt().nullable(),writable:Lt().default(!1),writeTargets:Ne(D()).default([])}),wM=je({type:D(),json:ml(D(),Mu())}),NM=jM.extend({env:qp,content:D(),seo:Yw,schemaBlocks:Ne(wM).default([])}),Fb=NM.extend({contentHash:D(),contentSnippet:D()});je({manualRequired:cl(!0),targetUrl:D(),adminUrl:D().nullable().optional(),content:D(),nextSteps:Ne(D()).default([])});const CM=je({slug:D(),severity:Zt(["high","medium","low"]),code:Zt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:D()});je({slug:D(),title:D(),status:D(),wordCount:_e(),seo:Yw,schemaPresent:Lt(),issues:Ne(CM).default([])});je({slug:D(),live:Fb,staging:Fb,hasDifferences:Lt(),differences:je({title:Lt(),slug:Lt(),content:Lt(),seoTitle:Lt(),seoDescription:Lt(),noindex:Lt(),schema:Lt()})});const kM=Zt(["queued","running","completed","partial","failed","cancelled"]),zM=Zt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),_M=Zt(["manual","scheduled","config-apply"]),EM=Zt(["cited","not-cited"]),AM=Zt(["new","cited","lost","emerging","not-cited"]);je({id:D(),projectId:D(),kind:zM,status:kM,trigger:_M.default("manual"),location:D().nullable().optional(),startedAt:D().nullable().optional(),finishedAt:D().nullable().optional(),error:D().nullable().optional(),createdAt:D()});const Jw=je({uri:D(),title:D()});je({id:D(),runId:D(),keywordId:D(),keyword:D().optional(),provider:Kr,citationState:EM,transition:AM.optional(),answerText:D().nullable().optional(),citedDomains:Ne(D()).default([]),competitorOverlap:Ne(D()).default([]),groundingSources:Ne(Jw).default([]),searchQueries:Ne(D()).default([]),model:D().nullable().optional(),location:D().nullable().optional(),createdAt:D()});je({id:D(),projectId:D().nullable().optional(),actor:D(),action:D(),entityType:D(),entityId:D().nullable().optional(),diff:Mu().optional(),createdAt:D()});const RM=Zt(["yes","no","unknown","not-mentioned"]);je({companyName:D().min(1),domain:D().min(1),phrases:Ne(D().min(1)).optional().default([]),competitors:Ne(D().min(1)).optional().default([])});const TM=je({name:D(),count:_e().int().nonnegative()}),OM=je({id:D(),name:D(),weight:_e(),score:_e(),grade:D(),status:Zt(["pass","partial","fail"]),findings:Ne(je({type:D(),message:D()})).default([]),recommendations:Ne(D()).default([])}),LM=je({url:D(),finalUrl:D(),auditedAt:D(),overallScore:_e(),overallGrade:D(),summary:D(),factors:Ne(OM).default([])}),DM=je({industry:D(),summary:D(),services:Ne(D()).default([]),categoryTerms:Ne(D()).default([])}),MM=je({provider:D(),displayName:D(),model:D().nullable().optional(),mentioned:Lt(),cited:Lt(),describedAccurately:RM,accuracyNotes:D().nullable().optional(),incorrectClaims:Ne(D()).default([]),recommendedCompetitors:Ne(D()).default([]),citedDomains:Ne(D()).default([]),groundingSources:Ne(Jw).default([]),searchQueries:Ne(D()).default([]),answerText:D(),error:D().nullable().optional()}),$M=je({phrase:D(),providerResults:Ne(MM).default([])}),PM=je({totalQueries:_e().int().nonnegative(),totalProviders:_e().int().nonnegative(),totalComparisons:_e().int().nonnegative(),mentionCount:_e().int().nonnegative(),citationCount:_e().int().nonnegative(),topCompetitors:Ne(TM).default([]),visibilityGap:D(),whatThisMeans:Ne(D()).default([]),recommendedActions:Ne(D()).default([])});je({companyName:D(),domain:D(),homepageUrl:D(),generatedAt:D(),phrases:Ne(D()).default([]),competitors:Ne(D()).default([]),profile:DM,audit:LM,queryResults:Ne($M).default([]),summary:PM});je({id:D(),projectId:D(),cronExpr:D(),preset:D().nullable().optional(),timezone:D().default("UTC"),enabled:Lt().default(!0),providers:Ne(Kr).default([]),lastRunAt:D().nullable().optional(),nextRunAt:D().nullable().optional(),createdAt:D(),updatedAt:D()});je({preset:D().optional(),cron:D().optional(),timezone:D().optional().default("UTC"),enabled:Lt().optional().default(!0),providers:Ne(Kr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});je({id:D(),projectId:D(),propertyId:D(),clientEmail:D(),connected:Lt(),createdAt:D(),updatedAt:D()});je({date:D(),landingPage:D(),sessions:_e(),organicSessions:_e(),users:_e()});je({totalSessions:_e(),totalOrganicSessions:_e(),totalUsers:_e(),topPages:Ne(je({landingPage:D(),sessions:_e(),organicSessions:_e(),users:_e()})),lastSyncedAt:D().nullable()});function Bm({state:e}){return o.jsx(lt,{tone:qA(e),children:Vu(e)})}function Zb(e,t){const s=t.filter(u=>u.trim().length>1),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(u=>u.startsWith("**")&&u.endsWith("**")?{type:"bold",value:u.slice(2,-2)}:{type:"text",value:u});if(s.length===0)return a.map((u,f)=>u.type==="bold"?cs.createElement("strong",{key:`b-${f}`,className:"text-zinc-200 font-semibold"},u.value):u.value).filter(Boolean);const r=s.map(u=>u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(`(${r.join("|")})`,"gi");return a.flatMap((u,f)=>u.value.split(c).map((p,v)=>p?v%2===1?u.type==="bold"?cs.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},cs.createElement("strong",{className:"text-zinc-200 font-semibold"},p)):cs.createElement("mark",{key:`hl-${f}-${v}`,className:"answer-highlight"},p):u.type==="bold"?cs.createElement("strong",{key:`b-${f}-${v}`,className:"text-zinc-200 font-semibold"},p):p:null)).filter(Boolean)}function UM({evidence:e,project:t,onClose:s}){const[a,r]=w.useState(!1),[c,u]=w.useState(-1),[f,m]=w.useState(null),[p,v]=w.useState(!1),[y,x]=w.useState({}),b=hM(t.project),N=new Set(b.map(Um)),S=e.runHistory,C=S.length>1,[k,R]=w.useState(null),A=w.useRef(!1);w.useEffect(()=>{if(A.current||e.answerSnippet)return;const H=S.at(-1);H&&(A.current=!0,Pr(H.runId).then(T=>{const B=T.snapshots.find(se=>se.keyword===e.keyword&&se.provider===e.provider);B?.answerText&&R({citationState:e.citationState,provider:e.provider,model:B.model??e.model,answerSnippet:B.answerText,citedDomains:B.citedDomains??e.citedDomains,competitorDomains:B.competitorOverlap??e.competitorDomains,groundingSources:B.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,S]);const z=c>=0&&f!==null,O=z?f:k||{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},$=O.citationState==="cited"||O.citationState==="emerging",L=O.citedDomains.findIndex(H=>N.has(H.toLowerCase().replace(/^www\./,"")))+1,U=O.citedDomains.length,X=t.project.displayName||t.project.name,Q=[...b.map(Um),X,X.split(" ").slice(0,2).join(" ")].filter(H=>H.trim().length>2),ee=$?"cited":O.citationState==="lost"?"lost":O.citationState==="pending"?"pending":"not-cited",ue=w.useRef(0),Ee=w.useCallback(async H=>{const T=++ue.current;if(H===-1||H===S.length-1){u(-1),m(null),r(!1);return}u(H),r(!1);const B=S[H],se=`${B.runId}::${e.keyword}::${e.provider}`;if(y[se]){m(y[se]);return}v(!0);try{const le=await Pr(B.runId);if(T!==ue.current)return;const J=le.snapshots.find(ye=>ye.keyword===e.keyword&&ye.provider===e.provider)??le.snapshots.find(ye=>ye.keyword===e.keyword),fe=J?{citationState:J.citationState,provider:J.provider,model:J.model??null,answerSnippet:J.answerText??"",citedDomains:J.citedDomains,competitorDomains:J.competitorOverlap,groundingSources:J.groundingSources,evidenceUrls:[],changeLabel:B.citationState,summary:""}:{citationState:B.citationState,provider:e.provider,model:B.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:B.citationState,summary:"Snapshot data not available for this run."};x(ye=>({...ye,[se]:fe})),m(fe)}catch{if(T!==ue.current)return;m({citationState:B.citationState,provider:e.provider,model:B.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],groundingSources:[],evidenceUrls:[],changeLabel:B.citationState,summary:"Failed to load historical run data."})}finally{T===ue.current&&v(!1)}},[S,e.keyword,e.provider,y]),K=(z||e.historyScope!=="provider")&&O.model?`${O.provider} (${O.model}) · ${O.changeLabel.toLowerCase()}`:`${O.provider} · ${O.changeLabel.toLowerCase()}`,ae=!z&&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(" · "):"",me=$&&L>0?{label:"Citation confirmed",title:`Cited #${L} of ${U} domain${U!==1?"s":""}`,meta:K}:$?{label:"Citation confirmed",title:"Cited in this answer",meta:K}:O.citationState==="lost"?{label:"Citation lost",title:U>0?`${U} domain${U!==1?"s":""} cited instead`:"No longer appearing in this answer",meta:K}:O.citationState==="pending"?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not in this answer",title:U>0?`${U} domain${U!==1?"s":""} cited instead`:"No domains cited for this query",meta:K},V=()=>{if(!O.answerSnippet)return null;const H=O.answerSnippet.split(`
|
|
95
|
-
`),T=[];let B=[],se=0;const le=()=>{if(B.length===0)return;const J=B.join(" ").trim();J&&T.push(o.jsx("p",{className:T.length>0?"mt-2.5":"",children:Zb(J,Q)},se++)),B=[]};for(const J of H){const fe=J.trim();if(/^[-\u2013\u2014]{3,}$/.test(fe)){le(),T.push(o.jsx("hr",{className:"border-zinc-800/60 my-3"},se++));continue}const ye=fe.match(/^(#{1,3})\s+(.+)$/);if(ye){le();const Ae=ye[1].length,ge=ye[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||ye[2],Ze=Ae===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Ae===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";T.push(o.jsx("p",{className:Ze,children:Zb(ge,Q)},se++));continue}if(fe===""){le();continue}B.push(fe)}return le(),T};return o.jsx(uw,{open:!0,onOpenChange:H=>{H||s()},children:o.jsxs(dw,{children:[o.jsx(Rp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),o.jsxs(Tp,{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 ",O.provider||"All providers"]}),o.jsx(Op,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),o.jsxs(hw,{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(Zu,{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((H,T)=>{const B=c===-1&&T===S.length-1||c===T,se=H.citationState==="cited"?"bg-emerald-400":H.citationState==="emerging"?"bg-amber-400":H.citationState==="lost"?"bg-rose-400":"bg-zinc-600",J=new Date(H.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),fe=!!(H.model&&T>0&&S[T-1]?.model&&S[T-1].model!==H.model);return o.jsxs("button",{type:"button",className:`evidence-run-dot ${B?"evidence-run-dot--selected":""}`,onClick:()=>Ee(T===S.length-1?-1:T),"aria-label":[`Run ${J}: ${H.citationState}`,H.model?`model ${H.model}`:null,fe?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":B,children:[o.jsx("span",{className:`size-2 rounded-full ${se} ${fe?"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:J})]},T)})}),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:()=>Ee(-1),children:"\\u2190 Back to latest"})]}),!z&&(e.modelTransitions?.length??0)>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(H=>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:`${H.fromModel??"unknown"} -> ${H.toModel??"unknown"} on ${new Date(H.createdAt).toLocaleDateString()}`},`${H.runId}:${H.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--${ee}`,children:[o.jsx("p",{className:`evidence-position-label evidence-position-label--${ee}`,children:me.label}),o.jsx("p",{className:`evidence-position-title evidence-position-title--${ee}`,children:me.title}),o.jsx("p",{className:"evidence-position-meta",children:me.meta}),ae&&o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:ae})]}),O.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:V()}),O.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"})]}),!O.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"}),!z&&e.relatedTechnicalSignals.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"drawer-section-label",children:$?"Why you're cited":"What to fix"}),o.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((H,T)=>o.jsxs("div",{className:"action-item",children:[o.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?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:H})]},T))})]}),O.summary&&o.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:O.summary})]}),o.jsxs("div",{className:"evidence-modal-sidebar",children:[O.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:[O.citedDomains.map((H,T)=>{const B=H.toLowerCase().replace(/^www\./,""),se=N.has(B),le=!se&&O.competitorDomains.some(fe=>fe.toLowerCase().replace(/^www\./,"")===B),J=se?"you":le?"competitor":"other";return o.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${J}`,children:[o.jsxs("span",{className:"citation-leaderboard-rank",children:["#",T+1]}),o.jsx("span",{className:"citation-leaderboard-domain",children:H}),se&&o.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),le&&o.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},H)}),!$&&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:"—"}),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"})]})]})]}),O.groundingSources.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"drawer-section-label",children:["Grounding sources (",O.groundingSources.length,")"]}),o.jsx("ul",{className:"grid gap-0.5",children:O.groundingSources.map((H,T)=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:H.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:H.title||H.uri})},T))})]}),O.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:O.evidenceUrls.map(H=>o.jsx("li",{className:"truncate text-sm",children:o.jsx("a",{href:H,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:H})},H))})]}),O.citedDomains.length===0&&O.groundingSources.length===0&&O.evidenceUrls.length===0&&o.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No citation data ",z?"for this run":"yet"]})]})]})]})]})]})})}function os(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 im=[{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 id(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 IM=id({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"}),BM=id({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"}),qM=id({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"}),HM=id({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"}),KM=[{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:os(["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:os(["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:os(["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:os(["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:os(["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:os(["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:os(["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:os(["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:os(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];im[0],im[1],os(["cited","cited","cited","cited","cited"]),im[2],2/7,os(["not-cited","not-cited","not-cited","cited"]);function GM(e,t){return e.projects.find(s=>s.project.id===t)}function FM(e,t){return e.runs.find(s=>s.id===t)}function ZM(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 Xw(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 Vb(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function VM(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 Ww(e){return e==="answer-visibility"?"Answer visibility sweep":e}function QM(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Hp(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:Ww(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Vb(e.startedAt):Vb(e.createdAt),duration:VM(e.startedAt,e.finishedAt),statusDetail:e.error?eN(e.error):YM(e),summary:JM(e),triggerLabel:QM(e.trigger)}}function eN(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 YM(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?eN(e.error):"Run failed.";default:return""}}function JM(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 tN(e){if(e.length===0)return{score:0,citedCount:0,totalCount:0};const t=new Map;for(const c of e){const u=c.keyword??c.id;t.has(u)||t.set(u,!1),c.citationState==="cited"&&t.set(u,!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 XM(e){return e>=70?"positive":e>=40?"caution":"negative"}function WM(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function e4(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function t4(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 u=c.keywordId,f=t.get(u)??{cited:!1,competitorOverlap:new Set};c.citationState==="cited"&&(f.cited=!0);for(const m of c.competitorOverlap)f.competitorOverlap.add(m);t.set(u,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:e4(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 n4(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 s4(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function i4(e,t){const s=n4(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:s4(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 nN(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(u=>s.has(u))&&a++;const r=a/e.length;return r>=.5?{label:"High",count:a}:r>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function a4(e,t,s,a){const r=[];let c=0;const u=new Set;if(s){const f=new Map;for(const x of s.snapshots)if(x.keyword){const b=`${x.keyword}::${x.provider}`;f.set(b,x)}const m=new Set(s.snapshots.map(x=>x.provider)),p=new Set(t.flatMap(x=>Object.keys(x.providerRuns??{}))),v=[...new Set([...m,...p])].sort(),y=v.length>0?v:["gemini"];for(const x of t){if(x.runs.length===0)continue;u.add(x.keyword);const N=x.runs.at(-1)?.transition??"not-cited";for(const S of y){const C=f.get(`${x.keyword}::${S}`),k=(x.providerRuns?.[S]?.length??0)>0;if(!C&&!k)continue;const R=C?.model??null,A=R?`${S}:${R}`:null,z=A?x.modelRuns?.[A]:void 0,O=x.providerRuns?.[S],$=(O?.length?O:null)??(z?.length?z:null),E=O?.length?"provider":z?.length?"model":"keyword",L=$?$.at(-1).transition:N,U=$?.at(-1)?.citationState,X=C?L==="lost"?"lost":L==="emerging"?"emerging":C.citationState==="cited"?"cited":"not-cited":U==="cited"?"cited":"not-cited",Q=qm($||x.runs),ee=r4(x,S),ue=($??x.runs).map(ae=>({runId:ae.runId,citationState:ae.citationState,createdAt:ae.createdAt,model:ee.get(ae.runId)??null})),Ee=o4(ue),we=E==="provider"&&Ee.length<=1?"model":E,K=l4(ue);r.push({id:`evidence_${e}_${c++}`,keyword:x.keyword,provider:C?.provider??S,model:C?.model??null,location:C?.location??null,citationState:X,changeLabel:c4(L,Q),answerSnippet:C?.answerText??"",citedDomains:C?.citedDomains??[],evidenceUrls:[],competitorDomains:C?.competitorOverlap??[],relatedTechnicalSignals:[],groundingSources:C?.groundingSources??[],summary:u4(X,x.keyword),runHistory:ue,historyScope:we,modelsSeen:Ee,modelTransitions:K})}}}for(const f of a)u.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 r4(e,t){const s=new Map,a=`${t}:`;for(const[r,c]of Object.entries(e.modelRuns??{})){if(!r.startsWith(a))continue;const u=r.slice(a.length),f=u==="unknown"?null:u;for(const m of c)s.set(m.runId,f)}return s}function o4(e){const t=new Set;for(const s of e)s.model&&t.add(s.model);return[...t]}function l4(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 qm(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 c4(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 u4(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 Qb(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 u=a.get(c)??new Set;u.add(r.keyword),a.set(c,u)}return a}const am=3;function d4(e){const{evidence:t,timeline:s,latestSnapshots:a,previousSnapshots:r,trackedCompetitors:c}=e,u=[],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&&u.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=Qb(a,c),v=Qb(r,c);for(const k of c){const R=p.get(k)??new Set,A=v.get(k)??new Set,z=[...R].filter(O=>!A.has(O));z.length>0&&u.push({id:`insight_comp_gained_${k}`,tone:"negative",title:`${k} appeared on ${z.length} key phrase${z.length>1?"s":""}`,detail:"A tracked competitor gained new citations.",actionLabel:"Competitor",affectedPhrases:z.map(O=>{const $=t.find(E=>E.keyword===O);return{keyword:O,evidenceId:$?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of s){const R=k.runs.at(-1);R&&y.set(k.keyword,{transition:R.transition,citationState:R.citationState})}const x=[],b=[],N=new Set;for(const[k,{transition:R,citationState:A}]of y){if(!(R==="emerging"||R==="new"&&A==="cited"))continue;N.add(k);const O=t.find($=>$.keyword===k&&($.citationState==="emerging"||$.citationState==="cited"));x.push({keyword:k,evidenceId:O?.id??"",provider:O?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(N.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(R=>R.keyword)).size;u.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&&u.push({id:"insight_first_citation",tone:"positive",title:`First citation on ${N.size} key phrase${N.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<am||k.runs.at(-1)?.citationState!=="not-cited")continue;if(qm(k.runs)>=am){const z=t.find(O=>O.keyword===k.keyword);C.push({keyword:k.keyword,evidenceId:z?.id??"",citationState:"not-cited"})}}C.length>0&&u.push({id:"insight_persistent_gap",tone:"caution",title:`${C.length} key phrase${C.length>1?"s":""} uncited for ${am}+ 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 R=p.get(k)??new Set,z=[...v.get(k)??new Set].filter(O=>!R.has(O));z.length>0&&u.push({id:`insight_comp_lost_${k}`,tone:"neutral",title:`${k} dropped from ${z.length} key phrase${z.length>1?"s":""}`,detail:"A tracked competitor lost citations.",actionLabel:"Competitor",affectedPhrases:z.map(O=>{const $=t.find(E=>E.keyword===O);return{keyword:O,evidenceId:$?.id??"",citationState:"not-cited"}})})}return u.length===0&&u.push({id:"insight_stable",tone:"neutral",title:"No significant changes",detail:"Citation state is stable across all tracked key phrases.",actionLabel:"Stable",affectedPhrases:[]}),u}function f4(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,u=0;for(const m of a)r.has(m)||c++;for(const m of r)a.has(m)||u++;const f=u>c?"negative":c>u?"positive":"neutral";return{gained:c,lost:u,tone:f,hasPreviousRun:!0}}function h4(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: ${Ww(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 m4(e){const t=Xw(e.project),s=a4(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],r=tN(a),c=t4(a),u=i4(e.gscCoverage,e.bingCoverage),f=nN(a,e.competitors.map(b=>b.domain)),m=d4({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,N)=>N.createdAt.localeCompare(b.createdAt)),v=p.map(b=>Hp(b,e.project.displayName||e.project.name)),y=new Map;for(const b of a){const N=b.provider||"gemini",S=b.model??null,C=`${N}::${S??"unknown"}`,k=y.get(C)??{provider:N,model:S,cited:0,total:0};k.total++,b.citationState==="cited"&&k.cited++,y.set(C,k)}const x=[...y.values()].sort((b,N)=>b.provider.localeCompare(N.provider)||(b.model??"").localeCompare(N.model??"")).map(({provider:b,model:N,cited:S,total:C})=>({provider:b,model:N,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?XM(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:u,providerScores:x,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:WM(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:h4(p),movementSummary:f4(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:s,competitors:e.competitors.map((b,N)=>{const S=new Set;for(const z of a)(z.competitorOverlap.includes(b.domain)||z.citedDomains.includes(b.domain))&&z.keyword&&S.add(z.keyword);const C=[...S],k=new Set(a.map(z=>z.keyword).filter(Boolean)),R=k.size>0?C.length/k.size:0,A=R>=.5?"High":R>=.2?"Moderate":C.length>0?"Low":"None";return{id:b.id||`comp_${N}`,domain:b.domain,citationCount:C.length,totalKeywords:k.size,pressureLabel:A,citedKeywords:C,movement:"",notes:""}}),recentRuns:v.slice(0,5)}}function p4(e){const t=Xw(e.project),s=e.latestRunDetail?.snapshots??[],a=tN(s),r=nN(s,e.competitors.map(m=>m.domain)),u=[...e.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt))[0],f=u?Hp(u,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 g4(e,t){const s=[],a=[],r=[];for(const u of e){a.push(m4(u)),r.push(p4(u));const f=[...u.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt));for(const m of f)s.push(Hp(m,u.project.displayName||u.project.name))}s.sort((u,f)=>f.createdAt.localeCompare(u.createdAt));const c=e.length>0;return{portfolioOverview:{projects:r,attentionItems:c?y4(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(u=>({name:u.name,displayName:u.displayName,keyUrl:u.keyUrl,modelHint:u.modelHint,model:u.model,state:u.configured?"ready":"needs-config",detail:u.configured?"Provider is configured.":"API key is missing.",quota:u.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 y4(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 Vn={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"]},sN=w.createContext(null);sN.Provider;function pl(){return w.useContext(sN)}function Oa(e){const s=pl()?.dashboard??null,a=xa({queryKey:Vn.projects.all,queryFn:YS,enabled:!s}),r=xa({queryKey:Vn.runs.all,queryFn:XS,enabled:!s,refetchInterval:N=>N.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=xa({queryKey:Vn.settings,queryFn:()=>Sp().catch(()=>null),enabled:!s}),u=a.data??[],f=r.data??[],m=Uk({queries:u.map(N=>{const S=f.filter(k=>k.projectId===N.id),C=S.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,R)=>R.createdAt.localeCompare(k.createdAt));return{queryKey:Vn.projects.detail(N.id,C[0]?.id),queryFn:async()=>{const[k,R,A,z,O,$,E]=await Promise.all([F_(N.name).catch(()=>[]),WS(N.name).catch(()=>[]),ej(N.name).catch(()=>[]),C[0]?Pr(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Pr(C[1].id).catch(()=>null):Promise.resolve(null),jp(N.name).catch(()=>null),wp(N.name).catch(()=>null)]);return{project:N,runs:S,keywords:k,competitors:R,timeline:A,latestRunDetail:z,previousRunDetail:O,gscCoverage:$,bingCoverage:E}},enabled:!s&&a.isSuccess&&r.isSuccess}})}),p=m.every(N=>N.isSuccess),v=w.useMemo(()=>{if(s)return s;if(!a.data||!r.data||u.length>0&&!p)return null;const N=m.map(S=>S.data).filter(S=>S!=null);return g4(N,c.data??null)},[s,a.data,r.data,c.data,p,m,u.length]),y=!s&&(a.isError||r.isError),x=!s&&!v&&!y,b=w.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 v4(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const Yb=v4(),Hm=Yb==="/"?"":Yb.replace(/\/$/,"");async function x4(){const e=Hm?`${Hm}/health`:"/health",t=await B2(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 ad(e,t){return xa({queryKey:Vn.health,queryFn:x4,enabled:e,refetchInterval:15e3,initialData:t})}function b4(e){return xa({queryKey:Vn.runs.detail(e??""),queryFn:()=>Pr(e),enabled:!!e,refetchInterval:t=>{const s=t.state.data?.status;return s==="running"||s==="queued"?3e3:!1}})}function Gr(){const e=Ii(),t=Ku({strict:!1}),s=Nn({select:m=>m.location.pathname}),a=t.runId??null,r=t.evidenceId??null;return{runId:a,evidenceId:r,openRun:m=>e({to:s,from:us.to,search:p=>({...p,runId:m,evidenceId:void 0})}),openEvidence:m=>e({to:s,from:us.to,search:p=>({...p,evidenceId:m,runId:void 0})}),closeDrawer:()=>e({to:s,from:us.to,search:m=>({...m,runId:void 0,evidenceId:void 0})})}}const S4={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function j4(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function w4(){const e=w.useSyncExternalStore(Z2,Qx,Qx),t=Ii(),{openRun:s}=Gr(),a=w.useCallback(c=>{Am(c)},[]),r=w.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?s(c.cta.runId):t({to:"/runs"}),Am(c.id))},[t,s]);return e.length===0?null:o.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>o.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${S4[c.tone]}`,children:[o.jsxs("div",{className:"toast-copy",children:[o.jsx("p",{className:"toast-title",children:c.title}),c.detail?o.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?o.jsx("button",{type:"button",className:"toast-action",onClick:()=>r(c),"aria-label":j4(c),children:c.cta.label}):null]}),o.jsx("button",{type:"button",onClick:()=>a(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:o.jsx(Zu,{className:"size-3.5"})})]},c.id))})}const Jb=[{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"}],Xb=e=>({label:e,state:"checking",detail:"Checking service health"}),N4={apiStatus:Xb("API"),workerStatus:Xb("Worker")};function C4(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function k4(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function z4(e){const t=C4(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function _4(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function E4(e,t,s){if(t)return t;const a=s.find(r=>r.id===e);return a?.displayName||a?.name||e}function A4(e,t){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,t>0?`${t} skipped at queue time`:null].filter(Boolean).join(", ")}function R4(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function T4(){const e=w.useSyncExternalStore($E,ka,ka),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,s=xa({queryKey:Vn.runs.all,queryFn:XS,enabled:t}),a=xa({queryKey:Vn.projects.all,queryFn:YS,enabled:t}),r=w.useRef({}),c=w.useCallback(()=>{s.refetch()},[s.refetch]);return w.useEffect(()=>{t&&c()},[t,c]),w.useEffect(()=>{if(!t||typeof window>"u")return;const u=()=>{document.visibilityState==="visible"&&c()};return window.addEventListener("focus",c),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",c),document.removeEventListener("visibilitychange",u)}},[t,c]),w.useEffect(()=>{const u=s.data??[],f=a.data??[],m=Object.fromEntries(u.map(v=>[v.id,v])),p=Object.fromEntries(u.map(v=>[v.id,v.status]));for(const v of Object.values(e.runs)){const y=m[v.runId];if(!y||!IE(y.status)||(r.current[y.id]??v.lastAnnouncedStatus)===y.status)continue;if(v.sourceAction==="run-all"){tb(y.id);continue}const b=E4(y.projectId,v.projectLabel,f);Ke({title:z4(y),detail:_4(y,b),tone:k4(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),tb(y.id)}for(const v of Object.values(e.batches)){const y=BE(v.runIds,m);y.finished&&(Ke({title:"Run-all batch finished",detail:A4(y,v.skippedCount),tone:R4(y),dedupeKey:`batch:${v.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),UE(v.batchId))}r.current=p},[a.data,s.data,e]),null}function O4(){const e=pl(),{dashboard:t,isLoading:s,refetch:a}=Oa(),u=ad(!e,e?.health).data??e?.health??N4,f=q_(),{runId:m,evidenceId:p,closeDrawer:v}=Gr(),[y,x]=w.useState(!1),b=b4(m),N=b.data??null,S=b.isLoading;w.useEffect(()=>{N&&N.status!=="running"&&N.status!=="queued"&&a()},[N?.status,a]),w.useEffect(()=>{x(!1)},[f.pathname]),w.useEffect(()=>{if(typeof window>"u"||!m&&!p)return;const z=O=>{O.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[m,p,v]);const C=t??e?.dashboard??null,k=m&&C?FM(C,m):void 0,R=p&&C?ZM(C,p):void 0,A=(()=>{const z=f.pathname;if(z==="/")return"Portfolio";if(z==="/projects")return"Projects";if(z==="/runs")return"Runs";if(z==="/settings")return"Settings";if(z==="/setup")return"Setup";if(z.startsWith("/projects/")){const $=z.split("/").filter(Boolean)[1];if($&&C){const E=C.projects.find(L=>L.project.id===$);if(E)return E.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(db,{})}),o.jsxs("nav",{className:"sidebar-nav",children:[o.jsxs(St,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(lE,{className:"sidebar-icon"}),o.jsx("span",{children:"Overview"})]}),o.jsxs(St,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[o.jsx(rE,{className:"sidebar-icon"}),o.jsx("span",{children:"Projects"})]}),o.jsxs(St,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(fE,{className:"sidebar-icon"}),o.jsx("span",{children:"Runs"})]}),o.jsxs(St,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(bE,{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(z=>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+z*15}%`}})]},z))]}):C&&C.projects.length>0?o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const O=z.visibilitySummary.tone;return o.jsxs(St,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[o.jsx("span",{className:`sidebar-dot sidebar-dot-${O}`}),o.jsx("span",{children:z.project.name})]},z.project.id)})]}):s?null:o.jsxs(o.Fragment,{children:[o.jsx("p",{className:"sidebar-section-title",children:"Resources"}),o.jsxs(St,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[o.jsx(gE,{className:"sidebar-icon"}),o.jsx("span",{children:"Setup"})]})]})]}),o.jsx("div",{className:"sidebar-footer",children:Jb.map(z=>o.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.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(db,{compact:!0})}),o.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[o.jsx(St,{to:"/",children:"Home"}),o.jsx(Fu,{className:"breadcrumb-sep size-3"}),o.jsx("span",{className:"breadcrumb-current",children:A})]})]}),o.jsxs("div",{className:"topbar-actions",children:[o.jsxs("div",{className:"health-pill-row",children:[o.jsxs("span",{className:`health-pill health-pill-${u.apiStatus.state}`,children:["API ",u.apiStatus.state==="ok"?"ok":u.apiStatus.state]}),o.jsxs("span",{className:`health-pill health-pill-${u.workerStatus.state}`,children:["Worker ",u.workerStatus.state==="ok"?"ok":u.workerStatus.state]})]}),o.jsxs(oe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>x(z=>!z),children:[o.jsx(uE,{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(oe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>x(!1),children:[o.jsx(Zu,{className:"size-5"}),o.jsx("span",{className:"sr-only",children:"Close navigation"})]}),o.jsx(St,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),o.jsx(St,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),o.jsx(St,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),o.jsx(St,{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(z=>o.jsx(St,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.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(z=>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"})]},z))}),o.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(z=>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(O=>o.jsx("div",{className:"skeleton-text-sm w-full"},O))})]},z))})]}):o.jsx(bp,{})}),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(iE,{className:"size-3.5"}),o.jsx("span",{children:"Canonry"})]}),o.jsx("div",{className:"footer-links",children:Jb.map(z=>o.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?o.jsxs(_T,{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(Ju,{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..."}):N&&N.snapshots.length>0?o.jsxs("div",{className:"space-y-2",children:[N.snapshots.map(z=>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:z.keyword??"Unknown key phrase"}),o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(al,{provider:z.provider}),o.jsx(Rj,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&o.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&o.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[o.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&o.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.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:[z.groundingSources.length," grounding source",z.groundingSources.length!==1?"s":""]}),o.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((O,$)=>o.jsx("li",{className:"text-xs text-zinc-500 truncate",children:o.jsx("a",{href:O.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:O.title||O.uri})},$))})]}),z.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:z.answerText})]})]},z.id)),N.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..."]})]}):N&&N.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..."]}):N&&N.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..."]}):N&&N.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:AE(N.error)})]}):o.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,R?o.jsx(UM,{evidence:R.evidence,project:R.project,onClose:v}):null,o.jsx(T4,{}),o.jsx(w4,{})]})}class L4 extends w.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(NE,{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(oe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[o.jsx(vE,{className:"size-3.5 mr-1.5"}),"Try again"]}),o.jsx(oe,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const De=w.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Wn("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 Km=w.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Wn("flex flex-col gap-1.5 p-5",e),...t}));Km.displayName="CardHeader";const Gm=w.forwardRef(({className:e,...t},s)=>o.jsx("h3",{ref:s,className:Wn("font-medium tracking-tight text-zinc-50",e),...t}));Gm.displayName="CardTitle";const Fm=w.forwardRef(({className:e,...t},s)=>o.jsx("p",{ref:s,className:Wn("text-sm text-zinc-500",e),...t}));Fm.displayName="CardDescription";const hu=w.forwardRef(({className:e,...t},s)=>o.jsx("div",{ref:s,className:Wn("p-5 pt-0",e),...t}));hu.displayName="CardContent";function D4({points:e,tone:t}){const s=w.useId();if(e.length===0)return null;const a=42,r=132,c=5,u=Math.min(...e),m=Math.max(...e)-u||1,p=r-c*2,v=a-c*2,y=e.map((x,b)=>{const N=c+b/Math.max(e.length-1,1)*p,S=c+(1-(x-u)/m)*v;return`${N},${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 M4(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function $4(e,t,s){return e.map(a=>{if(a.id==="api")return{...a,tone:Au(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:Au(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,u=r>0,f=s.providerStatuses.filter(m=>m.state==="ready").map(m=>M4(m)).join(" · ");return{...a,label:"Providers",tone:u?"positive":"caution",detail:`${r} of ${c} configured`,meta:f||"None configured"}})}function P4(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 U4(e,t,s){const a=P4(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 u=s.providerStatuses.some(f=>f.state==="ready");return{...c,detail:u?"At least one provider configured.":"No providers configured.",state:u?"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 I4({project:e}){return o.jsxs(St,{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," · ",Vu(e.lastRun.status)]})]})}),o.jsx("div",{className:"project-row-chart",children:o.jsx(D4,{points:e.trend,tone:Tj(e.lastRun.status)})}),o.jsx("span",{className:"project-row-link",children:o.jsx(Fu,{className:"h-4 w-4 text-zinc-500"})})]})}function B4(){const e=pl(),{dashboard:t,isLoading:s}=Oa(),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=ad(!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=$4(r.systemHealth,f,a.settings),{openRun:p}=Gr();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(I4,{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(oe,{size:"sm",asChild:!0,children:o.jsx(St,{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(St,{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(Ju,{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(lt,{tone:v.tone,children:v.label})]}),o.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Kp=Symbol.for("yaml.alias"),Zm=Symbol.for("yaml.document"),Li=Symbol.for("yaml.map"),iN=Symbol.for("yaml.pair"),Ns=Symbol.for("yaml.scalar"),Fr=Symbol.for("yaml.seq"),Yn=Symbol.for("yaml.node.type"),La=e=>!!e&&typeof e=="object"&&e[Yn]===Kp,rd=e=>!!e&&typeof e=="object"&&e[Yn]===Zm,gl=e=>!!e&&typeof e=="object"&&e[Yn]===Li,$t=e=>!!e&&typeof e=="object"&&e[Yn]===iN,pt=e=>!!e&&typeof e=="object"&&e[Yn]===Ns,yl=e=>!!e&&typeof e=="object"&&e[Yn]===Fr;function Dt(e){if(e&&typeof e=="object")switch(e[Yn]){case Li:case Fr:return!0}return!1}function Mt(e){if(e&&typeof e=="object")switch(e[Yn]){case Kp:case Li:case Ns:case Fr:return!0}return!1}const aN=e=>(pt(e)||Dt(e))&&!!e.anchor,fa=Symbol("break visit"),q4=Symbol("skip children"),Xo=Symbol("remove node");function Zr(e,t){const s=H4(t);rd(e)?Ar(null,e.contents,s,Object.freeze([e]))===Xo&&(e.contents=null):Ar(null,e,s,Object.freeze([]))}Zr.BREAK=fa;Zr.SKIP=q4;Zr.REMOVE=Xo;function Ar(e,t,s,a){const r=K4(e,t,s,a);if(Mt(r)||$t(r))return G4(e,a,r),Ar(e,r,s,a);if(typeof r!="symbol"){if(Dt(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const u=Ar(c,t.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===fa)return fa;u===Xo&&(t.items.splice(c,1),c-=1)}}}else if($t(t)){a=Object.freeze(a.concat(t));const c=Ar("key",t.key,s,a);if(c===fa)return fa;c===Xo&&(t.key=null);const u=Ar("value",t.value,s,a);if(u===fa)return fa;u===Xo&&(t.value=null)}}return r}function H4(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 K4(e,t,s,a){if(typeof s=="function")return s(e,t,a);if(gl(t))return s.Map?.(e,t,a);if(yl(t))return s.Seq?.(e,t,a);if($t(t))return s.Pair?.(e,t,a);if(pt(t))return s.Scalar?.(e,t,a);if(La(t))return s.Alias?.(e,t,a)}function G4(e,t,s){const a=t[t.length-1];if(Dt(a))a.items[e]=s;else if($t(a))e==="key"?a.key=s:a.value=s;else if(rd(a))a.contents=s;else{const r=La(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const F4={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Z4=e=>e.replace(/[!,[\]{}]/g,t=>F4[t]);class fn{constructor(t,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},fn.defaultYaml,t),this.tags=Object.assign({},fn.defaultTags,s)}clone(){const t=new fn(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new fn(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:fn.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},fn.defaultTags);break}return t}add(t,s){this.atNextDocument&&(this.yaml={explicit:fn.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},fn.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,u]=a;return this.tags[c]=u,!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 u=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,u),!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 u=t.slice(2,-1);return u==="!"||u==="!!"?(s(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&s("Verbatim tags must end with a >"),u)}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(u){return s(String(u)),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+Z4(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&&Mt(t.contents)){const c={};Zr(t.contents,(u,f)=>{Mt(f)&&f.tag&&(c[f.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!t||r.some(f=>f.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
|
|
96
|
-
`)}}fn.defaultYaml={explicit:!1,version:"1.2"};fn.defaultTags={"!!":"tag:yaml.org,2002:"};function rN(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 oN(e){const t=new Set;return Zr(e,{Value(s,a){a.anchor&&t.add(a.anchor)}}),t}function lN(e,t){for(let s=1;;++s){const a=`${e}${s}`;if(!t.has(a))return a}}function V4(e,t){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=oN(e));const u=lN(t,r);return r.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(pt(u.node)||Dt(u.node)))u.node.anchor=u.anchor;else{const f=new Error("Failed to resolve repeated object (this should not happen)");throw f.source=c,f}}},sourceObjects:a}}function Rr(e,t,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const u=a[r],f=Rr(e,a,String(r),u);f===void 0?delete a[r]:f!==u&&(a[r]=f)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),u=Rr(e,a,r,c);u===void 0?a.delete(r):u!==c&&a.set(r,u)}else if(a instanceof Set)for(const r of Array.from(a)){const c=Rr(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 u=Rr(e,a,r,c);u===void 0?delete a[r]:u!==c&&(a[r]=u)}return e.call(t,s,a)}function Qn(e,t,s){if(Array.isArray(e))return e.map((a,r)=>Qn(a,String(r),s));if(e&&typeof e.toJSON=="function"){if(!s||!aN(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 Gp{constructor(t){Object.defineProperty(this,Yn,{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(!rd(t))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:t,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Qn(this,"",u);if(typeof r=="function")for(const{count:m,res:p}of u.anchors.values())r(p,m);return typeof c=="function"?Rr(c,{"":f},"",f):f}}class Fp extends Gp{constructor(t){super(Kp),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=[],Zr(t,{Node:(c,u)=>{(La(u)||aN(u))&&a.push(u)}}),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,u=this.resolve(r,s);if(!u){const m=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(m)}let f=a.get(u);if(f||(Qn(u,null,s),f=a.get(u)),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=mu(r,u,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(rN(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 mu(e,t,s){if(La(t)){const a=t.resolve(e),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Dt(t)){let a=0;for(const r of t.items){const c=mu(e,r,s);c>a&&(a=c)}return a}else if($t(t)){const a=mu(e,t.key,s),r=mu(e,t.value,s);return Math.max(a,r)}return 1}const cN=e=>!e||typeof e!="function"&&typeof e!="object";class Te extends Gp{constructor(t){super(Ns),this.value=t}toJSON(t,s){return s?.keep?this.value:Qn(this.value,t,s)}toString(){return String(this.value)}}Te.BLOCK_FOLDED="BLOCK_FOLDED";Te.BLOCK_LITERAL="BLOCK_LITERAL";Te.PLAIN="PLAIN";Te.QUOTE_DOUBLE="QUOTE_DOUBLE";Te.QUOTE_SINGLE="QUOTE_SINGLE";const Q4="tag:yaml.org,2002:";function Y4(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 ul(e,t,s){if(rd(e)&&(e=e.contents),Mt(e))return e;if($t(e)){const y=s.schema[Li].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:u,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 Fp(m.anchor);m={anchor:null,node:null},f.set(e,m)}t?.startsWith("!!")&&(t=Q4+t.slice(2));let p=Y4(e,t,u.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Te(e);return m&&(m.node=y),y}p=e instanceof Map?u[Li]:Symbol.iterator in Object(e)?u[Fr]:u[Li]}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 Te(e);return t?v.tag=t:p.default||(v.tag=p.tag),m&&(m.node=v),v}function $u(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 u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return ul(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 Qo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class uN extends Gp{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=>Mt(a)||$t(a)?a.clone(t):a),this.range&&(s.range=this.range.slice()),s}addIn(t,s){if(Qo(t))this.add(s);else{const[a,...r]=t,c=this.get(a,!0);if(Dt(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,$u(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(Dt(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&&pt(c)?c.value:c:Dt(c)?c.getIn(r,s):void 0}hasAllNullValues(t){return this.items.every(s=>{if(!$t(s))return!1;const a=s.value;return a==null||t&&pt(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 Dt(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(Dt(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,$u(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const J4=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Zs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const ya=(e,t,s)=>e.endsWith(`
|
|
97
|
-
`)?Zs(s,t):s.includes(`
|
|
98
|
-
`)?`
|
|
99
|
-
`+Zs(s,t):(e.endsWith(" ")?"":" ")+s,dN="flow",Vm="block",pu="quoted";function od(e,t,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:u,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,N=!1,S=-1,C=-1,k=-1;s===Vm&&(S=Wb(e,S,t.length),S!==-1&&(y=S+m));for(let A;A=e[S+=1];){if(s===pu&&A==="\\"){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(A===`
|
|
100
|
-
`)s===Vm&&(S=Wb(e,S,t.length)),y=S+t.length+m,x=void 0;else{if(A===" "&&b&&b!==" "&&b!==`
|
|
101
|
-
`&&b!==" "){const z=e[S+1];z&&z!==" "&&z!==`
|
|
102
|
-
`&&z!==" "&&(x=S)}if(S>=y)if(x)p.push(x),y=x+m,x=void 0;else if(s===pu){for(;b===" "||b===" ";)b=A,A=e[S+=1],N=!0;const z=S>k+1?S-2:C-1;if(v[z])return e;p.push(z),v[z]=!0,y=z+m,x=void 0}else N=!0}b=A}if(N&&f&&f(),p.length===0)return e;u&&u();let R=e.slice(0,p[0]);for(let A=0;A<p.length;++A){const z=p[A],O=p[A+1]||e.length;z===0?R=`
|
|
103
|
-
${t}${e.slice(0,O)}`:(s===pu&&v[z]&&(R+=`${e[z]}\\`),R+=`
|
|
104
|
-
${t}${e.slice(z+1,O)}`)}return R}function Wb(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
|
-
`);a=t,r=t+1,c=e[r]}return a}const ld=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),cd=e=>/^(%|---|\.\.\.)/m.test(e);function X4(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,u=0;c<r;++c)if(e[c]===`
|
|
106
|
-
`){if(c-u>a)return!0;if(u=c+1,r-u<=a)return!1}return!0}function Wo(e,t){const s=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=t,r=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(cd(e)?" ":"");let u="",f=0;for(let m=0,p=s[m];p;p=s[++m])if(p===" "&&s[m+1]==="\\"&&s[m+2]==="n"&&(u+=s.slice(f,m)+"\\ ",m+=1,f=m,p="\\"),p==="\\")switch(s[m+1]){case"u":{u+=s.slice(f,m);const v=s.substr(m+2,4);switch(v){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:v.substr(0,2)==="00"?u+="\\x"+v.substr(2):u+=s.substr(m,6)}m+=5,f=m+1}break;case"n":if(a||s[m+2]==='"'||s.length<r)m+=1;else{for(u+=s.slice(f,m)+`
|
|
107
|
-
|
|
108
|
-
`;s[m+2]==="\\"&&s[m+3]==="n"&&s[m+4]!=='"';)u+=`
|
|
109
|
-
`,m+=2;u+=c,s[m+2]===" "&&(u+="\\"),m+=1,f=m+1}break;default:m+=1}return u=f?u+s.slice(f):s,a?u:od(u,c,pu,ld(t,!1))}function Qm(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
110
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return Wo(e,t);const s=t.indent||(cd(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
-
${s}`)+"'";return t.implicitKey?a:od(a,s,dN,ld(t,!1))}function Tr(e,t){const{singleQuote:s}=t.options;let a;if(s===!1)a=Wo;else{const r=e.includes('"'),c=e.includes("'");r&&!c?a=Qm:c&&!r?a=Wo:a=s?Qm:Wo}return a(e,t)}let Ym;try{Ym=new RegExp(`(^|(?<!
|
|
112
|
-
))
|
|
113
|
-
+(?!
|
|
114
|
-
|$)`,"g")}catch{Ym=/\n+(?!\n|$)/g}function gu({comment:e,type:t,value:s},a,r,c){const{blockQuote:u,commentString:f,lineWidth:m}=a.options;if(!u||/\n[\t ]+$/.test(s))return Tr(s,a);const p=a.indent||(a.forceBlockIndent||cd(s)?" ":""),v=u==="literal"?!0:u==="folded"||t===Te.BLOCK_FOLDED?!1:t===Te.BLOCK_LITERAL?!0:!X4(s,m,p.length);if(!s)return v?`|
|
|
115
|
-
`:`>
|
|
116
|
-
`;let y,x;for(x=s.length;x>0;--x){const O=s[x-1];if(O!==`
|
|
117
|
-
`&&O!==" "&&O!==" ")break}let b=s.substring(x);const N=b.indexOf(`
|
|
118
|
-
`);N===-1?y="-":s===b||N!==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(Ym,`$&${p}`));let S=!1,C,k=-1;for(C=0;C<s.length;++C){const O=s[C];if(O===" ")S=!0;else if(O===`
|
|
120
|
-
`)k=C;else break}let R=s.substring(0,k<C?k+1:C);R&&(s=s.substring(R.length),R=R.replace(/\n+/g,`$&${p}`));let z=(S?p?"2":"1":"")+y;if(e&&(z+=" "+f(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const O=s.replace(/\n+/g,`
|
|
121
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let $=!1;const E=ld(a,!0);u!=="folded"&&t!==Te.BLOCK_FOLDED&&(E.onOverflow=()=>{$=!0});const L=od(`${R}${O}${b}`,p,Vm,E);if(!$)return`>${z}
|
|
122
|
-
${p}${L}`}return s=s.replace(/\n+/g,`$&${p}`),`|${z}
|
|
123
|
-
${p}${R}${s}${b}`}function W4(e,t,s,a){const{type:r,value:c}=e,{actualString:u,implicitKey:f,indent:m,indentStep:p,inFlow:v}=t;if(f&&c.includes(`
|
|
124
|
-
`)||v&&/[[\]{},]/.test(c))return Tr(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
|
|
125
|
-
`)?Tr(c,t):gu(e,t,s,a);if(!f&&!v&&r!==Te.PLAIN&&c.includes(`
|
|
126
|
-
`))return gu(e,t,s,a);if(cd(c)){if(m==="")return t.forceBlockIndent=!0,gu(e,t,s,a);if(f&&m===p)return Tr(c,t)}const y=c.replace(/\n+/g,`$&
|
|
127
|
-
${m}`);if(u){const x=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:b,tags:N}=t.doc.schema;if(N.some(x)||b?.some(x))return Tr(c,t)}return f?y:od(y,m,dN,ld(t,!1))}function Zp(e,t,s,a){const{implicitKey:r,inFlow:c}=t,u=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Te.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(f=Te.QUOTE_DOUBLE);const m=v=>{switch(v){case Te.BLOCK_FOLDED:case Te.BLOCK_LITERAL:return r||c?Tr(u.value,t):gu(u,t,s,a);case Te.QUOTE_DOUBLE:return Wo(u.value,t);case Te.QUOTE_SINGLE:return Qm(u.value,t);case Te.PLAIN:return W4(u,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 fN(e,t){const s=Object.assign({blockQuote:!0,commentString:J4,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 e3(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(pt(t)){a=t.value;let r=e.filter(c=>c.identify?.(a));if(r.length>1){const c=r.filter(u=>u.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 t3(e,t,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(pt(e)||Dt(e))&&e.anchor;c&&rN(c)&&(s.add(c),r.push(`&${c}`));const u=e.tag??(t.default?null:t.tag);return u&&r.push(a.directives.tagString(u)),r.join(" ")}function Br(e,t,s,a){if($t(e))return e.toString(t,s,a);if(La(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=Mt(e)?e:t.doc.createNode(e,{onTagObj:m=>r=m});r??(r=e3(t.doc.schema.tags,c));const u=t3(c,r,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);const f=typeof r.stringify=="function"?r.stringify(c,t,s,a):pt(c)?Zp(c,t,s,a):c.toString(t,s,a);return u?pt(c)||f[0]==="{"||f[0]==="["?`${u} ${f}`:`${u}
|
|
128
|
-
${t.indent}${f}`:f}function n3({key:e,value:t},s,a,r){const{allNullValues:c,doc:u,indent:f,indentStep:m,options:{commentString:p,indentSeq:v,simpleKeys:y}}=s;let x=Mt(e)&&e.comment||null;if(y){if(x)throw new Error("With simple keys, key nodes cannot have comments");if(Dt(e)||!Mt(e)&&typeof e=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let b=!y&&(!e||x&&t==null&&!s.inFlow||Dt(e)||(pt(e)?e.type===Te.BLOCK_FOLDED||e.type===Te.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!b&&(y||!c),indent:f+m});let N=!1,S=!1,C=Br(e,s,()=>N=!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 N&&a&&a(),C===""?"?":b?`? ${C}`:C}else if(c&&!y||t==null&&b)return C=`? ${C}`,x&&!N?C+=ya(C,s.indent,p(x)):S&&r&&r(),C;N&&(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,R,A;Mt(t)?(k=!!t.spaceBefore,R=t.commentBefore,A=t.comment):(k=!1,R=null,A=null,t&&typeof t=="object"&&(t=u.createNode(t))),s.implicitKey=!1,!b&&!x&&pt(t)&&(s.indentAtStart=C.length+1),S=!1,!v&&m.length>=2&&!s.inFlow&&!b&&yl(t)&&!t.flow&&!t.tag&&!t.anchor&&(s.indent=s.indent.substring(2));let z=!1;const O=Br(t,s,()=>z=!0,()=>S=!0);let $=" ";if(x||k||R){if($=k?`
|
|
130
|
-
`:"",R){const E=p(R);$+=`
|
|
131
|
-
${Zs(E,s.indent)}`}O===""&&!s.inFlow?$===`
|
|
132
|
-
`&&A&&($=`
|
|
133
|
-
|
|
134
|
-
`):$+=`
|
|
135
|
-
${s.indent}`}else if(!b&&Dt(t)){const E=O[0],L=O.indexOf(`
|
|
136
|
-
`),U=L!==-1,X=s.inFlow??t.flow??t.items.length===0;if(U||!X){let Q=!1;if(U&&(E==="&"||E==="!")){let ee=O.indexOf(" ");E==="&"&&ee!==-1&&ee<L&&O[ee+1]==="!"&&(ee=O.indexOf(" ",ee+1)),(ee===-1||L<ee)&&(Q=!0)}Q||($=`
|
|
137
|
-
${s.indent}`)}}else(O===""||O[0]===`
|
|
138
|
-
`)&&($="");return C+=$+O,s.inFlow?z&&a&&a():A&&!z?C+=ya(C,s.indent,p(A)):S&&r&&r(),C}function s3(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Wc="<<",Vs={identify:e=>e===Wc||typeof e=="symbol"&&e.description===Wc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Te(Symbol(Wc)),{addToJSMap:hN}),stringify:()=>Wc},i3=(e,t)=>(Vs.identify(t)||pt(t)&&(!t.type||t.type===Te.PLAIN)&&Vs.identify(t.value))&&e?.doc.schema.tags.some(s=>s.tag===Vs.tag&&s.default);function hN(e,t,s){if(s=e&&La(s)?s.resolve(e.doc):s,yl(s))for(const a of s.items)rm(e,t,a);else if(Array.isArray(s))for(const a of s)rm(e,t,a);else rm(e,t,s)}function rm(e,t,s){const a=e&&La(s)?s.resolve(e.doc):s;if(!gl(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,e,Map);for(const[c,u]of r)t instanceof Map?t.has(c)||t.set(c,u):t instanceof Set?t.add(c):Object.prototype.hasOwnProperty.call(t,c)||Object.defineProperty(t,c,{value:u,writable:!0,enumerable:!0,configurable:!0});return t}function mN(e,t,{key:s,value:a}){if(Mt(s)&&s.addToJSMap)s.addToJSMap(e,t,a);else if(i3(e,s))hN(e,t,a);else{const r=Qn(s,"",e);if(t instanceof Map)t.set(r,Qn(a,r,e));else if(t instanceof Set)t.add(r);else{const c=a3(s,r,e),u=Qn(a,c,e);c in t?Object.defineProperty(t,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):t[c]=u}}return t}function a3(e,t,s){if(t===null)return"";if(typeof t!="object")return String(t);if(Mt(e)&&s?.doc){const a=fN(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)+'..."'),s3(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 Vp(e,t,s){const a=ul(e,void 0,s),r=ul(t,void 0,s);return new mn(a,r)}class mn{constructor(t,s=null){Object.defineProperty(this,Yn,{value:iN}),this.key=t,this.value=s}clone(t){let{key:s,value:a}=this;return Mt(s)&&(s=s.clone(t)),Mt(a)&&(a=a.clone(t)),new mn(s,a)}toJSON(t,s){const a=s?.mapAsMap?new Map:{};return mN(s,a,this)}toString(t,s,a){return t?.doc?n3(this,t,s,a):JSON.stringify(this)}}function pN(e,t,s){return(t.inFlow??e.flow?o3:r3)(e,t,s)}function r3({comment:e,items:t},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:u,onComment:f}){const{indent:m,options:{commentString:p}}=s,v=Object.assign({},s,{indent:c,type:null});let y=!1;const x=[];for(let N=0;N<t.length;++N){const S=t[N];let C=null;if(Mt(S))!y&&S.spaceBefore&&x.push(""),Pu(s,x,S.commentBefore,y),S.comment&&(C=S.comment);else if($t(S)){const R=Mt(S.key)?S.key:null;R&&(!y&&R.spaceBefore&&x.push(""),Pu(s,x,R.commentBefore,y))}y=!1;let k=Br(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 N=1;N<x.length;++N){const S=x[N];b+=S?`
|
|
139
|
-
${m}${S}`:`
|
|
140
|
-
`}}return e?(b+=`
|
|
141
|
-
`+Zs(p(e),m),f&&f()):y&&u&&u(),b}function o3({items:e},t,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:u,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 N=0;N<e.length;++N){const S=e[N];let C=null;if(Mt(S))S.spaceBefore&&y.push(""),Pu(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if($t(S)){const R=Mt(S.key)?S.key:null;R&&(R.spaceBefore&&y.push(""),Pu(t,y,R.commentBefore,!1),R.comment&&(p=!0));const A=Mt(S.value)?S.value:null;A?(A.comment&&(C=A.comment),A.commentBefore&&(p=!0)):S.value==null&&R?.comment&&(C=R.comment)}C&&(p=!0);let k=Br(S,m,()=>C=null);N<e.length-1&&(k+=","),C&&(k+=ya(k,a,f(C))),!p&&(y.length>v||k.includes(`
|
|
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 N=y.reduce((S,C)=>S+C.length+2,2);p=t.options.lineWidth>0&&N>t.options.lineWidth}if(p){let N=x;for(const S of y)N+=S?`
|
|
143
|
-
${c}${r}${S}`:`
|
|
144
|
-
`;return`${N}
|
|
145
|
-
${r}${b}`}else return`${x}${u}${y.join(" ")}${u}${b}`}function Pu({indent:e,options:{commentString:t}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=Zs(t(a),e);s.push(c.trimStart())}}function va(e,t){const s=pt(t)?t.value:t;for(const a of e)if($t(a)&&(a.key===t||a.key===s||pt(a.key)&&a.key.value===s))return a}class Zn extends uN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Li,t),this.items=[]}static from(t,s,a){const{keepUndefined:r,replacer:c}=a,u=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)&&u.items.push(Vp(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"&&u.items.sort(t.sortMapEntries),u}add(t,s){let a;$t(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new mn(t,t?.value):a=new mn(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`);pt(r.value)&&cN(a.value)?r.value.value=a.value:r.value=a.value}else if(c){const u=this.items.findIndex(f=>c(a,f)<0);u===-1?this.items.push(a):this.items.splice(u,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&&pt(r)?r.value:r)??void 0}has(t){return!!va(this.items,t)}set(t,s){this.add(new mn(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)mN(s,r,c);return r}toString(t,s,a){if(!t)return JSON.stringify(this);for(const r of this.items)if(!$t(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})),pN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:s})}}const Vr={collection:"map",default:!0,nodeClass:Zn,tag:"tag:yaml.org,2002:map",resolve(e,t){return gl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,s)=>Zn.from(e,t,s)};class _a extends uN{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Fr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const s=eu(t);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(t,s){const a=eu(t);if(typeof a!="number")return;const r=this.items[a];return!s&&pt(r)?r.value:r}has(t){const s=eu(t);return typeof s=="number"&&s<this.items.length}set(t,s){const a=eu(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[a];pt(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(Qn(c,String(r++),s));return a}toString(t,s,a){return t?pN(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 u=0;for(let f of s){if(typeof r=="function"){const m=s instanceof Set?f:String(u++);f=r.call(s,m,f)}c.items.push(ul(f,void 0,a))}}return c}}function eu(e){let t=pt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Qr={collection:"seq",default:!0,nodeClass:_a,tag:"tag:yaml.org,2002:seq",resolve(e,t){return yl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,s)=>_a.from(e,t,s)},ud={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),Zp(e,t,s,a)}},dd={identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Te(null),stringify:({source:e},t)=>typeof e=="string"&&dd.test.test(e)?e:t.options.nullStr},Qp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Te(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},s){if(e&&Qp.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 fs({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 u=c.indexOf(".");u<0&&(u=c.length,c+=".");let f=t-(c.length-u-1);for(;f-- >0;)c+="0"}return c}const gN={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:fs},yN={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():fs(e)}},vN={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 Te(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-s-1),t},stringify:fs},fd=e=>typeof e=="bigint"||Number.isInteger(e),Yp=(e,t,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),s);function xN(e,t,s){const{value:a}=e;return fd(a)&&a>=0?s+a.toString(t):fs(e)}const bN={identify:e=>fd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,s)=>Yp(e,2,8,s),stringify:e=>xN(e,8,"0o")},SN={identify:fd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,s)=>Yp(e,0,10,s),stringify:fs},jN={identify:e=>fd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,s)=>Yp(e,2,16,s),stringify:e=>xN(e,16,"0x")},l3=[Vr,Qr,ud,dd,Qp,bN,SN,jN,gN,yN,vN];function eS(e){return typeof e=="bigint"||Number.isInteger(e)}const tu=({value:e})=>JSON.stringify(e),c3=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:tu},{identify:e=>e==null,createNode:()=>new Te(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:tu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:tu},{identify:eS,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})=>eS(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:tu}],u3={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},d3=[Vr,Qr].concat(c3,u3),Jp={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 u=s;let f;if(typeof btoa=="function"){let m="";for(let p=0;p<u.length;++p)m+=String.fromCharCode(u[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=Te.BLOCK_LITERAL),t!==Te.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===Te.BLOCK_LITERAL?`
|
|
146
|
-
`:" ")}return Zp({comment:e,type:t,value:f},a,r,c)}};function wN(e,t){if(yl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!$t(a)){if(gl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const r=a.items[0]||new mn(new Te(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
|
|
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]=$t(a)?a:new mn(a)}}else t("Expected a sequence for this tag");return e}function NN(e,t,s){const{replacer:a}=s,r=new _a(e);r.tag="tag:yaml.org,2002:pairs";let c=0;if(t&&Symbol.iterator in Object(t))for(let u of t){typeof a=="function"&&(u=a.call(t,String(c++),u));let f,m;if(Array.isArray(u))if(u.length===2)f=u[0],m=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const p=Object.keys(u);if(p.length===1)f=p[0],m=u[f];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else f=u;r.items.push(Vp(f,m,s))}return r}const Xp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wN,createNode:NN};class Dr extends _a{constructor(){super(),this.add=Zn.prototype.add.bind(this),this.delete=Zn.prototype.delete.bind(this),this.get=Zn.prototype.get.bind(this),this.has=Zn.prototype.has.bind(this),this.set=Zn.prototype.set.bind(this),this.tag=Dr.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,u;if($t(r)?(c=Qn(r.key,"",s),u=Qn(r.value,c,s)):c=Qn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,u)}return a}static from(t,s,a){const r=NN(t,s,a),c=new this;return c.items=r.items,c}}Dr.tag="tag:yaml.org,2002:omap";const Wp={collection:"seq",identify:e=>e instanceof Map,nodeClass:Dr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const s=wN(e,t),a=[];for(const{key:r}of s.items)pt(r)&&(a.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new Dr,s)},createNode:(e,t,s)=>Dr.from(e,t,s)};function CN({value:e,source:t},s){return t&&(e?kN:zN).test.test(t)?t:e?s.options.trueStr:s.options.falseStr}const kN={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 Te(!0),stringify:CN},zN={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 Te(!1),stringify:CN},f3={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:fs},h3={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():fs(e)}},m3={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 Te(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:fs},vl=e=>typeof e=="bigint"||Number.isInteger(e);function hd(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 u=BigInt(e);return r==="-"?BigInt(-1)*u:u}const c=parseInt(e,s);return r==="-"?-1*c:c}function eg(e,t,s){const{value:a}=e;if(vl(a)){const r=a.toString(t);return a<0?"-"+s+r.substr(1):s+r}return fs(e)}const p3={identify:vl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,s)=>hd(e,2,2,s),stringify:e=>eg(e,2,"0b")},g3={identify:vl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,s)=>hd(e,1,8,s),stringify:e=>eg(e,8,"0")},y3={identify:vl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,s)=>hd(e,0,10,s),stringify:fs},v3={identify:vl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,s)=>hd(e,2,16,s),stringify:e=>eg(e,16,"0x")};class Mr extends Zn{constructor(t){super(t),this.tag=Mr.tag}add(t){let s;$t(t)?s=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?s=new mn(t.key,null):s=new mn(t,null),va(this.items,s.key)||this.items.push(s)}get(t,s){const a=va(this.items,t);return!s&&$t(a)?pt(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 mn(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 u of s)typeof r=="function"&&(u=r.call(s,u,u)),c.items.push(Vp(u,null,a));return c}}Mr.tag="tag:yaml.org,2002:set";const tg={collection:"map",identify:e=>e instanceof Set,nodeClass:Mr,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,s)=>Mr.from(e,t,s),resolve(e,t){if(gl(e)){if(e.hasAllNullValues(!0))return Object.assign(new Mr,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ng(e,t){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,r=u=>t?BigInt(u):Number(u),c=a.replace(/_/g,"").split(":").reduce((u,f)=>u*r(60)+r(f),r(0));return s==="-"?r(-1)*c:c}function _N(e){let{value:t}=e,s=u=>u;if(typeof t=="bigint")s=u=>BigInt(u);else if(isNaN(t)||!isFinite(t))return fs(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(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const EN={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})=>ng(e,s),stringify:_N},AN={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=>ng(e,!1),stringify:_N},md={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(md.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,u,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,u||0,f||0,m);const v=t[8];if(v&&v!=="Z"){let y=ng(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$/,"")??""},tS=[Vr,Qr,ud,dd,kN,zN,p3,g3,y3,v3,f3,h3,m3,Jp,Vs,Wp,Xp,tg,EN,AN,md],nS=new Map([["core",l3],["failsafe",[Vr,Qr,ud]],["json",d3],["yaml11",tS],["yaml-1.1",tS]]),sS={binary:Jp,bool:Qp,float:vN,floatExp:yN,floatNaN:gN,floatTime:AN,int:SN,intHex:jN,intOct:bN,intTime:EN,map:Vr,merge:Vs,null:dd,omap:Wp,pairs:Xp,seq:Qr,set:tg,timestamp:md},x3={"tag:yaml.org,2002:binary":Jp,"tag:yaml.org,2002:merge":Vs,"tag:yaml.org,2002:omap":Wp,"tag:yaml.org,2002:pairs":Xp,"tag:yaml.org,2002:set":tg,"tag:yaml.org,2002:timestamp":md};function om(e,t,s){const a=nS.get(t);if(a&&!e)return s&&!a.includes(Vs)?a.concat(Vs):a.slice();let r=a;if(!r)if(Array.isArray(e))r=[];else{const c=Array.from(nS.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).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(Vs)),r.reduce((c,u)=>{const f=typeof u=="string"?sS[u]:u;if(!f){const m=JSON.stringify(u),p=Object.keys(sS).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 b3=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class sg{constructor({compat:t,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:u,toStringDefaults:f}){this.compat=Array.isArray(t)?om(t,"compat"):t?om(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?x3:{},this.tags=om(s,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Li,{value:Vr}),Object.defineProperty(this,Ns,{value:ud}),Object.defineProperty(this,Fr,{value:Qr}),this.sortMapEntries=typeof u=="function"?u:u===!0?b3:null}clone(){const t=Object.create(sg.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function S3(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=fN(e,t),{commentString:c}=r.options;if(e.commentBefore){s.length!==1&&s.unshift("");const m=c(e.commentBefore);s.unshift(Zs(m,""))}let u=!1,f=null;if(e.contents){if(Mt(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(Zs(v,""))}r.forceBlockIndent=!!e.comment,f=e.contents.comment}const m=f?void 0:()=>u=!0;let p=Br(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(Br(e.contents,r));if(e.directives?.docEnd)if(e.comment){const m=c(e.comment);m.includes(`
|
|
149
|
-
`)?(s.push("..."),s.push(Zs(m,""))):s.push(`... ${m}`)}else s.push("...");else{let m=e.comment;m&&u&&(m=m.replace(/^\n+/,"")),m&&((!u||f)&&s[s.length-1]!==""&&s.push(""),s.push(Zs(c(m),"")))}return s.join(`
|
|
150
|
-
`)+`
|
|
151
|
-
`}class pd{constructor(t,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Yn,{value:Zm});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:u}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new fn({version:u}),this.setSchema(u,a),this.contents=t===void 0?null:this.createNode(t,r,a)}clone(){const t=Object.create(pd.prototype,{[Yn]:{value:Zm}});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=Mt(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Cr(this.contents)&&this.contents.add(t)}addIn(t,s){Cr(this.contents)&&this.contents.addIn(t,s)}createAlias(t,s){if(!t.anchor){const a=oN(this);t.anchor=!s||a.has(s)?lN(s||"a",a):s}return new Fp(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=R=>typeof R=="number"||R instanceof String||R 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:u,flow:f,keepUndefined:m,onTagObj:p,tag:v}=a??{},{onAnchor:y,setAnchors:x,sourceObjects:b}=V4(this,u||"a"),N={aliasDuplicateObjects:c??!0,keepUndefined:m??!1,onAnchor:y,onTagObj:p,replacer:r,schema:this.schema,sourceObjects:b},S=ul(t,v,N);return f&&Dt(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 mn(r,c)}delete(t){return Cr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Qo(t)?this.contents==null?!1:(this.contents=null,!0):Cr(this.contents)?this.contents.deleteIn(t):!1}get(t,s){return Dt(this.contents)?this.contents.get(t,s):void 0}getIn(t,s){return Qo(t)?!s&&pt(this.contents)?this.contents.value:this.contents:Dt(this.contents)?this.contents.getIn(t,s):void 0}has(t){return Dt(this.contents)?this.contents.has(t):!1}hasIn(t){return Qo(t)?this.contents!==void 0:Dt(this.contents)?this.contents.hasIn(t):!1}set(t,s){this.contents==null?this.contents=$u(this.schema,[t],s):Cr(this.contents)&&this.contents.set(t,s)}setIn(t,s){Qo(t)?this.contents=s:this.contents==null?this.contents=$u(this.schema,Array.from(t),s):Cr(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 fn({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 fn({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 sg(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:u}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},m=Qn(this.contents,s??"",f);if(typeof c=="function")for(const{count:p,res:v}of f.anchors.values())c(v,p);return typeof u=="function"?Rr(u,{"":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 S3(this,t)}}function Cr(e){if(Dt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class RN extends Error{constructor(t,s,a,r){super(),this.name=t,this.code=a,this.message=r,this.pos=s}}class nu extends RN{constructor(t,s,a){super("YAMLParseError",t,s,a)}}class j3 extends RN{constructor(t,s,a){super("YAMLWarning",t,s,a)}}const iS=(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,u=e.substring(t.lineStarts[a-1],t.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&u.length>80){const f=Math.min(c-39,u.length-79);u="…"+u.substring(f),c-=f-1}if(u.length>80&&(u=u.substring(0,79)+"…"),a>1&&/^ *$/.test(u.substring(0,c))){let f=e.substring(t.lineStarts[a-2],t.lineStarts[a-1]);f.length>80&&(f=f.substring(0,79)+`…
|
|
152
|
-
`),u=f+u}if(/[^ ]/.test(u)){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
|
-
|
|
154
|
-
${u}
|
|
155
|
-
${p}
|
|
156
|
-
`}};function qr(e,{flow:t,indicator:s,next:a,offset:r,onError:c,parentIndent:u,startOnNewline:f}){let m=!1,p=f,v=f,y="",x="",b=!1,N=!1,S=null,C=null,k=null,R=null,A=null,z=null,O=null;for(const L of e)switch(N&&(L.type!=="space"&&L.type!=="newline"&&L.type!=="comma"&&c(L.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),N=!1),S&&(p&&L.type!=="comment"&&L.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),L.type){case"space":!t&&(s!=="doc-start"||a?.type!=="flow-collection")&&L.source.includes(" ")&&(S=L),v=!0;break;case"comment":{v||c(L,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const U=L.source.substring(1)||" ";y?y+=x+U:y=U,x="",p=!1;break}case"newline":p?y?y+=L.source:(!z||s!=="seq-item-ind")&&(m=!0):x+=L.source,p=!0,b=!0,(C||k)&&(R=L),v=!0;break;case"anchor":C&&c(L,"MULTIPLE_ANCHORS","A node can have at most one anchor"),L.source.endsWith(":")&&c(L.offset+L.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=L,O??(O=L.offset),p=!1,v=!1,N=!0;break;case"tag":{k&&c(L,"MULTIPLE_TAGS","A node can have at most one tag"),k=L,O??(O=L.offset),p=!1,v=!1,N=!0;break}case s:(C||k)&&c(L,"BAD_PROP_ORDER",`Anchors and tags must be after the ${L.source} indicator`),z&&c(L,"UNEXPECTED_TOKEN",`Unexpected ${L.source} in ${t??"collection"}`),z=L,p=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(t){A&&c(L,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),A=L,p=!1,v=!1;break}default:c(L,"UNEXPECTED_TOKEN",`Unexpected ${L.type} token`),p=!1,v=!1}const $=e[e.length-1],E=$?$.offset+$.source.length:r;return N&&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<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:A,found:z,spaceBefore:m,comment:y,hasNewline:b,anchor:C,tag:k,newlineAfterProp:R,end:E,start:O??E}}function dl(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(dl(t.key)||dl(t.value))return!0}return!1;default:return!0}}function Jm(e,t,s){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&dl(t)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function TN(e,t,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,u)=>c===u||pt(c)&&pt(u)&&c.value===u.value;return t.some(c=>r(c.key,s))}const aS="All mapping items must start at the same column";function w3({composeNode:e,composeEmptyNode:t},s,a,r,c){const u=c?.nodeClass??Zn,f=new u(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:N}=v,S=qr(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",aS)),!S.anchor&&!S.tag&&!b){p=S.end,S.comment&&(f.comment?f.comment+=`
|
|
158
|
-
`+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||dl(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",aS);s.atKey=!0;const k=S.end,R=x?e(s,x,S,r):t(s,k,y,null,S,r);s.schema.compat&&Jm(a.indent,x,r),s.atKey=!1,TN(s,f.items,R)&&r(k,"DUPLICATE_KEY","Map keys must be unique");const A=qr(b??[],{indicator:"map-value-ind",next:N,offset:R.range[2],onError:r,parentIndent:a.indent,startOnNewline:!x||x.type==="block-scalar"});if(m=A.end,A.found){C&&(N?.type==="block-map"&&!A.hasNewline&&r(m,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<A.found.offset-1024&&r(R.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const z=N?e(s,N,A,r):t(s,m,b,null,A,r);s.schema.compat&&Jm(a.indent,N,r),m=z.range[2];const O=new mn(R,z);s.options.keepSourceTokens&&(O.srcToken=v),f.items.push(O)}else{C&&r(R.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(R.comment?R.comment+=`
|
|
159
|
-
`+A.comment:R.comment=A.comment);const z=new mn(R);s.options.keepSourceTokens&&(z.srcToken=v),f.items.push(z)}}return p&&p<m&&r(p,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,m,p??m],f}function N3({composeNode:e,composeEmptyNode:t},s,a,r,c){const u=c?.nodeClass??_a,f=new u(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=qr(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&&Jm(a.indent,y,r),m=b.range[2],f.items.push(b)}return f.range=[a.offset,m,p??m],f}function xl(e,t,s,a){let r="";if(e){let c=!1,u="";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+=u+v:r=v,u="";break}case"newline":r&&(u+=m),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}t+=m.length}}return{comment:r,offset:t}}const lm="Block collections are not allowed within flow collections",cm=e=>e&&(e.type==="block-map"||e.type==="block-seq");function C3({composeNode:e,composeEmptyNode:t},s,a,r,c){const u=a.start.source==="{",f=u?"flow map":"flow sequence",m=c?.nodeClass??(u?Zn:_a),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:R,key:A,sep:z,value:O}=k,$=qr(R,{flow:f,indicator:"explicit-key-ind",next:A??z?.[0],offset:y,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!$.found){if(!$.anchor&&!$.tag&&!z&&!O){C===0&&$.comma?r($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&r($.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),$.comment&&(p.comment?p.comment+=`
|
|
160
|
-
`+$.comment:p.comment=$.comment),y=$.end;continue}!u&&s.options.strict&&dl(A)&&r(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)$.comma&&r($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if($.comma||r($.start,"MISSING_CHAR",`Missing , between ${f} items`),$.comment){let E="";e:for(const L of R)switch(L.type){case"comma":case"space":break;case"comment":E=L.source.substring(1);break e;default:break e}if(E){let L=p.items[p.items.length-1];$t(L)&&(L=L.value??L.key),L.comment?L.comment+=`
|
|
161
|
-
`+E:L.comment=E,$.comment=$.comment.substring(E.length+1)}}if(!u&&!z&&!$.found){const E=O?e(s,O,$,r):t(s,$.end,z,null,$,r);p.items.push(E),y=E.range[2],cm(O)&&r(E.range,"BLOCK_IN_FLOW",lm)}else{s.atKey=!0;const E=$.end,L=A?e(s,A,$,r):t(s,E,R,null,$,r);cm(A)&&r(L.range,"BLOCK_IN_FLOW",lm),s.atKey=!1;const U=qr(z??[],{flow:f,indicator:"map-value-ind",next:O,offset:L.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(U.found){if(!u&&!$.found&&s.options.strict){if(z)for(const ee of z){if(ee===U.found)break;if(ee.type==="newline"){r(ee,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}$.start<U.found.offset-1024&&r(U.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else O&&("source"in O&&O.source?.[0]===":"?r(O,"MISSING_CHAR",`Missing space after : in ${f}`):r(U.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const X=O?e(s,O,U,r):U.found?t(s,U.end,z,null,U,r):null;X?cm(O)&&r(X.range,"BLOCK_IN_FLOW",lm):U.comment&&(L.comment?L.comment+=`
|
|
162
|
-
`+U.comment:L.comment=U.comment);const Q=new mn(L,X);if(s.options.keepSourceTokens&&(Q.srcToken=k),u){const ee=p;TN(s,ee.items,L)&&r(E,"DUPLICATE_KEY","Map keys must be unique"),ee.items.push(Q)}else{const ee=new Zn(s.schema);ee.flow=!0,ee.items.push(Q);const ue=(X??L).range;ee.range=[L.range[0],ue[1],ue[2]],p.items.push(ee)}y=X?X.range[2]:U.end}}const x=u?"}":"]",[b,...N]=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&&N.unshift(b)}if(N.length>0){const C=xl(N,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 um(e,t,s,a,r,c){const u=s.type==="block-map"?w3(e,t,s,a,c):s.type==="block-seq"?N3(e,t,s,a,c):C3(e,t,s,a,c),f=u.constructor;return r==="!"||r===f.tagName?(u.tag=f.tagName,u):(r&&(u.tag=r),u)}function k3(e,t,s,a,r){const c=a.tag,u=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,N=x&&c?x.offset>c.offset?x:c:x??c;N&&(!b||b.offset<N.offset)&&r(N,"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||!u||u==="!"||u===Zn.tagName&&f==="map"||u===_a.tagName&&f==="seq")return um(e,t,s,r,u);let m=t.schema.tags.find(x=>x.tag===u&&x.collection===f);if(!m){const x=t.schema.knownTags[u];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: ${u}`,!0),um(e,t,s,r,u)}const p=um(e,t,s,r,u,m),v=m.resolve?.(p,x=>r(c,"TAG_RESOLVE_FAILED",x),t.options)??p,y=Mt(v)?v:new Te(v);return y.range=p.range,y.tag=u,m?.format&&(y.format=m.format),y}function z3(e,t,s){const a=t.offset,r=_3(t,e.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?Te.BLOCK_FOLDED:Te.BLOCK_LITERAL,u=t.source?E3(t.source):[];let f=u.length;for(let S=u.length-1;S>=0;--S){const C=u[S][1];if(C===""||C==="\r")f=S;else break}if(f===0){const S=r.chomp==="+"&&u.length>0?`
|
|
164
|
-
`.repeat(Math.max(1,u.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]=u[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=u.length-1;S>=f;--S)u[S][0].length>m&&(f=S+1);let y="",x="",b=!1;for(let S=0;S<v;++S)y+=u[S][0].slice(m)+`
|
|
165
|
-
`;for(let S=v;S<f;++S){let[C,k]=u[S];p+=C.length+k.length+1;const R=k[k.length-1]==="\r";if(R&&(k=k.slice(0,-1)),k&&C.length<m){const z=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(p-k.length-(R?2:1),"BAD_INDENT",z),C=""}c===Te.BLOCK_LITERAL?(y+=x+C.slice(m)+k,x=`
|
|
166
|
-
`):C.length>m||k[0]===" "?(x===" "?x=`
|
|
167
|
-
`:!b&&x===`
|
|
168
|
-
`&&(x=`
|
|
169
|
-
|
|
170
|
-
`),y+=x+C.slice(m)+k,x=`
|
|
171
|
-
`,b=!0):k===""?x===`
|
|
172
|
-
`?y+=`
|
|
173
|
-
`:x=`
|
|
174
|
-
`:(y+=x+k,x=" ",b=!1)}switch(r.chomp){case"-":break;case"+":for(let S=f;S<u.length;++S)y+=`
|
|
175
|
-
`+u[S][0].slice(m);y[y.length-1]!==`
|
|
176
|
-
`&&(y+=`
|
|
177
|
-
`);break;default:y+=`
|
|
178
|
-
`}const N=a+r.length+t.source.length;return{value:y,type:c,comment:r.comment,range:[a,N,N]}}function _3({offset:e,props:t},s,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],c=r[0];let u=0,f="",m=-1;for(let x=1;x<r.length;++x){const b=r[x];if(!f&&(b==="-"||b==="+"))f=b;else{const N=Number(b);!u&&N?u=N:m===-1&&(m=e+x)}}m!==-1&&a(m,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let p=!1,v="",y=r.length;for(let x=1;x<t.length;++x){const b=t[x];switch(b.type){case"space":p=!0;case"newline":y+=b.source.length;break;case"comment":s&&!p&&a(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=b.source.length,v=b.source.substring(1);break;case"error":a(b,"UNEXPECTED_TOKEN",b.message),y+=b.source.length;break;default:{const N=`Unexpected token in block scalar header: ${b.type}`;a(b,"UNEXPECTED_TOKEN",N);const S=b.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:u,chomp:f,comment:v,length:y}}function E3(e){const t=e.split(/\n( *)/),s=t[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let u=1;u<t.length;u+=2)c.push([t[u],t[u+1]]);return c}function A3(e,t,s){const{offset:a,type:r,source:c,end:u}=e;let f,m;const p=(x,b,N)=>s(a+x,b,N);switch(r){case"scalar":f=Te.PLAIN,m=R3(c,p);break;case"single-quoted-scalar":f=Te.QUOTE_SINGLE,m=T3(c,p);break;case"double-quoted-scalar":f=Te.QUOTE_DOUBLE,m=O3(c,p);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,y=xl(u,v,t,s);return{value:m,type:f,comment:y.comment,range:[a,v,y.offset]}}function R3(e,t){let s="";switch(e[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),ON(e)}function T3(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ON(e.slice(1,-1)).replace(/''/g,"'")}function ON(e){let t,s;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
179
|
-
`,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
180
|
-
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=t.exec(e);if(!a)return e;let r=a[1],c=" ",u=t.lastIndex;for(s.lastIndex=u;a=s.exec(e);)a[1]===""?c===`
|
|
181
|
-
`?r+=c:c=`
|
|
182
|
-
`:(r+=c+a[1],c=" "),u=s.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=u,a=f.exec(e),r+c+(a?.[1]??"")}function O3(e,t){let s="";for(let a=1;a<e.length-1;++a){const r=e[a];if(!(r==="\r"&&e[a+1]===`
|
|
183
|
-
`))if(r===`
|
|
184
|
-
`){const{fold:c,offset:u}=L3(e,a);s+=c,a=u}else if(r==="\\"){let c=e[++a];const u=D3[c];if(u)s+=u;else if(c===`
|
|
185
|
-
`)for(c=e[a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="\r"&&e[a+1]===`
|
|
186
|
-
`)for(c=e[++a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="x"||c==="u"||c==="U"){const f={x:2,u:4,U:8}[c];s+=M3(e,a+1,f,t),a+=f}else{const f=e.substr(a-1,2);t(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),s+=f}}else if(r===" "||r===" "){const c=a;let u=e[a+1];for(;u===" "||u===" ";)u=e[++a+1];u!==`
|
|
187
|
-
`&&!(u==="\r"&&e[a+2]===`
|
|
188
|
-
`)&&(s+=a>c?e.slice(c,a+1):r)}else s+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function L3(e,t){let s="",a=e[t+1];for(;(a===" "||a===" "||a===`
|
|
189
|
-
`||a==="\r")&&!(a==="\r"&&e[t+2]!==`
|
|
190
|
-
`);)a===`
|
|
191
|
-
`&&(s+=`
|
|
192
|
-
`),t+=1,a=e[t+1];return s||(s=" "),{fold:s,offset:t}}const D3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function M3(e,t,s,a){const r=e.substr(t,s),u=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(u)){const f=e.substr(t-2,s+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(u)}function LN(e,t,s,a){const{value:r,type:c,comment:u,range:f}=t.type==="block-scalar"?z3(e,t,a):A3(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[Ns]:m?p=$3(e.schema,r,m,s,a):t.type==="scalar"?p=P3(e,r,t,a):p=e.schema[Ns];let v;try{const y=p.resolve(r,x=>a(s??t,"TAG_RESOLVE_FAILED",x),e.options);v=pt(y)?y:new Te(y)}catch(y){const x=y instanceof Error?y.message:String(y);a(s??t,"TAG_RESOLVE_FAILED",x),v=new Te(r)}return v.range=f,v.source=r,c&&(v.type=c),m&&(v.tag=m),p.format&&(v.format=p.format),u&&(v.comment=u),v}function $3(e,t,s,a,r){if(s==="!")return e[Ns];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 u=e.knownTags[s];return u&&!u.collection?(e.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[Ns])}function P3({atKey:e,directives:t,schema:s},a,r,c){const u=s.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||s[Ns];if(s.compat){const f=s.compat.find(m=>m.default&&m.test?.test(a))??s[Ns];if(u.tag!==f.tag){const m=t.tagString(u.tag),p=t.tagString(f.tag),v=`Value may be parsed as either ${m} or ${p}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return u}function U3(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 I3={composeNode:DN,composeEmptyNode:ig};function DN(e,t,s,a){const r=e.atKey,{spaceBefore:c,comment:u,anchor:f,tag:m}=s;let p,v=!0;switch(t.type){case"alias":p=B3(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=LN(e,t,m,a),f&&(p.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":p=k3(I3,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=ig(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&&(!pt(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),u&&(t.type==="scalar"&&t.source===""?p.comment=u:p.commentBefore=u),e.options.keepSourceTokens&&v&&(p.srcToken=t),p}function ig(e,t,s,a,{spaceBefore:r,comment:c,anchor:u,tag:f,end:m},p){const v={type:"scalar",offset:U3(t,s,a),indent:-1,source:""},y=LN(e,v,f,p);return u&&(y.anchor=u.source.substring(1),y.anchor===""&&p(u,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=m),y}function B3({options:e},{offset:t,source:s,end:a},r){const c=new Fp(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 u=t+s.length,f=xl(a,u,e.strict,r);return c.range=[t,u,f.offset],f.comment&&(c.comment=f.comment),c}function q3(e,t,{offset:s,start:a,value:r,end:c},u){const f=Object.assign({_directives:t},e),m=new pd(void 0,f),p={atKey:!1,atRoot:!0,directives:m.directives,options:m.options,schema:m.schema},v=qr(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});v.found&&(m.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&u(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),m.contents=r?DN(p,r,v,u):ig(p,v.end,a,null,v,u);const y=m.contents.range[2],x=xl(c,y,!1,u);return x.comment&&(m.comment=x.comment),m.range=[s,y,x.offset],m}function Zo(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 rS(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
|
-
|
|
195
|
-
`:`
|
|
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 H3{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const u=Zo(s);c?this.warnings.push(new j3(u,a,r)):this.errors.push(new nu(u,a,r))},this.directives=new fn({version:t.version||"1.2"}),this.options=t}decorate(t,s){const{comment:a,afterEmptyLine:r}=rS(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(Dt(c)&&!c.flow&&c.items.length>0){let u=c.items[0];$t(u)&&(u=u.key);const f=u.commentBefore;u.commentBefore=f?`${a}
|
|
198
|
-
${f}`:a}else{const u=c.commentBefore;c.commentBefore=u?`${a}
|
|
199
|
-
${u}`: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:rS(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=Zo(t);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const s=q3(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 nu(Zo(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 nu(Zo(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=xl(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 nu(Zo(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 pd(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 MN="\uFEFF",$N="",PN="",Xm="";function K3(e){switch(e){case MN:return"byte-order-mark";case $N:return"doc-mode";case PN:return"flow-error-end";case Xm:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
201
|
-
`:case`\r
|
|
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 rs(e){switch(e){case void 0:case" ":case`
|
|
203
|
-
`:case"\r":case" ":return!0;default:return!1}}const oS=new Set("0123456789ABCDEFabcdef"),G3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),su=new Set(",[]{}"),F3=new Set(` ,[]{}
|
|
204
|
-
\r `),dm=e=>!e||F3.has(e);class Z3{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
|
-
`?!0:s==="\r"?this.buffer[t+1]===`
|
|
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
|
-
`||!r&&!this.atEnd)return t+a+1}return s===`
|
|
208
|
-
`||a>=this.indentNext||!s&&!this.atEnd?t+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(t,3);if((a==="---"||a==="...")&&rs(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]===MN&&(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 $N,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==="...")&&rs(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&&!rs(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===":")&&rs(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(dm),"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("..."))&&rs(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield PN,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(dm),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||rs(u)||u===",")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
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){const c=this.continueScalar(r+1);if(c===-1)break;r=a.indexOf(`
|
|
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=>rs(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
|
-
`:t=c,s=0;break;case"\r":{const u=this.buffer[c+1];if(!u&&!this.atEnd)return this.setNext("block-scalar");if(u===`
|
|
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
|
-
`,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
|
-
`;)a=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let c=t-1,u=this.buffer[c];u==="\r"&&(u=this.buffer[--c]);const f=c;for(;u===" ";)u=this.buffer[--c];if(u===`
|
|
216
|
-
`&&c>=this.pos&&c+1+s>f)t=c;else break}while(!0);return yield Xm,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(rs(c)||t&&su.has(c))break;s=a}else if(rs(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
|
|
217
|
-
`?(a+=1,r=`
|
|
218
|
-
`,c=this.buffer[a+1]):s=a),c==="#"||t&&su.has(c))break;if(r===`
|
|
219
|
-
`){const u=this.continueScalar(a+1);if(u===-1)break;a=Math.max(a,u-2)}}else{if(t&&su.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Xm,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(dm))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,s=this.charAt(1);if(rs(s)||t&&su.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(;!rs(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(G3.has(s))s=this.buffer[++t];else if(s==="%"&&oS.has(this.buffer[t+1])&&oS.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
|
-
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
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 V3{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 lS(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 UN(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 iu(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 kr(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 cS(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,UN(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 Q3{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 Z3,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=K3(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"&&cS(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&&lS(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":{lS(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=iu(this.peek(2)),a=kr(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
|
-
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
223
|
-
`,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(r&&s.sep&&!s.value){const u=[];for(let f=0;f<s.sep.length;++f){const m=s.sep[f];switch(m.type){case"newline":u.push(f);break;case"space":break;case"comment":m.indent>t.indent&&(u.length=0);break;default:u.length=0}}u.length>=2&&(c=s.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(c.push(this.sourceToken),t.items.push({start:c,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(zi(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(UN(s.key)&&!zi(s.sep,"newline")){const u=kr(s.start),f=s.key,m=s.sep;m.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:f,sep:m}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(zi(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=kr(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?t.items.push({start:c,key:null,sep:[this.sourceToken]}):zi(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const u=this.flowScalar(this.type);r||s.value?(t.items.push({start:c,key:u,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(u):(Object.assign(s,{key:u,sep:[]}),this.onKeyLine=!0);return}default:{const u=this.startBlockValue(t);if(u){if(u.type==="block-seq"){if(!s.explicitKey&&s.sep&&!zi(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&t.items.push({start:c});this.stack.push(u);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){const s=t.items[t.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,t.indent)){const r=t.items[t.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,s.start),r.push(this.sourceToken),t.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=t.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;s.value||zi(s.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const s=t.items[t.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?t.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?t.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?t.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const a=this.startBlockValue(t);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===t.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=iu(a),c=kr(r);cS(t);const u=t.end.splice(1,t.end.length);u.push(this.sourceToken);const f={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:c,key:t,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=f}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let s=this.source.indexOf(`
|
|
224
|
-
`)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
|
|
225
|
-
`,s)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const s=iu(t),a=kr(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=iu(t),a=kr(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,s){return this.type!=="comment"||this.indent<=s?!1:t.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Y3(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new V3||null,prettyErrors:t}}function J3(e,t={}){const{lineCounter:s,prettyErrors:a}=Y3(t),r=new Q3(s?.addNewLine),c=new H3(t),u=Array.from(c.compose(r.parse(e)));if(a&&s)for(const f of u)f.errors.forEach(iS(e,s)),f.warnings.forEach(iS(e,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function X3({onApplied:e}){const[t,s]=w.useState(""),[a,r]=w.useState(!1),[c,u]=w.useState([]),[f,m]=w.useState([]),p=async()=>{if(!t.trim())return;r(!0),u([]),m([]);const v=J3(t),y=[],x=[];for(let b=0;b<v.length;b++){const N=v[b];if(N.errors.length>0){y.push(`Document ${b+1}: ${N.errors[0]?.message}`);continue}const S=N.toJSON();if(!(!S||typeof S!="object"))try{const C=await m2(S);x.push(`Applied "${C.displayName||C.name}" (revision ${C.configRevision})`)}catch(C){y.push(`Document ${b+1}: ${C instanceof Error?C.message:String(C)}`)}}u(x),m(y),r(!1),x.length>0&&(Ke({title:"YAML applied",detail:`Applied ${x.length} document${x.length===1?"":"s"} successfully.`,tone:y.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return o.jsxs("section",{className:"mt-8",children:[o.jsx("div",{className:"page-section-divider"}),o.jsx("div",{className:"section-head mt-6",children:o.jsxs("div",{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),o.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),o.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",o.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",o.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),o.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
226
|
-
kind: Project
|
|
227
|
-
metadata:
|
|
228
|
-
name: my-project
|
|
229
|
-
spec:
|
|
230
|
-
canonicalDomain: example.com
|
|
231
|
-
country: US
|
|
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(oe,{type:"button",disabled:!t.trim()||a,onClick:p,children:a?"Applying...":"Apply"})})]})}function W3(){const{dashboard:e,isLoading:t,refetch:s}=Oa();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(E=>o.jsx("div",{className:"skeleton-text-sm w-16"},E))}),[1,2,3].map(E=>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"})]},E))]})]});const a=e.projects,r=Ii(),[c,u]=w.useState(!1),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,x]=w.useState(""),[b,N]=w.useState("US"),[S,C]=w.useState("en"),[k,R]=w.useState(!1),[A,z]=w.useState(null),O=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),$=async()=>{if(!(!O||!y)){R(!0),z(null);try{const E=await Gu(O,{displayName:p||f,canonicalDomain:y,country:b,language:S});Ke({title:"Project created",detail:`${E.displayName||E.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${E.name}`,dedupeMode:"drop"}),s(),m(""),v(""),x(""),N("US"),C("en"),u(!1),r({to:"/projects/$projectId",params:{projectId:E.id}})}catch(E){z(E instanceof Error?E.message:"Failed to create project")}finally{R(!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(oe,{type:"button",onClick:()=>u(E=>!E),children:[o.jsx(Jx,{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:E=>m(E.target.value)}),O&&O!==f?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",O]}):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:E=>v(E.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:E=>x(E.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:E=>N(E.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:E=>C(E.target.value.toLowerCase())})]})]})]}),A?o.jsx("p",{className:"text-rose-400 text-sm mt-3",children:A}):null,o.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[o.jsx(oe,{type:"button",disabled:!O||!y||k,onClick:$,children:k?"Creating...":"Create project"}),o.jsx(oe,{type:"button",variant:"ghost",onClick:()=>u(!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(E=>{const L=E.recentRuns[0];return o.jsxs("tr",{className:"cursor-pointer",onClick:()=>r({to:"/projects/$projectId",params:{projectId:E.project.id}}),children:[o.jsxs("td",{children:[o.jsx(St,{to:"/projects/$projectId",params:{projectId:E.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:U=>U.stopPropagation(),children:E.project.displayName||E.project.name}),o.jsx("p",{className:"text-[11px] text-zinc-500",children:E.project.name})]}),o.jsx("td",{className:"text-zinc-400",children:E.project.canonicalDomain}),o.jsx("td",{children:o.jsx(lt,{tone:E.visibilitySummary.tone,children:E.visibilitySummary.value})}),o.jsx("td",{className:"text-zinc-500 text-sm",children:L?o.jsx(Ju,{status:L.status}):o.jsx("span",{className:"text-zinc-600",children:"No runs"})}),o.jsx("td",{className:"text-right text-zinc-500",children:E.project.country})]},E.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(oe,{type:"button",onClick:()=>u(!0),children:[o.jsx(Jx,{className:"size-4 mr-1.5"}),"Add project"]})]}),o.jsx(X3,{onApplied:()=>{s()}})]})}function ws({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 IN({run:e}){const{openRun:t}=Gr();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(Ju,{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(oe,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function BN({value:e,label:t,delta:s,tone:a,description:r,tooltip:c,isNumeric:u=!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):u&&!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:u?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),o.jsxs("p",{className:"gauge-label",children:[t,c&&o.jsx(ws,{text:c})]}),o.jsx("p",{className:"gauge-delta",children:s}),o.jsx("p",{className:"gauge-description",children:r})]})}function uS({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((u,f)=>o.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[u.citationState]??"bg-zinc-700"} ${u.model&&f>0&&s[f-1]?.model&&s[f-1].model!==u.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[u.citationState,new Date(u.createdAt).toLocaleDateString(),u.model?`model ${u.model}`:null,u.model&&f>0&&s[f-1]?.model&&s[f-1].model!==u.model?"model changed":null].filter(Boolean).join(" — ")},f))}),o.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function e$(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 t$({evidence:e}){const{openEvidence:t}=Gr(),[s,a]=w.useState(new Set),r=w.useMemo(()=>{const u=new Map;for(const f of e){const m=u.get(f.keyword)??[];u.set(f.keyword,[...m,f])}return[...u.entries()].map(([f,m])=>({phrase:f,items:m}))},[e]),c=u=>{a(f=>{const m=new Set(f);return m.has(u)?m.delete(u):m.add(u),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:u,items:f})=>{const m=s.has(u),p=f.map(N=>N.citationState),v=p.includes("cited")?"cited":p.includes("emerging")?"emerging":p.includes("lost")?"lost":p.every(N=>N==="pending")?"pending":"not-cited",y=e$(f),x=f.filter(N=>N.citationState==="cited"||N.citationState==="emerging").length,b=(()=>{if(y.length===0)return"Awaiting first run";if(y.length===1)return"First observation";const N=y[y.length-1].citationState,S=y[y.length-2].citationState;if(S!=="cited"&&N==="cited")return"Newly cited";if(S==="cited"&&N!=="cited")return"Lost since last run";let C=0;for(let k=y.length-1;k>=0&&y[k].citationState===N;k--)C++;return N==="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(w.Fragment,{children:[o.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(u),"aria-expanded":m,children:[o.jsx("td",{children:o.jsx(Fu,{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:u}),o.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(N=>o.jsx(al,{provider:N.provider},N.id))})]})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Bm,{state:v}),o.jsxs("span",{className:"text-[11px] text-zinc-500",children:[x,"/",f.length]})]})}),o.jsx("td",{children:o.jsx(uS,{history:y})}),o.jsx("td",{className:"evidence-change-cell",children:b}),o.jsx("td",{})]}),m&&f.map(N=>o.jsxs("tr",{className:"bg-zinc-900/30",children:[o.jsx("td",{}),o.jsx("td",{className:"evidence-keyword-cell pl-5",children:o.jsx(al,{provider:N.provider})}),o.jsx("td",{children:o.jsx(Bm,{state:N.citationState})}),o.jsx("td",{children:o.jsx(uS,{history:N.runHistory})}),o.jsx("td",{className:"evidence-change-cell",children:N.changeLabel}),o.jsx("td",{children:o.jsx(oe,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(N.id)},children:"View"})})]},N.id))]},u)})})]})})}function n$({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(lt,{tone:HA(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 s$=["7d","30d","90d","all"],i$=["gap","cited","uncited"],qN={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 a$({projectName:e}){const[t,s]=w.useState("30d"),[a,r]=w.useState(null),[c,u]=w.useState(null),[f,m]=w.useState(null),[p,v]=w.useState(null),[y,x]=w.useState(!0);return w.useEffect(()=>{let b=!1;return x(!0),Promise.all([M2(e,t),$2(e,t),P2(e,t)]).then(([N,S,C])=>{b||(r(N),u(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(ws,{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:s$.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(BN,{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(lt,{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,N])=>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:[(N.citationRate*100).toFixed(1),"%"]}),o.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[N.cited," / ",N.total]})]},b))})]})]})]}),a.buckets.length>=1&&o.jsx(r$,{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(ws,{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:i$.map(b=>{const N=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"," (",N,")"]},b)})}),o.jsx(o$,{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(ws,{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(l$,{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 ${qN[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(N=>N.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 r$({buckets:e,keywordChanges:t}){const[s,a]=w.useState(null),r=600,c=140,u={top:30,right:10,bottom:20,left:40},f=r-u.left-u.right,m=c-u.top-u.bottom,p=1,v=e.map((b,N)=>{const S=u.left+(e.length>1?N/(e.length-1)*f:f/2),C=u.top+m-b.citationRate/p*m;return{x:S,y:C}}),y=w.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 R=(new Date(C.date).getTime()-b)/S;return R<0||R>1?null:{...C,x:u.left+R*f}}).filter(C=>C!==null)},[e,t,u.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:u.left-4,y:u.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),o.jsx("text",{x:u.left-4,y:u.top+m+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),o.jsx("line",{x1:u.left,y1:u.top+m,x2:u.left+f,y2:u.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,N)=>o.jsxs("g",{children:[o.jsx("line",{x1:b.x,y1:u.top,x2:b.x,y2:u.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),o.jsx("text",{x:b.x,y:u.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:b.label})]},`kw-change-${N}`)),s!==null&&o.jsx("line",{x1:v[s].x,y1:u.top,x2:v[s].x,y2:u.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((b,N)=>{const{x:S,y:C}=v[N],k=s===N;return o.jsxs("g",{children:[o.jsx("circle",{cx:S,cy:C,r:"10",fill:"transparent",onMouseEnter:()=>a(N),style:{cursor:"pointer"}}),o.jsx("circle",{cx:S,cy:C,r:k?5:3,className:k?"fill-emerald-400":"fill-emerald-500"})]},N)}),s!==null&&(()=>{const b=e[s],{x:N,y:S}=v[s],C=`${(b.citationRate*100).toFixed(1)}%`,k=b.keywordCount?`${b.keywordCount} kp`:"",R=56,A=30,z=Math.max(u.left,Math.min(N-R/2,r-u.right-R)),O=S-A-8;return o.jsxs("g",{children:[o.jsx("rect",{x:z,y:O,width:R,height:A,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),o.jsx("text",{x:z+R/2,y:O+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:C}),k&&o.jsx("text",{x:z+R/2,y:O+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:k})]})})(),e.map((b,N)=>({b,i:N})).filter(({i:b})=>b===0||b===e.length-1||e.length<=7).map(({b,i:N})=>{const S=v[N].x;return o.jsx("text",{x:S,y:c-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:b.startDate.slice(5,10)},N)})]})]})}function o$({gaps:e,filter:t}){const s=w.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(lt,{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 l$({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:`${qN[s.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${s.label}: ${(s.percentage*100).toFixed(1)}%`},s.category)})})}function fm(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function c$(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 u$({projectName:e}){const[t,s]=w.useState(null),[a,r]=w.useState(null),[c,u]=w.useState(!0),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,x]=w.useState(null),[b,N]=w.useState(null),[S,C]=w.useState("sessions"),[k,R]=w.useState("desc");function A(U){u(!0),Fx(e).then(X=>{if(!U.current)return s(X),X.connected?Zx(e):null}).then(X=>{U.current||(X&&r(X),u(!1))}).catch(X=>{U.current||(x(X instanceof Error?X.message:"Failed to load GA4 data"),u(!1))})}w.useEffect(()=>{const U={current:!1};return A(U),()=>{U.current=!0}},[e]);async function z(){m(!0),x(null),N(null);try{const U=await oj(e);N(`Synced ${U.rowCount.toLocaleString()} rows (${U.days} days)`);const X=await Zx(e);r(X);const Q=await Fx(e);s(Q)}catch(U){x(U instanceof Error?U.message:"Sync failed")}finally{m(!1)}}async function O(){v(!0),x(null),N(null);try{await I2(e),s({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),r(null),N("GA4 disconnected")}catch(U){x(U instanceof Error?U.message:"Disconnect failed")}finally{v(!1)}}function $(U){S===U?R(X=>X==="desc"?"asc":"desc"):(C(U),R("desc"))}const E=w.useMemo(()=>a?.topPages?[...a.topPages].sort((U,X)=>{const Q=U[S],ee=X[S];return typeof Q=="string"&&typeof ee=="string"?k==="asc"?Q.localeCompare(ee):ee.localeCompare(Q):k==="asc"?Q-ee:ee-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.jsx(d$,{projectName:e,onConnected:()=>A({current:!1})});const L=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(oe,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[o.jsx(Xx,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),o.jsxs(oe,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:O,children:[o.jsx(kE,{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(ws,{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(hm,{value:fm(a.totalSessions),label:"Total Sessions",subtitle:a.totalSessions.toLocaleString(),tone:"neutral"}),o.jsx(hm,{value:fm(a.totalOrganicSessions),label:"Organic Sessions",subtitle:`${L}% of total`,tone:"positive"}),o.jsx(hm,{value:fm(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(oe,{variant:"outline",size:"sm",disabled:f,onClick:z,children:[o.jsx(Xx,{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(ws,{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(au,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:$,align:"left"}),o.jsx(au,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:$,align:"right"}),o.jsx(au,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:$,align:"right"}),o.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),o.jsx(au,{label:"Users",sortKey:"users",current:S,dir:k,onSort:$,align:"right"})]})}),o.jsx("tbody",{children:E.map(U=>o.jsx(h$,{page:U},U.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 ${c$(a.lastSyncedAt)}`:"Never synced"}),o.jsx("span",{children:a?`${a.topPages.length} pages shown`:""})]})]})}function d$({projectName:e,onConnected:t}){const[s,a]=w.useState(""),[r,c]=w.useState(null),[u,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(null),x=w.useRef(null),b=w.useCallback(S=>{const C=S.target.files?.[0];if(!C)return;y(null),c(C.name);const k=new FileReader;k.onload=()=>{const R=k.result;try{const A=JSON.parse(R);if(!A.client_email||!A.private_key){y("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),f(null);return}f(R)}catch{y("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),f(null)}},k.onerror=()=>{y("Failed to read file."),f(null)},k.readAsText(C)},[]);async function N(){if(y(null),!s.trim()){y("Property ID is required.");return}if(!u){y("Please upload a service account key file.");return}p(!0);try{await U2(e,{propertyId:s.trim(),keyJson:u});try{await oj(e)}catch{}t()}catch(S){y(S instanceof Error?S.message:"Failed to connect GA4")}finally{p(!1)}}return o.jsxs(De,{className:"surface-card p-6",children:[o.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),o.jsx("p",{className:"text-sm text-zinc-400 mb-5",children:"Connect a GA4 property to see traffic data for this project. You'll need a service account key file from Google Cloud Console."}),v&&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:v}),o.jsxs("div",{className:"mb-4",children:[o.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),o.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:s,onChange:S=>a(S.target.value),className:"w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 px-3 py-2 text-sm text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus:ring-1 focus:ring-zinc-600"}),o.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Find this in GA4 → Admin → Property Settings. It's a numeric ID, not the Measurement ID (G-XXXXXX)."})]}),o.jsxs("div",{className:"mb-5",children:[o.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),o.jsx("input",{ref:x,type:"file",accept:".json,application/json",onChange:b,className:"hidden"}),o.jsxs("button",{type:"button",onClick:()=>x.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[o.jsx(_E,{className:"w-4 h-4 shrink-0"}),r?o.jsx("span",{className:"text-zinc-200 truncate",children:r}):o.jsx("span",{children:"Upload .json key file"})]}),o.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Download from Google Cloud Console → IAM & Admin → Service Accounts → Keys → Add Key → JSON. The service account must have ",o.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),o.jsx(oe,{variant:"default",size:"sm",disabled:m||!s.trim()||!u,onClick:N,children:m?"Connecting & syncing…":"Connect GA4"})]})}function au({label:e,sortKey:t,current:s,dir:a,onSort:r,align:c}){const u=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,u&&o.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}const f$={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function hm({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 ${f$[a]}`,children:e}),o.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:s})]})}function h$({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 bl(e){e.invalidateQueries({queryKey:Vn.runs.all}),e.invalidateQueries({queryKey:Vn.projects.all})}function m$(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function p$(e,t){const s=e??"Project";return t==="gsc-sync"?`${s} will refresh after the sync completes.`:t==="inspect-sitemap"?`${s} will notify you when sitemap inspection finishes.`:`${s} will notify you when the run finishes.`}function gd(e,t){fj({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),Ke({title:m$(e.kind),detail:p$(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function g$(e){const t=e.filter(r=>r.status!=="conflict"),s=e.filter(r=>r.status==="conflict");if(t.length===0){Ke({title:"No runs queued",detail:s.length>0?`${s.length} project${s.length===1?"":"s"} already had a run in progress.`:"No projects were available to queue.",tone:"caution",durationMs:8e3,dedupeKey:"run-all:conflict",dedupeMode:"replace"});return}for(const r of t)fj({id:r.id,projectId:r.projectId,kind:r.kind,projectLabel:r.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const a=PE({runIds:t.map(r=>r.id),queuedCount:t.length,skippedCount:s.length});Ke({title:"Run-all batch queued",detail:s.length>0?`${t.length} project${t.length===1?"":"s"} queued, ${s.length} skipped because a run is already active.`:`${t.length} project${t.length===1?"":"s"} queued.`,tone:s.length>0?"caution":"neutral",dedupeKey:`batch:${a}`,dedupeMode:"replace"})}function yd(e,t){if(e instanceof ku&&e.code==="RUN_IN_PROGRESS"){Ke({title:"Run already in progress",detail:t?.projectLabel?`${t.projectLabel} already has an active run. Wait for it to finish, then retry.`:"This project already has an active run. Wait for it to finish, then retry.",tone:"caution",durationMs:8e3,dedupeKey:`run-in-progress:${t?.projectKey??"project"}:${t?.sourceAction??"run"}`,dedupeMode:"replace"});return}Ke({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function HN(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:s})=>Y_(t,s),onSuccess:(t,s)=>{bl(e),gd(t,{projectLabel:s.projectLabel??s.projectName,sourceAction:s.sourceAction})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:s.sourceAction})}})}function y$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:t=>p2(t),onSuccess:t=>{bl(e),g$(t)},onError:t=>{Ke({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function v$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:s})=>sj(t,s),onSuccess:(t,s)=>{bl(e),gd(t,{projectLabel:s.projectLabel??s.projectName,sourceAction:"gsc-sync"})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:"gsc-sync"})}})}function x$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>_2(t),onSuccess:(t,s)=>{bl(e),gd(t.run,{projectLabel:s.projectLabel??s.projectName,sourceAction:"discover-sitemaps"})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:"discover-sitemaps"})}})}function b$(){const e=Pi();return hl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:s})=>k2(t,s),onSuccess:(t,s)=>{bl(e),gd(t,{projectLabel:s.projectLabel??s.projectName,sourceAction:"inspect-sitemap"})},onError:(t,s)=>{yd(t,{projectKey:s.projectName,projectLabel:s.projectLabel??s.projectName,sourceAction:"inspect-sitemap"})}})}function S$({projectName:e}){const[t,s]=w.useState(!1),[a,r]=w.useState([]),[c,u]=w.useState([]),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,x]=w.useState([]),[b,N]=w.useState(null),[S,C]=w.useState(""),[k,R]=w.useState(""),[A,z]=w.useState("30"),[O,$]=w.useState(!1),[E,L]=w.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[U,X]=w.useState(""),[Q,ee]=w.useState(!0),[ue,Ee]=w.useState(!1),[we,K]=w.useState(!1),[ae,me]=w.useState(!1),[V,H]=w.useState(!1),[T,B]=w.useState(!1),[se,le]=w.useState(!1),[J,fe]=w.useState(null),[ye,Ae]=w.useState(!1),[ge,Ze]=w.useState(!1),[et,de]=w.useState(null),[Ve,at]=w.useState(""),[Vt,Pt]=w.useState(!1),[Dn,nn]=w.useState(!1),[_t,re]=w.useState("indexed"),[Ge,gt]=w.useState([]),[Qt,Qe]=w.useState(null),[Me,Ye]=w.useState(!1),[Nt,Be]=w.useState(null),[Da,pn]=w.useState(null),nt=a.find(I=>I.connectionType==="gsc"),Yr=f.length>0||p.length>0||y.length>0,ts=v$(),ht=x$(),gn=b$();async function ce(I){if(!I){u([]),C("");return}K(!0);try{const{sites:he}=await v2(e);u(he),C(I.propertyId??he[0]?.siteUrl??"")}catch(he){u([]),Be(he instanceof Error?he.message:"Failed to load Search Console properties")}finally{K(!1)}}async function kn(){H(!0);try{const I=await S2(e,{startDate:E.startDate||void 0,endDate:E.endDate||void 0,query:E.query||void 0,page:E.page||void 0,limit:parseInt(E.limit,10)||20});m(I)}catch(I){m([]),Be(I instanceof Error?I.message:"Failed to load GSC performance data")}finally{H(!1)}}async function Ma(){B(!0);try{const[I,he]=await Promise.all([w2(e,{url:U.trim()||void 0,limit:20}),N2(e)]);v(I),x(he)}catch(I){v([]),x([]),Be(I instanceof Error?I.message:"Failed to load GSC inspection history")}finally{B(!1)}}async function jl(){Ae(!0);try{const[I,he]=await Promise.all([jp(e),C2(e).catch(()=>[])]);fe(I),gt(he)}catch(I){fe(null),gt([]),Be(I instanceof Error?I.message:"Failed to load coverage data")}finally{Ae(!1)}}async function Ki(I){Ye(!0),Be(null);try{const he=await Kx(e,{urls:I}),{succeeded:xt,failed:Kt,total:ln}=he.summary;Ke({title:"Indexing requested",detail:Kt===0?`${xt} URL${xt!==1?"s":""} submitted for indexing.`:`${xt}/${ln} submitted successfully, ${Kt} failed.`,tone:Kt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(he){Be(he instanceof Error?he.message:"Failed to request indexing")}finally{Ye(!1)}}async function $a(){Ye(!0),Be(null);try{const I=await Kx(e,{urls:[],allUnindexed:!0}),{succeeded:he,failed:xt,total:Kt}=I.summary;Ke({title:"Indexing requested",detail:xt===0?`${he} unindexed URL${he!==1?"s":""} submitted for indexing.`:`${he}/${Kt} submitted successfully, ${xt} failed.`,tone:xt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(I){Be(I instanceof Error?I.message:"Failed to request indexing")}finally{Ye(!1)}}async function Cs(){if(Ve.trim()){Pt(!0),Be(null);try{await b2(e,"gsc",Ve.trim()),r(I=>I.map(he=>he.connectionType==="gsc"?{...he,sitemapUrl:Ve.trim()}:he)),Ke({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),at("")}catch(I){Be(I instanceof Error?I.message:"Failed to save sitemap URL")}finally{Pt(!1)}}}async function hs(){Be(null);try{const I=await ht.mutateAsync({projectName:e,projectLabel:e});de(I.sitemaps),r(he=>he.map(xt=>xt.connectionType==="gsc"?{...xt,sitemapUrl:I.primarySitemapUrl}:xt))}catch{}}async function Pa(){Ze(!0),Be(null);try{const I=await z2(e);de(I.sitemaps),I.sitemaps.length===0&&pn("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(I){Be(I instanceof Error?I.message:"Failed to list sitemaps")}finally{Ze(!1)}}async function Ys(){ee(!0),Be(null);try{const[I,he]=await Promise.all([Sp().catch(()=>null),nj(e).catch(()=>[])]);s(!!I?.google?.configured),r(he);const xt=he.find(Kt=>Kt.connectionType==="gsc");await Promise.all([ce(xt),kn(),Ma(),jl()])}finally{ee(!1)}}w.useEffect(()=>{Ys()},[e]);async function xd(){if(!t){Be("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}Ee(!0),Be(null),pn(null);try{const{authUrl:I}=await g2(e,"gsc");if(!I.startsWith("https://accounts.google.com/")){Be("Unexpected OAuth redirect URL. Please try again.");return}const he=window.open(I,"_blank","width=600,height=700");if(!he){window.location.assign(I);return}pn("Finish the Google consent flow in the popup, then close it to refresh this project.");const xt=window.setInterval(()=>{he.closed&&(window.clearInterval(xt),pn(null),Ys())},1e3)}catch(I){Be(I instanceof Error?I.message:"Failed to start OAuth flow")}finally{Ee(!1)}}async function wl(){Be(null),pn(null);try{await y2(e,"gsc"),r(I=>I.filter(he=>he.connectionType!=="gsc")),u([]),C("")}catch(I){Be(I instanceof Error?I.message:"Failed to disconnect")}}async function Jr(){if(S){me(!0),Be(null);try{await x2(e,"gsc",S),r(I=>I.map(he=>he.connectionType==="gsc"?{...he,propertyId:S}:he)),Ke({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(I){Be(I instanceof Error?I.message:"Failed to save GSC property")}finally{me(!1)}}}async function Gi(){Be(null),pn(null);try{await ts.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:O||void 0}})}catch{}}async function Nl(){if(k.trim()){le(!0),Be(null),pn(null);try{const I=await j2(e,k.trim());N(I),R(""),await Ma()}catch(I){Be(I instanceof Error?I.message:"Failed to inspect URL")}finally{le(!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:nt&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:V,onClick:()=>{kn()},children:V?"Refreshing…":"Refresh data"})})]}),Nt&&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:[Nt,o.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>Be(null),children:"×"})]}),Da&&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:[Da,o.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>pn(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(lt,{tone:nt?"positive":t?"caution":"negative",children:nt?"Connected":t?"Ready to connect":"App credentials missing"})]}),nt?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:nt.domain}),o.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:wl,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:nt.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:nt.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:ls(nt.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(oe,{type:"button",variant:"outline",size:"sm",disabled:ue,onClick:xd,children:ue?"Opening…":"Connect Google Search Console"}):o.jsx(oe,{type:"button",variant:"outline",size:"sm",asChild:!0,children:o.jsx(St,{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."})]})]})]}),nt&&!nt.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(oe,{type:"button",size:"sm",disabled:ht.isPending||!nt.propertyId,onClick:hs,children:ht.isPending?"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:Ve,onChange:I=>at(I.target.value),onKeyDown:I=>I.key==="Enter"&&void Cs()}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:Vt||!Ve.trim(),onClick:Cs,children:Vt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(nt||Yr)&&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:[J&&J.notIndexed.length>0&&o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:Me,onClick:()=>{$a()},children:Me?"Requesting…":`Request indexing (${J.notIndexed.length})`}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:ye,onClick:()=>{jl()},children:ye?"Loading…":"Refresh coverage"})]})]}),J&&J.summary.total>0?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const I=J.summary.indexed+J.summary.notIndexed,he=I>0?J.summary.indexed/I:0,xt=I>0?J.summary.notIndexed/I:0,Kt=54,ln=2*Math.PI*Kt,Ua=ln*(1-he),ms=ln*xt,cn=ln*he;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:Kt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),o.jsx("circle",{cx:"64",cy:"64",r:Kt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:ln,strokeDashoffset:Ua,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),J.summary.notIndexed>0&&o.jsx("circle",{cx:"64",cy:"64",r:Kt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${ms} ${ln-ms}`,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:[(he*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:J.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:J.summary.notIndexed.toLocaleString()}),o.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(J.reasonGroups??[]).length>0&&o.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(J.reasonGroups??[]).length," ",(J.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),J.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:J.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(I=>{const he=I==="indexed"?J.indexed.length:I==="notIndexed"?J.notIndexed.length:J.deindexed.length,xt=I==="indexed"?"Indexed":I==="notIndexed"?"Not Indexed":"Deindexed";return o.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${_t===I?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{re(I),Qe(null)},children:[xt," (",he,")"]},I)})}),o.jsxs("div",{className:"mt-3 overflow-x-auto",children:[_t==="indexed"&&J.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:J.indexed.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.crawlTime?I.crawlTime.split("T")[0]:"—"}),o.jsx("td",{className:"text-zinc-400",children:I.isMobileFriendly===!0?"Yes":I.isMobileFriendly===!1?"No":"—"})]},I.id))})]}),_t==="notIndexed"&&!Qt&&(J.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:(J.reasonGroups??[]).map(I=>o.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Qe(I.reason),children:[o.jsx("td",{className:"text-zinc-200",children:I.reason}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.count})]},I.reason))})]}),_t==="notIndexed"&&!Qt&&(J.reasonGroups??[]).length===0&&J.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:J.notIndexed.map(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"})]},I.id))})]}),_t==="notIndexed"&&Qt&&(()=>{const I=(J.reasonGroups??[]).find(he=>he.reason===Qt);return I?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:()=>Qe(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:I.reason}),o.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[I.count," affected page",I.count!==1?"s":""]})]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:Me,onClick:()=>{Ki(I.urls.map(he=>he.url))},children:Me?"Requesting…":`Request indexing (${I.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:I.urls.map(he=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:he.url}),o.jsx("td",{className:"text-zinc-400",children:he.crawlTime?he.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:Me,onClick:()=>{Ki([he.url])},title:"Request indexing",children:"Index"})})]},he.id))})]})]}):null})(),_t==="deindexed"&&J.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:J.deindexed.map((I,he)=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.previousState}),o.jsx("td",{className:"text-zinc-400",children:I.currentState}),o.jsx("td",{className:"text-zinc-400",children:I.transitionDate.split("T")[0]})]},`${I.url}-${he}`))})]}),(_t==="indexed"&&J.indexed.length===0||_t==="notIndexed"&&!Qt&&J.notIndexed.length===0||_t==="deindexed"&&J.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:ye?"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(oe,{type:"button",variant:"outline",size:"sm",disabled:V,onClick:()=>{kn()},children:V?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const I=new Map;for(const $e of f){const Je=I.get($e.date);Je?(Je.clicks+=$e.clicks,Je.impressions+=$e.impressions):I.set($e.date,{clicks:$e.clicks,impressions:$e.impressions})}const he=[...I.entries()].sort(([$e],[Je])=>$e.localeCompare(Je));if(he.length===0)return null;const xt=Math.max(...he.map(([,$e])=>$e.impressions),1),Kt=he.reduce(($e,[,Je])=>$e+Je.clicks,0),ln=he.reduce(($e,[,Je])=>$e+Je.impressions,0),Ua=ln>0?(Kt/ln*100).toFixed(1):"0.0",ms=700,cn=220,st={top:12,bottom:36,left:48,right:12},sn=ms-st.left-st.right,zn=cn-st.top-st.bottom,ks=sn/he.length,Ia=Math.max(Math.min(ks*.35,24),4),Cl=Math.max(Ia*.15,1),kl=$e=>{if($e<=0)return 1;const Je=Math.pow(10,Math.floor(Math.log10($e))),it=$e/Je,ns=it<=1.5?1.5:it<=3?3:it<=5?5:10;return Math.ceil(ns*Je)},ps=4,Js=Math.ceil(kl(xt)/ps)*ps,Xs=Array.from({length:ps+1},($e,Je)=>Js/ps*Je),Ws=$e=>$e>=1e3?`${($e/1e3).toFixed($e>=1e4?0:1)}k`:String($e);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:Kt.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:ln.toLocaleString()})]})]}),o.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",o.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Ua,"%"]})]})]}),o.jsx("div",{className:"relative w-full",style:{aspectRatio:`${ms} / ${cn}`},children:o.jsxs("svg",{viewBox:`0 0 ${ms} ${cn}`,className:"h-full w-full",children:[Xs.map(($e,Je)=>{const it=st.top+zn-$e/Js*zn;return o.jsxs("g",{children:[o.jsx("line",{x1:st.left,y1:it,x2:ms-st.right,y2:it,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),o.jsx("text",{x:st.left-6,y:it+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Ws($e)})]},`t-${Je}`)}),he.map(([$e,Je],it)=>{const ns=st.left+ks*it+ks/2,Fi=Je.impressions/Js*zn,gs=Je.clicks/Js*zn;return o.jsxs("g",{children:[o.jsx("title",{children:`${$e}
|
|
234
|
-
Clicks: ${Je.clicks}
|
|
235
|
-
Impressions: ${Je.impressions}
|
|
236
|
-
CTR: ${Je.impressions>0?(Je.clicks/Je.impressions*100).toFixed(1):0}%`}),o.jsx("rect",{x:ns-Ia-Cl/2,y:st.top+zn-Fi,width:Ia,height:Math.max(Fi,1),rx:2,fill:"#3b82f6",opacity:.85}),o.jsx("rect",{x:ns+Cl/2,y:st.top+zn-gs,width:Ia,height:Math.max(gs,1),rx:2,fill:"#10b981",opacity:.85})]},$e)}),(()=>{const $e=Math.min(he.length,7);return Array.from({length:$e},(Je,it)=>{const ns=he.length===1?0:Math.round(it/($e-1)*(he.length-1)),Fi=st.left+ks*ns+ks/2;return o.jsx("text",{x:Fi,y:cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:he[ns][0].slice(5)},`xl-${ns}`)})})()]})})]})})(),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:E.startDate,onChange:I=>L(he=>({...he,startDate:I.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:E.endDate,onChange:I=>L(he=>({...he,endDate:I.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:E.query,onChange:I=>L(he=>({...he,query:I.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:E.page,onChange:I=>L(he=>({...he,page:I.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:E.limit,onChange:I=>L(he=>({...he,limit:I.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((I,he)=>o.jsxs("tr",{children:[o.jsx("td",{className:"text-zinc-400",children:I.date}),o.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:I.query}),o.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:I.page}),o.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:I.clicks.toLocaleString()}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.impressions.toLocaleString()}),o.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(I.ctr)?I.ctr*100:0).toFixed(1),"%"]}),o.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.position.toFixed(1)})]},`${I.date}:${I.query}:${I.page}:${he}`))})]})}):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:I=>R(I.target.value),onKeyDown:I=>I.key==="Enter"&&void Nl()}),o.jsx(oe,{type:"button",size:"sm",disabled:se||!nt?.propertyId||!k.trim(),onClick:Nl,children:se?"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:Wx(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:ls(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(oe,{type:"button",variant:"outline",size:"sm",disabled:T,onClick:()=>{Ma()},children:T?"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:U,onChange:I=>X(I.target.value)}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:T,onClick:()=>{Ma()},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(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-300",children:I.indexingState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:Wx(I.isMobileFriendly)}),o.jsx("td",{className:"text-zinc-400",children:ls(I.inspectedAt)})]},I.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(I=>o.jsxs("tr",{children:[o.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),o.jsx("td",{className:"text-zinc-400",children:I.previousState??"Unknown"}),o.jsx("td",{className:"text-zinc-300",children:I.currentState??"Unknown"}),o.jsx("td",{className:"text-zinc-400",children:ls(I.transitionDate)})]},`${I.url}:${I.transitionDate}`))})]})}):o.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),nt&&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:()=>nn(I=>!I),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 ${Dn?"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"})]})}),Dn&&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:we||c.length===0,onChange:I=>C(I.target.value),children:c.length===0?o.jsx("option",{value:"",children:we?"Loading properties…":"No properties available"}):c.map(I=>o.jsxs("option",{value:I.siteUrl,children:[I.siteUrl," · ",I.permissionLevel]},I.siteUrl))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:we,onClick:()=>{ce(nt)},children:we?"Refreshing…":"Refresh properties"}),o.jsx(oe,{type:"button",size:"sm",disabled:!S||ae,onClick:Jr,children:ae?"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:A,onChange:I=>z(I.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:O,onChange:I=>$(I.target.checked)}),"Replace existing imported rows for the requested range"]})]}),o.jsx(oe,{type:"button",size:"sm",disabled:ts.isPending||!nt.propertyId,onClick:Gi,children:ts.isPending?"Queueing…":"Queue sync"}),!nt.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:[nt.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:nt.sitemapUrl})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:ge||!nt.propertyId,onClick:()=>{Pa()},children:ge?"Loading…":"Browse sitemaps from GSC"}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:ht.isPending||!nt.propertyId,onClick:hs,children:ht.isPending?"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."}),et&&et.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 (",et.length,")"]}),et.map(I=>{const he=I.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:I.path}),I.lastSubmitted&&o.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",I.lastSubmitted.split("T")[0]]})]}),o.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[he&&o.jsxs("div",{className:"text-right",children:[o.jsxs("p",{className:"text-zinc-300",children:[he.indexed," / ",he.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:()=>at(I.path),children:"Use"})]})]},I.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:nt.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ve,onChange:I=>at(I.target.value),onKeyDown:I=>I.key==="Enter"&&Ve.trim()&&void Cs()}),o.jsx(oe,{type:"button",size:"sm",disabled:Vt||!Ve.trim(),onClick:Cs,children:Vt?"Saving…":nt.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(oe,{type:"button",size:"sm",variant:"outline",disabled:gn.isPending||!nt.propertyId,onClick:async()=>{const he=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||nt.sitemapUrl||void 0;Be(null),pn(null);try{await gn.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:he}})}catch{}},children:gn.isPending?"Queueing…":"Inspect sitemap"})]}),!nt.propertyId&&o.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function j$({project:e,onUpdateProject:t,onRefresh:s}){const[a,r]=w.useState(!1),[c,u]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(e.displayName),[y,x]=w.useState(e.canonicalDomain),[b,N]=w.useState(e.country),[S,C]=w.useState(e.language),[k,R]=w.useState(e.ownedDomains??[]),[A,z]=w.useState(""),[O,$]=w.useState(null),[E,L]=w.useState(!1),[U,X]=w.useState(!1),[Q,ee]=w.useState(""),[ue,Ee]=w.useState(""),[we,K]=w.useState(""),[ae,me]=w.useState(""),[V,H]=w.useState("");w.useEffect(()=>{a||(v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),R(e.ownedDomains??[]))},[e,a]);function T(){r(!1),m(null),v(e.displayName),x(e.canonicalDomain),N(e.country),C(e.language),R(e.ownedDomains??[]),z("")}function B(){const de=A.trim();de&&(k.includes(de)||R([...k,de]),z(""))}function se(de){R(k.filter(Ve=>Ve!==de))}async function le(){if(!(!p.trim()||!y.trim()||!b.trim()||!S.trim())){u(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:b.trim(),language:S.trim()}),r(!1),Ke({title:"Project settings saved",detail:`${p.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(de){m(de instanceof Error?de.message:"Failed to save")}finally{u(!1)}}}async function J(){const de=Q.trim(),Ve=ue.trim(),at=we.trim(),Vt=ae.trim();if(!(!de||!Ve||!at||!Vt)){L(!0),$(null);try{const Pt={label:de,city:Ve,region:at,country:Vt};V.trim()&&(Pt.timezone=V.trim()),await J_(e.name,Pt),s(),ee(""),Ee(""),K(""),me(""),H(""),X(!1),Ke({title:"Location added",detail:`${de} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${de}`,dedupeMode:"drop"})}catch(Pt){$(Pt instanceof Error?Pt.message:"Failed to add location")}finally{L(!1)}}}async function fe(de){L(!0),$(null);try{await X_(e.name,de),s(),Ke({title:"Location removed",detail:`${de} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${de}`,dedupeMode:"drop"})}catch(Ve){$(Ve instanceof Error?Ve.message:"Failed to remove location")}finally{L(!1)}}async function ye(de){L(!0),$(null);try{await W_(e.name,de),s(),Ke({title:"Default location updated",detail:`${de} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Ve){$(Ve instanceof Error?Ve.message:"Failed to set default location")}finally{L(!1)}}const Ae=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",et=Q.trim()&&ue.trim()&&we.trim()&&ae.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(oe,{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:de=>v(de.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:de=>x(de.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:de=>N(de.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:de=>C(de.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(de=>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:[de,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>se(de),"aria-label":`Remove ${de}`,children:"×"})]},de))}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("input",{className:`${ge} flex-1`,type:"text",placeholder:"docs.example.com",value:A,onChange:de=>z(de.target.value),onKeyDown:de=>de.key==="Enter"&&(de.preventDefault(),B())}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:!A.trim(),onClick:B,children:"Add"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[o.jsx(oe,{type:"button",disabled:c||!Ae||!p.trim()||!y.trim(),onClick:le,children:c?"Saving...":"Save changes"}),o.jsx(oe,{type:"button",variant:"outline",disabled:c,onClick:T,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(de=>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:de},de))}):o.jsx("span",{className:"text-zinc-500",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",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:[O&&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:[O,o.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>$(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(de=>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 ${de.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:[de.label,de.label===e.defaultLocation?" ★":""]})}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.city}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.region}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:de.country}),o.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:de.timezone??"—"}),o.jsx("td",{className:"py-1.5",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[de.label!==e.defaultLocation&&o.jsx("button",{type:"button",disabled:E,onClick:()=>ye(de.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${de.label} as default location`,children:"Set default"}),o.jsx("button",{type:"button",disabled:E,onClick:()=>fe(de.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${de.label}`,children:"Remove"})]})})]},de.label))})]}):o.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),U?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:de=>ee(de.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:ue,onChange:de=>Ee(de.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:we,onChange:de=>K(de.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:ae,onChange:de=>me(de.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:V,onChange:de=>H(de.target.value),placeholder:"America/New_York"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[o.jsx(oe,{type:"button",size:"sm",disabled:E||!et,onClick:J,children:E?"Adding...":"Add location"}),o.jsx(oe,{type:"button",size:"sm",variant:"outline",disabled:E,onClick:()=>{X(!1),$(null)},children:"Cancel"})]})]}):o.jsx(oe,{type:"button",size:"sm",variant:"outline",onClick:()=>X(!0),children:"+ Add location"})]})]})]})})})]})}const w$=[{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"}],dS=["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 N$({projectName:e}){const[t,s]=w.useState("loading"),[a,r]=w.useState(!1),[c,u]=w.useState("daily"),[f,m]=w.useState(6),[p,v]=w.useState(""),[y,x]=w.useState("UTC"),[b,N]=w.useState(!1),[S,C]=w.useState(""),[k,R]=w.useState(!1),[A,z]=w.useState(!1),[O,$]=w.useState(null);w.useEffect(()=>{o2(e).then(s).catch(()=>s(null))},[e]);const E=()=>{if(t&&t!=="loading"){const Q=TE(t.preset??null,t.cronExpr);u(Q.freq),m(Q.hour),v(Q.customCron);const ee=dS.includes(t.timezone);x(ee?t.timezone:"Other"),N(!ee),C(ee?"":t.timezone)}else u("daily"),m(6),v(""),x("UTC"),N(!1),C("");$(null),r(!0)},L=async()=>{R(!0),$(null);try{const ee={timezone:b?S.trim()||"UTC":y};c==="custom"?ee.cron=p.trim():ee.preset=RE(c,f);const ue=await qx(e,ee);s(ue),r(!1),Ke({title:"Schedule saved",detail:Gh(ue.preset??null,ue.cronExpr,ue.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(Q){$(Q instanceof Error?Q.message:"Failed to save schedule")}finally{R(!1)}},U=async()=>{if(!(!t||t==="loading")){R(!0),$(null);try{const Q={timezone:t.timezone,enabled:!t.enabled};t.preset?Q.preset=t.preset:Q.cron=t.cronExpr;const ee=await qx(e,Q);s(ee),Ke({title:ee.enabled?"Schedule resumed":"Schedule paused",detail:Gh(ee.preset??null,ee.cronExpr,ee.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(Q){$(Q instanceof Error?Q.message:"Failed to update schedule")}finally{R(!1)}}},X=async()=>{z(!0),$(null);try{await l2(e),s(null),r(!1),Ke({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(Q){$(Q instanceof Error?Q.message:"Failed to remove schedule")}finally{z(!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(oe,{type:"button",variant:"outline",size:"sm",onClick:E,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:Gh(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(lt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:U,children:t.enabled?"Pause":"Resume"}),o.jsx(oe,{type:"button",variant:"ghost",size:"sm",disabled:A,onClick:X,children:A?"Removing...":"Remove"})]})]}),O&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:O})]}),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=>u(Q.target.value),children:w$.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,ee)=>o.jsx("option",{value:ee,children:Rm(ee)},ee))})]})]}),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"?(N(!0),x("Other")):(N(!1),x(Q.target.value))},children:[dS.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)})]}),O&&o.jsx("p",{className:"text-rose-400 text-sm",children:O}),o.jsxs("div",{className:"flex gap-2 justify-end",children:[o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),$(null)},children:"Cancel"}),o.jsx(oe,{type:"button",size:"sm",disabled:k||c==="custom"&&!p.trim(),onClick:L,children:k?"Saving...":"Save schedule"})]})]})]})}const C$=[{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 k$({projectName:e}){const[t,s]=w.useState("loading"),[a,r]=w.useState(!1),[c,u]=w.useState(""),[f,m]=w.useState(["citation.lost","citation.gained"]),[p,v]=w.useState(!1),[y,x]=w.useState(null),[b,N]=w.useState({});w.useEffect(()=>{c2(e).then(s).catch(()=>s([]))},[e]);const S=A=>{m(z=>z.includes(A)?z.filter(O=>O!==A):[...z,A])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),x(null);try{const A=await u2(e,{channel:"webhook",url:c.trim(),events:f});s(z=>z==="loading"?[A]:[...z,A]),u(""),m(["citation.lost","citation.gained"]),r(!1),Ke({title:"Webhook added",detail:`Notifications will be sent to ${A.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(A){x(A instanceof Error?A.message:"Failed to add webhook")}finally{v(!1)}}},k=async A=>{try{await d2(e,A),s(z=>z==="loading"?z:z.filter(O=>O.id!==A)),Ke({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${A}`,dedupeMode:"drop"})}catch(z){x(z instanceof Error?z.message:"Failed to remove webhook")}},R=async A=>{N(z=>({...z,[A]:{state:"testing"}}));try{const z=await f2(e,A);N(O=>({...O,[A]:{state:z.ok?"ok":"fail",status:z.status}})),z.ok&&Ke({title:"Test notification sent",detail:`Webhook returned status ${z.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${A}`,dedupeMode:"replace"})}catch{N(z=>({...z,[A]:{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(oe,{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:A=>u(A.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:C$.map(A=>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(A.value),onChange:()=>S(A.value)}),o.jsx("span",{className:"text-sm text-zinc-300",children:A.label})]},A.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(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>{r(!1),x(null)},children:"Cancel"}),o.jsx(oe,{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:"Endpoint"}),o.jsx("th",{children:"Events"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:t.map(A=>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",title:A.urlHost,children:A.urlDisplay??A.url})}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:A.events.map(z=>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:z.replace("."," ")},z))})}),o.jsx("td",{children:o.jsx(lt,{tone:A.enabled?"positive":"neutral",children:A.enabled?"Active":"Paused"})}),o.jsx("td",{children:o.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[b[A.id]&&(()=>{const z=b[A.id],O=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return o.jsx(lt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:O})})(),o.jsx(oe,{variant:"ghost",size:"sm",type:"button",disabled:b[A.id]?.state==="testing",onClick:()=>R(A.id),children:"Test"}),o.jsx(oe,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(A.id),children:"Remove"})]})})]},A.id))})]}),y&&o.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function fS({eyebrow:e,title:t,status:s,tone:a,targetLabel:r,targetValue:c,coverageValue:u,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(lt,{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:u})]})]}),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 ${ls(m)}`:"No recent sync yet"})]})]})}function ru({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 z$({projectName:e}){const[t,s]=w.useState(null),[a,r]=w.useState([]),[c,u]=w.useState(null),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,x]=w.useState(null),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,R]=w.useState(""),[A,z]=w.useState(!0),[O,$]=w.useState(!1),[E,L]=w.useState(null),[U,X]=w.useState("coverage");w.useEffect(()=>{Q()},[e]);async function Q(){z(!0),L(null);try{const V=await ij(e);if(s(V),V.connected){const[H,T,B]=await Promise.all([wp(e).catch(()=>null),aj(e).catch(()=>[]),L2(e).catch(()=>[])]);H&&u(H),m(T),v(B)}}catch(V){L(V instanceof Error?V.message:"Failed to load Bing data")}finally{z(!1)}}async function ee(){if(S.trim()){L(null);try{const V=await A2(e,S.trim());C(""),V.availableSites.length>0&&r(V.availableSites),await Q()}catch(V){L(V instanceof Error?V.message:"Failed to connect")}}}async function ue(){try{await R2(e),s(null),r([]),u(null),m([]),v([]),x(null),R(""),L(null)}catch(V){L(V instanceof Error?V.message:"Failed to disconnect")}}async function Ee(){if(k)try{await O2(e,k),await Q()}catch(V){L(V instanceof Error?V.message:"Failed to set site")}}async function we(){if(b.trim())try{const V=await rj(e,b.trim());x(V),m(H=>[V,...H])}catch(V){L(V instanceof Error?V.message:"Inspection failed")}}async function K(V){$(!0),L(null);try{const H=await Gx(e,{urls:[V]}),{succeeded:T,failed:B,total:se}=H.summary;Ke({title:"Bing submission requested",detail:B===0?`${T} URL submitted to Bing.`:`${T}/${se} submitted successfully, ${B} failed.`,tone:B===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${V}`,dedupeMode:"replace"})}catch(H){const T=H instanceof Error?H.message:"Submission failed";L(T),Ke({title:"Bing submission failed",detail:T,tone:"negative",dedupeKey:`bing:indexing:${e}:${V}`,dedupeMode:"replace"})}finally{$(!1)}}async function ae(){$(!0),L(null),Ke({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const V=await Gx(e,{allUnindexed:!0}),{succeeded:H,failed:T,total:B}=V.summary;Ke({title:"Bing submissions requested",detail:T===0?`${H}/${B} URL${B!==1?"s":""} submitted to Bing.`:`${H}/${B} submitted successfully, ${T} failed.`,tone:T===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(V){const H=V instanceof Error?V.message:"Batch submission failed";L(H),Ke({title:"Bing submissions failed",detail:H,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{$(!1)}}if(A)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(lt,{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:V=>C(V.target.value),onKeyDown:V=>V.key==="Enter"&&ee()}),o.jsx(oe,{size:"sm",disabled:!S.trim(),onClick:ee,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"})]})]}),E&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:E})]});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(lt,{tone:"positive",children:"Connected"}),o.jsx(oe,{size:"sm",variant:"ghost",onClick:ue,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?ls(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:V=>R(V.target.value),children:[o.jsx("option",{value:"",children:"Select a site..."}),a.map(V=>o.jsxs("option",{value:V.url,children:[V.url,V.verified?" (verified)":""]},V.url))]}),o.jsx(oe,{size:"sm",disabled:!k,onClick:Ee,children:"Set Site"})]}):o.jsx("div",{className:"mt-3",children:o.jsx(oe,{size:"sm",onClick:async()=>{const V=await T2(e);r(V.sites)},children:"Load Sites"})})]})]}),E&&o.jsx("p",{className:"mt-3 text-xs text-rose-400",children:E})]});const me=[{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(lt,{tone:"positive",children:"Connected"}),o.jsx(oe,{size:"sm",variant:"ghost",onClick:ue,children:"Disconnect"})]})]}),E&&o.jsx("p",{className:"mb-3 text-xs text-rose-400",children:E}),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?ls(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 ${ls(c.lastInspectedAt)}`:"No inspection history yet"})]}),o.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:me.map(V=>o.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===V.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>X(V.key),children:V.label},V.key))}),U==="coverage"&&c&&o.jsxs("div",{className:"mt-4 space-y-4",children:[o.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[o.jsx(ru,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),o.jsx(ru,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),o.jsx(ru,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),o.jsx(ru,{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.jsx(oe,{size:"sm",variant:"ghost",disabled:O,onClick:ae,children:O?"Submitting…":"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(V=>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:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.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",disabled:O,onClick:()=>K(V.url),children:"Submit"})})]},V.id))})]})})]}),(c.unknown??[]).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:["Unknown — not yet confirmed (",(c.unknown??[]).length,")"]}),o.jsx(oe,{size:"sm",variant:"ghost",disabled:O,onClick:ae,children:O?"Submitting…":"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-32",children:"Last Crawled"}),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.unknown??[]).map(V=>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:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.lastCrawledDate?ls(V.lastCrawledDate):"—"}),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",disabled:O,onClick:()=>K(V.url),children:"Submit"})})]},V.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(V=>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:V.url}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.lastCrawledDate?ls(V.lastCrawledDate):"—"})]},V.id))})]})})]})]}),U==="coverage"&&!c&&o.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="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:V=>N(V.target.value),onKeyDown:V=>V.key==="Enter"&&we()}),o.jsx(oe,{size:"sm",disabled:!b.trim(),onClick:we,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(V=>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:V.url}),o.jsx("td",{className:"py-1.5 px-3",children:o.jsx(lt,{tone:V.inIndex?"positive":"negative",children:V.inIndex?"Yes":"No"})}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:V.httpCode??"—"}),o.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:ls(V.inspectedAt)})]},V.id))})]})})]}),U==="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((V,H)=>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:V.query}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:V.clicks}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:V.impressions}),o.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(V.ctr)?V.ctr*100:0).toFixed(1),"%"]}),o.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:V.averagePosition.toFixed(1)})]},H))})]})})})]})]})}function _$({projectName:e}){const[t,s]=w.useState("google"),[a,r]=w.useState(!0),[c,u]=w.useState("idle"),[f,m]=w.useState(null),p=w.useRef(null),[v,y]=w.useState(!1),[x,b]=w.useState(null),[N,S]=w.useState(null),[C,k]=w.useState(!1),[R,A]=w.useState(null),[z,O]=w.useState(null);async function $(V=!1){V||r(!0),m(null);try{const[H,T,B]=await Promise.all([Sp().catch(()=>null),nj(e).catch(()=>[]),ij(e).catch(()=>null)]),se=T.find(fe=>fe.connectionType==="gsc")??null;y(!!H?.google?.configured),k(!!H?.bing?.configured),b(se),A(B);const[le,J]=await Promise.all([se?jp(e).catch(()=>null):Promise.resolve(null),B?.connected?wp(e).catch(()=>null):Promise.resolve(null)]);S(le),O(J)}catch(H){m(H instanceof Error?H.message:"Failed to load search console overview")}finally{r(!1)}}async function E(){if(c!=="idle")return;p.current?.abort();const V=new AbortController;p.current=V;const H=V.signal;u("syncing"),m(null);const T=[];try{async function B(){if(!x)return;const fe=await sj(e);if(!fe?.id)return;const ye=2e3,ge=Date.now()+12e4;for(;Date.now()<ge;){if(H.aborted||(await new Promise(et=>setTimeout(et,ye)),H.aborted))return;const Ze=await Pr(fe.id).catch(()=>null);if(!Ze)break;if(["completed","failed","cancelled"].includes(Ze.status)){Ze.status!=="completed"&&T.push(`Google sync ${Ze.status}`);break}}}const se=10;async function le(){if(!R?.connected)return;const fe=await aj(e).catch(()=>[]),ye=[...new Set(fe.map(Ae=>Ae.url))];if(ye.length!==0)for(let Ae=0;Ae<ye.length;Ae+=se){if(H.aborted)return;const ge=ye.slice(Ae,Ae+se),et=(await Promise.allSettled(ge.map(de=>rj(e,de)))).filter(de=>de.status==="rejected").length;et>0&&T.push(`${et} Bing inspection(s) failed`)}}const J=await Promise.allSettled([B(),le()]);for(const fe of J)fe.status==="rejected"&&T.push(fe.reason instanceof Error?fe.reason.message:"Sync failed");if(H.aborted)return;u("reloading"),await $(!0),T.length>0&&m(`Partial refresh: ${T.join("; ")}`)}catch(B){H.aborted||m(B instanceof Error?B.message:"Refresh failed")}finally{H.aborted||u("idle")}}w.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const L=x?"positive":v?"caution":"negative",U=x?"Connected":v?"Ready to connect":"Needs setup",X=N?`${N.summary.percentage}% indexed`:x?"Awaiting coverage":"No coverage data",Q=N?`${N.summary.notIndexed} not indexed${N.summary.deindexed>0?` · ${N.summary.deindexed} deindexed`:""}`:x?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",ee=N?.lastInspectedAt??x?.updatedAt??null,ue=R?.connected?"positive":C?"caution":"negative",Ee=R?.connected?"Connected":C?"Ready to connect":"Needs setup",we=z?`${z.summary.percentage}% indexed`:R?.connected?"Awaiting coverage":"No coverage data",K=z?z.summary.notIndexed+(z.summary.unknown??0):0,ae=z?`${K} not in index`:R?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",me=z?.lastInspectedAt??R?.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(oe,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{E()},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(fS,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":U,tone:a?"neutral":L,targetLabel:"Selected property",targetValue:x?.propertyId??"No property selected",coverageValue:a?"Loading…":X,note:a?"Loading overview…":Q,updatedAt:ee,active:t==="google",onClick:()=>s("google")}),o.jsx(fS,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":Ee,tone:a?"neutral":ue,targetLabel:"Selected site",targetValue:R?.siteUrl??"No site selected",coverageValue:a?"Loading…":we,note:a?"Loading overview…":ae,updatedAt:me,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(([V,H])=>o.jsx("button",{type:"button",role:"tab","aria-selected":t===V,className:`project-subnav-link ${t===V?"project-subnav-link-active":""}`,onClick:()=>s(V),children:H},V))}),t==="google"&&o.jsx(S$,{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(z$,{projectName:e})]})]})}function E$({insights:e}){const{openEvidence:t}=Gr(),[s,a]=w.useState(null);return o.jsx("div",{className:"insight-list",children:e.map(r=>{const c=s===r.id,u=r.affectedPhrases.length>0;return o.jsxs("div",{children:[o.jsxs("div",{className:`insight-row insight-row-${r.tone} ${u?"cursor-pointer":""}`,onClick:u?()=>a(c?null:r.id):void 0,children:[o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u&&o.jsx(Fu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),o.jsx(lt,{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})]}),u&&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(Bm,{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(al,{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 vd({tab:e}){const{projectId:t}=Hu({from:"/projects/$projectId"}),s=Ii(),{dashboard:a,isLoading:r,refetch:c}=Oa();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(re=>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"})]},re))}),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(re=>o.jsx("div",{className:"skeleton-text-sm w-full"},re))})]})]});const u=GM(a,t),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,x]=w.useState(!1),[b,N]=w.useState(""),[S,C]=w.useState(!1),[k,R]=w.useState(!1),[A,z]=w.useState(""),[O,$]=w.useState(!1),[E,L]=w.useState(!1),[U,X]=w.useState(""),[Q,ee]=w.useState(!1),[ue,Ee]=w.useState(void 0),[we,K]=w.useState(!1),[ae,me]=w.useState(null),[V,H]=w.useState(!1),T=u?.visibilityEvidence??[],B=u?.project.name??"",se=u?.project.displayName||u?.project.name||B,le=HN(),J=w.useMemo(()=>new Set(T.map(re=>re.location??"")),[T]),fe=J.has(""),ye=w.useMemo(()=>[...J].filter(Boolean),[J]);w.useEffect(()=>{if(ue===void 0||ue===""||!B){me(null),H(!1);return}H(!0),ej(B,ue).then(re=>{me(re),H(!1)}).catch(()=>{me(null),H(!1)})},[ue,B]);const Ae=w.useMemo(()=>{if(!ae)return null;const re=new Map;for(const Ge of ae){for(const[gt,Qt]of Object.entries(Ge.providerRuns??{}))re.set(`${Ge.keyword}::${gt}`,Qt.map(Qe=>({runId:Qe.runId,citationState:Qe.citationState,createdAt:Qe.createdAt})));(!Ge.providerRuns||Object.keys(Ge.providerRuns).length===0)&&re.set(`${Ge.keyword}::`,Ge.runs.map(gt=>({runId:gt.runId,citationState:gt.citationState,createdAt:gt.createdAt})))}return re},[ae]),ge=w.useMemo(()=>{const re=ue!==void 0?T.filter(Ge=>ue===""?!Ge.location:Ge.location===ue):T;return Ae?re.map(Ge=>{const gt=Ae.get(`${Ge.keyword}::${Ge.provider}`)??Ae.get(`${Ge.keyword}::`);return gt?{...Ge,runHistory:gt}:Ge}):re},[T,ue,Ae]);if(!u)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(oe,{asChild:!0,children:o.jsx(St,{to:"/",children:"Return to overview"})})]})});async function Ze(){try{await le.mutateAsync({projectName:B,projectLabel:se,sourceAction:"project-run"}),c()}catch{}}async function et(){v(!0);try{await e2(B),Ke({title:"Project deleted",detail:`${se} was removed.`,tone:"positive",dedupeKey:`project:delete:${B}`,dedupeMode:"drop"}),s({to:"/"}),c()}catch(re){console.error("Failed to delete project:",re)}finally{v(!1)}}async function de(){const re=await t2(B),Ge=typeof re=="string"?re:JSON.stringify(re,null,2),gt=new Blob([Ge],{type:"text/yaml"}),Qt=URL.createObjectURL(gt),Qe=document.createElement("a");Qe.href=Qt,Qe.download=`${B}.yaml`,Qe.click()}async function Ve(){const re=b.split(`
|
|
237
|
-
`).map(Ge=>Ge.trim()).filter(Boolean);if(re.length!==0){C(!0);try{await V_(B,re),c(),N(""),x(!1)}finally{C(!1)}}}async function at(){const re=A.trim();if(re){$(!0);try{const gt=(await WS(B)).map(Qe=>Qe.domain),Qt=[...new Set([...gt,re])];await tj(B,Qt),c(),z(""),R(!1)}finally{$(!1)}}}async function Vt(){const re=U.trim();if(re){ee(!0);try{const Ge=u?.project.ownedDomains??[];await Bx(B,[...Ge,re]),c(),X(""),L(!1)}finally{ee(!1)}}}async function Pt(re){ee(!0);try{const Ge=u?.project.ownedDomains??[];await Bx(B,Ge.filter(gt=>gt!==re)),c()}finally{ee(!1)}}async function Dn(re,Ge){await Q_(re,Ge),c()}const nn=re=>!Number.isNaN(Number.parseInt(re,10)),_t=[{key:"overview",label:"Overview",href:`/projects/${u.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${u.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${u.project.id}/traffic`},{key:"analytics",label:"Visibility",href:`/projects/${u.project.id}/analytics`}];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:u.project.displayName||u.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(oe,{type:"button",variant:"destructive",disabled:p,onClick:et,children:p?"Deleting...":"Yes, delete project"}),o.jsx(oe,{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:u.project.displayName||u.project.name}),o.jsxs("p",{className:"page-subtitle",children:[u.project.canonicalDomain,(u.project.ownedDomains??[]).length===0&&!E&&o.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>L(!0),children:"+ add domain"})," "," · ",u.contextLabel]}),o.jsxs("div",{className:"tag-row",children:[o.jsx("span",{className:"tag",children:u.project.country}),o.jsx("span",{className:"tag",children:u.project.language.toUpperCase()}),u.project.tags.map(re=>o.jsx("span",{className:"tag",children:re},re))]}),((u.project.ownedDomains??[]).length>0||E)&&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"}),(u.project.ownedDomains??[]).map(re=>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:[re,o.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:Q,onClick:()=>Pt(re),"aria-label":`Remove ${re}`,children:"×"})]},re)),E?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:U,onChange:re=>X(re.target.value),onKeyDown:re=>re.key==="Enter"&&Vt(),autoFocus:!0}),o.jsx(oe,{type:"button",size:"sm",disabled:!U.trim()||Q,onClick:Vt,children:Q?"...":"Add"}),o.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{L(!1),X("")},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:()=>L(!0),children:"+ domain"})]})]}),o.jsxs("div",{className:"page-header-right",children:[o.jsx("p",{className:"text-sm text-zinc-500",children:u.dateRangeLabel}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(oe,{type:"button",variant:"outline",size:"icon",onClick:de,"aria-label":"Export project as YAML",children:o.jsx(nE,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(oe,{type:"button",variant:"outline",size:"icon",onClick:()=>m(!0),"aria-label":"Delete project",children:o.jsx(jE,{className:"h-4 w-4 text-zinc-400"})}),o.jsx(oe,{type:"button",disabled:le.isPending,onClick:Ze,children:le.isPending?"Starting...":"Run now"})]})]})]}),o.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:_t.map(re=>o.jsx(St,{to:re.href,className:`project-subnav-link ${re.key===e?"project-subnav-link-active":""}`,"aria-current":re.key===e?"page":void 0,children:re.label},re.key))}),e==="overview"?o.jsxs(o.Fragment,{children:[o.jsxs("section",{className:"gauge-row",children:[o.jsx(BN,{value:u.visibilitySummary.value,label:u.visibilitySummary.label,delta:u.visibilitySummary.delta,tone:u.visibilitySummary.tone,description:u.visibilitySummary.description,tooltip:u.visibilitySummary.tooltip,isNumeric:nn(u.visibilitySummary.value),progress:u.visibilitySummary.progress}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",o.jsx(ws,{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:u.gapKeyPhrases.value}),o.jsxs("span",{className:"text-zinc-600",children:[" / ",u.keywordCounts.total]})]}),o.jsx("div",{className:"metric-card-bar",children:o.jsx("div",{className:`metric-card-bar-fill progress-fill-${u.gapKeyPhrases.tone}`,style:{width:u.gapKeyPhrases.progress!==void 0?`${u.gapKeyPhrases.progress*100}%`:"0%"}})}),o.jsx("p",{className:"metric-card-detail",children:u.gapKeyPhrases.delta}),o.jsx("p",{className:"metric-card-sub",children:u.gapKeyPhrases.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",o.jsx(ws,{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:u.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-${u.indexCoverage.tone}`,style:{width:`${Number.parseInt(u.indexCoverage.value,10)||0}%`}})}),o.jsx("p",{className:"metric-card-detail",children:u.indexCoverage.delta}),o.jsx("p",{className:"metric-card-sub",children:u.indexCoverage.description})]}),o.jsxs("div",{className:"metric-card",children:[o.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",o.jsx(ws,{text:"Keyword-level citation changes compared to the previous completed run."})]}),u.movementSummary.hasPreviousRun?o.jsxs("div",{className:"metric-card-movement",children:[o.jsxs("span",{className:u.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",u.movementSummary.gained," gained"]}),o.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),o.jsxs("span",{className:u.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",u.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:u.movementSummary.gained===0&&u.movementSummary.lost===0&&u.movementSummary.hasPreviousRun?"No changes since last run":u.movementSummary.gained>u.movementSummary.lost?"Visibility improving":u.movementSummary.lost>u.movementSummary.gained?"Visibility declining":""})]})]}),u.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(ws,{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:u.providerScores.map(re=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[o.jsx(al,{provider:re.provider}),re.model&&o.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:re.model})]})}),o.jsx("td",{children:o.jsxs("span",{className:`font-semibold ${re.score>=70?"text-emerald-400":re.score>=40?"text-amber-400":"text-rose-400"}`,children:[re.score,"%"]})}),o.jsxs("td",{className:"text-zinc-500",children:[re.cited," of ",re.total]})]},`${re.provider}::${re.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(E$,{insights:u.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(u.visibilityEvidence.map(re=>re.keyword)).size," key phrases tracked"]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>x(!y),children:y?"Cancel":"+ Add key phrases"})]})]}),y&&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:b,onChange:re=>N(re.target.value)}),o.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[o.jsxs("p",{className:"text-xs text-zinc-500",children:[b.split(`
|
|
238
|
-
`).filter(re=>re.trim()).length," key phrases"]}),o.jsx(oe,{type:"button",size:"sm",disabled:!b.trim()||S,onClick:Ve,children:S?"Adding...":"Add key phrases"})]})]}),u.project.locations&&u.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 ${ue===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":ue===void 0,onClick:()=>{Ee(void 0)},children:"All locations"}),u.project.locations.map(re=>J.has(re.label)&&o.jsx("button",{className:`filter-chip ${ue===re.label?"filter-chip-active":""}`,type:"button","aria-pressed":ue===re.label,onClick:()=>{Ee(re.label),K(!1)},children:re.label},re.label)),fe&&o.jsx("button",{className:`filter-chip ${ue===""?"filter-chip-active":""}`,type:"button","aria-pressed":ue==="",onClick:()=>{Ee(""),K(!1)},children:"No location"}),ye.length>1&&ue===void 0&&o.jsx("button",{className:`filter-chip filter-chip-compare ${we?"filter-chip-active":""}`,type:"button","aria-pressed":we,onClick:()=>K(re=>!re),title:"Side-by-side location comparison",children:"Compare"})]}),o.jsx(t$,{evidence:ge})]}),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:[u.competitors.length," tracked"]}),o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>R(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&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:A,onChange:re=>z(re.target.value),onKeyDown:re=>re.key==="Enter"&&at()}),o.jsx(oe,{type:"button",size:"sm",disabled:!A.trim()||O,onClick:at,children:O?"Adding...":"Add"})]}),o.jsx(n$,{competitors:u.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:u.recentRuns.map(re=>o.jsx(IN,{run:re},re.id))})]}),o.jsx(j$,{project:{...u.project,displayName:u.project.displayName??u.project.name,defaultLocation:u.project.defaultLocation??null},onUpdateProject:Dn,onRefresh:()=>{c()}}),o.jsx(N$,{projectName:u.project.name}),o.jsx(k$,{projectName:u.project.name})]}):e==="analytics"?o.jsx(a$,{projectName:u.project.name}):e==="traffic"?o.jsx(u$,{projectName:u.project.name}):o.jsx(_$,{projectName:u.project.name})]})}function A$(){const{dashboard:e,isLoading:t}=Oa(),s=y$();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(m=>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"})]},m))})]});const a=e.runs,[r,c]=w.useState("all"),u=r==="all"?a:a.filter(m=>m.status===r),f=async()=>{try{await s.mutateAsync(void 0)}catch{}};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(oe,{type:"button",variant:"outline",size:"sm",disabled:s.isPending,onClick:()=>{f()},children:s.isPending?"Queueing…":"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(m=>o.jsx("button",{className:`filter-chip ${r===m?"filter-chip-active":""}`,type:"button","aria-pressed":r===m,onClick:()=>c(m),children:m==="all"?"All runs":Vu(m)},m))}),o.jsx("div",{className:"run-list",children:u.length>0?u.map(m=>o.jsx(IN,{run:m},m.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 R$({providerName:e,keyUrl:t,modelHint:s,onSaved:a}){const r=e.toLowerCase()==="local",[c,u]=w.useState(""),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,x]=w.useState(""),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,R]=w.useState(!1),[A,z]=w.useState(null),[O,$]=w.useState(!1),E=r?f.trim().length>0:c.trim().length>0;async function L(){if(E){R(!0),z(null),$(!1);try{const X=we=>{const K=parseInt(we.trim(),10);return Number.isFinite(K)&&K>0?K:void 0},Q={},ee=X(y);ee!==void 0&&(Q.maxConcurrency=ee);const ue=X(b);ue!==void 0&&(Q.maxRequestsPerMinute=ue);const Ee=X(S);Ee!==void 0&&(Q.maxRequestsPerDay=Ee),await a2(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...p.trim()?{model:p.trim()}:{},...Object.keys(Q).length>0?{quota:Q}:{}}),u(""),m(""),v(""),x(""),N(""),C(""),$(!0),Ke({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),a()}catch(X){z(X instanceof Error?X.message:"Failed to update provider")}finally{R(!1)}}}const U=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:X=>m(X.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:X=>u(X.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:U,value:p,onChange:X=>v(X.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:X=>x(X.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:X=>N(X.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:X=>C(X.target.value)}),o.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),A&&o.jsx("p",{className:"text-xs text-rose-400",children:A}),O&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),o.jsx(oe,{type:"button",size:"sm",disabled:!E||k,onClick:L,children:k?"Saving...":"Save"})]})}function T$({onSaved:e}){const[t,s]=w.useState(""),[a,r]=w.useState(""),[c,u]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(!1),y=t.trim().length>0&&a.trim().length>0;async function x(){if(y){u(!0),m(null),v(!1);try{await r2({clientId:t.trim(),clientSecret:a.trim()}),s(""),r(""),v(!0),Ke({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(b){m(b instanceof Error?b.message:"Failed to update Google OAuth credentials")}finally{u(!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(oe,{type:"button",size:"sm",disabled:!y||c,onClick:x,children:c?"Saving...":"Save Google OAuth app"})]})}function O$(){const[e,t]=w.useState(null),[s,a]=w.useState(null),[r,c]=w.useState(!1),[u,f]=w.useState("localhost"),[m,p]=w.useState("9222"),[v,y]=w.useState(!1);return w.useEffect(()=>{Hx().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(lt,{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(oe,{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 E2(u,parseInt(m,10)||9222);const b=await Hx().catch(()=>null);b&&t(b),c(!1),Ke({title:"CDP endpoint saved",detail:`${u}:${parseInt(m,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}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:u,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(oe,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const L$={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function D$(){const e=pl(),{dashboard:t}=Oa(),s=t?.settings??e?.dashboard?.settings,c=ad(!e,e?.health).data??e?.health??L$,[u,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(!1),[x,b]=w.useState(""),[N,S]=w.useState(!1),[C,k]=w.useState(null),[R,A]=w.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(z=>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:z.displayName??z.name})]}),o.jsx(lt,{tone:z.state==="ready"?"positive":"caution",children:z.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:z.model})]}),z.quota&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsx("dt",{children:"Concurrency"}),o.jsx("dd",{children:z.quota.maxConcurrency})]}),o.jsxs("div",{children:[o.jsx("dt",{children:"Rate limit"}),o.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),o.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),o.jsx("div",{className:"mt-2",children:o.jsx(oe,{type:"button",variant:"outline",size:"sm",onClick:()=>f(u===z.name?null:z.name),children:u===z.name?"Cancel":z.state==="ready"?z.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),u===z.name&&o.jsx(R$,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.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(lt,{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(oe,{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(T$,{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(lt,{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(oe,{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:z=>b(z.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}),R&&o.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),o.jsx(oe,{type:"button",size:"sm",disabled:!x.trim()||N,onClick:async()=>{if(x.trim()){S(!0),k(null),A(!1);try{await D2(x.trim()),b(""),A(!0),y(!1),Ke({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(z){k(z instanceof Error?z.message:"Failed to update Bing API key")}finally{S(!1)}}},children:N?"Saving...":"Save Bing API key"})]})]}),o.jsx(O$,{}),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(lt,{tone:Au(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(lt,{tone:Au(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(z=>o.jsx("li",{children:z},z))}),o.jsx("p",{className:"supporting-copy",children:s.bootstrapNote})]})})]}):null}const M$=[{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 $$({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 P$(){const e=pl(),{dashboard:t,isLoading:s,refetch:a}=Oa(),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(ce=>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"})]},ce))})]})]});const c=r.settings,m=ad(!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=U4(r.setup,m,c),v=Ii(),[y,x]=w.useState(0),[b,N]=w.useState(""),[S,C]=w.useState(""),[k,R]=w.useState(""),[A,z]=w.useState("US"),[O,$]=w.useState("en"),[E,L]=w.useState(null),[U,X]=w.useState(null),[Q,ee]=w.useState(null),[ue,Ee]=w.useState(!1),[we,K]=w.useState(""),[ae,me]=w.useState(!1),[V,H]=w.useState(null),[T,B]=w.useState(!1),se=c.providerStatuses.filter(ce=>ce.state==="ready"),[le,J]=w.useState(se[0]?.name??""),[fe,ye]=w.useState(5),[Ae,ge]=w.useState(!1),[Ze,et]=w.useState(null),[de,Ve]=w.useState(""),[at,Vt]=w.useState(!1),[Pt,Dn]=w.useState(null),[nn,_t]=w.useState(!1),[re,Ge]=w.useState(!1),[gt,Qt]=w.useState(!1),Qe=HN(),Me=b.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Ye=we.split(`
|
|
239
|
-
`).map(ce=>ce.trim()).filter(Boolean),Nt=de.split(`
|
|
240
|
-
`).map(ce=>ce.trim()).filter(Boolean),Be=p.healthChecks.some(ce=>ce.id==="api"&&ce.state==="ready"),Da=async()=>{if(!(!Me||!k)){Ee(!0),ee(null);try{const ce=await Gu(Me,{displayName:S||b,canonicalDomain:k,country:A,language:O});L(Me),X(ce.id),Ke({title:"Project created",detail:`${ce.displayName||ce.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ce.name}`,dedupeMode:"drop"}),a(),x(2)}catch(ce){ee(ce instanceof Error?ce.message:"Failed to create project")}finally{Ee(!1)}}},pn=async()=>{if(!E)return;const ce=Ye;if(ce.length!==0){B(!0),H(null);try{await Z_(E,ce),me(!0),a(),x(3)}catch(kn){H(kn instanceof Error?kn.message:"Failed to save key phrases")}finally{B(!1)}}},nt=async()=>{if(!(!E||!le)){ge(!0),et(null);try{const ce=await h2(E,le,fe);if(ce.keywords.length>0){const kn=we?we.trimEnd()+`
|
|
241
|
-
`+ce.keywords.join(`
|
|
242
|
-
`):ce.keywords.join(`
|
|
243
|
-
`);K(kn)}}catch(ce){et(ce instanceof Error?ce.message:"Failed to generate key phrases")}finally{ge(!1)}}},Yr=async()=>{if(!E)return;const ce=Nt;if(ce.length!==0){_t(!0),Dn(null);try{await tj(E,ce),Vt(!0),a(),x(4)}catch(kn){Dn(kn instanceof Error?kn.message:"Failed to save competitors")}finally{_t(!1)}}},ts=async()=>{if(E){Qt(!0);try{await Qe.mutateAsync({projectName:E,projectLabel:S||b||E,sourceAction:"setup-launch"}),Ge(!0),a()}catch{}finally{Qt(!1)}}},ht=()=>x(ce=>Math.max(0,ce-1)),gn=(()=>{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(ce=>o.jsxs("div",{className:"health-check-row",children:[o.jsxs("div",{children:[o.jsx("p",{className:"run-row-title",children:ce.label}),o.jsx("p",{className:"supporting-copy",children:ce.detail}),ce.id==="provider"&&ce.state!=="ready"&&o.jsx(St,{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(lt,{tone:ce.state==="ready"?"positive":"caution",children:ce.state==="ready"?"Ready":"Attention"})]},ce.id))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx("span",{}),o.jsx(oe,{type:"button",disabled:!Be,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"})]}),E?o.jsx(lt,{tone:"positive",children:"Created"}):null]}),E?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:E})," created successfully."]}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(oe,{type:"button",variant:"outline",onClick:ht,children:"Back"}),o.jsx(oe,{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:ce=>N(ce.target.value)}),Me&&Me!==b?o.jsxs("p",{className:"supporting-copy",children:["Slug: ",Me]}):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:ce=>C(ce.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:ce=>R(ce.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:A,onChange:ce=>z(ce.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:O,onChange:ce=>$(ce.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(oe,{type:"button",variant:"outline",onClick:ht,children:"Back"}),o.jsx(oe,{type:"button",disabled:!Me||!k||ue,onClick:Da,children:ue?"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"})]}),ae?o.jsxs(lt,{tone:"positive",children:[Ye.length," saved"]}):o.jsxs(lt,{tone:"neutral",children:[Ye.length," key phrase",Ye.length!==1?"s":""]})]}),o.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ae?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:Ye.map(ce=>o.jsx("li",{children:ce},ce))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(oe,{type:"button",variant:"outline",onClick:ht,children:"Back"}),o.jsx(oe,{type:"button",onClick:()=>x(3),children:"Continue"})]})]}):o.jsxs("div",{className:"compact-stack",children:[se.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:le,onChange:ce=>J(ce.target.value),children:se.map(ce=>o.jsxs("option",{value:ce.name,children:[ce.displayName??ce.name,ce.model?` (${ce.model})`:""]},ce.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:fe,onChange:ce=>ye(Number(ce.target.value)),children:[3,5,10,15,20].map(ce=>o.jsx("option",{value:ce,children:ce},ce))})]}),o.jsx(oe,{type:"button",variant:"outline",disabled:Ae||!le,onClick:nt,children:Ae?"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
|
-
best invisalign downtown brooklyn
|
|
245
|
-
pediatric dentist brooklyn heights`,value:we,onChange:ce=>K(ce.target.value)})]}),V?o.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(oe,{type:"button",variant:"outline",onClick:ht,children:"Back"}),o.jsx(oe,{type:"button",disabled:Ye.length===0||T,onClick:pn,children:T?"Saving...":`Save ${Ye.length} key phrase${Ye.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"})]}),at?o.jsx(lt,{tone:"positive",children:"Saved"}):null]}),o.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),at?o.jsxs("div",{className:"compact-stack",children:[o.jsx("ul",{className:"detail-list",children:Nt.map(ce=>o.jsx("li",{children:ce},ce))}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(oe,{type:"button",variant:"outline",onClick:ht,children:"Back"}),o.jsx(oe,{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:de,onChange:ce=>Ve(ce.target.value)})]}),Pt?o.jsx("p",{className:"text-rose-400 text-sm",children:Pt}):null,o.jsxs("div",{className:"setup-nav",children:[o.jsx(oe,{type:"button",variant:"outline",onClick:ht,children:"Back"}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(oe,{type:"button",variant:"outline",onClick:()=>x(4),children:"Skip"}),o.jsx(oe,{type:"button",disabled:Nt.length===0||nn,onClick:Yr,children:nn?"Saving...":`Save ${Nt.length} competitor${Nt.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"})]}),re?o.jsx(lt,{tone:"positive",children:"Queued"}):null]}),re?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(oe,{type:"button",onClick:()=>v({to:U?`/projects/${U}`:"/"}),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:E}),"."]}),o.jsxs("div",{className:"setup-nav",children:[o.jsx(oe,{type:"button",variant:"outline",onClick:ht,children:"Back"}),o.jsx(oe,{type:"button",disabled:gt,onClick:ts,children:gt?"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($$,{current:y,labels:M$}),o.jsx("section",{className:"setup-wizard",children:gn})]})}function U$(){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(oe,{asChild:!0,children:o.jsx(St,{to:"/",children:"Return to overview"})})]})})})}function I$(){return o.jsx(L4,{children:o.jsx(O4,{})})}const us=__()({component:I$,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),B$=Xn({getParentRoute:()=>us,path:"/",component:B4,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Vn.projects.all);if(t&&t.length===0)throw up({to:"/setup"})}}),q$=Xn({getParentRoute:()=>us,path:"/projects",component:W3}),Sl=Xn({getParentRoute:()=>us,path:"/projects/$projectId",component:()=>o.jsx(bp,{})}),H$=Xn({getParentRoute:()=>Sl,path:"/",component:()=>o.jsx(vd,{tab:"overview"})}),K$=Xn({getParentRoute:()=>Sl,path:"/search-console",component:()=>o.jsx(vd,{tab:"search-console"})}),G$=Xn({getParentRoute:()=>Sl,path:"/analytics",component:()=>o.jsx(vd,{tab:"analytics"})}),F$=Xn({getParentRoute:()=>Sl,path:"/traffic",component:()=>o.jsx(vd,{tab:"traffic"})}),Z$=Xn({getParentRoute:()=>us,path:"/runs",component:A$}),V$=Xn({getParentRoute:()=>us,path:"/settings",component:D$,beforeLoad:({context:e})=>{}}),Q$=Xn({getParentRoute:()=>us,path:"/setup",component:P$,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Vn.projects.all);if(t&&t.length>0)throw up({to:"/"})}}),Y$=Xn({getParentRoute:()=>us,path:"*",component:U$}),J$=us.addChildren([B$,q$,Sl.addChildren([H$,K$,G$,F$]),Z$,V$,Q$,Y$]);function X$(e,t){return P_({routeTree:J$,basepath:Hm||"/",context:{queryClient:e},...t?.initialEntries})}const KN=V2(),W$=X$(KN),GN=document.getElementById("root");if(!GN)throw new Error("Expected #root element for web app bootstrap.");function eP(){const[e,t]=w.useState(Ix()?"ready":"checking"),[s,a]=w.useState(""),[r,c]=w.useState(""),[u,f]=w.useState(null),[m,p]=w.useState(!1);w.useEffect(()=>{if(Ix())return;let x=!1;return n2().then(b=>{x||(b.authenticated?t("ready"):t(b.setupRequired?"setup":"login"))}).catch(b=>{x||(f(b instanceof Error?b.message:"Failed to reach the Canonry API"),t("login"))}),()=>{x=!0}},[]);const v=async x=>{if(x.preventDefault(),!s.trim()||s.trim().length<8){f("Password must be at least 8 characters");return}if(s!==r){f("Passwords do not match");return}p(!0),f(null);try{if(!(await s2(s.trim())).authenticated){f("Setup failed");return}a(""),c(""),t("ready")}catch(b){f(b instanceof ku||b instanceof Error?b.message:"Setup failed")}finally{p(!1)}},y=async x=>{if(x.preventDefault(),!!s.trim()){p(!0),f(null);try{if(!(await i2(s.trim())).authenticated){f("Incorrect password");return}a(""),t("ready")}catch(b){f(b instanceof ku||b instanceof Error?b.message:"Authentication failed")}finally{p(!1)}}};return e==="ready"?o.jsx(Dk,{client:KN,children:o.jsx(B_,{router:W$})}):o.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:o.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:o.jsx(De,{className:"surface-card w-full",children:e==="checking"?o.jsx(hu,{className:"py-8",children:o.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?o.jsxs(o.Fragment,{children:[o.jsxs(Km,{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),o.jsx(Gm,{children:"Create a dashboard password"}),o.jsx(Fm,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),o.jsx(hu,{children:o.jsxs("form",{className:"space-y-4",onSubmit:v,children:[o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),o.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:s,onChange:x=>a(x.target.value),placeholder:"At least 8 characters"})]}),o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),o.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:r,onChange:x=>c(x.target.value),placeholder:"Re-enter password"})]}),u?o.jsx("p",{className:"text-sm text-rose-400",children:u}):null,o.jsx(oe,{type:"submit",disabled:m||!s.trim()||!r.trim(),children:m?"Setting up…":"Create password & open dashboard"})]})})]}):o.jsxs(o.Fragment,{children:[o.jsxs(Km,{children:[o.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),o.jsx(Gm,{children:"Sign in to Canonry"}),o.jsx(Fm,{children:"Enter your dashboard password to continue."})]}),o.jsx(hu,{children:o.jsxs("form",{className:"space-y-4",onSubmit:y,children:[o.jsxs("label",{className:"block space-y-1.5",children:[o.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),o.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:s,onChange:x=>a(x.target.value),placeholder:"Dashboard password"})]}),u?o.jsx("p",{className:"text-sm text-rose-400",children:u}):null,o.jsx(oe,{type:"submit",disabled:m||!s.trim(),children:m?"Signing in…":"Open dashboard"})]})})]})})})})}uk.createRoot(GN).render(o.jsx(w.StrictMode,{children:o.jsx(eP,{})}));
|