@ainyc/canonry 1.34.0 → 1.35.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-CxMuEW6I.css → index-B9SBdBOm.css} +1 -1
- package/assets/assets/index-DyipkdOb.js +281 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-4SRBJCNX.js → chunk-ETP5IOHC.js} +53 -9
- package/dist/cli.js +38 -4
- package/dist/index.js +1 -1
- package/package.json +6 -6
- package/assets/assets/index-BPuIj1DV.js +0 -246
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
function ck(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(a,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>a[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)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 n(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=n(o);fetch(o.href,c)}})();function bS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rh={exports:{}},qo={};var Qv;function uk(){if(Qv)return qo;Qv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var f in o)f!=="key"&&(c[f]=o[f])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:c}}return qo.Fragment=t,qo.jsx=n,qo.jsxs=n,qo}var Yv;function dk(){return Yv||(Yv=1,Rh.exports=uk()),Rh.exports}var r=dk(),Oh={exports:{}},Oe={};var Jv;function fk(){if(Jv)return Oe;Jv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=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"),b=Symbol.iterator;function x(R){return R===null||typeof R!="object"?null:(R=b&&R[b]||R["@@iterator"],typeof R=="function"?R:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(R,B,re){this.props=R,this.context=B,this.refs=C,this.updater=re||N}k.prototype.isReactComponent={},k.prototype.setState=function(R,B){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,B,"setState")},k.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function A(){}A.prototype=k.prototype;function T(R,B,re){this.props=R,this.context=B,this.refs=C,this.updater=re||N}var z=T.prototype=new A;z.constructor=T,S(z,k.prototype),z.isPureReactComponent=!0;var M=Array.isArray;function $(){}var E={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function K(R,B,re){var Z=re.ref;return{$$typeof:e,type:R,key:B,ref:Z!==void 0?Z:null,props:re}}function W(R,B){return K(R.type,B,R.props)}function J(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function ne(R){var B={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(re){return B[re]})}var fe=/\/+/g;function Ee(R,B){return typeof R=="object"&&R!==null&&R.key!=null?ne(""+R.key):B.toString(36)}function xe(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then($,$):(R.status="pending",R.then(function(B){R.status==="pending"&&(R.status="fulfilled",R.value=B)},function(B){R.status==="pending"&&(R.status="rejected",R.reason=B)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function H(R,B,re,Z,V){var se=typeof R;(se==="undefined"||se==="boolean")&&(R=null);var ge=!1;if(R===null)ge=!0;else switch(se){case"bigint":case"string":case"number":ge=!0;break;case"object":switch(R.$$typeof){case e:case t:ge=!0;break;case v:return ge=R._init,H(ge(R._payload),B,re,Z,V)}}if(ge)return V=V(R),ge=Z===""?"."+Ee(R,0):Z,M(V)?(re="",ge!=null&&(re=ge.replace(fe,"$&/")+"/"),H(V,B,re,"",function(Ae){return Ae})):V!=null&&(J(V)&&(V=W(V,re+(V.key==null||R&&R.key===V.key?"":(""+V.key).replace(fe,"$&/")+"/")+ge)),B.push(V)),1;ge=0;var je=Z===""?".":Z+":";if(M(R))for(var de=0;de<R.length;de++)Z=R[de],se=je+Ee(Z,de),ge+=H(Z,B,re,se,V);else if(de=x(R),typeof de=="function")for(R=de.call(R),de=0;!(Z=R.next()).done;)Z=Z.value,se=je+Ee(Z,de++),ge+=H(Z,B,re,se,V);else if(se==="object"){if(typeof R.then=="function")return H(xe(R),B,re,Z,V);throw B=String(R),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return ge}function ae(R,B,re){if(R==null)return R;var Z=[],V=0;return H(R,Z,"","",function(se){return B.call(re,se,V++)}),Z}function pe(R){if(R._status===-1){var B=R._result;B=B(),B.then(function(re){(R._status===0||R._status===-1)&&(R._status=1,R._result=re)},function(re){(R._status===0||R._status===-1)&&(R._status=2,R._result=re)}),R._status===-1&&(R._status=0,R._result=B)}if(R._status===1)return R._result.default;throw R._result}var he=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},P={map:ae,forEach:function(R,B,re){ae(R,function(){B.apply(this,arguments)},re)},count:function(R){var B=0;return ae(R,function(){B++}),B},toArray:function(R){return ae(R,function(B){return B})||[]},only:function(R){if(!J(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Oe.Activity=y,Oe.Children=P,Oe.Component=k,Oe.Fragment=n,Oe.Profiler=o,Oe.PureComponent=T,Oe.StrictMode=a,Oe.Suspense=m,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(R){return E.H.useMemoCache(R)}},Oe.cache=function(R){return function(){return R.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(R,B,re){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var Z=S({},R.props),V=R.key;if(B!=null)for(se in B.key!==void 0&&(V=""+B.key),B)!O.call(B,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&B.ref===void 0||(Z[se]=B[se]);var se=arguments.length-2;if(se===1)Z.children=re;else if(1<se){for(var ge=Array(se),je=0;je<se;je++)ge[je]=arguments[je+2];Z.children=ge}return K(R.type,V,Z)},Oe.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},Oe.createElement=function(R,B,re){var Z,V={},se=null;if(B!=null)for(Z in B.key!==void 0&&(se=""+B.key),B)O.call(B,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(V[Z]=B[Z]);var ge=arguments.length-2;if(ge===1)V.children=re;else if(1<ge){for(var je=Array(ge),de=0;de<ge;de++)je[de]=arguments[de+2];V.children=je}if(R&&R.defaultProps)for(Z in ge=R.defaultProps,ge)V[Z]===void 0&&(V[Z]=ge[Z]);return K(R,se,V)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(R){return{$$typeof:f,render:R}},Oe.isValidElement=J,Oe.lazy=function(R){return{$$typeof:v,_payload:{_status:-1,_result:R},_init:pe}},Oe.memo=function(R,B){return{$$typeof:p,type:R,compare:B===void 0?null:B}},Oe.startTransition=function(R){var B=E.T,re={};E.T=re;try{var Z=R(),V=E.S;V!==null&&V(re,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then($,he)}catch(se){he(se)}finally{B!==null&&re.types!==null&&(B.types=re.types),E.T=B}},Oe.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Oe.use=function(R){return E.H.use(R)},Oe.useActionState=function(R,B,re){return E.H.useActionState(R,B,re)},Oe.useCallback=function(R,B){return E.H.useCallback(R,B)},Oe.useContext=function(R){return E.H.useContext(R)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(R,B){return E.H.useDeferredValue(R,B)},Oe.useEffect=function(R,B){return E.H.useEffect(R,B)},Oe.useEffectEvent=function(R){return E.H.useEffectEvent(R)},Oe.useId=function(){return E.H.useId()},Oe.useImperativeHandle=function(R,B,re){return E.H.useImperativeHandle(R,B,re)},Oe.useInsertionEffect=function(R,B){return E.H.useInsertionEffect(R,B)},Oe.useLayoutEffect=function(R,B){return E.H.useLayoutEffect(R,B)},Oe.useMemo=function(R,B){return E.H.useMemo(R,B)},Oe.useOptimistic=function(R,B){return E.H.useOptimistic(R,B)},Oe.useReducer=function(R,B,re){return E.H.useReducer(R,B,re)},Oe.useRef=function(R){return E.H.useRef(R)},Oe.useState=function(R){return E.H.useState(R)},Oe.useSyncExternalStore=function(R,B,re){return E.H.useSyncExternalStore(R,B,re)},Oe.useTransition=function(){return E.H.useTransition()},Oe.version="19.2.4",Oe}var Xv;function pl(){return Xv||(Xv=1,Oh.exports=fk()),Oh.exports}var w=pl();const us=bS(w),ip=ck({__proto__:null,default:us},[w]);var Lh={exports:{}},Ko={},Dh={exports:{}},Mh={};var Wv;function hk(){return Wv||(Wv=1,(function(e){function t(H,ae){var pe=H.length;H.push(ae);e:for(;0<pe;){var he=pe-1>>>1,P=H[he];if(0<o(P,ae))H[he]=ae,H[pe]=P,pe=he;else break e}}function n(H){return H.length===0?null:H[0]}function a(H){if(H.length===0)return null;var ae=H[0],pe=H.pop();if(pe!==ae){H[0]=pe;e:for(var he=0,P=H.length,R=P>>>1;he<R;){var B=2*(he+1)-1,re=H[B],Z=B+1,V=H[Z];if(0>o(re,pe))Z<P&&0>o(V,re)?(H[he]=V,H[Z]=pe,he=Z):(H[he]=re,H[B]=pe,he=B);else if(Z<P&&0>o(V,pe))H[he]=V,H[Z]=pe,he=Z;else break e}}return ae}function o(H,ae){var pe=H.sortIndex-ae.sortIndex;return pe!==0?pe:H.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,b=3,x=!1,N=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function z(H){for(var ae=n(p);ae!==null;){if(ae.callback===null)a(p);else if(ae.startTime<=H)a(p),ae.sortIndex=ae.expirationTime,t(m,ae);else break;ae=n(p)}}function M(H){if(S=!1,z(H),!N)if(n(m)!==null)N=!0,$||($=!0,ne());else{var ae=n(p);ae!==null&&xe(M,ae.startTime-H)}}var $=!1,E=-1,O=5,K=-1;function W(){return C?!0:!(e.unstable_now()-K<O)}function J(){if(C=!1,$){var H=e.unstable_now();K=H;var ae=!0;try{e:{N=!1,S&&(S=!1,A(E),E=-1),x=!0;var pe=b;try{t:{for(z(H),y=n(m);y!==null&&!(y.expirationTime>H&&W());){var he=y.callback;if(typeof he=="function"){y.callback=null,b=y.priorityLevel;var P=he(y.expirationTime<=H);if(H=e.unstable_now(),typeof P=="function"){y.callback=P,z(H),ae=!0;break t}y===n(m)&&a(m),z(H)}else a(m);y=n(m)}if(y!==null)ae=!0;else{var R=n(p);R!==null&&xe(M,R.startTime-H),ae=!1}}break e}finally{y=null,b=pe,x=!1}ae=void 0}}finally{ae?ne():$=!1}}}var ne;if(typeof T=="function")ne=function(){T(J)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,Ee=fe.port2;fe.port1.onmessage=J,ne=function(){Ee.postMessage(null)}}else ne=function(){k(J,0)};function xe(H,ae){E=k(function(){H(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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(H){switch(b){case 1:case 2:case 3:var ae=3;break;default:ae=b}var pe=b;b=ae;try{return H()}finally{b=pe}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(H,ae){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var pe=b;b=H;try{return ae()}finally{b=pe}},e.unstable_scheduleCallback=function(H,ae,pe){var he=e.unstable_now();switch(typeof pe=="object"&&pe!==null?(pe=pe.delay,pe=typeof pe=="number"&&0<pe?he+pe:he):pe=he,H){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=pe+P,H={id:v++,callback:ae,priorityLevel:H,startTime:pe,expirationTime:P,sortIndex:-1},pe>he?(H.sortIndex=pe,t(p,H),n(m)===null&&H===n(p)&&(S?(A(E),E=-1):S=!0,xe(M,pe-he))):(H.sortIndex=P,t(m,H),N||x||(N=!0,$||($=!0,ne()))),H},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(H){var ae=b;return function(){var pe=b;b=ae;try{return H.apply(this,arguments)}finally{b=pe}}}})(Mh)),Mh}var eb;function mk(){return eb||(eb=1,Dh.exports=hk()),Dh.exports}var $h={exports:{}},an={};var tb;function pk(){if(tb)return an;tb=1;var e=pl();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 n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(m,p,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,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),b=typeof p.integrity=="string"?p.integrity:void 0,x=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:b,fetchPriority:x}):v==="script"&&a.d.X(m,{crossOrigin:y,integrity:b,fetchPriority:x,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 nb;function xS(){if(nb)return $h.exports;nb=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(),$h.exports=pk(),$h.exports}var sb;function gk(){if(sb)return Ko;sb=1;var e=mk(),t=pl(),n=xS();function a(s){var i="https://react.dev/errors/"+s;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 #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function c(s){var i=s,l=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(l=i.return),s=i.return;while(s)}return i.tag===3?l:null}function u(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function f(s){if(s.tag===31){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function m(s){if(c(s)!==s)throw Error(a(188))}function p(s){var i=s.alternate;if(!i){if(i=c(s),i===null)throw Error(a(188));return i!==s?null:s}for(var l=s,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),s;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?s:i}function v(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=v(s),i!==null)return i;s=s.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=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"),A=Symbol.for("react.consumer"),T=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function ne(s){return s===null||typeof s!="object"?null:(s=J&&s[J]||s["@@iterator"],typeof s=="function"?s:null)}var fe=Symbol.for("react.client.reference");function Ee(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===fe?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case M:return"Suspense";case $:return"SuspenseList";case K:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case N:return"Portal";case T:return s.displayName||"Context";case A:return(s._context.displayName||"Context")+".Consumer";case z:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case E:return i=s.displayName||null,i!==null?i:Ee(s.type)||"Memo";case O:i=s._payload,s=s._init;try{return Ee(s(i))}catch{}}return null}var xe=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},he=[],P=-1;function R(s){return{current:s}}function B(s){0>P||(s.current=he[P],he[P]=null,P--)}function re(s,i){P++,he[P]=s.current,s.current=i}var Z=R(null),V=R(null),se=R(null),ge=R(null);function je(s,i){switch(re(se,i),re(V,s),re(Z,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?vv(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=vv(i),s=bv(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}B(Z),re(Z,s)}function de(){B(Z),B(V),B(se)}function Ae(s){s.memoizedState!==null&&re(ge,s);var i=Z.current,l=bv(i,s.type);i!==l&&(re(V,s),re(Z,l))}function Re(s){V.current===s&&(B(Z),B(V)),ge.current===s&&(B(ge),Po._currentValue=pe)}var ce,Pe;function Ve(s){if(ce===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ce=i&&i[1]||"",Pe=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+ce+s+Pe}var Vt=!1;function Ut(s,i){if(!s||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 Q=Y}Reflect.construct(s,[],ie)}else{try{ie.call()}catch(Y){Q=Y}s.call(ie.prototype)}}else{try{throw Error()}catch(Y){Q=Y}(ie=s())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(Y){if(Y&&Q&&typeof Y.stack=="string")return[Y.stack,Q.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 D=j.split(`
|
|
4
|
-
`),F=_.split(`
|
|
5
|
-
`);for(h=d=0;d<D.length&&!D[d].includes("DetermineComponentFrameRoot");)d++;for(;h<F.length&&!F[h].includes("DetermineComponentFrameRoot");)h++;if(d===D.length||h===F.length)for(d=D.length-1,h=F.length-1;1<=d&&0<=h&&D[d]!==F[h];)h--;for(;1<=d&&0<=h;d--,h--)if(D[d]!==F[h]){if(d!==1||h!==1)do if(d--,h--,0>h||D[d]!==F[h]){var X=`
|
|
6
|
-
`+D[d].replace(" at new "," at ");return s.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",s.displayName)),X}while(1<=d&&0<=h);break}}}finally{Vt=!1,Error.prepareStackTrace=l}return(l=s?s.displayName||s.name:"")?Ve(l):""}function Mn(s,i){switch(s.tag){case 26:case 27:case 5:return Ve(s.type);case 16:return Ve("Lazy");case 13:return s.child!==i&&i!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return Ut(s.type,!1);case 11:return Ut(s.type.render,!1);case 1:return Ut(s.type,!0);case 31:return Ve("Activity");default:return""}}function nn(s){try{var i="",l=null;do i+=Mn(s,l),l=s,s=s.return;while(s);return i}catch(d){return`
|
|
7
|
-
Error generating stack: `+d.message+`
|
|
8
|
-
`+d.stack}}var Tt=Object.prototype.hasOwnProperty,oe=e.unstable_scheduleCallback,Qe=e.unstable_cancelCallback,ut=e.unstable_shouldYield,Qt=e.unstable_requestPaint,Ye=e.unstable_now,Ue=e.unstable_getCurrentPriorityLevel,Xe=e.unstable_ImmediatePriority,Ct=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,Ma=e.unstable_LowPriority,gn=e.unstable_IdlePriority,st=e.log,Xr=e.unstable_setDisableYieldValue,ns=null,mt=null;function yn(s){if(typeof st=="function"&&Xr(s),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(ns,s)}catch{}}var ue=Math.clz32?Math.clz32:Cl,zn=Math.log,$a=Math.LN2;function Cl(s){return s>>>=0,s===0?32:31-(zn(s)/$a|0)|0}var Gi=256,Pa=262144,Cs=4194304;function ms(s){var i=s&42;if(i!==0)return i;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Ua(s,i,l){var d=s.pendingLanes;if(d===0)return 0;var h=0,g=s.suspendedLanes,j=s.pingedLanes;s=s.warmLanes;var _=d&134217727;return _!==0?(d=_&~g,d!==0?h=ms(d):(j&=_,j!==0?h=ms(j):l||(l=_&~s,l!==0&&(h=ms(l))))):(_=d&~g,_!==0?h=ms(_):j!==0?h=ms(j):l||(l=d&~s,l!==0&&(h=ms(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(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function wd(s,i){switch(s){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 kl(){var s=Cs;return Cs<<=1,(Cs&62914560)===0&&(Cs=4194304),s}function Wr(s){for(var i=[],l=0;31>l;l++)i.push(s);return i}function Fi(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function zl(s,i,l,d,h,g){var j=s.pendingLanes;s.pendingLanes=l,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=l,s.entangledLanes&=l,s.errorRecoveryDisabledLanes&=l,s.shellSuspendCounter=0;var _=s.entanglements,D=s.expirationTimes,F=s.hiddenUpdates;for(l=j&~l;0<l;){var X=31-ue(l),ie=1<<X;_[X]=0,D[X]=-1;var Q=F[X];if(Q!==null)for(F[X]=null,X=0;X<Q.length;X++){var Y=Q[X];Y!==null&&(Y.lane&=-536870913)}l&=~ie}d!==0&&I(s,d,0),g!==0&&h===0&&s.tag!==0&&(s.suspendedLanes|=g&~(j&~i))}function I(s,i,l){s.pendingLanes|=i,s.suspendedLanes&=~i;var d=31-ue(i);s.entangledLanes|=i,s.entanglements[d]=s.entanglements[d]|1073741824|l&261930}function me(s,i){var l=s.entangledLanes|=i;for(s=s.entanglements;l;){var d=31-ue(l),h=1<<d;h&i|s[d]&i&&(s[d]|=i),l&=~h}}function bt(s,i){var l=i&-i;return l=(l&42)!==0?1:Gt(l),(l&(s.suspendedLanes|i))!==0?0:l}function Gt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ln(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Ia(){var s=ae.p;return s!==0?s:(s=window.event,s===void 0?32:qv(s.type))}function ps(s,i){var l=ae.p;try{return ae.p=s,i()}finally{ae.p=l}}var cn=Math.random().toString(36).slice(2),it="__reactFiber$"+cn,sn="__reactProps$"+cn,_n="__reactContainer$"+cn,ks="__reactEvents$"+cn,Ba="__reactListeners$"+cn,_l="__reactHandles$"+cn,El="__reactResources$"+cn,gs="__reactMarker$"+cn;function Js(s){delete s[it],delete s[sn],delete s[ks],delete s[Ba],delete s[_l]}function Xs(s){var i=s[it];if(i)return i;for(var l=s.parentNode;l;){if(i=l[_n]||l[it]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(s=kv(s);s!==null;){if(l=s[it])return l;s=kv(s)}return i}s=l,l=s.parentNode}return null}function Ws(s){if(s=s[it]||s[_n]){var i=s.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return s}return null}function Ie(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s.stateNode;throw Error(a(33))}function We(s){var i=s[El];return i||(i=s[El]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function at(s){s[gs]=!0}var ss=new Set,Zi={};function ys(s,i){qa(s,i),qa(s+"Capture",i)}function qa(s,i){for(Zi[s]=i,s=0;s<i.length;s++)ss.add(i[s])}var e1=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]*$"),lg={},cg={};function t1(s){return Tt.call(cg,s)?!0:Tt.call(lg,s)?!1:e1.test(s)?cg[s]=!0:(lg[s]=!0,!1)}function Tl(s,i,l){if(t1(i))if(l===null)s.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":s.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){s.removeAttribute(i);return}}s.setAttribute(i,""+l)}}function Al(s,i,l){if(l===null)s.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(i);return}s.setAttribute(i,""+l)}}function zs(s,i,l,d){if(d===null)s.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttributeNS(i,l,""+d)}}function $n(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ug(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function n1(s,i,l){var d=Object.getOwnPropertyDescriptor(s.constructor.prototype,i);if(!s.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var h=d.get,g=d.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return h.call(this)},set:function(j){l=""+j,g.call(this,j)}}),Object.defineProperty(s,i,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(j){l=""+j},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function Nd(s){if(!s._valueTracker){var i=ug(s)?"checked":"value";s._valueTracker=n1(s,i,""+s[i])}}function dg(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return s&&(d=ug(s)?s.checked?"true":"false":s.value),s=d,s!==l?(i.setValue(s),!0):!1}function Rl(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var s1=/[\n"\\]/g;function Pn(s){return s.replace(s1,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Cd(s,i,l,d,h,g,j,_){s.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?s.type=j:s.removeAttribute("type"),i!=null?j==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+$n(i)):s.value!==""+$n(i)&&(s.value=""+$n(i)):j!=="submit"&&j!=="reset"||s.removeAttribute("value"),i!=null?kd(s,j,$n(i)):l!=null?kd(s,j,$n(l)):d!=null&&s.removeAttribute("value"),h==null&&g!=null&&(s.defaultChecked=!!g),h!=null&&(s.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?s.name=""+$n(_):s.removeAttribute("name")}function fg(s,i,l,d,h,g,j,_){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(s.type=g),i!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){Nd(s);return}l=l!=null?""+$n(l):"",i=i!=null?""+$n(i):l,_||i===s.value||(s.value=i),s.defaultValue=i}d=d??h,d=typeof d!="function"&&typeof d!="symbol"&&!!d,s.checked=_?s.checked:!!d,s.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(s.name=j),Nd(s)}function kd(s,i,l){i==="number"&&Rl(s.ownerDocument)===s||s.defaultValue===""+l||(s.defaultValue=""+l)}function Ka(s,i,l,d){if(s=s.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<s.length;l++)h=i.hasOwnProperty("$"+s[l].value),s[l].selected!==h&&(s[l].selected=h),h&&d&&(s[l].defaultSelected=!0)}else{for(l=""+$n(l),i=null,h=0;h<s.length;h++){if(s[h].value===l){s[h].selected=!0,d&&(s[h].defaultSelected=!0);return}i!==null||s[h].disabled||(i=s[h])}i!==null&&(i.selected=!0)}}function hg(s,i,l){if(i!=null&&(i=""+$n(i),i!==s.value&&(s.value=i),l==null)){s.defaultValue!==i&&(s.defaultValue=i);return}s.defaultValue=l!=null?""+$n(l):""}function mg(s,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(a(92));if(xe(d)){if(1<d.length)throw Error(a(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=$n(i),s.defaultValue=l,d=s.textContent,d===l&&d!==""&&d!==null&&(s.value=d),Nd(s)}function Ha(s,i){if(i){var l=s.firstChild;if(l&&l===s.lastChild&&l.nodeType===3){l.nodeValue=i;return}}s.textContent=i}var i1=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 pg(s,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?s.setProperty(i,""):i==="float"?s.cssFloat="":s[i]="":d?s.setProperty(i,l):typeof l!="number"||l===0||i1.has(i)?i==="float"?s.cssFloat=l:s[i]=(""+l).trim():s[i]=l+"px"}function gg(s,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(s=s.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?s.setProperty(d,""):d==="float"?s.cssFloat="":s[d]="");for(var h in i)d=i[h],i.hasOwnProperty(h)&&l[h]!==d&&pg(s,h,d)}else for(var g in i)i.hasOwnProperty(g)&&pg(s,g,i[g])}function zd(s){if(s.indexOf("-")===-1)return!1;switch(s){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 a1=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"]]),r1=/^[\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 Ol(s){return r1.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function _s(){}var _d=null;function Ed(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ga=null,Fa=null;function yg(s){var i=Ws(s);if(i&&(s=i.stateNode)){var l=s[sn]||null;e:switch(s=i.stateNode,i.type){case"input":if(Cd(s,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=s;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Pn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==s&&d.form===s.form){var h=d[sn]||null;if(!h)throw Error(a(90));Cd(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===s.form&&dg(d)}break e;case"textarea":hg(s,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Ka(s,!!l.multiple,i,!1)}}}var Td=!1;function vg(s,i,l){if(Td)return s(i,l);Td=!0;try{var d=s(i);return d}finally{if(Td=!1,(Ga!==null||Fa!==null)&&(xc(),Ga&&(i=Ga,s=Fa,Fa=Ga=null,yg(i),s)))for(i=0;i<s.length;i++)yg(s[i])}}function eo(s,i){var l=s.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)||(s=s.type,d=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!d;break e;default:s=!1}if(s)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"),Ad=!1;if(Es)try{var to={};Object.defineProperty(to,"passive",{get:function(){Ad=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{Ad=!1}var ei=null,Rd=null,Ll=null;function bg(){if(Ll)return Ll;var s,i=Rd,l=i.length,d,h="value"in ei?ei.value:ei.textContent,g=h.length;for(s=0;s<l&&i[s]===h[s];s++);var j=l-s;for(d=1;d<=j&&i[l-d]===h[g-d];d++);return Ll=h.slice(s,1<d?1-d:void 0)}function Dl(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function Ml(){return!0}function xg(){return!1}function vn(s){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 s)s.hasOwnProperty(_)&&(l=s[_],this[_]=l?l(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Ml:xg,this.isPropagationStopped=xg,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=Ml)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),i}var Vi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$l=vn(Vi),no=y({},Vi,{view:0,detail:0}),o1=vn(no),Od,Ld,so,Pl=y({},no,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Md,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==so&&(so&&s.type==="mousemove"?(Od=s.screenX-so.screenX,Ld=s.screenY-so.screenY):Ld=Od=0,so=s),Od)},movementY:function(s){return"movementY"in s?s.movementY:Ld}}),Sg=vn(Pl),l1=y({},Pl,{dataTransfer:0}),c1=vn(l1),u1=y({},no,{relatedTarget:0}),Dd=vn(u1),d1=y({},Vi,{animationName:0,elapsedTime:0,pseudoElement:0}),f1=vn(d1),h1=y({},Vi,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),m1=vn(h1),p1=y({},Vi,{data:0}),jg=vn(p1),g1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},y1={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"},v1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function b1(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=v1[s])?!!i[s]:!1}function Md(){return b1}var x1=y({},no,{key:function(s){if(s.key){var i=g1[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=Dl(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?y1[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Md,charCode:function(s){return s.type==="keypress"?Dl(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Dl(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),S1=vn(x1),j1=y({},Pl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wg=vn(j1),w1=y({},no,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Md}),N1=vn(w1),C1=y({},Vi,{propertyName:0,elapsedTime:0,pseudoElement:0}),k1=vn(C1),z1=y({},Pl,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),_1=vn(z1),E1=y({},Vi,{newState:0,oldState:0}),T1=vn(E1),A1=[9,13,27,32],$d=Es&&"CompositionEvent"in window,io=null;Es&&"documentMode"in document&&(io=document.documentMode);var R1=Es&&"TextEvent"in window&&!io,Ng=Es&&(!$d||io&&8<io&&11>=io),Cg=" ",kg=!1;function zg(s,i){switch(s){case"keyup":return A1.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _g(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Za=!1;function O1(s,i){switch(s){case"compositionend":return _g(i);case"keypress":return i.which!==32?null:(kg=!0,Cg);case"textInput":return s=i.data,s===Cg&&kg?null:s;default:return null}}function L1(s,i){if(Za)return s==="compositionend"||!$d&&zg(s,i)?(s=bg(),Ll=Rd=ei=null,Za=!1,s):null;switch(s){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 Ng&&i.locale!=="ko"?null:i.data;default:return null}}var D1={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 Eg(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!D1[s.type]:i==="textarea"}function Tg(s,i,l,d){Ga?Fa?Fa.push(d):Fa=[d]:Ga=d,i=zc(i,"onChange"),0<i.length&&(l=new $l("onChange","change",null,l,d),s.push({event:l,listeners:i}))}var ao=null,ro=null;function M1(s){fv(s,0)}function Ul(s){var i=Ie(s);if(dg(i))return s}function Ag(s,i){if(s==="change")return i}var Rg=!1;if(Es){var Pd;if(Es){var Ud="oninput"in document;if(!Ud){var Og=document.createElement("div");Og.setAttribute("oninput","return;"),Ud=typeof Og.oninput=="function"}Pd=Ud}else Pd=!1;Rg=Pd&&(!document.documentMode||9<document.documentMode)}function Lg(){ao&&(ao.detachEvent("onpropertychange",Dg),ro=ao=null)}function Dg(s){if(s.propertyName==="value"&&Ul(ro)){var i=[];Tg(i,ro,s,Ed(s)),vg(M1,i)}}function $1(s,i,l){s==="focusin"?(Lg(),ao=i,ro=l,ao.attachEvent("onpropertychange",Dg)):s==="focusout"&&Lg()}function P1(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Ul(ro)}function U1(s,i){if(s==="click")return Ul(i)}function I1(s,i){if(s==="input"||s==="change")return Ul(i)}function B1(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var En=typeof Object.is=="function"?Object.is:B1;function oo(s,i){if(En(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var l=Object.keys(s),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var h=l[d];if(!Tt.call(i,h)||!En(s[h],i[h]))return!1}return!0}function Mg(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function $g(s,i){var l=Mg(s);s=0;for(var d;l;){if(l.nodeType===3){if(d=s+l.textContent.length,s<=i&&d>=i)return{node:l,offset:i-s};s=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Mg(l)}}function Pg(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?Pg(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function Ug(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=Rl(s.document);i instanceof s.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)s=i.contentWindow;else break;i=Rl(s.document)}return i}function Id(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var q1=Es&&"documentMode"in document&&11>=document.documentMode,Va=null,Bd=null,lo=null,qd=!1;function Ig(s,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;qd||Va==null||Va!==Rl(d)||(d=Va,"selectionStart"in d&&Id(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}),lo&&oo(lo,d)||(lo=d,d=zc(Bd,"onSelect"),0<d.length&&(i=new $l("onSelect","select",null,i,l),s.push({event:i,listeners:d}),i.target=Va)))}function Qi(s,i){var l={};return l[s.toLowerCase()]=i.toLowerCase(),l["Webkit"+s]="webkit"+i,l["Moz"+s]="moz"+i,l}var Qa={animationend:Qi("Animation","AnimationEnd"),animationiteration:Qi("Animation","AnimationIteration"),animationstart:Qi("Animation","AnimationStart"),transitionrun:Qi("Transition","TransitionRun"),transitionstart:Qi("Transition","TransitionStart"),transitioncancel:Qi("Transition","TransitionCancel"),transitionend:Qi("Transition","TransitionEnd")},Kd={},Bg={};Es&&(Bg=document.createElement("div").style,"AnimationEvent"in window||(delete Qa.animationend.animation,delete Qa.animationiteration.animation,delete Qa.animationstart.animation),"TransitionEvent"in window||delete Qa.transitionend.transition);function Yi(s){if(Kd[s])return Kd[s];if(!Qa[s])return s;var i=Qa[s],l;for(l in i)if(i.hasOwnProperty(l)&&l in Bg)return Kd[s]=i[l];return s}var qg=Yi("animationend"),Kg=Yi("animationiteration"),Hg=Yi("animationstart"),K1=Yi("transitionrun"),H1=Yi("transitionstart"),G1=Yi("transitioncancel"),Gg=Yi("transitionend"),Fg=new Map,Hd="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(" ");Hd.push("scrollEnd");function is(s,i){Fg.set(s,i),ys(i,[s])}var Il=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Un=[],Ya=0,Gd=0;function Bl(){for(var s=Ya,i=Gd=Ya=0;i<s;){var l=Un[i];Un[i++]=null;var d=Un[i];Un[i++]=null;var h=Un[i];Un[i++]=null;var g=Un[i];if(Un[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&&Zg(l,h,g)}}function ql(s,i,l,d){Un[Ya++]=s,Un[Ya++]=i,Un[Ya++]=l,Un[Ya++]=d,Gd|=d,s.lanes|=d,s=s.alternate,s!==null&&(s.lanes|=d)}function Fd(s,i,l,d){return ql(s,i,l,d),Kl(s)}function Ji(s,i){return ql(s,null,null,i),Kl(s)}function Zg(s,i,l){s.lanes|=l;var d=s.alternate;d!==null&&(d.lanes|=l);for(var h=!1,g=s.return;g!==null;)g.childLanes|=l,d=g.alternate,d!==null&&(d.childLanes|=l),g.tag===22&&(s=g.stateNode,s===null||s._visibility&1||(h=!0)),s=g,g=g.return;return s.tag===3?(g=s.stateNode,h&&i!==null&&(h=31-ue(l),s=g.hiddenUpdates,d=s[h],d===null?s[h]=[i]:d.push(i),i.lane=l|536870912),g):null}function Kl(s){if(50<Ao)throw Ao=0,nh=null,Error(a(185));for(var i=s.return;i!==null;)s=i,i=s.return;return s.tag===3?s.stateNode:null}var Ja={};function F1(s,i,l,d){this.tag=s,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 Tn(s,i,l,d){return new F1(s,i,l,d)}function Zd(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ts(s,i){var l=s.alternate;return l===null?(l=Tn(s.tag,i,s.key,s.mode),l.elementType=s.elementType,l.type=s.type,l.stateNode=s.stateNode,l.alternate=s,s.alternate=l):(l.pendingProps=i,l.type=s.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=s.flags&65011712,l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,i=s.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=s.sibling,l.index=s.index,l.ref=s.ref,l.refCleanup=s.refCleanup,l}function Vg(s,i){s.flags&=65011714;var l=s.alternate;return l===null?(s.childLanes=0,s.lanes=i,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,i=l.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s}function Hl(s,i,l,d,h,g){var j=0;if(d=s,typeof s=="function")Zd(s)&&(j=1);else if(typeof s=="string")j=JC(s,l,Z.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case K:return s=Tn(31,l,i,h),s.elementType=K,s.lanes=g,s;case S:return Xi(l.children,h,g,i);case C:j=8,h|=24;break;case k:return s=Tn(12,l,i,h|2),s.elementType=k,s.lanes=g,s;case M:return s=Tn(13,l,i,h),s.elementType=M,s.lanes=g,s;case $:return s=Tn(19,l,i,h),s.elementType=$,s.lanes=g,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case T:j=10;break e;case A:j=9;break e;case z:j=11;break e;case E:j=14;break e;case O:j=16,d=null;break e}j=29,l=Error(a(130,s===null?"null":typeof s,"")),d=null}return i=Tn(j,l,i,h),i.elementType=s,i.type=d,i.lanes=g,i}function Xi(s,i,l,d){return s=Tn(7,s,d,i),s.lanes=l,s}function Vd(s,i,l){return s=Tn(6,s,null,i),s.lanes=l,s}function Qg(s){var i=Tn(18,null,null,0);return i.stateNode=s,i}function Qd(s,i,l){return i=Tn(4,s.children!==null?s.children:[],s.key,i),i.lanes=l,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}var Yg=new WeakMap;function In(s,i){if(typeof s=="object"&&s!==null){var l=Yg.get(s);return l!==void 0?l:(i={value:s,source:i,stack:nn(i)},Yg.set(s,i),i)}return{value:s,source:i,stack:nn(i)}}var Xa=[],Wa=0,Gl=null,co=0,Bn=[],qn=0,ti=null,vs=1,bs="";function As(s,i){Xa[Wa++]=co,Xa[Wa++]=Gl,Gl=s,co=i}function Jg(s,i,l){Bn[qn++]=vs,Bn[qn++]=bs,Bn[qn++]=ti,ti=s;var d=vs;s=bs;var h=32-ue(d)-1;d&=~(1<<h),l+=1;var g=32-ue(i)+h;if(30<g){var j=h-h%5;g=(d&(1<<j)-1).toString(32),d>>=j,h-=j,vs=1<<32-ue(i)+h|l<<h|d,bs=g+s}else vs=1<<g|l<<h|d,bs=s}function Yd(s){s.return!==null&&(As(s,1),Jg(s,1,0))}function Jd(s){for(;s===Gl;)Gl=Xa[--Wa],Xa[Wa]=null,co=Xa[--Wa],Xa[Wa]=null;for(;s===ti;)ti=Bn[--qn],Bn[qn]=null,bs=Bn[--qn],Bn[qn]=null,vs=Bn[--qn],Bn[qn]=null}function Xg(s,i){Bn[qn++]=vs,Bn[qn++]=bs,Bn[qn++]=ti,vs=i.id,bs=i.overflow,ti=s}var Jt=null,yt=null,Je=!1,ni=null,Kn=!1,Xd=Error(a(519));function si(s){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uo(In(i,s)),Xd}function Wg(s){var i=s.stateNode,l=s.type,d=s.memoizedProps;switch(i[it]=s,i[sn]=d,l){case"dialog":Ke("cancel",i),Ke("close",i);break;case"iframe":case"object":case"embed":Ke("load",i);break;case"video":case"audio":for(l=0;l<Oo.length;l++)Ke(Oo[l],i);break;case"source":Ke("error",i);break;case"img":case"image":case"link":Ke("error",i),Ke("load",i);break;case"details":Ke("toggle",i);break;case"input":Ke("invalid",i),fg(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Ke("invalid",i);break;case"textarea":Ke("invalid",i),mg(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||gv(i.textContent,l)?(d.popover!=null&&(Ke("beforetoggle",i),Ke("toggle",i)),d.onScroll!=null&&Ke("scroll",i),d.onScrollEnd!=null&&Ke("scrollend",i),d.onClick!=null&&(i.onclick=_s),i=!0):i=!1,i||si(s,!0)}function ey(s){for(Jt=s.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:Jt=Jt.return}}function er(s){if(s!==Jt)return!1;if(!Je)return ey(s),Je=!0,!1;var i=s.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=s.type,l=!(l!=="form"&&l!=="button")||yh(s.type,s.memoizedProps)),l=!l),l&&yt&&si(s),ey(s),i===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));yt=Cv(s)}else if(i===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(317));yt=Cv(s)}else i===27?(i=yt,yi(s.type)?(s=jh,jh=null,yt=s):yt=i):yt=Jt?Gn(s.stateNode.nextSibling):null;return!0}function Wi(){yt=Jt=null,Je=!1}function Wd(){var s=ni;return s!==null&&(jn===null?jn=s:jn.push.apply(jn,s),ni=null),s}function uo(s){ni===null?ni=[s]:ni.push(s)}var ef=R(null),ea=null,Rs=null;function ii(s,i,l){re(ef,i._currentValue),i._currentValue=l}function Os(s){s._currentValue=ef.current,B(ef)}function tf(s,i,l){for(;s!==null;){var d=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),s===l)break;s=s.return}}function nf(s,i,l,d){var h=s.child;for(h!==null&&(h.return=s);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 D=0;D<i.length;D++)if(_.context===i[D]){g.lanes|=l,_=g.alternate,_!==null&&(_.lanes|=l),tf(g.return,l,s),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),tf(j,l,s),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===s){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function tr(s,i,l,d){s=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;En(h.pendingProps.value,j.value)||(s!==null?s.push(_):s=[_])}}else if(h===ge.current){if(j=h.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(s!==null?s.push(Po):s=[Po])}h=h.return}s!==null&&nf(i,s,l,d),i.flags|=262144}function Fl(s){for(s=s.firstContext;s!==null;){if(!En(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function ta(s){ea=s,Rs=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Xt(s){return ty(ea,s)}function Zl(s,i){return ea===null&&ta(s),ty(s,i)}function ty(s,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Rs===null){if(s===null)throw Error(a(308));Rs=i,s.dependencies={lanes:0,firstContext:i},s.flags|=524288}else Rs=Rs.next=i;return l}var Z1=typeof AbortController<"u"?AbortController:function(){var s=[],i=this.signal={aborted:!1,addEventListener:function(l,d){s.push(d)}};this.abort=function(){i.aborted=!0,s.forEach(function(l){return l()})}},V1=e.unstable_scheduleCallback,Q1=e.unstable_NormalPriority,It={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sf(){return{controller:new Z1,data:new Map,refCount:0}}function fo(s){s.refCount--,s.refCount===0&&V1(Q1,function(){s.controller.abort()})}var ho=null,af=0,nr=0,sr=null;function Y1(s,i){if(ho===null){var l=ho=[];af=0,nr=lh(),sr={status:"pending",value:void 0,then:function(d){l.push(d)}}}return af++,i.then(ny,ny),i}function ny(){if(--af===0&&ho!==null){sr!==null&&(sr.status="fulfilled");var s=ho;ho=null,nr=0,sr=null;for(var i=0;i<s.length;i++)(0,s[i])()}}function J1(s,i){var l=[],d={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return s.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 sy=H.S;H.S=function(s,i){I0=Ye(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Y1(s,i),sy!==null&&sy(s,i)};var na=R(null);function rf(){var s=na.current;return s!==null?s:pt.pooledCache}function Vl(s,i){i===null?re(na,na.current):re(na,i.pool)}function iy(){var s=rf();return s===null?null:{parent:It._currentValue,pool:s}}var ir=Error(a(460)),of=Error(a(474)),Ql=Error(a(542)),Yl={then:function(){}};function ay(s){return s=s.status,s==="fulfilled"||s==="rejected"}function ry(s,i,l){switch(l=s[l],l===void 0?s.push(i):l!==i&&(i.then(_s,_s),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,ly(s),s;default:if(typeof i.status=="string")i.then(_s,_s);else{if(s=pt,s!==null&&100<s.shellSuspendCounter)throw Error(a(482));s=i,s.status="pending",s.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 s=i.reason,ly(s),s}throw ia=i,ir}}function sa(s){try{var i=s._init;return i(s._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ia=l,ir):l}}var ia=null;function oy(){if(ia===null)throw Error(a(459));var s=ia;return ia=null,s}function ly(s){if(s===ir||s===Ql)throw Error(a(483))}var ar=null,mo=0;function Jl(s){var i=mo;return mo+=1,ar===null&&(ar=[]),ry(ar,s,i)}function po(s,i){i=i.props.ref,s.ref=i!==void 0?i:null}function Xl(s,i){throw i.$$typeof===b?Error(a(525)):(s=Object.prototype.toString.call(i),Error(a(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)))}function cy(s){function i(q,U){if(s){var G=q.deletions;G===null?(q.deletions=[U],q.flags|=16):G.push(U)}}function l(q,U){if(!s)return null;for(;U!==null;)i(q,U),U=U.sibling;return null}function d(q){for(var U=new Map;q!==null;)q.key!==null?U.set(q.key,q):U.set(q.index,q),q=q.sibling;return U}function h(q,U){return q=Ts(q,U),q.index=0,q.sibling=null,q}function g(q,U,G){return q.index=G,s?(G=q.alternate,G!==null?(G=G.index,G<U?(q.flags|=67108866,U):G):(q.flags|=67108866,U)):(q.flags|=1048576,U)}function j(q){return s&&q.alternate===null&&(q.flags|=67108866),q}function _(q,U,G,ee){return U===null||U.tag!==6?(U=Vd(G,q.mode,ee),U.return=q,U):(U=h(U,G),U.return=q,U)}function D(q,U,G,ee){var ze=G.type;return ze===S?X(q,U,G.props.children,ee,G.key):U!==null&&(U.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===O&&sa(ze)===U.type)?(U=h(U,G.props),po(U,G),U.return=q,U):(U=Hl(G.type,G.key,G.props,null,q.mode,ee),po(U,G),U.return=q,U)}function F(q,U,G,ee){return U===null||U.tag!==4||U.stateNode.containerInfo!==G.containerInfo||U.stateNode.implementation!==G.implementation?(U=Qd(G,q.mode,ee),U.return=q,U):(U=h(U,G.children||[]),U.return=q,U)}function X(q,U,G,ee,ze){return U===null||U.tag!==7?(U=Xi(G,q.mode,ee,ze),U.return=q,U):(U=h(U,G),U.return=q,U)}function ie(q,U,G){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Vd(""+U,q.mode,G),U.return=q,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case x:return G=Hl(U.type,U.key,U.props,null,q.mode,G),po(G,U),G.return=q,G;case N:return U=Qd(U,q.mode,G),U.return=q,U;case O:return U=sa(U),ie(q,U,G)}if(xe(U)||ne(U))return U=Xi(U,q.mode,G,null),U.return=q,U;if(typeof U.then=="function")return ie(q,Jl(U),G);if(U.$$typeof===T)return ie(q,Zl(q,U),G);Xl(q,U)}return null}function Q(q,U,G,ee){var ze=U!==null?U.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return ze!==null?null:_(q,U,""+G,ee);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return G.key===ze?D(q,U,G,ee):null;case N:return G.key===ze?F(q,U,G,ee):null;case O:return G=sa(G),Q(q,U,G,ee)}if(xe(G)||ne(G))return ze!==null?null:X(q,U,G,ee,null);if(typeof G.then=="function")return Q(q,U,Jl(G),ee);if(G.$$typeof===T)return Q(q,U,Zl(q,G),ee);Xl(q,G)}return null}function Y(q,U,G,ee,ze){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return q=q.get(G)||null,_(U,q,""+ee,ze);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:return q=q.get(ee.key===null?G:ee.key)||null,D(U,q,ee,ze);case N:return q=q.get(ee.key===null?G:ee.key)||null,F(U,q,ee,ze);case O:return ee=sa(ee),Y(q,U,G,ee,ze)}if(xe(ee)||ne(ee))return q=q.get(G)||null,X(U,q,ee,ze,null);if(typeof ee.then=="function")return Y(q,U,G,Jl(ee),ze);if(ee.$$typeof===T)return Y(q,U,G,Zl(U,ee),ze);Xl(U,ee)}return null}function Se(q,U,G,ee){for(var ze=null,et=null,Ce=U,$e=U=0,Fe=null;Ce!==null&&$e<G.length;$e++){Ce.index>$e?(Fe=Ce,Ce=null):Fe=Ce.sibling;var tt=Q(q,Ce,G[$e],ee);if(tt===null){Ce===null&&(Ce=Fe);break}s&&Ce&&tt.alternate===null&&i(q,Ce),U=g(tt,U,$e),et===null?ze=tt:et.sibling=tt,et=tt,Ce=Fe}if($e===G.length)return l(q,Ce),Je&&As(q,$e),ze;if(Ce===null){for(;$e<G.length;$e++)Ce=ie(q,G[$e],ee),Ce!==null&&(U=g(Ce,U,$e),et===null?ze=Ce:et.sibling=Ce,et=Ce);return Je&&As(q,$e),ze}for(Ce=d(Ce);$e<G.length;$e++)Fe=Y(Ce,q,$e,G[$e],ee),Fe!==null&&(s&&Fe.alternate!==null&&Ce.delete(Fe.key===null?$e:Fe.key),U=g(Fe,U,$e),et===null?ze=Fe:et.sibling=Fe,et=Fe);return s&&Ce.forEach(function(ji){return i(q,ji)}),Je&&As(q,$e),ze}function Te(q,U,G,ee){if(G==null)throw Error(a(151));for(var ze=null,et=null,Ce=U,$e=U=0,Fe=null,tt=G.next();Ce!==null&&!tt.done;$e++,tt=G.next()){Ce.index>$e?(Fe=Ce,Ce=null):Fe=Ce.sibling;var ji=Q(q,Ce,tt.value,ee);if(ji===null){Ce===null&&(Ce=Fe);break}s&&Ce&&ji.alternate===null&&i(q,Ce),U=g(ji,U,$e),et===null?ze=ji:et.sibling=ji,et=ji,Ce=Fe}if(tt.done)return l(q,Ce),Je&&As(q,$e),ze;if(Ce===null){for(;!tt.done;$e++,tt=G.next())tt=ie(q,tt.value,ee),tt!==null&&(U=g(tt,U,$e),et===null?ze=tt:et.sibling=tt,et=tt);return Je&&As(q,$e),ze}for(Ce=d(Ce);!tt.done;$e++,tt=G.next())tt=Y(Ce,q,$e,tt.value,ee),tt!==null&&(s&&tt.alternate!==null&&Ce.delete(tt.key===null?$e:tt.key),U=g(tt,U,$e),et===null?ze=tt:et.sibling=tt,et=tt);return s&&Ce.forEach(function(lk){return i(q,lk)}),Je&&As(q,$e),ze}function ht(q,U,G,ee){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 x:e:{for(var ze=G.key;U!==null;){if(U.key===ze){if(ze=G.type,ze===S){if(U.tag===7){l(q,U.sibling),ee=h(U,G.props.children),ee.return=q,q=ee;break e}}else if(U.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===O&&sa(ze)===U.type){l(q,U.sibling),ee=h(U,G.props),po(ee,G),ee.return=q,q=ee;break e}l(q,U);break}else i(q,U);U=U.sibling}G.type===S?(ee=Xi(G.props.children,q.mode,ee,G.key),ee.return=q,q=ee):(ee=Hl(G.type,G.key,G.props,null,q.mode,ee),po(ee,G),ee.return=q,q=ee)}return j(q);case N:e:{for(ze=G.key;U!==null;){if(U.key===ze)if(U.tag===4&&U.stateNode.containerInfo===G.containerInfo&&U.stateNode.implementation===G.implementation){l(q,U.sibling),ee=h(U,G.children||[]),ee.return=q,q=ee;break e}else{l(q,U);break}else i(q,U);U=U.sibling}ee=Qd(G,q.mode,ee),ee.return=q,q=ee}return j(q);case O:return G=sa(G),ht(q,U,G,ee)}if(xe(G))return Se(q,U,G,ee);if(ne(G)){if(ze=ne(G),typeof ze!="function")throw Error(a(150));return G=ze.call(G),Te(q,U,G,ee)}if(typeof G.then=="function")return ht(q,U,Jl(G),ee);if(G.$$typeof===T)return ht(q,U,Zl(q,G),ee);Xl(q,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,U!==null&&U.tag===6?(l(q,U.sibling),ee=h(U,G),ee.return=q,q=ee):(l(q,U),ee=Vd(G,q.mode,ee),ee.return=q,q=ee),j(q)):l(q,U)}return function(q,U,G,ee){try{mo=0;var ze=ht(q,U,G,ee);return ar=null,ze}catch(Ce){if(Ce===ir||Ce===Ql)throw Ce;var et=Tn(29,Ce,null,q.mode);return et.lanes=ee,et.return=q,et}}}var aa=cy(!0),uy=cy(!1),ai=!1;function lf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cf(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function ri(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function oi(s,i,l){var d=s.updateQueue;if(d===null)return null;if(d=d.shared,(nt&2)!==0){var h=d.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),d.pending=i,i=Kl(s),Zg(s,null,l),i}return ql(s,d,i,l),Kl(s)}function go(s,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var d=i.lanes;d&=s.pendingLanes,l|=d,i.lanes=l,me(s,l)}}function uf(s,i){var l=s.updateQueue,d=s.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},s.updateQueue=l;return}s=l.lastBaseUpdate,s===null?l.firstBaseUpdate=i:s.next=i,l.lastBaseUpdate=i}var df=!1;function yo(){if(df){var s=sr;if(s!==null)throw s}}function vo(s,i,l,d){df=!1;var h=s.updateQueue;ai=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var D=_,F=D.next;D.next=null,j===null?g=F:j.next=F,j=D;var X=s.alternate;X!==null&&(X=X.updateQueue,_=X.lastBaseUpdate,_!==j&&(_===null?X.firstBaseUpdate=F:_.next=F,X.lastBaseUpdate=D))}if(g!==null){var ie=h.baseState;j=0,X=F=D=null,_=g;do{var Q=_.lane&-536870913,Y=Q!==_.lane;if(Y?(Ge&Q)===Q:(d&Q)===Q){Q!==0&&Q===nr&&(df=!0),X!==null&&(X=X.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Se=s,Te=_;Q=i;var ht=l;switch(Te.tag){case 1:if(Se=Te.payload,typeof Se=="function"){ie=Se.call(ht,ie,Q);break e}ie=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Te.payload,Q=typeof Se=="function"?Se.call(ht,ie,Q):Se,Q==null)break e;ie=y({},ie,Q);break e;case 2:ai=!0}}Q=_.callback,Q!==null&&(s.flags|=64,Y&&(s.flags|=8192),Y=h.callbacks,Y===null?h.callbacks=[Q]:Y.push(Q))}else Y={lane:Q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},X===null?(F=X=Y,D=ie):X=X.next=Y,j|=Q;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;Y=_,_=Y.next,Y.next=null,h.lastBaseUpdate=Y,h.shared.pending=null}}while(!0);X===null&&(D=ie),h.baseState=D,h.firstBaseUpdate=F,h.lastBaseUpdate=X,g===null&&(h.shared.lanes=0),fi|=j,s.lanes=j,s.memoizedState=ie}}function dy(s,i){if(typeof s!="function")throw Error(a(191,s));s.call(i)}function fy(s,i){var l=s.callbacks;if(l!==null)for(s.callbacks=null,s=0;s<l.length;s++)dy(l[s],i)}var rr=R(null),Wl=R(0);function hy(s,i){s=qs,re(Wl,s),re(rr,i),qs=s|i.baseLanes}function ff(){re(Wl,qs),re(rr,rr.current)}function hf(){qs=Wl.current,B(rr),B(Wl)}var An=R(null),Hn=null;function li(s){var i=s.alternate;re(Lt,Lt.current&1),re(An,s),Hn===null&&(i===null||rr.current!==null||i.memoizedState!==null)&&(Hn=s)}function mf(s){re(Lt,Lt.current),re(An,s),Hn===null&&(Hn=s)}function my(s){s.tag===22?(re(Lt,Lt.current),re(An,s),Hn===null&&(Hn=s)):ci()}function ci(){re(Lt,Lt.current),re(An,An.current)}function Rn(s){B(An),Hn===s&&(Hn=null),B(Lt)}var Lt=R(0);function ec(s){for(var i=s;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||xh(l)||Sh(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===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Ls=0,De=null,dt=null,Bt=null,tc=!1,or=!1,ra=!1,nc=0,bo=0,lr=null,X1=0;function At(){throw Error(a(321))}function pf(s,i){if(i===null)return!1;for(var l=0;l<i.length&&l<s.length;l++)if(!En(s[l],i[l]))return!1;return!0}function gf(s,i,l,d,h,g){return Ls=g,De=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=s===null||s.memoizedState===null?Jy:Af,ra=!1,g=l(d,h),ra=!1,or&&(g=gy(i,l,d,h)),py(s),g}function py(s){H.H=jo;var i=dt!==null&&dt.next!==null;if(Ls=0,Bt=dt=De=null,tc=!1,bo=0,lr=null,i)throw Error(a(300));s===null||qt||(s=s.dependencies,s!==null&&Fl(s)&&(qt=!0))}function gy(s,i,l,d){De=s;var h=0;do{if(or&&(lr=null),bo=0,or=!1,25<=h)throw Error(a(301));if(h+=1,Bt=dt=null,s.updateQueue!=null){var g=s.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}H.H=Xy,g=i(l,d)}while(or);return g}function W1(){var s=H.H,i=s.useState()[0];return i=typeof i.then=="function"?xo(i):i,s=s.useState()[0],(dt!==null?dt.memoizedState:null)!==s&&(De.flags|=1024),i}function yf(){var s=nc!==0;return nc=0,s}function vf(s,i,l){i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~l}function bf(s){if(tc){for(s=s.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}tc=!1}Ls=0,Bt=dt=De=null,or=!1,bo=nc=0,lr=null}function un(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bt===null?De.memoizedState=Bt=s:Bt=Bt.next=s,Bt}function Dt(){if(dt===null){var s=De.alternate;s=s!==null?s.memoizedState:null}else s=dt.next;var i=Bt===null?De.memoizedState:Bt.next;if(i!==null)Bt=i,dt=s;else{if(s===null)throw De.alternate===null?Error(a(467)):Error(a(310));dt=s,s={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Bt===null?De.memoizedState=Bt=s:Bt=Bt.next=s}return Bt}function sc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(s){var i=bo;return bo+=1,lr===null&&(lr=[]),s=ry(lr,s,i),i=De,(Bt===null?i.memoizedState:Bt.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?Jy:Af),s}function ic(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return xo(s);if(s.$$typeof===T)return Xt(s)}throw Error(a(438,String(s)))}function xf(s){var i=null,l=De.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=De.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=sc(),De.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(s),d=0;d<s;d++)l[d]=W;return i.index++,l}function Ds(s,i){return typeof i=="function"?i(s):i}function ac(s){var i=Dt();return Sf(i,dt,s)}function Sf(s,i,l){var d=s.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=l;var h=s.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=s.baseState,h===null)s.memoizedState=g;else{i=h.next;var _=j=null,D=null,F=i,X=!1;do{var ie=F.lane&-536870913;if(ie!==F.lane?(Ge&ie)===ie:(Ls&ie)===ie){var Q=F.revertLane;if(Q===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),ie===nr&&(X=!0);else if((Ls&Q)===Q){F=F.next,Q===nr&&(X=!0);continue}else ie={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=ie,j=g):D=D.next=ie,De.lanes|=Q,fi|=Q;ie=F.action,ra&&l(g,ie),g=F.hasEagerState?F.eagerState:l(g,ie)}else Q={lane:ie,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},D===null?(_=D=Q,j=g):D=D.next=Q,De.lanes|=ie,fi|=ie;F=F.next}while(F!==null&&F!==i);if(D===null?j=g:D.next=_,!En(g,s.memoizedState)&&(qt=!0,X&&(l=sr,l!==null)))throw l;s.memoizedState=g,s.baseState=j,s.baseQueue=D,d.lastRenderedState=g}return h===null&&(d.lanes=0),[s.memoizedState,d.dispatch]}function jf(s){var i=Dt(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var d=l.dispatch,h=l.pending,g=i.memoizedState;if(h!==null){l.pending=null;var j=h=h.next;do g=s(g,j.action),j=j.next;while(j!==h);En(g,i.memoizedState)||(qt=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,d]}function yy(s,i,l){var d=De,h=Dt(),g=Je;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var j=!En((dt||h).memoizedState,l);if(j&&(h.memoizedState=l,qt=!0),h=h.queue,Cf(xy.bind(null,d,h,s),[s]),h.getSnapshot!==i||j||Bt!==null&&Bt.memoizedState.tag&1){if(d.flags|=2048,cr(9,{destroy:void 0},by.bind(null,d,h,l,i),null),pt===null)throw Error(a(349));g||(Ls&127)!==0||vy(d,i,l)}return l}function vy(s,i,l){s.flags|=16384,s={getSnapshot:i,value:l},i=De.updateQueue,i===null?(i=sc(),De.updateQueue=i,i.stores=[s]):(l=i.stores,l===null?i.stores=[s]:l.push(s))}function by(s,i,l,d){i.value=l,i.getSnapshot=d,Sy(i)&&jy(s)}function xy(s,i,l){return l(function(){Sy(i)&&jy(s)})}function Sy(s){var i=s.getSnapshot;s=s.value;try{var l=i();return!En(s,l)}catch{return!0}}function jy(s){var i=Ji(s,2);i!==null&&wn(i,s,2)}function wf(s){var i=un();if(typeof s=="function"){var l=s;if(s=l(),ra){yn(!0);try{l()}finally{yn(!1)}}}return i.memoizedState=i.baseState=s,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:s},i}function wy(s,i,l,d){return s.baseState=l,Sf(s,dt,typeof d=="function"?d:Ds)}function eC(s,i,l,d,h){if(lc(s))throw Error(a(485));if(s=i.action,s!==null){var g={payload:h,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};H.T!==null?l(!0):g.isTransition=!1,d(g),l=i.pending,l===null?(g.next=i.pending=g,Ny(i,g)):(g.next=l.next,i.pending=l.next=g)}}function Ny(s,i){var l=i.action,d=i.payload,h=s.state;if(i.isTransition){var g=H.T,j={};H.T=j;try{var _=l(h,d),D=H.S;D!==null&&D(j,_),Cy(s,i,_)}catch(F){Nf(s,i,F)}finally{g!==null&&j.types!==null&&(g.types=j.types),H.T=g}}else try{g=l(h,d),Cy(s,i,g)}catch(F){Nf(s,i,F)}}function Cy(s,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){ky(s,i,d)},function(d){return Nf(s,i,d)}):ky(s,i,l)}function ky(s,i,l){i.status="fulfilled",i.value=l,zy(i),s.state=l,i=s.pending,i!==null&&(l=i.next,l===i?s.pending=null:(l=l.next,i.next=l,Ny(s,l)))}function Nf(s,i,l){var d=s.pending;if(s.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,zy(i),i=i.next;while(i!==d)}s.action=null}function zy(s){s=s.listeners;for(var i=0;i<s.length;i++)(0,s[i])()}function _y(s,i){return i}function Ey(s,i){if(Je){var l=pt.formState;if(l!==null){e:{var d=De;if(Je){if(yt){t:{for(var h=yt,g=Kn;h.nodeType!==8;){if(!g){h=null;break t}if(h=Gn(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){yt=Gn(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:_y,lastRenderedState:i},l.queue=d,l=Vy.bind(null,De,d),d.dispatch=l,d=wf(!1),g=Tf.bind(null,De,!1,d.queue),d=un(),h={state:i,dispatch:null,action:s,pending:null},d.queue=h,l=eC.bind(null,De,h,g,l),h.dispatch=l,d.memoizedState=s,[i,l,!1]}function Ty(s){var i=Dt();return Ay(i,dt,s)}function Ay(s,i,l){if(i=Sf(s,i,_y)[0],s=ac(Ds)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=xo(i)}catch(j){throw j===ir?Ql:j}else d=i;i=Dt();var h=i.queue,g=h.dispatch;return l!==i.memoizedState&&(De.flags|=2048,cr(9,{destroy:void 0},tC.bind(null,h,l),null)),[d,g,s]}function tC(s,i){s.action=i}function Ry(s){var i=Dt(),l=dt;if(l!==null)return Ay(i,l,s);Dt(),i=i.memoizedState,l=Dt();var d=l.queue.dispatch;return l.memoizedState=s,[i,d,!1]}function cr(s,i,l,d){return s={tag:s,create:l,deps:d,inst:i,next:null},i=De.updateQueue,i===null&&(i=sc(),De.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=s.next=s:(d=l.next,l.next=s,s.next=d,i.lastEffect=s),s}function Oy(){return Dt().memoizedState}function rc(s,i,l,d){var h=un();De.flags|=s,h.memoizedState=cr(1|i,{destroy:void 0},l,d===void 0?null:d)}function oc(s,i,l,d){var h=Dt();d=d===void 0?null:d;var g=h.memoizedState.inst;dt!==null&&d!==null&&pf(d,dt.memoizedState.deps)?h.memoizedState=cr(i,g,l,d):(De.flags|=s,h.memoizedState=cr(1|i,g,l,d))}function Ly(s,i){rc(8390656,8,s,i)}function Cf(s,i){oc(2048,8,s,i)}function nC(s){De.flags|=4;var i=De.updateQueue;if(i===null)i=sc(),De.updateQueue=i,i.events=[s];else{var l=i.events;l===null?i.events=[s]:l.push(s)}}function Dy(s){var i=Dt().memoizedState;return nC({ref:i,nextImpl:s}),function(){if((nt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function My(s,i){return oc(4,2,s,i)}function $y(s,i){return oc(4,4,s,i)}function Py(s,i){if(typeof i=="function"){s=s();var l=i(s);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function Uy(s,i,l){l=l!=null?l.concat([s]):null,oc(4,4,Py.bind(null,i,s),l)}function kf(){}function Iy(s,i){var l=Dt();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&pf(i,d[1])?d[0]:(l.memoizedState=[s,i],s)}function By(s,i){var l=Dt();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&pf(i,d[1]))return d[0];if(d=s(),ra){yn(!0);try{s()}finally{yn(!1)}}return l.memoizedState=[d,i],d}function zf(s,i,l){return l===void 0||(Ls&1073741824)!==0&&(Ge&261930)===0?s.memoizedState=i:(s.memoizedState=l,s=q0(),De.lanes|=s,fi|=s,l)}function qy(s,i,l,d){return En(l,i)?l:rr.current!==null?(s=zf(s,l,d),En(s,i)||(qt=!0),s):(Ls&42)===0||(Ls&1073741824)!==0&&(Ge&261930)===0?(qt=!0,s.memoizedState=l):(s=q0(),De.lanes|=s,fi|=s,i)}function Ky(s,i,l,d,h){var g=ae.p;ae.p=g!==0&&8>g?g:8;var j=H.T,_={};H.T=_,Tf(s,!1,i,l);try{var D=h(),F=H.S;if(F!==null&&F(_,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var X=J1(D,d);So(s,i,X,Dn(s))}else So(s,i,d,Dn(s))}catch(ie){So(s,i,{then:function(){},status:"rejected",reason:ie},Dn())}finally{ae.p=g,j!==null&&_.types!==null&&(j.types=_.types),H.T=j}}function sC(){}function _f(s,i,l,d){if(s.tag!==5)throw Error(a(476));var h=Hy(s).queue;Ky(s,h,i,pe,l===null?sC:function(){return Gy(s),l(d)})}function Hy(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ds,lastRenderedState:pe},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},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function Gy(s){var i=Hy(s);i.next===null&&(i=s.alternate.memoizedState),So(s,i.next.queue,{},Dn())}function Ef(){return Xt(Po)}function Fy(){return Dt().memoizedState}function Zy(){return Dt().memoizedState}function iC(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var l=Dn();s=ri(l);var d=oi(i,s,l);d!==null&&(wn(d,i,l),go(d,i,l)),i={cache:sf()},s.payload=i;return}i=i.return}}function aC(s,i,l){var d=Dn();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},lc(s)?Qy(i,l):(l=Fd(s,i,l,d),l!==null&&(wn(l,s,d),Yy(l,i,d)))}function Vy(s,i,l){var d=Dn();So(s,i,l,d)}function So(s,i,l,d){var h={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(lc(s))Qy(i,h);else{var g=s.alternate;if(s.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=_,En(_,j))return ql(s,i,h,0),pt===null&&Bl(),!1}catch{}if(l=Fd(s,i,h,d),l!==null)return wn(l,s,d),Yy(l,i,d),!0}return!1}function Tf(s,i,l,d){if(d={lane:2,revertLane:lh(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},lc(s)){if(i)throw Error(a(479))}else i=Fd(s,l,d,2),i!==null&&wn(i,s,2)}function lc(s){var i=s.alternate;return s===De||i!==null&&i===De}function Qy(s,i){or=tc=!0;var l=s.pending;l===null?i.next=i:(i.next=l.next,l.next=i),s.pending=i}function Yy(s,i,l){if((l&4194048)!==0){var d=i.lanes;d&=s.pendingLanes,l|=d,i.lanes=l,me(s,l)}}var jo={readContext:Xt,use:ic,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};jo.useEffectEvent=At;var Jy={readContext:Xt,use:ic,useCallback:function(s,i){return un().memoizedState=[s,i===void 0?null:i],s},useContext:Xt,useEffect:Ly,useImperativeHandle:function(s,i,l){l=l!=null?l.concat([s]):null,rc(4194308,4,Py.bind(null,i,s),l)},useLayoutEffect:function(s,i){return rc(4194308,4,s,i)},useInsertionEffect:function(s,i){rc(4,2,s,i)},useMemo:function(s,i){var l=un();i=i===void 0?null:i;var d=s();if(ra){yn(!0);try{s()}finally{yn(!1)}}return l.memoizedState=[d,i],d},useReducer:function(s,i,l){var d=un();if(l!==void 0){var h=l(i);if(ra){yn(!0);try{l(i)}finally{yn(!1)}}}else h=i;return d.memoizedState=d.baseState=h,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:h},d.queue=s,s=s.dispatch=aC.bind(null,De,s),[d.memoizedState,s]},useRef:function(s){var i=un();return s={current:s},i.memoizedState=s},useState:function(s){s=wf(s);var i=s.queue,l=Vy.bind(null,De,i);return i.dispatch=l,[s.memoizedState,l]},useDebugValue:kf,useDeferredValue:function(s,i){var l=un();return zf(l,s,i)},useTransition:function(){var s=wf(!1);return s=Ky.bind(null,De,s.queue,!0,!1),un().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,l){var d=De,h=un();if(Je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),pt===null)throw Error(a(349));(Ge&127)!==0||vy(d,i,l)}h.memoizedState=l;var g={value:l,getSnapshot:i};return h.queue=g,Ly(xy.bind(null,d,g,s),[s]),d.flags|=2048,cr(9,{destroy:void 0},by.bind(null,d,g,l,i),null),l},useId:function(){var s=un(),i=pt.identifierPrefix;if(Je){var l=bs,d=vs;l=(d&~(1<<32-ue(d)-1)).toString(32)+l,i="_"+i+"R_"+l,l=nc++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=X1++,i="_"+i+"r_"+l.toString(32)+"_";return s.memoizedState=i},useHostTransitionStatus:Ef,useFormState:Ey,useActionState:Ey,useOptimistic:function(s){var i=un();i.memoizedState=i.baseState=s;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Tf.bind(null,De,!0,l),l.dispatch=i,[s,i]},useMemoCache:xf,useCacheRefresh:function(){return un().memoizedState=iC.bind(null,De)},useEffectEvent:function(s){var i=un(),l={impl:s};return i.memoizedState=l,function(){if((nt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Af={readContext:Xt,use:ic,useCallback:Iy,useContext:Xt,useEffect:Cf,useImperativeHandle:Uy,useInsertionEffect:My,useLayoutEffect:$y,useMemo:By,useReducer:ac,useRef:Oy,useState:function(){return ac(Ds)},useDebugValue:kf,useDeferredValue:function(s,i){var l=Dt();return qy(l,dt.memoizedState,s,i)},useTransition:function(){var s=ac(Ds)[0],i=Dt().memoizedState;return[typeof s=="boolean"?s:xo(s),i]},useSyncExternalStore:yy,useId:Fy,useHostTransitionStatus:Ef,useFormState:Ty,useActionState:Ty,useOptimistic:function(s,i){var l=Dt();return wy(l,dt,s,i)},useMemoCache:xf,useCacheRefresh:Zy};Af.useEffectEvent=Dy;var Xy={readContext:Xt,use:ic,useCallback:Iy,useContext:Xt,useEffect:Cf,useImperativeHandle:Uy,useInsertionEffect:My,useLayoutEffect:$y,useMemo:By,useReducer:jf,useRef:Oy,useState:function(){return jf(Ds)},useDebugValue:kf,useDeferredValue:function(s,i){var l=Dt();return dt===null?zf(l,s,i):qy(l,dt.memoizedState,s,i)},useTransition:function(){var s=jf(Ds)[0],i=Dt().memoizedState;return[typeof s=="boolean"?s:xo(s),i]},useSyncExternalStore:yy,useId:Fy,useHostTransitionStatus:Ef,useFormState:Ry,useActionState:Ry,useOptimistic:function(s,i){var l=Dt();return dt!==null?wy(l,dt,s,i):(l.baseState=s,[s,l.queue.dispatch])},useMemoCache:xf,useCacheRefresh:Zy};Xy.useEffectEvent=Dy;function Rf(s,i,l,d){i=s.memoizedState,l=l(d,i),l=l==null?i:y({},i,l),s.memoizedState=l,s.lanes===0&&(s.updateQueue.baseState=l)}var Of={enqueueSetState:function(s,i,l){s=s._reactInternals;var d=Dn(),h=ri(d);h.payload=i,l!=null&&(h.callback=l),i=oi(s,h,d),i!==null&&(wn(i,s,d),go(i,s,d))},enqueueReplaceState:function(s,i,l){s=s._reactInternals;var d=Dn(),h=ri(d);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=oi(s,h,d),i!==null&&(wn(i,s,d),go(i,s,d))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var l=Dn(),d=ri(l);d.tag=2,i!=null&&(d.callback=i),i=oi(s,d,l),i!==null&&(wn(i,s,l),go(i,s,l))}};function Wy(s,i,l,d,h,g,j){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(d,g,j):i.prototype&&i.prototype.isPureReactComponent?!oo(l,d)||!oo(h,g):!0}function e0(s,i,l,d){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==s&&Of.enqueueReplaceState(i,i.state,null)}function oa(s,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}if(s=s.defaultProps){l===i&&(l=y({},l));for(var h in s)l[h]===void 0&&(l[h]=s[h])}return l}function t0(s){Il(s)}function n0(s){console.error(s)}function s0(s){Il(s)}function cc(s,i){try{var l=s.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function i0(s,i,l){try{var d=s.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Lf(s,i,l){return l=ri(l),l.tag=3,l.payload={element:null},l.callback=function(){cc(s,i)},l}function a0(s){return s=ri(s),s.tag=3,s}function r0(s,i,l,d){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var g=d.value;s.payload=function(){return h(g)},s.callback=function(){i0(i,l,d)}}var j=l.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(s.callback=function(){i0(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 rC(s,i,l,d,h){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&tr(i,l,h,!0),l=An.current,l!==null){switch(l.tag){case 31:case 13:return Hn===null?Sc():l.alternate===null&&Rt===0&&(Rt=3),l.flags&=-257,l.flags|=65536,l.lanes=h,d===Yl?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),ah(s,d,h)),!1;case 22:return l.flags|=65536,d===Yl?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)),ah(s,d,h)),!1}throw Error(a(435,l.tag))}return ah(s,d,h),Sc(),!1}if(Je)return i=An.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,d!==Xd&&(s=Error(a(422),{cause:d}),uo(In(s,l)))):(d!==Xd&&(i=Error(a(423),{cause:d}),uo(In(i,l))),s=s.current.alternate,s.flags|=65536,h&=-h,s.lanes|=h,d=In(d,l),h=Lf(s.stateNode,d,h),uf(s,h),Rt!==4&&(Rt=2)),!1;var g=Error(a(520),{cause:d});if(g=In(g,l),To===null?To=[g]:To.push(g),Rt!==4&&(Rt=2),i===null)return!0;d=In(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,s=h&-h,l.lanes|=s,s=Lf(l.stateNode,d,s),uf(l,s),!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=a0(h),r0(h,s,l,d),uf(l,h),!1}l=l.return}while(l!==null);return!1}var Df=Error(a(461)),qt=!1;function Wt(s,i,l,d){i.child=s===null?uy(i,null,l,d):aa(i,s.child,l,d)}function o0(s,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 ta(i),d=gf(s,i,l,j,g,h),_=yf(),s!==null&&!qt?(vf(s,i,h),Ms(s,i,h)):(Je&&_&&Yd(i),i.flags|=1,Wt(s,i,d,h),i.child)}function l0(s,i,l,d,h){if(s===null){var g=l.type;return typeof g=="function"&&!Zd(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,c0(s,i,g,d,h)):(s=Hl(l.type,null,d,i,i.mode,h),s.ref=i.ref,s.return=i,i.child=s)}if(g=s.child,!Kf(s,h)){var j=g.memoizedProps;if(l=l.compare,l=l!==null?l:oo,l(j,d)&&s.ref===i.ref)return Ms(s,i,h)}return i.flags|=1,s=Ts(g,d),s.ref=i.ref,s.return=i,i.child=s}function c0(s,i,l,d,h){if(s!==null){var g=s.memoizedProps;if(oo(g,d)&&s.ref===i.ref)if(qt=!1,i.pendingProps=d=g,Kf(s,h))(s.flags&131072)!==0&&(qt=!0);else return i.lanes=s.lanes,Ms(s,i,h)}return Mf(s,i,l,d,h)}function u0(s,i,l,d){var h=d.children,g=s!==null?s.memoizedState:null;if(s===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,s!==null){for(d=i.child=s.child,h=0;d!==null;)h=h|d.lanes|d.childLanes,d=d.sibling;d=h&~g}else d=0,i.child=null;return d0(s,i,g,l,d)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},s!==null&&Vl(i,g!==null?g.cachePool:null),g!==null?hy(i,g):ff(),my(i);else return d=i.lanes=536870912,d0(s,i,g!==null?g.baseLanes|l:l,l,d)}else g!==null?(Vl(i,g.cachePool),hy(i,g),ci(),i.memoizedState=null):(s!==null&&Vl(i,null),ff(),ci());return Wt(s,i,h,l),i.child}function wo(s,i){return s!==null&&s.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function d0(s,i,l,d,h){var g=rf();return g=g===null?null:{parent:It._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},s!==null&&Vl(i,null),ff(),my(i),s!==null&&tr(s,i,d,!0),i.childLanes=h,null}function uc(s,i){return i=fc({mode:i.mode,children:i.children},s.mode),i.ref=s.ref,s.child=i,i.return=s,i}function f0(s,i,l){return aa(i,s.child,null,l),s=uc(i,i.pendingProps),s.flags|=2,Rn(i),i.memoizedState=null,s}function oC(s,i,l){var d=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,s===null){if(Je){if(d.mode==="hidden")return s=uc(i,d),i.lanes=536870912,wo(null,s);if(mf(i),(s=yt)?(s=Nv(s,Kn),s=s!==null&&s.data==="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:ti!==null?{id:vs,overflow:bs}:null,retryLane:536870912,hydrationErrors:null},l=Qg(s),l.return=i,i.child=l,Jt=i,yt=null)):s=null,s===null)throw si(i);return i.lanes=536870912,null}return uc(i,d)}var g=s.memoizedState;if(g!==null){var j=g.dehydrated;if(mf(i),h)if(i.flags&256)i.flags&=-257,i=f0(s,i,l);else if(i.memoizedState!==null)i.child=s.child,i.flags|=128,i=null;else throw Error(a(558));else if(qt||tr(s,i,l,!1),h=(l&s.childLanes)!==0,qt||h){if(d=pt,d!==null&&(j=bt(d,l),j!==0&&j!==g.retryLane))throw g.retryLane=j,Ji(s,j),wn(d,s,j),Df;Sc(),i=f0(s,i,l)}else s=g.treeContext,yt=Gn(j.nextSibling),Jt=i,Je=!0,ni=null,Kn=!1,s!==null&&Xg(i,s),i=uc(i,d),i.flags|=4096;return i}return s=Ts(s.child,{mode:d.mode,children:d.children}),s.ref=i.ref,i.child=s,s.return=i,s}function dc(s,i){var l=i.ref;if(l===null)s!==null&&s.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(s===null||s.ref!==l)&&(i.flags|=4194816)}}function Mf(s,i,l,d,h){return ta(i),l=gf(s,i,l,d,void 0,h),d=yf(),s!==null&&!qt?(vf(s,i,h),Ms(s,i,h)):(Je&&d&&Yd(i),i.flags|=1,Wt(s,i,l,h),i.child)}function h0(s,i,l,d,h,g){return ta(i),i.updateQueue=null,l=gy(i,d,l,h),py(s),d=yf(),s!==null&&!qt?(vf(s,i,g),Ms(s,i,g)):(Je&&d&&Yd(i),i.flags|=1,Wt(s,i,l,g),i.child)}function m0(s,i,l,d,h){if(ta(i),i.stateNode===null){var g=Ja,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=Of,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=d,g.state=i.memoizedState,g.refs={},lf(i),j=l.contextType,g.context=typeof j=="object"&&j!==null?Xt(j):Ja,g.state=i.memoizedState,j=l.getDerivedStateFromProps,typeof j=="function"&&(Rf(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&&Of.enqueueReplaceState(g,g.state,null),vo(i,d,g,h),yo(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(s===null){g=i.stateNode;var _=i.memoizedProps,D=oa(l,_);g.props=D;var F=g.context,X=l.contextType;j=Ja,typeof X=="object"&&X!==null&&(j=Xt(X));var ie=l.getDerivedStateFromProps;X=typeof ie=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,X||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||F!==j)&&e0(i,g,d,j),ai=!1;var Q=i.memoizedState;g.state=Q,vo(i,d,g,h),yo(),F=i.memoizedState,_||Q!==F||ai?(typeof ie=="function"&&(Rf(i,l,ie,d),F=i.memoizedState),(D=ai||Wy(i,l,D,d,Q,F,j))?(X||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=D):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{g=i.stateNode,cf(s,i),j=i.memoizedProps,X=oa(l,j),g.props=X,ie=i.pendingProps,Q=g.context,F=l.contextType,D=Ja,typeof F=="object"&&F!==null&&(D=Xt(F)),_=l.getDerivedStateFromProps,(F=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ie||Q!==D)&&e0(i,g,d,D),ai=!1,Q=i.memoizedState,g.state=Q,vo(i,d,g,h),yo();var Y=i.memoizedState;j!==ie||Q!==Y||ai||s!==null&&s.dependencies!==null&&Fl(s.dependencies)?(typeof _=="function"&&(Rf(i,l,_,d),Y=i.memoizedState),(X=ai||Wy(i,l,X,d,Q,Y,D)||s!==null&&s.dependencies!==null&&Fl(s.dependencies))?(F||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(d,Y,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(d,Y,D)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===s.memoizedProps&&Q===s.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===s.memoizedProps&&Q===s.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Y),g.props=d,g.state=Y,g.context=D,d=X):(typeof g.componentDidUpdate!="function"||j===s.memoizedProps&&Q===s.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===s.memoizedProps&&Q===s.memoizedState||(i.flags|=1024),d=!1)}return g=d,dc(s,i),d=(i.flags&128)!==0,g||d?(g=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,s!==null&&d?(i.child=aa(i,s.child,null,h),i.child=aa(i,null,l,h)):Wt(s,i,l,h),i.memoizedState=g.state,s=i.child):s=Ms(s,i,h),s}function p0(s,i,l,d){return Wi(),i.flags|=256,Wt(s,i,l,d),i.child}var $f={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pf(s){return{baseLanes:s,cachePool:iy()}}function Uf(s,i,l){return s=s!==null?s.childLanes&~l:0,i&&(s|=Ln),s}function g0(s,i,l){var d=i.pendingProps,h=!1,g=(i.flags&128)!==0,j;if((j=g)||(j=s!==null&&s.memoizedState===null?!1:(Lt.current&2)!==0),j&&(h=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,s===null){if(Je){if(h?li(i):ci(),(s=yt)?(s=Nv(s,Kn),s=s!==null&&s.data!=="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:ti!==null?{id:vs,overflow:bs}:null,retryLane:536870912,hydrationErrors:null},l=Qg(s),l.return=i,i.child=l,Jt=i,yt=null)):s=null,s===null)throw si(i);return Sh(s)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,h?(ci(),h=i.mode,_=fc({mode:"hidden",children:_},h),d=Xi(d,h,l,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=Pf(l),d.childLanes=Uf(s,j,l),i.memoizedState=$f,wo(null,d)):(li(i),If(i,_))}var D=s.memoizedState;if(D!==null&&(_=D.dehydrated,_!==null)){if(g)i.flags&256?(li(i),i.flags&=-257,i=Bf(s,i,l)):i.memoizedState!==null?(ci(),i.child=s.child,i.flags|=128,i=null):(ci(),_=d.fallback,h=i.mode,d=fc({mode:"visible",children:d.children},h),_=Xi(_,h,l,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,aa(i,s.child,null,l),d=i.child,d.memoizedState=Pf(l),d.childLanes=Uf(s,j,l),i.memoizedState=$f,i=wo(null,d));else if(li(i),Sh(_)){if(j=_.nextSibling&&_.nextSibling.dataset,j)var F=j.dgst;j=F,d=Error(a(419)),d.stack="",d.digest=j,uo({value:d,source:null,stack:null}),i=Bf(s,i,l)}else if(qt||tr(s,i,l,!1),j=(l&s.childLanes)!==0,qt||j){if(j=pt,j!==null&&(d=bt(j,l),d!==0&&d!==D.retryLane))throw D.retryLane=d,Ji(s,d),wn(j,s,d),Df;xh(_)||Sc(),i=Bf(s,i,l)}else xh(_)?(i.flags|=192,i.child=s.child,i=null):(s=D.treeContext,yt=Gn(_.nextSibling),Jt=i,Je=!0,ni=null,Kn=!1,s!==null&&Xg(i,s),i=If(i,d.children),i.flags|=4096);return i}return h?(ci(),_=d.fallback,h=i.mode,D=s.child,F=D.sibling,d=Ts(D,{mode:"hidden",children:d.children}),d.subtreeFlags=D.subtreeFlags&65011712,F!==null?_=Ts(F,_):(_=Xi(_,h,l,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,wo(null,d),d=i.child,_=s.child.memoizedState,_===null?_=Pf(l):(h=_.cachePool,h!==null?(D=It._currentValue,h=h.parent!==D?{parent:D,pool:D}:h):h=iy(),_={baseLanes:_.baseLanes|l,cachePool:h}),d.memoizedState=_,d.childLanes=Uf(s,j,l),i.memoizedState=$f,wo(s.child,d)):(li(i),l=s.child,s=l.sibling,l=Ts(l,{mode:"visible",children:d.children}),l.return=i,l.sibling=null,s!==null&&(j=i.deletions,j===null?(i.deletions=[s],i.flags|=16):j.push(s)),i.child=l,i.memoizedState=null,l)}function If(s,i){return i=fc({mode:"visible",children:i},s.mode),i.return=s,s.child=i}function fc(s,i){return s=Tn(22,s,null,i),s.lanes=0,s}function Bf(s,i,l){return aa(i,s.child,null,l),s=If(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function y0(s,i,l){s.lanes|=i;var d=s.alternate;d!==null&&(d.lanes|=i),tf(s.return,i,l)}function qf(s,i,l,d,h,g){var j=s.memoizedState;j===null?s.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 v0(s,i,l){var d=i.pendingProps,h=d.revealOrder,g=d.tail;d=d.children;var j=Lt.current,_=(j&2)!==0;if(_?(j=j&1|2,i.flags|=128):j&=1,re(Lt,j),Wt(s,i,d,l),d=Je?co:0,!_&&s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&y0(s,l,i);else if(s.tag===19)y0(s,l,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)s=l.alternate,s!==null&&ec(s)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),qf(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(s=h.alternate,s!==null&&ec(s)===null){i.child=h;break}s=h.sibling,h.sibling=l,l=h,h=s}qf(i,!0,l,null,g,d);break;case"together":qf(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Ms(s,i,l){if(s!==null&&(i.dependencies=s.dependencies),fi|=i.lanes,(l&i.childLanes)===0)if(s!==null){if(tr(s,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(s!==null&&i.child!==s.child)throw Error(a(153));if(i.child!==null){for(s=i.child,l=Ts(s,s.pendingProps),i.child=l,l.return=i;s.sibling!==null;)s=s.sibling,l=l.sibling=Ts(s,s.pendingProps),l.return=i;l.sibling=null}return i.child}function Kf(s,i){return(s.lanes&i)!==0?!0:(s=s.dependencies,!!(s!==null&&Fl(s)))}function lC(s,i,l){switch(i.tag){case 3:je(i,i.stateNode.containerInfo),ii(i,It,s.memoizedState.cache),Wi();break;case 27:case 5:Ae(i);break;case 4:je(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,mf(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?g0(s,i,l):(li(i),s=Ms(s,i,l),s!==null?s.sibling:null);li(i);break;case 19:var h=(s.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(tr(s,i,l,!1),d=(l&i.childLanes)!==0),h){if(d)return v0(s,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),re(Lt,Lt.current),d)break;return null;case 22:return i.lanes=0,u0(s,i,l,i.pendingProps);case 24:ii(i,It,s.memoizedState.cache)}return Ms(s,i,l)}function b0(s,i,l){if(s!==null)if(s.memoizedProps!==i.pendingProps)qt=!0;else{if(!Kf(s,l)&&(i.flags&128)===0)return qt=!1,lC(s,i,l);qt=(s.flags&131072)!==0}else qt=!1,Je&&(i.flags&1048576)!==0&&Jg(i,co,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(s=sa(i.elementType),i.type=s,typeof s=="function")Zd(s)?(d=oa(s,d),i.tag=1,i=m0(null,i,s,d,l)):(i.tag=0,i=Mf(null,i,s,d,l));else{if(s!=null){var h=s.$$typeof;if(h===z){i.tag=11,i=o0(null,i,s,d,l);break e}else if(h===E){i.tag=14,i=l0(null,i,s,d,l);break e}}throw i=Ee(s)||s,Error(a(306,i,""))}}return i;case 0:return Mf(s,i,i.type,i.pendingProps,l);case 1:return d=i.type,h=oa(d,i.pendingProps),m0(s,i,d,h,l);case 3:e:{if(je(i,i.stateNode.containerInfo),s===null)throw Error(a(387));d=i.pendingProps;var g=i.memoizedState;h=g.element,cf(s,i),vo(i,d,null,l);var j=i.memoizedState;if(d=j.cache,ii(i,It,d),d!==g.cache&&nf(i,[It],l,!0),yo(),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=p0(s,i,d,l);break e}else if(d!==h){h=In(Error(a(424)),i),uo(h),i=p0(s,i,d,l);break e}else for(s=i.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,yt=Gn(s.firstChild),Jt=i,Je=!0,ni=null,Kn=!0,l=uy(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Wi(),d===h){i=Ms(s,i,l);break e}Wt(s,i,d,l)}i=i.child}return i;case 26:return dc(s,i),s===null?(l=Tv(i.type,null,i.pendingProps,null))?i.memoizedState=l:Je||(l=i.type,s=i.pendingProps,d=_c(se.current).createElement(l),d[it]=i,d[sn]=s,en(d,l,s),at(d),i.stateNode=d):i.memoizedState=Tv(i.type,s.memoizedProps,i.pendingProps,s.memoizedState),null;case 27:return Ae(i),s===null&&Je&&(d=i.stateNode=zv(i.type,i.pendingProps,se.current),Jt=i,Kn=!0,h=yt,yi(i.type)?(jh=h,yt=Gn(d.firstChild)):yt=h),Wt(s,i,i.pendingProps.children,l),dc(s,i),s===null&&(i.flags|=4194304),i.child;case 5:return s===null&&Je&&((h=d=yt)&&(d=PC(d,i.type,i.pendingProps,Kn),d!==null?(i.stateNode=d,Jt=i,yt=Gn(d.firstChild),Kn=!1,h=!0):h=!1),h||si(i)),Ae(i),h=i.type,g=i.pendingProps,j=s!==null?s.memoizedProps:null,d=g.children,yh(h,g)?d=null:j!==null&&yh(h,j)&&(i.flags|=32),i.memoizedState!==null&&(h=gf(s,i,W1,null,null,l),Po._currentValue=h),dc(s,i),Wt(s,i,d,l),i.child;case 6:return s===null&&Je&&((s=l=yt)&&(l=UC(l,i.pendingProps,Kn),l!==null?(i.stateNode=l,Jt=i,yt=null,s=!0):s=!1),s||si(i)),null;case 13:return g0(s,i,l);case 4:return je(i,i.stateNode.containerInfo),d=i.pendingProps,s===null?i.child=aa(i,null,d,l):Wt(s,i,d,l),i.child;case 11:return o0(s,i,i.type,i.pendingProps,l);case 7:return Wt(s,i,i.pendingProps,l),i.child;case 8:return Wt(s,i,i.pendingProps.children,l),i.child;case 12:return Wt(s,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,ii(i,i.type,d.value),Wt(s,i,d.children,l),i.child;case 9:return h=i.type._context,d=i.pendingProps.children,ta(i),h=Xt(h),d=d(h),i.flags|=1,Wt(s,i,d,l),i.child;case 14:return l0(s,i,i.type,i.pendingProps,l);case 15:return c0(s,i,i.type,i.pendingProps,l);case 19:return v0(s,i,l);case 31:return oC(s,i,l);case 22:return u0(s,i,l,i.pendingProps);case 24:return ta(i),d=Xt(It),s===null?(h=rf(),h===null&&(h=pt,g=sf(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=l),h=g),i.memoizedState={parent:d,cache:h},lf(i),ii(i,It,h)):((s.lanes&l)!==0&&(cf(s,i),vo(i,null,null,l),yo()),h=s.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,It,d)):(d=g.cache,ii(i,It,d),d!==h.cache&&nf(i,[It],l,!0))),Wt(s,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function $s(s){s.flags|=4}function Hf(s,i,l,d,h){if((i=(s.mode&32)!==0)&&(i=!1),i){if(s.flags|=16777216,(h&335544128)===h)if(s.stateNode.complete)s.flags|=8192;else if(F0())s.flags|=8192;else throw ia=Yl,of}else s.flags&=-16777217}function x0(s,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Dv(i))if(F0())s.flags|=8192;else throw ia=Yl,of}function hc(s,i){i!==null&&(s.flags|=4),s.flags&16384&&(i=s.tag!==22?kl():536870912,s.lanes|=i,hr|=i)}function No(s,i){if(!Je)switch(s.tailMode){case"hidden":i=s.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?s.tail=null:l.sibling=null;break;case"collapsed":l=s.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:d.sibling=null}}function vt(s){var i=s.alternate!==null&&s.alternate.child===s.child,l=0,d=0;if(i)for(var h=s.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags&65011712,d|=h.flags&65011712,h.return=s,h=h.sibling;else for(h=s.child;h!==null;)l|=h.lanes|h.childLanes,d|=h.subtreeFlags,d|=h.flags,h.return=s,h=h.sibling;return s.subtreeFlags|=d,s.childLanes=l,i}function cC(s,i,l){var d=i.pendingProps;switch(Jd(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,s!==null&&(d=s.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Os(It),de(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(s===null||s.child===null)&&(er(i)?$s(i):s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Wd())),vt(i),null;case 26:var h=i.type,g=i.memoizedState;return s===null?($s(i),g!==null?(vt(i),x0(i,g)):(vt(i),Hf(i,h,null,d,l))):g?g!==s.memoizedState?($s(i),vt(i),x0(i,g)):(vt(i),i.flags&=-16777217):(s=s.memoizedProps,s!==d&&$s(i),vt(i),Hf(i,h,s,d,l)),null;case 27:if(Re(i),l=se.current,h=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}s=Z.current,er(i)?Wg(i):(s=zv(h,d,l),i.stateNode=s,$s(i))}return vt(i),null;case 5:if(Re(i),h=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==d&&$s(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return vt(i),null}if(g=Z.current,er(i))Wg(i);else{var j=_c(se.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[it]=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),Hf(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,l),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==d&&$s(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(s=se.current,er(i)){if(s=i.stateNode,l=i.memoizedProps,d=null,h=Jt,h!==null)switch(h.tag){case 27:case 5:d=h.memoizedProps}s[it]=i,s=!!(s.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||gv(s.nodeValue,l)),s||si(i,!0)}else s=_c(s).createTextNode(d),s[it]=i,i.stateNode=s}return vt(i),null;case 31:if(l=i.memoizedState,s===null||s.memoizedState!==null){if(d=er(i),l!==null){if(s===null){if(!d)throw Error(a(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(a(557));s[it]=i}else Wi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),s=!1}else l=Wd(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=l),s=!0;if(!s)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,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(h=er(i),d!==null&&d.dehydrated!==null){if(s===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[it]=i}else Wi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;vt(i),h=!1}else h=Wd(),s!==null&&s.memoizedState!==null&&(s.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,s=s!==null&&s.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!==s&&l&&(i.child.flags|=8192),hc(i,i.updateQueue),vt(i),null);case 4:return de(),s===null&&fh(i.stateNode.containerInfo),vt(i),null;case 10:return Os(i.type),vt(i),null;case 19:if(B(Lt),d=i.memoizedState,d===null)return vt(i),null;if(h=(i.flags&128)!==0,g=d.rendering,g===null)if(h)No(d,!1);else{if(Rt!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(g=ec(s),g!==null){for(i.flags|=128,No(d,!1),s=g.updateQueue,i.updateQueue=s,hc(i,s),i.subtreeFlags=0,s=l,l=i.child;l!==null;)Vg(l,s),l=l.sibling;return re(Lt,Lt.current&1|2),Je&&As(i,d.treeForkCount),i.child}s=s.sibling}d.tail!==null&&Ye()>vc&&(i.flags|=128,h=!0,No(d,!1),i.lanes=4194304)}else{if(!h)if(s=ec(g),s!==null){if(i.flags|=128,h=!0,s=s.updateQueue,i.updateQueue=s,hc(i,s),No(d,!0),d.tail===null&&d.tailMode==="hidden"&&!g.alternate&&!Je)return vt(i),null}else 2*Ye()-d.renderingStartTime>vc&&l!==536870912&&(i.flags|=128,h=!0,No(d,!1),i.lanes=4194304);d.isBackwards?(g.sibling=i.child,i.child=g):(s=d.last,s!==null?s.sibling=g:i.child=g,d.last=g)}return d.tail!==null?(s=d.tail,d.rendering=s,d.tail=s.sibling,d.renderingStartTime=Ye(),s.sibling=null,l=Lt.current,re(Lt,h?l&1|2:l&1),Je&&As(i,d.treeForkCount),s):(vt(i),null);case 22:case 23:return Rn(i),hf(),d=i.memoizedState!==null,s!==null?s.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&&hc(i,l.retryQueue),l=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),s!==null&&B(na),null;case 24:return l=null,s!==null&&(l=s.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Os(It),vt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function uC(s,i){switch(Jd(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return Os(It),de(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return Re(i),null;case 31:if(i.memoizedState!==null){if(Rn(i),i.alternate===null)throw Error(a(340));Wi()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(Rn(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Wi()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return B(Lt),null;case 4:return de(),null;case 10:return Os(i.type),null;case 22:case 23:return Rn(i),hf(),s!==null&&B(na),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return Os(It),null;case 25:return null;default:return null}}function S0(s,i){switch(Jd(i),i.tag){case 3:Os(It),de();break;case 26:case 27:case 5:Re(i);break;case 4:de();break;case 31:i.memoizedState!==null&&Rn(i);break;case 13:Rn(i);break;case 19:B(Lt);break;case 10:Os(i.type);break;case 22:case 23:Rn(i),hf(),s!==null&&B(na);break;case 24:Os(It)}}function Co(s,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&s)===s){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(s,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&s)===s){var j=d.inst,_=j.destroy;if(_!==void 0){j.destroy=void 0,h=i;var D=l,F=_;try{F()}catch(X){ot(h,D,X)}}}d=d.next}while(d!==g)}}catch(X){ot(i,i.return,X)}}function j0(s){var i=s.updateQueue;if(i!==null){var l=s.stateNode;try{fy(i,l)}catch(d){ot(s,s.return,d)}}}function w0(s,i,l){l.props=oa(s.type,s.memoizedProps),l.state=s.memoizedState;try{l.componentWillUnmount()}catch(d){ot(s,i,d)}}function ko(s,i){try{var l=s.ref;if(l!==null){switch(s.tag){case 26:case 27:case 5:var d=s.stateNode;break;case 30:d=s.stateNode;break;default:d=s.stateNode}typeof l=="function"?s.refCleanup=l(d):l.current=d}}catch(h){ot(s,i,h)}}function xs(s,i){var l=s.ref,d=s.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(h){ot(s,i,h)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){ot(s,i,h)}else l.current=null}function N0(s){var i=s.type,l=s.memoizedProps,d=s.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(s,s.return,h)}}function Gf(s,i,l){try{var d=s.stateNode;RC(d,s.type,l,i),d[sn]=i}catch(h){ot(s,s.return,h)}}function C0(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&yi(s.type)||s.tag===4}function Ff(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||C0(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&yi(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Zf(s,i,l){var d=s.tag;if(d===5||d===6)s=s.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(s,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(s),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=_s));else if(d!==4&&(d===27&&yi(s.type)&&(l=s.stateNode,i=null),s=s.child,s!==null))for(Zf(s,i,l),s=s.sibling;s!==null;)Zf(s,i,l),s=s.sibling}function mc(s,i,l){var d=s.tag;if(d===5||d===6)s=s.stateNode,i?l.insertBefore(s,i):l.appendChild(s);else if(d!==4&&(d===27&&yi(s.type)&&(l=s.stateNode),s=s.child,s!==null))for(mc(s,i,l),s=s.sibling;s!==null;)mc(s,i,l),s=s.sibling}function k0(s){var i=s.stateNode,l=s.memoizedProps;try{for(var d=s.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);en(i,d,l),i[it]=s,i[sn]=l}catch(g){ot(s,s.return,g)}}var Ps=!1,Kt=!1,Vf=!1,z0=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function dC(s,i){if(s=s.containerInfo,ph=Dc,s=Ug(s),Id(s)){if("selectionStart"in s)var l={start:s.selectionStart,end:s.selectionEnd};else e:{l=(l=s.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,D=-1,F=0,X=0,ie=s,Q=null;t:for(;;){for(var Y;ie!==l||h!==0&&ie.nodeType!==3||(_=j+h),ie!==g||d!==0&&ie.nodeType!==3||(D=j+d),ie.nodeType===3&&(j+=ie.nodeValue.length),(Y=ie.firstChild)!==null;)Q=ie,ie=Y;for(;;){if(ie===s)break t;if(Q===l&&++F===h&&(_=j),Q===g&&++X===d&&(D=j),(Y=ie.nextSibling)!==null)break;ie=Q,Q=ie.parentNode}ie=Y}l=_===-1||D===-1?null:{start:_,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(gh={focusedElem:s,selectionRange:l},Dc=!1,Yt=i;Yt!==null;)if(i=Yt,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,Yt=s;else for(;Yt!==null;){switch(i=Yt,g=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(l=0;l<s.length;l++)h=s[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&g!==null){s=void 0,l=i,h=g.memoizedProps,g=g.memoizedState,d=l.stateNode;try{var Se=oa(l.type,h);s=d.getSnapshotBeforeUpdate(Se,g),d.__reactInternalSnapshotBeforeUpdate=s}catch(Te){ot(l,l.return,Te)}}break;case 3:if((s&1024)!==0){if(s=i.stateNode.containerInfo,l=s.nodeType,l===9)bh(s);else if(l===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":bh(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(a(163))}if(s=i.sibling,s!==null){s.return=i.return,Yt=s;break}Yt=i.return}}function _0(s,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:Is(s,l),d&4&&Co(5,l);break;case 1:if(Is(s,l),d&4)if(s=l.stateNode,i===null)try{s.componentDidMount()}catch(j){ot(l,l.return,j)}else{var h=oa(l.type,i.memoizedProps);i=i.memoizedState;try{s.componentDidUpdate(h,i,s.__reactInternalSnapshotBeforeUpdate)}catch(j){ot(l,l.return,j)}}d&64&&j0(l),d&512&&ko(l,l.return);break;case 3:if(Is(s,l),d&64&&(s=l.updateQueue,s!==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{fy(s,i)}catch(j){ot(l,l.return,j)}}break;case 27:i===null&&d&4&&k0(l);case 26:case 5:Is(s,l),i===null&&d&4&&N0(l),d&512&&ko(l,l.return);break;case 12:Is(s,l);break;case 31:Is(s,l),d&4&&A0(s,l);break;case 13:Is(s,l),d&4&&R0(s,l),d&64&&(s=l.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(l=xC.bind(null,l),IC(s,l))));break;case 22:if(d=l.memoizedState!==null||Ps,!d){i=i!==null&&i.memoizedState!==null||Kt,h=Ps;var g=Kt;Ps=d,(Kt=i)&&!g?Bs(s,l,(l.subtreeFlags&8772)!==0):Is(s,l),Ps=h,Kt=g}break;case 30:break;default:Is(s,l)}}function E0(s){var i=s.alternate;i!==null&&(s.alternate=null,E0(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&Js(i)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var xt=null,bn=!1;function Us(s,i,l){for(l=l.child;l!==null;)T0(s,i,l),l=l.sibling}function T0(s,i,l){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(ns,l)}catch{}switch(l.tag){case 26:Kt||xs(l,i),Us(s,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Kt||xs(l,i);var d=xt,h=bn;yi(l.type)&&(xt=l.stateNode,bn=!1),Us(s,i,l),Do(l.stateNode),xt=d,bn=h;break;case 5:Kt||xs(l,i);case 6:if(d=xt,h=bn,xt=null,Us(s,i,l),xt=d,bn=h,xt!==null)if(bn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(l.stateNode)}catch(g){ot(l,i,g)}else try{xt.removeChild(l.stateNode)}catch(g){ot(l,i,g)}break;case 18:xt!==null&&(bn?(s=xt,jv(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,l.stateNode),Sr(s)):jv(xt,l.stateNode));break;case 4:d=xt,h=bn,xt=l.stateNode.containerInfo,bn=!0,Us(s,i,l),xt=d,bn=h;break;case 0:case 11:case 14:case 15:ui(2,l,i),Kt||ui(4,l,i),Us(s,i,l);break;case 1:Kt||(xs(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&w0(l,i,d)),Us(s,i,l);break;case 21:Us(s,i,l);break;case 22:Kt=(d=Kt)||l.memoizedState!==null,Us(s,i,l),Kt=d;break;default:Us(s,i,l)}}function A0(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Sr(s)}catch(l){ot(i,i.return,l)}}}function R0(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Sr(s)}catch(l){ot(i,i.return,l)}}function fC(s){switch(s.tag){case 31:case 13:case 19:var i=s.stateNode;return i===null&&(i=s.stateNode=new z0),i;case 22:return s=s.stateNode,i=s._retryCache,i===null&&(i=s._retryCache=new z0),i;default:throw Error(a(435,s.tag))}}function pc(s,i){var l=fC(s);i.forEach(function(d){if(!l.has(d)){l.add(d);var h=SC.bind(null,s,d);d.then(h,h)}})}function xn(s,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var h=l[d],g=s,j=i,_=j;e:for(;_!==null;){switch(_.tag){case 27:if(yi(_.type)){xt=_.stateNode,bn=!1;break e}break;case 5:xt=_.stateNode,bn=!1;break e;case 3:case 4:xt=_.stateNode.containerInfo,bn=!0;break e}_=_.return}if(xt===null)throw Error(a(160));T0(g,j,h),xt=null,bn=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)O0(i,s),i=i.sibling}var as=null;function O0(s,i){var l=s.alternate,d=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:xn(i,s),Sn(s),d&4&&(ui(3,s,s.return),Co(3,s),ui(5,s,s.return));break;case 1:xn(i,s),Sn(s),d&512&&(Kt||l===null||xs(l,l.return)),d&64&&Ps&&(s=s.updateQueue,s!==null&&(d=s.callbacks,d!==null&&(l=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var h=as;if(xn(i,s),Sn(s),d&512&&(Kt||l===null||xs(l,l.return)),d&4){var g=l!==null?l.memoizedState:null;if(d=s.memoizedState,l===null)if(d===null)if(s.stateNode===null){e:{d=s.type,l=s.memoizedProps,h=h.ownerDocument||h;t:switch(d){case"title":g=h.getElementsByTagName("title")[0],(!g||g[gs]||g[it]||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[it]=s,at(g),d=g;break e;case"link":var j=Ov("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=Ov("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[it]=s,at(g),d=g}s.stateNode=d}else Lv(h,s.type,s.stateNode);else s.stateNode=Rv(h,d,s.memoizedProps);else g!==d?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,d===null?Lv(h,s.type,s.stateNode):Rv(h,d,s.memoizedProps)):d===null&&s.stateNode!==null&&Gf(s,s.memoizedProps,l.memoizedProps)}break;case 27:xn(i,s),Sn(s),d&512&&(Kt||l===null||xs(l,l.return)),l!==null&&d&4&&Gf(s,s.memoizedProps,l.memoizedProps);break;case 5:if(xn(i,s),Sn(s),d&512&&(Kt||l===null||xs(l,l.return)),s.flags&32){h=s.stateNode;try{Ha(h,"")}catch(Se){ot(s,s.return,Se)}}d&4&&s.stateNode!=null&&(h=s.memoizedProps,Gf(s,h,l!==null?l.memoizedProps:h)),d&1024&&(Vf=!0);break;case 6:if(xn(i,s),Sn(s),d&4){if(s.stateNode===null)throw Error(a(162));d=s.memoizedProps,l=s.stateNode;try{l.nodeValue=d}catch(Se){ot(s,s.return,Se)}}break;case 3:if(Ac=null,h=as,as=Ec(i.containerInfo),xn(i,s),as=h,Sn(s),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Sr(i.containerInfo)}catch(Se){ot(s,s.return,Se)}Vf&&(Vf=!1,L0(s));break;case 4:d=as,as=Ec(s.stateNode.containerInfo),xn(i,s),Sn(s),as=d;break;case 12:xn(i,s),Sn(s);break;case 31:xn(i,s),Sn(s),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,pc(s,d)));break;case 13:xn(i,s),Sn(s),s.child.flags&8192&&s.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(yc=Ye()),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,pc(s,d)));break;case 22:h=s.memoizedState!==null;var D=l!==null&&l.memoizedState!==null,F=Ps,X=Kt;if(Ps=F||h,Kt=X||D,xn(i,s),Kt=X,Ps=F,Sn(s),d&8192)e:for(i=s.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||D||Ps||Kt||la(s)),l=null,i=s;;){if(i.tag===5||i.tag===26){if(l===null){D=l=i;try{if(g=D.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{_=D.stateNode;var ie=D.memoizedProps.style,Q=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;_.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Se){ot(D,D.return,Se)}}}else if(i.tag===6){if(l===null){D=i;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(Se){ot(D,D.return,Se)}}}else if(i.tag===18){if(l===null){D=i;try{var Y=D.stateNode;h?wv(Y,!0):wv(D.stateNode,!1)}catch(Se){ot(D,D.return,Se)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===s)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=s.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,pc(s,l))));break;case 19:xn(i,s),Sn(s),d&4&&(d=s.updateQueue,d!==null&&(s.updateQueue=null,pc(s,d)));break;case 30:break;case 21:break;default:xn(i,s),Sn(s)}}function Sn(s){var i=s.flags;if(i&2){try{for(var l,d=s.return;d!==null;){if(C0(d)){l=d;break}d=d.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var h=l.stateNode,g=Ff(s);mc(s,g,h);break;case 5:var j=l.stateNode;l.flags&32&&(Ha(j,""),l.flags&=-33);var _=Ff(s);mc(s,_,j);break;case 3:case 4:var D=l.stateNode.containerInfo,F=Ff(s);Zf(s,F,D);break;default:throw Error(a(161))}}catch(X){ot(s,s.return,X)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function L0(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var i=s;L0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),s=s.sibling}}function Is(s,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)_0(s,i.alternate,i),i=i.sibling}function la(s){for(s=s.child;s!==null;){var i=s;switch(i.tag){case 0:case 11:case 14:case 15:ui(4,i,i.return),la(i);break;case 1:xs(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&w0(i,i.return,l),la(i);break;case 27:Do(i.stateNode);case 26:case 5:xs(i,i.return),la(i);break;case 22:i.memoizedState===null&&la(i);break;case 30:la(i);break;default:la(i)}s=s.sibling}}function Bs(s,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,h=s,g=i,j=g.flags;switch(g.tag){case 0:case 11:case 15:Bs(h,g,l),Co(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 D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)dy(D[h],_)}catch(F){ot(d,d.return,F)}}l&&j&64&&j0(g),ko(g,g.return);break;case 27:k0(g);case 26:case 5:Bs(h,g,l),l&&d===null&&j&4&&N0(g),ko(g,g.return);break;case 12:Bs(h,g,l);break;case 31:Bs(h,g,l),l&&j&4&&A0(h,g);break;case 13:Bs(h,g,l),l&&j&4&&R0(h,g);break;case 22:g.memoizedState===null&&Bs(h,g,l),ko(g,g.return);break;case 30:break;default:Bs(h,g,l)}i=i.sibling}}function Qf(s,i){var l=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==l&&(s!=null&&s.refCount++,l!=null&&fo(l))}function Yf(s,i){s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&fo(s))}function rs(s,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)D0(s,i,l,d),i=i.sibling}function D0(s,i,l,d){var h=i.flags;switch(i.tag){case 0:case 11:case 15:rs(s,i,l,d),h&2048&&Co(9,i);break;case 1:rs(s,i,l,d);break;case 3:rs(s,i,l,d),h&2048&&(s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&fo(s)));break;case 12:if(h&2048){rs(s,i,l,d),s=i.stateNode;try{var g=i.memoizedProps,j=g.id,_=g.onPostCommit;typeof _=="function"&&_(j,i.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(D){ot(i,i.return,D)}}else rs(s,i,l,d);break;case 31:rs(s,i,l,d);break;case 13:rs(s,i,l,d);break;case 23:break;case 22:g=i.stateNode,j=i.alternate,i.memoizedState!==null?g._visibility&2?rs(s,i,l,d):zo(s,i):g._visibility&2?rs(s,i,l,d):(g._visibility|=2,ur(s,i,l,d,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Qf(j,i);break;case 24:rs(s,i,l,d),h&2048&&Yf(i.alternate,i);break;default:rs(s,i,l,d)}}function ur(s,i,l,d,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=s,j=i,_=l,D=d,F=j.flags;switch(j.tag){case 0:case 11:case 15:ur(g,j,_,D,h),Co(8,j);break;case 23:break;case 22:var X=j.stateNode;j.memoizedState!==null?X._visibility&2?ur(g,j,_,D,h):zo(g,j):(X._visibility|=2,ur(g,j,_,D,h)),h&&F&2048&&Qf(j.alternate,j);break;case 24:ur(g,j,_,D,h),h&&F&2048&&Yf(j.alternate,j);break;default:ur(g,j,_,D,h)}i=i.sibling}}function zo(s,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=s,d=i,h=d.flags;switch(d.tag){case 22:zo(l,d),h&2048&&Qf(d.alternate,d);break;case 24:zo(l,d),h&2048&&Yf(d.alternate,d);break;default:zo(l,d)}i=i.sibling}}var _o=8192;function dr(s,i,l){if(s.subtreeFlags&_o)for(s=s.child;s!==null;)M0(s,i,l),s=s.sibling}function M0(s,i,l){switch(s.tag){case 26:dr(s,i,l),s.flags&_o&&s.memoizedState!==null&&XC(l,as,s.memoizedState,s.memoizedProps);break;case 5:dr(s,i,l);break;case 3:case 4:var d=as;as=Ec(s.stateNode.containerInfo),dr(s,i,l),as=d;break;case 22:s.memoizedState===null&&(d=s.alternate,d!==null&&d.memoizedState!==null?(d=_o,_o=16777216,dr(s,i,l),_o=d):dr(s,i,l));break;default:dr(s,i,l)}}function $0(s){var i=s.alternate;if(i!==null&&(s=i.child,s!==null)){i.child=null;do i=s.sibling,s.sibling=null,s=i;while(s!==null)}}function Eo(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Yt=d,U0(d,s)}$0(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)P0(s),s=s.sibling}function P0(s){switch(s.tag){case 0:case 11:case 15:Eo(s),s.flags&2048&&ui(9,s,s.return);break;case 3:Eo(s);break;case 12:Eo(s);break;case 22:var i=s.stateNode;s.memoizedState!==null&&i._visibility&2&&(s.return===null||s.return.tag!==13)?(i._visibility&=-3,gc(s)):Eo(s);break;default:Eo(s)}}function gc(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];Yt=d,U0(d,s)}$0(s)}for(s=s.child;s!==null;){switch(i=s,i.tag){case 0:case 11:case 15:ui(8,i,i.return),gc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,gc(i));break;default:gc(i)}s=s.sibling}}function U0(s,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:fo(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,Yt=d;else e:for(l=s;Yt!==null;){d=Yt;var h=d.sibling,g=d.return;if(E0(d),d===l){Yt=null;break e}if(h!==null){h.return=g,Yt=h;break e}Yt=g}}}var hC={getCacheForType:function(s){var i=Xt(It),l=i.data.get(s);return l===void 0&&(l=s(),i.data.set(s,l)),l},cacheSignal:function(){return Xt(It).controller.signal}},mC=typeof WeakMap=="function"?WeakMap:Map,nt=0,pt=null,qe=null,Ge=0,rt=0,On=null,di=!1,fr=!1,Jf=!1,qs=0,Rt=0,fi=0,ca=0,Xf=0,Ln=0,hr=0,To=null,jn=null,Wf=!1,yc=0,I0=0,vc=1/0,bc=null,hi=null,Ft=0,mi=null,mr=null,Ks=0,eh=0,th=null,B0=null,Ao=0,nh=null;function Dn(){return(nt&2)!==0&&Ge!==0?Ge&-Ge:H.T!==null?lh():Ia()}function q0(){if(Ln===0)if((Ge&536870912)===0||Je){var s=Pa;Pa<<=1,(Pa&3932160)===0&&(Pa=262144),Ln=s}else Ln=536870912;return s=An.current,s!==null&&(s.flags|=32),Ln}function wn(s,i,l){(s===pt&&(rt===2||rt===9)||s.cancelPendingCommit!==null)&&(pr(s,0),pi(s,Ge,Ln,!1)),Fi(s,l),((nt&2)===0||s!==pt)&&(s===pt&&((nt&2)===0&&(ca|=l),Rt===4&&pi(s,Ge,Ln,!1)),Ss(s))}function K0(s,i,l){if((nt&6)!==0)throw Error(a(327));var d=!l&&(i&127)===0&&(i&s.expiredLanes)===0||Ys(s,i),h=d?yC(s,i):ih(s,i,!0),g=d;do{if(h===0){fr&&!d&&pi(s,i,0,!1);break}else{if(l=s.current.alternate,g&&!pC(l)){h=ih(s,i,!1),g=!1;continue}if(h===2){if(g=i,s.errorRecoveryDisabledLanes&g)var j=0;else j=s.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var _=s;h=To;var D=_.current.memoizedState.isDehydrated;if(D&&(pr(_,j).flags|=256),j=ih(_,j,!1),j!==2){if(Jf&&!D){_.errorRecoveryDisabledLanes|=g,ca|=g,h=4;break e}g=jn,jn=h,g!==null&&(jn===null?jn=g:jn.push.apply(jn,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){pr(s,0),pi(s,i,0,!0);break}e:{switch(d=s,g=h,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:pi(d,i,Ln,!di);break e;case 2:jn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=yc+300-Ye(),10<h)){if(pi(d,i,Ln,!di),Ua(d,0,!0)!==0)break e;Ks=i,d.timeoutHandle=xv(H0.bind(null,d,l,jn,bc,Wf,i,Ln,ca,hr,di,g,"Throttled",-0,0),h);break e}H0(d,l,jn,bc,Wf,i,Ln,ca,hr,di,g,null,-0,0)}}break}while(!0);Ss(s)}function H0(s,i,l,d,h,g,j,_,D,F,X,ie,Q,Y){if(s.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},M0(i,g,ie);var Se=(g&62914560)===g?yc-Ye():(g&4194048)===g?I0-Ye():0;if(Se=WC(ie,Se),Se!==null){Ks=g,s.cancelPendingCommit=Se(X0.bind(null,s,i,g,l,d,h,j,_,D,X,ie,null,Q,Y)),pi(s,g,j,!F);return}}X0(s,i,g,l,d,h,j,_,D)}function pC(s){for(var i=s;;){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(!En(g(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function pi(s,i,l,d){i&=~Xf,i&=~ca,s.suspendedLanes|=i,s.pingedLanes&=~i,d&&(s.warmLanes|=i),d=s.expirationTimes;for(var h=i;0<h;){var g=31-ue(h),j=1<<g;d[g]=-1,h&=~j}l!==0&&I(s,l,i)}function xc(){return(nt&6)===0?(Ro(0),!1):!0}function sh(){if(qe!==null){if(rt===0)var s=qe.return;else s=qe,Rs=ea=null,bf(s),ar=null,mo=0,s=qe;for(;s!==null;)S0(s.alternate,s),s=s.return;qe=null}}function pr(s,i){var l=s.timeoutHandle;l!==-1&&(s.timeoutHandle=-1,DC(l)),l=s.cancelPendingCommit,l!==null&&(s.cancelPendingCommit=null,l()),Ks=0,sh(),pt=s,qe=l=Ts(s.current,null),Ge=i,rt=0,On=null,di=!1,fr=Ys(s,i),Jf=!1,hr=Ln=Xf=ca=fi=Rt=0,jn=To=null,Wf=!1,(i&8)!==0&&(i|=i&32);var d=s.entangledLanes;if(d!==0)for(s=s.entanglements,d&=i;0<d;){var h=31-ue(d),g=1<<h;i|=s[h],d&=~g}return qs=i,Bl(),l}function G0(s,i){De=null,H.H=jo,i===ir||i===Ql?(i=oy(),rt=3):i===of?(i=oy(),rt=4):rt=i===Df?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,On=i,qe===null&&(Rt=1,cc(s,In(i,s.current)))}function F0(){var s=An.current;return s===null?!0:(Ge&4194048)===Ge?Hn===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?s===Hn:!1}function Z0(){var s=H.H;return H.H=jo,s===null?jo:s}function V0(){var s=H.A;return H.A=hC,s}function Sc(){Rt=4,di||(Ge&4194048)!==Ge&&An.current!==null||(fr=!0),(fi&134217727)===0&&(ca&134217727)===0||pt===null||pi(pt,Ge,Ln,!1)}function ih(s,i,l){var d=nt;nt|=2;var h=Z0(),g=V0();(pt!==s||Ge!==i)&&(bc=null,pr(s,i)),i=!1;var j=Rt;e:do try{if(rt!==0&&qe!==null){var _=qe,D=On;switch(rt){case 8:sh(),j=6;break e;case 3:case 2:case 9:case 6:An.current===null&&(i=!0);var F=rt;if(rt=0,On=null,gr(s,_,D,F),l&&fr){j=0;break e}break;default:F=rt,rt=0,On=null,gr(s,_,D,F)}}gC(),j=Rt;break}catch(X){G0(s,X)}while(!0);return i&&s.shellSuspendCounter++,Rs=ea=null,nt=d,H.H=h,H.A=g,qe===null&&(pt=null,Ge=0,Bl()),j}function gC(){for(;qe!==null;)Q0(qe)}function yC(s,i){var l=nt;nt|=2;var d=Z0(),h=V0();pt!==s||Ge!==i?(bc=null,vc=Ye()+500,pr(s,i)):fr=Ys(s,i);e:do try{if(rt!==0&&qe!==null){i=qe;var g=On;t:switch(rt){case 1:rt=0,On=null,gr(s,i,g,1);break;case 2:case 9:if(ay(g)){rt=0,On=null,Y0(i);break}i=function(){rt!==2&&rt!==9||pt!==s||(rt=7),Ss(s)},g.then(i,i);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:ay(g)?(rt=0,On=null,Y0(i)):(rt=0,On=null,gr(s,i,g,7));break;case 5:var j=null;switch(qe.tag){case 26:j=qe.memoizedState;case 5:case 27:var _=qe;if(j?Dv(j):_.stateNode.complete){rt=0,On=null;var D=_.sibling;if(D!==null)qe=D;else{var F=_.return;F!==null?(qe=F,jc(F)):qe=null}break t}}rt=0,On=null,gr(s,i,g,5);break;case 6:rt=0,On=null,gr(s,i,g,6);break;case 8:sh(),Rt=6;break e;default:throw Error(a(462))}}vC();break}catch(X){G0(s,X)}while(!0);return Rs=ea=null,H.H=d,H.A=h,nt=l,qe!==null?0:(pt=null,Ge=0,Bl(),Rt)}function vC(){for(;qe!==null&&!ut();)Q0(qe)}function Q0(s){var i=b0(s.alternate,s,qs);s.memoizedProps=s.pendingProps,i===null?jc(s):qe=i}function Y0(s){var i=s,l=i.alternate;switch(i.tag){case 15:case 0:i=h0(l,i,i.pendingProps,i.type,void 0,Ge);break;case 11:i=h0(l,i,i.pendingProps,i.type.render,i.ref,Ge);break;case 5:bf(i);default:S0(l,i),i=qe=Vg(i,qs),i=b0(l,i,qs)}s.memoizedProps=s.pendingProps,i===null?jc(s):qe=i}function gr(s,i,l,d){Rs=ea=null,bf(i),ar=null,mo=0;var h=i.return;try{if(rC(s,h,i,l,Ge)){Rt=1,cc(s,In(l,s.current)),qe=null;return}}catch(g){if(h!==null)throw qe=h,g;Rt=1,cc(s,In(l,s.current)),qe=null;return}i.flags&32768?(Je||d===1?s=!0:fr||(Ge&536870912)!==0?s=!1:(di=s=!0,(d===2||d===9||d===3||d===6)&&(d=An.current,d!==null&&d.tag===13&&(d.flags|=16384))),J0(i,s)):jc(i)}function jc(s){var i=s;do{if((i.flags&32768)!==0){J0(i,di);return}s=i.return;var l=cC(i.alternate,i,qs);if(l!==null){qe=l;return}if(i=i.sibling,i!==null){qe=i;return}qe=i=s}while(i!==null);Rt===0&&(Rt=5)}function J0(s,i){do{var l=uC(s.alternate,s);if(l!==null){l.flags&=32767,qe=l;return}if(l=s.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(s=s.sibling,s!==null)){qe=s;return}qe=s=l}while(s!==null);Rt=6,qe=null}function X0(s,i,l,d,h,g,j,_,D){s.cancelPendingCommit=null;do wc();while(Ft!==0);if((nt&6)!==0)throw Error(a(327));if(i!==null){if(i===s.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=Gd,zl(s,l,g,j,_,D),s===pt&&(qe=pt=null,Ge=0),mr=i,mi=s,Ks=l,eh=g,th=h,B0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,jC(He,function(){return sv(),null})):(s.callbackNode=null,s.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=H.T,H.T=null,h=ae.p,ae.p=2,j=nt,nt|=4;try{dC(s,i,l)}finally{nt=j,ae.p=h,H.T=d}}Ft=1,W0(),ev(),tv()}}function W0(){if(Ft===1){Ft=0;var s=mi,i=mr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=H.T,H.T=null;var d=ae.p;ae.p=2;var h=nt;nt|=4;try{O0(i,s);var g=gh,j=Ug(s.containerInfo),_=g.focusedElem,D=g.selectionRange;if(j!==_&&_&&_.ownerDocument&&Pg(_.ownerDocument.documentElement,_)){if(D!==null&&Id(_)){var F=D.start,X=D.end;if(X===void 0&&(X=F),"selectionStart"in _)_.selectionStart=F,_.selectionEnd=Math.min(X,_.value.length);else{var ie=_.ownerDocument||document,Q=ie&&ie.defaultView||window;if(Q.getSelection){var Y=Q.getSelection(),Se=_.textContent.length,Te=Math.min(D.start,Se),ht=D.end===void 0?Te:Math.min(D.end,Se);!Y.extend&&Te>ht&&(j=ht,ht=Te,Te=j);var q=$g(_,Te),U=$g(_,ht);if(q&&U&&(Y.rangeCount!==1||Y.anchorNode!==q.node||Y.anchorOffset!==q.offset||Y.focusNode!==U.node||Y.focusOffset!==U.offset)){var G=ie.createRange();G.setStart(q.node,q.offset),Y.removeAllRanges(),Te>ht?(Y.addRange(G),Y.extend(U.node,U.offset)):(G.setEnd(U.node,U.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 ee=ie[_];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Dc=!!ph,gh=ph=null}finally{nt=h,ae.p=d,H.T=l}}s.current=i,Ft=2}}function ev(){if(Ft===2){Ft=0;var s=mi,i=mr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=H.T,H.T=null;var d=ae.p;ae.p=2;var h=nt;nt|=4;try{_0(s,i.alternate,i)}finally{nt=h,ae.p=d,H.T=l}}Ft=3}}function tv(){if(Ft===4||Ft===3){Ft=0,Qt();var s=mi,i=mr,l=Ks,d=B0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Ft=5:(Ft=0,mr=mi=null,nv(s,s.pendingLanes));var h=s.pendingLanes;if(h===0&&(hi=null),ln(l),i=i.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(ns,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=H.T,h=ae.p,ae.p=2,H.T=null;try{for(var g=s.onRecoverableError,j=0;j<d.length;j++){var _=d[j];g(_.value,{componentStack:_.stack})}}finally{H.T=i,ae.p=h}}(Ks&3)!==0&&wc(),Ss(s),h=s.pendingLanes,(l&261930)!==0&&(h&42)!==0?s===nh?Ao++:(Ao=0,nh=s):Ao=0,Ro(0)}}function nv(s,i){(s.pooledCacheLanes&=i)===0&&(i=s.pooledCache,i!=null&&(s.pooledCache=null,fo(i)))}function wc(){return W0(),ev(),tv(),sv()}function sv(){if(Ft!==5)return!1;var s=mi,i=eh;eh=0;var l=ln(Ks),d=H.T,h=ae.p;try{ae.p=32>l?32:l,H.T=null,l=th,th=null;var g=mi,j=Ks;if(Ft=0,mr=mi=null,Ks=0,(nt&6)!==0)throw Error(a(331));var _=nt;if(nt|=4,P0(g.current),D0(g,g.current,j,l),nt=_,Ro(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(ns,g)}catch{}return!0}finally{ae.p=h,H.T=d,nv(s,i)}}function iv(s,i,l){i=In(l,i),i=Lf(s.stateNode,i,2),s=oi(s,i,2),s!==null&&(Fi(s,2),Ss(s))}function ot(s,i,l){if(s.tag===3)iv(s,s,l);else for(;i!==null;){if(i.tag===3){iv(i,s,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))){s=In(l,s),l=a0(2),d=oi(i,l,2),d!==null&&(r0(l,d,i,s),Fi(d,2),Ss(d));break}}i=i.return}}function ah(s,i,l){var d=s.pingCache;if(d===null){d=s.pingCache=new mC;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)||(Jf=!0,h.add(l),s=bC.bind(null,s,i,l),i.then(s,s))}function bC(s,i,l){var d=s.pingCache;d!==null&&d.delete(i),s.pingedLanes|=s.suspendedLanes&l,s.warmLanes&=~l,pt===s&&(Ge&l)===l&&(Rt===4||Rt===3&&(Ge&62914560)===Ge&&300>Ye()-yc?(nt&2)===0&&pr(s,0):Xf|=l,hr===Ge&&(hr=0)),Ss(s)}function av(s,i){i===0&&(i=kl()),s=Ji(s,i),s!==null&&(Fi(s,i),Ss(s))}function xC(s){var i=s.memoizedState,l=0;i!==null&&(l=i.retryLane),av(s,l)}function SC(s,i){var l=0;switch(s.tag){case 31:case 13:var d=s.stateNode,h=s.memoizedState;h!==null&&(l=h.retryLane);break;case 19:d=s.stateNode;break;case 22:d=s.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),av(s,l)}function jC(s,i){return oe(s,i)}var Nc=null,yr=null,rh=!1,Cc=!1,oh=!1,gi=0;function Ss(s){s!==yr&&s.next===null&&(yr===null?Nc=yr=s:yr=yr.next=s),Cc=!0,rh||(rh=!0,NC())}function Ro(s,i){if(!oh&&Cc){oh=!0;do for(var l=!1,d=Nc;d!==null;){if(s!==0){var h=d.pendingLanes;if(h===0)var g=0;else{var j=d.suspendedLanes,_=d.pingedLanes;g=(1<<31-ue(42|s)+1)-1,g&=h&~(j&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,cv(d,g))}else g=Ge,g=Ua(d,d===pt?g:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(g&3)===0||Ys(d,g)||(l=!0,cv(d,g));d=d.next}while(l);oh=!1}}function wC(){rv()}function rv(){Cc=rh=!1;var s=0;gi!==0&&LC()&&(s=gi);for(var i=Ye(),l=null,d=Nc;d!==null;){var h=d.next,g=ov(d,i);g===0?(d.next=null,l===null?Nc=h:l.next=h,h===null&&(yr=l)):(l=d,(s!==0||(g&3)!==0)&&(Cc=!0)),d=h}Ft!==0&&Ft!==5||Ro(s),gi!==0&&(gi=0)}function ov(s,i){for(var l=s.suspendedLanes,d=s.pingedLanes,h=s.expirationTimes,g=s.pendingLanes&-62914561;0<g;){var j=31-ue(g),_=1<<j,D=h[j];D===-1?((_&l)===0||(_&d)!==0)&&(h[j]=wd(_,i)):D<=i&&(s.expiredLanes|=_),g&=~_}if(i=pt,l=Ge,l=Ua(s,s===i?l:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),d=s.callbackNode,l===0||s===i&&(rt===2||rt===9)||s.cancelPendingCommit!==null)return d!==null&&d!==null&&Qe(d),s.callbackNode=null,s.callbackPriority=0;if((l&3)===0||Ys(s,l)){if(i=l&-l,i===s.callbackPriority)return i;switch(d!==null&&Qe(d),ln(l)){case 2:case 8:l=Ct;break;case 32:l=He;break;case 268435456:l=gn;break;default:l=He}return d=lv.bind(null,s),l=oe(l,d),s.callbackPriority=i,s.callbackNode=l,i}return d!==null&&d!==null&&Qe(d),s.callbackPriority=2,s.callbackNode=null,2}function lv(s,i){if(Ft!==0&&Ft!==5)return s.callbackNode=null,s.callbackPriority=0,null;var l=s.callbackNode;if(wc()&&s.callbackNode!==l)return null;var d=Ge;return d=Ua(s,s===pt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),d===0?null:(K0(s,d,i),ov(s,Ye()),s.callbackNode!=null&&s.callbackNode===l?lv.bind(null,s):null)}function cv(s,i){if(wc())return null;K0(s,i,!0)}function NC(){MC(function(){(nt&6)!==0?oe(Xe,wC):rv()})}function lh(){if(gi===0){var s=nr;s===0&&(s=Gi,Gi<<=1,(Gi&261888)===0&&(Gi=256)),gi=s}return gi}function uv(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Ol(""+s)}function dv(s,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,s.id&&l.setAttribute("form",s.id),i.parentNode.insertBefore(l,i),s=new FormData(s),l.parentNode.removeChild(l),s}function CC(s,i,l,d,h){if(i==="submit"&&l&&l.stateNode===h){var g=uv((h[sn]||null).action),j=d.submitter;j&&(i=(i=j[sn]||null)?uv(i.formAction):j.getAttribute("formAction"),i!==null&&(g=i,j=null));var _=new $l("action","action",null,d,h);s.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(gi!==0){var D=j?dv(h,j):new FormData(h);_f(l,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(_.preventDefault(),D=j?dv(h,j):new FormData(h),_f(l,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var ch=0;ch<Hd.length;ch++){var uh=Hd[ch],kC=uh.toLowerCase(),zC=uh[0].toUpperCase()+uh.slice(1);is(kC,"on"+zC)}is(qg,"onAnimationEnd"),is(Kg,"onAnimationIteration"),is(Hg,"onAnimationStart"),is("dblclick","onDoubleClick"),is("focusin","onFocus"),is("focusout","onBlur"),is(K1,"onTransitionRun"),is(H1,"onTransitionStart"),is(G1,"onTransitionCancel"),is(Gg,"onTransitionEnd"),qa("onMouseEnter",["mouseout","mouseover"]),qa("onMouseLeave",["mouseout","mouseover"]),qa("onPointerEnter",["pointerout","pointerover"]),qa("onPointerLeave",["pointerout","pointerover"]),ys("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ys("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ys("onBeforeInput",["compositionend","keypress","textInput","paste"]),ys("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ys("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ys("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oo="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(" "),_C=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oo));function fv(s,i){i=(i&4)!==0;for(var l=0;l<s.length;l++){var d=s[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],D=_.instance,F=_.currentTarget;if(_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(X){Il(X)}h.currentTarget=null,g=D}else for(j=0;j<d.length;j++){if(_=d[j],D=_.instance,F=_.currentTarget,_=_.listener,D!==g&&h.isPropagationStopped())break e;g=_,h.currentTarget=F;try{g(h)}catch(X){Il(X)}h.currentTarget=null,g=D}}}}function Ke(s,i){var l=i[ks];l===void 0&&(l=i[ks]=new Set);var d=s+"__bubble";l.has(d)||(hv(i,s,2,!1),l.add(d))}function dh(s,i,l){var d=0;i&&(d|=4),hv(l,s,d,i)}var kc="_reactListening"+Math.random().toString(36).slice(2);function fh(s){if(!s[kc]){s[kc]=!0,ss.forEach(function(l){l!=="selectionchange"&&(_C.has(l)||dh(l,!1,s),dh(l,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[kc]||(i[kc]=!0,dh("selectionchange",!1,i))}}function hv(s,i,l,d){switch(qv(i)){case 2:var h=nk;break;case 8:h=sk;break;default:h=zh}l=h.bind(null,i,l,s),h=void 0,!Ad||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),d?h!==void 0?s.addEventListener(i,l,{capture:!0,passive:h}):s.addEventListener(i,l,!0):h!==void 0?s.addEventListener(i,l,{passive:h}):s.addEventListener(i,l,!1)}function hh(s,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 D=j.tag;if((D===3||D===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;_!==null;){if(j=Xs(_),j===null)return;if(D=j.tag,D===5||D===6||D===26||D===27){d=g=j;continue e}_=_.parentNode}}d=d.return}vg(function(){var F=g,X=Ed(l),ie=[];e:{var Q=Fg.get(s);if(Q!==void 0){var Y=$l,Se=s;switch(s){case"keypress":if(Dl(l)===0)break e;case"keydown":case"keyup":Y=S1;break;case"focusin":Se="focus",Y=Dd;break;case"focusout":Se="blur",Y=Dd;break;case"beforeblur":case"afterblur":Y=Dd;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=Sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=c1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=N1;break;case qg:case Kg:case Hg:Y=f1;break;case Gg:Y=k1;break;case"scroll":case"scrollend":Y=o1;break;case"wheel":Y=_1;break;case"copy":case"cut":case"paste":Y=m1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=wg;break;case"toggle":case"beforetoggle":Y=T1}var Te=(i&4)!==0,ht=!Te&&(s==="scroll"||s==="scrollend"),q=Te?Q!==null?Q+"Capture":null:Q;Te=[];for(var U=F,G;U!==null;){var ee=U;if(G=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||G===null||q===null||(ee=eo(U,q),ee!=null&&Te.push(Lo(U,ee,G))),ht)break;U=U.return}0<Te.length&&(Q=new Y(Q,Se,null,l,X),ie.push({event:Q,listeners:Te}))}}if((i&7)===0){e:{if(Q=s==="mouseover"||s==="pointerover",Y=s==="mouseout"||s==="pointerout",Q&&l!==_d&&(Se=l.relatedTarget||l.fromElement)&&(Xs(Se)||Se[_n]))break e;if((Y||Q)&&(Q=X.window===X?X:(Q=X.ownerDocument)?Q.defaultView||Q.parentWindow:window,Y?(Se=l.relatedTarget||l.toElement,Y=F,Se=Se?Xs(Se):null,Se!==null&&(ht=c(Se),Te=Se.tag,Se!==ht||Te!==5&&Te!==27&&Te!==6)&&(Se=null)):(Y=null,Se=F),Y!==Se)){if(Te=Sg,ee="onMouseLeave",q="onMouseEnter",U="mouse",(s==="pointerout"||s==="pointerover")&&(Te=wg,ee="onPointerLeave",q="onPointerEnter",U="pointer"),ht=Y==null?Q:Ie(Y),G=Se==null?Q:Ie(Se),Q=new Te(ee,U+"leave",Y,l,X),Q.target=ht,Q.relatedTarget=G,ee=null,Xs(X)===F&&(Te=new Te(q,U+"enter",Se,l,X),Te.target=G,Te.relatedTarget=ht,ee=Te),ht=ee,Y&&Se)t:{for(Te=EC,q=Y,U=Se,G=0,ee=q;ee;ee=Te(ee))G++;ee=0;for(var ze=U;ze;ze=Te(ze))ee++;for(;0<G-ee;)q=Te(q),G--;for(;0<ee-G;)U=Te(U),ee--;for(;G--;){if(q===U||U!==null&&q===U.alternate){Te=q;break t}q=Te(q),U=Te(U)}Te=null}else Te=null;Y!==null&&mv(ie,Q,Y,Te,!1),Se!==null&&ht!==null&&mv(ie,ht,Se,Te,!0)}}e:{if(Q=F?Ie(F):window,Y=Q.nodeName&&Q.nodeName.toLowerCase(),Y==="select"||Y==="input"&&Q.type==="file")var et=Ag;else if(Eg(Q))if(Rg)et=I1;else{et=P1;var Ce=$1}else Y=Q.nodeName,!Y||Y.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?F&&zd(F.elementType)&&(et=Ag):et=U1;if(et&&(et=et(s,F))){Tg(ie,et,l,X);break e}Ce&&Ce(s,Q,F),s==="focusout"&&F&&Q.type==="number"&&F.memoizedProps.value!=null&&kd(Q,"number",Q.value)}switch(Ce=F?Ie(F):window,s){case"focusin":(Eg(Ce)||Ce.contentEditable==="true")&&(Va=Ce,Bd=F,lo=null);break;case"focusout":lo=Bd=Va=null;break;case"mousedown":qd=!0;break;case"contextmenu":case"mouseup":case"dragend":qd=!1,Ig(ie,l,X);break;case"selectionchange":if(q1)break;case"keydown":case"keyup":Ig(ie,l,X)}var $e;if($d)e:{switch(s){case"compositionstart":var Fe="onCompositionStart";break e;case"compositionend":Fe="onCompositionEnd";break e;case"compositionupdate":Fe="onCompositionUpdate";break e}Fe=void 0}else Za?zg(s,l)&&(Fe="onCompositionEnd"):s==="keydown"&&l.keyCode===229&&(Fe="onCompositionStart");Fe&&(Ng&&l.locale!=="ko"&&(Za||Fe!=="onCompositionStart"?Fe==="onCompositionEnd"&&Za&&($e=bg()):(ei=X,Rd="value"in ei?ei.value:ei.textContent,Za=!0)),Ce=zc(F,Fe),0<Ce.length&&(Fe=new jg(Fe,s,null,l,X),ie.push({event:Fe,listeners:Ce}),$e?Fe.data=$e:($e=_g(l),$e!==null&&(Fe.data=$e)))),($e=R1?O1(s,l):L1(s,l))&&(Fe=zc(F,"onBeforeInput"),0<Fe.length&&(Ce=new jg("onBeforeInput","beforeinput",null,l,X),ie.push({event:Ce,listeners:Fe}),Ce.data=$e)),CC(ie,s,F,l,X)}fv(ie,i)})}function Lo(s,i,l){return{instance:s,listener:i,currentTarget:l}}function zc(s,i){for(var l=i+"Capture",d=[];s!==null;){var h=s,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=eo(s,l),h!=null&&d.unshift(Lo(s,h,g)),h=eo(s,i),h!=null&&d.push(Lo(s,h,g))),s.tag===3)return d;s=s.return}return[]}function EC(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function mv(s,i,l,d,h){for(var g=i._reactName,j=[];l!==null&&l!==d;){var _=l,D=_.alternate,F=_.stateNode;if(_=_.tag,D!==null&&D===d)break;_!==5&&_!==26&&_!==27||F===null||(D=F,h?(F=eo(l,g),F!=null&&j.unshift(Lo(l,F,D))):h||(F=eo(l,g),F!=null&&j.push(Lo(l,F,D)))),l=l.return}j.length!==0&&s.push({event:i,listeners:j})}var TC=/\r\n?/g,AC=/\u0000|\uFFFD/g;function pv(s){return(typeof s=="string"?s:""+s).replace(TC,`
|
|
9
|
-
`).replace(AC,"")}function gv(s,i){return i=pv(i),pv(s)===i}function ft(s,i,l,d,h,g){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ha(s,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ha(s,""+d);break;case"className":Al(s,"class",d);break;case"tabIndex":Al(s,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Al(s,l,d);break;case"style":gg(s,d,g);break;case"data":if(i!=="object"){Al(s,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){s.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(l);break}d=Ol(""+d),s.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){s.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"&&ft(s,i,"name",h.name,h,null),ft(s,i,"formEncType",h.formEncType,h,null),ft(s,i,"formMethod",h.formMethod,h,null),ft(s,i,"formTarget",h.formTarget,h,null)):(ft(s,i,"encType",h.encType,h,null),ft(s,i,"method",h.method,h,null),ft(s,i,"target",h.target,h,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){s.removeAttribute(l);break}d=Ol(""+d),s.setAttribute(l,d);break;case"onClick":d!=null&&(s.onclick=_s);break;case"onScroll":d!=null&&Ke("scroll",s);break;case"onScrollEnd":d!=null&&Ke("scrollend",s);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));s.innerHTML=l}}break;case"multiple":s.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":s.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"){s.removeAttribute("xlink:href");break}l=Ol(""+d),s.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"?s.setAttribute(l,""+d):s.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"?s.setAttribute(l,""):s.removeAttribute(l);break;case"capture":case"download":d===!0?s.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?s.setAttribute(l,d):s.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?s.setAttribute(l,d):s.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?s.removeAttribute(l):s.setAttribute(l,d);break;case"popover":Ke("beforetoggle",s),Ke("toggle",s),Tl(s,"popover",d);break;case"xlinkActuate":zs(s,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":zs(s,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":zs(s,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":zs(s,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":zs(s,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":zs(s,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":zs(s,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":zs(s,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":zs(s,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Tl(s,"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=a1.get(l)||l,Tl(s,l,d))}}function mh(s,i,l,d,h,g){switch(l){case"style":gg(s,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));s.innerHTML=l}}break;case"children":typeof d=="string"?Ha(s,d):(typeof d=="number"||typeof d=="bigint")&&Ha(s,""+d);break;case"onScroll":d!=null&&Ke("scroll",s);break;case"onScrollEnd":d!=null&&Ke("scrollend",s);break;case"onClick":d!=null&&(s.onclick=_s);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Zi.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=s[sn]||null,g=g!=null?g[l]:null,typeof g=="function"&&s.removeEventListener(i,g,h),typeof d=="function")){typeof g!="function"&&g!==null&&(l in s?s[l]=null:s.hasAttribute(l)&&s.removeAttribute(l)),s.addEventListener(i,d,h);break e}l in s?s[l]=d:d===!0?s.setAttribute(l,""):Tl(s,l,d)}}}function en(s,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",s),Ke("load",s);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:ft(s,i,g,j,l,null)}}h&&ft(s,i,"srcSet",l.srcSet,l,null),d&&ft(s,i,"src",l.src,l,null);return;case"input":Ke("invalid",s);var _=g=j=h=null,D=null,F=null;for(d in l)if(l.hasOwnProperty(d)){var X=l[d];if(X!=null)switch(d){case"name":h=X;break;case"type":j=X;break;case"checked":D=X;break;case"defaultChecked":F=X;break;case"value":g=X;break;case"defaultValue":_=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(a(137,i));break;default:ft(s,i,d,X,l,null)}}fg(s,g,_,D,F,j,h,!1);return;case"select":Ke("invalid",s),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:ft(s,i,h,_,l,null)}i=g,l=j,s.multiple=!!d,i!=null?Ka(s,!!d,i,!1):l!=null&&Ka(s,!!d,l,!0);return;case"textarea":Ke("invalid",s),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:ft(s,i,j,_,l,null)}mg(s,d,h,g);return;case"option":for(D in l)l.hasOwnProperty(D)&&(d=l[D],d!=null)&&(D==="selected"?s.selected=d&&typeof d!="function"&&typeof d!="symbol":ft(s,i,D,d,l,null));return;case"dialog":Ke("beforetoggle",s),Ke("toggle",s),Ke("cancel",s),Ke("close",s);break;case"iframe":case"object":Ke("load",s);break;case"video":case"audio":for(d=0;d<Oo.length;d++)Ke(Oo[d],s);break;case"image":Ke("error",s),Ke("load",s);break;case"details":Ke("toggle",s);break;case"embed":case"source":case"link":Ke("error",s),Ke("load",s);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:ft(s,i,F,d,l,null)}return;default:if(zd(i)){for(X in l)l.hasOwnProperty(X)&&(d=l[X],d!==void 0&&mh(s,i,X,d,l,void 0));return}}for(_ in l)l.hasOwnProperty(_)&&(d=l[_],d!=null&&ft(s,i,_,d,l,null))}function RC(s,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,D=null,F=null,X=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":D=ie;default:d.hasOwnProperty(Y)||ft(s,i,Y,null,d,ie)}}for(var Q in d){var Y=d[Q];if(ie=l[Q],d.hasOwnProperty(Q)&&(Y!=null||ie!=null))switch(Q){case"type":g=Y;break;case"name":h=Y;break;case"checked":F=Y;break;case"defaultChecked":X=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&&ft(s,i,Q,Y,d,ie)}}Cd(s,j,_,D,F,X,g,h);return;case"select":Y=j=_=Q=null;for(g in l)if(D=l[g],l.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":Y=D;default:d.hasOwnProperty(g)||ft(s,i,g,null,d,D)}for(h in d)if(g=d[h],D=l[h],d.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":Q=g;break;case"defaultValue":_=g;break;case"multiple":j=g;default:g!==D&&ft(s,i,h,g,d,D)}i=_,l=j,d=Y,Q!=null?Ka(s,!!l,Q,!1):!!d!=!!l&&(i!=null?Ka(s,!!l,i,!0):Ka(s,!!l,l?[]:"",!1));return;case"textarea":Y=Q=null;for(_ in l)if(h=l[_],l.hasOwnProperty(_)&&h!=null&&!d.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:ft(s,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":Q=h;break;case"defaultValue":Y=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==g&&ft(s,i,j,h,d,g)}hg(s,Q,Y);return;case"option":for(var Se in l)Q=l[Se],l.hasOwnProperty(Se)&&Q!=null&&!d.hasOwnProperty(Se)&&(Se==="selected"?s.selected=!1:ft(s,i,Se,null,d,Q));for(D in d)Q=d[D],Y=l[D],d.hasOwnProperty(D)&&Q!==Y&&(Q!=null||Y!=null)&&(D==="selected"?s.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":ft(s,i,D,Q,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 Te in l)Q=l[Te],l.hasOwnProperty(Te)&&Q!=null&&!d.hasOwnProperty(Te)&&ft(s,i,Te,null,d,Q);for(F in d)if(Q=d[F],Y=l[F],d.hasOwnProperty(F)&&Q!==Y&&(Q!=null||Y!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(a(137,i));break;default:ft(s,i,F,Q,d,Y)}return;default:if(zd(i)){for(var ht in l)Q=l[ht],l.hasOwnProperty(ht)&&Q!==void 0&&!d.hasOwnProperty(ht)&&mh(s,i,ht,void 0,d,Q);for(X in d)Q=d[X],Y=l[X],!d.hasOwnProperty(X)||Q===Y||Q===void 0&&Y===void 0||mh(s,i,X,Q,d,Y);return}}for(var q in l)Q=l[q],l.hasOwnProperty(q)&&Q!=null&&!d.hasOwnProperty(q)&&ft(s,i,q,null,d,Q);for(ie in d)Q=d[ie],Y=l[ie],!d.hasOwnProperty(ie)||Q===Y||Q==null&&Y==null||ft(s,i,ie,Q,d,Y)}function yv(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function OC(){if(typeof performance.getEntriesByType=="function"){for(var s=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&&_&&yv(j)){for(j=0,_=h.responseEnd,d+=1;d<l.length;d++){var D=l[d],F=D.startTime;if(F>_)break;var X=D.transferSize,ie=D.initiatorType;X&&yv(ie)&&(D=D.responseEnd,j+=X*(D<_?1:(_-F)/(D-F)))}if(--d,i+=8*(g+j)/(h.duration/1e3),s++,10<s)break}}if(0<s)return i/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var ph=null,gh=null;function _c(s){return s.nodeType===9?s:s.ownerDocument}function vv(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function bv(s,i){if(s===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&i==="foreignObject"?0:s}function yh(s,i){return s==="textarea"||s==="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 vh=null;function LC(){var s=window.event;return s&&s.type==="popstate"?s===vh?!1:(vh=s,!0):(vh=null,!1)}var xv=typeof setTimeout=="function"?setTimeout:void 0,DC=typeof clearTimeout=="function"?clearTimeout:void 0,Sv=typeof Promise=="function"?Promise:void 0,MC=typeof queueMicrotask=="function"?queueMicrotask:typeof Sv<"u"?function(s){return Sv.resolve(null).then(s).catch($C)}:xv;function $C(s){setTimeout(function(){throw s})}function yi(s){return s==="head"}function jv(s,i){var l=i,d=0;do{var h=l.nextSibling;if(s.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(d===0){s.removeChild(h),Sr(i);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Do(s.ownerDocument.documentElement);else if(l==="head"){l=s.ownerDocument.head,Do(l);for(var g=l.firstChild;g;){var j=g.nextSibling,_=g.nodeName;g[gs]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=j}}else l==="body"&&Do(s.ownerDocument.body);l=h}while(l);Sr(i)}function wv(s,i){var l=s;s=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(s===0)break;s--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||s++;l=d}while(l)}function bh(s){var i=s.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":bh(l),Js(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}s.removeChild(l)}}function PC(s,i,l,d){for(;s.nodeType===1;){var h=l;if(s.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(d){if(!s[gs])switch(i){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(g=s.getAttribute("rel"),g==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(g!==h.rel||s.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||s.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||s.getAttribute("title")!==(h.title==null?null:h.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(g=s.getAttribute("src"),(g!==(h.src==null?null:h.src)||s.getAttribute("type")!==(h.type==null?null:h.type)||s.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(i==="input"&&s.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&s.getAttribute("name")===g)return s}else return s;if(s=Gn(s.nextSibling),s===null)break}return null}function UC(s,i,l){if(i==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=Gn(s.nextSibling),s===null))return null;return s}function Nv(s,i){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!i||(s=Gn(s.nextSibling),s===null))return null;return s}function xh(s){return s.data==="$?"||s.data==="$~"}function Sh(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function IC(s,i){var l=s.ownerDocument;if(s.data==="$~")s._reactRetry=i;else if(s.data!=="$?"||l.readyState!=="loading")i();else{var d=function(){i(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),s._reactRetry=d}}function Gn(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return s}var jh=null;function Cv(s){s=s.nextSibling;for(var i=0;s;){if(s.nodeType===8){var l=s.data;if(l==="/$"||l==="/&"){if(i===0)return Gn(s.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}s=s.nextSibling}return null}function kv(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var l=s.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return s;i--}else l!=="/$"&&l!=="/&"||i++}s=s.previousSibling}return null}function zv(s,i,l){switch(i=_c(l),s){case"html":if(s=i.documentElement,!s)throw Error(a(452));return s;case"head":if(s=i.head,!s)throw Error(a(453));return s;case"body":if(s=i.body,!s)throw Error(a(454));return s;default:throw Error(a(451))}}function Do(s){for(var i=s.attributes;i.length;)s.removeAttributeNode(i[0]);Js(s)}var Fn=new Map,_v=new Set;function Ec(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Hs=ae.d;ae.d={f:BC,r:qC,D:KC,C:HC,L:GC,m:FC,X:VC,S:ZC,M:QC};function BC(){var s=Hs.f(),i=xc();return s||i}function qC(s){var i=Ws(s);i!==null&&i.tag===5&&i.type==="form"?Gy(i):Hs.r(s)}var vr=typeof document>"u"?null:document;function Ev(s,i,l){var d=vr;if(d&&typeof i=="string"&&i){var h=Pn(i);h='link[rel="'+s+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),_v.has(h)||(_v.add(h),s={rel:s,crossOrigin:l,href:i},d.querySelector(h)===null&&(i=d.createElement("link"),en(i,"link",s),at(i),d.head.appendChild(i)))}}function KC(s){Hs.D(s),Ev("dns-prefetch",s,null)}function HC(s,i){Hs.C(s,i),Ev("preconnect",s,i)}function GC(s,i,l){Hs.L(s,i,l);var d=vr;if(d&&s&&i){var h='link[rel="preload"][as="'+Pn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+Pn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+Pn(l.imageSizes)+'"]')):h+='[href="'+Pn(s)+'"]';var g=h;switch(i){case"style":g=br(s);break;case"script":g=xr(s)}Fn.has(g)||(s=y({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:s,as:i},l),Fn.set(g,s),d.querySelector(h)!==null||i==="style"&&d.querySelector(Mo(g))||i==="script"&&d.querySelector($o(g))||(i=d.createElement("link"),en(i,"link",s),at(i),d.head.appendChild(i)))}}function FC(s,i){Hs.m(s,i);var l=vr;if(l&&s){var d=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Pn(d)+'"][href="'+Pn(s)+'"]',g=h;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=xr(s)}if(!Fn.has(g)&&(s=y({rel:"modulepreload",href:s},i),Fn.set(g,s),l.querySelector(h)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector($o(g)))return}d=l.createElement("link"),en(d,"link",s),at(d),l.head.appendChild(d)}}}function ZC(s,i,l){Hs.S(s,i,l);var d=vr;if(d&&s){var h=We(d).hoistableStyles,g=br(s);i=i||"default";var j=h.get(g);if(!j){var _={loading:0,preload:null};if(j=d.querySelector(Mo(g)))_.loading=5;else{s=y({rel:"stylesheet",href:s,"data-precedence":i},l),(l=Fn.get(g))&&wh(s,l);var D=j=d.createElement("link");at(D),en(D,"link",s),D._p=new Promise(function(F,X){D.onload=F,D.onerror=X}),D.addEventListener("load",function(){_.loading|=1}),D.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Tc(j,i,d)}j={type:"stylesheet",instance:j,count:1,state:_},h.set(g,j)}}}function VC(s,i){Hs.X(s,i);var l=vr;if(l&&s){var d=We(l).hoistableScripts,h=xr(s),g=d.get(h);g||(g=l.querySelector($o(h)),g||(s=y({src:s,async:!0},i),(i=Fn.get(h))&&Nh(s,i),g=l.createElement("script"),at(g),en(g,"link",s),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(h,g))}}function QC(s,i){Hs.M(s,i);var l=vr;if(l&&s){var d=We(l).hoistableScripts,h=xr(s),g=d.get(h);g||(g=l.querySelector($o(h)),g||(s=y({src:s,async:!0,type:"module"},i),(i=Fn.get(h))&&Nh(s,i),g=l.createElement("script"),at(g),en(g,"link",s),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},d.set(h,g))}}function Tv(s,i,l,d){var h=(h=se.current)?Ec(h):null;if(!h)throw Error(a(446));switch(s){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=br(l.href),l=We(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"){s=br(l.href);var g=We(h).hoistableStyles,j=g.get(s);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(s,j),(g=h.querySelector(Mo(s)))&&!g._p&&(j.instance=g,j.state.loading=5),Fn.has(s)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Fn.set(s,l),g||YC(h,s,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=We(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,s))}}function br(s){return'href="'+Pn(s)+'"'}function Mo(s){return'link[rel="stylesheet"]['+s+"]"}function Av(s){return y({},s,{"data-precedence":s.precedence,precedence:null})}function YC(s,i,l,d){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=s.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),at(i),s.head.appendChild(i))}function xr(s){return'[src="'+Pn(s)+'"]'}function $o(s){return"script[async]"+s}function Rv(s,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=s.querySelector('style[data-href~="'+Pn(l.href)+'"]');if(d)return i.instance=d,at(d),d;var h=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(s.ownerDocument||s).createElement("style"),at(d),en(d,"style",h),Tc(d,l.precedence,s),i.instance=d;case"stylesheet":h=br(l.href);var g=s.querySelector(Mo(h));if(g)return i.state.loading|=4,i.instance=g,at(g),g;d=Av(l),(h=Fn.get(h))&&wh(d,h),g=(s.ownerDocument||s).createElement("link"),at(g);var j=g;return j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),en(g,"link",d),i.state.loading|=4,Tc(g,l.precedence,s),i.instance=g;case"script":return g=xr(l.src),(h=s.querySelector($o(g)))?(i.instance=h,at(h),h):(d=l,(h=Fn.get(g))&&(d=y({},l),Nh(d,h)),s=s.ownerDocument||s,h=s.createElement("script"),at(h),en(h,"link",d),s.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,Tc(d,l.precedence,s));return i.instance}function Tc(s,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(s,g.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(s,i.firstChild))}function wh(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.title==null&&(s.title=i.title)}function Nh(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.integrity==null&&(s.integrity=i.integrity)}var Ac=null;function Ov(s,i,l){if(Ac===null){var d=new Map,h=Ac=new Map;h.set(l,d)}else h=Ac,d=h.get(l),d||(d=new Map,h.set(l,d));if(d.has(s))return d;for(d.set(s,null),l=l.getElementsByTagName(s),h=0;h<l.length;h++){var g=l[h];if(!(g[gs]||g[it]||s==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(i)||"";j=s+j;var _=d.get(j);_?_.push(g):d.set(j,[g])}}return d}function Lv(s,i,l){s=s.ownerDocument||s,s.head.insertBefore(l,i==="title"?s.querySelector("head > title"):null)}function JC(s,i,l){if(l===1||i.itemProp!=null)return!1;switch(s){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"?(s=i.disabled,typeof i.precedence=="string"&&s==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 Dv(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function XC(s,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=br(d.href),g=i.querySelector(Mo(h));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=Rc.bind(s),i.then(s,s)),l.state.loading|=4,l.instance=g,at(g);return}g=i.ownerDocument||i,d=Av(d),(h=Fn.get(h))&&wh(d,h),g=g.createElement("link"),at(g);var j=g;j._p=new Promise(function(_,D){j.onload=_,j.onerror=D}),en(g,"link",d),l.instance=g}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(s.count++,l=Rc.bind(s),i.addEventListener("load",l),i.addEventListener("error",l))}}var Ch=0;function WC(s,i){return s.stylesheets&&s.count===0&&Lc(s,s.stylesheets),0<s.count||0<s.imgCount?function(l){var d=setTimeout(function(){if(s.stylesheets&&Lc(s,s.stylesheets),s.unsuspend){var g=s.unsuspend;s.unsuspend=null,g()}},6e4+i);0<s.imgBytes&&Ch===0&&(Ch=62500*OC());var h=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Lc(s,s.stylesheets),s.unsuspend)){var g=s.unsuspend;s.unsuspend=null,g()}},(s.imgBytes>Ch?50:800)+i);return s.unsuspend=l,function(){s.unsuspend=null,clearTimeout(d),clearTimeout(h)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Lc(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Oc=null;function Lc(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Oc=new Map,i.forEach(ek,s),Oc=null,Rc.call(s))}function ek(s,i){if(!(i.state.loading&4)){var l=Oc.get(s);if(l)var d=l.get(null);else{l=new Map,Oc.set(s,l);for(var h=s.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=Rc.bind(this),h.addEventListener("load",d),h.addEventListener("error",d),g?g.parentNode.insertBefore(h,g.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(h,s.firstChild)),i.state.loading|=4}}var Po={$$typeof:T,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function tk(s,i,l,d,h,g,j,_,D){this.tag=1,this.containerInfo=s,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=Wr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wr(0),this.hiddenUpdates=Wr(null),this.identifierPrefix=d,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Mv(s,i,l,d,h,g,j,_,D,F,X,ie){return s=new tk(s,i,l,j,D,F,X,ie,_),i=1,g===!0&&(i|=24),g=Tn(3,null,null,i),s.current=g,g.stateNode=s,i=sf(),i.refCount++,s.pooledCache=i,i.refCount++,g.memoizedState={element:d,isDehydrated:l,cache:i},lf(g),s}function $v(s){return s?(s=Ja,s):Ja}function Pv(s,i,l,d,h,g){h=$v(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(s,d,i),l!==null&&(wn(l,s,i),go(l,s,i))}function Uv(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var l=s.retryLane;s.retryLane=l!==0&&l<i?l:i}}function kh(s,i){Uv(s,i),(s=s.alternate)&&Uv(s,i)}function Iv(s){if(s.tag===13||s.tag===31){var i=Ji(s,67108864);i!==null&&wn(i,s,67108864),kh(s,67108864)}}function Bv(s){if(s.tag===13||s.tag===31){var i=Dn();i=Gt(i);var l=Ji(s,i);l!==null&&wn(l,s,i),kh(s,i)}}var Dc=!0;function nk(s,i,l,d){var h=H.T;H.T=null;var g=ae.p;try{ae.p=2,zh(s,i,l,d)}finally{ae.p=g,H.T=h}}function sk(s,i,l,d){var h=H.T;H.T=null;var g=ae.p;try{ae.p=8,zh(s,i,l,d)}finally{ae.p=g,H.T=h}}function zh(s,i,l,d){if(Dc){var h=_h(d);if(h===null)hh(s,i,d,Mc,l),Kv(s,d);else if(ak(h,s,i,l,d))d.stopPropagation();else if(Kv(s,d),i&4&&-1<ik.indexOf(s)){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=ms(g.pendingLanes);if(j!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;j;){var D=1<<31-ue(j);_.entanglements[1]|=D,j&=~D}Ss(g),(nt&6)===0&&(vc=Ye()+500,Ro(0))}}break;case 31:case 13:_=Ji(g,2),_!==null&&wn(_,g,2),xc(),kh(g,2)}if(g=_h(d),g===null&&hh(s,i,d,Mc,l),g===h)break;h=g}h!==null&&d.stopPropagation()}else hh(s,i,d,null,l)}}function _h(s){return s=Ed(s),Eh(s)}var Mc=null;function Eh(s){if(Mc=null,s=Xs(s),s!==null){var i=c(s);if(i===null)s=null;else{var l=i.tag;if(l===13){if(s=u(i),s!==null)return s;s=null}else if(l===31){if(s=f(i),s!==null)return s;s=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null)}}return Mc=s,null}function qv(s){switch(s){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(Ue()){case Xe:return 2;case Ct:return 8;case He:case Ma:return 32;case gn:return 268435456;default:return 32}default:return 32}}var Th=!1,vi=null,bi=null,xi=null,Uo=new Map,Io=new Map,Si=[],ik="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 Kv(s,i){switch(s){case"focusin":case"focusout":vi=null;break;case"dragenter":case"dragleave":bi=null;break;case"mouseover":case"mouseout":xi=null;break;case"pointerover":case"pointerout":Uo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(i.pointerId)}}function Bo(s,i,l,d,h,g){return s===null||s.nativeEvent!==g?(s={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:g,targetContainers:[h]},i!==null&&(i=Ws(i),i!==null&&Iv(i)),s):(s.eventSystemFlags|=d,i=s.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),s)}function ak(s,i,l,d,h){switch(i){case"focusin":return vi=Bo(vi,s,i,l,d,h),!0;case"dragenter":return bi=Bo(bi,s,i,l,d,h),!0;case"mouseover":return xi=Bo(xi,s,i,l,d,h),!0;case"pointerover":var g=h.pointerId;return Uo.set(g,Bo(Uo.get(g)||null,s,i,l,d,h)),!0;case"gotpointercapture":return g=h.pointerId,Io.set(g,Bo(Io.get(g)||null,s,i,l,d,h)),!0}return!1}function Hv(s){var i=Xs(s.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){s.blockedOn=i,ps(s.priority,function(){Bv(l)});return}}else if(i===31){if(i=f(l),i!==null){s.blockedOn=i,ps(s.priority,function(){Bv(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){s.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}s.blockedOn=null}function $c(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var l=_h(s.nativeEvent);if(l===null){l=s.nativeEvent;var d=new l.constructor(l.type,l);_d=d,l.target.dispatchEvent(d),_d=null}else return i=Ws(l),i!==null&&Iv(i),s.blockedOn=l,!1;i.shift()}return!0}function Gv(s,i,l){$c(s)&&l.delete(i)}function rk(){Th=!1,vi!==null&&$c(vi)&&(vi=null),bi!==null&&$c(bi)&&(bi=null),xi!==null&&$c(xi)&&(xi=null),Uo.forEach(Gv),Io.forEach(Gv)}function Pc(s,i){s.blockedOn===i&&(s.blockedOn=null,Th||(Th=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,rk)))}var Uc=null;function Fv(s){Uc!==s&&(Uc=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Uc===s&&(Uc=null);for(var i=0;i<s.length;i+=3){var l=s[i],d=s[i+1],h=s[i+2];if(typeof d!="function"){if(Eh(d||l)===null)continue;break}var g=Ws(l);g!==null&&(s.splice(i,3),i-=3,_f(g,{pending:!0,data:h,method:l.method,action:d},d,h))}}))}function Sr(s){function i(D){return Pc(D,s)}vi!==null&&Pc(vi,s),bi!==null&&Pc(bi,s),xi!==null&&Pc(xi,s),Uo.forEach(i),Io.forEach(i);for(var l=0;l<Si.length;l++){var d=Si[l];d.blockedOn===s&&(d.blockedOn=null)}for(;0<Si.length&&(l=Si[0],l.blockedOn===null);)Hv(l),l.blockedOn===null&&Si.shift();if(l=(s.ownerDocument||s).$$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||Fv(l);else if(j){var _=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[sn]||null)_=j.formAction;else if(Eh(h)!==null)continue}else _=j.action;typeof _=="function"?l[d+1]=_:(l.splice(d,3),d-=3),Fv(l)}}}function Zv(){function s(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",s),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function Ah(s){this._internalRoot=s}Ic.prototype.render=Ah.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,d=Dn();Pv(l,d,s,i,null,null)},Ic.prototype.unmount=Ah.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;Pv(s.current,2,null,s,null,null),xc(),i[_n]=null}};function Ic(s){this._internalRoot=s}Ic.prototype.unstable_scheduleHydration=function(s){if(s){var i=Ia();s={blockedOn:null,target:s,priority:i};for(var l=0;l<Si.length&&i!==0&&i<Si[l].priority;l++);Si.splice(l,0,s),l===0&&Hv(s)}};var Vv=t.version;if(Vv!=="19.2.4")throw Error(a(527,Vv,"19.2.4"));ae.findDOMNode=function(s){var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(a(188)):(s=Object.keys(s).join(","),Error(a(268,s)));return s=p(i),s=s!==null?v(s):null,s=s===null?null:s.stateNode,s};var ok={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bc.isDisabled&&Bc.supportsFiber)try{ns=Bc.inject(ok),mt=Bc}catch{}}return Ko.createRoot=function(s,i){if(!o(s))throw Error(a(299));var l=!1,d="",h=t0,g=n0,j=s0;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=Mv(s,1,!1,null,null,l,d,null,h,g,j,Zv),s[_n]=i.current,fh(s),new Ah(i)},Ko.hydrateRoot=function(s,i,l){if(!o(s))throw Error(a(299));var d=!1,h="",g=t0,j=n0,_=s0,D=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&&(D=l.formState)),i=Mv(s,1,!0,i,l??null,d,h,D,g,j,_,Zv),i.context=$v(null),l=i.current,d=Dn(),d=Gt(d),h=ri(d),h.callback=null,oi(l,h,d),l=d,i.current.lanes=l,Fi(i,l),Ss(i),s[_n]=i.current,fh(s),new Ic(i)},Ko.version="19.2.4",Ko}var ib;function yk(){if(ib)return Lh.exports;ib=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(),Lh.exports=gk(),Lh.exports}var vk=yk(),Ta=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(){}},bk={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},xk=class{#t=bk;#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)}},ma=new xk;function Sk(e){setTimeout(e,0)}var Ca=typeof window>"u"||"Deno"in globalThis;function rn(){}function jk(e,t){return typeof e=="function"?e(t):e}function bm(e){return typeof e=="number"&&e>=0&&e!==1/0}function SS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ai(e,t){return typeof e=="function"?e(t):e}function Zn(e,t){return typeof e=="function"?e(t):e}function ab(e,t){const{type:n="all",exact:a,fetchStatus:o,predicate:c,queryKey:u,stale:f}=e;if(u){if(a){if(t.queryHash!==ap(u,t.options))return!1}else if(!sl(t.queryKey,u))return!1}if(n!=="all"){const m=t.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||o&&o!==t.state.fetchStatus||c&&!c(t))}function rb(e,t){const{exact:n,status:a,predicate:o,mutationKey:c}=e;if(c){if(!t.options.mutationKey)return!1;if(n){if(ka(t.options.mutationKey)!==ka(c))return!1}else if(!sl(t.options.mutationKey,c))return!1}return!(a&&t.state.status!==a||o&&!o(t))}function ap(e,t){return(t?.queryKeyHashFn||ka)(e)}function ka(e){return JSON.stringify(e,(t,n)=>xm(n)?Object.keys(n).sort().reduce((a,o)=>(a[o]=n[o],a),{}):n)}function sl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>sl(e[n],t[n])):!1}var wk=Object.prototype.hasOwnProperty;function rp(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=ob(e)&&ob(t);if(!a&&!(xm(e)&&xm(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],b=e[y],x=t[y];if(b===x){m[y]=b,(a?v<c:wk.call(e,y))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){m[y]=x;continue}const N=rp(b,x,n+1);m[y]=N,N===b&&p++}return c===f&&p===c?e:m}function il(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function ob(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xm(e){if(!lb(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!lb(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lb(e){return Object.prototype.toString.call(e)==="[object Object]"}function Nk(e){return new Promise(t=>{ma.setTimeout(t,e)})}function Sm(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?rp(e,t):t}function Ck(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function kk(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var op=Symbol();function jS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===op?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function lp(e,t){return typeof e=="function"?e(...t):!!e}function zk(e,t,n){let a=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),a||(a=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var _k=class extends Ta{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Ca&&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"}},cp=new _k;function jm(){let e,t;const n=new Promise((o,c)=>{e=o,t=c});n.status="pending",n.catch(()=>{});function a(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{a({status:"fulfilled",value:o}),e(o)},n.reject=o=>{a({status:"rejected",reason:o}),t(o)},n}var Ek=Sk;function Tk(){let e=[],t=0,n=f=>{f()},a=f=>{f()},o=Ek;const c=f=>{t?e.push(f):o(()=>{n(f)})},u=()=>{const f=e;e=[],f.length&&o(()=>{a(()=>{f.forEach(m=>{n(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=>{n=f},setBatchNotifyFunction:f=>{a=f},setScheduler:f=>{o=f}}}var Ot=Tk(),Ak=class extends Ta{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Ca&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}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(n=>{n(e)}))}isOnline(){return this.#t}},xu=new Ak;function Rk(e){return Math.min(1e3*2**e,3e4)}function wS(e){return(e??"online")==="online"?xu.isOnline():!0}var wm=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function NS(e){let t=!1,n=0,a;const o=jm(),c=()=>o.status!=="pending",u=S=>{if(!c()){const C=new wm(S);b(C),e.onCancel?.(C)}},f=()=>{t=!0},m=()=>{t=!1},p=()=>cp.isFocused()&&(e.networkMode==="always"||xu.isOnline())&&e.canRun(),v=()=>wS(e.networkMode)&&e.canRun(),y=S=>{c()||(a?.(),o.resolve(S))},b=S=>{c()||(a?.(),o.reject(S))},x=()=>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=n===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 A=e.retry??(Ca?0:3),T=e.retryDelay??Rk,z=typeof T=="function"?T(n,k):T,M=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,k);if(t||!M){b(k);return}n++,e.onFail?.(n,k),Nk(z).then(()=>p()?void 0:x()).then(()=>{t?b(k):N()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(a?.(),o),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?N():x().then(N),o)}}var CS=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),bm(this.gcTime)&&(this.#t=ma.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ca?1/0:300*1e3))}clearGcTimeout(){this.#t&&(ma.clearTimeout(this.#t),this.#t=void 0)}},Ok=class extends CS{#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=ub(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=ub(this.options);t.data!==void 0&&(this.setState(cb(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Sm(this.state.data,e,this.options);return this.#r({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}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=>Zn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===op||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:!SS(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 n=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},o=()=>{const f=jS(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:o};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=NS({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof wm&&f.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.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 wm){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=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...kS(n.data,this.options),fetchMeta:e.meta??null};case"success":const a={...n,...cb(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?a:void 0,a;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Ot.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function kS(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:wS(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cb(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ub(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var up=class extends Ta{constructor(e,t){super(),this.options=t,this.#t=e,this.#r=null,this.#o=jm(),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),db(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Nm(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Nm(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=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 Zn(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&&!il(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&fb(this.#e,n,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==n||Zn(this.options.enabled,this.#e)!==Zn(t.enabled,this.#e)||Ai(this.options.staleTime,this.#e)!==Ai(t.staleTime,this.#e))&&this.#g();const o=this.#y();a&&(this.#e!==n||Zn(this.options.enabled,this.#e)!==Zn(t.enabled,this.#e)||o!==this.#l)&&this.#v(o)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return Dk(this,n)&&(this.#i=n,this.#a=this.options,this.#s=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,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(n,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),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,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.#x();const e=Ai(this.options.staleTime,this.#e);if(Ca||this.#i.isStale||!bm(e))return;const n=SS(this.#i.dataUpdatedAt,e)+1;this.#c=ma.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(Ca||Zn(this.options.enabled,this.#e)===!1||!bm(this.#l)||this.#l===0)&&(this.#u=ma.setInterval(()=>{(this.options.refetchIntervalInBackground||cp.isFocused())&&this.#p()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(ma.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(ma.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,a=this.options,o=this.#i,c=this.#s,u=this.#a,m=e!==n?e.state:this.#n,{state:p}=e;let v={...p},y=!1,b;if(t._optimisticResults){const O=this.hasListeners(),K=!O&&db(e,t),W=O&&fb(e,n,t,a);(K||W)&&(v={...v,...kS(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:N,status:S}=v;b=v.data;let C=!1;if(t.placeholderData!==void 0&&b===void 0&&S==="pending"){let O;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(O=o.data,C=!0):O=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,O!==void 0&&(S="success",b=Sm(o?.data,O,t),y=!0)}if(t.select&&b!==void 0&&!C)if(o&&b===c?.data&&t.select===this.#m)b=this.#d;else try{this.#m=t.select,b=t.select(b),b=Sm(o?.data,b,t),this.#d=b,this.#r=null}catch(O){this.#r=O}this.#r&&(x=this.#r,b=this.#d,N=Date.now(),S="error");const k=v.fetchStatus==="fetching",A=S==="pending",T=S==="error",z=A&&k,M=b!==void 0,E={status:S,fetchStatus:v.fetchStatus,isPending:A,isSuccess:S==="success",isError:T,isInitialLoading:z,isLoading:z,data:b,dataUpdatedAt:v.dataUpdatedAt,error:x,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&&!A,isLoadingError:T&&!M,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:T&&M,isStale:dp(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Zn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=E.data!==void 0,K=E.status==="error"&&!O,W=fe=>{K?fe.reject(E.error):O&&fe.resolve(E.data)},J=()=>{const fe=this.#o=E.promise=jm();W(fe)},ne=this.#o;switch(ne.status){case"pending":e.queryHash===n.queryHash&&W(ne);break;case"fulfilled":(K||E.data!==ne.value)&&J();break;case"rejected":(!K||E.error!==ne.reason)&&J();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),il(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!this.#h.size)return!0;const c=new Set(o??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:n()})}#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.#b()}#w(e){Ot.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Lk(e,t){return Zn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function db(e,t){return Lk(e,t)||e.state.data!==void 0&&Nm(e,t,t.refetchOnMount)}function Nm(e,t,n){if(Zn(t.enabled,e)!==!1&&Ai(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&dp(e,t)}return!1}function fb(e,t,n,a){return(e!==t||Zn(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dp(e,n)}function dp(e,t){return Zn(t.enabled,e)!==!1&&e.isStaleByTime(Ai(t.staleTime,e))}function Dk(e,t){return!il(e.getCurrentResult(),t)}function hb(e){return{onFetch:(t,n)=>{const a=t.options,o=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=>{zk(N,()=>t.signal,()=>v=!0)},b=jS(t.options,t.fetchOptions),x=async(N,S,C)=>{if(v)return Promise.reject();if(S==null&&N.pages.length)return Promise.resolve(N);const A=(()=>{const $={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return y($),$})(),T=await b(A),{maxPages:z}=t.options,M=C?kk:Ck;return{pages:M(N.pages,T,z),pageParams:M(N.pageParams,S,z)}};if(o&&c.length){const N=o==="backward",S=N?Mk:mb,C={pages:c,pageParams:u},k=S(a,C);f=await x(C,k,N)}else{const N=e??c.length;do{const S=m===0?u[0]??a.initialPageParam:mb(a,f);if(m>0&&S==null)break;f=await x(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},n):t.fetchFn=p}}}function mb(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function Mk(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var $k=class extends CS{#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||zS(),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"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=NS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):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",o=!this.#i.canStart();try{if(a)t();else{this.#s({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const u=await this.options.onMutate?.(e,n);u!==this.state.context&&this.#s({type:"pending",context:u,variables:e,isPaused:o})}const c=await this.#i.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,n),await this.options.onSuccess?.(c,e,this.state.context,n),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(c,null,e,this.state.context,n),this.#s({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onError?.(c,e,this.state.context,n)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,n)}catch(u){Promise.reject(u)}throw this.#s({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Ot.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function zS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var _S=class extends Ta{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const a=new $k({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(a),a}add(e){this.#t.add(e);const t=qc(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=qc(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const a=n.indexOf(e);a!==-1&&n.splice(a,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=qc(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(o=>o.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=qc(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ot.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(n=>rb(t,n))}findAll(e={}){return this.getAll().filter(t=>rb(e,t))}notify(e){Ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ot.batch(()=>Promise.all(e.map(t=>t.continue().catch(rn))))}};function qc(e){return e.options.scope?.id}var Pk=class extends Ta{#t;#e=void 0;#n;#i;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#s()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),il(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ka(n.mutationKey)!==ka(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,n){return this.#i=n,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??zS();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){Ot.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,a=this.#e.context,o={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,a,o)}catch(c){Promise.reject(c)}try{this.#i.onSettled?.(t.data,null,n,a,o)}catch(c){Promise.reject(c)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,a,o)}catch(c){Promise.reject(c)}try{this.#i.onSettled?.(void 0,t.error,n,a,o)}catch(c){Promise.reject(c)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function pb(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function Uk(e,t,n){const a=e.slice(0);return a[t]=n,a}var Ik=class extends Ta{#t;#e;#n;#i;#s;#a;#o;#r;#m;#d=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,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,Ot.batch(()=>{const n=this.#s,a=this.#u(this.#n);a.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const o=a.map(v=>v.observer),c=o.map(v=>v.getCurrentResult()),u=n.length!==o.length,f=o.some((v,y)=>v!==n[y]),m=u||f,p=m?!0:c.some((v,y)=>{const b=this.#e[y];return!b||!il(v,b)});!m&&!p||(m&&(this.#d=a,this.#s=o),this.#e=c,this.hasListeners()&&(m&&(pb(n,o).forEach(v=>{v.destroy()}),pb(o,n).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 n=this.#u(e),a=n.map(c=>c.observer.getOptimisticResult(c.defaultedQueryOptions)),o=n.map(c=>c.defaultedQueryOptions.queryHash);return[a,c=>this.#c(c??a,t,o),()=>this.#f(a,n)]}#f(e,t){return t.map((n,a)=>{const o=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?o:n.observer.trackResult(o,c=>{t.forEach(u=>{u.observer.trackProp(c)})})})}#c(e,t,n){if(t){const a=this.#m,o=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((c,u)=>c!==a[u]));return(!this.#a||this.#e!==this.#r||o||t!==this.#o)&&(this.#o=t,this.#r=this.#e,n!==void 0&&(this.#m=n),this.#a=rp(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#s.forEach(a=>{const o=a.options.queryHash;if(!o)return;const c=t.get(o);c?c.push(a):t.set(o,[a])});const n=[];return e.forEach(a=>{const o=this.#t.defaultQueryOptions(a),u=t.get(o.queryHash)?.shift()??new up(this.#t,o);n.push({defaultedQueryOptions:o,observer:u})}),n}#l(e,t){const n=this.#s.indexOf(e);n!==-1&&(this.#e=Uk(this.#e,n,t),this.#h())}#h(){if(this.hasListeners()){const e=this.#a,t=this.#f(this.#e,this.#d),n=this.#c(t,this.#i?.combine);e!==n&&Ot.batch(()=>{this.listeners.forEach(a=>{a(this.#e)})})}}},Bk=class extends Ta{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const a=t.queryKey,o=t.queryHash??ap(a,t);let c=this.get(o);return c||(c=new Ok({client:e,queryKey:a,queryHash:o,options:e.defaultQueryOptions(t),state:n,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(){Ot.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(n=>ab(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ab(e,n)):t}notify(e){Ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ot.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ot.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},qk=class{#t;#e;#n;#i;#s;#a;#o;#r;constructor(e={}){this.#t=e.queryCache||new Bk,this.#e=e.mutationCache||new _S,this.#n=e.defaultOptions||{},this.#i=new Map,this.#s=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=cp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#r=xu.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),n=this.#t.build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ai(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),c=this.#t.get(a.queryHash)?.state.data,u=jk(t,c);if(u!==void 0)return this.#t.build(this,a).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Ot.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Ot.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Ot.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=Ot.batch(()=>this.#t.findAll(e).map(o=>o.cancel(n)));return Promise.all(a).then(rn).catch(rn)}invalidateQueries(e,t={}){return Ot.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=Ot.batch(()=>this.#t.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let c=o.fetch(void 0,n);return n.throwOnError||(c=c.catch(rn)),o.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 n=this.#t.build(this,t);return n.isStaleByTime(Ai(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(rn).catch(rn)}fetchInfiniteQuery(e){return e.behavior=hb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rn).catch(rn)}ensureInfiniteQueryData(e){return e.behavior=hb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xu.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(ka(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(a=>{sl(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(ka(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(a=>{sl(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ap(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===op&&(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()}},ES=w.createContext(void 0),Ui=e=>{const t=w.useContext(ES);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Kk=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),r.jsx(ES.Provider,{value:e,children:t})),TS=w.createContext(!1),AS=()=>w.useContext(TS);TS.Provider;function Hk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Gk=w.createContext(Hk()),RS=()=>w.useContext(Gk),OS=(e,t,n)=>{const a=n?.state.error&&typeof e.throwOnError=="function"?lp(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},LS=e=>{w.useEffect(()=>{e.clearReset()},[e])},DS=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(o&&e.data===void 0||lp(n,[e.error,a])),MS=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...o)=>n(a(...o)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Fk=(e,t)=>e.isLoading&&e.isFetching&&!t,Cm=(e,t)=>e?.suspense&&t.isPending,km=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Zk({queries:e,...t},n){const a=Ui(),o=AS(),c=RS(),u=w.useMemo(()=>e.map(S=>{const C=a.defaultQueryOptions(S);return C._optimisticResults=o?"isRestoring":"optimistic",C}),[e,a,o]);u.forEach(S=>{MS(S);const C=a.getQueryCache().get(S.queryHash);OS(S,c,C)}),LS(c);const[f]=w.useState(()=>new Ik(a,u,t)),[m,p,v]=f.getOptimisticResult(u,t.combine),y=!o&&t.subscribed!==!1;w.useSyncExternalStore(w.useCallback(S=>y?f.subscribe(Ot.batchCalls(S)):rn,[f,y]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),w.useEffect(()=>{f.setQueries(u,t)},[u,t,f]);const x=m.some((S,C)=>Cm(u[C],S))?m.flatMap((S,C)=>{const k=u[C];if(k&&Cm(k,S)){const A=new up(a,k);return km(k,A,c)}return[]}):[];if(x.length>0)throw Promise.all(x);const N=m.find((S,C)=>{const k=u[C];return k&&DS({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 Vk(e,t,n){const a=AS(),o=RS(),c=Ui(),u=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=c.getQueryCache().get(u.queryHash);u._optimisticResults=a?"isRestoring":"optimistic",MS(u),OS(u,o,f),LS(o);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(b=>{const x=y?p.subscribe(Ot.batchCalls(b)):rn;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),w.useEffect(()=>{p.setOptions(u)},[u,p]),Cm(u,v))throw km(u,p,o);if(DS({result:v,errorResetBoundary:o,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw v.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(u,v),u.experimental_prefetchInRender&&!Ca&&Fk(v,a)&&(m?km(u,p,o):f?.promise)?.catch(rn).finally(()=>{p.updateResult()}),u.notifyOnChangeProps?v:p.trackResult(v)}function xa(e,t){return Vk(e,up)}function gl(e,t){const n=Ui(),[a]=w.useState(()=>new Pk(n,e));w.useEffect(()=>{a.setOptions(e)},[a,e]);const o=w.useSyncExternalStore(w.useCallback(u=>a.subscribe(Ot.batchCalls(u)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=w.useCallback((u,f)=>{a.mutate(u,f).catch(rn)},[a]);if(o.error&&lp(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}var Kc=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Ph(e){const t=w.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Qk(e,t,n={},a={}){w.useEffect(()=>{if(!e.current||a.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([c])=>{t(c)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,a.disabled,e])}function Yk(e){const t=w.useRef(null);return w.useImperativeHandle(e,()=>t.current,[]),t}var Jk=!1;function al(e){return e[e.length-1]}function Xk(e){return typeof e=="function"}function Ei(e,t){return Xk(e)?e(t):e}var Wk=Object.prototype.hasOwnProperty,gb=Object.prototype.propertyIsEnumerable,ez=()=>Object.create(null),ua=(e,t)=>pa(e,t,ez);function pa(e,t,n=()=>({}),a=0){if(e===t)return e;if(a>500)return t;const o=t,c=bb(e)&&bb(o);if(!c&&!(Su(e)&&Su(o)))return o;const u=c?e:yb(e);if(!u)return o;const f=c?o:yb(o);if(!f)return o;const m=u.length,p=f.length,v=c?new Array(p):n();let y=0;for(let b=0;b<p;b++){const x=c?b:f[b],N=e[x],S=o[x];if(N===S){v[x]=N,(c?b<m:Wk.call(e,x))&&y++;continue}if(N===null||S===null||typeof N!="object"||typeof S!="object"){v[x]=S;continue}const C=pa(N,S,n,a+1);v[x]=C,C===N&&y++}return m===p&&y===m?e:v}function yb(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!gb.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const a=t;for(const o of n){if(!gb.call(e,o))return!1;a.push(o)}return a}function Su(e){if(!vb(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!vb(n)||!n.hasOwnProperty("isPrototypeOf"))}function vb(e){return Object.prototype.toString.call(e)==="[object Object]"}function bb(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sa(e,t,n){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,o=e.length;a<o;a++)if(!Sa(e[a],t[a],n))return!1;return!0}if(Su(e)&&Su(t)){const a=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!a||t[u]!==void 0)&&!Sa(e[u],t[u],n))return!1;return!0}let o=0;if(!a)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let c=0;for(const u in t)if((!a||t[u]!==void 0)&&(c++,c>o||!Sa(e[u],t[u],n)))return!1;return o===c}return!1}function Pr(e){let t,n;const a=new Promise((o,c)=>{t=o,n=c});return a.status="pending",a.resolve=o=>{a.status="resolved",a.value=o,t(o),e?.(o)},a.reject=o=>{a.status="rejected",n(o)},a}function rl(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function tz(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function xb(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return tz(t)}var nz=["http:","https:","mailto:","tel:"];function ju(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ho(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 n=0,a="",o;for(;(o=t.exec(e))!==null;)a+=xb(e.slice(n,o.index))+o[0],n=t.lastIndex;a=a+xb(n?e.slice(n):e);let c=!1;return a.startsWith("//")&&(c=!0,a="/"+a.replace(/^\/+/,"")),{path:a,handledProtocolRelativeURL:c}}function sz(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function wu(e){const t=new Map;let n,a;const o=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,n=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 o(u),u.value},set(c,u){if(t.size>=e&&n){const m=n;t.delete(m.key),m.next&&(n=m.next,m.next.prev=void 0),m===a&&(a=void 0)}const f=t.get(c);if(f)f.value=u,o(f);else{const m={key:c,value:u,prev:a};a&&(a.next=m),a=m,n||(n=m),t.set(c,m)}},clear(){t.clear(),n=void 0,a=void 0}}}var iz="Invariant failed";function Mi(e,t){if(!e)throw new Error(iz)}var ga=4,$S=5;function az(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function fp(e,t,n=new Uint16Array(6)){const a=e.indexOf("/",t),o=a===-1?e.length:a,c=e.substring(t,o);if(!c||!c.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(c==="$"){const f=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(c.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const u=az(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 n[0]=3,n[1]=t+f,n[2]=t+v,n[3]=t+y,n[4]=t+m+1,n[5]=o,n}}else if(p===36){const v=f+1,y=f+2;return y===m?(n[0]=2,n[1]=t+f,n[2]=t+v,n[3]=t+y,n[4]=t+m+1,n[5]=e.length,n):(n[0]=1,n[1]=t+f,n[2]=t+y,n[3]=t+m,n[4]=t+m+1,n[5]=o,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function qu(e,t,n,a,o,c,u){u?.(n);let f=a;{const m=n.fullPath??n.from,p=m.length,v=n.options?.caseSensitive??e,y=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<p;){const x=fp(m,f,t);let N;const S=f,C=x[5];switch(f=C+1,c++,x[0]){case 0:{const k=m.substring(x[2],x[3]);if(v){const A=o.static?.get(k);if(A)N=A;else{o.static??=new Map;const T=ya(n.fullPath??n.from);T.parent=o,T.depth=c,N=T,o.static.set(k,T)}}else{const A=k.toLowerCase(),T=o.staticInsensitive?.get(A);if(T)N=T;else{o.staticInsensitive??=new Map;const z=ya(n.fullPath??n.from);z.parent=o,z.depth=c,N=z,o.staticInsensitive.set(A,z)}}break}case 1:{const k=m.substring(S,x[1]),A=m.substring(x[4],C),T=v&&!!(k||A),z=k?T?k:k.toLowerCase():void 0,M=A?T?A:A.toLowerCase():void 0,$=!y&&o.dynamic?.find(E=>!E.skipOnParamError&&E.caseSensitive===T&&E.prefix===z&&E.suffix===M);if($)N=$;else{const E=Ih(1,n.fullPath??n.from,T,z,M);N=E,E.depth=c,E.parent=o,o.dynamic??=[],o.dynamic.push(E)}break}case 3:{const k=m.substring(S,x[1]),A=m.substring(x[4],C),T=v&&!!(k||A),z=k?T?k:k.toLowerCase():void 0,M=A?T?A:A.toLowerCase():void 0,$=!y&&o.optional?.find(E=>!E.skipOnParamError&&E.caseSensitive===T&&E.prefix===z&&E.suffix===M);if($)N=$;else{const E=Ih(3,n.fullPath??n.from,T,z,M);N=E,E.parent=o,E.depth=c,o.optional??=[],o.optional.push(E)}break}case 2:{const k=m.substring(S,x[1]),A=m.substring(x[4],C),T=v&&!!(k||A),z=k?T?k:k.toLowerCase():void 0,M=A?T?A:A.toLowerCase():void 0,$=Ih(2,n.fullPath??n.from,T,z,M);N=$,$.parent=o,$.depth=c,o.wildcard??=[],o.wildcard.push($)}}o=N}if(y&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=ya(n.fullPath??n.from);x.kind=$S,x.parent=o,c++,x.depth=c,o.pathless??=[],o.pathless.push(x),o=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&m.endsWith("/")){const x=ya(n.fullPath??n.from);x.kind=ga,x.parent=o,c++,x.depth=c,o.index=x,o=x}o.parse=n.options?.params?.parse??null,o.skipOnParamError=y,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,b&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const m of n.children)qu(e,t,m,f,o,c,u)}function Uh(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 zi(e){if(e.pathless)for(const t of e.pathless)zi(t);if(e.static)for(const t of e.static.values())zi(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())zi(t);if(e.dynamic?.length){e.dynamic.sort(Uh);for(const t of e.dynamic)zi(t)}if(e.optional?.length){e.optional.sort(Uh);for(const t of e.optional)zi(t)}if(e.wildcard?.length){e.wildcard.sort(Uh);for(const t of e.wildcard)zi(t)}}function ya(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 Ih(e,t,n,a,o){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:n,prefix:a,suffix:o}}function rz(e,t){const n=ya("/"),a=new Uint16Array(6);for(const o of e)qu(!1,a,o,1,n,0);zi(n),t.masksTree=n,t.flatCache=wu(1e3)}function oz(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const a=hp(e,t.masksTree);return t.flatCache.set(e,a),a}function lz(e,t,n,a,o){e||="/",a||="/";const c=t?`case\0${e}`:e;let u=o.singleCache.get(c);return u||(u=ya("/"),qu(t,new Uint16Array(6),{from:e},1,u,0),o.singleCache.set(c,u)),hp(a,u,n)}function cz(e,t,n=!1){const a=n?e:`nofuzz\0${e}`,o=t.matchCache.get(a);if(o!==void 0)return o;e||="/";let c;try{c=hp(e,t.segmentTree,n)}catch(u){if(u instanceof URIError)c=null;else throw u}return c&&(c.branch=fz(c.route)),t.matchCache.set(a,c),c}function uz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function dz(e,t=!1,n){const a=ya(e.fullPath),o=new Uint16Array(6),c={},u={};let f=0;return qu(t,o,e,1,a,0,m=>{if(n?.(m,f),Mi(!(m.id in c),`Duplicate routes found with id: ${String(m.id)}`),c[m.id]=m,f!==0&&m.path){const p=uz(m.fullPath);(!u[p]||m.fullPath.endsWith("/"))&&(u[p]=m)}f++}),zi(a),{processedTree:{segmentTree:a,singleCache:wu(1e3),matchCache:wu(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:u}}function hp(e,t,n=!1){const a=e.split("/"),o=mz(e,a,t,n);if(!o)return null;const[c]=PS(e,a,o);return{route:o.node.route,rawParams:c,parsedParams:o.parsedParams}}function PS(e,t,n){const a=hz(n.node);let o=null;const c=Object.create(null);let u=n.extract?.part??0,f=n.extract?.node??0,m=n.extract?.path??0,p=n.extract?.segment??0;for(;f<a.length;u++,f++,m++,p++){const v=a[f];if(v.kind===ga)break;if(v.kind===$S){p--,u--,m--;continue}const y=t[u],b=m;if(y&&(m+=y.length),v.kind===1){o??=n.node.fullPath.split("/");const x=o[p],N=v.prefix?.length??0;if(x.charCodeAt(N)===123){const S=v.suffix?.length??0,C=x.substring(N+2,x.length-S-1),k=y.substring(N,y.length-S);c[C]=decodeURIComponent(k)}else{const S=x.substring(1);c[S]=decodeURIComponent(y)}}else if(v.kind===3){if(n.skipped&1<<f){u--,m=b-1;continue}o??=n.node.fullPath.split("/");const x=o[p],N=v.prefix?.length??0,S=v.suffix?.length??0,C=x.substring(N+3,x.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 x=v,N=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),S=decodeURIComponent(N);c["*"]=S,c._splat=S;break}}return n.rawParams&&Object.assign(c,n.rawParams),[c,{part:u,node:f,path:m,segment:p}]}function fz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function hz(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mz(e,t,n,a){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!al(t),c=o&&e!=="/",u=t.length-(o?1:0),f=[{node:n,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:b,index:x,skipped:N,depth:S,statics:C,dynamics:k,optionals:A}=y;let{extract:T,rawParams:z,parsedParams:M}=y;if(b.skipOnParamError){if(!Bh(e,t,y))continue;z=y.rawParams,T=y.extract,M=y.parsedParams}a&&b.route&&b.kind!==ga&&Go(p,y)&&(p=y);const $=x===u;if($&&(b.route&&!c&&Go(v,y)&&(v=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const E=$?void 0:t[x];let O;if($&&b.index){const K={node:b.index,index:x,skipped:N,depth:S+1,statics:C,dynamics:k,optionals:A,extract:T,rawParams:z,parsedParams:M};let W=!0;if(b.index.skipOnParamError&&(Bh(e,t,K)||(W=!1)),W){if(C===u&&!k&&!A&&!N)return K;Go(v,K)&&(v=K)}}if(b.wildcard&&Go(m,y))for(const K of b.wildcard){const{prefix:W,suffix:J}=K;if(W&&($||!(K.caseSensitive?E:O??=E.toLowerCase()).startsWith(W)))continue;if(J){if($)continue;const fe=t.slice(x).join("/").slice(-J.length);if((K.caseSensitive?fe:fe.toLowerCase())!==J)continue}const ne={node:K,index:u,skipped:N,depth:S,statics:C,dynamics:k,optionals:A,extract:T,rawParams:z,parsedParams:M};if(!(K.skipOnParamError&&!Bh(e,t,ne))){m=ne;break}}if(b.optional){const K=N|1<<S,W=S+1;for(let J=b.optional.length-1;J>=0;J--){const ne=b.optional[J];f.push({node:ne,index:x,skipped:K,depth:W,statics:C,dynamics:k,optionals:A,extract:T,rawParams:z,parsedParams:M})}if(!$)for(let J=b.optional.length-1;J>=0;J--){const ne=b.optional[J],{prefix:fe,suffix:Ee}=ne;if(fe||Ee){const xe=ne.caseSensitive?E:O??=E.toLowerCase();if(fe&&!xe.startsWith(fe)||Ee&&!xe.endsWith(Ee))continue}f.push({node:ne,index:x+1,skipped:N,depth:W,statics:C,dynamics:k,optionals:A+1,extract:T,rawParams:z,parsedParams:M})}}if(!$&&b.dynamic&&E)for(let K=b.dynamic.length-1;K>=0;K--){const W=b.dynamic[K],{prefix:J,suffix:ne}=W;if(J||ne){const fe=W.caseSensitive?E:O??=E.toLowerCase();if(J&&!fe.startsWith(J)||ne&&!fe.endsWith(ne))continue}f.push({node:W,index:x+1,skipped:N,depth:S+1,statics:C,dynamics:k+1,optionals:A,extract:T,rawParams:z,parsedParams:M})}if(!$&&b.staticInsensitive){const K=b.staticInsensitive.get(O??=E.toLowerCase());K&&f.push({node:K,index:x+1,skipped:N,depth:S+1,statics:C+1,dynamics:k,optionals:A,extract:T,rawParams:z,parsedParams:M})}if(!$&&b.static){const K=b.static.get(E);K&&f.push({node:K,index:x+1,skipped:N,depth:S+1,statics:C+1,dynamics:k,optionals:A,extract:T,rawParams:z,parsedParams:M})}if(b.pathless){const K=S+1;for(let W=b.pathless.length-1;W>=0;W--){const J=b.pathless[W];f.push({node:J,index:x,skipped:N,depth:K,statics:C,dynamics:k,optionals:A,extract:T,rawParams:z,parsedParams:M})}}}if(v&&m)return Go(m,v)?v:m;if(v)return v;if(m)return m;if(a&&p){let y=p.index;for(let x=0;x<p.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return p.rawParams??=Object.create(null),p.rawParams["**"]=decodeURIComponent(b),p}return null}function Bh(e,t,n){try{const[a,o]=PS(e,t,n);n.rawParams=a,n.extract=o;const c=n.node.parse(a);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,c),!0}catch{return null}}function Go(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===ga)>(e.node.kind===ga)||t.node.kind===ga==(e.node.kind===ga)&&t.depth>e.depth))):!0}function uu(e){return mp(e.filter(t=>t!==void 0).join("/"))}function mp(e){return e.replace(/\/{2,}/g,"/")}function US(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 IS(e){return Ri(US(e))}function Nu(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function pz(e,t,n){return Nu(e,n)===Nu(t,n)}function gz({base:e,to:t,trailingSlash:n="never",cache:a}){const o=t.startsWith("/"),c=!o&&t===".";let u;if(a){u=o?t:c?e:e+"\0"+t;const y=a.get(u);if(y)return y}let f;if(c)f=e.split("/");else if(o)f=t.split("/");else{for(f=e.split("/");f.length>1&&al(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const N=y[b];N===""?b?b===x-1&&f.push(N):f=[N]:N===".."?f.pop():N==="."||f.push(N)}}f.length>1&&(al(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let m,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;m=fp(b,0,m);const x=m[0];if(x===0){p+=b;continue}const N=m[5],S=b.substring(0,m[1]),C=b.substring(m[4],N),k=b.substring(m[2],m[3]);x===1?p+=S||C?`${S}{$${k}}${C}`:`$${k}`:x===2?p+=S||C?`${S}{$}${C}`:"$":p+=`${S}{-$${k}}${C}`}p=mp(p);const v=p||"/";return u&&a&&a.set(u,v),v}function yz(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),a=new RegExp(n,"g");return o=>o.replace(a,c=>t.get(c)??c)}function qh(e,t,n){const a=t[e];return typeof a!="string"?a:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(a)?a:a.split("/").map(o=>jb(o,n)).join("/"):jb(a,n)}function Sb({path:e,params:t,decoder:n,...a}){let o=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:o};const u=e.length;let f=0,m,p="";for(;f<u;){const v=f;m=fp(e,v,m);const y=m[5];if(f=y+1,v===y)continue;const b=m[0];if(b===0){p+="/"+e.substring(v,y);continue}if(b===2){const x=t._splat;c._splat=x,c["*"]=x;const N=e.substring(v,m[1]),S=e.substring(m[4],y);if(!x){o=!0,(N||S)&&(p+="/"+N+S);continue}const C=qh("_splat",t,n);p+="/"+N+C+S;continue}if(b===1){const x=e.substring(m[2],m[3]);!o&&!(x in t)&&(o=!0),c[x]=t[x];const N=e.substring(v,m[1]),S=e.substring(m[4],y),C=qh(x,t,n)??"undefined";p+="/"+N+C+S;continue}if(b===3){const x=e.substring(m[2],m[3]),N=t[x];if(N==null)continue;c[x]=N;const S=e.substring(v,m[1]),C=e.substring(m[4],y),k=qh(x,t,n)??"";p+="/"+S+k+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:o}}function jb(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function mn(e){return!!e?.isNotFound}function vz(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var zm="tsr-scroll-restoration-v1_3",bz=(e,t)=>{let n;return(...a)=>{n||(n=setTimeout(()=>{e(...a),n=null},t))}};function xz(){const e=vz();if(!e)return null;const t=e.getItem(zm);let n=t?JSON.parse(t):{};return{state:n,set:a=>{n=Ei(a,n)||n;try{e.setItem(zm,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Hc=xz(),Sz=e=>e.state.__TSR_key||e.href;function jz(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}var Cu=!1;function wz({storageKey:e,key:t,behavior:n,shouldScrollRestoration:a,scrollToTopSelectors:o,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];Cu=!0;e:{if(a&&m&&Object.keys(m).length>0){for(const y in m){const b=m[y];if(y==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const p=(c??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(p);b&&b.scrollIntoView(y)}break e}const v={top:0,left:0,behavior:n};if(window.scrollTo(v),o)for(const y of o){if(y==="window")continue;const b=typeof y=="function"?y():document.querySelector(y);b&&b.scrollTo(v)}}Cu=!1}function Nz(e,t){if(!Hc||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Hc))return;e.isScrollRestorationSetup=!0,Cu=!1;const n=e.options.getScrollRestorationKey||Sz;window.history.scrollRestoration="manual";const a=o=>{if(Cu||!e.isScrollRestoring)return;let c="";if(o.target===document||o.target===window)c="window";else{const f=o.target.getAttribute("data-scroll-restoration-id");f?c=`[data-scroll-restoration-id="${f}"]`:c=jz(o.target)}const u=n(e.state.location);Hc.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",bz(a,100),!0),e.subscribe("onRendered",o=>{const c=n(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(wz({storageKey:zm,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Hc.set(u=>(u[c]||={},u)))})}function Cz(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function kz(e,t=String){const n=new URLSearchParams;for(const a in e){const o=e[a];o!==void 0&&n.set(a,t(o))}return n.toString()}function Kh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function zz(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[a,o]of t.entries()){const c=n[a];c==null?n[a]=Kh(o):Array.isArray(c)?c.push(Kh(o)):n[a]=[c,Kh(o)]}return n}var _z=Tz(JSON.parse),Ez=Az(JSON.stringify,JSON.parse);function Tz(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=zz(t);for(const a in n){const o=n[a];if(typeof o=="string")try{n[a]=e(o)}catch{}}return n}}function Az(e,t){const n=typeof t=="function";function a(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const c=kz(o,a);return c?`?${c}`:""}}var ja="__root__";function pp(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 n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Nn(e){return e instanceof Response&&!!e.options}function Rz(e){return{input:({url:t})=>{for(const n of e)t=_m(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=BS(e[n],t);return t}}}function Oz(e){const t=IS(e.basepath),n=`/${t}`,a=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),c=e.caseSensitive?a:a.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===o?u.pathname="/":f.startsWith(c)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=uu(["/",t,u.pathname]),u)}}function _m(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function BS(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}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 qS({update:e,notify:t,unwatched:n}){return{link:a,unlink:o,propagate:c,checkDirty:u,shallowPropagate:f};function a(p,v,y){const b=v.depsTail;if(b!==void 0&&b.dep===p)return;const x=b!==void 0?b.nextDep:v.deps;if(x!==void 0&&x.dep===p){x.version=y,v.depsTail=x;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:b,nextDep:x,prevSub:N,nextSub:void 0};x!==void 0&&(x.prevDep=S),b!==void 0?b.nextDep=S:v.deps=S,N!==void 0?N.nextSub=S:p.subs=S}function o(p,v=p.sub){const y=p.dep,b=p.prevDep,x=p.nextDep,N=p.nextSub,S=p.prevSub;return x!==void 0?x.prevDep=b:v.depsTail=b,b!==void 0?b.nextDep=x:v.deps=x,N!==void 0?N.prevSub=S:y.subsTail=S,S!==void 0?S.nextSub=N:(y.subs=N)===void 0&&n(y),x}function c(p){let v=p.nextSub,y;e:do{const b=p.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&m(p,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const N=b.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,b=0,x=!1;e:do{const N=p.dep,S=N.flags;if(v.flags&16)x=!0;else if((S&17)===17){if(e(N)){const C=N.subs;C.nextSub!==void 0&&f(C),x=!0}}else if((S&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=N.deps,v=N,++b;continue}if(!x){const C=p.nextDep;if(C!==void 0){p=C;continue}}for(;b--;){const C=v.subs,k=C.nextSub!==void 0;if(k?(p=y.value,y=y.prev):p=C,x){if(e(v)){k&&f(C),v=p.sub;continue}x=!1}else v.flags&=-33;v=p.sub;const A=p.nextDep;if(A!==void 0){p=A;continue e}}return x}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 gp=0,da=0,Wo=0;const Fs=[],{link:gP,unlink:KS,propagate:yP,checkDirty:Lz,shallowPropagate:vP}=qS({update(e){return e.depsTail!==void 0?Pz(e):Uz(e)},notify(e){let t=Wo,n=t;do if(Fs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Wo=t;n<--t;){const a=Fs[n];Fs[n++]=Fs[t],Fs[t]=a}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Ku(e)):qz.call(e)}});function Dz(){return gp}function Mz(){++gp}function $z(){--gp||Bz()}function Pz(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Ku(e)}}function Uz(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function Iz(e){const t=e.flags;if(t&16||t&32&&Lz(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Ku(e)}}else e.flags=2}function Bz(){try{for(;da<Wo;){const e=Fs[da];Fs[da++]=void 0,Iz(e)}}finally{for(;da<Wo;){const e=Fs[da];Fs[da++]=void 0,e.flags|=10}da=0,Wo=0}}function qz(){this.depsTail=void 0,this.flags=0,Ku(this);const e=this.subs;e!==void 0&&KS(e)}function Ku(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=KS(n,e)}function yp(e,t,n){const a=typeof e=="object",o=a?e:void 0;return{next:(a?e.next:e)?.bind(o),error:(a?e.error:t)?.bind(o),complete:(a?e.complete:n)?.bind(o)}}const Em=[];let du=0;const{link:wb,unlink:Kz,propagate:Hz,checkDirty:HS,shallowPropagate:Nb}=qS({update(e){return e._update()},notify(e){Em[Tm++]=e,e.flags&=~jt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=jt.Mutable|jt.Dirty,ku(e))}});let Gc=0,Tm=0,js;function ku(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Kz(n,e)}function GS(){if(!(Dz()>0)){for(;Gc<Tm;){const e=Em[Gc];Em[Gc++]=void 0,e.notify()}Gc=0,Tm=0}}function FS(e,t){const n=typeof e=="function",a=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?jt.None:jt.Mutable,get(){return js!==void 0&&wb(o,js,du),o._snapshot},subscribe(c){const u=yp(c),f={current:!1},m=Gz(()=>{o.get(),f.current?u.next?.(o._snapshot):f.current=!0});return{unsubscribe:()=>{m.stop()}}},_update(c){const u=js,f=Object.is;if(n)js=o,++du,o.depsTail=void 0;else if(c===void 0)return!1;n&&(o.flags=jt.Mutable|jt.RecursedCheck);try{const m=o._snapshot,p=typeof c=="function"?c(m):c===void 0&&n?a(m):c;return m===void 0||!f(m,p)?(o._snapshot=p,!0):!1}finally{js=u,n&&(o.flags&=~jt.RecursedCheck),ku(o)}}};return n?(o.flags=jt.Mutable|jt.Dirty,o.get=function(){const c=o.flags;if(c&jt.Dirty||c&jt.Pending&&HS(o.deps,o)){if(o._update()){const u=o.subs;u!==void 0&&Nb(u)}}else c&jt.Pending&&(o.flags=c&~jt.Pending);return js!==void 0&&wb(o,js,du),o._snapshot}):o.set=function(c){if(o._update(c)){const u=o.subs;u!==void 0&&(Hz(u),Nb(u),GS())}},o}function Gz(e){const t=()=>{const a=js;js=n,++du,n.depsTail=void 0,n.flags=jt.Watching|jt.RecursedCheck;try{return e()}finally{js=a,n.flags&=~jt.RecursedCheck,ku(n)}},n={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&&HS(this.deps,this)?t():this.flags=jt.Watching},stop(){this.flags=jt.None,this.depsTail=void 0,ku(this)}};return t(),n}class Fz{constructor(t){this.atom=FS(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(yp(t))}}class Zz{constructor(t){this.atom=FS(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(yp(t))}}function Vz(e){return typeof e=="function"?new Zz(e):new Fz(e)}function Qz(e){try{Mz(),e()}finally{$z(),GS()}}function el(e){let t;return Qz(()=>{t=e()}),t}var Am=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Hu=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),wa=(e,t,n=!0)=>{const a={...e.router.options.context??{}},o=n?t:t-1;for(let c=0;c<=o;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},Cb=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,a=e.matches.findIndex(u=>u.routeId===e.router.routeTree.id),o=a>=0?a:0;let c=n?e.matches.findIndex(u=>u.routeId===n):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=o);for(let u=c;u>=0;u--){const f=e.matches[u];if(e.router.looseRoutesById[f.routeId].options.notFoundComponent)return u}return n?c:o},Ti=(e,t,n)=>{if(!(!Nn(n)&&!mn(n)))throw Nn(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:Nn(n)?"redirected":a.status==="pending"?"success":a.status,context:wa(e,t.index),isFetching:!1,error:n})),mn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Nn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},ZS=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},kb=(e,t,n)=>{const a=wa(e,n);e.updateMatch(t,o=>({...o,context:a}))},Fo=(e,t,n,a)=>{const{id:o,routeId:c}=e.matches[t],u=e.router.looseRoutesById[c];if(n instanceof Promise)throw n;n.routerCode=a,e.firstBadMatchIndex??=t,Ti(e,e.router.getMatch(o),n);try{u.options.onError?.(n)}catch(f){n=f,Ti(e,e.router.getMatch(o),n)}e.updateMatch(o,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Nn(n)&&!mn(n)&&(e.serialError??=n)},VS=(e,t,n,a)=>{if(a._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Hu(e,t)&&(n.options.loader||n.options.beforeLoad||YS(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const c=setTimeout(()=>{Am(e)},o);a._nonReactive.pendingTimeout=c}},Yz=(e,t,n)=>{const a=e.router.getMatch(t);if(!a._nonReactive.beforeLoadPromise&&!a._nonReactive.loaderPromise)return;VS(e,t,n,a);const o=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&Ti(e,c,c.error)};return a._nonReactive.beforeLoadPromise?a._nonReactive.beforeLoadPromise.then(o):o()},Jz=(e,t,n,a)=>{const o=e.router.getMatch(t);let c=o._nonReactive.loadPromise;o._nonReactive.loadPromise=Pr(()=>{c?.resolve(),c=void 0});const{paramsError:u,searchError:f}=o;u&&Fo(e,n,u,"PARSE_PARAMS"),f&&Fo(e,n,f,"VALIDATE_SEARCH"),VS(e,t,a,o);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=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,z=>({...z,isFetching:!1}))};if(!a.options.beforeLoad){el(()=>{v(),y()});return}o._nonReactive.beforeLoadPromise=Pr();const b={...wa(e,n,!1),...o.__routeContext},{search:x,params:N,cause:S}=o,C=Hu(e,t),k={search:x,abortController:m,params:N,preload:C,context:b,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},A=z=>{if(z===void 0){el(()=>{v(),y()});return}(Nn(z)||mn(z))&&(v(),Fo(e,n,z,"BEFORE_LOAD")),el(()=>{v(),e.updateMatch(t,M=>({...M,__beforeLoadContext:z})),y()})};let T;try{if(T=a.options.beforeLoad(k),rl(T))return v(),T.catch(z=>{Fo(e,n,z,"BEFORE_LOAD")}).then(A)}catch(z){v(),Fo(e,n,z,"BEFORE_LOAD")}A(T)},Xz=(e,t)=>{const{id:n,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a],c=()=>f(),u=()=>Jz(e,n,t,o),f=()=>{if(ZS(e,n))return;const m=Yz(e,n,o);return rl(m)?m.then(u):u()};return c()},Wz=(e,t,n)=>{const a=e.router.getMatch(t);if(!a||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:a,params:a.params,loaderData:a.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([c,u,f])=>({meta:c?.meta,links:c?.links,headScripts:c?.scripts,headers:f,scripts:u,styles:c?.styles}))},QS=(e,t,n,a,o)=>{const c=t[a-1],{params:u,loaderDeps:f,abortController:m,cause:p}=e.router.getMatch(n),v=wa(e,a),y=Hu(e,n);return{params:u,deps:f,preload:!!y,parentMatchPromise:c,abortController:m,context:v,location:e.location,navigate:b=>e.router.navigate({...b,_fromLocation:e.location}),cause:y?"preload":p,route:o,...e.router.options.additionalContext}},zb=async(e,t,n,a,o)=>{try{const c=e.router.getMatch(n);try{(!(Jk??e.router.isServer)||c.ssr===!0)&&ol(o);const u=o.options.loader,f=typeof u=="function"?u:u?.handler,m=f?.(QS(e,t,n,a,o)),p=!!f&&rl(m);if((p||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||c._nonReactive.minPendingPromise)&&e.updateMatch(n,y=>({...y,isFetching:"loader"})),f){const y=p?await m:m;Ti(e,e.router.getMatch(n),y),y!==void 0&&e.updateMatch(n,b=>({...b,loaderData:y}))}o._lazyPromise&&await o._lazyPromise;const v=c._nonReactive.minPendingPromise;v&&await v,o._componentsPromise&&await o._componentsPromise,e.updateMatch(n,y=>({...y,error:void 0,context:wa(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(n,p=>({...p,status:p.status==="pending"?"success":p.status,isFetching:!1,context:wa(e,a)}));return}const m=c._nonReactive.minPendingPromise;m&&await m,mn(u)&&await o.options.notFoundComponent?.preload?.(),Ti(e,e.router.getMatch(n),u);try{o.options.onError?.(u)}catch(p){f=p,Ti(e,e.router.getMatch(n),p)}!Nn(f)&&!mn(f)&&await ol(o,["errorComponent"]),e.updateMatch(n,p=>({...p,error:f,context:wa(e,a),status:"error",isFetching:!1}))}}catch(c){const u=e.router.getMatch(n);u&&(u._nonReactive.loaderPromise=void 0),Ti(e,u,c)}},e_=async(e,t,n)=>{async function a(x,N,S,C,k){const A=Date.now()-N.updatedAt,T=x?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,z=k.options.shouldReload,M=typeof z=="function"?z(QS(e,t,o,n,k)):z,{status:$,invalid:E}=C,O=A>T&&(!!e.forceStaleReload||C.cause==="enter"||S!==void 0&&S!==C.id);u=$==="success"&&(E||(M??O)),x&&k.options.preload===!1||(u&&!e.sync&&v?(f=!0,(async()=>{try{await zb(e,t,o,n,k);const K=e.router.getMatch(o);K._nonReactive.loaderPromise?.resolve(),K._nonReactive.loadPromise?.resolve(),K._nonReactive.loaderPromise=void 0,K._nonReactive.loadPromise=void 0}catch(K){Nn(K)&&await e.router.navigate(K.options)}})()):$!=="success"||u?await zb(e,t,o,n,k):kb(e,o,n))}const{id:o,routeId:c}=e.matches[n];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(ZS(e,o)){if(!e.router.getMatch(o))return e.matches[n];kb(e,o,n)}else{const x=e.router.getMatch(o),N=e.router.state.matches[n]?.routeId===c?e.router.state.matches[n].id:e.router.state.matches.find(C=>C.routeId===c)?.id,S=Hu(e,o);if(x._nonReactive.loaderPromise){if(x.status==="success"&&!e.sync&&!x.preload&&v)return x;await x._nonReactive.loaderPromise;const C=e.router.getMatch(o),k=C._nonReactive.error||C.error;k&&Ti(e,C,k),C.status==="pending"&&await a(S,x,N,C,m)}else{const C=S&&!e.router.state.matches.some(A=>A.id===o),k=e.router.getMatch(o);k._nonReactive.loaderPromise=Pr(),C!==k.preload&&e.updateMatch(o,A=>({...A,preload:C})),await a(S,x,N,k,m)}}const y=e.router.getMatch(o);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 b=f?y.isFetching:!1;return b!==y.isFetching||y.invalid!==!1?(e.updateMatch(o,x=>({...x,isFetching:b,invalid:!1})),e.router.getMatch(o)):y};async function _b(e){const t=e,n=[];t.router.state.matches.some(b=>b._forcePending)&&Am(t);let a;for(let b=0;b<t.matches.length;b++){try{const x=Xz(t,b);rl(x)&&await x}catch(x){if(Nn(x))throw x;if(mn(x))a=x;else if(!t.preload)throw x;break}if(t.serialError)break}const o=t.firstBadMatchIndex??t.matches.length,c=a&&!t.preload?Cb(t,a):void 0,u=a&&t.preload?0:c!==void 0?Math.min(c+1,o):o;let f,m;for(let b=0;b<u;b++)n.push(e_(t,n,b));try{await Promise.all(n)}catch{const b=await Promise.allSettled(n);for(const x of b){if(x.status!=="rejected")continue;const N=x.reason;if(Nn(N))throw N;mn(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 b=Cb(t,p);Mi(b!==void 0);const x=t.matches[b],N=t.router.looseRoutesById[x.routeId],S=t.router.options?.defaultNotFoundComponent;!N.options.notFoundComponent&&S&&(N.options.notFoundComponent=S),p.routeId=x.routeId;const C=x.routeId===t.router.routeTree.id;t.updateMatch(x.id,k=>({...k,...C?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),v=b,await ol(N,["notFoundComponent"])}else if(!t.preload){const b=t.matches[0];b.globalNotFound||t.router.getMatch(b.id)?.globalNotFound&&t.updateMatch(b.id,x=>({...x,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const b=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await ol(b,["errorComponent"])}for(let b=0;b<=v;b++){const{id:x,routeId:N}=t.matches[b],S=t.router.looseRoutesById[N];try{const C=Wz(t,x,S);if(C){const k=await C;t.updateMatch(x,A=>({...A,...k}))}}catch(C){console.error(`Error executing head for route ${N}:`,C)}}const y=Am(t);if(rl(y)&&await y,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Eb(e,t){const n=t.map(a=>e.options[a]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function ol(e,t=fu){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(a=>{const{id:o,...c}=a.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===fu?(()=>{if(e._componentsPromise===void 0){const a=Eb(e,fu);a?e._componentsPromise=a.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Eb(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function YS(e){for(const t of fu)if(e.options[t]?.preload)return!0;return!1}var fu=["component","errorComponent","pendingComponent","notFoundComponent"],Oi="__TSR_index",Tb="popstate",Ab="beforeunload";function t_(e){let t=e.getLocation();const n=new Set,a=u=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:u}))},o=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 b=zu(m.path,m.state);if(await y.blockerFn({currentLocation:t,nextLocation:b,action:m.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,f,m)=>{const p=t.state[Oi];f=Rb(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[Oi];f=Rb(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),o({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{c({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{c({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Oi]!==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 Rb(e,t){t||(t={});const n=vp();return{...t,key:n,__TSR_key:n,[Oi]:e}}function n_(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,a=t.history.replaceState;let o=[];const c=()=>o,u=O=>o=O,f=(O=>O),m=(()=>zu(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=vp();t.history.replaceState({[Oi]:0,key:O,__TSR_key:O},"")}let p=m(),v,y=!1,b=!1,x=!1,N=!1;const S=()=>p;let C,k;const A=()=>{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)},T=(O,K,W)=>{const J=f(K);k||(v=p),p=zu(K,W),C={href:J,state:W,isPush:C?.isPush||O==="push"},k||(k=Promise.resolve().then(()=>A()))},z=O=>{p=m(),E.notify({type:O})},M=async()=>{if(b){b=!1;return}const O=m(),K=O.state[Oi]-p.state[Oi],W=K===1,J=K===-1,ne=!W&&!J||y;y=!1;const fe=ne?"GO":J?"BACK":"FORWARD",Ee=ne?{type:"GO",index:K}:{type:J?"BACK":"FORWARD"};if(x)x=!1;else{const xe=c();if(typeof document<"u"&&xe.length){for(const H of xe)if(await H.blockerFn({currentLocation:p,nextLocation:O,action:fe})){b=!0,t.history.go(1),E.notify(Ee);return}}}p=m(),E.notify(Ee)},$=O=>{if(N){N=!1;return}let K=!1;const W=c();if(typeof document<"u"&&W.length)for(const J of W){const ne=J.enableBeforeUnload??!0;if(ne===!0){K=!0;break}if(typeof ne=="function"&&ne()===!0){K=!0;break}}if(K)return O.preventDefault(),O.returnValue=""},E=t_({getLocation:S,getLength:()=>t.history.length,pushState:(O,K)=>T("push",O,K),replaceState:(O,K)=>T("replace",O,K),back:O=>(O&&(x=!0),N=!0,t.history.back()),forward:O=>{O&&(x=!0),N=!0,t.history.forward()},go:O=>{y=!0,t.history.go(O)},createHref:O=>f(O),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=a,t.removeEventListener(Ab,$,{capture:!0}),t.removeEventListener(Tb,M)},onBlocked:()=>{v&&p!==v&&(p=v)},getBlockers:c,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(Ab,$,{capture:!0}),t.addEventListener(Tb,M),t.history.pushState=function(...O){const K=n.apply(t.history,O);return E._ignoreSubscribers||z("PUSH"),K},t.history.replaceState=function(...O){const K=a.apply(t.history,O);return E._ignoreSubscribers||z("REPLACE"),K},E}function s_(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function zu(e,t){const n=s_(e),a=n.indexOf("#"),o=n.indexOf("?"),c=vp();return{href:n,pathname:n.substring(0,a>0?o>0?Math.min(a,o):a:o>0?o:n.length),hash:a>-1?n.substring(a):"",search:o>-1?n.slice(o,a===-1?void 0:a):"",state:t||{[Oi]:0,key:c,__TSR_key:c}}}function vp(){return(Math.random()+1).toString(36).substring(7)}function Na(e){const t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function i_(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var a_=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 n=this.options,a=this.basepath??n?.basepath??"/",o=this.basepath===void 0,c=n?.rewrite;if(this.options={...n,...t},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=yz(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=n_()),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=wu(1e3),p=this.buildRouteTree(),this.setRoutes(p)}!this.__store&&this.latestLocation&&(this.__store=Vz(o_(this.latestLocation)),Nz(this));let u=!1;const f=this.options.basepath??"/",m=this.options.rewrite;if(o||a!==f||c!==m){this.basepath=f;const p=[],v=IS(f);v&&v!=="/"&&p.push(Oz({basepath:f})),m&&p.push(m),this.rewrite=p.length===0?void 0:p.length===1?p[0]:Rz(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=dz(this.routeTree,this.options.caseSensitive,(n,a)=>{n.init({originalIndex:a})});return this.options.routeMasks&&rz(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const a={eventType:t,fn:n};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{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:Ho(f).path,external:!1,searchStr:k,search:ua(n?.search,C),hash:Ho(p.slice(1)).path,state:pa(n?.state,y)}}const b=new URL(v,this.origin),x=_m(this.rewrite,b),N=this.options.parseSearch(x.search),S=this.options.stringifySearch(N);return x.search=S,{href:x.href.replace(x.origin,""),publicHref:v,pathname:Ho(x.pathname).path,external:!!this.rewrite&&x.origin!==this.origin,searchStr:S,search:ua(n?.search,N),hash:Ho(x.hash.slice(1)).path,state:pa(n?.state,y)}},o=a(t),{__tempLocation:c,__tempKey:u}=o.state;if(c&&(!u||u===this.tempLocationKey)){const f=a(c);return f.state.key=o.state.key,f.state.__TSR_key=o.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:o}}return o},this.resolvePathWithBase=(t,n)=>gz({base:t,to:mp(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,n,a)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:n},a):this.matchRoutesInternal(t,n),this.getMatchedRoutes=t=>l_({pathname:t,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=t=>{const n=this.getMatch(t);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const t=this.state.matches.filter(a=>a.status==="pending"),n=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=t=>{const n=(o={})=>{const c=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutesLightweight(c);o.from;const f=o.unsafeRelative==="path"?c.pathname:o.from??u.fullPath,m=this.resolvePathWithBase(f,"."),p=u.search,v=Object.assign(Object.create(null),u.params),y=o.to?this.resolvePathWithBase(m,`${o.to}`):this.resolvePathWithBase(m,"."),b=o.params===!1||o.params===null?Object.create(null):(o.params??!0)===!0?v:Object.assign(v,Ei(o.params,v)),x=this.getMatchedRoutes(y);let N=x.matchedRoutes;if((!x.foundRoute||x.foundRoute.path!=="/"&&x.routeParams["**"])&&this.options.notFoundRoute&&(N=[...N,this.options.notFoundRoute]),Object.keys(b).length>0)for(const K of N){const W=K.options.params?.stringify??K.options.stringifyParams;if(W)try{Object.assign(b,W(b))}catch{}}const S=t.leaveParams?y:Ho(Sb({path:y,params:b,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let C=p;if(t._includeValidateSearch&&this.options.search?.strict){const K={};N.forEach(W=>{if(W.options.validateSearch)try{Object.assign(K,hu(W.options.validateSearch,{...K,...C}))}catch{}}),C=K}C=c_({search:C,dest:o,destRoutes:N,_includeValidateSearch:t._includeValidateSearch}),C=ua(p,C);const k=this.options.stringifySearch(C),A=o.hash===!0?c.hash:o.hash?Ei(o.hash,c.hash):void 0,T=A?`#${A}`:"";let z=o.state===!0?c.state:o.state?Ei(o.state,c.state):{};z=pa(c.state,z);const M=`${S}${k}${T}`;let $,E,O=!1;if(this.rewrite){const K=new URL(M,this.origin),W=BS(this.rewrite,K);$=K.href.replace(K.origin,""),W.origin!==this.origin?(E=W.href,O=!0):E=W.pathname+W.search+W.hash}else $=sz(M),E=$;return{publicHref:E,href:$,pathname:S,search:C,searchStr:k,state:z,hash:A??"",external:O,unmaskOnReload:o.unmaskOnReload}},a=(o={},c)=>{const u=n(o);let f=c?n(c):void 0;if(!f){const m=Object.create(null);if(this.options.routeMasks){const p=oz(u.pathname,this.processedTree);if(p){Object.assign(m,p.rawParams);const{from:v,params:y,...b}=p.route,x=y===!1||y===null?Object.create(null):(y??!0)===!0?m:Object.assign(m,Ei(y,m));c={from:t.from,...b,params:x},f=n(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:n,...a})=>{const o=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const m=Sa(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=Pr(()=>{u?.resolve(),u=void 0}),c&&o())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:n})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:a,viewTransition:o,ignoreBlocker:c,href:u,...f}={})=>{if(u){const v=this.history.location.state.__TSR_index,y=zu(u,{__TSR_index:t?v:v+1}),b=new URL(y.pathname,this.origin);f.to=_m(this.rewrite,b).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:o,replace:t,resetScroll:n,hashScrollIntoView:a,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===m&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:t,reloadDocument:n,href:a,publicHref:o,...c})=>{let u=!1;if(a)try{new URL(`${a}`),u=!0}catch{}if(u&&!n&&(n=!0),n){if(t!==void 0||!a){const m=this.buildLocation({to:t,...c});a=a??m.publicHref,o=o??m.publicHref}const f=!u&&o?o:a;if(ju(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(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(a=>!t.some(o=>o.id===a.id))}))},this.load=async t=>{let n,a,o;const c=this.state.resolvedLocation??this.state.location;for(o=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const m=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Na({resolvedLocation:p,location:m})}),this.emit({type:"onBeforeLoad",...Na({resolvedLocation:p,location:m})}),await _b({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=[],b=[],x=[];el(()=>{this.__store.setState(N=>{const S=N.matches,C=N.pendingMatches||N.matches;return v=S.filter(k=>!C.some(A=>A.id===k.id)),y=S.filter(k=>!C.some(A=>A.routeId===k.routeId)),b=C.filter(k=>!S.some(A=>A.routeId===k.routeId)),x=C.filter(k=>S.some(A=>A.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"],[b,"onEnter"],[x,"onStay"]].forEach(([N,S])=>{N.forEach(C=>{this.looseRoutesById[C.routeId].options[S]?.(C)})})})})}})}catch(m){Nn(m)?(n=m,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):mn(m)&&(a=m),this.__store.setState(p=>({...p,statusCode:n?n.status:a?404:p.matches.some(v=>v.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==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 n=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,c=this.state.resolvedLocation,u=typeof n.types=="function"?n.types(Na({resolvedLocation:c,location:o})):n.types;if(u===!1){t();return}a={update:t,types:u}}else a=t;document.startViewTransition(a)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(o=>o.id===t)?"pendingMatches":this.state.matches.some(o=>o.id===t)?"matches":this.state.cachedMatches.some(o=>o.id===t)?"cachedMatches":"";a&&(a==="cachedMatches"?this.__store.setState(o=>({...o,cachedMatches:i_(o.cachedMatches.map(c=>c.id===t?n(c):c))})):this.__store.setState(o=>({...o,[a]:o[a]?.map(c=>c.id===t?n(c):c)})))})},this.getMatch=t=>{const n=a=>a.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=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(n),cachedMatches:a.cachedMatches.map(n),pendingMatches:a.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:t?.sync})},this.getParsedLocationHref=t=>t.publicHref||"/",this.resolveRedirect=t=>{const n=t.headers.get("Location");if(!t.options.href||t.options._builtLocation){const a=t.options._builtLocation??this.buildLocation(t.options),o=this.getParsedLocationHref(a);t.options.href=o,t.headers.set("Location",o)}else if(n)try{const a=new URL(n);if(this.origin&&a.origin===this.origin){const o=a.pathname+a.search+a.hash;t.options.href=o,t.headers.set("Location",o)}}catch{}if(t.options.href&&!t.options._builtLocation&&ju(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 n=t?.filter;n!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(o=>!n(o))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=n=>{const a=this.looseRoutesById[n.routeId];if(!a.options.loader)return!0;const o=(n.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=o};this.clearCache({filter:t})},this.loadRouteChunk=ol,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let a=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),c=new Set([...o,...this.state.cachedMatches.map(u=>u.id)]);el(()=>{a.forEach(u=>{c.has(u.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,u]}))})});try{return a=await _b({router:this,matches:a,location:n,preload:!0,updateMatch:(u,f)=>{o.has(u)?a=a.map(m=>m.id===u?f(m):m):this.updateMatch(u,f)}}),a}catch(u){if(Nn(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:n});mn(u)||console.error(u);return}},this.matchRoute=(t,n)=>{const a={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},o=this.buildLocation(a);if(n?.pending&&this.state.status!=="pending")return!1;const c=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,u=lz(o.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,c.pathname,this.processedTree);return!u||t.params&&!Sa(u.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Sa(c.search,o.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??Ez,parseSearch:e.parseSearch??_z,protocolAllowlist:e.protocolAllowlist??nz}),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:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;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 n=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:o,parsedParams:c}=n;let{matchedRoutes:u}=n,f=!1;(a?a.path!=="/"&&o["**"]:Ri(e.pathname))&&(this.options.notFoundRoute?u=[...u,this.options.notFoundRoute]:f=!0);const m=f?d_(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 b=u[y],x=p[y-1];let N,S,C;{const fe=x?.search??e.search,Ee=x?._strictSearch??void 0;try{const xe=hu(b.options.validateSearch,{...fe})??void 0;N={...fe,...xe},S={...Ee,...xe},C=void 0}catch(xe){let H=xe;if(xe instanceof _u||(H=new _u(xe.message,{cause:xe})),t?.throwOnError)throw H;N=fe,S={},C=H}}const k=b.options.loaderDeps?.({search:N})??"",A=k?JSON.stringify(k):"",{interpolatedPath:T,usedParams:z}=Sb({path:b.fullPath,params:o,decoder:this.pathParamsDecoder,server:this.isServer}),M=b.id+T+A,$=this.getMatch(M),E=v.get(b.id),O=$?._strictParams??z;let K;if(!$)try{Ob(b,z,c,O)}catch(fe){if(mn(fe)||Nn(fe)?K=fe:K=new r_(fe.message,{cause:fe}),t?.throwOnError)throw K}Object.assign(o,O);const W=E?"stay":"enter";let J;if($)J={...$,cause:W,params:E?.params??o,_strictParams:O,search:ua(E?E.search:$.search,N),_strictSearch:S};else{const fe=b.options.loader||b.options.beforeLoad||b.lazyFn||YS(b)?"pending":"success";J={id:M,ssr:b.options.ssr,index:y,routeId:b.id,params:E?.params??o,_strictParams:O,pathname:T,updatedAt:Date.now(),search:E?ua(E.search,N):N,_strictSearch:S,searchError:void 0,status:fe,isFetching:!1,error:void 0,paramsError:K,__routeContext:void 0,_nonReactive:{loadPromise:Pr()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:W,loaderDeps:E?pa(E.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:b.options.staticData||{},fullPath:b.fullPath}}t?.preload||(J.globalNotFound=m===b.id),J.searchError=C;const ne=this.getParentContext(x);J.context={...ne,...J.__routeContext,...J.__beforeLoadContext},p[y]=J}for(let y=0;y<p.length;y++){const b=p[y],x=this.looseRoutesById[b.routeId],N=this.getMatch(b.id),S=v.get(b.routeId);if(b.params=S?ua(S.params,o):o,!N){const C=p[y-1],k=this.getParentContext(C);if(x.options.context){const A={deps:b.loaderDeps,params:b.params,context:k??{},location:e,navigate:T=>this.navigate({...T,_fromLocation:e}),buildLocation:this.buildLocation,cause:b.cause,abortController:b.abortController,preload:!!b.preload,matches:p,routeId:x.id};b.__routeContext=x.options.context(A)??void 0}b.context={...k,...b.__routeContext,...b.__beforeLoadContext}}}return p}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:a}=this.getMatchedRoutes(e.pathname),o=al(t),c={...e.search};for(const p of t)try{Object.assign(c,hu(p.options.validateSearch,c))}catch{}const u=al(this.state.matches),f=u&&u.routeId===o.id&&e.pathname===this.state.location.pathname;let m;if(f)m=u.params;else{const p=Object.assign(Object.create(null),n);for(const v of t)try{Ob(v,n,a??{},p)}catch{}m=p}return{matchedRoutes:t,fullPath:o.fullPath,search:c,params:m}}},_u=class extends Error{},r_=class extends Error{};function o_(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function hu(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new _u("Async validation not supported");if(n.issues)throw new _u(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function l_({pathname:e,routesById:t,processedTree:n}){const a=Object.create(null),o=Ri(e);let c,u;const f=cz(o,n,!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 c_({search:e,dest:t,destRoutes:n,_includeValidateSearch:a}){return u_(n)(e,t,a??!1)}function u_(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const c=({search:u,next:f})=>{let m=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(m=o.options.preSearchFilters.reduce((v,y)=>y(v),u));const p=f(m);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((v,y)=>y(v),p):p};t.middlewares.push(c)}if(o.options.validateSearch){const c=({search:u,next:f})=>{const m=f(u);if(!t._includeValidateSearch)return m;try{return{...m,...hu(o.options.validateSearch,m)??void 0}}catch{return m}};t.middlewares.push(c)}}const n=({search:o})=>{const c=t.dest;return c.search?c.search===!0?o:Ei(c.search,o):{}};t.middlewares.push(n);const a=(o,c,u)=>{if(o>=u.length)return c;const f=u[o];return f({search:c,next:p=>a(o+1,p,u)})};return function(c,u,f){return t.dest=u,t._includeValidateSearch=f,a(0,c,t.middlewares)}}function d_(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const a=t[n];if(a.children)return a.id}return ja}function Ob(e,t,n,a){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const c in t)c in n&&(a[c]=n[c]);else{const c=o(a);Object.assign(a,c)}}var f_="Error preloading route! ☝️",JS=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 n=this.options,a=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=ja:this.parentRoute||Mi(!1);let o=a?ja:n?.path;o&&o!=="/"&&(o=US(o));const c=n?.id||o;let u=a?ja:uu([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);o==="__root__"&&(o="/"),u!=="__root__"&&(u=uu(["/",u]));const f=u==="__root__"?"/":uu([this.parentRoute.fullPath,o]);this._path=o,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=>pp({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.")}},h_=class extends JS{constructor(e){super(e)}};function bp(e){const t=e.errorComponent??xp;return r.jsx(m_,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:a})=>n?w.createElement(t,{error:n,reset:a}):e.children})}var m_=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 xp({error:e}){const[t,n]=w.useState(!1);return r.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[r.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[r.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),r.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(a=>!a),children:t?"Hide Error":"Show Error"})]}),r.jsx("div",{style:{height:".25rem"}}),t?r.jsx("div",{children:r.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?r.jsx("code",{children:e.message}):null})}):null]})}function p_({children:e,fallback:t=null}){return XS()?r.jsx(us.Fragment,{children:e}):r.jsx(us.Fragment,{children:t})}function XS(){return us.useSyncExternalStore(g_,()=>!0,()=>!1)}function g_(){return()=>{}}var WS=w.createContext(null);function Xn(e){const t=w.useContext(WS);return e?.warn,t}var Hh={exports:{}},Gh={},Fh={exports:{}},Zh={};var Lb;function y_(){if(Lb)return Zh;Lb=1;var e=pl();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function f(y,b){var x=b(),N=a({inst:{value:x,getSnapshot:b}}),S=N[0].inst,C=N[1];return c(function(){S.value=x,S.getSnapshot=b,m(S)&&C({inst:S})},[y,x,b]),o(function(){return m(S)&&C({inst:S}),y(function(){m(S)&&C({inst:S})})},[y]),u(x),x}function m(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!n(y,x)}catch{return!0}}function p(y,b){return b()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Zh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Zh}var Db;function v_(){return Db||(Db=1,Fh.exports=y_()),Fh.exports}var Mb;function b_(){if(Mb)return Gh;Mb=1;var e=pl(),t=v_();function n(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,c=e.useRef,u=e.useEffect,f=e.useMemo,m=e.useDebugValue;return Gh.useSyncExternalStoreWithSelector=function(p,v,y,b,x){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(!A){if(A=!0,T=$,$=b($),x!==void 0&&S.hasValue){var E=S.value;if(x(E,$))return z=E}return z=$}if(E=z,a(T,$))return E;var O=b($);return x!==void 0&&x(E,O)?(T=$,E):(T=$,z=O)}var A=!1,T,z,M=y===void 0?null:y;return[function(){return k(v())},M===null?void 0:function(){return k(M())}]},[v,y,b,x]);var C=o(p,N[0],N[1]);return u(function(){S.hasValue=!0,S.value=C},[C]),m(C),C},Gh}var $b;function x_(){return $b||($b=1,Hh.exports=b_()),Hh.exports}var S_=x_();function j_(e,t){return e===t}function w_(e,t,n=j_){const a=w.useCallback(u=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(u);return f},[e]),o=w.useCallback(()=>e?.get(),[e]);return S_.useSyncExternalStoreWithSelector(a,o,o,t,n)}function Cn(e){const t=Xn({warn:e?.router===void 0}),n=e?.router||t,a=w.useRef(void 0);return w_(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const c=pa(a.current,e.select(o));return a.current=c,c}return e.select(o)}return o})}var Gu=w.createContext(void 0),N_=w.createContext(void 0);function Ii(e){const t=w.useContext(e.from?N_:Gu);return Cn({select:n=>{const a=n.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(Mi(!((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 Sp(e){return Ii({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function jp(e){const{select:t,...n}=e;return Ii({...n,select:a=>t?t(a.loaderDeps):a.loaderDeps})}function Fu(e){return Ii({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Zu(e){return Ii({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Bi(e){const t=Xn();return w.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function wp(e){return Ii({...e,select:t=>e.select?e.select(t.context):t.context})}var Vu=xS();const C_=bS(Vu);function k_(e,t){const n=Xn(),a=Yk(t),{activeProps:o,inactiveProps:c,activeOptions:u,to:f,preload:m,preloadDelay:p,hashScrollIntoView:v,replace:y,startTransition:b,resetScroll:x,viewTransition:N,children:S,target:C,disabled:k,style:A,className:T,onClick:z,onBlur:M,onFocus:$,onMouseEnter:E,onMouseLeave:O,onTouchStart:K,ignoreBlocker:W,params:J,search:ne,hash:fe,state:Ee,mask:xe,reloadDocument:H,unsafeRelative:ae,from:pe,_fromLocation:he,...P}=e,R=XS(),B=Cn({select:Ue=>{const Xe=Ue.matches[Ue.matches.length-1];return{search:Xe?.search,hash:Ue.location.hash,path:Xe?.pathname}},structuralSharing:!0}),re=e.from,Z=w.useMemo(()=>({...e,from:re}),[n,B,re,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),V=w.useMemo(()=>n.buildLocation({...Z}),[n,Z]),se=V.maskedLocation?V.maskedLocation.publicHref:V.publicHref,ge=V.maskedLocation?V.maskedLocation.external:V.external,je=w.useMemo(()=>R_(se,ge,n.history,k),[k,ge,se,n.history]),de=w.useMemo(()=>{if(je?.external)return ju(je.href,n.protocolAllowlist)?void 0:je.href;if(!O_(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),ju(f,n.protocolAllowlist)?void 0:f}catch{}},[f,je,n.protocolAllowlist]),Ae=Cn({select:Ue=>{if(de)return!1;if(u?.exact){if(!pz(Ue.location.pathname,V.pathname,n.basepath))return!1}else{const Xe=Nu(Ue.location.pathname,n.basepath),Ct=Nu(V.pathname,n.basepath);if(!(Xe.startsWith(Ct)&&(Xe.length===Ct.length||Xe[Ct.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Sa(Ue.location.search,V.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?R&&Ue.location.hash===V.hash:!0}}),Re=Ae?Ei(o,{})??z_:Vh,ce=Ae?Vh:Ei(c,{})??Vh,Pe=[T,Re.className,ce.className].filter(Boolean).join(" "),Ve=(A||Re.style||ce.style)&&{...A,...Re.style,...ce.style},[Vt,Ut]=w.useState(!1),Mn=w.useRef(!1),nn=e.reloadDocument||de?!1:m??n.options.defaultPreload,Tt=p??n.options.defaultPreloadDelay??0,oe=w.useCallback(()=>{n.preloadRoute({...Z,_builtLocation:V}).catch(Ue=>{console.warn(Ue),console.warn(f_)})},[n,Z,V]);Qk(a,w.useCallback(Ue=>{Ue?.isIntersecting&&oe()},[oe]),A_,{disabled:!!k||nn!=="viewport"}),w.useEffect(()=>{Mn.current||!k&&nn==="render"&&(oe(),Mn.current=!0)},[k,oe,nn]);const Qe=Ue=>{const Xe=Ue.currentTarget.getAttribute("target"),Ct=C!==void 0?C:Xe;if(!k&&!L_(Ue)&&!Ue.defaultPrevented&&(!Ct||Ct==="_self")&&Ue.button===0){Ue.preventDefault(),Vu.flushSync(()=>{Ut(!0)});const He=n.subscribe("onResolved",()=>{He(),Ut(!1)});n.navigate({...Z,replace:y,resetScroll:x,hashScrollIntoView:v,startTransition:b,viewTransition:N,ignoreBlocker:W})}};if(de)return{...P,ref:a,href:de,...S&&{children:S},...C&&{target:C},...k&&{disabled:k},...A&&{style:A},...T&&{className:T},...z&&{onClick:z},...M&&{onBlur:M},...$&&{onFocus:$},...E&&{onMouseEnter:E},...O&&{onMouseLeave:O},...K&&{onTouchStart:K}};const ut=Ue=>{if(k||nn!=="intent")return;if(!Tt){oe();return}const Xe=Ue.currentTarget;if(Zo.has(Xe))return;const Ct=setTimeout(()=>{Zo.delete(Xe),oe()},Tt);Zo.set(Xe,Ct)},Qt=Ue=>{k||nn!=="intent"||oe()},Ye=Ue=>{if(k||!nn||!Tt)return;const Xe=Ue.currentTarget,Ct=Zo.get(Xe);Ct&&(clearTimeout(Ct),Zo.delete(Xe))};return{...P,...Re,...ce,href:je?.href,ref:a,onClick:jr([z,Qe]),onBlur:jr([M,Ye]),onFocus:jr([$,ut]),onMouseEnter:jr([E,ut]),onMouseLeave:jr([O,Ye]),onTouchStart:jr([K,Qt]),disabled:!!k,target:C,...Ve&&{style:Ve},...Pe&&{className:Pe},...k&&__,...Ae&&E_,...R&&Vt&&T_}}var Vh={},z_={className:"active"},__={role:"link","aria-disabled":!0},E_={"data-status":"active","aria-current":"page"},T_={"data-transitioning":"transitioning"},Zo=new WeakMap,A_={rootMargin:"100px"},jr=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function R_(e,t,n,a){if(!a)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function O_(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:n,...a}=e,{type:o,...c}=k_(a,t),u=typeof a.children=="function"?a.children({isActive:c["data-status"]==="active"}):a.children;if(!n){const{disabled:f,...m}=c;return w.createElement("a",m,u)}return w.createElement(n,c,u)});function L_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var D_=class extends JS{constructor(e){super(e),this.useMatch=t=>Ii({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>wp({...t,from:this.id}),this.useSearch=t=>Zu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Fu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>jp({...t,from:this.id}),this.useLoaderData=t=>Sp({...t,from:this.id}),this.useNavigate=()=>Bi({from:this.fullPath}),this.Link=us.forwardRef((t,n)=>r.jsx(St,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function Wn(e){return new D_(e)}function M_(){return e=>P_(e)}var $_=class extends h_{constructor(e){super(e),this.useMatch=t=>Ii({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>wp({...t,from:this.id}),this.useSearch=t=>Zu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Fu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>jp({...t,from:this.id}),this.useLoaderData=t=>Sp({...t,from:this.id}),this.useNavigate=()=>Bi({from:this.fullPath}),this.Link=us.forwardRef((t,n)=>r.jsx(St,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function P_(e){return new $_(e)}function Pb(e){return typeof e=="object"?new Ub(e,{silent:!0}).createRoute(e):new Ub(e,{silent:!0}).createRoute}var Ub=class{constructor(e,t){this.path=e,this.createRoute=n=>{const a=Wn(n);return a.isRoot=!1,a},this.silent=t?.silent}},Ib=class{constructor(e){this.useMatch=t=>Ii({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>wp({...t,from:this.options.id}),this.useSearch=t=>Zu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Fu({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>jp({...t,from:this.options.id}),this.useLoaderData=t=>Sp({...t,from:this.options.id}),this.useNavigate=()=>Bi({from:Xn().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function Bb(e){return typeof e=="object"?new Ib(e):t=>new Ib({id:e,...t})}function U_(e){const t=Cn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return r.jsx(bp,{getResetKey:()=>t,onCatch:(n,a)=>{if(mn(n))e.onCatch?.(n,a);else throw n},errorComponent:({error:n})=>{if(mn(n))return e.fallback?.(n);throw n},children:e.children})}function I_(){return r.jsx("p",{children:"Not Found"})}function _r(e){return r.jsx(r.Fragment,{children:e.children})}function ej(e,t,n){return t.options.notFoundComponent?r.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?r.jsx(e.options.defaultNotFoundComponent,{...n}):r.jsx(I_,{})}function B_(){return Xn().isScrollRestoring,null}var tj=w.memo(function({matchId:t}){const n=Xn(),a=Cn({select:N=>{const S=N.matches.findIndex(k=>k.id===t),C=N.matches[S];return Mi(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:N.loadedAt,parentRouteId:N.matches[S-1]?.routeId}},structuralSharing:!0}),o=n.routesById[a.routeId],c=o.options.pendingComponent??n.options.defaultPendingComponent,u=c?r.jsx(c,{}):null,f=o.options.errorComponent??n.options.defaultErrorComponent,m=o.options.onCatch??n.options.defaultOnCatch,p=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,v=a.ssr===!1||a.ssr==="data-only",y=(!o.isRoot||o.options.wrapInSuspense||v)&&(o.options.wrapInSuspense??c??(o.options.errorComponent?.preload||v))?w.Suspense:_r,b=f?bp:_r,x=p?U_:_r;return r.jsxs(o.isRoot?o.options.shellComponent??_r:_r,{children:[r.jsx(Gu.Provider,{value:t,children:r.jsx(y,{fallback:u,children:r.jsx(b,{getResetKey:()=>a.resetKey,errorComponent:f||xp,onCatch:(N,S)=>{if(mn(N))throw N;m?.(N,S)},children:r.jsx(x,{fallback:N=>{if(!p||N.routeId&&N.routeId!==a.routeId||!N.routeId&&!o.isRoot)throw N;return w.createElement(p,N)},children:v||a._displayPending?r.jsx(p_,{fallback:u,children:r.jsx(qb,{matchId:t})}):r.jsx(qb,{matchId:t})})})})}),a.parentRouteId===ja&&n.options.scrollRestoration?r.jsxs(r.Fragment,{children:[r.jsx(q_,{}),r.jsx(B_,{})]}):null]})});function q_(){const e=Xn(),t=w.useRef(void 0);return r.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Na(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var qb=w.memo(function({matchId:t}){const n=Xn(),{match:a,key:o,routeId:c}=Cn({select:m=>{const p=m.matches.find(b=>b.id===t),v=p.routeId,y=(n.routesById[v].options.remountDeps??n.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=n.routesById[c],f=w.useMemo(()=>{const m=u.options.component??n.options.defaultComponent;return m?r.jsx(m,{},o):r.jsx(Np,{})},[o,u.options.component,n.options.defaultComponent]);if(a._displayPending)throw n.getMatch(a.id)?._nonReactive.displayPendingPromise;if(a._forcePending)throw n.getMatch(a.id)?._nonReactive.minPendingPromise;if(a.status==="pending"){const m=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(m){const p=n.getMatch(a.id);if(p&&!p._nonReactive.minPendingPromise){const v=Pr();p._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),p._nonReactive.minPendingPromise=void 0},m)}}throw n.getMatch(a.id)?._nonReactive.loadPromise}if(a.status==="notFound")return Mi(mn(a.error)),ej(n,u,a.error);if(a.status==="redirected")throw Mi(Nn(a.error)),n.getMatch(a.id)?._nonReactive.loadPromise;if(a.status==="error")throw a.error;return f}),Np=w.memo(function(){const t=Xn(),n=w.useContext(Gu),a=Cn({select:p=>p.matches.find(v=>v.id===n)?.routeId}),o=t.routesById[a],c=Cn({select:p=>{const v=p.matches.find(y=>y.id===n);return Mi(v),v.globalNotFound}}),u=Cn({select:p=>{const v=p.matches;return v[v.findIndex(y=>y.id===n)+1]?.id}}),f=t.options.defaultPendingComponent?r.jsx(t.options.defaultPendingComponent,{}):null;if(c)return ej(t,o,void 0);if(!u)return null;const m=r.jsx(tj,{matchId:u});return a===ja?r.jsx(w.Suspense,{fallback:f,children:m}):m});function K_(){const e=Xn(),t=w.useRef({router:e,mounted:!1}),[n,a]=w.useState(!1),{hasPendingMatches:o,isLoading:c}=Cn({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),u=Ph(c),f=c||n||o,m=Ph(f),p=c||o,v=Ph(p);return e.startTransition=y=>{a(!0),w.startTransition(()=>{y(),a(!1)})},w.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ri(e.latestLocation.publicHref)!==Ri(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),Kc(()=>{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(b){console.error(b)}})()},[e]),Kc(()=>{u&&!c&&e.emit({type:"onLoad",...Na(e.state)})},[u,e,c]),Kc(()=>{v&&!p&&e.emit({type:"onBeforeRouteMount",...Na(e.state)})},[p,v,e]),Kc(()=>{if(m&&!f){const y=Na(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&Cz(e)}},[f,m,e]),null}function H_(){const e=Xn(),t=e.routesById[ja].options.pendingComponent??e.options.defaultPendingComponent,n=t?r.jsx(t,{}):null,a=r.jsxs(typeof document<"u"&&e.ssr?_r:w.Suspense,{fallback:n,children:[r.jsx(K_,{}),r.jsx(G_,{})]});return e.options.InnerWrap?r.jsx(e.options.InnerWrap,{children:a}):a}function G_(){const e=Xn(),t=Cn({select:o=>o.matches[0]?.id}),n=Cn({select:o=>o.loadedAt}),a=t?r.jsx(tj,{matchId:t}):null;return r.jsx(Gu.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?a:r.jsx(bp,{getResetKey:()=>n,errorComponent:xp,onCatch:void 0,children:a})})}var F_=e=>new Z_(e),Z_=class extends a_{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=Pb,globalThis.createLazyFileRoute=Bb):typeof window<"u"&&(window.createFileRoute=Pb,window.createLazyFileRoute=Bb);function V_({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const a=r.jsx(WS.Provider,{value:e,children:t});return e.options.Wrap?r.jsx(e.options.Wrap,{children:a}):a}function Q_({router:e,...t}){return r.jsx(V_,{router:e,...t,children:r.jsx(H_,{})})}function Y_(e){return Cn({select:t=>t.location})}class Eu extends Error{code;statusCode;constructor(t,n,a){super(t),this.name="ApiError",this.code=a??"UNKNOWN",this.statusCode=n}}function J_(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const X_=J_();function W_(){return""}function Kb(){return!!W_()}async function ye(e,t){const n=await fetch(`${X_}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const a=await n.text();let o=`API ${n.status}: ${n.statusText}`,c;if(a)try{const u=JSON.parse(a);typeof u.error=="string"?o=u.error:u.error?.message?(o=u.error.message,c=u.error.code):u.message&&(o=u.message)}catch{o=a}throw new Eu(o,n.status,c)}if(n.status!==204)return n.json()}function nj(){return ye("/projects")}function sj(e){return ye(`/projects/${encodeURIComponent(e)}`)}function ij(){return ye("/runs")}function Ur(e){return ye(`/runs/${encodeURIComponent(e)}`)}function e2(e){return ye(`/projects/${encodeURIComponent(e)}/keywords`)}function aj(e){return ye(`/projects/${encodeURIComponent(e)}/competitors`)}function rj(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const a=n.toString();return ye(`/projects/${encodeURIComponent(e)}/timeline${a?`?${a}`:""}`)}function Qu(e,t){return ye(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function t2(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"PUT",body:JSON.stringify({keywords:t})})}function n2(e,t){return ye(`/projects/${encodeURIComponent(e)}/keywords`,{method:"POST",body:JSON.stringify({keywords:t})})}function oj(e,t){return ye(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function Hb(e,t){const n=await sj(e);return Qu(e,{displayName:n.displayName,canonicalDomain:n.canonicalDomain,ownedDomains:t,country:n.country,language:n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:n.locations,defaultLocation:n.defaultLocation})}async function s2(e,t){const n=await sj(e);return Qu(e,{displayName:t.displayName??n.displayName,canonicalDomain:t.canonicalDomain??n.canonicalDomain,ownedDomains:t.ownedDomains??n.ownedDomains,country:t.country??n.country,language:t.language??n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:t.locations??n.locations,defaultLocation:t.defaultLocation!==void 0?t.defaultLocation:n.defaultLocation})}function i2(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),ye(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function a2(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function r2(e,t){await ye(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function o2(e,t){return ye(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function l2(e){await ye(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function c2(e){return ye(`/projects/${encodeURIComponent(e)}/export`)}function Cp(){return ye("/settings")}function u2(){return ye("/session")}function d2(e){return ye("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function f2(e){return ye("/session",{method:"POST",body:JSON.stringify({password:e})})}function h2(e,t){return ye(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function m2(e){return ye("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function p2(e){try{return await ye(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Error&&t.message.includes("404"))return null;throw t}}function Gb(e,t){return ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function g2(e){await ye(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function y2(e){return ye(`/projects/${encodeURIComponent(e)}/notifications`)}function v2(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function b2(e,t){await ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function x2(e,t){return ye(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function S2(e,t,n){return ye(`/projects/${encodeURIComponent(e)}/keywords/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function j2(e){return ye("/apply",{method:"POST",body:JSON.stringify(e)})}function w2(e){return ye("/runs",{method:"POST",body:JSON.stringify(e??{})})}function lj(e){return ye(`/projects/${encodeURIComponent(e)}/google/connections`)}function N2(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function C2(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function k2(e){return ye(`/projects/${encodeURIComponent(e)}/google/properties`)}function z2(e,t,n){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function _2(e,t,n){return ye(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function cj(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function E2(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit));const a=n.toString()?`?${n.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/performance${a}`)}function T2(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function A2(e,t){const n=new URLSearchParams;t?.url&&n.set("url",t.url),n.set("limit",String(t.limit));const a=n.toString()?`?${n.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${a}`)}function R2(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function kp(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function O2(e,t){const n=new URLSearchParams,a=n.toString()?`?${n.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${a}`)}function L2(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function D2(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function M2(e){return ye(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function Fb(){return ye("/cdp/status")}function $2(e,t){return ye("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function Zb(e,t){return ye(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function uj(e){return ye(`/projects/${encodeURIComponent(e)}/bing/status`)}function P2(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function U2(e){return ye(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function I2(e){return ye(`/projects/${encodeURIComponent(e)}/bing/sites`)}function B2(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function zp(e){return ye(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function dj(e,t){const n=new URLSearchParams,a=n.toString()?`?${n.toString()}`:"";return ye(`/projects/${encodeURIComponent(e)}/bing/inspections${a}`)}function fj(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function Vb(e,t){return ye(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function q2(e){return ye(`/projects/${encodeURIComponent(e)}/bing/performance`)}function K2(e){return ye("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function H2(e,t){const n=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/metrics${n}`)}function G2(e,t){const n=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/gaps${n}`)}function F2(e,t){const n=t?`?window=${t}`:"";return ye(`/projects/${encodeURIComponent(e)}/analytics/sources${n}`)}function Qb(e){return ye(`/projects/${encodeURIComponent(e)}/ga/status`)}function Yb(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/traffic`)}function hj(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function Z2(e,t){return ye(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function V2(e){return ye(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}async function Q2(e,t){try{const n=await fetch(e);if(!n.ok)return{label:t,state:"error",detail:`HTTP ${n.status}`};const a=await n.json(),o=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=[o,c===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:o,databaseConfigured:c,lastHeartbeatAt:u}}catch(n){return{label:t,state:"error",detail:n instanceof Error?n.message:"unreachable"}}}const Y2=6e3,J2=5,X2=180;let on=[],W2=0;const Rm=new Set,Om=new Map,Lm=new Map;function Tu(){const e=[...on];for(const t of Rm)t(e)}function _p(e){const t=Om.get(e);t&&(clearTimeout(t),Om.delete(e));const n=Lm.get(e);n&&(clearTimeout(n),Lm.delete(e))}function mj(e){_p(e);const t=on.length;on=on.filter(n=>n.id!==e),on.length!==t&&Tu()}function Jb(e){_p(e.id),Om.set(e.id,setTimeout(()=>{Dm(e.id)},e.durationMs))}function eE(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function Ze(e,t="negative",n=Y2){const a=eE(e,t,n),o={id:String(++W2),title:a.title,detail:a.detail,tone:a.tone??t,durationMs:a.durationMs??n,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:o.title,detail:o.detail,tone:o.tone,durationMs:o.durationMs,cta:o.cta,state:"open"};return on=on.map(f=>f.id===c.id?u:f),Tu(),Jb(u),c.id}}return on.length>=J2&&mj(on[0].id),on=[...on,o],Tu(),Jb(o),o.id}function Dm(e){const t=on.find(n=>n.id===e);!t||t.state==="closing"||(_p(e),on=on.map(n=>n.id===e?{...n,state:"closing"}:n),Tu(),Lm.set(e,setTimeout(()=>{mj(e)},X2)))}function tE(e){return Rm.add(e),()=>{Rm.delete(e)}}function Xb(){return on}function nE(){return new qk({defaultOptions:{queries:{staleTime:3e4,retry:1,refetchOnWindowFocus:!1}},mutationCache:new _S({onError:(e,t,n,a)=>{a.meta?.skipGlobalErrorToast||Ze({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const sE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),iE=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),Wb=e=>{const t=iE(e);return t.charAt(0).toUpperCase()+t.slice(1)},pj=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),aE=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var rE={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 oE=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:o="",children:c,iconNode:u,...f},m)=>w.createElement("svg",{ref:m,...rE,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:pj("lucide",o),...!c&&!aE(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,v])=>w.createElement(p,v)),...Array.isArray(c)?c:[c]]));const tn=(e,t)=>{const n=w.forwardRef(({className:a,...o},c)=>w.createElement(oE,{ref:c,iconNode:t,className:pj(`lucide-${sE(Wb(e))}`,`lucide-${e}`,a),...o}));return n.displayName=Wb(e),n};const lE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Yu=tn("chevron-right",lE);const cE=[["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"}]],uE=tn("download",cE);const dE=[["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"}]],fE=tn("github",dE);const hE=[["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"}]],mE=tn("globe",hE);const pE=[["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"}]],gE=tn("layout-dashboard",pE);const yE=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],vE=tn("menu",yE);const bE=[["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"}]],xE=tn("play",bE);const SE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ex=tn("plus",SE);const jE=[["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"}]],tx=tn("refresh-cw",jE);const wE=[["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"}]],NE=tn("rocket",wE);const CE=[["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"}]],kE=tn("rotate-ccw",CE);const zE=[["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"}]],_E=tn("settings",zE);const EE=[["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"}]],TE=tn("trash-2",EE);const AE=[["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"}]],RE=tn("triangle-alert",AE);const OE=[["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"}]],LE=tn("unplug",OE);const DE=[["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"}]],ME=tn("upload",DE);const $E=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ju=tn("x",$E);function PE(e){const t=e.match(/^(\[.*?\])\s*(.+)/);if(t){const n=t[1],a=t[2],o=a.indexOf("{");if(o>=0){const c=a.slice(0,o).trim(),u=a.slice(o);try{const f=JSON.parse(u);return`${n} ${c}
|
|
10
|
-
|
|
11
|
-
${JSON.stringify(f,null,2)}`}catch{}}return`${n}
|
|
12
|
-
${a}`}try{const n=JSON.parse(e);return JSON.stringify(n,null,2)}catch{return e}}function Xu(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function cs(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function nx(e){return e===null?"Unknown":e?"Pass":"Fail"}function Mm(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function UE(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function IE(e,t){if(!e)return{freq:"custom",hour:6,customCron:t};if(e==="twice-daily")return{freq:"twice-daily",hour:6,customCron:""};const n=e.match(/^daily(?:@(\d+))?$/);if(n)return{freq:"daily",hour:n[1]?parseInt(n[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 Qh(e,t,n){const a=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${a}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${a}`;const o=e.match(/^daily(?:@(\d+))?$/);if(o){const u=o[1]?parseInt(o[1]):6;return`Every day at ${Mm(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 ${Mm(f)} · ${a}`}return`${e} · ${a}`}const gj="canonry.run-tracker",$m=new Set;let sx=!1,BE=0,Wu={runs:{},batches:{}};function qE(){const e=za();for(const t of $m)t(e)}function KE(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function HE(){typeof window>"u"||window.sessionStorage.setItem(gj,JSON.stringify(Wu))}function yj(){sx||(sx=!0,!(typeof window>"u")&&(Wu=KE(window.sessionStorage.getItem(gj))))}function ed(e){Wu=e,HE(),qE()}function za(){return yj(),Wu}function GE(e){return yj(),$m.add(e),()=>{$m.delete(e)}}function vj(e){const t=za();ed({...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 ix(e){const t=za();if(!t.runs[e])return;const{[e]:n,...a}=t.runs;ed({...t,runs:a})}function FE(e){const t=za(),n=`batch_${Date.now()}_${++BE}`;return ed({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function ZE(e){const t=za();if(!t.batches[e])return;const{[e]:n,...a}=t.batches;ed({...t,batches:a})}function VE(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function QE(e,t){let n=0,a=0,o=0,c=0,u=0;for(const f of e){const m=t[f]?.status;m==="completed"?n+=1:m==="partial"?a+=1:m==="failed"?o+=1:m==="cancelled"?c+=1:u+=1}return{completed:n,partial:a,failed:o,cancelled:c,pending:u,finished:u===0}}function ax(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ep(...e){return t=>{let n=!1;const a=e.map(o=>{const c=ax(o,t);return!n&&typeof c=="function"&&(n=!0),c});if(n)return()=>{for(let o=0;o<a.length;o++){const c=a[o];typeof c=="function"?c():ax(e[o],null)}}}}function Aa(...e){return w.useCallback(Ep(...e),e)}var YE=Symbol.for("react.lazy"),Au=ip[" use ".trim().toString()];function JE(e){return typeof e=="object"&&e!==null&&"then"in e}function bj(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===YE&&"_payload"in e&&JE(e._payload)}function XE(e){const t=eT(e),n=w.forwardRef((a,o)=>{let{children:c,...u}=a;bj(c)&&typeof Au=="function"&&(c=Au(c._payload));const f=w.Children.toArray(c),m=f.find(nT);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 r.jsx(t,{...u,ref:o,children:w.isValidElement(p)?w.cloneElement(p,void 0,v):null})}return r.jsx(t,{...u,ref:o,children:c})});return n.displayName=`${e}.Slot`,n}var WE=XE("Slot");function eT(e){const t=w.forwardRef((n,a)=>{let{children:o,...c}=n;if(bj(o)&&typeof Au=="function"&&(o=Au(o._payload)),w.isValidElement(o)){const u=iT(o),f=sT(c,o.props);return o.type!==w.Fragment&&(f.ref=a?Ep(a,u):u),w.cloneElement(o,f)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var tT=Symbol("radix.slottable");function nT(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===tT}function sT(e,t){const n={...t};for(const a in t){const o=e[a],c=t[a];/^on[A-Z]/.test(a)?o&&c?n[a]=(...f)=>{const m=c(...f);return o(...f),m}:o&&(n[a]=o):a==="style"?n[a]={...o,...c}:a==="className"&&(n[a]=[o,c].filter(Boolean).join(" "))}return{...e,...n}}function iT(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function xj(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=xj(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function Sj(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=xj(e))&&(a&&(a+=" "),a+=t);return a}const rx=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ox=Sj,jj=(e,t)=>n=>{var a;if(t?.variants==null)return ox(e,n?.class,n?.className);const{variants:o,defaultVariants:c}=t,u=Object.keys(o).map(p=>{const v=n?.[p],y=c?.[p];if(v===null)return null;const b=rx(v)||rx(y);return o[p][b]}),f=n&&Object.entries(n).reduce((p,v)=>{let[y,b]=v;return b===void 0||(p[y]=b),p},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((p,v)=>{let{class:y,className:b,...x}=v;return Object.entries(x).every(N=>{let[S,C]=N;return Array.isArray(C)?C.includes({...c,...f}[S]):{...c,...f}[S]===C})?[...p,y,b]:p},[]);return ox(e,u,m,n?.class,n?.className)},aT=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},rT=(e,t)=>({classGroupId:e,validator:t}),wj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ru="-",lx=[],oT="arbitrary..",lT=e=>{const t=uT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return cT(u);const f=u.split(Ru),m=f[0]===""&&f.length>1?1:0;return Nj(f,m,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const m=a[u],p=n[u];return m?p?aT(p,m):m:p||lx}return n[u]||lx}}},Nj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],c=n.nextPart.get(o);if(c){const p=Nj(e,t+1,c);if(p)return p}const u=n.validators;if(u===null)return;const f=t===0?e.join(Ru):e.slice(t).join(Ru),m=u.length;for(let p=0;p<m;p++){const v=u[p];if(v.validator(f))return v.classGroupId}},cT=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?oT+a:void 0})(),uT=e=>{const{theme:t,classGroups:n}=e;return dT(n,t)},dT=(e,t)=>{const n=wj();for(const a in e){const o=e[a];Tp(o,n,a,t)}return n},Tp=(e,t,n,a)=>{const o=e.length;for(let c=0;c<o;c++){const u=e[c];fT(u,t,n,a)}},fT=(e,t,n,a)=>{if(typeof e=="string"){hT(e,t,n);return}if(typeof e=="function"){mT(e,t,n,a);return}pT(e,t,n,a)},hT=(e,t,n)=>{const a=e===""?t:Cj(t,e);a.classGroupId=n},mT=(e,t,n,a)=>{if(gT(e)){Tp(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(rT(n,e))},pT=(e,t,n,a)=>{const o=Object.entries(e),c=o.length;for(let u=0;u<c;u++){const[f,m]=o[u];Tp(m,Cj(t,f),n,a)}},Cj=(e,t)=>{let n=e;const a=t.split(Ru),o=a.length;for(let c=0;c<o;c++){const u=a[c];let f=n.nextPart.get(u);f||(f=wj(),n.nextPart.set(u,f)),n=f}return n},gT=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,yT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const o=(c,u)=>{n[c]=u,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(c){let u=n[c];if(u!==void 0)return u;if((u=a[c])!==void 0)return o(c,u),u},set(c,u){c in n?n[c]=u:o(c,u)}}},Pm="!",cx=":",vT=[],ux=(e,t,n,a,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:o}),bT=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=o=>{const c=[];let u=0,f=0,m=0,p;const v=o.length;for(let S=0;S<v;S++){const C=o[S];if(u===0&&f===0){if(C===cx){c.push(o.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?o:o.slice(m);let b=y,x=!1;y.endsWith(Pm)?(b=y.slice(0,-1),x=!0):y.startsWith(Pm)&&(b=y.slice(1),x=!0);const N=p&&p>m?p-m:void 0;return ux(c,x,b,N)};if(t){const o=t+cx,c=a;a=u=>u.startsWith(o)?c(u.slice(o.length)):ux(vT,!1,u,void 0,!0)}if(n){const o=a;a=c=>n({className:c,parseClassName:o})}return a},xT=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let o=[];for(let c=0;c<n.length;c++){const u=n[c],f=u[0]==="[",m=t.has(u);f||m?(o.length>0&&(o.sort(),a.push(...o),o=[]),a.push(u)):o.push(u)}return o.length>0&&(o.sort(),a.push(...o)),a}},ST=e=>({cache:yT(e.cacheSize),parseClassName:bT(e),sortModifiers:xT(e),...lT(e)}),jT=/\s+/,wT=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:o,sortModifiers:c}=t,u=[],f=e.trim().split(jT);let m="";for(let p=f.length-1;p>=0;p-=1){const v=f[p],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:N,maybePostfixModifierPosition:S}=n(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 A=b.length===0?"":b.length===1?b[0]:c(b).join(":"),T=x?A+Pm:A,z=T+k;if(u.indexOf(z)>-1)continue;u.push(z);const M=o(k,C);for(let $=0;$<M.length;++$){const E=M[$];u.push(T+E)}m=v+(m.length>0?" "+m:m)}return m},NT=(...e)=>{let t=0,n,a,o="";for(;t<e.length;)(n=e[t++])&&(a=kj(n))&&(o&&(o+=" "),o+=a);return o},kj=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=kj(e[a]))&&(n&&(n+=" "),n+=t);return n},CT=(e,...t)=>{let n,a,o,c;const u=m=>{const p=t.reduce((v,y)=>y(v),e());return n=ST(p),a=n.cache.get,o=n.cache.set,c=f,f(m)},f=m=>{const p=a(m);if(p)return p;const v=wT(m,n);return o(m,v),v};return c=u,(...m)=>c(NT(...m))},kT=[],Zt=e=>{const t=n=>n[e]||kT;return t.isThemeGetter=!0,t},zj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_j=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_T=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ET=/\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$/,TT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,AT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wi=e=>zT.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),Ni=e=>!!e&&Number.isInteger(Number(e)),Yh=e=>e.endsWith("%")&&Be(e.slice(0,-1)),Gs=e=>_T.test(e),Ej=()=>!0,OT=e=>ET.test(e)&&!TT.test(e),Ap=()=>!1,LT=e=>AT.test(e),DT=e=>RT.test(e),MT=e=>!we(e)&&!Ne(e),$T=e=>qi(e,Rj,Ap),we=e=>zj.test(e),fa=e=>qi(e,Oj,OT),dx=e=>qi(e,GT,Be),PT=e=>qi(e,Dj,Ej),UT=e=>qi(e,Lj,Ap),fx=e=>qi(e,Tj,Ap),IT=e=>qi(e,Aj,DT),Fc=e=>qi(e,Mj,LT),Ne=e=>_j.test(e),Vo=e=>Ra(e,Oj),BT=e=>Ra(e,Lj),hx=e=>Ra(e,Tj),qT=e=>Ra(e,Rj),KT=e=>Ra(e,Aj),Zc=e=>Ra(e,Mj,!0),HT=e=>Ra(e,Dj,!0),qi=(e,t,n)=>{const a=zj.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Ra=(e,t,n=!1)=>{const a=_j.exec(e);return a?a[1]?t(a[1]):n:!1},Tj=e=>e==="position"||e==="percentage",Aj=e=>e==="image"||e==="url",Rj=e=>e==="length"||e==="size"||e==="bg-size",Oj=e=>e==="length",GT=e=>e==="number",Lj=e=>e==="family-name",Dj=e=>e==="number"||e==="weight",Mj=e=>e==="shadow",FT=()=>{const e=Zt("color"),t=Zt("font"),n=Zt("text"),a=Zt("font-weight"),o=Zt("tracking"),c=Zt("leading"),u=Zt("breakpoint"),f=Zt("container"),m=Zt("spacing"),p=Zt("radius"),v=Zt("shadow"),y=Zt("inset-shadow"),b=Zt("text-shadow"),x=Zt("drop-shadow"),N=Zt("blur"),S=Zt("perspective"),C=Zt("aspect"),k=Zt("ease"),A=Zt("animate"),T=()=>["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"],M=()=>[...z(),Ne,we],$=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto","contain","none"],O=()=>[Ne,we,m],K=()=>[wi,"full","auto",...O()],W=()=>[Ni,"none","subgrid",Ne,we],J=()=>["auto",{span:["full",Ni,Ne,we]},Ni,Ne,we],ne=()=>[Ni,"auto",Ne,we],fe=()=>["auto","min","max","fr",Ne,we],Ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],xe=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...O()],ae=()=>[wi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],pe=()=>[wi,"screen","full","dvw","lvw","svw","min","max","fit",...O()],he=()=>[wi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],P=()=>[e,Ne,we],R=()=>[...z(),hx,fx,{position:[Ne,we]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],re=()=>["auto","cover","contain",qT,$T,{size:[Ne,we]}],Z=()=>[Yh,Vo,fa],V=()=>["","none","full",p,Ne,we],se=()=>["",Be,Vo,fa],ge=()=>["solid","dashed","dotted","double"],je=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Be,Yh,hx,fx],Ae=()=>["","none",N,Ne,we],Re=()=>["none",Be,Ne,we],ce=()=>["none",Be,Ne,we],Pe=()=>[Be,Ne,we],Ve=()=>[wi,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gs],breakpoint:[Gs],color:[Ej],container:[Gs],"drop-shadow":[Gs],ease:["in","out","in-out"],font:[MT],"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",Be],text:[Gs],"text-shadow":[Gs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wi,we,Ne,C]}],container:["container"],columns:[{columns:[Be,we,Ne,f]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:M()}],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:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[Ni,"auto",Ne,we]}],basis:[{basis:[wi,"full","auto",f,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,wi,"auto","initial","none",we]}],grow:[{grow:["",Be,Ne,we]}],shrink:[{shrink:["",Be,Ne,we]}],order:[{order:[Ni,"first","last","none",Ne,we]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":fe()}],"auto-rows":[{"auto-rows":fe()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...Ee(),"normal"]}],"justify-items":[{"justify-items":[...xe(),"normal"]}],"justify-self":[{"justify-self":["auto",...xe()]}],"align-content":[{content:["normal",...Ee()]}],"align-items":[{items:[...xe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...xe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ee()}],"place-items":[{"place-items":[...xe(),"baseline"]}],"place-self":[{"place-self":["auto",...xe()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:ae()}],"inline-size":[{inline:["auto",...pe()]}],"min-inline-size":[{"min-inline":["auto",...pe()]}],"max-inline-size":[{"max-inline":["none",...pe()]}],"block-size":[{block:["auto",...he()]}],"min-block-size":[{"min-block":["auto",...he()]}],"max-block-size":[{"max-block":["none",...he()]}],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",n,Vo,fa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,HT,PT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yh,we]}],"font-family":[{font:[BT,UT,t]}],"font-features":[{"font-features":[we]}],"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:[o,Ne,we]}],"line-clamp":[{"line-clamp":[Be,"none",Ne,dx]}],leading:[{leading:[c,...O()]}],"list-image":[{"list-image":["none",Ne,we]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,we]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",Ne,fa]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Be,"auto",Ne,we]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,we]}],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",Ne,we]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:re()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ni,Ne,we],radial:["",Ne,we],conic:[Ni,Ne,we]},KT,IT]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,Ne,we]}],"outline-w":[{outline:["",Be,Vo,fa]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",v,Zc,Fc]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",y,Zc,Fc]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Be,fa]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",b,Zc,Fc]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Be,Ne,we]}],"mix-blend":[{"mix-blend":[...je(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":je()}],"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":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Ne,we]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:re()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,we]}],filter:[{filter:["","none",Ne,we]}],blur:[{blur:Ae()}],brightness:[{brightness:[Be,Ne,we]}],contrast:[{contrast:[Be,Ne,we]}],"drop-shadow":[{"drop-shadow":["","none",x,Zc,Fc]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Be,Ne,we]}],"hue-rotate":[{"hue-rotate":[Be,Ne,we]}],invert:[{invert:["",Be,Ne,we]}],saturate:[{saturate:[Be,Ne,we]}],sepia:[{sepia:["",Be,Ne,we]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,we]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[Be,Ne,we]}],"backdrop-contrast":[{"backdrop-contrast":[Be,Ne,we]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,Ne,we]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,Ne,we]}],"backdrop-invert":[{"backdrop-invert":["",Be,Ne,we]}],"backdrop-opacity":[{"backdrop-opacity":[Be,Ne,we]}],"backdrop-saturate":[{"backdrop-saturate":[Be,Ne,we]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,Ne,we]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,we]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",Ne,we]}],ease:[{ease:["linear","initial",k,Ne,we]}],delay:[{delay:[Be,Ne,we]}],animate:[{animate:["none",A,Ne,we]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ne,we]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:Pe()}],"skew-x":[{"skew-x":Pe()}],"skew-y":[{"skew-y":Pe()}],transform:[{transform:[Ne,we,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ve()}],"translate-x":[{"translate-x":Ve()}],"translate-y":[{"translate-y":Ve()}],"translate-z":[{"translate-z":Ve()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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",Ne,we]}],"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":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",Ne,we]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Be,Vo,fa,dx]}],stroke:[{stroke:["none",...P()]}],"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"]}},ZT=CT(FT);function es(...e){return ZT(Sj(e))}const VT=jj("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"}}),le=w.forwardRef(({className:e,variant:t,size:n,asChild:a=!1,...o},c)=>{const u=a?WE:"button";return r.jsx(u,{ref:c,className:es(VT({variant:t,size:n,className:e})),...o})});le.displayName="Button";const QT=jj("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 $j({className:e,variant:t,...n}){return r.jsx("div",{className:es(QT({variant:t}),e),...n})}function mx({compact:e=!1}){return r.jsxs(St,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[r.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),r.jsxs("span",{className:"brand-copy",children:[r.jsx("span",{className:"brand-mark",children:"Canonry"}),e?null:r.jsx("span",{className:"brand-subtitle",children:"AEO Monitor"})]})]})}function ll({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 r.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 Ou(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function Pj(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 YT(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 JT(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function lt({tone:e,children:t}){const n=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return r.jsx($j,{variant:n,children:t})}function td({status:e}){return r.jsx(lt,{tone:Pj(e),children:Xu(e)})}function Li(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function XT(e,t){const n=w.createContext(t),a=c=>{const{children:u,...f}=c,m=w.useMemo(()=>f,Object.values(f));return r.jsx(n.Provider,{value:m,children:u})};a.displayName=e+"Provider";function o(c){const u=w.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[a,o]}function WT(e,t=[]){let n=[];function a(c,u){const f=w.createContext(u),m=n.length;n=[...n,u];const p=y=>{const{scope:b,children:x,...N}=y,S=b?.[e]?.[m]||f,C=w.useMemo(()=>N,Object.values(N));return r.jsx(S.Provider,{value:C,children:x})};p.displayName=c+"Provider";function v(y,b){const x=b?.[e]?.[m]||f,N=w.useContext(x);if(N)return N;if(u!==void 0)return u;throw new Error(`\`${y}\` must be used within \`${c}\``)}return[p,v]}const o=()=>{const c=n.map(u=>w.createContext(u));return function(f){const m=f?.[e]||c;return w.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return o.scopeName=e,[a,eA(o,...t)]}function eA(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(o=>({useScope:o(),scopeName:o.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 n.scopeName=t.scopeName,n}var cl=globalThis?.document?w.useLayoutEffect:()=>{},tA=ip[" useId ".trim().toString()]||(()=>{}),nA=0;function Jh(e){const[t,n]=w.useState(tA());return cl(()=>{n(a=>a??String(nA++))},[e]),e||(t?`radix-${t}`:"")}var sA=ip[" useInsertionEffect ".trim().toString()]||cl;function iA({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[o,c,u]=aA({defaultProp:t,onChange:n}),f=e!==void 0,m=f?e:o;{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=rA(v)?v(e):v;y!==e&&u.current?.(y)}else c(v)},[f,e,c,u]);return[m,p]}function aA({defaultProp:e,onChange:t}){const[n,a]=w.useState(e),o=w.useRef(n),c=w.useRef(t);return sA(()=>{c.current=t},[t]),w.useEffect(()=>{o.current!==n&&(c.current?.(n),o.current=n)},[n,o]),[n,a,c]}function rA(e){return typeof e=="function"}function Uj(e){const t=oA(e),n=w.forwardRef((a,o)=>{const{children:c,...u}=a,f=w.Children.toArray(c),m=f.find(cA);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 r.jsx(t,{...u,ref:o,children:w.isValidElement(p)?w.cloneElement(p,void 0,v):null})}return r.jsx(t,{...u,ref:o,children:c})});return n.displayName=`${e}.Slot`,n}function oA(e){const t=w.forwardRef((n,a)=>{const{children:o,...c}=n;if(w.isValidElement(o)){const u=dA(o),f=uA(c,o.props);return o.type!==w.Fragment&&(f.ref=a?Ep(a,u):u),w.cloneElement(o,f)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lA=Symbol("radix.slottable");function cA(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lA}function uA(e,t){const n={...t};for(const a in t){const o=e[a],c=t[a];/^on[A-Z]/.test(a)?o&&c?n[a]=(...f)=>{const m=c(...f);return o(...f),m}:o&&(n[a]=o):a==="style"?n[a]={...o,...c}:a==="className"&&(n[a]=[o,c].filter(Boolean).join(" "))}return{...e,...n}}function dA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Qs=fA.reduce((e,t)=>{const n=Uj(`Primitive.${t}`),a=w.forwardRef((o,c)=>{const{asChild:u,...f}=o,m=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(m,{...f,ref:c})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function hA(e,t){e&&Vu.flushSync(()=>e.dispatchEvent(t))}function ul(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>t.current?.(...n),[])}function mA(e,t=globalThis?.document){const n=ul(e);w.useEffect(()=>{const a=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var pA="DismissableLayer",Um="dismissableLayer.update",gA="dismissableLayer.pointerDownOutside",yA="dismissableLayer.focusOutside",px,Ij=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bj=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...m}=e,p=w.useContext(Ij),[v,y]=w.useState(null),b=v?.ownerDocument??globalThis?.document,[,x]=w.useState({}),N=Aa(t,E=>y(E)),S=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),A=v?S.indexOf(v):-1,T=p.layersWithOutsidePointerEventsDisabled.size>0,z=A>=k,M=xA(E=>{const O=E.target,K=[...p.branches].some(W=>W.contains(O));!z||K||(o?.(E),u?.(E),E.defaultPrevented||f?.())},b),$=SA(E=>{const O=E.target;[...p.branches].some(W=>W.contains(O))||(c?.(E),u?.(E),E.defaultPrevented||f?.())},b);return mA(E=>{A===p.layers.size-1&&(a?.(E),!E.defaultPrevented&&f&&(E.preventDefault(),f()))},b),w.useEffect(()=>{if(v)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(px=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),gx(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=px)}},[v,b,n,p]),w.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),gx())},[v,p]),w.useEffect(()=>{const E=()=>x({});return document.addEventListener(Um,E),()=>document.removeEventListener(Um,E)},[]),r.jsx(Qs.div,{...m,ref:N,style:{pointerEvents:T?z?"auto":"none":void 0,...e.style},onFocusCapture:Li(e.onFocusCapture,$.onFocusCapture),onBlurCapture:Li(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:Li(e.onPointerDownCapture,M.onPointerDownCapture)})});Bj.displayName=pA;var vA="DismissableLayerBranch",bA=w.forwardRef((e,t)=>{const n=w.useContext(Ij),a=w.useRef(null),o=Aa(t,a);return w.useEffect(()=>{const c=a.current;if(c)return n.branches.add(c),()=>{n.branches.delete(c)}},[n.branches]),r.jsx(Qs.div,{...e,ref:o})});bA.displayName=vA;function xA(e,t=globalThis?.document){const n=ul(e),a=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const c=f=>{if(f.target&&!a.current){let m=function(){qj(gA,n,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=m,t.addEventListener("click",o.current,{once:!0})):m()}else t.removeEventListener("click",o.current);a.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",c),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function SA(e,t=globalThis?.document){const n=ul(e),a=w.useRef(!1);return w.useEffect(()=>{const o=c=>{c.target&&!a.current&&qj(yA,n,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function gx(){const e=new CustomEvent(Um);document.dispatchEvent(e)}function qj(e,t,n,{discrete:a}){const o=n.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),a?hA(o,c):o.dispatchEvent(c)}var Xh="focusScope.autoFocusOnMount",Wh="focusScope.autoFocusOnUnmount",yx={bubbles:!1,cancelable:!0},jA="FocusScope",Kj=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...u}=e,[f,m]=w.useState(null),p=ul(o),v=ul(c),y=w.useRef(null),b=Aa(t,S=>m(S)),x=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(a){let S=function(T){if(x.paused||!f)return;const z=T.target;f.contains(z)?y.current=z:ki(y.current,{select:!0})},C=function(T){if(x.paused||!f)return;const z=T.relatedTarget;z!==null&&(f.contains(z)||ki(y.current,{select:!0}))},k=function(T){if(document.activeElement===document.body)for(const M of T)M.removedNodes.length>0&&ki(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const A=new MutationObserver(k);return f&&A.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),A.disconnect()}}},[a,f,x.paused]),w.useEffect(()=>{if(f){bx.add(x);const S=document.activeElement;if(!f.contains(S)){const k=new CustomEvent(Xh,yx);f.addEventListener(Xh,p),f.dispatchEvent(k),k.defaultPrevented||(wA(_A(Hj(f)),{select:!0}),document.activeElement===S&&ki(f))}return()=>{f.removeEventListener(Xh,p),setTimeout(()=>{const k=new CustomEvent(Wh,yx);f.addEventListener(Wh,v),f.dispatchEvent(k),k.defaultPrevented||ki(S??document.body,{select:!0}),f.removeEventListener(Wh,v),bx.remove(x)},0)}}},[f,p,v,x]);const N=w.useCallback(S=>{if(!n&&!a||x.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const A=S.currentTarget,[T,z]=NA(A);T&&z?!S.shiftKey&&k===z?(S.preventDefault(),n&&ki(T,{select:!0})):S.shiftKey&&k===T&&(S.preventDefault(),n&&ki(z,{select:!0})):k===A&&S.preventDefault()}},[n,a,x.paused]);return r.jsx(Qs.div,{tabIndex:-1,...u,ref:b,onKeyDown:N})});Kj.displayName=jA;function wA(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ki(a,{select:t}),document.activeElement!==n)return}function NA(e){const t=Hj(e),n=vx(t,e),a=vx(t.reverse(),e);return[n,a]}function Hj(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const o=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||o?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vx(e,t){for(const n of e)if(!CA(n,{upTo:t}))return n}function CA(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 kA(e){return e instanceof HTMLInputElement&&"select"in e}function ki(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&kA(e)&&t&&e.select()}}var bx=zA();function zA(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xx(e,t),e.unshift(t)},remove(t){e=xx(e,t),e[0]?.resume()}}}function xx(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function _A(e){return e.filter(t=>t.tagName!=="A")}var EA="Portal",Gj=w.forwardRef((e,t)=>{const{container:n,...a}=e,[o,c]=w.useState(!1);cl(()=>c(!0),[]);const u=n||o&&globalThis?.document?.body;return u?C_.createPortal(r.jsx(Qs.div,{...a,ref:t}),u):null});Gj.displayName=EA;function TA(e,t){return w.useReducer((n,a)=>t[n][a]??n,e)}var nd=e=>{const{present:t,children:n}=e,a=AA(t),o=typeof n=="function"?n({present:a.isPresent}):w.Children.only(n),c=Aa(a.ref,RA(o));return typeof n=="function"||a.isPresent?w.cloneElement(o,{ref:c}):null};nd.displayName="Presence";function AA(e){const[t,n]=w.useState(),a=w.useRef(null),o=w.useRef(e),c=w.useRef("none"),u=e?"mounted":"unmounted",[f,m]=TA(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const p=Vc(a.current);c.current=f==="mounted"?p:"none"},[f]),cl(()=>{const p=a.current,v=o.current;if(v!==e){const b=c.current,x=Vc(p);e?m("MOUNT"):x==="none"||p?.display==="none"?m("UNMOUNT"):m(v&&b!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),cl(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,y=x=>{const S=Vc(a.current).includes(CSS.escape(x.animationName));if(x.target===t&&S&&(m("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=x=>{x.target===t&&(c.current=Vc(a.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(p),t.removeEventListener("animationstart",b),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,n(p)},[])}}function Vc(e){return e?.animationName||"none"}function RA(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var em=0;function OA(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Sx()),document.body.insertAdjacentElement("beforeend",e[1]??Sx()),em++,()=>{em===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),em--}},[])}function Sx(){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 ws=function(){return ws=Object.assign||function(t){for(var n,a=1,o=arguments.length;a<o;a++){n=arguments[a];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(t[c]=n[c])}return t},ws.apply(this,arguments)};function Fj(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n}function LA(e,t,n){if(n||arguments.length===2)for(var a=0,o=t.length,c;a<o;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 mu="right-scroll-bar-position",pu="width-before-scroll-bar",DA="with-scroll-bars-hidden",MA="--removed-body-scroll-bar-size";function tm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function $A(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var o=n.value;o!==a&&(n.value=a,n.callback(a,o))}}}})[0];return n.callback=t,n.facade}var PA=typeof window<"u"?w.useLayoutEffect:w.useEffect,jx=new WeakMap;function UA(e,t){var n=$A(null,function(a){return e.forEach(function(o){return tm(o,a)})});return PA(function(){var a=jx.get(n);if(a){var o=new Set(a),c=new Set(e),u=n.current;o.forEach(function(f){c.has(f)||tm(f,null)}),c.forEach(function(f){o.has(f)||tm(f,u)})}jx.set(n,e)},[e]),n}function IA(e){return e}function BA(e,t){t===void 0&&(t=IA);var n=[],a=!1,o={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(c){var u=t(c,a);return n.push(u),function(){n=n.filter(function(f){return f!==u})}},assignSyncMedium:function(c){for(a=!0;n.length;){var u=n;n=[],u.forEach(c)}n={push:function(f){return c(f)},filter:function(){return n}}},assignMedium:function(c){a=!0;var u=[];if(n.length){var f=n;n=[],f.forEach(c),u=n}var m=function(){var v=u;u=[],v.forEach(c)},p=function(){return Promise.resolve().then(m)};p(),n={push:function(v){u.push(v),p()},filter:function(v){return u=u.filter(v),n}}}};return o}function qA(e){e===void 0&&(e={});var t=BA(null);return t.options=ws({async:!0,ssr:!1},e),t}var Zj=function(e){var t=e.sideCar,n=Fj(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,ws({},n))};Zj.isSideCarExport=!0;function KA(e,t){return e.useMedium(t),Zj}var Vj=qA(),nm=function(){},sd=w.forwardRef(function(e,t){var n=w.useRef(null),a=w.useState({onScrollCapture:nm,onWheelCapture:nm,onTouchMoveCapture:nm}),o=a[0],c=a[1],u=e.forwardProps,f=e.children,m=e.className,p=e.removeScrollBar,v=e.enabled,y=e.shards,b=e.sideCar,x=e.noRelative,N=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,A=k===void 0?"div":k,T=e.gapMode,z=Fj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=b,$=UA([n,t]),E=ws(ws({},z),o);return w.createElement(w.Fragment,null,v&&w.createElement(M,{sideCar:Vj,removeScrollBar:p,shards:y,noRelative:x,noIsolation:N,inert:S,setCallbacks:c,allowPinchZoom:!!C,lockRef:n,gapMode:T}),u?w.cloneElement(w.Children.only(f),ws(ws({},E),{ref:$})):w.createElement(A,ws({},E,{className:m,ref:$}),f))});sd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sd.classNames={fullWidth:pu,zeroRight:mu};var HA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function GA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=HA();return t&&e.setAttribute("nonce",t),e}function FA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ZA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var VA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=GA())&&(FA(t,n),ZA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},QA=function(){var e=VA();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Qj=function(){var e=QA(),t=function(n){var a=n.styles,o=n.dynamic;return e(a,o),null};return t},YA={left:0,top:0,right:0,gap:0},sm=function(e){return parseInt(e||"",10)||0},JA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[sm(n),sm(a),sm(o)]},XA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return YA;var t=JA(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},WA=Qj(),Lr="data-scroll-locked",eR=function(e,t,n,a){var o=e.left,c=e.top,u=e.right,f=e.gap;return n===void 0&&(n="margin"),`
|
|
13
|
-
.`.concat(DA,` {
|
|
14
|
-
overflow: hidden `).concat(a,`;
|
|
15
|
-
padding-right: `).concat(f,"px ").concat(a,`;
|
|
16
|
-
}
|
|
17
|
-
body[`).concat(Lr,`] {
|
|
18
|
-
overflow: hidden `).concat(a,`;
|
|
19
|
-
overscroll-behavior: contain;
|
|
20
|
-
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
21
|
-
padding-left: `.concat(o,`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
|
-
`),n==="padding"&&"padding-right: ".concat(f,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.`).concat(mu,` {
|
|
31
|
-
right: `).concat(f,"px ").concat(a,`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.`).concat(pu,` {
|
|
35
|
-
margin-right: `).concat(f,"px ").concat(a,`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.`).concat(mu," .").concat(mu,` {
|
|
39
|
-
right: 0 `).concat(a,`;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.`).concat(pu," .").concat(pu,` {
|
|
43
|
-
margin-right: 0 `).concat(a,`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
body[`).concat(Lr,`] {
|
|
47
|
-
`).concat(MA,": ").concat(f,`px;
|
|
48
|
-
}
|
|
49
|
-
`)},wx=function(){var e=parseInt(document.body.getAttribute(Lr)||"0",10);return isFinite(e)?e:0},tR=function(){w.useEffect(function(){return document.body.setAttribute(Lr,(wx()+1).toString()),function(){var e=wx()-1;e<=0?document.body.removeAttribute(Lr):document.body.setAttribute(Lr,e.toString())}},[])},nR=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,o=a===void 0?"margin":a;tR();var c=w.useMemo(function(){return XA(o)},[o]);return w.createElement(WA,{styles:eR(c,!t,o,n?"":"!important")})},Im=!1;if(typeof window<"u")try{var Qc=Object.defineProperty({},"passive",{get:function(){return Im=!0,!0}});window.addEventListener("test",Qc,Qc),window.removeEventListener("test",Qc,Qc)}catch{Im=!1}var wr=Im?{passive:!1}:!1,sR=function(e){return e.tagName==="TEXTAREA"},Yj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sR(e)&&n[t]==="visible")},iR=function(e){return Yj(e,"overflowY")},aR=function(e){return Yj(e,"overflowX")},Nx=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var o=Jj(e,a);if(o){var c=Xj(e,a),u=c[1],f=c[2];if(u>f)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},rR=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},oR=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},Jj=function(e,t){return e==="v"?iR(t):aR(t)},Xj=function(e,t){return e==="v"?rR(t):oR(t)},lR=function(e,t){return e==="h"&&t==="rtl"?-1:1},cR=function(e,t,n,a,o){var c=lR(e,window.getComputedStyle(t).direction),u=c*a,f=n.target,m=t.contains(f),p=!1,v=u>0,y=0,b=0;do{if(!f)break;var x=Xj(e,f),N=x[0],S=x[1],C=x[2],k=S-C-c*N;(N||k)&&Jj(e,f)&&(y+=k,b+=N);var A=f.parentNode;f=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(b)<1)&&(p=!0),p},Yc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Cx=function(e){return[e.deltaX,e.deltaY]},kx=function(e){return e&&"current"in e?e.current:e},uR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dR=function(e){return`
|
|
50
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
51
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
52
|
-
`)},fR=0,Nr=[];function hR(e){var t=w.useRef([]),n=w.useRef([0,0]),a=w.useRef(),o=w.useState(fR++)[0],c=w.useState(Qj)[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(o));var S=LA([e.lockRef.current],(e.shards||[]).map(kx),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[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=Yc(S),A=n.current,T="deltaX"in S?S.deltaX:A[0]-k[0],z="deltaY"in S?S.deltaY:A[1]-k[1],M,$=S.target,E=Math.abs(T)>Math.abs(z)?"h":"v";if("touches"in S&&E==="h"&&$.type==="range")return!1;var O=window.getSelection(),K=O&&O.anchorNode,W=K?K===$||K.contains($):!1;if(W)return!1;var J=Nx(E,$);if(!J)return!0;if(J?M=E:(M=E==="v"?"h":"v",J=Nx(E,$)),!J)return!1;if(!a.current&&"changedTouches"in S&&(T||z)&&(a.current=M),!M)return!0;var ne=a.current||M;return cR(ne,C,S,ne==="h"?T:z)},[]),m=w.useCallback(function(S){var C=S;if(!(!Nr.length||Nr[Nr.length-1]!==c)){var k="deltaY"in C?Cx(C):Yc(C),A=t.current.filter(function(M){return M.name===C.type&&(M.target===C.target||C.target===M.shadowParent)&&uR(M.delta,k)})[0];if(A&&A.should){C.cancelable&&C.preventDefault();return}if(!A){var T=(u.current.shards||[]).map(kx).filter(Boolean).filter(function(M){return M.contains(C.target)}),z=T.length>0?f(C,T[0]):!u.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),p=w.useCallback(function(S,C,k,A){var T={name:S,delta:C,target:k,should:A,shadowParent:mR(k)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(z){return z!==T})},1)},[]),v=w.useCallback(function(S){n.current=Yc(S),a.current=void 0},[]),y=w.useCallback(function(S){p(S.type,Cx(S),S.target,f(S,e.lockRef.current))},[]),b=w.useCallback(function(S){p(S.type,Yc(S),S.target,f(S,e.lockRef.current))},[]);w.useEffect(function(){return Nr.push(c),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",m,wr),document.addEventListener("touchmove",m,wr),document.addEventListener("touchstart",v,wr),function(){Nr=Nr.filter(function(S){return S!==c}),document.removeEventListener("wheel",m,wr),document.removeEventListener("touchmove",m,wr),document.removeEventListener("touchstart",v,wr)}},[]);var x=e.removeScrollBar,N=e.inert;return w.createElement(w.Fragment,null,N?w.createElement(c,{styles:dR(o)}):null,x?w.createElement(nR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pR=KA(Vj,hR);var Wj=w.forwardRef(function(e,t){return w.createElement(sd,ws({},e,{ref:t,sideCar:pR}))});Wj.classNames=sd.classNames;var gR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cr=new WeakMap,Jc=new WeakMap,Xc={},im=0,ew=function(e){return e&&(e.host||ew(e.parentNode))},yR=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=ew(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},vR=function(e,t,n,a){var o=yR(t,Array.isArray(e)?e:[e]);Xc[n]||(Xc[n]=new WeakMap);var c=Xc[n],u=[],f=new Set,m=new Set(o),p=function(y){!y||f.has(y)||(f.add(y),p(y.parentNode))};o.forEach(p);var v=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(b){if(f.has(b))v(b);else try{var x=b.getAttribute(a),N=x!==null&&x!=="false",S=(Cr.get(b)||0)+1,C=(c.get(b)||0)+1;Cr.set(b,S),c.set(b,C),u.push(b),S===1&&N&&Jc.set(b,!0),C===1&&b.setAttribute(n,"true"),N||b.setAttribute(a,"true")}catch(k){console.error("aria-hidden: cannot operate on ",b,k)}})};return v(t),f.clear(),im++,function(){u.forEach(function(y){var b=Cr.get(y)-1,x=c.get(y)-1;Cr.set(y,b),c.set(y,x),b||(Jc.has(y)||y.removeAttribute(a),Jc.delete(y)),x||y.removeAttribute(n)}),im--,im||(Cr=new WeakMap,Cr=new WeakMap,Jc=new WeakMap,Xc={})}},bR=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),o=gR(e);return o?(a.push.apply(a,Array.from(o.querySelectorAll("[aria-live], script"))),vR(a,o,n,"aria-hidden")):function(){return null}},id="Dialog",[tw]=WT(id),[xR,fs]=tw(id),nw=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:o,onOpenChange:c,modal:u=!0}=e,f=w.useRef(null),m=w.useRef(null),[p,v]=iA({prop:a,defaultProp:o??!1,onChange:c,caller:id});return r.jsx(xR,{scope:t,triggerRef:f,contentRef:m,contentId:Jh(),titleId:Jh(),descriptionId:Jh(),open:p,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(y=>!y),[v]),modal:u,children:n})};nw.displayName=id;var sw="DialogTrigger",SR=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=fs(sw,n),c=Aa(t,o.triggerRef);return r.jsx(Qs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Lp(o.open),...a,ref:c,onClick:Li(e.onClick,o.onOpenToggle)})});SR.displayName=sw;var Rp="DialogPortal",[jR,iw]=tw(Rp,{forceMount:void 0}),aw=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:o}=e,c=fs(Rp,t);return r.jsx(jR,{scope:t,forceMount:n,children:w.Children.map(a,u=>r.jsx(nd,{present:n||c.open,children:r.jsx(Gj,{asChild:!0,container:o,children:u})}))})};aw.displayName=Rp;var Lu="DialogOverlay",rw=w.forwardRef((e,t)=>{const n=iw(Lu,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,c=fs(Lu,e.__scopeDialog);return c.modal?r.jsx(nd,{present:a||c.open,children:r.jsx(NR,{...o,ref:t})}):null});rw.displayName=Lu;var wR=Uj("DialogOverlay.RemoveScroll"),NR=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=fs(Lu,n);return r.jsx(Wj,{as:wR,allowPinchZoom:!0,shards:[o.contentRef],children:r.jsx(Qs.div,{"data-state":Lp(o.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),_a="DialogContent",ow=w.forwardRef((e,t)=>{const n=iw(_a,e.__scopeDialog),{forceMount:a=n.forceMount,...o}=e,c=fs(_a,e.__scopeDialog);return r.jsx(nd,{present:a||c.open,children:c.modal?r.jsx(CR,{...o,ref:t}):r.jsx(kR,{...o,ref:t})})});ow.displayName=_a;var CR=w.forwardRef((e,t)=>{const n=fs(_a,e.__scopeDialog),a=w.useRef(null),o=Aa(t,n.contentRef,a);return w.useEffect(()=>{const c=a.current;if(c)return bR(c)},[]),r.jsx(lw,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Li(e.onCloseAutoFocus,c=>{c.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Li(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0;(u.button===2||f)&&c.preventDefault()}),onFocusOutside:Li(e.onFocusOutside,c=>c.preventDefault())})}),kR=w.forwardRef((e,t)=>{const n=fs(_a,e.__scopeDialog),a=w.useRef(!1),o=w.useRef(!1);return r.jsx(lw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(a.current||n.triggerRef.current?.focus(),c.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(a.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=c.target;n.triggerRef.current?.contains(u)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),lw=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:c,...u}=e,f=fs(_a,n),m=w.useRef(null),p=Aa(t,m);return OA(),r.jsxs(r.Fragment,{children:[r.jsx(Kj,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:c,children:r.jsx(Bj,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Lp(f.open),...u,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(zR,{titleId:f.titleId}),r.jsx(ER,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Op="DialogTitle",cw=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=fs(Op,n);return r.jsx(Qs.h2,{id:o.titleId,...a,ref:t})});cw.displayName=Op;var uw="DialogDescription",dw=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=fs(uw,n);return r.jsx(Qs.p,{id:o.descriptionId,...a,ref:t})});dw.displayName=uw;var fw="DialogClose",hw=w.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,o=fs(fw,n);return r.jsx(Qs.button,{type:"button",...a,ref:t,onClick:Li(e.onClick,()=>o.onOpenChange(!1))})});hw.displayName=fw;function Lp(e){return e?"open":"closed"}var mw="DialogTitleWarning",[bP,pw]=XT(mw,{contentName:_a,titleName:Op,docsSlug:"dialog"}),zR=({titleId:e})=>{const t=pw(mw),n=`\`${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(n))},[n,e]),null},_R="DialogDescriptionWarning",ER=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${pw(_R).contentName}}.`;return w.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},gw=nw,yw=aw,Dp=rw,Mp=ow,$p=cw,vw=dw,bw=hw;const TR=gw,AR=yw,xw=w.forwardRef(({className:e,...t},n)=>r.jsx(Dp,{ref:n,className:es("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));xw.displayName=Dp.displayName;const RR=400,OR=1200,LR=720,Sw=w.forwardRef(({className:e,children:t,...n},a)=>{const[o,c]=w.useState(LR),u=w.useRef(!1),f=w.useRef(0),m=w.useRef(0),p=w.useCallback(b=>{u.current=!0,f.current=b.clientX,m.current=o,b.target.setPointerCapture(b.pointerId),b.preventDefault()},[o]),v=w.useCallback(b=>{if(!u.current)return;const x=f.current-b.clientX,N=Math.min(OR,Math.max(RR,m.current+x));c(N)},[]),y=w.useCallback(()=>{u.current=!1},[]);return r.jsxs(AR,{children:[r.jsx(xw,{}),r.jsxs(Mp,{ref:a,className:es("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(${o}px, 100vw)`},...n,children:[r.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,r.jsxs(bw,{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:[r.jsx(Ju,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Sw.displayName=Mp.displayName;const DR=({className:e,...t})=>r.jsx("div",{className:es("flex flex-col gap-1.5 pr-10",e),...t}),jw=w.forwardRef(({className:e,...t},n)=>r.jsx($p,{ref:n,className:es("text-lg font-medium text-zinc-50",e),...t}));jw.displayName=$p.displayName;const ww=w.forwardRef(({className:e,...t},n)=>r.jsx(vw,{ref:n,className:es("text-sm text-zinc-500",e),...t}));ww.displayName=vw.displayName;function MR({title:e,subtitle:t,children:n,open:a,onClose:o}){return r.jsx(TR,{open:a,onOpenChange:c=>c?void 0:o(),children:r.jsxs(Sw,{children:[r.jsxs(DR,{className:"drawer-head",children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),r.jsx(jw,{id:"drawer-title",children:e}),r.jsx(ww,{className:"sr-only",children:t})]}),r.jsx("div",{className:"drawer-body",children:n})]})})}function te(e,t,n){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 b=v[y];b in f||(f[b]=p[b].bind(f))}}const o=n?.Parent??Object;class c extends o{}Object.defineProperty(c,"name",{value:e});function u(f){var m;const p=n?.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=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class Dr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Nw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Cw={};function $i(e){return Cw}function kw(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,o])=>t.indexOf(+a)===-1).map(([a,o])=>o)}function Bm(e,t){return typeof t=="bigint"?t.toString():t}function Pp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Up(e){return e==null}function Ip(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function $R(e,t){const n=(e.toString().split(".")[1]||"").length,a=t.toString();let o=(a.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(a)){const m=a.match(/\d?e-(\d?)/);m?.[1]&&(o=Number.parseInt(m[1]))}const c=n>o?n:o,u=Number.parseInt(e.toFixed(c).replace(".","")),f=Number.parseInt(t.toFixed(c).replace(".",""));return u%f/10**c}const zx=Symbol("evaluating");function ct(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==zx)return a===void 0&&(a=zx,a=n()),a},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function Oa(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ki(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function _x(e){return JSON.stringify(e)}function PR(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const zw="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Du(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const UR=Pp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ir(e){if(Du(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Du(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function _w(e){return Ir(e)?{...e}:Array.isArray(e)?[...e]:e}const IR=new Set(["string","number","symbol"]);function Br(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hi(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function ke(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 BR(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const qR={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 KR(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c=Ki(e._zod.def,{get shape(){const u={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(u[f]=n.shape[f])}return Oa(this,"shape",u),u},checks:[]});return Hi(e,c)}function HR(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Ki(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete u[f]}return Oa(this,"shape",u),u},checks:[]});return Hi(e,c)}function GR(e,t){if(!Ir(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.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 o=Ki(e._zod.def,{get shape(){const c={...e._zod.def.shape,...t};return Oa(this,"shape",c),c}});return Hi(e,o)}function FR(e,t){if(!Ir(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Ki(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Oa(this,"shape",a),a}});return Hi(e,n)}function ZR(e,t){const n=Ki(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return Oa(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Hi(e,n)}function VR(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Ki(t._zod.def,{get shape(){const f=t._zod.def.shape,m={...f};if(n)for(const p in n){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);n[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 Oa(this,"shape",m),m},checks:[]});return Hi(t,u)}function QR(e,t,n){const a=Ki(t._zod.def,{get shape(){const o=t._zod.def.shape,c={...o};if(n)for(const u in n){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)c[u]=new e({type:"nonoptional",innerType:o[u]});return Oa(this,"shape",c),c}});return Hi(t,a)}function Er(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Tr(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Wc(e){return typeof e=="string"?e:e?.message}function Pi(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const o=Wc(e.inst?._zod.def?.error?.(e))??Wc(t?.error?.(e))??Wc(n.customError?.(e))??Wc(n.localeError?.(e))??"Invalid input";a.message=o}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Bp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function dl(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const Ew=(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,Bm,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Tw=te("$ZodError",Ew),Aw=te("$ZodError",Ew,{Parent:Error});function YR(e,t=n=>n.message){const n={},a=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):a.push(t(o));return{formErrors:a,fieldErrors:n}}function JR(e,t=n=>n.message){const n={_errors:[]},a=o=>{for(const c of o.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)n._errors.push(t(c));else{let u=n,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),n}const qp=e=>(t,n,a,o)=>{const c=a?Object.assign(a,{async:!1}):{async:!1},u=t._zod.run({value:n,issues:[]},c);if(u instanceof Promise)throw new Dr;if(u.issues.length){const f=new(o?.Err??e)(u.issues.map(m=>Pi(m,c,$i())));throw zw(f,o?.callee),f}return u.value},Kp=e=>async(t,n,a,o)=>{const c=a?Object.assign(a,{async:!0}):{async:!0};let u=t._zod.run({value:n,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new(o?.Err??e)(u.issues.map(m=>Pi(m,c,$i())));throw zw(f,o?.callee),f}return u.value},ad=e=>(t,n,a)=>{const o=a?{...a,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},o);if(c instanceof Promise)throw new Dr;return c.issues.length?{success:!1,error:new(e??Tw)(c.issues.map(u=>Pi(u,o,$i())))}:{success:!0,data:c.value}},XR=ad(Aw),rd=e=>async(t,n,a)=>{const o=a?Object.assign(a,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},o);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(u=>Pi(u,o,$i())))}:{success:!0,data:c.value}},WR=rd(Aw),eO=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return qp(e)(t,n,o)},tO=e=>(t,n,a)=>qp(e)(t,n,a),nO=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Kp(e)(t,n,o)},sO=e=>async(t,n,a)=>Kp(e)(t,n,a),iO=e=>(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ad(e)(t,n,o)},aO=e=>(t,n,a)=>ad(e)(t,n,a),rO=e=>async(t,n,a)=>{const o=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return rd(e)(t,n,o)},oO=e=>async(t,n,a)=>rd(e)(t,n,a),lO=/^[cC][^\s-]{8,}$/,cO=/^[0-9a-z]+$/,uO=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dO=/^[0-9a-vA-V]{20}$/,fO=/^[A-Za-z0-9]{27}$/,hO=/^[a-zA-Z0-9_-]{21}$/,mO=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,pO=/^([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})$/,Ex=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)$/,gO=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vO(){return new RegExp(yO,"u")}const bO=/^(?:(?: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])$/,xO=/^(([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}|:))$/,SO=/^((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])$/,jO=/^(([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])$/,wO=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rw=/^[A-Za-z0-9_-]*$/,NO=/^\+[1-9]\d{6,14}$/,Ow="(?:(?:\\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])))",CO=new RegExp(`^${Ow}$`);function Lw(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 kO(e){return new RegExp(`^${Lw(e)}$`)}function zO(e){const t=Lw({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${Ow}T(?:${a})$`)}const _O=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},EO=/^-?\d+$/,Dw=/^-?\d+(?:\.\d+)?$/,TO=/^(?:true|false)$/i,AO=/^[^A-Z]*$/,RO=/^[^a-z]*$/,kn=te("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Mw={number:"number",bigint:"bigint",object:"date"},$w=te("$ZodCheckLessThan",(e,t)=>{kn.init(e,t);const n=Mw[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,c=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<c&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pw=te("$ZodCheckGreaterThan",(e,t)=>{kn.init(e,t);const n=Mw[typeof t.value];e._zod.onattach.push(a=>{const o=a._zod.bag,c=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>c&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),OO=te("$ZodCheckMultipleOf",(e,t)=>{kn.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):$R(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),LO=te("$ZodCheckNumberFormat",(e,t)=>{kn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[o,c]=qR[t.format];e._zod.onattach.push(u=>{const f=u._zod.bag;f.format=t.format,f.minimum=o,f.maximum=c,n&&(f.pattern=EO)}),e._zod.check=u=>{const f=u.value;if(n){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<o&&u.issues.push({origin:"number",input:f,code:"too_small",minimum:o,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})}}),DO=te("$ZodCheckMaxLength",(e,t)=>{var n;kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Up(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const o=a.value;if(o.length<=t.maximum)return;const u=Bp(o);a.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),MO=te("$ZodCheckMinLength",(e,t)=>{var n;kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Up(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const o=a.value;if(o.length>=t.minimum)return;const u=Bp(o);a.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),$O=te("$ZodCheckLengthEquals",(e,t)=>{var n;kn.init(e,t),(n=e._zod.def).when??(n.when=a=>{const o=a.value;return!Up(o)&&o.length!==void 0}),e._zod.onattach.push(a=>{const o=a._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=a=>{const o=a.value,c=o.length;if(c===t.length)return;const u=Bp(o),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})}}),od=te("$ZodCheckStringFormat",(e,t)=>{var n,a;kn.init(e,t),e._zod.onattach.push(o=>{const c=o._zod.bag;c.format=t.format,t.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),PO=te("$ZodCheckRegex",(e,t)=>{od.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),UO=te("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=AO),od.init(e,t)}),IO=te("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=RO),od.init(e,t)}),BO=te("$ZodCheckIncludes",(e,t)=>{kn.init(e,t);const n=Br(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(o=>{const c=o._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(a)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),qO=te("$ZodCheckStartsWith",(e,t)=>{kn.init(e,t);const n=new RegExp(`^${Br(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),KO=te("$ZodCheckEndsWith",(e,t)=>{kn.init(e,t);const n=new RegExp(`.*${Br(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const o=a._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),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})}}),HO=te("$ZodCheckOverwrite",(e,t)=>{kn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class GO{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),o=Math.min(...a.map(u=>u.length-u.trimStart().length)),c=a.map(u=>u.slice(o)).map(u=>" ".repeat(this.indent*2)+u);for(const u of c)this.content.push(u)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(c=>` ${c}`)];return new t(...n,o.join(`
|
|
58
|
-
`))}}const FO={major:4,minor:3,patch:6},zt=te("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=FO;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const o of a)for(const c of o._zod.onattach)c(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(u,f,m)=>{let p=Er(u),v;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(u))continue}else if(p)continue;const b=u.issues.length,x=y._zod.check(u);if(x instanceof Promise&&m?.async===!1)throw new Dr;if(v||x instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await x,u.issues.length!==b&&(p||(p=Er(u,b)))});else{if(u.issues.length===b)continue;p||(p=Er(u,b))}}return v?v.then(()=>u):u},c=(u,f,m)=>{if(Er(u))return u.aborted=!0,u;const p=o(f,a,m);if(p instanceof Promise){if(m.async===!1)throw new Dr;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 Dr;return m.then(p=>o(p,a,f))}return o(m,a,f)}}ct(e,"~standard",()=>({validate:o=>{try{const c=XR(e,o);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return WR(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),Hp=te("$ZodString",(e,t)=>{zt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_O(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Nt=te("$ZodStringFormat",(e,t)=>{od.init(e,t),Hp.init(e,t)}),ZO=te("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=pO),Nt.init(e,t)}),VO=te("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ex(a))}else t.pattern??(t.pattern=Ex());Nt.init(e,t)}),QO=te("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=gO),Nt.init(e,t)}),YO=te("$ZodURL",(e,t)=>{Nt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),o=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),JO=te("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=vO()),Nt.init(e,t)}),XO=te("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hO),Nt.init(e,t)}),WO=te("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lO),Nt.init(e,t)}),eL=te("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=cO),Nt.init(e,t)}),tL=te("$ZodULID",(e,t)=>{t.pattern??(t.pattern=uO),Nt.init(e,t)}),nL=te("$ZodXID",(e,t)=>{t.pattern??(t.pattern=dO),Nt.init(e,t)}),sL=te("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fO),Nt.init(e,t)}),iL=te("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=zO(t)),Nt.init(e,t)}),aL=te("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=CO),Nt.init(e,t)}),rL=te("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=kO(t)),Nt.init(e,t)}),oL=te("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=mO),Nt.init(e,t)}),lL=te("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=bO),Nt.init(e,t),e._zod.bag.format="ipv4"}),cL=te("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xO),Nt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),uL=te("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=SO),Nt.init(e,t)}),dL=te("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=jO),Nt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[o,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://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Uw(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const fL=te("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=wO),Nt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Uw(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function hL(e){if(!Rw.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Uw(n)}const mL=te("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rw),Nt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{hL(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),pL=te("$ZodE164",(e,t)=>{t.pattern??(t.pattern=NO),Nt.init(e,t)});function gL(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const o=JSON.parse(atob(a));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const yL=te("$ZodJWT",(e,t)=>{Nt.init(e,t),e._zod.check=n=>{gL(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Iw=te("$ZodNumber",(e,t)=>{zt.init(e,t),e._zod.pattern=e._zod.bag.pattern??Dw,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const c=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...c?{received:c}:{}}),n}}),vL=te("$ZodNumberFormat",(e,t)=>{LO.init(e,t),Iw.init(e,t)}),bL=te("$ZodBoolean",(e,t)=>{zt.init(e,t),e._zod.pattern=TO,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),xL=te("$ZodUnknown",(e,t)=>{zt.init(e,t),e._zod.parse=n=>n}),SL=te("$ZodNever",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Tx(e,t,n){e.issues.length&&t.issues.push(...Tr(n,e.issues)),t.value[n]=e.value}const jL=te("$ZodArray",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const c=[];for(let u=0;u<o.length;u++){const f=o[u],m=t.element._zod.run({value:f,issues:[]},a);m instanceof Promise?c.push(m.then(p=>Tx(p,n,u))):Tx(m,n,u)}return c.length?Promise.all(c).then(()=>n):n}});function Mu(e,t,n,a,o){if(e.issues.length){if(o&&!(n in a))return;t.issues.push(...Tr(n,e.issues))}e.value===void 0?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Bw(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 n=BR(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function qw(e,t,n,a,o,c){const u=[],f=o.keySet,m=o.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 b=m.run({value:t[y],issues:[]},a);b instanceof Promise?e.push(b.then(x=>Mu(x,n,y,t,v))):Mu(b,n,y,t,v)}return u.length&&n.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:c}),e.length?Promise.all(e).then(()=>n):n}const wL=te("$ZodObject",(e,t)=>{if(zt.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=Pp(()=>Bw(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 o=Du,c=t.catchall;let u;e._zod.parse=(f,m)=>{u??(u=a.value);const p=f.value;if(!o(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const v=[],y=u.shape;for(const b of u.keys){const x=y[b],N=x._zod.optout==="optional",S=x._zod.run({value:p[b],issues:[]},m);S instanceof Promise?v.push(S.then(C=>Mu(C,f,b,p,N))):Mu(S,f,b,p,N)}return c?qw(v,p,f,m,a.value,e):v.length?Promise.all(v).then(()=>f):f}}),NL=te("$ZodObjectJIT",(e,t)=>{wL.init(e,t);const n=e._zod.parse,a=Pp(()=>Bw(t)),o=b=>{const x=new GO(["shape","payload","ctx"]),N=a.value,S=T=>{const z=_x(T);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};x.write("const input = payload.value;");const C=Object.create(null);let k=0;for(const T of N.keys)C[T]=`key_${k++}`;x.write("const newResult = {};");for(const T of N.keys){const z=C[T],M=_x(T),E=b[T]?._zod?.optout==="optional";x.write(`const ${z} = ${S(T)};`),E?x.write(`
|
|
59
|
-
if (${z}.issues.length) {
|
|
60
|
-
if (${M} in input) {
|
|
61
|
-
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
62
|
-
...iss,
|
|
63
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
64
|
-
})));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (${z}.value === undefined) {
|
|
69
|
-
if (${M} in input) {
|
|
70
|
-
newResult[${M}] = undefined;
|
|
71
|
-
}
|
|
72
|
-
} else {
|
|
73
|
-
newResult[${M}] = ${z}.value;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
`):x.write(`
|
|
77
|
-
if (${z}.issues.length) {
|
|
78
|
-
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
79
|
-
...iss,
|
|
80
|
-
path: iss.path ? [${M}, ...iss.path] : [${M}]
|
|
81
|
-
})));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (${z}.value === undefined) {
|
|
85
|
-
if (${M} in input) {
|
|
86
|
-
newResult[${M}] = undefined;
|
|
87
|
-
}
|
|
88
|
-
} else {
|
|
89
|
-
newResult[${M}] = ${z}.value;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
`)}x.write("payload.value = newResult;"),x.write("return payload;");const A=x.compile();return(T,z)=>A(b,T,z)};let c;const u=Du,f=!Cw.jitless,p=f&&UR.value,v=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=a.value);const N=b.value;return u(N)?f&&p&&x?.async===!1&&x.jitless!==!0?(c||(c=o(t.shape)),b=c(b,x),v?qw([],N,b,x,y,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:N,inst:e}),b)}});function Ax(e,t,n,a){for(const c of e)if(c.issues.length===0)return t.value=c.value,t;const o=e.filter(c=>!Er(c));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(c=>c.issues.map(u=>Pi(u,a,$i())))}),t)}const CL=te("$ZodUnion",(e,t)=>{zt.init(e,t),ct(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),ct(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),ct(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),ct(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(c=>c._zod.pattern);return new RegExp(`^(${o.map(c=>Ip(c.source)).join("|")})$`)}});const n=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(o,c)=>{if(n)return a(o,c);let u=!1;const f=[];for(const m of t.options){const p=m._zod.run({value:o.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=>Ax(m,o,e,c)):Ax(f,o,e,c)}}),kL=te("$ZodIntersection",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value,c=t.left._zod.run({value:o,issues:[]},a),u=t.right._zod.run({value:o,issues:[]},a);return c instanceof Promise||u instanceof Promise?Promise.all([c,u]).then(([m,p])=>Rx(n,m,p)):Rx(n,c,u)}});function qm(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(Ir(e)&&Ir(t)){const n=Object.keys(t),a=Object.keys(e).filter(c=>n.indexOf(c)!==-1),o={...e,...t};for(const c of a){const u=qm(e[c],t[c]);if(!u.valid)return{valid:!1,mergeErrorPath:[c,...u.mergeErrorPath]};o[c]=u.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const o=e[a],c=t[a],u=qm(o,c);if(!u.valid)return{valid:!1,mergeErrorPath:[a,...u.mergeErrorPath]};n.push(u.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Rx(e,t,n){const a=new Map;let o;for(const f of t.issues)if(f.code==="unrecognized_keys"){o??(o=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 n.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&&o&&e.issues.push({...o,keys:c}),Er(e))return e;const u=qm(t.value,n.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const zL=te("$ZodRecord",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{const o=n.value;if(!Ir(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const c=[],u=t.keyType._zod.values;if(u){n.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:o[p],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&n.issues.push(...Tr(p,y.issues)),n.value[p]=y.value})):(v.issues.length&&n.issues.push(...Tr(p,v.issues)),n.value[p]=v.value)}let m;for(const p in o)f.has(p)||(m=m??[],m.push(p));m&&m.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:m})}else{n.value={};for(const f of Reflect.ownKeys(o)){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"&&Dw.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"?n.value[f]=o[f]:n.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(y=>Pi(y,a,$i())),input:f,path:[f],inst:e});continue}const v=t.valueType._zod.run({value:o[f],issues:[]},a);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&n.issues.push(...Tr(f,y.issues)),n.value[m.value]=y.value})):(v.issues.length&&n.issues.push(...Tr(f,v.issues)),n.value[m.value]=v.value)}}return c.length?Promise.all(c).then(()=>n):n}}),_L=te("$ZodEnum",(e,t)=>{zt.init(e,t);const n=kw(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(o=>IR.has(typeof o)).map(o=>typeof o=="string"?Br(o):o.toString()).join("|")})$`),e._zod.parse=(o,c)=>{const u=o.value;return a.has(u)||o.issues.push({code:"invalid_value",values:n,input:u,inst:e}),o}}),EL=te("$ZodLiteral",(e,t)=>{if(zt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?Br(a):a?Br(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,o)=>{const c=a.value;return n.has(c)||a.issues.push({code:"invalid_value",values:t.values,input:c,inst:e}),a}}),TL=te("$ZodTransform",(e,t)=>{zt.init(e,t),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Nw(e.constructor.name);const o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(n.value=u,n));if(o instanceof Promise)throw new Dr;return n.value=o,n}});function Ox(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Kw=te("$ZodOptional",(e,t)=>{zt.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 n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ip(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(c=>Ox(c,n.value)):Ox(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),AL=te("$ZodExactOptional",(e,t)=>{Kw.init(e,t),ct(e._zod,"values",()=>t.innerType._zod.values),ct(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),RL=te("$ZodNullable",(e,t)=>{zt.init(e,t),ct(e._zod,"optin",()=>t.innerType._zod.optin),ct(e._zod,"optout",()=>t.innerType._zod.optout),ct(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ip(n.source)}|null)$`):void 0}),ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),OL=te("$ZodDefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(c=>Lx(c,t)):Lx(o,t)}});function Lx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const LL=te("$ZodPrefault",(e,t)=>{zt.init(e,t),e._zod.optin="optional",ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),DL=te("$ZodNonOptional",(e,t)=>{zt.init(e,t),ct(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(c=>Dx(c,e)):Dx(o,e)}});function Dx(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 ML=te("$ZodCatch",(e,t)=>{zt.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=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(c=>(n.value=c.value,c.issues.length&&(n.value=t.catchValue({...n,error:{issues:c.issues.map(u=>Pi(u,a,$i()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(c=>Pi(c,a,$i()))},input:n.value}),n.issues=[]),n)}}),$L=te("$ZodPipe",(e,t)=>{zt.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=(n,a)=>{if(a.direction==="backward"){const c=t.out._zod.run(n,a);return c instanceof Promise?c.then(u=>eu(u,t.in,a)):eu(c,t.in,a)}const o=t.in._zod.run(n,a);return o instanceof Promise?o.then(c=>eu(c,t.out,a)):eu(o,t.out,a)}});function eu(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const PL=te("$ZodReadonly",(e,t)=>{zt.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=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const o=t.innerType._zod.run(n,a);return o instanceof Promise?o.then(Mx):Mx(o)}});function Mx(e){return e.value=Object.freeze(e.value),e}const UL=te("$ZodCustom",(e,t)=>{kn.init(e,t),zt.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,o=t.fn(a);if(o instanceof Promise)return o.then(c=>$x(c,n,a,e));$x(o,n,a,e)}});function $x(e,t,n,a){if(!e){const o={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(o.params=a._zod.def.params),t.issues.push(dl(o))}}var Px;class IL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[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 n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const o={...a,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function BL(){return new IL}(Px=globalThis).__zod_globalRegistry??(Px.__zod_globalRegistry=BL());const Jo=globalThis.__zod_globalRegistry;function qL(e,t){return new e({type:"string",...ke(t)})}function KL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function Ux(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function HL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function GL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function FL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function ZL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function VL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function QL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function YL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function JL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function XL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function WL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function e5(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function t5(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function n5(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function s5(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function i5(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function a5(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function r5(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function o5(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function l5(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function c5(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function u5(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function d5(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function f5(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function h5(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function m5(e,t){return new e({type:"number",checks:[],...ke(t)})}function p5(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(t)})}function g5(e,t){return new e({type:"boolean",...ke(t)})}function y5(e){return new e({type:"unknown"})}function v5(e,t){return new e({type:"never",...ke(t)})}function Ix(e,t){return new $w({check:"less_than",...ke(t),value:e,inclusive:!1})}function am(e,t){return new $w({check:"less_than",...ke(t),value:e,inclusive:!0})}function Bx(e,t){return new Pw({check:"greater_than",...ke(t),value:e,inclusive:!1})}function rm(e,t){return new Pw({check:"greater_than",...ke(t),value:e,inclusive:!0})}function qx(e,t){return new OO({check:"multiple_of",...ke(t),value:e})}function Hw(e,t){return new DO({check:"max_length",...ke(t),maximum:e})}function $u(e,t){return new MO({check:"min_length",...ke(t),minimum:e})}function Gw(e,t){return new $O({check:"length_equals",...ke(t),length:e})}function b5(e,t){return new PO({check:"string_format",format:"regex",...ke(t),pattern:e})}function x5(e){return new UO({check:"string_format",format:"lowercase",...ke(e)})}function S5(e){return new IO({check:"string_format",format:"uppercase",...ke(e)})}function j5(e,t){return new BO({check:"string_format",format:"includes",...ke(t),includes:e})}function w5(e,t){return new qO({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function N5(e,t){return new KO({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function Hr(e){return new HO({check:"overwrite",tx:e})}function C5(e){return Hr(t=>t.normalize(e))}function k5(){return Hr(e=>e.trim())}function z5(){return Hr(e=>e.toLowerCase())}function _5(){return Hr(e=>e.toUpperCase())}function E5(){return Hr(e=>PR(e))}function T5(e,t,n){return new e({type:"array",element:t,...ke(n)})}function A5(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}function R5(e){const t=O5(n=>(n.addIssue=a=>{if(typeof a=="string")n.issues.push(dl(a,n.value,t._zod.def));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(dl(o))}},e(n.value,n)));return t}function O5(e,t){const n=new kn({check:"custom",...ke(t)});return n._zod.check=e,n}function Fw(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??Jo,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,n={path:[],schemaPath:[]}){var a;const o=e._zod.def,c=t.seen.get(e);if(c)return c.count++,n.schemaPath.includes(e)&&(c.cycle=n.path),c.schema;const u={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,u);const f=e._zod.toJSONSchema?.();if(f)u.schema=f;else{const v={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,u.schema,v);else{const b=u.schema,x=t.processors[o.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);x(e,t,b,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 Zw(e,t){const n=e.seen.get(t);if(!n)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 o=u=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(u[0])?.id,b=e.external.uri??(N=>N);if(y)return{ref:b(y)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(u[1]===n)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}=o(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 Vw(e,t){const n=e.seen.get(t);if(!n)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 b=e.seen.get(v),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(x)):Object.assign(m,x),Object.assign(m,p),u._zod.parent===v)for(const S in m)S==="$ref"||S==="allOf"||S in p||delete m[S];if(x.$ref&&b.def)for(const S in m)S==="$ref"||S==="allOf"||S in b.def&&JSON.stringify(m[S])===JSON.stringify(b.def[S])&&delete m[S]}const y=u._zod.parent;if(y&&y!==v){a(y);const b=e.seen.get(y);if(b?.schema.$ref&&(m.$ref=b.schema.$ref,b.def))for(const x in m)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(m[x])===JSON.stringify(b.def[x])&&delete m[x]}e.override({zodSchema:u,jsonSchema:m,path:f.path??[]})};for(const u of[...e.seen.entries()].reverse())a(u[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$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");o.$id=e.external.uri(u)}Object.assign(o,n.def??n.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"?o.$defs=c:o.definitions=c);try{const u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Pu(t,"input",e.processors),output:Pu(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function dn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return dn(a.element,n);if(a.type==="set")return dn(a.valueType,n);if(a.type==="lazy")return dn(a.getter(),n);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,n);if(a.type==="intersection")return dn(a.left,n)||dn(a.right,n);if(a.type==="record"||a.type==="map")return dn(a.keyType,n)||dn(a.valueType,n);if(a.type==="pipe")return dn(a.in,n)||dn(a.out,n);if(a.type==="object"){for(const o in a.shape)if(dn(a.shape[o],n))return!0;return!1}if(a.type==="union"){for(const o of a.options)if(dn(o,n))return!0;return!1}if(a.type==="tuple"){for(const o of a.items)if(dn(o,n))return!0;return!!(a.rest&&dn(a.rest,n))}return!1}const L5=(e,t={})=>n=>{const a=Fw({...n,processors:t});return Ht(e,a),Zw(a,e),Vw(a,e)},Pu=(e,t,n={})=>a=>{const{libraryOptions:o,target:c}=a??{},u=Fw({...o??{},target:c,io:t,processors:n});return Ht(e,u),Zw(u,e),Vw(u,e)},D5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},M5=(e,t,n,a)=>{const o=n;o.type="string";const{minimum:c,maximum:u,format:f,patterns:m,contentEncoding:p}=e._zod.bag;if(typeof c=="number"&&(o.minLength=c),typeof u=="number"&&(o.maxLength=u),f&&(o.format=D5[f]??f,o.format===""&&delete o.format,f==="time"&&delete o.format),p&&(o.contentEncoding=p),m&&m.size>0){const v=[...m];v.length===1?o.pattern=v[0].source:v.length>1&&(o.allOf=[...v.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},$5=(e,t,n,a)=>{const o=n,{minimum:c,maximum:u,format:f,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?o.type="integer":o.type="number",typeof v=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=v,o.exclusiveMinimum=!0):o.exclusiveMinimum=v),typeof c=="number"&&(o.minimum=c,typeof v=="number"&&t.target!=="draft-04"&&(v>=c?delete o.minimum:delete o.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=p,o.exclusiveMaximum=!0):o.exclusiveMaximum=p),typeof u=="number"&&(o.maximum=u,typeof p=="number"&&t.target!=="draft-04"&&(p<=u?delete o.maximum:delete o.exclusiveMaximum)),typeof m=="number"&&(o.multipleOf=m)},P5=(e,t,n,a)=>{n.type="boolean"},U5=(e,t,n,a)=>{n.not={}},I5=(e,t,n,a)=>{},B5=(e,t,n,a)=>{const o=e._zod.def,c=kw(o.entries);c.every(u=>typeof u=="number")&&(n.type="number"),c.every(u=>typeof u=="string")&&(n.type="string"),n.enum=c},q5=(e,t,n,a)=>{const o=e._zod.def,c=[];for(const u of o.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];n.type=u===null?"null":typeof u,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[u]:n.const=u}else c.every(u=>typeof u=="number")&&(n.type="number"),c.every(u=>typeof u=="string")&&(n.type="string"),c.every(u=>typeof u=="boolean")&&(n.type="boolean"),c.every(u=>u===null)&&(n.type="null"),n.enum=c},K5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},H5=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},G5=(e,t,n,a)=>{const o=n,c=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(o.minItems=u),typeof f=="number"&&(o.maxItems=f),o.type="array",o.items=Ht(c.element,t,{...a,path:[...a.path,"items"]})},F5=(e,t,n,a)=>{const o=n,c=e._zod.def;o.type="object",o.properties={};const u=c.shape;for(const p in u)o.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&&(o.required=Array.from(m)),c.catchall?._zod.def.type==="never"?o.additionalProperties=!1:c.catchall?c.catchall&&(o.additionalProperties=Ht(c.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Z5=(e,t,n,a)=>{const o=e._zod.def,c=o.inclusive===!1,u=o.options.map((f,m)=>Ht(f,t,{...a,path:[...a.path,c?"oneOf":"anyOf",m]}));c?n.oneOf=u:n.anyOf=u},V5=(e,t,n,a)=>{const o=e._zod.def,c=Ht(o.left,t,{...a,path:[...a.path,"allOf",0]}),u=Ht(o.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]];n.allOf=m},Q5=(e,t,n,a)=>{const o=n,c=e._zod.def;o.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","*"]});o.patternProperties={};for(const y of m)o.patternProperties[y.source]=v}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=Ht(c.keyType,t,{...a,path:[...a.path,"propertyNames"]})),o.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&&(o.required=v)}},Y5=(e,t,n,a)=>{const o=e._zod.def,c=Ht(o.innerType,t,a),u=t.seen.get(e);t.target==="openapi-3.0"?(u.ref=o.innerType,n.nullable=!0):n.anyOf=[c,{type:"null"}]},J5=(e,t,n,a)=>{const o=e._zod.def;Ht(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType},X5=(e,t,n,a)=>{const o=e._zod.def;Ht(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},W5=(e,t,n,a)=>{const o=e._zod.def;Ht(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},eD=(e,t,n,a)=>{const o=e._zod.def;Ht(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType;let u;try{u=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=u},tD=(e,t,n,a)=>{const o=e._zod.def,c=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;Ht(c,t,a);const u=t.seen.get(e);u.ref=c},nD=(e,t,n,a)=>{const o=e._zod.def;Ht(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType,n.readOnly=!0},Qw=(e,t,n,a)=>{const o=e._zod.def;Ht(o.innerType,t,a);const c=t.seen.get(e);c.ref=o.innerType},sD=te("ZodISODateTime",(e,t)=>{iL.init(e,t),Et.init(e,t)});function iD(e){return u5(sD,e)}const aD=te("ZodISODate",(e,t)=>{aL.init(e,t),Et.init(e,t)});function rD(e){return d5(aD,e)}const oD=te("ZodISOTime",(e,t)=>{rL.init(e,t),Et.init(e,t)});function lD(e){return f5(oD,e)}const cD=te("ZodISODuration",(e,t)=>{oL.init(e,t),Et.init(e,t)});function uD(e){return h5(cD,e)}const dD=(e,t)=>{Tw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>JR(e,n)},flatten:{value:n=>YR(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Bm,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Bm,2)}},isEmpty:{get(){return e.issues.length===0}}})},ts=te("ZodError",dD,{Parent:Error}),fD=qp(ts),hD=Kp(ts),mD=ad(ts),pD=rd(ts),gD=eO(ts),yD=tO(ts),vD=nO(ts),bD=sO(ts),xD=iO(ts),SD=aO(ts),jD=rO(ts),wD=oO(ts),_t=te("ZodType",(e,t)=>(zt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Pu(e,"input"),output:Pu(e,"output")}}),e.toJSONSchema=L5(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Ki(t,{checks:[...t.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(n,a)=>Hi(e,n,a),e.brand=()=>e,e.register=((n,a)=>(n.add(e,a),e)),e.parse=(n,a)=>fD(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>mD(e,n,a),e.parseAsync=async(n,a)=>hD(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>pD(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>gD(e,n,a),e.decode=(n,a)=>yD(e,n,a),e.encodeAsync=async(n,a)=>vD(e,n,a),e.decodeAsync=async(n,a)=>bD(e,n,a),e.safeEncode=(n,a)=>xD(e,n,a),e.safeDecode=(n,a)=>SD(e,n,a),e.safeEncodeAsync=async(n,a)=>jD(e,n,a),e.safeDecodeAsync=async(n,a)=>wD(e,n,a),e.refine=(n,a)=>e.check(yM(n,a)),e.superRefine=n=>e.check(vM(n)),e.overwrite=n=>e.check(Hr(n)),e.optional=()=>Gx(e),e.exactOptional=()=>iM(e),e.nullable=()=>Fx(e),e.nullish=()=>Gx(Fx(e)),e.nonoptional=n=>uM(e,n),e.array=()=>be(e),e.or=n=>YD([e,n]),e.and=n=>XD(e,n),e.transform=n=>Zx(e,nM(n)),e.default=n=>oM(e,n),e.prefault=n=>cM(e,n),e.catch=n=>fM(e,n),e.pipe=n=>Zx(e,n),e.readonly=()=>pM(e),e.describe=n=>{const a=e.clone();return Jo.add(a,{description:n}),a},Object.defineProperty(e,"description",{get(){return Jo.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Jo.get(e);const a=e.clone();return Jo.add(a,n[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Yw=te("_ZodString",(e,t)=>{Hp.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,c)=>M5(e,a,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...a)=>e.check(b5(...a)),e.includes=(...a)=>e.check(j5(...a)),e.startsWith=(...a)=>e.check(w5(...a)),e.endsWith=(...a)=>e.check(N5(...a)),e.min=(...a)=>e.check($u(...a)),e.max=(...a)=>e.check(Hw(...a)),e.length=(...a)=>e.check(Gw(...a)),e.nonempty=(...a)=>e.check($u(1,...a)),e.lowercase=a=>e.check(x5(a)),e.uppercase=a=>e.check(S5(a)),e.trim=()=>e.check(k5()),e.normalize=(...a)=>e.check(C5(...a)),e.toLowerCase=()=>e.check(z5()),e.toUpperCase=()=>e.check(_5()),e.slugify=()=>e.check(E5())}),ND=te("ZodString",(e,t)=>{Hp.init(e,t),Yw.init(e,t),e.email=n=>e.check(KL(CD,n)),e.url=n=>e.check(VL(kD,n)),e.jwt=n=>e.check(c5(BD,n)),e.emoji=n=>e.check(QL(zD,n)),e.guid=n=>e.check(Ux(Kx,n)),e.uuid=n=>e.check(HL(tu,n)),e.uuidv4=n=>e.check(GL(tu,n)),e.uuidv6=n=>e.check(FL(tu,n)),e.uuidv7=n=>e.check(ZL(tu,n)),e.nanoid=n=>e.check(YL(_D,n)),e.guid=n=>e.check(Ux(Kx,n)),e.cuid=n=>e.check(JL(ED,n)),e.cuid2=n=>e.check(XL(TD,n)),e.ulid=n=>e.check(WL(AD,n)),e.base64=n=>e.check(r5(PD,n)),e.base64url=n=>e.check(o5(UD,n)),e.xid=n=>e.check(e5(RD,n)),e.ksuid=n=>e.check(t5(OD,n)),e.ipv4=n=>e.check(n5(LD,n)),e.ipv6=n=>e.check(s5(DD,n)),e.cidrv4=n=>e.check(i5(MD,n)),e.cidrv6=n=>e.check(a5($D,n)),e.e164=n=>e.check(l5(ID,n)),e.datetime=n=>e.check(iD(n)),e.date=n=>e.check(rD(n)),e.time=n=>e.check(lD(n)),e.duration=n=>e.check(uD(n))});function L(e){return qL(ND,e)}const Et=te("ZodStringFormat",(e,t)=>{Nt.init(e,t),Yw.init(e,t)}),CD=te("ZodEmail",(e,t)=>{QO.init(e,t),Et.init(e,t)}),Kx=te("ZodGUID",(e,t)=>{ZO.init(e,t),Et.init(e,t)}),tu=te("ZodUUID",(e,t)=>{VO.init(e,t),Et.init(e,t)}),kD=te("ZodURL",(e,t)=>{YO.init(e,t),Et.init(e,t)}),zD=te("ZodEmoji",(e,t)=>{JO.init(e,t),Et.init(e,t)}),_D=te("ZodNanoID",(e,t)=>{XO.init(e,t),Et.init(e,t)}),ED=te("ZodCUID",(e,t)=>{WO.init(e,t),Et.init(e,t)}),TD=te("ZodCUID2",(e,t)=>{eL.init(e,t),Et.init(e,t)}),AD=te("ZodULID",(e,t)=>{tL.init(e,t),Et.init(e,t)}),RD=te("ZodXID",(e,t)=>{nL.init(e,t),Et.init(e,t)}),OD=te("ZodKSUID",(e,t)=>{sL.init(e,t),Et.init(e,t)}),LD=te("ZodIPv4",(e,t)=>{lL.init(e,t),Et.init(e,t)}),DD=te("ZodIPv6",(e,t)=>{cL.init(e,t),Et.init(e,t)}),MD=te("ZodCIDRv4",(e,t)=>{uL.init(e,t),Et.init(e,t)}),$D=te("ZodCIDRv6",(e,t)=>{dL.init(e,t),Et.init(e,t)}),PD=te("ZodBase64",(e,t)=>{fL.init(e,t),Et.init(e,t)}),UD=te("ZodBase64URL",(e,t)=>{mL.init(e,t),Et.init(e,t)}),ID=te("ZodE164",(e,t)=>{pL.init(e,t),Et.init(e,t)}),BD=te("ZodJWT",(e,t)=>{yL.init(e,t),Et.init(e,t)}),Jw=te("ZodNumber",(e,t)=>{Iw.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,c)=>$5(e,a,o),e.gt=(a,o)=>e.check(Bx(a,o)),e.gte=(a,o)=>e.check(rm(a,o)),e.min=(a,o)=>e.check(rm(a,o)),e.lt=(a,o)=>e.check(Ix(a,o)),e.lte=(a,o)=>e.check(am(a,o)),e.max=(a,o)=>e.check(am(a,o)),e.int=a=>e.check(Hx(a)),e.safe=a=>e.check(Hx(a)),e.positive=a=>e.check(Bx(0,a)),e.nonnegative=a=>e.check(rm(0,a)),e.negative=a=>e.check(Ix(0,a)),e.nonpositive=a=>e.check(am(0,a)),e.multipleOf=(a,o)=>e.check(qx(a,o)),e.step=(a,o)=>e.check(qx(a,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function _e(e){return m5(Jw,e)}const qD=te("ZodNumberFormat",(e,t)=>{vL.init(e,t),Jw.init(e,t)});function Hx(e){return p5(qD,e)}const KD=te("ZodBoolean",(e,t)=>{bL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>P5(e,n,a)});function kt(e){return g5(KD,e)}const HD=te("ZodUnknown",(e,t)=>{xL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>I5()});function Uu(){return y5(HD)}const GD=te("ZodNever",(e,t)=>{SL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>U5(e,n,a)});function FD(e){return v5(GD,e)}const ZD=te("ZodArray",(e,t)=>{jL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>G5(e,n,a,o),e.element=t.element,e.min=(n,a)=>e.check($u(n,a)),e.nonempty=n=>e.check($u(1,n)),e.max=(n,a)=>e.check(Hw(n,a)),e.length=(n,a)=>e.check(Gw(n,a)),e.unwrap=()=>e.element});function be(e,t){return T5(ZD,e,t)}const VD=te("ZodObject",(e,t)=>{NL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>F5(e,n,a,o),ct(e,"shape",()=>t.shape),e.keyof=()=>wt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Uu()}),e.loose=()=>e.clone({...e._zod.def,catchall:Uu()}),e.strict=()=>e.clone({...e._zod.def,catchall:FD()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>GR(e,n),e.safeExtend=n=>FR(e,n),e.merge=n=>ZR(e,n),e.pick=n=>KR(e,n),e.omit=n=>HR(e,n),e.partial=(...n)=>VR(Xw,e,n[0]),e.required=(...n)=>QR(Ww,e,n[0])});function ve(e,t){const n={type:"object",shape:e??{},...ke(t)};return new VD(n)}const QD=te("ZodUnion",(e,t)=>{CL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>Z5(e,n,a,o),e.options=t.options});function YD(e,t){return new QD({type:"union",options:e,...ke(t)})}const JD=te("ZodIntersection",(e,t)=>{kL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>V5(e,n,a,o)});function XD(e,t){return new JD({type:"intersection",left:e,right:t})}const WD=te("ZodRecord",(e,t)=>{zL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>Q5(e,n,a,o),e.keyType=t.keyType,e.valueType=t.valueType});function yl(e,t,n){return new WD({type:"record",keyType:e,valueType:t,...ke(n)})}const Km=te("ZodEnum",(e,t)=>{_L.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(a,o,c)=>B5(e,a,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,o)=>{const c={};for(const u of a)if(n.has(u))c[u]=t.entries[u];else throw new Error(`Key ${u} not found in enum`);return new Km({...t,checks:[],...ke(o),entries:c})},e.exclude=(a,o)=>{const c={...t.entries};for(const u of a)if(n.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new Km({...t,checks:[],...ke(o),entries:c})}});function wt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Km({type:"enum",entries:n,...ke(t)})}const eM=te("ZodLiteral",(e,t)=>{EL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>q5(e,n,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 fl(e,t){return new eM({type:"literal",values:Array.isArray(e)?e:[e],...ke(t)})}const tM=te("ZodTransform",(e,t)=>{TL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>H5(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new Nw(e.constructor.name);n.addIssue=c=>{if(typeof c=="string")n.issues.push(dl(c,n.value,t));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=n.value),u.inst??(u.inst=e),n.issues.push(dl(u))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(c=>(n.value=c,n)):(n.value=o,n)}});function nM(e){return new tM({type:"transform",transform:e})}const Xw=te("ZodOptional",(e,t)=>{Kw.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>Qw(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function Gx(e){return new Xw({type:"optional",innerType:e})}const sM=te("ZodExactOptional",(e,t)=>{AL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>Qw(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function iM(e){return new sM({type:"optional",innerType:e})}const aM=te("ZodNullable",(e,t)=>{RL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>Y5(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function Fx(e){return new aM({type:"nullable",innerType:e})}const rM=te("ZodDefault",(e,t)=>{OL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>X5(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function oM(e,t){return new rM({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_w(t)}})}const lM=te("ZodPrefault",(e,t)=>{LL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>W5(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function cM(e,t){return new lM({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_w(t)}})}const Ww=te("ZodNonOptional",(e,t)=>{DL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>J5(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function uM(e,t){return new Ww({type:"nonoptional",innerType:e,...ke(t)})}const dM=te("ZodCatch",(e,t)=>{ML.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>eD(e,n,a,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function fM(e,t){return new dM({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const hM=te("ZodPipe",(e,t)=>{$L.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>tD(e,n,a,o),e.in=t.in,e.out=t.out});function Zx(e,t){return new hM({type:"pipe",in:e,out:t})}const mM=te("ZodReadonly",(e,t)=>{PL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>nD(e,n,a,o),e.unwrap=()=>e._zod.def.innerType});function pM(e){return new mM({type:"readonly",innerType:e})}const gM=te("ZodCustom",(e,t)=>{UL.init(e,t),_t.init(e,t),e._zod.processJSONSchema=(n,a,o)=>K5(e,n)});function yM(e,t={}){return A5(gM,e,t)}function vM(e){return R5(e)}ve({maxConcurrency:_e().int().positive(),maxRequestsPerMinute:_e().int().positive(),maxRequestsPerDay:_e().int().positive()});const Gr=L().min(1);L().min(1);const Gp=ve({label:L().min(1),city:L().min(1),region:L().min(1),country:L().length(2),timezone:L().optional()}),eN=wt(["citation.lost","citation.gained","run.completed","run.failed"]);ve({id:L(),projectId:L(),channel:fl("webhook"),url:L().url(),urlDisplay:L(),urlHost:L(),events:be(eN),enabled:kt().default(!0),webhookSecret:L().optional(),createdAt:L(),updatedAt:L()});const tN=wt(["cli","api","config-file"]);function bM(e){const t=new Set,n=new Set;for(const a of e){if(t.has(a.label)){n.add(a.label);continue}t.add(a.label)}return[...n]}function xM(e,t){return t?e.some(n=>n.label===t):!0}ve({displayName:L().min(1),canonicalDomain:L().min(1),ownedDomains:be(L().min(1)).optional(),country:L().length(2),language:L().min(2),tags:be(L()).optional(),labels:yl(L(),L()).optional(),providers:be(Gr).optional(),locations:be(Gp).optional(),defaultLocation:L().nullable().optional(),configSource:tN.optional()});ve({id:L(),name:L(),displayName:L().optional(),canonicalDomain:L(),ownedDomains:be(L()).default([]),country:L().length(2),language:L().min(2),tags:be(L()).default([]),labels:yl(L(),L()).default({}),locations:be(Gp).default([]),defaultLocation:L().nullable().optional(),configSource:tN.default("cli"),configRevision:_e().int().positive().default(1),createdAt:L().optional(),updatedAt:L().optional()});function Hm(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}function SM(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,a=[];for(const o of t){const c=o.trim();if(!c)continue;const u=Hm(c);n.has(u)||(n.add(u),a.push(c))}return a}const jM=ve({name:L().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:yl(L(),L()).optional().default({})}),wM=ve({preset:L().optional(),cron:L().optional(),timezone:L().optional().default("UTC"),providers:be(Gr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),NM=ve({channel:fl("webhook"),url:L().url(),events:be(eN).min(1)}),CM=ve({gsc:ve({propertyUrl:L()}).optional(),syncSchedule:ve({preset:L().optional(),cron:L().optional()}).optional()}).optional(),kM=ve({displayName:L().min(1),canonicalDomain:L().min(1),ownedDomains:be(L().min(1)).optional().default([]),country:L().length(2),language:L().min(2),keywords:be(L().min(1)).optional().default([]),competitors:be(L().min(1)).optional().default([]),providers:be(Gr).optional().default([]),locations:be(Gp).optional().default([]),defaultLocation:L().optional(),schedule:wM,notifications:be(NM).optional().default([]),google:CM}).superRefine((e,t)=>{const n=bM(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),xM(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ve({apiVersion:fl("canonry/v1"),kind:fl("Project"),metadata:jM,spec:kM});const zM=wt(["gsc","ga4"]);ve({id:L(),domain:L(),connectionType:zM,propertyId:L().nullable().optional(),sitemapUrl:L().nullable().optional(),scopes:be(L()).default([]),createdAt:L(),updatedAt:L()});ve({date:L(),query:L(),page:L(),country:L().nullable().optional(),device:L().nullable().optional(),clicks:_e(),impressions:_e(),ctr:_e(),position:_e()});const Gm=ve({id:L(),url:L(),indexingState:L().nullable().optional(),verdict:L().nullable().optional(),coverageState:L().nullable().optional(),pageFetchState:L().nullable().optional(),robotsTxtState:L().nullable().optional(),crawlTime:L().nullable().optional(),lastCrawlResult:L().nullable().optional(),isMobileFriendly:kt().nullable().optional(),richResults:be(L()).default([]),inspectedAt:L()});wt(["stable","reindexed","deindexed","still-missing","new"]);const _M=ve({url:L(),previousState:L().nullable(),currentState:L().nullable(),transitionDate:L()}),EM=ve({reason:L(),count:_e(),urls:be(Gm).default([])});ve({summary:ve({total:_e(),indexed:_e(),notIndexed:_e(),deindexed:_e(),percentage:_e()}),lastInspectedAt:L().nullable(),indexed:be(Gm).default([]),notIndexed:be(Gm).default([]),deindexed:be(_M).default([]),reasonGroups:be(EM).default([])});ve({url:L(),type:wt(["URL_UPDATED","URL_DELETED"]),notifiedAt:L()});ve({url:L(),type:wt(["URL_UPDATED","URL_DELETED"]),notifiedAt:L(),status:wt(["success","error"]),error:L().optional()});ve({date:L(),indexed:_e(),notIndexed:_e(),reasonBreakdown:yl(L(),_e()).default({})});ve({id:L(),domain:L(),siteUrl:L().nullable().optional(),createdAt:L(),updatedAt:L()});const om=ve({id:L(),url:L(),httpCode:_e().nullable().optional(),inIndex:kt().nullable().optional(),lastCrawledDate:L().nullable().optional(),inIndexDate:L().nullable().optional(),inspectedAt:L(),documentSize:_e().nullable().optional(),anchorCount:_e().nullable().optional(),discoveryDate:L().nullable().optional()});ve({summary:ve({total:_e(),indexed:_e(),notIndexed:_e(),unknown:_e().optional(),percentage:_e()}),lastInspectedAt:L().nullable(),indexed:be(om).default([]),notIndexed:be(om).default([]),unknown:be(om).default([]).optional()});ve({query:L(),impressions:_e(),clicks:_e(),ctr:_e(),averagePosition:_e()});ve({url:L(),status:wt(["success","error"]),submittedAt:L(),error:L().optional()});const Fr=wt(["live","staging"]);ve({projectName:L(),url:L(),stagingUrl:L().optional(),username:L(),defaultEnv:Fr,createdAt:L(),updatedAt:L()});const Vx=ve({url:L(),reachable:kt(),pageCount:_e().nullable().optional(),version:L().nullable().optional(),error:L().nullable().optional(),plugins:be(L()).optional(),authenticatedUser:ve({id:_e(),slug:L()}).nullable().optional()});ve({connected:kt(),projectName:L(),defaultEnv:Fr,live:Vx.nullable(),staging:Vx.nullable(),adminUrl:L().nullable().optional()});const TM=ve({id:_e(),slug:L(),title:L(),status:L(),modifiedAt:L().nullable().optional(),link:L().nullable().optional()}),nN=ve({title:L().nullable(),description:L().nullable(),noindex:kt().nullable(),writable:kt().default(!1),writeTargets:be(L()).default([])}),AM=ve({type:L(),json:yl(L(),Uu())}),RM=TM.extend({env:Fr,content:L(),seo:nN,schemaBlocks:be(AM).default([])}),Qx=RM.extend({contentHash:L(),contentSnippet:L()}),sN=ve({manualRequired:fl(!0),targetUrl:L(),adminUrl:L().nullable().optional(),content:L(),nextSteps:be(L()).default([])}),OM=ve({slug:L(),severity:wt(["high","medium","low"]),code:wt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:L()});ve({slug:L(),title:L(),status:L(),wordCount:_e(),seo:nN,schemaPresent:kt(),issues:be(OM).default([])});const LM=ve({slug:L(),status:wt(["applied","skipped","manual"]),error:L().optional(),manualAssist:sN.optional()});ve({env:Fr,strategy:wt(["plugin","manual"]),results:be(LM)});const DM=ve({slug:L(),status:wt(["deployed","stripped","skipped","failed"]),schemasInjected:be(L()).optional(),manualAssist:sN.optional(),error:L().optional()});ve({env:Fr,results:be(DM)});const MM=ve({slug:L(),title:L(),canonrySchemas:be(L()),thirdPartySchemas:be(L()),hasCanonrySchema:kt()});ve({env:Fr,pages:be(MM)});const $M=ve({name:L(),status:wt(["completed","skipped","failed"]),summary:L().optional(),error:L().optional()});ve({projectName:L(),steps:be($M)});ve({slug:L(),live:Qx,staging:Qx,hasDifferences:kt(),differences:ve({title:kt(),slug:kt(),content:kt(),seoTitle:kt(),seoDescription:kt(),noindex:kt(),schema:kt()})});const PM=wt(["queued","running","completed","partial","failed","cancelled"]),UM=wt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap"]),IM=wt(["manual","scheduled","config-apply"]),BM=wt(["cited","not-cited"]),qM=wt(["visible","not-visible"]),KM=wt(["new","cited","lost","emerging","not-cited"]);ve({id:L(),projectId:L(),kind:UM,status:PM,trigger:IM.default("manual"),location:L().nullable().optional(),startedAt:L().nullable().optional(),finishedAt:L().nullable().optional(),error:L().nullable().optional(),createdAt:L()});const iN=ve({uri:L(),title:L()});ve({id:L(),runId:L(),keywordId:L(),keyword:L().optional(),provider:Gr,citationState:BM,answerMentioned:kt().optional(),visibilityState:qM.optional(),transition:KM.optional(),answerText:L().nullable().optional(),citedDomains:be(L()).default([]),competitorOverlap:be(L()).default([]),recommendedCompetitors:be(L()).default([]),matchedTerms:be(L()).default([]),groundingSources:be(iN).default([]),searchQueries:be(L()).default([]),model:L().nullable().optional(),location:L().nullable().optional(),createdAt:L()});ve({id:L(),projectId:L().nullable().optional(),actor:L(),action:L(),entityType:L(),entityId:L().nullable().optional(),diff:Uu().optional(),createdAt:L()});const HM=wt(["yes","no","unknown","not-mentioned"]);ve({companyName:L().min(1),domain:L().min(1),phrases:be(L().min(1)).optional().default([]),competitors:be(L().min(1)).optional().default([])});const GM=ve({name:L(),count:_e().int().nonnegative()}),FM=ve({id:L(),name:L(),weight:_e(),score:_e(),grade:L(),status:wt(["pass","partial","fail"]),findings:be(ve({type:L(),message:L()})).default([]),recommendations:be(L()).default([])}),ZM=ve({url:L(),finalUrl:L(),auditedAt:L(),overallScore:_e(),overallGrade:L(),summary:L(),factors:be(FM).default([])}),VM=ve({industry:L(),summary:L(),services:be(L()).default([]),categoryTerms:be(L()).default([])}),QM=ve({provider:L(),displayName:L(),model:L().nullable().optional(),mentioned:kt(),cited:kt(),describedAccurately:HM,accuracyNotes:L().nullable().optional(),incorrectClaims:be(L()).default([]),recommendedCompetitors:be(L()).default([]),citedDomains:be(L()).default([]),groundingSources:be(iN).default([]),searchQueries:be(L()).default([]),answerText:L(),error:L().nullable().optional()}),YM=ve({phrase:L(),providerResults:be(QM).default([])}),JM=ve({totalQueries:_e().int().nonnegative(),totalProviders:_e().int().nonnegative(),totalComparisons:_e().int().nonnegative(),mentionCount:_e().int().nonnegative(),citationCount:_e().int().nonnegative(),topCompetitors:be(GM).default([]),visibilityGap:L(),whatThisMeans:be(L()).default([]),recommendedActions:be(L()).default([])});ve({companyName:L(),domain:L(),homepageUrl:L(),generatedAt:L(),phrases:be(L()).default([]),competitors:be(L()).default([]),profile:VM,audit:ZM,queryResults:be(YM).default([]),summary:JM});ve({id:L(),projectId:L(),cronExpr:L(),preset:L().nullable().optional(),timezone:L().default("UTC"),enabled:kt().default(!0),providers:be(Gr).default([]),lastRunAt:L().nullable().optional(),nextRunAt:L().nullable().optional(),createdAt:L(),updatedAt:L()});ve({preset:L().optional(),cron:L().optional(),timezone:L().optional().default("UTC"),enabled:kt().optional().default(!0),providers:be(Gr).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});ve({id:L(),projectId:L(),propertyId:L(),clientEmail:L(),connected:kt(),createdAt:L(),updatedAt:L()});ve({date:L(),landingPage:L(),sessions:_e(),organicSessions:_e(),users:_e()});const XM=ve({source:L(),medium:L(),sessions:_e(),users:_e()});ve({totalSessions:_e(),totalOrganicSessions:_e(),totalUsers:_e(),topPages:be(ve({landingPage:L(),sessions:_e(),organicSessions:_e(),users:_e()})),aiReferrals:be(XM),lastSyncedAt:L().nullable()});function Yx(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}function hn({text:e}){const[t,n]=w.useState(null),a=w.useRef(null),o=w.useCallback(()=>{if(!a.current)return;const u=a.current.getBoundingClientRect();n({top:u.top+window.scrollY,left:u.left+u.width/2+window.scrollX})},[]),c=w.useCallback(()=>n(null),[]);return r.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:o,onMouseLeave:c,onFocus:o,onBlur:c,children:[r.jsxs("svg",{ref:a,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&Vu.createPortal(r.jsx("span",{role:"tooltip",className:"info-tooltip-bubble info-tooltip-bubble--fixed",style:{top:t.top,left:t.left},children:e}),document.body)]})}function Jx(e,t){const n=WM(t),a=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(p=>p.startsWith("**")&&p.endsWith("**")?{type:"bold",value:p.slice(2,-2)}:{type:"text",value:p}),o=n.flatMap(p=>p.terms).filter(p=>p.trim().length>1);if(o.length===0)return a.map((p,v)=>p.type==="bold"?us.createElement("strong",{key:`b-${v}`,className:"text-zinc-200 font-semibold"},p.value):p.value).filter(Boolean);const u=[...o].sort((p,v)=>v.length-p.length).map(p=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),f=new RegExp(`(${u.join("|")})`,"gi"),m=new Map;for(const p of n)for(const v of p.terms){const y=v.toLowerCase();m.has(y)||m.set(y,p.className)}return a.flatMap((p,v)=>p.value.split(f).map((b,x)=>{if(!b)return null;if(x%2===1){const S=m.get(b.toLowerCase())??"answer-highlight";return p.type==="bold"?us.createElement("mark",{key:`hl-${v}-${x}`,className:S},us.createElement("strong",{className:"text-zinc-200 font-semibold"},b)):us.createElement("mark",{key:`hl-${v}-${x}`,className:S},b)}return p.type==="bold"?us.createElement("strong",{key:`b-${v}-${x}`,className:"text-zinc-200 font-semibold"},b):b})).filter(Boolean)}function WM(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function lm(e,t){switch(e){case"new":return"First observation";case"emerging":return"First visibility";case"lost":return"Lost since last run";default:return t==="visible"?"Visible in latest run":t==="pending"?"Awaiting first run":"Not visible in latest run"}}function e4({evidence:e,project:t,onClose:n}){const[a,o]=w.useState(!1),[c,u]=w.useState("mentions"),[f,m]=w.useState(-1),[p,v]=w.useState(null),[y,b]=w.useState(!1),[x,N]=w.useState({}),S=SM(t.project),C=new Set(S.map(Hm)),k=e.runHistory,A=k.length>1,[T,z]=w.useState(null),M=w.useRef(!1);w.useEffect(()=>{if(M.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const Z=k.at(-1);Z&&(M.current=!0,Ur(Z.runId).then(V=>{const se=V.snapshots.find(ge=>ge.keyword===e.keyword&&ge.provider===e.provider);se&&z({citationState:se.citationState,answerMentioned:se.answerMentioned,visibilityState:se.visibilityState,visibilityTransition:Z.visibilityTransition,provider:se.provider,model:se.model??e.model,answerSnippet:se.answerText??e.answerSnippet,citedDomains:se.citedDomains??e.citedDomains,competitorDomains:se.competitorOverlap??e.competitorDomains,recommendedCompetitors:se.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:se.matchedTerms??e.matchedTerms??[],groundingSources:se.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const $=f>=0&&p!==null,E=$?p:T||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:k.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},O=E.visibilityState==="pending"||E.citationState==="pending",K=O?!1:E.visibilityState!=null?E.visibilityState==="visible":E.answerMentioned!=null?E.answerMentioned:E.citationState==="cited"||E.citationState==="emerging",W=E.answerMentioned!=null||E.visibilityState!=null||E.recommendedCompetitors.length>0,J=E.citedDomains.length>0||E.groundingSources.length>0||E.evidenceUrls.length>0,ne=t.project.displayName||t.project.name,fe=[...S.map(Hm),ne,ne.split(" ").slice(0,2).join(" "),...E.matchedTerms].filter(Z=>Z.trim().length>2),Ee=[...E.competitorDomains.flatMap(Z=>{const V=Z.split(".")[0];return V&&V.length>=4?[V]:[]}),...E.recommendedCompetitors].filter(Z=>Z.trim().length>2),xe=[{terms:fe,className:"answer-highlight-brand"},...Ee.length>0?[{terms:Ee,className:"answer-highlight-competitor"}]:[]],H=O?"pending":E.visibilityTransition==="lost"?"lost":K?"cited":"not-cited",ae=w.useRef(0),pe=w.useCallback(async Z=>{const V=++ae.current;if(Z===-1||Z===k.length-1){m(-1),v(null),o(!1);return}m(Z),o(!1);const se=k[Z],ge=`${se.runId}::${e.keyword}::${e.provider}`;if(x[ge]){v(x[ge]);return}b(!0);try{const je=await Ur(se.runId);if(V!==ae.current)return;const de=je.snapshots.find(Re=>Re.keyword===e.keyword&&Re.provider===e.provider)??je.snapshots.find(Re=>Re.keyword===e.keyword),Ae=de?{citationState:de.citationState,answerMentioned:de.answerMentioned,visibilityState:de.visibilityState,visibilityTransition:se.visibilityTransition,provider:de.provider,model:de.model??null,answerSnippet:de.answerText??"",citedDomains:de.citedDomains,competitorDomains:de.competitorOverlap,recommendedCompetitors:de.recommendedCompetitors??[],matchedTerms:de.matchedTerms??[],groundingSources:de.groundingSources,evidenceUrls:[],changeLabel:lm(se.visibilityTransition,se.visibilityState),summary:""}:{citationState:se.citationState,answerMentioned:se.answerMentioned,visibilityState:se.visibilityState,visibilityTransition:se.visibilityTransition,provider:e.provider,model:se.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:lm(se.visibilityTransition,se.visibilityState),summary:"Snapshot data not available for this run."};N(Re=>({...Re,[ge]:Ae})),v(Ae)}catch{if(V!==ae.current)return;v({citationState:se.citationState,answerMentioned:se.answerMentioned,visibilityState:se.visibilityState,visibilityTransition:se.visibilityTransition,provider:e.provider,model:se.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:lm(se.visibilityTransition,se.visibilityState),summary:"Failed to load historical run data."})}finally{V===ae.current&&b(!1)}},[k,e.keyword,e.provider,x]),P=($||e.historyScope!=="provider")&&E.model?`${E.provider} (${E.model}) · ${E.changeLabel.toLowerCase()}`:`${E.provider} · ${E.changeLabel.toLowerCase()}`,R=!$&&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(" · "):"",B=K?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:P}:E.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:P}:O?{label:"Pending",title:"Awaiting first visibility run",meta:"No provider data yet"}:{label:"Not visible in answer",title:"Your brand or domain was not mentioned in this answer",meta:P},re=()=>{if(!E.answerSnippet)return null;const Z=E.answerSnippet.split(`
|
|
95
|
-
`),V=[];let se=[],ge=0;const je=()=>{if(se.length===0)return;const de=se.join(" ").trim();de&&V.push(r.jsx("p",{className:V.length>0?"mt-2.5":"",children:Jx(de,xe)},ge++)),se=[]};for(const de of Z){const Ae=de.trim();if(/^[-\u2013\u2014]{3,}$/.test(Ae)){je(),V.push(r.jsx("hr",{className:"border-zinc-800/60 my-3"},ge++));continue}const Re=Ae.match(/^(#{1,3})\s+(.+)$/);if(Re){je();const ce=Re[1].length,Pe=Re[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Re[2],Ve=ce===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":ce===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";V.push(r.jsx("p",{className:Ve,children:Jx(Pe,xe)},ge++));continue}if(Ae===""){je();continue}se.push(Ae)}return je(),V};return r.jsx(gw,{open:!0,onOpenChange:Z=>{Z||n()},children:r.jsxs(yw,{children:[r.jsx(Dp,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),r.jsxs(Mp,{className:"evidence-modal","aria-describedby":void 0,children:[r.jsxs("div",{className:"evidence-modal-header",children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",E.provider||"All providers"]}),r.jsx($p,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.keyword})]}),r.jsxs(bw,{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:[r.jsx(Ju,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]}),A&&r.jsxs("div",{className:"evidence-modal-timeline",children:[r.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),r.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((Z,V)=>{const se=f===-1&&V===k.length-1||f===V,ge=Z.visibilityState??(Z.answerMentioned?"visible":"not-visible"),je=Z.visibilityTransition??ge,de=ge==="visible"?"bg-emerald-400":je==="emerging"?"bg-amber-400":je==="lost"?"bg-rose-400":"bg-zinc-600",Re=new Date(Z.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),ce=!!(Z.model&&V>0&&k[V-1]?.model&&k[V-1].model!==Z.model);return r.jsxs("button",{type:"button",className:`evidence-run-dot ${se?"evidence-run-dot--selected":""}`,onClick:()=>pe(V===k.length-1?-1:V),"aria-label":[`Run ${Re}: ${ge}`,Z.model?`model ${Z.model}`:null,ce?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":se,children:[r.jsx("span",{className:`size-2 rounded-full ${de} ${ce?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),r.jsx("span",{className:"text-[10px] text-zinc-500",children:Re})]},V)})}),f>=0&&f<k.length&&r.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[f].createdAt).toLocaleString()," ","—"," ",r.jsx("span",{className:"capitalize",children:k[f].visibilityState??(k[f].answerMentioned?"visible":"not-visible")}),r.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>pe(-1),children:["←"," Back to latest"]})]}),!$&&(e.modelTransitions?.length??0)>0&&r.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(Z=>r.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:`${Z.fromModel??"unknown"} -> ${Z.toModel??"unknown"} on ${new Date(Z.createdAt).toLocaleDateString()}`},`${Z.runId}:${Z.toModel??"unknown"}`))})]}),r.jsxs("div",{className:"evidence-modal-body",children:[y&&r.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"evidence-modal-main",children:[r.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[r.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:B.label}),r.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:B.title}),r.jsx("p",{className:"evidence-position-meta",children:B.meta}),R&&r.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:R})]}),E.answerSnippet&&r.jsxs("div",{children:[r.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),r.jsx("div",{className:`answer-snippet-block ${a?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:re()}),E.answerSnippet.length>280&&r.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>o(!a),children:a?"↑ Collapse":"↓ Show full answer"})]}),!E.answerSnippet&&!y&&r.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"}),!$&&e.relatedTechnicalSignals.length>0&&r.jsxs("div",{children:[r.jsx("p",{className:"drawer-section-label",children:K?"Why you're visible":"What to fix"}),r.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Z,V)=>r.jsxs("div",{className:"action-item",children:[r.jsx("svg",{className:`action-item-icon ${K?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:K?r.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),r.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),r.jsx("span",{className:"action-item-text",children:Z})]},V))})]}),E.summary&&r.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:E.summary})]}),r.jsxs("div",{className:"evidence-modal-sidebar",children:[(W||J)&&r.jsxs("div",{className:"sidebar-tabs",children:[r.jsx("button",{className:`sidebar-tab ${c==="mentions"?"sidebar-tab--active":""}`,onClick:()=>u("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),r.jsx("button",{className:`sidebar-tab ${c==="sources"?"sidebar-tab--active":""}`,onClick:()=>u("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),c==="mentions"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsxs("div",{className:"drawer-section-label flex items-center",children:[r.jsx("span",{children:"Answer visibility"}),r.jsx(hn,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),r.jsxs("div",{className:`mention-status mention-status--${K?"visible":"not-visible"}`,children:[r.jsx("span",{className:"mention-status-icon",children:O?"…":K?"✓":"—"}),r.jsx("span",{className:"mention-status-label",children:O?"Pending":K?"Visible":"Not visible"})]}),E.matchedTerms.length>0&&r.jsxs("div",{className:"mt-2",children:[r.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),r.jsx("div",{className:"flex flex-wrap gap-1.5",children:E.matchedTerms.map(Z=>r.jsx("span",{className:"mention-chip mention-chip--brand",children:Z},Z))})]}),!O&&!K&&E.matchedTerms.length===0&&r.jsxs("div",{className:"mt-2",children:[r.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),r.jsx("div",{className:"flex flex-wrap gap-1.5",children:fe.map(Z=>r.jsx("span",{className:"mention-chip mention-chip--muted",children:Z},Z))}),r.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(E.recommendedCompetitors.length>0||E.competitorDomains.length>0)&&r.jsxs("div",{children:[r.jsxs("div",{className:"drawer-section-label flex items-center",children:[r.jsx("span",{children:"Competitors in answer"}),r.jsx(hn,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),r.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const Z=E.competitorDomains.map(ge=>ge.replace(/^www\./,"")),V=new Set(Z.map(ge=>Yx(ge.replace(/\.[^.]+$/,""))));return[...E.recommendedCompetitors.filter(ge=>!V.has(Yx(ge))),...Z].map(ge=>r.jsx("span",{className:"mention-chip mention-chip--competitor",children:ge},ge))})()})]})]}),c==="sources"&&r.jsxs(r.Fragment,{children:[E.citedDomains.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"drawer-section-label flex items-center",children:[r.jsx("span",{children:"Domains from source links"}),r.jsx(hn,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),r.jsx("div",{className:"citation-leaderboard",children:E.citedDomains.map((Z,V)=>{const se=Z.toLowerCase().replace(/^www\./,""),ge=C.has(se),je=!ge&&E.competitorDomains.some(Ae=>Ae.toLowerCase().replace(/^www\./,"")===se),de=ge?"you":je?"competitor":"other";return r.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${de}`,children:[r.jsxs("span",{className:"citation-leaderboard-rank",children:["#",V+1]}),r.jsx("span",{className:"citation-leaderboard-domain",children:Z}),ge&&r.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),je&&r.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Z)})})]}),E.groundingSources.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"drawer-section-label flex items-center",children:[r.jsxs("span",{children:["Grounding source links (",E.groundingSources.length,")"]}),r.jsx(hn,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),r.jsx("ul",{className:"grid gap-0.5",children:E.groundingSources.map((Z,V)=>r.jsx("li",{className:"truncate text-sm",children:r.jsx("a",{href:Z.uri,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Z.title||Z.uri})},V))})]}),E.evidenceUrls.length>0&&r.jsxs("div",{children:[r.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),r.jsx("ul",{className:"grid gap-1",children:E.evidenceUrls.map(Z=>r.jsx("li",{className:"truncate text-sm",children:r.jsx("a",{href:Z,target:"_blank",rel:"noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Z})},Z))})]}),E.citedDomains.length===0&&E.groundingSources.length===0&&E.evidenceUrls.length===0&&r.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",$?"for this run":"yet"]})]}),!W&&!J&&r.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",$?"for this run":"yet"]})]})]})]})]})]})})}function ls(e){const t=new Date("2026-02-20");return e.map((n,a)=>({runId:`run_mock_${a+1}`,citationState:n,createdAt:new Date(t.getTime()+a*2*24*60*60*1e3).toISOString()}))}const cm=[{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 ld(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 t4=ld({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"}),n4=ld({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"}),s4=ld({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"}),i4=ld({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"}),a4=[{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:ls(["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:ls(["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:ls(["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:ls(["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:ls(["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:ls(["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:ls(["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:ls(["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:ls(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];cm[0],cm[1],ls(["cited","cited","cited","cited","cited"]),cm[2],2/7,ls(["not-cited","not-cited","not-cited","cited"]);function r4(e,t){return e.projects.find(n=>n.project.id===t)}function o4(e,t){return e.runs.find(n=>n.id===t)}function l4(e,t){for(const n of e.projects){const a=n.visibilityEvidence.find(o=>o.id===t);if(a)return{project:n,evidence:a}}}function aN(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 Xx(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function c4(e,t){if(!e)return"Waiting";if(!t)return"Running";const n=new Date(t).getTime()-new Date(e).getTime();if(n<1e3)return"<1s";const a=Math.floor(n/1e3);if(a<60)return`${a}s`;const o=Math.floor(a/60),c=a%60;return`${o}m ${c}s`}function rN(e){return e==="answer-visibility"?"Answer visibility sweep":e}function u4(e){return e==="manual"?"Manual":e==="scheduled"?"Scheduled":e==="config-apply"?"Config apply":e}function Fp(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:rN(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?Xx(e.startedAt):Xx(e.createdAt),duration:c4(e.startedAt,e.finishedAt),statusDetail:e.error?oN(e.error):d4(e),summary:f4(e),triggerLabel:u4(e.trigger)}}function oN(e){try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){const a=n.message??n.error?.message??n[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 n=t[1];return n.length>200?n.slice(0,200)+"…":n}return e.length>200?e.slice(0,200)+"…":e}function d4(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?oN(e.error):"Run failed.";default:return""}}function f4(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 lN(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 n=t.size,a=[...t.values()].filter(Boolean).length;return{score:n>0?Math.round(a/n*100):0,citedCount:a,totalCount:n}}function h4(e){return e>=70?"positive":e>=40?"caution":"negative"}function m4(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function p4(e,t){return e===0?"positive":(t>0?e/t:0)>=.3?"negative":"caution"}function g4(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 n=t.size,a=[...t.values()].filter(c=>!c.cited&&c.competitorOverlap.size>0).length,o=a===1?"key phrase":"key phrases";return{label:"Gap Key Phrases",value:`${a}`,delta:`${a} of ${n} key phrases at risk`,tone:p4(a,n),description:a>0?`${a} tracked ${o} 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:n>0?a/n:0}}function y4(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 v4(e){return e.provider==="Google"&&e.deindexed>0?"negative":e.percentage>=90?"positive":e.percentage>=70?"caution":"negative"}function b4(e,t){const n=y4(e,t);if(!n||n.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=n.notIndexed===1?"URL is":"URLs are",o=n.deindexed===1?"URL":"URLs";return{label:"Index Coverage",value:`${Math.round(n.percentage)}`,delta:`${n.provider} · ${n.indexed} of ${n.total} indexed`,tone:v4(n),description:n.provider==="Google"&&n.deindexed>0?`${n.deindexed} deindexed ${o} detected in the latest Google Search Console inspection.`:`${n.notIndexed} ${a} not indexed in ${n.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 cN(e,t){if(e.length===0||t.length===0)return{label:"None",count:0};const n=new Set(t);let a=0;for(const c of e)c.competitorOverlap.some(u=>n.has(u))&&a++;const o=a/e.length;return o>=.5?{label:"High",count:a}:o>=.2?{label:"Moderate",count:a}:{label:"Low",count:a}}function x4(e,t,n,a){const o=[];let c=0;const u=new Set;if(n){const f=new Map;for(const b of n.snapshots)if(b.keyword){const x=`${b.keyword}::${b.provider}`;f.set(x,b)}const m=new Set(n.snapshots.map(b=>b.provider)),p=new Set(t.flatMap(b=>Object.keys(b.providerRuns??{}))),v=[...new Set([...m,...p])].sort(),y=v.length>0?v:["gemini"];for(const b of t){if(b.runs.length===0)continue;u.add(b.keyword);const x=b.runs.at(-1),N=x?.transition??"not-cited";for(const S of y){const C=f.get(`${b.keyword}::${S}`),k=(b.providerRuns?.[S]?.length??0)>0;if(!C&&!k)continue;const A=C?.model??null,T=A?`${S}:${A}`:null,z=T?b.modelRuns?.[T]:void 0,M=b.providerRuns?.[S],$=(M?.length?M:null)??(z?.length?z:null),E=M?.length?"provider":z?.length?"model":"keyword",O=$?$.at(-1).transition:N,K=$?$.at(-1).visibilityTransition??($.at(-1).visibilityState==="visible"?"visible":"not-visible"):x?.visibilityTransition??(x?.visibilityState==="visible"?"visible":"not-visible"),W=$?.at(-1)?.citationState,J=$?.at(-1)?.visibilityState,ne=C?O==="lost"?"lost":O==="emerging"?"emerging":C.citationState==="cited"?"cited":"not-cited":W==="cited"?"cited":"not-cited",fe=C?.visibilityState??(J==="visible"?"visible":J==="pending"?"pending":"not-visible"),Ee=Fm($||b.runs),xe=Wx($||b.runs),H=S4(b,S),ae=($??b.runs).map(R=>({runId:R.runId,citationState:R.citationState,createdAt:R.createdAt,model:H.get(R.runId)??null,answerMentioned:R.answerMentioned,visibilityState:R.visibilityState,visibilityTransition:R.visibilityTransition})),pe=j4(ae),he=E==="provider"&&pe.length<=1?"model":E,P=w4(ae);o.push({id:`evidence_${e}_${c++}`,keyword:b.keyword,provider:C?.provider??S,model:C?.model??null,location:C?.location??null,citationState:ne,answerMentioned:C?.answerMentioned,visibilityState:fe,visibilityChangeLabel:eS(K,xe,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:eS(O,Ee),answerSnippet:C?.answerText??"",citedDomains:C?.citedDomains??[],evidenceUrls:[],competitorDomains:C?.competitorOverlap??[],recommendedCompetitors:C?.recommendedCompetitors??[],matchedTerms:C?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:C?.groundingSources??[],summary:N4(fe,K,b.keyword),runHistory:ae,historyScope:he,modelsSeen:pe,modelTransitions:P})}}}for(const f of a)u.has(f.keyword)||o.push({id:`evidence_${e}_${c++}`,keyword:f.keyword,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${f.keyword}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"keyword",modelsSeen:[],modelTransitions:[]});return o}function S4(e,t){const n=new Map,a=`${t}:`;for(const[o,c]of Object.entries(e.modelRuns??{})){if(!o.startsWith(a))continue;const u=o.slice(a.length),f=u==="unknown"?null:u;for(const m of c)n.set(m.runId,f)}return n}function j4(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function w4(e){const t=[];let n=null;for(const a of e){const o=a.model??null;o!==n&&n!==null&&t.push({runId:a.runId,createdAt:a.createdAt,fromModel:n,toModel:o}),n=o}return t}function Fm(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let n=0;for(let a=e.length-1;a>=0&&e[a].citationState===t;a--)n++;return n}function Wx(e){if(e.length===0)return 0;const t=e[e.length-1].visibilityState??"not-visible";let n=0;for(let a=e.length-1;a>=0&&(e[a].visibilityState??"not-visible")===t;a--)n++;return n}function eS(e,t,n){const a={positive:n?.positive??"cited",negative:n?.negative??"not cited",first:n?.first??"first citation"};switch(e){case"new":return"First observation";case"cited":case"visible":return t<=1?`${Qo(a.positive)} in latest run`:`${Qo(a.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Qo(a.first);case"not-cited":case"not-visible":return t<=1?`${Qo(a.negative)} in latest run`:`${Qo(a.negative)} across ${t} runs`;default:return e}}function Qo(e){return e.charAt(0).toUpperCase()+e.slice(1)}function N4(e,t,n){switch(t){case"lost":return`Visibility was lost for "${n}". Your brand no longer appeared in the latest answer.`;case"emerging":return`Your brand started appearing in AI answers for "${n}".`}switch(e){case"visible":return`Your brand or domain is visible in AI answers for "${n}".`;case"pending":return`"${n}" has been added but no visibility run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${n}".`}}function tS(e,t){const n=new Set(t),a=new Map;for(const o of e)if(o.keyword)for(const c of o.competitorOverlap){if(!n.has(c))continue;const u=a.get(c)??new Set;u.add(o.keyword),a.set(c,u)}return a}const um=3;function C4(e){const{evidence:t,timeline:n,latestSnapshots:a,previousSnapshots:o,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=tS(a,c),v=tS(o,c);for(const k of c){const A=p.get(k)??new Set,T=v.get(k)??new Set,z=[...A].filter(M=>!T.has(M));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(M=>{const $=t.find(E=>E.keyword===M);return{keyword:M,evidenceId:$?.id??"",citationState:"cited"}})})}const y=new Map;for(const k of n){const A=k.runs.at(-1);A&&y.set(k.keyword,{transition:A.transition,citationState:A.citationState})}const b=[],x=[],N=new Set;for(const[k,{transition:A,citationState:T}]of y){if(!(A==="emerging"||A==="new"&&T==="cited"))continue;N.add(k);const M=t.find($=>$.keyword===k&&($.citationState==="emerging"||$.citationState==="cited"));b.push({keyword:k,evidenceId:M?.id??"",provider:M?.provider,citationState:"emerging"})}for(const k of t)k.citationState==="emerging"&&(N.has(k.keyword)||x.push({keyword:k.keyword,evidenceId:k.id,provider:k.provider,citationState:"emerging"}));if(x.length>0){const k=new Set(x.map(A=>A.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:x})}b.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:b});const S=new Set(t.map(k=>k.keyword)),C=[];for(const k of n){if(!S.has(k.keyword)||k.runs.length<um||k.runs.at(-1)?.citationState!=="not-cited")continue;if(Fm(k.runs)>=um){const z=t.find(M=>M.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 ${um}+ 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 A=p.get(k)??new Set,z=[...v.get(k)??new Set].filter(M=>!A.has(M));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(M=>{const $=t.find(E=>E.keyword===M);return{keyword:M,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 k4(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 n=m=>{const p=new Set;for(const v of m)v.citationState==="cited"&&v.keyword&&p.add(v.keyword);return p},a=n(e),o=n(t);let c=0,u=0;for(const m of a)o.has(m)||c++;for(const m of o)a.has(m)||u++;const f=u>c?"negative":c>u?"positive":"neutral";return{gained:c,lost:u,tone:f,hasPreviousRun:!0}}function z4(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 n=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:n,delta:`${e.length} total runs`,tone:a,description:`Latest: ${rN(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 _4(e){const t=aN(e.project),n=x4(t.name,e.timeline,e.latestRunDetail,e.keywords),a=e.latestRunDetail?.snapshots??[],o=lN(a),c=g4(a),u=b4(e.gscCoverage,e.bingCoverage),f=cN(a,e.competitors.map(x=>x.domain)),m=C4({evidence:n,timeline:e.timeline,latestSnapshots:e.latestRunDetail?.snapshots??[],previousSnapshots:e.previousRunDetail?.snapshots??[],trackedCompetitors:e.competitors.map(x=>x.domain)}),p=[...e.runs].sort((x,N)=>N.createdAt.localeCompare(x.createdAt)),v=p.map(x=>Fp(x,e.project.displayName||e.project.name)),y=new Map;for(const x of a){const N=x.provider||"gemini",S=x.model??null,C=`${N}::${S??"unknown"}`,k=y.get(C)??{provider:N,model:S,cited:0,total:0};k.total++,x.citationState==="cited"&&k.cited++,y.set(C,k)}const b=[...y.values()].sort((x,N)=>x.provider.localeCompare(N.provider)||(x.model??"").localeCompare(N.model??"")).map(({provider:x,model:N,cited:S,total:C})=>({provider:x,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?`${o.score}`:"No data",delta:a.length>0?`${o.citedCount} of ${o.totalCount} key phrases visible`:"Run a sweep first",tone:a.length>0?h4(o.score):"neutral",description:a.length>0?`${o.citedCount} of ${o.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:o.citedCount,total:o.totalCount},gapKeyPhrases:c,indexCoverage:u,providerScores:b,competitorPressure:{label:"Competitor Pressure",value:f.label,delta:f.count>0?`${f.count} overlapping citations`:"No overlap detected",tone:m4(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:z4(p),movementSummary:k4(e.latestRunDetail?.snapshots??[],e.previousRunDetail?.snapshots??[]),insights:m,visibilityEvidence:n,competitors:e.competitors.map((x,N)=>{const S=new Set;for(const z of a)(z.competitorOverlap.includes(x.domain)||z.citedDomains.includes(x.domain))&&z.keyword&&S.add(z.keyword);const C=[...S],k=new Set(a.map(z=>z.keyword).filter(Boolean)),A=k.size>0?C.length/k.size:0,T=A>=.5?"High":A>=.2?"Moderate":C.length>0?"Low":"None";return{id:x.id||`comp_${N}`,domain:x.domain,citationCount:C.length,totalKeywords:k.size,pressureLabel:T,citedKeywords:C,movement:"",notes:""}}),recentRuns:v.slice(0,5)}}function E4(e){const t=aN(e.project),n=e.latestRunDetail?.snapshots??[],a=lN(n),o=cN(n,e.competitors.map(m=>m.domain)),u=[...e.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt))[0],f=u?Fp(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:n.length>0?`${a.citedCount} of ${a.totalCount} key phrases`:"No data",lastRun:f,insight:n.length>0?`${a.citedCount} of ${a.totalCount} key phrases visible across ${new Set(n.map(m=>m.provider)).size} provider${new Set(n.map(m=>m.provider)).size>1?"s":""}.`:"No runs completed yet.",trend:[],competitorPressureLabel:o.label}}function T4(e,t){const n=[],a=[],o=[];for(const u of e){a.push(_4(u)),o.push(E4(u));const f=[...u.runs].sort((m,p)=>p.createdAt.localeCompare(m.createdAt));for(const m of f)n.push(Fp(m,u.project.displayName||u.project.name))}n.sort((u,f)=>f.createdAt.localeCompare(u.createdAt));const c=e.length>0;return{portfolioOverview:{projects:o,attentionItems:c?A4(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:n.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:n,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 A4(e){const t=[];for(const n of e){const a=n.visibilityEvidence.filter(c=>c.citationState==="lost");a.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${a.length} key phrase${a.length>1?"s":""} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const o=n.recentRuns.filter(c=>c.status==="running"||c.status==="queued");o.length>0&&t.push({id:`attention_${n.project.id}_active`,tone:"neutral",title:`${n.project.displayName||n.project.name} has active runs`,detail:`${o.length} run${o.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 Qn={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"]},uN=w.createContext(null);uN.Provider;function vl(){return w.useContext(uN)}function La(e){const n=vl()?.dashboard??null,a=xa({queryKey:Qn.projects.all,queryFn:nj,enabled:!n}),o=xa({queryKey:Qn.runs.all,queryFn:ij,enabled:!n,refetchInterval:N=>N.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:!1}),c=xa({queryKey:Qn.settings,queryFn:()=>Cp().catch(()=>null),enabled:!n}),u=a.data??[],f=o.data??[],m=Zk({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,A)=>A.createdAt.localeCompare(k.createdAt));return{queryKey:Qn.projects.detail(N.id,C[0]?.id),queryFn:async()=>{const[k,A,T,z,M,$,E]=await Promise.all([e2(N.name).catch(()=>[]),aj(N.name).catch(()=>[]),rj(N.name).catch(()=>[]),C[0]?Ur(C[0].id).catch(()=>null):Promise.resolve(null),C[1]?Ur(C[1].id).catch(()=>null):Promise.resolve(null),kp(N.name).catch(()=>null),zp(N.name).catch(()=>null)]);return{project:N,runs:S,keywords:k,competitors:A,timeline:T,latestRunDetail:z,previousRunDetail:M,gscCoverage:$,bingCoverage:E}},enabled:!n&&a.isSuccess&&o.isSuccess}})}),p=m.every(N=>N.isSuccess),v=w.useMemo(()=>{if(n)return n;if(!a.data||!o.data||u.length>0&&!p)return null;const N=m.map(S=>S.data).filter(S=>S!=null);return T4(N,c.data??null)},[n,a.data,o.data,c.data,p,m,u.length]),y=!n&&(a.isError||o.isError),b=!n&&!v&&!y,x=w.useCallback(async()=>{await Promise.all([a.refetch(),o.refetch(),c.refetch()])},[a.refetch,o.refetch,c.refetch]);return{dashboard:v,isLoading:b,isError:y,refetch:x}}function R4(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const nS=R4(),Zm=nS==="/"?"":nS.replace(/\/$/,"");async function O4(){const e=Zm?`${Zm}/health`:"/health",t=await Q2(e,"API"),n=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:n}}function cd(e,t){return xa({queryKey:Qn.health,queryFn:O4,enabled:e,refetchInterval:15e3,initialData:t})}function L4(e){return xa({queryKey:Qn.runs.detail(e??""),queryFn:()=>Ur(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Zr(){const e=Bi(),t=Zu({strict:!1}),n=Cn({select:m=>m.location.pathname}),a=t.runId??null,o=t.evidenceId??null;return{runId:a,evidenceId:o,openRun:m=>e({to:n,from:ds.to,search:p=>({...p,runId:m,evidenceId:void 0})}),openEvidence:m=>e({to:n,from:ds.to,search:p=>({...p,evidenceId:m,runId:void 0})}),closeDrawer:()=>e({to:n,from:ds.to,search:m=>({...m,runId:void 0,evidenceId:void 0})})}}const D4={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function M4(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function $4(){const e=w.useSyncExternalStore(tE,Xb,Xb),t=Bi(),{openRun:n}=Zr(),a=w.useCallback(c=>{Dm(c)},[]),o=w.useCallback(c=>{c.cta&&(c.cta.intent==="open-run-drawer"?n(c.cta.runId):t({to:"/runs"}),Dm(c.id))},[t,n]);return e.length===0?null:r.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(c=>r.jsxs("section",{role:c.tone==="negative"?"alert":"status","aria-live":c.tone==="negative"?"assertive":"polite","data-state":c.state,className:`toast-card ${D4[c.tone]}`,children:[r.jsxs("div",{className:"toast-copy",children:[r.jsx("p",{className:"toast-title",children:c.title}),c.detail?r.jsx("p",{className:"toast-detail",children:c.detail}):null,c.cta?r.jsx("button",{type:"button",className:"toast-action",onClick:()=>o(c),"aria-label":M4(c),children:c.cta.label}):null]}),r.jsx("button",{type:"button",onClick:()=>a(c.id),className:"toast-dismiss","aria-label":"Dismiss",children:r.jsx(Ju,{className:"size-3.5"})})]},c.id))})}const sS=[{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"}],iS=e=>({label:e,state:"checking",detail:"Checking service health"}),P4={apiStatus:iS("API"),workerStatus:iS("Worker")};function U4(e){return e==="gsc-sync"?"GSC sync":e==="inspect-sitemap"?"Sitemap inspection":"Visibility sweep"}function I4(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function B4(e){const t=U4(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function q4(e,t){return e.error?`${t}: ${e.error}`:e.location?`${t} · ${e.location}`:t}function K4(e,t,n){if(t)return t;const a=n.find(o=>o.id===e);return a?.displayName||a?.name||e}function H4(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 G4(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function F4(){const e=w.useSyncExternalStore(GE,za,za),t=Object.keys(e.runs).length>0||Object.keys(e.batches).length>0,n=xa({queryKey:Qn.runs.all,queryFn:ij,enabled:t}),a=xa({queryKey:Qn.projects.all,queryFn:nj,enabled:t}),o=w.useRef({}),c=w.useCallback(()=>{n.refetch()},[n.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=n.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||!VE(y.status)||(o.current[y.id]??v.lastAnnouncedStatus)===y.status)continue;if(v.sourceAction==="run-all"){ix(y.id);continue}const x=K4(y.projectId,v.projectLabel,f);Ze({title:B4(y),detail:q4(y,x),tone:I4(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),ix(y.id)}for(const v of Object.values(e.batches)){const y=QE(v.runIds,m);y.finished&&(Ze({title:"Run-all batch finished",detail:H4(y,v.skippedCount),tone:G4(y),dedupeKey:`batch:${v.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),ZE(v.batchId))}o.current=p},[a.data,n.data,e]),null}function Z4(){const e=vl(),{dashboard:t,isLoading:n,refetch:a}=La(),u=cd(!e,e?.health).data??e?.health??P4,f=Y_(),{runId:m,evidenceId:p,closeDrawer:v}=Zr(),[y,b]=w.useState(!1),x=L4(m),N=x.data??null,S=x.isLoading;w.useEffect(()=>{N&&N.status!=="running"&&N.status!=="queued"&&a()},[N?.status,a]),w.useEffect(()=>{b(!1)},[f.pathname]),w.useEffect(()=>{if(typeof window>"u"||!m&&!p)return;const z=M=>{M.key==="Escape"&&v()};return window.addEventListener("keydown",z),()=>{window.removeEventListener("keydown",z)}},[m,p,v]);const C=t??e?.dashboard??null,k=m&&C?o4(C,m):void 0,A=p&&C?l4(C,p):void 0,T=(()=>{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(O=>O.project.id===$);if(E)return E.project.name}return"Project"}return"Not found"})();return r.jsxs("div",{className:"app-shell",children:[r.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),r.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[r.jsx("div",{className:"sidebar-brand",children:r.jsx(mx,{})}),r.jsxs("nav",{className:"sidebar-nav",children:[r.jsxs(St,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx(gE,{className:"sidebar-icon"}),r.jsx("span",{children:"Overview"})]}),r.jsxs(St,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[r.jsx(mE,{className:"sidebar-icon"}),r.jsx("span",{children:"Projects"})]}),r.jsxs(St,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx(xE,{className:"sidebar-icon"}),r.jsx("span",{children:"Runs"})]}),r.jsxs(St,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx(_E,{className:"sidebar-icon"}),r.jsx("span",{children:"Settings"})]}),n?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(z=>r.jsxs("div",{className:"sidebar-skeleton-item",children:[r.jsx("span",{className:"skeleton-circle size-2"}),r.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+z*15}%`}})]},z))]}):C&&C.projects.length>0?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"sidebar-section-title",children:"Projects"}),C.projects.map(z=>{const M=z.visibilitySummary.tone;return r.jsxs(St,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[r.jsx("span",{className:`sidebar-dot sidebar-dot-${M}`}),r.jsx("span",{children:z.project.name})]},z.project.id)})]}):n?null:r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"sidebar-section-title",children:"Resources"}),r.jsxs(St,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[r.jsx(NE,{className:"sidebar-icon"}),r.jsx("span",{children:"Setup"})]})]})]}),r.jsx("div",{className:"sidebar-footer",children:sS.map(z=>r.jsx("a",{className:"sidebar-footer-link",href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]}),r.jsxs("div",{className:"main-area",children:[r.jsxs("header",{className:"topbar",children:[r.jsxs("div",{className:"topbar-left",children:[r.jsx("div",{className:"topbar-brand-mobile",children:r.jsx(mx,{compact:!0})}),r.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[r.jsx(St,{to:"/",children:"Home"}),r.jsx(Yu,{className:"breadcrumb-sep size-3"}),r.jsx("span",{className:"breadcrumb-current",children:T})]})]}),r.jsxs("div",{className:"topbar-actions",children:[r.jsxs("div",{className:"health-pill-row",children:[r.jsxs("span",{className:`health-pill health-pill-${u.apiStatus.state}`,children:["API ",u.apiStatus.state==="ok"?"ok":u.apiStatus.state]}),r.jsxs("span",{className:`health-pill health-pill-${u.workerStatus.state}`,children:["Worker ",u.workerStatus.state==="ok"?"ok":u.workerStatus.state]})]}),r.jsxs(le,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":y,"aria-controls":"mobile-nav",onClick:()=>b(z=>!z),children:[r.jsx(vE,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),r.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${y?"mobile-nav-open":""}`,children:[r.jsxs(le,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>b(!1),children:[r.jsx(Ju,{className:"size-5"}),r.jsx("span",{className:"sr-only",children:"Close navigation"})]}),r.jsx(St,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),r.jsx(St,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),r.jsx(St,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),r.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?r.jsxs("div",{className:"mobile-nav-section",children:[r.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),C.projects.map(z=>r.jsx(St,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"mobile-nav-link",children:z.project.name},z.project.id))]}):null]}),r.jsx("main",{id:"content",className:"page-shell",children:n&&!e?r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-40"}),r.jsx("div",{className:"skeleton-text-sm w-72"})]}),r.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(z=>r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-24"}),r.jsx("div",{className:"skeleton-text w-full"}),r.jsx("div",{className:"skeleton-text-sm w-3/4"})]},z))}),r.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(z=>r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-20"}),r.jsx("div",{className:"space-y-2",children:[1,2,3].map(M=>r.jsx("div",{className:"skeleton-text-sm w-full"},M))})]},z))})]}):r.jsx(Np,{})}),r.jsxs("footer",{className:"footer",children:[r.jsxs("a",{href:"https://github.com/AINYC/canonry",target:"_blank",rel:"noreferrer",className:"footer-brand",children:[r.jsx(fE,{className:"size-3.5"}),r.jsx("span",{children:"Canonry"})]}),r.jsx("div",{className:"footer-links",children:sS.map(z=>r.jsx("a",{href:z.href,target:"_blank",rel:"noreferrer",children:z.label},z.href))})]})]}),k?r.jsxs(MR,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:v,children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[r.jsx(td,{status:k.status}),r.jsx("span",{className:"text-zinc-400",children:k.startedAt}),r.jsx("span",{className:"text-zinc-500",children:k.duration}),r.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&r.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),r.jsxs("div",{className:"mt-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),S?r.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):N&&N.snapshots.length>0?r.jsxs("div",{className:"space-y-2",children:[N.snapshots.map(z=>r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[r.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:z.keyword??"Unknown key phrase"}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx(ll,{provider:z.provider}),r.jsx($j,{variant:z.citationState==="cited"?"success":"neutral",children:z.citationState})]})]}),z.model&&r.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:z.model}),z.citedDomains.length>0&&r.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[r.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",z.citedDomains.join(", ")]}),z.competitorOverlap.length>0&&r.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",z.competitorOverlap.join(", ")]}),z.groundingSources&&z.groundingSources.length>0&&r.jsxs("details",{className:"mt-2",children:[r.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":""]}),r.jsx("ul",{className:"mt-1 space-y-0.5",children:z.groundingSources.map((M,$)=>r.jsx("li",{className:"text-xs text-zinc-500 truncate",children:r.jsx("a",{href:M.uri,target:"_blank",rel:"noreferrer",className:"hover:text-zinc-300",children:M.title||M.uri})},$))})]}),z.answerText&&r.jsxs("details",{className:"mt-1",children:[r.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),r.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:z.answerText})]})]},z.id)),N.status==="running"&&r.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[r.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Querying remaining key phrases..."]})]}):N&&N.status==="running"?r.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[r.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"?r.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[r.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?r.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[r.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),r.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:PE(N.error)})]}):r.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,A?r.jsx(e4,{evidence:A.evidence,project:A.project,onClose:v}):null,r.jsx(F4,{}),r.jsx($4,{})]})}class V4 extends w.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("[ErrorBoundary]",t,n.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?r.jsx("div",{className:"page-container",children:r.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[r.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:r.jsx(RE,{className:"size-6 text-rose-400"})}),r.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),r.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),r.jsxs("div",{className:"flex gap-3 mt-2",children:[r.jsxs(le,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[r.jsx(kE,{className:"size-3.5 mr-1.5"}),"Try again"]}),r.jsx(le,{variant:"secondary",size:"sm",onClick:()=>{window.location.href="/"},children:"Go home"})]})]})}):this.props.children}}const Me=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:es("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}));Me.displayName="Card";const Vm=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:es("flex flex-col gap-1.5 p-5",e),...t}));Vm.displayName="CardHeader";const Qm=w.forwardRef(({className:e,...t},n)=>r.jsx("h3",{ref:n,className:es("font-medium tracking-tight text-zinc-50",e),...t}));Qm.displayName="CardTitle";const Ym=w.forwardRef(({className:e,...t},n)=>r.jsx("p",{ref:n,className:es("text-sm text-zinc-500",e),...t}));Ym.displayName="CardDescription";const gu=w.forwardRef(({className:e,...t},n)=>r.jsx("div",{ref:n,className:es("p-5 pt-0",e),...t}));gu.displayName="CardContent";function Q4({points:e,tone:t}){const n=w.useId();if(e.length===0)return null;const a=42,o=132,c=5,u=Math.min(...e),m=Math.max(...e)-u||1,p=o-c*2,v=a-c*2,y=e.map((b,x)=>{const N=c+x/Math.max(e.length-1,1)*p,S=c+(1-(b-u)/m)*v;return`${N},${S}`}).join(" ");return r.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${o} ${a}`,"aria-hidden":"true",children:[r.jsx("defs",{children:r.jsx("clipPath",{id:n,children:r.jsx("rect",{x:c,y:c,width:p,height:v,rx:"8"})})}),r.jsx("line",{className:"sparkline-guide",x1:c,x2:o-c,y1:a-c,y2:a-c}),r.jsx("polyline",{clipPath:`url(#${n})`,points:y,vectorEffect:"non-scaling-stroke"})]})}function Y4(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function J4(e,t,n){return e.map(a=>{if(a.id==="api")return{...a,tone:Ou(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(a.id==="worker")return{...a,tone:Ou(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const o=n.providerStatuses.filter(m=>m.state==="ready").length,c=n.providerStatuses.length,u=o>0,f=n.providerStatuses.filter(m=>m.state==="ready").map(m=>Y4(m)).join(" · ");return{...a,label:"Providers",tone:u?"positive":"caution",detail:`${o} of ${c} configured`,meta:f||"None configured"}})}function X4(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(n=>n.state==="ready"))return"Launch is blocked until at least one provider is configured."}function W4(e,t,n){const a=X4(t,n),o=structuredClone(e);return o.healthChecks=o.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=n.providerStatuses.some(f=>f.state==="ready");return{...c,detail:u?"At least one provider configured.":"No providers configured.",state:u?"ready":"attention"}}),o.launchState.enabled=a===void 0,o.launchState.blockedReason=a,o.launchState.summary=a??"Queue a visibility sweep first, then follow with a site audit to explain movement.",o}function e3({project:e}){return r.jsxs(St,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[r.jsxs("div",{className:"project-row-primary",children:[r.jsxs("div",{children:[r.jsx("p",{className:"project-name",children:e.project.name}),r.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),r.jsx("p",{className:"project-insight",children:e.insight})]}),r.jsx("div",{className:"project-row-stat",children:r.jsxs("div",{className:"metric-inline-block",children:[r.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),r.jsx("p",{className:"metric-inline-value",children:e.visibilityScore}),r.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta})]})}),r.jsx("div",{className:"project-row-stat",children:r.jsxs("div",{className:"metric-inline-block",children:[r.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),r.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),r.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Xu(e.lastRun.status)]})]})}),r.jsx("div",{className:"project-row-chart",children:r.jsx(Q4,{points:e.trend,tone:Pj(e.lastRun.status)})}),r.jsx("span",{className:"project-row-link",children:r.jsx(Yu,{className:"h-4 w-4 text-zinc-500"})})]})}function t3(){const e=vl(),{dashboard:t,isLoading:n}=La(),a=t??e?.dashboard;if(!a||n)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-32"}),r.jsx("div",{className:"skeleton-text-sm w-64"})]}),r.jsx("div",{className:"space-y-3",children:[1,2,3].map(v=>r.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("div",{className:"skeleton-text w-36"}),r.jsx("div",{className:"skeleton-text-sm w-48"})]}),r.jsx("div",{className:"skeleton-text w-16"}),r.jsx("div",{className:"skeleton-text w-16"}),r.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},v))})]});const o=a.portfolioOverview,f=cd(!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=J4(o.systemHealth,f,a.settings),{openRun:p}=Zr();return r.jsxs("div",{className:"page-container",children:[r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Portfolio"}),r.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),r.jsx("div",{className:"page-header-right",children:r.jsx("p",{className:"text-[11px] text-zinc-600",children:o.lastUpdatedAt})})]}),o.projects.length>0?r.jsx("div",{className:"project-list project-list-scrollable",children:o.projects.map(v=>r.jsx(e3,{project:v},v.project.id))}):r.jsxs(Me,{className:"surface-card empty-card",children:[r.jsx("h3",{children:o.emptyState?.title??"No projects yet"}),r.jsx("p",{className:"supporting-copy",children:o.emptyState?.detail}),r.jsx(le,{size:"sm",asChild:!0,children:r.jsx(St,{to:o.emptyState?.ctaHref==="/setup"||!o.emptyState?.ctaHref?"/setup":"/",children:o.emptyState?.ctaLabel??"Launch setup"})})]}),r.jsxs("div",{className:"overview-secondary-grid",children:[o.attentionItems.length>0&&r.jsxs("section",{className:"overview-secondary-section",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),r.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),r.jsx("div",{className:"attention-list attention-list-scrollable",children:o.attentionItems.map(v=>r.jsxs(St,{to:v.href,className:`attention-item attention-item-${v.tone}`,children:[r.jsxs("div",{children:[r.jsx("p",{className:"attention-title",children:v.title}),r.jsx("p",{className:"attention-detail",children:v.detail})]}),r.jsx("span",{className:"attention-action",children:v.actionLabel})]},v.id))})]}),r.jsxs("section",{className:"overview-secondary-section",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),r.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),r.jsx("div",{className:"compact-stack compact-stack-scrollable",children:o.recentRuns.length>0?o.recentRuns.map(v=>r.jsxs("button",{className:"compact-run",type:"button",onClick:()=>p(v.id),children:[r.jsxs("div",{children:[r.jsx("p",{className:"compact-run-title",children:v.projectName}),r.jsx("p",{className:"compact-run-detail",children:v.summary})]}),r.jsx(td,{status:v.status})]},v.id)):r.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),r.jsxs("section",{className:"page-section",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),r.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),r.jsx("div",{className:"health-grid",children:m.map(v=>r.jsxs(Me,{className:"surface-card compact-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:v.label}),r.jsx("h3",{children:v.detail})]}),r.jsx(lt,{tone:v.tone,children:v.label})]}),r.jsx("p",{className:"supporting-copy",children:v.meta})]},v.id))})]})]})}const Zp=Symbol.for("yaml.alias"),Jm=Symbol.for("yaml.document"),Di=Symbol.for("yaml.map"),dN=Symbol.for("yaml.pair"),Ns=Symbol.for("yaml.scalar"),Vr=Symbol.for("yaml.seq"),Jn=Symbol.for("yaml.node.type"),Da=e=>!!e&&typeof e=="object"&&e[Jn]===Zp,ud=e=>!!e&&typeof e=="object"&&e[Jn]===Jm,bl=e=>!!e&&typeof e=="object"&&e[Jn]===Di,Pt=e=>!!e&&typeof e=="object"&&e[Jn]===dN,gt=e=>!!e&&typeof e=="object"&&e[Jn]===Ns,xl=e=>!!e&&typeof e=="object"&&e[Jn]===Vr;function Mt(e){if(e&&typeof e=="object")switch(e[Jn]){case Di:case Vr:return!0}return!1}function $t(e){if(e&&typeof e=="object")switch(e[Jn]){case Zp:case Di:case Ns:case Vr:return!0}return!1}const fN=e=>(gt(e)||Mt(e))&&!!e.anchor,ha=Symbol("break visit"),n3=Symbol("skip children"),tl=Symbol("remove node");function Qr(e,t){const n=s3(t);ud(e)?Ar(null,e.contents,n,Object.freeze([e]))===tl&&(e.contents=null):Ar(null,e,n,Object.freeze([]))}Qr.BREAK=ha;Qr.SKIP=n3;Qr.REMOVE=tl;function Ar(e,t,n,a){const o=i3(e,t,n,a);if($t(o)||Pt(o))return a3(e,a,o),Ar(e,o,n,a);if(typeof o!="symbol"){if(Mt(t)){a=Object.freeze(a.concat(t));for(let c=0;c<t.items.length;++c){const u=Ar(c,t.items[c],n,a);if(typeof u=="number")c=u-1;else{if(u===ha)return ha;u===tl&&(t.items.splice(c,1),c-=1)}}}else if(Pt(t)){a=Object.freeze(a.concat(t));const c=Ar("key",t.key,n,a);if(c===ha)return ha;c===tl&&(t.key=null);const u=Ar("value",t.value,n,a);if(u===ha)return ha;u===tl&&(t.value=null)}}return o}function s3(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 i3(e,t,n,a){if(typeof n=="function")return n(e,t,a);if(bl(t))return n.Map?.(e,t,a);if(xl(t))return n.Seq?.(e,t,a);if(Pt(t))return n.Pair?.(e,t,a);if(gt(t))return n.Scalar?.(e,t,a);if(Da(t))return n.Alias?.(e,t,a)}function a3(e,t,n){const a=t[t.length-1];if(Mt(a))a.items[e]=n;else if(Pt(a))e==="key"?a.key=n:a.value=n;else if(ud(a))a.contents=n;else{const o=Da(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const r3={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},o3=e=>e.replace(/[!,[\]{}]/g,t=>r3[t]);class fn{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},fn.defaultYaml,t),this.tags=Object.assign({},fn.defaultTags,n)}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,n){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]+/),o=a.shift();switch(o){case"%TAG":{if(a.length!==2&&(n(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 n(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 n(6,`Unsupported YAML version ${c}`,u),!1}}default:return n(0,`Unknown directive ${o}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const u=t.slice(2,-1);return u==="!"||u==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),u)}const[,a,o]=t.match(/^(.*!)([^!]*)$/s);o||n(`The ${t} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(o)}catch(u){return n(String(u)),null}return a==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,a]of Object.entries(this.tags))if(t.startsWith(a))return n+o3(t.substring(a.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let o;if(t&&a.length>0&&$t(t.contents)){const c={};Qr(t.contents,(u,f)=>{$t(f)&&f.tag&&(c[f.tag]=!0)}),o=Object.keys(c)}else o=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!t||o.some(f=>f.startsWith(u)))&&n.push(`%TAG ${c} ${u}`);return n.join(`
|
|
96
|
-
`)}}fn.defaultYaml={explicit:!1,version:"1.2"};fn.defaultTags={"!!":"tag:yaml.org,2002:"};function hN(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function mN(e){const t=new Set;return Qr(e,{Value(n,a){a.anchor&&t.add(a.anchor)}}),t}function pN(e,t){for(let n=1;;++n){const a=`${e}${n}`;if(!t.has(a))return a}}function l3(e,t){const n=[],a=new Map;let o=null;return{onAnchor:c=>{n.push(c),o??(o=mN(e));const u=pN(t,o);return o.add(u),u},setAnchors:()=>{for(const c of n){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(gt(u.node)||Mt(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,n,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let o=0,c=a.length;o<c;++o){const u=a[o],f=Rr(e,a,String(o),u);f===void 0?delete a[o]:f!==u&&(a[o]=f)}else if(a instanceof Map)for(const o of Array.from(a.keys())){const c=a.get(o),u=Rr(e,a,o,c);u===void 0?a.delete(o):u!==c&&a.set(o,u)}else if(a instanceof Set)for(const o of Array.from(a)){const c=Rr(e,a,o,o);c===void 0?a.delete(o):c!==o&&(a.delete(o),a.add(c))}else for(const[o,c]of Object.entries(a)){const u=Rr(e,a,o,c);u===void 0?delete a[o]:u!==c&&(a[o]=u)}return e.call(t,n,a)}function Yn(e,t,n){if(Array.isArray(e))return e.map((a,o)=>Yn(a,String(o),n));if(e&&typeof e.toJSON=="function"){if(!n||!fN(e))return e.toJSON(t,n);const a={aliasCount:0,count:1,res:void 0};n.anchors.set(e,a),n.onCreate=c=>{a.res=c,delete n.onCreate};const o=e.toJSON(t,n);return n.onCreate&&n.onCreate(o),o}return typeof e=="bigint"&&!n?.keep?Number(e):e}class Vp{constructor(t){Object.defineProperty(this,Jn,{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:n,maxAliasCount:a,onAnchor:o,reviver:c}={}){if(!ud(t))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Yn(this,"",u);if(typeof o=="function")for(const{count:m,res:p}of u.anchors.values())o(p,m);return typeof c=="function"?Rr(c,{"":f},"",f):f}}class Qp extends Vp{constructor(t){super(Zp),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let a;n?.aliasResolveCache?a=n.aliasResolveCache:(a=[],Qr(t,{Node:(c,u)=>{(Da(u)||fN(u))&&a.push(u)}}),n&&(n.aliasResolveCache=a));let o;for(const c of a){if(c===this)break;c.anchor===this.source&&(o=c)}return o}toJSON(t,n){if(!n)return{source:this.source};const{anchors:a,doc:o,maxAliasCount:c}=n,u=this.resolve(o,n);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||(Yn(u,null,n),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=yu(o,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,n,a){const o=`*${this.source}`;if(t){if(hN(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`${o} `}return o}}function yu(e,t,n){if(Da(t)){const a=t.resolve(e),o=n&&a&&n.get(a);return o?o.count*o.aliasCount:0}else if(Mt(t)){let a=0;for(const o of t.items){const c=yu(e,o,n);c>a&&(a=c)}return a}else if(Pt(t)){const a=yu(e,t.key,n),o=yu(e,t.value,n);return Math.max(a,o)}return 1}const gN=e=>!e||typeof e!="function"&&typeof e!="object";class Le extends Vp{constructor(t){super(Ns),this.value=t}toJSON(t,n){return n?.keep?this.value:Yn(this.value,t,n)}toString(){return String(this.value)}}Le.BLOCK_FOLDED="BLOCK_FOLDED";Le.BLOCK_LITERAL="BLOCK_LITERAL";Le.PLAIN="PLAIN";Le.QUOTE_DOUBLE="QUOTE_DOUBLE";Le.QUOTE_SINGLE="QUOTE_SINGLE";const c3="tag:yaml.org,2002:";function u3(e,t,n){if(t){const a=n.filter(c=>c.tag===t),o=a.find(c=>!c.format)??a[0];if(!o)throw new Error(`Tag ${t} not found`);return o}return n.find(a=>a.identify?.(e)&&!a.format)}function hl(e,t,n){if(ud(e)&&(e=e.contents),$t(e))return e;if(Pt(e)){const y=n.schema[Di].createNode?.(n.schema,null,n);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:o,onTagObj:c,schema:u,sourceObjects:f}=n;let m;if(a&&e&&typeof e=="object"){if(m=f.get(e),m)return m.anchor??(m.anchor=o(e)),new Qp(m.anchor);m={anchor:null,node:null},f.set(e,m)}t?.startsWith("!!")&&(t=c3+t.slice(2));let p=u3(e,t,u.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const y=new Le(e);return m&&(m.node=y),y}p=e instanceof Map?u[Di]:Symbol.iterator in Object(e)?u[Vr]:u[Di]}c&&(c(p),delete n.onTagObj);const v=p?.createNode?p.createNode(n.schema,e,n):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(n.schema,e,n):new Le(e);return t?v.tag=t:p.default||(v.tag=p.tag),m&&(m.node=v),v}function Iu(e,t,n){let a=n;for(let o=t.length-1;o>=0;--o){const c=t[o];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return hl(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 Xo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class yN extends Vp{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(a=>$t(a)||Pt(a)?a.clone(t):a),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Xo(t))this.add(n);else{const[a,...o]=t,c=this.get(a,!0);if(Mt(c))c.addIn(o,n);else if(c===void 0&&this.schema)this.set(a,Iu(this.schema,o,n));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}deleteIn(t){const[n,...a]=t;if(a.length===0)return this.delete(n);const o=this.get(n,!0);if(Mt(o))return o.deleteIn(a);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${a}`)}getIn(t,n){const[a,...o]=t,c=this.get(a,!0);return o.length===0?!n&>(c)?c.value:c:Mt(c)?c.getIn(o,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Pt(n))return!1;const a=n.value;return a==null||t&>(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(t){const[n,...a]=t;if(a.length===0)return this.has(n);const o=this.get(n,!0);return Mt(o)?o.hasIn(a):!1}setIn(t,n){const[a,...o]=t;if(o.length===0)this.set(a,n);else{const c=this.get(a,!0);if(Mt(c))c.setIn(o,n);else if(c===void 0&&this.schema)this.set(a,Iu(this.schema,o,n));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}}const d3=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Zs(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const va=(e,t,n)=>e.endsWith(`
|
|
97
|
-
`)?Zs(n,t):n.includes(`
|
|
98
|
-
`)?`
|
|
99
|
-
`+Zs(n,t):(e.endsWith(" ")?"":" ")+n,vN="flow",Xm="block",vu="quoted";function dd(e,t,n="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:c=20,onFold:u,onOverflow:f}={}){if(!o||o<0)return e;o<c&&(c=0);const m=Math.max(1+c,1+o-t.length);if(e.length<=m)return e;const p=[],v={};let y=o-t.length;typeof a=="number"&&(a>o-Math.max(2,c)?p.push(0):y=o-a);let b,x,N=!1,S=-1,C=-1,k=-1;n===Xm&&(S=aS(e,S,t.length),S!==-1&&(y=S+m));for(let T;T=e[S+=1];){if(n===vu&&T==="\\"){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(T===`
|
|
100
|
-
`)n===Xm&&(S=aS(e,S,t.length)),y=S+t.length+m,b=void 0;else{if(T===" "&&x&&x!==" "&&x!==`
|
|
101
|
-
`&&x!==" "){const z=e[S+1];z&&z!==" "&&z!==`
|
|
102
|
-
`&&z!==" "&&(b=S)}if(S>=y)if(b)p.push(b),y=b+m,b=void 0;else if(n===vu){for(;x===" "||x===" ";)x=T,T=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,b=void 0}else N=!0}x=T}if(N&&f&&f(),p.length===0)return e;u&&u();let A=e.slice(0,p[0]);for(let T=0;T<p.length;++T){const z=p[T],M=p[T+1]||e.length;z===0?A=`
|
|
103
|
-
${t}${e.slice(0,M)}`:(n===vu&&v[z]&&(A+=`${e[z]}\\`),A+=`
|
|
104
|
-
${t}${e.slice(z+1,M)}`)}return A}function aS(e,t,n){let a=t,o=t+1,c=e[o];for(;c===" "||c===" ";)if(t<o+n)c=e[++t];else{do c=e[++t];while(c&&c!==`
|
|
105
|
-
`);a=t,o=t+1,c=e[o]}return a}const fd=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),hd=e=>/^(%|---|\.\.\.)/m.test(e);function f3(e,t,n){if(!t||t<0)return!1;const a=t-n,o=e.length;if(o<=a)return!1;for(let c=0,u=0;c<o;++c)if(e[c]===`
|
|
106
|
-
`){if(c-u>a)return!0;if(u=c+1,o-u<=a)return!1}return!0}function nl(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:a}=t,o=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(hd(e)?" ":"");let u="",f=0;for(let m=0,p=n[m];p;p=n[++m])if(p===" "&&n[m+1]==="\\"&&n[m+2]==="n"&&(u+=n.slice(f,m)+"\\ ",m+=1,f=m,p="\\"),p==="\\")switch(n[m+1]){case"u":{u+=n.slice(f,m);const v=n.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+=n.substr(m,6)}m+=5,f=m+1}break;case"n":if(a||n[m+2]==='"'||n.length<o)m+=1;else{for(u+=n.slice(f,m)+`
|
|
107
|
-
|
|
108
|
-
`;n[m+2]==="\\"&&n[m+3]==="n"&&n[m+4]!=='"';)u+=`
|
|
109
|
-
`,m+=2;u+=c,n[m+2]===" "&&(u+="\\"),m+=1,f=m+1}break;default:m+=1}return u=f?u+n.slice(f):n,a?u:dd(u,c,vu,fd(t,!1))}function Wm(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
110
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return nl(e,t);const n=t.indent||(hd(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
111
|
-
${n}`)+"'";return t.implicitKey?a:dd(a,n,vN,fd(t,!1))}function Or(e,t){const{singleQuote:n}=t.options;let a;if(n===!1)a=nl;else{const o=e.includes('"'),c=e.includes("'");o&&!c?a=Wm:c&&!o?a=nl:a=n?Wm:nl}return a(e,t)}let ep;try{ep=new RegExp(`(^|(?<!
|
|
112
|
-
))
|
|
113
|
-
+(?!
|
|
114
|
-
|$)`,"g")}catch{ep=/\n+(?!\n|$)/g}function bu({comment:e,type:t,value:n},a,o,c){const{blockQuote:u,commentString:f,lineWidth:m}=a.options;if(!u||/\n[\t ]+$/.test(n))return Or(n,a);const p=a.indent||(a.forceBlockIndent||hd(n)?" ":""),v=u==="literal"?!0:u==="folded"||t===Le.BLOCK_FOLDED?!1:t===Le.BLOCK_LITERAL?!0:!f3(n,m,p.length);if(!n)return v?`|
|
|
115
|
-
`:`>
|
|
116
|
-
`;let y,b;for(b=n.length;b>0;--b){const M=n[b-1];if(M!==`
|
|
117
|
-
`&&M!==" "&&M!==" ")break}let x=n.substring(b);const N=x.indexOf(`
|
|
118
|
-
`);N===-1?y="-":n===x||N!==x.length-1?(y="+",c&&c()):y="",x&&(n=n.slice(0,-x.length),x[x.length-1]===`
|
|
119
|
-
`&&(x=x.slice(0,-1)),x=x.replace(ep,`$&${p}`));let S=!1,C,k=-1;for(C=0;C<n.length;++C){const M=n[C];if(M===" ")S=!0;else if(M===`
|
|
120
|
-
`)k=C;else break}let A=n.substring(0,k<C?k+1:C);A&&(n=n.substring(A.length),A=A.replace(/\n+/g,`$&${p}`));let z=(S?p?"2":"1":"")+y;if(e&&(z+=" "+f(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!v){const M=n.replace(/\n+/g,`
|
|
121
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let $=!1;const E=fd(a,!0);u!=="folded"&&t!==Le.BLOCK_FOLDED&&(E.onOverflow=()=>{$=!0});const O=dd(`${A}${M}${x}`,p,Xm,E);if(!$)return`>${z}
|
|
122
|
-
${p}${O}`}return n=n.replace(/\n+/g,`$&${p}`),`|${z}
|
|
123
|
-
${p}${A}${n}${x}`}function h3(e,t,n,a){const{type:o,value:c}=e,{actualString:u,implicitKey:f,indent:m,indentStep:p,inFlow:v}=t;if(f&&c.includes(`
|
|
124
|
-
`)||v&&/[[\]{},]/.test(c))return Or(c,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return f||v||!c.includes(`
|
|
125
|
-
`)?Or(c,t):bu(e,t,n,a);if(!f&&!v&&o!==Le.PLAIN&&c.includes(`
|
|
126
|
-
`))return bu(e,t,n,a);if(hd(c)){if(m==="")return t.forceBlockIndent=!0,bu(e,t,n,a);if(f&&m===p)return Or(c,t)}const y=c.replace(/\n+/g,`$&
|
|
127
|
-
${m}`);if(u){const b=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(y),{compat:x,tags:N}=t.doc.schema;if(N.some(b)||x?.some(b))return Or(c,t)}return f?y:dd(y,m,vN,fd(t,!1))}function Yp(e,t,n,a){const{implicitKey:o,inFlow:c}=t,u=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:f}=e;f!==Le.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(f=Le.QUOTE_DOUBLE);const m=v=>{switch(v){case Le.BLOCK_FOLDED:case Le.BLOCK_LITERAL:return o||c?Or(u.value,t):bu(u,t,n,a);case Le.QUOTE_DOUBLE:return nl(u.value,t);case Le.QUOTE_SINGLE:return Wm(u.value,t);case Le.PLAIN:return h3(u,t,n,a);default:return null}};let p=m(f);if(p===null){const{defaultKeyType:v,defaultStringType:y}=t.options,b=o&&v||y;if(p=m(b),p===null)throw new Error(`Unsupported default string type ${b}`)}return p}function bN(e,t){const n=Object.assign({blockQuote:!0,commentString:d3,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(n.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:a,options:n}}function m3(e,t){if(t.tag){const o=e.filter(c=>c.tag===t.tag);if(o.length>0)return o.find(c=>c.format===t.format)??o[0]}let n,a;if(gt(t)){a=t.value;let o=e.filter(c=>c.identify?.(a));if(o.length>1){const c=o.filter(u=>u.test);c.length>0&&(o=c)}n=o.find(c=>c.format===t.format)??o.find(c=>!c.format)}else a=t,n=e.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!n){const o=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return n}function p3(e,t,{anchors:n,doc:a}){if(!a.directives)return"";const o=[],c=(gt(e)||Mt(e))&&e.anchor;c&&hN(c)&&(n.add(c),o.push(`&${c}`));const u=e.tag??(t.default?null:t.tag);return u&&o.push(a.directives.tagString(u)),o.join(" ")}function qr(e,t,n,a){if(Pt(e))return e.toString(t,n,a);if(Da(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 o;const c=$t(e)?e:t.doc.createNode(e,{onTagObj:m=>o=m});o??(o=m3(t.doc.schema.tags,c));const u=p3(c,o,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);const f=typeof o.stringify=="function"?o.stringify(c,t,n,a):gt(c)?Yp(c,t,n,a):c.toString(t,n,a);return u?gt(c)||f[0]==="{"||f[0]==="["?`${u} ${f}`:`${u}
|
|
128
|
-
${t.indent}${f}`:f}function g3({key:e,value:t},n,a,o){const{allNullValues:c,doc:u,indent:f,indentStep:m,options:{commentString:p,indentSeq:v,simpleKeys:y}}=n;let b=$t(e)&&e.comment||null;if(y){if(b)throw new Error("With simple keys, key nodes cannot have comments");if(Mt(e)||!$t(e)&&typeof e=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let x=!y&&(!e||b&&t==null&&!n.inFlow||Mt(e)||(gt(e)?e.type===Le.BLOCK_FOLDED||e.type===Le.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!x&&(y||!c),indent:f+m});let N=!1,S=!1,C=qr(e,n,()=>N=!0,()=>S=!0);if(!x&&!n.inFlow&&C.length>1024){if(y)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(n.inFlow){if(c||t==null)return N&&a&&a(),C===""?"?":x?`? ${C}`:C}else if(c&&!y||t==null&&x)return C=`? ${C}`,b&&!N?C+=va(C,n.indent,p(b)):S&&o&&o(),C;N&&(b=null),x?(b&&(C+=va(C,n.indent,p(b))),C=`? ${C}
|
|
129
|
-
${f}:`):(C=`${C}:`,b&&(C+=va(C,n.indent,p(b))));let k,A,T;$t(t)?(k=!!t.spaceBefore,A=t.commentBefore,T=t.comment):(k=!1,A=null,T=null,t&&typeof t=="object"&&(t=u.createNode(t))),n.implicitKey=!1,!x&&!b&>(t)&&(n.indentAtStart=C.length+1),S=!1,!v&&m.length>=2&&!n.inFlow&&!x&&xl(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let z=!1;const M=qr(t,n,()=>z=!0,()=>S=!0);let $=" ";if(b||k||A){if($=k?`
|
|
130
|
-
`:"",A){const E=p(A);$+=`
|
|
131
|
-
${Zs(E,n.indent)}`}M===""&&!n.inFlow?$===`
|
|
132
|
-
`&&T&&($=`
|
|
133
|
-
|
|
134
|
-
`):$+=`
|
|
135
|
-
${n.indent}`}else if(!x&&Mt(t)){const E=M[0],O=M.indexOf(`
|
|
136
|
-
`),K=O!==-1,W=n.inFlow??t.flow??t.items.length===0;if(K||!W){let J=!1;if(K&&(E==="&"||E==="!")){let ne=M.indexOf(" ");E==="&"&&ne!==-1&&ne<O&&M[ne+1]==="!"&&(ne=M.indexOf(" ",ne+1)),(ne===-1||O<ne)&&(J=!0)}J||($=`
|
|
137
|
-
${n.indent}`)}}else(M===""||M[0]===`
|
|
138
|
-
`)&&($="");return C+=$+M,n.inFlow?z&&a&&a():T&&!z?C+=va(C,n.indent,p(T)):S&&o&&o(),C}function y3(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const nu="<<",Vs={identify:e=>e===nu||typeof e=="symbol"&&e.description===nu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Le(Symbol(nu)),{addToJSMap:xN}),stringify:()=>nu},v3=(e,t)=>(Vs.identify(t)||gt(t)&&(!t.type||t.type===Le.PLAIN)&&Vs.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Vs.tag&&n.default);function xN(e,t,n){if(n=e&&Da(n)?n.resolve(e.doc):n,xl(n))for(const a of n.items)dm(e,t,a);else if(Array.isArray(n))for(const a of n)dm(e,t,a);else dm(e,t,n)}function dm(e,t,n){const a=e&&Da(n)?n.resolve(e.doc):n;if(!bl(a))throw new Error("Merge sources must be maps or map aliases");const o=a.toJSON(null,e,Map);for(const[c,u]of o)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 SN(e,t,{key:n,value:a}){if($t(n)&&n.addToJSMap)n.addToJSMap(e,t,a);else if(v3(e,n))xN(e,t,a);else{const o=Yn(n,"",e);if(t instanceof Map)t.set(o,Yn(a,o,e));else if(t instanceof Set)t.add(o);else{const c=b3(n,o,e),u=Yn(a,c,e);c in t?Object.defineProperty(t,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):t[c]=u}}return t}function b3(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if($t(e)&&n?.doc){const a=bN(n.doc,{});a.anchors=new Set;for(const c of n.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const o=e.toString(a);if(!n.mapKeyWarned){let c=JSON.stringify(o);c.length>40&&(c=c.substring(0,36)+'..."'),y3(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return o}return JSON.stringify(t)}function Jp(e,t,n){const a=hl(e,void 0,n),o=hl(t,void 0,n);return new pn(a,o)}class pn{constructor(t,n=null){Object.defineProperty(this,Jn,{value:dN}),this.key=t,this.value=n}clone(t){let{key:n,value:a}=this;return $t(n)&&(n=n.clone(t)),$t(a)&&(a=a.clone(t)),new pn(n,a)}toJSON(t,n){const a=n?.mapAsMap?new Map:{};return SN(n,a,this)}toString(t,n,a){return t?.doc?g3(this,t,n,a):JSON.stringify(this)}}function jN(e,t,n){return(t.inFlow??e.flow?S3:x3)(e,t,n)}function x3({comment:e,items:t},n,{blockItemPrefix:a,flowChars:o,itemIndent:c,onChompKeep:u,onComment:f}){const{indent:m,options:{commentString:p}}=n,v=Object.assign({},n,{indent:c,type:null});let y=!1;const b=[];for(let N=0;N<t.length;++N){const S=t[N];let C=null;if($t(S))!y&&S.spaceBefore&&b.push(""),Bu(n,b,S.commentBefore,y),S.comment&&(C=S.comment);else if(Pt(S)){const A=$t(S.key)?S.key:null;A&&(!y&&A.spaceBefore&&b.push(""),Bu(n,b,A.commentBefore,y))}y=!1;let k=qr(S,v,()=>C=null,()=>y=!0);C&&(k+=va(k,c,p(C))),y&&C&&(y=!1),b.push(a+k)}let x;if(b.length===0)x=o.start+o.end;else{x=b[0];for(let N=1;N<b.length;++N){const S=b[N];x+=S?`
|
|
139
|
-
${m}${S}`:`
|
|
140
|
-
`}}return e?(x+=`
|
|
141
|
-
`+Zs(p(e),m),f&&f()):y&&u&&u(),x}function S3({items:e},t,{flowChars:n,itemIndent:a}){const{indent:o,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($t(S))S.spaceBefore&&y.push(""),Bu(t,y,S.commentBefore,!1),S.comment&&(C=S.comment);else if(Pt(S)){const A=$t(S.key)?S.key:null;A&&(A.spaceBefore&&y.push(""),Bu(t,y,A.commentBefore,!1),A.comment&&(p=!0));const T=$t(S.value)?S.value:null;T?(T.comment&&(C=T.comment),T.commentBefore&&(p=!0)):S.value==null&&A?.comment&&(C=A.comment)}C&&(p=!0);let k=qr(S,m,()=>C=null);N<e.length-1&&(k+=","),C&&(k+=va(k,a,f(C))),!p&&(y.length>v||k.includes(`
|
|
142
|
-
`))&&(p=!0),y.push(k),v=y.length}const{start:b,end:x}=n;if(y.length===0)return b+x;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=b;for(const S of y)N+=S?`
|
|
143
|
-
${c}${o}${S}`:`
|
|
144
|
-
`;return`${N}
|
|
145
|
-
${o}${x}`}else return`${b}${u}${y.join(" ")}${u}${x}`}function Bu({indent:e,options:{commentString:t}},n,a,o){if(a&&o&&(a=a.replace(/^\n+/,"")),a){const c=Zs(t(a),e);n.push(c.trimStart())}}function ba(e,t){const n=gt(t)?t.value:t;for(const a of e)if(Pt(a)&&(a.key===t||a.key===n||gt(a.key)&&a.key.value===n))return a}class Vn extends yN{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Di,t),this.items=[]}static from(t,n,a){const{keepUndefined:o,replacer:c}=a,u=new this(t),f=(m,p)=>{if(typeof c=="function")p=c.call(n,m,p);else if(Array.isArray(c)&&!c.includes(m))return;(p!==void 0||o)&&u.items.push(Jp(m,p,a))};if(n instanceof Map)for(const[m,p]of n)f(m,p);else if(n&&typeof n=="object")for(const m of Object.keys(n))f(m,n[m]);return typeof t.sortMapEntries=="function"&&u.items.sort(t.sortMapEntries),u}add(t,n){let a;Pt(t)?a=t:!t||typeof t!="object"||!("key"in t)?a=new pn(t,t?.value):a=new pn(t.key,t.value);const o=ba(this.items,a.key),c=this.schema?.sortMapEntries;if(o){if(!n)throw new Error(`Key ${a.key} already set`);gt(o.value)&&gN(a.value)?o.value.value=a.value:o.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 n=ba(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const o=ba(this.items,t)?.value;return(!n&>(o)?o.value:o)??void 0}has(t){return!!ba(this.items,t)}set(t,n){this.add(new pn(t,n),!0)}toJSON(t,n,a){const o=a?new a:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(o);for(const c of this.items)SN(n,o,c);return o}toString(t,n,a){if(!t)return JSON.stringify(this);for(const o of this.items)if(!Pt(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),jN(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:a,onComment:n})}}const Yr={collection:"map",default:!0,nodeClass:Vn,tag:"tag:yaml.org,2002:map",resolve(e,t){return bl(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Vn.from(e,t,n)};class Ea extends yN{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Vr,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=su(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const a=su(t);if(typeof a!="number")return;const o=this.items[a];return!n&>(o)?o.value:o}has(t){const n=su(t);return typeof n=="number"&&n<this.items.length}set(t,n){const a=su(t);if(typeof a!="number")throw new Error(`Expected a valid index, not ${t}.`);const o=this.items[a];gt(o)&&gN(n)?o.value=n:this.items[a]=n}toJSON(t,n){const a=[];n?.onCreate&&n.onCreate(a);let o=0;for(const c of this.items)a.push(Yn(c,String(o++),n));return a}toString(t,n,a){return t?jN(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:a,onComment:n}):JSON.stringify(this)}static from(t,n,a){const{replacer:o}=a,c=new this(t);if(n&&Symbol.iterator in Object(n)){let u=0;for(let f of n){if(typeof o=="function"){const m=n instanceof Set?f:String(u++);f=o.call(n,m,f)}c.items.push(hl(f,void 0,a))}}return c}}function su(e){let t=gt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const Jr={collection:"seq",default:!0,nodeClass:Ea,tag:"tag:yaml.org,2002:seq",resolve(e,t){return xl(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Ea.from(e,t,n)},md={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,a){return t=Object.assign({actualString:!0},t),Yp(e,t,n,a)}},pd={identify:e=>e==null,createNode:()=>new Le(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Le(null),stringify:({source:e},t)=>typeof e=="string"&&pd.test.test(e)?e:t.options.nullStr},Xp={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Le(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Xp.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(t===a)return e}return t?n.options.trueStr:n.options.falseStr}};function hs({format:e,minFractionDigits:t,tag:n,value:a}){if(typeof a=="bigint")return String(a);const o=typeof a=="number"?a:Number(a);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&t&&(!n||n==="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 wN={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:hs},NN={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():hs(e)}},CN={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 Le(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:hs},gd=e=>typeof e=="bigint"||Number.isInteger(e),Wp=(e,t,n,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(t),n);function kN(e,t,n){const{value:a}=e;return gd(a)&&a>=0?n+a.toString(t):hs(e)}const zN={identify:e=>gd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Wp(e,2,8,n),stringify:e=>kN(e,8,"0o")},_N={identify:gd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Wp(e,0,10,n),stringify:hs},EN={identify:e=>gd(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Wp(e,2,16,n),stringify:e=>kN(e,16,"0x")},j3=[Yr,Jr,md,pd,Xp,zN,_N,EN,wN,NN,CN];function rS(e){return typeof e=="bigint"||Number.isInteger(e)}const iu=({value:e})=>JSON.stringify(e),w3=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:iu},{identify:e=>e==null,createNode:()=>new Le(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:iu},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:iu},{identify:rS,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>rS(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:iu}],N3={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},C3=[Yr,Jr].concat(w3,N3),eg={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(n.length);for(let o=0;o<n.length;++o)a[o]=n.charCodeAt(o);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:n},a,o,c){if(!n)return"";const u=n;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=Le.BLOCK_LITERAL),t!==Le.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,b=0;y<p;++y,b+=m)v[y]=f.substr(b,m);f=v.join(t===Le.BLOCK_LITERAL?`
|
|
146
|
-
`:" ")}return Yp({comment:e,type:t,value:f},a,o,c)}};function TN(e,t){if(xl(e))for(let n=0;n<e.items.length;++n){let a=e.items[n];if(!Pt(a)){if(bl(a)){a.items.length>1&&t("Each pair must have its own sequence indicator");const o=a.items[0]||new pn(new Le(null));if(a.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${a.commentBefore}
|
|
147
|
-
${o.key.commentBefore}`:a.commentBefore),a.comment){const c=o.value??o.key;c.comment=c.comment?`${a.comment}
|
|
148
|
-
${c.comment}`:a.comment}a=o}e.items[n]=Pt(a)?a:new pn(a)}}else t("Expected a sequence for this tag");return e}function AN(e,t,n){const{replacer:a}=n,o=new Ea(e);o.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;o.items.push(Jp(f,m,n))}return o}const tg={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:TN,createNode:AN};class Mr extends Ea{constructor(){super(),this.add=Vn.prototype.add.bind(this),this.delete=Vn.prototype.delete.bind(this),this.get=Vn.prototype.get.bind(this),this.has=Vn.prototype.has.bind(this),this.set=Vn.prototype.set.bind(this),this.tag=Mr.tag}toJSON(t,n){if(!n)return super.toJSON(t);const a=new Map;n?.onCreate&&n.onCreate(a);for(const o of this.items){let c,u;if(Pt(o)?(c=Yn(o.key,"",n),u=Yn(o.value,c,n)):c=Yn(o,"",n),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,u)}return a}static from(t,n,a){const o=AN(t,n,a),c=new this;return c.items=o.items,c}}Mr.tag="tag:yaml.org,2002:omap";const ng={collection:"seq",identify:e=>e instanceof Map,nodeClass:Mr,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=TN(e,t),a=[];for(const{key:o}of n.items)gt(o)&&(a.includes(o.value)?t(`Ordered maps must not include duplicate keys: ${o.value}`):a.push(o.value));return Object.assign(new Mr,n)},createNode:(e,t,n)=>Mr.from(e,t,n)};function RN({value:e,source:t},n){return t&&(e?ON:LN).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const ON={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 Le(!0),stringify:RN},LN={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 Le(!1),stringify:RN},k3={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:hs},z3={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():hs(e)}},_3={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 Le(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const a=e.substring(n+1).replace(/_/g,"");a[a.length-1]==="0"&&(t.minFractionDigits=a.length)}return t},stringify:hs},Sl=e=>typeof e=="bigint"||Number.isInteger(e);function yd(e,t,n,{intAsBigInt:a}){const o=e[0];if((o==="-"||o==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),a){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const u=BigInt(e);return o==="-"?BigInt(-1)*u:u}const c=parseInt(e,n);return o==="-"?-1*c:c}function sg(e,t,n){const{value:a}=e;if(Sl(a)){const o=a.toString(t);return a<0?"-"+n+o.substr(1):n+o}return hs(e)}const E3={identify:Sl,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>yd(e,2,2,n),stringify:e=>sg(e,2,"0b")},T3={identify:Sl,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>yd(e,1,8,n),stringify:e=>sg(e,8,"0")},A3={identify:Sl,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>yd(e,0,10,n),stringify:hs},R3={identify:Sl,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>yd(e,2,16,n),stringify:e=>sg(e,16,"0x")};class $r extends Vn{constructor(t){super(t),this.tag=$r.tag}add(t){let n;Pt(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new pn(t.key,null):n=new pn(t,null),ba(this.items,n.key)||this.items.push(n)}get(t,n){const a=ba(this.items,t);return!n&&Pt(a)?gt(a.key)?a.key.value:a.key:a}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const a=ba(this.items,t);a&&!n?this.items.splice(this.items.indexOf(a),1):!a&&n&&this.items.push(new pn(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,a){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,a);throw new Error("Set items must all have null values")}static from(t,n,a){const{replacer:o}=a,c=new this(t);if(n&&Symbol.iterator in Object(n))for(let u of n)typeof o=="function"&&(u=o.call(n,u,u)),c.items.push(Jp(u,null,a));return c}}$r.tag="tag:yaml.org,2002:set";const ig={collection:"map",identify:e=>e instanceof Set,nodeClass:$r,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>$r.from(e,t,n),resolve(e,t){if(bl(e)){if(e.hasAllNullValues(!0))return Object.assign(new $r,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function ag(e,t){const n=e[0],a=n==="-"||n==="+"?e.substring(1):e,o=u=>t?BigInt(u):Number(u),c=a.replace(/_/g,"").split(":").reduce((u,f)=>u*o(60)+o(f),o(0));return n==="-"?o(-1)*c:c}function DN(e){let{value:t}=e,n=u=>u;if(typeof t=="bigint")n=u=>BigInt(u);else if(isNaN(t)||!isFinite(t))return hs(e);let a="";t<0&&(a="-",t*=n(-1));const o=n(60),c=[t%o];return t<60?c.unshift(0):(t=(t-c[0])/o,c.unshift(t%o),t>=60&&(t=(t-c[0])/o,c.unshift(t))),a+c.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const MN={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:n})=>ag(e,n),stringify:DN},$N={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=>ag(e,!1),stringify:DN},vd={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(vd.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,a,o,c,u,f]=t.map(Number),m=t[7]?Number((t[7]+"00").substr(1,3)):0;let p=Date.UTC(n,a-1,o,c||0,u||0,f||0,m);const v=t[8];if(v&&v!=="Z"){let y=ag(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$/,"")??""},oS=[Yr,Jr,md,pd,ON,LN,E3,T3,A3,R3,k3,z3,_3,eg,Vs,ng,tg,ig,MN,$N,vd],lS=new Map([["core",j3],["failsafe",[Yr,Jr,md]],["json",C3],["yaml11",oS],["yaml-1.1",oS]]),cS={binary:eg,bool:Xp,float:CN,floatExp:NN,floatNaN:wN,floatTime:$N,int:_N,intHex:EN,intOct:zN,intTime:MN,map:Yr,merge:Vs,null:pd,omap:ng,pairs:tg,seq:Jr,set:ig,timestamp:vd},O3={"tag:yaml.org,2002:binary":eg,"tag:yaml.org,2002:merge":Vs,"tag:yaml.org,2002:omap":ng,"tag:yaml.org,2002:pairs":tg,"tag:yaml.org,2002:set":ig,"tag:yaml.org,2002:timestamp":vd};function fm(e,t,n){const a=lS.get(t);if(a&&!e)return n&&!a.includes(Vs)?a.concat(Vs):a.slice();let o=a;if(!o)if(Array.isArray(e))o=[];else{const c=Array.from(lS.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)o=o.concat(c);else typeof e=="function"&&(o=e(o.slice()));return n&&(o=o.concat(Vs)),o.reduce((c,u)=>{const f=typeof u=="string"?cS[u]:u;if(!f){const m=JSON.stringify(u),p=Object.keys(cS).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 L3=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class rg{constructor({compat:t,customTags:n,merge:a,resolveKnownTags:o,schema:c,sortMapEntries:u,toStringDefaults:f}){this.compat=Array.isArray(t)?fm(t,"compat"):t?fm(null,t):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?O3:{},this.tags=fm(n,this.name,a),this.toStringOptions=f??null,Object.defineProperty(this,Di,{value:Yr}),Object.defineProperty(this,Ns,{value:md}),Object.defineProperty(this,Vr,{value:Jr}),this.sortMapEntries=typeof u=="function"?u:u===!0?L3:null}clone(){const t=Object.create(rg.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function D3(e,t){const n=[];let a=t.directives===!0;if(t.directives!==!1&&e.directives){const m=e.directives.toString(e);m?(n.push(m),a=!0):e.directives.docStart&&(a=!0)}a&&n.push("---");const o=bN(e,t),{commentString:c}=o.options;if(e.commentBefore){n.length!==1&&n.unshift("");const m=c(e.commentBefore);n.unshift(Zs(m,""))}let u=!1,f=null;if(e.contents){if($t(e.contents)){if(e.contents.spaceBefore&&a&&n.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);n.push(Zs(v,""))}o.forceBlockIndent=!!e.comment,f=e.contents.comment}const m=f?void 0:()=>u=!0;let p=qr(e.contents,o,()=>f=null,m);f&&(p+=va(p,"",c(f))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(qr(e.contents,o));if(e.directives?.docEnd)if(e.comment){const m=c(e.comment);m.includes(`
|
|
149
|
-
`)?(n.push("..."),n.push(Zs(m,""))):n.push(`... ${m}`)}else n.push("...");else{let m=e.comment;m&&u&&(m=m.replace(/^\n+/,"")),m&&((!u||f)&&n[n.length-1]!==""&&n.push(""),n.push(Zs(c(m),"")))}return n.join(`
|
|
150
|
-
`)+`
|
|
151
|
-
`}class bd{constructor(t,n,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Jn,{value:Jm});let o=null;typeof n=="function"||Array.isArray(n)?o=n:a===void 0&&n&&(a=n,n=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,o,a)}clone(){const t=Object.create(bd.prototype,{[Jn]:{value:Jm}});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=$t(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){kr(this.contents)&&this.contents.add(t)}addIn(t,n){kr(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const a=mN(this);t.anchor=!n||a.has(n)?pN(n||"a",a):n}return new Qp(t.anchor)}createNode(t,n,a){let o;if(typeof n=="function")t=n.call({"":t},"",t),o=n;else if(Array.isArray(n)){const C=A=>typeof A=="number"||A instanceof String||A instanceof Number,k=n.filter(C).map(String);k.length>0&&(n=n.concat(k)),o=n}else a===void 0&&n&&(a=n,n=void 0);const{aliasDuplicateObjects:c,anchorPrefix:u,flow:f,keepUndefined:m,onTagObj:p,tag:v}=a??{},{onAnchor:y,setAnchors:b,sourceObjects:x}=l3(this,u||"a"),N={aliasDuplicateObjects:c??!0,keepUndefined:m??!1,onAnchor:y,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:x},S=hl(t,v,N);return f&&Mt(S)&&(S.flow=!0),b(),S}createPair(t,n,a={}){const o=this.createNode(t,null,a),c=this.createNode(n,null,a);return new pn(o,c)}delete(t){return kr(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Xo(t)?this.contents==null?!1:(this.contents=null,!0):kr(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Mt(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Xo(t)?!n&>(this.contents)?this.contents.value:this.contents:Mt(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Mt(this.contents)?this.contents.has(t):!1}hasIn(t){return Xo(t)?this.contents!==void 0:Mt(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Iu(this.schema,[t],n):kr(this.contents)&&this.contents.set(t,n)}setIn(t,n){Xo(t)?this.contents=n:this.contents==null?this.contents=Iu(this.schema,Array.from(t),n):kr(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){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 o=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(a)this.schema=new rg(Object.assign(a,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:a,maxAliasCount:o,onAnchor:c,reviver:u}={}){const f={anchors:new Map,doc:this,keep:!t,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},m=Yn(this.contents,n??"",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,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return D3(this,t)}}function kr(e){if(Mt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class PN extends Error{constructor(t,n,a,o){super(),this.name=t,this.code=a,this.message=o,this.pos=n}}class au extends PN{constructor(t,n,a){super("YAMLParseError",t,n,a)}}class M3 extends PN{constructor(t,n,a){super("YAMLWarning",t,n,a)}}const uS=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(f=>t.linePos(f));const{line:a,col:o}=n.linePos[0];n.message+=` at line ${a}, column ${o}`;let c=o-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=n.linePos[1];m?.line===a&&m.col>o&&(f=Math.max(1,Math.min(m.col-o,80-c)));const p=" ".repeat(c)+"^".repeat(f);n.message+=`:
|
|
153
|
-
|
|
154
|
-
${u}
|
|
155
|
-
${p}
|
|
156
|
-
`}};function Kr(e,{flow:t,indicator:n,next:a,offset:o,onError:c,parentIndent:u,startOnNewline:f}){let m=!1,p=f,v=f,y="",b="",x=!1,N=!1,S=null,C=null,k=null,A=null,T=null,z=null,M=null;for(const O of e)switch(N&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&c(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),N=!1),S&&(p&&O.type!=="comment"&&O.type!=="newline"&&c(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),O.type){case"space":!t&&(n!=="doc-start"||a?.type!=="flow-collection")&&O.source.includes(" ")&&(S=O),v=!0;break;case"comment":{v||c(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const K=O.source.substring(1)||" ";y?y+=b+K:y=K,b="",p=!1;break}case"newline":p?y?y+=O.source:(!z||n!=="seq-item-ind")&&(m=!0):b+=O.source,p=!0,x=!0,(C||k)&&(A=O),v=!0;break;case"anchor":C&&c(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&c(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),C=O,M??(M=O.offset),p=!1,v=!1,N=!0;break;case"tag":{k&&c(O,"MULTIPLE_TAGS","A node can have at most one tag"),k=O,M??(M=O.offset),p=!1,v=!1,N=!0;break}case n:(C||k)&&c(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),z&&c(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${t??"collection"}`),z=O,p=n==="seq-item-ind"||n==="explicit-key-ind",v=!1;break;case"comma":if(t){T&&c(O,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),T=O,p=!1,v=!1;break}default:c(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),p=!1,v=!1}const $=e[e.length-1],E=$?$.offset+$.source.length:o;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:T,found:z,spaceBefore:m,comment:y,hasNewline:x,anchor:C,tag:k,newlineAfterProp:A,end:E,start:M??E}}function ml(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 n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(ml(t.key)||ml(t.value))return!0}return!1;default:return!0}}function tp(e,t,n){if(t?.type==="flow-collection"){const a=t.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&ml(t)&&n(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function UN(e,t,n){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const o=typeof a=="function"?a:(c,u)=>c===u||gt(c)&>(u)&&c.value===u.value;return t.some(c=>o(c.key,n))}const dS="All mapping items must start at the same column";function $3({composeNode:e,composeEmptyNode:t},n,a,o,c){const u=c?.nodeClass??Vn,f=new u(n.schema);n.atRoot&&(n.atRoot=!1);let m=a.offset,p=null;for(const v of a.items){const{start:y,key:b,sep:x,value:N}=v,S=Kr(y,{indicator:"explicit-key-ind",next:b??x?.[0],offset:m,onError:o,parentIndent:a.indent,startOnNewline:!0}),C=!S.found;if(C){if(b&&(b.type==="block-seq"?o(m,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in b&&b.indent!==a.indent&&o(m,"BAD_INDENT",dS)),!S.anchor&&!S.tag&&!x){p=S.end,S.comment&&(f.comment?f.comment+=`
|
|
158
|
-
`+S.comment:f.comment=S.comment);continue}(S.newlineAfterProp||ml(b))&&o(b??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&o(m,"BAD_INDENT",dS);n.atKey=!0;const k=S.end,A=b?e(n,b,S,o):t(n,k,y,null,S,o);n.schema.compat&&tp(a.indent,b,o),n.atKey=!1,UN(n,f.items,A)&&o(k,"DUPLICATE_KEY","Map keys must be unique");const T=Kr(x??[],{indicator:"map-value-ind",next:N,offset:A.range[2],onError:o,parentIndent:a.indent,startOnNewline:!b||b.type==="block-scalar"});if(m=T.end,T.found){C&&(N?.type==="block-map"&&!T.hasNewline&&o(m,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&S.start<T.found.offset-1024&&o(A.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(n,N,T,o):t(n,m,x,null,T,o);n.schema.compat&&tp(a.indent,N,o),m=z.range[2];const M=new pn(A,z);n.options.keepSourceTokens&&(M.srcToken=v),f.items.push(M)}else{C&&o(A.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),T.comment&&(A.comment?A.comment+=`
|
|
159
|
-
`+T.comment:A.comment=T.comment);const z=new pn(A);n.options.keepSourceTokens&&(z.srcToken=v),f.items.push(z)}}return p&&p<m&&o(p,"IMPOSSIBLE","Map comment with trailing content"),f.range=[a.offset,m,p??m],f}function P3({composeNode:e,composeEmptyNode:t},n,a,o,c){const u=c?.nodeClass??Ea,f=new u(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=a.offset,p=null;for(const{start:v,value:y}of a.items){const b=Kr(v,{indicator:"seq-item-ind",next:y,offset:m,onError:o,parentIndent:a.indent,startOnNewline:!0});if(!b.found)if(b.anchor||b.tag||y)y?.type==="block-seq"?o(b.end,"BAD_INDENT","All sequence items must start at the same column"):o(m,"MISSING_CHAR","Sequence item without - indicator");else{p=b.end,b.comment&&(f.comment=b.comment);continue}const x=y?e(n,y,b,o):t(n,b.end,v,null,b,o);n.schema.compat&&tp(a.indent,y,o),m=x.range[2],f.items.push(x)}return f.range=[a.offset,m,p??m],f}function jl(e,t,n,a){let o="";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":{n&&!c&&a(f,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=m.substring(1)||" ";o?o+=u+v:o=v,u="";break}case"newline":o&&(u+=m),c=!0;break;default:a(f,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}t+=m.length}}return{comment:o,offset:t}}const hm="Block collections are not allowed within flow collections",mm=e=>e&&(e.type==="block-map"||e.type==="block-seq");function U3({composeNode:e,composeEmptyNode:t},n,a,o,c){const u=a.start.source==="{",f=u?"flow map":"flow sequence",m=c?.nodeClass??(u?Vn:Ea),p=new m(n.schema);p.flow=!0;const v=n.atRoot;v&&(n.atRoot=!1),n.atKey&&(n.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:A,key:T,sep:z,value:M}=k,$=Kr(A,{flow:f,indicator:"explicit-key-ind",next:T??z?.[0],offset:y,onError:o,parentIndent:a.indent,startOnNewline:!1});if(!$.found){if(!$.anchor&&!$.tag&&!z&&!M){C===0&&$.comma?o($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`):C<a.items.length-1&&o($.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${f}`),$.comment&&(p.comment?p.comment+=`
|
|
160
|
-
`+$.comment:p.comment=$.comment),y=$.end;continue}!u&&n.options.strict&&ml(T)&&o(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(C===0)$.comma&&o($.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${f}`);else if($.comma||o($.start,"MISSING_CHAR",`Missing , between ${f} items`),$.comment){let E="";e:for(const O of A)switch(O.type){case"comma":case"space":break;case"comment":E=O.source.substring(1);break e;default:break e}if(E){let O=p.items[p.items.length-1];Pt(O)&&(O=O.value??O.key),O.comment?O.comment+=`
|
|
161
|
-
`+E:O.comment=E,$.comment=$.comment.substring(E.length+1)}}if(!u&&!z&&!$.found){const E=M?e(n,M,$,o):t(n,$.end,z,null,$,o);p.items.push(E),y=E.range[2],mm(M)&&o(E.range,"BLOCK_IN_FLOW",hm)}else{n.atKey=!0;const E=$.end,O=T?e(n,T,$,o):t(n,E,A,null,$,o);mm(T)&&o(O.range,"BLOCK_IN_FLOW",hm),n.atKey=!1;const K=Kr(z??[],{flow:f,indicator:"map-value-ind",next:M,offset:O.range[2],onError:o,parentIndent:a.indent,startOnNewline:!1});if(K.found){if(!u&&!$.found&&n.options.strict){if(z)for(const ne of z){if(ne===K.found)break;if(ne.type==="newline"){o(ne,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}$.start<K.found.offset-1024&&o(K.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else M&&("source"in M&&M.source?.[0]===":"?o(M,"MISSING_CHAR",`Missing space after : in ${f}`):o(K.start,"MISSING_CHAR",`Missing , or : between ${f} items`));const W=M?e(n,M,K,o):K.found?t(n,K.end,z,null,K,o):null;W?mm(M)&&o(W.range,"BLOCK_IN_FLOW",hm):K.comment&&(O.comment?O.comment+=`
|
|
162
|
-
`+K.comment:O.comment=K.comment);const J=new pn(O,W);if(n.options.keepSourceTokens&&(J.srcToken=k),u){const ne=p;UN(n,ne.items,O)&&o(E,"DUPLICATE_KEY","Map keys must be unique"),ne.items.push(J)}else{const ne=new Vn(n.schema);ne.flow=!0,ne.items.push(J);const fe=(W??O).range;ne.range=[O.range[0],fe[1],fe[2]],p.items.push(ne)}y=W?W.range[2]:K.end}}const b=u?"}":"]",[x,...N]=a.end;let S=y;if(x?.source===b)S=x.offset+x.source.length;else{const C=f[0].toUpperCase()+f.substring(1),k=v?`${C} must end with a ${b}`:`${C} in block collection must be sufficiently indented and end with a ${b}`;o(y,v?"MISSING_CHAR":"BAD_INDENT",k),x&&x.source.length!==1&&N.unshift(x)}if(N.length>0){const C=jl(N,S,n.options.strict,o);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 pm(e,t,n,a,o,c){const u=n.type==="block-map"?$3(e,t,n,a,c):n.type==="block-seq"?P3(e,t,n,a,c):U3(e,t,n,a,c),f=u.constructor;return o==="!"||o===f.tagName?(u.tag=f.tagName,u):(o&&(u.tag=o),u)}function I3(e,t,n,a,o){const c=a.tag,u=c?t.directives.tagName(c.source,b=>o(c,"TAG_RESOLVE_FAILED",b)):null;if(n.type==="block-seq"){const{anchor:b,newlineAfterProp:x}=a,N=b&&c?b.offset>c.offset?b:c:b??c;N&&(!x||x.offset<N.offset)&&o(N,"MISSING_CHAR","Missing newline after block sequence props")}const f=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!c||!u||u==="!"||u===Vn.tagName&&f==="map"||u===Ea.tagName&&f==="seq")return pm(e,t,n,o,u);let m=t.schema.tags.find(b=>b.tag===u&&b.collection===f);if(!m){const b=t.schema.knownTags[u];if(b?.collection===f)t.schema.tags.push(Object.assign({},b,{default:!1})),m=b;else return b?o(c,"BAD_COLLECTION_TYPE",`${b.tag} used for ${f} collection, but expects ${b.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),pm(e,t,n,o,u)}const p=pm(e,t,n,o,u,m),v=m.resolve?.(p,b=>o(c,"TAG_RESOLVE_FAILED",b),t.options)??p,y=$t(v)?v:new Le(v);return y.range=p.range,y.tag=u,m?.format&&(y.format=m.format),y}function B3(e,t,n){const a=t.offset,o=q3(t,e.options.strict,n);if(!o)return{value:"",type:null,comment:"",range:[a,a,a]};const c=o.mode===">"?Le.BLOCK_FOLDED:Le.BLOCK_LITERAL,u=t.source?K3(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=o.chomp==="+"&&u.length>0?`
|
|
164
|
-
`.repeat(Math.max(1,u.length-1)):"";let C=a+o.length;return t.source&&(C+=t.source.length),{value:S,type:c,comment:o.comment,range:[a,C,C]}}let m=t.indent+o.indent,p=t.offset+o.length,v=0;for(let S=0;S<f;++S){const[C,k]=u[S];if(k===""||k==="\r")o.indent===0&&C.length>m&&(m=C.length);else{C.length<m&&n(p+C.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(m=C.length),v=S,m===0&&!e.atRoot&&n(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="",b="",x=!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 A=k[k.length-1]==="\r";if(A&&(k=k.slice(0,-1)),k&&C.length<m){const z=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;n(p-k.length-(A?2:1),"BAD_INDENT",z),C=""}c===Le.BLOCK_LITERAL?(y+=b+C.slice(m)+k,b=`
|
|
166
|
-
`):C.length>m||k[0]===" "?(b===" "?b=`
|
|
167
|
-
`:!x&&b===`
|
|
168
|
-
`&&(b=`
|
|
169
|
-
|
|
170
|
-
`),y+=b+C.slice(m)+k,b=`
|
|
171
|
-
`,x=!0):k===""?b===`
|
|
172
|
-
`?y+=`
|
|
173
|
-
`:b=`
|
|
174
|
-
`:(y+=b+k,b=" ",x=!1)}switch(o.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+o.length+t.source.length;return{value:y,type:c,comment:o.comment,range:[a,N,N]}}function q3({offset:e,props:t},n,a){if(t[0].type!=="block-scalar-header")return a(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=t[0],c=o[0];let u=0,f="",m=-1;for(let b=1;b<o.length;++b){const x=o[b];if(!f&&(x==="-"||x==="+"))f=x;else{const N=Number(x);!u&&N?u=N:m===-1&&(m=e+b)}}m!==-1&&a(m,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,v="",y=o.length;for(let b=1;b<t.length;++b){const x=t[b];switch(x.type){case"space":p=!0;case"newline":y+=x.source.length;break;case"comment":n&&!p&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),y+=x.source.length,v=x.source.substring(1);break;case"error":a(x,"UNEXPECTED_TOKEN",x.message),y+=x.source.length;break;default:{const N=`Unexpected token in block scalar header: ${x.type}`;a(x,"UNEXPECTED_TOKEN",N);const S=x.source;S&&typeof S=="string"&&(y+=S.length)}}}return{mode:c,indent:u,chomp:f,comment:v,length:y}}function K3(e){const t=e.split(/\n( *)/),n=t[0],a=n.match(/^( *)/),c=[a?.[1]?[a[1],n.slice(a[1].length)]:["",n]];for(let u=1;u<t.length;u+=2)c.push([t[u],t[u+1]]);return c}function H3(e,t,n){const{offset:a,type:o,source:c,end:u}=e;let f,m;const p=(b,x,N)=>n(a+b,x,N);switch(o){case"scalar":f=Le.PLAIN,m=G3(c,p);break;case"single-quoted-scalar":f=Le.QUOTE_SINGLE,m=F3(c,p);break;case"double-quoted-scalar":f=Le.QUOTE_DOUBLE,m=Z3(c,p);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,y=jl(u,v,t,n);return{value:m,type:f,comment:y.comment,range:[a,v,y.offset]}}function G3(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),IN(e)}function F3(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),IN(e.slice(1,-1)).replace(/''/g,"'")}function IN(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
179
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
180
|
-
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=t.exec(e);if(!a)return e;let o=a[1],c=" ",u=t.lastIndex;for(n.lastIndex=u;a=n.exec(e);)a[1]===""?c===`
|
|
181
|
-
`?o+=c:c=`
|
|
182
|
-
`:(o+=c+a[1],c=" "),u=n.lastIndex;const f=/[ \t]*(.*)/sy;return f.lastIndex=u,a=f.exec(e),o+c+(a?.[1]??"")}function Z3(e,t){let n="";for(let a=1;a<e.length-1;++a){const o=e[a];if(!(o==="\r"&&e[a+1]===`
|
|
183
|
-
`))if(o===`
|
|
184
|
-
`){const{fold:c,offset:u}=V3(e,a);n+=c,a=u}else if(o==="\\"){let c=e[++a];const u=Q3[c];if(u)n+=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];n+=Y3(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}`),n+=f}}else if(o===" "||o===" "){const c=a;let u=e[a+1];for(;u===" "||u===" ";)u=e[++a+1];u!==`
|
|
187
|
-
`&&!(u==="\r"&&e[a+2]===`
|
|
188
|
-
`)&&(n+=a>c?e.slice(c,a+1):o)}else n+=o}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function V3(e,t){let n="",a=e[t+1];for(;(a===" "||a===" "||a===`
|
|
189
|
-
`||a==="\r")&&!(a==="\r"&&e[t+2]!==`
|
|
190
|
-
`);)a===`
|
|
191
|
-
`&&(n+=`
|
|
192
|
-
`),t+=1,a=e[t+1];return n||(n=" "),{fold:n,offset:t}}const Q3={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
193
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Y3(e,t,n,a){const o=e.substr(t,n),u=o.length===n&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;if(isNaN(u)){const f=e.substr(t-2,n+2);return a(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${f}`),f}return String.fromCodePoint(u)}function BN(e,t,n,a){const{value:o,type:c,comment:u,range:f}=t.type==="block-scalar"?B3(e,t,a):H3(t,e.options.strict,a),m=n?e.directives.tagName(n.source,y=>a(n,"TAG_RESOLVE_FAILED",y)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[Ns]:m?p=J3(e.schema,o,m,n,a):t.type==="scalar"?p=X3(e,o,t,a):p=e.schema[Ns];let v;try{const y=p.resolve(o,b=>a(n??t,"TAG_RESOLVE_FAILED",b),e.options);v=gt(y)?y:new Le(y)}catch(y){const b=y instanceof Error?y.message:String(y);a(n??t,"TAG_RESOLVE_FAILED",b),v=new Le(o)}return v.range=f,v.source=o,c&&(v.type=c),m&&(v.tag=m),p.format&&(v.format=p.format),u&&(v.comment=u),v}function J3(e,t,n,a,o){if(n==="!")return e[Ns];const c=[];for(const f of e.tags)if(!f.collection&&f.tag===n)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[n];return u&&!u.collection?(e.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Ns])}function X3({atKey:e,directives:t,schema:n},a,o,c){const u=n.tags.find(f=>(f.default===!0||e&&f.default==="key")&&f.test?.test(a))||n[Ns];if(n.compat){const f=n.compat.find(m=>m.default&&m.test?.test(a))??n[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(o,"TAG_RESOLVE_FAILED",v,!0)}}return u}function W3(e,t,n){if(t){n??(n=t.length);for(let a=n-1;a>=0;--a){let o=t[a];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=t[++a];o?.type==="space";)e+=o.source.length,o=t[++a];break}}return e}const e$={composeNode:qN,composeEmptyNode:og};function qN(e,t,n,a){const o=e.atKey,{spaceBefore:c,comment:u,anchor:f,tag:m}=n;let p,v=!0;switch(t.type){case"alias":p=t$(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=BN(e,t,m,a),f&&(p.anchor=f.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":p=I3(e$,e,t,n,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=og(e,t.offset,void 0,null,n,a),v=!1}}return f&&p.anchor===""&&a(f,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!gt(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 og(e,t,n,a,{spaceBefore:o,comment:c,anchor:u,tag:f,end:m},p){const v={type:"scalar",offset:W3(t,n,a),indent:-1,source:""},y=BN(e,v,f,p);return u&&(y.anchor=u.source.substring(1),y.anchor===""&&p(u,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(y.spaceBefore=!0),c&&(y.comment=c,y.range[2]=m),y}function t$({options:e},{offset:t,source:n,end:a},o){const c=new Qp(n.substring(1));c.source===""&&o(t,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&o(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=t+n.length,f=jl(a,u,e.strict,o);return c.range=[t,u,f.offset],f.comment&&(c.comment=f.comment),c}function n$(e,t,{offset:n,start:a,value:o,end:c},u){const f=Object.assign({_directives:t},e),m=new bd(void 0,f),p={atKey:!1,atRoot:!0,directives:m.directives,options:m.options,schema:m.schema},v=Kr(a,{indicator:"doc-start",next:o??c?.[0],offset:n,onError:u,parentIndent:0,startOnNewline:!0});v.found&&(m.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!v.hasNewline&&u(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),m.contents=o?qN(p,o,v,u):og(p,v.end,a,null,v,u);const y=m.contents.range[2],b=jl(c,y,!1,u);return b.comment&&(m.comment=b.comment),m.range=[n,y,b.offset],m}function Yo(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:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function fS(e){let t="",n=!1,a=!1;for(let o=0;o<e.length;++o){const c=e[o];switch(c[0]){case"#":t+=(t===""?"":a?`
|
|
194
|
-
|
|
195
|
-
`:`
|
|
196
|
-
`)+(c.substring(1)||" "),n=!0,a=!1;break;case"%":e[o+1]?.[0]!=="#"&&(o+=1),n=!1;break;default:n||(a=!0),n=!1}}return{comment:t,afterEmptyLine:a}}class s${constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,a,o,c)=>{const u=Yo(n);c?this.warnings.push(new M3(u,a,o)):this.errors.push(new au(u,a,o))},this.directives=new fn({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:a,afterEmptyLine:o}=fS(this.prelude);if(a){const c=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
197
|
-
${a}`:a;else if(o||t.directives.docStart||!c)t.commentBefore=a;else if(Mt(c)&&!c.flow&&c.items.length>0){let u=c.items[0];Pt(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}}n?(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:fS(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,a=-1){for(const o of t)yield*this.next(o);yield*this.end(n,a)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,a,o)=>{const c=Yo(t);c[0]+=n,this.onError(c,"BAD_DIRECTIVE",a,o)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=n$(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,a=new au(Yo(t),"UNEXPECTED_TOKEN",n);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 au(Yo(t),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const n=jl(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
|
|
200
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new au(Yo(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-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),o=new bd(void 0,a);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,n,n],this.decorate(o,!1),yield o}}}const KN="\uFEFF",HN="",GN="",np="";function i$(e){switch(e){case KN:return"byte-order-mark";case HN:return"doc-mode";case GN:return"flow-error-end";case np: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 os(e){switch(e){case void 0:case" ":case`
|
|
203
|
-
`:case"\r":case" ":return!0;default:return!1}}const hS=new Set("0123456789ABCDEFabcdef"),a$=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ru=new Set(",[]{}"),r$=new Set(` ,[]{}
|
|
204
|
-
\r `),gm=e=>!e||r$.has(e);class o${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,n=!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=!n;let a=this.next??"stream";for(;a&&(n||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
205
|
-
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
206
|
-
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let a=0;for(;n===" ";)n=this.buffer[++a+t];if(n==="\r"){const o=this.buffer[a+t+1];if(o===`
|
|
207
|
-
`||!o&&!this.atEnd)return t+a+1}return n===`
|
|
208
|
-
`||a>=this.indentNext||!n&&!this.atEnd?t+a:-1}if(n==="-"||n==="."){const a=this.buffer.substr(t,3);if((a==="---"||a==="...")&&os(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]===KN&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,a=t.indexOf("#");for(;a!==-1;){const c=t[a-1];if(c===" "||c===" "){n=a-1;break}else a=t.indexOf("#",a+1)}for(;;){const c=t[n-1];if(c===" "||c===" ")n-=1;else break}const o=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield HN,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 n=this.peek(3);if((n==="---"||n==="...")&&os(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!os(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&os(n)){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 n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);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(gm),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,a=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=a=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&o[0]!=="#"||a===0&&(o.startsWith("---")||o.startsWith("..."))&&os(o[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield GN,yield*this.parseLineStart();let c=0;for(;o[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),o[c]){case void 0:return"flow";case"#":return yield*this.pushCount(o.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(gm),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||os(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 n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let c=0;for(;this.buffer[n-1-c]==="\\";)c+=1;if(c%2===0)break;n=this.buffer.indexOf('"',n+1)}const a=this.buffer.substring(0,n);let o=a.indexOf(`
|
|
210
|
-
`,this.pos);if(o!==-1){for(;o!==-1;){const c=this.continueScalar(o+1);if(c===-1)break;o=a.indexOf(`
|
|
211
|
-
`,c)}o!==-1&&(n=o-(a[o-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>os(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,a;e:for(let c=this.pos;a=this.buffer[c];++c)switch(a){case" ":n+=1;break;case`
|
|
212
|
-
`:t=c,n=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(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n: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 o=t+1;for(a=this.buffer[o];a===" ";)a=this.buffer[++o];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
215
|
-
`;)a=this.buffer[++o];t=o-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+n>f)t=c;else break}while(!0);return yield np,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,a=this.pos-1,o;for(;o=this.buffer[++a];)if(o===":"){const c=this.buffer[a+1];if(os(c)||t&&ru.has(c))break;n=a}else if(os(o)){let c=this.buffer[a+1];if(o==="\r"&&(c===`
|
|
217
|
-
`?(a+=1,o=`
|
|
218
|
-
`,c=this.buffer[a+1]):n=a),c==="#"||t&&ru.has(c))break;if(o===`
|
|
219
|
-
`){const u=this.continueScalar(a+1);if(u===-1)break;a=Math.max(a,u-2)}}else{if(t&&ru.has(o))break;n=a}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield np,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const a=this.buffer.slice(this.pos,t);return a?(yield a,this.pos+=a.length,a.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(gm))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(os(n)||t&&ru.has(n))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,n=this.buffer[t];for(;!os(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(a$.has(n))n=this.buffer[++t];else if(n==="%"&&hS.has(this.buffer[t+1])&&hS.has(this.buffer[t+2]))n=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 n=this.pos-1,a;do a=this.buffer[++n];while(a===" "||t&&a===" ");const o=n-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=n),o}*pushUntil(t){let n=this.pos,a=this.buffer[n];for(;!t(a);)a=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class l${constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,a=this.lineStarts.length;for(;n<a;){const c=n+a>>1;this.lineStarts[c]<t?n=c+1:a=c}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const o=this.lineStarts[n-1];return{line:n,col:t-o+1}}}}function _i(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function mS(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 FN(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 ou(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 zr(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 pS(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!_i(t.start,"explicit-key-ind")&&!_i(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,FN(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 c${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 o$,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(t,n))yield*this.next(a);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=i$(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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 n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const a=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in a?a.indent:0:n.type==="flow-collection"&&a.type==="document"&&(n.indent=0),n.type==="flow-collection"&&pS(n),a.type){case"document":a.value=n;break;case"block-scalar":a.props.push(n);break;case"block-map":{const o=a.items[a.items.length-1];if(o.value){a.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=n;else{Object.assign(o,{key:n,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=a.items[a.items.length-1];o.value?a.items.push({start:[],value:n}):o.value=n;break}case"flow-collection":{const o=a.items[a.items.length-1];!o||o.value?a.items.push({start:[],key:n,sep:[]}):o.sep?o.value=n:Object.assign(o,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const o=n.items[n.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&mS(o.start)===-1&&(n.indent===0||o.start.every(c=>c.type!=="comment"||c.indent<n.indent))&&(a.type==="document"?a.end=o.start:a.items.push({start:o.start}),n.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":{mS(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 n=this.startBlockValue(t);n?this.stack.push(n):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 n=ou(this.peek(2)),a=zr(n);let o;t.end?(o=t.end,o.push(this.sourceToken),delete t.end):o=[this.sourceToken];const c={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};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 n=this.source.indexOf(`
|
|
222
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
223
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const a="end"in n.value?n.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 n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,o=a&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&n.sep&&!n.value){const u=[];for(let f=0;f<n.sep.length;++f){const m=n.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=n.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(c.push(this.sourceToken),t.items.push({start:c}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.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(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_i(n.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(FN(n.key)&&!_i(n.sep,"newline")){const u=zr(n.start),f=n.key,m=n.sep;m.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:f,sep:m}]})}else c.length>0?n.sep=n.sep.concat(c,this.sourceToken):n.sep.push(this.sourceToken);else if(_i(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const u=zr(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:c,key:null,sep:[this.sourceToken]}):_i(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{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);o||n.value?(t.items.push({start:c,key:u,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(u):(Object.assign(n,{key:u,sep:[]}),this.onKeyLine=!0);return}default:{const u=this.startBlockValue(t);if(u){if(u.type==="block-seq"){if(!n.explicitKey&&n.sep&&!_i(n.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 n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const a="end"in n.value?n.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 n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const o=t.items[t.items.length-2]?.value?.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||_i(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.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 n=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":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:o,sep:[]}):n.sep?this.stack.push(o):Object.assign(n,{key:o,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 o=ou(a),c=zr(o);pS(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 n=this.source.indexOf(`
|
|
224
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
225
|
-
`,n)+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 n=ou(t),a=zr(n);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 n=ou(t),a=zr(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!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 u$(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new l$||null,prettyErrors:t}}function d$(e,t={}){const{lineCounter:n,prettyErrors:a}=u$(t),o=new c$(n?.addNewLine),c=new s$(t),u=Array.from(c.compose(o.parse(e)));if(a&&n)for(const f of u)f.errors.forEach(uS(e,n)),f.warnings.forEach(uS(e,n));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function f$({onApplied:e}){const[t,n]=w.useState(""),[a,o]=w.useState(!1),[c,u]=w.useState([]),[f,m]=w.useState([]),p=async()=>{if(!t.trim())return;o(!0),u([]),m([]);const v=d$(t),y=[],b=[];for(let x=0;x<v.length;x++){const N=v[x];if(N.errors.length>0){y.push(`Document ${x+1}: ${N.errors[0]?.message}`);continue}const S=N.toJSON();if(!(!S||typeof S!="object"))try{const C=await j2(S);b.push(`Applied "${C.displayName||C.name}" (revision ${C.configRevision})`)}catch(C){y.push(`Document ${x+1}: ${C instanceof Error?C.message:String(C)}`)}}u(b),m(y),o(!1),b.length>0&&(Ze({title:"YAML applied",detail:`Applied ${b.length} document${b.length===1?"":"s"} successfully.`,tone:y.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return r.jsxs("section",{className:"mt-8",children:[r.jsx("div",{className:"page-section-divider"}),r.jsx("div",{className:"section-head mt-6",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),r.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),r.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",r.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",r.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),r.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=>n(v.target.value)}),c.length>0&&r.jsx("ul",{className:"mt-2 space-y-1",children:c.map((v,y)=>r.jsx("li",{className:"text-emerald-400 text-sm",children:v},y))}),f.length>0&&r.jsx("ul",{className:"mt-2 space-y-1",children:f.map((v,y)=>r.jsx("li",{className:"text-rose-400 text-sm",children:v},y))}),r.jsx("div",{className:"mt-3",children:r.jsx(le,{type:"button",disabled:!t.trim()||a,onClick:p,children:a?"Applying...":"Apply"})})]})}function h$(){const{dashboard:e,isLoading:t,refetch:n}=La();if(!e||t)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-28"}),r.jsx("div",{className:"skeleton-text-sm w-40"})]}),r.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[r.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(E=>r.jsx("div",{className:"skeleton-text-sm w-16"},E))}),[1,2,3].map(E=>r.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[r.jsxs("div",{className:"flex-1 space-y-1",children:[r.jsx("div",{className:"skeleton-text w-28"}),r.jsx("div",{className:"skeleton-text-sm w-16"})]}),r.jsx("div",{className:"skeleton-text w-24"}),r.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),r.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),r.jsx("div",{className:"skeleton-text-sm w-8"})]},E))]})]});const a=e.projects,o=Bi(),[c,u]=w.useState(!1),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,b]=w.useState(""),[x,N]=w.useState("US"),[S,C]=w.useState("en"),[k,A]=w.useState(!1),[T,z]=w.useState(null),M=f.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),$=async()=>{if(!(!M||!y)){A(!0),z(null);try{const E=await Qu(M,{displayName:p||f,canonicalDomain:y,country:x,language:S});Ze({title:"Project created",detail:`${E.displayName||E.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${E.name}`,dedupeMode:"drop"}),n(),m(""),v(""),b(""),N("US"),C("en"),u(!1),o({to:"/projects/$projectId",params:{projectId:E.id}})}catch(E){z(E instanceof Error?E.message:"Failed to create project")}finally{A(!1)}}};return r.jsxs("div",{className:"page-container",children:[r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Projects"}),r.jsxs("p",{className:"page-subtitle",children:[a.length," project",a.length!==1?"s":""," tracked"]})]}),r.jsx("div",{className:"page-header-right",children:r.jsxs(le,{type:"button",onClick:()=>u(E=>!E),children:[r.jsx(ex,{className:"size-4 mr-1.5"}),"Add project"]})})]}),c?r.jsxs(Me,{className:"surface-card mb-6",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),r.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),r.jsxs("div",{className:"compact-stack mt-4",children:[r.jsxs("div",{className:"setup-field-row",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),r.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:f,onChange:E=>m(E.target.value)}),M&&M!==f?r.jsxs("p",{className:"supporting-copy",children:["Slug: ",M]}):null]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),r.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:p,onChange:E=>v(E.target.value)})]})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),r.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:y,onChange:E=>b(E.target.value)})]}),r.jsxs("div",{className:"setup-field-row",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),r.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:x,onChange:E=>N(E.target.value.toUpperCase())})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),r.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:S,onChange:E=>C(E.target.value.toLowerCase())})]})]})]}),T?r.jsx("p",{className:"text-rose-400 text-sm mt-3",children:T}):null,r.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[r.jsx(le,{type:"button",disabled:!M||!y||k,onClick:$,children:k?"Creating...":"Create project"}),r.jsx(le,{type:"button",variant:"ghost",onClick:()=>u(!1),children:"Cancel"})]})]}):null,a.length>0?r.jsx("div",{className:"data-table-wrapper",children:r.jsxs("table",{className:"data-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Name"}),r.jsx("th",{children:"Domain"}),r.jsx("th",{children:"Visibility"}),r.jsx("th",{children:"Last run"}),r.jsx("th",{className:"text-right",children:"Country"})]})}),r.jsx("tbody",{children:a.map(E=>{const O=E.recentRuns[0];return r.jsxs("tr",{className:"cursor-pointer",onClick:()=>o({to:"/projects/$projectId",params:{projectId:E.project.id}}),children:[r.jsxs("td",{children:[r.jsx(St,{to:"/projects/$projectId",params:{projectId:E.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:K=>K.stopPropagation(),children:E.project.displayName||E.project.name}),r.jsx("p",{className:"text-[11px] text-zinc-500",children:E.project.name})]}),r.jsx("td",{className:"text-zinc-400",children:E.project.canonicalDomain}),r.jsx("td",{children:r.jsx(lt,{tone:E.visibilitySummary.tone,children:E.visibilitySummary.value})}),r.jsx("td",{className:"text-zinc-500 text-sm",children:O?r.jsx(td,{status:O.status}):r.jsx("span",{className:"text-zinc-600",children:"No runs"})}),r.jsx("td",{className:"text-right text-zinc-500",children:E.project.country})]},E.project.id)})})]})}):c?null:r.jsxs(Me,{className:"surface-card empty-card",children:[r.jsx("h3",{children:"No projects yet"}),r.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),r.jsxs(le,{type:"button",onClick:()=>u(!0),children:[r.jsx(ex,{className:"size-4 mr-1.5"}),"Add project"]})]}),r.jsx(f$,{onApplied:()=>{n()}})]})}function sp({state:e}){return r.jsx(lt,{tone:YT(e),children:Xu(e)})}function ZN({run:e}){const{openRun:t}=Zr();return r.jsxs("article",{className:"run-row",children:[r.jsxs("div",{className:"run-row-main",children:[r.jsxs("div",{className:"run-row-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:e.summary}),r.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),r.jsx(td,{status:e.status})]}),r.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),r.jsxs("dl",{className:"run-row-meta",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Started"}),r.jsx("dd",{children:e.startedAt})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Duration"}),r.jsx("dd",{children:e.duration})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Trigger"}),r.jsx("dd",{children:e.triggerLabel})]})]}),r.jsx(le,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function VN({value:e,label:t,delta:n,tone:a,description:o,tooltip:c,isNumeric:u=!0,progress:f}){const v=2*Math.PI*48,y=Number.parseInt(e,10),b=typeof f=="number"&&Number.isFinite(f)?Math.min(Math.max(f,0),1):u&&!Number.isNaN(y)?Math.min(y/100,1):.5,x=v*(1-b);return r.jsxs("div",{className:"score-gauge",children:[r.jsxs("div",{className:"gauge-ring-wrapper",children:[r.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[r.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),r.jsx("circle",{className:`gauge-fill gauge-fill-${a}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:v,strokeDashoffset:x,transform:"rotate(-90 60 60)"})]}),r.jsx("div",{className:"gauge-center",children:r.jsx("span",{className:u?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),r.jsxs("p",{className:"gauge-label",children:[t,c&&r.jsx(hn,{text:c})]}),r.jsx("p",{className:"gauge-delta",children:n}),r.jsx("p",{className:"gauge-description",children:o})]})}function gS({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return r.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"},o=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),c=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return r.jsxs("div",{className:"flex items-center gap-1",children:[r.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:o}),r.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((u,f)=>r.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${a[u.citationState]??"bg-zinc-700"} ${u.model&&f>0&&n[f-1]?.model&&n[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&&n[f-1]?.model&&n[f-1].model!==u.model?"model changed":null].filter(Boolean).join(" — ")},f))}),r.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:c})]})}function m$(e){const t=new Map;for(const a of e)for(const o of a.runHistory){const c=t.get(o.createdAt);c?c.states.push(o.citationState):t.set(o.createdAt,{states:[o.citationState],runId:o.runId})}return[...t.entries()].sort(([a],[o])=>a.localeCompare(o)).map(([a,{states:o,runId:c}])=>({runId:c,createdAt:a,citationState:o.includes("cited")?"cited":o.includes("emerging")?"emerging":"not-cited"}))}function p$({evidence:e}){const{openEvidence:t}=Zr(),[n,a]=w.useState(new Set),o=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 r.jsx("div",{className:"evidence-table-wrap",children:r.jsxs("table",{className:"evidence-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{style:{width:"2rem"}}),r.jsx("th",{children:"Key Phrase"}),r.jsx("th",{children:"Status"}),r.jsx("th",{children:"Citation History"}),r.jsx("th",{children:"Change"}),r.jsx("th",{})]})}),r.jsx("tbody",{children:o.map(({phrase:u,items:f})=>{const m=n.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=m$(f),b=f.filter(N=>N.citationState==="cited"||N.citationState==="emerging").length,x=(()=>{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 r.jsxs(w.Fragment,{children:[r.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(u),"aria-expanded":m,children:[r.jsx("td",{children:r.jsx(Yu,{size:14,className:`transition-transform duration-150 text-zinc-500 ${m?"rotate-90":""}`})}),r.jsx("td",{className:"evidence-keyword-cell",children:r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-zinc-100",children:u}),r.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:f.map(N=>r.jsx(ll,{provider:N.provider},N.id))})]})}),r.jsx("td",{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(sp,{state:v}),r.jsxs("span",{className:"text-[11px] text-zinc-500",children:[b,"/",f.length]})]})}),r.jsx("td",{children:r.jsx(gS,{history:y})}),r.jsx("td",{className:"evidence-change-cell",children:x}),r.jsx("td",{})]}),m&&f.map(N=>r.jsxs("tr",{className:"bg-zinc-900/30",children:[r.jsx("td",{}),r.jsx("td",{className:"evidence-keyword-cell pl-5",children:r.jsx(ll,{provider:N.provider})}),r.jsx("td",{children:r.jsx(sp,{state:N.citationState})}),r.jsx("td",{children:r.jsx(gS,{history:N.runHistory})}),r.jsx("td",{className:"evidence-change-cell",children:N.changeLabel}),r.jsx("td",{children:r.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:S=>{S.stopPropagation(),t(N.id)},children:"View"})})]},N.id))]},u)})})]})})}function g$({competitors:e}){return e.length===0?r.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):r.jsx("div",{className:"competitor-table-wrap",children:r.jsxs("table",{className:"competitor-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Domain"}),r.jsx("th",{children:"Pressure"}),r.jsx("th",{children:"Citations"}),r.jsx("th",{children:"Key Phrases"})]})}),r.jsx("tbody",{children:e.map(t=>r.jsxs("tr",{children:[r.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),r.jsx("td",{children:r.jsx(lt,{tone:JT(t.pressureLabel),children:t.pressureLabel})}),r.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalKeywords>0?`${t.citationCount} / ${t.totalKeywords}`:"—"}),r.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedKeywords.length>0?t.citedKeywords.join(", "):"Not cited"})]},t.id))})]})})}const y$=["7d","30d","90d","all"],v$=["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 b$({projectName:e}){const[t,n]=w.useState("30d"),[a,o]=w.useState(null),[c,u]=w.useState(null),[f,m]=w.useState(null),[p,v]=w.useState(null),[y,b]=w.useState(!0);return w.useEffect(()=>{let x=!1;return b(!0),Promise.all([H2(e,t),G2(e,t),F2(e,t)]).then(([N,S,C])=>{x||(o(N),u(S),m(C),b(!1))}).catch(()=>{x||b(!1)}),()=>{x=!0}},[e,t]),y&&!a?r.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading analytics…"}):r.jsxs(r.Fragment,{children:[r.jsxs("section",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Citation Metrics"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Citation Rate Trends ",r.jsx(hn,{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."})]})]}),r.jsx("div",{className:"flex gap-1",children:y$.map(x=>r.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${t===x?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>n(x),children:x==="all"?"All":x},x))})]}),a&&r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-6",children:[r.jsx(VN,{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}),r.jsxs("div",{className:"flex-1 space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-xs text-zinc-500",children:"Trend"}),r.jsx(lt,{tone:a.trend==="improving"?"positive":a.trend==="declining"?"negative":"neutral",children:a.trend})]}),Object.keys(a.byProvider).length>0&&r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx("th",{className:"text-left py-1 font-medium",children:"Provider"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Rate"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Cited / Total"})]})}),r.jsx("tbody",{children:Object.entries(a.byProvider).map(([x,N])=>r.jsxs("tr",{className:"border-t border-zinc-800/40",children:[r.jsx("td",{className:"py-1.5 text-zinc-300",children:x}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-200",children:[(N.citationRate*100).toFixed(1),"%"]}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[N.cited," / ",N.total]})]},x))})]})]})]}),a.buckets.length>=1&&r.jsx(x$,{buckets:a.buckets,keywordChanges:a.keywordChanges??[]})]})]}),r.jsx("div",{className:"page-section-divider"}),r.jsxs("section",{children:[r.jsx("div",{className:"flex items-center justify-between mb-4",children:r.jsxs("div",{children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Opportunity Analysis"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Brand Gap Analysis ",r.jsx(hn,{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&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex gap-1 mb-4",children:v$.map(x=>{const N=x==="cited"?c.cited.length:x==="gap"?c.gap.length:c.uncited.length,S=p===x;return r.jsxs("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${S?x==="gap"?"bg-amber-900/40 border-amber-700/60 text-amber-300":x==="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:x),children:[x==="gap"?"Gap":x==="cited"?"Cited":"Not Cited"," (",N,")"]},x)})}),r.jsx(S$,{gaps:c,filter:p})]})]}),r.jsx("div",{className:"page-section-divider"}),r.jsxs("section",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Source Intelligence"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Source Origin Breakdown ",r.jsx(hn,{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&&r.jsxs("div",{className:"space-y-4",children:[r.jsx(j$,{categories:f.overall}),r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx("th",{className:"text-left py-1 font-medium",children:"Category"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Count"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"%"}),r.jsx("th",{className:"text-left py-1 pl-4 font-medium",children:"Top Sources"})]})}),r.jsx("tbody",{children:f.overall.map(x=>r.jsxs("tr",{className:"border-t border-zinc-800/40",children:[r.jsxs("td",{className:"py-1.5 text-zinc-300 flex items-center gap-2",children:[r.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${QN[x.category]??"bg-zinc-600"}`}),x.label]}),r.jsx("td",{className:"py-1.5 text-right text-zinc-200",children:x.count}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-400",children:[(x.percentage*100).toFixed(1),"%"]}),r.jsx("td",{className:"py-1.5 pl-4 text-zinc-500 text-xs truncate max-w-[200px]",children:x.topDomains.slice(0,3).map(N=>N.domain).join(", ")})]},x.category))})]})]}),f&&f.overall.length===0&&r.jsx("p",{className:"text-sm text-zinc-500 py-4",children:"No source data available. Run a visibility sweep first."})]})]})}function x$({buckets:e,keywordChanges:t}){const[n,a]=w.useState(null),o=600,c=140,u={top:30,right:10,bottom:20,left:40},f=o-u.left-u.right,m=c-u.top-u.bottom,p=1,v=e.map((x,N)=>{const S=u.left+(e.length>1?N/(e.length-1)*f:f/2),C=u.top+m-x.citationRate/p*m;return{x:S,y:C}}),y=w.useMemo(()=>{if(!t||t.length===0||e.length<2)return[];const x=new Date(e[0].startDate).getTime(),S=new Date(e[e.length-1].startDate).getTime()-x;return S<=0?[]:t.map(C=>{const A=(new Date(C.date).getTime()-x)/S;return A<0||A>1?null:{...C,x:u.left+A*f}}).filter(C=>C!==null)},[e,t,u.left,f]),b=v.map(x=>`${x.x},${x.y}`).join(" ");return r.jsxs("div",{className:"surface-card rounded-lg p-3 border border-zinc-800/60",children:[r.jsx("p",{className:"text-[10px] text-zinc-500 mb-1 flex items-center gap-1",children:"kp = key phrases tracked in this window"}),r.jsxs("svg",{viewBox:`0 0 ${o} ${c}`,className:"w-full h-auto","aria-label":"Citation rate trend chart",onMouseLeave:()=>a(null),children:[r.jsxs("text",{x:u.left-4,y:u.top+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:[(p*100).toFixed(0),"%"]}),r.jsx("text",{x:u.left-4,y:u.top+m+4,textAnchor:"end",className:"fill-zinc-500",fontSize:"9",children:"0%"}),r.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"}),r.jsx("polyline",{fill:"none",stroke:"currentColor",className:"text-emerald-500",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",points:b}),y.map((x,N)=>r.jsxs("g",{children:[r.jsx("line",{x1:x.x,y1:u.top,x2:x.x,y2:u.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"4 2"}),r.jsx("text",{x:x.x,y:u.top-6,textAnchor:"middle",className:"fill-zinc-500",fontSize:"7",fontWeight:"500",children:x.label})]},`kw-change-${N}`)),n!==null&&r.jsx("line",{x1:v[n].x,y1:u.top,x2:v[n].x,y2:u.top+m,stroke:"currentColor",className:"text-zinc-600",strokeWidth:"0.5",strokeDasharray:"3 2"}),e.map((x,N)=>{const{x:S,y:C}=v[N],k=n===N;return r.jsxs("g",{children:[r.jsx("circle",{cx:S,cy:C,r:"10",fill:"transparent",onMouseEnter:()=>a(N),style:{cursor:"pointer"}}),r.jsx("circle",{cx:S,cy:C,r:k?5:3,className:k?"fill-emerald-400":"fill-emerald-500"})]},N)}),n!==null&&(()=>{const x=e[n],{x:N,y:S}=v[n],C=`${(x.citationRate*100).toFixed(1)}%`,k=x.keywordCount?`${x.keywordCount} kp`:"",A=56,T=30,z=Math.max(u.left,Math.min(N-A/2,o-u.right-A)),M=S-T-8;return r.jsxs("g",{children:[r.jsx("rect",{x:z,y:M,width:A,height:T,rx:"4",className:"fill-zinc-800",stroke:"currentColor",strokeWidth:"0.5"}),r.jsx("text",{x:z+A/2,y:M+13,textAnchor:"middle",className:"fill-zinc-50",fontSize:"11",fontWeight:"600",children:C}),k&&r.jsx("text",{x:z+A/2,y:M+24,textAnchor:"middle",className:"fill-zinc-400",fontSize:"8",children:k})]})})(),e.map((x,N)=>({b:x,i:N})).filter(({i:x})=>x===0||x===e.length-1||e.length<=7).map(({b:x,i:N})=>{const S=v[N].x;return r.jsx("text",{x:S,y:c-2,textAnchor:"middle",className:"fill-zinc-500",fontSize:"8",children:x.startDate.slice(5,10)},N)})]})]})}function S$({gaps:e,filter:t}){const n=w.useMemo(()=>{const a=[...e.gap.map(o=>({...o,_sort:0})),...e.cited.map(o=>({...o,_sort:1})),...e.uncited.map(o=>({...o,_sort:2}))];return t?a.filter(o=>o.category===t):a.sort((o,c)=>o._sort-c._sort)},[e,t]);return n.length===0?r.jsxs("p",{className:"text-sm text-zinc-500 py-4",children:["No key phrases found",t?` with status "${t}"`:"","."]}):r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx("th",{className:"text-left py-1 font-medium",children:"Keyword"}),r.jsx("th",{className:"text-left py-1 font-medium",children:"Status"}),r.jsx("th",{className:"text-left py-1 font-medium",children:"Providers Citing"}),r.jsx("th",{className:"text-left py-1 font-medium",children:"Competitors Citing"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Consistency"})]})}),r.jsx("tbody",{children:n.map(a=>{const o=a.category==="cited"?"positive":a.category==="gap"?"caution":"neutral";return r.jsxs("tr",{className:`border-t border-zinc-800/40 ${a.category==="gap"?"border-l-2 border-l-amber-600/60":""}`,children:[r.jsx("td",{className:"py-1.5 text-zinc-200",children:a.keyword}),r.jsx("td",{className:"py-1.5",children:r.jsx(lt,{tone:o,children:a.category==="gap"?"Gap":a.category==="cited"?"Cited":"Not Cited"})}),r.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.providers.length>0?a.providers.join(", "):"—"}),r.jsx("td",{className:"py-1.5 text-zinc-400 text-xs",children:a.competitorsCiting.length>0?a.competitorsCiting.join(", "):"—"}),r.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 j$({categories:e}){const t=e.reduce((n,a)=>n+a.count,0);return t===0?null:r.jsx("div",{className:"flex rounded-full overflow-hidden h-3 bg-zinc-800","aria-label":"Source category distribution",children:e.map(n=>{const a=n.count/t*100;return a<.5?null:r.jsx("div",{className:`${QN[n.category]??"bg-zinc-600"} transition-all`,style:{width:`${a}%`},title:`${n.label}: ${(n.percentage*100).toFixed(1)}%`},n.category)})})}function lu(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function w$(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const a=Math.floor(n/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function N$({projectName:e}){const[t,n]=w.useState(null),[a,o]=w.useState(null),[c,u]=w.useState(!0),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,b]=w.useState(null),[x,N]=w.useState(null),[S,C]=w.useState("sessions"),[k,A]=w.useState("desc"),[T,z]=w.useState("sessions"),[M,$]=w.useState("desc");function E(he){u(!0),Qb(e).then(P=>{if(!he.current)return n(P),P.connected?Yb(e):null}).then(P=>{he.current||(o(P??null),u(!1))}).catch(P=>{he.current||(b(P instanceof Error?P.message:"Failed to load GA4 data"),u(!1))})}w.useEffect(()=>{const he={current:!1};return E(he),()=>{he.current=!0}},[e]);async function O(){m(!0),b(null),N(null);try{const he=await hj(e);N(`Synced ${he.rowCount.toLocaleString()} page rows and ${he.aiReferralCount.toLocaleString()} AI referral rows (${he.days} days)`);const P=await Yb(e);o(P);const R=await Qb(e);n(R)}catch(he){b(he instanceof Error?he.message:"Sync failed")}finally{m(!1)}}async function K(){v(!0),b(null),N(null);try{await V2(e),n({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),o(null),N("GA4 disconnected")}catch(he){b(he instanceof Error?he.message:"Disconnect failed")}finally{v(!1)}}function W(he){S===he?A(P=>P==="desc"?"asc":"desc"):(C(he),A("desc"))}function J(he){T===he?$(P=>P==="desc"?"asc":"desc"):(z(he),$("desc"))}const ne=w.useMemo(()=>a?.topPages?[...a.topPages].sort((he,P)=>{const R=he[S],B=P[S];return typeof R=="string"&&typeof B=="string"?k==="asc"?R.localeCompare(B):B.localeCompare(R):k==="asc"?R-B:B-R}):[],[a?.topPages,S,k]),fe=w.useMemo(()=>a?.aiReferrals?[...a.aiReferrals].sort((he,P)=>{const R=he[T],B=P[T];return typeof R=="string"&&typeof B=="string"?M==="asc"?R.localeCompare(B):B.localeCompare(R):M==="asc"?R-B:B-R}):[],[a?.aiReferrals,T,M]);if(c&&!t)return r.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!t?.connected)return r.jsx(C$,{projectName:e,onConnected:()=>E({current:!1})});const Ee=a&&a.totalSessions>0?Math.round(a.totalOrganicSessions/a.totalSessions*100):0,xe=a?.aiReferrals.reduce((he,P)=>he+P.sessions,0)??0,H=a&&a.totalSessions>0?Math.round(xe/a.totalSessions*100):0,ae=a?new Set(a.aiReferrals.map(he=>he.source.toLowerCase())).size:0,pe=fe[0]??null;return r.jsxs(r.Fragment,{children:[y&&r.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}),x&&r.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:x}),r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),r.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",r.jsx("span",{className:"text-zinc-300",children:t.propertyId}),t.clientEmail&&r.jsxs(r.Fragment,{children:[" · ",r.jsx("span",{className:"text-zinc-500",children:t.clientEmail})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs(le,{variant:"outline",size:"sm",disabled:f,onClick:O,children:[r.jsx(tx,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),f?"Syncing…":"Sync"]}),r.jsxs(le,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:K,children:[r.jsx(LE,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),r.jsxs("section",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",r.jsx(hn,{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?r.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[r.jsx(ym,{value:lu(a.totalSessions),label:"Total Sessions",subtitle:a.totalSessions.toLocaleString(),tone:"neutral"}),r.jsx(ym,{value:lu(a.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Ee}% of total`,tone:"positive"}),r.jsx(ym,{value:lu(a.totalUsers),label:"Total Users",subtitle:a.totalUsers.toLocaleString(),tone:"neutral"})]}):r.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[r.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),r.jsxs(le,{variant:"outline",size:"sm",disabled:f,onClick:O,children:[r.jsx(tx,{className:`w-3.5 h-3.5 mr-1.5 ${f?"animate-spin":""}`}),"Sync from GA4"]})]})]}),a&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"page-section-divider"}),r.jsxs("section",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"AI Attribution"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["AI Referral Sources",r.jsx(hn,{text:"Counts explicit AI referrers detected in GA4 sessionSource values, such as ChatGPT, Claude, Gemini, Perplexity, OpenAI, and Copilot. Generic search-engine sources like plain Bing are intentionally excluded to avoid false positives."})]})]}),r.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[r.jsxs(Me,{className:"surface-card p-5",children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),r.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Attributable AI visits"})]}),a.aiReferrals.length>0?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[r.jsx(vm,{label:"AI Sessions",value:lu(xe),hint:`${xe.toLocaleString()} sessions`,tone:"positive"}),r.jsx(vm,{label:"Share of Traffic",value:`${H}%`,hint:"of total sessions",tone:"neutral"}),r.jsx(vm,{label:"Tracked Sources",value:String(ae),hint:`${a.aiReferrals.length} source rows`,tone:"neutral"})]}),r.jsx("div",{className:"mt-4 rounded-lg border border-emerald-800/40 bg-emerald-500/6 px-4 py-3 text-sm text-emerald-100",children:pe?`Top explicit AI referrer: ${pe.source} via ${pe.medium}, accounting for ${pe.sessions.toLocaleString()} sessions in the current sync window.`:"Explicit AI referrers detected in the current sync window."})]}):r.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-500/6 px-4 py-4 text-sm text-amber-100",children:"No explicit AI referrers were detected in the current sync window. This view intentionally favors precision over broad matching, so unattributed traffic hidden inside generic search sources is excluded."})]}),r.jsxs(Me,{className:"surface-card p-5",children:[r.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),r.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),r.jsx("p",{className:"text-xs text-zinc-500",children:a.aiReferrals.length>0?`${a.aiReferrals.length} rows`:"No source rows"})]}),a.aiReferrals.length>0?r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx(Ci,{label:"Source",sortKey:"source",current:T,dir:M,onSort:J,align:"left"}),r.jsx(Ci,{label:"Medium",sortKey:"medium",current:T,dir:M,onSort:J,align:"left"}),r.jsx(Ci,{label:"Sessions",sortKey:"sessions",current:T,dir:M,onSort:J,align:"right"}),r.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),r.jsx(Ci,{label:"Users",sortKey:"users",current:T,dir:M,onSort:J,align:"right"})]})}),r.jsx("tbody",{children:fe.map(he=>r.jsx(z$,{referral:he,totalSessions:xe},`${he.source}:${he.medium}`))})]})}):r.jsx("div",{className:"rounded-lg border border-dashed border-zinc-800/60 bg-zinc-950/40 px-4 py-6 text-sm text-zinc-500",children:"Connect GA4 and sync traffic to monitor explicit AI referral sources here."})]})]})]})]}),a&&a.topPages.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"page-section-divider"}),r.jsxs("section",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),r.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",r.jsx(hn,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[r.jsx(Ci,{label:"Landing Page",sortKey:"landingPage",current:S,dir:k,onSort:W,align:"left"}),r.jsx(Ci,{label:"Sessions",sortKey:"sessions",current:S,dir:k,onSort:W,align:"right"}),r.jsx(Ci,{label:"Organic",sortKey:"organicSessions",current:S,dir:k,onSort:W,align:"right"}),r.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),r.jsx(Ci,{label:"Users",sortKey:"users",current:S,dir:k,onSort:W,align:"right"})]})}),r.jsx("tbody",{children:ne.map(he=>r.jsx(k$,{page:he},he.landingPage))})]})})]})]}),r.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[r.jsx("span",{children:a?.lastSyncedAt?`Last synced ${w$(a.lastSyncedAt)}`:"Never synced"}),r.jsx("span",{children:a?`${a.topPages.length} pages · ${a.aiReferrals.length} AI rows`:""})]})]})}function C$({projectName:e,onConnected:t}){const[n,a]=w.useState(""),[o,c]=w.useState(null),[u,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(null),b=w.useRef(null),x=w.useCallback(S=>{const C=S.target.files?.[0];if(!C)return;y(null),c(C.name);const k=new FileReader;k.onload=()=>{const A=k.result;try{const T=JSON.parse(A);if(!T.client_email||!T.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(A)}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),!n.trim()){y("Property ID is required.");return}if(!u){y("Please upload a service account key file.");return}p(!0);try{await Z2(e,{propertyId:n.trim(),keyJson:u});try{await hj(e)}catch{}t()}catch(S){y(S instanceof Error?S.message:"Failed to connect GA4")}finally{p(!1)}}return r.jsxs(Me,{className:"surface-card p-6",children:[r.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),r.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&&r.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}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),r.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,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"}),r.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)."})]}),r.jsxs("div",{className:"mb-5",children:[r.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),r.jsx("input",{ref:b,type:"file",accept:".json,application/json",onChange:x,className:"hidden"}),r.jsxs("button",{type:"button",onClick:()=>b.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:[r.jsx(ME,{className:"w-4 h-4 shrink-0"}),o?r.jsx("span",{className:"text-zinc-200 truncate",children:o}):r.jsx("span",{children:"Upload .json key file"})]}),r.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 ",r.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),r.jsx(le,{variant:"default",size:"sm",disabled:m||!n.trim()||!u,onClick:N,children:m?"Connecting & syncing…":"Connect GA4"})]})}function Ci({label:e,sortKey:t,current:n,dir:a,onSort:o,align:c}){const u=n===t;return r.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${c==="right"?"text-right":"text-left"}`,onClick:()=>o(t),children:[e,u&&r.jsx("span",{className:"ml-0.5",children:a==="asc"?"↑":"↓"})]})}const YN={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function ym({value:e,label:t,subtitle:n,tone:a}){return r.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),r.jsx("p",{className:`text-2xl font-bold tabular-nums ${YN[a]}`,children:e}),r.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function vm({value:e,label:t,hint:n,tone:a}){return r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3",children:[r.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),r.jsx("p",{className:`text-xl font-semibold tabular-nums ${YN[a]}`,children:e}),r.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function k$({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return r.jsxs("tr",{className:"border-t border-zinc-800/40",children:[r.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),r.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),r.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),r.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function z$({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0";return r.jsxs("tr",{className:"border-t border-zinc-800/40",children:[r.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),r.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),r.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),r.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),r.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function wl(e){e.invalidateQueries({queryKey:Qn.runs.all}),e.invalidateQueries({queryKey:Qn.projects.all})}function _$(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function E$(e,t){const n=e??"Project";return t==="gsc-sync"?`${n} will refresh after the sync completes.`:t==="inspect-sitemap"?`${n} will notify you when sitemap inspection finishes.`:`${n} will notify you when the run finishes.`}function xd(e,t){vj({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),Ze({title:_$(e.kind),detail:E$(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function T$(e){const t=e.filter(o=>o.status!=="conflict"),n=e.filter(o=>o.status==="conflict");if(t.length===0){Ze({title:"No runs queued",detail:n.length>0?`${n.length} project${n.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 o of t)vj({id:o.id,projectId:o.projectId,kind:o.kind,projectLabel:o.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const a=FE({runIds:t.map(o=>o.id),queuedCount:t.length,skippedCount:n.length});Ze({title:"Run-all batch queued",detail:n.length>0?`${t.length} project${t.length===1?"":"s"} queued, ${n.length} skipped because a run is already active.`:`${t.length} project${t.length===1?"":"s"} queued.`,tone:n.length>0?"caution":"neutral",dedupeKey:`batch:${a}`,dedupeMode:"replace"})}function Sd(e,t){if(e instanceof Eu&&e.code==="RUN_IN_PROGRESS"){Ze({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}Ze({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function JN(){const e=Ui();return gl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>i2(t,n),onSuccess:(t,n)=>{wl(e),xd(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Sd(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function A$(){const e=Ui();return gl({meta:{skipGlobalErrorToast:!0},mutationFn:t=>w2(t),onSuccess:t=>{wl(e),T$(t)},onError:t=>{Ze({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function R$(){const e=Ui();return gl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>cj(t,n),onSuccess:(t,n)=>{wl(e),xd(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Sd(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function O$(){const e=Ui();return gl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>M2(t),onSuccess:(t,n)=>{wl(e),xd(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Sd(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function L$(){const e=Ui();return gl({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>L2(t,n),onSuccess:(t,n)=>{wl(e),xd(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Sd(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}function D$({projectName:e}){const[t,n]=w.useState(!1),[a,o]=w.useState([]),[c,u]=w.useState([]),[f,m]=w.useState([]),[p,v]=w.useState([]),[y,b]=w.useState([]),[x,N]=w.useState(null),[S,C]=w.useState(""),[k,A]=w.useState(""),[T,z]=w.useState("30"),[M,$]=w.useState(!1),[E,O]=w.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[K,W]=w.useState(""),[J,ne]=w.useState(!0),[fe,Ee]=w.useState(!1),[xe,H]=w.useState(!1),[ae,pe]=w.useState(!1),[he,P]=w.useState(!1),[R,B]=w.useState(!1),[re,Z]=w.useState(!1),[V,se]=w.useState(null),[ge,je]=w.useState(!1),[de,Ae]=w.useState(!1),[Re,ce]=w.useState(null),[Pe,Ve]=w.useState(""),[Vt,Ut]=w.useState(!1),[Mn,nn]=w.useState(!1),[Tt,oe]=w.useState("indexed"),[Qe,ut]=w.useState([]),[Qt,Ye]=w.useState(null),[Ue,Xe]=w.useState(!1),[Ct,He]=w.useState(null),[Ma,gn]=w.useState(null),st=a.find(I=>I.connectionType==="gsc"),Xr=f.length>0||p.length>0||y.length>0,ns=R$(),mt=O$(),yn=L$();async function ue(I){if(!I){u([]),C("");return}H(!0);try{const{sites:me}=await k2(e);u(me),C(I.propertyId??me[0]?.siteUrl??"")}catch(me){u([]),He(me instanceof Error?me.message:"Failed to load Search Console properties")}finally{H(!1)}}async function zn(){P(!0);try{const I=await E2(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([]),He(I instanceof Error?I.message:"Failed to load GSC performance data")}finally{P(!1)}}async function $a(){B(!0);try{const[I,me]=await Promise.all([A2(e,{url:K.trim()||void 0,limit:20}),R2(e)]);v(I),b(me)}catch(I){v([]),b([]),He(I instanceof Error?I.message:"Failed to load GSC inspection history")}finally{B(!1)}}async function Cl(){je(!0);try{const[I,me]=await Promise.all([kp(e),O2(e).catch(()=>[])]);se(I),ut(me)}catch(I){se(null),ut([]),He(I instanceof Error?I.message:"Failed to load coverage data")}finally{je(!1)}}async function Gi(I){Xe(!0),He(null);try{const me=await Zb(e,{urls:I}),{succeeded:bt,failed:Gt,total:ln}=me.summary;Ze({title:"Indexing requested",detail:Gt===0?`${bt} URL${bt!==1?"s":""} submitted for indexing.`:`${bt}/${ln} submitted successfully, ${Gt} failed.`,tone:Gt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(me){He(me instanceof Error?me.message:"Failed to request indexing")}finally{Xe(!1)}}async function Pa(){Xe(!0),He(null);try{const I=await Zb(e,{urls:[],allUnindexed:!0}),{succeeded:me,failed:bt,total:Gt}=I.summary;Ze({title:"Indexing requested",detail:bt===0?`${me} unindexed URL${me!==1?"s":""} submitted for indexing.`:`${me}/${Gt} submitted successfully, ${bt} failed.`,tone:bt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(I){He(I instanceof Error?I.message:"Failed to request indexing")}finally{Xe(!1)}}async function Cs(){if(Pe.trim()){Ut(!0),He(null);try{await _2(e,"gsc",Pe.trim()),o(I=>I.map(me=>me.connectionType==="gsc"?{...me,sitemapUrl:Pe.trim()}:me)),Ze({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ve("")}catch(I){He(I instanceof Error?I.message:"Failed to save sitemap URL")}finally{Ut(!1)}}}async function ms(){He(null);try{const I=await mt.mutateAsync({projectName:e,projectLabel:e});ce(I.sitemaps),o(me=>me.map(bt=>bt.connectionType==="gsc"?{...bt,sitemapUrl:I.primarySitemapUrl}:bt))}catch{}}async function Ua(){Ae(!0),He(null);try{const I=await D2(e);ce(I.sitemaps),I.sitemaps.length===0&&gn("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(I){He(I instanceof Error?I.message:"Failed to list sitemaps")}finally{Ae(!1)}}async function Ys(){ne(!0),He(null);try{const[I,me]=await Promise.all([Cp().catch(()=>null),lj(e).catch(()=>[])]);n(!!I?.google?.configured),o(me);const bt=me.find(Gt=>Gt.connectionType==="gsc");await Promise.all([ue(bt),zn(),$a(),Cl()])}finally{ne(!1)}}w.useEffect(()=>{Ys()},[e]);async function wd(){if(!t){He("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}Ee(!0),He(null),gn(null);try{const{authUrl:I}=await N2(e,"gsc");if(!I.startsWith("https://accounts.google.com/")){He("Unexpected OAuth redirect URL. Please try again.");return}const me=window.open(I,"_blank","width=600,height=700");if(!me){window.location.assign(I);return}gn("Finish the Google consent flow in the popup, then close it to refresh this project.");const bt=window.setInterval(()=>{me.closed&&(window.clearInterval(bt),gn(null),Ys())},1e3)}catch(I){He(I instanceof Error?I.message:"Failed to start OAuth flow")}finally{Ee(!1)}}async function kl(){He(null),gn(null);try{await C2(e,"gsc"),o(I=>I.filter(me=>me.connectionType!=="gsc")),u([]),C("")}catch(I){He(I instanceof Error?I.message:"Failed to disconnect")}}async function Wr(){if(S){pe(!0),He(null);try{await z2(e,"gsc",S),o(I=>I.map(me=>me.connectionType==="gsc"?{...me,propertyId:S}:me)),Ze({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(I){He(I instanceof Error?I.message:"Failed to save GSC property")}finally{pe(!1)}}}async function Fi(){He(null),gn(null);try{await ns.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(T,10)||void 0,full:M||void 0}})}catch{}}async function zl(){if(k.trim()){Z(!0),He(null),gn(null);try{const I=await T2(e,k.trim());N(I),A(""),await $a()}catch(I){He(I instanceof Error?I.message:"Failed to inspect URL")}finally{Z(!1)}}}return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),r.jsx("h2",{children:"Google Search Console"})]}),r.jsx("div",{className:"flex items-center gap-2",children:st&&r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:he,onClick:()=>{zn()},children:he?"Refreshing…":"Refresh data"})})]}),Ct&&r.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:[Ct,r.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>He(null),children:"×"})]}),Ma&&r.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:[Ma,r.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>gn(null),children:"×"})]}),J?r.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsx(lt,{tone:st?"positive":t?"caution":"negative",children:st?"Connected":t?"Ready to connect":"App credentials missing"})]}),st?r.jsxs("div",{className:"mt-3 space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),r.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),r.jsx("span",{className:"text-xs text-zinc-500",children:st.domain}),r.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:kl,children:"Disconnect"})]}),r.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",r.jsx("code",{children:st.domain}),"."]})]}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:st.propertyId??"No property selected yet"})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:cs(st.updatedAt)})]})]})]}):r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[r.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."}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[t?r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:fe,onClick:wd,children:fe?"Opening…":"Connect Google Search Console"}):r.jsx(le,{type:"button",variant:"outline",size:"sm",asChild:!0,children:r.jsx(St,{to:"/settings",children:"Open Settings"})}),!t&&r.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),st&&!st.sitemapUrl&&r.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("span",{className:"mt-0.5 text-amber-400",children:r.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:r.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"})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),r.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."}),r.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.jsx(le,{type:"button",size:"sm",disabled:mt.isPending||!st.propertyId,onClick:ms,children:mt.isPending?"Discovering…":"Auto-discover from GSC"}),r.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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:Pe,onChange:I=>Ve(I.target.value),onKeyDown:I=>I.key==="Enter"&&void Cs()}),r.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:Vt||!Pe.trim(),onClick:Cs,children:Vt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(st||Xr)&&r.jsxs(r.Fragment,{children:[r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),r.jsx("h3",{children:"Index coverage"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[V&&V.notIndexed.length>0&&r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:Ue,onClick:()=>{Pa()},children:Ue?"Requesting…":`Request indexing (${V.notIndexed.length})`}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:ge,onClick:()=>{Cl()},children:ge?"Loading…":"Refresh coverage"})]})]}),V&&V.summary.total>0?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const I=V.summary.indexed+V.summary.notIndexed,me=I>0?V.summary.indexed/I:0,bt=I>0?V.summary.notIndexed/I:0,Gt=54,ln=2*Math.PI*Gt,Ia=ln*(1-me),ps=ln*bt,cn=ln*me;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative h-48 w-48",children:[r.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[r.jsx("circle",{cx:"64",cy:"64",r:Gt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),r.jsx("circle",{cx:"64",cy:"64",r:Gt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:ln,strokeDashoffset:Ia,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),V.summary.notIndexed>0&&r.jsx("circle",{cx:"64",cy:"64",r:Gt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${ps} ${ln-ps}`,strokeDashoffset:-cn,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),r.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[r.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(me*100).toFixed(0),"%"]}),r.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),r.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:V.summary.indexed.toLocaleString()}),r.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),r.jsx("div",{className:"h-8 w-px bg-zinc-800"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:V.summary.notIndexed.toLocaleString()}),r.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(V.reasonGroups??[]).length>0&&r.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(V.reasonGroups??[]).length," ",(V.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),V.summary.deindexed>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"h-8 w-px bg-zinc-800"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:V.summary.deindexed.toLocaleString()}),r.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),r.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(I=>{const me=I==="indexed"?V.indexed.length:I==="notIndexed"?V.notIndexed.length:V.deindexed.length,bt=I==="indexed"?"Indexed":I==="notIndexed"?"Not Indexed":"Deindexed";return r.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Tt===I?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{oe(I),Ye(null)},children:[bt," (",me,")"]},I)})}),r.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Tt==="indexed"&&V.indexed.length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Verdict"}),r.jsx("th",{className:"text-left",children:"Last Crawl"}),r.jsx("th",{className:"text-left",children:"Mobile"})]})}),r.jsx("tbody",{children:V.indexed.map(I=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),r.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:I.crawlTime?I.crawlTime.split("T")[0]:"—"}),r.jsx("td",{className:"text-zinc-400",children:I.isMobileFriendly===!0?"Yes":I.isMobileFriendly===!1?"No":"—"})]},I.id))})]}),Tt==="notIndexed"&&!Qt&&(V.reasonGroups??[]).length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"Reason"}),r.jsx("th",{className:"text-right",children:"Pages"})]})}),r.jsx("tbody",{children:(V.reasonGroups??[]).map(I=>r.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ye(I.reason),children:[r.jsx("td",{className:"text-zinc-200",children:I.reason}),r.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.count})]},I.reason))})]}),Tt==="notIndexed"&&!Qt&&(V.reasonGroups??[]).length===0&&V.notIndexed.length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Indexing State"}),r.jsx("th",{className:"text-left",children:"Coverage"})]})}),r.jsx("tbody",{children:V.notIndexed.map(I=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),r.jsx("td",{className:"text-zinc-400",children:I.indexingState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"})]},I.id))})]}),Tt==="notIndexed"&&Qt&&(()=>{const I=(V.reasonGroups??[]).find(me=>me.reason===Qt);return I?r.jsxs("div",{children:[r.jsx("div",{className:"flex items-center gap-2 mb-3",children:r.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ye(null),children:["←"," Back to reasons"]})}),r.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-zinc-200",children:I.reason}),r.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[I.count," affected page",I.count!==1?"s":""]})]}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:Ue,onClick:()=>{Gi(I.urls.map(me=>me.url))},children:Ue?"Requesting…":`Request indexing (${I.count})`})]}),r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Last Crawl"}),r.jsx("th",{className:"w-8"})]})}),r.jsx("tbody",{children:I.urls.map(me=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:me.url}),r.jsx("td",{className:"text-zinc-400",children:me.crawlTime?me.crawlTime.split("T")[0]:"—"}),r.jsx("td",{children:r.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:Ue,onClick:()=>{Gi([me.url])},title:"Request indexing",children:"Index"})})]},me.id))})]})]}):null})(),Tt==="deindexed"&&V.deindexed.length>0&&r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Previous"}),r.jsx("th",{className:"text-left",children:"Current"}),r.jsx("th",{className:"text-left",children:"Detected"})]})}),r.jsx("tbody",{children:V.deindexed.map((I,me)=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),r.jsx("td",{className:"text-zinc-400",children:I.previousState}),r.jsx("td",{className:"text-zinc-400",children:I.currentState}),r.jsx("td",{className:"text-zinc-400",children:I.transitionDate.split("T")[0]})]},`${I.url}-${me}`))})]}),(Tt==="indexed"&&V.indexed.length===0||Tt==="notIndexed"&&!Qt&&V.notIndexed.length===0||Tt==="deindexed"&&V.deindexed.length===0)&&r.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:ge?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),r.jsx("h3",{children:"Search performance"})]}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:he,onClick:()=>{zn()},children:he?"Loading…":"Apply filters"})]}),f.length>0&&(()=>{const I=new Map;for(const Ie of f){const We=I.get(Ie.date);We?(We.clicks+=Ie.clicks,We.impressions+=Ie.impressions):I.set(Ie.date,{clicks:Ie.clicks,impressions:Ie.impressions})}const me=[...I.entries()].sort(([Ie],[We])=>Ie.localeCompare(We));if(me.length===0)return null;const bt=Math.max(...me.map(([,Ie])=>Ie.impressions),1),Gt=me.reduce((Ie,[,We])=>Ie+We.clicks,0),ln=me.reduce((Ie,[,We])=>Ie+We.impressions,0),Ia=ln>0?(Gt/ln*100).toFixed(1):"0.0",ps=700,cn=220,it={top:12,bottom:36,left:48,right:12},sn=ps-it.left-it.right,_n=cn-it.top-it.bottom,ks=sn/me.length,Ba=Math.max(Math.min(ks*.35,24),4),_l=Math.max(Ba*.15,1),El=Ie=>{if(Ie<=0)return 1;const We=Math.pow(10,Math.floor(Math.log10(Ie))),at=Ie/We,ss=at<=1.5?1.5:at<=3?3:at<=5?5:10;return Math.ceil(ss*We)},gs=4,Js=Math.ceil(El(bt)/gs)*gs,Xs=Array.from({length:gs+1},(Ie,We)=>Js/gs*We),Ws=Ie=>Ie>=1e3?`${(Ie/1e3).toFixed(Ie>=1e4?0:1)}k`:String(Ie);return r.jsxs("div",{className:"mt-3",children:[r.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),r.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",r.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Gt.toLocaleString()})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),r.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",r.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:ln.toLocaleString()})]})]}),r.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",r.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Ia,"%"]})]})]}),r.jsx("div",{className:"relative w-full",style:{aspectRatio:`${ps} / ${cn}`},children:r.jsxs("svg",{viewBox:`0 0 ${ps} ${cn}`,className:"h-full w-full",children:[Xs.map((Ie,We)=>{const at=it.top+_n-Ie/Js*_n;return r.jsxs("g",{children:[r.jsx("line",{x1:it.left,y1:at,x2:ps-it.right,y2:at,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),r.jsx("text",{x:it.left-6,y:at+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:Ws(Ie)})]},`t-${We}`)}),me.map(([Ie,We],at)=>{const ss=it.left+ks*at+ks/2,Zi=We.impressions/Js*_n,ys=We.clicks/Js*_n;return r.jsxs("g",{children:[r.jsx("title",{children:`${Ie}
|
|
234
|
-
Clicks: ${We.clicks}
|
|
235
|
-
Impressions: ${We.impressions}
|
|
236
|
-
CTR: ${We.impressions>0?(We.clicks/We.impressions*100).toFixed(1):0}%`}),r.jsx("rect",{x:ss-Ba-_l/2,y:it.top+_n-Zi,width:Ba,height:Math.max(Zi,1),rx:2,fill:"#3b82f6",opacity:.85}),r.jsx("rect",{x:ss+_l/2,y:it.top+_n-ys,width:Ba,height:Math.max(ys,1),rx:2,fill:"#10b981",opacity:.85})]},Ie)}),(()=>{const Ie=Math.min(me.length,7);return Array.from({length:Ie},(We,at)=>{const ss=me.length===1?0:Math.round(at/(Ie-1)*(me.length-1)),Zi=it.left+ks*ss+ks/2;return r.jsx("text",{x:Zi,y:cn-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:me[ss][0].slice(5)},`xl-${ss}`)})})()]})})]})})(),r.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[r.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=>O(me=>({...me,startDate:I.target.value}))}),r.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=>O(me=>({...me,endDate:I.target.value}))}),r.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=>O(me=>({...me,query:I.target.value}))}),r.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=>O(me=>({...me,page:I.target.value}))}),r.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=>O(me=>({...me,limit:I.target.value}))})]}),f.length>0?r.jsx("div",{className:"mt-3 overflow-x-auto",children:r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"Date"}),r.jsx("th",{className:"text-left",children:"Query"}),r.jsx("th",{className:"text-left",children:"Page"}),r.jsx("th",{className:"text-right",children:"Clicks"}),r.jsx("th",{className:"text-right",children:"Impressions"}),r.jsx("th",{className:"text-right",children:"CTR"}),r.jsx("th",{className:"text-right",children:"Position"})]})}),r.jsx("tbody",{children:f.map((I,me)=>r.jsxs("tr",{children:[r.jsx("td",{className:"text-zinc-400",children:I.date}),r.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:I.query}),r.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:I.page}),r.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:I.clicks.toLocaleString()}),r.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.impressions.toLocaleString()}),r.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(I.ctr)?I.ctr*100:0).toFixed(1),"%"]}),r.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:I.position.toFixed(1)})]},`${I.date}:${I.query}:${I.page}:${me}`))})]})}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),r.jsx("h3",{children:"Inspect a URL"})]})}),r.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[r.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=>A(I.target.value),onKeyDown:I=>I.key==="Enter"&&void zl()}),r.jsx(le,{type:"button",size:"sm",disabled:re||!st?.propertyId||!k.trim(),onClick:zl,children:re?"Inspecting…":"Inspect URL"})]}),x&&r.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:x.indexingState??"Unknown"})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:x.verdict??"Unknown"})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:nx(x.isMobileFriendly)})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:cs(x.crawlTime)})]})]})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),r.jsx("h3",{children:"Inspection log"})]}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:R,onClick:()=>{$a()},children:R?"Loading…":"Refresh history"})]}),r.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[r.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:K,onChange:I=>W(I.target.value)}),r.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:R,onClick:()=>{$a()},children:"Apply filter"})]}),p.length>0?r.jsx("div",{className:"mt-3 overflow-x-auto",children:r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Indexing"}),r.jsx("th",{className:"text-left",children:"Verdict"}),r.jsx("th",{className:"text-left",children:"Coverage"}),r.jsx("th",{className:"text-left",children:"Mobile"}),r.jsx("th",{className:"text-left",children:"Inspected"})]})}),r.jsx("tbody",{children:p.map(I=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),r.jsx("td",{className:"text-zinc-300",children:I.indexingState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:I.verdict??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:I.coverageState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:nx(I.isMobileFriendly)}),r.jsx("td",{className:"text-zinc-400",children:cs(I.inspectedAt)})]},I.id))})]})}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),r.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?r.jsx("div",{className:"mt-3 overflow-x-auto",children:r.jsxs("table",{className:"data-table w-full text-sm",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{className:"text-left",children:"URL"}),r.jsx("th",{className:"text-left",children:"Previous"}),r.jsx("th",{className:"text-left",children:"Current"}),r.jsx("th",{className:"text-left",children:"Changed at"})]})}),r.jsx("tbody",{children:y.map(I=>r.jsxs("tr",{children:[r.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:I.url}),r.jsx("td",{className:"text-zinc-400",children:I.previousState??"Unknown"}),r.jsx("td",{className:"text-zinc-300",children:I.currentState??"Unknown"}),r.jsx("td",{className:"text-zinc-400",children:cs(I.transitionDate)})]},`${I.url}:${I.transitionDate}`))})]})}):r.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),st&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:r.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>nn(I=>!I),children:[r.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 ${Mn?"rotate-90":""}`,"aria-hidden":"true",children:r.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"})}),r.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Mn&&r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[r.jsxs(Me,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),r.jsx("h3",{children:"Pick the Search Console property"})]})}),r.jsxs("div",{className:"mt-3 space-y-2",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),r.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:xe||c.length===0,onChange:I=>C(I.target.value),children:c.length===0?r.jsx("option",{value:"",children:xe?"Loading properties…":"No properties available"}):c.map(I=>r.jsxs("option",{value:I.siteUrl,children:[I.siteUrl," · ",I.permissionLevel]},I.siteUrl))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:xe,onClick:()=>{ue(st)},children:xe?"Refreshing…":"Refresh properties"}),r.jsx(le,{type:"button",size:"sm",disabled:!S||ae,onClick:Wr,children:ae?"Saving…":"Save property"})]}),r.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),r.jsx("h3",{children:"Import GSC performance data"})]})}),r.jsxs("div",{className:"mt-3 space-y-3",children:[r.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),r.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:T,onChange:I=>z(I.target.value)})]}),r.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:[r.jsx("input",{type:"checkbox",checked:M,onChange:I=>$(I.target.checked)}),"Replace existing imported rows for the requested range"]})]}),r.jsx(le,{type:"button",size:"sm",disabled:ns.isPending||!st.propertyId,onClick:Fi,children:ns.isPending?"Queueing…":"Queue sync"}),!st.propertyId&&r.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),r.jsx("h3",{children:"Sitemap configuration"})]})}),r.jsxs("div",{className:"mt-3 space-y-3",children:[st.sitemapUrl&&r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:st.sitemapUrl})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:de||!st.propertyId,onClick:()=>{Ua()},children:de?"Loading…":"Browse sitemaps from GSC"}),r.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:mt.isPending||!st.propertyId,onClick:ms,children:mt.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),r.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."}),Re&&Re.length>0&&r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[r.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Re.length,")"]}),Re.map(I=>{const me=I.contents?.[0];return r.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[r.jsxs("div",{children:[r.jsx("p",{className:"text-zinc-200 break-all",children:I.path}),I.lastSubmitted&&r.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",I.lastSubmitted.split("T")[0]]})]}),r.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[me&&r.jsxs("div",{className:"text-right",children:[r.jsxs("p",{className:"text-zinc-300",children:[me.indexed," / ",me.submitted]}),r.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),r.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ve(I.path),children:"Use"})]})]},I.path)})]}),r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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:st.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Pe,onChange:I=>Ve(I.target.value),onKeyDown:I=>I.key==="Enter"&&Pe.trim()&&void Cs()}),r.jsx(le,{type:"button",size:"sm",disabled:Vt||!Pe.trim(),onClick:Cs,children:Vt?"Saving…":st.sitemapUrl?"Update":"Save"})]}),r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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}`}),r.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:yn.isPending||!st.propertyId,onClick:async()=>{const me=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||st.sitemapUrl||void 0;He(null),gn(null);try{await yn.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:me}})}catch{}},children:yn.isPending?"Queueing…":"Inspect sitemap"})]}),!st.propertyId&&r.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function M$({project:e,onUpdateProject:t,onRefresh:n}){const[a,o]=w.useState(!1),[c,u]=w.useState(!1),[f,m]=w.useState(null),[p,v]=w.useState(e.displayName),[y,b]=w.useState(e.canonicalDomain),[x,N]=w.useState(e.country),[S,C]=w.useState(e.language),[k,A]=w.useState(e.ownedDomains??[]),[T,z]=w.useState(""),[M,$]=w.useState(null),[E,O]=w.useState(!1),[K,W]=w.useState(!1),[J,ne]=w.useState(""),[fe,Ee]=w.useState(""),[xe,H]=w.useState(""),[ae,pe]=w.useState(""),[he,P]=w.useState("");w.useEffect(()=>{a||(v(e.displayName),b(e.canonicalDomain),N(e.country),C(e.language),A(e.ownedDomains??[]))},[e,a]);function R(){o(!1),m(null),v(e.displayName),b(e.canonicalDomain),N(e.country),C(e.language),A(e.ownedDomains??[]),z("")}function B(){const ce=T.trim();ce&&(k.includes(ce)||A([...k,ce]),z(""))}function re(ce){A(k.filter(Pe=>Pe!==ce))}async function Z(){if(!(!p.trim()||!y.trim()||!x.trim()||!S.trim())){u(!0),m(null);try{await t(e.name,{displayName:p.trim(),canonicalDomain:y.trim(),ownedDomains:k,country:x.trim(),language:S.trim()}),o(!1),Ze({title:"Project settings saved",detail:`${p.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(ce){m(ce instanceof Error?ce.message:"Failed to save")}finally{u(!1)}}}async function V(){const ce=J.trim(),Pe=fe.trim(),Ve=xe.trim(),Vt=ae.trim();if(!(!ce||!Pe||!Ve||!Vt)){O(!0),$(null);try{const Ut={label:ce,city:Pe,region:Ve,country:Vt};he.trim()&&(Ut.timezone=he.trim()),await a2(e.name,Ut),n(),ne(""),Ee(""),H(""),pe(""),P(""),W(!1),Ze({title:"Location added",detail:`${ce} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${ce}`,dedupeMode:"drop"})}catch(Ut){$(Ut instanceof Error?Ut.message:"Failed to add location")}finally{O(!1)}}}async function se(ce){O(!0),$(null);try{await r2(e.name,ce),n(),Ze({title:"Location removed",detail:`${ce} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${ce}`,dedupeMode:"drop"})}catch(Pe){$(Pe instanceof Error?Pe.message:"Failed to remove location")}finally{O(!1)}}async function ge(ce){O(!0),$(null);try{await o2(e.name,ce),n(),Ze({title:"Default location updated",detail:`${ce} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Pe){$(Pe instanceof Error?Pe.message:"Failed to set default location")}finally{O(!1)}}const je=p!==e.displayName||y!==e.canonicalDomain||x!==e.country||S!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),de="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",Ae="block text-xs font-medium text-zinc-400 mb-1",Re=J.trim()&&fe.trim()&&xe.trim()&&ae.trim();return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),r.jsx("h2",{children:"Project settings"})]}),!a&&r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>o(!0),children:"Edit settings"})]}),f&&r.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,r.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>m(null),children:"×"})]}),a?r.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:Ae,children:"Display name"}),r.jsx("input",{className:de,type:"text",value:p,onChange:ce=>v(ce.target.value),placeholder:"My Project"})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ae,children:"Canonical domain"}),r.jsx("input",{className:de,type:"text",value:y,onChange:ce=>b(ce.target.value),placeholder:"example.com"})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ae,children:"Country"}),r.jsx("input",{className:de,type:"text",value:x,onChange:ce=>N(ce.target.value),placeholder:"US",maxLength:2})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ae,children:"Language"}),r.jsx("input",{className:de,type:"text",value:S,onChange:ce=>C(ce.target.value),placeholder:"en"})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:Ae,children:"Owned domains"}),r.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(ce=>r.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:[ce,r.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>re(ce),"aria-label":`Remove ${ce}`,children:"×"})]},ce))}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("input",{className:`${de} flex-1`,type:"text",placeholder:"docs.example.com",value:T,onChange:ce=>z(ce.target.value),onKeyDown:ce=>ce.key==="Enter"&&(ce.preventDefault(),B())}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:!T.trim(),onClick:B,children:"Add"})]})]}),r.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[r.jsx(le,{type:"button",disabled:c||!je||!p.trim()||!y.trim(),onClick:Z,children:c?"Saving...":"Save changes"}),r.jsx(le,{type:"button",variant:"outline",disabled:c,onClick:R,children:"Cancel"})]})]}):r.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:r.jsx("table",{className:"w-full text-sm",children:r.jsxs("tbody",{children:[r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),r.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?r.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(ce=>r.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:ce},ce))}):r.jsx("span",{className:"text-zinc-500",children:"—"})})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),r.jsxs("tr",{className:"border-b border-zinc-800/40",children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),r.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),r.jsxs("tr",{children:[r.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),r.jsxs("td",{className:"px-4 py-2.5",children:[M&&r.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:[M,r.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>$(null),children:"×"})]}),(e.locations??[]).length>0?r.jsxs("table",{className:"w-full text-xs mb-2",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"text-zinc-600",children:[r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),r.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),r.jsx("th",{className:"pb-1"})]})}),r.jsx("tbody",{children:e.locations.map(ce=>r.jsxs("tr",{className:"border-t border-zinc-800/30",children:[r.jsx("td",{className:"py-1.5 pr-3",children:r.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${ce.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:[ce.label,ce.label===e.defaultLocation?" ★":""]})}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:ce.city}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:ce.region}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:ce.country}),r.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:ce.timezone??"—"}),r.jsx("td",{className:"py-1.5",children:r.jsxs("div",{className:"flex items-center gap-1.5",children:[ce.label!==e.defaultLocation&&r.jsx("button",{type:"button",disabled:E,onClick:()=>ge(ce.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${ce.label} as default location`,children:"Set default"}),r.jsx("button",{type:"button",disabled:E,onClick:()=>se(ce.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${ce.label}`,children:"Remove"})]})})]},ce.label))})]}):r.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),K?r.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[r.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),r.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),r.jsx("input",{className:de,type:"text",value:J,onChange:ce=>ne(ce.target.value),placeholder:"nyc"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),r.jsx("input",{className:de,type:"text",value:fe,onChange:ce=>Ee(ce.target.value),placeholder:"New York"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),r.jsx("input",{className:de,type:"text",value:xe,onChange:ce=>H(ce.target.value),placeholder:"NY"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),r.jsx("input",{className:de,type:"text",value:ae,onChange:ce=>pe(ce.target.value),placeholder:"US",maxLength:2})]}),r.jsxs("div",{className:"col-span-2",children:[r.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),r.jsx("input",{className:de,type:"text",value:he,onChange:ce=>P(ce.target.value),placeholder:"America/New_York"})]})]}),r.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[r.jsx(le,{type:"button",size:"sm",disabled:E||!Re,onClick:V,children:E?"Adding...":"Add location"}),r.jsx(le,{type:"button",size:"sm",variant:"outline",disabled:E,onClick:()=>{W(!1),$(null)},children:"Cancel"})]})]}):r.jsx(le,{type:"button",size:"sm",variant:"outline",onClick:()=>W(!0),children:"+ Add location"})]})]})]})})})]})}const $$=[{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"}],yS=["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 P$({projectName:e}){const[t,n]=w.useState("loading"),[a,o]=w.useState(!1),[c,u]=w.useState("daily"),[f,m]=w.useState(6),[p,v]=w.useState(""),[y,b]=w.useState("UTC"),[x,N]=w.useState(!1),[S,C]=w.useState(""),[k,A]=w.useState(!1),[T,z]=w.useState(!1),[M,$]=w.useState(null);w.useEffect(()=>{p2(e).then(n).catch(()=>n(null))},[e]);const E=()=>{if(t&&t!=="loading"){const J=IE(t.preset??null,t.cronExpr);u(J.freq),m(J.hour),v(J.customCron);const ne=yS.includes(t.timezone);b(ne?t.timezone:"Other"),N(!ne),C(ne?"":t.timezone)}else u("daily"),m(6),v(""),b("UTC"),N(!1),C("");$(null),o(!0)},O=async()=>{A(!0),$(null);try{const ne={timezone:x?S.trim()||"UTC":y};c==="custom"?ne.cron=p.trim():ne.preset=UE(c,f);const fe=await Gb(e,ne);n(fe),o(!1),Ze({title:"Schedule saved",detail:Qh(fe.preset??null,fe.cronExpr,fe.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(J){$(J instanceof Error?J.message:"Failed to save schedule")}finally{A(!1)}},K=async()=>{if(!(!t||t==="loading")){A(!0),$(null);try{const J={timezone:t.timezone,enabled:!t.enabled};t.preset?J.preset=t.preset:J.cron=t.cronExpr;const ne=await Gb(e,J);n(ne),Ze({title:ne.enabled?"Schedule resumed":"Schedule paused",detail:Qh(ne.preset??null,ne.cronExpr,ne.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(J){$(J instanceof Error?J.message:"Failed to update schedule")}finally{A(!1)}}},W=async()=>{z(!0),$(null);try{await g2(e),n(null),o(!1),Ze({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(J){$(J instanceof Error?J.message:"Failed to remove schedule")}finally{z(!1)}};return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),r.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!a&&r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:E,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&r.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!a&&t===null&&r.jsx(Me,{className:"surface-card compact-card",children:r.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!a&&t!==null&&r.jsxs(Me,{className:"surface-card compact-card",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Qh(t.preset??null,t.cronExpr,t.timezone)}),r.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",r.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&r.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&r.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx(lt,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:K,children:t.enabled?"Pause":"Resume"}),r.jsx(le,{type:"button",variant:"ghost",size:"sm",disabled:T,onClick:W,children:T?"Removing...":"Remove"})]})]}),M&&r.jsx("p",{className:"text-rose-400 text-sm mt-2",children:M})]}),a&&r.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),r.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:J=>u(J.target.value),children:$$.map(J=>r.jsx("option",{value:J.value,children:J.label},J.value))})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),r.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:J=>m(parseInt(J.target.value)),children:Array.from({length:24},(J,ne)=>r.jsx("option",{value:ne,children:Mm(ne)},ne))})]})]}),c==="custom"&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),r.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:J=>v(J.target.value)})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),r.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:x?"Other":y,onChange:J=>{J.target.value==="Other"?(N(!0),b("Other")):(N(!1),b(J.target.value))},children:[yS.map(J=>r.jsx("option",{value:J,children:J},J)),r.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),x&&r.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:J=>C(J.target.value)})]}),M&&r.jsx("p",{className:"text-rose-400 text-sm",children:M}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!1),$(null)},children:"Cancel"}),r.jsx(le,{type:"button",size:"sm",disabled:k||c==="custom"&&!p.trim(),onClick:O,children:k?"Saving...":"Save schedule"})]})]})]})}const U$=[{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 I$({projectName:e}){const[t,n]=w.useState("loading"),[a,o]=w.useState(!1),[c,u]=w.useState(""),[f,m]=w.useState(["citation.lost","citation.gained"]),[p,v]=w.useState(!1),[y,b]=w.useState(null),[x,N]=w.useState({});w.useEffect(()=>{y2(e).then(n).catch(()=>n([]))},[e]);const S=T=>{m(z=>z.includes(T)?z.filter(M=>M!==T):[...z,T])},C=async()=>{if(!(!c.trim()||f.length===0)){v(!0),b(null);try{const T=await v2(e,{channel:"webhook",url:c.trim(),events:f});n(z=>z==="loading"?[T]:[...z,T]),u(""),m(["citation.lost","citation.gained"]),o(!1),Ze({title:"Webhook added",detail:`Notifications will be sent to ${T.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(T){b(T instanceof Error?T.message:"Failed to add webhook")}finally{v(!1)}}},k=async T=>{try{await b2(e,T),n(z=>z==="loading"?z:z.filter(M=>M.id!==T)),Ze({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${T}`,dedupeMode:"drop"})}catch(z){b(z instanceof Error?z.message:"Failed to remove webhook")}},A=async T=>{N(z=>({...z,[T]:{state:"testing"}}));try{const z=await x2(e,T);N(M=>({...M,[T]:{state:z.ok?"ok":"fail",status:z.status}})),z.ok&&Ze({title:"Test notification sent",detail:`Webhook returned status ${z.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${T}`,dedupeMode:"replace"})}catch{N(z=>({...z,[T]:{state:"fail"}}))}};return r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),r.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!a),b(null)},children:a?"Cancel":"+ Add webhook"})]}),a&&r.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),r.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:T=>u(T.target.value)})]}),r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),r.jsx("div",{className:"flex flex-wrap gap-3",children:U$.map(T=>r.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[r.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:f.includes(T.value),onChange:()=>S(T.value)}),r.jsx("span",{className:"text-sm text-zinc-300",children:T.label})]},T.value))})]}),y&&r.jsx("p",{className:"text-rose-400 text-sm",children:y}),r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>{o(!1),b(null)},children:"Cancel"}),r.jsx(le,{type:"button",size:"sm",disabled:p||!c.trim()||f.length===0,onClick:C,children:p?"Adding...":"Add webhook"})]})]}),t==="loading"&&r.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!a&&r.jsx(Me,{className:"surface-card compact-card",children:r.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&&r.jsxs("div",{className:"evidence-table-wrap",children:[r.jsxs("table",{className:"evidence-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Endpoint"}),r.jsx("th",{children:"Events"}),r.jsx("th",{children:"Status"}),r.jsx("th",{})]})}),r.jsx("tbody",{children:t.map(T=>r.jsxs("tr",{children:[r.jsx("td",{className:"evidence-keyword-cell",children:r.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:T.urlHost,children:T.urlDisplay??T.url})}),r.jsx("td",{children:r.jsx("div",{className:"flex flex-wrap gap-1",children:T.events.map(z=>r.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))})}),r.jsx("td",{children:r.jsx(lt,{tone:T.enabled?"positive":"neutral",children:T.enabled?"Active":"Paused"})}),r.jsx("td",{children:r.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[x[T.id]&&(()=>{const z=x[T.id],M=z.state==="testing"?"Sending…":z.state==="ok"?`Delivered${z.status?` (${z.status})`:""}`:`Failed${z.status?` (${z.status})`:""}`;return r.jsx(lt,{tone:z.state==="ok"?"positive":z.state==="fail"?"negative":"neutral",children:M})})(),r.jsx(le,{variant:"ghost",size:"sm",type:"button",disabled:x[T.id]?.state==="testing",onClick:()=>A(T.id),children:"Test"}),r.jsx(le,{variant:"ghost",size:"sm",type:"button",onClick:()=>k(T.id),children:"Remove"})]})})]},T.id))})]}),y&&r.jsx("p",{className:"text-rose-400 text-sm mt-2",children:y})]})]})}function vS({eyebrow:e,title:t,status:n,tone:a,targetLabel:o,targetValue:c,coverageValue:u,note:f,updatedAt:m,active:p,onClick:v}){return r.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:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),r.jsx("h3",{children:t})]}),r.jsx(lt,{tone:a,children:n})]}),r.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:o}),r.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:c})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:u})]})]}),r.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:[r.jsx("span",{children:f}),r.jsx("span",{children:m?`Updated ${cs(m)}`:"No recent sync yet"})]})]})}function cu({label:e,value:t,tone:n}){const a=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),r.jsx("p",{className:`mt-2 text-2xl font-semibold ${a}`,children:t})]})}function B$({projectName:e,refreshNonce:t}){const[n,a]=w.useState(null),[o,c]=w.useState([]),[u,f]=w.useState(null),[m,p]=w.useState([]),[v,y]=w.useState([]),[b,x]=w.useState(null),[N,S]=w.useState(""),[C,k]=w.useState(""),[A,T]=w.useState(""),[z,M]=w.useState(!0),[$,E]=w.useState(!1),[O,K]=w.useState(null),[W,J]=w.useState("coverage");w.useEffect(()=>{ne()},[e,t]);async function ne(){M(!0),K(null);try{const P=await uj(e);if(a(P),P.connected){const[R,B,re,Z]=await Promise.all([zp(e).catch(()=>null),dj(e).catch(()=>[]),q2(e).catch(()=>[]),P.siteUrl?Promise.resolve([]):I2(e).then(V=>V.sites).catch(()=>[])]);f(R),p(B),y(re),c(Z)}else f(null),p([]),y([]),c([])}catch(P){K(P instanceof Error?P.message:"Failed to load Bing data")}finally{M(!1)}}async function fe(){if(C.trim()){K(null);try{const P=await P2(e,C.trim());k(""),P.availableSites.length>0&&c(P.availableSites),await ne()}catch(P){K(P instanceof Error?P.message:"Failed to connect")}}}async function Ee(){try{await U2(e),a(null),c([]),f(null),p([]),y([]),x(null),T(""),K(null)}catch(P){K(P instanceof Error?P.message:"Failed to disconnect")}}async function xe(){if(A)try{await B2(e,A),await ne()}catch(P){K(P instanceof Error?P.message:"Failed to set site")}}async function H(){if(N.trim())try{const P=await fj(e,N.trim());x(P),p(R=>[P,...R])}catch(P){K(P instanceof Error?P.message:"Inspection failed")}}async function ae(P){E(!0),K(null);try{const R=await Vb(e,{urls:[P]}),{succeeded:B,failed:re,total:Z}=R.summary;Ze({title:"Bing submission requested",detail:re===0?`${B} URL submitted to Bing.`:`${B}/${Z} submitted successfully, ${re} failed.`,tone:re===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${P}`,dedupeMode:"replace"})}catch(R){const B=R instanceof Error?R.message:"Submission failed";K(B),Ze({title:"Bing submission failed",detail:B,tone:"negative",dedupeKey:`bing:indexing:${e}:${P}`,dedupeMode:"replace"})}finally{E(!1)}}async function pe(){E(!0),K(null),Ze({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const P=await Vb(e,{allUnindexed:!0}),{succeeded:R,failed:B,total:re}=P.summary;Ze({title:"Bing submissions requested",detail:B===0?`${R}/${re} URL${re!==1?"s":""} submitted to Bing.`:`${R}/${re} submitted successfully, ${B} failed.`,tone:B===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(P){const R=P instanceof Error?P.message:"Batch submission failed";K(R),Ze({title:"Bing submissions failed",detail:R,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{E(!1)}}if(z)return r.jsx(Me,{className:"surface-card",children:r.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!n?.connected)return r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsx(lt,{tone:"caution",children:"Not connected"})]}),r.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),r.jsxs("div",{className:"mt-3",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.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:C,onChange:P=>k(P.target.value),onKeyDown:P=>P.key==="Enter"&&fe()}),r.jsx(le,{size:"sm",disabled:!C.trim(),onClick:fe,children:"Connect"})]}),r.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",r.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"})]})]}),O&&r.jsx("p",{className:"mt-3 text-xs text-rose-400",children:O})]});if(!n.siteUrl)return r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(lt,{tone:"positive",children:"Connected"}),r.jsx(le,{size:"sm",variant:"ghost",onClick:Ee,children:"Disconnect"})]})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),r.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),r.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),r.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."})]}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.domain})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?cs(n.updatedAt):"—"})]})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),o.length>0?r.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[r.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:A,onChange:P=>T(P.target.value),children:[r.jsx("option",{value:"",children:"Select a site..."}),o.map(P=>r.jsxs("option",{value:P.url,children:[P.url,P.verified?" (verified)":""]},P.url))]}),r.jsx(le,{size:"sm",disabled:!A,onClick:xe,children:"Set Site"})]}):r.jsx("p",{className:"mt-3 text-xs text-zinc-500",children:"No verified Bing sites are available yet. Verify the domain in Bing Webmaster Tools, then use the page-level refresh to reload everything."})]})]}),O&&r.jsx("p",{className:"mt-3 text-xs text-rose-400",children:O})]});const he=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return r.jsxs("div",{className:"space-y-3",children:[r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),r.jsx("h3",{children:"Domain authorization"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(lt,{tone:"positive",children:"Connected"}),r.jsx(le,{size:"sm",variant:"ghost",onClick:Ee,children:"Disconnect"})]})]}),O&&r.jsx("p",{className:"mb-3 text-xs text-rose-400",children:O}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),r.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),r.jsx("span",{className:"text-xs text-zinc-500",children:n.domain})]}),r.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",r.jsx("code",{children:n.siteUrl}),"."]})]}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.siteUrl})]}),r.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[r.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),r.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:n.updatedAt?cs(n.updatedAt):"—"})]})]})]})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),r.jsx("h3",{children:"Index monitoring"})]}),r.jsx("p",{className:"text-xs text-zinc-500",children:u?.lastInspectedAt?`Last inspected ${cs(u.lastInspectedAt)}`:"No inspection history yet"})]}),r.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:he.map(P=>r.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${W===P.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>J(P.key),children:P.label},P.key))}),W==="coverage"&&u&&r.jsxs("div",{className:"mt-4 space-y-4",children:[r.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[r.jsx(cu,{label:"Indexed",value:u.summary.indexed,tone:"positive"}),r.jsx(cu,{label:"Not in index",value:u.summary.notIndexed+(u.summary.unknown??0),tone:"negative"}),r.jsx(cu,{label:"Status unknown",value:u.summary.unknown??0,tone:"neutral"}),r.jsx(cu,{label:"Coverage",value:`${u.summary.percentage}%`,tone:"neutral"})]}),u.notIndexed.length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[r.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",u.notIndexed.length,")"]}),r.jsx(le,{size:"sm",variant:"ghost",disabled:$,onClick:pe,children:$?"Submitting…":"Submit all to Bing"})]}),r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),r.jsx("tbody",{children:u.notIndexed.map(P=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:P.url}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:P.httpCode??"—"}),r.jsx("td",{className:"py-1.5 px-3 text-right",children:r.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:$,onClick:()=>ae(P.url),children:"Submit"})})]},P.id))})]})})]}),(u.unknown??[]).length>0&&r.jsxs("div",{children:[r.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[r.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(u.unknown??[]).length,")"]}),r.jsx(le,{size:"sm",variant:"ghost",disabled:$,onClick:pe,children:$?"Submitting…":"Submit all to Bing"})]}),r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),r.jsx("tbody",{children:(u.unknown??[]).map(P=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:P.url}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:P.lastCrawledDate?cs(P.lastCrawledDate):"—"}),r.jsx("td",{className:"py-1.5 px-3 text-right",children:r.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:$,onClick:()=>ae(P.url),children:"Submit"})})]},P.id))})]})})]}),u.indexed.length>0&&r.jsxs("div",{children:[r.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",u.indexed.length,")"]}),r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),r.jsx("tbody",{children:u.indexed.map(P=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:P.url}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:P.lastCrawledDate?cs(P.lastCrawledDate):"—"})]},P.id))})]})})]})]}),W==="coverage"&&!u&&r.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),W==="inspections"&&r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[r.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:N,onChange:P=>S(P.target.value),onKeyDown:P=>P.key==="Enter"&&H()}),r.jsx(le,{size:"sm",disabled:!N.trim(),onClick:H,children:"Inspect"})]}),b&&r.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[r.jsx("div",{className:"font-medium text-zinc-200",children:b.url}),r.jsxs("div",{className:"text-zinc-400",children:["In Index: ",r.jsx("span",{className:b.inIndex?"text-emerald-400":"text-rose-400",children:b.inIndex?"Yes":"No"})," · ","HTTP: ",b.httpCode??"—"," · ","Crawled: ",b.lastCrawledDate??"—"]})]}),m.length>0&&r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),r.jsx("tbody",{children:m.map(P=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:P.url}),r.jsx("td",{className:"py-1.5 px-3",children:r.jsx(lt,{tone:P.inIndex?"positive":"negative",children:P.inIndex?"Yes":"No"})}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:P.httpCode??"—"}),r.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:cs(P.inspectedAt)})]},P.id))})]})})]}),W==="performance"&&r.jsx("div",{className:"mt-4",children:v.length===0?r.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):r.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:r.jsxs("table",{className:"w-full text-xs",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-zinc-800",children:[r.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Clicks"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Impr"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"CTR"}),r.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:"Pos"})]})}),r.jsx("tbody",{children:v.map((P,R)=>r.jsxs("tr",{className:"border-b border-zinc-800/50",children:[r.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:P.query}),r.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:P.clicks}),r.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:P.impressions}),r.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(P.ctr)?P.ctr*100:0).toFixed(1),"%"]}),r.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:P.averagePosition.toFixed(1)})]},R))})]})})})]})]})}function q$({projectName:e}){const[t,n]=w.useState("google"),[a,o]=w.useState(!0),[c,u]=w.useState("idle"),[f,m]=w.useState(null),p=w.useRef(null),[v,y]=w.useState(!1),[b,x]=w.useState(null),[N,S]=w.useState(null),[C,k]=w.useState(!1),[A,T]=w.useState(null),[z,M]=w.useState(null),[$,E]=w.useState(0);async function O(R=!1){R||o(!0),m(null);try{const[B,re,Z]=await Promise.all([Cp().catch(()=>null),lj(e).catch(()=>[]),uj(e).catch(()=>null)]),V=re.find(je=>je.connectionType==="gsc")??null;y(!!B?.google?.configured),k(!!B?.bing?.configured),x(V),T(Z);const[se,ge]=await Promise.all([V?kp(e).catch(()=>null):Promise.resolve(null),Z?.connected?zp(e).catch(()=>null):Promise.resolve(null)]);S(se),M(ge)}catch(B){m(B instanceof Error?B.message:"Failed to load search console overview")}finally{o(!1)}}async function K(){if(c!=="idle")return;p.current?.abort();const R=new AbortController;p.current=R;const B=R.signal;u("syncing"),m(null);const re=[];try{async function Z(){if(!b)return;const je=await cj(e);if(!je?.id)return;const de=2e3,Re=Date.now()+12e4;for(;Date.now()<Re;){if(B.aborted||(await new Promise(Pe=>setTimeout(Pe,de)),B.aborted))return;const ce=await Ur(je.id).catch(()=>null);if(!ce)break;if(["completed","failed","cancelled"].includes(ce.status)){ce.status!=="completed"&&re.push(`Google sync ${ce.status}`);break}}}const V=10;async function se(){if(!A?.connected)return;const je=await dj(e).catch(()=>[]),de=[...new Set(je.map(Ae=>Ae.url))];if(de.length!==0)for(let Ae=0;Ae<de.length;Ae+=V){if(B.aborted)return;const Re=de.slice(Ae,Ae+V),Pe=(await Promise.allSettled(Re.map(Ve=>fj(e,Ve)))).filter(Ve=>Ve.status==="rejected").length;Pe>0&&re.push(`${Pe} Bing inspection(s) failed`)}}const ge=await Promise.allSettled([Z(),se()]);for(const je of ge)je.status==="rejected"&&re.push(je.reason instanceof Error?je.reason.message:"Sync failed");if(B.aborted)return;u("reloading"),await O(!0),E(je=>je+1),re.length>0&&m(`Partial refresh: ${re.join("; ")}`)}catch(Z){B.aborted||m(Z instanceof Error?Z.message:"Refresh failed")}finally{B.aborted||u("idle")}}w.useEffect(()=>(O(),()=>{p.current?.abort()}),[e]);const W=b?"positive":v?"caution":"negative",J=b?"Connected":v?"Ready to connect":"Needs setup",ne=N?`${N.summary.percentage}% indexed`:b?"Awaiting coverage":"No coverage data",fe=N?`${N.summary.notIndexed} not indexed${N.summary.deindexed>0?` · ${N.summary.deindexed} deindexed`:""}`:b?"Run sitemap inspection to populate coverage":v?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",Ee=N?.lastInspectedAt??b?.updatedAt??null,xe=A?.connected?"positive":C?"caution":"negative",H=A?.connected?"Connected":C?"Ready to connect":"Needs setup",ae=z?`${z.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",pe=z?z.summary.notIndexed+(z.summary.unknown??0):0,he=z?`${pe} not in index`:A?.connected?"Inspect URLs to populate coverage":C?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",P=z?.lastInspectedAt??A?.updatedAt??null;return r.jsxs("div",{className:"space-y-6",children:[r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),r.jsx("h2",{children:"Search Engine Intelligence"}),r.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."})]}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:a||c!=="idle",onClick:()=>{K()},children:a?"Loading…":c==="syncing"?"Refreshing Google & Bing…":c==="reloading"?"Reloading workspaces…":"Refresh all"})]}),f&&r.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}),r.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[r.jsx(vS,{eyebrow:"Google",title:"Google Search Console",status:a?"Loading…":J,tone:a?"neutral":W,targetLabel:"Selected property",targetValue:b?.propertyId??"No property selected",coverageValue:a?"Loading…":ne,note:a?"Loading overview…":fe,updatedAt:Ee,active:t==="google",onClick:()=>n("google")}),r.jsx(vS,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:a?"Loading…":H,tone:a?"neutral":xe,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:a?"Loading…":ae,note:a?"Loading overview…":he,updatedAt:P,active:t==="bing",onClick:()=>n("bing")})]})]}),r.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([R,B])=>r.jsx("button",{type:"button",role:"tab","aria-selected":t===R,className:`project-subnav-link ${t===R?"project-subnav-link-active":""}`,onClick:()=>n(R),children:B},R))}),t==="google"&&r.jsx(D$,{projectName:e}),t==="bing"&&r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),r.jsx("h2",{children:"Bing Webmaster Tools"})]})}),r.jsx(B$,{projectName:e,refreshNonce:$})]})]})}function K$({insights:e}){const{openEvidence:t}=Zr(),[n,a]=w.useState(null);return r.jsx("div",{className:"insight-list",children:e.map(o=>{const c=n===o.id,u=o.affectedPhrases.length>0;return r.jsxs("div",{children:[r.jsxs("div",{className:`insight-row insight-row-${o.tone} ${u?"cursor-pointer":""}`,onClick:u?()=>a(c?null:o.id):void 0,children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u&&r.jsx(Yu,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${c?"rotate-90":""}`}),r.jsx(lt,{tone:o.tone,children:o.actionLabel}),r.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:o.title}),r.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:o.detail})]}),u&&r.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[o.affectedPhrases.length," phrase",o.affectedPhrases.length>1?"s":""]})]}),c&&r.jsx("div",{className:"divide-y divide-zinc-800/20",children:o.affectedPhrases.map(f=>r.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[r.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[r.jsx(sp,{state:f.citationState}),r.jsx("span",{className:"text-sm text-zinc-200 truncate",children:f.keyword}),r.jsx("div",{className:"hidden sm:flex gap-1",children:f.provider&&r.jsx(ll,{provider:f.provider})})]}),r.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))})]},o.id)})})}function jd({tab:e}){const{projectId:t}=Fu({from:"/projects/$projectId"}),n=Bi(),{dashboard:a,isLoading:o,refetch:c}=La();if(!a||o)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-48"}),r.jsx("div",{className:"skeleton-text-sm w-32"})]}),r.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(oe=>r.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[r.jsx("div",{className:"skeleton-circle size-20"}),r.jsx("div",{className:"skeleton-text w-16 mt-3"})]},oe))}),r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-28"}),r.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(oe=>r.jsx("div",{className:"skeleton-text-sm w-full"},oe))})]})]});const u=r4(a,t),[f,m]=w.useState(!1),[p,v]=w.useState(!1),[y,b]=w.useState(!1),[x,N]=w.useState(""),[S,C]=w.useState(!1),[k,A]=w.useState(!1),[T,z]=w.useState(""),[M,$]=w.useState(!1),[E,O]=w.useState(!1),[K,W]=w.useState(""),[J,ne]=w.useState(!1),[fe,Ee]=w.useState(void 0),[xe,H]=w.useState(!1),[ae,pe]=w.useState(null),[he,P]=w.useState(!1),R=u?.visibilityEvidence??[],B=u?.project.name??"",re=u?.project.displayName||u?.project.name||B,Z=JN(),V=w.useMemo(()=>new Set(R.map(oe=>oe.location??"")),[R]),se=V.has(""),ge=w.useMemo(()=>[...V].filter(Boolean),[V]);w.useEffect(()=>{if(fe===void 0||fe===""||!B){pe(null),P(!1);return}P(!0),rj(B,fe).then(oe=>{pe(oe),P(!1)}).catch(()=>{pe(null),P(!1)})},[fe,B]);const je=w.useMemo(()=>{if(!ae)return null;const oe=new Map;for(const Qe of ae){for(const[ut,Qt]of Object.entries(Qe.providerRuns??{}))oe.set(`${Qe.keyword}::${ut}`,Qt.map(Ye=>({runId:Ye.runId,citationState:Ye.citationState,createdAt:Ye.createdAt,answerMentioned:Ye.answerMentioned,visibilityState:Ye.visibilityState,visibilityTransition:Ye.visibilityTransition})));(!Qe.providerRuns||Object.keys(Qe.providerRuns).length===0)&&oe.set(`${Qe.keyword}::`,Qe.runs.map(ut=>({runId:ut.runId,citationState:ut.citationState,createdAt:ut.createdAt,answerMentioned:ut.answerMentioned,visibilityState:ut.visibilityState,visibilityTransition:ut.visibilityTransition})))}return oe},[ae]),de=w.useMemo(()=>{const oe=fe!==void 0?R.filter(Qe=>fe===""?!Qe.location:Qe.location===fe):R;return je?oe.map(Qe=>{const ut=je.get(`${Qe.keyword}::${Qe.provider}`)??je.get(`${Qe.keyword}::`);return ut?{...Qe,runHistory:ut}:Qe}):oe},[R,fe,je]);if(!u)return r.jsx("div",{className:"page-container",children:r.jsxs(Me,{className:"surface-card empty-card",children:[r.jsx("h1",{children:"Project not found"}),r.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),r.jsx(le,{asChild:!0,children:r.jsx(St,{to:"/",children:"Return to overview"})})]})});async function Ae(){try{await Z.mutateAsync({projectName:B,projectLabel:re,sourceAction:"project-run"}),c()}catch{}}async function Re(){v(!0);try{await l2(B),Ze({title:"Project deleted",detail:`${re} was removed.`,tone:"positive",dedupeKey:`project:delete:${B}`,dedupeMode:"drop"}),n({to:"/"}),c()}catch(oe){console.error("Failed to delete project:",oe)}finally{v(!1)}}async function ce(){const oe=await c2(B),Qe=typeof oe=="string"?oe:JSON.stringify(oe,null,2),ut=new Blob([Qe],{type:"text/yaml"}),Qt=URL.createObjectURL(ut),Ye=document.createElement("a");Ye.href=Qt,Ye.download=`${B}.yaml`,Ye.click()}async function Pe(){const oe=x.split(`
|
|
237
|
-
`).map(Qe=>Qe.trim()).filter(Boolean);if(oe.length!==0){C(!0);try{await n2(B,oe),c(),N(""),b(!1)}finally{C(!1)}}}async function Ve(){const oe=T.trim();if(oe){$(!0);try{const ut=(await aj(B)).map(Ye=>Ye.domain),Qt=[...new Set([...ut,oe])];await oj(B,Qt),c(),z(""),A(!1)}finally{$(!1)}}}async function Vt(){const oe=K.trim();if(oe){ne(!0);try{const Qe=u?.project.ownedDomains??[];await Hb(B,[...Qe,oe]),c(),W(""),O(!1)}finally{ne(!1)}}}async function Ut(oe){ne(!0);try{const Qe=u?.project.ownedDomains??[];await Hb(B,Qe.filter(ut=>ut!==oe)),c()}finally{ne(!1)}}async function Mn(oe,Qe){await s2(oe,Qe),c()}const nn=oe=>!Number.isNaN(Number.parseInt(oe,10)),Tt=[{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 r.jsxs("div",{className:"page-container",children:[f?r.jsxs(Me,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[r.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),r.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",r.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."]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx(le,{type:"button",variant:"destructive",disabled:p,onClick:Re,children:p?"Deleting...":"Yes, delete project"}),r.jsx(le,{type:"button",variant:"outline",disabled:p,onClick:()=>m(!1),children:"Cancel"})]})]}):null,r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:u.project.displayName||u.project.name}),r.jsxs("p",{className:"page-subtitle",children:[u.project.canonicalDomain,(u.project.ownedDomains??[]).length===0&&!E&&r.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>O(!0),children:"+ add domain"})," "," · ",u.contextLabel]}),r.jsxs("div",{className:"tag-row",children:[r.jsx("span",{className:"tag",children:u.project.country}),r.jsx("span",{className:"tag",children:u.project.language.toUpperCase()}),u.project.tags.map(oe=>r.jsx("span",{className:"tag",children:oe},oe))]}),((u.project.ownedDomains??[]).length>0||E)&&r.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(u.project.ownedDomains??[]).map(oe=>r.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:[oe,r.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:J,onClick:()=>Ut(oe),"aria-label":`Remove ${oe}`,children:"×"})]},oe)),E?r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.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:K,onChange:oe=>W(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&Vt(),autoFocus:!0}),r.jsx(le,{type:"button",size:"sm",disabled:!K.trim()||J,onClick:Vt,children:J?"...":"Add"}),r.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{O(!1),W("")},children:"Cancel"})]}):r.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:()=>O(!0),children:"+ domain"})]})]}),r.jsxs("div",{className:"page-header-right",children:[r.jsx("p",{className:"text-sm text-zinc-500",children:u.dateRangeLabel}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(le,{type:"button",variant:"outline",size:"icon",onClick:ce,"aria-label":"Export project as YAML",children:r.jsx(uE,{className:"h-4 w-4 text-zinc-400"})}),r.jsx(le,{type:"button",variant:"outline",size:"icon",onClick:()=>m(!0),"aria-label":"Delete project",children:r.jsx(TE,{className:"h-4 w-4 text-zinc-400"})}),r.jsx(le,{type:"button",disabled:Z.isPending,onClick:Ae,children:Z.isPending?"Starting...":"Run now"})]})]})]}),r.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:Tt.map(oe=>r.jsx(St,{to:oe.href,className:`project-subnav-link ${oe.key===e?"project-subnav-link-active":""}`,"aria-current":oe.key===e?"page":void 0,children:oe.label},oe.key))}),e==="overview"?r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"gauge-row",children:[r.jsx(VN,{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}),r.jsxs("div",{className:"metric-card",children:[r.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Key Phrases",r.jsx(hn,{text:"Tracked key phrases where competitors are cited in the latest completed visibility run but your domain is not."})]}),r.jsxs("p",{className:"metric-card-big-value",children:[r.jsx("span",{className:"text-zinc-50",children:u.gapKeyPhrases.value}),r.jsxs("span",{className:"text-zinc-600",children:[" / ",u.keywordCounts.total]})]}),r.jsx("div",{className:"metric-card-bar",children:r.jsx("div",{className:`metric-card-bar-fill progress-fill-${u.gapKeyPhrases.tone}`,style:{width:u.gapKeyPhrases.progress!==void 0?`${u.gapKeyPhrases.progress*100}%`:"0%"}})}),r.jsx("p",{className:"metric-card-detail",children:u.gapKeyPhrases.delta}),r.jsx("p",{className:"metric-card-sub",children:u.gapKeyPhrases.description})]}),r.jsxs("div",{className:"metric-card",children:[r.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",r.jsx(hn,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),r.jsxs("p",{className:"metric-card-big-value",children:[r.jsx("span",{className:"text-zinc-50",children:u.indexCoverage.value}),r.jsx("span",{className:"text-zinc-600",children:"%"})]}),r.jsx("div",{className:"metric-card-bar",children:r.jsx("div",{className:`metric-card-bar-fill progress-fill-${u.indexCoverage.tone}`,style:{width:`${Number.parseInt(u.indexCoverage.value,10)||0}%`}})}),r.jsx("p",{className:"metric-card-detail",children:u.indexCoverage.delta}),r.jsx("p",{className:"metric-card-sub",children:u.indexCoverage.description})]}),r.jsxs("div",{className:"metric-card",children:[r.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",r.jsx(hn,{text:"Keyword-level citation changes compared to the previous completed run."})]}),u.movementSummary.hasPreviousRun?r.jsxs("div",{className:"metric-card-movement",children:[r.jsxs("span",{className:u.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",u.movementSummary.gained," gained"]}),r.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),r.jsxs("span",{className:u.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",u.movementSummary.lost," lost"]})]}):r.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),r.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&&r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),r.jsxs("h2",{children:["Visibility by model ",r.jsx(hn,{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."})]})]})}),r.jsx("div",{className:"evidence-table-wrap",children:r.jsxs("table",{className:"evidence-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Model"}),r.jsx("th",{children:"Score"}),r.jsx("th",{children:"Cited key phrases"})]})}),r.jsx("tbody",{children:u.providerScores.map(oe=>r.jsxs("tr",{children:[r.jsx("td",{children:r.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[r.jsx(ll,{provider:oe.provider}),oe.model&&r.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:oe.model})]})}),r.jsx("td",{children:r.jsxs("span",{className:`font-semibold ${oe.score>=70?"text-emerald-400":oe.score>=40?"text-amber-400":"text-rose-400"}`,children:[oe.score,"%"]})}),r.jsxs("td",{className:"text-zinc-500",children:[oe.cited," of ",oe.total]})]},`${oe.provider}::${oe.model??"unknown"}`))})]})})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),r.jsx("h2",{children:"Citation signals"})]})}),r.jsx(K$,{insights:u.insights})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),r.jsx("h2",{children:"Key phrase citation tracking"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("p",{className:"supporting-copy",children:[new Set(u.visibilityEvidence.map(oe=>oe.keyword)).size," key phrases tracked"]}),r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>b(!y),children:y?"Cancel":"+ Add key phrases"})]})]}),y&&r.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[r.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:x,onChange:oe=>N(oe.target.value)}),r.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[r.jsxs("p",{className:"text-xs text-zinc-500",children:[x.split(`
|
|
238
|
-
`).filter(oe=>oe.trim()).length," key phrases"]}),r.jsx(le,{type:"button",size:"sm",disabled:!x.trim()||S,onClick:Pe,children:S?"Adding...":"Add key phrases"})]})]}),u.project.locations&&u.project.locations.length>0&&r.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[r.jsx("button",{className:`filter-chip ${fe===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":fe===void 0,onClick:()=>{Ee(void 0)},children:"All locations"}),u.project.locations.map(oe=>V.has(oe.label)&&r.jsx("button",{className:`filter-chip ${fe===oe.label?"filter-chip-active":""}`,type:"button","aria-pressed":fe===oe.label,onClick:()=>{Ee(oe.label),H(!1)},children:oe.label},oe.label)),se&&r.jsx("button",{className:`filter-chip ${fe===""?"filter-chip-active":""}`,type:"button","aria-pressed":fe==="",onClick:()=>{Ee(""),H(!1)},children:"No location"}),ge.length>1&&fe===void 0&&r.jsx("button",{className:`filter-chip filter-chip-compare ${xe?"filter-chip-active":""}`,type:"button","aria-pressed":xe,onClick:()=>H(oe=>!oe),title:"Side-by-side location comparison",children:"Compare"})]}),r.jsx(p$,{evidence:de})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsxs("div",{className:"section-head section-head-inline",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),r.jsx("h2",{children:"Competitive landscape"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("p",{className:"supporting-copy",children:[u.competitors.length," tracked"]}),r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&r.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[r.jsx("input",{className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",type:"text",placeholder:"competitor.com",value:T,onChange:oe=>z(oe.target.value),onKeyDown:oe=>oe.key==="Enter"&&Ve()}),r.jsx(le,{type:"button",size:"sm",disabled:!T.trim()||M,onClick:Ve,children:M?"Adding...":"Add"})]}),r.jsx(g$,{competitors:u.competitors})]}),r.jsxs("section",{className:"page-section-divider",children:[r.jsx("div",{className:"section-head section-head-inline",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),r.jsx("h2",{children:"Recent execution history"})]})}),r.jsx("div",{className:"run-list",children:u.recentRuns.map(oe=>r.jsx(ZN,{run:oe},oe.id))})]}),r.jsx(M$,{project:{...u.project,displayName:u.project.displayName??u.project.name,defaultLocation:u.project.defaultLocation??null},onUpdateProject:Mn,onRefresh:()=>{c()}}),r.jsx(P$,{projectName:u.project.name}),r.jsx(I$,{projectName:u.project.name})]}):e==="analytics"?r.jsx(b$,{projectName:u.project.name}):e==="traffic"?r.jsx(N$,{projectName:u.project.name}):r.jsx(q$,{projectName:u.project.name})]})}function H$(){const{dashboard:e,isLoading:t}=La(),n=A$();if(!e||t)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-20"}),r.jsx("div",{className:"skeleton-text-sm w-72"})]}),r.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(m=>r.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[r.jsxs("div",{className:"flex-1 space-y-1.5",children:[r.jsx("div",{className:"skeleton-text w-40"}),r.jsx("div",{className:"skeleton-text-sm w-56"})]}),r.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},m))})]});const a=e.runs,[o,c]=w.useState("all"),u=o==="all"?a:a.filter(m=>m.status===o),f=async()=>{try{await n.mutateAsync(void 0)}catch{}};return r.jsxs("div",{className:"page-container",children:[r.jsxs("div",{className:"page-header",children:[r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Runs"}),r.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),r.jsx(le,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{f()},children:n.isPending?"Queueing…":"Run all projects"})]}),r.jsxs("section",{children:[r.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(m=>r.jsx("button",{className:`filter-chip ${o===m?"filter-chip-active":""}`,type:"button","aria-pressed":o===m,onClick:()=>c(m),children:m==="all"?"All runs":Xu(m)},m))}),r.jsx("div",{className:"run-list",children:u.length>0?u.map(m=>r.jsx(ZN,{run:m},m.id)):r.jsxs(Me,{className:"surface-card empty-card",children:[r.jsx("h2",{children:"No runs match this filter"}),r.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function G$({providerName:e,keyUrl:t,modelHint:n,onSaved:a}){const o=e.toLowerCase()==="local",[c,u]=w.useState(""),[f,m]=w.useState(""),[p,v]=w.useState(""),[y,b]=w.useState(""),[x,N]=w.useState(""),[S,C]=w.useState(""),[k,A]=w.useState(!1),[T,z]=w.useState(null),[M,$]=w.useState(!1),E=o?f.trim().length>0:c.trim().length>0;async function O(){if(E){A(!0),z(null),$(!1);try{const W=xe=>{const H=parseInt(xe.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},J={},ne=W(y);ne!==void 0&&(J.maxConcurrency=ne);const fe=W(x);fe!==void 0&&(J.maxRequestsPerMinute=fe);const Ee=W(S);Ee!==void 0&&(J.maxRequestsPerDay=Ee),await h2(e.toLowerCase(),{...c.trim()?{apiKey:c.trim()}:{},...f.trim()?{baseUrl:f.trim()}:{},...p.trim()?{model:p.trim()}:{},...Object.keys(J).length>0?{quota:J}:{}}),u(""),m(""),v(""),b(""),N(""),C(""),$(!0),Ze({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),a()}catch(W){z(W instanceof Error?W.message:"Failed to update provider")}finally{A(!1)}}}const K=n??"Use default model";return r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[o&&r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),r.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:W=>m(W.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",o?" (optional)":""]}),t&&r.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 ","↗"]})]}),r.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:o?"Optional — most local servers don't need one":`Enter ${e} API key`,value:c,onChange:W=>u(W.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),r.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:K,value:p,onChange:W=>v(W.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),r.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[r.jsxs("div",{children:[r.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:W=>b(W.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),r.jsxs("div",{children:[r.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:x,onChange:W=>N(W.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),r.jsxs("div",{children:[r.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:W=>C(W.target.value)}),r.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),T&&r.jsx("p",{className:"text-xs text-rose-400",children:T}),M&&r.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),r.jsx(le,{type:"button",size:"sm",disabled:!E||k,onClick:O,children:k?"Saving...":"Save"})]})}function F$({onSaved:e}){const[t,n]=w.useState(""),[a,o]=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 b(){if(y){u(!0),m(null),v(!1);try{await m2({clientId:t.trim(),clientSecret:a.trim()}),n(""),o(""),v(!0),Ze({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(x){m(x instanceof Error?x.message:"Failed to update Google OAuth credentials")}finally{u(!1)}}}return r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),r.jsxs("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 ","↗"]})]}),r.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:x=>n(x.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),r.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:x=>o(x.target.value)})]}),r.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",r.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),f&&r.jsx("p",{className:"text-xs text-rose-400",children:f}),p&&r.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),r.jsx(le,{type:"button",size:"sm",disabled:!y||c,onClick:b,children:c?"Saving...":"Save Google OAuth app"})]})}function Z$(){const[e,t]=w.useState(null),[n,a]=w.useState(null),[o,c]=w.useState(!1),[u,f]=w.useState("localhost"),[m,p]=w.useState("9222"),[v,y]=w.useState(!1);return w.useEffect(()=>{Fb().then(t).catch(b=>{const x=b instanceof Error?b.message:String(b);x.includes("501")||a(x)})},[]),r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),r.jsx("h2",{children:"ChatGPT (CDP)"})]}),r.jsx(lt,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&r.jsxs("div",{children:[r.jsx("dt",{children:"Endpoint"}),r.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&r.jsxs("div",{children:[r.jsx("dt",{children:"Browser"}),r.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&r.jsxs("div",{children:[r.jsx("dt",{children:"Tabs"}),r.jsx("dd",{children:e.targets.map(b=>r.jsxs("span",{className:"mr-2",children:[b.name,": ",b.alive?"● alive":"○ idle"]},b.name))})]})]}),r.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.":n||"Not configured. Set an endpoint below or run: canonry cdp connect --host localhost --port 9222"}),r.jsx("div",{className:"mt-2",children:r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>c(!o),children:o?"Cancel":e?.connected?"Update endpoint":"Configure"})}),o&&r.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async b=>{b.preventDefault(),y(!0);try{await $2(u,parseInt(m,10)||9222);const x=await Fb().catch(()=>null);x&&t(x),c(!1),Ze({title:"CDP endpoint saved",detail:`${u}:${parseInt(m,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(x){a(x instanceof Error?x.message:String(x))}finally{y(!1)}},children:[r.jsxs("div",{className:"flex gap-2",children:[r.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:b=>f(b.target.value),"aria-label":"CDP host"}),r.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:b=>p(b.target.value),"aria-label":"CDP port"})]}),r.jsx("div",{children:r.jsx(le,{type:"submit",size:"sm",disabled:v,children:v?"Saving…":"Save endpoint"})})]})]})}const V$={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function Q$(){const e=vl(),{dashboard:t}=La(),n=t?.settings??e?.dashboard?.settings,c=cd(!e,e?.health).data??e?.health??V$,[u,f]=w.useState(null),[m,p]=w.useState(!1),[v,y]=w.useState(!1),[b,x]=w.useState(""),[N,S]=w.useState(!1),[C,k]=w.useState(null),[A,T]=w.useState(!1);return n?r.jsxs("div",{className:"page-container",children:[r.jsx("div",{className:"page-header",children:r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Settings"}),r.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),r.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(z=>r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),r.jsx("h2",{children:z.displayName??z.name})]}),r.jsx(lt,{tone:z.state==="ready"?"positive":"caution",children:z.state==="ready"?"Ready":"Needs config"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Model"}),r.jsx("dd",{className:"font-mono text-xs",children:z.model})]}),z.quota&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Concurrency"}),r.jsx("dd",{children:z.quota.maxConcurrency})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Rate limit"}),r.jsxs("dd",{children:[z.quota.maxRequestsPerMinute,"/min · ",z.quota.maxRequestsPerDay,"/day"]})]})]})]}),r.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:z.detail}),r.jsx("div",{className:"mt-2",children:r.jsx(le,{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&&r.jsx(G$,{providerName:z.name,keyUrl:z.keyUrl,modelHint:z.modelHint,onSaved:()=>{f(null)}})]},z.name)),r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),r.jsx("h2",{children:"Search Console OAuth"})]}),r.jsx(lt,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Auth model"}),r.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Storage"}),r.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),r.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),r.jsx("div",{className:"mt-2",children:r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>p(!m),children:m?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),m&&r.jsx(F$,{onSaved:()=>{p(!1)}})]}),r.jsxs(Me,{className:"surface-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),r.jsx("h2",{children:"Webmaster Tools"})]}),r.jsx(lt,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),r.jsxs("dl",{className:"definition-list mt-3",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Auth model"}),r.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Storage"}),r.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),r.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),r.jsx("div",{className:"mt-2",children:r.jsx(le,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!v),children:v?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),v&&r.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),r.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"})]}),r.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:b,onChange:z=>x(z.target.value)})]}),r.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",r.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),C&&r.jsx("p",{className:"text-xs text-rose-400",children:C}),A&&r.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),r.jsx(le,{type:"button",size:"sm",disabled:!b.trim()||N,onClick:async()=>{if(b.trim()){S(!0),k(null),T(!1);try{await K2(b.trim()),x(""),T(!0),y(!1),Ze({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"})]})]}),r.jsx(Z$,{}),r.jsxs(Me,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),r.jsx("h2",{children:"API and worker"})]})}),r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"health-row",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:"API"}),r.jsx("p",{className:"supporting-copy",children:c.apiStatus.detail})]}),r.jsx(lt,{tone:Ou(c.apiStatus),children:c.apiStatus.state==="ok"?"Healthy":"Attention"})]}),r.jsxs("div",{className:"health-row",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:"Worker"}),r.jsx("p",{className:"supporting-copy",children:c.workerStatus.detail})]}),r.jsx(lt,{tone:Ou(c.workerStatus),children:c.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),r.jsx("section",{className:"page-section",children:r.jsxs(Me,{className:"surface-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),r.jsx("h2",{children:"Operational guidance"})]})}),r.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(z=>r.jsx("li",{children:z},z))}),r.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const Y$=[{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 J$({current:e,labels:t}){return r.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,a)=>{const o=a<e,c=a===e;return r.jsxs("div",{className:`setup-step ${o?"setup-step-done":""} ${c?"setup-step-active":""}`,role:"listitem","aria-current":c?"step":void 0,children:[r.jsx("span",{className:"setup-step-number",children:o?"✓":a+1}),r.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function X$(){const e=vl(),{dashboard:t,isLoading:n,refetch:a}=La(),o=t??e?.dashboard;if(!o||n)return r.jsxs("div",{className:"page-skeleton",children:[r.jsxs("div",{className:"page-skeleton-header",children:[r.jsx("div",{className:"skeleton-text h-6 w-24"}),r.jsx("div",{className:"skeleton-text-sm w-80"})]}),r.jsxs("div",{className:"page-skeleton-card",children:[r.jsx("div",{className:"skeleton-text w-32"}),r.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(ue=>r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"space-y-1 flex-1",children:[r.jsx("div",{className:"skeleton-text w-24"}),r.jsx("div",{className:"skeleton-text-sm w-48"})]}),r.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},ue))})]})]});const c=o.settings,m=cd(!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=W4(o.setup,m,c),v=Bi(),[y,b]=w.useState(0),[x,N]=w.useState(""),[S,C]=w.useState(""),[k,A]=w.useState(""),[T,z]=w.useState("US"),[M,$]=w.useState("en"),[E,O]=w.useState(null),[K,W]=w.useState(null),[J,ne]=w.useState(null),[fe,Ee]=w.useState(!1),[xe,H]=w.useState(""),[ae,pe]=w.useState(!1),[he,P]=w.useState(null),[R,B]=w.useState(!1),re=c.providerStatuses.filter(ue=>ue.state==="ready"),[Z,V]=w.useState(re[0]?.name??""),[se,ge]=w.useState(5),[je,de]=w.useState(!1),[Ae,Re]=w.useState(null),[ce,Pe]=w.useState(""),[Ve,Vt]=w.useState(!1),[Ut,Mn]=w.useState(null),[nn,Tt]=w.useState(!1),[oe,Qe]=w.useState(!1),[ut,Qt]=w.useState(!1),Ye=JN(),Ue=x.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Xe=xe.split(`
|
|
239
|
-
`).map(ue=>ue.trim()).filter(Boolean),Ct=ce.split(`
|
|
240
|
-
`).map(ue=>ue.trim()).filter(Boolean),He=p.healthChecks.some(ue=>ue.id==="api"&&ue.state==="ready"),Ma=async()=>{if(!(!Ue||!k)){Ee(!0),ne(null);try{const ue=await Qu(Ue,{displayName:S||x,canonicalDomain:k,country:T,language:M});O(Ue),W(ue.id),Ze({title:"Project created",detail:`${ue.displayName||ue.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ue.name}`,dedupeMode:"drop"}),a(),b(2)}catch(ue){ne(ue instanceof Error?ue.message:"Failed to create project")}finally{Ee(!1)}}},gn=async()=>{if(!E)return;const ue=Xe;if(ue.length!==0){B(!0),P(null);try{await t2(E,ue),pe(!0),a(),b(3)}catch(zn){P(zn instanceof Error?zn.message:"Failed to save key phrases")}finally{B(!1)}}},st=async()=>{if(!(!E||!Z)){de(!0),Re(null);try{const ue=await S2(E,Z,se);if(ue.keywords.length>0){const zn=xe?xe.trimEnd()+`
|
|
241
|
-
`+ue.keywords.join(`
|
|
242
|
-
`):ue.keywords.join(`
|
|
243
|
-
`);H(zn)}}catch(ue){Re(ue instanceof Error?ue.message:"Failed to generate key phrases")}finally{de(!1)}}},Xr=async()=>{if(!E)return;const ue=Ct;if(ue.length!==0){Tt(!0),Mn(null);try{await oj(E,ue),Vt(!0),a(),b(4)}catch(zn){Mn(zn instanceof Error?zn.message:"Failed to save competitors")}finally{Tt(!1)}}},ns=async()=>{if(E){Qt(!0);try{await Ye.mutateAsync({projectName:E,projectLabel:S||x||E,sourceAction:"setup-launch"}),Qe(!0),a()}catch{}finally{Qt(!1)}}},mt=()=>b(ue=>Math.max(0,ue-1)),yn=(()=>{switch(y){case 0:return r.jsxs(Me,{className:"surface-card step-card",children:[r.jsx("div",{className:"section-head",children:r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),r.jsx("h2",{children:"System ready"})]})}),r.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),r.jsx("div",{className:"compact-stack",children:p.healthChecks.map(ue=>r.jsxs("div",{className:"health-check-row",children:[r.jsxs("div",{children:[r.jsx("p",{className:"run-row-title",children:ue.label}),r.jsx("p",{className:"supporting-copy",children:ue.detail}),ue.id==="provider"&&ue.state!=="ready"&&r.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"})]}),r.jsx(lt,{tone:ue.state==="ready"?"positive":"caution",children:ue.state==="ready"?"Ready":"Attention"})]},ue.id))}),r.jsxs("div",{className:"setup-nav",children:[r.jsx("span",{}),r.jsx(le,{type:"button",disabled:!He,onClick:()=>b(1),children:"Continue"})]})]});case 1:return r.jsxs(Me,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),r.jsx("h2",{children:"Create project"})]}),E?r.jsx(lt,{tone:"positive",children:"Created"}):null]}),E?r.jsxs("div",{className:"compact-stack",children:[r.jsxs("p",{className:"text-zinc-300",children:["Project ",r.jsx("span",{className:"text-zinc-100 font-medium",children:E})," created successfully."]}),r.jsxs("div",{className:"setup-nav",children:[r.jsx(le,{type:"button",variant:"outline",onClick:mt,children:"Back"}),r.jsx(le,{type:"button",onClick:()=>b(2),children:"Continue"})]})]}):r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),r.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:x,onChange:ue=>N(ue.target.value)}),Ue&&Ue!==x?r.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ue]}):null]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),r.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:S,onChange:ue=>C(ue.target.value)})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),r.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:ue=>A(ue.target.value)})]}),r.jsxs("div",{className:"setup-field-row",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),r.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:T,onChange:ue=>z(ue.target.value.toUpperCase())})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),r.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:M,onChange:ue=>$(ue.target.value.toLowerCase())})]})]}),J?r.jsx("p",{className:"text-rose-400 text-sm",children:J}):null,r.jsxs("div",{className:"setup-nav",children:[r.jsx(le,{type:"button",variant:"outline",onClick:mt,children:"Back"}),r.jsx(le,{type:"button",disabled:!Ue||!k||fe,onClick:Ma,children:fe?"Creating...":"Create project"})]})]})]});case 2:return r.jsxs(Me,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),r.jsx("h2",{children:"Add key phrases"})]}),ae?r.jsxs(lt,{tone:"positive",children:[Xe.length," saved"]}):r.jsxs(lt,{tone:"neutral",children:[Xe.length," key phrase",Xe.length!==1?"s":""]})]}),r.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ae?r.jsxs("div",{className:"compact-stack",children:[r.jsx("ul",{className:"detail-list",children:Xe.map(ue=>r.jsx("li",{children:ue},ue))}),r.jsxs("div",{className:"setup-nav",children:[r.jsx(le,{type:"button",variant:"outline",onClick:mt,children:"Back"}),r.jsx(le,{type:"button",onClick:()=>b(3),children:"Continue"})]})]}):r.jsxs("div",{className:"compact-stack",children:[re.length>0?r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[r.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",r.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),r.jsxs("div",{className:"flex items-end gap-2",children:[r.jsxs("div",{className:"setup-field flex-1",children:[r.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),r.jsx("select",{id:"gen-provider",className:"setup-input",value:Z,onChange:ue=>V(ue.target.value),children:re.map(ue=>r.jsxs("option",{value:ue.name,children:[ue.displayName??ue.name,ue.model?` (${ue.model})`:""]},ue.name))})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),r.jsx("select",{id:"gen-count",className:"setup-input",value:se,onChange:ue=>ge(Number(ue.target.value)),children:[3,5,10,15,20].map(ue=>r.jsx("option",{value:ue,children:ue},ue))})]}),r.jsx(le,{type:"button",variant:"outline",disabled:je||!Z,onClick:st,children:je?"Analyzing site...":"Generate"})]}),Ae?r.jsx("p",{className:"text-rose-400 text-sm",children:Ae}):null]}):null,r.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[r.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",r.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"keywords",children:"Key phrases (one per line)"}),r.jsx("textarea",{id:"keywords",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
244
|
-
best invisalign downtown brooklyn
|
|
245
|
-
pediatric dentist brooklyn heights`,value:xe,onChange:ue=>H(ue.target.value)})]}),he?r.jsx("p",{className:"text-rose-400 text-sm",children:he}):null,r.jsxs("div",{className:"setup-nav",children:[r.jsx(le,{type:"button",variant:"outline",onClick:mt,children:"Back"}),r.jsx(le,{type:"button",disabled:Xe.length===0||R,onClick:gn,children:R?"Saving...":`Save ${Xe.length} key phrase${Xe.length!==1?"s":""}`})]})]})]});case 3:return r.jsxs(Me,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),r.jsx("h2",{children:"Add competitors"})]}),Ve?r.jsx(lt,{tone:"positive",children:"Saved"}):null]}),r.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same key phrases. One per line."}),Ve?r.jsxs("div",{className:"compact-stack",children:[r.jsx("ul",{className:"detail-list",children:Ct.map(ue=>r.jsx("li",{children:ue},ue))}),r.jsxs("div",{className:"setup-nav",children:[r.jsx(le,{type:"button",variant:"outline",onClick:mt,children:"Back"}),r.jsx(le,{type:"button",onClick:()=>b(4),children:"Continue"})]})]}):r.jsxs("div",{className:"compact-stack",children:[r.jsxs("div",{className:"setup-field",children:[r.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),r.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
246
|
-
competitor2.com`,value:ce,onChange:ue=>Pe(ue.target.value)})]}),Ut?r.jsx("p",{className:"text-rose-400 text-sm",children:Ut}):null,r.jsxs("div",{className:"setup-nav",children:[r.jsx(le,{type:"button",variant:"outline",onClick:mt,children:"Back"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(le,{type:"button",variant:"outline",onClick:()=>b(4),children:"Skip"}),r.jsx(le,{type:"button",disabled:Ct.length===0||nn,onClick:Xr,children:nn?"Saving...":`Save ${Ct.length} competitor${Ct.length!==1?"s":""}`})]})]})]})]});case 4:return r.jsxs(Me,{className:"surface-card step-card",children:[r.jsxs("div",{className:"section-head",children:[r.jsxs("div",{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),r.jsx("h2",{children:"Launch first run"})]}),oe?r.jsx(lt,{tone:"positive",children:"Queued"}):null]}),oe?r.jsxs("div",{className:"compact-stack",children:[r.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),r.jsxs("div",{className:"setup-nav",children:[r.jsx("span",{}),r.jsx(le,{type:"button",onClick:()=>v({to:K?`/projects/${K}`:"/"}),children:"Open project"})]})]}):r.jsxs("div",{className:"compact-stack",children:[r.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",r.jsx("span",{className:"text-zinc-100 font-medium",children:E}),"."]}),r.jsxs("div",{className:"setup-nav",children:[r.jsx(le,{type:"button",variant:"outline",onClick:mt,children:"Back"}),r.jsx(le,{type:"button",disabled:ut,onClick:ns,children:ut?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return r.jsxs("div",{className:"page-container",children:[r.jsx("div",{className:"page-header",children:r.jsxs("div",{className:"page-header-left",children:[r.jsx("h1",{className:"page-title",children:"Setup"}),r.jsx("p",{className:"page-subtitle",children:"Create a project, add key phrases, add competitors, and launch the first run."})]})}),r.jsx(J$,{current:y,labels:Y$}),r.jsx("section",{className:"setup-wizard",children:yn})]})}function W$(){return r.jsx("div",{className:"page-container",children:r.jsx("section",{className:"page-section",children:r.jsxs(Me,{className:"surface-card empty-card",children:[r.jsx("h1",{children:"Route not found"}),r.jsx("p",{children:"The current path does not map to a dashboard view."}),r.jsx(le,{asChild:!0,children:r.jsx(St,{to:"/",children:"Return to overview"})})]})})})}function eP(){return r.jsx(V4,{children:r.jsx(Z4,{})})}const ds=M_()({component:eP,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),tP=Wn({getParentRoute:()=>ds,path:"/",component:t3,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Qn.projects.all);if(t&&t.length===0)throw pp({to:"/setup"})}}),nP=Wn({getParentRoute:()=>ds,path:"/projects",component:h$}),Nl=Wn({getParentRoute:()=>ds,path:"/projects/$projectId",component:()=>r.jsx(Np,{})}),sP=Wn({getParentRoute:()=>Nl,path:"/",component:()=>r.jsx(jd,{tab:"overview"})}),iP=Wn({getParentRoute:()=>Nl,path:"/search-console",component:()=>r.jsx(jd,{tab:"search-console"})}),aP=Wn({getParentRoute:()=>Nl,path:"/analytics",component:()=>r.jsx(jd,{tab:"analytics"})}),rP=Wn({getParentRoute:()=>Nl,path:"/traffic",component:()=>r.jsx(jd,{tab:"traffic"})}),oP=Wn({getParentRoute:()=>ds,path:"/runs",component:H$}),lP=Wn({getParentRoute:()=>ds,path:"/settings",component:Q$,beforeLoad:({context:e})=>{}}),cP=Wn({getParentRoute:()=>ds,path:"/setup",component:X$,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Qn.projects.all);if(t&&t.length>0)throw pp({to:"/"})}}),uP=Wn({getParentRoute:()=>ds,path:"*",component:W$}),dP=ds.addChildren([tP,nP,Nl.addChildren([sP,iP,aP,rP]),oP,lP,cP,uP]);function fP(e,t){return F_({routeTree:dP,basepath:Zm||"/",context:{queryClient:e},...t?.initialEntries})}const XN=nE(),hP=fP(XN),WN=document.getElementById("root");if(!WN)throw new Error("Expected #root element for web app bootstrap.");function mP(){const[e,t]=w.useState(Kb()?"ready":"checking"),[n,a]=w.useState(""),[o,c]=w.useState(""),[u,f]=w.useState(null),[m,p]=w.useState(!1);w.useEffect(()=>{if(Kb())return;let b=!1;return u2().then(x=>{b||(x.authenticated?t("ready"):t(x.setupRequired?"setup":"login"))}).catch(x=>{b||(f(x instanceof Error?x.message:"Failed to reach the Canonry API"),t("login"))}),()=>{b=!0}},[]);const v=async b=>{if(b.preventDefault(),!n.trim()||n.trim().length<8){f("Password must be at least 8 characters");return}if(n!==o){f("Passwords do not match");return}p(!0),f(null);try{if(!(await d2(n.trim())).authenticated){f("Setup failed");return}a(""),c(""),t("ready")}catch(x){f(x instanceof Eu||x instanceof Error?x.message:"Setup failed")}finally{p(!1)}},y=async b=>{if(b.preventDefault(),!!n.trim()){p(!0),f(null);try{if(!(await f2(n.trim())).authenticated){f("Incorrect password");return}a(""),t("ready")}catch(x){f(x instanceof Eu||x instanceof Error?x.message:"Authentication failed")}finally{p(!1)}}};return e==="ready"?r.jsx(Kk,{client:XN,children:r.jsx(Q_,{router:hP})}):r.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:r.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:r.jsx(Me,{className:"surface-card w-full",children:e==="checking"?r.jsx(gu,{className:"py-8",children:r.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?r.jsxs(r.Fragment,{children:[r.jsxs(Vm,{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),r.jsx(Qm,{children:"Create a dashboard password"}),r.jsx(Ym,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),r.jsx(gu,{children:r.jsxs("form",{className:"space-y-4",onSubmit:v,children:[r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),r.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:n,onChange:b=>a(b.target.value),placeholder:"At least 8 characters"})]}),r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),r.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:o,onChange:b=>c(b.target.value),placeholder:"Re-enter password"})]}),u?r.jsx("p",{className:"text-sm text-rose-400",children:u}):null,r.jsx(le,{type:"submit",disabled:m||!n.trim()||!o.trim(),children:m?"Setting up…":"Create password & open dashboard"})]})})]}):r.jsxs(r.Fragment,{children:[r.jsxs(Vm,{children:[r.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),r.jsx(Qm,{children:"Sign in to Canonry"}),r.jsx(Ym,{children:"Enter your dashboard password to continue."})]}),r.jsx(gu,{children:r.jsxs("form",{className:"space-y-4",onSubmit:y,children:[r.jsxs("label",{className:"block space-y-1.5",children:[r.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),r.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:n,onChange:b=>a(b.target.value),placeholder:"Dashboard password"})]}),u?r.jsx("p",{className:"text-sm text-rose-400",children:u}):null,r.jsx(le,{type:"submit",disabled:m||!n.trim(),children:m?"Signing in…":"Open dashboard"})]})})]})})})})}vk.createRoot(WN).render(r.jsx(w.StrictMode,{children:r.jsx(mP,{})}));
|