@ainyc/canonry 4.21.4 → 4.23.1
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-BFfB9cRq.js +302 -0
- package/assets/index.html +1 -1
- package/dist/{chunk-VFKGHXVJ.js → chunk-6EJ54OX7.js} +26 -3
- package/dist/{chunk-3UGJUNQX.js → chunk-E5PZ23OS.js} +654 -110
- package/dist/{chunk-EY63PENL.js → chunk-EUGCQSFC.js} +12 -0
- package/dist/{chunk-GVQYROIK.js → chunk-OYYFXKRK.js} +1 -1
- package/dist/cli.js +107 -9
- package/dist/index.d.ts +17 -0
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-5COCQKXG.js → intelligence-service-NVN2PAR7.js} +2 -2
- package/dist/mcp.js +3 -3
- package/package.json +10 -10
- package/assets/assets/index-CYfF3BeK.js +0 -302
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
function yK(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rw={exports:{}},bf={};var kz;function vK(){if(kz)return bf;kz=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:a}}return bf.Fragment=t,bf.jsx=n,bf.jsxs=n,bf}var Cz;function xK(){return Cz||(Cz=1,rw.exports=vK()),rw.exports}var l=xK(),iw={exports:{}},tt={};var Az;function bK(){if(Az)return tt;Az=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function v(D){return D===null||typeof D!="object"?null:(D=y&&D[y]||D["@@iterator"],typeof D=="function"?D:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,j={};function k(D,U,M){this.props=D,this.context=U,this.refs=j,this.updater=M||S}k.prototype.isReactComponent={},k.prototype.setState=function(D,U){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,U,"setState")},k.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function E(){}E.prototype=k.prototype;function C(D,U,M){this.props=D,this.context=U,this.refs=j,this.updater=M||S}var O=C.prototype=new E;O.constructor=C,b(O,k.prototype),O.isPureReactComponent=!0;var z=Array.isArray;function A(){}var _={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function $(D,U,M){var Q=M.ref;return{$$typeof:e,type:D,key:U,ref:Q!==void 0?Q:null,props:M}}function F(D,U){return $(D.type,U,D.props)}function q(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function B(D){var U={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(M){return U[M]})}var V=/\/+/g;function X(D,U){return typeof D=="object"&&D!==null&&D.key!=null?B(""+D.key):U.toString(36)}function Z(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(A,A):(D.status="pending",D.then(function(U){D.status==="pending"&&(D.status="fulfilled",D.value=U)},function(U){D.status==="pending"&&(D.status="rejected",D.reason=U)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function H(D,U,M,Q,oe){var ne=typeof D;(ne==="undefined"||ne==="boolean")&&(D=null);var Ae=!1;if(D===null)Ae=!0;else switch(ne){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(D.$$typeof){case e:case t:Ae=!0;break;case p:return Ae=D._init,H(Ae(D._payload),U,M,Q,oe)}}if(Ae)return oe=oe(D),Ae=Q===""?"."+X(D,0):Q,z(oe)?(M="",Ae!=null&&(M=Ae.replace(V,"$&/")+"/"),H(oe,U,M,"",function(he){return he})):oe!=null&&(q(oe)&&(oe=F(oe,M+(oe.key==null||D&&D.key===oe.key?"":(""+oe.key).replace(V,"$&/")+"/")+Ae)),U.push(oe)),1;Ae=0;var _e=Q===""?".":Q+":";if(z(D))for(var ee=0;ee<D.length;ee++)Q=D[ee],ne=_e+X(Q,ee),Ae+=H(Q,U,M,ne,oe);else if(ee=v(D),typeof ee=="function")for(D=ee.call(D),ee=0;!(Q=D.next()).done;)Q=Q.value,ne=_e+X(Q,ee++),Ae+=H(Q,U,M,ne,oe);else if(ne==="object"){if(typeof D.then=="function")return H(Z(D),U,M,Q,oe);throw U=String(D),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function J(D,U,M){if(D==null)return D;var Q=[],oe=0;return H(D,Q,"","",function(ne){return U.call(M,ne,oe++)}),Q}function ue(D){if(D._status===-1){var U=D._result;U=U(),U.then(function(M){(D._status===0||D._status===-1)&&(D._status=1,D._result=M)},function(M){(D._status===0||D._status===-1)&&(D._status=2,D._result=M)}),D._status===-1&&(D._status=0,D._result=U)}if(D._status===1)return D._result.default;throw D._result}var we=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},I={map:J,forEach:function(D,U,M){J(D,function(){U.apply(this,arguments)},M)},count:function(D){var U=0;return J(D,function(){U++}),U},toArray:function(D){return J(D,function(U){return U})||[]},only:function(D){if(!q(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return tt.Activity=m,tt.Children=I,tt.Component=k,tt.Fragment=n,tt.Profiler=i,tt.PureComponent=C,tt.StrictMode=r,tt.Suspense=d,tt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,tt.__COMPILER_RUNTIME={__proto__:null,c:function(D){return _.H.useMemoCache(D)}},tt.cache=function(D){return function(){return D.apply(null,arguments)}},tt.cacheSignal=function(){return null},tt.cloneElement=function(D,U,M){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Q=b({},D.props),oe=D.key;if(U!=null)for(ne in U.key!==void 0&&(oe=""+U.key),U)!R.call(U,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&U.ref===void 0||(Q[ne]=U[ne]);var ne=arguments.length-2;if(ne===1)Q.children=M;else if(1<ne){for(var Ae=Array(ne),_e=0;_e<ne;_e++)Ae[_e]=arguments[_e+2];Q.children=Ae}return $(D.type,oe,Q)},tt.createContext=function(D){return D={$$typeof:o,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:a,_context:D},D},tt.createElement=function(D,U,M){var Q,oe={},ne=null;if(U!=null)for(Q in U.key!==void 0&&(ne=""+U.key),U)R.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(oe[Q]=U[Q]);var Ae=arguments.length-2;if(Ae===1)oe.children=M;else if(1<Ae){for(var _e=Array(Ae),ee=0;ee<Ae;ee++)_e[ee]=arguments[ee+2];oe.children=_e}if(D&&D.defaultProps)for(Q in Ae=D.defaultProps,Ae)oe[Q]===void 0&&(oe[Q]=Ae[Q]);return $(D,ne,oe)},tt.createRef=function(){return{current:null}},tt.forwardRef=function(D){return{$$typeof:c,render:D}},tt.isValidElement=q,tt.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:ue}},tt.memo=function(D,U){return{$$typeof:f,type:D,compare:U===void 0?null:U}},tt.startTransition=function(D){var U=_.T,M={};_.T=M;try{var Q=D(),oe=_.S;oe!==null&&oe(M,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,we)}catch(ne){we(ne)}finally{U!==null&&M.types!==null&&(U.types=M.types),_.T=U}},tt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},tt.use=function(D){return _.H.use(D)},tt.useActionState=function(D,U,M){return _.H.useActionState(D,U,M)},tt.useCallback=function(D,U){return _.H.useCallback(D,U)},tt.useContext=function(D){return _.H.useContext(D)},tt.useDebugValue=function(){},tt.useDeferredValue=function(D,U){return _.H.useDeferredValue(D,U)},tt.useEffect=function(D,U){return _.H.useEffect(D,U)},tt.useEffectEvent=function(D){return _.H.useEffectEvent(D)},tt.useId=function(){return _.H.useId()},tt.useImperativeHandle=function(D,U,M){return _.H.useImperativeHandle(D,U,M)},tt.useInsertionEffect=function(D,U){return _.H.useInsertionEffect(D,U)},tt.useLayoutEffect=function(D,U){return _.H.useLayoutEffect(D,U)},tt.useMemo=function(D,U){return _.H.useMemo(D,U)},tt.useOptimistic=function(D,U){return _.H.useOptimistic(D,U)},tt.useReducer=function(D,U,M){return _.H.useReducer(D,U,M)},tt.useRef=function(D){return _.H.useRef(D)},tt.useState=function(D){return _.H.useState(D)},tt.useSyncExternalStore=function(D,U,M){return _.H.useSyncExternalStore(D,U,M)},tt.useTransition=function(){return _.H.useTransition()},tt.version="19.2.4",tt}var Oz;function ld(){return Oz||(Oz=1,iw.exports=bK()),iw.exports}var x=ld();const Hi=ba(x),yv=yK({__proto__:null,default:Hi},[x]);var aw={exports:{}},wf={},sw={exports:{}},ow={};var Ez;function wK(){return Ez||(Ez=1,(function(e){function t(H,J){var ue=H.length;H.push(J);e:for(;0<ue;){var we=ue-1>>>1,I=H[we];if(0<i(I,J))H[we]=J,H[ue]=I,ue=we;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var J=H[0],ue=H.pop();if(ue!==J){H[0]=ue;e:for(var we=0,I=H.length,D=I>>>1;we<D;){var U=2*(we+1)-1,M=H[U],Q=U+1,oe=H[Q];if(0>i(M,ue))Q<I&&0>i(oe,M)?(H[we]=oe,H[Q]=ue,we=Q):(H[we]=M,H[U]=ue,we=U);else if(Q<I&&0>i(oe,ue))H[we]=oe,H[Q]=ue,we=Q;else break e}}return J}function i(H,J){var ue=H.sortIndex-J.sortIndex;return ue!==0?ue:H.id-J.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var d=[],f=[],p=1,m=null,y=3,v=!1,S=!1,b=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function O(H){for(var J=n(f);J!==null;){if(J.callback===null)r(f);else if(J.startTime<=H)r(f),J.sortIndex=J.expirationTime,t(d,J);else break;J=n(f)}}function z(H){if(b=!1,O(H),!S)if(n(d)!==null)S=!0,A||(A=!0,B());else{var J=n(f);J!==null&&Z(z,J.startTime-H)}}var A=!1,_=-1,R=5,$=-1;function F(){return j?!0:!(e.unstable_now()-$<R)}function q(){if(j=!1,A){var H=e.unstable_now();$=H;var J=!0;try{e:{S=!1,b&&(b=!1,E(_),_=-1),v=!0;var ue=y;try{t:{for(O(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var we=m.callback;if(typeof we=="function"){m.callback=null,y=m.priorityLevel;var I=we(m.expirationTime<=H);if(H=e.unstable_now(),typeof I=="function"){m.callback=I,O(H),J=!0;break t}m===n(d)&&r(d),O(H)}else r(d);m=n(d)}if(m!==null)J=!0;else{var D=n(f);D!==null&&Z(z,D.startTime-H),J=!1}}break e}finally{m=null,y=ue,v=!1}J=void 0}}finally{J?B():A=!1}}}var B;if(typeof C=="function")B=function(){C(q)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,X=V.port2;V.port1.onmessage=q,B=function(){X.postMessage(null)}}else B=function(){k(q,0)};function Z(H,J){_=k(function(){H(e.unstable_now())},J)}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"):R=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var J=3;break;default:J=y}var ue=y;y=J;try{return H()}finally{y=ue}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,J){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ue=y;y=H;try{return J()}finally{y=ue}},e.unstable_scheduleCallback=function(H,J,ue){var we=e.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?we+ue:we):ue=we,H){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=ue+I,H={id:p++,callback:J,priorityLevel:H,startTime:ue,expirationTime:I,sortIndex:-1},ue>we?(H.sortIndex=ue,t(f,H),n(d)===null&&H===n(f)&&(b?(E(_),_=-1):b=!0,Z(z,ue-we))):(H.sortIndex=I,t(d,H),S||v||(S=!0,A||(A=!0,B()))),H},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(H){var J=y;return function(){var ue=y;y=J;try{return H.apply(this,arguments)}finally{y=ue}}}})(ow)),ow}var _z;function SK(){return _z||(_z=1,sw.exports=wK()),sw.exports}var lw={exports:{}},br={};var zz;function jK(){if(zz)return br;zz=1;var e=ld();function t(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={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},i=Symbol.for("react.portal");function a(d,f,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:d,containerInfo:f,implementation:p}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return br.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,br.createPortal=function(d,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return a(d,f,null,p)},br.flushSync=function(d){var f=o.T,p=r.p;try{if(o.T=null,r.p=2,d)return d()}finally{o.T=f,r.p=p,r.d.f()}},br.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(d,f))},br.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},br.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},br.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},br.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},br.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},br.requestFormReset=function(d){r.d.r(d)},br.unstable_batchedUpdates=function(d,f){return d(f)},br.useFormState=function(d,f,p){return o.H.useFormState(d,f,p)},br.useFormStatus=function(){return o.H.useHostTransitionStatus()},br.version="19.2.4",br}var Tz;function FL(){if(Tz)return lw.exports;Tz=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(),lw.exports=jK(),lw.exports}var Pz;function NK(){if(Pz)return wf;Pz=1;var e=SK(),t=ld(),n=FL();function r(s){var u="https://react.dev/errors/"+s;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+s+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var u=s,h=s;if(s.alternate)for(;u.return;)u=u.return;else{s=u;do u=s,(u.flags&4098)!==0&&(h=u.return),s=u.return;while(s)}return u.tag===3?h:null}function o(s){if(s.tag===13){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function c(s){if(s.tag===31){var u=s.memoizedState;if(u===null&&(s=s.alternate,s!==null&&(u=s.memoizedState)),u!==null)return u.dehydrated}return null}function d(s){if(a(s)!==s)throw Error(r(188))}function f(s){var u=s.alternate;if(!u){if(u=a(s),u===null)throw Error(r(188));return u!==s?null:s}for(var h=s,g=u;;){var w=h.return;if(w===null)break;var N=w.alternate;if(N===null){if(g=w.return,g!==null){h=g;continue}break}if(w.child===N.child){for(N=w.child;N;){if(N===h)return d(w),s;if(N===g)return d(w),u;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=w,g=N;else{for(var T=!1,L=w.child;L;){if(L===h){T=!0,h=w,g=N;break}if(L===g){T=!0,g=w,h=N;break}L=L.sibling}if(!T){for(L=N.child;L;){if(L===h){T=!0,h=N,g=w;break}if(L===g){T=!0,g=N,h=w;break}L=L.sibling}if(!T)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?s:u}function p(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s;for(s=s.child;s!==null;){if(u=p(s),u!==null)return u;s=s.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function B(s){return s===null||typeof s!="object"?null:(s=q&&s[q]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function X(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case b:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case z:return"Suspense";case A:return"SuspenseList";case $:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case S:return"Portal";case C:return s.displayName||"Context";case E:return(s._context.displayName||"Context")+".Consumer";case O:var u=s.render;return s=s.displayName,s||(s=u.displayName||u.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case _:return u=s.displayName||null,u!==null?u:X(s.type)||"Memo";case R:u=s._payload,s=s._init;try{return X(s(u))}catch{}}return null}var Z=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},we=[],I=-1;function D(s){return{current:s}}function U(s){0>I||(s.current=we[I],we[I]=null,I--)}function M(s,u){I++,we[I]=s.current,s.current=u}var Q=D(null),oe=D(null),ne=D(null),Ae=D(null);function _e(s,u){switch(M(ne,u),M(oe,s),M(Q,null),u.nodeType){case 9:case 11:s=(s=u.documentElement)&&(s=s.namespaceURI)?Q_(s):0;break;default:if(s=u.tagName,u=u.namespaceURI)u=Q_(u),s=Y_(u,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}U(Q),M(Q,s)}function ee(){U(Q),U(oe),U(ne)}function he(s){s.memoizedState!==null&&M(Ae,s);var u=Q.current,h=Y_(u,s.type);u!==h&&(M(oe,s),M(Q,h))}function Ee(s){oe.current===s&&(U(Q),U(oe)),Ae.current===s&&(U(Ae),gf._currentValue=ue)}var G,Fe;function De(s){if(G===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);G=u&&u[1]||"",Fe=-1<h.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+G+s+Fe}var rt=!1;function Qe(s,u){if(!s||rt)return"";rt=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(u){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(fe){var le=fe}Reflect.construct(s,[],xe)}else{try{xe.call()}catch(fe){le=fe}s.call(xe.prototype)}}else{try{throw Error()}catch(fe){le=fe}(xe=s())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(fe){if(fe&&le&&typeof fe.stack=="string")return[fe.stack,le.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),T=N[0],L=N[1];if(T&&L){var K=T.split(`
|
|
4
|
+
`),ae=L.split(`
|
|
5
|
+
`);for(w=g=0;g<K.length&&!K[g].includes("DetermineComponentFrameRoot");)g++;for(;w<ae.length&&!ae[w].includes("DetermineComponentFrameRoot");)w++;if(g===K.length||w===ae.length)for(g=K.length-1,w=ae.length-1;1<=g&&0<=w&&K[g]!==ae[w];)w--;for(;1<=g&&0<=w;g--,w--)if(K[g]!==ae[w]){if(g!==1||w!==1)do if(g--,w--,0>w||K[g]!==ae[w]){var pe=`
|
|
6
|
+
`+K[g].replace(" at new "," at ");return s.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",s.displayName)),pe}while(1<=g&&0<=w);break}}}finally{rt=!1,Error.prepareStackTrace=h}return(h=s?s.displayName||s.name:"")?De(h):""}function en(s,u){switch(s.tag){case 26:case 27:case 5:return De(s.type);case 16:return De("Lazy");case 13:return s.child!==u&&u!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Qe(s.type,!1);case 11:return Qe(s.type.render,!1);case 1:return Qe(s.type,!0);case 31:return De("Activity");default:return""}}function Ut(s){try{var u="",h=null;do u+=en(s,h),h=s,s=s.return;while(s);return u}catch(g){return`
|
|
7
|
+
Error generating stack: `+g.message+`
|
|
8
|
+
`+g.stack}}var ln=Object.prototype.hasOwnProperty,_t=e.unstable_scheduleCallback,be=e.unstable_cancelCallback,Je=e.unstable_shouldYield,zt=e.unstable_requestPaint,Ct=e.unstable_now,Ye=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,Pe=e.unstable_NormalPriority,We=e.unstable_LowPriority,ut=e.unstable_IdlePriority,Qn=e.log,yr=e.unstable_setDisableYieldValue,tn=null,Gt=null;function cn(s){if(typeof Qn=="function"&&yr(s),Gt&&typeof Gt.setStrictMode=="function")try{Gt.setStrictMode(tn,s)}catch{}}var it=Math.clz32?Math.clz32:Vr,Yn=Math.log,me=Math.LN2;function Vr(s){return s>>>=0,s===0?32:31-(Yn(s)/me|0)|0}var vr=256,kt=262144,Qr=4194304;function je(s){var u=s&42;if(u!==0)return u;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 Xe(s,u,h){var g=s.pendingLanes;if(g===0)return 0;var w=0,N=s.suspendedLanes,T=s.pingedLanes;s=s.warmLanes;var L=g&134217727;return L!==0?(g=L&~N,g!==0?w=je(g):(T&=L,T!==0?w=je(T):h||(h=L&~s,h!==0&&(w=je(h))))):(L=g&~N,L!==0?w=je(L):T!==0?w=je(T):h||(h=g&~s,h!==0&&(w=je(h)))),w===0?0:u!==0&&u!==w&&(u&N)===0&&(N=w&-w,h=u&-u,N>=h||N===32&&(h&4194048)!==0)?u:w}function Ve(s,u){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&u)===0}function et(s,u){switch(s){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 Wn(){var s=Qr;return Qr<<=1,(Qr&62914560)===0&&(Qr=4194304),s}function Ei(s){for(var u=[],h=0;31>h;h++)u.push(s);return u}function Yt(s,u){s.pendingLanes|=u,u!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function fi(s,u,h,g,w,N){var T=s.pendingLanes;s.pendingLanes=h,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=h,s.entangledLanes&=h,s.errorRecoveryDisabledLanes&=h,s.shellSuspendCounter=0;var L=s.entanglements,K=s.expirationTimes,ae=s.hiddenUpdates;for(h=T&~h;0<h;){var pe=31-it(h),xe=1<<pe;L[pe]=0,K[pe]=-1;var le=ae[pe];if(le!==null)for(ae[pe]=null,pe=0;pe<le.length;pe++){var fe=le[pe];fe!==null&&(fe.lane&=-536870913)}h&=~xe}g!==0&&Ja(s,g,0),N!==0&&w===0&&s.tag!==0&&(s.suspendedLanes|=N&~(T&~u))}function Ja(s,u,h){s.pendingLanes|=u,s.suspendedLanes&=~u;var g=31-it(u);s.entangledLanes|=u,s.entanglements[g]=s.entanglements[g]|1073741824|h&261930}function ka(s,u){var h=s.entangledLanes|=u;for(s=s.entanglements;h;){var g=31-it(h),w=1<<g;w&u|s[g]&u&&(s[g]|=u),h&=~w}}function ia(s,u){var h=u&-u;return h=(h&42)!==0?1:Ed(h),(h&(s.suspendedLanes|u))!==0?0:h}function Ed(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 bc(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function pp(){var s=J.p;return s!==0?s:(s=window.event,s===void 0?32:vz(s.type))}function mp(s,u){var h=J.p;try{return J.p=s,u()}finally{J.p=h}}var Ca=Math.random().toString(36).slice(2),Ln="__reactFiber$"+Ca,ar="__reactProps$"+Ca,Y="__reactContainer$"+Ca,Ne="__reactEvents$"+Ca,ht="__reactListeners$"+Ca,Dt="__reactHandles$"+Ca,$n="__reactResources$"+Ca,Dr="__reactMarker$"+Ca;function aa(s){delete s[Ln],delete s[ar],delete s[Ne],delete s[ht],delete s[Dt]}function hi(s){var u=s[Ln];if(u)return u;for(var h=s.parentNode;h;){if(u=h[Y]||h[Ln]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(s=nz(s);s!==null;){if(h=s[Ln])return h;s=nz(s)}return u}s=h,h=s.parentNode}return null}function Bn(s){if(s=s[Ln]||s[Y]){var u=s.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return s}return null}function Yo(s){var u=s.tag;if(u===5||u===26||u===27||u===6)return s.stateNode;throw Error(r(33))}function pi(s){var u=s[$n];return u||(u=s[$n]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function un(s){s[Dr]=!0}var Wo=new Set,_d={};function es(s,u){sa(s,u),sa(s+"Capture",u)}function sa(s,u){for(_d[s]=u,s=0;s<u.length;s++)Wo.add(u[s])}var wc=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]*$"),gp={},yp={};function bt(s){return ln.call(yp,s)?!0:ln.call(gp,s)?!1:wc.test(s)?yp[s]=!0:(gp[s]=!0,!1)}function Mt(s,u,h){if(bt(u))if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":s.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(u);return}}s.setAttribute(u,""+h)}}function xr(s,u,h){if(h===null)s.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttribute(u,""+h)}}function Zn(s,u,h,g){if(g===null)s.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(h);return}s.setAttributeNS(u,h,""+g)}}function sr(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function zd(s){var u=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function u9(s,u,h){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,u);if(!s.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var w=g.get,N=g.set;return Object.defineProperty(s,u,{configurable:!0,get:function(){return w.call(this)},set:function(T){h=""+T,N.call(this,T)}}),Object.defineProperty(s,u,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(T){h=""+T},stopTracking:function(){s._valueTracker=null,delete s[u]}}}}function W0(s){if(!s._valueTracker){var u=zd(s)?"checked":"value";s._valueTracker=u9(s,u,""+s[u])}}function UA(s){if(!s)return!1;var u=s._valueTracker;if(!u)return!0;var h=u.getValue(),g="";return s&&(g=zd(s)?s.checked?"true":"false":s.value),s=g,s!==h?(u.setValue(s),!0):!1}function vp(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 d9=/[\n"\\]/g;function _i(s){return s.replace(d9,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function Z0(s,u,h,g,w,N,T,L){s.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?s.type=T:s.removeAttribute("type"),u!=null?T==="number"?(u===0&&s.value===""||s.value!=u)&&(s.value=""+sr(u)):s.value!==""+sr(u)&&(s.value=""+sr(u)):T!=="submit"&&T!=="reset"||s.removeAttribute("value"),u!=null?X0(s,T,sr(u)):h!=null?X0(s,T,sr(h)):g!=null&&s.removeAttribute("value"),w==null&&N!=null&&(s.defaultChecked=!!N),w!=null&&(s.checked=w&&typeof w!="function"&&typeof w!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?s.name=""+sr(L):s.removeAttribute("name")}function qA(s,u,h,g,w,N,T,L){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.type=N),u!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||u!=null)){W0(s);return}h=h!=null?""+sr(h):"",u=u!=null?""+sr(u):h,L||u===s.value||(s.value=u),s.defaultValue=u}g=g??w,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=L?s.checked:!!g,s.defaultChecked=!!g,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(s.name=T),W0(s)}function X0(s,u,h){u==="number"&&vp(s.ownerDocument)===s||s.defaultValue===""+h||(s.defaultValue=""+h)}function Sc(s,u,h,g){if(s=s.options,u){u={};for(var w=0;w<h.length;w++)u["$"+h[w]]=!0;for(h=0;h<s.length;h++)w=u.hasOwnProperty("$"+s[h].value),s[h].selected!==w&&(s[h].selected=w),w&&g&&(s[h].defaultSelected=!0)}else{for(h=""+sr(h),u=null,w=0;w<s.length;w++){if(s[w].value===h){s[w].selected=!0,g&&(s[w].defaultSelected=!0);return}u!==null||s[w].disabled||(u=s[w])}u!==null&&(u.selected=!0)}}function FA(s,u,h){if(u!=null&&(u=""+sr(u),u!==s.value&&(s.value=u),h==null)){s.defaultValue!==u&&(s.defaultValue=u);return}s.defaultValue=h!=null?""+sr(h):""}function HA(s,u,h,g){if(u==null){if(g!=null){if(h!=null)throw Error(r(92));if(Z(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),u=h}h=sr(u),s.defaultValue=h,g=s.textContent,g===h&&g!==""&&g!==null&&(s.value=g),W0(s)}function jc(s,u){if(u){var h=s.firstChild;if(h&&h===s.lastChild&&h.nodeType===3){h.nodeValue=u;return}}s.textContent=u}var f9=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 KA(s,u,h){var g=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?s.setProperty(u,""):u==="float"?s.cssFloat="":s[u]="":g?s.setProperty(u,h):typeof h!="number"||h===0||f9.has(u)?u==="float"?s.cssFloat=h:s[u]=(""+h).trim():s[u]=h+"px"}function GA(s,u,h){if(u!=null&&typeof u!="object")throw Error(r(62));if(s=s.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var w in u)g=u[w],u.hasOwnProperty(w)&&h[w]!==g&&KA(s,w,g)}else for(var N in u)u.hasOwnProperty(N)&&KA(s,N,u[N])}function J0(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 h9=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"]]),p9=/^[\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 xp(s){return p9.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function ts(){}var ex=null;function tx(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Nc=null,kc=null;function VA(s){var u=Bn(s);if(u&&(s=u.stateNode)){var h=s[ar]||null;e:switch(s=u.stateNode,u.type){case"input":if(Z0(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=s;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+_i(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var g=h[u];if(g!==s&&g.form===s.form){var w=g[ar]||null;if(!w)throw Error(r(90));Z0(g,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(u=0;u<h.length;u++)g=h[u],g.form===s.form&&UA(g)}break e;case"textarea":FA(s,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&Sc(s,!!h.multiple,u,!1)}}}var nx=!1;function QA(s,u,h){if(nx)return s(u,h);nx=!0;try{var g=s(u);return g}finally{if(nx=!1,(Nc!==null||kc!==null)&&(sm(),Nc&&(u=Nc,s=kc,kc=Nc=null,VA(u),s)))for(u=0;u<s.length;u++)VA(s[u])}}function Td(s,u){var h=s.stateNode;if(h===null)return null;var g=h[ar]||null;if(g===null)return null;h=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var ns=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rx=!1;if(ns)try{var Pd={};Object.defineProperty(Pd,"passive",{get:function(){rx=!0}}),window.addEventListener("test",Pd,Pd),window.removeEventListener("test",Pd,Pd)}catch{rx=!1}var qs=null,ix=null,bp=null;function YA(){if(bp)return bp;var s,u=ix,h=u.length,g,w="value"in qs?qs.value:qs.textContent,N=w.length;for(s=0;s<h&&u[s]===w[s];s++);var T=h-s;for(g=1;g<=T&&u[h-g]===w[N-g];g++);return bp=w.slice(s,1<g?1-g:void 0)}function wp(s){var u=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&u===13&&(s=13)):s=u,s===10&&(s=13),32<=s||s===13?s:0}function Sp(){return!0}function WA(){return!1}function Yr(s){function u(h,g,w,N,T){this._reactName=h,this._targetInst=w,this.type=g,this.nativeEvent=N,this.target=T,this.currentTarget=null;for(var L in s)s.hasOwnProperty(L)&&(h=s[L],this[L]=h?h(N):N[L]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Sp:WA,this.isPropagationStopped=WA,this}return m(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Sp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Sp)},persist:function(){},isPersistent:Sp}),u}var Zo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jp=Yr(Zo),Rd=m({},Zo,{view:0,detail:0}),m9=Yr(Rd),ax,sx,Dd,Np=m({},Rd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lx,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!==Dd&&(Dd&&s.type==="mousemove"?(ax=s.screenX-Dd.screenX,sx=s.screenY-Dd.screenY):sx=ax=0,Dd=s),ax)},movementY:function(s){return"movementY"in s?s.movementY:sx}}),ZA=Yr(Np),g9=m({},Np,{dataTransfer:0}),y9=Yr(g9),v9=m({},Rd,{relatedTarget:0}),ox=Yr(v9),x9=m({},Zo,{animationName:0,elapsedTime:0,pseudoElement:0}),b9=Yr(x9),w9=m({},Zo,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),S9=Yr(w9),j9=m({},Zo,{data:0}),XA=Yr(j9),N9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},k9={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"},C9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function A9(s){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(s):(s=C9[s])?!!u[s]:!1}function lx(){return A9}var O9=m({},Rd,{key:function(s){if(s.key){var u=N9[s.key]||s.key;if(u!=="Unidentified")return u}return s.type==="keypress"?(s=wp(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?k9[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lx,charCode:function(s){return s.type==="keypress"?wp(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?wp(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),E9=Yr(O9),_9=m({},Np,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),JA=Yr(_9),z9=m({},Rd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lx}),T9=Yr(z9),P9=m({},Zo,{propertyName:0,elapsedTime:0,pseudoElement:0}),R9=Yr(P9),D9=m({},Np,{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}),M9=Yr(D9),I9=m({},Zo,{newState:0,oldState:0}),L9=Yr(I9),$9=[9,13,27,32],cx=ns&&"CompositionEvent"in window,Md=null;ns&&"documentMode"in document&&(Md=document.documentMode);var B9=ns&&"TextEvent"in window&&!Md,eO=ns&&(!cx||Md&&8<Md&&11>=Md),tO=" ",nO=!1;function rO(s,u){switch(s){case"keyup":return $9.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iO(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Cc=!1;function U9(s,u){switch(s){case"compositionend":return iO(u);case"keypress":return u.which!==32?null:(nO=!0,tO);case"textInput":return s=u.data,s===tO&&nO?null:s;default:return null}}function q9(s,u){if(Cc)return s==="compositionend"||!cx&&rO(s,u)?(s=YA(),bp=ix=qs=null,Cc=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return eO&&u.locale!=="ko"?null:u.data;default:return null}}var F9={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 aO(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u==="input"?!!F9[s.type]:u==="textarea"}function sO(s,u,h,g){Nc?kc?kc.push(g):kc=[g]:Nc=g,u=hm(u,"onChange"),0<u.length&&(h=new jp("onChange","change",null,h,g),s.push({event:h,listeners:u}))}var Id=null,Ld=null;function H9(s){q_(s,0)}function kp(s){var u=Yo(s);if(UA(u))return s}function oO(s,u){if(s==="change")return u}var lO=!1;if(ns){var ux;if(ns){var dx="oninput"in document;if(!dx){var cO=document.createElement("div");cO.setAttribute("oninput","return;"),dx=typeof cO.oninput=="function"}ux=dx}else ux=!1;lO=ux&&(!document.documentMode||9<document.documentMode)}function uO(){Id&&(Id.detachEvent("onpropertychange",dO),Ld=Id=null)}function dO(s){if(s.propertyName==="value"&&kp(Ld)){var u=[];sO(u,Ld,s,tx(s)),QA(H9,u)}}function K9(s,u,h){s==="focusin"?(uO(),Id=u,Ld=h,Id.attachEvent("onpropertychange",dO)):s==="focusout"&&uO()}function G9(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return kp(Ld)}function V9(s,u){if(s==="click")return kp(u)}function Q9(s,u){if(s==="input"||s==="change")return kp(u)}function Y9(s,u){return s===u&&(s!==0||1/s===1/u)||s!==s&&u!==u}var mi=typeof Object.is=="function"?Object.is:Y9;function $d(s,u){if(mi(s,u))return!0;if(typeof s!="object"||s===null||typeof u!="object"||u===null)return!1;var h=Object.keys(s),g=Object.keys(u);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var w=h[g];if(!ln.call(u,w)||!mi(s[w],u[w]))return!1}return!0}function fO(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function hO(s,u){var h=fO(s);s=0;for(var g;h;){if(h.nodeType===3){if(g=s+h.textContent.length,s<=u&&g>=u)return{node:h,offset:u-s};s=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=fO(h)}}function pO(s,u){return s&&u?s===u?!0:s&&s.nodeType===3?!1:u&&u.nodeType===3?pO(s,u.parentNode):"contains"in s?s.contains(u):s.compareDocumentPosition?!!(s.compareDocumentPosition(u)&16):!1:!1}function mO(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var u=vp(s.document);u instanceof s.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)s=u.contentWindow;else break;u=vp(s.document)}return u}function fx(s){var u=s&&s.nodeName&&s.nodeName.toLowerCase();return u&&(u==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||u==="textarea"||s.contentEditable==="true")}var W9=ns&&"documentMode"in document&&11>=document.documentMode,Ac=null,hx=null,Bd=null,px=!1;function gO(s,u,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;px||Ac==null||Ac!==vp(g)||(g=Ac,"selectionStart"in g&&fx(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Bd&&$d(Bd,g)||(Bd=g,g=hm(hx,"onSelect"),0<g.length&&(u=new jp("onSelect","select",null,u,h),s.push({event:u,listeners:g}),u.target=Ac)))}function Xo(s,u){var h={};return h[s.toLowerCase()]=u.toLowerCase(),h["Webkit"+s]="webkit"+u,h["Moz"+s]="moz"+u,h}var Oc={animationend:Xo("Animation","AnimationEnd"),animationiteration:Xo("Animation","AnimationIteration"),animationstart:Xo("Animation","AnimationStart"),transitionrun:Xo("Transition","TransitionRun"),transitionstart:Xo("Transition","TransitionStart"),transitioncancel:Xo("Transition","TransitionCancel"),transitionend:Xo("Transition","TransitionEnd")},mx={},yO={};ns&&(yO=document.createElement("div").style,"AnimationEvent"in window||(delete Oc.animationend.animation,delete Oc.animationiteration.animation,delete Oc.animationstart.animation),"TransitionEvent"in window||delete Oc.transitionend.transition);function Jo(s){if(mx[s])return mx[s];if(!Oc[s])return s;var u=Oc[s],h;for(h in u)if(u.hasOwnProperty(h)&&h in yO)return mx[s]=u[h];return s}var vO=Jo("animationend"),xO=Jo("animationiteration"),bO=Jo("animationstart"),Z9=Jo("transitionrun"),X9=Jo("transitionstart"),J9=Jo("transitioncancel"),wO=Jo("transitionend"),SO=new Map,gx="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(" ");gx.push("scrollEnd");function oa(s,u){SO.set(s,u),es(u,[s])}var Cp=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=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(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},zi=[],Ec=0,yx=0;function Ap(){for(var s=Ec,u=yx=Ec=0;u<s;){var h=zi[u];zi[u++]=null;var g=zi[u];zi[u++]=null;var w=zi[u];zi[u++]=null;var N=zi[u];if(zi[u++]=null,g!==null&&w!==null){var T=g.pending;T===null?w.next=w:(w.next=T.next,T.next=w),g.pending=w}N!==0&&jO(h,w,N)}}function Op(s,u,h,g){zi[Ec++]=s,zi[Ec++]=u,zi[Ec++]=h,zi[Ec++]=g,yx|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function vx(s,u,h,g){return Op(s,u,h,g),Ep(s)}function el(s,u){return Op(s,null,null,u),Ep(s)}function jO(s,u,h){s.lanes|=h;var g=s.alternate;g!==null&&(g.lanes|=h);for(var w=!1,N=s.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(s=N.stateNode,s===null||s._visibility&1||(w=!0)),s=N,N=N.return;return s.tag===3?(N=s.stateNode,w&&u!==null&&(w=31-it(h),s=N.hiddenUpdates,g=s[w],g===null?s[w]=[u]:g.push(u),u.lane=h|536870912),N):null}function Ep(s){if(50<cf)throw cf=0,Ab=null,Error(r(185));for(var u=s.return;u!==null;)s=u,u=s.return;return s.tag===3?s.stateNode:null}var _c={};function eH(s,u,h,g){this.tag=s,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gi(s,u,h,g){return new eH(s,u,h,g)}function xx(s){return s=s.prototype,!(!s||!s.isReactComponent)}function rs(s,u){var h=s.alternate;return h===null?(h=gi(s.tag,u,s.key,s.mode),h.elementType=s.elementType,h.type=s.type,h.stateNode=s.stateNode,h.alternate=s,s.alternate=h):(h.pendingProps=u,h.type=s.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=s.flags&65011712,h.childLanes=s.childLanes,h.lanes=s.lanes,h.child=s.child,h.memoizedProps=s.memoizedProps,h.memoizedState=s.memoizedState,h.updateQueue=s.updateQueue,u=s.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=s.sibling,h.index=s.index,h.ref=s.ref,h.refCleanup=s.refCleanup,h}function NO(s,u){s.flags&=65011714;var h=s.alternate;return h===null?(s.childLanes=0,s.lanes=u,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=h.childLanes,s.lanes=h.lanes,s.child=h.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=h.memoizedProps,s.memoizedState=h.memoizedState,s.updateQueue=h.updateQueue,s.type=h.type,u=h.dependencies,s.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),s}function _p(s,u,h,g,w,N){var T=0;if(g=s,typeof s=="function")xx(s)&&(T=1);else if(typeof s=="string")T=aK(s,h,Q.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case $:return s=gi(31,h,u,w),s.elementType=$,s.lanes=N,s;case b:return tl(h.children,w,N,u);case j:T=8,w|=24;break;case k:return s=gi(12,h,u,w|2),s.elementType=k,s.lanes=N,s;case z:return s=gi(13,h,u,w),s.elementType=z,s.lanes=N,s;case A:return s=gi(19,h,u,w),s.elementType=A,s.lanes=N,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case C:T=10;break e;case E:T=9;break e;case O:T=11;break e;case _:T=14;break e;case R:T=16,g=null;break e}T=29,h=Error(r(130,s===null?"null":typeof s,"")),g=null}return u=gi(T,h,u,w),u.elementType=s,u.type=g,u.lanes=N,u}function tl(s,u,h,g){return s=gi(7,s,g,u),s.lanes=h,s}function bx(s,u,h){return s=gi(6,s,null,u),s.lanes=h,s}function kO(s){var u=gi(18,null,null,0);return u.stateNode=s,u}function wx(s,u,h){return u=gi(4,s.children!==null?s.children:[],s.key,u),u.lanes=h,u.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},u}var CO=new WeakMap;function Ti(s,u){if(typeof s=="object"&&s!==null){var h=CO.get(s);return h!==void 0?h:(u={value:s,source:u,stack:Ut(u)},CO.set(s,u),u)}return{value:s,source:u,stack:Ut(u)}}var zc=[],Tc=0,zp=null,Ud=0,Pi=[],Ri=0,Fs=null,Aa=1,Oa="";function is(s,u){zc[Tc++]=Ud,zc[Tc++]=zp,zp=s,Ud=u}function AO(s,u,h){Pi[Ri++]=Aa,Pi[Ri++]=Oa,Pi[Ri++]=Fs,Fs=s;var g=Aa;s=Oa;var w=32-it(g)-1;g&=~(1<<w),h+=1;var N=32-it(u)+w;if(30<N){var T=w-w%5;N=(g&(1<<T)-1).toString(32),g>>=T,w-=T,Aa=1<<32-it(u)+w|h<<w|g,Oa=N+s}else Aa=1<<N|h<<w|g,Oa=s}function Sx(s){s.return!==null&&(is(s,1),AO(s,1,0))}function jx(s){for(;s===zp;)zp=zc[--Tc],zc[Tc]=null,Ud=zc[--Tc],zc[Tc]=null;for(;s===Fs;)Fs=Pi[--Ri],Pi[Ri]=null,Oa=Pi[--Ri],Pi[Ri]=null,Aa=Pi[--Ri],Pi[Ri]=null}function OO(s,u){Pi[Ri++]=Aa,Pi[Ri++]=Oa,Pi[Ri++]=Fs,Aa=u.id,Oa=u.overflow,Fs=s}var or=null,nn=null,wt=!1,Hs=null,Di=!1,Nx=Error(r(519));function Ks(s){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qd(Ti(u,s)),Nx}function EO(s){var u=s.stateNode,h=s.type,g=s.memoizedProps;switch(u[Ln]=s,u[ar]=g,h){case"dialog":mt("cancel",u),mt("close",u);break;case"iframe":case"object":case"embed":mt("load",u);break;case"video":case"audio":for(h=0;h<df.length;h++)mt(df[h],u);break;case"source":mt("error",u);break;case"img":case"image":case"link":mt("error",u),mt("load",u);break;case"details":mt("toggle",u);break;case"input":mt("invalid",u),qA(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":mt("invalid",u);break;case"textarea":mt("invalid",u),HA(u,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||g.suppressHydrationWarning===!0||G_(u.textContent,h)?(g.popover!=null&&(mt("beforetoggle",u),mt("toggle",u)),g.onScroll!=null&&mt("scroll",u),g.onScrollEnd!=null&&mt("scrollend",u),g.onClick!=null&&(u.onclick=ts),u=!0):u=!1,u||Ks(s,!0)}function _O(s){for(or=s.return;or;)switch(or.tag){case 5:case 31:case 13:Di=!1;return;case 27:case 3:Di=!0;return;default:or=or.return}}function Pc(s){if(s!==or)return!1;if(!wt)return _O(s),wt=!0,!1;var u=s.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=s.type,h=!(h!=="form"&&h!=="button")||qb(s.type,s.memoizedProps)),h=!h),h&&nn&&Ks(s),_O(s),u===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));nn=tz(s)}else if(u===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));nn=tz(s)}else u===27?(u=nn,ao(s.type)?(s=Vb,Vb=null,nn=s):nn=u):nn=or?Ii(s.stateNode.nextSibling):null;return!0}function nl(){nn=or=null,wt=!1}function kx(){var s=Hs;return s!==null&&(Jr===null?Jr=s:Jr.push.apply(Jr,s),Hs=null),s}function qd(s){Hs===null?Hs=[s]:Hs.push(s)}var Cx=D(null),rl=null,as=null;function Gs(s,u,h){M(Cx,u._currentValue),u._currentValue=h}function ss(s){s._currentValue=Cx.current,U(Cx)}function Ax(s,u,h){for(;s!==null;){var g=s.alternate;if((s.childLanes&u)!==u?(s.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),s===h)break;s=s.return}}function Ox(s,u,h,g){var w=s.child;for(w!==null&&(w.return=s);w!==null;){var N=w.dependencies;if(N!==null){var T=w.child;N=N.firstContext;e:for(;N!==null;){var L=N;N=w;for(var K=0;K<u.length;K++)if(L.context===u[K]){N.lanes|=h,L=N.alternate,L!==null&&(L.lanes|=h),Ax(N.return,h,s),g||(T=null);break e}N=L.next}}else if(w.tag===18){if(T=w.return,T===null)throw Error(r(341));T.lanes|=h,N=T.alternate,N!==null&&(N.lanes|=h),Ax(T,h,s),T=null}else T=w.child;if(T!==null)T.return=w;else for(T=w;T!==null;){if(T===s){T=null;break}if(w=T.sibling,w!==null){w.return=T.return,T=w;break}T=T.return}w=T}}function Rc(s,u,h,g){s=null;for(var w=u,N=!1;w!==null;){if(!N){if((w.flags&524288)!==0)N=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var T=w.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var L=w.type;mi(w.pendingProps.value,T.value)||(s!==null?s.push(L):s=[L])}}else if(w===Ae.current){if(T=w.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(s!==null?s.push(gf):s=[gf])}w=w.return}s!==null&&Ox(u,s,h,g),u.flags|=262144}function Tp(s){for(s=s.firstContext;s!==null;){if(!mi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function il(s){rl=s,as=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function lr(s){return zO(rl,s)}function Pp(s,u){return rl===null&&il(s),zO(s,u)}function zO(s,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},as===null){if(s===null)throw Error(r(308));as=u,s.dependencies={lanes:0,firstContext:u},s.flags|=524288}else as=as.next=u;return h}var tH=typeof AbortController<"u"?AbortController:function(){var s=[],u=this.signal={aborted:!1,addEventListener:function(h,g){s.push(g)}};this.abort=function(){u.aborted=!0,s.forEach(function(h){return h()})}},nH=e.unstable_scheduleCallback,rH=e.unstable_NormalPriority,zn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ex(){return{controller:new tH,data:new Map,refCount:0}}function Fd(s){s.refCount--,s.refCount===0&&nH(rH,function(){s.controller.abort()})}var Hd=null,_x=0,Dc=0,Mc=null;function iH(s,u){if(Hd===null){var h=Hd=[];_x=0,Dc=Pb(),Mc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return _x++,u.then(TO,TO),u}function TO(){if(--_x===0&&Hd!==null){Mc!==null&&(Mc.status="fulfilled");var s=Hd;Hd=null,Dc=0,Mc=null;for(var u=0;u<s.length;u++)(0,s[u])()}}function aH(s,u){var h=[],g={status:"pending",value:null,reason:null,then:function(w){h.push(w)}};return s.then(function(){g.status="fulfilled",g.value=u;for(var w=0;w<h.length;w++)(0,h[w])(u)},function(w){for(g.status="rejected",g.reason=w,w=0;w<h.length;w++)(0,h[w])(void 0)}),g}var PO=H.S;H.S=function(s,u){g_=Ct(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&iH(s,u),PO!==null&&PO(s,u)};var al=D(null);function zx(){var s=al.current;return s!==null?s:Vt.pooledCache}function Rp(s,u){u===null?M(al,al.current):M(al,u.pool)}function RO(){var s=zx();return s===null?null:{parent:zn._currentValue,pool:s}}var Ic=Error(r(460)),Tx=Error(r(474)),Dp=Error(r(542)),Mp={then:function(){}};function DO(s){return s=s.status,s==="fulfilled"||s==="rejected"}function MO(s,u,h){switch(h=s[h],h===void 0?s.push(u):h!==u&&(u.then(ts,ts),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,LO(s),s;default:if(typeof u.status=="string")u.then(ts,ts);else{if(s=Vt,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=u,s.status="pending",s.then(function(g){if(u.status==="pending"){var w=u;w.status="fulfilled",w.value=g}},function(g){if(u.status==="pending"){var w=u;w.status="rejected",w.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw s=u.reason,LO(s),s}throw ol=u,Ic}}function sl(s){try{var u=s._init;return u(s._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(ol=h,Ic):h}}var ol=null;function IO(){if(ol===null)throw Error(r(459));var s=ol;return ol=null,s}function LO(s){if(s===Ic||s===Dp)throw Error(r(483))}var Lc=null,Kd=0;function Ip(s){var u=Kd;return Kd+=1,Lc===null&&(Lc=[]),MO(Lc,s,u)}function Gd(s,u){u=u.props.ref,s.ref=u!==void 0?u:null}function Lp(s,u){throw u.$$typeof===y?Error(r(525)):(s=Object.prototype.toString.call(u),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":s)))}function $O(s){function u(te,W){if(s){var ie=te.deletions;ie===null?(te.deletions=[W],te.flags|=16):ie.push(W)}}function h(te,W){if(!s)return null;for(;W!==null;)u(te,W),W=W.sibling;return null}function g(te){for(var W=new Map;te!==null;)te.key!==null?W.set(te.key,te):W.set(te.index,te),te=te.sibling;return W}function w(te,W){return te=rs(te,W),te.index=0,te.sibling=null,te}function N(te,W,ie){return te.index=ie,s?(ie=te.alternate,ie!==null?(ie=ie.index,ie<W?(te.flags|=67108866,W):ie):(te.flags|=67108866,W)):(te.flags|=1048576,W)}function T(te){return s&&te.alternate===null&&(te.flags|=67108866),te}function L(te,W,ie,ve){return W===null||W.tag!==6?(W=bx(ie,te.mode,ve),W.return=te,W):(W=w(W,ie),W.return=te,W)}function K(te,W,ie,ve){var He=ie.type;return He===b?pe(te,W,ie.props.children,ve,ie.key):W!==null&&(W.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&sl(He)===W.type)?(W=w(W,ie.props),Gd(W,ie),W.return=te,W):(W=_p(ie.type,ie.key,ie.props,null,te.mode,ve),Gd(W,ie),W.return=te,W)}function ae(te,W,ie,ve){return W===null||W.tag!==4||W.stateNode.containerInfo!==ie.containerInfo||W.stateNode.implementation!==ie.implementation?(W=wx(ie,te.mode,ve),W.return=te,W):(W=w(W,ie.children||[]),W.return=te,W)}function pe(te,W,ie,ve,He){return W===null||W.tag!==7?(W=tl(ie,te.mode,ve,He),W.return=te,W):(W=w(W,ie),W.return=te,W)}function xe(te,W,ie){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=bx(""+W,te.mode,ie),W.return=te,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return ie=_p(W.type,W.key,W.props,null,te.mode,ie),Gd(ie,W),ie.return=te,ie;case S:return W=wx(W,te.mode,ie),W.return=te,W;case R:return W=sl(W),xe(te,W,ie)}if(Z(W)||B(W))return W=tl(W,te.mode,ie,null),W.return=te,W;if(typeof W.then=="function")return xe(te,Ip(W),ie);if(W.$$typeof===C)return xe(te,Pp(te,W),ie);Lp(te,W)}return null}function le(te,W,ie,ve){var He=W!==null?W.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return He!==null?null:L(te,W,""+ie,ve);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:return ie.key===He?K(te,W,ie,ve):null;case S:return ie.key===He?ae(te,W,ie,ve):null;case R:return ie=sl(ie),le(te,W,ie,ve)}if(Z(ie)||B(ie))return He!==null?null:pe(te,W,ie,ve,null);if(typeof ie.then=="function")return le(te,W,Ip(ie),ve);if(ie.$$typeof===C)return le(te,W,Pp(te,ie),ve);Lp(te,ie)}return null}function fe(te,W,ie,ve,He){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return te=te.get(ie)||null,L(W,te,""+ve,He);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return te=te.get(ve.key===null?ie:ve.key)||null,K(W,te,ve,He);case S:return te=te.get(ve.key===null?ie:ve.key)||null,ae(W,te,ve,He);case R:return ve=sl(ve),fe(te,W,ie,ve,He)}if(Z(ve)||B(ve))return te=te.get(ie)||null,pe(W,te,ve,He,null);if(typeof ve.then=="function")return fe(te,W,ie,Ip(ve),He);if(ve.$$typeof===C)return fe(te,W,ie,Pp(W,ve),He);Lp(W,ve)}return null}function Ie(te,W,ie,ve){for(var He=null,At=null,Be=W,st=W=0,vt=null;Be!==null&&st<ie.length;st++){Be.index>st?(vt=Be,Be=null):vt=Be.sibling;var Ot=le(te,Be,ie[st],ve);if(Ot===null){Be===null&&(Be=vt);break}s&&Be&&Ot.alternate===null&&u(te,Be),W=N(Ot,W,st),At===null?He=Ot:At.sibling=Ot,At=Ot,Be=vt}if(st===ie.length)return h(te,Be),wt&&is(te,st),He;if(Be===null){for(;st<ie.length;st++)Be=xe(te,ie[st],ve),Be!==null&&(W=N(Be,W,st),At===null?He=Be:At.sibling=Be,At=Be);return wt&&is(te,st),He}for(Be=g(Be);st<ie.length;st++)vt=fe(Be,te,st,ie[st],ve),vt!==null&&(s&&vt.alternate!==null&&Be.delete(vt.key===null?st:vt.key),W=N(vt,W,st),At===null?He=vt:At.sibling=vt,At=vt);return s&&Be.forEach(function(uo){return u(te,uo)}),wt&&is(te,st),He}function Ge(te,W,ie,ve){if(ie==null)throw Error(r(151));for(var He=null,At=null,Be=W,st=W=0,vt=null,Ot=ie.next();Be!==null&&!Ot.done;st++,Ot=ie.next()){Be.index>st?(vt=Be,Be=null):vt=Be.sibling;var uo=le(te,Be,Ot.value,ve);if(uo===null){Be===null&&(Be=vt);break}s&&Be&&uo.alternate===null&&u(te,Be),W=N(uo,W,st),At===null?He=uo:At.sibling=uo,At=uo,Be=vt}if(Ot.done)return h(te,Be),wt&&is(te,st),He;if(Be===null){for(;!Ot.done;st++,Ot=ie.next())Ot=xe(te,Ot.value,ve),Ot!==null&&(W=N(Ot,W,st),At===null?He=Ot:At.sibling=Ot,At=Ot);return wt&&is(te,st),He}for(Be=g(Be);!Ot.done;st++,Ot=ie.next())Ot=fe(Be,te,st,Ot.value,ve),Ot!==null&&(s&&Ot.alternate!==null&&Be.delete(Ot.key===null?st:Ot.key),W=N(Ot,W,st),At===null?He=Ot:At.sibling=Ot,At=Ot);return s&&Be.forEach(function(gK){return u(te,gK)}),wt&&is(te,st),He}function Ht(te,W,ie,ve){if(typeof ie=="object"&&ie!==null&&ie.type===b&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:e:{for(var He=ie.key;W!==null;){if(W.key===He){if(He=ie.type,He===b){if(W.tag===7){h(te,W.sibling),ve=w(W,ie.props.children),ve.return=te,te=ve;break e}}else if(W.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===R&&sl(He)===W.type){h(te,W.sibling),ve=w(W,ie.props),Gd(ve,ie),ve.return=te,te=ve;break e}h(te,W);break}else u(te,W);W=W.sibling}ie.type===b?(ve=tl(ie.props.children,te.mode,ve,ie.key),ve.return=te,te=ve):(ve=_p(ie.type,ie.key,ie.props,null,te.mode,ve),Gd(ve,ie),ve.return=te,te=ve)}return T(te);case S:e:{for(He=ie.key;W!==null;){if(W.key===He)if(W.tag===4&&W.stateNode.containerInfo===ie.containerInfo&&W.stateNode.implementation===ie.implementation){h(te,W.sibling),ve=w(W,ie.children||[]),ve.return=te,te=ve;break e}else{h(te,W);break}else u(te,W);W=W.sibling}ve=wx(ie,te.mode,ve),ve.return=te,te=ve}return T(te);case R:return ie=sl(ie),Ht(te,W,ie,ve)}if(Z(ie))return Ie(te,W,ie,ve);if(B(ie)){if(He=B(ie),typeof He!="function")throw Error(r(150));return ie=He.call(ie),Ge(te,W,ie,ve)}if(typeof ie.then=="function")return Ht(te,W,Ip(ie),ve);if(ie.$$typeof===C)return Ht(te,W,Pp(te,ie),ve);Lp(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,W!==null&&W.tag===6?(h(te,W.sibling),ve=w(W,ie),ve.return=te,te=ve):(h(te,W),ve=bx(ie,te.mode,ve),ve.return=te,te=ve),T(te)):h(te,W)}return function(te,W,ie,ve){try{Kd=0;var He=Ht(te,W,ie,ve);return Lc=null,He}catch(Be){if(Be===Ic||Be===Dp)throw Be;var At=gi(29,Be,null,te.mode);return At.lanes=ve,At.return=te,At}}}var ll=$O(!0),BO=$O(!1),Vs=!1;function Px(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rx(s,u){s=s.updateQueue,u.updateQueue===s&&(u.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Qs(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Ys(s,u,h){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Tt&2)!==0){var w=g.pending;return w===null?u.next=u:(u.next=w.next,w.next=u),g.pending=u,u=Ep(s),jO(s,null,h),u}return Op(s,g,u,h),Ep(s)}function Vd(s,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var g=u.lanes;g&=s.pendingLanes,h|=g,u.lanes=h,ka(s,h)}}function Dx(s,u){var h=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var w=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var T={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?w=N=T:N=N.next=T,h=h.next}while(h!==null);N===null?w=N=u:N=N.next=u}else w=N=u;h={baseState:g.baseState,firstBaseUpdate:w,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},s.updateQueue=h;return}s=h.lastBaseUpdate,s===null?h.firstBaseUpdate=u:s.next=u,h.lastBaseUpdate=u}var Mx=!1;function Qd(){if(Mx){var s=Mc;if(s!==null)throw s}}function Yd(s,u,h,g){Mx=!1;var w=s.updateQueue;Vs=!1;var N=w.firstBaseUpdate,T=w.lastBaseUpdate,L=w.shared.pending;if(L!==null){w.shared.pending=null;var K=L,ae=K.next;K.next=null,T===null?N=ae:T.next=ae,T=K;var pe=s.alternate;pe!==null&&(pe=pe.updateQueue,L=pe.lastBaseUpdate,L!==T&&(L===null?pe.firstBaseUpdate=ae:L.next=ae,pe.lastBaseUpdate=K))}if(N!==null){var xe=w.baseState;T=0,pe=ae=K=null,L=N;do{var le=L.lane&-536870913,fe=le!==L.lane;if(fe?(yt&le)===le:(g&le)===le){le!==0&&le===Dc&&(Mx=!0),pe!==null&&(pe=pe.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ie=s,Ge=L;le=u;var Ht=h;switch(Ge.tag){case 1:if(Ie=Ge.payload,typeof Ie=="function"){xe=Ie.call(Ht,xe,le);break e}xe=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ge.payload,le=typeof Ie=="function"?Ie.call(Ht,xe,le):Ie,le==null)break e;xe=m({},xe,le);break e;case 2:Vs=!0}}le=L.callback,le!==null&&(s.flags|=64,fe&&(s.flags|=8192),fe=w.callbacks,fe===null?w.callbacks=[le]:fe.push(le))}else fe={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},pe===null?(ae=pe=fe,K=xe):pe=pe.next=fe,T|=le;if(L=L.next,L===null){if(L=w.shared.pending,L===null)break;fe=L,L=fe.next,fe.next=null,w.lastBaseUpdate=fe,w.shared.pending=null}}while(!0);pe===null&&(K=xe),w.baseState=K,w.firstBaseUpdate=ae,w.lastBaseUpdate=pe,N===null&&(w.shared.lanes=0),eo|=T,s.lanes=T,s.memoizedState=xe}}function UO(s,u){if(typeof s!="function")throw Error(r(191,s));s.call(u)}function qO(s,u){var h=s.callbacks;if(h!==null)for(s.callbacks=null,s=0;s<h.length;s++)UO(h[s],u)}var $c=D(null),$p=D(0);function FO(s,u){s=ms,M($p,s),M($c,u),ms=s|u.baseLanes}function Ix(){M($p,ms),M($c,$c.current)}function Lx(){ms=$p.current,U($c),U($p)}var yi=D(null),Mi=null;function Ws(s){var u=s.alternate;M(kn,kn.current&1),M(yi,s),Mi===null&&(u===null||$c.current!==null||u.memoizedState!==null)&&(Mi=s)}function $x(s){M(kn,kn.current),M(yi,s),Mi===null&&(Mi=s)}function HO(s){s.tag===22?(M(kn,kn.current),M(yi,s),Mi===null&&(Mi=s)):Zs()}function Zs(){M(kn,kn.current),M(yi,yi.current)}function vi(s){U(yi),Mi===s&&(Mi=null),U(kn)}var kn=D(0);function Bp(s){for(var u=s;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Kb(h)||Gb(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var os=0,at=null,qt=null,Tn=null,Up=!1,Bc=!1,cl=!1,qp=0,Wd=0,Uc=null,sH=0;function bn(){throw Error(r(321))}function Bx(s,u){if(u===null)return!1;for(var h=0;h<u.length&&h<s.length;h++)if(!mi(s[h],u[h]))return!1;return!0}function Ux(s,u,h,g,w,N){return os=N,at=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,H.H=s===null||s.memoizedState===null?AE:nb,cl=!1,N=h(g,w),cl=!1,Bc&&(N=GO(u,h,g,w)),KO(s),N}function KO(s){H.H=Jd;var u=qt!==null&&qt.next!==null;if(os=0,Tn=qt=at=null,Up=!1,Wd=0,Uc=null,u)throw Error(r(300));s===null||Pn||(s=s.dependencies,s!==null&&Tp(s)&&(Pn=!0))}function GO(s,u,h,g){at=s;var w=0;do{if(Bc&&(Uc=null),Wd=0,Bc=!1,25<=w)throw Error(r(301));if(w+=1,Tn=qt=null,s.updateQueue!=null){var N=s.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}H.H=OE,N=u(h,g)}while(Bc);return N}function oH(){var s=H.H,u=s.useState()[0];return u=typeof u.then=="function"?Zd(u):u,s=s.useState()[0],(qt!==null?qt.memoizedState:null)!==s&&(at.flags|=1024),u}function qx(){var s=qp!==0;return qp=0,s}function Fx(s,u,h){u.updateQueue=s.updateQueue,u.flags&=-2053,s.lanes&=~h}function Hx(s){if(Up){for(s=s.memoizedState;s!==null;){var u=s.queue;u!==null&&(u.pending=null),s=s.next}Up=!1}os=0,Tn=qt=at=null,Bc=!1,Wd=qp=0,Uc=null}function Mr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?at.memoizedState=Tn=s:Tn=Tn.next=s,Tn}function Cn(){if(qt===null){var s=at.alternate;s=s!==null?s.memoizedState:null}else s=qt.next;var u=Tn===null?at.memoizedState:Tn.next;if(u!==null)Tn=u,qt=s;else{if(s===null)throw at.alternate===null?Error(r(467)):Error(r(310));qt=s,s={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},Tn===null?at.memoizedState=Tn=s:Tn=Tn.next=s}return Tn}function Fp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zd(s){var u=Wd;return Wd+=1,Uc===null&&(Uc=[]),s=MO(Uc,s,u),u=at,(Tn===null?u.memoizedState:Tn.next)===null&&(u=u.alternate,H.H=u===null||u.memoizedState===null?AE:nb),s}function Hp(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Zd(s);if(s.$$typeof===C)return lr(s)}throw Error(r(438,String(s)))}function Kx(s){var u=null,h=at.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var g=at.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(w){return w.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=Fp(),at.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(s),g=0;g<s;g++)h[g]=F;return u.index++,h}function ls(s,u){return typeof u=="function"?u(s):u}function Kp(s){var u=Cn();return Gx(u,qt,s)}function Gx(s,u,h){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var w=s.baseQueue,N=g.pending;if(N!==null){if(w!==null){var T=w.next;w.next=N.next,N.next=T}u.baseQueue=w=N,g.pending=null}if(N=s.baseState,w===null)s.memoizedState=N;else{u=w.next;var L=T=null,K=null,ae=u,pe=!1;do{var xe=ae.lane&-536870913;if(xe!==ae.lane?(yt&xe)===xe:(os&xe)===xe){var le=ae.revertLane;if(le===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),xe===Dc&&(pe=!0);else if((os&le)===le){ae=ae.next,le===Dc&&(pe=!0);continue}else xe={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=xe,T=N):K=K.next=xe,at.lanes|=le,eo|=le;xe=ae.action,cl&&h(N,xe),N=ae.hasEagerState?ae.eagerState:h(N,xe)}else le={lane:xe,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=le,T=N):K=K.next=le,at.lanes|=xe,eo|=xe;ae=ae.next}while(ae!==null&&ae!==u);if(K===null?T=N:K.next=L,!mi(N,s.memoizedState)&&(Pn=!0,pe&&(h=Mc,h!==null)))throw h;s.memoizedState=N,s.baseState=T,s.baseQueue=K,g.lastRenderedState=N}return w===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Vx(s){var u=Cn(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=s;var g=h.dispatch,w=h.pending,N=u.memoizedState;if(w!==null){h.pending=null;var T=w=w.next;do N=s(N,T.action),T=T.next;while(T!==w);mi(N,u.memoizedState)||(Pn=!0),u.memoizedState=N,u.baseQueue===null&&(u.baseState=N),h.lastRenderedState=N}return[N,g]}function VO(s,u,h){var g=at,w=Cn(),N=wt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=u();var T=!mi((qt||w).memoizedState,h);if(T&&(w.memoizedState=h,Pn=!0),w=w.queue,Wx(WO.bind(null,g,w,s),[s]),w.getSnapshot!==u||T||Tn!==null&&Tn.memoizedState.tag&1){if(g.flags|=2048,qc(9,{destroy:void 0},YO.bind(null,g,w,h,u),null),Vt===null)throw Error(r(349));N||(os&127)!==0||QO(g,u,h)}return h}function QO(s,u,h){s.flags|=16384,s={getSnapshot:u,value:h},u=at.updateQueue,u===null?(u=Fp(),at.updateQueue=u,u.stores=[s]):(h=u.stores,h===null?u.stores=[s]:h.push(s))}function YO(s,u,h,g){u.value=h,u.getSnapshot=g,ZO(u)&&XO(s)}function WO(s,u,h){return h(function(){ZO(u)&&XO(s)})}function ZO(s){var u=s.getSnapshot;s=s.value;try{var h=u();return!mi(s,h)}catch{return!0}}function XO(s){var u=el(s,2);u!==null&&ei(u,s,2)}function Qx(s){var u=Mr();if(typeof s=="function"){var h=s;if(s=h(),cl){cn(!0);try{h()}finally{cn(!1)}}}return u.memoizedState=u.baseState=s,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:s},u}function JO(s,u,h,g){return s.baseState=h,Gx(s,qt,typeof g=="function"?g:ls)}function lH(s,u,h,g,w){if(Qp(s))throw Error(r(485));if(s=u.action,s!==null){var N={payload:w,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){N.listeners.push(T)}};H.T!==null?h(!0):N.isTransition=!1,g(N),h=u.pending,h===null?(N.next=u.pending=N,eE(u,N)):(N.next=h.next,u.pending=h.next=N)}}function eE(s,u){var h=u.action,g=u.payload,w=s.state;if(u.isTransition){var N=H.T,T={};H.T=T;try{var L=h(w,g),K=H.S;K!==null&&K(T,L),tE(s,u,L)}catch(ae){Yx(s,u,ae)}finally{N!==null&&T.types!==null&&(N.types=T.types),H.T=N}}else try{N=h(w,g),tE(s,u,N)}catch(ae){Yx(s,u,ae)}}function tE(s,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){nE(s,u,g)},function(g){return Yx(s,u,g)}):nE(s,u,h)}function nE(s,u,h){u.status="fulfilled",u.value=h,rE(u),s.state=h,u=s.pending,u!==null&&(h=u.next,h===u?s.pending=null:(h=h.next,u.next=h,eE(s,h)))}function Yx(s,u,h){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=h,rE(u),u=u.next;while(u!==g)}s.action=null}function rE(s){s=s.listeners;for(var u=0;u<s.length;u++)(0,s[u])()}function iE(s,u){return u}function aE(s,u){if(wt){var h=Vt.formState;if(h!==null){e:{var g=at;if(wt){if(nn){t:{for(var w=nn,N=Di;w.nodeType!==8;){if(!N){w=null;break t}if(w=Ii(w.nextSibling),w===null){w=null;break t}}N=w.data,w=N==="F!"||N==="F"?w:null}if(w){nn=Ii(w.nextSibling),g=w.data==="F!";break e}}Ks(g)}g=!1}g&&(u=h[0])}}return h=Mr(),h.memoizedState=h.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:iE,lastRenderedState:u},h.queue=g,h=NE.bind(null,at,g),g.dispatch=h,g=Qx(!1),N=tb.bind(null,at,!1,g.queue),g=Mr(),w={state:u,dispatch:null,action:s,pending:null},g.queue=w,h=lH.bind(null,at,w,N,h),w.dispatch=h,g.memoizedState=s,[u,h,!1]}function sE(s){var u=Cn();return oE(u,qt,s)}function oE(s,u,h){if(u=Gx(s,u,iE)[0],s=Kp(ls)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=Zd(u)}catch(T){throw T===Ic?Dp:T}else g=u;u=Cn();var w=u.queue,N=w.dispatch;return h!==u.memoizedState&&(at.flags|=2048,qc(9,{destroy:void 0},cH.bind(null,w,h),null)),[g,N,s]}function cH(s,u){s.action=u}function lE(s){var u=Cn(),h=qt;if(h!==null)return oE(u,h,s);Cn(),u=u.memoizedState,h=Cn();var g=h.queue.dispatch;return h.memoizedState=s,[u,g,!1]}function qc(s,u,h,g){return s={tag:s,create:h,deps:g,inst:u,next:null},u=at.updateQueue,u===null&&(u=Fp(),at.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=s.next=s:(g=h.next,h.next=s,s.next=g,u.lastEffect=s),s}function cE(){return Cn().memoizedState}function Gp(s,u,h,g){var w=Mr();at.flags|=s,w.memoizedState=qc(1|u,{destroy:void 0},h,g===void 0?null:g)}function Vp(s,u,h,g){var w=Cn();g=g===void 0?null:g;var N=w.memoizedState.inst;qt!==null&&g!==null&&Bx(g,qt.memoizedState.deps)?w.memoizedState=qc(u,N,h,g):(at.flags|=s,w.memoizedState=qc(1|u,N,h,g))}function uE(s,u){Gp(8390656,8,s,u)}function Wx(s,u){Vp(2048,8,s,u)}function uH(s){at.flags|=4;var u=at.updateQueue;if(u===null)u=Fp(),at.updateQueue=u,u.events=[s];else{var h=u.events;h===null?u.events=[s]:h.push(s)}}function dE(s){var u=Cn().memoizedState;return uH({ref:u,nextImpl:s}),function(){if((Tt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function fE(s,u){return Vp(4,2,s,u)}function hE(s,u){return Vp(4,4,s,u)}function pE(s,u){if(typeof u=="function"){s=s();var h=u(s);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return s=s(),u.current=s,function(){u.current=null}}function mE(s,u,h){h=h!=null?h.concat([s]):null,Vp(4,4,pE.bind(null,u,s),h)}function Zx(){}function gE(s,u){var h=Cn();u=u===void 0?null:u;var g=h.memoizedState;return u!==null&&Bx(u,g[1])?g[0]:(h.memoizedState=[s,u],s)}function yE(s,u){var h=Cn();u=u===void 0?null:u;var g=h.memoizedState;if(u!==null&&Bx(u,g[1]))return g[0];if(g=s(),cl){cn(!0);try{s()}finally{cn(!1)}}return h.memoizedState=[g,u],g}function Xx(s,u,h){return h===void 0||(os&1073741824)!==0&&(yt&261930)===0?s.memoizedState=u:(s.memoizedState=h,s=v_(),at.lanes|=s,eo|=s,h)}function vE(s,u,h,g){return mi(h,u)?h:$c.current!==null?(s=Xx(s,h,g),mi(s,u)||(Pn=!0),s):(os&42)===0||(os&1073741824)!==0&&(yt&261930)===0?(Pn=!0,s.memoizedState=h):(s=v_(),at.lanes|=s,eo|=s,u)}function xE(s,u,h,g,w){var N=J.p;J.p=N!==0&&8>N?N:8;var T=H.T,L={};H.T=L,tb(s,!1,u,h);try{var K=w(),ae=H.S;if(ae!==null&&ae(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var pe=aH(K,g);Xd(s,u,pe,wi(s))}else Xd(s,u,g,wi(s))}catch(xe){Xd(s,u,{then:function(){},status:"rejected",reason:xe},wi())}finally{J.p=N,T!==null&&L.types!==null&&(T.types=L.types),H.T=T}}function dH(){}function Jx(s,u,h,g){if(s.tag!==5)throw Error(r(476));var w=bE(s).queue;xE(s,w,u,ue,h===null?dH:function(){return wE(s),h(g)})}function bE(s){var u=s.memoizedState;if(u!==null)return u;u={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:ue},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ls,lastRenderedState:h},next:null},s.memoizedState=u,s=s.alternate,s!==null&&(s.memoizedState=u),u}function wE(s){var u=bE(s);u.next===null&&(u=s.alternate.memoizedState),Xd(s,u.next.queue,{},wi())}function eb(){return lr(gf)}function SE(){return Cn().memoizedState}function jE(){return Cn().memoizedState}function fH(s){for(var u=s.return;u!==null;){switch(u.tag){case 24:case 3:var h=wi();s=Qs(h);var g=Ys(u,s,h);g!==null&&(ei(g,u,h),Vd(g,u,h)),u={cache:Ex()},s.payload=u;return}u=u.return}}function hH(s,u,h){var g=wi();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Qp(s)?kE(u,h):(h=vx(s,u,h,g),h!==null&&(ei(h,s,g),CE(h,u,g)))}function NE(s,u,h){var g=wi();Xd(s,u,h,g)}function Xd(s,u,h,g){var w={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(Qp(s))kE(u,w);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=u.lastRenderedReducer,N!==null))try{var T=u.lastRenderedState,L=N(T,h);if(w.hasEagerState=!0,w.eagerState=L,mi(L,T))return Op(s,u,w,0),Vt===null&&Ap(),!1}catch{}if(h=vx(s,u,w,g),h!==null)return ei(h,s,g),CE(h,u,g),!0}return!1}function tb(s,u,h,g){if(g={lane:2,revertLane:Pb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},Qp(s)){if(u)throw Error(r(479))}else u=vx(s,h,g,2),u!==null&&ei(u,s,2)}function Qp(s){var u=s.alternate;return s===at||u!==null&&u===at}function kE(s,u){Bc=Up=!0;var h=s.pending;h===null?u.next=u:(u.next=h.next,h.next=u),s.pending=u}function CE(s,u,h){if((h&4194048)!==0){var g=u.lanes;g&=s.pendingLanes,h|=g,u.lanes=h,ka(s,h)}}var Jd={readContext:lr,use:Hp,useCallback:bn,useContext:bn,useEffect:bn,useImperativeHandle:bn,useLayoutEffect:bn,useInsertionEffect:bn,useMemo:bn,useReducer:bn,useRef:bn,useState:bn,useDebugValue:bn,useDeferredValue:bn,useTransition:bn,useSyncExternalStore:bn,useId:bn,useHostTransitionStatus:bn,useFormState:bn,useActionState:bn,useOptimistic:bn,useMemoCache:bn,useCacheRefresh:bn};Jd.useEffectEvent=bn;var AE={readContext:lr,use:Hp,useCallback:function(s,u){return Mr().memoizedState=[s,u===void 0?null:u],s},useContext:lr,useEffect:uE,useImperativeHandle:function(s,u,h){h=h!=null?h.concat([s]):null,Gp(4194308,4,pE.bind(null,u,s),h)},useLayoutEffect:function(s,u){return Gp(4194308,4,s,u)},useInsertionEffect:function(s,u){Gp(4,2,s,u)},useMemo:function(s,u){var h=Mr();u=u===void 0?null:u;var g=s();if(cl){cn(!0);try{s()}finally{cn(!1)}}return h.memoizedState=[g,u],g},useReducer:function(s,u,h){var g=Mr();if(h!==void 0){var w=h(u);if(cl){cn(!0);try{h(u)}finally{cn(!1)}}}else w=u;return g.memoizedState=g.baseState=w,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:w},g.queue=s,s=s.dispatch=hH.bind(null,at,s),[g.memoizedState,s]},useRef:function(s){var u=Mr();return s={current:s},u.memoizedState=s},useState:function(s){s=Qx(s);var u=s.queue,h=NE.bind(null,at,u);return u.dispatch=h,[s.memoizedState,h]},useDebugValue:Zx,useDeferredValue:function(s,u){var h=Mr();return Xx(h,s,u)},useTransition:function(){var s=Qx(!1);return s=xE.bind(null,at,s.queue,!0,!1),Mr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,u,h){var g=at,w=Mr();if(wt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),Vt===null)throw Error(r(349));(yt&127)!==0||QO(g,u,h)}w.memoizedState=h;var N={value:h,getSnapshot:u};return w.queue=N,uE(WO.bind(null,g,N,s),[s]),g.flags|=2048,qc(9,{destroy:void 0},YO.bind(null,g,N,h,u),null),h},useId:function(){var s=Mr(),u=Vt.identifierPrefix;if(wt){var h=Oa,g=Aa;h=(g&~(1<<32-it(g)-1)).toString(32)+h,u="_"+u+"R_"+h,h=qp++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=sH++,u="_"+u+"r_"+h.toString(32)+"_";return s.memoizedState=u},useHostTransitionStatus:eb,useFormState:aE,useActionState:aE,useOptimistic:function(s){var u=Mr();u.memoizedState=u.baseState=s;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=tb.bind(null,at,!0,h),h.dispatch=u,[s,u]},useMemoCache:Kx,useCacheRefresh:function(){return Mr().memoizedState=fH.bind(null,at)},useEffectEvent:function(s){var u=Mr(),h={impl:s};return u.memoizedState=h,function(){if((Tt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},nb={readContext:lr,use:Hp,useCallback:gE,useContext:lr,useEffect:Wx,useImperativeHandle:mE,useInsertionEffect:fE,useLayoutEffect:hE,useMemo:yE,useReducer:Kp,useRef:cE,useState:function(){return Kp(ls)},useDebugValue:Zx,useDeferredValue:function(s,u){var h=Cn();return vE(h,qt.memoizedState,s,u)},useTransition:function(){var s=Kp(ls)[0],u=Cn().memoizedState;return[typeof s=="boolean"?s:Zd(s),u]},useSyncExternalStore:VO,useId:SE,useHostTransitionStatus:eb,useFormState:sE,useActionState:sE,useOptimistic:function(s,u){var h=Cn();return JO(h,qt,s,u)},useMemoCache:Kx,useCacheRefresh:jE};nb.useEffectEvent=dE;var OE={readContext:lr,use:Hp,useCallback:gE,useContext:lr,useEffect:Wx,useImperativeHandle:mE,useInsertionEffect:fE,useLayoutEffect:hE,useMemo:yE,useReducer:Vx,useRef:cE,useState:function(){return Vx(ls)},useDebugValue:Zx,useDeferredValue:function(s,u){var h=Cn();return qt===null?Xx(h,s,u):vE(h,qt.memoizedState,s,u)},useTransition:function(){var s=Vx(ls)[0],u=Cn().memoizedState;return[typeof s=="boolean"?s:Zd(s),u]},useSyncExternalStore:VO,useId:SE,useHostTransitionStatus:eb,useFormState:lE,useActionState:lE,useOptimistic:function(s,u){var h=Cn();return qt!==null?JO(h,qt,s,u):(h.baseState=s,[s,h.queue.dispatch])},useMemoCache:Kx,useCacheRefresh:jE};OE.useEffectEvent=dE;function rb(s,u,h,g){u=s.memoizedState,h=h(g,u),h=h==null?u:m({},u,h),s.memoizedState=h,s.lanes===0&&(s.updateQueue.baseState=h)}var ib={enqueueSetState:function(s,u,h){s=s._reactInternals;var g=wi(),w=Qs(g);w.payload=u,h!=null&&(w.callback=h),u=Ys(s,w,g),u!==null&&(ei(u,s,g),Vd(u,s,g))},enqueueReplaceState:function(s,u,h){s=s._reactInternals;var g=wi(),w=Qs(g);w.tag=1,w.payload=u,h!=null&&(w.callback=h),u=Ys(s,w,g),u!==null&&(ei(u,s,g),Vd(u,s,g))},enqueueForceUpdate:function(s,u){s=s._reactInternals;var h=wi(),g=Qs(h);g.tag=2,u!=null&&(g.callback=u),u=Ys(s,g,h),u!==null&&(ei(u,s,h),Vd(u,s,h))}};function EE(s,u,h,g,w,N,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,T):u.prototype&&u.prototype.isPureReactComponent?!$d(h,g)||!$d(w,N):!0}function _E(s,u,h,g){s=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,g),u.state!==s&&ib.enqueueReplaceState(u,u.state,null)}function ul(s,u){var h=u;if("ref"in u){h={};for(var g in u)g!=="ref"&&(h[g]=u[g])}if(s=s.defaultProps){h===u&&(h=m({},h));for(var w in s)h[w]===void 0&&(h[w]=s[w])}return h}function zE(s){Cp(s)}function TE(s){console.error(s)}function PE(s){Cp(s)}function Yp(s,u){try{var h=s.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function RE(s,u,h){try{var g=s.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function ab(s,u,h){return h=Qs(h),h.tag=3,h.payload={element:null},h.callback=function(){Yp(s,u)},h}function DE(s){return s=Qs(s),s.tag=3,s}function ME(s,u,h,g){var w=h.type.getDerivedStateFromError;if(typeof w=="function"){var N=g.value;s.payload=function(){return w(N)},s.callback=function(){RE(u,h,g)}}var T=h.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(s.callback=function(){RE(u,h,g),typeof w!="function"&&(to===null?to=new Set([this]):to.add(this));var L=g.stack;this.componentDidCatch(g.value,{componentStack:L!==null?L:""})})}function pH(s,u,h,g,w){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=h.alternate,u!==null&&Rc(u,h,w,!0),h=yi.current,h!==null){switch(h.tag){case 31:case 13:return Mi===null?om():h.alternate===null&&wn===0&&(wn=3),h.flags&=-257,h.flags|=65536,h.lanes=w,g===Mp?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([g]):u.add(g),_b(s,g,w)),!1;case 22:return h.flags|=65536,g===Mp?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([g]):h.add(g)),_b(s,g,w)),!1}throw Error(r(435,h.tag))}return _b(s,g,w),om(),!1}if(wt)return u=yi.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=w,g!==Nx&&(s=Error(r(422),{cause:g}),qd(Ti(s,h)))):(g!==Nx&&(u=Error(r(423),{cause:g}),qd(Ti(u,h))),s=s.current.alternate,s.flags|=65536,w&=-w,s.lanes|=w,g=Ti(g,h),w=ab(s.stateNode,g,w),Dx(s,w),wn!==4&&(wn=2)),!1;var N=Error(r(520),{cause:g});if(N=Ti(N,h),lf===null?lf=[N]:lf.push(N),wn!==4&&(wn=2),u===null)return!0;g=Ti(g,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,s=w&-w,h.lanes|=s,s=ab(h.stateNode,g,s),Dx(h,s),!1;case 1:if(u=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(to===null||!to.has(N))))return h.flags|=65536,w&=-w,h.lanes|=w,w=DE(w),ME(w,s,h,g),Dx(h,w),!1}h=h.return}while(h!==null);return!1}var sb=Error(r(461)),Pn=!1;function cr(s,u,h,g){u.child=s===null?BO(u,null,h,g):ll(u,s.child,h,g)}function IE(s,u,h,g,w){h=h.render;var N=u.ref;if("ref"in g){var T={};for(var L in g)L!=="ref"&&(T[L]=g[L])}else T=g;return il(u),g=Ux(s,u,h,T,N,w),L=qx(),s!==null&&!Pn?(Fx(s,u,w),cs(s,u,w)):(wt&&L&&Sx(u),u.flags|=1,cr(s,u,g,w),u.child)}function LE(s,u,h,g,w){if(s===null){var N=h.type;return typeof N=="function"&&!xx(N)&&N.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=N,$E(s,u,N,g,w)):(s=_p(h.type,null,g,u,u.mode,w),s.ref=u.ref,s.return=u,u.child=s)}if(N=s.child,!pb(s,w)){var T=N.memoizedProps;if(h=h.compare,h=h!==null?h:$d,h(T,g)&&s.ref===u.ref)return cs(s,u,w)}return u.flags|=1,s=rs(N,g),s.ref=u.ref,s.return=u,u.child=s}function $E(s,u,h,g,w){if(s!==null){var N=s.memoizedProps;if($d(N,g)&&s.ref===u.ref)if(Pn=!1,u.pendingProps=g=N,pb(s,w))(s.flags&131072)!==0&&(Pn=!0);else return u.lanes=s.lanes,cs(s,u,w)}return ob(s,u,h,g,w)}function BE(s,u,h,g){var w=g.children,N=s!==null?s.memoizedState:null;if(s===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,s!==null){for(g=u.child=s.child,w=0;g!==null;)w=w|g.lanes|g.childLanes,g=g.sibling;g=w&~N}else g=0,u.child=null;return UE(s,u,N,h,g)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},s!==null&&Rp(u,N!==null?N.cachePool:null),N!==null?FO(u,N):Ix(),HO(u);else return g=u.lanes=536870912,UE(s,u,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(Rp(u,N.cachePool),FO(u,N),Zs(),u.memoizedState=null):(s!==null&&Rp(u,null),Ix(),Zs());return cr(s,u,w,h),u.child}function ef(s,u){return s!==null&&s.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function UE(s,u,h,g,w){var N=zx();return N=N===null?null:{parent:zn._currentValue,pool:N},u.memoizedState={baseLanes:h,cachePool:N},s!==null&&Rp(u,null),Ix(),HO(u),s!==null&&Rc(s,u,g,!0),u.childLanes=w,null}function Wp(s,u){return u=Xp({mode:u.mode,children:u.children},s.mode),u.ref=s.ref,s.child=u,u.return=s,u}function qE(s,u,h){return ll(u,s.child,null,h),s=Wp(u,u.pendingProps),s.flags|=2,vi(u),u.memoizedState=null,s}function mH(s,u,h){var g=u.pendingProps,w=(u.flags&128)!==0;if(u.flags&=-129,s===null){if(wt){if(g.mode==="hidden")return s=Wp(u,g),u.lanes=536870912,ef(null,s);if($x(u),(s=nn)?(s=ez(s,Di),s=s!==null&&s.data==="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Fs!==null?{id:Aa,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},h=kO(s),h.return=u,u.child=h,or=u,nn=null)):s=null,s===null)throw Ks(u);return u.lanes=536870912,null}return Wp(u,g)}var N=s.memoizedState;if(N!==null){var T=N.dehydrated;if($x(u),w)if(u.flags&256)u.flags&=-257,u=qE(s,u,h);else if(u.memoizedState!==null)u.child=s.child,u.flags|=128,u=null;else throw Error(r(558));else if(Pn||Rc(s,u,h,!1),w=(h&s.childLanes)!==0,Pn||w){if(g=Vt,g!==null&&(T=ia(g,h),T!==0&&T!==N.retryLane))throw N.retryLane=T,el(s,T),ei(g,s,T),sb;om(),u=qE(s,u,h)}else s=N.treeContext,nn=Ii(T.nextSibling),or=u,wt=!0,Hs=null,Di=!1,s!==null&&OO(u,s),u=Wp(u,g),u.flags|=4096;return u}return s=rs(s.child,{mode:g.mode,children:g.children}),s.ref=u.ref,u.child=s,s.return=u,s}function Zp(s,u){var h=u.ref;if(h===null)s!==null&&s.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(s===null||s.ref!==h)&&(u.flags|=4194816)}}function ob(s,u,h,g,w){return il(u),h=Ux(s,u,h,g,void 0,w),g=qx(),s!==null&&!Pn?(Fx(s,u,w),cs(s,u,w)):(wt&&g&&Sx(u),u.flags|=1,cr(s,u,h,w),u.child)}function FE(s,u,h,g,w,N){return il(u),u.updateQueue=null,h=GO(u,g,h,w),KO(s),g=qx(),s!==null&&!Pn?(Fx(s,u,N),cs(s,u,N)):(wt&&g&&Sx(u),u.flags|=1,cr(s,u,h,N),u.child)}function HE(s,u,h,g,w){if(il(u),u.stateNode===null){var N=_c,T=h.contextType;typeof T=="object"&&T!==null&&(N=lr(T)),N=new h(g,N),u.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=ib,u.stateNode=N,N._reactInternals=u,N=u.stateNode,N.props=g,N.state=u.memoizedState,N.refs={},Px(u),T=h.contextType,N.context=typeof T=="object"&&T!==null?lr(T):_c,N.state=u.memoizedState,T=h.getDerivedStateFromProps,typeof T=="function"&&(rb(u,h,T,g),N.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(T=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),T!==N.state&&ib.enqueueReplaceState(N,N.state,null),Yd(u,g,N,w),Qd(),N.state=u.memoizedState),typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(s===null){N=u.stateNode;var L=u.memoizedProps,K=ul(h,L);N.props=K;var ae=N.context,pe=h.contextType;T=_c,typeof pe=="object"&&pe!==null&&(T=lr(pe));var xe=h.getDerivedStateFromProps;pe=typeof xe=="function"||typeof N.getSnapshotBeforeUpdate=="function",L=u.pendingProps!==L,pe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L||ae!==T)&&_E(u,N,g,T),Vs=!1;var le=u.memoizedState;N.state=le,Yd(u,g,N,w),Qd(),ae=u.memoizedState,L||le!==ae||Vs?(typeof xe=="function"&&(rb(u,h,xe,g),ae=u.memoizedState),(K=Vs||EE(u,h,K,g,le,ae,T))?(pe||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=ae),N.props=g,N.state=ae,N.context=T,g=K):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{N=u.stateNode,Rx(s,u),T=u.memoizedProps,pe=ul(h,T),N.props=pe,xe=u.pendingProps,le=N.context,ae=h.contextType,K=_c,typeof ae=="object"&&ae!==null&&(K=lr(ae)),L=h.getDerivedStateFromProps,(ae=typeof L=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(T!==xe||le!==K)&&_E(u,N,g,K),Vs=!1,le=u.memoizedState,N.state=le,Yd(u,g,N,w),Qd();var fe=u.memoizedState;T!==xe||le!==fe||Vs||s!==null&&s.dependencies!==null&&Tp(s.dependencies)?(typeof L=="function"&&(rb(u,h,L,g),fe=u.memoizedState),(pe=Vs||EE(u,h,pe,g,le,fe,K)||s!==null&&s.dependencies!==null&&Tp(s.dependencies))?(ae||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,fe,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,fe,K)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=fe),N.props=g,N.state=fe,N.context=K,g=pe):(typeof N.componentDidUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===s.memoizedProps&&le===s.memoizedState||(u.flags|=1024),g=!1)}return N=g,Zp(s,u),g=(u.flags&128)!==0,N||g?(N=u.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),u.flags|=1,s!==null&&g?(u.child=ll(u,s.child,null,w),u.child=ll(u,null,h,w)):cr(s,u,h,w),u.memoizedState=N.state,s=u.child):s=cs(s,u,w),s}function KE(s,u,h,g){return nl(),u.flags|=256,cr(s,u,h,g),u.child}var lb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cb(s){return{baseLanes:s,cachePool:RO()}}function ub(s,u,h){return s=s!==null?s.childLanes&~h:0,u&&(s|=bi),s}function GE(s,u,h){var g=u.pendingProps,w=!1,N=(u.flags&128)!==0,T;if((T=N)||(T=s!==null&&s.memoizedState===null?!1:(kn.current&2)!==0),T&&(w=!0,u.flags&=-129),T=(u.flags&32)!==0,u.flags&=-33,s===null){if(wt){if(w?Ws(u):Zs(),(s=nn)?(s=ez(s,Di),s=s!==null&&s.data!=="&"?s:null,s!==null&&(u.memoizedState={dehydrated:s,treeContext:Fs!==null?{id:Aa,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},h=kO(s),h.return=u,u.child=h,or=u,nn=null)):s=null,s===null)throw Ks(u);return Gb(s)?u.lanes=32:u.lanes=536870912,null}var L=g.children;return g=g.fallback,w?(Zs(),w=u.mode,L=Xp({mode:"hidden",children:L},w),g=tl(g,w,h,null),L.return=u,g.return=u,L.sibling=g,u.child=L,g=u.child,g.memoizedState=cb(h),g.childLanes=ub(s,T,h),u.memoizedState=lb,ef(null,g)):(Ws(u),db(u,L))}var K=s.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(N)u.flags&256?(Ws(u),u.flags&=-257,u=fb(s,u,h)):u.memoizedState!==null?(Zs(),u.child=s.child,u.flags|=128,u=null):(Zs(),L=g.fallback,w=u.mode,g=Xp({mode:"visible",children:g.children},w),L=tl(L,w,h,null),L.flags|=2,g.return=u,L.return=u,g.sibling=L,u.child=g,ll(u,s.child,null,h),g=u.child,g.memoizedState=cb(h),g.childLanes=ub(s,T,h),u.memoizedState=lb,u=ef(null,g));else if(Ws(u),Gb(L)){if(T=L.nextSibling&&L.nextSibling.dataset,T)var ae=T.dgst;T=ae,g=Error(r(419)),g.stack="",g.digest=T,qd({value:g,source:null,stack:null}),u=fb(s,u,h)}else if(Pn||Rc(s,u,h,!1),T=(h&s.childLanes)!==0,Pn||T){if(T=Vt,T!==null&&(g=ia(T,h),g!==0&&g!==K.retryLane))throw K.retryLane=g,el(s,g),ei(T,s,g),sb;Kb(L)||om(),u=fb(s,u,h)}else Kb(L)?(u.flags|=192,u.child=s.child,u=null):(s=K.treeContext,nn=Ii(L.nextSibling),or=u,wt=!0,Hs=null,Di=!1,s!==null&&OO(u,s),u=db(u,g.children),u.flags|=4096);return u}return w?(Zs(),L=g.fallback,w=u.mode,K=s.child,ae=K.sibling,g=rs(K,{mode:"hidden",children:g.children}),g.subtreeFlags=K.subtreeFlags&65011712,ae!==null?L=rs(ae,L):(L=tl(L,w,h,null),L.flags|=2),L.return=u,g.return=u,g.sibling=L,u.child=g,ef(null,g),g=u.child,L=s.child.memoizedState,L===null?L=cb(h):(w=L.cachePool,w!==null?(K=zn._currentValue,w=w.parent!==K?{parent:K,pool:K}:w):w=RO(),L={baseLanes:L.baseLanes|h,cachePool:w}),g.memoizedState=L,g.childLanes=ub(s,T,h),u.memoizedState=lb,ef(s.child,g)):(Ws(u),h=s.child,s=h.sibling,h=rs(h,{mode:"visible",children:g.children}),h.return=u,h.sibling=null,s!==null&&(T=u.deletions,T===null?(u.deletions=[s],u.flags|=16):T.push(s)),u.child=h,u.memoizedState=null,h)}function db(s,u){return u=Xp({mode:"visible",children:u},s.mode),u.return=s,s.child=u}function Xp(s,u){return s=gi(22,s,null,u),s.lanes=0,s}function fb(s,u,h){return ll(u,s.child,null,h),s=db(u,u.pendingProps.children),s.flags|=2,u.memoizedState=null,s}function VE(s,u,h){s.lanes|=u;var g=s.alternate;g!==null&&(g.lanes|=u),Ax(s.return,u,h)}function hb(s,u,h,g,w,N){var T=s.memoizedState;T===null?s.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:w,treeForkCount:N}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=g,T.tail=h,T.tailMode=w,T.treeForkCount=N)}function QE(s,u,h){var g=u.pendingProps,w=g.revealOrder,N=g.tail;g=g.children;var T=kn.current,L=(T&2)!==0;if(L?(T=T&1|2,u.flags|=128):T&=1,M(kn,T),cr(s,u,g,h),g=wt?Ud:0,!L&&s!==null&&(s.flags&128)!==0)e:for(s=u.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&VE(s,h,u);else if(s.tag===19)VE(s,h,u);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===u)break e;for(;s.sibling===null;){if(s.return===null||s.return===u)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(w){case"forwards":for(h=u.child,w=null;h!==null;)s=h.alternate,s!==null&&Bp(s)===null&&(w=h),h=h.sibling;h=w,h===null?(w=u.child,u.child=null):(w=h.sibling,h.sibling=null),hb(u,!1,w,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,w=u.child,u.child=null;w!==null;){if(s=w.alternate,s!==null&&Bp(s)===null){u.child=w;break}s=w.sibling,w.sibling=h,h=w,w=s}hb(u,!0,h,null,N,g);break;case"together":hb(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function cs(s,u,h){if(s!==null&&(u.dependencies=s.dependencies),eo|=u.lanes,(h&u.childLanes)===0)if(s!==null){if(Rc(s,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(s!==null&&u.child!==s.child)throw Error(r(153));if(u.child!==null){for(s=u.child,h=rs(s,s.pendingProps),u.child=h,h.return=u;s.sibling!==null;)s=s.sibling,h=h.sibling=rs(s,s.pendingProps),h.return=u;h.sibling=null}return u.child}function pb(s,u){return(s.lanes&u)!==0?!0:(s=s.dependencies,!!(s!==null&&Tp(s)))}function gH(s,u,h){switch(u.tag){case 3:_e(u,u.stateNode.containerInfo),Gs(u,zn,s.memoizedState.cache),nl();break;case 27:case 5:he(u);break;case 4:_e(u,u.stateNode.containerInfo);break;case 10:Gs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,$x(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(Ws(u),u.flags|=128,null):(h&u.child.childLanes)!==0?GE(s,u,h):(Ws(u),s=cs(s,u,h),s!==null?s.sibling:null);Ws(u);break;case 19:var w=(s.flags&128)!==0;if(g=(h&u.childLanes)!==0,g||(Rc(s,u,h,!1),g=(h&u.childLanes)!==0),w){if(g)return QE(s,u,h);u.flags|=128}if(w=u.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),M(kn,kn.current),g)break;return null;case 22:return u.lanes=0,BE(s,u,h,u.pendingProps);case 24:Gs(u,zn,s.memoizedState.cache)}return cs(s,u,h)}function YE(s,u,h){if(s!==null)if(s.memoizedProps!==u.pendingProps)Pn=!0;else{if(!pb(s,h)&&(u.flags&128)===0)return Pn=!1,gH(s,u,h);Pn=(s.flags&131072)!==0}else Pn=!1,wt&&(u.flags&1048576)!==0&&AO(u,Ud,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(s=sl(u.elementType),u.type=s,typeof s=="function")xx(s)?(g=ul(s,g),u.tag=1,u=HE(null,u,s,g,h)):(u.tag=0,u=ob(null,u,s,g,h));else{if(s!=null){var w=s.$$typeof;if(w===O){u.tag=11,u=IE(null,u,s,g,h);break e}else if(w===_){u.tag=14,u=LE(null,u,s,g,h);break e}}throw u=X(s)||s,Error(r(306,u,""))}}return u;case 0:return ob(s,u,u.type,u.pendingProps,h);case 1:return g=u.type,w=ul(g,u.pendingProps),HE(s,u,g,w,h);case 3:e:{if(_e(u,u.stateNode.containerInfo),s===null)throw Error(r(387));g=u.pendingProps;var N=u.memoizedState;w=N.element,Rx(s,u),Yd(u,g,null,h);var T=u.memoizedState;if(g=T.cache,Gs(u,zn,g),g!==N.cache&&Ox(u,[zn],h,!0),Qd(),g=T.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:T.cache},u.updateQueue.baseState=N,u.memoizedState=N,u.flags&256){u=KE(s,u,g,h);break e}else if(g!==w){w=Ti(Error(r(424)),u),qd(w),u=KE(s,u,g,h);break e}else for(s=u.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,nn=Ii(s.firstChild),or=u,wt=!0,Hs=null,Di=!0,h=BO(u,null,g,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(nl(),g===w){u=cs(s,u,h);break e}cr(s,u,g,h)}u=u.child}return u;case 26:return Zp(s,u),s===null?(h=sz(u.type,null,u.pendingProps,null))?u.memoizedState=h:wt||(h=u.type,s=u.pendingProps,g=pm(ne.current).createElement(h),g[Ln]=u,g[ar]=s,ur(g,h,s),un(g),u.stateNode=g):u.memoizedState=sz(u.type,s.memoizedProps,u.pendingProps,s.memoizedState),null;case 27:return he(u),s===null&&wt&&(g=u.stateNode=rz(u.type,u.pendingProps,ne.current),or=u,Di=!0,w=nn,ao(u.type)?(Vb=w,nn=Ii(g.firstChild)):nn=w),cr(s,u,u.pendingProps.children,h),Zp(s,u),s===null&&(u.flags|=4194304),u.child;case 5:return s===null&&wt&&((w=g=nn)&&(g=GH(g,u.type,u.pendingProps,Di),g!==null?(u.stateNode=g,or=u,nn=Ii(g.firstChild),Di=!1,w=!0):w=!1),w||Ks(u)),he(u),w=u.type,N=u.pendingProps,T=s!==null?s.memoizedProps:null,g=N.children,qb(w,N)?g=null:T!==null&&qb(w,T)&&(u.flags|=32),u.memoizedState!==null&&(w=Ux(s,u,oH,null,null,h),gf._currentValue=w),Zp(s,u),cr(s,u,g,h),u.child;case 6:return s===null&&wt&&((s=h=nn)&&(h=VH(h,u.pendingProps,Di),h!==null?(u.stateNode=h,or=u,nn=null,s=!0):s=!1),s||Ks(u)),null;case 13:return GE(s,u,h);case 4:return _e(u,u.stateNode.containerInfo),g=u.pendingProps,s===null?u.child=ll(u,null,g,h):cr(s,u,g,h),u.child;case 11:return IE(s,u,u.type,u.pendingProps,h);case 7:return cr(s,u,u.pendingProps,h),u.child;case 8:return cr(s,u,u.pendingProps.children,h),u.child;case 12:return cr(s,u,u.pendingProps.children,h),u.child;case 10:return g=u.pendingProps,Gs(u,u.type,g.value),cr(s,u,g.children,h),u.child;case 9:return w=u.type._context,g=u.pendingProps.children,il(u),w=lr(w),g=g(w),u.flags|=1,cr(s,u,g,h),u.child;case 14:return LE(s,u,u.type,u.pendingProps,h);case 15:return $E(s,u,u.type,u.pendingProps,h);case 19:return QE(s,u,h);case 31:return mH(s,u,h);case 22:return BE(s,u,h,u.pendingProps);case 24:return il(u),g=lr(zn),s===null?(w=zx(),w===null&&(w=Vt,N=Ex(),w.pooledCache=N,N.refCount++,N!==null&&(w.pooledCacheLanes|=h),w=N),u.memoizedState={parent:g,cache:w},Px(u),Gs(u,zn,w)):((s.lanes&h)!==0&&(Rx(s,u),Yd(u,null,null,h),Qd()),w=s.memoizedState,N=u.memoizedState,w.parent!==g?(w={parent:g,cache:g},u.memoizedState=w,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=w),Gs(u,zn,g)):(g=N.cache,Gs(u,zn,g),g!==w.cache&&Ox(u,[zn],h,!0))),cr(s,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function us(s){s.flags|=4}function mb(s,u,h,g,w){if((u=(s.mode&32)!==0)&&(u=!1),u){if(s.flags|=16777216,(w&335544128)===w)if(s.stateNode.complete)s.flags|=8192;else if(S_())s.flags|=8192;else throw ol=Mp,Tx}else s.flags&=-16777217}function WE(s,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!dz(u))if(S_())s.flags|=8192;else throw ol=Mp,Tx}function Jp(s,u){u!==null&&(s.flags|=4),s.flags&16384&&(u=s.tag!==22?Wn():536870912,s.lanes|=u,Gc|=u)}function tf(s,u){if(!wt)switch(s.tailMode){case"hidden":u=s.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s.tail=null:h.sibling=null;break;case"collapsed":h=s.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?u||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function rn(s){var u=s.alternate!==null&&s.alternate.child===s.child,h=0,g=0;if(u)for(var w=s.child;w!==null;)h|=w.lanes|w.childLanes,g|=w.subtreeFlags&65011712,g|=w.flags&65011712,w.return=s,w=w.sibling;else for(w=s.child;w!==null;)h|=w.lanes|w.childLanes,g|=w.subtreeFlags,g|=w.flags,w.return=s,w=w.sibling;return s.subtreeFlags|=g,s.childLanes=h,u}function yH(s,u,h){var g=u.pendingProps;switch(jx(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(u),null;case 1:return rn(u),null;case 3:return h=u.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),ss(zn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(Pc(u)?us(u):s===null||s.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,kx())),rn(u),null;case 26:var w=u.type,N=u.memoizedState;return s===null?(us(u),N!==null?(rn(u),WE(u,N)):(rn(u),mb(u,w,null,g,h))):N?N!==s.memoizedState?(us(u),rn(u),WE(u,N)):(rn(u),u.flags&=-16777217):(s=s.memoizedProps,s!==g&&us(u),rn(u),mb(u,w,s,g,h)),null;case 27:if(Ee(u),h=ne.current,w=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&us(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return rn(u),null}s=Q.current,Pc(u)?EO(u):(s=rz(w,g,h),u.stateNode=s,us(u))}return rn(u),null;case 5:if(Ee(u),w=u.type,s!==null&&u.stateNode!=null)s.memoizedProps!==g&&us(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return rn(u),null}if(N=Q.current,Pc(u))EO(u);else{var T=pm(ne.current);switch(N){case 1:N=T.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:N=T.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":N=T.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":N=T.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":N=T.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?T.createElement("select",{is:g.is}):T.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?T.createElement(w,{is:g.is}):T.createElement(w)}}N[Ln]=u,N[ar]=g;e:for(T=u.child;T!==null;){if(T.tag===5||T.tag===6)N.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===u)break e;for(;T.sibling===null;){if(T.return===null||T.return===u)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}u.stateNode=N;e:switch(ur(N,w,g),w){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&us(u)}}return rn(u),mb(u,u.type,s===null?null:s.memoizedProps,u.pendingProps,h),null;case 6:if(s&&u.stateNode!=null)s.memoizedProps!==g&&us(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(s=ne.current,Pc(u)){if(s=u.stateNode,h=u.memoizedProps,g=null,w=or,w!==null)switch(w.tag){case 27:case 5:g=w.memoizedProps}s[Ln]=u,s=!!(s.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||G_(s.nodeValue,h)),s||Ks(u,!0)}else s=pm(s).createTextNode(g),s[Ln]=u,u.stateNode=s}return rn(u),null;case 31:if(h=u.memoizedState,s===null||s.memoizedState!==null){if(g=Pc(u),h!==null){if(s===null){if(!g)throw Error(r(318));if(s=u.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[Ln]=u}else nl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;rn(u),s=!1}else h=kx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=h),s=!0;if(!s)return u.flags&256?(vi(u),u):(vi(u),null);if((u.flags&128)!==0)throw Error(r(558))}return rn(u),null;case 13:if(g=u.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(w=Pc(u),g!==null&&g.dehydrated!==null){if(s===null){if(!w)throw Error(r(318));if(w=u.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[Ln]=u}else nl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;rn(u),w=!1}else w=kx(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=w),w=!0;if(!w)return u.flags&256?(vi(u),u):(vi(u),null)}return vi(u),(u.flags&128)!==0?(u.lanes=h,u):(h=g!==null,s=s!==null&&s.memoizedState!==null,h&&(g=u.child,w=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(w=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==w&&(g.flags|=2048)),h!==s&&h&&(u.child.flags|=8192),Jp(u,u.updateQueue),rn(u),null);case 4:return ee(),s===null&&Ib(u.stateNode.containerInfo),rn(u),null;case 10:return ss(u.type),rn(u),null;case 19:if(U(kn),g=u.memoizedState,g===null)return rn(u),null;if(w=(u.flags&128)!==0,N=g.rendering,N===null)if(w)tf(g,!1);else{if(wn!==0||s!==null&&(s.flags&128)!==0)for(s=u.child;s!==null;){if(N=Bp(s),N!==null){for(u.flags|=128,tf(g,!1),s=N.updateQueue,u.updateQueue=s,Jp(u,s),u.subtreeFlags=0,s=h,h=u.child;h!==null;)NO(h,s),h=h.sibling;return M(kn,kn.current&1|2),wt&&is(u,g.treeForkCount),u.child}s=s.sibling}g.tail!==null&&Ct()>im&&(u.flags|=128,w=!0,tf(g,!1),u.lanes=4194304)}else{if(!w)if(s=Bp(N),s!==null){if(u.flags|=128,w=!0,s=s.updateQueue,u.updateQueue=s,Jp(u,s),tf(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!wt)return rn(u),null}else 2*Ct()-g.renderingStartTime>im&&h!==536870912&&(u.flags|=128,w=!0,tf(g,!1),u.lanes=4194304);g.isBackwards?(N.sibling=u.child,u.child=N):(s=g.last,s!==null?s.sibling=N:u.child=N,g.last=N)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Ct(),s.sibling=null,h=kn.current,M(kn,w?h&1|2:h&1),wt&&is(u,g.treeForkCount),s):(rn(u),null);case 22:case 23:return vi(u),Lx(),g=u.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(h&536870912)!==0&&(u.flags&128)===0&&(rn(u),u.subtreeFlags&6&&(u.flags|=8192)):rn(u),h=u.updateQueue,h!==null&&Jp(u,h.retryQueue),h=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048),s!==null&&U(al),null;case 24:return h=null,s!==null&&(h=s.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),ss(zn),rn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function vH(s,u){switch(jx(u),u.tag){case 1:return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 3:return ss(zn),ee(),s=u.flags,(s&65536)!==0&&(s&128)===0?(u.flags=s&-65537|128,u):null;case 26:case 27:case 5:return Ee(u),null;case 31:if(u.memoizedState!==null){if(vi(u),u.alternate===null)throw Error(r(340));nl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 13:if(vi(u),s=u.memoizedState,s!==null&&s.dehydrated!==null){if(u.alternate===null)throw Error(r(340));nl()}return s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 19:return U(kn),null;case 4:return ee(),null;case 10:return ss(u.type),null;case 22:case 23:return vi(u),Lx(),s!==null&&U(al),s=u.flags,s&65536?(u.flags=s&-65537|128,u):null;case 24:return ss(zn),null;case 25:return null;default:return null}}function ZE(s,u){switch(jx(u),u.tag){case 3:ss(zn),ee();break;case 26:case 27:case 5:Ee(u);break;case 4:ee();break;case 31:u.memoizedState!==null&&vi(u);break;case 13:vi(u);break;case 19:U(kn);break;case 10:ss(u.type);break;case 22:case 23:vi(u),Lx(),s!==null&&U(al);break;case 24:ss(zn)}}function nf(s,u){try{var h=u.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var w=g.next;h=w;do{if((h.tag&s)===s){g=void 0;var N=h.create,T=h.inst;g=N(),T.destroy=g}h=h.next}while(h!==w)}}catch(L){Bt(u,u.return,L)}}function Xs(s,u,h){try{var g=u.updateQueue,w=g!==null?g.lastEffect:null;if(w!==null){var N=w.next;g=N;do{if((g.tag&s)===s){var T=g.inst,L=T.destroy;if(L!==void 0){T.destroy=void 0,w=u;var K=h,ae=L;try{ae()}catch(pe){Bt(w,K,pe)}}}g=g.next}while(g!==N)}}catch(pe){Bt(u,u.return,pe)}}function XE(s){var u=s.updateQueue;if(u!==null){var h=s.stateNode;try{qO(u,h)}catch(g){Bt(s,s.return,g)}}}function JE(s,u,h){h.props=ul(s.type,s.memoizedProps),h.state=s.memoizedState;try{h.componentWillUnmount()}catch(g){Bt(s,u,g)}}function rf(s,u){try{var h=s.ref;if(h!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof h=="function"?s.refCleanup=h(g):h.current=g}}catch(w){Bt(s,u,w)}}function Ea(s,u){var h=s.ref,g=s.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(w){Bt(s,u,w)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(w){Bt(s,u,w)}else h.current=null}function e_(s){var u=s.type,h=s.memoizedProps,g=s.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(w){Bt(s,s.return,w)}}function gb(s,u,h){try{var g=s.stateNode;BH(g,s.type,h,u),g[ar]=u}catch(w){Bt(s,s.return,w)}}function t_(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ao(s.type)||s.tag===4}function yb(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||t_(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&&ao(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 vb(s,u,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(s,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(s),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=ts));else if(g!==4&&(g===27&&ao(s.type)&&(h=s.stateNode,u=null),s=s.child,s!==null))for(vb(s,u,h),s=s.sibling;s!==null;)vb(s,u,h),s=s.sibling}function em(s,u,h){var g=s.tag;if(g===5||g===6)s=s.stateNode,u?h.insertBefore(s,u):h.appendChild(s);else if(g!==4&&(g===27&&ao(s.type)&&(h=s.stateNode),s=s.child,s!==null))for(em(s,u,h),s=s.sibling;s!==null;)em(s,u,h),s=s.sibling}function n_(s){var u=s.stateNode,h=s.memoizedProps;try{for(var g=s.type,w=u.attributes;w.length;)u.removeAttributeNode(w[0]);ur(u,g,h),u[Ln]=s,u[ar]=h}catch(N){Bt(s,s.return,N)}}var ds=!1,Rn=!1,xb=!1,r_=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function xH(s,u){if(s=s.containerInfo,Bb=wm,s=mO(s),fx(s)){if("selectionStart"in s)var h={start:s.selectionStart,end:s.selectionEnd};else e:{h=(h=s.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var w=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var T=0,L=-1,K=-1,ae=0,pe=0,xe=s,le=null;t:for(;;){for(var fe;xe!==h||w!==0&&xe.nodeType!==3||(L=T+w),xe!==N||g!==0&&xe.nodeType!==3||(K=T+g),xe.nodeType===3&&(T+=xe.nodeValue.length),(fe=xe.firstChild)!==null;)le=xe,xe=fe;for(;;){if(xe===s)break t;if(le===h&&++ae===w&&(L=T),le===N&&++pe===g&&(K=T),(fe=xe.nextSibling)!==null)break;xe=le,le=xe.parentNode}xe=fe}h=L===-1||K===-1?null:{start:L,end:K}}else h=null}h=h||{start:0,end:0}}else h=null;for(Ub={focusedElem:s,selectionRange:h},wm=!1,Xn=u;Xn!==null;)if(u=Xn,s=u.child,(u.subtreeFlags&1028)!==0&&s!==null)s.return=u,Xn=s;else for(;Xn!==null;){switch(u=Xn,N=u.alternate,s=u.flags,u.tag){case 0:if((s&4)!==0&&(s=u.updateQueue,s=s!==null?s.events:null,s!==null))for(h=0;h<s.length;h++)w=s[h],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&N!==null){s=void 0,h=u,w=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Ie=ul(h.type,w);s=g.getSnapshotBeforeUpdate(Ie,N),g.__reactInternalSnapshotBeforeUpdate=s}catch(Ge){Bt(h,h.return,Ge)}}break;case 3:if((s&1024)!==0){if(s=u.stateNode.containerInfo,h=s.nodeType,h===9)Hb(s);else if(h===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Hb(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(r(163))}if(s=u.sibling,s!==null){s.return=u.return,Xn=s;break}Xn=u.return}}function i_(s,u,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:hs(s,h),g&4&&nf(5,h);break;case 1:if(hs(s,h),g&4)if(s=h.stateNode,u===null)try{s.componentDidMount()}catch(T){Bt(h,h.return,T)}else{var w=ul(h.type,u.memoizedProps);u=u.memoizedState;try{s.componentDidUpdate(w,u,s.__reactInternalSnapshotBeforeUpdate)}catch(T){Bt(h,h.return,T)}}g&64&&XE(h),g&512&&rf(h,h.return);break;case 3:if(hs(s,h),g&64&&(s=h.updateQueue,s!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{qO(s,u)}catch(T){Bt(h,h.return,T)}}break;case 27:u===null&&g&4&&n_(h);case 26:case 5:hs(s,h),u===null&&g&4&&e_(h),g&512&&rf(h,h.return);break;case 12:hs(s,h);break;case 31:hs(s,h),g&4&&o_(s,h);break;case 13:hs(s,h),g&4&&l_(s,h),g&64&&(s=h.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(h=OH.bind(null,h),QH(s,h))));break;case 22:if(g=h.memoizedState!==null||ds,!g){u=u!==null&&u.memoizedState!==null||Rn,w=ds;var N=Rn;ds=g,(Rn=u)&&!N?ps(s,h,(h.subtreeFlags&8772)!==0):hs(s,h),ds=w,Rn=N}break;case 30:break;default:hs(s,h)}}function a_(s){var u=s.alternate;u!==null&&(s.alternate=null,a_(u)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(u=s.stateNode,u!==null&&aa(u)),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 dn=null,Wr=!1;function fs(s,u,h){for(h=h.child;h!==null;)s_(s,u,h),h=h.sibling}function s_(s,u,h){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(tn,h)}catch{}switch(h.tag){case 26:Rn||Ea(h,u),fs(s,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:Rn||Ea(h,u);var g=dn,w=Wr;ao(h.type)&&(dn=h.stateNode,Wr=!1),fs(s,u,h),hf(h.stateNode),dn=g,Wr=w;break;case 5:Rn||Ea(h,u);case 6:if(g=dn,w=Wr,dn=null,fs(s,u,h),dn=g,Wr=w,dn!==null)if(Wr)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(h.stateNode)}catch(N){Bt(h,u,N)}else try{dn.removeChild(h.stateNode)}catch(N){Bt(h,u,N)}break;case 18:dn!==null&&(Wr?(s=dn,X_(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,h.stateNode),eu(s)):X_(dn,h.stateNode));break;case 4:g=dn,w=Wr,dn=h.stateNode.containerInfo,Wr=!0,fs(s,u,h),dn=g,Wr=w;break;case 0:case 11:case 14:case 15:Xs(2,h,u),Rn||Xs(4,h,u),fs(s,u,h);break;case 1:Rn||(Ea(h,u),g=h.stateNode,typeof g.componentWillUnmount=="function"&&JE(h,u,g)),fs(s,u,h);break;case 21:fs(s,u,h);break;case 22:Rn=(g=Rn)||h.memoizedState!==null,fs(s,u,h),Rn=g;break;default:fs(s,u,h)}}function o_(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{eu(s)}catch(h){Bt(u,u.return,h)}}}function l_(s,u){if(u.memoizedState===null&&(s=u.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{eu(s)}catch(h){Bt(u,u.return,h)}}function bH(s){switch(s.tag){case 31:case 13:case 19:var u=s.stateNode;return u===null&&(u=s.stateNode=new r_),u;case 22:return s=s.stateNode,u=s._retryCache,u===null&&(u=s._retryCache=new r_),u;default:throw Error(r(435,s.tag))}}function tm(s,u){var h=bH(s);u.forEach(function(g){if(!h.has(g)){h.add(g);var w=EH.bind(null,s,g);g.then(w,w)}})}function Zr(s,u){var h=u.deletions;if(h!==null)for(var g=0;g<h.length;g++){var w=h[g],N=s,T=u,L=T;e:for(;L!==null;){switch(L.tag){case 27:if(ao(L.type)){dn=L.stateNode,Wr=!1;break e}break;case 5:dn=L.stateNode,Wr=!1;break e;case 3:case 4:dn=L.stateNode.containerInfo,Wr=!0;break e}L=L.return}if(dn===null)throw Error(r(160));s_(N,T,w),dn=null,Wr=!1,N=w.alternate,N!==null&&(N.return=null),w.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)c_(u,s),u=u.sibling}var la=null;function c_(s,u){var h=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Zr(u,s),Xr(s),g&4&&(Xs(3,s,s.return),nf(3,s),Xs(5,s,s.return));break;case 1:Zr(u,s),Xr(s),g&512&&(Rn||h===null||Ea(h,h.return)),g&64&&ds&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(h=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var w=la;if(Zr(u,s),Xr(s),g&512&&(Rn||h===null||Ea(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=s.memoizedState,h===null)if(g===null)if(s.stateNode===null){e:{g=s.type,h=s.memoizedProps,w=w.ownerDocument||w;t:switch(g){case"title":N=w.getElementsByTagName("title")[0],(!N||N[Dr]||N[Ln]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=w.createElement(g),w.head.insertBefore(N,w.querySelector("head > title"))),ur(N,g,h),N[Ln]=s,un(N),g=N;break e;case"link":var T=cz("link","href",w).get(g+(h.href||""));if(T){for(var L=0;L<T.length;L++)if(N=T[L],N.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&N.getAttribute("rel")===(h.rel==null?null:h.rel)&&N.getAttribute("title")===(h.title==null?null:h.title)&&N.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){T.splice(L,1);break t}}N=w.createElement(g),ur(N,g,h),w.head.appendChild(N);break;case"meta":if(T=cz("meta","content",w).get(g+(h.content||""))){for(L=0;L<T.length;L++)if(N=T[L],N.getAttribute("content")===(h.content==null?null:""+h.content)&&N.getAttribute("name")===(h.name==null?null:h.name)&&N.getAttribute("property")===(h.property==null?null:h.property)&&N.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&N.getAttribute("charset")===(h.charSet==null?null:h.charSet)){T.splice(L,1);break t}}N=w.createElement(g),ur(N,g,h),w.head.appendChild(N);break;default:throw Error(r(468,g))}N[Ln]=s,un(N),g=N}s.stateNode=g}else uz(w,s.type,s.stateNode);else s.stateNode=lz(w,g,s.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?uz(w,s.type,s.stateNode):lz(w,g,s.memoizedProps)):g===null&&s.stateNode!==null&&gb(s,s.memoizedProps,h.memoizedProps)}break;case 27:Zr(u,s),Xr(s),g&512&&(Rn||h===null||Ea(h,h.return)),h!==null&&g&4&&gb(s,s.memoizedProps,h.memoizedProps);break;case 5:if(Zr(u,s),Xr(s),g&512&&(Rn||h===null||Ea(h,h.return)),s.flags&32){w=s.stateNode;try{jc(w,"")}catch(Ie){Bt(s,s.return,Ie)}}g&4&&s.stateNode!=null&&(w=s.memoizedProps,gb(s,w,h!==null?h.memoizedProps:w)),g&1024&&(xb=!0);break;case 6:if(Zr(u,s),Xr(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,h=s.stateNode;try{h.nodeValue=g}catch(Ie){Bt(s,s.return,Ie)}}break;case 3:if(ym=null,w=la,la=mm(u.containerInfo),Zr(u,s),la=w,Xr(s),g&4&&h!==null&&h.memoizedState.isDehydrated)try{eu(u.containerInfo)}catch(Ie){Bt(s,s.return,Ie)}xb&&(xb=!1,u_(s));break;case 4:g=la,la=mm(s.stateNode.containerInfo),Zr(u,s),Xr(s),la=g;break;case 12:Zr(u,s),Xr(s);break;case 31:Zr(u,s),Xr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,tm(s,g)));break;case 13:Zr(u,s),Xr(s),s.child.flags&8192&&s.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(rm=Ct()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,tm(s,g)));break;case 22:w=s.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ae=ds,pe=Rn;if(ds=ae||w,Rn=pe||K,Zr(u,s),Rn=pe,ds=ae,Xr(s),g&8192)e:for(u=s.stateNode,u._visibility=w?u._visibility&-2:u._visibility|1,w&&(h===null||K||ds||Rn||dl(s)),h=null,u=s;;){if(u.tag===5||u.tag===26){if(h===null){K=h=u;try{if(N=K.stateNode,w)T=N.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{L=K.stateNode;var xe=K.memoizedProps.style,le=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;L.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Ie){Bt(K,K.return,Ie)}}}else if(u.tag===6){if(h===null){K=u;try{K.stateNode.nodeValue=w?"":K.memoizedProps}catch(Ie){Bt(K,K.return,Ie)}}}else if(u.tag===18){if(h===null){K=u;try{var fe=K.stateNode;w?J_(fe,!0):J_(K.stateNode,!1)}catch(Ie){Bt(K,K.return,Ie)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===s)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===s)break e;for(;u.sibling===null;){if(u.return===null||u.return===s)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=s.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,tm(s,h))));break;case 19:Zr(u,s),Xr(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,tm(s,g)));break;case 30:break;case 21:break;default:Zr(u,s),Xr(s)}}function Xr(s){var u=s.flags;if(u&2){try{for(var h,g=s.return;g!==null;){if(t_(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var w=h.stateNode,N=yb(s);em(s,N,w);break;case 5:var T=h.stateNode;h.flags&32&&(jc(T,""),h.flags&=-33);var L=yb(s);em(s,L,T);break;case 3:case 4:var K=h.stateNode.containerInfo,ae=yb(s);vb(s,ae,K);break;default:throw Error(r(161))}}catch(pe){Bt(s,s.return,pe)}s.flags&=-3}u&4096&&(s.flags&=-4097)}function u_(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var u=s;u_(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),s=s.sibling}}function hs(s,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)i_(s,u.alternate,u),u=u.sibling}function dl(s){for(s=s.child;s!==null;){var u=s;switch(u.tag){case 0:case 11:case 14:case 15:Xs(4,u,u.return),dl(u);break;case 1:Ea(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&JE(u,u.return,h),dl(u);break;case 27:hf(u.stateNode);case 26:case 5:Ea(u,u.return),dl(u);break;case 22:u.memoizedState===null&&dl(u);break;case 30:dl(u);break;default:dl(u)}s=s.sibling}}function ps(s,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,w=s,N=u,T=N.flags;switch(N.tag){case 0:case 11:case 15:ps(w,N,h),nf(4,N);break;case 1:if(ps(w,N,h),g=N,w=g.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ae){Bt(g,g.return,ae)}if(g=N,w=g.updateQueue,w!==null){var L=g.stateNode;try{var K=w.shared.hiddenCallbacks;if(K!==null)for(w.shared.hiddenCallbacks=null,w=0;w<K.length;w++)UO(K[w],L)}catch(ae){Bt(g,g.return,ae)}}h&&T&64&&XE(N),rf(N,N.return);break;case 27:n_(N);case 26:case 5:ps(w,N,h),h&&g===null&&T&4&&e_(N),rf(N,N.return);break;case 12:ps(w,N,h);break;case 31:ps(w,N,h),h&&T&4&&o_(w,N);break;case 13:ps(w,N,h),h&&T&4&&l_(w,N);break;case 22:N.memoizedState===null&&ps(w,N,h),rf(N,N.return);break;case 30:break;default:ps(w,N,h)}u=u.sibling}}function bb(s,u){var h=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),s=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(s=u.memoizedState.cachePool.pool),s!==h&&(s!=null&&s.refCount++,h!=null&&Fd(h))}function wb(s,u){s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&Fd(s))}function ca(s,u,h,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)d_(s,u,h,g),u=u.sibling}function d_(s,u,h,g){var w=u.flags;switch(u.tag){case 0:case 11:case 15:ca(s,u,h,g),w&2048&&nf(9,u);break;case 1:ca(s,u,h,g);break;case 3:ca(s,u,h,g),w&2048&&(s=null,u.alternate!==null&&(s=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==s&&(u.refCount++,s!=null&&Fd(s)));break;case 12:if(w&2048){ca(s,u,h,g),s=u.stateNode;try{var N=u.memoizedProps,T=N.id,L=N.onPostCommit;typeof L=="function"&&L(T,u.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(K){Bt(u,u.return,K)}}else ca(s,u,h,g);break;case 31:ca(s,u,h,g);break;case 13:ca(s,u,h,g);break;case 23:break;case 22:N=u.stateNode,T=u.alternate,u.memoizedState!==null?N._visibility&2?ca(s,u,h,g):af(s,u):N._visibility&2?ca(s,u,h,g):(N._visibility|=2,Fc(s,u,h,g,(u.subtreeFlags&10256)!==0||!1)),w&2048&&bb(T,u);break;case 24:ca(s,u,h,g),w&2048&&wb(u.alternate,u);break;default:ca(s,u,h,g)}}function Fc(s,u,h,g,w){for(w=w&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var N=s,T=u,L=h,K=g,ae=T.flags;switch(T.tag){case 0:case 11:case 15:Fc(N,T,L,K,w),nf(8,T);break;case 23:break;case 22:var pe=T.stateNode;T.memoizedState!==null?pe._visibility&2?Fc(N,T,L,K,w):af(N,T):(pe._visibility|=2,Fc(N,T,L,K,w)),w&&ae&2048&&bb(T.alternate,T);break;case 24:Fc(N,T,L,K,w),w&&ae&2048&&wb(T.alternate,T);break;default:Fc(N,T,L,K,w)}u=u.sibling}}function af(s,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=s,g=u,w=g.flags;switch(g.tag){case 22:af(h,g),w&2048&&bb(g.alternate,g);break;case 24:af(h,g),w&2048&&wb(g.alternate,g);break;default:af(h,g)}u=u.sibling}}var sf=8192;function Hc(s,u,h){if(s.subtreeFlags&sf)for(s=s.child;s!==null;)f_(s,u,h),s=s.sibling}function f_(s,u,h){switch(s.tag){case 26:Hc(s,u,h),s.flags&sf&&s.memoizedState!==null&&sK(h,la,s.memoizedState,s.memoizedProps);break;case 5:Hc(s,u,h);break;case 3:case 4:var g=la;la=mm(s.stateNode.containerInfo),Hc(s,u,h),la=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=sf,sf=16777216,Hc(s,u,h),sf=g):Hc(s,u,h));break;default:Hc(s,u,h)}}function h_(s){var u=s.alternate;if(u!==null&&(s=u.child,s!==null)){u.child=null;do u=s.sibling,s.sibling=null,s=u;while(s!==null)}}function of(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];Xn=g,m_(g,s)}h_(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)p_(s),s=s.sibling}function p_(s){switch(s.tag){case 0:case 11:case 15:of(s),s.flags&2048&&Xs(9,s,s.return);break;case 3:of(s);break;case 12:of(s);break;case 22:var u=s.stateNode;s.memoizedState!==null&&u._visibility&2&&(s.return===null||s.return.tag!==13)?(u._visibility&=-3,nm(s)):of(s);break;default:of(s)}}function nm(s){var u=s.deletions;if((s.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];Xn=g,m_(g,s)}h_(s)}for(s=s.child;s!==null;){switch(u=s,u.tag){case 0:case 11:case 15:Xs(8,u,u.return),nm(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,nm(u));break;default:nm(u)}s=s.sibling}}function m_(s,u){for(;Xn!==null;){var h=Xn;switch(h.tag){case 0:case 11:case 15:Xs(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Fd(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,Xn=g;else e:for(h=s;Xn!==null;){g=Xn;var w=g.sibling,N=g.return;if(a_(g),g===h){Xn=null;break e}if(w!==null){w.return=N,Xn=w;break e}Xn=N}}}var wH={getCacheForType:function(s){var u=lr(zn),h=u.data.get(s);return h===void 0&&(h=s(),u.data.set(s,h)),h},cacheSignal:function(){return lr(zn).controller.signal}},SH=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Vt=null,pt=null,yt=0,$t=0,xi=null,Js=!1,Kc=!1,Sb=!1,ms=0,wn=0,eo=0,fl=0,jb=0,bi=0,Gc=0,lf=null,Jr=null,Nb=!1,rm=0,g_=0,im=1/0,am=null,to=null,Un=0,no=null,Vc=null,gs=0,kb=0,Cb=null,y_=null,cf=0,Ab=null;function wi(){return(Tt&2)!==0&&yt!==0?yt&-yt:H.T!==null?Pb():pp()}function v_(){if(bi===0)if((yt&536870912)===0||wt){var s=kt;kt<<=1,(kt&3932160)===0&&(kt=262144),bi=s}else bi=536870912;return s=yi.current,s!==null&&(s.flags|=32),bi}function ei(s,u,h){(s===Vt&&($t===2||$t===9)||s.cancelPendingCommit!==null)&&(Qc(s,0),ro(s,yt,bi,!1)),Yt(s,h),((Tt&2)===0||s!==Vt)&&(s===Vt&&((Tt&2)===0&&(fl|=h),wn===4&&ro(s,yt,bi,!1)),_a(s))}function x_(s,u,h){if((Tt&6)!==0)throw Error(r(327));var g=!h&&(u&127)===0&&(u&s.expiredLanes)===0||Ve(s,u),w=g?kH(s,u):Eb(s,u,!0),N=g;do{if(w===0){Kc&&!g&&ro(s,u,0,!1);break}else{if(h=s.current.alternate,N&&!jH(h)){w=Eb(s,u,!1),N=!1;continue}if(w===2){if(N=u,s.errorRecoveryDisabledLanes&N)var T=0;else T=s.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){u=T;e:{var L=s;w=lf;var K=L.current.memoizedState.isDehydrated;if(K&&(Qc(L,T).flags|=256),T=Eb(L,T,!1),T!==2){if(Sb&&!K){L.errorRecoveryDisabledLanes|=N,fl|=N,w=4;break e}N=Jr,Jr=w,N!==null&&(Jr===null?Jr=N:Jr.push.apply(Jr,N))}w=T}if(N=!1,w!==2)continue}}if(w===1){Qc(s,0),ro(s,u,0,!0);break}e:{switch(g=s,N=w,N){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:ro(g,u,bi,!Js);break e;case 2:Jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(w=rm+300-Ct(),10<w)){if(ro(g,u,bi,!Js),Xe(g,0,!0)!==0)break e;gs=u,g.timeoutHandle=W_(b_.bind(null,g,h,Jr,am,Nb,u,bi,fl,Gc,Js,N,"Throttled",-0,0),w);break e}b_(g,h,Jr,am,Nb,u,bi,fl,Gc,Js,N,null,-0,0)}}break}while(!0);_a(s)}function b_(s,u,h,g,w,N,T,L,K,ae,pe,xe,le,fe){if(s.timeoutHandle=-1,xe=u.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ts},f_(u,N,xe);var Ie=(N&62914560)===N?rm-Ct():(N&4194048)===N?g_-Ct():0;if(Ie=oK(xe,Ie),Ie!==null){gs=N,s.cancelPendingCommit=Ie(O_.bind(null,s,u,N,h,g,w,T,L,K,pe,xe,null,le,fe)),ro(s,N,T,!ae);return}}O_(s,u,N,h,g,w,T,L,K)}function jH(s){for(var u=s;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var w=h[g],N=w.getSnapshot;w=w.value;try{if(!mi(N(),w))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===s)break;for(;u.sibling===null;){if(u.return===null||u.return===s)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function ro(s,u,h,g){u&=~jb,u&=~fl,s.suspendedLanes|=u,s.pingedLanes&=~u,g&&(s.warmLanes|=u),g=s.expirationTimes;for(var w=u;0<w;){var N=31-it(w),T=1<<N;g[N]=-1,w&=~T}h!==0&&Ja(s,h,u)}function sm(){return(Tt&6)===0?(uf(0),!1):!0}function Ob(){if(pt!==null){if($t===0)var s=pt.return;else s=pt,as=rl=null,Hx(s),Lc=null,Kd=0,s=pt;for(;s!==null;)ZE(s.alternate,s),s=s.return;pt=null}}function Qc(s,u){var h=s.timeoutHandle;h!==-1&&(s.timeoutHandle=-1,FH(h)),h=s.cancelPendingCommit,h!==null&&(s.cancelPendingCommit=null,h()),gs=0,Ob(),Vt=s,pt=h=rs(s.current,null),yt=u,$t=0,xi=null,Js=!1,Kc=Ve(s,u),Sb=!1,Gc=bi=jb=fl=eo=wn=0,Jr=lf=null,Nb=!1,(u&8)!==0&&(u|=u&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=u;0<g;){var w=31-it(g),N=1<<w;u|=s[w],g&=~N}return ms=u,Ap(),h}function w_(s,u){at=null,H.H=Jd,u===Ic||u===Dp?(u=IO(),$t=3):u===Tx?(u=IO(),$t=4):$t=u===sb?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,xi=u,pt===null&&(wn=1,Yp(s,Ti(u,s.current)))}function S_(){var s=yi.current;return s===null?!0:(yt&4194048)===yt?Mi===null:(yt&62914560)===yt||(yt&536870912)!==0?s===Mi:!1}function j_(){var s=H.H;return H.H=Jd,s===null?Jd:s}function N_(){var s=H.A;return H.A=wH,s}function om(){wn=4,Js||(yt&4194048)!==yt&&yi.current!==null||(Kc=!0),(eo&134217727)===0&&(fl&134217727)===0||Vt===null||ro(Vt,yt,bi,!1)}function Eb(s,u,h){var g=Tt;Tt|=2;var w=j_(),N=N_();(Vt!==s||yt!==u)&&(am=null,Qc(s,u)),u=!1;var T=wn;e:do try{if($t!==0&&pt!==null){var L=pt,K=xi;switch($t){case 8:Ob(),T=6;break e;case 3:case 2:case 9:case 6:yi.current===null&&(u=!0);var ae=$t;if($t=0,xi=null,Yc(s,L,K,ae),h&&Kc){T=0;break e}break;default:ae=$t,$t=0,xi=null,Yc(s,L,K,ae)}}NH(),T=wn;break}catch(pe){w_(s,pe)}while(!0);return u&&s.shellSuspendCounter++,as=rl=null,Tt=g,H.H=w,H.A=N,pt===null&&(Vt=null,yt=0,Ap()),T}function NH(){for(;pt!==null;)k_(pt)}function kH(s,u){var h=Tt;Tt|=2;var g=j_(),w=N_();Vt!==s||yt!==u?(am=null,im=Ct()+500,Qc(s,u)):Kc=Ve(s,u);e:do try{if($t!==0&&pt!==null){u=pt;var N=xi;t:switch($t){case 1:$t=0,xi=null,Yc(s,u,N,1);break;case 2:case 9:if(DO(N)){$t=0,xi=null,C_(u);break}u=function(){$t!==2&&$t!==9||Vt!==s||($t=7),_a(s)},N.then(u,u);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:DO(N)?($t=0,xi=null,C_(u)):($t=0,xi=null,Yc(s,u,N,7));break;case 5:var T=null;switch(pt.tag){case 26:T=pt.memoizedState;case 5:case 27:var L=pt;if(T?dz(T):L.stateNode.complete){$t=0,xi=null;var K=L.sibling;if(K!==null)pt=K;else{var ae=L.return;ae!==null?(pt=ae,lm(ae)):pt=null}break t}}$t=0,xi=null,Yc(s,u,N,5);break;case 6:$t=0,xi=null,Yc(s,u,N,6);break;case 8:Ob(),wn=6;break e;default:throw Error(r(462))}}CH();break}catch(pe){w_(s,pe)}while(!0);return as=rl=null,H.H=g,H.A=w,Tt=h,pt!==null?0:(Vt=null,yt=0,Ap(),wn)}function CH(){for(;pt!==null&&!Je();)k_(pt)}function k_(s){var u=YE(s.alternate,s,ms);s.memoizedProps=s.pendingProps,u===null?lm(s):pt=u}function C_(s){var u=s,h=u.alternate;switch(u.tag){case 15:case 0:u=FE(h,u,u.pendingProps,u.type,void 0,yt);break;case 11:u=FE(h,u,u.pendingProps,u.type.render,u.ref,yt);break;case 5:Hx(u);default:ZE(h,u),u=pt=NO(u,ms),u=YE(h,u,ms)}s.memoizedProps=s.pendingProps,u===null?lm(s):pt=u}function Yc(s,u,h,g){as=rl=null,Hx(u),Lc=null,Kd=0;var w=u.return;try{if(pH(s,w,u,h,yt)){wn=1,Yp(s,Ti(h,s.current)),pt=null;return}}catch(N){if(w!==null)throw pt=w,N;wn=1,Yp(s,Ti(h,s.current)),pt=null;return}u.flags&32768?(wt||g===1?s=!0:Kc||(yt&536870912)!==0?s=!1:(Js=s=!0,(g===2||g===9||g===3||g===6)&&(g=yi.current,g!==null&&g.tag===13&&(g.flags|=16384))),A_(u,s)):lm(u)}function lm(s){var u=s;do{if((u.flags&32768)!==0){A_(u,Js);return}s=u.return;var h=yH(u.alternate,u,ms);if(h!==null){pt=h;return}if(u=u.sibling,u!==null){pt=u;return}pt=u=s}while(u!==null);wn===0&&(wn=5)}function A_(s,u){do{var h=vH(s.alternate,s);if(h!==null){h.flags&=32767,pt=h;return}if(h=s.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(s=s.sibling,s!==null)){pt=s;return}pt=s=h}while(s!==null);wn=6,pt=null}function O_(s,u,h,g,w,N,T,L,K){s.cancelPendingCommit=null;do cm();while(Un!==0);if((Tt&6)!==0)throw Error(r(327));if(u!==null){if(u===s.current)throw Error(r(177));if(N=u.lanes|u.childLanes,N|=yx,fi(s,h,N,T,L,K),s===Vt&&(pt=Vt=null,yt=0),Vc=u,no=s,gs=h,kb=N,Cb=w,y_=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,_H(Pe,function(){return P_(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,w=J.p,J.p=2,T=Tt,Tt|=4;try{xH(s,u,h)}finally{Tt=T,J.p=w,H.T=g}}Un=1,E_(),__(),z_()}}function E_(){if(Un===1){Un=0;var s=no,u=Vc,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var w=Tt;Tt|=4;try{c_(u,s);var N=Ub,T=mO(s.containerInfo),L=N.focusedElem,K=N.selectionRange;if(T!==L&&L&&L.ownerDocument&&pO(L.ownerDocument.documentElement,L)){if(K!==null&&fx(L)){var ae=K.start,pe=K.end;if(pe===void 0&&(pe=ae),"selectionStart"in L)L.selectionStart=ae,L.selectionEnd=Math.min(pe,L.value.length);else{var xe=L.ownerDocument||document,le=xe&&xe.defaultView||window;if(le.getSelection){var fe=le.getSelection(),Ie=L.textContent.length,Ge=Math.min(K.start,Ie),Ht=K.end===void 0?Ge:Math.min(K.end,Ie);!fe.extend&&Ge>Ht&&(T=Ht,Ht=Ge,Ge=T);var te=hO(L,Ge),W=hO(L,Ht);if(te&&W&&(fe.rangeCount!==1||fe.anchorNode!==te.node||fe.anchorOffset!==te.offset||fe.focusNode!==W.node||fe.focusOffset!==W.offset)){var ie=xe.createRange();ie.setStart(te.node,te.offset),fe.removeAllRanges(),Ge>Ht?(fe.addRange(ie),fe.extend(W.node,W.offset)):(ie.setEnd(W.node,W.offset),fe.addRange(ie))}}}}for(xe=[],fe=L;fe=fe.parentNode;)fe.nodeType===1&&xe.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<xe.length;L++){var ve=xe[L];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}wm=!!Bb,Ub=Bb=null}finally{Tt=w,J.p=g,H.T=h}}s.current=u,Un=2}}function __(){if(Un===2){Un=0;var s=no,u=Vc,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var g=J.p;J.p=2;var w=Tt;Tt|=4;try{i_(s,u.alternate,u)}finally{Tt=w,J.p=g,H.T=h}}Un=3}}function z_(){if(Un===4||Un===3){Un=0,zt();var s=no,u=Vc,h=gs,g=y_;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Un=5:(Un=0,Vc=no=null,T_(s,s.pendingLanes));var w=s.pendingLanes;if(w===0&&(to=null),bc(h),u=u.stateNode,Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(tn,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=H.T,w=J.p,J.p=2,H.T=null;try{for(var N=s.onRecoverableError,T=0;T<g.length;T++){var L=g[T];N(L.value,{componentStack:L.stack})}}finally{H.T=u,J.p=w}}(gs&3)!==0&&cm(),_a(s),w=s.pendingLanes,(h&261930)!==0&&(w&42)!==0?s===Ab?cf++:(cf=0,Ab=s):cf=0,uf(0)}}function T_(s,u){(s.pooledCacheLanes&=u)===0&&(u=s.pooledCache,u!=null&&(s.pooledCache=null,Fd(u)))}function cm(){return E_(),__(),z_(),P_()}function P_(){if(Un!==5)return!1;var s=no,u=kb;kb=0;var h=bc(gs),g=H.T,w=J.p;try{J.p=32>h?32:h,H.T=null,h=Cb,Cb=null;var N=no,T=gs;if(Un=0,Vc=no=null,gs=0,(Tt&6)!==0)throw Error(r(331));var L=Tt;if(Tt|=4,p_(N.current),d_(N,N.current,T,h),Tt=L,uf(0,!1),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(tn,N)}catch{}return!0}finally{J.p=w,H.T=g,T_(s,u)}}function R_(s,u,h){u=Ti(h,u),u=ab(s.stateNode,u,2),s=Ys(s,u,2),s!==null&&(Yt(s,2),_a(s))}function Bt(s,u,h){if(s.tag===3)R_(s,s,h);else for(;u!==null;){if(u.tag===3){R_(u,s,h);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(to===null||!to.has(g))){s=Ti(h,s),h=DE(2),g=Ys(u,h,2),g!==null&&(ME(h,g,u,s),Yt(g,2),_a(g));break}}u=u.return}}function _b(s,u,h){var g=s.pingCache;if(g===null){g=s.pingCache=new SH;var w=new Set;g.set(u,w)}else w=g.get(u),w===void 0&&(w=new Set,g.set(u,w));w.has(h)||(Sb=!0,w.add(h),s=AH.bind(null,s,u,h),u.then(s,s))}function AH(s,u,h){var g=s.pingCache;g!==null&&g.delete(u),s.pingedLanes|=s.suspendedLanes&h,s.warmLanes&=~h,Vt===s&&(yt&h)===h&&(wn===4||wn===3&&(yt&62914560)===yt&&300>Ct()-rm?(Tt&2)===0&&Qc(s,0):jb|=h,Gc===yt&&(Gc=0)),_a(s)}function D_(s,u){u===0&&(u=Wn()),s=el(s,u),s!==null&&(Yt(s,u),_a(s))}function OH(s){var u=s.memoizedState,h=0;u!==null&&(h=u.retryLane),D_(s,h)}function EH(s,u){var h=0;switch(s.tag){case 31:case 13:var g=s.stateNode,w=s.memoizedState;w!==null&&(h=w.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),D_(s,h)}function _H(s,u){return _t(s,u)}var um=null,Wc=null,zb=!1,dm=!1,Tb=!1,io=0;function _a(s){s!==Wc&&s.next===null&&(Wc===null?um=Wc=s:Wc=Wc.next=s),dm=!0,zb||(zb=!0,TH())}function uf(s,u){if(!Tb&&dm){Tb=!0;do for(var h=!1,g=um;g!==null;){if(s!==0){var w=g.pendingLanes;if(w===0)var N=0;else{var T=g.suspendedLanes,L=g.pingedLanes;N=(1<<31-it(42|s)+1)-1,N&=w&~(T&~L),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,$_(g,N))}else N=yt,N=Xe(g,g===Vt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||Ve(g,N)||(h=!0,$_(g,N));g=g.next}while(h);Tb=!1}}function zH(){M_()}function M_(){dm=zb=!1;var s=0;io!==0&&qH()&&(s=io);for(var u=Ct(),h=null,g=um;g!==null;){var w=g.next,N=I_(g,u);N===0?(g.next=null,h===null?um=w:h.next=w,w===null&&(Wc=h)):(h=g,(s!==0||(N&3)!==0)&&(dm=!0)),g=w}Un!==0&&Un!==5||uf(s),io!==0&&(io=0)}function I_(s,u){for(var h=s.suspendedLanes,g=s.pingedLanes,w=s.expirationTimes,N=s.pendingLanes&-62914561;0<N;){var T=31-it(N),L=1<<T,K=w[T];K===-1?((L&h)===0||(L&g)!==0)&&(w[T]=et(L,u)):K<=u&&(s.expiredLanes|=L),N&=~L}if(u=Vt,h=yt,h=Xe(s,s===u?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,h===0||s===u&&($t===2||$t===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&be(g),s.callbackNode=null,s.callbackPriority=0;if((h&3)===0||Ve(s,h)){if(u=h&-h,u===s.callbackPriority)return u;switch(g!==null&&be(g),bc(h)){case 2:case 8:h=Se;break;case 32:h=Pe;break;case 268435456:h=ut;break;default:h=Pe}return g=L_.bind(null,s),h=_t(h,g),s.callbackPriority=u,s.callbackNode=h,u}return g!==null&&g!==null&&be(g),s.callbackPriority=2,s.callbackNode=null,2}function L_(s,u){if(Un!==0&&Un!==5)return s.callbackNode=null,s.callbackPriority=0,null;var h=s.callbackNode;if(cm()&&s.callbackNode!==h)return null;var g=yt;return g=Xe(s,s===Vt?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(x_(s,g,u),I_(s,Ct()),s.callbackNode!=null&&s.callbackNode===h?L_.bind(null,s):null)}function $_(s,u){if(cm())return null;x_(s,u,!0)}function TH(){HH(function(){(Tt&6)!==0?_t(ce,zH):M_()})}function Pb(){if(io===0){var s=Dc;s===0&&(s=vr,vr<<=1,(vr&261888)===0&&(vr=256)),io=s}return io}function B_(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:xp(""+s)}function U_(s,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,s.id&&h.setAttribute("form",s.id),u.parentNode.insertBefore(h,u),s=new FormData(s),h.parentNode.removeChild(h),s}function PH(s,u,h,g,w){if(u==="submit"&&h&&h.stateNode===w){var N=B_((w[ar]||null).action),T=g.submitter;T&&(u=(u=T[ar]||null)?B_(u.formAction):T.getAttribute("formAction"),u!==null&&(N=u,T=null));var L=new jp("action","action",null,g,w);s.push({event:L,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(io!==0){var K=T?U_(w,T):new FormData(w);Jx(h,{pending:!0,data:K,method:w.method,action:N},null,K)}}else typeof N=="function"&&(L.preventDefault(),K=T?U_(w,T):new FormData(w),Jx(h,{pending:!0,data:K,method:w.method,action:N},N,K))},currentTarget:w}]})}}for(var Rb=0;Rb<gx.length;Rb++){var Db=gx[Rb],RH=Db.toLowerCase(),DH=Db[0].toUpperCase()+Db.slice(1);oa(RH,"on"+DH)}oa(vO,"onAnimationEnd"),oa(xO,"onAnimationIteration"),oa(bO,"onAnimationStart"),oa("dblclick","onDoubleClick"),oa("focusin","onFocus"),oa("focusout","onBlur"),oa(Z9,"onTransitionRun"),oa(X9,"onTransitionStart"),oa(J9,"onTransitionCancel"),oa(wO,"onTransitionEnd"),sa("onMouseEnter",["mouseout","mouseover"]),sa("onMouseLeave",["mouseout","mouseover"]),sa("onPointerEnter",["pointerout","pointerover"]),sa("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var df="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(" "),MH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(df));function q_(s,u){u=(u&4)!==0;for(var h=0;h<s.length;h++){var g=s[h],w=g.event;g=g.listeners;e:{var N=void 0;if(u)for(var T=g.length-1;0<=T;T--){var L=g[T],K=L.instance,ae=L.currentTarget;if(L=L.listener,K!==N&&w.isPropagationStopped())break e;N=L,w.currentTarget=ae;try{N(w)}catch(pe){Cp(pe)}w.currentTarget=null,N=K}else for(T=0;T<g.length;T++){if(L=g[T],K=L.instance,ae=L.currentTarget,L=L.listener,K!==N&&w.isPropagationStopped())break e;N=L,w.currentTarget=ae;try{N(w)}catch(pe){Cp(pe)}w.currentTarget=null,N=K}}}}function mt(s,u){var h=u[Ne];h===void 0&&(h=u[Ne]=new Set);var g=s+"__bubble";h.has(g)||(F_(u,s,2,!1),h.add(g))}function Mb(s,u,h){var g=0;u&&(g|=4),F_(h,s,g,u)}var fm="_reactListening"+Math.random().toString(36).slice(2);function Ib(s){if(!s[fm]){s[fm]=!0,Wo.forEach(function(h){h!=="selectionchange"&&(MH.has(h)||Mb(h,!1,s),Mb(h,!0,s))});var u=s.nodeType===9?s:s.ownerDocument;u===null||u[fm]||(u[fm]=!0,Mb("selectionchange",!1,u))}}function F_(s,u,h,g){switch(vz(u)){case 2:var w=uK;break;case 8:w=dK;break;default:w=Xb}h=w.bind(null,u,h,s),w=void 0,!rx||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(w=!0),g?w!==void 0?s.addEventListener(u,h,{capture:!0,passive:w}):s.addEventListener(u,h,!0):w!==void 0?s.addEventListener(u,h,{passive:w}):s.addEventListener(u,h,!1)}function Lb(s,u,h,g,w){var N=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var T=g.tag;if(T===3||T===4){var L=g.stateNode.containerInfo;if(L===w)break;if(T===4)for(T=g.return;T!==null;){var K=T.tag;if((K===3||K===4)&&T.stateNode.containerInfo===w)return;T=T.return}for(;L!==null;){if(T=hi(L),T===null)return;if(K=T.tag,K===5||K===6||K===26||K===27){g=N=T;continue e}L=L.parentNode}}g=g.return}QA(function(){var ae=N,pe=tx(h),xe=[];e:{var le=SO.get(s);if(le!==void 0){var fe=jp,Ie=s;switch(s){case"keypress":if(wp(h)===0)break e;case"keydown":case"keyup":fe=E9;break;case"focusin":Ie="focus",fe=ox;break;case"focusout":Ie="blur",fe=ox;break;case"beforeblur":case"afterblur":fe=ox;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=ZA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=y9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=T9;break;case vO:case xO:case bO:fe=b9;break;case wO:fe=R9;break;case"scroll":case"scrollend":fe=m9;break;case"wheel":fe=M9;break;case"copy":case"cut":case"paste":fe=S9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=JA;break;case"toggle":case"beforetoggle":fe=L9}var Ge=(u&4)!==0,Ht=!Ge&&(s==="scroll"||s==="scrollend"),te=Ge?le!==null?le+"Capture":null:le;Ge=[];for(var W=ae,ie;W!==null;){var ve=W;if(ie=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ie===null||te===null||(ve=Td(W,te),ve!=null&&Ge.push(ff(W,ve,ie))),Ht)break;W=W.return}0<Ge.length&&(le=new fe(le,Ie,null,h,pe),xe.push({event:le,listeners:Ge}))}}if((u&7)===0){e:{if(le=s==="mouseover"||s==="pointerover",fe=s==="mouseout"||s==="pointerout",le&&h!==ex&&(Ie=h.relatedTarget||h.fromElement)&&(hi(Ie)||Ie[Y]))break e;if((fe||le)&&(le=pe.window===pe?pe:(le=pe.ownerDocument)?le.defaultView||le.parentWindow:window,fe?(Ie=h.relatedTarget||h.toElement,fe=ae,Ie=Ie?hi(Ie):null,Ie!==null&&(Ht=a(Ie),Ge=Ie.tag,Ie!==Ht||Ge!==5&&Ge!==27&&Ge!==6)&&(Ie=null)):(fe=null,Ie=ae),fe!==Ie)){if(Ge=ZA,ve="onMouseLeave",te="onMouseEnter",W="mouse",(s==="pointerout"||s==="pointerover")&&(Ge=JA,ve="onPointerLeave",te="onPointerEnter",W="pointer"),Ht=fe==null?le:Yo(fe),ie=Ie==null?le:Yo(Ie),le=new Ge(ve,W+"leave",fe,h,pe),le.target=Ht,le.relatedTarget=ie,ve=null,hi(pe)===ae&&(Ge=new Ge(te,W+"enter",Ie,h,pe),Ge.target=ie,Ge.relatedTarget=Ht,ve=Ge),Ht=ve,fe&&Ie)t:{for(Ge=IH,te=fe,W=Ie,ie=0,ve=te;ve;ve=Ge(ve))ie++;ve=0;for(var He=W;He;He=Ge(He))ve++;for(;0<ie-ve;)te=Ge(te),ie--;for(;0<ve-ie;)W=Ge(W),ve--;for(;ie--;){if(te===W||W!==null&&te===W.alternate){Ge=te;break t}te=Ge(te),W=Ge(W)}Ge=null}else Ge=null;fe!==null&&H_(xe,le,fe,Ge,!1),Ie!==null&&Ht!==null&&H_(xe,Ht,Ie,Ge,!0)}}e:{if(le=ae?Yo(ae):window,fe=le.nodeName&&le.nodeName.toLowerCase(),fe==="select"||fe==="input"&&le.type==="file")var At=oO;else if(aO(le))if(lO)At=Q9;else{At=G9;var Be=K9}else fe=le.nodeName,!fe||fe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&J0(ae.elementType)&&(At=oO):At=V9;if(At&&(At=At(s,ae))){sO(xe,At,h,pe);break e}Be&&Be(s,le,ae),s==="focusout"&&ae&&le.type==="number"&&ae.memoizedProps.value!=null&&X0(le,"number",le.value)}switch(Be=ae?Yo(ae):window,s){case"focusin":(aO(Be)||Be.contentEditable==="true")&&(Ac=Be,hx=ae,Bd=null);break;case"focusout":Bd=hx=Ac=null;break;case"mousedown":px=!0;break;case"contextmenu":case"mouseup":case"dragend":px=!1,gO(xe,h,pe);break;case"selectionchange":if(W9)break;case"keydown":case"keyup":gO(xe,h,pe)}var st;if(cx)e:{switch(s){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Cc?rO(s,h)&&(vt="onCompositionEnd"):s==="keydown"&&h.keyCode===229&&(vt="onCompositionStart");vt&&(eO&&h.locale!=="ko"&&(Cc||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Cc&&(st=YA()):(qs=pe,ix="value"in qs?qs.value:qs.textContent,Cc=!0)),Be=hm(ae,vt),0<Be.length&&(vt=new XA(vt,s,null,h,pe),xe.push({event:vt,listeners:Be}),st?vt.data=st:(st=iO(h),st!==null&&(vt.data=st)))),(st=B9?U9(s,h):q9(s,h))&&(vt=hm(ae,"onBeforeInput"),0<vt.length&&(Be=new XA("onBeforeInput","beforeinput",null,h,pe),xe.push({event:Be,listeners:vt}),Be.data=st)),PH(xe,s,ae,h,pe)}q_(xe,u)})}function ff(s,u,h){return{instance:s,listener:u,currentTarget:h}}function hm(s,u){for(var h=u+"Capture",g=[];s!==null;){var w=s,N=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||N===null||(w=Td(s,h),w!=null&&g.unshift(ff(s,w,N)),w=Td(s,u),w!=null&&g.push(ff(s,w,N))),s.tag===3)return g;s=s.return}return[]}function IH(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function H_(s,u,h,g,w){for(var N=u._reactName,T=[];h!==null&&h!==g;){var L=h,K=L.alternate,ae=L.stateNode;if(L=L.tag,K!==null&&K===g)break;L!==5&&L!==26&&L!==27||ae===null||(K=ae,w?(ae=Td(h,N),ae!=null&&T.unshift(ff(h,ae,K))):w||(ae=Td(h,N),ae!=null&&T.push(ff(h,ae,K)))),h=h.return}T.length!==0&&s.push({event:u,listeners:T})}var LH=/\r\n?/g,$H=/\u0000|\uFFFD/g;function K_(s){return(typeof s=="string"?s:""+s).replace(LH,`
|
|
9
|
+
`).replace($H,"")}function G_(s,u){return u=K_(u),K_(s)===u}function Ft(s,u,h,g,w,N){switch(h){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||jc(s,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&jc(s,""+g);break;case"className":xr(s,"class",g);break;case"tabIndex":xr(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":xr(s,h,g);break;case"style":GA(s,g,N);break;case"data":if(u!=="object"){xr(s,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||h!=="href")){s.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=xp(""+g),s.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(h,"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 N=="function"&&(h==="formAction"?(u!=="input"&&Ft(s,u,"name",w.name,w,null),Ft(s,u,"formEncType",w.formEncType,w,null),Ft(s,u,"formMethod",w.formMethod,w,null),Ft(s,u,"formTarget",w.formTarget,w,null)):(Ft(s,u,"encType",w.encType,w,null),Ft(s,u,"method",w.method,w,null),Ft(s,u,"target",w.target,w,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(h);break}g=xp(""+g),s.setAttribute(h,g);break;case"onClick":g!=null&&(s.onclick=ts);break;case"onScroll":g!=null&&mt("scroll",s);break;case"onScrollEnd":g!=null&&mt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}h=xp(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",h);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""+g):s.removeAttribute(h);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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,""):s.removeAttribute(h);break;case"capture":case"download":g===!0?s.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(h,g):s.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(h,g):s.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(h):s.setAttribute(h,g);break;case"popover":mt("beforetoggle",s),mt("toggle",s),Mt(s,"popover",g);break;case"xlinkActuate":Zn(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Zn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Zn(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Zn(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Zn(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Zn(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Zn(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Zn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Zn(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Mt(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=h9.get(h)||h,Mt(s,h,g))}}function $b(s,u,h,g,w,N){switch(h){case"style":GA(s,g,N);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(w.children!=null)throw Error(r(60));s.innerHTML=h}}break;case"children":typeof g=="string"?jc(s,g):(typeof g=="number"||typeof g=="bigint")&&jc(s,""+g);break;case"onScroll":g!=null&&mt("scroll",s);break;case"onScrollEnd":g!=null&&mt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_d.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(w=h.endsWith("Capture"),u=h.slice(2,w?h.length-7:void 0),N=s[ar]||null,N=N!=null?N[h]:null,typeof N=="function"&&s.removeEventListener(u,N,w),typeof g=="function")){typeof N!="function"&&N!==null&&(h in s?s[h]=null:s.hasAttribute(h)&&s.removeAttribute(h)),s.addEventListener(u,g,w);break e}h in s?s[h]=g:g===!0?s.setAttribute(h,""):Mt(s,h,g)}}}function ur(s,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",s),mt("load",s);var g=!1,w=!1,N;for(N in h)if(h.hasOwnProperty(N)){var T=h[N];if(T!=null)switch(N){case"src":g=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ft(s,u,N,T,h,null)}}w&&Ft(s,u,"srcSet",h.srcSet,h,null),g&&Ft(s,u,"src",h.src,h,null);return;case"input":mt("invalid",s);var L=N=T=w=null,K=null,ae=null;for(g in h)if(h.hasOwnProperty(g)){var pe=h[g];if(pe!=null)switch(g){case"name":w=pe;break;case"type":T=pe;break;case"checked":K=pe;break;case"defaultChecked":ae=pe;break;case"value":N=pe;break;case"defaultValue":L=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,u));break;default:Ft(s,u,g,pe,h,null)}}qA(s,N,L,K,ae,T,w,!1);return;case"select":mt("invalid",s),g=T=N=null;for(w in h)if(h.hasOwnProperty(w)&&(L=h[w],L!=null))switch(w){case"value":N=L;break;case"defaultValue":T=L;break;case"multiple":g=L;default:Ft(s,u,w,L,h,null)}u=N,h=T,s.multiple=!!g,u!=null?Sc(s,!!g,u,!1):h!=null&&Sc(s,!!g,h,!0);return;case"textarea":mt("invalid",s),N=w=g=null;for(T in h)if(h.hasOwnProperty(T)&&(L=h[T],L!=null))switch(T){case"value":g=L;break;case"defaultValue":w=L;break;case"children":N=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Ft(s,u,T,L,h,null)}HA(s,g,w,N);return;case"option":for(K in h)h.hasOwnProperty(K)&&(g=h[K],g!=null)&&(K==="selected"?s.selected=g&&typeof g!="function"&&typeof g!="symbol":Ft(s,u,K,g,h,null));return;case"dialog":mt("beforetoggle",s),mt("toggle",s),mt("cancel",s),mt("close",s);break;case"iframe":case"object":mt("load",s);break;case"video":case"audio":for(g=0;g<df.length;g++)mt(df[g],s);break;case"image":mt("error",s),mt("load",s);break;case"details":mt("toggle",s);break;case"embed":case"source":case"link":mt("error",s),mt("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(ae in h)if(h.hasOwnProperty(ae)&&(g=h[ae],g!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Ft(s,u,ae,g,h,null)}return;default:if(J0(u)){for(pe in h)h.hasOwnProperty(pe)&&(g=h[pe],g!==void 0&&$b(s,u,pe,g,h,void 0));return}}for(L in h)h.hasOwnProperty(L)&&(g=h[L],g!=null&&Ft(s,u,L,g,h,null))}function BH(s,u,h,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,N=null,T=null,L=null,K=null,ae=null,pe=null;for(fe in h){var xe=h[fe];if(h.hasOwnProperty(fe)&&xe!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":K=xe;default:g.hasOwnProperty(fe)||Ft(s,u,fe,null,g,xe)}}for(var le in g){var fe=g[le];if(xe=h[le],g.hasOwnProperty(le)&&(fe!=null||xe!=null))switch(le){case"type":N=fe;break;case"name":w=fe;break;case"checked":ae=fe;break;case"defaultChecked":pe=fe;break;case"value":T=fe;break;case"defaultValue":L=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,u));break;default:fe!==xe&&Ft(s,u,le,fe,g,xe)}}Z0(s,T,L,K,ae,pe,N,w);return;case"select":fe=T=L=le=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":fe=K;default:g.hasOwnProperty(N)||Ft(s,u,N,null,g,K)}for(w in g)if(N=g[w],K=h[w],g.hasOwnProperty(w)&&(N!=null||K!=null))switch(w){case"value":le=N;break;case"defaultValue":L=N;break;case"multiple":T=N;default:N!==K&&Ft(s,u,w,N,g,K)}u=L,h=T,g=fe,le!=null?Sc(s,!!h,le,!1):!!g!=!!h&&(u!=null?Sc(s,!!h,u,!0):Sc(s,!!h,h?[]:"",!1));return;case"textarea":fe=le=null;for(L in h)if(w=h[L],h.hasOwnProperty(L)&&w!=null&&!g.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Ft(s,u,L,null,g,w)}for(T in g)if(w=g[T],N=h[T],g.hasOwnProperty(T)&&(w!=null||N!=null))switch(T){case"value":le=w;break;case"defaultValue":fe=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==N&&Ft(s,u,T,w,g,N)}FA(s,le,fe);return;case"option":for(var Ie in h)le=h[Ie],h.hasOwnProperty(Ie)&&le!=null&&!g.hasOwnProperty(Ie)&&(Ie==="selected"?s.selected=!1:Ft(s,u,Ie,null,g,le));for(K in g)le=g[K],fe=h[K],g.hasOwnProperty(K)&&le!==fe&&(le!=null||fe!=null)&&(K==="selected"?s.selected=le&&typeof le!="function"&&typeof le!="symbol":Ft(s,u,K,le,g,fe));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 Ge in h)le=h[Ge],h.hasOwnProperty(Ge)&&le!=null&&!g.hasOwnProperty(Ge)&&Ft(s,u,Ge,null,g,le);for(ae in g)if(le=g[ae],fe=h[ae],g.hasOwnProperty(ae)&&le!==fe&&(le!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,u));break;default:Ft(s,u,ae,le,g,fe)}return;default:if(J0(u)){for(var Ht in h)le=h[Ht],h.hasOwnProperty(Ht)&&le!==void 0&&!g.hasOwnProperty(Ht)&&$b(s,u,Ht,void 0,g,le);for(pe in g)le=g[pe],fe=h[pe],!g.hasOwnProperty(pe)||le===fe||le===void 0&&fe===void 0||$b(s,u,pe,le,g,fe);return}}for(var te in h)le=h[te],h.hasOwnProperty(te)&&le!=null&&!g.hasOwnProperty(te)&&Ft(s,u,te,null,g,le);for(xe in g)le=g[xe],fe=h[xe],!g.hasOwnProperty(xe)||le===fe||le==null&&fe==null||Ft(s,u,xe,le,g,fe)}function V_(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function UH(){if(typeof performance.getEntriesByType=="function"){for(var s=0,u=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var w=h[g],N=w.transferSize,T=w.initiatorType,L=w.duration;if(N&&L&&V_(T)){for(T=0,L=w.responseEnd,g+=1;g<h.length;g++){var K=h[g],ae=K.startTime;if(ae>L)break;var pe=K.transferSize,xe=K.initiatorType;pe&&V_(xe)&&(K=K.responseEnd,T+=pe*(K<L?1:(L-ae)/(K-ae)))}if(--g,u+=8*(N+T)/(w.duration/1e3),s++,10<s)break}}if(0<s)return u/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Bb=null,Ub=null;function pm(s){return s.nodeType===9?s:s.ownerDocument}function Q_(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 Y_(s,u){if(s===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&u==="foreignObject"?0:s}function qb(s,u){return s==="textarea"||s==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Fb=null;function qH(){var s=window.event;return s&&s.type==="popstate"?s===Fb?!1:(Fb=s,!0):(Fb=null,!1)}var W_=typeof setTimeout=="function"?setTimeout:void 0,FH=typeof clearTimeout=="function"?clearTimeout:void 0,Z_=typeof Promise=="function"?Promise:void 0,HH=typeof queueMicrotask=="function"?queueMicrotask:typeof Z_<"u"?function(s){return Z_.resolve(null).then(s).catch(KH)}:W_;function KH(s){setTimeout(function(){throw s})}function ao(s){return s==="head"}function X_(s,u){var h=u,g=0;do{var w=h.nextSibling;if(s.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"||h==="/&"){if(g===0){s.removeChild(w),eu(u);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")hf(s.ownerDocument.documentElement);else if(h==="head"){h=s.ownerDocument.head,hf(h);for(var N=h.firstChild;N;){var T=N.nextSibling,L=N.nodeName;N[Dr]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=T}}else h==="body"&&hf(s.ownerDocument.body);h=w}while(h);eu(u)}function J_(s,u){var h=s;s=0;do{var g=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(s===0)break;s--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||s++;h=g}while(h)}function Hb(s){var u=s.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Hb(h),aa(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}s.removeChild(h)}}function GH(s,u,h,g){for(;s.nodeType===1;){var w=h;if(s.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Dr])switch(u){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(N=s.getAttribute("rel"),N==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(N!==w.rel||s.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||s.getAttribute("title")!==(w.title==null?null:w.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(N=s.getAttribute("src"),(N!==(w.src==null?null:w.src)||s.getAttribute("type")!==(w.type==null?null:w.type)||s.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&N&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(u==="input"&&s.type==="hidden"){var N=w.name==null?null:""+w.name;if(w.type==="hidden"&&s.getAttribute("name")===N)return s}else return s;if(s=Ii(s.nextSibling),s===null)break}return null}function VH(s,u,h){if(u==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!h||(s=Ii(s.nextSibling),s===null))return null;return s}function ez(s,u){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Ii(s.nextSibling),s===null))return null;return s}function Kb(s){return s.data==="$?"||s.data==="$~"}function Gb(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function QH(s,u){var h=s.ownerDocument;if(s.data==="$~")s._reactRetry=u;else if(s.data!=="$?"||h.readyState!=="loading")u();else{var g=function(){u(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Ii(s){for(;s!=null;s=s.nextSibling){var u=s.nodeType;if(u===1||u===3)break;if(u===8){if(u=s.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return s}var Vb=null;function tz(s){s=s.nextSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="/$"||h==="/&"){if(u===0)return Ii(s.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}s=s.nextSibling}return null}function nz(s){s=s.previousSibling;for(var u=0;s;){if(s.nodeType===8){var h=s.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return s;u--}else h!=="/$"&&h!=="/&"||u++}s=s.previousSibling}return null}function rz(s,u,h){switch(u=pm(h),s){case"html":if(s=u.documentElement,!s)throw Error(r(452));return s;case"head":if(s=u.head,!s)throw Error(r(453));return s;case"body":if(s=u.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function hf(s){for(var u=s.attributes;u.length;)s.removeAttributeNode(u[0]);aa(s)}var Li=new Map,iz=new Set;function mm(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ys=J.d;J.d={f:YH,r:WH,D:ZH,C:XH,L:JH,m:eK,X:nK,S:tK,M:rK};function YH(){var s=ys.f(),u=sm();return s||u}function WH(s){var u=Bn(s);u!==null&&u.tag===5&&u.type==="form"?wE(u):ys.r(s)}var Zc=typeof document>"u"?null:document;function az(s,u,h){var g=Zc;if(g&&typeof u=="string"&&u){var w=_i(u);w='link[rel="'+s+'"][href="'+w+'"]',typeof h=="string"&&(w+='[crossorigin="'+h+'"]'),iz.has(w)||(iz.add(w),s={rel:s,crossOrigin:h,href:u},g.querySelector(w)===null&&(u=g.createElement("link"),ur(u,"link",s),un(u),g.head.appendChild(u)))}}function ZH(s){ys.D(s),az("dns-prefetch",s,null)}function XH(s,u){ys.C(s,u),az("preconnect",s,u)}function JH(s,u,h){ys.L(s,u,h);var g=Zc;if(g&&s&&u){var w='link[rel="preload"][as="'+_i(u)+'"]';u==="image"&&h&&h.imageSrcSet?(w+='[imagesrcset="'+_i(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(w+='[imagesizes="'+_i(h.imageSizes)+'"]')):w+='[href="'+_i(s)+'"]';var N=w;switch(u){case"style":N=Xc(s);break;case"script":N=Jc(s)}Li.has(N)||(s=m({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:s,as:u},h),Li.set(N,s),g.querySelector(w)!==null||u==="style"&&g.querySelector(pf(N))||u==="script"&&g.querySelector(mf(N))||(u=g.createElement("link"),ur(u,"link",s),un(u),g.head.appendChild(u)))}}function eK(s,u){ys.m(s,u);var h=Zc;if(h&&s){var g=u&&typeof u.as=="string"?u.as:"script",w='link[rel="modulepreload"][as="'+_i(g)+'"][href="'+_i(s)+'"]',N=w;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Jc(s)}if(!Li.has(N)&&(s=m({rel:"modulepreload",href:s},u),Li.set(N,s),h.querySelector(w)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(mf(N)))return}g=h.createElement("link"),ur(g,"link",s),un(g),h.head.appendChild(g)}}}function tK(s,u,h){ys.S(s,u,h);var g=Zc;if(g&&s){var w=pi(g).hoistableStyles,N=Xc(s);u=u||"default";var T=w.get(N);if(!T){var L={loading:0,preload:null};if(T=g.querySelector(pf(N)))L.loading=5;else{s=m({rel:"stylesheet",href:s,"data-precedence":u},h),(h=Li.get(N))&&Qb(s,h);var K=T=g.createElement("link");un(K),ur(K,"link",s),K._p=new Promise(function(ae,pe){K.onload=ae,K.onerror=pe}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,gm(T,u,g)}T={type:"stylesheet",instance:T,count:1,state:L},w.set(N,T)}}}function nK(s,u){ys.X(s,u);var h=Zc;if(h&&s){var g=pi(h).hoistableScripts,w=Jc(s),N=g.get(w);N||(N=h.querySelector(mf(w)),N||(s=m({src:s,async:!0},u),(u=Li.get(w))&&Yb(s,u),N=h.createElement("script"),un(N),ur(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(w,N))}}function rK(s,u){ys.M(s,u);var h=Zc;if(h&&s){var g=pi(h).hoistableScripts,w=Jc(s),N=g.get(w);N||(N=h.querySelector(mf(w)),N||(s=m({src:s,async:!0,type:"module"},u),(u=Li.get(w))&&Yb(s,u),N=h.createElement("script"),un(N),ur(N,"link",s),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(w,N))}}function sz(s,u,h,g){var w=(w=ne.current)?mm(w):null;if(!w)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=Xc(h.href),h=pi(w).hoistableStyles,g=h.get(u),g||(g={type:"style",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){s=Xc(h.href);var N=pi(w).hoistableStyles,T=N.get(s);if(T||(w=w.ownerDocument||w,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(s,T),(N=w.querySelector(pf(s)))&&!N._p&&(T.instance=N,T.state.loading=5),Li.has(s)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Li.set(s,h),N||iK(w,s,h,T.state))),u&&g===null)throw Error(r(528,""));return T}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=Jc(h),h=pi(w).hoistableScripts,g=h.get(u),g||(g={type:"script",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Xc(s){return'href="'+_i(s)+'"'}function pf(s){return'link[rel="stylesheet"]['+s+"]"}function oz(s){return m({},s,{"data-precedence":s.precedence,precedence:null})}function iK(s,u,h,g){s.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=s.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),ur(u,"link",h),un(u),s.head.appendChild(u))}function Jc(s){return'[src="'+_i(s)+'"]'}function mf(s){return"script[async]"+s}function lz(s,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var g=s.querySelector('style[data-href~="'+_i(h.href)+'"]');if(g)return u.instance=g,un(g),g;var w=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),un(g),ur(g,"style",w),gm(g,h.precedence,s),u.instance=g;case"stylesheet":w=Xc(h.href);var N=s.querySelector(pf(w));if(N)return u.state.loading|=4,u.instance=N,un(N),N;g=oz(h),(w=Li.get(w))&&Qb(g,w),N=(s.ownerDocument||s).createElement("link"),un(N);var T=N;return T._p=new Promise(function(L,K){T.onload=L,T.onerror=K}),ur(N,"link",g),u.state.loading|=4,gm(N,h.precedence,s),u.instance=N;case"script":return N=Jc(h.src),(w=s.querySelector(mf(N)))?(u.instance=w,un(w),w):(g=h,(w=Li.get(N))&&(g=m({},h),Yb(g,w)),s=s.ownerDocument||s,w=s.createElement("script"),un(w),ur(w,"link",g),s.head.appendChild(w),u.instance=w);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,gm(g,h.precedence,s));return u.instance}function gm(s,u,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=g.length?g[g.length-1]:null,N=w,T=0;T<g.length;T++){var L=g[T];if(L.dataset.precedence===u)N=L;else if(N!==w)break}N?N.parentNode.insertBefore(s,N.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(s,u.firstChild))}function Qb(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.title==null&&(s.title=u.title)}function Yb(s,u){s.crossOrigin==null&&(s.crossOrigin=u.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=u.referrerPolicy),s.integrity==null&&(s.integrity=u.integrity)}var ym=null;function cz(s,u,h){if(ym===null){var g=new Map,w=ym=new Map;w.set(h,g)}else w=ym,g=w.get(h),g||(g=new Map,w.set(h,g));if(g.has(s))return g;for(g.set(s,null),h=h.getElementsByTagName(s),w=0;w<h.length;w++){var N=h[w];if(!(N[Dr]||N[Ln]||s==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var T=N.getAttribute(u)||"";T=s+T;var L=g.get(T);L?L.push(N):g.set(T,[N])}}return g}function uz(s,u,h){s=s.ownerDocument||s,s.head.insertBefore(h,u==="title"?s.querySelector("head > title"):null)}function aK(s,u,h){if(h===1||u.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;return u.rel==="stylesheet"?(s=u.disabled,typeof u.precedence=="string"&&s==null):!0;case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function dz(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function sK(s,u,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var w=Xc(g.href),N=u.querySelector(pf(w));if(N){u=N._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(s.count++,s=vm.bind(s),u.then(s,s)),h.state.loading|=4,h.instance=N,un(N);return}N=u.ownerDocument||u,g=oz(g),(w=Li.get(w))&&Qb(g,w),N=N.createElement("link"),un(N);var T=N;T._p=new Promise(function(L,K){T.onload=L,T.onerror=K}),ur(N,"link",g),h.instance=N}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(s.count++,h=vm.bind(s),u.addEventListener("load",h),u.addEventListener("error",h))}}var Wb=0;function oK(s,u){return s.stylesheets&&s.count===0&&bm(s,s.stylesheets),0<s.count||0<s.imgCount?function(h){var g=setTimeout(function(){if(s.stylesheets&&bm(s,s.stylesheets),s.unsuspend){var N=s.unsuspend;s.unsuspend=null,N()}},6e4+u);0<s.imgBytes&&Wb===0&&(Wb=62500*UH());var w=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&bm(s,s.stylesheets),s.unsuspend)){var N=s.unsuspend;s.unsuspend=null,N()}},(s.imgBytes>Wb?50:800)+u);return s.unsuspend=h,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(w)}}:null}function vm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)bm(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var xm=null;function bm(s,u){s.stylesheets=null,s.unsuspend!==null&&(s.count++,xm=new Map,u.forEach(lK,s),xm=null,vm.call(s))}function lK(s,u){if(!(u.state.loading&4)){var h=xm.get(s);if(h)var g=h.get(null);else{h=new Map,xm.set(s,h);for(var w=s.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<w.length;N++){var T=w[N];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(h.set(T.dataset.precedence,T),g=T)}g&&h.set(null,g)}w=u.instance,T=w.getAttribute("data-precedence"),N=h.get(T)||g,N===g&&h.set(null,w),h.set(T,w),this.count++,g=vm.bind(this),w.addEventListener("load",g),w.addEventListener("error",g),N?N.parentNode.insertBefore(w,N.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(w,s.firstChild)),u.state.loading|=4}}var gf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function cK(s,u,h,g,w,N,T,L,K){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=Ei(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ei(0),this.hiddenUpdates=Ei(null),this.identifierPrefix=g,this.onUncaughtError=w,this.onCaughtError=N,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function fz(s,u,h,g,w,N,T,L,K,ae,pe,xe){return s=new cK(s,u,h,T,K,ae,pe,xe,L),u=1,N===!0&&(u|=24),N=gi(3,null,null,u),s.current=N,N.stateNode=s,u=Ex(),u.refCount++,s.pooledCache=u,u.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:u},Px(N),s}function hz(s){return s?(s=_c,s):_c}function pz(s,u,h,g,w,N){w=hz(w),g.context===null?g.context=w:g.pendingContext=w,g=Qs(u),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Ys(s,g,u),h!==null&&(ei(h,s,u),Vd(h,s,u))}function mz(s,u){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var h=s.retryLane;s.retryLane=h!==0&&h<u?h:u}}function Zb(s,u){mz(s,u),(s=s.alternate)&&mz(s,u)}function gz(s){if(s.tag===13||s.tag===31){var u=el(s,67108864);u!==null&&ei(u,s,67108864),Zb(s,67108864)}}function yz(s){if(s.tag===13||s.tag===31){var u=wi();u=Ed(u);var h=el(s,u);h!==null&&ei(h,s,u),Zb(s,u)}}var wm=!0;function uK(s,u,h,g){var w=H.T;H.T=null;var N=J.p;try{J.p=2,Xb(s,u,h,g)}finally{J.p=N,H.T=w}}function dK(s,u,h,g){var w=H.T;H.T=null;var N=J.p;try{J.p=8,Xb(s,u,h,g)}finally{J.p=N,H.T=w}}function Xb(s,u,h,g){if(wm){var w=Jb(g);if(w===null)Lb(s,u,g,Sm,h),xz(s,g);else if(hK(w,s,u,h,g))g.stopPropagation();else if(xz(s,g),u&4&&-1<fK.indexOf(s)){for(;w!==null;){var N=Bn(w);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var T=je(N.pendingLanes);if(T!==0){var L=N;for(L.pendingLanes|=2,L.entangledLanes|=2;T;){var K=1<<31-it(T);L.entanglements[1]|=K,T&=~K}_a(N),(Tt&6)===0&&(im=Ct()+500,uf(0))}}break;case 31:case 13:L=el(N,2),L!==null&&ei(L,N,2),sm(),Zb(N,2)}if(N=Jb(g),N===null&&Lb(s,u,g,Sm,h),N===w)break;w=N}w!==null&&g.stopPropagation()}else Lb(s,u,g,null,h)}}function Jb(s){return s=tx(s),ew(s)}var Sm=null;function ew(s){if(Sm=null,s=hi(s),s!==null){var u=a(s);if(u===null)s=null;else{var h=u.tag;if(h===13){if(s=o(u),s!==null)return s;s=null}else if(h===31){if(s=c(u),s!==null)return s;s=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;s=null}else u!==s&&(s=null)}}return Sm=s,null}function vz(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(Ye()){case ce:return 2;case Se:return 8;case Pe:case We:return 32;case ut:return 268435456;default:return 32}default:return 32}}var tw=!1,so=null,oo=null,lo=null,yf=new Map,vf=new Map,co=[],fK="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 xz(s,u){switch(s){case"focusin":case"focusout":so=null;break;case"dragenter":case"dragleave":oo=null;break;case"mouseover":case"mouseout":lo=null;break;case"pointerover":case"pointerout":yf.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":vf.delete(u.pointerId)}}function xf(s,u,h,g,w,N){return s===null||s.nativeEvent!==N?(s={blockedOn:u,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[w]},u!==null&&(u=Bn(u),u!==null&&gz(u)),s):(s.eventSystemFlags|=g,u=s.targetContainers,w!==null&&u.indexOf(w)===-1&&u.push(w),s)}function hK(s,u,h,g,w){switch(u){case"focusin":return so=xf(so,s,u,h,g,w),!0;case"dragenter":return oo=xf(oo,s,u,h,g,w),!0;case"mouseover":return lo=xf(lo,s,u,h,g,w),!0;case"pointerover":var N=w.pointerId;return yf.set(N,xf(yf.get(N)||null,s,u,h,g,w)),!0;case"gotpointercapture":return N=w.pointerId,vf.set(N,xf(vf.get(N)||null,s,u,h,g,w)),!0}return!1}function bz(s){var u=hi(s.target);if(u!==null){var h=a(u);if(h!==null){if(u=h.tag,u===13){if(u=o(h),u!==null){s.blockedOn=u,mp(s.priority,function(){yz(h)});return}}else if(u===31){if(u=c(h),u!==null){s.blockedOn=u,mp(s.priority,function(){yz(h)});return}}else if(u===3&&h.stateNode.current.memoizedState.isDehydrated){s.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}s.blockedOn=null}function jm(s){if(s.blockedOn!==null)return!1;for(var u=s.targetContainers;0<u.length;){var h=Jb(s.nativeEvent);if(h===null){h=s.nativeEvent;var g=new h.constructor(h.type,h);ex=g,h.target.dispatchEvent(g),ex=null}else return u=Bn(h),u!==null&&gz(u),s.blockedOn=h,!1;u.shift()}return!0}function wz(s,u,h){jm(s)&&h.delete(u)}function pK(){tw=!1,so!==null&&jm(so)&&(so=null),oo!==null&&jm(oo)&&(oo=null),lo!==null&&jm(lo)&&(lo=null),yf.forEach(wz),vf.forEach(wz)}function Nm(s,u){s.blockedOn===u&&(s.blockedOn=null,tw||(tw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pK)))}var km=null;function Sz(s){km!==s&&(km=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){km===s&&(km=null);for(var u=0;u<s.length;u+=3){var h=s[u],g=s[u+1],w=s[u+2];if(typeof g!="function"){if(ew(g||h)===null)continue;break}var N=Bn(h);N!==null&&(s.splice(u,3),u-=3,Jx(N,{pending:!0,data:w,method:h.method,action:g},g,w))}}))}function eu(s){function u(K){return Nm(K,s)}so!==null&&Nm(so,s),oo!==null&&Nm(oo,s),lo!==null&&Nm(lo,s),yf.forEach(u),vf.forEach(u);for(var h=0;h<co.length;h++){var g=co[h];g.blockedOn===s&&(g.blockedOn=null)}for(;0<co.length&&(h=co[0],h.blockedOn===null);)bz(h),h.blockedOn===null&&co.shift();if(h=(s.ownerDocument||s).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var w=h[g],N=h[g+1],T=w[ar]||null;if(typeof N=="function")T||Sz(h);else if(T){var L=null;if(N&&N.hasAttribute("formAction")){if(w=N,T=N[ar]||null)L=T.formAction;else if(ew(w)!==null)continue}else L=T.action;typeof L=="function"?h[g+1]=L:(h.splice(g,3),g-=3),Sz(h)}}}function jz(){function s(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(T){return w=T})},focusReset:"manual",scroll:"manual"})}function u(){w!==null&&(w(),w=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,w=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),w!==null&&(w(),w=null)}}}function nw(s){this._internalRoot=s}Cm.prototype.render=nw.prototype.render=function(s){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,g=wi();pz(h,g,s,u,null,null)},Cm.prototype.unmount=nw.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var u=s.containerInfo;pz(s.current,2,null,s,null,null),sm(),u[Y]=null}};function Cm(s){this._internalRoot=s}Cm.prototype.unstable_scheduleHydration=function(s){if(s){var u=pp();s={blockedOn:null,target:s,priority:u};for(var h=0;h<co.length&&u!==0&&u<co[h].priority;h++);co.splice(h,0,s),h===0&&bz(s)}};var Nz=t.version;if(Nz!=="19.2.4")throw Error(r(527,Nz,"19.2.4"));J.findDOMNode=function(s){var u=s._reactInternals;if(u===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(u),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var mK={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Am=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Am.isDisabled&&Am.supportsFiber)try{tn=Am.inject(mK),Gt=Am}catch{}}return wf.createRoot=function(s,u){if(!i(s))throw Error(r(299));var h=!1,g="",w=zE,N=TE,T=PE;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(T=u.onRecoverableError)),u=fz(s,1,!1,null,null,h,g,null,w,N,T,jz),s[Y]=u.current,Ib(s),new nw(u)},wf.hydrateRoot=function(s,u,h){if(!i(s))throw Error(r(299));var g=!1,w="",N=zE,T=TE,L=PE,K=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(T=h.onCaughtError),h.onRecoverableError!==void 0&&(L=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),u=fz(s,1,!0,u,h??null,g,w,K,N,T,L,jz),u.context=hz(null),h=u.current,g=wi(),g=Ed(g),w=Qs(g),w.callback=null,Ys(h,w,g),h=g,u.current.lanes=h,Yt(u,h),_a(u),s[Y]=u.current,Ib(s),new Cm(u)},wf.version="19.2.4",wf}var Rz;function kK(){if(Rz)return aw.exports;Rz=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(),aw.exports=NK(),aw.exports}var CK=kK(),sc=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(){}},AK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},OK=class{#t=AK;#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)}},kl=new OK;function EK(e){setTimeout(e,0)}var Fl=typeof window>"u"||"Deno"in globalThis;function jr(){}function _K(e,t){return typeof e=="function"?e(t):e}function Ij(e){return typeof e=="number"&&e>=0&&e!==1/0}function HL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Oo(e,t){return typeof e=="function"?e(t):e}function Fi(e,t){return typeof e=="function"?e(t):e}function Dz(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:c}=e;if(o){if(r){if(t.queryHash!==zN(o,t.options))return!1}else if(!ch(t.queryKey,o))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||a&&!a(t))}function Mz(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Hl(t.options.mutationKey)!==Hl(a))return!1}else if(!ch(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function zN(e,t){return(t?.queryKeyHashFn||Hl)(e)}function Hl(e){return JSON.stringify(e,(t,n)=>Lj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ch(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>ch(e[n],t[n])):!1}var zK=Object.prototype.hasOwnProperty;function TN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Iz(e)&&Iz(t);if(!r&&!(Lj(e)&&Lj(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),c=o.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const m=r?p:o[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:zK.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const S=TN(y,v,n+1);d[m]=S,S===y&&f++}return a===c&&f===a?e:d}function uh(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 Iz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Lj(e){if(!Lz(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Lz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Lz(e){return Object.prototype.toString.call(e)==="[object Object]"}function TK(e){return new Promise(t=>{kl.setTimeout(t,e)})}function $j(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?TN(e,t):t}function PK(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function RK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var PN=Symbol();function KL(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===PN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function RN(e,t){return typeof e=="function"?e(...t):!!e}function DK(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var MK=class extends sc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Fl&&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"}},DN=new MK;function Bj(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var IK=EK;function LK(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=IK;const a=c=>{t?e.push(c):i(()=>{n(c)})},o=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||o()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var Nn=LK(),$K=class extends sc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Fl&&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}},Ug=new $K;function BK(e){return Math.min(1e3*2**e,3e4)}function GL(e){return(e??"online")==="online"?Ug.isOnline():!0}var Uj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function VL(e){let t=!1,n=0,r;const i=Bj(),a=()=>i.status!=="pending",o=b=>{if(!a()){const j=new Uj(b);y(j),e.onCancel?.(j)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>DN.isFocused()&&(e.networkMode==="always"||Ug.isOnline())&&e.canRun(),p=()=>GL(e.networkMode)&&e.canRun(),m=b=>{a()||(r?.(),i.resolve(b))},y=b=>{a()||(r?.(),i.reject(b))},v=()=>new Promise(b=>{r=j=>{(a()||f())&&b(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),S=()=>{if(a())return;let b;const j=n===0?e.initialPromise:void 0;try{b=j??e.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(m).catch(k=>{if(a())return;const E=e.retry??(Fl?0:3),C=e.retryDelay??BK,O=typeof C=="function"?C(n,k):C,z=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!z){y(k);return}n++,e.onFail?.(n,k),TK(O).then(()=>f()?void 0:v()).then(()=>{t?y(k):S()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?S():v().then(S),i)}}var QL=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ij(this.gcTime)&&(this.#t=kl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(kl.clearTimeout(this.#t),this.#t=void 0)}},UK=class extends QL{#t;#e;#n;#i;#r;#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=Bz(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Bz(this.options);t.data!==void 0&&(this.setState($z(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=$j(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Fi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===PN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oo(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:!HL(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.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.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=KL(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},o=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(o,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=VL({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:c=>{c instanceof Uj&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Uj){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(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,...YL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...$z(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#e=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Nn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function YL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:GL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $z(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bz(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var MN=class extends sc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=Bj(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#i=void 0;#r;#a;#o;#s;#p;#d;#f;#c;#u;#l;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Uz(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return qj(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return qj(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),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 Fi(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),t._defaulted&&!uh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&qz(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Fi(this.options.enabled,this.#e)!==Fi(t.enabled,this.#e)||Oo(this.options.staleTime,this.#e)!==Oo(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Fi(this.options.enabled,this.#e)!==Fi(t.enabled,this.#e)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return FK(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="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,r))})}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.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#m(e){this.#S();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(jr)),t}#g(){this.#b();const e=Oo(this.options.staleTime,this.#e);if(Fl||this.#i.isStale||!Ij(e))return;const n=HL(this.#i.dataUpdatedAt,e)+1;this.#c=kl.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.#w(),this.#l=e,!(Fl||Fi(this.options.enabled,this.#e)===!1||!Ij(this.#l)||this.#l===0)&&(this.#u=kl.setInterval(()=>{(this.options.refetchIntervalInBackground||DN.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(kl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(kl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,o=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,y;if(t._optimisticResults){const R=this.hasListeners(),$=!R&&Uz(e,t),F=R&&qz(e,n,t,r);($||F)&&(p={...p,...YL(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:S,status:b}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&b==="pending"){let R;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(R=i.data,j=!0):R=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,R!==void 0&&(b="success",y=$j(i?.data,R,t),m=!0)}if(t.select&&y!==void 0&&!j)if(i&&y===a?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=$j(i?.data,y,t),this.#d=y,this.#s=null}catch(R){this.#s=R}this.#s&&(v=this.#s,y=this.#d,S=Date.now(),b="error");const k=p.fetchStatus==="fetching",E=b==="pending",C=b==="error",O=E&&k,z=y!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:E,isSuccess:b==="success",isError:C,isInitialLoading:O,isLoading:O,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:C&&!z,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&z,isStale:IN(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Fi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=_.data!==void 0,$=_.status==="error"&&!R,F=V=>{$?V.reject(_.error):R&&V.resolve(_.data)},q=()=>{const V=this.#o=_.promise=Bj();F(V)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&F(B);break;case"fulfilled":($||_.data!==B.value)&&q();break;case"rejected":(!$||_.error!==B.reason)&&q();break}}return _}updateResult(){const e=this.#i,t=this.createResult(this.#e,this.options);if(this.#r=this.#e.state,this.#a=this.options,this.#r.data!==void 0&&(this.#f=this.#e),uh(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#h.size)return!0;const a=new Set(i??this.#h);return this.options.throwOnError&&a.add("error"),Object.keys(this.#i).some(o=>{const c=o;return this.#i[c]!==e[c]&&a.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#j(e){Nn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function qK(e,t){return Fi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Uz(e,t){return qK(e,t)||e.state.data!==void 0&&qj(e,t,t.refetchOnMount)}function qj(e,t,n){if(Fi(t.enabled,e)!==!1&&Oo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&IN(e,t)}return!1}function qz(e,t,n,r){return(e!==t||Fi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&IN(e,n)}function IN(e,t){return Fi(t.enabled,e)!==!1&&e.isStaleByTime(Oo(t.staleTime,e))}function FK(e,t){return!uh(e.getCurrentResult(),t)}function Fz(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=S=>{DK(S,()=>t.signal,()=>p=!0)},y=KL(t.options,t.fetchOptions),v=async(S,b,j)=>{if(p)return Promise.reject();if(b==null&&S.pages.length)return Promise.resolve(S);const E=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:b,direction:j?"backward":"forward",meta:t.options.meta};return m(A),A})(),C=await y(E),{maxPages:O}=t.options,z=j?RK:PK;return{pages:z(S.pages,C,O),pageParams:z(S.pageParams,b,O)}};if(i&&a.length){const S=i==="backward",b=S?HK:Hz,j={pages:a,pageParams:o},k=b(r,j);c=await v(j,k,S)}else{const S=e??a.length;do{const b=d===0?o[0]??r.initialPageParam:Hz(r,c);if(d>0&&b==null)break;c=await v(c,b),d++}while(d<S)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function Hz(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function HK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var KK=class extends QL{#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||WL(),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.#r({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=VL({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#n.runNext(this)}}#r(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),Nn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function WL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ZL=class extends sc{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 r=new KK({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#t.add(e);const t=Om(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=Om(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Om(e);if(typeof t=="string"){const r=this.#e.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Om(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Nn.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=>Mz(t,n))}findAll(e={}){return this.getAll().filter(t=>Mz(e,t))}notify(e){Nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Nn.batch(()=>Promise.all(e.map(t=>t.continue().catch(jr))))}};function Om(e){return e.options.scope?.id}var GK=class extends sc{#t;#e=void 0;#n;#i;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#r()}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),uh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Hl(n.mutationKey)!==Hl(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.#r(),this.#a(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),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)}#r(){const t=this.#n?.state??WL();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){Nn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context,i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function Kz(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function VK(e,t,n){const r=e.slice(0);return r[t]=n,r}var QK=class extends sc{#t;#e;#n;#i;#r;#a;#o;#s;#p;#d=[];constructor(e,t,n){super(),this.#t=e,this.#i=n,this.#n=[],this.#r=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#r.forEach(e=>{e.subscribe(t=>{this.#l(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#r.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#i=t,Nn.batch(()=>{const n=this.#r,r=this.#u(this.#n);r.forEach(p=>p.observer.setOptions(p.defaultedQueryOptions));const i=r.map(p=>p.observer),a=i.map(p=>p.getCurrentResult()),o=n.length!==i.length,c=i.some((p,m)=>p!==n[m]),d=o||c,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!uh(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(Kz(n,i).forEach(p=>{p.destroy()}),Kz(i,n).forEach(p=>{p.subscribe(m=>{this.#l(p,m)})})),this.#h()))})}getCurrentResult(){return this.#e}getQueries(){return this.#r.map(e=>e.getCurrentQuery())}getObservers(){return this.#r}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(a=>a.observer.getOptimisticResult(a.defaultedQueryOptions)),i=n.map(a=>a.defaultedQueryOptions.queryHash);return[r,a=>this.#c(a??r,t,i),()=>this.#f(r,n)]}#f(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,a=>{t.forEach(o=>{o.observer.trackProp(a)})})})}#c(e,t,n){if(t){const r=this.#p,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((a,o)=>a!==r[o]));return(!this.#a||this.#e!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#e,n!==void 0&&(this.#p=n),this.#a=TN(this.#a,t(e))),this.#a}return e}#u(e){const t=new Map;this.#r.forEach(r=>{const i=r.options.queryHash;if(!i)return;const a=t.get(i);a?a.push(r):t.set(i,[r])});const n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),o=t.get(i.queryHash)?.shift()??new MN(this.#t,i);n.push({defaultedQueryOptions:i,observer:o})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=VK(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&&Nn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},YK=class extends sc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??zN(r,t);let a=this.get(i);return a||(a=new UK({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}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(){Nn.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=>Dz(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Dz(e,n)):t}notify(e){Nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Nn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Nn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},WK=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new YK,this.#e=e.mutationCache||new ZL,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=DN.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Ug.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=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),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Oo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=this.#t.get(r.queryHash)?.state.data,o=_K(t,a);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Nn.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Nn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Nn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Nn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(jr).catch(jr)}invalidateQueries(e,t={}){return Nn.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},r=Nn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(jr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Oo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e.behavior=Fz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}ensureInfiniteQueryData(e){return e.behavior=Fz(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ug.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(Hl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{ch(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Hl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{ch(e,r.mutationKey)&&Object.assign(n,r.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=zN(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===PN&&(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()}},XL=x.createContext(void 0),Kr=e=>{const t=x.useContext(XL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ZK=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(XL.Provider,{value:e,children:t})),JL=x.createContext(!1),e5=()=>x.useContext(JL);JL.Provider;function XK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var JK=x.createContext(XK()),t5=()=>x.useContext(JK),n5=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?RN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},r5=e=>{x.useEffect(()=>{e.clearReset()},[e])},i5=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||RN(n,[e.error,r])),a5=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},e7=(e,t)=>e.isLoading&&e.isFetching&&!t,Fj=(e,t)=>e?.suspense&&t.isPending,Hj=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function s5({queries:e,...t},n){const r=Kr(),i=e5(),a=t5(),o=x.useMemo(()=>e.map(b=>{const j=r.defaultQueryOptions(b);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);o.forEach(b=>{a5(b);const j=r.getQueryCache().get(b.queryHash);n5(b,a,j)}),r5(a);const[c]=x.useState(()=>new QK(r,o,t)),[d,f,p]=c.getOptimisticResult(o,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?c.subscribe(Nn.batchCalls(b)):jr,[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(o,t)},[o,t,c]);const v=d.some((b,j)=>Fj(o[j],b))?d.flatMap((b,j)=>{const k=o[j];if(k&&Fj(k,b)){const E=new MN(r,k);return Hj(k,E,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const S=d.find((b,j)=>{const k=o[j];return k&&i5({result:b,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(S?.error)throw S.error;return f(p())}function t7(e,t,n){const r=e5(),i=t5(),a=Kr(),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);const c=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?"isRestoring":"optimistic",a5(o),n5(o,i,c),r5(i);const d=!a.getQueryCache().get(o.queryHash),[f]=x.useState(()=>new t(a,o)),p=f.getOptimisticResult(o),m=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=m?f.subscribe(Nn.batchCalls(y)):jr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(o)},[o,f]),Fj(o,p))throw Hj(o,f,i);if(i5({result:p,errorResetBoundary:i,throwOnError:o.throwOnError,query:c,suspense:o.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,p),o.experimental_prefetchInRender&&!Fl&&e7(p,r)&&(d?Hj(o,f,i):c?.promise)?.catch(jr).finally(()=>{f.updateResult()}),o.notifyOnChangeProps?p:f.trackResult(p)}function Ar(e,t){return t7(e,MN)}function oc(e,t){const n=Kr(),[r]=x.useState(()=>new GK(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(Nn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((o,c)=>{r.mutate(o,c).catch(jr)},[r]);if(i.error&&RN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Em=typeof window<"u"?x.useLayoutEffect:x.useEffect;function cw(e){const t=x.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function n7(e,t,n={},r={}){x.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function r7(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var i7=!1;function dh(e){return e[e.length-1]}function a7(e){return typeof e=="function"}function jo(e,t){return a7(e)?e(t):e}var s7=Object.prototype.hasOwnProperty,Gz=Object.prototype.propertyIsEnumerable,o7=()=>Object.create(null),hl=(e,t)=>Cl(e,t,o7);function Cl(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=Yz(e)&&Yz(i);if(!a&&!(qg(e)&&qg(i)))return i;const o=a?e:Vz(e);if(!o)return i;const c=a?i:Vz(i);if(!c)return i;const d=o.length,f=c.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:c[y],S=e[v],b=i[v];if(S===b){p[v]=S,(a?y<d:s7.call(e,v))&&m++;continue}if(S===null||b===null||typeof S!="object"||typeof b!="object"){p[v]=b;continue}const j=Cl(S,b,n,r+1);p[v]=j,j===S&&m++}return d===f&&m===d?e:p}function Vz(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Gz.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const r=t;for(const i of n){if(!Gz.call(e,i))return!1;r.push(i)}return r}function qg(e){if(!Qz(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Qz(n)||!n.hasOwnProperty("isPrototypeOf"))}function Qz(e){return Object.prototype.toString.call(e)==="[object Object]"}function Yz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Dl(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 r=0,i=e.length;r<i;r++)if(!Dl(e[r],t[r],n))return!1;return!0}if(qg(e)&&qg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const o in t)if((!r||t[o]!==void 0)&&!Dl(e[o],t[o],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&i++;let a=0;for(const o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Dl(e[o],t[o],n)))return!1;return i===a}return!1}function Hu(e){let t,n;const r=new Promise((i,a)=>{t=i,n=a});return r.status="pending",r.resolve=i=>{r.status="resolved",r.value=i,t(i),e?.(i)},r.reject=i=>{r.status="rejected",n(i)},r}function fh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function l7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Wz(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 l7(t)}var c7=["http:","https:","mailto:","tel:"];function Fg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Sf(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,r="",i;for(;(i=t.exec(e))!==null;)r+=Wz(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Wz(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function u7(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Hg(e){const t=new Map;let n,r;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,r&&(r.next=a,a.prev=r)):(a.next.prev=void 0,n=a.next,a.next=void 0,r&&(a.prev=r,r.next=a)),r=a)};return{get(a){const o=t.get(a);if(o)return i(o),o.value},set(a,o){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const c=t.get(a);if(c)c.value=o,i(c);else{const d={key:a,value:o,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,r=void 0}}}var d7="Invariant failed";function Es(e,t){if(!e)throw new Error(d7)}var Al=4,o5=5;function f7(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 LN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const o=f7(a);if(o){const[c,d]=o,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const p=c+3,m=d;if(p<m)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=c+1,m=c+2;return m===d?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function vv(e,t,n,r,i,a,o){o?.(n);let c=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<f;){const v=LN(d,c,t);let S;const b=c,j=v[5];switch(c=j+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const E=i.static?.get(k);if(E)S=E;else{i.static??=new Map;const C=Ol(n.fullPath??n.from);C.parent=i,C.depth=a,S=C,i.static.set(k,C)}}else{const E=k.toLowerCase(),C=i.staticInsensitive?.get(E);if(C)S=C;else{i.staticInsensitive??=new Map;const O=Ol(n.fullPath??n.from);O.parent=i,O.depth=a,S=O,i.staticInsensitive.set(E,O)}}break}case 1:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),O=k?C?k:k.toLowerCase():void 0,z=E?C?E:E.toLowerCase():void 0,A=!m&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===O&&_.suffix===z);if(A)S=A;else{const _=dw(1,n.fullPath??n.from,C,O,z);S=_,_.depth=a,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case 3:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),O=k?C?k:k.toLowerCase():void 0,z=E?C?E:E.toLowerCase():void 0,A=!m&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===O&&_.suffix===z);if(A)S=A;else{const _=dw(3,n.fullPath??n.from,C,O,z);S=_,_.parent=i,_.depth=a,i.optional??=[],i.optional.push(_)}break}case 2:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),C=p&&!!(k||E),O=k?C?k:k.toLowerCase():void 0,z=E?C?E:E.toLowerCase():void 0,A=dw(2,n.fullPath??n.from,C,O,z);S=A,A.parent=i,A.depth=a,i.wildcard??=[],i.wildcard.push(A)}}i=S}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=Ol(n.fullPath??n.from);v.kind=o5,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&d.endsWith("/")){const v=Ol(n.fullPath??n.from);v.kind=Al,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)vv(e,t,d,c,i,a,o)}function uw(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 yo(e){if(e.pathless)for(const t of e.pathless)yo(t);if(e.static)for(const t of e.static.values())yo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())yo(t);if(e.dynamic?.length){e.dynamic.sort(uw);for(const t of e.dynamic)yo(t)}if(e.optional?.length){e.optional.sort(uw);for(const t of e.optional)yo(t)}if(e.wildcard?.length){e.wildcard.sort(uw);for(const t of e.wildcard)yo(t)}}function Ol(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 dw(e,t,n,r,i){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:r,suffix:i}}function h7(e,t){const n=Ol("/"),r=new Uint16Array(6);for(const i of e)vv(!1,r,i,1,n,0);yo(n),t.masksTree=n,t.flatCache=Hg(1e3)}function p7(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=$N(e,t.masksTree);return t.flatCache.set(e,r),r}function m7(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let o=i.singleCache.get(a);return o||(o=Ol("/"),vv(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),$N(r,o,n)}function g7(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||="/";let a;try{a=$N(e,t.segmentTree,n)}catch(o){if(o instanceof URIError)a=null;else throw o}return a&&(a.branch=x7(a.route)),t.matchCache.set(r,a),a}function y7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function v7(e,t=!1,n){const r=Ol(e.fullPath),i=new Uint16Array(6),a={},o={};let c=0;return vv(t,i,e,1,r,0,d=>{if(n?.(d,c),Es(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,c!==0&&d.path){const f=y7(d.fullPath);(!o[f]||d.fullPath.endsWith("/"))&&(o[f]=d)}c++}),yo(r),{processedTree:{segmentTree:r,singleCache:Hg(1e3),matchCache:Hg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function $N(e,t,n=!1){const r=e.split("/"),i=w7(e,r,t,n);if(!i)return null;const[a]=l5(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function l5(e,t,n){const r=b7(n.node);let i=null;const a=Object.create(null);let o=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;o++,c++,d++,f++){const p=r[c];if(p.kind===Al)break;if(p.kind===o5){f--,o--,d--;continue}const m=t[o],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],S=p.prefix?.length??0;if(v.charCodeAt(S)===123){const b=p.suffix?.length??0,j=v.substring(S+2,v.length-b-1),k=m.substring(S,m.length-b);a[j]=decodeURIComponent(k)}else{const b=v.substring(1);a[b]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<c){o--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],S=p.prefix?.length??0,b=p.suffix?.length??0,j=v.substring(S+3,v.length-b-1),k=p.suffix||p.prefix?m.substring(S,m.length-b):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,S=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),b=decodeURIComponent(S);a["*"]=b,a._splat=b;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:c,path:d,segment:f}]}function x7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function b7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function w7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!dh(t),a=i&&e!=="/",o=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;c.length;){const m=c.pop(),{node:y,index:v,skipped:S,depth:b,statics:j,dynamics:k,optionals:E}=m;let{extract:C,rawParams:O,parsedParams:z}=m;if(y.skipOnParamError){if(!fw(e,t,m))continue;O=m.rawParams,C=m.extract,z=m.parsedParams}r&&y.route&&y.kind!==Al&&jf(f,m)&&(f=m);const A=v===o;if(A&&(y.route&&!a&&jf(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const _=A?void 0:t[v];let R;if(A&&y.index){const $={node:y.index,index:v,skipped:S,depth:b+1,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:z};let F=!0;if(y.index.skipOnParamError&&(fw(e,t,$)||(F=!1)),F){if(j===o&&!k&&!E&&!S)return $;jf(p,$)&&(p=$)}}if(y.wildcard&&jf(d,m))for(const $ of y.wildcard){const{prefix:F,suffix:q}=$;if(F&&(A||!($.caseSensitive?_:R??=_.toLowerCase()).startsWith(F)))continue;if(q){if(A)continue;const V=t.slice(v).join("/").slice(-q.length);if(($.caseSensitive?V:V.toLowerCase())!==q)continue}const B={node:$,index:o,skipped:S,depth:b,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:z};if(!($.skipOnParamError&&!fw(e,t,B))){d=B;break}}if(y.optional){const $=S|1<<b,F=b+1;for(let q=y.optional.length-1;q>=0;q--){const B=y.optional[q];c.push({node:B,index:v,skipped:$,depth:F,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:z})}if(!A)for(let q=y.optional.length-1;q>=0;q--){const B=y.optional[q],{prefix:V,suffix:X}=B;if(V||X){const Z=B.caseSensitive?_:R??=_.toLowerCase();if(V&&!Z.startsWith(V)||X&&!Z.endsWith(X))continue}c.push({node:B,index:v+1,skipped:S,depth:F,statics:j,dynamics:k,optionals:E+1,extract:C,rawParams:O,parsedParams:z})}}if(!A&&y.dynamic&&_)for(let $=y.dynamic.length-1;$>=0;$--){const F=y.dynamic[$],{prefix:q,suffix:B}=F;if(q||B){const V=F.caseSensitive?_:R??=_.toLowerCase();if(q&&!V.startsWith(q)||B&&!V.endsWith(B))continue}c.push({node:F,index:v+1,skipped:S,depth:b+1,statics:j,dynamics:k+1,optionals:E,extract:C,rawParams:O,parsedParams:z})}if(!A&&y.staticInsensitive){const $=y.staticInsensitive.get(R??=_.toLowerCase());$&&c.push({node:$,index:v+1,skipped:S,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:z})}if(!A&&y.static){const $=y.static.get(_);$&&c.push({node:$,index:v+1,skipped:S,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:z})}if(y.pathless){const $=b+1;for(let F=y.pathless.length-1;F>=0;F--){const q=y.pathless[F];c.push({node:q,index:v,skipped:S,depth:$,statics:j,dynamics:k,optionals:E,extract:C,rawParams:O,parsedParams:z})}}}if(p&&d)return jf(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const y=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(y),f}return null}function fw(e,t,n){try{const[r,i]=l5(e,t,n);n.rawParams=r,n.extract=i;const a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function jf(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===Al)>(e.node.kind===Al)||t.node.kind===Al==(e.node.kind===Al)&&t.depth>e.depth))):!0}function jg(e){return BN(e.filter(t=>t!==void 0).join("/"))}function BN(e){return e.replace(/\/{2,}/g,"/")}function c5(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Eo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function u5(e){return Eo(c5(e))}function Kg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function S7(e,t,n){return Kg(e,n)===Kg(t,n)}function j7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let o;if(r){o=i?t:a?e:e+"\0"+t;const m=r.get(o);if(m)return m}let c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&dh(c)==="";)c.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const S=m[y];S===""?y?y===v-1&&c.push(S):c=[S]:S===".."?c.pop():S==="."||c.push(S)}}c.length>1&&(dh(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let d,f="";for(let m=0;m<c.length;m++){m>0&&(f+="/");const y=c[m];if(!y)continue;d=LN(y,0,d);const v=d[0];if(v===0){f+=y;continue}const S=d[5],b=y.substring(0,d[1]),j=y.substring(d[4],S),k=y.substring(d[2],d[3]);v===1?f+=b||j?`${b}{$${k}}${j}`:`$${k}`:v===2?f+=b||j?`${b}{$}${j}`:"$":f+=`${b}{-$${k}}${j}`}f=BN(f);const p=f||"/";return o&&r&&r.set(o,p),p}function N7(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),r=new RegExp(n,"g");return i=>i.replace(r,a=>t.get(a)??a)}function hw(e,t,n){const r=t[e];return typeof r!="string"?r:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split("/").map(i=>Xz(i,n)).join("/"):Xz(r,n)}function Zz({path:e,params:t,decoder:n,...r}){let i=!1;const a=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const o=e.length;let c=0,d,f="";for(;c<o;){const p=c;d=LN(e,p,d);const m=d[5];if(c=m+1,p===m)continue;const y=d[0];if(y===0){f+="/"+e.substring(p,m);continue}if(y===2){const v=t._splat;a._splat=v,a["*"]=v;const S=e.substring(p,d[1]),b=e.substring(d[4],m);if(!v){i=!0,(S||b)&&(f+="/"+S+b);continue}const j=hw("_splat",t,n);f+="/"+S+j+b;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const S=e.substring(p,d[1]),b=e.substring(d[4],m),j=hw(v,t,n)??"undefined";f+="/"+S+j+b;continue}if(y===3){const v=e.substring(d[2],d[3]),S=t[v];if(S==null)continue;a[v]=S;const b=e.substring(p,d[1]),j=e.substring(d[4],m),k=hw(v,t,n)??"";f+="/"+b+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function Xz(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Ur(e){return!!e?.isNotFound}function k7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var Kj="tsr-scroll-restoration-v1_3",C7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function A7(){const e=k7();if(!e)return null;const t=e.getItem(Kj);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=jo(r,n)||n;try{e.setItem(Kj,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var _m=A7(),O7=e=>e.state.__TSR_key||e.href;function E7(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 Gg=!1;function _7({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const c=t||window.history.state?.__TSR_key,d=o[c];Gg=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const y=d[m];if(m==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const y=document.getElementById(f);y&&y.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}Gg=!1}function z7(e,t){if(!_m||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!_m))return;e.isScrollRestorationSetup=!0,Gg=!1;const n=e.options.getScrollRestorationKey||O7;window.history.scrollRestoration="manual";const r=i=>{if(Gg||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?a=`[data-scroll-restoration-id="${c}"]`:a=E7(i.target)}const o=n(e.state.location);_m.set(c=>{const d=c[o]||={},f=d[a]||={};if(a==="window")f.scrollX=window.scrollX||0,f.scrollY=window.scrollY||0;else if(a){const p=document.querySelector(a);p&&(f.scrollX=p.scrollLeft||0,f.scrollY=p.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",C7(r,100),!0),e.subscribe("onRendered",i=>{const a=n(i.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(_7({storageKey:Kj,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&_m.set(o=>(o[a]||={},o)))})}function T7(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 P7(e,t=String){const n=new URLSearchParams;for(const r in e){const i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function pw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function R7(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,i]of t.entries()){const a=n[r];a==null?n[r]=pw(i):Array.isArray(a)?a.push(pw(i)):n[r]=[a,pw(i)]}return n}var D7=I7(JSON.parse),M7=L7(JSON.stringify,JSON.parse);function I7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=R7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function L7(e,t){const n=typeof t=="function";function r(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=P7(i,r);return a?`?${a}`:""}}var Ml="__root__";function UN(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 ni(e){return e instanceof Response&&!!e.options}function $7(e){return{input:({url:t})=>{for(const n of e)t=Gj(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=d5(e[n],t);return t}}}function B7(e){const t=u5(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:o})=>{const c=e.caseSensitive?o.pathname:o.pathname.toLowerCase();return c===i?o.pathname="/":c.startsWith(a)&&(o.pathname=o.pathname.slice(n.length)),o},output:({url:o})=>(o.pathname=jg(["/",t,o.pathname]),o)}}function Gj(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 d5(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 fn=(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))(fn||{});function f5({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:c};function r(f,p,m){const y=p.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const S=f.subsTail;if(S!==void 0&&S.version===m&&S.sub===p)return;const b=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:S,nextSub:void 0};v!==void 0&&(v.prevDep=b),y!==void 0?y.nextDep=b:p.deps=b,S!==void 0?S.nextSub=b:f.subs=b}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,S=f.nextSub,b=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,S!==void 0?S.prevSub=b:m.subsTail=b,b!==void 0?b.nextSub=S:(m.subs=S)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const S=y.subs;if(S!==void 0){const b=(f=S).nextSub;b!==void 0&&(m={value:p,prev:m},p=b);continue}}if((f=p)!==void 0){p=f.nextSub;continue}for(;m!==void 0;)if(f=m.value,m=m.prev,f!==void 0){p=f.nextSub;continue e}break}while(!0)}function o(f,p){let m,y=0,v=!1;e:do{const S=f.dep,b=S.flags;if(p.flags&16)v=!0;else if((b&17)===17){if(e(S)){const j=S.subs;j.nextSub!==void 0&&c(j),v=!0}}else if((b&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=S.deps,p=S,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){const j=p.subs,k=j.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=j,v){if(e(p)){k&&c(j),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const E=f.nextDep;if(E!==void 0){f=E;continue e}}return v}while(!0)}function c(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let qN=0,pl=0,Xf=0;const bs=[],{link:pze,unlink:h5,propagate:mze,checkDirty:U7,shallowPropagate:gze}=f5({update(e){return e.depsTail!==void 0?K7(e):G7(e)},notify(e){let t=Xf,n=t;do if(bs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Xf=t;n<--t;){const r=bs[n];bs[n++]=bs[t],bs[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,xv(e)):Y7.call(e)}});function q7(){return qN}function F7(){++qN}function H7(){--qN||Q7()}function K7(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,xv(e)}}function G7(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function V7(e){const t=e.flags;if(t&16||t&32&&U7(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,xv(e)}}else e.flags=2}function Q7(){try{for(;pl<Xf;){const e=bs[pl];bs[pl++]=void 0,V7(e)}}finally{for(;pl<Xf;){const e=bs[pl];bs[pl++]=void 0,e.flags|=10}pl=0,Xf=0}}function Y7(){this.depsTail=void 0,this.flags=0,xv(this);const e=this.subs;e!==void 0&&h5(e)}function xv(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=h5(n,e)}function FN(e,t,n){const r=typeof e=="object",i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}const Vj=[];let Ng=0;const{link:Jz,unlink:W7,propagate:Z7,checkDirty:p5,shallowPropagate:e2}=f5({update(e){return e._update()},notify(e){Vj[Qj++]=e,e.flags&=~fn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=fn.Mutable|fn.Dirty,Vg(e))}});let zm=0,Qj=0,Da;function Vg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=W7(n,e)}function m5(){if(!(q7()>0)){for(;zm<Qj;){const e=Vj[zm];Vj[zm++]=void 0,e.notify()}zm=0,Qj=0}}function g5(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?fn.None:fn.Mutable,get(){return Da!==void 0&&Jz(i,Da,Ng),i._snapshot},subscribe(a){const o=FN(a),c={current:!1},d=X7(()=>{i.get(),c.current?o.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const o=Da,c=Object.is;if(n)Da=i,++Ng,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=fn.Mutable|fn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!c(d,f)?(i._snapshot=f,!0):!1}finally{Da=o,n&&(i.flags&=~fn.RecursedCheck),Vg(i)}}};return n?(i.flags=fn.Mutable|fn.Dirty,i.get=function(){const a=i.flags;if(a&fn.Dirty||a&fn.Pending&&p5(i.deps,i)){if(i._update()){const o=i.subs;o!==void 0&&e2(o)}}else a&fn.Pending&&(i.flags=a&~fn.Pending);return Da!==void 0&&Jz(i,Da,Ng),i._snapshot}):i.set=function(a){if(i._update(a)){const o=i.subs;o!==void 0&&(Z7(o),e2(o),m5())}},i}function X7(e){const t=()=>{const r=Da;Da=n,++Ng,n.depsTail=void 0,n.flags=fn.Watching|fn.RecursedCheck;try{return e()}finally{Da=r,n.flags&=~fn.RecursedCheck,Vg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:fn.Watching|fn.RecursedCheck,notify(){const r=this.flags;r&fn.Dirty||r&fn.Pending&&p5(this.deps,this)?t():this.flags=fn.Watching},stop(){this.flags=fn.None,this.depsTail=void 0,Vg(this)}};return t(),n}class J7{constructor(t){this.atom=g5(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(FN(t))}}class eG{constructor(t){this.atom=g5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(FN(t))}}function tG(e){return typeof e=="function"?new eG(e):new J7(e)}function nG(e){try{F7(),e()}finally{H7(),m5()}}function Jf(e){let t;return nG(()=>{t=e()}),t}var Yj=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},bv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Il=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const o=e.matches[a];if(!o)continue;const c=e.router.getMatch(o.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},t2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(o=>o.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(o=>o.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let o=a;o>=0;o--){const c=e.matches[o];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return o}return n?a:i},No=(e,t,n)=>{if(!(!ni(n)&&!Ur(n)))throw ni(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,r=>({...r,status:ni(n)?"redirected":r.status==="pending"?"success":r.status,context:Il(e,t.index),isFetching:!1,error:n})),Ur(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ni(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},y5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},n2=(e,t,n)=>{const r=Il(e,n);e.updateMatch(t,i=>({...i,context:r}))},Nf=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,No(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(c){n=c,No(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ni(n)&&!Ur(n)&&(e.serialError??=n)},v5=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!bv(e,t)&&(n.options.loader||n.options.beforeLoad||b5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{Yj(e)},i);r._nonReactive.pendingTimeout=a}},rG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;v5(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&No(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},iG=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Hu(()=>{a?.resolve(),a=void 0});const{paramsError:o,searchError:c}=i;o&&Nf(e,n,o,"PARSE_PARAMS"),c&&Nf(e,n,c,"VALIDATE_SEARCH"),v5(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,O=>({...O,isFetching:"beforeLoad",fetchCount:O.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,O=>({...O,isFetching:!1}))};if(!r.options.beforeLoad){Jf(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=Hu();const y={...Il(e,n,!1),...i.__routeContext},{search:v,params:S,cause:b}=i,j=bv(e,t),k={search:v,abortController:d,params:S,preload:j,context:y,location:e.location,navigate:O=>e.router.navigate({...O,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=O=>{if(O===void 0){Jf(()=>{p(),m()});return}(ni(O)||Ur(O))&&(p(),Nf(e,n,O,"BEFORE_LOAD")),Jf(()=>{p(),e.updateMatch(t,z=>({...z,__beforeLoadContext:O})),m()})};let C;try{if(C=r.options.beforeLoad(k),fh(C))return p(),C.catch(O=>{Nf(e,n,O,"BEFORE_LOAD")}).then(E)}catch(O){p(),Nf(e,n,O,"BEFORE_LOAD")}E(C)},aG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),o=()=>iG(e,n,t,i),c=()=>{if(y5(e,n))return;const d=rG(e,n,i);return fh(d)?d.then(o):o()};return a()},sG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,o,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:o,styles:a?.styles}))},x5=(e,t,n,r,i)=>{const a=t[r-1],{params:o,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),p=Il(e,r),m=bv(e,n);return{params:o,deps:c,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},r2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(i7??e.router.isServer)||a.ssr===!0)&&hh(i);const o=i.options.loader,c=typeof o=="function"?o:o?.handler,d=c?.(x5(e,t,n,r,i)),f=!!c&&fh(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),c){const m=f?await d:d;No(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,y=>({...y,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:Il(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(o){let c=o;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Il(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Ur(o)&&await i.options.notFoundComponent?.preload?.(),No(e,e.router.getMatch(n),o);try{i.options.onError?.(o)}catch(f){c=f,No(e,e.router.getMatch(n),f)}!ni(c)&&!Ur(c)&&await hh(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:Il(e,r),status:"error",isFetching:!1}))}}catch(a){const o=e.router.getMatch(n);o&&(o._nonReactive.loaderPromise=void 0),No(e,o,a)}},oG=async(e,t,n)=>{async function r(v,S,b,j,k){const E=Date.now()-S.updatedAt,C=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,O=k.options.shouldReload,z=typeof O=="function"?O(x5(e,t,i,n,k)):O,{status:A,invalid:_}=j,R=E>C&&(!!e.forceStaleReload||j.cause==="enter"||b!==void 0&&b!==j.id);o=A==="success"&&(_||(z??R)),v&&k.options.preload===!1||(o&&!e.sync&&p?(c=!0,(async()=>{try{await r2(e,t,i,n,k);const $=e.router.getMatch(i);$._nonReactive.loaderPromise?.resolve(),$._nonReactive.loadPromise?.resolve(),$._nonReactive.loaderPromise=void 0,$._nonReactive.loadPromise=void 0}catch($){ni($)&&await e.router.navigate($.options)}})()):A!=="success"||o?await r2(e,t,i,n,k):n2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let o=!1,c=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(y5(e,i)){if(!e.router.getMatch(i))return e.matches[n];n2(e,i,n)}else{const v=e.router.getMatch(i),S=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,b=bv(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const j=e.router.getMatch(i),k=j._nonReactive.error||j.error;k&&No(e,j,k),j.status==="pending"&&await r(b,v,S,j,d)}else{const j=b&&!e.router.state.matches.some(E=>E.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=Hu(),j!==k.preload&&e.updateMatch(i,E=>({...E,preload:j})),await r(b,v,S,k,d)}}const m=e.router.getMatch(i);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=c?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):m};async function i2(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&Yj(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=aG(t,y);fh(v)&&await v}catch(v){if(ni(v))throw v;if(Ur(v))r=v;else if(!t.preload)throw v;break}if(t.serialError)break}const i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?t2(t,r):void 0,o=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let y=0;y<o;y++)n.push(oG(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const S=v.reason;if(ni(S))throw S;Ur(S)?c??=S:d??=S}if(d!==void 0)throw d}const f=c??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const y=t2(t,f);Es(y!==void 0);const v=t.matches[y],S=t.router.looseRoutesById[v.routeId],b=t.router.options?.defaultNotFoundComponent;!S.options.notFoundComponent&&b&&(S.options.notFoundComponent=b),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=y,await hh(S,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await hh(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:S}=t.matches[y],b=t.router.looseRoutesById[S];try{const j=sG(t,v,b);if(j){const k=await j;t.updateMatch(v,E=>({...E,...k}))}}catch(j){console.error(`Error executing head for route ${S}:`,j)}}const m=Yj(t);if(fh(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function a2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function hh(e,t=kg){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(r=>{const{id:i,...a}=r.options;Object.assign(e.options,a),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===kg?(()=>{if(e._componentsPromise===void 0){const r=a2(e,kg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():a2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function b5(e){for(const t of kg)if(e.options[t]?.preload)return!0;return!1}var kg=["component","errorComponent","pendingComponent","notFoundComponent"],_o="__TSR_index",s2="popstate",o2="beforeunload";function lG(e){let t=e.getLocation();const n=new Set,r=o=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:o}))},i=o=>{e.notifyOnIndexChange??!0?r(o):t=e.getLocation()},a=async({task:o,navigateOpts:c,...d})=>{if(c?.ignoreBlocker??!1){o();return}const f=e.getBlockers?.()??[],p=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&f.length&&p)for(const m of f){const y=Qg(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}o()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:o=>(n.add(o),()=>{n.delete(o)}),push:(o,c,d)=>{const f=t.state[_o];c=l2(f+1,c),a({task:()=>{e.pushState(o,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:o,state:c})},replace:(o,c,d)=>{const f=t.state[_o];c=l2(f,c),a({task:()=>{e.replaceState(o,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:o,state:c})},go:(o,c)=>{a({task:()=>{e.go(o),i({type:"GO",index:o})},navigateOpts:c,type:"GO"})},back:o=>{a({task:()=>{e.back(o?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:o,type:"BACK"})},forward:o=>{a({task:()=>{e.forward(o?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:o,type:"FORWARD"})},canGoBack:()=>t.state[_o]!==0,createHref:o=>e.createHref(o),block:o=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,o]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==o))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function l2(e,t){t||(t={});const n=HN();return{...t,key:n,__TSR_key:n,[_o]:e}}function cG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,o=R=>i=R,c=(R=>R),d=(()=>Qg(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=HN();t.history.replaceState({[_o]:0,key:R,__TSR_key:R},"")}let f=d(),p,m=!1,y=!1,v=!1,S=!1;const b=()=>f;let j,k;const E=()=>{j&&(_._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),_._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},C=(R,$,F)=>{const q=c($);k||(p=f),f=Qg($,F),j={href:q,state:F,isPush:j?.isPush||R==="push"},k||(k=Promise.resolve().then(()=>E()))},O=R=>{f=d(),_.notify({type:R})},z=async()=>{if(y){y=!1;return}const R=d(),$=R.state[_o]-f.state[_o],F=$===1,q=$===-1,B=!F&&!q||m;m=!1;const V=B?"GO":q?"BACK":"FORWARD",X=B?{type:"GO",index:$}:{type:q?"BACK":"FORWARD"};if(v)v=!1;else{const Z=a();if(typeof document<"u"&&Z.length){for(const H of Z)if(await H.blockerFn({currentLocation:f,nextLocation:R,action:V})){y=!0,t.history.go(1),_.notify(X);return}}}f=d(),_.notify(X)},A=R=>{if(S){S=!1;return}let $=!1;const F=a();if(typeof document<"u"&&F.length)for(const q of F){const B=q.enableBeforeUnload??!0;if(B===!0){$=!0;break}if(typeof B=="function"&&B()===!0){$=!0;break}}if($)return R.preventDefault(),R.returnValue=""},_=lG({getLocation:b,getLength:()=>t.history.length,pushState:(R,$)=>C("push",R,$),replaceState:(R,$)=>C("replace",R,$),back:R=>(R&&(v=!0),S=!0,t.history.back()),forward:R=>{R&&(v=!0),S=!0,t.history.forward()},go:R=>{m=!0,t.history.go(R)},createHref:R=>c(R),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(o2,A,{capture:!0}),t.removeEventListener(s2,z)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(o2,A,{capture:!0}),t.addEventListener(s2,z),t.history.pushState=function(...R){const $=n.apply(t.history,R);return _._ignoreSubscribers||O("PUSH"),$},t.history.replaceState=function(...R){const $=r.apply(t.history,R);return _._ignoreSubscribers||O("REPLACE"),$},_}function uG(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Qg(e,t){const n=uG(e),r=n.indexOf("#"),i=n.indexOf("?"),a=HN();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):"",search:i>-1?n.slice(i,r===-1?void 0:r):"",state:t||{[_o]:0,key:a,__TSR_key:a}}}function HN(){return(Math.random()+1).toString(36).substring(7)}function Ll(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 dG(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var fG=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,r=this.basepath??n?.basepath??"/",i=this.basepath===void 0,a=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=N7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=cG()),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 f;this.resolvePathCache=Hg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=tG(pG(this.latestLocation)),z7(this));let o=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==c||a!==d){this.basepath=c;const f=[],p=u5(c);p&&p!=="/"&&f.push(B7({basepath:c})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:$7(f),this.history&&this.updateLatestLocation(),o=!0}o&&this.__store&&this.__store.setState(f=>({...f,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=v7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&h7(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const j=this.options.parseSearch(d),k=this.options.stringifySearch(j);return{href:c+k+f,publicHref:p,pathname:Sf(c).path,external:!1,searchStr:k,search:hl(n?.search,j),hash:Sf(f.slice(1)).path,state:Cl(n?.state,m)}}const y=new URL(p,this.origin),v=Gj(this.rewrite,y),S=this.options.parseSearch(v.search),b=this.options.stringifySearch(S);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Sf(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:hl(n?.search,S),hash:Sf(v.hash.slice(1)).path,state:Cl(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:o}=i.state;if(a&&(!o||o===this.tempLocationKey)){const c=r(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>j7({base:t,to:BN(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(t,n,r)=>typeof t=="string"?this.matchRoutesInternal({pathname:t,search:n},r):this.matchRoutesInternal(t,n),this.getMatchedRoutes=t=>mG({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(r=>r.status==="pending"),n=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...t,...n]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=t=>{const n=(i={})=>{const a=i._fromLocation||this.pendingBuiltLocation||this.latestLocation,o=this.matchRoutesLightweight(a);i.from;const c=i.unsafeRelative==="path"?a.pathname:i.from??o.fullPath,d=this.resolvePathWithBase(c,"."),f=o.search,p=Object.assign(Object.create(null),o.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,jo(i.params,p)),v=this.getMatchedRoutes(m);let S=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(S=[...S,this.options.notFoundRoute]),Object.keys(y).length>0)for(const $ of S){const F=$.options.params?.stringify??$.options.stringifyParams;if(F)try{Object.assign(y,F(y))}catch{}}const b=t.leaveParams?m:Sf(Zz({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const $={};S.forEach(F=>{if(F.options.validateSearch)try{Object.assign($,Cg(F.options.validateSearch,{...$,...j}))}catch{}}),j=$}j=gG({search:j,dest:i,destRoutes:S,_includeValidateSearch:t._includeValidateSearch}),j=hl(f,j);const k=this.options.stringifySearch(j),E=i.hash===!0?a.hash:i.hash?jo(i.hash,a.hash):void 0,C=E?`#${E}`:"";let O=i.state===!0?a.state:i.state?jo(i.state,a.state):{};O=Cl(a.state,O);const z=`${b}${k}${C}`;let A,_,R=!1;if(this.rewrite){const $=new URL(z,this.origin),F=d5(this.rewrite,$);A=$.href.replace($.origin,""),F.origin!==this.origin?(_=F.href,R=!0):_=F.pathname+F.search+F.hash}else A=u7(z),_=A;return{publicHref:_,href:A,pathname:b,search:j,searchStr:k,state:O,hash:E??"",external:R,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const o=n(i);let c=a?n(a):void 0;if(!c){const d=Object.create(null);if(this.options.routeMasks){const f=p7(o.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,jo(m,d));a={from:t.from,...y,params:v},c=n(a)}}}return c&&(o.maskedLocation=c),o};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Dl(r.state,this.latestLocation.state);return c.forEach(f=>{delete r.state[f]}),d},a=Eo(this.latestLocation.href)===Eo(r.href);let o=this.commitLocationPromise;if(this.commitLocationPromise=Hu(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:d,...f}=r;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:a,href:o,...c}={})=>{if(o){const p=this.history.location.state.__TSR_index,m=Qg(o,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);c.to=Gj(this.rewrite,y).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const d=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let o=!1;if(r)try{new URL(`${r}`),o=!0}catch{}if(o&&!n&&(n=!0),n){if(t!==void 0||!r){const d=this.buildLocation({to:t,...a});r=r??d.publicHref,i=i??d.publicHref}const c=!o&&i?i:r;if(Fg(c,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,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(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const a=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Ll({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Ll({resolvedLocation:f,location:d})}),await i2({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],y=[],v=[];Jf(()=>{this.__store.setState(S=>{const b=S.matches,j=S.pendingMatches||S.matches;return p=b.filter(k=>!j.some(E=>E.id===k.id)),m=b.filter(k=>!j.some(E=>E.routeId===k.routeId)),y=j.filter(k=>!b.some(E=>E.routeId===k.routeId)),v=j.filter(k=>b.some(E=>E.routeId===k.routeId)),{...S,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([S,b])=>{S.forEach(j=>{this.looseRoutesById[j.routeId].options[b]?.(j)})})})})}})}catch(d){ni(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Ur(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.__store.state.matches.some(c=>c.status==="error")&&(o=500),o!==void 0&&this.__store.setState(c=>({...c,statusCode:o}))},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 r;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const i=this.latestLocation,a=this.state.resolvedLocation,o=typeof n.types=="function"?n.types(Ll({resolvedLocation:a,location:i})):n.types;if(o===!1){t();return}r={update:t,types:o}}else r=t;document.startViewTransition(r)}else t()},this.updateMatch=(t,n)=>{this.startTransition(()=>{const r=this.state.pendingMatches?.some(i=>i.id===t)?"pendingMatches":this.state.matches.some(i=>i.id===t)?"matches":this.state.cachedMatches.some(i=>i.id===t)?"cachedMatches":"";r&&(r==="cachedMatches"?this.__store.setState(i=>({...i,cachedMatches:dG(i.cachedMatches.map(a=>a.id===t?n(a):a))})):this.__store.setState(i=>({...i,[r]:i[r]?.map(a=>a.id===t?n(a):a)})))})},this.getMatch=t=>{const n=r=>r.id===t;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=t=>{const n=r=>t?.filter?.(r)??!0?{...r,invalid:!0,...t?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r;return this.__store.setState(r=>({...r,matches:r.matches.map(n),cachedMatches:r.cachedMatches.map(n),pendingMatches:r.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 r=t.options._builtLocation??this.buildLocation(t.options),i=this.getParsedLocationHref(r);t.options.href=i,t.headers.set("Location",i)}else if(n)try{const r=new URL(n);if(this.origin&&r.origin===this.origin){const i=r.pathname+r.search+r.hash;t.options.href=i,t.headers.set("Location",i)}}catch{}if(t.options.href&&!t.options._builtLocation&&Fg(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(r=>({...r,cachedMatches:r.cachedMatches.filter(i=>!n(i))})):this.__store.setState(r=>({...r,cachedMatches:[]}))},this.clearExpiredCache=()=>{const t=n=>{const r=this.looseRoutesById[n.routeId];if(!r.options.loader)return!0;const i=(n.preload?r.options.preloadGcTime??this.options.defaultPreloadGcTime:r.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=i};this.clearCache({filter:t})},this.loadRouteChunk=hh,this.preloadRoute=async t=>{const n=t._builtLocation??this.buildLocation(t);let r=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:t});const i=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(o=>o.id)),a=new Set([...i,...this.state.cachedMatches.map(o=>o.id)]);Jf(()=>{r.forEach(o=>{a.has(o.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,o]}))})});try{return r=await i2({router:this,matches:r,location:n,preload:!0,updateMatch:(o,c)=>{i.has(o)?r=r.map(d=>d.id===o?c(d):d):this.updateMatch(o,c)}}),r}catch(o){if(ni(o))return o.options.reloadDocument?void 0:await this.preloadRoute({...o.options,_fromLocation:n});Ur(o)||console.error(o);return}},this.matchRoute=(t,n)=>{const r={...t,to:t.to?this.resolvePathWithBase(t.from||"",t.to):void 0,params:t.params||{},leaveParams:!0},i=this.buildLocation(r);if(n?.pending&&this.state.status!=="pending")return!1;const a=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,o=m7(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!o||t.params&&!Dl(o.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Dl(a.search,i.search,{partial:!0})?o.rawParams:!1:o.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??M7,parseSearch:e.parseSearch??D7,protocolAllowlist:e.protocolAllowlist??c7}),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 r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}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:r,routeParams:i,parsedParams:a}=n;let{matchedRoutes:o}=n,c=!1;(r?r.path!=="/"&&i["**"]:Eo(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:c=!0);const d=c?vG(this.options.notFoundMode,o):void 0,f=new Array(o.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<o.length;m++){const y=o[m],v=f[m-1];let S,b,j;{const V=v?.search??e.search,X=v?._strictSearch??void 0;try{const Z=Cg(y.options.validateSearch,{...V})??void 0;S={...V,...Z},b={...X,...Z},j=void 0}catch(Z){let H=Z;if(Z instanceof Yg||(H=new Yg(Z.message,{cause:Z})),t?.throwOnError)throw H;S=V,b={},j=H}}const k=y.options.loaderDeps?.({search:S})??"",E=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:O}=Zz({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),z=y.id+C+E,A=this.getMatch(z),_=p.get(y.id),R=A?._strictParams??O;let $;if(!A)try{c2(y,O,a,R)}catch(V){if(Ur(V)||ni(V)?$=V:$=new hG(V.message,{cause:V}),t?.throwOnError)throw $}Object.assign(i,R);const F=_?"stay":"enter";let q;if(A)q={...A,cause:F,params:_?.params??i,_strictParams:R,search:hl(_?_.search:A.search,S),_strictSearch:b};else{const V=y.options.loader||y.options.beforeLoad||y.lazyFn||b5(y)?"pending":"success";q={id:z,ssr:y.options.ssr,index:m,routeId:y.id,params:_?.params??i,_strictParams:R,pathname:C,updatedAt:Date.now(),search:_?hl(_.search,S):S,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:Hu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:_?Cl(_.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(q.globalNotFound=d===y.id),q.searchError=j;const B=this.getParentContext(v);q.context={...B,...q.__routeContext,...q.__beforeLoadContext},f[m]=q}for(let m=0;m<f.length;m++){const y=f[m],v=this.looseRoutesById[y.routeId],S=this.getMatch(y.id),b=p.get(y.routeId);if(y.params=b?hl(b.params,i):i,!S){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const E={deps:y.loaderDeps,params:y.params,context:k??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(E)??void 0}y.context={...k,...y.__routeContext,...y.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=dh(t),a={...e.search};for(const f of t)try{Object.assign(a,Cg(f.options.validateSearch,a))}catch{}const o=dh(this.state.matches),c=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(c)d=o.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{c2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},Yg=class extends Error{},hG=class extends Error{};function pG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Cg(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Yg("Async validation not supported");if(n.issues)throw new Yg(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 mG({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Eo(e);let a,o;const c=g7(i,n,!0);return c&&(a=c.route,Object.assign(r,c.rawParams),o=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function gG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return yG(n)(e,t,r??!1)}function yG(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:o,next:c})=>{let d=o;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),o));const f=c(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:o,next:c})=>{const d=c(o);if(!t._includeValidateSearch)return d;try{return{...d,...Cg(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:jo(a.search,i):{}};t.middlewares.push(n);const r=(i,a,o)=>{if(i>=o.length)return a;const c=o[i];return c({search:a,next:f=>r(i+1,f,o)})};return function(a,o,c){return t.dest=o,t._includeValidateSearch=c,r(0,a,t.middlewares)}}function vG(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const r=t[n];if(r.children)return r.id}return Ml}function c2(e,t,n,r){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(r[a]=n[a]);else{const a=i(r);Object.assign(r,a)}}var xG="Error preloading route! ☝️",w5=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,r=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),r?this._path=Ml:this.parentRoute||Es(!1);let i=r?Ml:n?.path;i&&i!=="/"&&(i=c5(i));const a=n?.id||i;let o=r?Ml:jg([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),o!=="__root__"&&(o=jg(["/",o]));const c=o==="__root__"?"/":jg([this.parentRoute.fullPath,i]);this._path=i,this._id=o,this._fullPath=c,this._to=Eo(c)},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=>UN({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.")}},bG=class extends w5{constructor(e){super(e)}};function KN(e){const t=e.errorComponent??GN;return l.jsx(wG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var wG=class extends x.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 GN({error:e}){const[t,n]=x.useState(!1);return l.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[l.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),l.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),l.jsx("div",{style:{height:".25rem"}}),t?l.jsx("div",{children:l.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?l.jsx("code",{children:e.message}):null})}):null]})}function SG({children:e,fallback:t=null}){return S5()?l.jsx(Hi.Fragment,{children:e}):l.jsx(Hi.Fragment,{children:t})}function S5(){return Hi.useSyncExternalStore(jG,()=>!0,()=>!1)}function jG(){return()=>{}}var j5=x.createContext(null);function Ji(e){const t=x.useContext(j5);return e?.warn,t}var mw={exports:{}},gw={},yw={exports:{}},vw={};var u2;function NG(){if(u2)return vw;u2=1;var e=ld();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,o=e.useDebugValue;function c(m,y){var v=y(),S=r({inst:{value:v,getSnapshot:y}}),b=S[0].inst,j=S[1];return a(function(){b.value=v,b.getSnapshot=y,d(b)&&j({inst:b})},[m,v,y]),i(function(){return d(b)&&j({inst:b}),m(function(){d(b)&&j({inst:b})})},[m]),o(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return vw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,vw}var d2;function kG(){return d2||(d2=1,yw.exports=NG()),yw.exports}var f2;function CG(){if(f2)return gw;f2=1;var e=ld(),t=kG();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,c=e.useMemo,d=e.useDebugValue;return gw.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var S=a(null);if(S.current===null){var b={hasValue:!1,value:null};S.current=b}else b=S.current;S=c(function(){function k(A){if(!E){if(E=!0,C=A,A=y(A),v!==void 0&&b.hasValue){var _=b.value;if(v(_,A))return O=_}return O=A}if(_=O,r(C,A))return _;var R=y(A);return v!==void 0&&v(_,R)?(C=A,_):(C=A,O=R)}var E=!1,C,O,z=m===void 0?null:m;return[function(){return k(p())},z===null?void 0:function(){return k(z())}]},[p,m,y,v]);var j=i(f,S[0],S[1]);return o(function(){b.hasValue=!0,b.value=j},[j]),d(j),j},gw}var h2;function AG(){return h2||(h2=1,mw.exports=CG()),mw.exports}var N5=AG();function OG(e,t){return e===t}function EG(e,t,n=OG){const r=x.useCallback(o=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(o);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return N5.useSyncExternalStoreWithSelector(r,i,i,t,n)}function si(e){const t=Ji({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return EG(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Cl(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var wv=x.createContext(void 0),_G=x.createContext(void 0);function Uo(e){const t=x.useContext(e.from?_G:wv);return si({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Es(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function VN(e){return Uo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function QN(e){const{select:t,...n}=e;return Uo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Bh(e){return Uo({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 Sv(e){return Uo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function qo(e){const t=Ji();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function YN(e){return Uo({...e,select:t=>e.select?e.select(t.context):t.context})}var lc=FL();const zG=ba(lc);function TG(e,t){const n=Ji(),r=r7(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:c,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:S,children:b,target:j,disabled:k,style:E,className:C,onClick:O,onBlur:z,onFocus:A,onMouseEnter:_,onMouseLeave:R,onTouchStart:$,ignoreBlocker:F,params:q,search:B,hash:V,state:X,mask:Z,reloadDocument:H,unsafeRelative:J,from:ue,_fromLocation:we,...I}=e,D=S5(),U=si({select:Ye=>{const ce=Ye.matches[Ye.matches.length-1];return{search:ce?.search,hash:Ye.location.hash,path:ce?.pathname}},structuralSharing:!0}),M=e.from,Q=x.useMemo(()=>({...e,from:M}),[n,U,M,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),oe=x.useMemo(()=>n.buildLocation({...Q}),[n,Q]),ne=oe.maskedLocation?oe.maskedLocation.publicHref:oe.publicHref,Ae=oe.maskedLocation?oe.maskedLocation.external:oe.external,_e=x.useMemo(()=>LG(ne,Ae,n.history,k),[k,Ae,ne,n.history]),ee=x.useMemo(()=>{if(_e?.external)return Fg(_e.href,n.protocolAllowlist)?void 0:_e.href;if(!$G(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Fg(c,n.protocolAllowlist)?void 0:c}catch{}},[c,_e,n.protocolAllowlist]),he=si({select:Ye=>{if(ee)return!1;if(o?.exact){if(!S7(Ye.location.pathname,oe.pathname,n.basepath))return!1}else{const ce=Kg(Ye.location.pathname,n.basepath),Se=Kg(oe.pathname,n.basepath);if(!(ce.startsWith(Se)&&(ce.length===Se.length||ce[Se.length]==="/")))return!1}return(o?.includeSearch??!0)&&!Dl(Ye.location.search,oe.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?D&&Ye.location.hash===oe.hash:!0}}),Ee=he?jo(i,{})??PG:xw,G=he?xw:jo(a,{})??xw,Fe=[C,Ee.className,G.className].filter(Boolean).join(" "),De=(E||Ee.style||G.style)&&{...E,...Ee.style,...G.style},[rt,Qe]=x.useState(!1),en=x.useRef(!1),Ut=e.reloadDocument||ee?!1:d??n.options.defaultPreload,ln=f??n.options.defaultPreloadDelay??0,_t=x.useCallback(()=>{n.preloadRoute({...Q,_builtLocation:oe}).catch(Ye=>{console.warn(Ye),console.warn(xG)})},[n,Q,oe]);n7(r,x.useCallback(Ye=>{Ye?.isIntersecting&&_t()},[_t]),IG,{disabled:!!k||Ut!=="viewport"}),x.useEffect(()=>{en.current||!k&&Ut==="render"&&(_t(),en.current=!0)},[k,_t,Ut]);const be=Ye=>{const ce=Ye.currentTarget.getAttribute("target"),Se=j!==void 0?j:ce;if(!k&&!BG(Ye)&&!Ye.defaultPrevented&&(!Se||Se==="_self")&&Ye.button===0){Ye.preventDefault(),lc.flushSync(()=>{Qe(!0)});const Pe=n.subscribe("onResolved",()=>{Pe(),Qe(!1)});n.navigate({...Q,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:S,ignoreBlocker:F})}};if(ee)return{...I,ref:r,href:ee,...b&&{children:b},...j&&{target:j},...k&&{disabled:k},...E&&{style:E},...C&&{className:C},...O&&{onClick:O},...z&&{onBlur:z},...A&&{onFocus:A},..._&&{onMouseEnter:_},...R&&{onMouseLeave:R},...$&&{onTouchStart:$}};const Je=Ye=>{if(k||Ut!=="intent")return;if(!ln){_t();return}const ce=Ye.currentTarget;if(kf.has(ce))return;const Se=setTimeout(()=>{kf.delete(ce),_t()},ln);kf.set(ce,Se)},zt=Ye=>{k||Ut!=="intent"||_t()},Ct=Ye=>{if(k||!Ut||!ln)return;const ce=Ye.currentTarget,Se=kf.get(ce);Se&&(clearTimeout(Se),kf.delete(ce))};return{...I,...Ee,...G,href:_e?.href,ref:r,onClick:tu([O,be]),onBlur:tu([z,Ct]),onFocus:tu([A,Je]),onMouseEnter:tu([_,Je]),onMouseLeave:tu([R,Ct]),onTouchStart:tu([$,zt]),disabled:!!k,target:j,...De&&{style:De},...Fe&&{className:Fe},...k&&RG,...he&&DG,...D&&rt&&MG}}var xw={},PG={className:"active"},RG={role:"link","aria-disabled":!0},DG={"data-status":"active","aria-current":"page"},MG={"data-transitioning":"transitioning"},kf=new WeakMap,IG={rootMargin:"100px"},tu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function LG(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function $G(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var jt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=TG(r,t),o=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return x.createElement("a",d,o)}return x.createElement(n,a,o)});function BG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var UG=class extends w5{constructor(e){super(e),this.useMatch=t=>Uo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>YN({...t,from:this.id}),this.useSearch=t=>Sv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Bh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>QN({...t,from:this.id}),this.useLoaderData=t=>VN({...t,from:this.id}),this.useNavigate=()=>qo({from:this.fullPath}),this.Link=Hi.forwardRef((t,n)=>l.jsx(jt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function _r(e){return new UG(e)}function qG(){return e=>HG(e)}var FG=class extends bG{constructor(e){super(e),this.useMatch=t=>Uo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>YN({...t,from:this.id}),this.useSearch=t=>Sv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Bh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>QN({...t,from:this.id}),this.useLoaderData=t=>VN({...t,from:this.id}),this.useNavigate=()=>qo({from:this.fullPath}),this.Link=Hi.forwardRef((t,n)=>l.jsx(jt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function HG(e){return new FG(e)}function p2(e){return typeof e=="object"?new m2(e,{silent:!0}).createRoute(e):new m2(e,{silent:!0}).createRoute}var m2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=_r(n);return r.isRoot=!1,r},this.silent=t?.silent}},g2=class{constructor(e){this.useMatch=t=>Uo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>YN({...t,from:this.options.id}),this.useSearch=t=>Sv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Bh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>QN({...t,from:this.options.id}),this.useLoaderData=t=>VN({...t,from:this.options.id}),this.useNavigate=()=>qo({from:Ji().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function y2(e){return typeof e=="object"?new g2(e):t=>new g2({id:e,...t})}function KG(e){const t=si({select:n=>`not-found-${n.location.pathname}-${n.status}`});return l.jsx(KN,{getResetKey:()=>t,onCatch:(n,r)=>{if(Ur(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Ur(n))return e.fallback?.(n);throw n},children:e.children})}function GG(){return l.jsx("p",{children:"Not Found"})}function xu(e){return l.jsx(l.Fragment,{children:e.children})}function k5(e,t,n){return t.options.notFoundComponent?l.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?l.jsx(e.options.defaultNotFoundComponent,{...n}):l.jsx(GG,{})}function VG(){return Ji().isScrollRestoring,null}var C5=x.memo(function({matchId:t}){const n=Ji(),r=si({select:S=>{const b=S.matches.findIndex(k=>k.id===t),j=S.matches[b];return Es(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:S.loadedAt,parentRouteId:S.matches[b-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,o=a?l.jsx(a,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?x.Suspense:xu,y=c?KN:xu,v=f?KG:xu;return l.jsxs(i.isRoot?i.options.shellComponent??xu:xu,{children:[l.jsx(wv.Provider,{value:t,children:l.jsx(m,{fallback:o,children:l.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:c||GN,onCatch:(S,b)=>{if(Ur(S))throw S;d?.(S,b)},children:l.jsx(v,{fallback:S=>{if(!f||S.routeId&&S.routeId!==r.routeId||!S.routeId&&!i.isRoot)throw S;return x.createElement(f,S)},children:p||r._displayPending?l.jsx(SG,{fallback:o,children:l.jsx(v2,{matchId:t})}):l.jsx(v2,{matchId:t})})})})}),r.parentRouteId===Ml&&n.options.scrollRestoration?l.jsxs(l.Fragment,{children:[l.jsx(QG,{}),l.jsx(VG,{})]}):null]})});function QG(){const e=Ji(),t=x.useRef(void 0);return l.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Ll(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var v2=x.memo(function({matchId:t}){const n=Ji(),{match:r,key:i,routeId:a}=si({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),o=n.routesById[a],c=x.useMemo(()=>{const d=o.options.component??n.options.defaultComponent;return d?l.jsx(d,{},i):l.jsx(WN,{})},[i,o.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=o.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=Hu();f._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),f._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return Es(Ur(r.error)),k5(n,o,r.error);if(r.status==="redirected")throw Es(ni(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),WN=x.memo(function(){const t=Ji(),n=x.useContext(wv),r=si({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=si({select:f=>{const p=f.matches.find(m=>m.id===n);return Es(p),p.globalNotFound}}),o=si({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?l.jsx(t.options.defaultPendingComponent,{}):null;if(a)return k5(t,i,void 0);if(!o)return null;const d=l.jsx(C5,{matchId:o});return r===Ml?l.jsx(x.Suspense,{fallback:c,children:d}):d});function YG(){const e=Ji(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=si({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),o=cw(a),c=a||n||i,d=cw(c),f=a||i,p=cw(f);return e.startTransition=m=>{r(!0),x.startTransition(()=>{m(),r(!1)})},x.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Eo(e.latestLocation.publicHref)!==Eo(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),Em(()=>{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(y){console.error(y)}})()},[e]),Em(()=>{o&&!a&&e.emit({type:"onLoad",...Ll(e.state)})},[o,e,a]),Em(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Ll(e.state)})},[f,p,e]),Em(()=>{if(d&&!c){const m=Ll(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&T7(e)}},[c,d,e]),null}function WG(){const e=Ji(),t=e.routesById[Ml].options.pendingComponent??e.options.defaultPendingComponent,n=t?l.jsx(t,{}):null,r=l.jsxs(typeof document<"u"&&e.ssr?xu:x.Suspense,{fallback:n,children:[l.jsx(YG,{}),l.jsx(ZG,{})]});return e.options.InnerWrap?l.jsx(e.options.InnerWrap,{children:r}):r}function ZG(){const e=Ji(),t=si({select:i=>i.matches[0]?.id}),n=si({select:i=>i.loadedAt}),r=t?l.jsx(C5,{matchId:t}):null;return l.jsx(wv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:l.jsx(KN,{getResetKey:()=>n,errorComponent:GN,onCatch:void 0,children:r})})}var XG=e=>new JG(e),JG=class extends fG{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=p2,globalThis.createLazyFileRoute=y2):typeof window<"u"&&(window.createFileRoute=p2,window.createLazyFileRoute=y2);function eV({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=l.jsx(j5.Provider,{value:e,children:t});return e.options.Wrap?l.jsx(e.options.Wrap,{children:r}):r}function tV({router:e,...t}){return l.jsx(eV,{router:e,...t,children:l.jsx(WG,{})})}function A5(e){return si({select:t=>t.location})}class Or extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function nV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const O5=nV();function rV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function iV(e){return`${rV()}${e}`}function aV(e,t){if(t===404)return"Health endpoint returned 404. Check basePath or reverse-proxy configuration and make sure the dashboard reaches /health instead of an API-prefixed route."}function sV(){return""}function bw(){return!!sV()}let E5=null;function x2(e){E5=e}function _5(){E5?.()}async function Ce(e,t){const n=t?.body!=null,r=await fetch(`${O5}${e}`,{...t,credentials:t?.credentials??"same-origin",headers:{...n?{"Content-Type":"application/json"}:{},...t?.headers}});if(!r.ok){const i=await r.text();let a=`API ${r.status}: ${r.statusText}`,o;if(i)try{const c=JSON.parse(i);typeof c.error=="string"?a=c.error:c.error?.message?(a=c.error.message,o=c.error.code):c.message&&(a=c.message)}catch{a=i}throw(r.status===401||r.status===403)&&!e.startsWith("/session")&&_5(),new Or(a,r.status,o)}if(r.status!==204)return r.json()}function jv(){return Ce("/projects")}function z5(e){return Ce(`/projects/${encodeURIComponent(e)}`)}function T5(){return Ce("/runs")}function oV(e){return Ce(`/projects/${encodeURIComponent(e)}/runs`)}function Kl(e){return Ce(`/runs/${encodeURIComponent(e)}`)}function lV(e){return Ce(`/projects/${encodeURIComponent(e)}/queries`)}function P5(e){return Ce(`/projects/${encodeURIComponent(e)}/competitors`)}function R5(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Ce(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function cV(e,t){const r=new URLSearchParams().toString();return Ce(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function Nv(e,t){return Ce(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function uV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function dV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function D5(e,t){return Ce(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function b2(e,t){const n=await z5(e);return Nv(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 fV(e,t){const n=await z5(e);return Nv(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 hV(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),Ce(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function pV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function mV(e,t){await Ce(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function gV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function yV(e){await Ce(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function vV(e){return Ce(`/projects/${encodeURIComponent(e)}/export`)}function ZN(){return Ce("/settings")}function w2(){return Ce("/session")}function xV(e){return Ce("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function bV(e){return Ce("/session",{method:"POST",body:JSON.stringify({password:e})})}function wV(e,t){return Ce(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function SV(e){return Ce("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function jV(e){try{return await Ce(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof Or&&t.statusCode===404)return null;throw t}}function S2(e,t){return Ce(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function NV(e){await Ce(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function kV(e){return Ce(`/projects/${encodeURIComponent(e)}/notifications`)}function CV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function AV(e,t){await Ce(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function OV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function EV(e,t,n){return Ce(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function _V(e){return Ce("/apply",{method:"POST",body:JSON.stringify(e)})}function zV(e){return Ce("/runs",{method:"POST",body:JSON.stringify(e??{})})}function M5(e){return Ce(`/projects/${encodeURIComponent(e)}/google/connections`)}function TV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function PV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function RV(e){return Ce(`/projects/${encodeURIComponent(e)}/google/properties`)}function DV(e,t,n){return Ce(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function MV(e,t,n){return Ce(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function I5(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function IV(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.offset!==void 0&&t.offset>0&&n.set("offset",String(t.offset));const r=n.toString()?`?${n.toString()}`:"";return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function LV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function $V(e,t){const n=new URLSearchParams;t?.url&&n.set("url",t.url),n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function BV(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function XN(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function UV(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function qV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function FV(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function HV(e){return Ce(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function j2(){return Ce("/cdp/status")}function KV(e,t){return Ce("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function N2(e,t){return Ce(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function L5(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/status`)}function GV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function VV(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function QV(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/sites`)}function YV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function JN(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function $5(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ce(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function B5(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function WV(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/inspect-sitemap`,{method:"POST",body:void 0})}function k2(e,t){return Ce(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function ZV(e){return Ce(`/projects/${encodeURIComponent(e)}/bing/performance`)}function XV(e){return Ce("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function JV(e){return Ce(`/projects/${encodeURIComponent(e)}/report`)}function eQ(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function tQ(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${O5}/projects/${encodeURIComponent(e)}/report.html?${n.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new Or(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),o=eQ(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,c=document.createElement("a");c.href=a,c.download=o,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(a)}function nQ(e){return Ce(`/projects/${encodeURIComponent(e)}/ga/status`)}function rQ(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Ce(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function U5(e,t){return Ce(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function iQ(e,t){return Ce(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function aQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ce(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function sQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ce(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function oQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ce(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function lQ(e){return Ce(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function cQ(e){return Ce(`/projects/${encodeURIComponent(e)}/traffic/sources`)}function uQ(e){return Ce(`/projects/${encodeURIComponent(e)}/traffic/status`)}function q5(e,t){return Ce(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}`)}function dQ(e,t){const n={};t?.since&&(n.since=t.since),t?.until&&(n.until=t.until),t?.kind&&(n.kind=t.kind),t?.sourceId&&(n.sourceId=t.sourceId),t?.limit!==void 0&&(n.limit=String(t.limit));const r=Object.keys(n).length?"?"+new URLSearchParams(n).toString():"";return Ce(`/projects/${encodeURIComponent(e)}/traffic/events${r}`)}function fQ(e,t){return Ce(`/projects/${encodeURIComponent(e)}/traffic/connect/cloud-run`,{method:"POST",body:JSON.stringify(t)})}function hQ(e,t,n){return Ce(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}/sync`,{method:"POST",body:JSON.stringify(n??{})})}function pQ(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return Ce(`/projects/${encodeURIComponent(e)}/insights${n}`)}function mQ(e){return Ce(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function gQ(e,t){const n=iV(e);try{const r=await fetch(n,{credentials:"same-origin"});if(!r.ok)return{label:t,state:"error",detail:`${t} ${r.status}: ${r.statusText}`,statusCode:r.status,hint:aV(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",o=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,c=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,o===!1?"database not configured":"database configured",c?`heartbeat ${c}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:o,lastHeartbeatAt:c}}catch(r){return{label:t,state:"error",detail:r instanceof Error?r.message:"unreachable",hint:e==="/health"?`Request failed while checking ${n}. If this instance is served behind a sub-path, verify the dashboard basePath and reverse-proxy rewrites.`:void 0}}}function yQ(){return Ce("/backlinks/status")}function vQ(){return Ce("/backlinks/install",{method:"POST"})}function F5(){return Ce("/backlinks/syncs/latest")}function xQ(){return Ce("/backlinks/syncs")}function bQ(e){return Ce("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function wQ(){return Ce("/backlinks/releases")}function SQ(){return Ce("/backlinks/latest-release")}function jQ(e){return Ce(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function NQ(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return Ce(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function kQ(e,t={}){const n=new URLSearchParams;t.limit!==void 0&&n.set("limit",String(t.limit)),t.offset!==void 0&&n.set("offset",String(t.offset)),t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return Ce(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function CQ(e){return Ce(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function AQ(e,t){return Ce(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const OQ=6e3,EQ=5,_Q=180;let Nr=[],zQ=0;const Wj=new Set,Zj=new Map,Xj=new Map;function Wg(){const e=[...Nr];for(const t of Wj)t(e)}function ek(e){const t=Zj.get(e);t&&(clearTimeout(t),Zj.delete(e));const n=Xj.get(e);n&&(clearTimeout(n),Xj.delete(e))}function H5(e){ek(e);const t=Nr.length;Nr=Nr.filter(n=>n.id!==e),Nr.length!==t&&Wg()}function C2(e){ek(e.id),Zj.set(e.id,setTimeout(()=>{Jj(e.id)},e.durationMs))}function TQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function gt(e,t="negative",n=OQ){const r=TQ(e,t,n),i={id:String(++zQ),title:r.title,detail:r.detail,tone:r.tone??t,durationMs:r.durationMs??n,dedupeKey:r.dedupeKey,cta:r.cta,state:"open"};if(r.dedupeKey){const a=Nr.find(o=>o.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const o={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return Nr=Nr.map(c=>c.id===a.id?o:c),Wg(),C2(o),a.id}}return Nr.length>=EQ&&H5(Nr[0].id),Nr=[...Nr,i],Wg(),C2(i),i.id}function Jj(e){const t=Nr.find(n=>n.id===e);!t||t.state==="closing"||(ek(e),Nr=Nr.map(n=>n.id===e?{...n,state:"closing"}:n),Wg(),Xj.set(e,setTimeout(()=>{H5(e)},_Q)))}function PQ(e){return Wj.add(e),()=>{Wj.delete(e)}}function A2(){return Nr}const RQ=5*6e4,K5=30*6e4,ws=3e4,kr=6e4,e1=3e4;function DQ(){return new WK({defaultOptions:{queries:{staleTime:RQ,retry:1,refetchOnWindowFocus:!1}},mutationCache:new ZL({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||gt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const MQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),IQ=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),O2=e=>{const t=IQ(e);return t.charAt(0).toUpperCase()+t.slice(1)},G5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),LQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var $Q={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 BQ=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:o,...c},d)=>x.createElement("svg",{ref:d,...$Q,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:G5("lucide",i),...!a&&!LQ(c)&&{"aria-hidden":"true"},...c},[...o.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const xt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(BQ,{ref:a,iconNode:t,className:G5(`lucide-${MQ(O2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=O2(e),n};const UQ=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],E2=xt("arrow-left",UQ);const qQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],FQ=xt("arrow-up",qQ);const HQ=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],KQ=xt("book-open",HQ);const GQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],V5=xt("check",GQ);const VQ=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],QQ=xt("chevron-down",VQ);const YQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Uh=xt("chevron-right",YQ);const WQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],ZQ=xt("circle-alert",WQ);const XQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q5=xt("circle-check",XQ);const JQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Y5=xt("circle-question-mark",JQ);const eY=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],tY=xt("copy",eY);const nY=[["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"}]],kv=xt("download",nY);const rY=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],iY=xt("external-link",rY);const aY=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],sY=xt("file-text",aY);const oY=[["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"}]],lY=xt("github",oY);const cY=[["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"}]],uY=xt("globe",cY);const dY=[["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"}]],fY=xt("layout-dashboard",dY);const hY=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],W5=xt("link-2",hY);const pY=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Z5=xt("loader-circle",pY);const mY=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],gY=xt("maximize-2",mY);const yY=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],vY=xt("menu",yY);const xY=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],bY=xt("minimize-2",xY);const wY=[["path",{d:"M5 12h14",key:"1ays0h"}]],SY=xt("minus",wY);const jY=[["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"}]],Zg=xt("play",jY);const NY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xg=xt("plus",NY);const kY=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],CY=xt("radar",kY);const AY=[["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"}]],Jg=xt("refresh-cw",AY);const OY=[["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"}]],EY=xt("rocket",OY);const _Y=[["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"}]],X5=xt("rotate-ccw",_Y);const zY=[["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"}]],TY=xt("settings",zY);const PY=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],_2=xt("sparkles",PY);const RY=[["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"}]],J5=xt("trash-2",RY);const DY=[["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"}]],ey=xt("triangle-alert",DY);const MY=[["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"}]],IY=xt("unplug",MY);const LY=[["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"}]],$Y=xt("upload",LY);const BY=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],UY=xt("wrench",BY);const qY=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],cd=xt("x",qY);function ye(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:o,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const f=o.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in c||(c[y]=f[y].bind(c))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(c){var d;const f=n?.Parent?new a:this;r(f,c),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class zu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class e4 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const t4={};function Do(e){return t4}function n4(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function t1(e,t){return typeof t=="bigint"?t.toString():t}function Cv(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function tk(e){return e==null}function nk(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function FY(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const d=r.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return o%c/10**a}const z2=Symbol("evaluating");function It(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==z2)return r===void 0&&(r=z2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function cc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function T2(e){return JSON.stringify(e)}function HY(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const r4="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ph(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const KY=Cv(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ku(e){if(ph(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ph(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function i4(e){return Ku(e)?{...e}:Array.isArray(e)?[...e]:e}const GY=new Set(["string","number","symbol"]);function Gu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ho(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function qe(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 VY(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const QY={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 YY(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=Fo(e._zod.def,{get shape(){const o={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(o[c]=n.shape[c])}return cc(this,"shape",o),o},checks:[]});return Ho(e,a)}function WY(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Fo(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete o[c]}return cc(this,"shape",o),o},checks:[]});return Ho(e,a)}function ZY(e,t){if(!Ku(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Fo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return cc(this,"shape",a),a}});return Ho(e,i)}function XY(e,t){if(!Ku(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Fo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return cc(this,"shape",r),r}});return Ho(e,n)}function JY(e,t){const n=Fo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return cc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Ho(e,n)}function eW(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=Fo(t._zod.def,{get shape(){const c=t._zod.def.shape,d={...c};if(n)for(const f in n){if(!(f in c))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:c[f]}):c[f])}else for(const f in c)d[f]=e?new e({type:"optional",innerType:c[f]}):c[f];return cc(this,"shape",d),d},checks:[]});return Ho(t,o)}function tW(e,t,n){const r=Fo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return cc(this,"shape",a),a}});return Ho(t,r)}function wu(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 Su(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Tm(e){return typeof e=="string"?e:e?.message}function Mo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Tm(e.inst?._zod.def?.error?.(e))??Tm(t?.error?.(e))??Tm(n.customError?.(e))??Tm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function rk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function mh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const a4=(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,t1,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},s4=ye("$ZodError",a4),o4=ye("$ZodError",a4,{Parent:Error});function nW(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function rW(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(o=>r({issues:o}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let o=n,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(a))):o[d]=o[d]||{_errors:[]},o=o[d],c++}}};return r(e),n}const ik=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new zu;if(o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>Mo(d,a,Do())));throw r4(c,i?.callee),c}return o.value},ak=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const c=new(i?.Err??e)(o.issues.map(d=>Mo(d,a,Do())));throw r4(c,i?.callee),c}return o.value},Av=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new zu;return a.issues.length?{success:!1,error:new(e??s4)(a.issues.map(o=>Mo(o,i,Do())))}:{success:!0,data:a.value}},iW=Av(o4),Ov=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>Mo(o,i,Do())))}:{success:!0,data:a.value}},aW=Ov(o4),sW=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ik(e)(t,n,i)},oW=e=>(t,n,r)=>ik(e)(t,n,r),lW=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ak(e)(t,n,i)},cW=e=>async(t,n,r)=>ak(e)(t,n,r),uW=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Av(e)(t,n,i)},dW=e=>(t,n,r)=>Av(e)(t,n,r),fW=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ov(e)(t,n,i)},hW=e=>async(t,n,r)=>Ov(e)(t,n,r),pW=/^[cC][^\s-]{8,}$/,mW=/^[0-9a-z]+$/,gW=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,yW=/^[0-9a-vA-V]{20}$/,vW=/^[A-Za-z0-9]{27}$/,xW=/^[a-zA-Z0-9_-]{21}$/,bW=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wW=/^([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})$/,P2=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)$/,SW=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,jW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function NW(){return new RegExp(jW,"u")}const kW=/^(?:(?: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])$/,CW=/^(([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}|:))$/,AW=/^((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])$/,OW=/^(([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])$/,EW=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,l4=/^[A-Za-z0-9_-]*$/,_W=/^\+[1-9]\d{6,14}$/,c4="(?:(?:\\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])))",zW=new RegExp(`^${c4}$`);function u4(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 TW(e){return new RegExp(`^${u4(e)}$`)}function PW(e){const t=u4({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${c4}T(?:${r})$`)}const RW=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},DW=/^-?\d+$/,d4=/^-?\d+(?:\.\d+)?$/,MW=/^(?:true|false)$/i,IW=/^[^A-Z]*$/,LW=/^[^a-z]*$/,ui=ye("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),f4={number:"number",bigint:"bigint",object:"date"},h4=ye("$ZodCheckLessThan",(e,t)=>{ui.init(e,t);const n=f4[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),p4=ye("$ZodCheckGreaterThan",(e,t)=>{ui.init(e,t);const n=f4[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$W=ye("$ZodCheckMultipleOf",(e,t)=>{ui.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.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):FY(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})}}),BW=ye("$ZodCheckNumberFormat",(e,t)=>{ui.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=QY[t.format];e._zod.onattach.push(o=>{const c=o._zod.bag;c.format=t.format,c.minimum=i,c.maximum=a,n&&(c.pattern=DW)}),e._zod.check=o=>{const c=o.value;if(n){if(!Number.isInteger(c)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&o.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>a&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),UW=ye("$ZodCheckMaxLength",(e,t)=>{var n;ui.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!tk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=rk(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),qW=ye("$ZodCheckMinLength",(e,t)=>{var n;ui.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!tk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=rk(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),FW=ye("$ZodCheckLengthEquals",(e,t)=>{var n;ui.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!tk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const o=rk(i),c=a>t.length;r.issues.push({origin:o,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ev=ye("$ZodCheckStringFormat",(e,t)=>{var n,r;ui.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),HW=ye("$ZodCheckRegex",(e,t)=>{Ev.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})}}),KW=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=IW),Ev.init(e,t)}),GW=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=LW),Ev.init(e,t)}),VW=ye("$ZodCheckIncludes",(e,t)=>{ui.init(e,t);const n=Gu(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),QW=ye("$ZodCheckStartsWith",(e,t)=>{ui.init(e,t);const n=new RegExp(`^${Gu(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),YW=ye("$ZodCheckEndsWith",(e,t)=>{ui.init(e,t);const n=new RegExp(`.*${Gu(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),WW=ye("$ZodCheckOverwrite",(e,t)=>{ui.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ZW{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 r=t.split(`
|
|
10
|
+
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
11
|
+
`))}}const XW={major:4,minor:3,patch:6},yn=ye("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=XW;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,c,d)=>{let f=wu(o),p;for(const m of c){if(m._zod.def.when){if(!m._zod.def.when(o))continue}else if(f)continue;const y=o.issues.length,v=m._zod.check(o);if(v instanceof Promise&&d?.async===!1)throw new zu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,o.issues.length!==y&&(f||(f=wu(o,y)))});else{if(o.issues.length===y)continue;f||(f=wu(o,y))}}return p?p.then(()=>o):o},a=(o,c,d)=>{if(wu(o))return o.aborted=!0,o;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new zu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(o,c)=>{if(c.skipChecks)return e._zod.parse(o,c);if(c.direction==="backward"){const f=e._zod.parse({value:o.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,o,c)):a(f,o,c)}const d=e._zod.parse(o,c);if(d instanceof Promise){if(c.async===!1)throw new zu;return d.then(f=>i(f,r,c))}return i(d,r,c)}}It(e,"~standard",()=>({validate:i=>{try{const a=iW(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return aW(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),sk=ye("$ZodString",(e,t)=>{yn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??RW(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),pn=ye("$ZodStringFormat",(e,t)=>{Ev.init(e,t),sk.init(e,t)}),JW=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=wW),pn.init(e,t)}),eZ=ye("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=P2(r))}else t.pattern??(t.pattern=P2());pn.init(e,t)}),tZ=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=SW),pn.init(e,t)}),nZ=ye("$ZodURL",(e,t)=>{pn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),rZ=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=NW()),pn.init(e,t)}),iZ=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xW),pn.init(e,t)}),aZ=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pW),pn.init(e,t)}),sZ=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mW),pn.init(e,t)}),oZ=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gW),pn.init(e,t)}),lZ=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=yW),pn.init(e,t)}),cZ=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vW),pn.init(e,t)}),uZ=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=PW(t)),pn.init(e,t)}),dZ=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zW),pn.init(e,t)}),fZ=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=TW(t)),pn.init(e,t)}),hZ=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bW),pn.init(e,t)}),pZ=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=kW),pn.init(e,t),e._zod.bag.format="ipv4"}),mZ=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=CW),pn.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})}}}),gZ=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=AW),pn.init(e,t)}),yZ=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=OW),pn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function m4(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const vZ=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=EW),pn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{m4(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function xZ(e){if(!l4.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return m4(n)}const bZ=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=l4),pn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{xZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),wZ=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=_W),pn.init(e,t)});function SZ(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const jZ=ye("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{SZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),g4=ye("$ZodNumber",(e,t)=>{yn.init(e,t),e._zod.pattern=e._zod.bag.pattern??d4,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),NZ=ye("$ZodNumberFormat",(e,t)=>{BW.init(e,t),g4.init(e,t)}),kZ=ye("$ZodBoolean",(e,t)=>{yn.init(e,t),e._zod.pattern=MW,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),CZ=ye("$ZodUnknown",(e,t)=>{yn.init(e,t),e._zod.parse=n=>n}),AZ=ye("$ZodNever",(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function R2(e,t,n){e.issues.length&&t.issues.push(...Su(n,e.issues)),t.value[n]=e.value}const OZ=ye("$ZodArray",(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const c=i[o],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?a.push(d.then(f=>R2(f,n,o))):R2(d,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function ty(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Su(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function y4(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=VY(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function v4(e,t,n,r,i,a){const o=[],c=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(c.has(m))continue;if(f==="never"){o.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>ty(v,n,m,t,p))):ty(y,n,m,t,p)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const EZ=ye("$ZodObject",(e,t)=>{if(yn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Cv(()=>y4(t));It(e._zod,"propValues",()=>{const c=t.shape,d={};for(const f in c){const p=c[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=ph,a=t.catchall;let o;e._zod.parse=(c,d)=>{o??(o=r.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value={};const p=[],m=o.shape;for(const y of o.keys){const v=m[y],S=v._zod.optout==="optional",b=v._zod.run({value:f[y],issues:[]},d);b instanceof Promise?p.push(b.then(j=>ty(j,c,y,f,S))):ty(b,c,y,f,S)}return a?v4(p,f,c,d,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),_Z=ye("$ZodObjectJIT",(e,t)=>{EZ.init(e,t);const n=e._zod.parse,r=Cv(()=>y4(t)),i=y=>{const v=new ZW(["shape","payload","ctx"]),S=r.value,b=C=>{const O=T2(C);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const C of S.keys)j[C]=`key_${k++}`;v.write("const newResult = {};");for(const C of S.keys){const O=j[C],z=T2(C),_=y[C]?._zod?.optout==="optional";v.write(`const ${O} = ${b(C)};`),_?v.write(`
|
|
12
|
+
if (${O}.issues.length) {
|
|
13
|
+
if (${z} in input) {
|
|
14
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
15
|
+
...iss,
|
|
16
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (${O}.value === undefined) {
|
|
22
|
+
if (${z} in input) {
|
|
23
|
+
newResult[${z}] = undefined;
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
newResult[${z}] = ${O}.value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`):v.write(`
|
|
30
|
+
if (${O}.issues.length) {
|
|
31
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
32
|
+
...iss,
|
|
33
|
+
path: iss.path ? [${z}, ...iss.path] : [${z}]
|
|
34
|
+
})));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (${O}.value === undefined) {
|
|
38
|
+
if (${z} in input) {
|
|
39
|
+
newResult[${z}] = undefined;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
newResult[${z}] = ${O}.value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(C,O)=>E(y,C,O)};let a;const o=ph,c=!t4.jitless,f=c&&KY.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const S=y.value;return o(S)?c&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?v4([],S,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),y)}});function D2(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!wu(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(o=>Mo(o,r,Do())))}),t)}const x4=ye("$ZodUnion",(e,t)=>{yn.init(e,t),It(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),It(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),It(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),It(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>nk(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1;const c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)c.push(f),o=!0;else{if(f.issues.length===0)return f;c.push(f)}}return o?Promise.all(c).then(d=>D2(d,i,e,a)):D2(c,i,e,a)}}),zZ=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,x4.init(e,t);const n=e._zod.parse;It(e._zod,"propValues",()=>{const i={};for(const a of t.options){const o=a._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[c,d]of Object.entries(o)){i[c]||(i[c]=new Set);for(const f of d)i[c].add(f)}}return i});const r=Cv(()=>{const i=t.options,a=new Map;for(const o of i){const c=o._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const d of c){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,o)}}return a});e._zod.parse=(i,a)=>{const o=i.value;if(!ph(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const c=r.value.get(o?.[t.discriminator]);return c?c._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),TZ=ye("$ZodIntersection",(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([d,f])=>M2(n,d,f)):M2(n,a,o)}});function n1(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(Ku(e)&&Ku(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of r){const o=n1(e[a],t[a]);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i[a]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],a=t[r],o=n1(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function M2(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const a=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&i&&e.issues.push({...i,keys:a}),wu(e))return e;const o=n1(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const PZ=ye("$ZodRecord",(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Ku(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],o=t.keyType._zod.values;if(o){n.value={};const c=new Set;for(const f of o)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Su(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Su(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&d4.test(c)&&d.issues.length){const m=t.keyType._zod.run({value:Number(c),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Mo(m,r,Do())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Su(c,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Su(c,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),RZ=ye("$ZodEnum",(e,t)=>{yn.init(e,t);const n=n4(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>GY.has(typeof i)).map(i=>typeof i=="string"?Gu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),DZ=ye("$ZodLiteral",(e,t)=>{if(yn.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(r=>typeof r=="string"?Gu(r):r?Gu(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),MZ=ye("$ZodTransform",(e,t)=>{yn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new e4(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new zu;return n.value=i,n}});function I2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const b4=ye("$ZodOptional",(e,t)=>{yn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${nk(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>I2(a,n.value)):I2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),IZ=ye("$ZodExactOptional",(e,t)=>{b4.init(e,t),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),LZ=ye("$ZodNullable",(e,t)=>{yn.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${nk(n.source)}|null)$`):void 0}),It(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),$Z=ye("$ZodDefault",(e,t)=>{yn.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>L2(a,t)):L2(i,t)}});function L2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const BZ=ye("$ZodPrefault",(e,t)=>{yn.init(e,t),e._zod.optin="optional",It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),UZ=ye("$ZodNonOptional",(e,t)=>{yn.init(e,t),It(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>$2(a,e)):$2(i,e)}});function $2(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 qZ=ye("$ZodCatch",(e,t)=>{yn.init(e,t),It(e._zod,"optin",()=>t.innerType._zod.optin),It(e._zod,"optout",()=>t.innerType._zod.optout),It(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(o=>Mo(o,r,Do()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Mo(a,r,Do()))},input:n.value}),n.issues=[]),n)}}),FZ=ye("$ZodPipe",(e,t)=>{yn.init(e,t),It(e._zod,"values",()=>t.in._zod.values),It(e._zod,"optin",()=>t.in._zod.optin),It(e._zod,"optout",()=>t.out._zod.optout),It(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(o=>Pm(o,t.in,r)):Pm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>Pm(a,t.out,r)):Pm(i,t.out,r)}});function Pm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const HZ=ye("$ZodReadonly",(e,t)=>{yn.init(e,t),It(e._zod,"propValues",()=>t.innerType._zod.propValues),It(e._zod,"values",()=>t.innerType._zod.values),It(e._zod,"optin",()=>t.innerType?._zod?.optin),It(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(B2):B2(i)}});function B2(e){return e.value=Object.freeze(e.value),e}const KZ=ye("$ZodCustom",(e,t)=>{ui.init(e,t),yn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(a=>U2(a,n,r,e));U2(i,n,r,e)}});function U2(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(mh(i))}}var q2;class GZ{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.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 r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function VZ(){return new GZ}(q2=globalThis).__zod_globalRegistry??(q2.__zod_globalRegistry=VZ());const Gf=globalThis.__zod_globalRegistry;function QZ(e,t){return new e({type:"string",...qe(t)})}function YZ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function F2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function WZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function ZZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function XZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function JZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function eX(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function tX(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function nX(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function rX(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function iX(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function aX(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function sX(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function oX(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function lX(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function cX(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function uX(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function dX(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function fX(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function hX(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function pX(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function mX(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}function gX(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function yX(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function vX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function xX(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function bX(e,t){return new e({type:"number",checks:[],...qe(t)})}function wX(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function SX(e,t){return new e({type:"boolean",...qe(t)})}function jX(e){return new e({type:"unknown"})}function NX(e,t){return new e({type:"never",...qe(t)})}function H2(e,t){return new h4({check:"less_than",...qe(t),value:e,inclusive:!1})}function ww(e,t){return new h4({check:"less_than",...qe(t),value:e,inclusive:!0})}function K2(e,t){return new p4({check:"greater_than",...qe(t),value:e,inclusive:!1})}function Sw(e,t){return new p4({check:"greater_than",...qe(t),value:e,inclusive:!0})}function G2(e,t){return new $W({check:"multiple_of",...qe(t),value:e})}function w4(e,t){return new UW({check:"max_length",...qe(t),maximum:e})}function ny(e,t){return new qW({check:"min_length",...qe(t),minimum:e})}function S4(e,t){return new FW({check:"length_equals",...qe(t),length:e})}function kX(e,t){return new HW({check:"string_format",format:"regex",...qe(t),pattern:e})}function CX(e){return new KW({check:"string_format",format:"lowercase",...qe(e)})}function AX(e){return new GW({check:"string_format",format:"uppercase",...qe(e)})}function OX(e,t){return new VW({check:"string_format",format:"includes",...qe(t),includes:e})}function EX(e,t){return new QW({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function _X(e,t){return new YW({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function ud(e){return new WW({check:"overwrite",tx:e})}function zX(e){return ud(t=>t.normalize(e))}function TX(){return ud(e=>e.trim())}function PX(){return ud(e=>e.toLowerCase())}function RX(){return ud(e=>e.toUpperCase())}function DX(){return ud(e=>HY(e))}function MX(e,t,n){return new e({type:"array",element:t,...qe(n)})}function IX(e,t,n){return new e({type:"custom",check:"custom",fn:t,...qe(n)})}function LX(e){const t=$X(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(mh(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(mh(i))}},e(n.value,n)));return t}function $X(e,t){const n=new ui({check:"custom",...qe(t)});return n._zod.check=e,n}function j4(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??Gf,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 Mn(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,p);else{const y=o.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),Mn(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(o.schema,d),t.io==="input"&&Ir(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function N4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const c=e.metadataRegistry.get(o[0])?.id;if(c){const d=r.get(c);if(d&&d!==o[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,o[0])}}const i=o=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,y=e.external.uri??(S=>S);if(m)return{ref:y(m)};const v=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=v,{defId:v,ref:`${y("__shared")}#/${c}/${v}`}}if(o[1]===n)return{ref:"#"};const f=`#/${c}/`,p=o[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=o=>{if(o[1].schema.$ref)return;const c=o[1],{ref:d,defId:f}=i(o);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const o of e.seen.entries()){const c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
46
|
+
|
|
47
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const c=o[1];if(t===o[0]){a(o);continue}if(e.external){const f=e.external.registry.get(o[0])?.id;if(t!==o[0]&&f){a(o);continue}}if(e.metadataRegistry.get(o[0])?.id){a(o);continue}if(c.cycle){a(o);continue}if(c.count>1&&e.reused==="ref"){a(o);continue}}}function k4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=o=>{const c=e.seen.get(o);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const y=e.seen.get(p),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),o._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&y.def)for(const b in d)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(d[b])===JSON.stringify(y.def[b])&&delete d[b]}const m=o._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:o,jsonSchema:d,path:c.path??[]})};for(const o of[...e.seen.entries()].reverse())r(o[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(o)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const o of e.seen.entries()){const c=o[1];c.def&&c.defId&&(a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:ry(t,"input",e.processors),output:ry(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Ir(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ir(r.element,n);if(r.type==="set")return Ir(r.valueType,n);if(r.type==="lazy")return Ir(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ir(r.innerType,n);if(r.type==="intersection")return Ir(r.left,n)||Ir(r.right,n);if(r.type==="record"||r.type==="map")return Ir(r.keyType,n)||Ir(r.valueType,n);if(r.type==="pipe")return Ir(r.in,n)||Ir(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Ir(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Ir(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Ir(i,n))return!0;return!!(r.rest&&Ir(r.rest,n))}return!1}const BX=(e,t={})=>n=>{const r=j4({...n,processors:t});return Mn(e,r),N4(r,e),k4(r,e)},ry=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},o=j4({...i??{},target:a,io:t,processors:n});return Mn(e,o),N4(o,e),k4(o,e)},UX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},qX=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:o,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),c&&(i.format=UX[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},FX=(e,t,n,r)=>{const i=n,{minimum:a,maximum:o,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof o=="number"&&(i.maximum=o,typeof f=="number"&&t.target!=="draft-04"&&(f<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},HX=(e,t,n,r)=>{n.type="boolean"},KX=(e,t,n,r)=>{n.not={}},GX=(e,t,n,r)=>{},VX=(e,t,n,r)=>{const i=e._zod.def,a=n4(i.entries);a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),n.enum=a},QX=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){const o=a[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else a.every(o=>typeof o=="number")&&(n.type="number"),a.every(o=>typeof o=="string")&&(n.type="string"),a.every(o=>typeof o=="boolean")&&(n.type="boolean"),a.every(o=>o===null)&&(n.type="null"),n.enum=a},YX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},WX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ZX=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:o,maximum:c}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=Mn(a.element,t,{...r,path:[...r.path,"items"]})},XX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const o=a.shape;for(const f in o)i.properties[f]=Mn(o[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(o)),d=new Set([...c].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Mn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},JX=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,o=i.options.map((c,d)=>Mn(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=o:n.anyOf=o},eJ=(e,t,n,r)=>{const i=e._zod.def,a=Mn(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Mn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(a)?a.allOf:[a],...c(o)?o.allOf:[o]];n.allOf=d},tJ=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const o=a.keyType,d=o._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=Mn(a.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of d)i.patternProperties[m.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Mn(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Mn(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=o._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},nJ=(e,t,n,r)=>{const i=e._zod.def,a=Mn(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},rJ=(e,t,n,r)=>{const i=e._zod.def;Mn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},iJ=(e,t,n,r)=>{const i=e._zod.def;Mn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},aJ=(e,t,n,r)=>{const i=e._zod.def;Mn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},sJ=(e,t,n,r)=>{const i=e._zod.def;Mn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},oJ=(e,t,n,r)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Mn(a,t,r);const o=t.seen.get(e);o.ref=a},lJ=(e,t,n,r)=>{const i=e._zod.def;Mn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},C4=(e,t,n,r)=>{const i=e._zod.def;Mn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},cJ=ye("ZodISODateTime",(e,t)=>{uZ.init(e,t),xn.init(e,t)});function uJ(e){return gX(cJ,e)}const dJ=ye("ZodISODate",(e,t)=>{dZ.init(e,t),xn.init(e,t)});function fJ(e){return yX(dJ,e)}const hJ=ye("ZodISOTime",(e,t)=>{fZ.init(e,t),xn.init(e,t)});function pJ(e){return vX(hJ,e)}const mJ=ye("ZodISODuration",(e,t)=>{hZ.init(e,t),xn.init(e,t)});function gJ(e){return xX(mJ,e)}const yJ=(e,t)=>{s4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>rW(e,n)},flatten:{value:n=>nW(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,t1,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,t1,2)}},isEmpty:{get(){return e.issues.length===0}}})},ea=ye("ZodError",yJ,{Parent:Error}),vJ=ik(ea),xJ=ak(ea),bJ=Av(ea),wJ=Ov(ea),SJ=sW(ea),jJ=oW(ea),NJ=lW(ea),kJ=cW(ea),CJ=uW(ea),AJ=dW(ea),OJ=fW(ea),EJ=hW(ea),vn=ye("ZodType",(e,t)=>(yn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ry(e,"input"),output:ry(e,"output")}}),e.toJSONSchema=BX(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Fo(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>Ho(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>vJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>bJ(e,n,r),e.parseAsync=async(n,r)=>xJ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>wJ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>SJ(e,n,r),e.decode=(n,r)=>jJ(e,n,r),e.encodeAsync=async(n,r)=>NJ(e,n,r),e.decodeAsync=async(n,r)=>kJ(e,n,r),e.safeEncode=(n,r)=>CJ(e,n,r),e.safeDecode=(n,r)=>AJ(e,n,r),e.safeEncodeAsync=async(n,r)=>OJ(e,n,r),e.safeDecodeAsync=async(n,r)=>EJ(e,n,r),e.refine=(n,r)=>e.check(jee(n,r)),e.superRefine=n=>e.check(Nee(n)),e.overwrite=n=>e.check(ud(n)),e.optional=()=>Y2(e),e.exactOptional=()=>uee(e),e.nullable=()=>W2(e),e.nullish=()=>Y2(W2(e)),e.nonoptional=n=>gee(e,n),e.array=()=>ke(e),e.or=n=>tee([e,n]),e.and=n=>iee(e,n),e.transform=n=>Z2(e,lee(n)),e.default=n=>hee(e,n),e.prefault=n=>mee(e,n),e.catch=n=>vee(e,n),e.pipe=n=>Z2(e,n),e.readonly=()=>wee(e),e.describe=n=>{const r=e.clone();return Gf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Gf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Gf.get(e);const r=e.clone();return Gf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),A4=ye("_ZodString",(e,t)=>{sk.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>qX(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(kX(...r)),e.includes=(...r)=>e.check(OX(...r)),e.startsWith=(...r)=>e.check(EX(...r)),e.endsWith=(...r)=>e.check(_X(...r)),e.min=(...r)=>e.check(ny(...r)),e.max=(...r)=>e.check(w4(...r)),e.length=(...r)=>e.check(S4(...r)),e.nonempty=(...r)=>e.check(ny(1,...r)),e.lowercase=r=>e.check(CX(r)),e.uppercase=r=>e.check(AX(r)),e.trim=()=>e.check(TX()),e.normalize=(...r)=>e.check(zX(...r)),e.toLowerCase=()=>e.check(PX()),e.toUpperCase=()=>e.check(RX()),e.slugify=()=>e.check(DX())}),_J=ye("ZodString",(e,t)=>{sk.init(e,t),A4.init(e,t),e.email=n=>e.check(YZ(zJ,n)),e.url=n=>e.check(eX(TJ,n)),e.jwt=n=>e.check(mX(VJ,n)),e.emoji=n=>e.check(tX(PJ,n)),e.guid=n=>e.check(F2(V2,n)),e.uuid=n=>e.check(WZ(Rm,n)),e.uuidv4=n=>e.check(ZZ(Rm,n)),e.uuidv6=n=>e.check(XZ(Rm,n)),e.uuidv7=n=>e.check(JZ(Rm,n)),e.nanoid=n=>e.check(nX(RJ,n)),e.guid=n=>e.check(F2(V2,n)),e.cuid=n=>e.check(rX(DJ,n)),e.cuid2=n=>e.check(iX(MJ,n)),e.ulid=n=>e.check(aX(IJ,n)),e.base64=n=>e.check(fX(HJ,n)),e.base64url=n=>e.check(hX(KJ,n)),e.xid=n=>e.check(sX(LJ,n)),e.ksuid=n=>e.check(oX($J,n)),e.ipv4=n=>e.check(lX(BJ,n)),e.ipv6=n=>e.check(cX(UJ,n)),e.cidrv4=n=>e.check(uX(qJ,n)),e.cidrv6=n=>e.check(dX(FJ,n)),e.e164=n=>e.check(pX(GJ,n)),e.datetime=n=>e.check(uJ(n)),e.date=n=>e.check(fJ(n)),e.time=n=>e.check(pJ(n)),e.duration=n=>e.check(gJ(n))});function P(e){return QZ(_J,e)}const xn=ye("ZodStringFormat",(e,t)=>{pn.init(e,t),A4.init(e,t)}),zJ=ye("ZodEmail",(e,t)=>{tZ.init(e,t),xn.init(e,t)}),V2=ye("ZodGUID",(e,t)=>{JW.init(e,t),xn.init(e,t)}),Rm=ye("ZodUUID",(e,t)=>{eZ.init(e,t),xn.init(e,t)}),TJ=ye("ZodURL",(e,t)=>{nZ.init(e,t),xn.init(e,t)}),PJ=ye("ZodEmoji",(e,t)=>{rZ.init(e,t),xn.init(e,t)}),RJ=ye("ZodNanoID",(e,t)=>{iZ.init(e,t),xn.init(e,t)}),DJ=ye("ZodCUID",(e,t)=>{aZ.init(e,t),xn.init(e,t)}),MJ=ye("ZodCUID2",(e,t)=>{sZ.init(e,t),xn.init(e,t)}),IJ=ye("ZodULID",(e,t)=>{oZ.init(e,t),xn.init(e,t)}),LJ=ye("ZodXID",(e,t)=>{lZ.init(e,t),xn.init(e,t)}),$J=ye("ZodKSUID",(e,t)=>{cZ.init(e,t),xn.init(e,t)}),BJ=ye("ZodIPv4",(e,t)=>{pZ.init(e,t),xn.init(e,t)}),UJ=ye("ZodIPv6",(e,t)=>{mZ.init(e,t),xn.init(e,t)}),qJ=ye("ZodCIDRv4",(e,t)=>{gZ.init(e,t),xn.init(e,t)}),FJ=ye("ZodCIDRv6",(e,t)=>{yZ.init(e,t),xn.init(e,t)}),HJ=ye("ZodBase64",(e,t)=>{vZ.init(e,t),xn.init(e,t)}),KJ=ye("ZodBase64URL",(e,t)=>{bZ.init(e,t),xn.init(e,t)}),GJ=ye("ZodE164",(e,t)=>{wZ.init(e,t),xn.init(e,t)}),VJ=ye("ZodJWT",(e,t)=>{jZ.init(e,t),xn.init(e,t)}),O4=ye("ZodNumber",(e,t)=>{g4.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>FX(e,r,i),e.gt=(r,i)=>e.check(K2(r,i)),e.gte=(r,i)=>e.check(Sw(r,i)),e.min=(r,i)=>e.check(Sw(r,i)),e.lt=(r,i)=>e.check(H2(r,i)),e.lte=(r,i)=>e.check(ww(r,i)),e.max=(r,i)=>e.check(ww(r,i)),e.int=r=>e.check(Q2(r)),e.safe=r=>e.check(Q2(r)),e.positive=r=>e.check(K2(0,r)),e.nonnegative=r=>e.check(Sw(0,r)),e.negative=r=>e.check(H2(0,r)),e.nonpositive=r=>e.check(ww(0,r)),e.multipleOf=(r,i)=>e.check(G2(r,i)),e.step=(r,i)=>e.check(G2(r,i)),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 re(e){return bX(O4,e)}const QJ=ye("ZodNumberFormat",(e,t)=>{NZ.init(e,t),O4.init(e,t)});function Q2(e){return wX(QJ,e)}const YJ=ye("ZodBoolean",(e,t)=>{kZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HX(e,n,r)});function lt(e){return SX(YJ,e)}const WJ=ye("ZodUnknown",(e,t)=>{CZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GX()});function Gl(){return jX(WJ)}const ZJ=ye("ZodNever",(e,t)=>{AZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KX(e,n,r)});function XJ(e){return NX(ZJ,e)}const JJ=ye("ZodArray",(e,t)=>{OZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZX(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(ny(n,r)),e.nonempty=n=>e.check(ny(1,n)),e.max=(n,r)=>e.check(w4(n,r)),e.length=(n,r)=>e.check(S4(n,r)),e.unwrap=()=>e.element});function ke(e,t){return MX(JJ,e,t)}const eee=ye("ZodObject",(e,t)=>{_Z.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XX(e,n,r,i),It(e,"shape",()=>t.shape),e.keyof=()=>Ke(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Gl()}),e.loose=()=>e.clone({...e._zod.def,catchall:Gl()}),e.strict=()=>e.clone({...e._zod.def,catchall:XJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ZY(e,n),e.safeExtend=n=>XY(e,n),e.merge=n=>JY(e,n),e.pick=n=>YY(e,n),e.omit=n=>WY(e,n),e.partial=(...n)=>eW(z4,e,n[0]),e.required=(...n)=>tW(T4,e,n[0])});function de(e,t){const n={type:"object",shape:e??{},...qe(t)};return new eee(n)}const E4=ye("ZodUnion",(e,t)=>{x4.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JX(e,n,r,i),e.options=t.options});function tee(e,t){return new E4({type:"union",options:e,...qe(t)})}const nee=ye("ZodDiscriminatedUnion",(e,t)=>{E4.init(e,t),zZ.init(e,t)});function _4(e,t,n){return new nee({type:"union",options:t,discriminator:e,...qe(n)})}const ree=ye("ZodIntersection",(e,t)=>{TZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eJ(e,n,r,i)});function iee(e,t){return new ree({type:"intersection",left:e,right:t})}const aee=ye("ZodRecord",(e,t)=>{PZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tJ(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Ya(e,t,n){return new aee({type:"record",keyType:e,valueType:t,...qe(n)})}const r1=ye("ZodEnum",(e,t)=>{RZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>VX(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const a={};for(const o of r)if(n.has(o))a[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new r1({...t,checks:[],...qe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const o of r)if(n.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new r1({...t,checks:[],...qe(i),entries:a})}});function Ke(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new r1({type:"enum",entries:n,...qe(t)})}const see=ye("ZodLiteral",(e,t)=>{DZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QX(e,n,r),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 ci(e,t){return new see({type:"literal",values:Array.isArray(e)?e:[e],...qe(t)})}const oee=ye("ZodTransform",(e,t)=>{MZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new e4(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(mh(a,n.value,t));else{const o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(mh(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function lee(e){return new oee({type:"transform",transform:e})}const z4=ye("ZodOptional",(e,t)=>{b4.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>C4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Y2(e){return new z4({type:"optional",innerType:e})}const cee=ye("ZodExactOptional",(e,t)=>{IZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>C4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function uee(e){return new cee({type:"optional",innerType:e})}const dee=ye("ZodNullable",(e,t)=>{LZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function W2(e){return new dee({type:"nullable",innerType:e})}const fee=ye("ZodDefault",(e,t)=>{$Z.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hee(e,t){return new fee({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():i4(t)}})}const pee=ye("ZodPrefault",(e,t)=>{BZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function mee(e,t){return new pee({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():i4(t)}})}const T4=ye("ZodNonOptional",(e,t)=>{UZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function gee(e,t){return new T4({type:"nonoptional",innerType:e,...qe(t)})}const yee=ye("ZodCatch",(e,t)=>{qZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vee(e,t){return new yee({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const xee=ye("ZodPipe",(e,t)=>{FZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oJ(e,n,r,i),e.in=t.in,e.out=t.out});function Z2(e,t){return new xee({type:"pipe",in:e,out:t})}const bee=ye("ZodReadonly",(e,t)=>{HZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function wee(e){return new bee({type:"readonly",innerType:e})}const See=ye("ZodCustom",(e,t)=>{KZ.init(e,t),vn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YX(e,n)});function jee(e,t={}){return IX(See,e,t)}function Nee(e){return LX(e)}de({maxConcurrency:re().int().positive(),maxRequestsPerMinute:re().int().positive(),maxRequestsPerDay:re().int().positive()});const Rs=P().min(1);P().min(1);const ok=de({label:P().min(1),city:P().min(1),region:P().min(1),country:P().length(2),timezone:P().optional()}),lk=Ke(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);de({id:P(),projectId:P(),channel:ci("webhook"),url:P().url(),urlDisplay:P(),urlHost:P(),events:ke(lk),enabled:lt().default(!0),source:P().optional(),webhookSecret:P().optional(),createdAt:P(),updatedAt:P()});de({channel:ci("webhook"),url:P().url(),events:ke(lk).min(1),source:P().optional()});const P4=Ke(["cli","api","config-file"]);function kee(e){const t=new Set,n=new Set;for(const r of e){if(t.has(r.label)){n.add(r.label);continue}t.add(r.label)}return[...n]}function Cee(e,t){return t?e.some(n=>n.label===t):!0}de({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:ke(P().min(1)).optional(),country:P().length(2),language:P().min(2),tags:ke(P()).optional(),labels:Ya(P(),P()).optional(),providers:ke(Rs).optional(),locations:ke(ok).optional(),defaultLocation:P().nullable().optional(),autoExtractBacklinks:lt().optional(),configSource:P4.optional()});de({id:P(),name:P(),displayName:P().optional(),canonicalDomain:P(),ownedDomains:ke(P()).default([]),country:P().length(2),language:P().min(2),tags:ke(P()).default([]),labels:Ya(P(),P()).default({}),locations:ke(ok).default([]),defaultLocation:P().nullable().optional(),autoExtractBacklinks:lt().default(!1),configSource:P4.default("cli"),configRevision:re().int().positive().default(1),createdAt:P().optional(),updatedAt:P().optional()});de({id:P(),query:P(),createdAt:P()});de({id:P(),keyword:P(),createdAt:P()});de({queries:ke(P().trim().min(1)).min(1)});de({keywords:ke(P().trim().min(1)).min(1)});de({provider:Rs,count:re().int().min(1).max(20).optional()});de({id:P(),domain:P(),createdAt:P()});de({competitors:ke(P().trim().min(1)).min(1)});function iy(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const Aee=new Set(["ac.uk","co.id","co.il","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.au","com.br","com.cn","com.mx","com.ph","com.sg","com.tr","edu.au","edu.sg","gov.au","gov.uk","me.uk","ne.jp","net.au","net.br","net.cn","net.in","net.tr","or.jp","or.kr","org.au","org.br","org.in","org.nz","org.tr","org.uk","org.za"]);function Oee(e){const t=iy(e);if(!t)return"";const n=t.split("/")[0]?.split(":")[0]??"";if(!n)return"";const r=n.split(".").filter(Boolean);if(r.length<2)return"";if(r.length===2)return r.join(".");const i=r.slice(-2).join(".");return Aee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function Eee(e){const t=Oee(e);return t?t.split(".")[0]??"":""}function _ee(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const o=iy(a);n.has(o)||(n.add(o),r.push(a))}return r}const zee=de({name:P().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:Ya(P(),P()).optional().default({})}),Tee=de({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),providers:ke(Rs).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),Pee=de({channel:ci("webhook"),url:P().url(),events:ke(lk).min(1)}),Ree=de({gsc:de({propertyUrl:P()}).optional(),syncSchedule:de({preset:P().optional(),cron:P().optional()}).optional()}).optional(),X2=ke(P().min(1)),Dee=de({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:ke(P().min(1)).optional().default([]),country:P().length(2),language:P().min(2),queries:X2.optional(),keywords:X2.optional(),competitors:ke(P().min(1)).optional().default([]),providers:ke(Rs).optional().default([]),locations:ke(ok).optional().default([]),defaultLocation:P().optional(),schedule:Tee,notifications:ke(Pee).optional().default([]),google:Ree,autoExtractBacklinks:lt().optional().default(!1)}).superRefine((e,t)=>{e.queries!==void 0&&e.keywords!==void 0&&t.addIssue({code:"custom",message:"Use spec.queries; spec.keywords is accepted only as a legacy alias when spec.queries is omitted",path:["keywords"]});const n=kee(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),Cee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});de({apiVersion:ci("canonry/v1"),kind:ci("Project"),metadata:zee,spec:Dee});const Mee=Ke(["gsc","ga4"]);de({id:P(),domain:P(),connectionType:Mee,propertyId:P().nullable().optional(),sitemapUrl:P().nullable().optional(),scopes:ke(P()).default([]),createdAt:P(),updatedAt:P()});de({date:P(),query:P(),page:P(),country:P().nullable().optional(),device:P().nullable().optional(),clicks:re(),impressions:re(),ctr:re(),position:re()});const i1=de({id:P(),url:P(),indexingState:P().nullable().optional(),verdict:P().nullable().optional(),coverageState:P().nullable().optional(),pageFetchState:P().nullable().optional(),robotsTxtState:P().nullable().optional(),crawlTime:P().nullable().optional(),lastCrawlResult:P().nullable().optional(),isMobileFriendly:lt().nullable().optional(),richResults:ke(P()).default([]),inspectedAt:P()});Ke(["stable","reindexed","deindexed","still-missing","new"]);const Iee=de({url:P(),previousState:P().nullable(),currentState:P().nullable(),transitionDate:P()}),Lee=de({reason:P(),count:re(),urls:ke(i1).default([])});de({summary:de({total:re(),indexed:re(),notIndexed:re(),deindexed:re(),percentage:re()}),lastInspectedAt:P().nullable(),lastSyncedAt:P().nullable(),indexed:ke(i1).default([]),notIndexed:ke(i1).default([]),deindexed:ke(Iee).default([]),reasonGroups:ke(Lee).default([])});de({url:P(),type:Ke(["URL_UPDATED","URL_DELETED"]),notifiedAt:P()});de({url:P(),type:Ke(["URL_UPDATED","URL_DELETED"]),notifiedAt:P(),status:Ke(["success","error"]),error:P().optional()});de({date:P(),indexed:re(),notIndexed:re(),reasonBreakdown:Ya(P(),re()).default({})});de({id:P(),domain:P(),siteUrl:P().nullable().optional(),createdAt:P(),updatedAt:P()});const jw=de({id:P(),url:P(),httpCode:re().nullable().optional(),inIndex:lt().nullable().optional(),lastCrawledDate:P().nullable().optional(),inIndexDate:P().nullable().optional(),inspectedAt:P(),documentSize:re().nullable().optional(),anchorCount:re().nullable().optional(),discoveryDate:P().nullable().optional()});de({summary:de({total:re(),indexed:re(),notIndexed:re(),unknown:re().optional(),percentage:re()}),lastInspectedAt:P().nullable(),indexed:ke(jw).default([]),notIndexed:ke(jw).default([]),unknown:ke(jw).default([]).optional()});de({query:P(),impressions:re(),clicks:re(),ctr:re(),averagePosition:re()});de({date:P(),indexed:re(),notIndexed:re(),unknown:re()});de({url:P(),status:Ke(["success","error"]),submittedAt:P(),error:P().optional()});const dd=Ke(["live","staging"]);de({projectName:P(),url:P(),stagingUrl:P().optional(),username:P(),defaultEnv:dd,createdAt:P(),updatedAt:P()});const J2=de({url:P(),reachable:lt(),pageCount:re().nullable().optional(),version:P().nullable().optional(),error:P().nullable().optional(),plugins:ke(P()).optional(),authenticatedUser:de({id:re(),slug:P()}).nullable().optional()});de({connected:lt(),projectName:P(),defaultEnv:dd,live:J2.nullable(),staging:J2.nullable(),adminUrl:P().nullable().optional()});const $ee=de({id:re(),slug:P(),title:P(),status:P(),modifiedAt:P().nullable().optional(),link:P().nullable().optional()}),R4=de({title:P().nullable(),description:P().nullable(),noindex:lt().nullable(),writable:lt().default(!1),writeTargets:ke(P()).default([])}),Bee=de({type:P(),json:Ya(P(),Gl())}),Uee=$ee.extend({env:dd,content:P(),seo:R4,schemaBlocks:ke(Bee).default([])}),eT=Uee.extend({contentHash:P(),contentSnippet:P()}),D4=de({manualRequired:ci(!0),targetUrl:P(),adminUrl:P().nullable().optional(),content:P(),nextSteps:ke(P()).default([])}),qee=de({slug:P(),severity:Ke(["high","medium","low"]),code:Ke(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:P()});de({slug:P(),title:P(),status:P(),wordCount:re(),seo:R4,schemaPresent:lt(),issues:ke(qee).default([])});const Fee=de({slug:P(),status:Ke(["applied","skipped","manual"]),error:P().optional(),manualAssist:D4.optional()});de({env:dd,strategy:Ke(["plugin","manual"]),results:ke(Fee)});const Hee=de({slug:P(),status:Ke(["deployed","stripped","skipped","failed"]),schemasInjected:ke(P()).optional(),manualAssist:D4.optional(),error:P().optional()});de({env:dd,results:ke(Hee)});const Kee=de({slug:P(),title:P(),canonrySchemas:ke(P()),thirdPartySchemas:ke(P()),hasCanonrySchema:lt()});de({env:dd,pages:ke(Kee)});const Gee=de({name:P(),status:Ke(["completed","skipped","failed"]),summary:P().optional(),error:P().optional()});de({projectName:P(),steps:ke(Gee)});de({slug:P(),live:eT,staging:eT,hasDifferences:lt(),differences:de({title:lt(),slug:lt(),content:lt(),seoTitle:lt(),seoDescription:lt(),noindex:lt(),schema:lt()})});const _v=Ke(["queued","running","completed","partial","failed","cancelled"]),pr=_v.enum,M4=Ke(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync"]),Nt=M4.enum,I4=Ke(["manual","scheduled","config-apply","backfill"]),eh=I4.enum,Vu=Ke(["cited","not-cited"]),gh=Vu.enum,ay=Ke(["visible","not-visible"]);ay.enum;const L4=Ke(["new","cited","lost","emerging","not-cited"]);L4.enum;de({kind:ci(Nt["answer-visibility"]).optional(),trigger:ci(eh.manual).optional(),providers:ke(Rs).optional(),location:P().min(1).optional(),allLocations:lt().optional(),noLocation:lt().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const Vee=de({message:P(),raw:Gl().optional()}),Qee=de({message:P().optional(),providers:Ya(P(),Vee).optional()}),Yee=de({id:P(),projectId:P(),kind:M4,status:_v,trigger:I4.default("manual"),location:P().nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),error:Qee.nullable().optional(),createdAt:P()});function ck(e){if(e.providers){const t=Object.entries(e.providers);if(t.length===1){const[n,r]=t[0];return`${n}: ${r.message}`}if(t.length>1)return t.map(([n,r])=>`${n}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const $4=de({uri:P(),title:P()}),B4=de({id:P(),runId:P(),queryId:P(),query:P().optional(),provider:Rs,citationState:Vu,answerMentioned:lt().optional(),visibilityState:ay.optional(),transition:L4.optional(),answerText:P().nullable().optional(),citedDomains:ke(P()).default([]),competitorOverlap:ke(P()).default([]),recommendedCompetitors:ke(P()).default([]),matchedTerms:ke(P()).default([]),groundingSources:ke($4).default([]),searchQueries:ke(P()).default([]),model:P().nullable().optional(),location:P().nullable().optional(),createdAt:P()});de({snapshots:ke(B4),total:re().int().nonnegative()});const Wee=de({queryId:P().nullable(),query:P().nullable(),run1State:Vu.nullable(),run2State:Vu.nullable(),run1AnswerMentioned:lt().nullable(),run2AnswerMentioned:lt().nullable(),run1VisibilityState:ay.nullable(),run2VisibilityState:ay.nullable(),changed:lt(),visibilityChanged:lt()});de({run1:P(),run2:P(),diff:ke(Wee)});const Zee=Yee.extend({snapshots:ke(B4).optional()});de({totalRuns:re().int().nonnegative(),run:Zee.nullable()});de({id:P(),projectId:P().nullable().optional(),actor:P(),action:P(),entityType:P(),entityId:P().nullable().optional(),diff:Gl().optional(),createdAt:P()});const Xee=Ke(["yes","no","unknown","not-mentioned"]),tT=ke(P().min(1));de({companyName:P().min(1),domain:P().min(1),queries:tT.optional(),phrases:tT.optional(),competitors:ke(P().min(1)).optional().default([])}).superRefine((e,t)=>{e.queries!==void 0&&e.phrases!==void 0&&t.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const Jee=de({name:P(),count:re().int().nonnegative()}),ete=de({id:P(),name:P(),weight:re(),score:re(),grade:P(),status:Ke(["pass","partial","fail"]),findings:ke(de({type:P(),message:P()})).default([]),recommendations:ke(P()).default([])}),tte=de({url:P(),finalUrl:P(),auditedAt:P(),overallScore:re(),overallGrade:P(),summary:P(),factors:ke(ete).default([])}),nte=de({industry:P(),summary:P(),services:ke(P()).default([]),categoryTerms:ke(P()).default([])}),rte=de({provider:P(),displayName:P(),model:P().nullable().optional(),mentioned:lt(),cited:lt(),describedAccurately:Xee,accuracyNotes:P().nullable().optional(),incorrectClaims:ke(P()).default([]),recommendedCompetitors:ke(P()).default([]),citedDomains:ke(P()).default([]),groundingSources:ke($4).default([]),searchQueries:ke(P()).default([]),answerText:P(),error:P().nullable().optional()}),ite=de({query:P(),providerResults:ke(rte).default([])}),ate=de({totalQueries:re().int().nonnegative(),totalProviders:re().int().nonnegative(),totalComparisons:re().int().nonnegative(),mentionCount:re().int().nonnegative(),citationCount:re().int().nonnegative(),topCompetitors:ke(Jee).default([]),visibilityGap:P(),whatThisMeans:ke(P()).default([]),recommendedActions:ke(P()).default([])});de({companyName:P(),domain:P(),homepageUrl:P(),generatedAt:P(),queries:ke(P()).default([]),competitors:ke(P()).default([]),profile:nte,audit:tte,queryResults:ke(ite).default([]),summary:ate});const uk=Ke(["answer-visibility","traffic-sync"]);uk.enum;de({id:P(),projectId:P(),kind:uk,cronExpr:P(),preset:P().nullable().optional(),timezone:P().default("UTC"),enabled:lt().default(!0),providers:ke(Rs).default([]),sourceId:P().nullable().optional(),lastRunAt:P().nullable().optional(),nextRunAt:P().nullable().optional(),createdAt:P(),updatedAt:P()});de({kind:uk.optional(),preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),enabled:lt().optional().default(!0),providers:ke(Rs).optional().default([]),sourceId:P().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const ste=Ke(["mentioned","cited"]);ste.enum;de({id:P(),projectId:P(),propertyId:P(),clientEmail:P(),connected:lt(),createdAt:P(),updatedAt:P()});de({date:P(),landingPage:P(),sessions:re(),organicSessions:re(),users:re()});const dk=Ke(["session","first_user","manual_utm"]),ote=de({source:P(),medium:P(),sessions:re(),users:re(),sourceDimension:dk}),lte=de({source:P(),medium:P(),sourceDimension:dk,landingPage:P(),sessions:re(),users:re()}),cte=de({source:P(),medium:P(),sessions:re(),users:re(),channelGroup:P()}),Cf=de({sessions:re(),sharePct:re(),sharePctDisplay:P()}),ute=de({organic:Cf,social:Cf,direct:Cf,ai:Cf,other:Cf});de({totalSessions:re(),totalOrganicSessions:re(),totalDirectSessions:re(),totalUsers:re(),topPages:ke(de({landingPage:P(),sessions:re(),organicSessions:re(),directSessions:re(),users:re()})),aiReferrals:ke(ote),aiReferralLandingPages:ke(lte),aiSessionsDeduped:re(),aiUsersDeduped:re(),aiSessionsBySession:re(),aiUsersBySession:re(),socialReferrals:ke(cte),socialSessions:re(),socialUsers:re(),channelBreakdown:ute,organicSharePct:re(),aiSharePct:re(),aiSharePctBySession:re(),directSharePct:re(),socialSharePct:re(),organicSharePctDisplay:P(),aiSharePctDisplay:P(),aiSharePctBySessionDisplay:P(),directSharePctDisplay:P(),socialSharePctDisplay:P(),otherSessions:re(),otherSharePct:re(),otherSharePctDisplay:P(),lastSyncedAt:P().nullable()});de({date:P(),source:P(),medium:P(),landingPage:P(),sessions:re(),users:re(),sourceDimension:dk});de({date:P(),source:P(),medium:P(),sessions:re(),users:re(),channelGroup:P()});de({date:P(),sessions:re(),organicSessions:re(),users:re()});function sy(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const dte=Ke(["aero","user","compaction"]);dte.enum;const U4=128;de({key:P().min(1).max(U4),value:P().min(1)});de({key:P().min(1).max(U4)});const fk=Ke(["queued","downloading","querying","ready","failed"]);fk.enum;de({id:P(),release:P(),status:fk,phaseDetail:P().nullable().optional(),vertexPath:P().nullable().optional(),edgesPath:P().nullable().optional(),vertexSha256:P().nullable().optional(),edgesSha256:P().nullable().optional(),vertexBytes:re().int().nullable().optional(),edgesBytes:re().int().nullable().optional(),projectsProcessed:re().int().nullable().optional(),domainsDiscovered:re().int().nullable().optional(),downloadStartedAt:P().nullable().optional(),downloadFinishedAt:P().nullable().optional(),queryStartedAt:P().nullable().optional(),queryFinishedAt:P().nullable().optional(),error:P().nullable().optional(),createdAt:P(),updatedAt:P()});const fte=de({linkingDomain:P(),numHosts:re().int()}),hte=de({projectId:P(),release:P(),targetDomain:P(),totalLinkingDomains:re().int(),totalHosts:re().int(),top10HostsShare:P(),queriedAt:P(),excludedLinkingDomains:re().int().optional(),excludedHosts:re().int().optional()});de({summary:hte.nullable(),total:re().int(),rows:ke(fte)});de({release:P(),totalLinkingDomains:re().int(),totalHosts:re().int(),top10HostsShare:P(),queriedAt:P()});de({duckdbInstalled:lt(),duckdbVersion:P().nullable().optional(),duckdbSpec:P(),pluginDir:P()});de({installed:lt(),version:P(),path:P(),alreadyPresent:lt()});de({release:P(),vertexUrl:P(),edgesUrl:P(),vertexBytes:re().int().nullable(),edgesBytes:re().int().nullable(),lastModified:P().nullable()});de({release:P(),syncStatus:fk.nullable(),bytes:re().int(),lastUsedAt:P().nullable()});Ke(["snapshot","insight"]);const pte=de({kind:ci("snapshot"),id:P(),runId:P(),query:P(),provider:P(),model:P().nullable(),citationState:Vu,matchedField:Ke(["answerText","citedDomains","searchQueries","query"]),snippet:P(),createdAt:P()}),mte=de({kind:ci("insight"),id:P(),runId:P().nullable(),type:Ke(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:Ke(["critical","high","medium","low"]),title:P(),query:P(),provider:P(),matchedField:Ke(["title","query","recommendation","cause"]),snippet:P(),dismissed:lt(),createdAt:P()}),gte=_4("kind",[pte,mte]);de({query:P(),totalHits:re().int().nonnegative(),truncated:lt(),hits:ke(gte)});const q4=Ke(["create","expand","refresh","add-schema"]);q4.enum;function yte(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const F4=Ke(["gsc","competitor-evidence","both"]);F4.enum;const H4=Ke(["high","medium","low"]);H4.enum;const vte=Ke(["blog-post","comparison","listicle","how-to","guide","glossary"]);vte.enum;const K4=Ke(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);K4.enum;const xte=de({url:P(),gscImpressions:re().nonnegative(),gscClicks:re().nonnegative(),gscAvgPosition:re().nonnegative().nullable(),organicSessions:re().nonnegative()}),bte=de({domain:P(),url:P(),title:P(),citationCount:re().int().nonnegative()}),wte=de({demand:re(),competitor:re(),absence:re(),gapSeverity:re()}),Ste=de({actionId:P(),state:K4,lastUpdated:P()}),jte=de({targetRef:P(),query:P(),action:q4,ourBestPage:xte.nullable(),winningCompetitor:bte.nullable(),score:re(),scoreBreakdown:wte,drivers:ke(P()),demandSource:F4,actionConfidence:H4,existingAction:Ste.nullable()});de({targets:ke(jte),contextMetrics:de({totalAiReferralSessions:re().int().nonnegative(),latestRunId:P(),runTimestamp:P()})});const Nte=de({uri:P(),title:P(),domain:P(),isOurDomain:lt(),isCompetitor:lt(),citationCount:re().int().nonnegative(),providers:ke(Rs)}),kte=de({query:P(),groundingSources:ke(Nte)});de({sources:ke(kte),latestRunId:P()});const Cte=de({query:P(),competitorDomains:ke(P()),competitorCount:re().int().nonnegative(),missRate:re().min(0).max(1),lastSeenInRunId:P()});de({gaps:ke(Cte),latestRunId:P()});const G4=Ke(["ok","warn","fail","skipped"]);G4.enum;const hk=Ke(["global","project"]);hk.enum;const V4=Ke(["auth","config","providers","integrations","database","schedules"]);V4.enum;const Ate=de({id:P(),category:V4,scope:hk,title:P(),status:G4,code:P().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:P(),remediation:P().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Ya(P(),Gl()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:re().int().nonnegative().describe("How long the check took to execute.")});de({scope:hk,project:P().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:P().describe("ISO-8601 timestamp when this doctor run started."),durationMs:re().int().nonnegative(),summary:de({total:re().int().nonnegative(),ok:re().int().nonnegative(),warn:re().int().nonnegative(),fail:re().int().nonnegative(),skipped:re().int().nonnegative()}),checks:ke(Ate)});const Ote=de({provider:P(),citationState:Vu,cited:lt(),mentioned:lt(),runId:P(),runCreatedAt:P()}),Ete=de({queryId:P(),query:P(),providers:ke(Ote),citedCount:re().int().nonnegative(),mentionedCount:re().int().nonnegative(),totalProviders:re().int().nonnegative()}),_te=de({queryId:P(),query:P(),provider:P(),citingCompetitors:ke(P()),runId:P(),runCreatedAt:P()}),zte=de({providersConfigured:re().int().nonnegative(),providersCiting:re().int().nonnegative(),providersMentioning:re().int().nonnegative(),totalQueries:re().int().nonnegative(),queriesCitedAndMentioned:re().int().nonnegative(),queriesCitedOnly:re().int().nonnegative(),queriesMentionedOnly:re().int().nonnegative(),queriesInvisible:re().int().nonnegative(),latestRunId:P().nullable(),latestRunAt:P().nullable()});de({summary:zte,byQuery:ke(Ete),competitorGaps:ke(_te),status:Ke(["ready","no-data"]),reason:Ke(["no-runs-yet","no-queries"]).optional()});function Tte(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function Pte(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function Rte(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function Dte(e){switch(e){case"content":return"Content";case"competitors":return"Competitors";case"provider":return"Provider";case"search-demand":return"Search demand";case"indexing":return"Indexing";case"location":return"Location";case"monitoring":return"Monitoring"}}function Mte(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const Ite=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function Q4(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function Y4(e){return e.length>4&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e}function W4(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(Q4).map(Y4).filter(Boolean)):new Set}function Z4(e,t){const n=Q4(e).map(Y4).filter(Boolean).filter(r=>!Ite.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function Lte(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function $te(e,t){const n=W4(e);if(t.length<=1||n.size===0)return[...t];const r=new Set,i=[];for(const a of t){if(a.category!=="content"){i.push(a);continue}const o=Z4(Lte(a),n);!o||r.has(o)||(r.add(o),i.push(a))}return i}function Bte(e){const t=W4(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=Z4(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const Ute=Ke(["claude","codex"]);Ute.enum;const qte=Ke(["claude","codex","all"]);qte.enum;const pk=Ke(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);pk.enum;const Fte=Ke(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);Fte.enum;const Hte=Ke(["raw-request","aggregate-bucket"]),Kte=Hte.enum,Gte=Ke(["observed","provider-aggregated","inferred"]),Vte=Gte.enum,Qte=de({type:P().nullable(),labels:Ya(P(),P())}),Yte=de({sourceType:pk,evidenceKind:ci(Kte["raw-request"]),confidence:ci(Vte.observed),eventId:P().min(1),observedAt:P().min(1),method:P().nullable(),requestUrl:P().nullable(),host:P().nullable(),path:P().min(1),queryString:P().nullable(),status:re().int().nullable(),userAgent:P().nullable(),remoteIp:P().nullable(),referer:P().nullable(),latencyMs:re().nullable(),requestSizeBytes:re().int().nullable(),responseSizeBytes:re().int().nullable(),providerResource:Qte,providerLabels:Ya(P(),P())});de({events:ke(Yte),rawEntryCount:re().int().nonnegative(),skippedEntryCount:re().int().nonnegative(),nextPageToken:P().optional(),filter:P()});const X4=Ke(["connected","paused","error","archived"]),Vf=X4.enum,J4=Ke(["oauth","service-account"]);J4.enum;const Wte=Ke(["verified","claimed_unverified","unknown_ai_like"]);Wte.enum;de({gcpProjectId:P().min(1),serviceName:P().nullable().optional(),location:P().nullable().optional(),authMode:J4});de({baseUrl:P().url(),username:P().min(1)});const e3=de({id:P(),projectId:P(),sourceType:pk,displayName:P(),status:X4,lastSyncedAt:P().nullable(),lastCursor:P().nullable(),lastError:P().nullable(),archivedAt:P().nullable(),config:Ya(P(),Gl()),createdAt:P(),updatedAt:P()});de({gcpProjectId:P().min(1),serviceName:P().min(1).optional(),location:P().min(1).optional(),displayName:P().min(1).optional(),keyJson:P().optional()});de({baseUrl:P().url(),username:P().min(1),applicationPassword:P().min(1),displayName:P().min(1).optional()});de({sourceId:P(),runId:P(),syncedAt:P(),pulledEvents:re().int().nonnegative(),crawlerHits:re().int().nonnegative(),aiReferralHits:re().int().nonnegative(),unknownHits:re().int().nonnegative(),crawlerBucketRows:re().int().nonnegative(),aiReferralBucketRows:re().int().nonnegative(),sampleRows:re().int().nonnegative(),windowStart:P(),windowEnd:P()});de({days:re().int().positive().optional()});de({sourceId:P(),runId:P(),status:_v,windowStart:P(),windowEnd:P(),daysRequested:re().int().positive(),daysApplied:re().int().positive()});const Zte=de({crawlerHits:re().int().nonnegative(),aiReferralHits:re().int().nonnegative(),sampleCount:re().int().nonnegative()});de({sources:ke(e3)});const Xte=e3.extend({totals24h:Zte,latestRun:de({runId:P(),status:_v,startedAt:P().nullable(),finishedAt:P().nullable(),error:P().nullable()}).nullable()});de({sources:ke(Xte)});const Jte=Ke(["crawler","ai-referral"]),La=Jte.enum,ene=de({kind:ci(La.crawler),sourceId:P(),tsHour:P(),botId:P(),operator:P(),verificationStatus:P(),pathNormalized:P(),status:re().int(),hits:re().int().nonnegative()}),tne=de({kind:ci(La["ai-referral"]),sourceId:P(),tsHour:P(),product:P(),operator:P(),sourceDomain:P(),evidenceType:P(),landingPathNormalized:P(),status:re().int(),hits:re().int().nonnegative()}),nne=_4("kind",[ene,tne]);de({windowStart:P(),windowEnd:P(),totals:de({crawlerHits:re().int().nonnegative(),aiReferralHits:re().int().nonnegative()}),events:ke(nne)});function Nw(e){return Number.isFinite(e)?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString("en-US"):"—"}function rne(e,t){return t<=0?null:Math.round((e-t)/t*100)}function nT(e,t,n="vs prior 7 days"){return e.deltaPct===null?e.prior===0?"First baseline week":"":e.deltaPct>0?`Up ${e.deltaPct}% ${n} (${Nw(e.prior)} ${t})`:e.deltaPct<0?`Down ${Math.abs(e.deltaPct)}% ${n} (${Nw(e.prior)} ${t})`:`Flat ${n} (${Nw(e.prior)} ${t})`}var ko=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(ko||{});const ine={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Dm={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},ane=ck;function sne(e){const t=[];if(e.message&&t.push(e.message),e.providers)for(const[n,r]of Object.entries(e.providers)){const i=`[${n}] ${r.message}`;r.raw!==void 0?t.push(`${i}
|
|
48
|
+
|
|
49
|
+
${JSON.stringify(r.raw,null,2)}`):t.push(i)}return t.length>0?t.join(`
|
|
50
|
+
|
|
51
|
+
`):"Run failed."}function zv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ha(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function rT(e){return e===null?"Unknown":e?"Pass":"Fail"}function a1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function one(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function lne(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 r=e.match(/^(weekly@(?:mon|tue|wed|thu|fri|sat|sun))(?:@(\d+))?$/);return r?{freq:r[1],hour:r[2]?parseInt(r[2]):6,customCron:""}:{freq:"custom",hour:6,customCron:t}}function kw(e,t,n){const r=n==="UTC"?"UTC":n.split("/").pop()?.replace(/_/g," ")??n;if(!e)return`Custom: ${t} · ${r}`;if(e==="twice-daily")return`Twice a day (6am & 6pm) · ${r}`;const i=e.match(/^daily(?:@(\d+))?$/);if(i){const o=i[1]?parseInt(i[1]):6;return`Every day at ${a1(o)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const o={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},c=a[2]?parseInt(a[2]):6;return`Every ${o[a[1]]} at ${a1(c)} · ${r}`}return`${e} · ${r}`}function oy(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function t3(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 cne(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 une(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function dne(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Io(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
+
`):void 0}function fne(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:oy(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:oy(t.workerStatus),detail:t.workerStatus.state==="ok"?"Healthy":"Needs attention",meta:t.workerStatus.detail};const i=n.providerStatuses.filter(d=>d.state==="ready").length,a=n.providerStatuses.length,o=i>0,c=n.providerStatuses.filter(d=>d.state==="ready").map(d=>dne(d)).join(" · ");return{...r,label:"Providers",tone:o?"positive":"caution",detail:`${i} of ${a} configured`,meta:c||"None configured"}})}function hne(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 pne(e,t,n){const r=hne(t,n),i=structuredClone(e);return i.healthChecks=i.healthChecks.map(a=>{if(a.id==="api")return{...a,detail:t.apiStatus.detail,state:t.apiStatus.state==="ok"?"ready":"attention"};if(a.id==="worker")return{...a,detail:t.workerStatus.detail,state:t.workerStatus.state==="ok"?"ready":"attention"};const o=n.providerStatuses.some(c=>c.state==="ready");return{...a,detail:o?"At least one provider configured.":"No providers configured.",state:o?"ready":"attention"}}),i.launchState.enabled=r===void 0,i.launchState.blockedReason=r,i.launchState.summary=r??"Queue a visibility sweep first, then follow with a site audit to explain movement.",i}const n3="canonry.run-tracker",s1=new Set;let iT=!1,mne=0,Tv={runs:{},batches:{}};function gne(){const e=Vl();for(const t of s1)t(e)}function yne(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function vne(){typeof window>"u"||window.sessionStorage.setItem(n3,JSON.stringify(Tv))}function r3(){iT||(iT=!0,!(typeof window>"u")&&(Tv=yne(window.sessionStorage.getItem(n3))))}function Pv(e){Tv=e,vne(),gne()}function Vl(){return r3(),Tv}function xne(e){return r3(),s1.add(e),()=>{s1.delete(e)}}function i3(e){const t=Vl();Pv({...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 aT(e){const t=Vl();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Pv({...t,runs:r})}function bne(e){const t=Vl(),n=`batch_${Date.now()}_${++mne}`;return Pv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function wne(e){const t=Vl();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Pv({...t,batches:r})}function mk(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function Sne(e,t){let n=0,r=0,i=0,a=0,o=0;for(const c of e){const d=t[c]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:o+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:o,finished:o===0}}function sT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=sT(i,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let i=0;i<r.length;i++){const a=r[i];typeof a=="function"?a():sT(e[i],null)}}}}function uc(...e){return x.useCallback(gk(...e),e)}var jne=Symbol.for("react.lazy"),ly=yv[" use ".trim().toString()];function Nne(e){return typeof e=="object"&&e!==null&&"then"in e}function a3(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===jne&&"_payload"in e&&Nne(e._payload)}function kne(e){const t=Ane(e),n=x.forwardRef((r,i)=>{let{children:a,...o}=r;a3(a)&&typeof ly=="function"&&(a=ly(a._payload));const c=x.Children.toArray(a),d=c.find(Ene);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return l.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var Cne=kne("Slot");function Ane(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(a3(i)&&typeof ly=="function"&&(i=ly(i._payload)),x.isValidElement(i)){const o=zne(i),c=_ne(a,i.props);return i.type!==x.Fragment&&(c.ref=r?gk(r,o):o),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var One=Symbol("radix.slottable");function Ene(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===One}function _ne(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function zne(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 s3(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=s3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=s3(e))&&(r&&(r+=" "),r+=t);return r}const oT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,lT=Rt,o3=(e,t)=>n=>{var r;if(t?.variants==null)return lT(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,o=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const y=oT(p)||oT(m);return i[f][y]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(S=>{let[b,j]=S;return Array.isArray(j)?j.includes({...a,...c}[b]):{...a,...c}[b]===j})?[...f,m,y]:f},[]);return lT(e,o,d,n?.class,n?.className)},Tne=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Pne=(e,t)=>({classGroupId:e,validator:t}),l3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cy="-",cT=[],Rne="arbitrary..",Dne=e=>{const t=Ine(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Mne(o);const c=o.split(cy),d=c[0]===""&&c.length>1?1:0;return c3(c,d,t)},getConflictingClassGroupIds:(o,c)=>{if(c){const d=r[o],f=n[o];return d?f?Tne(f,d):d:f||cT}return n[o]||cT}}},c3=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=c3(e,t+1,a);if(f)return f}const o=n.validators;if(o===null)return;const c=t===0?e.join(cy):e.slice(t).join(cy),d=o.length;for(let f=0;f<d;f++){const p=o[f];if(p.validator(c))return p.classGroupId}},Mne=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Rne+r:void 0})(),Ine=e=>{const{theme:t,classGroups:n}=e;return Lne(n,t)},Lne=(e,t)=>{const n=l3();for(const r in e){const i=e[r];yk(i,n,r,t)}return n},yk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const o=e[a];$ne(o,t,n,r)}},$ne=(e,t,n,r)=>{if(typeof e=="string"){Bne(e,t,n);return}if(typeof e=="function"){Une(e,t,n,r);return}qne(e,t,n,r)},Bne=(e,t,n)=>{const r=e===""?t:u3(t,e);r.classGroupId=n},Une=(e,t,n,r)=>{if(Fne(e)){yk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Pne(n,e))},qne=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let o=0;o<a;o++){const[c,d]=i[o];yk(d,u3(t,c),n,r)}},u3=(e,t)=>{let n=e;const r=t.split(cy),i=r.length;for(let a=0;a<i;a++){const o=r[a];let c=n.nextPart.get(o);c||(c=l3(),n.nextPart.set(o,c)),n=c}return n},Fne=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Hne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},o1="!",uT=":",Kne=[],dT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Gne=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let o=0,c=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const j=i[b];if(o===0&&c===0){if(j===uT){a.push(i.slice(d,b)),d=b+1;continue}if(j==="/"){f=b;continue}}j==="["?o++:j==="]"?o--:j==="("?c++:j===")"&&c--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(o1)?(y=m.slice(0,-1),v=!0):m.startsWith(o1)&&(y=m.slice(1),v=!0);const S=f&&f>d?f-d:void 0;return dT(a,v,y,S)};if(t){const i=t+uT,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):dT(Kne,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Vne=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],c=o[0]==="[",d=t.has(o);c||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},Qne=e=>({cache:Hne(e.cacheSize),parseClassName:Gne(e),sortModifiers:Vne(e),...Dne(e)}),Yne=/\s+/,Wne=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],c=e.trim().split(Yne);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!b,k=r(j?S.substring(0,b):S);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(S),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const E=y.length===0?"":y.length===1?y[0]:a(y).join(":"),C=v?E+o1:E,O=C+k;if(o.indexOf(O)>-1)continue;o.push(O);const z=i(k,j);for(let A=0;A<z.length;++A){const _=z[A];o.push(C+_)}d=p+(d.length>0?" "+d:d)}return d},Zne=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=d3(n))&&(i&&(i+=" "),i+=r);return i},d3=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=d3(e[r]))&&(n&&(n+=" "),n+=t);return n},Xne=(e,...t)=>{let n,r,i,a;const o=d=>{const f=t.reduce((p,m)=>m(p),e());return n=Qne(f),r=n.cache.get,i=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=Wne(d,n);return i(d,p),p};return a=o,(...d)=>a(Zne(...d))},Jne=[],qn=e=>{const t=n=>n[e]||Jne;return t.isThemeGetter=!0,t},f3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,h3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ere=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,tre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nre=/\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$/,rre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ire=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,are=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fo=e=>ere.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),ho=e=>!!e&&Number.isInteger(Number(e)),Cw=e=>e.endsWith("%")&&dt(e.slice(0,-1)),vs=e=>tre.test(e),p3=()=>!0,sre=e=>nre.test(e)&&!rre.test(e),vk=()=>!1,ore=e=>ire.test(e),lre=e=>are.test(e),cre=e=>!Le(e)&&!$e(e),ure=e=>Ko(e,y3,vk),Le=e=>f3.test(e),ml=e=>Ko(e,v3,sre),fT=e=>Ko(e,vre,dt),dre=e=>Ko(e,b3,p3),fre=e=>Ko(e,x3,vk),hT=e=>Ko(e,m3,vk),hre=e=>Ko(e,g3,lre),Mm=e=>Ko(e,w3,ore),$e=e=>h3.test(e),Af=e=>dc(e,v3),pre=e=>dc(e,x3),pT=e=>dc(e,m3),mre=e=>dc(e,y3),gre=e=>dc(e,g3),Im=e=>dc(e,w3,!0),yre=e=>dc(e,b3,!0),Ko=(e,t,n)=>{const r=f3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},dc=(e,t,n=!1)=>{const r=h3.exec(e);return r?r[1]?t(r[1]):n:!1},m3=e=>e==="position"||e==="percentage",g3=e=>e==="image"||e==="url",y3=e=>e==="length"||e==="size"||e==="bg-size",v3=e=>e==="length",vre=e=>e==="number",x3=e=>e==="family-name",b3=e=>e==="number"||e==="weight",w3=e=>e==="shadow",xre=()=>{const e=qn("color"),t=qn("font"),n=qn("text"),r=qn("font-weight"),i=qn("tracking"),a=qn("leading"),o=qn("breakpoint"),c=qn("container"),d=qn("spacing"),f=qn("radius"),p=qn("shadow"),m=qn("inset-shadow"),y=qn("text-shadow"),v=qn("drop-shadow"),S=qn("blur"),b=qn("perspective"),j=qn("aspect"),k=qn("ease"),E=qn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...O(),$e,Le],A=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],R=()=>[$e,Le,d],$=()=>[fo,"full","auto",...R()],F=()=>[ho,"none","subgrid",$e,Le],q=()=>["auto",{span:["full",ho,$e,Le]},ho,$e,Le],B=()=>[ho,"auto",$e,Le],V=()=>["auto","min","max","fr",$e,Le],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],J=()=>[fo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],ue=()=>[fo,"screen","full","dvw","lvw","svw","min","max","fit",...R()],we=()=>[fo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],I=()=>[e,$e,Le],D=()=>[...O(),pT,hT,{position:[$e,Le]}],U=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",mre,ure,{size:[$e,Le]}],Q=()=>[Cw,Af,ml],oe=()=>["","none","full",f,$e,Le],ne=()=>["",dt,Af,ml],Ae=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[dt,Cw,pT,hT],he=()=>["","none",S,$e,Le],Ee=()=>["none",dt,$e,Le],G=()=>["none",dt,$e,Le],Fe=()=>[dt,$e,Le],De=()=>[fo,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[vs],breakpoint:[vs],color:[p3],container:[vs],"drop-shadow":[vs],ease:["in","out","in-out"],font:[cre],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[vs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[vs],shadow:[vs],spacing:["px",dt],text:[vs],"text-shadow":[vs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fo,Le,$e,j]}],container:["container"],columns:[{columns:[dt,Le,$e,c]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:z()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[ho,"auto",$e,Le]}],basis:[{basis:[fo,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,fo,"auto","initial","none",Le]}],grow:[{grow:["",dt,$e,Le]}],shrink:[{shrink:["",dt,$e,Le]}],order:[{order:[ho,"first","last","none",$e,Le]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m: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":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...ue()]}],"min-inline-size":[{"min-inline":["auto",...ue()]}],"max-inline-size":[{"max-inline":["none",...ue()]}],"block-size":[{block:["auto",...we()]}],"min-block-size":[{"min-block":["auto",...we()]}],"max-block-size":[{"max-block":["none",...we()]}],w:[{w:[c,"screen",...J()]}],"min-w":[{"min-w":[c,"screen","none",...J()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[o]},...J()]}],h:[{h:["screen","lh",...J()]}],"min-h":[{"min-h":["screen","lh","none",...J()]}],"max-h":[{"max-h":["screen","lh",...J()]}],"font-size":[{text:["base",n,Af,ml]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,yre,dre]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cw,Le]}],"font-family":[{font:[pre,fre,t]}],"font-features":[{"font-features":[Le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,$e,Le]}],"line-clamp":[{"line-clamp":[dt,"none",$e,fT]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",$e,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",$e,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",$e,ml]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[dt,"auto",$e,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e,Le]}],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",$e,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:U()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ho,$e,Le],radial:["",$e,Le],conic:[ho,$e,Le]},gre,hre]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ae(),"hidden","none"]}],"divide-style":[{divide:[...Ae(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...Ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,$e,Le]}],"outline-w":[{outline:["",dt,Af,ml]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",p,Im,Mm]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",m,Im,Mm]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[dt,ml]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",y,Im,Mm]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[dt,$e,Le]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"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":[dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":ee()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ee()}],"mask-image-t-to-pos":[{"mask-t-to":ee()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ee()}],"mask-image-r-to-pos":[{"mask-r-to":ee()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ee()}],"mask-image-b-to-pos":[{"mask-b-to":ee()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ee()}],"mask-image-l-to-pos":[{"mask-l-to":ee()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ee()}],"mask-image-x-to-pos":[{"mask-x-to":ee()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ee()}],"mask-image-y-to-pos":[{"mask-y-to":ee()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[$e,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":ee()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":ee()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:U()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",$e,Le]}],filter:[{filter:["","none",$e,Le]}],blur:[{blur:he()}],brightness:[{brightness:[dt,$e,Le]}],contrast:[{contrast:[dt,$e,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,Im,Mm]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",dt,$e,Le]}],"hue-rotate":[{"hue-rotate":[dt,$e,Le]}],invert:[{invert:["",dt,$e,Le]}],saturate:[{saturate:[dt,$e,Le]}],sepia:[{sepia:["",dt,$e,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",$e,Le]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[dt,$e,Le]}],"backdrop-contrast":[{"backdrop-contrast":[dt,$e,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,$e,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,$e,Le]}],"backdrop-invert":[{"backdrop-invert":["",dt,$e,Le]}],"backdrop-opacity":[{"backdrop-opacity":[dt,$e,Le]}],"backdrop-saturate":[{"backdrop-saturate":[dt,$e,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,$e,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",$e,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",$e,Le]}],ease:[{ease:["linear","initial",k,$e,Le]}],delay:[{delay:[dt,$e,Le]}],animate:[{animate:["none",E,$e,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,$e,Le]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:Fe()}],"skew-x":[{"skew-x":Fe()}],"skew-y":[{"skew-y":Fe()}],transform:[{transform:[$e,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:De()}],"translate-x":[{"translate-x":De()}],"translate-y":[{"translate-y":De()}],"translate-z":[{"translate-z":De()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"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",$e,Le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e,Le]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[dt,Af,ml,fT]}],stroke:[{stroke:["none",...I()]}],"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"]}},bre=Xne(xre);function ta(...e){return bre(Rt(e))}const wre=o3("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"}}),ge=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const o=r?Cne:"button";return l.jsx(o,{ref:a,className:ta(wre({variant:t,size:n,className:e})),...i})});ge.displayName="Button";const Sre=o3("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 S3({className:e,variant:t,...n}){return l.jsx("div",{className:ta(Sre({variant:t}),e),...n})}function mT({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return l.jsxs(jt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[l.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),l.jsxs("span",{className:"brand-copy",children:[l.jsx("span",{className:"brand-mark",children:"Canonry"}),n?l.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function Ql({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 l.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 ct({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return l.jsx(S3,{variant:r,...n,children:t})}function Rv({status:e}){return l.jsx(ct,{tone:t3(e),children:zv(e)})}function zo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function jre(e,t){const n=x.createContext(t),r=a=>{const{children:o,...c}=a,d=x.useMemo(()=>c,Object.values(c));return l.jsx(n.Provider,{value:d,children:o})};r.displayName=e+"Provider";function i(a){const o=x.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Nre(e,t=[]){let n=[];function r(a,o){const c=x.createContext(o),d=n.length;n=[...n,o];const f=m=>{const{scope:y,children:v,...S}=m,b=y?.[e]?.[d]||c,j=x.useMemo(()=>S,Object.values(S));return l.jsx(b.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||c,S=x.useContext(v);if(S)return S;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(o=>x.createContext(o));return function(c){const d=c?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,kre(i,...t)]}function kre(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(a){const o=r.reduce((c,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...c,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var yh=globalThis?.document?x.useLayoutEffect:()=>{},Cre=yv[" useId ".trim().toString()]||(()=>{}),Are=0;function Aw(e){const[t,n]=x.useState(Cre());return yh(()=>{n(r=>r??String(Are++))},[e]),e||(t?`radix-${t}`:"")}var Ore=yv[" useInsertionEffect ".trim().toString()]||yh;function Ere({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,o]=_re({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"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.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const m=zre(p)?p(e):p;m!==e&&o.current?.(m)}else a(p)},[c,e,a,o]);return[d,f]}function _re({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return Ore(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function zre(e){return typeof e=="function"}function j3(e){const t=Tre(e),n=x.forwardRef((r,i)=>{const{children:a,...o}=r,c=x.Children.toArray(a),d=c.find(Rre);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return l.jsx(t,{...o,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return l.jsx(t,{...o,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function Tre(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const o=Mre(i),c=Dre(a,i.props);return i.type!==x.Fragment&&(c.ref=r?gk(r,o):o),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Pre=Symbol("radix.slottable");function Rre(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Pre}function Dre(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Mre(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 Ire=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ds=Ire.reduce((e,t)=>{const n=j3(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:o,...c}=i,d=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Lre(e,t){e&&lc.flushSync(()=>e.dispatchEvent(t))}function vh(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function $re(e,t=globalThis?.document){const n=vh(e);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Bre="DismissableLayer",l1="dismissableLayer.update",Ure="dismissableLayer.pointerDownOutside",qre="dismissableLayer.focusOutside",gT,N3=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),k3=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:c,...d}=e,f=x.useContext(N3),[p,m]=x.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),S=uc(t,_=>m(_)),b=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=b.indexOf(j),E=p?b.indexOf(p):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,O=E>=k,z=Kre(_=>{const R=_.target,$=[...f.branches].some(F=>F.contains(R));!O||$||(i?.(_),o?.(_),_.defaultPrevented||c?.())},y),A=Gre(_=>{const R=_.target;[...f.branches].some(F=>F.contains(R))||(a?.(_),o?.(_),_.defaultPrevented||c?.())},y);return $re(_=>{E===f.layers.size-1&&(r?.(_),!_.defaultPrevented&&c&&(_.preventDefault(),c()))},y),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(gT=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),yT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=gT)}},[p,y,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),yT())},[p,f]),x.useEffect(()=>{const _=()=>v({});return document.addEventListener(l1,_),()=>document.removeEventListener(l1,_)},[]),l.jsx(Ds.div,{...d,ref:S,style:{pointerEvents:C?O?"auto":"none":void 0,...e.style},onFocusCapture:zo(e.onFocusCapture,A.onFocusCapture),onBlurCapture:zo(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:zo(e.onPointerDownCapture,z.onPointerDownCapture)})});k3.displayName=Bre;var Fre="DismissableLayerBranch",Hre=x.forwardRef((e,t)=>{const n=x.useContext(N3),r=x.useRef(null),i=uc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),l.jsx(Ds.div,{...e,ref:i})});Hre.displayName=Fre;function Kre(e,t=globalThis?.document){const n=vh(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let d=function(){C3(Ure,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Gre(e,t=globalThis?.document){const n=vh(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&C3(qre,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yT(){const e=new CustomEvent(l1);document.dispatchEvent(e)}function C3(e,t,n,{discrete:r}){const i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Lre(i,a):i.dispatchEvent(a)}var Ow="focusScope.autoFocusOnMount",Ew="focusScope.autoFocusOnUnmount",vT={bubbles:!1,cancelable:!0},Vre="FocusScope",A3=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,d]=x.useState(null),f=vh(i),p=vh(a),m=x.useRef(null),y=uc(t,b=>d(b)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let b=function(C){if(v.paused||!c)return;const O=C.target;c.contains(O)?m.current=O:go(m.current,{select:!0})},j=function(C){if(v.paused||!c)return;const O=C.relatedTarget;O!==null&&(c.contains(O)||go(m.current,{select:!0}))},k=function(C){if(document.activeElement===document.body)for(const z of C)z.removedNodes.length>0&&go(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const E=new MutationObserver(k);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),E.disconnect()}}},[r,c,v.paused]),x.useEffect(()=>{if(c){bT.add(v);const b=document.activeElement;if(!c.contains(b)){const k=new CustomEvent(Ow,vT);c.addEventListener(Ow,f),c.dispatchEvent(k),k.defaultPrevented||(Qre(Jre(O3(c)),{select:!0}),document.activeElement===b&&go(c))}return()=>{c.removeEventListener(Ow,f),setTimeout(()=>{const k=new CustomEvent(Ew,vT);c.addEventListener(Ew,p),c.dispatchEvent(k),k.defaultPrevented||go(b??document.body,{select:!0}),c.removeEventListener(Ew,p),bT.remove(v)},0)}}},[c,f,p,v]);const S=x.useCallback(b=>{if(!n&&!r||v.paused)return;const j=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,k=document.activeElement;if(j&&k){const E=b.currentTarget,[C,O]=Yre(E);C&&O?!b.shiftKey&&k===O?(b.preventDefault(),n&&go(C,{select:!0})):b.shiftKey&&k===C&&(b.preventDefault(),n&&go(O,{select:!0})):k===E&&b.preventDefault()}},[n,r,v.paused]);return l.jsx(Ds.div,{tabIndex:-1,...o,ref:y,onKeyDown:S})});A3.displayName=Vre;function Qre(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(go(r,{select:t}),document.activeElement!==n)return}function Yre(e){const t=O3(e),n=xT(t,e),r=xT(t.reverse(),e);return[n,r]}function O3(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xT(e,t){for(const n of e)if(!Wre(n,{upTo:t}))return n}function Wre(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 Zre(e){return e instanceof HTMLInputElement&&"select"in e}function go(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zre(e)&&t&&e.select()}}var bT=Xre();function Xre(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=wT(e,t),e.unshift(t)},remove(t){e=wT(e,t),e[0]?.resume()}}}function wT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Jre(e){return e.filter(t=>t.tagName!=="A")}var eie="Portal",E3=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);yh(()=>a(!0),[]);const o=n||i&&globalThis?.document?.body;return o?zG.createPortal(l.jsx(Ds.div,{...r,ref:t}),o):null});E3.displayName=eie;function tie(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Dv=e=>{const{present:t,children:n}=e,r=nie(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=uc(r.ref,rie(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};Dv.displayName="Presence";function nie(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),o=e?"mounted":"unmounted",[c,d]=tie(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Lm(r.current);a.current=c==="mounted"?f:"none"},[c]),yh(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=Lm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),yh(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=Lm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},y=v=>{v.target===t&&(a.current=Lm(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Lm(e){return e?.animationName||"none"}function rie(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 _w=0;function iie(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ST()),document.body.insertAdjacentElement("beforeend",e[1]??ST()),_w++,()=>{_w===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_w--}},[])}function ST(){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 Ma=function(){return Ma=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Ma.apply(this,arguments)};function _3(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function aie(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ag="right-scroll-bar-position",Og="width-before-scroll-bar",sie="with-scroll-bars-hidden",oie="--removed-body-scroll-bar-size";function zw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lie(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var cie=typeof window<"u"?x.useLayoutEffect:x.useEffect,jT=new WeakMap;function uie(e,t){var n=lie(null,function(r){return e.forEach(function(i){return zw(i,r)})});return cie(function(){var r=jT.get(n);if(r){var i=new Set(r),a=new Set(e),o=n.current;i.forEach(function(c){a.has(c)||zw(c,null)}),a.forEach(function(c){i.has(c)||zw(c,o)})}jT.set(n,e)},[e]),n}function die(e){return e}function fie(e,t){t===void 0&&(t=die);var n=[],r=!1,i={read:function(){if(r)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(a){var o=t(a,r);return n.push(o),function(){n=n.filter(function(c){return c!==o})}},assignSyncMedium:function(a){for(r=!0;n.length;){var o=n;n=[],o.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var o=[];if(n.length){var c=n;n=[],c.forEach(a),o=n}var d=function(){var p=o;o=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){o.push(p),f()},filter:function(p){return o=o.filter(p),n}}}};return i}function hie(e){e===void 0&&(e={});var t=fie(null);return t.options=Ma({async:!0,ssr:!1},e),t}var z3=function(e){var t=e.sideCar,n=_3(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ma({},n))};z3.isSideCarExport=!0;function pie(e,t){return e.useMedium(t),z3}var T3=hie(),Tw=function(){},Mv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:Tw,onWheelCapture:Tw,onTouchMoveCapture:Tw}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,S=e.noIsolation,b=e.inert,j=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,C=e.gapMode,O=_3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=y,A=uie([n,t]),_=Ma(Ma({},O),i);return x.createElement(x.Fragment,null,p&&x.createElement(z,{sideCar:T3,removeScrollBar:f,shards:m,noRelative:v,noIsolation:S,inert:b,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:C}),o?x.cloneElement(x.Children.only(c),Ma(Ma({},_),{ref:A})):x.createElement(E,Ma({},_,{className:d,ref:A}),c))});Mv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mv.classNames={fullWidth:Og,zeroRight:Ag};var mie=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gie(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mie();return t&&e.setAttribute("nonce",t),e}function yie(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vie(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xie=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gie())&&(yie(t,n),vie(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bie=function(){var e=xie();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},P3=function(){var e=bie(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},wie={left:0,top:0,right:0,gap:0},Pw=function(e){return parseInt(e||"",10)||0},Sie=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Pw(n),Pw(r),Pw(i)]},jie=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wie;var t=Sie(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Nie=P3(),Tu="data-scroll-locked",kie=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
+
.`.concat(sie,` {
|
|
54
|
+
overflow: hidden `).concat(r,`;
|
|
55
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
56
|
+
}
|
|
57
|
+
body[`).concat(Tu,`] {
|
|
58
|
+
overflow: hidden `).concat(r,`;
|
|
59
|
+
overscroll-behavior: contain;
|
|
60
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
61
|
+
padding-left: `.concat(i,`px;
|
|
62
|
+
padding-top: `).concat(a,`px;
|
|
63
|
+
padding-right: `).concat(o,`px;
|
|
64
|
+
margin-left:0;
|
|
65
|
+
margin-top:0;
|
|
66
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
67
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.`).concat(Ag,` {
|
|
71
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.`).concat(Og,` {
|
|
75
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(Ag," .").concat(Ag,` {
|
|
79
|
+
right: 0 `).concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(Og," .").concat(Og,` {
|
|
83
|
+
margin-right: 0 `).concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
body[`).concat(Tu,`] {
|
|
87
|
+
`).concat(oie,": ").concat(c,`px;
|
|
88
|
+
}
|
|
89
|
+
`)},NT=function(){var e=parseInt(document.body.getAttribute(Tu)||"0",10);return isFinite(e)?e:0},Cie=function(){x.useEffect(function(){return document.body.setAttribute(Tu,(NT()+1).toString()),function(){var e=NT()-1;e<=0?document.body.removeAttribute(Tu):document.body.setAttribute(Tu,e.toString())}},[])},Aie=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Cie();var a=x.useMemo(function(){return jie(i)},[i]);return x.createElement(Nie,{styles:kie(a,!t,i,n?"":"!important")})},c1=!1;if(typeof window<"u")try{var $m=Object.defineProperty({},"passive",{get:function(){return c1=!0,!0}});window.addEventListener("test",$m,$m),window.removeEventListener("test",$m,$m)}catch{c1=!1}var nu=c1?{passive:!1}:!1,Oie=function(e){return e.tagName==="TEXTAREA"},R3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Oie(e)&&n[t]==="visible")},Eie=function(e){return R3(e,"overflowY")},_ie=function(e){return R3(e,"overflowX")},kT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=D3(e,r);if(i){var a=M3(e,r),o=a[1],c=a[2];if(o>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},zie=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Tie=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},D3=function(e,t){return e==="v"?Eie(t):_ie(t)},M3=function(e,t){return e==="v"?zie(t):Tie(t)},Pie=function(e,t){return e==="h"&&t==="rtl"?-1:1},Rie=function(e,t,n,r,i){var a=Pie(e,window.getComputedStyle(t).direction),o=a*r,c=n.target,d=t.contains(c),f=!1,p=o>0,m=0,y=0;do{if(!c)break;var v=M3(e,c),S=v[0],b=v[1],j=v[2],k=b-j-a*S;(S||k)&&D3(e,c)&&(m+=k,y+=S);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(f=!0),f},Bm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},CT=function(e){return[e.deltaX,e.deltaY]},AT=function(e){return e&&"current"in e?e.current:e},Die=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Mie=function(e){return`
|
|
90
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
+
`)},Iie=0,ru=[];function Lie(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(Iie++)[0],a=x.useState(P3)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=aie([e.lockRef.current],(e.shards||[]).map(AT),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!o.current.allowPinchZoom;var k=Bm(b),E=n.current,C="deltaX"in b?b.deltaX:E[0]-k[0],O="deltaY"in b?b.deltaY:E[1]-k[1],z,A=b.target,_=Math.abs(C)>Math.abs(O)?"h":"v";if("touches"in b&&_==="h"&&A.type==="range")return!1;var R=window.getSelection(),$=R&&R.anchorNode,F=$?$===A||$.contains(A):!1;if(F)return!1;var q=kT(_,A);if(!q)return!0;if(q?z=_:(z=_==="v"?"h":"v",q=kT(_,A)),!q)return!1;if(!r.current&&"changedTouches"in b&&(C||O)&&(r.current=z),!z)return!0;var B=r.current||z;return Rie(B,j,b,B==="h"?C:O)},[]),d=x.useCallback(function(b){var j=b;if(!(!ru.length||ru[ru.length-1]!==a)){var k="deltaY"in j?CT(j):Bm(j),E=t.current.filter(function(z){return z.name===j.type&&(z.target===j.target||j.target===z.shadowParent)&&Die(z.delta,k)})[0];if(E&&E.should){j.cancelable&&j.preventDefault();return}if(!E){var C=(o.current.shards||[]).map(AT).filter(Boolean).filter(function(z){return z.contains(j.target)}),O=C.length>0?c(j,C[0]):!o.current.noIsolation;O&&j.cancelable&&j.preventDefault()}}},[]),f=x.useCallback(function(b,j,k,E){var C={name:b,delta:j,target:k,should:E,shadowParent:$ie(k)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(O){return O!==C})},1)},[]),p=x.useCallback(function(b){n.current=Bm(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,CT(b),b.target,c(b,e.lockRef.current))},[]),y=x.useCallback(function(b){f(b.type,Bm(b),b.target,c(b,e.lockRef.current))},[]);x.useEffect(function(){return ru.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,nu),document.addEventListener("touchmove",d,nu),document.addEventListener("touchstart",p,nu),function(){ru=ru.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,nu),document.removeEventListener("touchmove",d,nu),document.removeEventListener("touchstart",p,nu)}},[]);var v=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(a,{styles:Mie(i)}):null,v?x.createElement(Aie,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function $ie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Bie=pie(T3,Lie);var I3=x.forwardRef(function(e,t){return x.createElement(Mv,Ma({},e,{ref:t,sideCar:Bie}))});I3.classNames=Mv.classNames;var Uie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},iu=new WeakMap,Um=new WeakMap,qm={},Rw=0,L3=function(e){return e&&(e.host||L3(e.parentNode))},qie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=L3(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Fie=function(e,t,n,r){var i=qie(t,Array.isArray(e)?e:[e]);qm[n]||(qm[n]=new WeakMap);var a=qm[n],o=[],c=new Set,d=new Set(i),f=function(m){!m||c.has(m)||(c.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(y){if(c.has(y))p(y);else try{var v=y.getAttribute(r),S=v!==null&&v!=="false",b=(iu.get(y)||0)+1,j=(a.get(y)||0)+1;iu.set(y,b),a.set(y,j),o.push(y),b===1&&S&&Um.set(y,!0),j===1&&y.setAttribute(n,"true"),S||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),c.clear(),Rw++,function(){o.forEach(function(m){var y=iu.get(m)-1,v=a.get(m)-1;iu.set(m,y),a.set(m,v),y||(Um.has(m)||m.removeAttribute(r),Um.delete(m)),v||m.removeAttribute(n)}),Rw--,Rw||(iu=new WeakMap,iu=new WeakMap,Um=new WeakMap,qm={})}},Hie=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Uie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Fie(r,i,n,"aria-hidden")):function(){return null}},Iv="Dialog",[$3]=Nre(Iv),[Kie,wa]=$3(Iv),B3=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=x.useRef(null),d=x.useRef(null),[f,p]=Ere({prop:r,defaultProp:i??!1,onChange:a,caller:Iv});return l.jsx(Kie,{scope:t,triggerRef:c,contentRef:d,contentId:Aw(),titleId:Aw(),descriptionId:Aw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:o,children:n})};B3.displayName=Iv;var U3="DialogTrigger",Gie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wa(U3,n),a=uc(t,i.triggerRef);return l.jsx(Ds.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":wk(i.open),...r,ref:a,onClick:zo(e.onClick,i.onOpenToggle)})});Gie.displayName=U3;var xk="DialogPortal",[Vie,q3]=$3(xk,{forceMount:void 0}),F3=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=wa(xk,t);return l.jsx(Vie,{scope:t,forceMount:n,children:x.Children.map(r,o=>l.jsx(Dv,{present:n||a.open,children:l.jsx(E3,{asChild:!0,container:i,children:o})}))})};F3.displayName=xk;var uy="DialogOverlay",H3=x.forwardRef((e,t)=>{const n=q3(uy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wa(uy,e.__scopeDialog);return a.modal?l.jsx(Dv,{present:r||a.open,children:l.jsx(Yie,{...i,ref:t})}):null});H3.displayName=uy;var Qie=j3("DialogOverlay.RemoveScroll"),Yie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wa(uy,n);return l.jsx(I3,{as:Qie,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Ds.div,{"data-state":wk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Yl="DialogContent",K3=x.forwardRef((e,t)=>{const n=q3(Yl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wa(Yl,e.__scopeDialog);return l.jsx(Dv,{present:r||a.open,children:a.modal?l.jsx(Wie,{...i,ref:t}):l.jsx(Zie,{...i,ref:t})})});K3.displayName=Yl;var Wie=x.forwardRef((e,t)=>{const n=wa(Yl,e.__scopeDialog),r=x.useRef(null),i=uc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return Hie(a)},[]),l.jsx(G3,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:zo(e.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0;(o.button===2||c)&&a.preventDefault()}),onFocusOutside:zo(e.onFocusOutside,a=>a.preventDefault())})}),Zie=x.forwardRef((e,t)=>{const n=wa(Yl,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return l.jsx(G3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||n.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=a.target;n.triggerRef.current?.contains(o)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),G3=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,c=wa(Yl,n),d=x.useRef(null),f=uc(t,d);return iie(),l.jsxs(l.Fragment,{children:[l.jsx(A3,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:l.jsx(k3,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":wk(c.open),...o,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Xie,{titleId:c.titleId}),l.jsx(eae,{contentRef:d,descriptionId:c.descriptionId})]})]})}),bk="DialogTitle",V3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wa(bk,n);return l.jsx(Ds.h2,{id:i.titleId,...r,ref:t})});V3.displayName=bk;var Q3="DialogDescription",Y3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wa(Q3,n);return l.jsx(Ds.p,{id:i.descriptionId,...r,ref:t})});Y3.displayName=Q3;var W3="DialogClose",Z3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wa(W3,n);return l.jsx(Ds.button,{type:"button",...r,ref:t,onClick:zo(e.onClick,()=>i.onOpenChange(!1))})});Z3.displayName=W3;function wk(e){return e?"open":"closed"}var X3="DialogTitleWarning",[yze,J3]=jre(X3,{contentName:Yl,titleName:bk,docsSlug:"dialog"}),Xie=({titleId:e})=>{const t=J3(X3),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
93
|
+
|
|
94
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
95
|
+
|
|
96
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Jie="DialogDescriptionWarning",eae=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${J3(Jie).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},e$=B3,t$=F3,Sk=H3,jk=K3,Nk=V3,n$=Y3,r$=Z3;const i$=e$,tae=t$,a$=x.forwardRef(({className:e,...t},n)=>l.jsx(Sk,{ref:n,className:ta("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));a$.displayName=Sk.displayName;const nae=400,rae=1200,iae=720,kk=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(iae),o=x.useRef(!1),c=x.useRef(0),d=x.useRef(0),f=x.useCallback(y=>{o.current=!0,c.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=x.useCallback(y=>{if(!o.current)return;const v=c.current-y.clientX,S=Math.min(rae,Math.max(nae,d.current+v));a(S)},[]),m=x.useCallback(()=>{o.current=!1},[]);return l.jsxs(tae,{children:[l.jsx(a$,{}),l.jsxs(jk,{ref:r,className:ta("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(${i}px, 100vw)`},...n,children:[l.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:f,onPointerMove:p,onPointerUp:m}),t,l.jsxs(r$,{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:[l.jsx(cd,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});kk.displayName=jk.displayName;const s$=({className:e,...t})=>l.jsx("div",{className:ta("flex flex-col gap-1.5 pr-10",e),...t}),Ck=x.forwardRef(({className:e,...t},n)=>l.jsx(Nk,{ref:n,className:ta("text-lg font-medium text-zinc-50",e),...t}));Ck.displayName=Nk.displayName;const Ak=x.forwardRef(({className:e,...t},n)=>l.jsx(n$,{ref:n,className:ta("text-sm text-zinc-500",e),...t}));Ak.displayName=n$.displayName;function aae({title:e,subtitle:t,children:n,open:r,onClose:i}){return l.jsx(i$,{open:r,onOpenChange:a=>a?void 0:i(),children:l.jsxs(kk,{children:[l.jsxs(s$,{className:"drawer-head",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),l.jsx(Ck,{id:"drawer-title",children:e}),l.jsx(Ak,{className:"sr-only",children:t})]}),l.jsx("div",{className:"drawer-body",children:n})]})})}function mr({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const o=r.current.getBoundingClientRect();n({top:o.top,left:o.left+o.width/2})},[]),a=x.useCallback(()=>n(null),[]);return l.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[l.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&lc.createPortal(l.jsx("span",{role:"tooltip",style:{position:"fixed",top:t.top,left:t.left,transform:"translateX(-50%) translateY(calc(-100% - 8px))",zIndex:9999,pointerEvents:"none",width:"14rem",padding:"0.5rem 0.75rem",fontSize:"11px",fontWeight:400,textTransform:"none",letterSpacing:"normal",lineHeight:"1rem",color:"#d4d4d8",backgroundColor:"#18181b",border:"1px solid rgba(63, 63, 70, 0.6)",borderRadius:"0.5rem",boxShadow:"0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1)"},children:e}),document.body)]})}const sae=/[\s\-_]+/;function oae(e){const t=e.split(sae).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function OT(e,t){const n=lae(t),r=e.split(/(\*\*[^*]+\*\*)/).filter(Boolean).map(f=>f.startsWith("**")&&f.endsWith("**")?{type:"bold",value:f.slice(2,-2)}:{type:"text",value:f}),i=n.flatMap(f=>f.terms).filter(f=>f.trim().length>1);if(i.length===0)return r.map((f,p)=>f.type==="bold"?Hi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const o=[...i].sort((f,p)=>p.length-f.length).map(oae).filter(f=>!!f);if(o.length===0)return r.map((f,p)=>f.type==="bold"?Hi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const c=new RegExp(`(${o.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=sy(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(c).map((y,v)=>{if(!y)return null;if(v%2===1){const b=d.get(sy(y))??"answer-highlight";return f.type==="bold"?Hi.createElement("mark",{key:`hl-${p}-${v}`,className:b},Hi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Hi.createElement("mark",{key:`hl-${p}-${v}`,className:b},y)}return f.type==="bold"?Hi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function lae(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Dw(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 cae({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,o]=x.useState("mentions"),[c,d]=x.useState(-1),[f,p]=x.useState(null),[m,y]=x.useState(!1),[v,S]=x.useState({}),b=_ee(t.project),j=new Set(b.map(iy)),k=e.runHistory,E=k.length>1,[C,O]=x.useState(null),z=x.useRef(!1);x.useEffect(()=>{if(z.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const Q=k.at(-1);Q&&(z.current=!0,Kl(Q.runId).then(oe=>{const ne=oe.snapshots.find(Ae=>Ae.query===e.query&&Ae.provider===e.provider);ne&&O({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:Q.visibilityTransition,provider:ne.provider,model:ne.model??e.model,answerSnippet:ne.answerText??e.answerSnippet,citedDomains:ne.citedDomains??e.citedDomains,competitorDomains:ne.competitorOverlap??e.competitorDomains,recommendedCompetitors:ne.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??e.matchedTerms??[],groundingSources:ne.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const A=c>=0&&f!==null,_=A?f:C||{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},R=_.visibilityState==="pending"||_.citationState==="pending",$=R?!1:_.visibilityState!=null?_.visibilityState==="visible":_.answerMentioned!=null?_.answerMentioned:_.citationState===gh.cited||_.citationState==="emerging",F=_.answerMentioned!=null||_.visibilityState!=null||_.recommendedCompetitors.length>0,q=_.citedDomains.length>0||_.groundingSources.length>0||_.evidenceUrls.length>0,B=t.project.displayName||t.project.name,V=[...b.map(iy),B,B.split(" ").slice(0,2).join(" "),..._.matchedTerms].filter(Q=>Q.trim().length>2),X=[..._.competitorDomains.flatMap(Q=>{const oe=Eee(Q);return oe.length>=4?[oe]:[]}),..._.recommendedCompetitors].filter(Q=>Q.trim().length>2),Z=[{terms:V,className:"answer-highlight-brand"},...X.length>0?[{terms:X,className:"answer-highlight-competitor"}]:[]],H=R?"pending":_.visibilityTransition==="lost"?"lost":$?"cited":"not-cited",J=x.useRef(0),ue=x.useCallback(async Q=>{const oe=++J.current;if(Q===-1||Q===k.length-1){d(-1),p(null),i(!1);return}d(Q),i(!1);const ne=k[Q],Ae=`${ne.runId}::${e.query}::${e.provider}`;if(v[Ae]){p(v[Ae]);return}y(!0);try{const _e=await Kl(ne.runId);if(oe!==J.current)return;const ee=_e.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider)??_e.snapshots.find(Ee=>Ee.query===e.query),he=ee?{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ne.visibilityTransition,provider:ee.provider,model:ee.model??null,answerSnippet:ee.answerText??"",citedDomains:ee.citedDomains,competitorDomains:ee.competitorOverlap,recommendedCompetitors:ee.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??[],groundingSources:ee.groundingSources,evidenceUrls:[],changeLabel:Dw(ne.visibilityTransition,ne.visibilityState),summary:""}:{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Dw(ne.visibilityTransition,ne.visibilityState),summary:"Snapshot data not available for this run."};S(Ee=>({...Ee,[Ae]:he})),p(he)}catch{if(oe!==J.current)return;p({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ne.visibilityTransition,provider:e.provider,model:ne.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Dw(ne.visibilityTransition,ne.visibilityState),summary:"Failed to load historical run data."})}finally{oe===J.current&&y(!1)}},[k,e.query,e.provider,v]),I=(A||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,D=!A&&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(" · "):"",U=$?{label:"Visible in answer",title:"Your brand or domain is mentioned in this answer",meta:I}:_.visibilityTransition==="lost"?{label:"Visibility lost",title:"Your brand no longer appears in this answer",meta:I}:R?{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:I},M=()=>{if(!_.answerSnippet)return null;const Q=_.answerSnippet.split(`
|
|
97
|
+
`),oe=[];let ne=[],Ae=0;const _e=()=>{if(ne.length===0)return;const ee=ne.join(" ").trim();ee&&oe.push(l.jsx("p",{className:oe.length>0?"mt-2.5":"",children:OT(ee,Z)},Ae++)),ne=[]};for(const ee of Q){const he=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(he)){_e(),oe.push(l.jsx("hr",{className:"border-zinc-800/60 my-3"},Ae++));continue}const Ee=he.match(/^(#{1,3})\s+(.+)$/);if(Ee){_e();const G=Ee[1].length,Fe=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],De=G===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":G===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";oe.push(l.jsx("p",{className:De,children:OT(Fe,Z)},Ae++));continue}if(he===""){_e();continue}ne.push(he)}return _e(),oe};return l.jsx(e$,{open:!0,onOpenChange:Q=>{Q||n()},children:l.jsxs(t$,{children:[l.jsx(Sk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),l.jsxs(jk,{className:"evidence-modal","aria-describedby":void 0,children:[l.jsxs("div",{className:"evidence-modal-header",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",_.provider||"All providers"]}),l.jsx(Nk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),l.jsxs(r$,{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:[l.jsx(cd,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&l.jsxs("div",{className:"evidence-modal-timeline",children:[l.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),l.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((Q,oe)=>{const ne=c===-1&&oe===k.length-1||c===oe,Ae=Q.visibilityState??(Q.answerMentioned?"visible":"not-visible"),_e=Q.visibilityTransition??Ae,ee=Ae==="visible"?"bg-emerald-400":_e==="emerging"?"bg-amber-400":_e==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(Q.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),G=!!(Q.model&&oe>0&&k[oe-1]?.model&&k[oe-1].model!==Q.model);return l.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>ue(oe===k.length-1?-1:oe),"aria-label":[`Run ${Ee}: ${Ae}`,Q.model?`model ${Q.model}`:null,G?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[l.jsx("span",{className:`size-2 rounded-full ${ee} ${G?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),l.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},oe)})}),c>=0&&c<k.length&&l.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[c].createdAt).toLocaleString()," ","—"," ",l.jsx("span",{className:"capitalize",children:k[c].visibilityState??(k[c].answerMentioned?"visible":"not-visible")}),l.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>ue(-1),children:["←"," Back to latest"]})]}),!A&&(e.modelTransitions?.length??0)>0&&l.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(Q=>l.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:`${Q.fromModel??"unknown"} -> ${Q.toModel??"unknown"} on ${new Date(Q.createdAt).toLocaleDateString()}`},`${Q.runId}:${Q.toModel??"unknown"}`))})]}),l.jsxs("div",{className:"evidence-modal-body",children:[m&&l.jsxs("div",{className:"md:col-span-2 flex items-center justify-center py-12 text-zinc-500 text-sm",children:["Loading historical run data","…"]}),!m&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"evidence-modal-main",children:[l.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[l.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:U.label}),l.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:U.title}),l.jsx("p",{className:"evidence-position-meta",children:U.meta}),D&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:D})]}),_.answerSnippet&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),l.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:M()}),_.answerSnippet.length>280&&l.jsx("button",{type:"button",className:"mt-1.5 text-xs text-zinc-500 hover:text-zinc-300 transition-colors",onClick:()=>i(!r),children:r?"↑ Collapse":"↓ Show full answer"})]}),!_.answerSnippet&&!m&&l.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"}),!A&&e.relatedTechnicalSignals.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:$?"Why you're visible":"What to fix"}),l.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((Q,oe)=>l.jsxs("div",{className:"action-item",children:[l.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?l.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):l.jsxs(l.Fragment,{children:[l.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),l.jsx("span",{className:"action-item-text",children:Q})]},oe))})]}),_.summary&&l.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:_.summary})]}),l.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||q)&&l.jsxs("div",{className:"sidebar-tabs",children:[l.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>o("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),l.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>o("sources"),type:"button",title:"Grounding links the model used to build the answer. These are supporting sources, not the primary visibility signal.",children:"Sources"})]}),a==="mentions"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Answer visibility"}),l.jsx(mr,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),l.jsxs("div",{className:`mention-status mention-status--${$?"visible":"not-visible"}`,children:[l.jsx("span",{className:"mention-status-icon",children:R?"…":$?"✓":"—"}),l.jsx("span",{className:"mention-status-label",children:R?"Pending":$?"Visible":"Not visible"})]}),_.matchedTerms.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.matchedTerms.map(Q=>l.jsx("span",{className:"mention-chip mention-chip--brand",children:Q},Q))})]}),!R&&!$&&_.matchedTerms.length===0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:V.map(Q=>l.jsx("span",{className:"mention-chip mention-chip--muted",children:Q},Q))}),l.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(_.recommendedCompetitors.length>0||_.competitorDomains.length>0)&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Competitors in answer"}),l.jsx(mr,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const Q=_.competitorDomains.map(Ae=>Ae.replace(/^www\./,"")),oe=new Set(Q.map(Ae=>sy(Ae.replace(/\.[^.]+$/,""))));return[..._.recommendedCompetitors.filter(Ae=>!oe.has(sy(Ae))),...Q].map(Ae=>l.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ae},Ae))})()})]})]}),a==="sources"&&l.jsxs(l.Fragment,{children:[_.citedDomains.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsx("span",{children:"Domains from source links"}),l.jsx(mr,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),l.jsx("div",{className:"citation-leaderboard",children:_.citedDomains.map((Q,oe)=>{const ne=Q.toLowerCase().replace(/^www\./,""),Ae=j.has(ne),_e=!Ae&&_.competitorDomains.some(he=>he.toLowerCase().replace(/^www\./,"")===ne),ee=Ae?"you":_e?"competitor":"other";return l.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[l.jsxs("span",{className:"citation-leaderboard-rank",children:["#",oe+1]}),l.jsx("span",{className:"citation-leaderboard-domain",children:Q}),Ae&&l.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),_e&&l.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},Q)})})]}),_.groundingSources.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"drawer-section-label flex items-center",children:[l.jsxs("span",{children:["Grounding source links (",_.groundingSources.length,")"]}),l.jsx(mr,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),l.jsx("ul",{className:"grid gap-0.5",children:_.groundingSources.map((Q,oe)=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:Q.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Q.title||Q.uri})},oe))})]}),_.evidenceUrls.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),l.jsx("ul",{className:"grid gap-1",children:_.evidenceUrls.map(Q=>l.jsx("li",{className:"truncate text-sm",children:l.jsx("a",{href:Q,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:Q})},Q))})]}),_.citedDomains.length===0&&_.groundingSources.length===0&&_.evidenceUrls.length===0&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",A?"for this run":"yet"]})]}),!F&&!q&&l.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",A?"for this run":"yet"]})]})]})]})]})]})})}function fa(e){const t=new Date("2026-02-20");return e.map((n,r)=>({runId:`run_mock_${r+1}`,citationState:n,createdAt:new Date(t.getTime()+r*2*24*60*60*1e3).toISOString()}))}const Mw=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],country:"US",language:"en",tags:["local intent","priority"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,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,autoExtractBacklinks:!1,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,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function Lv(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 uae=Lv({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"}),dae=Lv({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"}),fae=Lv({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"}),hae=Lv({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"}),pae=[{id:"evidence_citypoint_emergency_gemini",query:"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:fa(["cited","cited","cited","cited","cited","cited","cited","not-cited","not-cited"])},{id:"evidence_citypoint_emergency_openai",query:"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:fa(["not-cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_emergency_claude",query:"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:fa(["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",query:"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:fa(["not-cited","not-cited","not-cited","not-cited","not-cited","not-cited","cited"])},{id:"evidence_citypoint_invisalign_gemini",query:"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:fa(["cited","cited","cited","cited","cited","cited","cited","cited"])},{id:"evidence_citypoint_invisalign_claude",query:"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:fa(["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",query:"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:fa(["not-cited","not-cited","not-cited","not-cited"])},{id:"evidence_citypoint_children_gemini",query:"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:fa(["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",query:"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:fa(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Mw[0],Mw[1],fa(["cited","cited","cited","cited","cited"]),Mw[2],2/7,fa(["not-cited","not-cited","not-cited","cited"]);function mae(e,t){return e.projects.find(n=>n.project.id===t)}function gae(e,t){return e.runs.find(n=>n.id===t)}function yae(e,t){for(const n of e.projects){const r=n.visibilityEvidence.find(i=>i.id===t);if(r)return{project:n,evidence:r}}}const vae={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},xae={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},bae={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function wae(e){return{id:e.id,tone:vae[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??bae[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:xae[e.type]}]}}function Sae(e){return e.filter(t=>!t.dismissed).map(wae)}function o$(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,autoExtractBacklinks:e.autoExtractBacklinks??!1,configSource:e.configSource,configRevision:e.configRevision,createdAt:e.createdAt,updatedAt:e.updatedAt}}function ET(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function jae(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 r=Math.floor(n/1e3);if(r<60)return`${r}s`;const i=Math.floor(r/60),a=r%60;return`${i}m ${a}s`}function l$(e){switch(e){case Nt["answer-visibility"]:return"Answer visibility sweep";case Nt["gsc-sync"]:return"GSC sync";case Nt["inspect-sitemap"]:return"Sitemap inspection";case Nt["ga-sync"]:return"GA sync";case Nt["traffic-sync"]:return"Traffic sync";case Nt["bing-inspect"]:return"Bing URL inspection";case Nt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Nt["site-audit"]:return"Site audit";case Nt["backlink-extract"]:return"Backlink extract"}}function Nae(e){return e===eh.manual?"Manual":e===eh.scheduled?"Scheduled":e===eh["config-apply"]?"Config apply":e}function Ok(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:l$(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?ET(e.startedAt):ET(e.createdAt),duration:jae(e.startedAt,e.finishedAt),statusDetail:e.error?c$(e.error):kae(e),summary:Cae(e),triggerLabel:Nae(e.trigger)}}function c$(e){const t=ck(e);return t.length>200?t.slice(0,200)+"…":t}function kae(e){switch(e.status){case pr.queued:return"Waiting for execution slot.";case pr.running:return"Provider queries in progress.";case pr.completed:return"All queries checked.";case pr.partial:return"Run completed with some queries skipped.";case pr.failed:return e.error?c$(e.error):"Run failed.";case pr.cancelled:return"Run was cancelled.";default:return""}}function Cae(e){const t=l$(e.kind);switch(e.status){case pr.queued:return`${t} queued`;case pr.running:return`${t} in progress`;case pr.completed:return`${t} completed`;case pr.partial:return`${t} partially completed`;case pr.failed:return`${t} failed`;case pr.cancelled:return`${t} cancelled`;default:return e.status}}function Aae(e,t,n,r){const i=[];let a=0;const o=new Set;if(n){const c=new Map;for(const y of n.snapshots)if(y.query){const v=`${y.query}::${y.provider}`;c.set(v,y)}const d=new Set(n.snapshots.map(y=>y.provider)),f=new Set(t.flatMap(y=>Object.keys(y.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const y of t){if(y.runs.length===0)continue;o.add(y.query);const v=y.runs.at(-1),S=v?.transition??"not-cited";for(const b of m){const j=c.get(`${y.query}::${b}`),k=(y.providerRuns?.[b]?.length??0)>0;if(!j&&!k)continue;const E=j?.model??null,C=E?`${b}:${E}`:null,O=C?y.modelRuns?.[C]:void 0,z=y.providerRuns?.[b],A=(z?.length?z:null)??(O?.length?O:null),_=z?.length?"provider":O?.length?"model":"query",R=A?A.at(-1).transition:S,$=A?A.at(-1).visibilityTransition??(A.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=A?.at(-1)?.citationState,q=A?.at(-1)?.visibilityState,B=j?R==="lost"?"lost":R==="emerging"?"emerging":j.citationState===gh.cited?"cited":"not-cited":F===gh.cited?"cited":"not-cited",V=j?.visibilityState??(q==="visible"?"visible":q==="pending"?"pending":"not-visible"),X=_T(A||y.runs),Z=zT(A||y.runs),H=Oae(y,b),J=(A??y.runs).map(D=>({runId:D.runId,citationState:D.citationState,createdAt:D.createdAt,model:H.get(D.runId)??null,answerMentioned:D.answerMentioned,visibilityState:D.visibilityState,visibilityTransition:D.visibilityTransition})),ue=Eae(J),we=_==="provider"&&ue.length<=1?"model":_,I=_ae(J);i.push({id:`evidence_${e}_${a++}`,query:y.query,provider:j?.provider??b,model:j?.model??null,location:j?.location??null,citationState:B,answerMentioned:j?.answerMentioned,visibilityState:V,visibilityChangeLabel:TT($,Z,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:TT(R,X),answerSnippet:j?.answerText??"",citedDomains:j?.citedDomains??[],evidenceUrls:[],competitorDomains:j?.competitorOverlap??[],recommendedCompetitors:j?.recommendedCompetitors??[],matchedTerms:j?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:j?.groundingSources??[],summary:zae(V,$,y.query),runHistory:J,historyScope:we,modelsSeen:ue,modelTransitions:I})}}}for(const c of r)o.has(c.query)||i.push({id:`evidence_${e}_${a++}`,query:c.query,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:`"${c.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function Oae(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const o=i.slice(r.length),c=o==="unknown"?null:o;for(const d of a)n.set(d.runId,c)}return n}function Eae(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function _ae(e){const t=[];let n=null;for(const r of e){const i=r.model??null;i!==n&&n!==null&&t.push({runId:r.runId,createdAt:r.createdAt,fromModel:n,toModel:i}),n=i}return t}function _T(e){if(e.length===0)return 0;const t=e[e.length-1].citationState;let n=0;for(let r=e.length-1;r>=0&&e[r].citationState===t;r--)n++;return n}function zT(e){if(e.length===0)return 0;const t=e[e.length-1].visibilityState??"not-visible";let n=0;for(let r=e.length-1;r>=0&&(e[r].visibilityState??"not-visible")===t;r--)n++;return n}function TT(e,t,n){const r={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?`${Of(r.positive)} in latest run`:`${Of(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Of(r.first);case"not-cited":case"not-visible":return t<=1?`${Of(r.negative)} in latest run`:`${Of(r.negative)} across ${t} runs`;default:return e}}function Of(e){return e.charAt(0).toUpperCase()+e.slice(1)}function zae(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 Tae(e){const t=o$(e.project),n=Aae(t.name,e.timeline,e.latestRunDetail,e.queries),i=[...e.runs].sort((a,o)=>o.createdAt.localeCompare(a.createdAt)).map(a=>Ok(a,e.project.displayName||e.project.name));return e.overview?Pae(t,e.overview,n,i):Rae(t,n,i)}function Pae(e,t,n,r){const i=Sae(t.topInsights);for(const a of t.attentionItems)a.id.startsWith("insight_")||i.push({id:a.id,tone:a.tone,title:a.title,detail:a.detail,actionLabel:a.actionLabel,affectedPhrases:[]});return{project:e,dateRangeLabel:t.dateRangeLabel,contextLabel:t.contextLabel,visibilitySummary:t.scores.visibility,queryCounts:{cited:t.queryCounts.citedQueries,total:t.queryCounts.totalQueries},gapQueries:t.scores.gapQueries,indexCoverage:t.scores.indexCoverage,providerScores:t.providerScores,competitorPressure:t.scores.competitorPressure,runStatus:t.scores.runStatus,movementSummary:t.movementSummary,insights:i,visibilityEvidence:n,competitors:t.competitors.map(a=>({id:a.id,domain:a.domain,citationCount:a.citationCount,totalQueries:a.totalQueries,pressureLabel:a.pressureLabel,citedQueries:a.citedQueries,movement:"",notes:""})),recentRuns:r.slice(0,5)}}function Rae(e,t,n){const r={label:"",value:"No data",delta:"Loading…",tone:"neutral",description:"",tooltip:"",trend:[]};return{project:e,dateRangeLabel:"All time",contextLabel:`${e.country} / ${e.language.toUpperCase()}`,visibilitySummary:{...r,label:"Answer Visibility"},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Gap Queries"},indexCoverage:{...r,label:"Index Coverage"},providerScores:[],competitorPressure:{...r,label:"Competitor Pressure"},runStatus:{...r,label:"Run Status"},movementSummary:{gained:0,lost:0,tone:"neutral",hasPreviousRun:!1},insights:[],visibilityEvidence:t,competitors:[],recentRuns:n.slice(0,5)}}function Dae(e){const t=o$(e.project),n=[...e.runs].sort((y,v)=>v.createdAt.localeCompare(y.createdAt)),r=n.find(y=>y.kind===Nt["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?Ok(r,i):Mae(e.project.id,i),o=e.overview;if(!o)return{project:t,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:a,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const c=o.scores.visibility,d=c.progress??0,f=o.queryCounts.citedQueries,p=o.queryCounts.totalQueries,m=o.providers.length;return{project:t,visibilityScore:d,visibilityDelta:p>0?`${f} of ${p} queries`:"No data",visibilityTone:c.tone,providerCoverage:c.providerCoverage,lastRun:a,insight:p>0?`${f} of ${p} queries visible across ${m} provider${m===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:o.scores.competitorPressure.value}}function Mae(e,t){return{id:"none",projectId:e,projectName:t,kind:Nt["answer-visibility"],kindLabel:"No runs yet",status:pr.queued,trigger:eh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function Iae(e,t){const n=[],r=[],i=[];for(const o of e){r.push(Tae(o)),i.push(Dae(o));const c=[...o.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of c)n.push(Ok(d,o.project.displayName||o.project.name))}n.sort((o,c)=>c.createdAt.localeCompare(o.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?Lae(r):[{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"}),...a?{}:{emptyState:{title:"No projects yet",detail:"Canonry becomes useful after one project, a small query set, and one competitor list are in place.",ctaLabel:"Launch setup",ctaHref:"/setup"}}},projects:r,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"},queryImportState:{mode:"paste",queryCount:0,preview:[]},competitorDraft:{domains:[],notes:"Use the CLI to add competitors."},launchState:{enabled:a,ctaLabel:a?"Trigger run":"Create a project first",summary:a?"Ready to run.":"Create a project first to launch a run."}},settings:{providerStatuses:(t?.providers??[]).map(o=>({name:o.name,displayName:o.displayName,keyUrl:o.keyUrl,modelHint:o.modelHint,model:o.model,state:o.configured?"ready":"needs-config",detail:o.configured?"Provider is configured.":"API key is missing.",quota:o.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 Lae(e){const t=[];for(const n of e){const r=n.visibilityEvidence.filter(a=>a.citationState==="lost");r.length>0&&t.push({id:`attention_${n.project.id}_lost`,tone:"negative",title:`${n.project.displayName||n.project.name} lost citations`,detail:`${r.length} quer${r.length>1?"ies":"y"} lost citation.`,actionLabel:"Open project",href:`/projects/${n.project.id}`});const i=n.recentRuns.filter(a=>a.status===pr.running||a.status===pr.queued);i.length>0&&t.push({id:`attention_${n.project.id}_active`,tone:"neutral",title:`${n.project.displayName||n.project.name} has active runs`,detail:`${i.length} run${i.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 Re={projects:{all:["projects"],detail:(e,t)=>["projects",e,t],queries:e=>["projects",e,"queries"],competitors:e=>["projects",e,"competitors"],timeline:(e,t)=>["projects",e,"timeline",t]},runs:{all:["runs"],detail:e=>["runs",e]},settings:["settings"],health:["health"],gsc:{project:e=>["gsc",e],connections:e=>["gsc",e,"connections"],properties:e=>["gsc",e,"properties"],performance:(e,t)=>["gsc",e,"performance",t],inspections:(e,t)=>["gsc",e,"inspections",t],deindexed:e=>["gsc",e,"deindexed"],coverage:e=>["gsc",e,"coverage"],coverageHistory:e=>["gsc",e,"coverage-history"],sitemaps:e=>["gsc",e,"sitemaps"]},bing:{project:e=>["bing",e],status:e=>["bing",e,"status"],coverage:e=>["bing",e,"coverage"],inspections:e=>["bing",e,"inspections"],performance:e=>["bing",e,"performance"],sites:e=>["bing",e,"sites"]},schedule:e=>["schedule",e],notifications:e=>["notifications",e],agent:{providers:e=>["agent",e,"providers"]},citationVisibility:e=>["citation-visibility",e],report:e=>["report",e],traffic:{project:e=>["traffic",e],status:e=>["traffic",e,"status"],summary:(e,t)=>["traffic",e,"summary",t],aiHistory:(e,t)=>["traffic",e,"ai-history",t],sessionHistory:(e,t)=>["traffic",e,"session-history",t],socialHistory:(e,t)=>["traffic",e,"social-history",t]},serverTraffic:{all:["server-traffic"],project:e=>["server-traffic",e],sources:e=>["server-traffic",e,"sources"],status:e=>["server-traffic",e,"status"],sourceDetail:(e,t)=>["server-traffic",e,"sources",t],events:(e,t)=>["server-traffic",e,"events",t]}},u$=x.createContext(null);u$.Provider;function qh(){return x.useContext(u$)}function fc(e){const n=qh()?.dashboard??null,r=Ar({queryKey:Re.projects.all,queryFn:jv,enabled:!n}),i=Ar({queryKey:Re.runs.all,queryFn:T5,enabled:!n,staleTime:e1,refetchInterval:S=>S.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:e1}),a=Ar({queryKey:Re.settings,queryFn:()=>ZN().catch(()=>null),enabled:!n}),o=r.data??[],c=i.data??[],d=s5({queries:o.map(S=>{const b=c.filter(k=>k.projectId===S.id),j=b.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:Re.projects.detail(S.id,j[0]?.id),queryFn:async()=>{const k=j[0]?.id,[E,C,O,z,A,_,R,$,F]=await Promise.all([lV(S.name).catch(()=>[]),P5(S.name).catch(()=>[]),R5(S.name).catch(()=>[]),k?Kl(k).catch(()=>null):Promise.resolve(null),j[1]?Kl(j[1].id).catch(()=>null):Promise.resolve(null),XN(S.name).catch(()=>null),JN(S.name).catch(()=>null),k?pQ(S.name,k).catch(()=>null):Promise.resolve(null),cV(S.name).catch(()=>null)]);return{project:S,runs:b,queries:E,competitors:C,timeline:O,latestRunDetail:z,previousRunDetail:A,gscCoverage:_,bingCoverage:R,dbInsights:$,overview:F}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:K5}})}),f=d.every(S=>S.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||o.length>0&&!f)return null;const S=d.map(b=>b.data?{...b.data,runs:c.filter(j=>j.projectId===b.data.project.id)}:null).filter(b=>b!=null);return Iae(S,a.data??null)},[n,r.data,i.data,a.data,f,d,o.length,c]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:y,isError:m,refetch:v}}async function $ae(){const e=await gQ("/health","API"),t=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:t}}function $v(e,t){return Ar({queryKey:Re.health,queryFn:$ae,enabled:e,refetchInterval:15e3,initialData:t})}function Bae(e){return Ar({queryKey:Re.runs.detail(e??""),queryFn:()=>Kl(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function fd(){const e=qo(),t=Sv({strict:!1}),n=si({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:li.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:li.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:li.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const Uae={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function qae(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function Fae(){const e=x.useSyncExternalStore(PQ,A2,A2),t=qo(),{openRun:n}=fd(),r=x.useCallback(a=>{Jj(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),Jj(a.id))},[t,n]);return e.length===0?null:l.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>l.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${Uae[a.tone]}`,children:[l.jsxs("div",{className:"toast-copy",children:[l.jsx("p",{className:"toast-title",children:a.title}),a.detail?l.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?l.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":qae(a),children:a.cta.label}):null]}),l.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:l.jsx(cd,{className:"size-3.5"})})]},a.id))})}function Hae(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Kae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vae={};function PT(e,t){return(Vae.jsx?Gae:Kae).test(e)}const Qae=/[ \t\n\f\r]/g;function Yae(e){return typeof e=="object"?e.type==="text"?RT(e.value):!1:RT(e)}function RT(e){return e.replace(Qae,"")===""}let Fh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Fh.prototype.normal={};Fh.prototype.property={};Fh.prototype.space=void 0;function d$(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Fh(n,r,t)}function u1(e){return e.toLowerCase()}class di{constructor(t,n){this.attribute=n,this.property=t}}di.prototype.attribute="";di.prototype.booleanish=!1;di.prototype.boolean=!1;di.prototype.commaOrSpaceSeparated=!1;di.prototype.commaSeparated=!1;di.prototype.defined=!1;di.prototype.mustUseProperty=!1;di.prototype.number=!1;di.prototype.overloadedBoolean=!1;di.prototype.property="";di.prototype.spaceSeparated=!1;di.prototype.space=void 0;let Wae=0;const ot=hc(),Dn=hc(),d1=hc(),Oe=hc(),Wt=hc(),Pu=hc(),Si=hc();function hc(){return 2**++Wae}const f1=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:Dn,commaOrSpaceSeparated:Si,commaSeparated:Pu,number:Oe,overloadedBoolean:d1,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),Iw=Object.keys(f1);class Ek extends di{constructor(t,n,r,i){let a=-1;if(super(t,n),DT(this,"space",i),typeof r=="number")for(;++a<Iw.length;){const o=Iw[a];DT(this,Iw[a],(r&f1[o])===f1[o])}}}Ek.prototype.defined=!0;function DT(e,t,n){n&&(e[t]=n)}function hd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Ek(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[u1(r)]=r,n[u1(a.attribute)]=r}return new Fh(t,n,e.space)}const f$=hd({properties:{ariaActiveDescendant:null,ariaAtomic:Dn,ariaAutoComplete:null,ariaBusy:Dn,ariaChecked:Dn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Wt,ariaCurrent:null,ariaDescribedBy:Wt,ariaDetails:null,ariaDisabled:Dn,ariaDropEffect:Wt,ariaErrorMessage:null,ariaExpanded:Dn,ariaFlowTo:Wt,ariaGrabbed:Dn,ariaHasPopup:null,ariaHidden:Dn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wt,ariaLevel:Oe,ariaLive:null,ariaModal:Dn,ariaMultiLine:Dn,ariaMultiSelectable:Dn,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Dn,ariaReadOnly:Dn,ariaRelevant:null,ariaRequired:Dn,ariaRoleDescription:Wt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Dn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function h$(e,t){return t in e?e[t]:t}function p$(e,t){return h$(e,t.toLowerCase())}const Zae=hd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Pu,acceptCharset:Wt,accessKey:Wt,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:Wt,autoFocus:ot,autoPlay:ot,blocking:Wt,capture:null,charSet:null,checked:ot,cite:null,className:Wt,cols:Oe,colSpan:null,content:null,contentEditable:Dn,controls:ot,controlsList:Wt,coords:Oe|Pu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:d1,draggable:Dn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:Wt,height:Oe,hidden:d1,high:Oe,href:null,hrefLang:null,htmlFor:Wt,httpEquiv:Wt,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:Wt,itemRef:Wt,itemScope:ot,itemType:Wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Oe,pattern:null,ping:Wt,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:Wt,required:ot,reversed:ot,rows:Oe,rowSpan:Oe,sandbox:Wt,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Dn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:Dn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Wt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Dn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:p$}),Xae=hd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Si,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Pu,g2:Pu,glyphName:Pu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:Si,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Si,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Si,rev:Si,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Si,requiredFeatures:Si,requiredFonts:Si,requiredFormats:Si,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:Si,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Si,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Si,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:h$}),m$=hd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),g$=hd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:p$}),y$=hd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Jae={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ese=/[A-Z]/g,MT=/-[a-z]/g,tse=/^data[-\w.:]+$/i;function nse(e,t){const n=u1(t);let r=t,i=di;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&tse.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(MT,ise);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!MT.test(a)){let o=a.replace(ese,rse);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Ek}return new i(r,t)}function rse(e){return"-"+e.toLowerCase()}function ise(e){return e.charAt(1).toUpperCase()}const ase=d$([f$,Zae,m$,g$,y$],"html"),_k=d$([f$,Xae,m$,g$,y$],"svg");function sse(e){return e.join(" ").trim()}var au={},Lw,IT;function ose(){if(IT)return Lw;IT=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
98
|
+
`,f="/",p="*",m="",y="comment",v="declaration";function S(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var E=1,C=1;function O(X){var Z=X.match(t);Z&&(E+=Z.length);var H=X.lastIndexOf(d);C=~H?X.length-H:C+X.length}function z(){var X={line:E,column:C};return function(Z){return Z.position=new A(X),$(),Z}}function A(X){this.start=X,this.end={line:E,column:C},this.source=k.source}A.prototype.content=j;function _(X){var Z=new Error(k.source+":"+E+":"+C+": "+X);if(Z.reason=X,Z.filename=k.source,Z.line=E,Z.column=C,Z.source=j,!k.silent)throw Z}function R(X){var Z=X.exec(j);if(Z){var H=Z[0];return O(H),j=j.slice(H.length),Z}}function $(){R(n)}function F(X){var Z;for(X=X||[];Z=q();)Z!==!1&&X.push(Z);return X}function q(){var X=z();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Z=2;m!=j.charAt(Z)&&(p!=j.charAt(Z)||f!=j.charAt(Z+1));)++Z;if(Z+=2,m===j.charAt(Z-1))return _("End of comment missing");var H=j.slice(2,Z-2);return C+=2,O(H),j=j.slice(Z),C+=2,X({type:y,comment:H})}}function B(){var X=z(),Z=R(r);if(Z){if(q(),!R(i))return _("property missing ':'");var H=R(a),J=X({type:v,property:b(Z[0].replace(e,m)),value:H?b(H[0].replace(e,m)):m});return R(o),J}}function V(){var X=[];F(X);for(var Z;Z=B();)Z!==!1&&(X.push(Z),F(X));return X}return $(),V()}function b(j){return j?j.replace(c,m):m}return Lw=S,Lw}var LT;function lse(){if(LT)return au;LT=1;var e=au&&au.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(au,"__esModule",{value:!0}),au.default=n;const t=e(ose());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),c=typeof i=="function";return o.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return au}var Ef={},$T;function cse(){if($T)return Ef;$T=1,Object.defineProperty(Ef,"__esModule",{value:!0}),Ef.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(f){return!f||n.test(f)||e.test(f)},o=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,o))};return Ef.camelCase=d,Ef}var _f,BT;function use(){if(BT)return _f;BT=1;var e=_f&&_f.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(lse()),n=cse();function r(i,a){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(o[(0,n.camelCase)(c,a)]=d)}),o}return r.default=r,_f=r,_f}var dse=use();const fse=ba(dse),v$=x$("end"),zk=x$("start");function x$(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function hse(e){const t=zk(e),n=v$(e);if(t&&n)return{start:t,end:n}}function th(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?UT(e.position):"start"in e||"end"in e?UT(e):"line"in e||"column"in e?h1(e):""}function h1(e){return qT(e&&e.line)+":"+qT(e&&e.column)}function UT(e){return h1(e&&e.start)+"-"+h1(e&&e.end)}function qT(e){return e&&typeof e=="number"?e:1}class zr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?i=t:!a.cause&&t&&(o=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?a.ruleId=r:(a.source=r.slice(0,d),a.ruleId=r.slice(d+1))}if(!a.place&&a.ancestors&&a.ancestors){const d=a.ancestors[a.ancestors.length-1];d&&(a.place=d.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=th(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}zr.prototype.file="";zr.prototype.name="";zr.prototype.reason="";zr.prototype.message="";zr.prototype.stack="";zr.prototype.column=void 0;zr.prototype.line=void 0;zr.prototype.ancestors=void 0;zr.prototype.cause=void 0;zr.prototype.fatal=void 0;zr.prototype.place=void 0;zr.prototype.ruleId=void 0;zr.prototype.source=void 0;const Tk={}.hasOwnProperty,pse=new Map,mse=/[A-Z]/g,gse=new Set(["table","tbody","thead","tfoot","tr"]),yse=new Set(["td","th"]),b$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vse(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Cse(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=kse(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?_k:ase,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=w$(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function w$(e,t,n){if(t.type==="element")return xse(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return bse(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Sse(e,t,n);if(t.type==="mdxjsEsm")return wse(e,t);if(t.type==="root")return jse(e,t,n);if(t.type==="text")return Nse(e,t)}function xse(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=_k,e.schema=i),e.ancestors.push(t);const a=j$(e,t.tagName,!1),o=Ase(e,t);let c=Rk(e,t);return gse.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Yae(d):!0})),S$(e,o,a,t),Pk(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function bse(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}xh(e,t.position)}function wse(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xh(e,t.position)}function Sse(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=_k,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:j$(e,t.name,!0),o=Ose(e,t),c=Rk(e,t);return S$(e,o,a,t),Pk(o,c),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function jse(e,t,n){const r={};return Pk(r,Rk(e,t)),e.create(t,e.Fragment,r,n)}function Nse(e,t){return t.value}function S$(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Pk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function kse(e,t,n){return r;function r(i,a,o,c){const f=Array.isArray(o.children)?n:t;return c?f(a,o,c):f(a,o)}}function Cse(e,t){return n;function n(r,i,a,o){const c=Array.isArray(a.children),d=zk(r);return t(i,a,o,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function Ase(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Tk.call(t.properties,i)){const a=Ese(e,i,t.properties[i]);if(a){const[o,c]=a;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&yse.has(t.tagName)?r=c:n[o]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ose(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else xh(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else xh(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Rk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:pse;for(;++r<t.children.length;){const a=t.children[r];let o;if(e.passKeys){const d=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(d){const f=i.get(d)||0;o=d+"-"+f,i.set(d,f+1)}}const c=w$(e,a,o);c!==void 0&&n.push(c)}return n}function Ese(e,t,n){const r=nse(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Hae(n):sse(n)),r.property==="style"){let i=typeof n=="object"?n:_se(e,String(n));return e.stylePropertyNameCase==="css"&&(i=zse(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Jae[r.property]||r.property:r.attribute,n]}}function _se(e,t){try{return fse(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new zr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=b$+"#cannot-parse-style-attribute",i}}function j$(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,o;for(;++a<i.length;){const c=PT(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=o}else r=PT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Tk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);xh(e)}function xh(e,t){const n=new zr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=b$+"#cannot-handle-mdx-estrees-without-createevaluater",n}function zse(e){const t={};let n;for(n in e)Tk.call(e,n)&&(t[Tse(n)]=e[n]);return t}function Tse(e){let t=e.replace(mse,Pse);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Pse(e){return"-"+e.toLowerCase()}const $w={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Rse={};function Dse(e,t){const n=Rse,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return N$(e,r,i)}function N$(e,t,n){if(Mse(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return FT(e.children,t,n)}return Array.isArray(e)?FT(e,t,n):""}function FT(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=N$(e[i],t,n);return r.join("")}function Mse(e){return!!(e&&typeof e=="object")}const HT=document.createElement("i");function Dk(e){const t="&"+e+";";HT.innerHTML=t;const n=HT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Fa(e,t,n,r){const i=e.length;let a=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Ki(e,t){return e.length>0?(Fa(e,e.length,0,t),e):t}const KT={}.hasOwnProperty;function Ise(e){const t={};let n=-1;for(;++n<e.length;)Lse(t,e[n]);return t}function Lse(e,t){let n;for(n in t){const i=(KT.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let o;if(a)for(o in a){KT.call(i,o)||(i[o]=[]);const c=a[o];$se(i[o],Array.isArray(c)?c:c?[c]:[])}}}function $se(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Fa(e,0,0,r)}function k$(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Ru(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ia=Go(/[A-Za-z]/),Ni=Go(/[\dA-Za-z]/),Bse=Go(/[#-'*+\--9=?A-Z^-~]/);function p1(e){return e!==null&&(e<32||e===127)}const m1=Go(/\d/),Use=Go(/[\dA-Fa-f]/),qse=Go(/[!-/:-@[-`{-~]/);function Ze(e){return e!==null&&e<-2}function oi(e){return e!==null&&(e<0||e===32)}function Pt(e){return e===-2||e===-1||e===32}const Fse=Go(new RegExp("\\p{P}|\\p{S}","u")),Hse=Go(/\s/);function Go(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function pd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let o="";if(a===37&&Ni(e.charCodeAt(n+1))&&Ni(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(o=String.fromCharCode(a,c),i=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Xt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(d){return Pt(d)?(e.enter(n),c(d)):t(d)}function c(d){return Pt(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const Kse={tokenize:Gse};function Gse(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Xt(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Ze(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),o)}}const Vse={tokenize:Qse},GT={tokenize:Yse};function Qse(e){const t=this,n=[];let r=0,i,a,o;return c;function c(C){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,d,f)(C)}return f(C)}function d(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const O=t.events.length;let z=O,A;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){A=t.events[z][1].end;break}k(r);let _=O;for(;_<t.events.length;)t.events[_][1].end={...A},_++;return Fa(t.events,z+1,0,t.events.slice(O)),t.events.length=_,f(C)}return c(C)}function f(C){if(r===n.length){if(!i)return y(C);if(i.currentConstruct&&i.currentConstruct.concrete)return S(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(GT,p,m)(C)}function p(C){return i&&E(),k(r),y(C)}function m(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,S(C)}function y(C){return t.containerState={},e.attempt(GT,v,S)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),y(C)}function S(C){if(C===null){i&&E(),k(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(C)}function b(C){if(C===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(C);return}return Ze(C)?(e.consume(C),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(C),b)}function j(C,O){const z=t.sliceStream(C);if(O&&z.push(null),C.previous=a,a&&(a.next=C),a=C,i.defineSkip(C.start),i.write(z),t.parser.lazy[C.start.line]){let A=i.events.length;for(;A--;)if(i.events[A][1].start.offset<o&&(!i.events[A][1].end||i.events[A][1].end.offset>o))return;const _=t.events.length;let R=_,$,F;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if($){F=t.events[R][1].end;break}$=!0}for(k(r),A=_;A<t.events.length;)t.events[A][1].end={...F},A++;Fa(t.events,R+1,0,t.events.slice(_)),t.events.length=A}}function k(C){let O=n.length;for(;O-- >C;){const z=n[O];t.containerState=z[1],z[0].exit.call(t,e)}n.length=C}function E(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Yse(e,t,n){return Xt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function VT(e){if(e===null||oi(e)||Hse(e))return 1;if(Fse(e))return 2}function Mk(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const g1={name:"attention",resolveAll:Wse,tokenize:Zse};function Wse(e,t){let n=-1,r,i,a,o,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};QT(m,-d),QT(y,d),o={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[r][1].end={...o.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Ki(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Ki(f,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",a,t]]),f=Ki(f,Mk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Ki(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Ki(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Fa(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Zse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=VT(r);let a;return o;function o(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=VT(d),m=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function QT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Xse={name:"autolink",tokenize:Jse};function Jse(e,t,n){let r=0;return i;function i(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(v){return Ia(v)?(e.consume(v),o):v===64?n(v):f(v)}function o(v){return v===43||v===45||v===46||Ni(v)?(r=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||Ni(v))&&r++<32?(e.consume(v),c):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||p1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):Bse(v)?(e.consume(v),f):n(v)}function p(v){return Ni(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Ni(v))&&r++<63){const S=v===45?y:m;return e.consume(v),S}return n(v)}}const Bv={partial:!0,tokenize:eoe};function eoe(e,t,n){return r;function r(a){return Pt(a)?Xt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||Ze(a)?t(a):n(a)}}const C$={continuation:{tokenize:noe},exit:roe,name:"blockQuote",tokenize:toe};function toe(e,t,n){const r=this;return i;function i(o){if(o===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),a}return n(o)}function a(o){return Pt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function noe(e,t,n){const r=this;return i;function i(o){return Pt(o)?Xt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):a(o)}function a(o){return e.attempt(C$,t,n)(o)}}function roe(e){e.exit("blockQuote")}const A$={name:"characterEscape",tokenize:ioe};function ioe(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return qse(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const O$={name:"characterReference",tokenize:aoe};function aoe(e,t,n){const r=this;let i=0,a,o;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,o=Ni,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,o=Use,p):(e.enter("characterReferenceValue"),a=7,o=m1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return o===Ni&&!Dk(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(m)&&i++<a?(e.consume(m),p):n(m)}}const YT={partial:!0,tokenize:ooe},WT={concrete:!0,name:"codeFenced",tokenize:soe};function soe(e,t,n){const r=this,i={partial:!0,tokenize:z};let a=0,o=0,c;return d;function d(A){return f(A)}function f(A){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,c=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(A)}function p(A){return A===c?(o++,e.consume(A),p):o<3?n(A):(e.exit("codeFencedFenceSequence"),Pt(A)?Xt(e,m,"whitespace")(A):m(A))}function m(A){return A===null||Ze(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(YT,b,O)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(A)):Pt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,v,"whitespace")(A)):A===96&&A===c?n(A):(e.consume(A),y)}function v(A){return A===null||Ze(A)?m(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(A))}function S(A){return A===null||Ze(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(A)):A===96&&A===c?n(A):(e.consume(A),S)}function b(A){return e.attempt(i,O,j)(A)}function j(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),k}function k(A){return a>0&&Pt(A)?Xt(e,E,"linePrefix",a+1)(A):E(A)}function E(A){return A===null||Ze(A)?e.check(YT,b,O)(A):(e.enter("codeFlowValue"),C(A))}function C(A){return A===null||Ze(A)?(e.exit("codeFlowValue"),E(A)):(e.consume(A),C)}function O(A){return e.exit("codeFenced"),t(A)}function z(A,_,R){let $=0;return F;function F(Z){return A.enter("lineEnding"),A.consume(Z),A.exit("lineEnding"),q}function q(Z){return A.enter("codeFencedFence"),Pt(Z)?Xt(A,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):B(Z)}function B(Z){return Z===c?(A.enter("codeFencedFenceSequence"),V(Z)):R(Z)}function V(Z){return Z===c?($++,A.consume(Z),V):$>=o?(A.exit("codeFencedFenceSequence"),Pt(Z)?Xt(A,X,"whitespace")(Z):X(Z)):R(Z)}function X(Z){return Z===null||Ze(Z)?(A.exit("codeFencedFence"),_(Z)):R(Z)}}}function ooe(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Bw={name:"codeIndented",tokenize:coe},loe={partial:!0,tokenize:uoe};function coe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Xt(e,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?o(f):n(f)}function o(f){return f===null?d(f):Ze(f)?e.attempt(loe,o,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Ze(f)?(e.exit("codeFlowValue"),o(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function uoe(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Xt(e,a,"linePrefix",5)(o)}function a(o){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Ze(o)?i(o):n(o)}}const doe={name:"codeText",previous:hoe,resolve:foe,tokenize:poe};function foe(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function hoe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function poe(e,t,n){let r=0,i,a;return o;function o(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):Ze(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(m))}function f(m){return m===null||m===32||m===96||Ze(m)?(e.exit("codeTextData"),d(m)):(e.consume(m),f)}function p(m){return m===96?(e.consume(m),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(a.type="codeTextData",f(m))}}class moe{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&zf(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);zf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zf(this.left,n.reverse())}}}function zf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function E$(e){const t={};let n=-1,r,i,a,o,c,d,f;const p=new moe(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,a=0,a<d.length&&d[a][1].type==="lineEndingBlank"&&(a+=2),a<d.length&&d[a][1].type==="content"))for(;++a<d.length&&d[a][1].type!=="content";)d[a][1].type==="chunkText"&&(d[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,goe(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=p.get(a),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=a);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return Fa(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function goe(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,d=[],f={};let p,m,y=-1,v=n,S=0,b=0;const j=[b];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&o.defineSkip(v.start),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(p),v._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(b=y+1,j.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(o.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=c.slice(j[y],j[y+1]),E=a.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),y=-1;++y<d.length;)f[S+d[y][0]]=S+d[y][1],S+=d[y][1]-d[y][0]-1;return f}const yoe={resolve:xoe,tokenize:boe},voe={partial:!0,tokenize:woe};function xoe(e){return E$(e),e}function boe(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):Ze(c)?e.check(voe,o,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function woe(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Xt(e,a,"linePrefix")}function a(o){if(o===null||Ze(o))return n(o);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function _$(e,t,n,r,i,a,o,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(k),e.exit(a),y):k===null||k===32||k===41||p1(k)?n(k):(e.enter(r),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),b(k))}function y(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(c),y(k)):k===null||k===60||Ze(k)?n(k):(e.consume(k),k===92?S:v)}function S(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function b(k){return!p&&(k===null||k===41||oi(k))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(r),t(k)):p<f&&k===40?(e.consume(k),p++,b):k===41?(e.consume(k),p--,b):k===null||k===32||k===40||p1(k)?n(k):(e.consume(k),k===92?j:b)}function j(k){return k===40||k===41||k===92?(e.consume(k),b):b(k)}}function z$(e,t,n,r,i,a){const o=this;let c=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):Ze(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(v))}function m(v){return v===null||v===91||v===93||Ze(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Pt(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function T$(e,t,n,r,i,a){let o;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),o=y===40?41:y,d):n(y)}function d(y){return y===o?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===o?(e.exit(a),d(o)):y===null?n(y):Ze(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Xt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===o||y===null||Ze(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===o||y===92?(e.consume(y),p):p(y)}}function nh(e,t){let n;return r;function r(i){return Ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Pt(i)?Xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Soe={name:"definition",tokenize:Noe},joe={partial:!0,tokenize:koe};function Noe(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),o(v)}function o(v){return z$.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return i=Ru(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),d):n(v)}function d(v){return oi(v)?nh(e,f)(v):f(v)}function f(v){return _$(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(joe,m,m)(v)}function m(v){return Pt(v)?Xt(e,y,"whitespace")(v):y(v)}function y(v){return v===null||Ze(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function koe(e,t,n){return r;function r(c){return oi(c)?nh(e,i)(c):n(c)}function i(c){return T$(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Pt(c)?Xt(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Ze(c)?t(c):n(c)}}const Coe={name:"hardBreakEscape",tokenize:Aoe};function Aoe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return Ze(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Ooe={name:"headingAtx",resolve:Eoe,tokenize:_oe};function Eoe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Fa(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function _oe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),o(p)}function o(p){return p===35&&r++<6?(e.consume(p),o):p===null||oi(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Ze(p)?(e.exit("atxHeading"),t(p)):Pt(p)?Xt(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||oi(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const zoe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ZT=["pre","script","style","textarea"],Toe={concrete:!0,name:"htmlFlow",resolveTo:Doe,tokenize:Moe},Poe={partial:!0,tokenize:Loe},Roe={partial:!0,tokenize:Ioe};function Doe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Moe(e,t,n){const r=this;let i,a,o,c,d;return f;function f(M){return p(M)}function p(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),m}function m(M){return M===33?(e.consume(M),y):M===47?(e.consume(M),a=!0,b):M===63?(e.consume(M),i=3,r.interrupt?t:I):Ia(M)?(e.consume(M),o=String.fromCharCode(M),j):n(M)}function y(M){return M===45?(e.consume(M),i=2,v):M===91?(e.consume(M),i=5,c=0,S):Ia(M)?(e.consume(M),i=4,r.interrupt?t:I):n(M)}function v(M){return M===45?(e.consume(M),r.interrupt?t:I):n(M)}function S(M){const Q="CDATA[";return M===Q.charCodeAt(c++)?(e.consume(M),c===Q.length?r.interrupt?t:B:S):n(M)}function b(M){return Ia(M)?(e.consume(M),o=String.fromCharCode(M),j):n(M)}function j(M){if(M===null||M===47||M===62||oi(M)){const Q=M===47,oe=o.toLowerCase();return!Q&&!a&&ZT.includes(oe)?(i=1,r.interrupt?t(M):B(M)):zoe.includes(o.toLowerCase())?(i=6,Q?(e.consume(M),k):r.interrupt?t(M):B(M)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):a?E(M):C(M))}return M===45||Ni(M)?(e.consume(M),o+=String.fromCharCode(M),j):n(M)}function k(M){return M===62?(e.consume(M),r.interrupt?t:B):n(M)}function E(M){return Pt(M)?(e.consume(M),E):F(M)}function C(M){return M===47?(e.consume(M),F):M===58||M===95||Ia(M)?(e.consume(M),O):Pt(M)?(e.consume(M),C):F(M)}function O(M){return M===45||M===46||M===58||M===95||Ni(M)?(e.consume(M),O):z(M)}function z(M){return M===61?(e.consume(M),A):Pt(M)?(e.consume(M),z):C(M)}function A(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),d=M,_):Pt(M)?(e.consume(M),A):R(M)}function _(M){return M===d?(e.consume(M),d=null,$):M===null||Ze(M)?n(M):(e.consume(M),_)}function R(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||oi(M)?z(M):(e.consume(M),R)}function $(M){return M===47||M===62||Pt(M)?C(M):n(M)}function F(M){return M===62?(e.consume(M),q):n(M)}function q(M){return M===null||Ze(M)?B(M):Pt(M)?(e.consume(M),q):n(M)}function B(M){return M===45&&i===2?(e.consume(M),H):M===60&&i===1?(e.consume(M),J):M===62&&i===4?(e.consume(M),D):M===63&&i===3?(e.consume(M),I):M===93&&i===5?(e.consume(M),we):Ze(M)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Poe,U,V)(M)):M===null||Ze(M)?(e.exit("htmlFlowData"),V(M)):(e.consume(M),B)}function V(M){return e.check(Roe,X,U)(M)}function X(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Z}function Z(M){return M===null||Ze(M)?V(M):(e.enter("htmlFlowData"),B(M))}function H(M){return M===45?(e.consume(M),I):B(M)}function J(M){return M===47?(e.consume(M),o="",ue):B(M)}function ue(M){if(M===62){const Q=o.toLowerCase();return ZT.includes(Q)?(e.consume(M),D):B(M)}return Ia(M)&&o.length<8?(e.consume(M),o+=String.fromCharCode(M),ue):B(M)}function we(M){return M===93?(e.consume(M),I):B(M)}function I(M){return M===62?(e.consume(M),D):M===45&&i===2?(e.consume(M),I):B(M)}function D(M){return M===null||Ze(M)?(e.exit("htmlFlowData"),U(M)):(e.consume(M),D)}function U(M){return e.exit("htmlFlow"),t(M)}}function Ioe(e,t,n){const r=this;return i;function i(o){return Ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Loe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bv,t,n)}}const $oe={name:"htmlText",tokenize:Boe};function Boe(e,t,n){const r=this;let i,a,o;return c;function c(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),d}function d(I){return I===33?(e.consume(I),f):I===47?(e.consume(I),z):I===63?(e.consume(I),C):Ia(I)?(e.consume(I),R):n(I)}function f(I){return I===45?(e.consume(I),p):I===91?(e.consume(I),a=0,S):Ia(I)?(e.consume(I),E):n(I)}function p(I){return I===45?(e.consume(I),v):n(I)}function m(I){return I===null?n(I):I===45?(e.consume(I),y):Ze(I)?(o=m,J(I)):(e.consume(I),m)}function y(I){return I===45?(e.consume(I),v):m(I)}function v(I){return I===62?H(I):I===45?y(I):m(I)}function S(I){const D="CDATA[";return I===D.charCodeAt(a++)?(e.consume(I),a===D.length?b:S):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),j):Ze(I)?(o=b,J(I)):(e.consume(I),b)}function j(I){return I===93?(e.consume(I),k):b(I)}function k(I){return I===62?H(I):I===93?(e.consume(I),k):b(I)}function E(I){return I===null||I===62?H(I):Ze(I)?(o=E,J(I)):(e.consume(I),E)}function C(I){return I===null?n(I):I===63?(e.consume(I),O):Ze(I)?(o=C,J(I)):(e.consume(I),C)}function O(I){return I===62?H(I):C(I)}function z(I){return Ia(I)?(e.consume(I),A):n(I)}function A(I){return I===45||Ni(I)?(e.consume(I),A):_(I)}function _(I){return Ze(I)?(o=_,J(I)):Pt(I)?(e.consume(I),_):H(I)}function R(I){return I===45||Ni(I)?(e.consume(I),R):I===47||I===62||oi(I)?$(I):n(I)}function $(I){return I===47?(e.consume(I),H):I===58||I===95||Ia(I)?(e.consume(I),F):Ze(I)?(o=$,J(I)):Pt(I)?(e.consume(I),$):H(I)}function F(I){return I===45||I===46||I===58||I===95||Ni(I)?(e.consume(I),F):q(I)}function q(I){return I===61?(e.consume(I),B):Ze(I)?(o=q,J(I)):Pt(I)?(e.consume(I),q):$(I)}function B(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),i=I,V):Ze(I)?(o=B,J(I)):Pt(I)?(e.consume(I),B):(e.consume(I),X)}function V(I){return I===i?(e.consume(I),i=void 0,Z):I===null?n(I):Ze(I)?(o=V,J(I)):(e.consume(I),V)}function X(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||oi(I)?$(I):(e.consume(I),X)}function Z(I){return I===47||I===62||oi(I)?$(I):n(I)}function H(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function J(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),ue}function ue(I){return Pt(I)?Xt(e,we,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):we(I)}function we(I){return e.enter("htmlTextData"),o(I)}}const Ik={name:"labelEnd",resolveAll:Hoe,resolveTo:Koe,tokenize:Goe},Uoe={tokenize:Voe},qoe={tokenize:Qoe},Foe={tokenize:Yoe};function Hoe(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Fa(e,0,e.length,n),e}function Koe(e,t){let n=e.length,r=0,i,a,o,c;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const d={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[a][1].start},end:{...e[o][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Ki(c,e.slice(a+1,a+r+3)),c=Ki(c,[["enter",p,t]]),c=Ki(c,Mk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),c=Ki(c,[["exit",p,t],e[o-2],e[o-1],["exit",f,t]]),c=Ki(c,e.slice(o+1)),c=Ki(c,[["exit",d,t]]),Fa(e,a,e.length,c),e}function Goe(e,t,n){const r=this;let i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return c;function c(y){return a?a._inactive?m(y):(o=r.parser.defined.includes(Ru(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(Uoe,p,o?p:m)(y):y===91?e.attempt(qoe,p,o?f:m)(y):o?p(y):m(y)}function f(y){return e.attempt(Foe,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function Voe(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),i}function i(m){return oi(m)?nh(e,a)(m):a(m)}function a(m){return m===41?p(m):_$(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function o(m){return oi(m)?nh(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?T$(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return oi(m)?nh(e,p)(m):p(m)}function p(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function Qoe(e,t,n){const r=this;return i;function i(c){return z$.call(r,e,a,o,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(Ru(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function Yoe(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Woe={name:"labelStartImage",resolveAll:Ik.resolveAll,tokenize:Zoe};function Zoe(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const Xoe={name:"labelStartLink",resolveAll:Ik.resolveAll,tokenize:Joe};function Joe(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Uw={name:"lineEnding",tokenize:ele};function ele(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xt(e,t,"linePrefix")}}const Eg={name:"thematicBreak",tokenize:tle};function tle(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),o(f)}function o(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Ze(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Pt(f)?Xt(e,c,"whitespace")(f):c(f))}}const ti={continuation:{tokenize:ale},exit:ole,name:"list",tokenize:ile},nle={partial:!0,tokenize:lle},rle={partial:!0,tokenize:sle};function ile(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return c;function c(v){const S=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:m1(v)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Eg,n,f)(v):f(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(v)}return n(v)}function d(v){return m1(v)&&++o<10?(e.consume(v),d):(!r.interrupt||o<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),f(v)):n(v)}function f(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(Bv,r.interrupt?n:p,e.attempt(nle,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Pt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function ale(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bv,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xt(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Pt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(rle,t,o)(c))}function o(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xt(e,e.attempt(ti,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function sle(e,t,n){const r=this;return Xt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function ole(e){e.exit(this.containerState.type)}function lle(e,t,n){const r=this;return Xt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const o=r.events[r.events.length-1];return!Pt(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const XT={name:"setextUnderline",resolveTo:cle,tokenize:ule};function cle(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function ule(e,t,n){const r=this;let i;return a;function a(f){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=f,o(f)):n(f)}function o(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Pt(f)?Xt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Ze(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const dle={tokenize:fle};function fle(e){const t=this,n=e.attempt(Bv,r,e.attempt(this.parser.constructs.flowInitial,i,Xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(yoe,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const hle={resolveAll:R$()},ple=P$("string"),mle=P$("text");function P$(e){return{resolveAll:R$(e==="text"?gle:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,o,c);return o;function o(p){return f(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function R$(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function gle(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let a=i.length,o=-1,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(o=f.length;f.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const yle={42:ti,43:ti,45:ti,48:ti,49:ti,50:ti,51:ti,52:ti,53:ti,54:ti,55:ti,56:ti,57:ti,62:C$},vle={91:Soe},xle={[-2]:Bw,[-1]:Bw,32:Bw},ble={35:Ooe,42:Eg,45:[XT,Eg],60:Toe,61:XT,95:Eg,96:WT,126:WT},wle={38:O$,92:A$},Sle={[-5]:Uw,[-4]:Uw,[-3]:Uw,33:Woe,38:O$,42:g1,60:[Xse,$oe],91:Xoe,92:[Coe,A$],93:Ik,95:g1,96:doe},jle={null:[g1,hle]},Nle={null:[42,95]},kle={null:[]},Cle=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Nle,contentInitial:vle,disable:kle,document:yle,flow:ble,flowInitial:xle,insideSpan:jle,string:wle,text:Sle},Symbol.toStringTag,{value:"Module"}));function Ale(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let o=[],c=[];const d={attempt:_(z),check:_(A),consume:E,enter:C,exit:O,interrupt:_(A,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:S,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(q){return o=Ki(o,q),j(),o[o.length-1]!==null?[]:(R(t,0),f.events=Mk(a,f.events,f),f.events)}function y(q,B){return Ele(v(q),B)}function v(q){return Ole(o,q)}function S(){const{_bufferIndex:q,_index:B,line:V,column:X,offset:Z}=r;return{_bufferIndex:q,_index:B,line:V,column:X,offset:Z}}function b(q){i[q.line]=q.column,F()}function j(){let q;for(;r._index<o.length;){const B=o[r._index];if(typeof B=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(q){p=p(q)}function E(q){Ze(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,F()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=q}function C(q,B){const V=B||{};return V.type=q,V.start=S(),f.events.push(["enter",V,f]),c.push(V),V}function O(q){const B=c.pop();return B.end=S(),f.events.push(["exit",B,f]),B}function z(q,B){R(q,B.from)}function A(q,B){B.restore()}function _(q,B){return V;function V(X,Z,H){let J,ue,we,I;return Array.isArray(X)?U(X):"tokenize"in X?U([X]):D(X);function D(ne){return Ae;function Ae(_e){const ee=_e!==null&&ne[_e],he=_e!==null&&ne.null,Ee=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(he)?he:he?[he]:[]];return U(Ee)(_e)}}function U(ne){return J=ne,ue=0,ne.length===0?H:M(ne[ue])}function M(ne){return Ae;function Ae(_e){return I=$(),we=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?oe():ne.tokenize.call(B?Object.assign(Object.create(f),B):f,d,Q,oe)(_e)}}function Q(ne){return q(we,I),Z}function oe(ne){return I.restore(),++ue<J.length?M(J[ue]):H}}}function R(q,B){q.resolveAll&&!a.includes(q)&&a.push(q),q.resolve&&Fa(f.events,B,f.events.length-B,q.resolve(f.events.slice(B),f)),q.resolveTo&&(f.events=q.resolveTo(f.events,f))}function $(){const q=S(),B=f.previous,V=f.currentConstruct,X=f.events.length,Z=Array.from(c);return{from:X,restore:H};function H(){r=q,f.previous=B,f.currentConstruct=V,f.events.length=X,c=Z,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Ole(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Ele(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let o;if(typeof a=="string")o=a;else switch(a){case-5:{o="\r";break}case-4:{o=`
|
|
99
|
+
`;break}case-3:{o=`\r
|
|
100
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}function _le(e){const r={constructs:Ise([Cle,...(e||{}).extensions||[]]),content:i(Kse),defined:[],document:i(Vse),flow:i(dle),lazy:{},string:i(ple),text:i(mle)};return r;function i(a){return o;function o(c){return Ale(r,a,c)}}}function zle(e){for(;!E$(e););return e}const JT=/[\0\t\n\r]/g;function Tle(){let e=1,t="",n=!0,r;return i;function i(a,o,c){const d=[];let f,p,m,y,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(JT.lastIndex=m,f=JT.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const Ple=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Rle(e){return e.replace(Ple,Dle)}function Dle(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return k$(n.slice(a?2:1),a?16:10)}return Dk(n)||e}const D$={}.hasOwnProperty;function Mle(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Ile(n)(zle(_le(n).document().write(Tle()(e,t,!0))))}function Ile(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ln),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(rt),blockQuote:a(he),characterEscape:$,characterReference:$,codeFenced:a(Ee),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(Ee,o),codeText:a(G,o),codeTextData:$,data:$,codeFlowValue:$,definition:a(Fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(De),hardBreakEscape:a(Qe),hardBreakTrailing:a(Qe),htmlFlow:a(en,o),htmlFlowData:$,htmlText:a(en,o),htmlTextData:$,image:a(Ut),label:o,link:a(ln),listItem:a(be),listItemValue:y,listOrdered:a(_t,m),listUnordered:a(_t),paragraph:a(Je),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(rt),strong:a(zt),thematicBreak:a(Ye)},exit:{atxHeading:d(),atxHeadingSequence:z,autolink:d(),autolinkEmail:ee,autolinkProtocol:_e,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:ne,characterReference:Ae,codeFenced:d(j),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:S,codeFlowValue:F,codeIndented:d(k),codeText:d(Z),codeTextData:F,data:F,definition:d(),definitionDestinationString:O,definitionLabelString:E,definitionTitleString:C,emphasis:d(),hardBreakEscape:d(B),hardBreakTrailing:d(B),htmlFlow:d(V),htmlFlowData:F,htmlText:d(X),htmlTextData:F,image:d(J),label:we,labelText:ue,lineEnding:q,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Q,resourceDestinationString:I,resourceTitleString:D,resource:U,setextHeading:d(R),setextHeadingLineSequence:_,setextHeadingText:A,strong:d(),thematicBreak:d()}};M$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Se={type:"root",children:[]};const Pe={stack:[Se],tokenStack:[],config:t,enter:c,exit:f,buffer:o,resume:p,data:n},We=[];let ut=-1;for(;++ut<ce.length;)if(ce[ut][1].type==="listOrdered"||ce[ut][1].type==="listUnordered")if(ce[ut][0]==="enter")We.push(ut);else{const Qn=We.pop();ut=i(ce,Qn,ut)}for(ut=-1;++ut<ce.length;){const Qn=t[ce[ut][0]];D$.call(Qn,ce[ut][1].type)&&Qn[ce[ut][1].type].call(Object.assign({sliceSerialize:ce[ut][2].sliceSerialize},Pe),ce[ut][1])}if(Pe.tokenStack.length>0){const Qn=Pe.tokenStack[Pe.tokenStack.length-1];(Qn[1]||eP).call(Pe,void 0,Qn[0])}for(Se.position={start:po(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:po(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},ut=-1;++ut<t.transforms.length;)Se=t.transforms[ut](Se)||Se;return Se}function i(ce,Se,Pe){let We=Se-1,ut=-1,Qn=!1,yr,tn,Gt,cn;for(;++We<=Pe;){const it=ce[We];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?ut++:ut--,cn=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(yr&&!cn&&!ut&&!Gt&&(Gt=We),cn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cn=void 0}if(!ut&&it[0]==="enter"&&it[1].type==="listItemPrefix"||ut===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(yr){let Yn=We;for(tn=void 0;Yn--;){const me=ce[Yn];if(me[1].type==="lineEnding"||me[1].type==="lineEndingBlank"){if(me[0]==="exit")continue;tn&&(ce[tn][1].type="lineEndingBlank",Qn=!0),me[1].type="lineEnding",tn=Yn}else if(!(me[1].type==="linePrefix"||me[1].type==="blockQuotePrefix"||me[1].type==="blockQuotePrefixWhitespace"||me[1].type==="blockQuoteMarker"||me[1].type==="listItemIndent"))break}Gt&&(!tn||Gt<tn)&&(yr._spread=!0),yr.end=Object.assign({},tn?ce[tn][1].start:it[1].end),ce.splice(tn||We,0,["exit",yr,it[2]]),We++,Pe++}if(it[1].type==="listItemPrefix"){const Yn={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};yr=Yn,ce.splice(We,0,["enter",Yn,it[2]]),We++,Pe++,Gt=void 0,cn=!0}}}return ce[Se][1]._spread=Qn,Pe}function a(ce,Se){return Pe;function Pe(We){c.call(this,ce(We),We),Se&&Se.call(this,We)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(ce,Se,Pe){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Se,Pe||void 0]),ce.position={start:po(Se.start),end:void 0}}function d(ce){return Se;function Se(Pe){ce&&ce.call(this,Pe),f.call(this,Pe)}}function f(ce,Se){const Pe=this.stack.pop(),We=this.tokenStack.pop();if(We)We[0].type!==ce.type&&(Se?Se.call(this,ce,We[0]):(We[1]||eP).call(this,ce,We[0]));else throw new Error("Cannot close `"+ce.type+"` ("+th({start:ce.start,end:ce.end})+"): it’s not open");Pe.position.end=po(ce.end)}function p(){return Dse(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ce){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ce}function S(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ce}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const Se=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Se,Pe.identifier=Ru(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ce}function O(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ce}function z(ce){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Pe=this.sliceSerialize(ce).length;Se.depth=Pe}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function _(ce){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ce){const Pe=this.stack[this.stack.length-1].children;let We=Pe[Pe.length-1];(!We||We.type!=="text")&&(We=Ct(),We.position={start:po(ce.start),end:void 0},Pe.push(We)),this.stack.push(We)}function F(ce){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ce),Se.position.end=po(ce.end)}function q(ce){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Pe=Se.children[Se.children.length-1];Pe.position.end=po(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&($.call(this,ce),F.call(this,ce))}function B(){this.data.atHardBreak=!0}function V(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function X(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function Z(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function H(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Se,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function J(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Se,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function ue(ce){const Se=this.sliceSerialize(ce),Pe=this.stack[this.stack.length-2];Pe.label=Rle(Se),Pe.identifier=Ru(Se).toLowerCase()}function we(){const ce=this.stack[this.stack.length-1],Se=this.resume(),Pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,Pe.type==="link"){const We=ce.children;Pe.children=We}else Pe.alt=Se}function I(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ce}function D(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ce}function U(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function Q(ce){const Se=this.resume(),Pe=this.stack[this.stack.length-1];Pe.label=Se,Pe.identifier=Ru(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function oe(ce){this.data.characterReferenceType=ce.type}function ne(ce){const Se=this.sliceSerialize(ce),Pe=this.data.characterReferenceType;let We;Pe?(We=k$(Se,Pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):We=Dk(Se);const ut=this.stack[this.stack.length-1];ut.value+=We}function Ae(ce){const Se=this.stack.pop();Se.position.end=po(ce.end)}function _e(ce){F.call(this,ce);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ce)}function ee(ce){F.call(this,ce);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ce)}function he(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function G(){return{type:"inlineCode",value:""}}function Fe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function De(){return{type:"emphasis",children:[]}}function rt(){return{type:"heading",depth:0,children:[]}}function Qe(){return{type:"break"}}function en(){return{type:"html",value:""}}function Ut(){return{type:"image",title:null,url:"",alt:null}}function ln(){return{type:"link",title:null,url:"",children:[]}}function _t(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function be(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Je(){return{type:"paragraph",children:[]}}function zt(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function Ye(){return{type:"thematicBreak"}}}function po(e){return{line:e.line,column:e.column,offset:e.offset}}function M$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?M$(e,r):Lle(e,r)}}function Lle(e,t){let n;for(n in t)if(D$.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function eP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+th({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+th({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+th({start:t.start,end:t.end})+") is still open")}function $le(e){const t=this;t.parser=n;function n(r){return Mle(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ble(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Ule(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
+
`}]}function qle(e,t){const n=t.value?t.value+`
|
|
102
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function Fle(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hle(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Kle(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=pd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Gle(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vle(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function I$(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Qle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return I$(e,t);const i={src:pd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Yle(e,t){const n={src:pd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Wle(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Zle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return I$(e,t);const i={href:pd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Xle(e,t){const n={href:pd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jle(e,t,n){const r=e.all(t),i=n?ece(n):L$(t),a={},o=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(i||c!==0||p.type!=="element"||p.tagName!=="p")&&o.push({type:"text",value:`
|
|
103
|
+
`}),p.type==="element"&&p.tagName==="p"&&!i?o.push(...p.children):o.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
|
|
104
|
+
`});const f={type:"element",tagName:"li",properties:a,children:o};return e.patch(t,f),e.applyData(t,f)}function ece(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=L$(n[r])}return t}function L$(e){const t=e.spread;return t??e.children.length>1}function tce(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function nce(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rce(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ice(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ace(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=zk(t.children[1]),d=v$(t.children[t.children.length-1]);c&&d&&(o.position={start:c,end:d}),i.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function sce(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],y={},v=o?o[d]:void 0;v&&(y.align=v);let S={type:"element",tagName:a,properties:y,children:[]};m&&(S.children=e.all(m),e.patch(m,S),S=e.applyData(m,S)),f.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function oce(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const tP=9,nP=32;function lce(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(rP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(rP(t.slice(i),i>0,!1)),a.join("")}function rP(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===tP||a===nP;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===tP||a===nP;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function cce(e,t){const n={type:"text",value:lce(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uce(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const dce={blockquote:Ble,break:Ule,code:qle,delete:Fle,emphasis:Hle,footnoteReference:Kle,heading:Gle,html:Vle,imageReference:Qle,image:Yle,inlineCode:Wle,linkReference:Zle,link:Xle,listItem:Jle,list:tce,paragraph:nce,root:rce,strong:ice,table:ace,tableCell:oce,tableRow:sce,text:cce,thematicBreak:uce,toml:Fm,yaml:Fm,definition:Fm,footnoteDefinition:Fm};function Fm(){}const $$=-1,Uv=0,rh=1,dy=2,Lk=3,$k=4,Bk=5,Uk=6,B$=7,U$=8,iP=typeof self=="object"?self:globalThis,fce=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,o]=t[i];switch(a){case Uv:case $$:return n(o,i);case rh:{const c=n([],i);for(const d of o)c.push(r(d));return c}case dy:{const c=n({},i);for(const[d,f]of o)c[r(d)]=r(f);return c}case Lk:return n(new Date(o),i);case $k:{const{source:c,flags:d}=o;return n(new RegExp(c,d),i)}case Bk:{const c=n(new Map,i);for(const[d,f]of o)c.set(r(d),r(f));return c}case Uk:{const c=n(new Set,i);for(const d of o)c.add(r(d));return c}case B$:{const{name:c,message:d}=o;return n(new iP[c](d),i)}case U$:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new iP[a](o),i)};return r},aP=e=>fce(new Map,e)(0),su="",{toString:hce}={},{keys:pce}=Object,Tf=e=>{const t=typeof e;if(t!=="object"||!e)return[Uv,t];const n=hce.call(e).slice(8,-1);switch(n){case"Array":return[rh,su];case"Object":return[dy,su];case"Date":return[Lk,su];case"RegExp":return[$k,su];case"Map":return[Bk,su];case"Set":return[Uk,su];case"DataView":return[rh,n]}return n.includes("Array")?[rh,n]:n.includes("Error")?[B$,n]:[dy,n]},Hm=([e,t])=>e===Uv&&(t==="function"||t==="symbol"),mce=(e,t,n,r)=>{const i=(o,c)=>{const d=r.push(o)-1;return n.set(c,d),d},a=o=>{if(n.has(o))return n.get(o);let[c,d]=Tf(o);switch(c){case Uv:{let p=o;switch(d){case"bigint":c=U$,p=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([$$],o)}return i([c,p],o)}case rh:{if(d){let y=o;return d==="DataView"?y=new Uint8Array(o.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(o)),i([d,[...y]],o)}const p=[],m=i([c,p],o);for(const y of o)p.push(a(y));return m}case dy:{if(d)switch(d){case"BigInt":return i([d,o.toString()],o);case"Boolean":case"Number":case"String":return i([d,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const p=[],m=i([c,p],o);for(const y of pce(o))(e||!Hm(Tf(o[y])))&&p.push([a(y),a(o[y])]);return m}case Lk:return i([c,o.toISOString()],o);case $k:{const{source:p,flags:m}=o;return i([c,{source:p,flags:m}],o)}case Bk:{const p=[],m=i([c,p],o);for(const[y,v]of o)(e||!(Hm(Tf(y))||Hm(Tf(v))))&&p.push([a(y),a(v)]);return m}case Uk:{const p=[],m=i([c,p],o);for(const y of o)(e||!Hm(Tf(y)))&&p.push(a(y));return m}}const{message:f}=o;return i([c,{name:d,message:f}],o)};return a},sP=(e,{json:t,lossy:n}={})=>{const r=[];return mce(!(t||n),!!t,new Map,r)(e),r},fy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?aP(sP(e,t)):structuredClone(e):(e,t)=>aP(sP(e,t));function gce(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function yce(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function vce(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||gce,r=e.options.footnoteBackLabel||yce,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),y=pd(m.toLowerCase());let v=0;const S=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++v<=b;){S.length>0&&S.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,v);typeof E=="string"&&(E={type:"text",value:E}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const E=j.children[j.children.length-1];E&&E.type==="text"?E.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...S)}else p.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...fy(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
105
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
106
|
+
`}]}}const q$=(function(e){if(e==null)return Sce;if(typeof e=="function")return qv(e);if(typeof e=="object")return Array.isArray(e)?xce(e):bce(e);if(typeof e=="string")return wce(e);throw new Error("Expected function, string, or object as test")});function xce(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=q$(e[n]);return qv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function bce(e){const t=e;return qv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function wce(e){return qv(t);function t(n){return n&&n.type===e}}function qv(e){return t;function t(n,r,i){return!!(jce(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Sce(){return!0}function jce(e){return e!==null&&typeof e=="object"&&"type"in e}const F$=[],Nce=!0,oP=!1,kce="skip";function Cce(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=q$(i),o=r?-1:1;c(e,void 0,[])();function c(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=F$,S,b,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=Ace(n(d,p)),v[0]===oP))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==kce)for(b=(r?k.children.length:-1)+o,j=p.concat(k);b>-1&&b<k.children.length;){const E=k.children[b];if(S=c(E,b,j)(),S[0]===oP)return S;b=typeof S[1]=="number"?S[1]:b+o}}return v}}}function Ace(e){return Array.isArray(e)?e:typeof e=="number"?[Nce,e]:e==null?F$:[e]}function H$(e,t,n,r){let i,a,o;typeof t=="function"&&typeof n!="function"?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Cce(e,a,c,i);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return o(d,m,p)}}const y1={}.hasOwnProperty,Oce={};function Ece(e,t){const n=t||Oce,r=new Map,i=new Map,a=new Map,o={...dce,...n.handlers},c={all:f,applyData:zce,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:o,one:d,options:n,patch:_ce,wrap:Pce};return H$(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),c;function d(p,m){const y=p.type,v=c.handlers[y];if(y1.call(c.handlers,y)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:b,...j}=p,k=fy(j);return k.children=c.all(p),k}return fy(p)}return(c.options.unknownHandler||Tce)(c,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const S=c.one(y[v],p);if(S){if(v&&y[v-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=lP(S.value)),!Array.isArray(S)&&S.type==="element")){const b=S.children[0];b&&b.type==="text"&&(b.value=lP(b.value))}Array.isArray(S)?m.push(...S):m.push(S)}}}return m}}function _ce(e,t){e.position&&(t.position=hse(e))}function zce(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&a&&Object.assign(n.properties,fy(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Tce(e,t){const n=t.data||{},r="value"in t&&!(y1.call(n,"hProperties")||y1.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Pce(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
107
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
108
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
109
|
+
`}),n}function lP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function cP(e,t){const n=Ece(e,t),r=n.one(e,void 0),i=vce(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
110
|
+
`},i),a}function Rce(e,t){return e&&"run"in e?async function(n,r){const i=cP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return cP(n,{file:r,...e||t})}}function uP(e){if(e)throw e}var qw,dP;function Dce(){if(dP)return qw;dP=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},o=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return qw=function d(){var f,p,m,y,v,S,b=arguments[0],j=1,k=arguments.length,E=!1;for(typeof b=="boolean"&&(E=b,b=arguments[1]||{},j=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=c(b,p),y=c(f,p),b!==y&&(E&&y&&(a(y)||(v=i(y)))?(v?(v=!1,S=m&&i(m)?m:[]):S=m&&a(m)?m:{},o(b,{name:p,newValue:d(E,S,y)})):typeof y<"u"&&o(b,{name:p,newValue:y}));return b},qw}var Mce=Dce();const Fw=ba(Mce);function v1(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ice(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...i);function c(d,...f){const p=e[++a];let m=-1;if(d){o(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?Lce(p,c)(...f):o(null,...f)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Lce(e,t){let n;return r;function r(...o){const c=e.length>o.length;let d;c&&o.push(i);try{d=e.apply(this,o)}catch(f){const p=f;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(o,...c){n||(n=!0,t(o,...c))}function a(o){i(null,o)}}const Ra={basename:$ce,dirname:Bce,extname:Uce,join:qce,sep:"/"};function $ce(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hh(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Bce(e){if(Hh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Uce(e){Hh(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function qce(...e){let t=-1,n;for(;++t<e.length;)Hh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Fce(n)}function Fce(e){Hh(e);const t=e.codePointAt(0)===47;let n=Hce(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Hce(e,t){let n="",r=0,i=-1,a=0,o=-1,c,d;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=o,a=0;continue}}else if(n.length>0){n="",r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else c===46&&a>-1?a++:a=-1}return n}function Hh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Kce={cwd:Gce};function Gce(){return"/"}function x1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Vce(e){if(typeof e=="string")e=new URL(e);else if(!x1(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Qce(e)}function Qce(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Hw=["history","path","basename","stem","extname","dirname"];class K${constructor(t){let n;t?x1(t)?n={path:t}:typeof t=="string"||Yce(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Kce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Hw.length;){const a=Hw[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)Hw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Ra.basename(this.path):void 0}set basename(t){Gw(t,"basename"),Kw(t,"basename"),this.path=Ra.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ra.dirname(this.path):void 0}set dirname(t){fP(this.basename,"dirname"),this.path=Ra.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ra.extname(this.path):void 0}set extname(t){if(Kw(t,"extname"),fP(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ra.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){x1(t)&&(t=Vce(t)),Gw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ra.basename(this.path,this.extname):void 0}set stem(t){Gw(t,"stem"),Kw(t,"stem"),this.path=Ra.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new zr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Kw(e,t){if(e&&e.includes(Ra.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ra.sep+"`")}function Gw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function fP(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Yce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wce=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Zce={}.hasOwnProperty;class qk extends Wce{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ice()}copy(){const t=new qk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Fw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Yw("data",this.frozen),this.namespace[t]=n,this):Zce.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Yw("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Km(t),r=this.parser||this.Parser;return Vw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Vw("process",this.parser||this.Parser),Qw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,o){const c=Km(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return f(p);const v=m,S=r.stringify(v,y);eue(S)?y.value=S:y.result=S,f(p,y)});function f(p,m){p||!m?o(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Vw("processSync",this.parser||this.Parser),Qw("processSync",this.compiler||this.Compiler),this.process(t,i),pP("processSync","process",n),r;function i(a,o){n=!0,uP(a),r=o}}run(t,n,r){hP(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(o,c){const d=Km(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?c(p):o?o(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),pP("runSync","run",r),i;function a(o,c){uP(o),i=c,r=!0}}stringify(t,n){this.freeze();const r=Km(n),i=this.compiler||this.Compiler;return Qw("stringify",i),hP(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Yw("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...m]=f;d(p,m)}else o(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function o(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(i.settings=Fw(!0,i.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...S]=p;const b=r[y][1];v1(b)&&v1(v)&&(v=Fw(!0,b,v)),r[y]=[f,v,...S]}}}}const Xce=new qk().freeze();function Vw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Qw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Yw(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function hP(e){if(!v1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function pP(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Km(e){return Jce(e)?e:new K$(e)}function Jce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function eue(e){return typeof e=="string"||tue(e)}function tue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nue="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mP=[],gP={allowDangerousHtml:!0},rue=/^(https?|ircs?|mailto|xmpp)$/i,iue=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function aue(e){const t=sue(e),n=oue(e);return lue(t.runSync(t.parse(n),n),e)}function sue(e){const t=e.rehypePlugins||mP,n=e.remarkPlugins||mP,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gP}:gP;return Xce().use($le).use(n).use(Rce,r).use(t)}function oue(e){const t=e.children||"",n=new K$;return typeof t=="string"&&(n.value=t),n}function lue(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||cue;for(const p of iue)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+nue+p.id,void 0);return H$(e,f),vse(e,{Fragment:l.Fragment,components:i,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return o?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in $w)if(Object.hasOwn($w,v)&&Object.hasOwn(p.properties,v)){const S=p.properties[v],b=$w[v];(b===null||b.includes(p.tagName))&&(p.properties[v]=d(String(S||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function cue(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||rue.test(e.slice(0,t))?e:""}function uue(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Fv=uue();function Hv(e){(e===401||e===403)&&_5()}async function yP(e){const t=await fetch(`${Fv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){Hv(t.status);const n=await t.json().catch(()=>({}));throw new Or(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function due(e){const t=await fetch(`${Fv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){Hv(t.status);const n=await t.json().catch(()=>({}));throw new Or(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function fue(e){const t=await fetch(`${Fv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){Hv(t.status);const n=await t.json().catch(()=>({}));throw new Or(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function hue({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:o}){const c={prompt:t};n&&(c.provider=n),r&&(c.modelId=r),i&&(c.scope=i);const d=await fetch(`${Fv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c),signal:a});if(!d.ok||!d.body){Hv(d.status);const v=await d.json().catch(()=>({}));throw new Or(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const y=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",y,{once:!0});try{for(;;){const{value:v,done:S}=await f.read();if(S)break;m+=p.decode(v,{stream:!0});let b=m.indexOf(`
|
|
111
|
+
|
|
112
|
+
`);for(;b!==-1;){const j=m.slice(0,b);m=m.slice(b+2);for(const k of j.split(`
|
|
113
|
+
`)){if(!k.startsWith("data:"))continue;const E=k.slice(5).trim();if(E)try{o(JSON.parse(E))}catch{}}b=m.indexOf(`
|
|
114
|
+
|
|
115
|
+
`)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function G$(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const pue=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],mue=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],Gm=e=>`canonry:aero:provider:${e}`,vP=e=>`canonry:aero:scope:${e}`;function gue({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,o]=x.useState([]),[c,d]=x.useState(""),[f,p]=x.useState(!1),[m,y]=x.useState([]),[v,S]=x.useState(""),[b,j]=x.useState(null),[k,E]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Gm(e))??null),[C,O]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(vP(e))==="all"?"all":"read-only"),z=x.useRef(null),A=x.useRef(null),_=x.useRef(null),[R,$]=x.useState(0),F=x.useMemo(()=>{const U=c.trimStart();if(!U.startsWith("/"))return[];if(/\s/.test(U))return[];const M=U.toLowerCase();return mue.filter(Q=>Q.command.startsWith(M)||Q.label.toLowerCase().includes(M.slice(1)))},[c]);x.useEffect(()=>{$(U=>F.length===0?0:Math.min(U,F.length-1))},[F.length]);const q=Ar({queryKey:Re.agent.providers(e),queryFn:()=>due(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const U=q.data?.providers??[];if(k){const Q=U.find(oe=>oe.id===k&&oe.configured);if(Q)return Q}const M=q.data?.defaultProvider;return M?U.find(Q=>Q.id===M)??null:null},[k,q.data]);x.useEffect(()=>{if(!q.data||!k)return;q.data.providers.find(M=>M.id===k&&M.configured)||(E(null),window.localStorage.removeItem(Gm(e)))},[q.data,k,e]);const V=x.useCallback(U=>{E(U),!(typeof window>"u")&&(U?window.localStorage.setItem(Gm(e),U):window.localStorage.removeItem(Gm(e)))},[e]),X=x.useCallback(()=>{O(U=>{const M=U==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(vP(e),M),M})},[e]);x.useEffect(()=>{if(!t)return;const U=M=>{M.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[t,r]),x.useEffect(()=>{if(!t)return;let U=!1;j(null);const M=()=>{U||f||yP(e).then(ne=>{U||o(ne.messages)}).catch(ne=>{U||j(ne instanceof Error?ne.message:"Failed to load transcript")})};M();const oe=window.setInterval(M,15e3);return()=>{U=!0,window.clearInterval(oe)}},[t,e,f]),x.useEffect(()=>()=>{z.current?.abort()},[e]),x.useEffect(()=>{const U=A.current;U&&(U.scrollTop=U.scrollHeight)},[a,v,m]);async function Z(U){const M=U.trim();if(!M||f)return;j(null),d(""),p(!0),S(""),y([]);const Q={role:"user",content:M,timestamp:Date.now()};o(ne=>[...ne,Q]);const oe=new AbortController;z.current=oe;try{await hue({project:e,prompt:M,provider:k??void 0,scope:C,signal:oe.signal,onEvent:H});const ne=await yP(e);o(ne.messages)}catch(ne){ne.name!=="AbortError"&&j(ne instanceof Error?ne.message:"Prompt failed")}finally{p(!1),S(""),z.current=null}}function H(U){switch(U.type){case"message_update":S(G$(U.message));break;case"message_end":U.message.role==="assistant"&&S("");break;case"tool_execution_start":y(M=>[...M,{id:U.toolCallId,name:U.toolName,args:U.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(M=>M.map(Q=>Q.id===U.toolCallId?{...Q,endedAt:Date.now(),isError:U.isError,result:U.result}:Q));break;case"error":j(U.message);break}}async function J(){z.current?.abort();try{await fue(e),o([]),j(null)}catch(U){j(U instanceof Error?U.message:"Reset failed")}}const ue=a.length===0,we=t&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",I=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",D=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return l.jsx("div",{className:we,onClick:U=>{r&&U.target===U.currentTarget&&i(!1)},children:l.jsx("div",{className:I,children:t?l.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(_2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),l.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),l.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(yue,{providers:q.data?.providers??[],active:B,override:k,onPick:V,disabled:f}),l.jsx("button",{type:"button",onClick:J,className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:l.jsx(X5,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.jsx("button",{type:"button",onClick:()=>i(U=>!U),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?l.jsx(bY,{className:"h-3.5 w-3.5","aria-hidden":"true"}):l.jsx(gY,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),l.jsx("button",{type:"button",onClick:()=>{i(!1),n(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:l.jsx(cd,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),l.jsxs("div",{ref:A,className:D,children:[b&&l.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:b}),ue&&!f&&l.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",l.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:pue.map(U=>l.jsx("button",{type:"button",onClick:()=>Z(U.prompt),className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:U.label},U.label))})]}),Sue(a,e,k,C),m.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(U=>l.jsx(V$,{trail:U},U.id))}),f&&v&&l.jsxs("div",{className:"mt-3",children:[l.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsx(Q$,{content:v})]}),f&&!v&&m.every(U=>U.endedAt!==void 0)&&l.jsx(Cue,{})]}),l.jsx(vue,{projectName:e,activeProvider:B,scope:C,onToggleScope:X,disabled:f}),l.jsxs("div",{className:"relative",children:[F.length>0&&l.jsx(xue,{matches:F,selectedIndex:R,onHover:$,onPick:U=>{d(""),_.current?.focus(),U.action==="clear"?J():Z(U.prompt)}}),l.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:U=>{if(U.preventDefault(),F.length>0){const M=F[R];d(""),M.action==="clear"?J():Z(M.prompt);return}Z(c)},children:[l.jsx("textarea",{ref:_,value:c,onChange:U=>d(U.target.value),onKeyDown:U=>{if(F.length>0){if(U.key==="ArrowDown"){U.preventDefault(),$(M=>(M+1)%F.length);return}if(U.key==="ArrowUp"){U.preventDefault(),$(M=>(M-1+F.length)%F.length);return}if(U.key==="Tab"){U.preventDefault();const M=F[R];d(`${M.command} `);return}if(U.key==="Escape"){U.preventDefault(),d("");return}}if(U.key==="Enter"&&!U.shiftKey)if(U.preventDefault(),F.length>0){const M=F[R];d(""),M.action==="clear"?J():Z(M.prompt)}else Z(c)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),l.jsx("button",{type:"submit",disabled:f||!c.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:l.jsx(FQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):l.jsxs("button",{type:"button",onClick:()=>n(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(_2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),l.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function yue({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,o]=x.useState(!1),c=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=y=>{c.current?.contains(y.target)||o(!1)},m=y=>{y.key==="Escape"&&o(!1)};return window.addEventListener("mousedown",p),window.addEventListener("keydown",m),()=>{window.removeEventListener("mousedown",p),window.removeEventListener("keydown",m)}},[a]),e.length===0)return null;const d=t?.label.replace(/\s+\(.+\)$/,"")??"No provider",f=t?.defaultModel;return l.jsxs("div",{ref:c,className:"relative",children:[l.jsxs("button",{type:"button",onClick:()=>o(p=>!p),disabled:i,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":a,title:t?`${t.label} · ${t.defaultModel}`:"Pick a provider",children:[l.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&l.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),l.jsx(QQ,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&l.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[l.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),l.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,y=n===p.id;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(y?null:p.id),o(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[l.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?l.jsx(V5,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),l.jsxs("span",{className:"flex-1",children:[l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),y&&l.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!p.configured&&l.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),l.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&l.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&l.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",l.jsx("code",{className:"font-mono text-zinc-400",children:bue(p.id)})]})]})]})},p.id)})}),n&&l.jsx("button",{type:"button",onClick:()=>{r(null),o(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function vue({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,o=n==="all";return l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[l.jsx("span",{className:"text-zinc-600",children:"project"}),l.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&l.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[l.jsx("span",{className:"text-zinc-600",children:"model"}),l.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),l.jsxs("button",{type:"button",onClick:r,disabled:i,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${o?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:o?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[l.jsx("span",{className:o?"text-amber-500":"text-zinc-600",children:"scope"}),l.jsx("span",{className:"font-medium",children:o?"all tools":"read-only"})]})]})}function xue({matches:e,selectedIndex:t,onHover:n,onPick:r}){return l.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[l.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),l.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const o=a===t;return l.jsx("li",{children:l.jsxs("button",{type:"button",role:"option","aria-selected":o,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${o?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[l.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),l.jsx("span",{className:"font-medium",children:i.label}),l.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),l.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[l.jsx("span",{className:"mr-3",children:"↑↓ to select"}),l.jsx("span",{className:"mr-3",children:"Enter to run"}),l.jsx("span",{children:"Tab to autocomplete"})]})]})}function bue(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY"}}function wue(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function Sue(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const o=e[a],c=wue(o,a);if(o.role==="user"){const d=typeof o.content=="string"?o.content:JSON.stringify(o.content);if(d.startsWith("[system]"))continue;i.push(l.jsx(jue,{text:d,projectName:t,providerOverride:n,scope:r},c));continue}if(o.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=kue(o,d,o.timestamp??0),m=G$(o);i.push(l.jsxs(x.Fragment,{children:[p.length>0&&l.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>l.jsx(V$,{trail:y},y.id))}),m.trim()&&l.jsxs("div",{className:"mt-3",children:[l.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsx(Q$,{content:m})]})]},c)),a=f-1;continue}}return i}function jue({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),o=x.useMemo(()=>Nue(t,e,n,r),[t,e,n,r]);async function c(){try{await navigator.clipboard.writeText(o),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return l.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),l.jsx("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:o,children:i?l.jsxs(l.Fragment,{children:[l.jsx(V5,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):l.jsxs(l.Fragment,{children:[l.jsx(tY,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),l.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function Nue(e,t,n,r){const i=["canonry","agent","ask",xP(e),xP(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function xP(e){return`'${e.replace(/'/g,"'\\''")}'`}function kue(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,o=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:o?.timestamp,isError:o?.isError,result:o?.content})}return r}function V$({trail:e}){const[t,n]=x.useState(!1),r=e.endedAt===void 0,i=!r&&e.isError===!0,a=e.endedAt!=null?e.endedAt-e.startedAt:null,o=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,c=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return l.jsxs("div",{className:`rounded-md border ${c} ${d} font-mono`,children:[l.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":t,children:[l.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?l.jsx(Z5,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?l.jsx(ey,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):l.jsx(UY,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),l.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),l.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?l.jsx("span",{className:"text-emerald-400",children:"running…"}):l.jsxs(l.Fragment,{children:[l.jsx("span",{children:i?"failed":"ok"}),o&&l.jsx("span",{children:o})]}),l.jsx(Uh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&l.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[l.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),l.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:bP(e.args)}),!r&&e.result!==void 0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),l.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:bP(e.result)})]})]})]})}function bP(e){try{const t=typeof e=="string"?e:JSON.stringify(e,null,2);return t.length>2e3?`${t.slice(0,2e3)}
|
|
116
|
+
… (${t.length-2e3} more chars)`:t}catch{return String(e)}}function Q$({content:e}){return l.jsx("div",{className:"aero-markdown text-zinc-100",children:l.jsx(aue,{components:{h1:t=>l.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>l.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>l.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>l.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>l.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>l.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>l.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>l.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>l.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>l.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>l.jsx("code",{...n,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:t}),pre:t=>l.jsx("pre",{...t,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:t=>l.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>l.jsx("div",{className:"mb-2 overflow-x-auto",children:l.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>l.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>l.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>l.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>l.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>l.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>l.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function Cue(){return l.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[l.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),l.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[l.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),l.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),l.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function Aue(){const e=A5(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=Ar({queryKey:Re.projects.all,queryFn:jv,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(o=>o.id===n)??i.find(o=>o.name===n);return a?l.jsx(gue,{projectName:a.name},a.name):null}function Kv(e,t,n){switch(e.invalidateQueries({queryKey:Re.runs.all}),e.invalidateQueries({queryKey:Re.projects.all}),t){case Nt["answer-visibility"]:case Nt["site-audit"]:case Nt["backlink-extract"]:return;case Nt["gsc-sync"]:case Nt["inspect-sitemap"]:e.invalidateQueries({queryKey:Re.gsc.project(n)});return;case Nt["ga-sync"]:e.invalidateQueries({queryKey:Re.traffic.project(n)});return;case Nt["traffic-sync"]:e.invalidateQueries({queryKey:Re.traffic.project(n)}),e.invalidateQueries({queryKey:Re.serverTraffic.project(n)});return;case Nt["bing-inspect"]:case Nt["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:Re.bing.project(n)});return;default:return t}}const wP=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:lY},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:KQ},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:sY}],SP=e=>({label:e,state:"checking",detail:"Checking service health"}),Oue={apiStatus:SP("API"),workerStatus:SP("Worker")};function Eue(e){switch(e){case Nt["answer-visibility"]:return"Visibility sweep";case Nt["gsc-sync"]:return"GSC sync";case Nt["inspect-sitemap"]:return"Sitemap inspection";case Nt["ga-sync"]:return"GA sync";case Nt["traffic-sync"]:return"Traffic sync";case Nt["bing-inspect"]:return"Bing URL inspection";case Nt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Nt["site-audit"]:return"Site audit";case Nt["backlink-extract"]:return"Backlink extract"}}function _ue(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function zue(e){const t=Eue(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function Tue(e,t){return e.error?`${t}: ${ck(e.error)}`:e.location?`${t} · ${e.location}`:t}function Pue(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function Rue(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 Due(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function Mue(){const e=Kr(),t=x.useSyncExternalStore(xne,Vl,Vl),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=Ar({queryKey:Re.runs.all,queryFn:T5,enabled:n,staleTime:e1,refetchInterval:3e3}),i=Ar({queryKey:Re.projects.all,queryFn:jv,enabled:n}),a=x.useRef({}),o=x.useCallback(()=>{r.refetch()},[r.refetch]);return x.useEffect(()=>{n&&o()},[n,o]),x.useEffect(()=>{if(!n||typeof window>"u")return;const c=()=>{document.visibilityState==="visible"&&o()};return window.addEventListener("focus",o),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("focus",o),document.removeEventListener("visibilitychange",c)}},[n,o]),x.useEffect(()=>{const c=r.data??[],d=i.data??[],f=Object.fromEntries(c.map(m=>[m.id,m])),p=Object.fromEntries(c.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const y=f[m.runId];if(!y||!mk(y.status)||(a.current[y.id]??m.lastAnnouncedStatus)===y.status)continue;const S=d.find(j=>j.id===y.projectId);if(S&&Kv(e,y.kind,S.name),m.sourceAction==="run-all"){aT(y.id);continue}const b=Pue(y.projectId,m.projectLabel,d);gt({title:zue(y),detail:Tue(y,b),tone:_ue(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),aT(y.id)}for(const m of Object.values(t.batches)){const y=Sne(m.runIds,f);y.finished&&(gt({title:"Run-all batch finished",detail:Rue(y,m.skippedCount),tone:Due(y),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),wne(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function Iue(){const e=qh(),{dashboard:t,isLoading:n,refetch:r}=fc(),o=$v(!e,e?.health).data??e?.health??Oue,c=A5(),{runId:d,evidenceId:f,closeDrawer:p}=fd(),[m,y]=x.useState(!1),v=Bae(d),S=v.data??null,b=v.isLoading;x.useEffect(()=>{S&&S.status!=="running"&&S.status!=="queued"&&r()},[S?.status,r]),x.useEffect(()=>{y(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const O=z=>{z.key==="Escape"&&p()};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[d,f,p]);const j=t??e?.dashboard??null,k=d&&j?gae(j,d):void 0,E=f&&j?yae(j,f):void 0,C=(()=>{const O=c.pathname;if(O==="/")return"Portfolio";if(O==="/projects")return"Projects";if(O==="/runs")return"Runs";if(O==="/settings")return"Settings";if(O==="/setup")return"Setup";if(O==="/backlinks")return"Backlinks";if(O==="/traffic"||O.startsWith("/traffic/"))return"Server traffic";if(O.startsWith("/projects/")){const A=O.split("/").filter(Boolean)[1];if(A&&j){const _=j.projects.find(R=>R.project.id===A);if(_)return _.project.name}return"Project"}return"Not found"})();return l.jsxs("div",{className:"app-shell",children:[l.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),l.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[l.jsx("div",{className:"sidebar-brand",children:l.jsx(mT,{version:o.apiStatus.version})}),l.jsxs("nav",{className:"sidebar-nav",children:[l.jsxs(jt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(fY,{className:"sidebar-icon"}),l.jsx("span",{children:"Overview"})]}),l.jsxs(jt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(uY,{className:"sidebar-icon"}),l.jsx("span",{children:"Projects"})]}),l.jsxs(jt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(Zg,{className:"sidebar-icon"}),l.jsx("span",{children:"Runs"})]}),l.jsxs(jt,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[l.jsx(CY,{className:"sidebar-icon"}),l.jsx("span",{children:"Server traffic"})]}),l.jsxs(jt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(W5,{className:"sidebar-icon"}),l.jsx("span",{children:"Backlinks"})]}),l.jsxs(jt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(TY,{className:"sidebar-icon"}),l.jsx("span",{children:"Settings"})]}),n?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(O=>l.jsxs("div",{className:"sidebar-skeleton-item",children:[l.jsx("span",{className:"skeleton-circle size-2"}),l.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+O*15}%`}})]},O))]}):j&&j.projects.length>0?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Projects"}),j.projects.map(O=>{const z=O.visibilitySummary.tone;return l.jsxs(jt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[l.jsx("span",{className:`sidebar-dot sidebar-dot-${z}`}),l.jsx("span",{children:O.project.name})]},O.project.id)})]}):n?null:l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"sidebar-section-title",children:"Resources"}),l.jsxs(jt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[l.jsx(EY,{className:"sidebar-icon"}),l.jsx("span",{children:"Setup"})]})]})]}),l.jsx("div",{className:"sidebar-footer",children:wP.map(({label:O,href:z,Icon:A})=>l.jsx("a",{className:"sidebar-footer-icon",href:z,target:"_blank",rel:"noopener noreferrer",title:O,"aria-label":O,children:l.jsx(A,{className:"size-4"})},z))})]}),l.jsxs("div",{className:"main-area",children:[l.jsxs("header",{className:"topbar",children:[l.jsxs("div",{className:"topbar-left",children:[l.jsx("div",{className:"topbar-brand-mobile",children:l.jsx(mT,{compact:!0})}),l.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[l.jsx(jt,{to:"/",children:"Home"}),l.jsx(Uh,{className:"breadcrumb-sep size-3"}),l.jsx("span",{className:"breadcrumb-current",children:C})]})]}),l.jsxs("div",{className:"topbar-actions",children:[l.jsxs("div",{className:"health-pill-row",children:[l.jsxs("span",{className:`health-pill health-pill-${o.apiStatus.state}`,title:Io(o.apiStatus),children:["API ",o.apiStatus.state==="ok"?"ok":o.apiStatus.state]}),l.jsxs("span",{className:`health-pill health-pill-${o.workerStatus.state}`,title:Io(o.workerStatus),children:["Worker ",o.workerStatus.state==="ok"?"ok":o.workerStatus.state]})]}),l.jsxs(ge,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(O=>!O),children:[l.jsx(vY,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),l.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[l.jsxs(ge,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[l.jsx(cd,{className:"size-5"}),l.jsx("span",{className:"sr-only",children:"Close navigation"})]}),l.jsx(jt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),l.jsx(jt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),l.jsx(jt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),l.jsx(jt,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),l.jsx(jt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),j&&j.projects.length>0?l.jsxs("div",{className:"mobile-nav-section",children:[l.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),j.projects.map(O=>l.jsx(jt,{to:"/projects/$projectId",params:{projectId:O.project.id},className:"mobile-nav-link",children:O.project.name},O.project.id))]}):null]}),l.jsx("main",{id:"content",className:"page-shell",children:n&&!e?l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-40"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(O=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text w-full"}),l.jsx("div",{className:"skeleton-text-sm w-3/4"})]},O))}),l.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(O=>l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-20"}),l.jsx("div",{className:"space-y-2",children:[1,2,3].map(z=>l.jsx("div",{className:"skeleton-text-sm w-full"},z))})]},O))})]}):l.jsx(WN,{})}),l.jsxs("footer",{className:"footer",children:[l.jsxs("span",{className:"footer-brand",children:[l.jsx("span",{children:l.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),o.apiStatus.version&&o.apiStatus.version!=="unknown"?l.jsxs("span",{className:"footer-version",children:["v",o.apiStatus.version]}):null]}),l.jsx("div",{className:"footer-links",children:wP.map(({label:O,href:z,Icon:A})=>l.jsx("a",{href:z,target:"_blank",rel:"noopener noreferrer",title:O,"aria-label":O,className:"footer-icon",children:l.jsx(A,{className:"size-3.5"})},z))})]})]}),k?l.jsxs(aae,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[l.jsx(Rv,{status:k.status}),l.jsx("span",{className:"text-zinc-400",children:k.startedAt}),l.jsx("span",{className:"text-zinc-500",children:k.duration}),l.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&l.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),b?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):S&&S.snapshots.length>0?l.jsxs("div",{className:"space-y-2",children:[S.snapshots.map(O=>l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:O.query??"Unknown query"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Ql,{provider:O.provider}),l.jsx(S3,{variant:O.citationState===gh.cited?"success":"neutral",children:O.citationState})]})]}),O.model&&l.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:O.model}),O.citedDomains.length>0&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[l.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",O.citedDomains.join(", ")]}),O.competitorOverlap.length>0&&l.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",O.competitorOverlap.join(", ")]}),O.groundingSources&&O.groundingSources.length>0&&l.jsxs("details",{className:"mt-2",children:[l.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[O.groundingSources.length," grounding source",O.groundingSources.length!==1?"s":""]}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:O.groundingSources.map((z,A)=>l.jsx("li",{className:"text-xs text-zinc-500 truncate",children:l.jsx("a",{href:z.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:z.title||z.uri})},A))})]}),O.answerText&&l.jsxs("details",{className:"mt-1",children:[l.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:O.answerText})]})]},O.id)),S.status==="running"&&l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):S&&S.status==="running"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):S&&S.status==="queued"?l.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[l.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):S&&S.error?l.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[l.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),l.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:sne(S.error)})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?l.jsx(cae,{evidence:E.evidence,project:E.project,onClose:p}):null,l.jsx(Mue,{}),l.jsx(Fae,{}),l.jsx(Aue,{})]})}class Lue extends x.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?l.jsx("div",{className:"page-container",children:l.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[l.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:l.jsx(ey,{className:"size-6 text-rose-400"})}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),l.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),l.jsxs("div",{className:"flex gap-3 mt-2",children:[l.jsxs(ge,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[l.jsx(X5,{className:"size-3.5 mr-1.5"}),"Try again"]}),l.jsx(ge,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const ze=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ta("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}));ze.displayName="Card";const b1=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ta("flex flex-col gap-1.5 p-5",e),...t}));b1.displayName="CardHeader";const w1=x.forwardRef(({className:e,...t},n)=>l.jsx("h3",{ref:n,className:ta("font-medium tracking-tight text-zinc-50",e),...t}));w1.displayName="CardTitle";const S1=x.forwardRef(({className:e,...t},n)=>l.jsx("p",{ref:n,className:ta("text-sm text-zinc-500",e),...t}));S1.displayName="CardDescription";const _g=x.forwardRef(({className:e,...t},n)=>l.jsx("div",{ref:n,className:ta("p-5 pt-0",e),...t}));_g.displayName="CardContent";function $ue({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,a=5,o=Math.min(...e),d=Math.max(...e)-o||1,f=i-a*2,p=r-a*2,m=e.map((y,v)=>{const S=a+v/Math.max(e.length-1,1)*f,b=a+(1-(y-o)/d)*p;return`${S},${b}`}).join(" ");return l.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[l.jsx("defs",{children:l.jsx("clipPath",{id:n,children:l.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),l.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),l.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function Bue({project:e}){return l.jsxs(jt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[l.jsxs("div",{className:"project-row-primary",children:[l.jsxs("div",{children:[l.jsx("p",{className:"project-name",children:e.project.name}),l.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),l.jsx("p",{className:"project-insight",children:e.insight})]}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),l.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),l.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&l.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),l.jsx("div",{className:"project-row-stat",children:l.jsxs("div",{className:"metric-inline-block",children:[l.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),l.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),l.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",zv(e.lastRun.status)]})]})}),l.jsx("div",{className:"project-row-chart",children:l.jsx($ue,{points:e.trend,tone:t3(e.lastRun.status)})}),l.jsx("span",{className:"project-row-link",children:l.jsx(Uh,{className:"h-4 w-4 text-zinc-500"})})]})}function Uue(){const e=qh(),{dashboard:t,isLoading:n}=fc(),r=t??e?.dashboard;if(!r||n)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-32"}),l.jsx("div",{className:"skeleton-text-sm w-64"})]}),l.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[l.jsxs("div",{className:"flex-1 space-y-2",children:[l.jsx("div",{className:"skeleton-text w-36"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton-text w-16"}),l.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,c=$v(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},d=fne(i.systemHealth,c,r.settings),{openRun:f}=fd();return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Portfolio"}),l.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),l.jsx("div",{className:"page-header-right",children:l.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?l.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>l.jsx(Bue,{project:p},p.project.id))}):l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),l.jsx(ge,{size:"sm",asChild:!0,children:l.jsx(jt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),l.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),l.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),l.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>l.jsxs(jt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[l.jsxs("div",{children:[l.jsx("p",{className:"attention-title",children:p.title}),l.jsx("p",{className:"attention-detail",children:p.detail})]}),l.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),l.jsxs("section",{className:"overview-secondary-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),l.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),l.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>l.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[l.jsxs("div",{children:[l.jsx("p",{className:"compact-run-title",children:p.projectName}),l.jsx("p",{className:"compact-run-detail",children:p.summary})]}),l.jsx(Rv,{status:p.status})]},p.id)):l.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),l.jsxs("section",{className:"page-section",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),l.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),l.jsx("div",{className:"health-grid",children:d.map(p=>l.jsxs(ze,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),l.jsx("h3",{children:p.detail})]}),l.jsx(ct,{tone:p.tone,title:p.id==="api"?Io(c.apiStatus):p.id==="worker"?Io(c.workerStatus):void 0,children:p.label})]}),l.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Fk=Symbol.for("yaml.alias"),j1=Symbol.for("yaml.document"),To=Symbol.for("yaml.map"),Y$=Symbol.for("yaml.pair"),Ha=Symbol.for("yaml.scalar"),md=Symbol.for("yaml.seq"),Wi=Symbol.for("yaml.node.type"),pc=e=>!!e&&typeof e=="object"&&e[Wi]===Fk,Gv=e=>!!e&&typeof e=="object"&&e[Wi]===j1,Kh=e=>!!e&&typeof e=="object"&&e[Wi]===To,_n=e=>!!e&&typeof e=="object"&&e[Wi]===Y$,Jt=e=>!!e&&typeof e=="object"&&e[Wi]===Ha,Gh=e=>!!e&&typeof e=="object"&&e[Wi]===md;function An(e){if(e&&typeof e=="object")switch(e[Wi]){case To:case md:return!0}return!1}function On(e){if(e&&typeof e=="object")switch(e[Wi]){case Fk:case To:case Ha:case md:return!0}return!1}const W$=e=>(Jt(e)||An(e))&&!!e.anchor,wl=Symbol("break visit"),que=Symbol("skip children"),ih=Symbol("remove node");function gd(e,t){const n=Fue(t);Gv(e)?ju(null,e.contents,n,Object.freeze([e]))===ih&&(e.contents=null):ju(null,e,n,Object.freeze([]))}gd.BREAK=wl;gd.SKIP=que;gd.REMOVE=ih;function ju(e,t,n,r){const i=Hue(e,t,n,r);if(On(i)||_n(i))return Kue(e,r,i),ju(e,i,n,r);if(typeof i!="symbol"){if(An(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const o=ju(a,t.items[a],n,r);if(typeof o=="number")a=o-1;else{if(o===wl)return wl;o===ih&&(t.items.splice(a,1),a-=1)}}}else if(_n(t)){r=Object.freeze(r.concat(t));const a=ju("key",t.key,n,r);if(a===wl)return wl;a===ih&&(t.key=null);const o=ju("value",t.value,n,r);if(o===wl)return wl;o===ih&&(t.value=null)}}return i}function Fue(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 Hue(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Kh(t))return n.Map?.(e,t,r);if(Gh(t))return n.Seq?.(e,t,r);if(_n(t))return n.Pair?.(e,t,r);if(Jt(t))return n.Scalar?.(e,t,r);if(pc(t))return n.Alias?.(e,t,r)}function Kue(e,t,n){const r=t[t.length-1];if(An(r))r.items[e]=n;else if(_n(r))e==="key"?r.key=n:r.value=n;else if(Gv(r))r.contents=n;else{const i=pc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Gue={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Vue=e=>e.replace(/[!,[\]{}]/g,t=>Gue[t]);class Lr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Lr.defaultYaml,t),this.tags=Object.assign({},Lr.defaultTags,n)}clone(){const t=new Lr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Lr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Lr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Lr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Lr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Lr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[a,o]=r;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=r;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=t.match(/^(.*!)([^!]*)$/s);i||n(`The ${t} tag has no suffix`);const a=this.tags[r];if(a)try{return a+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+Vue(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(t&&r.length>0&&On(t.contents)){const a={};gd(t.contents,(o,c)=>{On(c)&&c.tag&&(a[c.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,o]of r)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
|
|
117
|
+
`)}}Lr.defaultYaml={explicit:!1,version:"1.2"};Lr.defaultTags={"!!":"tag:yaml.org,2002:"};function Z$(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 X$(e){const t=new Set;return gd(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function J$(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Que(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=X$(e));const o=J$(t,i);return i.add(o),o},setAnchors:()=>{for(const a of n){const o=r.get(a);if(typeof o=="object"&&o.anchor&&(Jt(o.node)||An(o.node)))o.node.anchor=o.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:r}}function Nu(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const o=r[i],c=Nu(e,r,String(i),o);c===void 0?delete r[i]:c!==o&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),o=Nu(e,r,i,a);o===void 0?r.delete(i):o!==a&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const a=Nu(e,r,i,i);a===void 0?r.delete(i):a!==i&&(r.delete(i),r.add(a))}else for(const[i,a]of Object.entries(r)){const o=Nu(e,r,i,a);o===void 0?delete r[i]:o!==a&&(r[i]=o)}return e.call(t,n,r)}function Yi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Yi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!W$(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=a=>{r.res=a,delete n.onCreate};const i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e=="bigint"&&!n?.keep?Number(e):e}class Hk{constructor(t){Object.defineProperty(this,Wi,{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:r,onAnchor:i,reviver:a}={}){if(!Gv(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Yi(this,"",o);if(typeof i=="function")for(const{count:d,res:f}of o.anchors.values())i(f,d);return typeof a=="function"?Nu(a,{"":c},"",c):c}}class Kk extends Hk{constructor(t){super(Fk),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],gd(t,{Node:(a,o)=>{(pc(o)||W$(o))&&r.push(o)}}),n&&(n.aliasResolveCache=r));let i;for(const a of r){if(a===this)break;a.anchor===this.source&&(i=a)}return i}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:a}=n,o=this.resolve(i,n);if(!o){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let c=r.get(o);if(c||(Yi(o,null,n),c=r.get(o)),c?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=zg(i,o,r)),c.count*c.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(Z$(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${i} `}return i}}function zg(e,t,n){if(pc(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(An(t)){let r=0;for(const i of t.items){const a=zg(e,i,n);a>r&&(r=a)}return r}else if(_n(t)){const r=zg(e,t.key,n),i=zg(e,t.value,n);return Math.max(r,i)}return 1}const eB=e=>!e||typeof e!="function"&&typeof e!="object";class nt extends Hk{constructor(t){super(Ha),this.value=t}toJSON(t,n){return n?.keep?this.value:Yi(this.value,t,n)}toString(){return String(this.value)}}nt.BLOCK_FOLDED="BLOCK_FOLDED";nt.BLOCK_LITERAL="BLOCK_LITERAL";nt.PLAIN="PLAIN";nt.QUOTE_DOUBLE="QUOTE_DOUBLE";nt.QUOTE_SINGLE="QUOTE_SINGLE";const Yue="tag:yaml.org,2002:";function Wue(e,t,n){if(t){const r=n.filter(a=>a.tag===t),i=r.find(a=>!a.format)??r[0];if(!i)throw new Error(`Tag ${t} not found`);return i}return n.find(r=>r.identify?.(e)&&!r.format)}function bh(e,t,n){if(Gv(e)&&(e=e.contents),On(e))return e;if(_n(e)){const m=n.schema[To].createNode?.(n.schema,null,n);return m.items.push(e),m}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=i(e)),new Kk(d.anchor);d={anchor:null,node:null},c.set(e,d)}t?.startsWith("!!")&&(t=Yue+t.slice(2));let f=Wue(e,t,o.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new nt(e);return d&&(d.node=m),m}f=e instanceof Map?o[To]:Symbol.iterator in Object(e)?o[md]:o[To]}a&&(a(f),delete n.onTagObj);const p=f?.createNode?f.createNode(n.schema,e,n):typeof f?.nodeClass?.from=="function"?f.nodeClass.from(n.schema,e,n):new nt(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function hy(e,t,n){let r=n;for(let i=t.length-1;i>=0;--i){const a=t[i];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=r,r=o}else r=new Map([[a,r]])}return bh(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Qf=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class tB extends Hk{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(r=>On(r)||_n(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Qf(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(An(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,hy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(An(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...i]=t,a=this.get(r,!0);return i.length===0?!n&&Jt(a)?a.value:a:An(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!_n(n))return!1;const r=n.value;return r==null||t&&Jt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const i=this.get(n,!0);return An(i)?i.hasIn(r):!1}setIn(t,n){const[r,...i]=t;if(i.length===0)this.set(r,n);else{const a=this.get(r,!0);if(An(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,hy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Zue=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function js(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const El=(e,t,n)=>e.endsWith(`
|
|
118
|
+
`)?js(n,t):n.includes(`
|
|
119
|
+
`)?`
|
|
120
|
+
`+js(n,t):(e.endsWith(" ")?"":" ")+n,nB="flow",N1="block",Tg="quoted";function Vv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:c}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let y,v,S=!1,b=-1,j=-1,k=-1;n===N1&&(b=jP(e,b,t.length),b!==-1&&(m=b+d));for(let C;C=e[b+=1];){if(n===Tg&&C==="\\"){switch(j=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}k=b}if(C===`
|
|
121
|
+
`)n===N1&&(b=jP(e,b,t.length)),m=b+t.length+d,y=void 0;else{if(C===" "&&v&&v!==" "&&v!==`
|
|
122
|
+
`&&v!==" "){const O=e[b+1];O&&O!==" "&&O!==`
|
|
123
|
+
`&&O!==" "&&(y=b)}if(b>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===Tg){for(;v===" "||v===" ";)v=C,C=e[b+=1],S=!0;const O=b>k+1?b-2:j-1;if(p[O])return e;f.push(O),p[O]=!0,m=O+d,y=void 0}else S=!0}v=C}if(S&&c&&c(),f.length===0)return e;o&&o();let E=e.slice(0,f[0]);for(let C=0;C<f.length;++C){const O=f[C],z=f[C+1]||e.length;O===0?E=`
|
|
124
|
+
${t}${e.slice(0,z)}`:(n===Tg&&p[O]&&(E+=`${e[O]}\\`),E+=`
|
|
125
|
+
${t}${e.slice(O+1,z)}`)}return E}function jP(e,t,n){let r=t,i=t+1,a=e[i];for(;a===" "||a===" ";)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
126
|
+
`);r=t,i=t+1,a=e[i]}return r}const Qv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yv=e=>/^(%|---|\.\.\.)/m.test(e);function Xue(e,t,n){if(!t||t<0)return!1;const r=t-n,i=e.length;if(i<=r)return!1;for(let a=0,o=0;a<i;++a)if(e[a]===`
|
|
127
|
+
`){if(a-o>r)return!0;if(o=a+1,i-o<=r)return!1}return!0}function ah(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Yv(e)?" ":"");let o="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(o+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{o+=n.slice(c,d);const p=n.substr(d+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(d,6)}d+=5,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(o+=n.slice(c,d)+`
|
|
128
|
+
|
|
129
|
+
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)o+=`
|
|
130
|
+
`,d+=2;o+=a,n[d+2]===" "&&(o+="\\"),d+=1,c=d+1}break;default:d+=1}return o=c?o+n.slice(c):n,r?o:Vv(o,a,Tg,Qv(t,!1))}function k1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return ah(e,t);const n=t.indent||(Yv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
+
${n}`)+"'";return t.implicitKey?r:Vv(r,n,nB,Qv(t,!1))}function ku(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=ah;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=k1:a&&!i?r=ah:r=n?k1:ah}return r(e,t)}let C1;try{C1=new RegExp(`(^|(?<!
|
|
133
|
+
))
|
|
134
|
+
+(?!
|
|
135
|
+
|$)`,"g")}catch{C1=/\n+(?!\n|$)/g}function Pg({comment:e,type:t,value:n},r,i,a){const{blockQuote:o,commentString:c,lineWidth:d}=r.options;if(!o||/\n[\t ]+$/.test(n))return ku(n,r);const f=r.indent||(r.forceBlockIndent||Yv(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===nt.BLOCK_FOLDED?!1:t===nt.BLOCK_LITERAL?!0:!Xue(n,d,f.length);if(!n)return p?`|
|
|
136
|
+
`:`>
|
|
137
|
+
`;let m,y;for(y=n.length;y>0;--y){const z=n[y-1];if(z!==`
|
|
138
|
+
`&&z!==" "&&z!==" ")break}let v=n.substring(y);const S=v.indexOf(`
|
|
139
|
+
`);S===-1?m="-":n===v||S!==v.length-1?(m="+",a&&a()):m="",v&&(n=n.slice(0,-v.length),v[v.length-1]===`
|
|
140
|
+
`&&(v=v.slice(0,-1)),v=v.replace(C1,`$&${f}`));let b=!1,j,k=-1;for(j=0;j<n.length;++j){const z=n[j];if(z===" ")b=!0;else if(z===`
|
|
141
|
+
`)k=j;else break}let E=n.substring(0,k<j?k+1:j);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${f}`));let O=(b?f?"2":"1":"")+m;if(e&&(O+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const z=n.replace(/\n+/g,`
|
|
142
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let A=!1;const _=Qv(r,!0);o!=="folded"&&t!==nt.BLOCK_FOLDED&&(_.onOverflow=()=>{A=!0});const R=Vv(`${E}${z}${v}`,f,N1,_);if(!A)return`>${O}
|
|
143
|
+
${f}${R}`}return n=n.replace(/\n+/g,`$&${f}`),`|${O}
|
|
144
|
+
${f}${E}${n}${v}`}function Jue(e,t,n,r){const{type:i,value:a}=e,{actualString:o,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&a.includes(`
|
|
145
|
+
`)||p&&/[[\]{},]/.test(a))return ku(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||p||!a.includes(`
|
|
146
|
+
`)?ku(a,t):Pg(e,t,n,r);if(!c&&!p&&i!==nt.PLAIN&&a.includes(`
|
|
147
|
+
`))return Pg(e,t,n,r);if(Yv(a)){if(d==="")return t.forceBlockIndent=!0,Pg(e,t,n,r);if(c&&d===f)return ku(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
+
${d}`);if(o){const y=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(m),{compat:v,tags:S}=t.doc.schema;if(S.some(y)||v?.some(y))return ku(a,t)}return c?m:Vv(m,d,nB,Qv(t,!1))}function Gk(e,t,n,r){const{implicitKey:i,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:c}=e;c!==nt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(c=nt.QUOTE_DOUBLE);const d=p=>{switch(p){case nt.BLOCK_FOLDED:case nt.BLOCK_LITERAL:return i||a?ku(o.value,t):Pg(o,t,n,r);case nt.QUOTE_DOUBLE:return ah(o.value,t);case nt.QUOTE_SINGLE:return k1(o.value,t);case nt.PLAIN:return Jue(o,t,n,r);default:return null}};let f=d(c);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,y=i&&p||m;if(f=d(y),f===null)throw new Error(`Unsupported default string type ${y}`)}return f}function rB(e,t){const n=Object.assign({blockQuote:!0,commentString:Zue,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 r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function ede(e,t){if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,r;if(Jt(t)){r=t.value;let i=e.filter(a=>a.identify?.(r));if(i.length>1){const a=i.filter(o=>o.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else r=t,n=e.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function tde(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Jt(e)||An(e))&&e.anchor;a&&Z$(a)&&(n.add(a),i.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function Qu(e,t,n,r){if(_n(e))return e.toString(t,n,r);if(pc(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 i;const a=On(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=ede(t.doc.schema.tags,a));const o=tde(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const c=typeof i.stringify=="function"?i.stringify(a,t,n,r):Jt(a)?Gk(a,t,n,r):a.toString(t,n,r);return o?Jt(a)||c[0]==="{"||c[0]==="["?`${o} ${c}`:`${o}
|
|
149
|
+
${t.indent}${c}`:c}function nde({key:e,value:t},n,r,i){const{allNullValues:a,doc:o,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=On(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(An(e)||!On(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||An(e)||(Jt(e)?e.type===nt.BLOCK_FOLDED||e.type===nt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:c+d});let S=!1,b=!1,j=Qu(e,n,()=>S=!0,()=>b=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return S&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!S?j+=El(j,n.indent,f(y)):b&&i&&i(),j;S&&(y=null),v?(y&&(j+=El(j,n.indent,f(y))),j=`? ${j}
|
|
150
|
+
${c}:`):(j=`${j}:`,y&&(j+=El(j,n.indent,f(y))));let k,E,C;On(t)?(k=!!t.spaceBefore,E=t.commentBefore,C=t.comment):(k=!1,E=null,C=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!v&&!y&&Jt(t)&&(n.indentAtStart=j.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&Gh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let O=!1;const z=Qu(t,n,()=>O=!0,()=>b=!0);let A=" ";if(y||k||E){if(A=k?`
|
|
151
|
+
`:"",E){const _=f(E);A+=`
|
|
152
|
+
${js(_,n.indent)}`}z===""&&!n.inFlow?A===`
|
|
153
|
+
`&&C&&(A=`
|
|
154
|
+
|
|
155
|
+
`):A+=`
|
|
156
|
+
${n.indent}`}else if(!v&&An(t)){const _=z[0],R=z.indexOf(`
|
|
157
|
+
`),$=R!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let q=!1;if($&&(_==="&"||_==="!")){let B=z.indexOf(" ");_==="&"&&B!==-1&&B<R&&z[B+1]==="!"&&(B=z.indexOf(" ",B+1)),(B===-1||R<B)&&(q=!0)}q||(A=`
|
|
158
|
+
${n.indent}`)}}else(z===""||z[0]===`
|
|
159
|
+
`)&&(A="");return j+=A+z,n.inFlow?O&&r&&r():C&&!O?j+=El(j,n.indent,f(C)):b&&i&&i(),j}function rde(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Vm="<<",Cs={identify:e=>e===Vm||typeof e=="symbol"&&e.description===Vm,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new nt(Symbol(Vm)),{addToJSMap:iB}),stringify:()=>Vm},ide=(e,t)=>(Cs.identify(t)||Jt(t)&&(!t.type||t.type===nt.PLAIN)&&Cs.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Cs.tag&&n.default);function iB(e,t,n){if(n=e&&pc(n)?n.resolve(e.doc):n,Gh(n))for(const r of n.items)Ww(e,t,r);else if(Array.isArray(n))for(const r of n)Ww(e,t,r);else Ww(e,t,n)}function Ww(e,t,n){const r=e&&pc(n)?n.resolve(e.doc):n;if(!Kh(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,o]of i)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function aB(e,t,{key:n,value:r}){if(On(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(ide(e,n))iB(e,t,r);else{const i=Yi(n,"",e);if(t instanceof Map)t.set(i,Yi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=ade(n,i,e),o=Yi(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function ade(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(On(e)&&n?.doc){const r=rB(n.doc,{});r.anchors=new Set;for(const a of n.anchors.keys())r.anchors.add(a.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=e.toString(r);if(!n.mapKeyWarned){let a=JSON.stringify(i);a.length>40&&(a=a.substring(0,36)+'..."'),rde(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(t)}function Vk(e,t,n){const r=bh(e,void 0,n),i=bh(t,void 0,n);return new qr(r,i)}class qr{constructor(t,n=null){Object.defineProperty(this,Wi,{value:Y$}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return On(n)&&(n=n.clone(t)),On(r)&&(r=r.clone(t)),new qr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return aB(n,r,this)}toString(t,n,r){return t?.doc?nde(this,t,n,r):JSON.stringify(this)}}function sB(e,t,n){return(t.inFlow??e.flow?ode:sde)(e,t,n)}function sde({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:c}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let S=0;S<t.length;++S){const b=t[S];let j=null;if(On(b))!m&&b.spaceBefore&&y.push(""),py(n,y,b.commentBefore,m),b.comment&&(j=b.comment);else if(_n(b)){const E=On(b.key)?b.key:null;E&&(!m&&E.spaceBefore&&y.push(""),py(n,y,E.commentBefore,m))}m=!1;let k=Qu(b,p,()=>j=null,()=>m=!0);j&&(k+=El(k,a,f(j))),m&&j&&(m=!1),y.push(r+k)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let S=1;S<y.length;++S){const b=y[S];v+=b?`
|
|
160
|
+
${d}${b}`:`
|
|
161
|
+
`}}return e?(v+=`
|
|
162
|
+
`+js(f(e),d),c&&c()):m&&o&&o(),v}function ode({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:c}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let S=0;S<e.length;++S){const b=e[S];let j=null;if(On(b))b.spaceBefore&&m.push(""),py(t,m,b.commentBefore,!1),b.comment&&(j=b.comment);else if(_n(b)){const E=On(b.key)?b.key:null;E&&(E.spaceBefore&&m.push(""),py(t,m,E.commentBefore,!1),E.comment&&(f=!0));const C=On(b.value)?b.value:null;C?(C.comment&&(j=C.comment),C.commentBefore&&(f=!0)):b.value==null&&E?.comment&&(j=E.comment)}j&&(f=!0);let k=Qu(b,d,()=>j=null);S<e.length-1&&(k+=","),j&&(k+=El(k,r,c(j))),!f&&(m.length>p||k.includes(`
|
|
163
|
+
`))&&(f=!0),m.push(k),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const S=m.reduce((b,j)=>b+j.length+2,2);f=t.options.lineWidth>0&&S>t.options.lineWidth}if(f){let S=y;for(const b of m)S+=b?`
|
|
164
|
+
${a}${i}${b}`:`
|
|
165
|
+
`;return`${S}
|
|
166
|
+
${i}${v}`}else return`${y}${o}${m.join(" ")}${o}${v}`}function py({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=js(t(r),e);n.push(a.trimStart())}}function _l(e,t){const n=Jt(t)?t.value:t;for(const r of e)if(_n(r)&&(r.key===t||r.key===n||Jt(r.key)&&r.key.value===n))return r}class Gi extends tB{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(To,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,o=new this(t),c=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&o.items.push(Vk(d,f,r))};if(n instanceof Map)for(const[d,f]of n)c(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))c(d,n[d]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){let r;_n(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new qr(t,t?.value):r=new qr(t.key,t.value);const i=_l(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);Jt(i.value)&&eB(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const o=this.items.findIndex(c=>a(r,c)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(t){const n=_l(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=_l(this.items,t)?.value;return(!n&&Jt(i)?i.value:i)??void 0}has(t){return!!_l(this.items,t)}set(t,n){this.add(new qr(t,n),!0)}toJSON(t,n,r){const i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(const a of this.items)aB(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!_n(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),sB(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const yd={collection:"map",default:!0,nodeClass:Gi,tag:"tag:yaml.org,2002:map",resolve(e,t){return Kh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Gi.from(e,t,n)};class Wl extends tB{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(md,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Qm(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Qm(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Jt(i)?i.value:i}has(t){const n=Qm(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Qm(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Jt(i)&&eB(n)?i.value=n:this.items[r]=n}toJSON(t,n){const r=[];n?.onCreate&&n.onCreate(r);let i=0;for(const a of this.items)r.push(Yi(a,String(i++),n));return r}toString(t,n,r){return t?sB(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let c of n){if(typeof i=="function"){const d=n instanceof Set?c:String(o++);c=i.call(n,d,c)}a.items.push(bh(c,void 0,r))}}return a}}function Qm(e){let t=Jt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const vd={collection:"seq",default:!0,nodeClass:Wl,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Gh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>Wl.from(e,t,n)},Wv={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Gk(e,t,n,r)}},Zv={identify:e=>e==null,createNode:()=>new nt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new nt(null),stringify:({source:e},t)=>typeof e=="string"&&Zv.test.test(e)?e:t.options.nullStr},Qk={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new nt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Qk.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function Sa({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let a=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(a)){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let c=t-(a.length-o-1);for(;c-- >0;)a+="0"}return a}const oB={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:Sa},lB={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():Sa(e)}},cB={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 nt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Sa},Xv=e=>typeof e=="bigint"||Number.isInteger(e),Yk=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function uB(e,t,n){const{value:r}=e;return Xv(r)&&r>=0?n+r.toString(t):Sa(e)}const dB={identify:e=>Xv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Yk(e,2,8,n),stringify:e=>uB(e,8,"0o")},fB={identify:Xv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Yk(e,0,10,n),stringify:Sa},hB={identify:e=>Xv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Yk(e,2,16,n),stringify:e=>uB(e,16,"0x")},lde=[yd,vd,Wv,Zv,Qk,dB,fB,hB,oB,lB,cB];function NP(e){return typeof e=="bigint"||Number.isInteger(e)}const Ym=({value:e})=>JSON.stringify(e),cde=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Ym},{identify:e=>e==null,createNode:()=>new nt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ym},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Ym},{identify:NP,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})=>NP(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:Ym}],ude={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},dde=[yd,vd].concat(cde,ude),Wk={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,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}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},r,i,a){if(!n)return"";const o=n;let c;if(typeof btoa=="function"){let d="";for(let f=0;f<o.length;++f)d+=String.fromCharCode(o[f]);c=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=nt.BLOCK_LITERAL),t!==nt.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/d),p=new Array(f);for(let m=0,y=0;m<f;++m,y+=d)p[m]=c.substr(y,d);c=p.join(t===nt.BLOCK_LITERAL?`
|
|
167
|
+
`:" ")}return Gk({comment:e,type:t,value:c},r,i,a)}};function pB(e,t){if(Gh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!_n(r)){if(Kh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new qr(new nt(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
168
|
+
${i.key.commentBefore}`:r.commentBefore),r.comment){const a=i.value??i.key;a.comment=a.comment?`${r.comment}
|
|
169
|
+
${a.comment}`:r.comment}r=i}e.items[n]=_n(r)?r:new qr(r)}}else t("Expected a sequence for this tag");return e}function mB(e,t,n){const{replacer:r}=n,i=new Wl(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof r=="function"&&(o=r.call(t,String(a++),o));let c,d;if(Array.isArray(o))if(o.length===2)c=o[0],d=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const f=Object.keys(o);if(f.length===1)c=f[0],d=o[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=o;i.items.push(Vk(c,d,n))}return i}const Zk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:pB,createNode:mB};class Du extends Wl{constructor(){super(),this.add=Gi.prototype.add.bind(this),this.delete=Gi.prototype.delete.bind(this),this.get=Gi.prototype.get.bind(this),this.has=Gi.prototype.has.bind(this),this.set=Gi.prototype.set.bind(this),this.tag=Du.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n?.onCreate&&n.onCreate(r);for(const i of this.items){let a,o;if(_n(i)?(a=Yi(i.key,"",n),o=Yi(i.value,a,n)):a=Yi(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,o)}return r}static from(t,n,r){const i=mB(t,n,r),a=new this;return a.items=i.items,a}}Du.tag="tag:yaml.org,2002:omap";const Xk={collection:"seq",identify:e=>e instanceof Map,nodeClass:Du,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=pB(e,t),r=[];for(const{key:i}of n.items)Jt(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Du,n)},createNode:(e,t,n)=>Du.from(e,t,n)};function gB({value:e,source:t},n){return t&&(e?yB:vB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const yB={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 nt(!0),stringify:gB},vB={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 nt(!1),stringify:gB},fde={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:Sa},hde={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():Sa(e)}},pde={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 nt(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:Sa},Vh=e=>typeof e=="bigint"||Number.isInteger(e);function Jv(e,t,n,{intAsBigInt:r}){const i=e[0];if((i==="-"||i==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return i==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return i==="-"?-1*a:a}function Jk(e,t,n){const{value:r}=e;if(Vh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Sa(e)}const mde={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Jv(e,2,2,n),stringify:e=>Jk(e,2,"0b")},gde={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Jv(e,1,8,n),stringify:e=>Jk(e,8,"0")},yde={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Jv(e,0,10,n),stringify:Sa},vde={identify:Vh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Jv(e,2,16,n),stringify:e=>Jk(e,16,"0x")};class Mu extends Gi{constructor(t){super(t),this.tag=Mu.tag}add(t){let n;_n(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new qr(t.key,null):n=new qr(t,null),_l(this.items,n.key)||this.items.push(n)}get(t,n){const r=_l(this.items,t);return!n&&_n(r)?Jt(r.key)?r.key.value:r.key:r}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 r=_l(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new qr(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:i}=r,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof i=="function"&&(o=i.call(n,o,o)),a.items.push(Vk(o,null,r));return a}}Mu.tag="tag:yaml.org,2002:set";const eC={collection:"map",identify:e=>e instanceof Set,nodeClass:Mu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Mu.from(e,t,n),resolve(e,t){if(Kh(e)){if(e.hasAllNullValues(!0))return Object.assign(new Mu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function tC(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=o=>t?BigInt(o):Number(o),a=r.replace(/_/g,"").split(":").reduce((o,c)=>o*i(60)+i(c),i(0));return n==="-"?i(-1)*a:a}function xB(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return Sa(e);let r="";t<0&&(r="-",t*=n(-1));const i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const bB={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})=>tC(e,n),stringify:xB},wB={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=>tC(e,!1),stringify:xB},e0={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(e0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,o,c]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,o||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let m=tC(p,!1);Math.abs(m)<30&&(m*=60),f-=6e4*m}return new Date(f)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},kP=[yd,vd,Wv,Zv,yB,vB,mde,gde,yde,vde,fde,hde,pde,Wk,Cs,Xk,Zk,eC,bB,wB,e0],CP=new Map([["core",lde],["failsafe",[yd,vd,Wv]],["json",dde],["yaml11",kP],["yaml-1.1",kP]]),AP={binary:Wk,bool:Qk,float:cB,floatExp:lB,floatNaN:oB,floatTime:wB,int:fB,intHex:hB,intOct:dB,intTime:bB,map:yd,merge:Cs,null:Zv,omap:Xk,pairs:Zk,seq:vd,set:eC,timestamp:e0},xde={"tag:yaml.org,2002:binary":Wk,"tag:yaml.org,2002:merge":Cs,"tag:yaml.org,2002:omap":Xk,"tag:yaml.org,2002:pairs":Zk,"tag:yaml.org,2002:set":eC,"tag:yaml.org,2002:timestamp":e0};function Zw(e,t,n){const r=CP.get(t);if(r&&!e)return n&&!r.includes(Cs)?r.concat(Cs):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(CP.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)i=i.concat(a);else typeof e=="function"&&(i=e(i.slice()));return n&&(i=i.concat(Cs)),i.reduce((a,o)=>{const c=typeof o=="string"?AP[o]:o;if(!c){const d=JSON.stringify(o),f=Object.keys(AP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(c)||a.push(c),a},[])}const bde=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class nC{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:o,toStringDefaults:c}){this.compat=Array.isArray(t)?Zw(t,"compat"):t?Zw(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?xde:{},this.tags=Zw(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,To,{value:yd}),Object.defineProperty(this,Ha,{value:Wv}),Object.defineProperty(this,md,{value:vd}),this.sortMapEntries=typeof o=="function"?o:o===!0?bde:null}clone(){const t=Object.create(nC.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function wde(e,t){const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const d=e.directives.toString(e);d?(n.push(d),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const i=rB(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(js(d,""))}let o=!1,c=null;if(e.contents){if(On(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(js(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>o=!0;let f=Qu(e.contents,i,()=>c=null,d);c&&(f+=El(f,"",a(c))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(Qu(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
+
`)?(n.push("..."),n.push(js(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&o&&(d=d.replace(/^\n+/,"")),d&&((!o||c)&&n[n.length-1]!==""&&n.push(""),n.push(js(a(d),"")))}return n.join(`
|
|
171
|
+
`)+`
|
|
172
|
+
`}class t0{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wi,{value:j1});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=a;let{version:o}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Lr({version:o}),this.setSchema(o,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(t0.prototype,{[Wi]:{value:j1}});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=On(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){ou(this.contents)&&this.contents.add(t)}addIn(t,n){ou(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=X$(this);t.anchor=!n||r.has(n)?J$(n||"a",r):n}return new Kk(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const j=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=Que(this,o||"a"),S={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=bh(t,p,S);return c&&An(b)&&(b.flow=!0),y(),b}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new qr(i,a)}delete(t){return ou(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Qf(t)?this.contents==null?!1:(this.contents=null,!0):ou(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return An(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Qf(t)?!n&&Jt(this.contents)?this.contents.value:this.contents:An(this.contents)?this.contents.getIn(t,n):void 0}has(t){return An(this.contents)?this.contents.has(t):!1}hasIn(t){return Qf(t)?this.contents!==void 0:An(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=hy(this.schema,[t],n):ou(this.contents)&&this.contents.set(t,n)}setIn(t,n){Qf(t)?this.contents=n:this.contents==null?this.contents=hy(this.schema,Array.from(t),n):ou(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Lr({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Lr({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new nC(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:a,reviver:o}={}){const c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Yi(this.contents,n??"",c);if(typeof a=="function")for(const{count:f,res:p}of c.anchors.values())a(p,f);return typeof o=="function"?Nu(o,{"":d},"",d):d}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 wde(this,t)}}function ou(e){if(An(e))return!0;throw new Error("Expected a YAML collection as document contents")}class SB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class Wm extends SB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Sde extends SB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const OP=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const c=Math.min(a-39,o.length-79);o="…"+o.substring(c),a-=c-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,a))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
173
|
+
`),o=c+o}if(/[^ ]/.test(o)){let c=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(c=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(c);n.message+=`:
|
|
174
|
+
|
|
175
|
+
${o}
|
|
176
|
+
${f}
|
|
177
|
+
`}};function Yu(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:c}){let d=!1,f=c,p=c,m="",y="",v=!1,S=!1,b=null,j=null,k=null,E=null,C=null,O=null,z=null;for(const R of e)switch(S&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&a(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S=!1),b&&(f&&R.type!=="comment"&&R.type!=="newline"&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),R.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&R.source.includes(" ")&&(b=R),p=!0;break;case"comment":{p||a(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=R.source.substring(1)||" ";m?m+=y+$:m=$,y="",f=!1;break}case"newline":f?m?m+=R.source:(!O||n!=="seq-item-ind")&&(d=!0):y+=R.source,f=!0,v=!0,(j||k)&&(E=R),p=!0;break;case"anchor":j&&a(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&a(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=R,z??(z=R.offset),f=!1,p=!1,S=!0;break;case"tag":{k&&a(R,"MULTIPLE_TAGS","A node can have at most one tag"),k=R,z??(z=R.offset),f=!1,p=!1,S=!0;break}case n:(j||k)&&a(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),O&&a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),O=R,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){C&&a(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),C=R,f=!1,p=!1;break}default:a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),f=!1,p=!1}const A=e[e.length-1],_=A?A.offset+A.source.length:i;return S&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&a(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b&&(f&&b.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:O,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:E,end:_,start:z??_}}function wh(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
178
|
+
`))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(wh(t.key)||wh(t.value))return!0}return!1;default:return!0}}function A1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&wh(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function jB(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,o)=>a===o||Jt(a)&&Jt(o)&&a.value===o.value;return t.some(a=>i(a.key,n))}const EP="All mapping items must start at the same column";function jde({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Gi,c=new o(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:y,sep:v,value:S}=p,b=Yu(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!b.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",EP)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(c.comment?c.comment+=`
|
|
179
|
+
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||wh(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==r.indent&&i(d,"BAD_INDENT",EP);n.atKey=!0;const k=b.end,E=y?e(n,y,b,i):t(n,k,m,null,b,i);n.schema.compat&&A1(r.indent,y,i),n.atKey=!1,jB(n,c.items,E)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const C=Yu(v??[],{indicator:"map-value-ind",next:S,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=C.end,C.found){j&&(S?.type==="block-map"&&!C.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<C.found.offset-1024&&i(E.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const O=S?e(n,S,C,i):t(n,d,v,null,C,i);n.schema.compat&&A1(r.indent,S,i),d=O.range[2];const z=new qr(E,O);n.options.keepSourceTokens&&(z.srcToken=p),c.items.push(z)}else{j&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),C.comment&&(E.comment?E.comment+=`
|
|
180
|
+
`+C.comment:E.comment=C.comment);const O=new qr(E);n.options.keepSourceTokens&&(O.srcToken=p),c.items.push(O)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,d,f??d],c}function Nde({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=a?.nodeClass??Wl,c=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=r.offset,f=null;for(const{start:p,value:m}of r.items){const y=Yu(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=y.end,y.comment&&(c.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&A1(r.indent,m,i),d=v.range[2],c.items.push(v)}return c.range=[r.offset,d,f??d],c}function Qh(e,t,n,r){let i="";if(e){let a=!1,o="";for(const c of e){const{source:d,type:f}=c;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=o+p:i=p,o="";break}case"newline":i&&(o+=d),a=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const Xw="Block collections are not allowed within flow collections",Jw=e=>e&&(e.type==="block-map"||e.type==="block-seq");function kde({composeNode:e,composeEmptyNode:t},n,r,i,a){const o=r.start.source==="{",c=o?"flow map":"flow sequence",d=a?.nodeClass??(o?Gi:Wl),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let j=0;j<r.items.length;++j){const k=r.items[j],{start:E,key:C,sep:O,value:z}=k,A=Yu(E,{flow:c,indicator:"explicit-key-ind",next:C??O?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!A.found){if(!A.anchor&&!A.tag&&!O&&!z){j===0&&A.comma?i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):j<r.items.length-1&&i(A.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),A.comment&&(f.comment?f.comment+=`
|
|
181
|
+
`+A.comment:f.comment=A.comment),m=A.end;continue}!o&&n.options.strict&&wh(C)&&i(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)A.comma&&i(A.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(A.comma||i(A.start,"MISSING_CHAR",`Missing , between ${c} items`),A.comment){let _="";e:for(const R of E)switch(R.type){case"comma":case"space":break;case"comment":_=R.source.substring(1);break e;default:break e}if(_){let R=f.items[f.items.length-1];_n(R)&&(R=R.value??R.key),R.comment?R.comment+=`
|
|
182
|
+
`+_:R.comment=_,A.comment=A.comment.substring(_.length+1)}}if(!o&&!O&&!A.found){const _=z?e(n,z,A,i):t(n,A.end,O,null,A,i);f.items.push(_),m=_.range[2],Jw(z)&&i(_.range,"BLOCK_IN_FLOW",Xw)}else{n.atKey=!0;const _=A.end,R=C?e(n,C,A,i):t(n,_,E,null,A,i);Jw(C)&&i(R.range,"BLOCK_IN_FLOW",Xw),n.atKey=!1;const $=Yu(O??[],{flow:c,indicator:"map-value-ind",next:z,offset:R.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!o&&!A.found&&n.options.strict){if(O)for(const B of O){if(B===$.found)break;if(B.type==="newline"){i(B,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}A.start<$.found.offset-1024&&i($.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else z&&("source"in z&&z.source?.[0]===":"?i(z,"MISSING_CHAR",`Missing space after : in ${c}`):i($.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const F=z?e(n,z,$,i):$.found?t(n,$.end,O,null,$,i):null;F?Jw(z)&&i(F.range,"BLOCK_IN_FLOW",Xw):$.comment&&(R.comment?R.comment+=`
|
|
183
|
+
`+$.comment:R.comment=$.comment);const q=new qr(R,F);if(n.options.keepSourceTokens&&(q.srcToken=k),o){const B=f;jB(n,B.items,R)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(q)}else{const B=new Gi(n.schema);B.flow=!0,B.items.push(q);const V=(F??R).range;B.range=[R.range[0],V[1],V[2]],f.items.push(B)}m=F?F.range[2]:$.end}}const y=o?"}":"]",[v,...S]=r.end;let b=m;if(v?.source===y)b=v.offset+v.source.length;else{const j=c[0].toUpperCase()+c.substring(1),k=p?`${j} must end with a ${y}`:`${j} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&S.unshift(v)}if(S.length>0){const j=Qh(S,b,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
|
|
184
|
+
`+j.comment:f.comment=j.comment),f.range=[r.offset,b,j.offset]}else f.range=[r.offset,b,b];return f}function eS(e,t,n,r,i,a){const o=n.type==="block-map"?jde(e,t,n,r,a):n.type==="block-seq"?Nde(e,t,n,r,a):kde(e,t,n,r,a),c=o.constructor;return i==="!"||i===c.tagName?(o.tag=c.tagName,o):(i&&(o.tag=i),o)}function Cde(e,t,n,r,i){const a=r.tag,o=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,S=y&&a?y.offset>a.offset?y:a:y??a;S&&(!v||v.offset<S.offset)&&i(S,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Gi.tagName&&c==="map"||o===Wl.tagName&&c==="seq")return eS(e,t,n,i,o);let d=t.schema.tags.find(y=>y.tag===o&&y.collection===c);if(!d){const y=t.schema.knownTags[o];if(y?.collection===c)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),eS(e,t,n,i,o)}const f=eS(e,t,n,i,o,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=On(p)?p:new nt(p);return m.range=f.range,m.tag=o,d?.format&&(m.format=d.format),m}function Ade(e,t,n){const r=t.offset,i=Ode(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?nt.BLOCK_FOLDED:nt.BLOCK_LITERAL,o=t.source?Ede(t.source):[];let c=o.length;for(let b=o.length-1;b>=0;--b){const j=o[b][1];if(j===""||j==="\r")c=b;else break}if(c===0){const b=i.chomp==="+"&&o.length>0?`
|
|
185
|
+
`.repeat(Math.max(1,o.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:b,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let b=0;b<c;++b){const[j,k]=o[b];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=b,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let b=o.length-1;b>=c;--b)o[b][0].length>d&&(c=b+1);let m="",y="",v=!1;for(let b=0;b<p;++b)m+=o[b][0].slice(d)+`
|
|
186
|
+
`;for(let b=p;b<c;++b){let[j,k]=o[b];f+=j.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&j.length<d){const O=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(f-k.length-(E?2:1),"BAD_INDENT",O),j=""}a===nt.BLOCK_LITERAL?(m+=y+j.slice(d)+k,y=`
|
|
187
|
+
`):j.length>d||k[0]===" "?(y===" "?y=`
|
|
188
|
+
`:!v&&y===`
|
|
189
|
+
`&&(y=`
|
|
190
|
+
|
|
191
|
+
`),m+=y+j.slice(d)+k,y=`
|
|
192
|
+
`,v=!0):k===""?y===`
|
|
193
|
+
`?m+=`
|
|
194
|
+
`:y=`
|
|
195
|
+
`:(m+=y+k,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let b=c;b<o.length;++b)m+=`
|
|
196
|
+
`+o[b][0].slice(d);m[m.length-1]!==`
|
|
197
|
+
`&&(m+=`
|
|
198
|
+
`);break;default:m+=`
|
|
199
|
+
`}const S=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,S,S]}}function Ode({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=t[0],a=i[0];let o=0,c="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!c&&(v==="-"||v==="+"))c=v;else{const S=Number(v);!o&&S?o=S:d===-1&&(d=e+y)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const S=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",S);const b=v.source;b&&typeof b=="string"&&(m+=b.length)}}}return{mode:a,indent:o,chomp:c,comment:p,length:m}}function Ede(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),a=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function _de(e,t,n){const{offset:r,type:i,source:a,end:o}=e;let c,d;const f=(y,v,S)=>n(r+y,v,S);switch(i){case"scalar":c=nt.PLAIN,d=zde(a,f);break;case"single-quoted-scalar":c=nt.QUOTE_SINGLE,d=Tde(a,f);break;case"double-quoted-scalar":c=nt.QUOTE_DOUBLE,d=Pde(a,f);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+a.length,r+a.length]}}const p=r+a.length,m=Qh(o,p,t,n);return{value:d,type:c,comment:m.comment,range:[r,p,m.offset]}}function zde(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}`),NB(e)}function Tde(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),NB(e.slice(1,-1)).replace(/''/g,"'")}function NB(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
200
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
201
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===""?a===`
|
|
202
|
+
`?i+=a:a=`
|
|
203
|
+
`:(i+=a+r[1],a=" "),o=n.lastIndex;const c=/[ \t]*(.*)/sy;return c.lastIndex=o,r=c.exec(e),i+a+(r?.[1]??"")}function Pde(e,t){let n="";for(let r=1;r<e.length-1;++r){const i=e[r];if(!(i==="\r"&&e[r+1]===`
|
|
204
|
+
`))if(i===`
|
|
205
|
+
`){const{fold:a,offset:o}=Rde(e,r);n+=a,r=o}else if(i==="\\"){let a=e[++r];const o=Dde[a];if(o)n+=o;else if(a===`
|
|
206
|
+
`)for(a=e[r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="\r"&&e[r+1]===`
|
|
207
|
+
`)for(a=e[++r+1];a===" "||a===" ";)a=e[++r+1];else if(a==="x"||a==="u"||a==="U"){const c={x:2,u:4,U:8}[a];n+=Mde(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const a=r;let o=e[r+1];for(;o===" "||o===" ";)o=e[++r+1];o!==`
|
|
208
|
+
`&&!(o==="\r"&&e[r+2]===`
|
|
209
|
+
`)&&(n+=r>a?e.slice(a,r+1):i)}else n+=i}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function Rde(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
210
|
+
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
211
|
+
`);)r===`
|
|
212
|
+
`&&(n+=`
|
|
213
|
+
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const Dde={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Mde(e,t,n,r){const i=e.substr(t,n),o=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(o)}function kB(e,t,n,r){const{value:i,type:a,comment:o,range:c}=t.type==="block-scalar"?Ade(e,t,r):_de(t,e.options.strict,r),d=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let f;e.options.stringKeys&&e.atKey?f=e.schema[Ha]:d?f=Ide(e.schema,i,d,n,r):t.type==="scalar"?f=Lde(e,i,t,r):f=e.schema[Ha];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=Jt(m)?m:new nt(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new nt(i)}return p.range=c,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),o&&(p.comment=o),p}function Ide(e,t,n,r,i){if(n==="!")return e[Ha];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if(c.test?.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Ha])}function Lde({atKey:e,directives:t,schema:n},r,i,a){const o=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[Ha];if(n.compat){const c=n.compat.find(d=>d.default&&d.test?.test(r))??n[Ha];if(o.tag!==c.tag){const d=t.tagString(o.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return o}function $de(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let i=t[r];switch(i.type){case"space":case"comment":case"newline":e-=i.source.length;continue}for(i=t[++r];i?.type==="space";)e+=i.source.length,i=t[++r];break}}return e}const Bde={composeNode:CB,composeEmptyNode:rC};function CB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:o,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=Ude(e,t,r),(c||d)&&r(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":f=kB(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=Cde(Bde,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=rC(e,t.offset,void 0,null,n,r),p=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!Jt(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&r(d??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(f.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?f.comment=o:f.commentBefore=o),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function rC(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:c,end:d},f){const p={type:"scalar",offset:$de(t,n,r),indent:-1,source:""},m=kB(e,p,c,f);return o&&(m.anchor=o.source.substring(1),m.anchor===""&&f(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function Ude({options:e},{offset:t,source:n,end:r},i){const a=new Kk(n.substring(1));a.source===""&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,c=Qh(r,o,e.strict,i);return a.range=[t,o,c.offset],c.comment&&(a.comment=c.comment),a}function qde(e,t,{offset:n,start:r,value:i,end:a},o){const c=Object.assign({_directives:t},e),d=new t0(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=Yu(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?CB(f,i,p,o):rC(f,p.end,r,null,p,o);const m=d.contents.range[2],y=Qh(a,m,!1,o);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function Pf(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 _P(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":r?`
|
|
215
|
+
|
|
216
|
+
`:`
|
|
217
|
+
`)+(a.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class Fde{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const o=Pf(n);a?this.warnings.push(new Sde(o,r,i)):this.errors.push(new Wm(o,r,i))},this.directives=new Lr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=_P(this.prelude);if(r){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
218
|
+
${r}`:r;else if(i||t.directives.docStart||!a)t.commentBefore=r;else if(An(a)&&!a.flow&&a.items.length>0){let o=a.items[0];_n(o)&&(o=o.key);const c=o.commentBefore;o.commentBefore=c?`${r}
|
|
219
|
+
${c}`:r}else{const o=a.commentBefore;a.commentBefore=o?`${r}
|
|
220
|
+
${o}`:r}}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:_P(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const i of t)yield*this.next(i);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,i)=>{const a=Pf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=qde(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,r=new Wm(Pf(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Wm(Pf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Qh(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
221
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Wm(Pf(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 r=Object.assign({_directives:this.directives},this.options),i=new t0(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}}const AB="\uFEFF",OB="",EB="",O1="";function Hde(e){switch(e){case AB:return"byte-order-mark";case OB:return"doc-mode";case EB:return"flow-error-end";case O1:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
222
|
+
`:case`\r
|
|
223
|
+
`: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 ua(e){switch(e){case void 0:case" ":case`
|
|
224
|
+
`:case"\r":case" ":return!0;default:return!1}}const zP=new Set("0123456789ABCDEFabcdef"),Kde=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Zm=new Set(",[]{}"),Gde=new Set(` ,[]{}
|
|
225
|
+
\r `),tS=e=>!e||Gde.has(e);class Vde{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 r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
226
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
227
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const i=this.buffer[r+t+1];if(i===`
|
|
228
|
+
`||!i&&!this.atEnd)return t+r+1}return n===`
|
|
229
|
+
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ua(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(`
|
|
230
|
+
`,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]===AB&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const a=t[r-1];if(a===" "||a===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-i),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 OB,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==="...")&&ua(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&&!ua(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===":")&&ua(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,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(tS),"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,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&ua(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield EB,yield*this.parseLineStart();let a=0;for(;i[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),i[a]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-a),"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(tS),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||ua(o)||o===",")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 a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let i=r.indexOf(`
|
|
231
|
+
`,this.pos);if(i!==-1){for(;i!==-1;){const a=this.continueScalar(i+1);if(a===-1)break;i=r.indexOf(`
|
|
232
|
+
`,a)}i!==-1&&(n=i-(r[i-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=>ua(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let a=this.pos;r=this.buffer[a];++a)switch(r){case" ":n+=1;break;case`
|
|
233
|
+
`:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
234
|
+
`)break}default:break e}if(!r&&!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 a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
|
|
235
|
+
`,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let i=t+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
236
|
+
`;)r=this.buffer[++i];t=i-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const c=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
237
|
+
`&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield O1,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const a=this.buffer[r+1];if(ua(a)||t&&Zm.has(a))break;n=r}else if(ua(i)){let a=this.buffer[r+1];if(i==="\r"&&(a===`
|
|
238
|
+
`?(r+=1,i=`
|
|
239
|
+
`,a=this.buffer[r+1]):n=r),a==="#"||t&&Zm.has(a))break;if(i===`
|
|
240
|
+
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(t&&Zm.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield O1,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 r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.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(tS))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ua(n)||t&&Zm.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(;!ua(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(Kde.has(n))n=this.buffer[++t];else if(n==="%"&&zP.has(this.buffer[t+1])&&zP.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===`
|
|
241
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
242
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class Qde{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const a=n+r>>1;this.lineStarts[a]<t?n=a+1:r=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const i=this.lineStarts[n-1];return{line:n,col:t-i+1}}}}function vo(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function TP(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 _B(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 Xm(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 lu(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 PP(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!vo(t.start,"explicit-key-ind")&&!vo(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,_B(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 Yde{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 Vde,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);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=Hde(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 r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,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 r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&PP(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&TP(i.start)===-1&&(n.indent===0||i.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.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":{TP(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=Xm(this.peek(2)),r=lu(n);let i;t.end?(i=t.end,i.push(this.sourceToken),delete t.end):i=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}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(`
|
|
243
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
244
|
+
`,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 r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.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 i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&n.sep&&!n.value){const o=[];for(let c=0;c<n.sep.length;++c){const d=n.sep[c];switch(d.type){case"newline":o.push(c);break;case"space":break;case"comment":d.indent>t.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),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):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,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(vo(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(_B(n.key)&&!vo(n.sep,"newline")){const o=lu(n.start),c=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:c,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(vo(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const o=lu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):vo(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 o=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(t);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!vo(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 r&&t.items.push({start:a});this.stack.push(o);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 r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.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 i=t.items[t.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,n.start),i.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||vo(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.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 i=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=Xm(r),a=lu(i);PP(t);const o=t.end.splice(1,t.end.length);o.push(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)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
245
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
246
|
+
`,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=Xm(t),r=lu(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Xm(t),r=lu(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.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 Wde(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Qde||null,prettyErrors:t}}function Zde(e,t={}){const{lineCounter:n,prettyErrors:r}=Wde(t),i=new Yde(n?.addNewLine),a=new Fde(t),o=Array.from(a.compose(i.parse(e)));if(r&&n)for(const c of o)c.errors.forEach(OP(e,n)),c.warnings.forEach(OP(e,n));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Xde({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,o]=x.useState([]),[c,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),o([]),d([]);const p=Zde(t),m=[],y=[];for(let v=0;v<p.length;v++){const S=p[v];if(S.errors.length>0){m.push(`Document ${v+1}: ${S.errors[0]?.message}`);continue}const b=S.toJSON();if(!(!b||typeof b!="object"))try{const j=await _V(b);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}o(y),d(m),i(!1),y.length>0&&(gt({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return l.jsxs("section",{className:"mt-8",children:[l.jsx("div",{className:"page-section-divider"}),l.jsx("div",{className:"section-head mt-6",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),l.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",l.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",l.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),l.jsx("textarea",{className:"setup-input w-full font-mono text-xs",rows:10,placeholder:`apiVersion: canonry/v1
|
|
247
|
+
kind: Project
|
|
248
|
+
metadata:
|
|
249
|
+
name: my-project
|
|
250
|
+
spec:
|
|
251
|
+
canonicalDomain: example.com
|
|
252
|
+
country: US
|
|
253
|
+
language: en
|
|
254
|
+
queries: []`,value:t,onChange:p=>n(p.target.value)}),a.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>l.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),c.length>0&&l.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,m)=>l.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),l.jsx("div",{className:"mt-3",children:l.jsx(ge,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function Jde(){const{dashboard:e,isLoading:t,refetch:n}=fc();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-28"}),l.jsx("div",{className:"skeleton-text-sm w-40"})]}),l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[l.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(_=>l.jsx("div",{className:"skeleton-text-sm w-16"},_))}),[1,2,3].map(_=>l.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"skeleton-text-sm w-16"})]}),l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),l.jsx("div",{className:"skeleton-text-sm w-8"})]},_))]})]});const r=e.projects,i=qo(),[a,o]=x.useState(!1),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,S]=x.useState("US"),[b,j]=x.useState("en"),[k,E]=x.useState(!1),[C,O]=x.useState(null),z=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),A=async()=>{if(!(!z||!m)){E(!0),O(null);try{const _=await Nv(z,{displayName:f||c,canonicalDomain:m,country:v,language:b});gt({title:"Project created",detail:`${_.displayName||_.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${_.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),S("US"),j("en"),o(!1),i({to:"/projects/$projectId",params:{projectId:_.id}})}catch(_){O(_ instanceof Error?_.message:"Failed to create project")}finally{E(!1)}}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Projects"}),l.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(ge,{type:"button",onClick:()=>o(_=>!_),children:[l.jsx(Xg,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?l.jsxs(ze,{className:"surface-card mb-6",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),l.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),l.jsxs("div",{className:"compact-stack mt-4",children:[l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),l.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:c,onChange:_=>d(_.target.value)}),z&&z!==c?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",z]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),l.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:_=>p(_.target.value)})]})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),l.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:_=>y(_.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),l.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:_=>S(_.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),l.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:b,onChange:_=>j(_.target.value.toLowerCase())})]})]})]}),C?l.jsx("p",{className:"text-rose-400 text-sm mt-3",children:C}):null,l.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[l.jsx(ge,{type:"button",disabled:!z||!m||k,onClick:A,children:k?"Creating...":"Create project"}),l.jsx(ge,{type:"button",variant:"ghost",onClick:()=>o(!1),children:"Cancel"})]})]}):null,r.length>0?l.jsx("div",{className:"data-table-wrapper",children:l.jsxs("table",{className:"data-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Name"}),l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Visibility"}),l.jsx("th",{children:"Last run"}),l.jsx("th",{className:"text-right",children:"Country"})]})}),l.jsx("tbody",{children:r.map(_=>{const R=_.recentRuns[0];return l.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:_.project.id}}),children:[l.jsxs("td",{children:[l.jsx(jt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:_.project.displayName||_.project.name}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:_.project.name})]}),l.jsx("td",{className:"text-zinc-400",children:_.project.canonicalDomain}),l.jsx("td",{children:l.jsx(ct,{tone:_.visibilitySummary.tone,children:_.visibilitySummary.value})}),l.jsx("td",{className:"text-zinc-500 text-sm",children:R?l.jsx(Rv,{status:R.status}):l.jsx("span",{className:"text-zinc-600",children:"No runs"})}),l.jsx("td",{className:"text-right text-zinc-500",children:_.project.country})]},_.project.id)})})]})}):a?null:l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h3",{children:"No projects yet"}),l.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),l.jsxs(ge,{type:"button",onClick:()=>o(!0),children:[l.jsx(Xg,{className:"size-4 mr-1.5"}),"Add project"]})]}),l.jsx(Xde,{onApplied:()=>{n()}})]})}function E1({state:e,label:t}){return l.jsx(ct,{tone:cne(e),children:t??zv(e)})}function zB({run:e}){const{openRun:t}=fd();return l.jsxs("article",{className:"run-row",children:[l.jsxs("div",{className:"run-row-main",children:[l.jsxs("div",{className:"run-row-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:e.summary}),l.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),l.jsx(Rv,{status:e.status})]}),l.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),l.jsxs("dl",{className:"run-row-meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Started"}),l.jsx("dd",{children:e.startedAt})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Duration"}),l.jsx("dd",{children:e.duration})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Trigger"}),l.jsx("dd",{children:e.triggerLabel})]})]}),l.jsx(ge,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function Rg({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:o=!0,progress:c,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),100)/100:o&&!Number.isNaN(y)?Math.min(y/100,1):.5,S=m*(1-v);return l.jsxs("div",{className:"score-gauge",children:[l.jsxs("div",{className:"gauge-ring-wrapper",children:[l.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[l.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),l.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:S,transform:"rotate(-90 60 60)"})]}),l.jsx("div",{className:"gauge-center",children:l.jsx("span",{className:o?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),l.jsxs("p",{className:"gauge-label",children:[t,a&&l.jsx(mr,{text:a})]}),l.jsx("p",{className:"gauge-delta",children:n}),d&&l.jsx("p",{className:"gauge-provider-coverage",children:d}),l.jsx("p",{className:"gauge-description",children:i})]})}function RP({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return l.jsx("span",{className:"text-[11px] text-zinc-600",children:"No data"});const r={cited:"bg-emerald-400","not-cited":"bg-zinc-600",lost:"bg-rose-400",emerging:"bg-amber-400 ring-1 ring-amber-300/60"},i=new Date(n[0].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),a=new Date(n[n.length-1].createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"});return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),l.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((o,c)=>l.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[o.citationState]??"bg-zinc-700"} ${o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[o.citationState,new Date(o.createdAt).toLocaleDateString(),o.model?`model ${o.model}`:null,o.model&&c>0&&n[c-1]?.model&&n[c-1].model!==o.model?"model changed":null].filter(Boolean).join(" — ")},c))}),l.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function efe(e){const t=new Map;for(const r of e)for(const i of r.runHistory){const a=t.get(i.createdAt);a?a.states.push(i.citationState):t.set(i.createdAt,{states:[i.citationState],runId:i.runId})}return[...t.entries()].sort(([r],[i])=>r.localeCompare(i)).map(([r,{states:i,runId:a}])=>({runId:a,createdAt:r,citationState:i.includes("cited")?"cited":i.includes("emerging")?"emerging":"not-cited"}))}function DP(e,t){return t==="citations"?e.citationState:e.visibilityState==="pending"||e.answerMentioned==null&&e.visibilityState==null?"pending":e.visibilityState==="visible"||e.answerMentioned===!0?"cited":"not-cited"}function MP(e,t){if(t==="mentions")switch(e){case"cited":return"Mentioned";case"not-cited":return"Not Mentioned";case"pending":return"Pending";case"emerging":return"Newly Mentioned";case"lost":return"No Longer Mentioned"}switch(e){case"cited":return"Cited";case"not-cited":return"Not Cited";case"lost":return"Lost";case"emerging":return"Emerging";case"pending":return"Pending"}}function IP(e,t){const n=t==="mentions"?"mentioned":"cited",r=t==="mentions"?"Mentioned":"Cited";if(e.length===0)return"Awaiting first run";if(e.length===1)return"First observation";const i=e[e.length-1].citationState,a=e[e.length-2].citationState;if(a!=="cited"&&i==="cited")return`Newly ${n}`;if(a==="cited"&&i!=="cited")return"Lost since last run";let o=0;for(let c=e.length-1;c>=0&&e[c].citationState===i;c--)o++;return i==="cited"?o<=1?`${r} in latest run`:`${r} for ${o} runs`:o<=1?`Not ${n} in latest run`:`Not ${n} across ${o} runs`}function tfe(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:DP(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:DP(r,t)}))}))}function nfe({evidence:e}){const{openEvidence:t}=fd(),[n,r]=x.useState(new Set),[i,a]=x.useState("citations"),o=x.useMemo(()=>{const m=tfe(e,i),y=new Map;for(const v of m){const S=y.get(v.query)??[];y.set(v.query,[...S,v])}return[...y.entries()].map(([v,S])=>({phrase:v,items:S}))},[e,i]),c=m=>{r(y=>{const v=new Set(y);return v.has(m)?v.delete(m):v.add(m),v})},d=i==="mentions"?"mentioned":"cited",f=i==="mentions"?"Mention History":"Citation History",p=i==="mentions"?"mentioned":"cited";return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),l.jsxs("div",{className:"inline-flex gap-0.5 p-0.5 rounded-md bg-zinc-900/60 border border-zinc-800/40",role:"tablist","aria-label":"Citation tracking view",children:[l.jsx("button",{type:"button",role:"tab","aria-selected":i==="citations",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="citations"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("citations"),children:"Citations"}),l.jsx("button",{type:"button",role:"tab","aria-selected":i==="mentions",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${i==="mentions"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>a("mentions"),children:"Mentions"})]}),l.jsx("span",{className:"text-[11px] text-zinc-500",children:i==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"2rem"}}),l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Status"}),l.jsx("th",{children:f}),l.jsx("th",{children:"Change"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:o.map(({phrase:m,items:y})=>{const v=n.has(m),S=y.map(C=>C.citationState),b=S.includes("cited")?"cited":S.includes("emerging")?"emerging":S.includes("lost")?"lost":S.every(C=>C==="pending")?"pending":"not-cited",j=efe(y),k=y.filter(C=>C.citationState===gh.cited||C.citationState==="emerging").length,E=IP(j,i);return l.jsxs(x.Fragment,{children:[l.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>c(m),"aria-expanded":v,children:[l.jsx("td",{children:l.jsx(Uh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${v?"rotate-90":""}`})}),l.jsx("td",{className:"evidence-query-cell",children:l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-zinc-100",children:m}),l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:y.map(C=>l.jsx(Ql,{provider:C.provider},C.id))})]})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(E1,{state:b,label:MP(b,i)}),l.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${k} of ${y.length} engines ${p}`,children:[k,"/",y.length]})]})}),l.jsx("td",{children:l.jsx(RP,{history:j})}),l.jsx("td",{className:"evidence-change-cell",children:E}),l.jsx("td",{})]}),v&&y.map(C=>l.jsxs("tr",{className:"bg-zinc-900/30",children:[l.jsx("td",{}),l.jsx("td",{className:"evidence-query-cell pl-5",children:l.jsx(Ql,{provider:C.provider})}),l.jsx("td",{children:l.jsx(E1,{state:C.citationState,label:MP(C.citationState,i)})}),l.jsx("td",{children:l.jsx(RP,{history:C.runHistory})}),l.jsx("td",{className:"evidence-change-cell",children:IP(C.runHistory,i)}),l.jsx("td",{children:l.jsx(ge,{variant:"ghost",size:"sm",type:"button",onClick:O=>{O.stopPropagation(),t(C.id)},children:"View"})})]},C.id))]},m)})})]})}),l.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",d==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function rfe({competitors:e}){return e.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):l.jsx("div",{className:"competitor-table-wrap",children:l.jsxs("table",{className:"competitor-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Domain"}),l.jsx("th",{children:"Pressure"}),l.jsx("th",{children:"Citations"}),l.jsx("th",{children:"Queries"})]})}),l.jsx("tbody",{children:e.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),l.jsx("td",{children:l.jsx(ct,{tone:une(t.pressureLabel),children:t.pressureLabel})}),l.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),l.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function LP({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:o,note:c,updatedAt:d,active:f,onClick:p}){return l.jsxs("button",{type:"button",onClick:p,className:`surface-card w-full text-left transition-colors ${f?"border-zinc-200 bg-zinc-900/50":"hover:border-zinc-700 hover:bg-zinc-900/40"}`,children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),l.jsx("h3",{children:t})]}),l.jsx(ct,{tone:r,children:n})]}),l.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),l.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:o})]})]}),l.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:[l.jsx("span",{children:c}),l.jsx("span",{children:d?`Updated ${ha(d)}`:"No recent sync yet"})]})]})}function Jm({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),l.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var ife=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function iC(e){if(typeof e!="string")return!1;var t=ife;return t.includes(e)}var afe=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],sfe=new Set(afe);function TB(e){return typeof e!="string"?!1:sfe.has(e)}function PB(e){return typeof e=="string"&&e.startsWith("data-")}function Zi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(TB(n)||PB(n))&&(t[n]=e[n]);return t}function Yh(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Zi(t)}return typeof e=="object"&&!Array.isArray(e)?Zi(e):null}function Fr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(TB(n)||PB(n)||iC(n))&&(t[n]=e[n]);return t}function ofe(e){return e==null?null:x.isValidElement(e)?Fr(e.props):typeof e=="object"&&!Array.isArray(e)?Fr(e):null}var lfe=["children","width","height","viewBox","className","style","title","desc"];function _1(){return _1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_1.apply(null,arguments)}function cfe(e,t){if(e==null)return{};var n,r,i=ufe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ufe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var aC=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:o,style:c,title:d,desc:f}=e,p=cfe(e,lfe),m=a||{width:r,height:i,x:0,y:0},y=Rt("recharts-surface",o);return x.createElement("svg",_1({},Fr(p),{className:y,width:r,height:i,style:c,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),x.createElement("title",null,d),x.createElement("desc",null,f),n)}),dfe=["children","className"];function z1(){return z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},z1.apply(null,arguments)}function ffe(e,t){if(e==null)return{};var n,r,i=hfe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function hfe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Er=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=ffe(e,dfe),a=Rt("recharts-layer",r);return x.createElement("g",z1({className:a},Fr(i),{ref:t}),n)}),RB=x.createContext(null),pfe=()=>x.useContext(RB);function Zt(e){return function(){return e}}const DB=Math.cos,my=Math.sin,ja=Math.sqrt,gy=Math.PI,n0=2*gy,T1=Math.PI,P1=2*T1,Sl=1e-6,mfe=P1-Sl;function MB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function gfe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return MB;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class yfe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?MB:gfe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,o){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+o}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,c=this._y1,d=r-t,f=i-n,p=o-t,m=c-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>Sl)if(!(Math.abs(m*d-f*p)>Sl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-o,S=i-c,b=d*d+f*f,j=v*v+S*S,k=Math.sqrt(b),E=Math.sqrt(y),C=a*Math.tan((T1-Math.acos((b+y-j)/(2*k*E)))/2),O=C/E,z=C/k;Math.abs(O-1)>Sl&&this._append`L${t+O*p},${n+O*m}`,this._append`A${a},${a},0,0,${+(m*v>p*S)},${this._x1=t+z*d},${this._y1=n+z*f}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let c=r*Math.cos(i),d=r*Math.sin(i),f=t+c,p=n+d,m=1^o,y=o?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>Sl||Math.abs(this._y1-p)>Sl)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%P1+P1),y>mfe?this._append`A${r},${r},0,1,${m},${t-c},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>Sl&&this._append`A${r},${r},0,${+(y>=T1)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function sC(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new yfe(t)}function oC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function IB(e){this._context=e}IB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function r0(e){return new IB(e)}function LB(e){return e[0]}function $B(e){return e[1]}function BB(e,t){var n=Zt(!0),r=null,i=r0,a=null,o=sC(c);e=typeof e=="function"?e:e===void 0?LB:Zt(e),t=typeof t=="function"?t:t===void 0?$B:Zt(t);function c(d){var f,p=(d=oC(d)).length,m,y=!1,v;for(r==null&&(a=i(v=o())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:Zt(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:Zt(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Zt(!!d),c):n},c.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),c):i},c.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),c):r},c}function eg(e,t,n){var r=null,i=Zt(!0),a=null,o=r0,c=null,d=sC(f);e=typeof e=="function"?e:e===void 0?LB:Zt(+e),t=typeof t=="function"?t:Zt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?$B:Zt(+n);function f(m){var y,v,S,b=(m=oC(m)).length,j,k=!1,E,C=new Array(b),O=new Array(b);for(a==null&&(c=o(E=d())),y=0;y<=b;++y){if(!(y<b&&i(j=m[y],y,m))===k)if(k=!k)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),S=y-1;S>=v;--S)c.point(C[S],O[S]);c.lineEnd(),c.areaEnd()}k&&(C[y]=+e(j,y,m),O[y]=+t(j,y,m),c.point(r?+r(j,y,m):C[y],n?+n(j,y,m):O[y]))}if(E)return c=null,E+""||null}function p(){return BB().defined(i).curve(o).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:Zt(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:Zt(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Zt(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:Zt(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:Zt(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Zt(+m),f):n},f.lineX0=f.lineY0=function(){return p().x(e).y(t)},f.lineY1=function(){return p().x(e).y(n)},f.lineX1=function(){return p().x(r).y(t)},f.defined=function(m){return arguments.length?(i=typeof m=="function"?m:Zt(!!m),f):i},f.curve=function(m){return arguments.length?(o=m,a!=null&&(c=o(a)),f):o},f.context=function(m){return arguments.length?(m==null?a=c=null:c=o(a=m),f):a},f}class UB{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function vfe(e){return new UB(e,!0)}function xfe(e){return new UB(e,!1)}const lC={draw(e,t){const n=ja(t/gy);e.moveTo(n,0),e.arc(0,0,n,0,n0)}},bfe={draw(e,t){const n=ja(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},qB=ja(1/3),wfe=qB*2,Sfe={draw(e,t){const n=ja(t/wfe),r=n*qB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},jfe={draw(e,t){const n=ja(t),r=-n/2;e.rect(r,r,n,n)}},Nfe=.8908130915292852,FB=my(gy/10)/my(7*gy/10),kfe=my(n0/10)*FB,Cfe=-DB(n0/10)*FB,Afe={draw(e,t){const n=ja(t*Nfe),r=kfe*n,i=Cfe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=n0*a/5,c=DB(o),d=my(o);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*i,d*r+c*i)}e.closePath()}},nS=ja(3),Ofe={draw(e,t){const n=-ja(t/(nS*3));e.moveTo(0,n*2),e.lineTo(-nS*n,-n),e.lineTo(nS*n,-n),e.closePath()}},$i=-.5,Bi=ja(3)/2,R1=1/ja(12),Efe=(R1/2+1)*3,_fe={draw(e,t){const n=ja(t/Efe),r=n/2,i=n*R1,a=r,o=n*R1+n,c=-a,d=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(c,d),e.lineTo($i*r-Bi*i,Bi*r+$i*i),e.lineTo($i*a-Bi*o,Bi*a+$i*o),e.lineTo($i*c-Bi*d,Bi*c+$i*d),e.lineTo($i*r+Bi*i,$i*i-Bi*r),e.lineTo($i*a+Bi*o,$i*o-Bi*a),e.lineTo($i*c+Bi*d,$i*d-Bi*c),e.closePath()}};function zfe(e,t){let n=null,r=sC(i);e=typeof e=="function"?e:Zt(e||lC),t=typeof t=="function"?t:Zt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Zt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Zt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function yy(){}function vy(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function HB(e){this._context=e}HB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:vy(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:vy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Tfe(e){return new HB(e)}function KB(e){this._context=e}KB.prototype={areaStart:yy,areaEnd:yy,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:vy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Pfe(e){return new KB(e)}function GB(e){this._context=e}GB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:vy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Rfe(e){return new GB(e)}function VB(e){this._context=e}VB.prototype={areaStart:yy,areaEnd:yy,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Dfe(e){return new VB(e)}function $P(e){return e<0?-1:1}function BP(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),c=(a*i+o*r)/(r+i);return($P(a)+$P(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(c))||0}function UP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function rS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,c=(a-r)/3;e._context.bezierCurveTo(r+c,i+c*t,a-c,o-c*n,a,o)}function xy(e){this._context=e}xy.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:rS(this,this._t0,UP(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,rS(this,UP(this,n=BP(this,e,t)),n);break;default:rS(this,this._t0,n=BP(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function QB(e){this._context=new YB(e)}(QB.prototype=Object.create(xy.prototype)).point=function(e,t){xy.prototype.point.call(this,t,e)};function YB(e){this._context=e}YB.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Mfe(e){return new xy(e)}function Ife(e){return new QB(e)}function WB(e){this._context=e}WB.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=qP(e),i=qP(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function qP(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Lfe(e){return new WB(e)}function i0(e,t){this._context=e,this._t=t}i0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function $fe(e){return new i0(e,.5)}function Bfe(e){return new i0(e,0)}function Ufe(e){return new i0(e,1)}function Zl(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,c=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<c;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function D1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function qfe(e,t){return e[t]}function Ffe(e){const t=[];return t.key=e,t}function Hfe(){var e=Zt([]),t=D1,n=Zl,r=qfe;function i(a){var o=Array.from(e.apply(this,arguments),Ffe),c,d=o.length,f=-1,p;for(const m of a)for(c=0,++f;c<d;++c)(o[c][f]=[0,+r(m,o[c].key,f,a)]).data=m;for(c=0,p=oC(t(o));c<d;++c)o[p[c]].index=c;return n(o,p),o}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:Zt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:Zt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?D1:typeof a=="function"?a:Zt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??Zl,i):n},i}function Kfe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Zl(e,t)}}function Gfe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,c=0;o<i;++o)c+=e[o][n][1]||0;r[n][1]+=r[n][0]=-c/2}Zl(e,t)}}function Vfe(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var c=0,d=0,f=0;c<o;++c){for(var p=e[t[c]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,S=0;S<c;++S){var b=e[t[S]],j=b[r][1]||0,k=b[r-1][1]||0;v+=j-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,Zl(e,t)}}var iS={},aS={},FP;function Qfe(){return FP||(FP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(aS)),aS}var sS={},HP;function ZB(){return HP||(HP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(sS)),sS}var oS={},KP;function cC(){return KP||(KP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="string"||typeof n=="symbol"?n:Object.is(n?.valueOf?.(),-0)?"-0":String(n)}e.toKey=t})(oS)),oS}var lS={},cS={},GP;function Yfe(){return GP||(GP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(cS)),cS}var VP;function uC(){return VP||(VP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Yfe(),n=cC();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],o=i.length;if(o===0)return a;let c=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),c++);c<o;){const m=i[c];f?m==="\\"&&c+1<o?(c++,d+=i[c]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,c++}return d&&a.push(d),a}e.toPath=r})(lS)),lS}var QP;function dC(){return QP||(QP=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qfe(),n=ZB(),r=cC(),i=uC();function a(c,d,f){if(c==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?n.isDeepKey(d)?a(c,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=c[d];return p===void 0?f:p}default:{if(Array.isArray(d))return o(c,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?f:p}}}function o(c,d,f){if(d.length===0)return f;let p=c;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(iS)),iS}var uS,YP;function Wfe(){return YP||(YP=1,uS=dC().get),uS}var Zfe=Wfe();const Wu=ba(Zfe);var Xfe=4;function Co(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xfe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function jn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,o)=>{var c=n[o-1];return typeof c=="string"?i+c+a:c!==void 0?i+Co(c)+a:i+a},"")}var ri=e=>e===0?0:e>0?1:-1,ya=e=>typeof e=="number"&&e!=+e,Xl=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Te=e=>(typeof e=="number"||e instanceof Number)&&!ya(e),Ka=e=>Te(e)||typeof e=="string",Jfe=0,Sh=e=>{var t=++Jfe;return"".concat(e||"").concat(t)},va=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Te(t)&&typeof t!="string")return r;var a;if(Xl(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return ya(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},XB=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function mn(e,t,n){return Te(e)&&Te(t)?Co(e+n*(t-e)):t}function JB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):Wu(r,t))===n)}var gn=e=>e===null||typeof e>"u",Wh=e=>gn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function ii(e){return e!=null}function mc(){}var ehe=["type","size","sizeType"];function M1(){return M1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},M1.apply(null,arguments)}function WP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ZP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WP(Object(n),!0).forEach(function(r){the(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function the(e,t,n){return(t=nhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nhe(e){var t=rhe(e,"string");return typeof t=="symbol"?t:t+""}function rhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ihe(e,t){if(e==null)return{};var n,r,i=ahe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ahe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var e6={symbolCircle:lC,symbolCross:bfe,symbolDiamond:Sfe,symbolSquare:jfe,symbolStar:Afe,symbolTriangle:Ofe,symbolWye:_fe},she=Math.PI/180,ohe=e=>{var t="symbol".concat(Wh(e));return e6[t]||lC},lhe=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*she;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},che=(e,t)=>{e6["symbol".concat(Wh(e))]=t},fC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=ihe(e,ehe),a=ZP(ZP({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var c=()=>{var y=ohe(o),v=zfe().type(y).size(lhe(n,r,o)),S=v();if(S!==null)return S},{className:d,cx:f,cy:p}=a,m=Fr(a);return Te(f)&&Te(p)&&Te(n)?x.createElement("path",M1({},m,{className:Rt("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:c()})):null};fC.registerSymbol=che;var t6=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,hC=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(x.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{iC(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},uhe=(e,t,n)=>r=>(e(t,n,r),null),a0=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];iC(i)&&typeof a=="function"&&(r||(r={}),r[i]=uhe(a,t,n))}),r};function XP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dhe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XP(Object(n),!0).forEach(function(r){fhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fhe(e,t,n){return(t=hhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hhe(e){var t=phe(e,"string");return typeof t=="symbol"?t:t+""}function phe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tr(e,t){var n=dhe({},e),r=t,i=Object.keys(t),a=i.reduce((o,c)=>(o[c]===void 0&&r[c]!==void 0&&(o[c]=r[c]),o),n);return a}function by(){return by=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},by.apply(null,arguments)}function JP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function n6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JP(Object(n),!0).forEach(function(r){mhe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mhe(e,t,n){return(t=ghe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ghe(e){var t=yhe(e,"string");return typeof t=="symbol"?t:t+""}function yhe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qi=32,vhe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function xhe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function bhe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=qi/2,a=qi/6,o=qi/3,c=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:xhe(t.payload),x1:0,y1:i,x2:qi,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(o,`
|
|
255
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*o,",").concat(i,`
|
|
256
|
+
H`).concat(qi,"M").concat(2*o,",").concat(i,`
|
|
257
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(o,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return x.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(qi/8,"h").concat(qi,"v").concat(qi*3/4,"h").concat(-qi,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=n6({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(fC,{fill:c,cx:i,cy:i,size:qi,sizeType:"diameter",type:d})}function whe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:o,labelStyle:c}=e,d={x:0,y:0,width:qi,height:qi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,y)=>{var v=m.formatter||i,S=Rt({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof c=="object"?n6({},c):{};b.color=m.inactive?a:b.color||m.color;var j=v?v(m.value,m,y):m.value;return x.createElement("li",by({className:S,style:f,key:"legend-item-".concat(y)},a0(e,m,y)),x.createElement(aC,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(bhe,{data:m,iconType:o,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},j))})}var She=e=>{var t=Tr(e,vhe),{payload:n,layout:r,align:i}=t;if(!n||!n.length)return null;var a={padding:0,margin:0,textAlign:r==="horizontal"?i:"left"};return x.createElement("ul",{className:"recharts-default-legend",style:a},x.createElement(whe,by({},t,{payload:n})))},dS={},fS={},eR;function jhe(){return eR||(eR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const o=n[a],c=r(o,a,n);i.has(c)||i.set(c,o)}return Array.from(i.values())}e.uniqBy=t})(fS)),fS}var hS={},tR;function Nhe(){return tR||(tR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(hS)),hS}var pS={},nR;function r6(){return nR||(nR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(pS)),pS}var mS={},gS={},yS={},rR;function khe(){return rR||(rR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(yS)),yS}var iR;function i6(){return iR||(iR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=khe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(gS)),gS}var vS={},aR;function Che(){return aR||(aR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(vS)),vS}var sR;function Ahe(){return sR||(sR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=i6(),n=Che();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(mS)),mS}var xS={},bS={},oR;function Ohe(){return oR||(oR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(bS)),bS}var wS={},SS={},jS={},NS={},lR;function a6(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(NS)),NS}var kS={},cR;function s6(){return cR||(cR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(kS)),kS}var CS={},uR;function o6(){return uR||(uR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(CS)),CS}var dR;function Ehe(){return dR||(dR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=a6(),n=s6(),r=o6();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(S,b,j,k,E,C){const O=y(S,b,j,k,E,C);return O!==void 0?!!O:a(S,b,v,C)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return o(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function o(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return c(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const S=Object.keys(m);if(p==null||n.isPrimitive(p))return S.length===0;if(S.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let b=0;b<S.length;b++){const j=S[b];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function c(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[S,b]of m.entries()){const j=p.get(S);if(y(j,b,S,p,m,v)===!1)return!1}return!0}function d(p,m,y,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const S=new Set;for(let b=0;b<m.length;b++){const j=m[b];let k=!1;for(let E=0;E<p.length;E++){if(S.has(E))continue;const C=p[E];let O=!1;if(y(C,j,b,p,m,v)&&(O=!0),O){S.add(E),k=!0;break}}if(!k)return!1}return!0}function f(p,m,y,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],y,v):!1}e.isMatchWith=i,e.isSetMatch=f})(jS)),jS}var fR;function l6(){return fR||(fR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ehe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(SS)),SS}var AS={},OS={},ES={},hR;function _he(){return hR||(hR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(ES)),ES}var _S={},pR;function pC(){return pR||(pR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(_S)),_S}var zS={},mR;function c6(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",c="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",S="[object Error]",b="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",C="[object Uint32Array]",O="[object BigUint64Array]",z="[object Int8Array]",A="[object Int16Array]",_="[object Int32Array]",R="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=b,e.dateTag=c,e.errorTag=S,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=A,e.int32ArrayTag=_,e.int8ArrayTag=z,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=E,e.uint32ArrayTag=C,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(zS)),zS}var TS={},gR;function zhe(){return gR||(gR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(TS)),TS}var yR;function u6(){return yR||(yR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_he(),n=pC(),r=c6(),i=s6(),a=zhe();function o(p,m){return c(p,void 0,p,new Map,m)}function c(p,m,y,v=new Map,S=void 0){const b=S?.(p,m,y,v);if(b!==void 0)return b;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=c(p[k],k,y,v,S);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[k,E]of p)j.set(k,c(E,k,y,v,S));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const k of p)j.add(c(k,void 0,y,v,S));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=c(p[k],k,y,v,S);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,y,v,S),j}if(typeof File<"u"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,y,v,S),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,y,v,S),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,y,v,S),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,S),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,S),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,S),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,S),j}return p}function d(p,m,y=p,v,S){const b=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<b.length;j++){const k=b[j],E=Object.getOwnPropertyDescriptor(p,k);(E==null||E.writable)&&(p[k]=c(m[k],k,y,v,S))}}function f(p){switch(n.getTag(p)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=o,e.cloneDeepWithImpl=c,e.copyProperties=d})(OS)),OS}var vR;function The(){return vR||(vR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u6();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(AS)),AS}var xR;function Phe(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=l6(),n=The();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(wS)),wS}var PS={},RS={},DS={},bR;function Rhe(){return bR||(bR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u6(),n=pC(),r=c6();function i(a,o){return t.cloneDeepWith(a,(c,d,f,p)=>{const m=o?.(c,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const y={};return p.set(a,y),t.copyProperties(y,a,f,p),y}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new a.constructor(a?.valueOf());return t.copyProperties(y,a),y}case r.argumentsTag:{const y={};return t.copyProperties(y,a),y.length=a.length,y[Symbol.iterator]=a[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(DS)),DS}var wR;function Dhe(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Rhe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(RS)),RS}var MS={},IS={},SR;function d6(){return SR||(SR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(IS)),IS}var LS={},jR;function Mhe(){return jR||(jR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(LS)),LS}var NR;function Ihe(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ZB(),n=d6(),r=Mhe(),i=uC();function a(o,c){let d;if(Array.isArray(c)?d=c:typeof c=="string"&&t.isDeepKey(c)&&o?.[c]==null?d=i.toPath(c):d=[c],d.length===0)return!1;let f=o;for(let p=0;p<d.length;p++){const m=d[p];if((f==null||!Object.hasOwn(f,m))&&!((Array.isArray(f)||r.isArguments(f))&&n.isIndex(m)&&m<f.length))return!1;f=f[m]}return!0}e.has=a})(MS)),MS}var kR;function Lhe(){return kR||(kR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=l6(),n=cC(),r=Dhe(),i=dC(),a=Ihe();function o(c,d){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,c);return p===void 0?a.has(f,c):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=o})(PS)),PS}var CR;function $he(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=r6(),n=Ohe(),r=Phe(),i=Lhe();function a(o){if(o==null)return t.identity;switch(typeof o){case"function":return o;case"object":return Array.isArray(o)&&o.length===2?i.matchesProperty(o[0],o[1]):r.matches(o);case"string":case"symbol":case"number":return n.property(o)}}e.iteratee=a})(xS)),xS}var AR;function Bhe(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jhe(),n=Nhe(),r=r6(),i=Ahe(),a=$he();function o(c,d=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(a.iteratee(d),1)):[]}e.uniqBy=o})(dS)),dS}var $S,OR;function Uhe(){return OR||(OR=1,$S=Bhe().uniqBy),$S}var qhe=Uhe();const ER=ba(qhe);function f6(e,t,n){return t===!0?ER(e,n):typeof t=="function"?ER(e,t):e}var mC=x.createContext(null),Fhe=e=>e,on=()=>{var e=x.useContext(mC);return e?e.store.dispatch:Fhe},Dg=()=>{},Hhe=()=>Dg,Khe=(e,t)=>e===t;function Ue(e){var t=x.useContext(mC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Dg,[t,e]);return N5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Hhe,t?t.store.getState:Dg,t?t.store.getState:Dg,n,Khe)}function Ghe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Vhe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Qhe(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var _R=e=>Array.isArray(e)?e:[e];function Yhe(e){const t=Array.isArray(e[0])?e[0]:e;return Qhe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Whe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Zhe=class{constructor(e){this.value=e}deref(){return this.value}},Xhe=typeof WeakRef<"u"?WeakRef:Zhe,Jhe=0,zR=1;function tg(){return{s:Jhe,v:void 0,o:null,p:null}}function h6(e,t={}){let n=tg();const{resultEqualityCheck:r}=t;let i,a=0;function o(){let c=n;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let S=c.o;S===null&&(c.o=S=new WeakMap);const b=S.get(v);b===void 0?(c=tg(),S.set(v,c)):c=b}else{let S=c.p;S===null&&(c.p=S=new Map);const b=S.get(v);b===void 0?(c=tg(),S.set(v,c)):c=b}}const f=c;let p;if(c.s===zR)p=c.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new Xhe(p):p}return f.s=zR,f.v=p,p}return o.clearCache=()=>{n=tg(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function epe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,c,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),Ghe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=h6,argsMemoizeOptions:S=[]}=p,b=_R(y),j=_R(S),k=Yhe(i),E=m(function(){return a++,f.apply(null,arguments)},...b),C=v(function(){o++;const z=Whe(k,arguments);return c=E.apply(null,z),c},...j);return Object.assign(C,{resultFunc:f,memoizedResultFunc:E,dependencies:k,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>c,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var se=epe(h6),tpe=Object.assign((e,t=se)=>{Vhe(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,c,d)=>(o[n[d]]=c,o),{}))},{withTypes:()=>tpe}),BS={},US={},qS={},TR;function npe(){return TR||(TR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),c=t(i);if(o===c&&o===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?c-o:o-c}return 0};e.compareValues=n})(qS)),qS}var FS={},HS={},PR;function p6(){return PR||(PR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(HS)),HS}var RR;function rpe(){return RR||(RR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p6(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(FS)),FS}var DR;function ipe(){return DR||(DR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=npe(),n=rpe(),r=uC();function i(a,o,c,d){if(a==null)return[];c=d?void 0:c,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(v=>String(v));const f=(v,S)=>{let b=v;for(let j=0;j<S.length&&b!=null;++j)b=b[S[j]];return b},p=(v,S)=>S==null||v==null?S:typeof v=="object"&&"key"in v?Object.hasOwn(S,v.key)?S[v.key]:f(S,v.path):typeof v=="function"?v(S):Array.isArray(v)?f(S,v):typeof S=="object"?S[v]:S,m=o.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(S=>p(S,v))})).slice().sort((v,S)=>{for(let b=0;b<m.length;b++){const j=t.compareValues(v.criteria[b],S.criteria[b],c[b]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(US)),US}var KS={},MR;function ape(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(c,d)=>{for(let f=0;f<c.length;f++){const p=c[f];Array.isArray(p)&&d<a?o(p,d+1):i.push(p)}};return o(n,0),i}e.flatten=t})(KS)),KS}var GS={},IR;function m6(){return IR||(IR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=d6(),n=i6(),r=a6(),i=o6();function a(o,c,d){return r.isObject(d)&&(typeof c=="number"&&n.isArrayLike(d)&&t.isIndex(c)&&c<d.length||typeof c=="string"&&c in d)?i.isEqualsSameValueZero(d[c],o):!1}e.isIterateeCall=a})(GS)),GS}var LR;function spe(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ipe(),n=ape(),r=m6();function i(a,...o){const c=o.length;return c>1&&r.isIterateeCall(a,o[0],o[1])?o=[]:c>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(BS)),BS}var VS,$R;function ope(){return $R||($R=1,VS=spe().sortBy),VS}var lpe=ope();const s0=ba(lpe);var g6=e=>e.legend.settings,cpe=e=>e.legend.size,upe=e=>e.legend.payload,dpe=se([upe,g6],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?s0(r,n):r});function fpe(){return Ue(dpe)}var ng=1;function y6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=x.useState({height:0,left:0,top:0,width:0}),r=x.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>ng||Math.abs(o.left-t.left)>ng||Math.abs(o.top-t.top)>ng||Math.abs(o.width-t.width)>ng)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function dr(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var hpe=typeof Symbol=="function"&&Symbol.observable||"@@observable",BR=hpe,QS=()=>Math.random().toString(36).substring(7).split("").join("."),ppe={INIT:`@@redux/INIT${QS()}`,REPLACE:`@@redux/REPLACE${QS()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${QS()}`},wy=ppe;function gC(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function v6(e,t,n){if(typeof e!="function")throw new Error(dr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(dr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(dr(1));return n(v6)(e,t)}let r=e,i=t,a=new Map,o=a,c=0,d=!1;function f(){o===a&&(o=new Map,a.forEach((j,k)=>{o.set(k,j)}))}function p(){if(d)throw new Error(dr(3));return i}function m(j){if(typeof j!="function")throw new Error(dr(4));if(d)throw new Error(dr(5));let k=!0;f();const E=c++;return o.set(E,j),function(){if(k){if(d)throw new Error(dr(6));k=!1,f(),o.delete(E),a=null}}}function y(j){if(!gC(j))throw new Error(dr(7));if(typeof j.type>"u")throw new Error(dr(8));if(typeof j.type!="string")throw new Error(dr(17));if(d)throw new Error(dr(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=o).forEach(E=>{E()}),j}function v(j){if(typeof j!="function")throw new Error(dr(10));r=j,y({type:wy.REPLACE})}function S(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(dr(11));function E(){const O=k;O.next&&O.next(p())}return E(),{unsubscribe:j(E)}},[BR](){return this}}}return y({type:wy.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[BR]:S}}function mpe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:wy.INIT})>"u")throw new Error(dr(12));if(typeof n(void 0,{type:wy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(dr(13))})}function x6(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const o=t[a];typeof e[o]=="function"&&(n[o]=e[o])}const r=Object.keys(n);let i;try{mpe(n)}catch(a){i=a}return function(o={},c){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],y=n[m],v=o[m],S=y(v,c);if(typeof S>"u")throw c&&c.type,new Error(dr(14));f[m]=S,d=d||S!==v}return d=d||r.length!==Object.keys(o).length,d?f:o}}function Sy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function gpe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(dr(15))};const o={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},c=e.map(d=>d(o));return a=Sy(...c)(i.dispatch),{...i,dispatch:a}}}function b6(e){return gC(e)&&"type"in e&&typeof e.type=="string"}var w6=Symbol.for("immer-nothing"),UR=Symbol.for("immer-draftable"),Hr=Symbol.for("immer-state");function pa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ki=Object,Zu=ki.getPrototypeOf,jy="constructor",o0="prototype",I1="configurable",Ny="enumerable",Mg="writable",jh="value",_s=e=>!!e&&!!e[Hr];function xa(e){return e?S6(e)||c0(e)||!!e[UR]||!!e[jy]?.[UR]||u0(e)||d0(e):!1}var ype=ki[o0][jy].toString(),qR=new WeakMap;function S6(e){if(!e||!yC(e))return!1;const t=Zu(e);if(t===null||t===ki[o0])return!0;const n=ki.hasOwnProperty.call(t,jy)&&t[jy];if(n===Object)return!0;if(!bu(n))return!1;let r=qR.get(n);return r===void 0&&(r=Function.toString.call(n),qR.set(n,r)),r===ype}function l0(e,t,n=!0){Zh(e)===0?(n?Reflect.ownKeys(e):ki.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Zh(e){const t=e[Hr];return t?t.type_:c0(e)?1:u0(e)?2:d0(e)?3:0}var FR=(e,t,n=Zh(e))=>n===2?e.has(t):ki[o0].hasOwnProperty.call(e,t),L1=(e,t,n=Zh(e))=>n===2?e.get(t):e[t],ky=(e,t,n,r=Zh(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function vpe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var c0=Array.isArray,u0=e=>e instanceof Map,d0=e=>e instanceof Set,yC=e=>typeof e=="object",bu=e=>typeof e=="function",YS=e=>typeof e=="boolean";function xpe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var xs=e=>e.copy_||e.base_,vC=e=>e.modified_?e.copy_:e.base_;function $1(e,t){if(u0(e))return new Map(e);if(d0(e))return new Set(e);if(c0(e))return Array[o0].slice.call(e);const n=S6(e);if(t===!0||t==="class_only"&&!n){const r=ki.getOwnPropertyDescriptors(e);delete r[Hr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c[Mg]===!1&&(c[Mg]=!0,c[I1]=!0),(c.get||c.set)&&(r[o]={[I1]:!0,[Mg]:!0,[Ny]:c[Ny],[jh]:e[o]})}return ki.create(Zu(e),r)}else{const r=Zu(e);if(r!==null&&n)return{...e};const i=ki.create(r);return ki.assign(i,e)}}function xC(e,t=!1){return f0(e)||_s(e)||!xa(e)||(Zh(e)>1&&ki.defineProperties(e,{set:rg,add:rg,clear:rg,delete:rg}),ki.freeze(e),t&&l0(e,(n,r)=>{xC(r,!0)},!1)),e}function bpe(){pa(2)}var rg={[jh]:bpe};function f0(e){return e===null||!yC(e)?!0:ki.isFrozen(e)}var Cy="MapSet",B1="Patches",HR="ArrayMethods",j6={};function Jl(e){const t=j6[e];return t||pa(0,e),t}var KR=e=>!!j6[e],Nh,N6=()=>Nh,wpe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:KR(Cy)?Jl(Cy):void 0,arrayMethodsPlugin_:KR(HR)?Jl(HR):void 0});function GR(e,t){t&&(e.patchPlugin_=Jl(B1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function U1(e){q1(e),e.drafts_.forEach(Spe),e.drafts_=null}function q1(e){e===Nh&&(Nh=e.parent_)}var VR=e=>Nh=wpe(Nh,e);function Spe(e){const t=e[Hr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function QR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Hr].modified_&&(U1(t),pa(4)),xa(e)&&(e=YR(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Hr].base_,e,t)}else e=YR(t,n);return jpe(t,e,!0),U1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==w6?e:void 0}function YR(e,t){if(f0(t))return t;const n=t[Hr];if(!n)return Ay(t,e.handledSet_,e);if(!h0(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);A6(n,e)}return n.copy_}function jpe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xC(t,n)}function k6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var h0=(e,t)=>e.scope_===t,Npe=[];function C6(e,t,n,r){const i=xs(e),a=e.type_;if(r!==void 0&&L1(i,r,a)===t){ky(i,r,n,a);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;l0(i,(d,f)=>{if(_s(f)){const p=c.get(f)||[];p.push(d),c.set(f,p)}})}const o=e.draftLocations_.get(t)??Npe;for(const c of o)ky(i,c,n,a)}function kpe(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!h0(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const o=vC(a);C6(e,a.draft_??a,o,n),A6(a,i)})}function A6(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const i=r.getPath(e);i&&r.generatePatches_(e,i,t)}k6(e)}}function Cpe(e,t,n){const{scope_:r}=e;if(_s(n)){const i=n[Hr];h0(i,r)&&i.callbacks_.push(function(){Ig(e);const o=vC(i);C6(e,n,o,t)})}else xa(n)&&e.callbacks_.push(function(){const a=xs(e);e.type_===3?a.has(n)&&Ay(n,r.handledSet_,r):L1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ay(L1(e.copy_,t,e.type_),r.handledSet_,r)})}function Ay(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||_s(e)||t.has(e)||!xa(e)||f0(e)||(t.add(e),l0(e,(r,i)=>{if(_s(i)){const a=i[Hr];if(h0(a,n)){const o=vC(a);ky(e,r,o,e.type_),k6(a)}}else xa(i)&&Ay(i,t,n)})),e}function Ape(e,t){const n=c0(e),r={type_:n?1:0,scope_:t?t.scope_:N6(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Oy;n&&(i=[r],a=kh);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,[c,r]}var Oy={get(e,t){if(t===Hr)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=xs(e);if(!FR(i,t,e.type_))return Ope(e,i,t);const a=i[t];if(e.finalized_||!xa(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&xpe(t))return a;if(a===WS(e.base_,t)){Ig(e);const o=e.type_===1?+t:t,c=H1(e.scope_,a,e,o);return e.copy_[o]=c}return a},has(e,t){return t in xs(e)},ownKeys(e){return Reflect.ownKeys(xs(e))},set(e,t,n){const r=O6(xs(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=WS(xs(e),t),a=i?.[Hr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(vpe(n,i)&&(n!==void 0||FR(e.base_,t,e.type_)))return!0;Ig(e),F1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Cpe(e,t,n)),!0},deleteProperty(e,t){return Ig(e),WS(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),F1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=xs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Mg]:!0,[I1]:e.type_!==1||t!=="length",[Ny]:r[Ny],[jh]:n[t]}},defineProperty(){pa(11)},getPrototypeOf(e){return Zu(e.base_)},setPrototypeOf(){pa(12)}},kh={};for(let e in Oy){let t=Oy[e];kh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}kh.deleteProperty=function(e,t){return kh.set.call(this,e,t,void 0)};kh.set=function(e,t,n){return Oy.set.call(this,e[0],t,n,e[0])};function WS(e,t){const n=e[Hr];return(n?xs(n):e)[t]}function Ope(e,t,n){const r=O6(t,n);return r?jh in r?r[jh]:r.get?.call(e.draft_):void 0}function O6(e,t){if(!(t in e))return;let n=Zu(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Zu(n)}}function F1(e){e.modified_||(e.modified_=!0,e.parent_&&F1(e.parent_))}function Ig(e){e.copy_||(e.assigned_=new Map,e.copy_=$1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Epe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(bu(n)&&!bu(r)){const o=r;r=n;const c=this;return function(f=o,...p){return c.produce(f,m=>r.call(this,m,...p))}}bu(r)||pa(6),i!==void 0&&!bu(i)&&pa(7);let a;if(xa(n)){const o=VR(this),c=H1(o,n,void 0);let d=!0;try{a=r(c),d=!1}finally{d?U1(o):q1(o)}return GR(o,i),QR(a,o)}else if(!n||!yC(n)){if(a=r(n),a===void 0&&(a=n),a===w6&&(a=void 0),this.autoFreeze_&&xC(a,!0),i){const o=[],c=[];Jl(B1).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:c}),i(o,c)}return a}else pa(1,n)},this.produceWithPatches=(n,r)=>{if(bu(n))return(c,...d)=>this.produceWithPatches(c,f=>n(f,...d));let i,a;return[this.produce(n,r,(c,d)=>{i=c,a=d}),i,a]},YS(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),YS(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),YS(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){xa(t)||pa(8),_s(t)&&(t=Vi(t));const n=VR(this),r=H1(n,t,void 0);return r[Hr].isManual_=!0,q1(n),r}finishDraft(t,n){const r=t&&t[Hr];(!r||!r.isManual_)&&pa(9);const{scope_:i}=r;return GR(i,n),QR(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Jl(B1).applyPatches_;return _s(t)?i(t,n):this.produce(t,a=>i(a,n))}};function H1(e,t,n,r){const[i,a]=u0(t)?Jl(Cy).proxyMap_(t,n):d0(t)?Jl(Cy).proxySet_(t,n):Ape(t,n);return(n?.scope_??N6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?kpe(n,a,r):a.callbacks_.push(function(d){d.mapSetPlugin_?.fixSetContents(a);const{patchPlugin_:f}=d;a.modified_&&f&&f.generatePatches_(a,[],d)}),i}function Vi(e){return _s(e)||pa(10,e),E6(e)}function E6(e){if(!xa(e)||f0(e))return e;const t=e[Hr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=$1(e,!0);return l0(n,(i,a)=>{ky(n,i,E6(a))},r),t&&(t.finalized_=!1),n}var _pe=new Epe,_6=_pe.produce;function z6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var zpe=z6(),Tpe=z6,Ppe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Sy:Sy.apply(null,arguments)};function Ai(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Ci(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>b6(r)&&r.type===e,n}var T6=class Yf extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Yf.prototype)}static get[Symbol.species](){return Yf}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Yf(...t[0].concat(this)):new Yf(...t.concat(this))}};function WR(e){return xa(e)?_6(e,()=>{}):e}function ig(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function Rpe(e){return typeof e=="boolean"}var Dpe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new T6;return n&&(Rpe(n)?o.push(zpe):o.push(Tpe(n.extraArgument))),o},P6="RTK_autoBatch",an=()=>e=>({payload:e,meta:{[P6]:!0}}),ZR=e=>t=>{setTimeout(t,e)},R6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const c=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ZR(10):e.type==="callback"?e.queueNotification:ZR(e.timeout),f=()=>{o=!1,a&&(a=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return c.add(p),()=>{y(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[P6],a=!i,a&&(o||(o=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},Mpe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new T6(e);return r&&i.push(R6(typeof r=="object"?r:void 0)),i};function Ipe(e){const t=Dpe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(gC(n))c=x6(n);else throw new Error(Ci(1));let d;typeof r=="function"?d=r(t):d=t();let f=Sy;i&&(f=Ppe({trace:!1,...typeof i=="object"&&i}));const p=gpe(...d),m=Mpe(p);let y=typeof o=="function"?o(m):m();const v=f(...y);return v6(c,a,v)}function D6(e){const t={},n=[];let r;const i={addCase(a,o){const c=typeof a=="string"?a:a.type;if(!c)throw new Error(Ci(28));if(c in t)throw new Error(Ci(29));return t[c]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function Lpe(e){return typeof e=="function"}function $pe(e,t){let[n,r,i]=D6(t),a;if(Lpe(e))a=()=>WR(e());else{const c=WR(e);a=()=>c}function o(c=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(_s(p)){const v=m(p,d);return v===void 0?p:v}else{if(xa(p))return _6(p,y=>m(y,d));{const y=m(p,d);if(y===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return p},c)}return o.getInitialState=a,o}var Bpe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Upe=(e=21)=>{let t="",n=e;for(;n--;)t+=Bpe[Math.random()*64|0];return t},qpe=Symbol.for("rtk-slice-createasyncthunk");function Fpe(e,t){return`${e}/${t}`}function Hpe({creators:e}={}){const t=e?.asyncThunk?.[qpe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Ci(11));const o=(typeof r.reducers=="function"?r.reducers(Gpe()):r.reducers)||{},c=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,O){const z=typeof C=="string"?C:C.type;if(!z)throw new Error(Ci(12));if(z in d.sliceCaseReducersByType)throw new Error(Ci(13));return d.sliceCaseReducersByType[z]=O,f},addMatcher(C,O){return d.sliceMatchers.push({matcher:C,reducer:O}),f},exposeAction(C,O){return d.actionCreators[C]=O,f},exposeCaseReducer(C,O){return d.sliceCaseReducersByName[C]=O,f}};c.forEach(C=>{const O=o[C],z={reducerName:C,type:Fpe(i,C),createNotation:typeof r.reducers=="function"};Qpe(O)?Wpe(z,O,f,t):Vpe(z,O,f)});function p(){const[C={},O=[],z=void 0]=typeof r.extraReducers=="function"?D6(r.extraReducers):[r.extraReducers],A={...C,...d.sliceCaseReducersByType};return $pe(r.initialState,_=>{for(let R in A)_.addCase(R,A[R]);for(let R of d.sliceMatchers)_.addMatcher(R.matcher,R.reducer);for(let R of O)_.addMatcher(R.matcher,R.reducer);z&&_.addDefaultCase(z)})}const m=C=>C,y=new Map,v=new WeakMap;let S;function b(C,O){return S||(S=p()),S(C,O)}function j(){return S||(S=p()),S.getInitialState()}function k(C,O=!1){function z(_){let R=_[C];return typeof R>"u"&&O&&(R=ig(v,z,j)),R}function A(_=m){const R=ig(y,O,()=>new WeakMap);return ig(R,_,()=>{const $={};for(const[F,q]of Object.entries(r.selectors??{}))$[F]=Kpe(q,_,()=>ig(v,_,j),O);return $})}return{reducerPath:C,getSelectors:A,get selectors(){return A(z)},selectSlice:z}}const E={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(C,{reducerPath:O,...z}={}){const A=O??a;return C.inject({reducerPath:A,reducer:b},z),{...E,...k(A,!0)}}};return E}}function Kpe(e,t,n,r){function i(a,...o){let c=t(a);return typeof c>"u"&&r&&(c=n()),e(c,...o)}return i.unwrapped=e,i}var Pr=Hpe();function Gpe(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function Vpe({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!Ype(r))throw new Error(Ci(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Ai(e,o):Ai(e))}function Qpe(e){return e._reducerDefinitionType==="asyncThunk"}function Ype(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Wpe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Ci(18));const{payloadCreator:a,fulfilled:o,pending:c,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),o&&r.addCase(m.fulfilled,o),c&&r.addCase(m.pending,c),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:o||ag,pending:c||ag,rejected:d||ag,settled:f||ag})}function ag(){}var Zpe="task",M6="listener",I6="completed",bC="cancelled",Xpe=`task-${bC}`,Jpe=`task-${I6}`,K1=`${M6}-${bC}`,eme=`${M6}-${I6}`,p0=class{constructor(e){this.code=e,this.message=`${Zpe} ${bC} (reason: ${e})`}name="TaskAbortError";message},wC=(e,t)=>{if(typeof e!="function")throw new TypeError(Ci(32))},Ey=()=>{},L6=(e,t=Ey)=>(e.catch(t),e),$6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),$l=e=>{if(e.aborted)throw new p0(e.reason)};function B6(e,t){let n=Ey;return new Promise((r,i)=>{const a=()=>i(new p0(e.reason));if(e.aborted){a();return}n=$6(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Ey})}var tme=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof p0?"cancelled":"rejected",error:n}}finally{t?.()}},_y=e=>t=>L6(B6(e,t).then(n=>($l(e),n))),U6=e=>{const t=_y(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Iu}=Object,XR={},m0="listenerMiddleware",nme=(e,t)=>{const n=r=>$6(e,()=>r.abort(e.reason));return(r,i)=>{wC(r);const a=new AbortController;n(a);const o=tme(async()=>{$l(e),$l(a.signal);const c=await r({pause:_y(a.signal),delay:U6(a.signal),signal:a.signal});return $l(a.signal),c},()=>a.abort(Jpe));return i?.autoJoin&&t.push(o.catch(Ey)),{result:_y(e)(o),cancel(){a.abort(Xpe)}}}},rme=(e,t)=>{const n=async(r,i)=>{$l(t);let a=()=>{};const c=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,y)=>{y.unsubscribe(),d([m,y.getState(),y.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&c.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await B6(t,Promise.race(c));return $l(t),d}finally{a()}};return(r,i)=>L6(n(r,i))},q6=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ai(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Ci(21));return wC(a),{predicate:i,type:t,effect:a}},F6=Iu(e=>{const{type:t,predicate:n,effect:r}=q6(e);return{id:Upe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Ci(22))}}},{withTypes:()=>F6}),JR=(e,t)=>{const{type:n,effect:r,predicate:i}=q6(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},G1=e=>{e.pending.forEach(t=>{t.abort(K1)})},ime=(e,t)=>()=>{for(const n of t.keys())G1(n);e.clear()},eD=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},H6=Iu(Ai(`${m0}/add`),{withTypes:()=>H6}),ame=Ai(`${m0}/removeAll`),K6=Iu(Ai(`${m0}/remove`),{withTypes:()=>K6}),sme=(...e)=>{console.error(`${m0}/error`,...e)},Xh=(e={})=>{const t=new Map,n=new Map,r=v=>{const S=n.get(v)??0;n.set(v,S+1)},i=v=>{const S=n.get(v)??1;S===1?n.delete(v):n.set(v,S-1)},{extra:a,onError:o=sme}=e;wC(o);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),S=>{v.unsubscribe(),S?.cancelActive&&G1(v)}),d=v=>{const S=JR(t,v)??F6(v);return c(S)};Iu(d,{withTypes:()=>d});const f=v=>{const S=JR(t,v);return S&&(S.unsubscribe(),v.cancelActive&&G1(S)),!!S};Iu(f,{withTypes:()=>f});const p=async(v,S,b,j)=>{const k=new AbortController,E=rme(d,k.signal),C=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(S,Iu({},b,{getOriginalState:j,condition:(O,z)=>E(O,z).then(Boolean),take:E,delay:U6(k.signal),pause:_y(k.signal),extra:a,signal:k.signal,fork:nme(k.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((O,z,A)=>{O!==k&&(O.abort(K1),A.delete(O))})},cancel:()=>{k.abort(K1),v.pending.delete(k)},throwIfCancelled:()=>{$l(k.signal)}})))}catch(O){O instanceof p0||eD(o,O,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(eme),i(v),v.pending.delete(k)}},m=ime(t,n);return{middleware:v=>S=>b=>{if(!b6(b))return S(b);if(H6.match(b))return d(b.payload);if(ame.match(b)){m();return}if(K6.match(b))return f(b.payload);let j=v.getState();const k=()=>{if(j===XR)throw new Error(Ci(23));return j};let E;try{if(E=S(b),t.size>0){const C=v.getState(),O=Array.from(t.values());for(const z of O){let A=!1;try{A=z.predicate(b,C,j)}catch(_){A=!1,eD(o,_,{raisedBy:"predicate"})}A&&p(z,b,v,k)}}}finally{j=XR}return E},startListening:d,stopListening:f,clearListeners:m}};function Ci(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ome={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},G6=Pr({name:"chartLayout",initialState:ome,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:lme,setLayout:cme,setChartSize:ume,setScale:dme}=G6.actions,fme=G6.reducer;function V6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ft(e){return Number.isFinite(e)}function Ga(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function tD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tD(Object(n),!0).forEach(function(r){hme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hme(e,t,n){return(t=pme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pme(e){var t=mme(e,"string");return typeof t=="symbol"?t:t+""}function mme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function En(e,t,n){return gn(e)||gn(t)?n:Ka(t)?Wu(e,t,n):typeof t=="function"?t(e):n}var gme=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:c}=t;if((c==="vertical"||c==="horizontal"&&o==="middle")&&a!=="center"&&Te(e[a]))return Cu(Cu({},e),{},{[a]:e[a]+(r||0)});if((c==="horizontal"||c==="vertical"&&a==="center")&&o!=="middle"&&Te(e[o]))return Cu(Cu({},e),{},{[o]:e[o]+(i||0)})}return e},Wa=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Q6=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,a,o=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(a=!0),c.coordinate));return i||o.push(t),a||o.push(n),o},Y6=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:o,realScaleType:c,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!o)return null;var S=c==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,b=i==="category"&&o.bandwidth?o.bandwidth()/S:0;if(b=v==="angleAxis"&&a&&a.length>=2?ri(a[0]-a[1])*2*b:b,m||y){var j=(m||y||[]).map((k,E)=>{var C=r?r.indexOf(k):k,O=o.map(C);return ft(O)?{coordinate:O+b,value:k,offset:b,index:E}:null}).filter(ii);return j}return d&&f?f.map((k,E)=>{var C=o.map(k);return ft(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(ii):o.ticks&&p!=null?o.ticks(p).map((k,E)=>{var C=o.map(k);return ft(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(ii):o.domain().map((k,E)=>{var C=o.map(k);return ft(C)?{coordinate:C+b,value:r?r[k]:k,index:E,offset:b}:null}).filter(ii)},yme=(e,t)=>{if(!t||t.length!==2||!Te(t[0])||!Te(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!Te(e[0])||e[0]<n)&&(i[0]=n),(!Te(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},vme=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0,c=0;c<n;++c){var d=e[c],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=ya(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=o,o+=y,f[1]=o)}}}},xme=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,o=0;o<n;++o){var c=e[o],d=c?.[i];if(d!=null){var f=ya(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},bme={sign:vme,expand:Kfe,none:Zl,silhouette:Gfe,wiggle:Vfe,positive:xme},wme=(e,t,n)=>{var r,i=(r=bme[n])!==null&&r!==void 0?r:Zl,a=Hfe().keys(t).value((c,d)=>Number(En(c,d,0))).order(D1).offset(i),o=a(e);return o.forEach((c,d)=>{c.forEach((f,p)=>{var m=En(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Te(m[0])&&Te(m[1])&&(f[0]=m[0],f[1]=m[1])})}),o};function W6(e){return e==null?void 0:String(e)}function nD(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!gn(i[t.dataKey])){var c=JB(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=En(i,gn(o)?t.dataKey:o),f=t.scale.map(d);return Te(f)?f:null}var rD=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:o}=e;if(t.type==="category")return n[o]?n[o].coordinate+r:null;var c=En(a,t.dataKey,t.scale.domain()[o]);if(gn(c))return null;var d=t.scale.map(c);return Te(d)?d-i/2+r:null},Sme=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},jme=e=>{var t=e.flat(2).filter(Te);return[Math.min(...t),Math.max(...t)]},Nme=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],kme=(e,t,n)=>{if(e!=null)return Nme(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,c=o.reduce((d,f)=>{var p=V6(f,t,n),m=jme(p);return!ft(m[0])||!ft(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},iD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,aD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Xu=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=s0(t,p=>p.coordinate),a=1/0,o=1,c=i.length;o<c;o++){var d=i[o],f=i[o-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function sD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Cu(Cu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function g0(e,t){if(e)return String(e);if(typeof t=="string")return t}var Cme=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Ame=(e,t)=>t==="centric"?e.angle:e.radius,Ms=e=>e.layout.width,Is=e=>e.layout.height,Ome=e=>e.layout.scale,Z6=e=>e.layout.margin,y0=se(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),v0=se(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Eme="data-recharts-item-index",_me="data-recharts-item-id",Jh=60;function oD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oD(Object(n),!0).forEach(function(r){zme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zme(e,t,n){return(t=Tme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tme(e){var t=Pme(e,"string");return typeof t=="symbol"?t:t+""}function Pme(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rme=e=>e.brush.height;function Dme(e){var t=v0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Jh;return n+i}return n},0)}function Mme(e){var t=v0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Jh;return n+i}return n},0)}function Ime(e){var t=y0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Lme(e){var t=y0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var tr=se([Ms,Is,Z6,Rme,Dme,Mme,Ime,Lme,g6,cpe],(e,t,n,r,i,a,o,c,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+o,bottom:(n.bottom||0)+c},y=sg(sg({},m),p),v=y.bottom;y.bottom+=r,y=gme(y,d,f);var S=e-y.left-y.right,b=t-y.top-y.bottom;return sg(sg({brushBottom:v},y),{},{width:Math.max(S,0),height:Math.max(b,0)})}),$me=se(tr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),SC=se(Ms,Is,(e,t)=>({x:0,y:0,width:e,height:t})),Bme=x.createContext(null),Rr=()=>x.useContext(Bme)!=null,x0=e=>e.brush,b0=se([x0,tr,Z6],(e,t,n)=>({height:e.height,x:Te(e.x)?e.x:t.left,y:Te(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Te(e.width)?e.width:t.width})),ZS={},XS={},JS={},lD;function Ume(){return lD||(lD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,c=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{c!==null&&(n.apply(o,c),o=void 0,c=null)},m=()=>{f&&p(),b()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},S=()=>{y!==null&&(clearTimeout(y),y=null)},b=()=>{S(),o=void 0,c=null},j=()=>{p()},k=function(...E){if(i?.aborted)return;o=this,c=E;const C=y==null;v(),d&&C&&p()};return k.schedule=v,k.cancel=b,k.flush=j,i?.addEventListener("abort",b,{once:!0}),k}e.debounce=t})(JS)),JS}var cD;function qme(){return cD||(cD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ume();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:c=!0,maxWait:d}=a,f=Array(2);o&&(f[0]="leading"),c&&(f[1]="trailing");let p,m=null;const y=t.debounce(function(...b){p=r.apply(this,b),m=null},i,{edges:f}),v=function(...b){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,b),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,b),p)},S=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=S,v}e.debounce=n})(XS)),XS}var uD;function Fme(){return uD||(uD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qme();function n(r,i=0,a={}){const{leading:o=!0,trailing:c=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:c})}e.throttle=n})(ZS)),ZS}var ej,dD;function Hme(){return dD||(dD=1,ej=Fme().throttle),ej}var Kme=Hme();const Gme=ba(Kme);var zy=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(n.replace(/%s/g,()=>i[o++]))}},$a={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},X6=(e,t,n)=>{var{width:r=$a.width,height:i=$a.height,aspect:a,maxHeight:o}=n,c=Xl(r)?e:Number(r),d=Xl(i)?t:Number(i);return a&&a>0&&(c?d=c/a:d&&(c=d*a),o&&d!=null&&d>o&&(d=o)),{calculatedWidth:c,calculatedHeight:d}},Vme={width:0,height:0,overflow:"visible"},Qme={width:0,overflowX:"visible"},Yme={height:0,overflowY:"visible"},Wme={},Zme=e=>{var{width:t,height:n}=e,r=Xl(t),i=Xl(n);return r&&i?Vme:r?Qme:i?Yme:Wme};function Xme(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=$a.width,a=$a.height):i===void 0?i=r&&r>0?void 0:$a.width:a===void 0&&(a=r&&r>0?void 0:$a.height),{width:i,height:a}}function V1(){return V1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V1.apply(null,arguments)}function fD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fD(Object(n),!0).forEach(function(r){Jme(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jme(e,t,n){return(t=ege(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ege(e){var t=tge(e,"string");return typeof t=="symbol"?t:t+""}function tge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J6=x.createContext($a.initialDimension);function nge(e){return Ga(e.width)&&Ga(e.height)}function eU(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return nge(i)?x.createElement(J6.Provider,{value:i},t):null}var jC=()=>x.useContext(J6),rge=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=$a.initialDimension,width:i,height:a,minWidth:o=$a.minWidth,minHeight:c,maxHeight:d,children:f,debounce:p=$a.debounce,id:m,className:y,onResize:v,style:S={}}=e,b=x.useRef(null),j=x.useRef();j.current=v,x.useImperativeHandle(t,()=>b.current);var[k,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),C=x.useCallback((R,$)=>{E(F=>{var q=Math.round(R),B=Math.round($);return F.containerWidth===q&&F.containerHeight===B?F:{containerWidth:q,containerHeight:B}})},[]);x.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return mc;var R=B=>{var V,X=B[0];if(X!=null){var{width:Z,height:H}=X.contentRect;C(Z,H),(V=j.current)===null||V===void 0||V.call(j,Z,H)}};p>0&&(R=Gme(R,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(R),{width:F,height:q}=b.current.getBoundingClientRect();return C(F,q),$.observe(b.current),()=>{$.disconnect()}},[C,p]);var{containerWidth:O,containerHeight:z}=k;zy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:_}=X6(O,z,{width:i,height:a,aspect:n,maxHeight:d});return zy(A!=null&&A>0||_!=null&&_>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
258
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
259
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
260
|
+
height and width.`,A,_,i,a,o,c,n),x.createElement("div",{id:m?"".concat(m):void 0,className:Rt("recharts-responsive-container",y),style:hD(hD({},S),{},{width:i,height:a,minWidth:o,minHeight:c,maxHeight:d}),ref:b},x.createElement("div",{style:Zme({width:i,height:a})},x.createElement(eU,{width:A,height:_},f)))}),Ty=x.forwardRef((e,t)=>{var n=jC();if(Ga(n.width)&&Ga(n.height))return e.children;var{width:r,height:i}=Xme({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=X6(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Te(a)&&Te(o)?x.createElement(eU,{width:a,height:o},e.children):x.createElement(rge,V1({},e,{width:r,height:i,ref:t}))});function NC(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var w0=()=>{var e,t=Rr(),n=Ue($me),r=Ue(b0),i=(e=Ue(x0))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},ige={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},tU=()=>{var e;return(e=Ue(tr))!==null&&e!==void 0?e:ige},kC=()=>Ue(Ms),CC=()=>Ue(Is),age=()=>Ue(e=>e.layout.margin),Lt=e=>e.layout.layoutType,gc=()=>Ue(Lt),AC=()=>{var e=gc();if(e==="horizontal"||e==="vertical")return e},nU=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},sge=()=>{var e=gc();return e!==void 0},ep=e=>{var t=on(),n=Rr(),{width:r,height:i}=e,a=jC(),o=r,c=i;return a&&(o=a.width>0?a.width:r,c=a.height>0?a.height:i),x.useEffect(()=>{!n&&Ga(o)&&Ga(c)&&t(ume({width:o,height:c}))},[t,n,o,c]),null},rU=Symbol.for("immer-nothing"),pD=Symbol.for("immer-draftable"),Oi=Symbol.for("immer-state");function ma(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ch=Object.getPrototypeOf;function Ju(e){return!!e&&!!e[Oi]}function ec(e){return e?iU(e)||Array.isArray(e)||!!e[pD]||!!e.constructor?.[pD]||tp(e)||j0(e):!1}var oge=Object.prototype.constructor.toString(),mD=new WeakMap;function iU(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=mD.get(n);return r===void 0&&(r=Function.toString.call(n),mD.set(n,r)),r===oge}function Py(e,t,n=!0){S0(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function S0(e){const t=e[Oi];return t?t.type_:Array.isArray(e)?1:tp(e)?2:j0(e)?3:0}function Q1(e,t){return S0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function aU(e,t,n){const r=S0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function lge(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function tp(e){return e instanceof Map}function j0(e){return e instanceof Set}function jl(e){return e.copy_||e.base_}function Y1(e,t){if(tp(e))return new Map(e);if(j0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=iU(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Oi];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const o=i[a],c=r[o];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[o]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[o]})}return Object.create(Ch(e),r)}else{const r=Ch(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function OC(e,t=!1){return N0(e)||Ju(e)||!ec(e)||(S0(e)>1&&Object.defineProperties(e,{set:og,add:og,clear:og,delete:og}),Object.freeze(e),t&&Object.values(e).forEach(n=>OC(n,!0))),e}function cge(){ma(2)}var og={value:cge};function N0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var uge={};function tc(e){const t=uge[e];return t||ma(0,e),t}var Ah;function sU(){return Ah}function dge(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gD(e,t){t&&(tc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function W1(e){Z1(e),e.drafts_.forEach(fge),e.drafts_=null}function Z1(e){e===Ah&&(Ah=e.parent_)}function yD(e){return Ah=dge(Ah,e)}function fge(e){const t=e[Oi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function vD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Oi].modified_&&(W1(t),ma(4)),ec(e)&&(e=Ry(t,e),t.parent_||Dy(t,e)),t.patches_&&tc("Patches").generateReplacementPatches_(n[Oi].base_,e,t.patches_,t.inversePatches_)):e=Ry(t,n,[]),W1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rU?e:void 0}function Ry(e,t,n){if(N0(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Oi];if(!i)return Py(t,(a,o)=>xD(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Dy(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,c=!1;i.type_===3&&(o=new Set(a),a.clear(),c=!0),Py(o,(d,f)=>xD(e,i,a,d,f,n,c),r),Dy(e,a,!1),n&&e.patches_&&tc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function xD(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const c=N0(i);if(!(c&&!o)){if(Ju(i)){const d=a&&t&&t.type_!==3&&!Q1(t.assigned_,r)?a.concat(r):void 0,f=Ry(e,i,d);if(aU(n,r,f),Ju(f))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(ec(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;Ry(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(tp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Dy(e,i)}}}function Dy(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&OC(t,n)}function hge(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:sU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=EC;n&&(i=[r],a=Oh);const{revoke:o,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=o,c}var EC={get(e,t){if(t===Oi)return e;const n=jl(e);if(!Q1(n,t))return pge(e,n,t);const r=n[t];return e.finalized_||!ec(r)?r:r===tj(e.base_,t)?(nj(e),e.copy_[t]=J1(r,e)):r},has(e,t){return t in jl(e)},ownKeys(e){return Reflect.ownKeys(jl(e))},set(e,t,n){const r=oU(jl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=tj(jl(e),t),a=i?.[Oi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(lge(n,i)&&(n!==void 0||Q1(e.base_,t)))return!0;nj(e),X1(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return tj(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nj(e),X1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=jl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ma(11)},getPrototypeOf(e){return Ch(e.base_)},setPrototypeOf(){ma(12)}},Oh={};Py(EC,(e,t)=>{Oh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Oh.deleteProperty=function(e,t){return Oh.set.call(this,e,t,void 0)};Oh.set=function(e,t,n){return EC.set.call(this,e[0],t,n,e[0])};function tj(e,t){const n=e[Oi];return(n?jl(n):e)[t]}function pge(e,t,n){const r=oU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function oU(e,t){if(!(t in e))return;let n=Ch(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ch(n)}}function X1(e){e.modified_||(e.modified_=!0,e.parent_&&X1(e.parent_))}function nj(e){e.copy_||(e.copy_=Y1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var mge=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(d=a,...f){return o.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&ma(6),r!==void 0&&typeof r!="function"&&ma(7);let i;if(ec(t)){const a=yD(this),o=J1(t,void 0);let c=!0;try{i=n(o),c=!1}finally{c?W1(a):Z1(a)}return gD(a,r),vD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===rU&&(i=void 0),this.autoFreeze_&&OC(i,!0),r){const a=[],o=[];tc("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else ma(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...c)=>this.produceWithPatches(o,d=>t(d,...c));let r,i;return[this.produce(t,n,(o,c)=>{r=o,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ec(e)||ma(8),Ju(e)&&(e=gge(e));const t=yD(this),n=J1(e,void 0);return n[Oi].isManual_=!0,Z1(t),n}finishDraft(e,t){const n=e&&e[Oi];(!n||!n.isManual_)&&ma(9);const{scope_:r}=n;return gD(r,t),vD(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=tc("Patches").applyPatches_;return Ju(e)?r(e,t):this.produce(e,i=>r(i,t))}};function J1(e,t){const n=tp(e)?tc("MapSet").proxyMap_(e,t):j0(e)?tc("MapSet").proxySet_(e,t):hge(e,t);return(t?t.scope_:sU()).drafts_.push(n),n}function gge(e){return Ju(e)||ma(10,e),lU(e)}function lU(e){if(!ec(e)||N0(e))return e;const t=e[Oi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Y1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Y1(e,!0);return Py(n,(i,a)=>{aU(n,i,lU(a))},r),t&&(t.finalized_=!1),n}var yge=new mge;yge.produce;var vge={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},cU=Pr({name:"legend",initialState:vge,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:an()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Vi(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:an()},removeLegendPayload:{reducer(e,t){var n=Vi(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:an()}}}),{setLegendSize:bD,setLegendSettings:xge,addLegendPayload:bge,replaceLegendPayload:wge,removeLegendPayload:Sge}=cU.actions,jge=cU.reducer,rj={exports:{}},ij={};var wD;function Nge(){if(wD)return ij;wD=1;var e=ld();function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,c=e.useDebugValue;return ij.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var S={hasValue:!1,value:null};v.current=S}else S=v.current;v=o(function(){function j(z){if(!k){if(k=!0,E=z,z=m(z),y!==void 0&&S.hasValue){var A=S.value;if(y(A,z))return C=A}return C=z}if(A=C,n(E,z))return A;var _=m(z);return y!==void 0&&y(A,_)?(E=z,A):(E=z,C=_)}var k=!1,E,C,O=p===void 0?null:p;return[function(){return j(f())},O===null?void 0:function(){return j(O())}]},[f,p,m,y]);var b=r(d,v[0],v[1]);return a(function(){S.hasValue=!0,S.value=b},[b]),c(b),b},ij}var SD;function kge(){return SD||(SD=1,rj.exports=Nge()),rj.exports}kge();function Cge(e){e()}function Age(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Cge(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var jD={notify(){},get:()=>[]};function Oge(e,t){let n,r=jD,i=0,a=!1;function o(b){p();const j=r.subscribe(b);let k=!1;return()=>{k||(k=!0,j(),m())}}function c(){r.notify()}function d(){S.onStateChange&&S.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=Age())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=jD)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const S={addNestedSub:o,notifyNestedSubs:c,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return S}var Ege=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_ge=Ege(),zge=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Tge=zge(),Pge=()=>_ge||Tge?x.useLayoutEffect:x.useEffect,Rge=Pge();function ND(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Dge(e,t){if(ND(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!ND(e[n[i]],t[n[i]]))return!1;return!0}var Mge=Symbol.for("react-redux-context"),Ige=typeof globalThis<"u"?globalThis:{};function Lge(){if(!x.createContext)return{};const e=Ige[Mge]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var $ge=Lge();function Bge(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=Oge(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),o=x.useMemo(()=>i.getState(),[i]);Rge(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),o!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,o]);const c=n||$ge;return x.createElement(c.Provider,{value:a},t)}var Uge=Bge,qge=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Fge(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function xd(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(qge.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Dge(e[r],t[r]))return!1}else if(!Fge(e[r],t[r]))return!1;return!0}var Hge=["contextPayload"];function eN(){return eN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eN.apply(null,arguments)}function kD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ed(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kD(Object(n),!0).forEach(function(r){Kge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kge(e,t,n){return(t=Gge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gge(e){var t=Vge(e,"string");return typeof t=="symbol"?t:t+""}function Vge(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qge(e,t){if(e==null)return{};var n,r,i=Yge(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Yge(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Wge(e){return e.value}function Zge(e){var{contextPayload:t}=e,n=Qge(e,Hge),r=f6(t,e.payloadUniqBy,Wge),i=ed(ed({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(She,i)}function Xge(e,t,n,r,i,a){var{layout:o,align:c,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&o==="vertical"?f={left:((r||0)-a.width)/2}:f=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),ed(ed({},f),p)}function Jge(e){var t=on();return x.useEffect(()=>{t(xge(e))},[t,e]),null}function eye(e){var t=on();return x.useEffect(()=>(t(bD(e)),()=>{t(bD({width:0,height:0}))}),[t,e]),null}function tye(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var nye={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function rye(e){var t=Tr(e,nye),n=fpe(),r=pfe(),i=age(),{width:a,height:o,wrapperStyle:c,portal:d}=t,[f,p]=y6([n]),m=kC(),y=CC();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),S=tye(t.layout,o,a,v),b=d?c:ed(ed({position:"absolute",width:S?.width||a||"auto",height:S?.height||o||"auto"},Xge(c,t,i,m,y,f)),c),j=d??r;if(j==null||n==null)return null;var k=x.createElement("div",{className:"recharts-legend-wrapper",style:b,ref:p},x.createElement(Jge,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(eye,{width:f.width,height:f.height}),x.createElement(Zge,eN({},t,S,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return lc.createPortal(k,j)}var uU=x.memo(rye,xd);uU.displayName="Legend";function tN(){return tN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tN.apply(null,arguments)}function CD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CD(Object(n),!0).forEach(function(r){iye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iye(e,t,n){return(t=aye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aye(e){var t=sye(e,"string");return typeof t=="symbol"?t:t+""}function sye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function oye(e){return Array.isArray(e)&&Ka(e[0])&&Ka(e[1])?e.join(" ~ "):e}var cu={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function lye(e,t){return t==null?e:s0(e,t)}var cye=e=>{var{separator:t=cu.separator,contentStyle:n,itemStyle:r,labelStyle:i=cu.labelStyle,payload:a,formatter:o,itemSorter:c,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=cu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var z={padding:0,margin:0},A=lye(a,c),_=A.map((R,$)=>{if(!R||R.type==="none")return null;var F=R.formatter||o||oye,{value:q,name:B}=R,V=q,X=B;if(F){var Z=F(q,B,R,$,a);if(Array.isArray(Z))[V,X]=Z;else if(Z!=null)V=Z;else return null}var H=Rf(Rf({},cu.itemStyle),{},{color:R.color||cu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Ka(X)?x.createElement("span",{className:"recharts-tooltip-item-name"},X):null,Ka(X)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},V),x.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:z},_)}return null},S=Rf(Rf({},cu.contentStyle),n),b=Rf({margin:0},i),j=!gn(p),k=j?p:"",E=Rt("recharts-default-tooltip",d),C=Rt("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var O=y?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",tN({className:E,style:S},O),x.createElement("p",{className:C,style:b},x.isValidElement(k)?k:"".concat(k)),v())},Df="recharts-tooltip-wrapper",uye={visibility:"hidden"};function dye(e){var{coordinate:t,translateX:n,translateY:r}=e;return Rt(Df,{["".concat(Df,"-right")]:Te(n)&&t&&Te(t.x)&&n>=t.x,["".concat(Df,"-left")]:Te(n)&&t&&Te(t.x)&&n<t.x,["".concat(Df,"-bottom")]:Te(r)&&t&&Te(t.y)&&r>=t.y,["".concat(Df,"-top")]:Te(r)&&t&&Te(t.y)&&r<t.y})}function AD(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:o,tooltipDimension:c,viewBox:d,viewBoxDimension:f}=e;if(a&&Te(a[r]))return a[r];var p=n[r]-c-(i>0?i:0),m=n[r]+i;if(t[r])return o[r]?p:m;var y=d[r];if(y==null)return 0;if(o[r]){var v=p,S=y;return v<S?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var b=m+c,j=y+f;return b>j?Math.max(p,y):Math.max(m,y)}function fye(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function hye(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:c,useTranslate3d:d,viewBox:f}=e,p,m,y;return c.height>0&&c.width>0&&n?(m=AD({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:c.width,viewBox:f,viewBoxDimension:f.width}),y=AD({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:c.height,viewBox:f,viewBoxDimension:f.height}),p=fye({translateX:m,translateY:y,useTranslate3d:d})):p=uye,{cssProperties:p,cssClasses:dye({translateX:m,translateY:y,coordinate:n})}}var pye=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),np={isSsr:pye()};function dU(){var[e,t]=x.useState(()=>np.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches);return x.useEffect(()=>{if(window.matchMedia){var n=window.matchMedia("(prefers-reduced-motion: reduce)"),r=()=>{t(n.matches)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}}},[]),e}function OD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OD(Object(n),!0).forEach(function(r){mye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mye(e,t,n){return(t=gye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gye(e){var t=yye(e,"string");return typeof t=="symbol"?t:t+""}function yye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vye(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function xye(e){var t,n,r,i,a,o,c=dU(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var S=b=>{if(b.key==="Escape"){var j,k,E,C;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&j!==void 0?j:0,y:(E=(C=e.coordinate)===null||C===void 0?void 0:C.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(n=e.coordinate)===null||n===void 0?void 0:n.y]),d.dismissed&&(((r=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&r!==void 0?r:0)!==d.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(uu(uu({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=hye({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:uu(uu({transition:vye({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=uu(uu({},y),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var bye=x.memo(xye),fU=()=>{var e;return(e=Ue(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function nN(){return nN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nN.apply(null,arguments)}function ED(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ED(Object(n),!0).forEach(function(r){wye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ED(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wye(e,t,n){return(t=Sye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sye(e){var t=jye(e,"string");return typeof t=="symbol"?t:t+""}function jye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zD={curveBasisClosed:Pfe,curveBasisOpen:Rfe,curveBasis:Tfe,curveBumpX:vfe,curveBumpY:xfe,curveLinearClosed:Dfe,curveLinear:r0,curveMonotoneX:Mfe,curveMonotoneY:Ife,curveNatural:Lfe,curveStep:$fe,curveStepAfter:Ufe,curveStepBefore:Bfe},My=e=>ft(e.x)&&ft(e.y),TD=e=>e.base!=null&&My(e.base)&&My(e),Mf=e=>e.x,If=e=>e.y,Nye=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Wh(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=zD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return zD[n]||r0},PD={connectNulls:!1,type:"linear"},kye=e=>{var{type:t=PD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=PD.connectNulls}=e,o=Nye(t,i),c=a?n.filter(My):n;if(Array.isArray(r)){var d,f=n.map((S,b)=>_D(_D({},S),{},{base:r[b]}));i==="vertical"?d=eg().y(If).x1(Mf).x0(S=>S.base.x):d=eg().x(Mf).y1(If).y0(S=>S.base.y);var p=d.defined(TD).curve(o),m=a?f.filter(TD):f;return p(m)}var y;i==="vertical"&&Te(r)?y=eg().y(If).x1(Mf).x0(r):Te(r)?y=eg().x(Mf).y1(If).y0(r):y=BB().x(Mf).y(If);var v=y.defined(My).curve(o);return v(c)},sh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=gc();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},c=n&&n.length?kye(o):r;return x.createElement("path",nN({},Zi(e),hC(e),{className:Rt("recharts-curve",t),d:c===null?void 0:c,ref:i}))},Cye=["x","y","top","left","width","height","className"];function rN(){return rN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rN.apply(null,arguments)}function RD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Aye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RD(Object(n),!0).forEach(function(r){Oye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oye(e,t,n){return(t=Eye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eye(e){var t=_ye(e,"string");return typeof t=="symbol"?t:t+""}function _ye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zye(e,t){if(e==null)return{};var n,r,i=Tye(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Tye(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Pye=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),Rye=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:c}=e,d=zye(e,Cye),f=Aye({x:t,y:n,top:r,left:i,width:a,height:o},d);return!Te(t)||!Te(n)||!Te(a)||!Te(o)||!Te(r)||!Te(i)?null:x.createElement("path",rN({},Fr(f),{className:Rt("recharts-cross",c),d:Pye(t,n,a,o,r,i)}))};function Dye(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function DD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function MD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?DD(Object(n),!0).forEach(function(r){Mye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mye(e,t,n){return(t=Iye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iye(e){var t=Lye(e,"string");return typeof t=="symbol"?t:t+""}function Lye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $ye=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),hU=(e,t,n)=>e.map(r=>"".concat($ye(r)," ").concat(t,"ms ").concat(n)).join(","),Bye=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Eh=(e,t)=>Object.keys(t).reduce((n,r)=>MD(MD({},n),{},{[r]:e(r,t[r])}),{});function ID(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ID(Object(n),!0).forEach(function(r){Uye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ID(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Uye(e,t,n){return(t=qye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qye(e){var t=Fye(e,"string");return typeof t=="symbol"?t:t+""}function Fye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Iy=(e,t,n)=>e+(t-e)*n,iN=e=>{var{from:t,to:n}=e;return t!==n},pU=(e,t,n)=>{var r=Eh((i,a)=>{if(iN(a)){var[o,c]=e(a.from,a.to,a.velocity);return Kn(Kn({},a),{},{from:o,velocity:c})}return a},t);return n<1?Eh((i,a)=>iN(a)&&r[i]!=null?Kn(Kn({},a),{},{velocity:Iy(a.velocity,r[i].velocity,n),from:Iy(a.from,r[i].from,n)}):a,t):pU(e,r,n-1)};function Hye(e,t,n,r,i,a){var o,c=r.reduce((y,v)=>Kn(Kn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Eh((y,v)=>v.from,c),f=()=>!Object.values(c).filter(iN).length,p=null,m=y=>{o||(o=y);var v=y-o,S=v/n.dt;c=pU(n,c,S),i(Kn(Kn(Kn({},e),t),d())),o=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function Kye(e,t,n,r,i,a,o){var c=null,d=i.reduce((m,y)=>{var v=e[y],S=t[y];return v==null||S==null?m:Kn(Kn({},m),{},{[y]:[v,S]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=Eh((b,j)=>Iy(...j,n(y)),d);if(a(Kn(Kn(Kn({},e),t),v)),y<1)c=o.setTimeout(p);else{var S=Eh((b,j)=>Iy(...j,n(1)),d);a(Kn(Kn(Kn({},e),t),S))}};return()=>(c=o.setTimeout(p),()=>{var m;(m=c)===null||m===void 0||m()})}const Gye=(e,t,n,r,i,a)=>{var o=Bye(e,t);return n==null?()=>(i(Kn(Kn({},e),t)),()=>{}):n.isStepper===!0?Hye(e,t,n,o,i,a):Kye(e,t,n,r,o,i,a)};var Ly=1e-4,mU=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],gU=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),LD=(e,t)=>n=>{var r=mU(e,t);return gU(r,n)},Vye=(e,t)=>n=>{var r=mU(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return gU(i,n)},Qye=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},Yye=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=Qye(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Wye=(e,t,n,r)=>{var i=LD(e,n),a=LD(t,r),o=Vye(e,n),c=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,y=0;y<8;++y){var v=i(m)-p,S=o(m);if(Math.abs(v-p)<Ly||S<Ly)return a(m);m=c(m-v/S)}return a(m)};return d.isStepper=!1,d},$D=function(){return Wye(...Yye(...arguments))},Zye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,c,d)=>{var f=-(o-c)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+o;return Math.abs(y-c)<Ly&&Math.abs(m)<Ly?[c,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},Xye=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return $D(e);case"spring":return Zye();default:if(e.split("(")[0]==="cubic-bezier")return $D(e)}return typeof e=="function"?e:null};function Jye(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var c=o,[d,...f]=c;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class eve{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function tve(){return Jye(new eve)}var nve=x.createContext(tve);function rve(e,t){var n=x.useContext(nve);return x.useMemo(()=>t??n(e),[e,t,n])}var ive={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},BD={t:0},aj={t:1};function k0(e){var t=Tr(e,ive),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:c,onAnimationStart:d,children:f}=t,p=dU(),m=n==="auto"?!np.isSsr&&!p:n,y=rve(t.animationId,t.animationManager),[v,S]=x.useState(m?BD:aj),b=x.useRef(null);return x.useEffect(()=>{m||S(aj)},[m]),x.useEffect(()=>{if(!m||!r)return mc;var j=Gye(BD,aj,Xye(a),i,S,y.getTimeoutController()),k=()=>{b.current=j()};return y.start([d,o,k,i,c]),()=>{y.stop(),b.current&&b.current(),c()}},[m,r,i,a,o,d,c,y]),f(v.t)}function C0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Sh(t)),r=x.useRef(e);return r.current!==e&&(n.current=Sh(t),r.current=e),n.current}var ave=["radius"],sve=["radius"],UD,qD,FD,HD,KD,GD,VD,QD,YD,WD;function ZD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZD(Object(n),!0).forEach(function(r){ove(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ove(e,t,n){return(t=lve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lve(e){var t=cve(e,"string");return typeof t=="symbol"?t:t+""}function cve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $y(){return $y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$y.apply(null,arguments)}function JD(e,t){if(e==null)return{};var n,r,i=uve(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function uve(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function za(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var eM=(e,t,n,r,i)=>{var a=Co(n),o=Co(r),c=Math.min(Math.abs(a)/2,Math.abs(o)/2),d=o>=0?1:-1,f=a>=0?1:-1,p=o>=0&&a>=0||o<0&&a<0?1:0,m;if(c>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,S=4;v<S;v++){var b,j=(b=i[v])!==null&&b!==void 0?b:0;y[v]=j>c?c:j}m=jn(UD||(UD=za(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=jn(qD||(qD=za(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=jn(FD||(FD=za(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=jn(HD||(HD=za(["A ",",",",0,0,",`,
|
|
261
|
+
`,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=jn(KD||(KD=za(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=jn(GD||(GD=za(["A ",",",",0,0,",`,
|
|
262
|
+
`,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=jn(VD||(VD=za(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=jn(QD||(QD=za(["A ",",",",0,0,",`,
|
|
263
|
+
`,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(c>0&&i===+i&&i>0){var k=Math.min(c,i);m=jn(YD||(YD=za(["M ",",",`
|
|
264
|
+
A `,",",",0,0,",",",",",`
|
|
265
|
+
L `,",",`
|
|
266
|
+
A `,",",",0,0,",",",",",`
|
|
267
|
+
L `,",",`
|
|
268
|
+
A `,",",",0,0,",",",",",`
|
|
269
|
+
L `,",",`
|
|
270
|
+
A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,p,e+f*k,t,e+n-f*k,t,k,k,p,e+n,t+d*k,e+n,t+r-d*k,k,k,p,e+n-f*k,t+r,e+f*k,t+r,k,k,p,e,t+r-d*k)}else m=jn(WD||(WD=za(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},tM={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},yU=e=>{var t=Tr(e,tM),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var J=n.current.getTotalLength();J&&i(J)}catch{}},[]);var{x:a,y:o,width:c,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:S,isUpdateAnimationActive:b}=t,j=x.useRef(c),k=x.useRef(d),E=x.useRef(a),C=x.useRef(o),O=x.useMemo(()=>({x:a,y:o,width:c,height:d,radius:f}),[a,o,c,d,f]),z=C0(O,"rectangle-");if(a!==+a||o!==+o||c!==+c||d!==+d||c===0||d===0)return null;var A=Rt("recharts-rectangle",p);if(!b){var _=Fr(t),{radius:R}=_,$=JD(_,ave);return x.createElement("path",$y({},$,{x:Co(a),y:Co(o),width:Co(c),height:Co(d),radius:typeof f=="number"?f:void 0,className:A,d:eM(a,o,c,d,f)}))}var F=j.current,q=k.current,B=E.current,V=C.current,X="0px ".concat(r===-1?1:r,"px"),Z="".concat(r,"px ").concat(r,"px"),H=hU(["strokeDasharray"],y,typeof m=="string"?m:tM.animationEasing);return x.createElement(k0,{animationId:z,key:z,canBegin:r>0,duration:y,easing:m,isActive:b,begin:v},J=>{var ue=mn(F,c,J),we=mn(q,d,J),I=mn(B,a,J),D=mn(V,o,J);n.current&&(j.current=ue,k.current=we,E.current=I,C.current=D);var U;S?J>0?U={transition:H,strokeDasharray:Z}:U={strokeDasharray:X}:U={strokeDasharray:Z};var M=Fr(t),{radius:Q}=M,oe=JD(M,sve);return x.createElement("path",$y({},oe,{radius:typeof f=="number"?f:void 0,className:A,d:eM(I,D,ue,we,f),ref:n,style:XD(XD({},U),t.style)}))})};function nM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nM(Object(n),!0).forEach(function(r){dve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dve(e,t,n){return(t=fve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fve(e){var t=hve(e,"string");return typeof t=="symbol"?t:t+""}function hve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var By=Math.PI/180,pve=e=>e*180/Math.PI,gr=(e,t,n,r)=>({x:e+Math.cos(-By*r)*n,y:t+Math.sin(-By*r)*n}),mve=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},gve=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},yve=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=gve({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var c=(n-i)/o,d=Math.acos(c);return r>a&&(d=2*Math.PI-d),{radius:o,angle:pve(d),angleInRadian:d}},vve=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},xve=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},bve=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=yve({x:n,y:r},t),{innerRadius:o,outerRadius:c}=t;if(i<o||i>c||i===0)return null;var{startAngle:d,endAngle:f}=vve(t),p=a,m;if(d<=f){for(;p>f;)p-=360;for(;p<d;)p+=360;m=p>=d&&p<=f}else{for(;p>d;)p-=360;for(;p<f;)p+=360;m=p>=f&&p<=d}return m?rM(rM({},t),{},{radius:i,angle:xve(p,t)}):null};function vU(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=gr(t,n,r,i),c=gr(t,n,r,a);return{points:[o,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var iM,aM,sM,oM,lM,cM,uM;function aN(){return aN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},aN.apply(null,arguments)}function zl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var wve=(e,t)=>{var n=ri(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},lg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:c,cornerIsExternal:d}=e,f=c*(o?1:-1)+r,p=Math.asin(c/f)/By,m=d?i:i+a*p,y=gr(t,n,f,m),v=gr(t,n,r,m),S=d?i-a*p:i,b=gr(t,n,f*Math.cos(p*By),S);return{center:y,circleTangency:v,lineTangency:b,theta:p}},xU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,c=wve(a,o),d=a+c,f=gr(t,n,i,a),p=gr(t,n,i,d),m=jn(iM||(iM=zl(["M ",",",`
|
|
271
|
+
A `,",",`,0,
|
|
272
|
+
`,",",`,
|
|
273
|
+
`,",",`
|
|
274
|
+
`])),f.x,f.y,i,i,+(Math.abs(c)>180),+(a>d),p.x,p.y);if(r>0){var y=gr(t,n,r,a),v=gr(t,n,r,d);m+=jn(aM||(aM=zl(["L ",",",`
|
|
275
|
+
A `,",",`,0,
|
|
276
|
+
`,",",`,
|
|
277
|
+
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(a<=d),y.x,y.y)}else m+=jn(sM||(sM=zl(["L ",","," Z"])),t,n);return m},Sve=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:c,startAngle:d,endAngle:f}=e,p=ri(f-d),{circleTangency:m,lineTangency:y,theta:v}=lg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:c}),{circleTangency:S,lineTangency:b,theta:j}=lg({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:c}),k=c?Math.abs(d-f):Math.abs(d-f)-v-j;if(k<0)return o?jn(oM||(oM=zl(["M ",",",`
|
|
278
|
+
a`,",",",0,0,1,",`,0
|
|
279
|
+
a`,",",",0,0,1,",`,0
|
|
280
|
+
`])),y.x,y.y,a,a,a*2,a,a,-a*2):xU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var E=jn(lM||(lM=zl(["M ",",",`
|
|
281
|
+
A`,",",",0,0,",",",",",`
|
|
282
|
+
A`,",",",0,",",",",",",",`
|
|
283
|
+
A`,",",",0,0,",",",",",`
|
|
284
|
+
`])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),S.x,S.y,a,a,+(p<0),b.x,b.y);if(r>0){var{circleTangency:C,lineTangency:O,theta:z}=lg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),{circleTangency:A,lineTangency:_,theta:R}=lg({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),$=c?Math.abs(d-f):Math.abs(d-f)-z-R;if($<0&&a===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=jn(cM||(cM=zl(["L",",",`
|
|
285
|
+
A`,",",",0,0,",",",",",`
|
|
286
|
+
A`,",",",0,",",",",",",",`
|
|
287
|
+
A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),A.x,A.y,r,r,+($>180),+(p>0),C.x,C.y,a,a,+(p<0),O.x,O.y)}else E+=jn(uM||(uM=zl(["L",",","Z"])),t,n);return E},jve={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},bU=e=>{var t=Tr(e,jve),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=Rt("recharts-sector",m),v=a-i,S=va(o,v,0,!0),b;return S>0&&Math.abs(f-p)<360?b=Sve({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(S,v/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p}):b=xU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",aN({},Fr(t),{className:y,d:b}))};function Nve(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(t6(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:c}=t,d=gr(r,i,a,c),f=gr(r,i,o,c);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return vU(t)}}var sj={},oj={},lj={},dM;function kve(){return dM||(dM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p6();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(lj)),lj}var fM;function Cve(){return fM||(fM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kve();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(oj)),oj}var hM;function Ave(){return hM||(hM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=m6(),n=Cve();function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?i<a?1:-1:n.toFinite(o);const c=Math.max(Math.ceil((a-i)/(o||1)),0),d=new Array(c);for(let f=0;f<c;f++)d[f]=i,i+=o;return d}e.range=r})(sj)),sj}var cj,pM;function Ove(){return pM||(pM=1,cj=Ave().range),cj}var Eve=Ove();const wU=ba(Eve);var Na=e=>e.chartData,_C=se([Na],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),A0=(e,t,n,r)=>r?_C(e):Na(e),SU=(e,t,n)=>n?_C(e):Na(e),_ve=se([A0],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});se([_C],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var zve=se([Na],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function Ua(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ft(t)&&ft(n))return!0}return!1}function mM(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function jU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(ft(n))i=n;else if(typeof n=="function")return;if(ft(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(Ua(o))return o}}function Tve(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Ua(r))return mM(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,c;if(i==="auto")t!=null&&(o=Math.min(...t));else if(Te(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t?.[0]))}catch{}else if(typeof i=="string"&&iD.test(i)){var d=iD.exec(i);if(d==null||d[1]==null||t==null)o=void 0;else{var f=+d[1];o=t[0]-f}}else o=t?.[0];if(a==="auto")t!=null&&(c=Math.max(...t));else if(Te(a))c=a;else if(typeof a=="function")try{t!=null&&(c=a(t?.[1]))}catch{}else if(typeof a=="string"&&aD.test(a)){var p=aD.exec(a);if(p==null||p[1]==null||t==null)c=void 0;else{var m=+p[1];c=t[1]+m}}else c=t?.[1];var y=[o,c];if(Ua(y))return t==null?y:mM(y,t,n)}}}var bd=1e9,Pve={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},TC,hn=!0,Xi="[DecimalError] ",Bl=Xi+"Invalid argument: ",zC=Xi+"Exponent out of range: ",wd=Math.floor,Nl=Math.pow,Rve=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ji,Jn=1e7,sn=7,NU=9007199254740991,Uy=wd(NU/sn),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*sn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Me.dividedBy=Me.div=function(e){return As(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return Qt(As(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return In(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ji))throw Error(Xi+"NaN");if(n.s<1)throw Error(Xi+(n.s?"NaN":"-Infinity"));return n.eq(ji)?new r(0):(hn=!1,t=As(_h(n,a),_h(e,a),a),hn=!0,Qt(t,i))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?AU(t,e):kU(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Xi+"NaN");return n.s?(hn=!1,t=As(n,e,0,1).times(e),hn=!0,n.minus(t)):Qt(new r(n),i)};Me.naturalExponential=Me.exp=function(){return CU(this)};Me.naturalLogarithm=Me.ln=function(){return _h(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kU(t,e):AU(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Bl+e);if(t=In(i)+1,r=i.d.length-1,n=r*sn+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Me.squareRoot=Me.sqrt=function(){var e,t,n,r,i,a,o,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Xi+"NaN")}for(e=In(c),hn=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ba(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=wd((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=o=n+3;;)if(a=r,r=a.plus(As(c,a,o+2)).times(.5),Ba(a.d).slice(0,o)===(t=Ba(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Qt(a,n+1,0),a.times(a).eq(c)){r=a;break}}else if(t!="9999")break;o+=4}return hn=!0,Qt(r,n)};Me.times=Me.mul=function(e){var t,n,r,i,a,o,c,d,f,p=this,m=p.constructor,y=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=y.length,f=v.length,d<f&&(a=y,y=v,v=a,o=d,d=f,f=o),a=[],o=d+f,r=o;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)c=a[i]+v[r]*y[i-r-1]+t,a[i--]=c%Jn|0,t=c/Jn|0;a[i]=(a[i]+t)%Jn|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,hn?Qt(e,m.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Va(e,0,bd),t===void 0?t=r.rounding:Va(t,0,8),Qt(n,e+In(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=nc(r,!0):(Va(e,0,bd),t===void 0?t=i.rounding:Va(t,0,8),r=Qt(new i(r),e+1,t),n=nc(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?nc(i):(Va(e,0,bd),t===void 0?t=a.rounding:Va(t,0,8),r=Qt(new a(i),e+In(i)+1,t),n=nc(r.abs(),!1,e+In(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return Qt(new t(e),In(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.pow=function(e){var t,n,r,i,a,o,c=this,d=c.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(ji);if(c=new d(c),!c.s){if(e.s<1)throw Error(Xi+"Infinity");return c}if(c.eq(ji))return c;if(r=d.precision,e.eq(ji))return Qt(c,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=c.s,o){if((n=p<0?-p:p)<=NU){for(i=new d(ji),t=Math.ceil(r/sn+4),hn=!1;n%2&&(i=i.times(c),yM(i.d,t)),n=wd(n/2),n!==0;)c=c.times(c),yM(c.d,t);return hn=!0,e.s<0?new d(ji).div(i):Qt(i,r)}}else if(a<0)throw Error(Xi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,hn=!1,i=e.times(_h(c,r+f)),hn=!0,i=CU(i),i.s=a,i};Me.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=In(i),r=nc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Va(e,1,bd),t===void 0?t=a.rounding:Va(t,0,8),i=Qt(new a(i),e,t),n=In(i),r=nc(i,e<=n||n<=a.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Va(e,1,bd),t===void 0?t=r.rounding:Va(t,0,8)),Qt(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=In(e),n=e.constructor;return nc(e,t<=n.toExpNeg||t>=n.toExpPos)};function kU(e,t){var n,r,i,a,o,c,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),hn?Qt(t,m):t;if(d=e.d,f=t.d,o=e.e,i=t.e,d=d.slice(),a=o-i,a){for(a<0?(r=d,a=-a,c=f.length):(r=f,i=o,c=d.length),o=Math.ceil(m/sn),c=o>c?o+1:c+1,a>c&&(a=c,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(c=d.length,a=f.length,c-a<0&&(a=c,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/Jn|0,d[a]%=Jn;for(n&&(d.unshift(n),++i),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=i,hn?Qt(t,m):t}function Va(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Bl+e)}function Ba(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+"",n=sn-r.length,n&&(a+=xo(n)),a+=r;o=e[t],r=o+"",n=sn-r.length,n&&(a+=xo(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var As=(function(){function e(r,i){var a,o=0,c=r.length;for(r=r.slice();c--;)a=r[c]*i+o,r[c]=a%Jn|0,o=a/Jn|0;return o&&r.unshift(o),r}function t(r,i,a,o){var c,d;if(a!=o)d=a>o?1:-1;else for(c=d=0;c<a;c++)if(r[c]!=i[c]){d=r[c]>i[c]?1:-1;break}return d}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]<i[a]?1:0,r[a]=o*Jn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,o){var c,d,f,p,m,y,v,S,b,j,k,E,C,O,z,A,_,R,$=r.constructor,F=r.s==i.s?1:-1,q=r.d,B=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(Xi+"Division by zero");for(d=r.e-i.e,_=B.length,z=q.length,v=new $(F),S=v.d=[],f=0;B[f]==(q[f]||0);)++f;if(B[f]>(q[f]||0)&&--d,a==null?E=a=$.precision:o?E=a+(In(r)-In(i))+1:E=a,E<0)return new $(0);if(E=E/sn+2|0,f=0,_==1)for(p=0,B=B[0],E++;(f<z||p)&&E--;f++)C=p*Jn+(q[f]||0),S[f]=C/B|0,p=C%B|0;else{for(p=Jn/(B[0]+1)|0,p>1&&(B=e(B,p),q=e(q,p),_=B.length,z=q.length),O=_,b=q.slice(0,_),j=b.length;j<_;)b[j++]=0;R=B.slice(),R.unshift(0),A=B[0],B[1]>=Jn/2&&++A;do p=0,c=t(B,b,_,j),c<0?(k=b[0],_!=j&&(k=k*Jn+(b[1]||0)),p=k/A|0,p>1?(p>=Jn&&(p=Jn-1),m=e(B,p),y=m.length,j=b.length,c=t(m,b,y,j),c==1&&(p--,n(m,_<y?R:B,y))):(p==0&&(c=p=1),m=B.slice()),y=m.length,y<j&&m.unshift(0),n(b,m,j),c==-1&&(j=b.length,c=t(B,b,_,j),c<1&&(p++,n(b,_<j?R:B,j))),j=b.length):c===0&&(p++,b=[0]),S[f++]=p,c&&b[0]?b[j++]=q[O]||0:(b=[q[O]],j=1);while((O++<z||b[0]!==void 0)&&E--)}return S[0]||S.shift(),v.e=d,Qt(v,o?a+In(v)+1:a)}})();function CU(e,t){var n,r,i,a,o,c,d=0,f=0,p=e.constructor,m=p.precision;if(In(e)>16)throw Error(zC+In(e));if(!e.s)return new p(ji);for(hn=!1,c=m,o=new p(.03125);e.abs().gte(.1);)e=e.times(o),f+=5;for(r=Math.log(Nl(2,f))/Math.LN10*2+5|0,c+=r,n=i=a=new p(ji),p.precision=c;;){if(i=Qt(i.times(e),c),n=n.times(++d),o=a.plus(As(i,n,c)),Ba(o.d).slice(0,c)===Ba(a.d).slice(0,c)){for(;f--;)a=Qt(a.times(a),c);return p.precision=m,t==null?(hn=!0,Qt(a,m)):a}a=o}}function In(e){for(var t=e.e*sn,n=e.d[0];n>=10;n/=10)t++;return t}function uj(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(Xi+"LN10 precision limit exceeded");return Qt(new e(e.LN10),t)}function xo(e){for(var t="";e--;)t+="0";return t}function _h(e,t){var n,r,i,a,o,c,d,f,p,m=1,y=10,v=e,S=v.d,b=v.constructor,j=b.precision;if(v.s<1)throw Error(Xi+(v.s?"NaN":"-Infinity"));if(v.eq(ji))return new b(0);if(t==null?(hn=!1,f=j):f=t,v.eq(10))return t==null&&(hn=!0),uj(b,f);if(f+=y,b.precision=f,n=Ba(S),r=n.charAt(0),a=In(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Ba(v.d),r=n.charAt(0),m++;a=In(v),r>1?(v=new b("0."+n),a++):v=new b(r+"."+n.slice(1))}else return d=uj(b,f+2,j).times(a+""),v=_h(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=j,t==null?(hn=!0,Qt(v,j)):v;for(c=o=v=As(v.minus(ji),v.plus(ji),f),p=Qt(v.times(v),f),i=3;;){if(o=Qt(o.times(p),f),d=c.plus(As(o,new b(i),f)),Ba(d.d).slice(0,f)===Ba(c.d).slice(0,f))return c=c.times(2),a!==0&&(c=c.plus(uj(b,f+2,j).times(a+""))),c=As(c,new b(m),f),b.precision=j,t==null?(hn=!0,Qt(c,j)):c;c=d,i+=2}}function gM(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=wd(n/sn),e.d=[],r=(n+1)%sn,n<0&&(r+=sn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=sn;r<i;)e.d.push(+t.slice(r,r+=sn));t=t.slice(r),r=sn-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),hn&&(e.e>Uy||e.e<-Uy))throw Error(zC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Qt(e,t,n){var r,i,a,o,c,d,f,p,m=e.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=sn,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/sn),a=m.length,p>=a)return e;for(f=a=m[p],o=1;a>=10;a/=10)o++;r%=sn,i=r-sn+o}if(n!==void 0&&(a=Nl(10,o-i-1),c=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?i>0?f/Nl(10,o-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=In(e),m.length=1,t=t-a-1,m[0]=Nl(10,(sn-t%sn)%sn),e.e=wd(-t/sn)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=p,a=1,p--):(m.length=p+1,a=Nl(10,sn-r),m[p]=i>0?(f/Nl(10,o-i)%Nl(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==Jn&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=Jn)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(hn&&(e.e>Uy||e.e<-Uy))throw Error(zC+In(e));return e}function AU(e,t){var n,r,i,a,o,c,d,f,p,m,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),hn?Qt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),o=f-r,o){for(p=o<0,p?(n=d,o=-o,c=m.length):(n=m,r=f,c=d.length),i=Math.max(Math.ceil(v/sn),c)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=d.length,c=m.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}o=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),c=d.length,i=m.length-c;i>0;--i)d[c++]=0;for(i=m.length;i>o;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Jn-1;--d[a],d[i]+=Jn}d[i]-=m[i]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,hn?Qt(t,v):t):new y(0)}function nc(e,t,n){var r,i=In(e),a=Ba(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+xo(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+xo(-i-1)+a,n&&(r=n-o)>0&&(a+=xo(r))):i>=o?(a+=xo(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+xo(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=xo(r))),e.s<0?"-"+a:a}function yM(e,t){if(e.length>t)return e.length=t,!0}function OU(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Bl+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return gM(o,a.toString())}else if(typeof a!="string")throw Error(Bl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Rve.test(a))gM(o,a);else throw Error(Bl+a)}if(i.prototype=Me,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=OU,i.config=i.set=Dve,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Dve(e){if(!e||typeof e!="object")throw Error(Xi+"Object expected");var t,n,r,i=["precision",1,bd,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(wd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Bl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Bl+n+": "+r);return this}var TC=OU(Pve);ji=new TC(1);const St=TC;function EU(e){var t;return e===0?t=1:t=Math.floor(new St(e).abs().log(10).toNumber())+1,t}function _U(e,t,n){for(var r=new St(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var zU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},PC=(e,t,n)=>{if(e.lte(0))return new St(0);var r=EU(e.toNumber()),i=new St(10).pow(r),a=e.div(i),o=r!==1?.05:.1,c=new St(Math.ceil(a.div(o).toNumber())).add(n).mul(o),d=c.mul(i);return t?new St(d.toNumber()):new St(Math.ceil(d.toNumber()))},TU=(e,t,n)=>{var r;if(e.lte(0))return new St(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new St(a).abs().log(10).toNumber()),c=new St(10).pow(o),d=e.div(c).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(c=c.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,c=c.mul(new St(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new St(m).mul(c);return t?y:new St(Math.ceil(y.toNumber()))},Mve=(e,t,n)=>{var r=new St(1),i=new St(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new St(10).pow(EU(e)-1),i=new St(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new St(Math.floor(e)))}else e===0?i=new St(Math.floor((t-1)/2)):n||(i=new St(Math.floor(e)));for(var o=Math.floor((t-1)/2),c=[],d=0;d<t;d++)c.push(i.add(new St(d-o).mul(r)).toNumber());return c},PU=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:PC;if(!Number.isFinite((n-t)/(r-1)))return{step:new St(0),tickMin:new St(0),tickMax:new St(0)};var c=o(new St(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new St(0):(d=new St(t).add(n).div(2),d=d.sub(new St(d).mod(c)));var f=Math.ceil(d.sub(t).div(c).toNumber()),p=Math.ceil(new St(n).sub(d).div(c).toNumber()),m=f+p+1;return m>r?PU(t,n,r,i,a+1,o):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:c,tickMin:d.sub(new St(f).mul(c)),tickMax:d.add(new St(p).mul(c))})},vM=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(i,2),[d,f]=zU([n,r]);if(d===-1/0||f===1/0){var p=f===1/0?[d,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),f];return n>r?p.reverse():p}if(d===f)return Mve(d,i,a);var m=o==="snap125"?TU:PC,{step:y,tickMin:v,tickMax:S}=PU(d,f,c,a,0,m),b=_U(v,S.add(new St(.1).mul(y)),y);return n>r?b.reverse():b},xM=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[c,d]=zU([r,i]);if(c===-1/0||d===1/0)return[r,i];if(c===d)return[c];var f=o==="snap125"?TU:PC,p=Math.max(n,2),m=f(new St(d).sub(c).div(p-1),a,0),y=[..._U(new St(c),new St(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},RU=e=>e.rootProps.maxBarSize,Ive=e=>e.rootProps.barGap,DU=e=>e.rootProps.barCategoryGap,Lve=e=>e.rootProps.barSize,O0=e=>e.rootProps.stackOffset,MU=e=>e.rootProps.reverseStackOrder,RC=e=>e.options.chartName,DC=e=>e.rootProps.syncId,IU=e=>e.rootProps.syncMethod,MC=e=>e.options.eventEmitter,$ve=e=>e.rootProps.baseValue,er={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},gl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Ta={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},E0=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function _0(e,t,n){if(n!=="auto")return n;if(e!=null)return Wa(e,t)?"category":"number"}function bM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bM(Object(n),!0).forEach(function(r){Bve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bve(e,t,n){return(t=Uve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uve(e){var t=qve(e,"string");return typeof t=="symbol"?t:t+""}function qve(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wM={allowDataOverflow:gl.allowDataOverflow,allowDecimals:gl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:gl.angleAxisId,includeHidden:!1,name:void 0,reversed:gl.reversed,scale:gl.scale,tick:gl.tick,tickCount:void 0,ticks:void 0,type:gl.type,unit:void 0,niceTicks:"auto"},SM={allowDataOverflow:Ta.allowDataOverflow,allowDecimals:Ta.allowDecimals,allowDuplicatedCategory:Ta.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Ta.radiusAxisId,includeHidden:Ta.includeHidden,name:void 0,reversed:Ta.reversed,scale:Ta.scale,tick:Ta.tick,tickCount:Ta.tickCount,ticks:void 0,type:Ta.type,unit:void 0,niceTicks:"auto"},Fve=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},IC=se([Fve,nU],(e,t)=>{var n;if(e!=null)return e;var r=(n=_0(t,"angleAxis",wM.type))!==null&&n!==void 0?n:"category";return qy(qy({},wM),{},{type:r})}),Hve=(e,t)=>e.polarAxis.radiusAxis[t],LC=se([Hve,nU],(e,t)=>{var n;if(e!=null)return e;var r=(n=_0(t,"radiusAxis",SM.type))!==null&&n!==void 0?n:"category";return qy(qy({},SM),{},{type:r})}),z0=e=>e.polarOptions,$C=se([Ms,Is,tr],mve),LU=se([z0,$C],(e,t)=>{if(e!=null)return va(e.innerRadius,t,0)}),$U=se([z0,$C],(e,t)=>{if(e!=null)return va(e.outerRadius,t,t*.8)}),Kve=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},BU=se([z0],Kve);se([IC,BU],E0);var UU=se([$C,LU,$U],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});se([LC,UU],E0);var qU=se([Lt,z0,LU,$U,Ms,Is],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:c,startAngle:d,endAngle:f}=t;return{cx:va(o,i,i/2),cy:va(c,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),nr=(e,t)=>t,T0=(e,t,n)=>n;function P0(e){return e?.id}function FU(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(c=>{var d,f=(d=c.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=P0(c);f.forEach((m,y)=>{var v=a==null||i?y:String(En(m,a,null)),S=En(m,c.dataKey,0),b;o.has(v)?b=o.get(v):b={},Object.assign(b,{[p]:S}),o.set(v,b)})}}),Array.from(o.values())}function R0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var D0=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function M0(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function Gve(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var rr=e=>{var t=Lt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Sd=e=>e.tooltip.settings.axisId;function BC(e){if(e!=null){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],c=i[1];return o<=c?a>=o&&a<=c:a>=c&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var c=e(a);if(c!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var d=e.bandwidth();switch(o.position){case"middle":c+=d/2;break;case"end":c+=d;break}}return c}}}}}var Vve=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Ua(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];ft(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Po(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Qve(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function UC(e){let t,n,r;e.length!==2?(t=Po,n=(c,d)=>Po(e(c),d),r=(c,d)=>e(c)-d):(t=e===Po||e===Qve?e:Yve,n=e,r=e);function i(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function o(c,d,f=0,p=c.length){const m=i(c,d,f,p-1);return m>f&&r(c[m-1],d)>-r(c[m],d)?m-1:m}return{left:i,center:o,right:a}}function Yve(){return 0}function HU(e){return e===null?NaN:+e}function*Wve(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const Zve=UC(Po),rp=Zve.right;UC(HU).center;class jM extends Map{constructor(t,n=e0e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(NM(this,t))}has(t){return super.has(NM(this,t))}set(t,n){return super.set(Xve(this,t),n)}delete(t){return super.delete(Jve(this,t))}}function NM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Xve({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Jve({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function e0e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function t0e(e=Po){if(e===Po)return KU;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function KU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const n0e=Math.sqrt(50),r0e=Math.sqrt(10),i0e=Math.sqrt(2);function Fy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=n0e?10:a>=r0e?5:a>=i0e?2:1;let c,d,f;return i<0?(f=Math.pow(10,-i)/o,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*o,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Fy(e,t,n*2):[c,d,f]}function sN(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,o]=r?Fy(t,e,n):Fy(e,t,n);if(!(a>=i))return[];const c=a-i+1,d=new Array(c);if(r)if(o<0)for(let f=0;f<c;++f)d[f]=(a-f)/-o;else for(let f=0;f<c;++f)d[f]=(a-f)*o;else if(o<0)for(let f=0;f<c;++f)d[f]=(i+f)/-o;else for(let f=0;f<c;++f)d[f]=(i+f)*o;return d}function oN(e,t,n){return t=+t,e=+e,n=+n,Fy(e,t,n)[2]}function lN(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?oN(t,e,n):oN(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function kM(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function CM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function GU(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?KU:t0e(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+y)),S=Math.min(r,Math.floor(t+(d-f)*m/d+y));GU(e,t,v,S,i)}const a=e[t];let o=n,c=r;for(Lf(e,n,t),i(e[r],a)>0&&Lf(e,n,r);o<c;){for(Lf(e,o,c),++o,--c;i(e[o],a)<0;)++o;for(;i(e[c],a)>0;)--c}i(e[n],a)===0?Lf(e,n,c):(++c,Lf(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Lf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function a0e(e,t,n){if(e=Float64Array.from(Wve(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return CM(e);if(t>=1)return kM(e);var r,i=(r-1)*t,a=Math.floor(i),o=kM(GU(e,a).subarray(0,a+1)),c=CM(e.subarray(a+1));return o+(c-o)*(i-a)}}function s0e(e,t,n=HU){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),c=+n(e[a+1],a+1,e);return o+(c-o)*(i-a)}}function o0e(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function na(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ls(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const cN=Symbol("implicit");function qC(){var e=new jM,t=[],n=[],r=cN;function i(a){let o=e.get(a);if(o===void 0){if(r!==cN)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new jM;for(const o of a)e.has(o)||e.set(o,t.push(o)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return qC(t,n).unknown(r)},na.apply(i,arguments),i}function FC(){var e=qC().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,c=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,S=v?i:r,b=v?r:i;a=(b-S)/Math.max(1,y-d+f*2),c&&(a=Math.floor(a)),S+=(b-S-a*(y-d))*p,o=a*(1-d),c&&(S=Math.round(S),o=Math.round(o));var j=o0e(y).map(function(k){return S+a*k});return n(v?j.reverse():j)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,c=!0,m()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(y){return arguments.length?(c=!!y,m()):c},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),m()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),m()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,m()):f},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return FC(t(),[r,i]).round(c).paddingInner(d).paddingOuter(f).align(p)},na.apply(m(),arguments)}function VU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return VU(t())},e}function l0e(){return VU(FC.apply(null,arguments).paddingInner(1))}function HC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function QU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ip(){}var zh=.7,Hy=1/zh,Lu="\\s*([+-]?\\d+)\\s*",Th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c0e=/^#([0-9a-f]{3,8})$/,u0e=new RegExp(`^rgb\\(${Lu},${Lu},${Lu}\\)$`),d0e=new RegExp(`^rgb\\(${qa},${qa},${qa}\\)$`),f0e=new RegExp(`^rgba\\(${Lu},${Lu},${Lu},${Th}\\)$`),h0e=new RegExp(`^rgba\\(${qa},${qa},${qa},${Th}\\)$`),p0e=new RegExp(`^hsl\\(${Th},${qa},${qa}\\)$`),m0e=new RegExp(`^hsla\\(${Th},${qa},${qa},${Th}\\)$`),AM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};HC(ip,Ph,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:OM,formatHex:OM,formatHex8:g0e,formatHsl:y0e,formatRgb:EM,toString:EM});function OM(){return this.rgb().formatHex()}function g0e(){return this.rgb().formatHex8()}function y0e(){return YU(this).formatHsl()}function EM(){return this.rgb().formatRgb()}function Ph(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=c0e.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?_M(t):n===3?new ai(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?cg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?cg(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=u0e.exec(e))?new ai(t[1],t[2],t[3],1):(t=d0e.exec(e))?new ai(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=f0e.exec(e))?cg(t[1],t[2],t[3],t[4]):(t=h0e.exec(e))?cg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=p0e.exec(e))?PM(t[1],t[2]/100,t[3]/100,1):(t=m0e.exec(e))?PM(t[1],t[2]/100,t[3]/100,t[4]):AM.hasOwnProperty(e)?_M(AM[e]):e==="transparent"?new ai(NaN,NaN,NaN,0):null}function _M(e){return new ai(e>>16&255,e>>8&255,e&255,1)}function cg(e,t,n,r){return r<=0&&(e=t=n=NaN),new ai(e,t,n,r)}function v0e(e){return e instanceof ip||(e=Ph(e)),e?(e=e.rgb(),new ai(e.r,e.g,e.b,e.opacity)):new ai}function uN(e,t,n,r){return arguments.length===1?v0e(e):new ai(e,t,n,r??1)}function ai(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}HC(ai,uN,QU(ip,{brighter(e){return e=e==null?Hy:Math.pow(Hy,e),new ai(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zh:Math.pow(zh,e),new ai(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ai(Ul(this.r),Ul(this.g),Ul(this.b),Ky(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zM,formatHex:zM,formatHex8:x0e,formatRgb:TM,toString:TM}));function zM(){return`#${Tl(this.r)}${Tl(this.g)}${Tl(this.b)}`}function x0e(){return`#${Tl(this.r)}${Tl(this.g)}${Tl(this.b)}${Tl((isNaN(this.opacity)?1:this.opacity)*255)}`}function TM(){const e=Ky(this.opacity);return`${e===1?"rgb(":"rgba("}${Ul(this.r)}, ${Ul(this.g)}, ${Ul(this.b)}${e===1?")":`, ${e})`}`}function Ky(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ul(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tl(e){return e=Ul(e),(e<16?"0":"")+e.toString(16)}function PM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ga(e,t,n,r)}function YU(e){if(e instanceof ga)return new ga(e.h,e.s,e.l,e.opacity);if(e instanceof ip||(e=Ph(e)),!e)return new ga;if(e instanceof ga)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,c=a-i,d=(a+i)/2;return c?(t===a?o=(n-r)/c+(n<r)*6:n===a?o=(r-t)/c+2:o=(t-n)/c+4,c/=d<.5?a+i:2-a-i,o*=60):c=d>0&&d<1?0:o,new ga(o,c,d,e.opacity)}function b0e(e,t,n,r){return arguments.length===1?YU(e):new ga(e,t,n,r??1)}function ga(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}HC(ga,b0e,QU(ip,{brighter(e){return e=e==null?Hy:Math.pow(Hy,e),new ga(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zh:Math.pow(zh,e),new ga(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ai(dj(e>=240?e-240:e+120,i,r),dj(e,i,r),dj(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ga(RM(this.h),ug(this.s),ug(this.l),Ky(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ky(this.opacity);return`${e===1?"hsl(":"hsla("}${RM(this.h)}, ${ug(this.s)*100}%, ${ug(this.l)*100}%${e===1?")":`, ${e})`}`}}));function RM(e){return e=(e||0)%360,e<0?e+360:e}function ug(e){return Math.max(0,Math.min(1,e||0))}function dj(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const KC=e=>()=>e;function w0e(e,t){return function(n){return e+n*t}}function S0e(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function j0e(e){return(e=+e)==1?WU:function(t,n){return n-t?S0e(t,n,e):KC(isNaN(t)?n:t)}}function WU(e,t){var n=t-e;return n?w0e(e,n):KC(isNaN(e)?t:e)}const DM=(function e(t){var n=j0e(t);function r(i,a){var o=n((i=uN(i)).r,(a=uN(a)).r),c=n(i.g,a.g),d=n(i.b,a.b),f=WU(i.opacity,a.opacity);return function(p){return i.r=o(p),i.g=c(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function N0e(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function k0e(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function C0e(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),o;for(o=0;o<r;++o)i[o]=jd(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(c){for(o=0;o<r;++o)a[o]=i[o](c);return a}}function A0e(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Gy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function O0e(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=jd(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var dN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fj=new RegExp(dN.source,"g");function E0e(e){return function(){return e}}function _0e(e){return function(t){return e(t)+""}}function z0e(e,t){var n=dN.lastIndex=fj.lastIndex=0,r,i,a,o=-1,c=[],d=[];for(e=e+"",t=t+"";(r=dN.exec(e))&&(i=fj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),c[o]?c[o]+=a:c[++o]=a),(r=r[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,d.push({i:o,x:Gy(r,i)})),n=fj.lastIndex;return n<t.length&&(a=t.slice(n),c[o]?c[o]+=a:c[++o]=a),c.length<2?d[0]?_0e(d[0].x):E0e(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)c[(m=d[p]).i]=m.x(f);return c.join("")})}function jd(e,t){var n=typeof t,r;return t==null||n==="boolean"?KC(t):(n==="number"?Gy:n==="string"?(r=Ph(t))?(t=r,DM):z0e:t instanceof Ph?DM:t instanceof Date?A0e:k0e(t)?N0e:Array.isArray(t)?C0e:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?O0e:Gy)(e,t)}function GC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function T0e(e,t){t===void 0&&(t=e,e=jd);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(o){var c=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[c](o-c)}}function P0e(e){return function(){return e}}function Vy(e){return+e}var MM=[0,1];function Br(e){return e}function fN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:P0e(isNaN(t)?NaN:.5)}function R0e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function D0e(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=fN(i,r),a=n(o,a)):(r=fN(r,i),a=n(a,o)),function(c){return a(r(c))}}function M0e(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=fN(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(c){var d=rp(e,c,1,r)-1;return a[d](i[d](c))}}function ap(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function I0(){var e=MM,t=MM,n=jd,r,i,a,o=Br,c,d,f;function p(){var y=Math.min(e.length,t.length);return o!==Br&&(o=R0e(e[0],e[y-1])),c=y>2?M0e:D0e,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=c(e.map(r),t,n)))(r(o(y)))}return m.invert=function(y){return o(i((f||(f=c(t,e.map(r),Gy)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,Vy),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=GC,p()},m.clamp=function(y){return arguments.length?(o=y?!0:Br,p()):o!==Br},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,v){return r=y,i=v,p()}}function VC(){return I0()(Br,Br)}function I0e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qy(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function td(e){return e=Qy(Math.abs(e)),e?e[1]:NaN}function L0e(e,t){return function(n,r){for(var i=n.length,a=[],o=0,c=e[0],d=0;i>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),a.push(n.substring(i-=c,i+c)),!((d+=c+1)>r));)c=e[o=(o+1)%e.length];return a.reverse().join(t)}}function $0e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var B0e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rh(e){if(!(t=B0e.exec(e)))throw new Error("invalid format: "+e);var t;return new QC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Rh.prototype=QC.prototype;function QC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}QC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function U0e(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Yy;function q0e(e,t){var n=Qy(e,t);if(!n)return Yy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Yy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Qy(e,Math.max(0,t+a-1))[0]}function IM(e,t){var n=Qy(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const LM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:I0e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>IM(e*100,t),r:IM,s:q0e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $M(e){return e}var BM=Array.prototype.map,UM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function F0e(e){var t=e.grouping===void 0||e.thousands===void 0?$M:L0e(BM.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?$M:$0e(BM.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=Rh(m);var v=m.fill,S=m.align,b=m.sign,j=m.symbol,k=m.zero,E=m.width,C=m.comma,O=m.precision,z=m.trim,A=m.type;A==="n"?(C=!0,A="g"):LM[A]||(O===void 0&&(O=12),z=!0,A="g"),(k||v==="0"&&S==="=")&&(k=!0,v="0",S="=");var _=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),R=(j==="$"?r:/[%p]/.test(A)?o:"")+(y&&y.suffix!==void 0?y.suffix:""),$=LM[A],F=/[defgprs%]/.test(A);O=O===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function q(B){var V=_,X=R,Z,H,J;if(A==="c")X=$(B)+X,B="";else{B=+B;var ue=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),O),z&&(B=U0e(B)),ue&&+B==0&&b!=="+"&&(ue=!1),V=(ue?b==="("?b:c:b==="-"||b==="("?"":b)+V,X=(A==="s"&&!isNaN(B)&&Yy!==void 0?UM[8+Yy/3]:"")+X+(ue&&b==="("?")":""),F){for(Z=-1,H=B.length;++Z<H;)if(J=B.charCodeAt(Z),48>J||J>57){X=(J===46?i+B.slice(Z+1):B.slice(Z))+X,B=B.slice(0,Z);break}}}C&&!k&&(B=t(B,1/0));var we=V.length+B.length+X.length,I=we<E?new Array(E-we+1).join(v):"";switch(C&&k&&(B=t(I+B,I.length?E-X.length:1/0),I=""),S){case"<":B=V+B+X+I;break;case"=":B=V+I+B+X;break;case"^":B=I.slice(0,we=I.length>>1)+V+B+X+I.slice(we);break;default:B=I+V+B+X;break}return a(B)}return q.toString=function(){return m+""},q}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(td(y)/3)))*3,S=Math.pow(10,-v),b=f((m=Rh(m),m.type="f",m),{suffix:UM[8+v/3]});return function(j){return b(S*j)}}return{format:f,formatPrefix:p}}var dg,YC,ZU;H0e({thousands:",",grouping:[3],currency:["$",""]});function H0e(e){return dg=F0e(e),YC=dg.format,ZU=dg.formatPrefix,dg}function K0e(e){return Math.max(0,-td(Math.abs(e)))}function G0e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(td(t)/3)))*3-td(Math.abs(e)))}function V0e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,td(t)-td(e))+1}function XU(e,t,n,r){var i=lN(e,t,n),a;switch(r=Rh(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=G0e(i,o))&&(r.precision=a),ZU(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=V0e(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=K0e(i))&&(r.precision=a-(r.type==="%")*2);break}}return YC(r)}function Vo(e){var t=e.domain;return e.ticks=function(n){var r=t();return sN(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return XU(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],c=r[a],d,f,p=10;for(c<o&&(f=o,o=c,c=f,f=i,i=a,a=f);p-- >0;){if(f=oN(o,c,n),f===d)return r[i]=o,r[a]=c,t(r);if(f>0)o=Math.floor(o/f)*f,c=Math.ceil(c/f)*f;else if(f<0)o=Math.ceil(o*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function JU(){var e=VC();return e.copy=function(){return ap(e,JU())},na.apply(e,arguments),Vo(e)}function eq(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,Vy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return eq(e).unknown(t)},e=arguments.length?Array.from(e,Vy):[0,1],Vo(n)}function tq(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function qM(e){return Math.log(e)}function FM(e){return Math.exp(e)}function Q0e(e){return-Math.log(-e)}function Y0e(e){return-Math.exp(-e)}function W0e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function Z0e(e){return e===10?W0e:e===Math.E?Math.exp:t=>Math.pow(e,t)}function X0e(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function HM(e){return(t,n)=>-e(-t,n)}function WC(e){const t=e(qM,FM),n=t.domain;let r=10,i,a;function o(){return i=X0e(r),a=Z0e(r),n()[0]<0?(i=HM(i),a=HM(a),e(Q0e,Y0e)):e(qM,FM),t}return t.base=function(c){return arguments.length?(r=+c,o()):r},t.domain=function(c){return arguments.length?(n(c),o()):n()},t.ticks=c=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let y=i(f),v=i(p),S,b;const j=c==null?10:+c;let k=[];if(!(r%1)&&v-y<j){if(y=Math.floor(y),v=Math.ceil(v),f>0){for(;y<=v;++y)for(S=1;S<r;++S)if(b=y<0?S/a(-y):S*a(y),!(b<f)){if(b>p)break;k.push(b)}}else for(;y<=v;++y)for(S=r-1;S>=1;--S)if(b=y>0?S/a(-y):S*a(y),!(b<f)){if(b>p)break;k.push(b)}k.length*2<j&&(k=sN(f,p,j))}else k=sN(y,v,Math.min(v-y,j)).map(a);return m?k.reverse():k},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Rh(d)).precision==null&&(d.trim=!0),d=YC(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(tq(n(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),t}function nq(){const e=WC(I0()).domain([1,10]);return e.copy=()=>ap(e,nq()).base(e.base()),na.apply(e,arguments),e}function KM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function GM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ZC(e){var t=1,n=e(KM(t),GM(t));return n.constant=function(r){return arguments.length?e(KM(t=+r),GM(t)):t},Vo(n)}function rq(){var e=ZC(I0());return e.copy=function(){return ap(e,rq()).constant(e.constant())},na.apply(e,arguments)}function VM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function J0e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function exe(e){return e<0?-e*e:e*e}function XC(e){var t=e(Br,Br),n=1;function r(){return n===1?e(Br,Br):n===.5?e(J0e,exe):e(VM(n),VM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},Vo(t)}function JC(){var e=XC(I0());return e.copy=function(){return ap(e,JC()).exponent(e.exponent())},na.apply(e,arguments),e}function txe(){return JC.apply(null,arguments).exponent(.5)}function QM(e){return Math.sign(e)*e*e}function nxe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function iq(){var e=VC(),t=[0,1],n=!1,r;function i(a){var o=nxe(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(QM(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Vy)).map(QM)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return iq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},na.apply(i,arguments),Vo(i)}function aq(){var e=[],t=[],n=[],r;function i(){var o=0,c=Math.max(1,t.length);for(n=new Array(c-1);++o<c;)n[o-1]=s0e(e,o/c);return a}function a(o){return o==null||isNaN(o=+o)?r:t[rp(n,o)]}return a.invertExtent=function(o){var c=t.indexOf(o);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},a.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let c of o)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Po),i()},a.range=function(o){return arguments.length?(t=Array.from(o),i()):t.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return aq().domain(e).range(t).unknown(r)},na.apply(a,arguments)}function sq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(d){return d!=null&&d<=d?i[rp(r,d,0,n)]:a}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return o}return o.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},o.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,c()):i.slice()},o.invertExtent=function(d){var f=i.indexOf(d);return f<0?[NaN,NaN]:f<1?[e,r[0]]:f>=n?[r[n-1],t]:[r[f-1],r[f]]},o.unknown=function(d){return arguments.length&&(a=d),o},o.thresholds=function(){return r.slice()},o.copy=function(){return sq().domain([e,t]).range(i).unknown(a)},na.apply(Vo(o),arguments)}function oq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[rp(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return oq().domain(e).range(t).unknown(n)},na.apply(i,arguments)}const hj=new Date,pj=new Date;function Gn(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),c=i.ceil(a);return a-o<c-a?o:c},i.offset=(a,o)=>(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,c)=>{const d=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<o)||!(c>0))return d;let f;do d.push(f=new Date(+a)),t(a,c),e(a);while(f<a&&a<o);return d},i.filter=a=>Gn(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,c)=>{if(o>=o)if(c<0)for(;++c<=0;)for(;t(o,-1),!a(o););else for(;--c>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(hj.setTime(+a),pj.setTime(+o),e(hj),e(pj),Math.floor(n(hj,pj))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Wy=Gn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Wy.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Gn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Wy);Wy.range;const Ns=1e3,Qi=Ns*60,ks=Qi*60,zs=ks*24,eA=zs*7,YM=zs*30,mj=zs*365,Pl=Gn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getUTCSeconds());Pl.range;const tA=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ns)},(e,t)=>{e.setTime(+e+t*Qi)},(e,t)=>(t-e)/Qi,e=>e.getMinutes());tA.range;const nA=Gn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Qi)},(e,t)=>(t-e)/Qi,e=>e.getUTCMinutes());nA.range;const rA=Gn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ns-e.getMinutes()*Qi)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getHours());rA.range;const iA=Gn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getUTCHours());iA.range;const sp=Gn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Qi)/zs,e=>e.getDate()-1);sp.range;const L0=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/zs,e=>e.getUTCDate()-1);L0.range;const lq=Gn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/zs,e=>Math.floor(e/zs));lq.range;function yc(e){return Gn(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Qi)/eA)}const $0=yc(0),Zy=yc(1),rxe=yc(2),ixe=yc(3),nd=yc(4),axe=yc(5),sxe=yc(6);$0.range;Zy.range;rxe.range;ixe.range;nd.range;axe.range;sxe.range;function vc(e){return Gn(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/eA)}const B0=vc(0),Xy=vc(1),oxe=vc(2),lxe=vc(3),rd=vc(4),cxe=vc(5),uxe=vc(6);B0.range;Xy.range;oxe.range;lxe.range;rd.range;cxe.range;uxe.range;const aA=Gn(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());aA.range;const sA=Gn(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());sA.range;const Ts=Gn(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ts.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});Ts.range;const Ps=Gn(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ps.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Gn(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Ps.range;function cq(e,t,n,r,i,a){const o=[[Pl,1,Ns],[Pl,5,5*Ns],[Pl,15,15*Ns],[Pl,30,30*Ns],[a,1,Qi],[a,5,5*Qi],[a,15,15*Qi],[a,30,30*Qi],[i,1,ks],[i,3,3*ks],[i,6,6*ks],[i,12,12*ks],[r,1,zs],[r,2,2*zs],[n,1,eA],[t,1,YM],[t,3,3*YM],[e,1,mj]];function c(f,p,m){const y=p<f;y&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),S=v?v.range(f,+p+1):[];return y?S.reverse():S}function d(f,p,m){const y=Math.abs(p-f)/m,v=UC(([,,j])=>j).right(o,y);if(v===o.length)return e.every(lN(f/mj,p/mj,m));if(v===0)return Wy.every(Math.max(lN(f,p,m),1));const[S,b]=o[y/o[v-1][2]<o[v][2]/y?v-1:v];return S.every(b)}return[c,d]}const[dxe,fxe]=cq(Ps,sA,B0,lq,iA,nA),[hxe,pxe]=cq(Ts,aA,$0,sp,rA,tA);function gj(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function yj(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function $f(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function mxe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,c=e.months,d=e.shortMonths,f=Bf(i),p=Uf(i),m=Bf(a),y=Uf(a),v=Bf(o),S=Uf(o),b=Bf(c),j=Uf(c),k=Bf(d),E=Uf(d),C={a:J,A:ue,b:we,B:I,c:null,d:tI,e:tI,f:Lxe,g:Qxe,G:Wxe,H:Dxe,I:Mxe,j:Ixe,L:uq,m:$xe,M:Bxe,p:D,q:U,Q:iI,s:aI,S:Uxe,u:qxe,U:Fxe,V:Hxe,w:Kxe,W:Gxe,x:null,X:null,y:Vxe,Y:Yxe,Z:Zxe,"%":rI},O={a:M,A:Q,b:oe,B:ne,c:null,d:nI,e:nI,f:tbe,g:dbe,G:hbe,H:Xxe,I:Jxe,j:ebe,L:fq,m:nbe,M:rbe,p:Ae,q:_e,Q:iI,s:aI,S:ibe,u:abe,U:sbe,V:obe,w:lbe,W:cbe,x:null,X:null,y:ube,Y:fbe,Z:pbe,"%":rI},z={a:F,A:q,b:B,B:V,c:X,d:JM,e:JM,f:zxe,g:XM,G:ZM,H:eI,I:eI,j:Axe,L:_xe,m:Cxe,M:Oxe,p:$,q:kxe,Q:Pxe,s:Rxe,S:Exe,u:bxe,U:wxe,V:Sxe,w:xxe,W:jxe,x:Z,X:H,y:XM,Y:ZM,Z:Nxe,"%":Txe};C.x=A(n,C),C.X=A(r,C),C.c=A(t,C),O.x=A(n,O),O.X=A(r,O),O.c=A(t,O);function A(ee,he){return function(Ee){var G=[],Fe=-1,De=0,rt=ee.length,Qe,en,Ut;for(Ee instanceof Date||(Ee=new Date(+Ee));++Fe<rt;)ee.charCodeAt(Fe)===37&&(G.push(ee.slice(De,Fe)),(en=WM[Qe=ee.charAt(++Fe)])!=null?Qe=ee.charAt(++Fe):en=Qe==="e"?" ":"0",(Ut=he[Qe])&&(Qe=Ut(Ee,en)),G.push(Qe),De=Fe+1);return G.push(ee.slice(De,Fe)),G.join("")}}function _(ee,he){return function(Ee){var G=$f(1900,void 0,1),Fe=R(G,ee,Ee+="",0),De,rt;if(Fe!=Ee.length)return null;if("Q"in G)return new Date(G.Q);if("s"in G)return new Date(G.s*1e3+("L"in G?G.L:0));if(he&&!("Z"in G)&&(G.Z=0),"p"in G&&(G.H=G.H%12+G.p*12),G.m===void 0&&(G.m="q"in G?G.q:0),"V"in G){if(G.V<1||G.V>53)return null;"w"in G||(G.w=1),"Z"in G?(De=yj($f(G.y,0,1)),rt=De.getUTCDay(),De=rt>4||rt===0?Xy.ceil(De):Xy(De),De=L0.offset(De,(G.V-1)*7),G.y=De.getUTCFullYear(),G.m=De.getUTCMonth(),G.d=De.getUTCDate()+(G.w+6)%7):(De=gj($f(G.y,0,1)),rt=De.getDay(),De=rt>4||rt===0?Zy.ceil(De):Zy(De),De=sp.offset(De,(G.V-1)*7),G.y=De.getFullYear(),G.m=De.getMonth(),G.d=De.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),rt="Z"in G?yj($f(G.y,0,1)).getUTCDay():gj($f(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(rt+5)%7:G.w+G.U*7-(rt+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,yj(G)):gj(G)}}function R(ee,he,Ee,G){for(var Fe=0,De=he.length,rt=Ee.length,Qe,en;Fe<De;){if(G>=rt)return-1;if(Qe=he.charCodeAt(Fe++),Qe===37){if(Qe=he.charAt(Fe++),en=z[Qe in WM?he.charAt(Fe++):Qe],!en||(G=en(ee,Ee,G))<0)return-1}else if(Qe!=Ee.charCodeAt(G++))return-1}return G}function $(ee,he,Ee){var G=f.exec(he.slice(Ee));return G?(ee.p=p.get(G[0].toLowerCase()),Ee+G[0].length):-1}function F(ee,he,Ee){var G=v.exec(he.slice(Ee));return G?(ee.w=S.get(G[0].toLowerCase()),Ee+G[0].length):-1}function q(ee,he,Ee){var G=m.exec(he.slice(Ee));return G?(ee.w=y.get(G[0].toLowerCase()),Ee+G[0].length):-1}function B(ee,he,Ee){var G=k.exec(he.slice(Ee));return G?(ee.m=E.get(G[0].toLowerCase()),Ee+G[0].length):-1}function V(ee,he,Ee){var G=b.exec(he.slice(Ee));return G?(ee.m=j.get(G[0].toLowerCase()),Ee+G[0].length):-1}function X(ee,he,Ee){return R(ee,t,he,Ee)}function Z(ee,he,Ee){return R(ee,n,he,Ee)}function H(ee,he,Ee){return R(ee,r,he,Ee)}function J(ee){return o[ee.getDay()]}function ue(ee){return a[ee.getDay()]}function we(ee){return d[ee.getMonth()]}function I(ee){return c[ee.getMonth()]}function D(ee){return i[+(ee.getHours()>=12)]}function U(ee){return 1+~~(ee.getMonth()/3)}function M(ee){return o[ee.getUTCDay()]}function Q(ee){return a[ee.getUTCDay()]}function oe(ee){return d[ee.getUTCMonth()]}function ne(ee){return c[ee.getUTCMonth()]}function Ae(ee){return i[+(ee.getUTCHours()>=12)]}function _e(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var he=A(ee+="",C);return he.toString=function(){return ee},he},parse:function(ee){var he=_(ee+="",!1);return he.toString=function(){return ee},he},utcFormat:function(ee){var he=A(ee+="",O);return he.toString=function(){return ee},he},utcParse:function(ee){var he=_(ee+="",!0);return he.toString=function(){return ee},he}}}var WM={"-":"",_:" ",0:"0"},ir=/^\s*\d+/,gxe=/^%/,yxe=/[\\^$*+?|[\]().{}]/g;function Et(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function vxe(e){return e.replace(yxe,"\\$&")}function Bf(e){return new RegExp("^(?:"+e.map(vxe).join("|")+")","i")}function Uf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function xxe(e,t,n){var r=ir.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function bxe(e,t,n){var r=ir.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function wxe(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Sxe(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function jxe(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ZM(e,t,n){var r=ir.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function XM(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nxe(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function kxe(e,t,n){var r=ir.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Cxe(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JM(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Axe(e,t,n){var r=ir.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function eI(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Oxe(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Exe(e,t,n){var r=ir.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function _xe(e,t,n){var r=ir.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function zxe(e,t,n){var r=ir.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Txe(e,t,n){var r=gxe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Pxe(e,t,n){var r=ir.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Rxe(e,t,n){var r=ir.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tI(e,t){return Et(e.getDate(),t,2)}function Dxe(e,t){return Et(e.getHours(),t,2)}function Mxe(e,t){return Et(e.getHours()%12||12,t,2)}function Ixe(e,t){return Et(1+sp.count(Ts(e),e),t,3)}function uq(e,t){return Et(e.getMilliseconds(),t,3)}function Lxe(e,t){return uq(e,t)+"000"}function $xe(e,t){return Et(e.getMonth()+1,t,2)}function Bxe(e,t){return Et(e.getMinutes(),t,2)}function Uxe(e,t){return Et(e.getSeconds(),t,2)}function qxe(e){var t=e.getDay();return t===0?7:t}function Fxe(e,t){return Et($0.count(Ts(e)-1,e),t,2)}function dq(e){var t=e.getDay();return t>=4||t===0?nd(e):nd.ceil(e)}function Hxe(e,t){return e=dq(e),Et(nd.count(Ts(e),e)+(Ts(e).getDay()===4),t,2)}function Kxe(e){return e.getDay()}function Gxe(e,t){return Et(Zy.count(Ts(e)-1,e),t,2)}function Vxe(e,t){return Et(e.getFullYear()%100,t,2)}function Qxe(e,t){return e=dq(e),Et(e.getFullYear()%100,t,2)}function Yxe(e,t){return Et(e.getFullYear()%1e4,t,4)}function Wxe(e,t){var n=e.getDay();return e=n>=4||n===0?nd(e):nd.ceil(e),Et(e.getFullYear()%1e4,t,4)}function Zxe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function nI(e,t){return Et(e.getUTCDate(),t,2)}function Xxe(e,t){return Et(e.getUTCHours(),t,2)}function Jxe(e,t){return Et(e.getUTCHours()%12||12,t,2)}function ebe(e,t){return Et(1+L0.count(Ps(e),e),t,3)}function fq(e,t){return Et(e.getUTCMilliseconds(),t,3)}function tbe(e,t){return fq(e,t)+"000"}function nbe(e,t){return Et(e.getUTCMonth()+1,t,2)}function rbe(e,t){return Et(e.getUTCMinutes(),t,2)}function ibe(e,t){return Et(e.getUTCSeconds(),t,2)}function abe(e){var t=e.getUTCDay();return t===0?7:t}function sbe(e,t){return Et(B0.count(Ps(e)-1,e),t,2)}function hq(e){var t=e.getUTCDay();return t>=4||t===0?rd(e):rd.ceil(e)}function obe(e,t){return e=hq(e),Et(rd.count(Ps(e),e)+(Ps(e).getUTCDay()===4),t,2)}function lbe(e){return e.getUTCDay()}function cbe(e,t){return Et(Xy.count(Ps(e)-1,e),t,2)}function ube(e,t){return Et(e.getUTCFullYear()%100,t,2)}function dbe(e,t){return e=hq(e),Et(e.getUTCFullYear()%100,t,2)}function fbe(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function hbe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?rd(e):rd.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function pbe(){return"+0000"}function rI(){return"%"}function iI(e){return+e}function aI(e){return Math.floor(+e/1e3)}var du,pq,mq;mbe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function mbe(e){return du=mxe(e),pq=du.format,du.parse,mq=du.utcFormat,du.utcParse,du}function gbe(e){return new Date(e)}function ybe(e){return e instanceof Date?+e:+new Date(+e)}function oA(e,t,n,r,i,a,o,c,d,f){var p=VC(),m=p.invert,y=p.domain,v=f(".%L"),S=f(":%S"),b=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),E=f("%b %d"),C=f("%B"),O=f("%Y");function z(A){return(d(A)<A?v:c(A)<A?S:o(A)<A?b:a(A)<A?j:r(A)<A?i(A)<A?k:E:n(A)<A?C:O)(A)}return p.invert=function(A){return new Date(m(A))},p.domain=function(A){return arguments.length?y(Array.from(A,ybe)):y().map(gbe)},p.ticks=function(A){var _=y();return e(_[0],_[_.length-1],A??10)},p.tickFormat=function(A,_){return _==null?z:f(_)},p.nice=function(A){var _=y();return(!A||typeof A.range!="function")&&(A=t(_[0],_[_.length-1],A??10)),A?y(tq(_,A)):p},p.copy=function(){return ap(p,oA(e,t,n,r,i,a,o,c,d,f))},p}function vbe(){return na.apply(oA(hxe,pxe,Ts,aA,$0,sp,rA,tA,Pl,pq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function xbe(){return na.apply(oA(dxe,fxe,Ps,sA,B0,L0,iA,nA,Pl,mq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function U0(){var e=0,t=1,n,r,i,a,o=Br,c=!1,d;function f(m){return m==null||isNaN(m=+m)?d:o(i===0?.5:(m=(a(m)-n)*i,c?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(c=!!m,f):c},f.interpolator=function(m){return arguments.length?(o=m,f):o};function p(m){return function(y){var v,S;return arguments.length?([v,S]=y,o=m(v,S),f):[o(0),o(1)]}}return f.range=p(jd),f.rangeRound=p(GC),f.unknown=function(m){return arguments.length?(d=m,f):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),f}}function Qo(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function gq(){var e=Vo(U0()(Br));return e.copy=function(){return Qo(e,gq())},Ls.apply(e,arguments)}function yq(){var e=WC(U0()).domain([1,10]);return e.copy=function(){return Qo(e,yq()).base(e.base())},Ls.apply(e,arguments)}function vq(){var e=ZC(U0());return e.copy=function(){return Qo(e,vq()).constant(e.constant())},Ls.apply(e,arguments)}function lA(){var e=XC(U0());return e.copy=function(){return Qo(e,lA()).exponent(e.exponent())},Ls.apply(e,arguments)}function bbe(){return lA.apply(null,arguments).exponent(.5)}function xq(){var e=[],t=Br;function n(r){if(r!=null&&!isNaN(r=+r))return t((rp(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(Po),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>a0e(e,a/r))},n.copy=function(){return xq(t).domain(e)},Ls.apply(n,arguments)}function q0(){var e=0,t=.5,n=1,r=1,i,a,o,c,d,f=Br,p,m=!1,y;function v(b){return isNaN(b=+b)?y:(b=.5+((b=+p(b))-a)*(r*b<r*a?c:d),f(m?Math.max(0,Math.min(1,b)):b))}v.domain=function(b){return arguments.length?([e,t,n]=b,i=p(e=+e),a=p(t=+t),o=p(n=+n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(b){return arguments.length?(m=!!b,v):m},v.interpolator=function(b){return arguments.length?(f=b,v):f};function S(b){return function(j){var k,E,C;return arguments.length?([k,E,C]=j,f=T0e(b,[k,E,C]),v):[f(0),f(.5),f(1)]}}return v.range=S(jd),v.rangeRound=S(GC),v.unknown=function(b){return arguments.length?(y=b,v):y},function(b){return p=b,i=b(e),a=b(t),o=b(n),c=i===a?0:.5/(a-i),d=a===o?0:.5/(o-a),r=a<i?-1:1,v}}function bq(){var e=Vo(q0()(Br));return e.copy=function(){return Qo(e,bq())},Ls.apply(e,arguments)}function wq(){var e=WC(q0()).domain([.1,1,10]);return e.copy=function(){return Qo(e,wq()).base(e.base())},Ls.apply(e,arguments)}function Sq(){var e=ZC(q0());return e.copy=function(){return Qo(e,Sq()).constant(e.constant())},Ls.apply(e,arguments)}function cA(){var e=XC(q0());return e.copy=function(){return Qo(e,cA()).exponent(e.exponent())},Ls.apply(e,arguments)}function wbe(){return cA.apply(null,arguments).exponent(.5)}const jq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:FC,scaleDiverging:bq,scaleDivergingLog:wq,scaleDivergingPow:cA,scaleDivergingSqrt:wbe,scaleDivergingSymlog:Sq,scaleIdentity:eq,scaleImplicit:cN,scaleLinear:JU,scaleLog:nq,scaleOrdinal:qC,scalePoint:l0e,scalePow:JC,scaleQuantile:aq,scaleQuantize:sq,scaleRadial:iq,scaleSequential:gq,scaleSequentialLog:yq,scaleSequentialPow:lA,scaleSequentialQuantile:xq,scaleSequentialSqrt:bbe,scaleSequentialSymlog:vq,scaleSqrt:txe,scaleSymlog:rq,scaleThreshold:oq,scaleTime:vbe,scaleUtc:xbe,tickFormat:XU},Symbol.toStringTag,{value:"Module"}));function Sbe(e){var t=jq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(Wh(e));if(n in t&&typeof t[n]=="function")return t[n]()}function sI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Sbe(e);if(r!=null)return r.domain(t).range(n),r}}function uA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?sI(e.scale,n,r):sI(t,n,r)}function jbe(e){return"scale".concat(Wh(e))}function Nbe(e){return jbe(e)in jq}var Nq=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string")return Nbe(r)?r:"point"}};function kbe(e,t){for(var n=0,r=e.length,i=e[0]<e[e.length-1];n<r;){var a=Math.floor((n+r)/2);(i?e[a]<t:e[a]>t)?n=a+1:r=a}return n}function kq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var o,c,d=kbe(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(o=r[d-1])!==null&&o!==void 0?o:0,p=(c=r[d])!==null&&c!==void 0?c:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function Cbe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):kq(e,void 0)}function oI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Jy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oI(Object(n),!0).forEach(function(r){Abe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Abe(e,t,n){return(t=Obe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Obe(e){var t=Ebe(e,"string");return typeof t=="symbol"?t:t+""}function Ebe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hN=[0,"auto"],Fn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},Cq=(e,t)=>e.cartesianAxis.xAxis[t],$s=(e,t)=>{var n=Cq(e,t);return n??Fn},Hn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:hN,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Jh},Aq=(e,t)=>e.cartesianAxis.yAxis[t],Bs=(e,t)=>{var n=Aq(e,t);return n??Hn},_be={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},dA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??_be},Gr=(e,t,n)=>{switch(t){case"xAxis":return $s(e,n);case"yAxis":return Bs(e,n);case"zAxis":return dA(e,n);case"angleAxis":return IC(e,n);case"radiusAxis":return LC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},zbe=(e,t,n)=>{switch(t){case"xAxis":return $s(e,n);case"yAxis":return Bs(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},op=(e,t,n)=>{switch(t){case"xAxis":return $s(e,n);case"yAxis":return Bs(e,n);case"angleAxis":return IC(e,n);case"radiusAxis":return LC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Oq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Eq(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var F0=e=>e.graphicalItems.cartesianItems,Tbe=se([nr,T0],Eq),_q=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Nd=se([F0,Gr,Tbe],_q,{memoizeOptions:{resultEqualityCheck:M0}}),zq=se([Nd],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(R0)),Tq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Pbe=se([Nd],Tq),Pq=e=>e.map(t=>t.data).filter(Boolean).flat(1),Rbe=se([Nd],e=>e.some(t=>!t.data)),Rq=se([Nd],Pq,{memoizeOptions:{resultEqualityCheck:M0}}),Dq=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},fA=se([Rq,A0],Dq),Dbe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:En(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:En(i,r)}))):e.map(r=>({value:r})),Mq=(e,t,n,r,i,a)=>{var{chartData:o=[],dataStartIndex:c,dataEndIndex:d}=r,f=Dbe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=o.slice(c,d+1),m=p.map(y=>({value:En(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},lp=se([fA,Gr,Nd,A0,Rbe,Rq],Mq);function $u(e){if(Ka(e)||e instanceof Date){var t=Number(e);if(ft(t))return t}}function lI(e){if(Array.isArray(e)){var t=[$u(e[0]),$u(e[1])];return Ua(t)?t:void 0}var n=$u(e);if(n!=null)return[n,n]}function Qa(e){return e.map($u).filter(ii)}function Mbe(e,t){var n=$u(e),r=$u(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Ibe=se([lp],e=>e?.map(t=>t.value).sort(Mbe));function Iq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Lbe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!ya(t))r=t;else if(Array.isArray(t)){var i=Qa(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Qa(n.flatMap(a=>{var o=En(e,a.dataKey),c,d;if(Array.isArray(o)?[c,d]=o:c=d=o,!(!ft(c)||!ft(d)))return[r-c,r+d]}))}var Vn=e=>{var t=rr(e),n=Sd(e);return op(e,t,n)},id=se([Vn],e=>e?.dataKey),$be=se([zq,A0,Vn],FU),Lq=(e,t,n,r)=>{var i={},a=t.reduce((o,c)=>{if(c.stackId==null)return o;var d=o[c.stackId];return d==null&&(d=[]),d.push(c),o[c.stackId]=d,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[c,d]=o,f=r?[...d].reverse():d,p=f.map(P0);return[c,{stackedData:wme(e,p,n),graphicalItems:f}]}))},ev=se([$be,zq,O0,MU],Lq),$q=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=kme(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},Bbe=se([Gr],e=>e.allowDataOverflow),hA=e=>{var t;if(e==null||!("domain"in e))return hN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Qa(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e?.domain)!==null&&t!==void 0?t:hN},Bq=se([Gr],hA),Uq=se([Bq,Bbe],jU),Ube=se([ev,Na,nr,Uq],$q,{memoizeOptions:{resultEqualityCheck:D0}}),pA=e=>e.errorBars,qbe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Iq(n,r)),tv=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),o=Math.min(...a),c=Math.max(...a);return[o,c]}},qq=function(t,n,r,i,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:o,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>Iq(a,v));m.forEach(v=>{var S,b=En(v,(S=n.dataKey)!==null&&S!==void 0?S:f.dataKey),j=Lbe(v,b,y);if(j.length>=2){var k=Math.min(...j),E=Math.max(...j);(c==null||k<c)&&(c=k),(d==null||E>d)&&(d=E)}var C=lI(b);C!=null&&(c=c==null?C[0]:Math.min(c,C[0]),d=d==null?C[1]:Math.max(d,C[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=lI(En(f,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),ft(c)&&ft(d))return[c,d]},Fbe=se([fA,Gr,Pbe,pA,nr,_ve],qq,{memoizeOptions:{resultEqualityCheck:D0}});function Hbe(e){var{value:t}=e;if(Ka(t)||t instanceof Date)return t}var Kbe=(e,t,n)=>{var r=e.map(Hbe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&XB(r))?wU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},Fq=e=>e.referenceElements.dots,kd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Gbe=se([Fq,nr,T0],kd),Hq=e=>e.referenceElements.areas,Vbe=se([Hq,nr,T0],kd),Kq=e=>e.referenceElements.lines,Qbe=se([Kq,nr,T0],kd),Gq=(e,t)=>{if(e!=null){var n=Qa(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Ybe=se(Gbe,nr,Gq),Vq=(e,t)=>{if(e!=null){var n=Qa(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Wbe=se([Vbe,nr],Vq);function Zbe(e){var t;if(e.x!=null)return Qa([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Qa(n)}function Xbe(e){var t;if(e.y!=null)return Qa([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Qa(n)}var Qq=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?Zbe(r):Xbe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Jbe=se([Qbe,nr],Qq),ewe=se(Ybe,Jbe,Wbe,(e,t,n)=>tv(e,n,t)),Yq=(e,t,n,r,i,a,o,c)=>{if(n!=null)return n;var d=o==="vertical"&&c==="xAxis"||o==="horizontal"&&c==="yAxis",f=d?tv(r,a,i):tv(a,i);return Tve(t,f,e.allowDataOverflow)},twe=se([Gr,Bq,Uq,Ube,Fbe,ewe,Lt,nr],Yq,{memoizeOptions:{resultEqualityCheck:D0}}),nwe=[0,1],Wq=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:c,type:d}=e,f=Wa(t,a);if(f&&c==null){var p;return wU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Kbe(r,e,f):i==="expand"&&!f?nwe:o}},mA=se([Gr,Lt,fA,lp,O0,nr,twe],Wq),Cd=se([Gr,Oq,RC],Nq),Zq=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=hA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&Ua(e)){if(a)return vM(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return xM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&Ua(e))return vM(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Ua(e))return xM(e,t.tickCount,t.allowDecimals,"adaptive")}}},gA=se([mA,op,Cd],Zq),Xq=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&Ua(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,c),Math.max(d,f)]}return t},rwe=se([Gr,mA,gA,nr],Xq),iwe=se(lp,Gr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Qa(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var c=0;c<r.length-1;c++){var d=r[c],f=r[c+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/o}}),Jq=se(iwe,Lt,DU,tr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!ft(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=va(n,e*a),c=e*a/2;return c-o-(c-o)/a*o}return 0}),awe=(e,t,n)=>{var r=$s(e,t);return r==null||typeof r.padding!="string"?0:Jq(e,"xAxis",t,n,r.padding)},swe=(e,t,n)=>{var r=Bs(e,t);return r==null||typeof r.padding!="string"?0:Jq(e,"yAxis",t,n,r.padding)},owe=se($s,awe,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),lwe=se(Bs,swe,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),cwe=se([tr,owe,b0,x0,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),uwe=se([tr,Lt,lwe,b0,x0,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),cp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return cwe(e,n,r);case"yAxis":return uwe(e,n,r);case"zAxis":return(i=dA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return BU(e);case"radiusAxis":return UU(e,n);default:return}},eF=se([Gr,cp],E0),dwe=se([Cd,rwe],Vve),yA=se([Gr,Cd,dwe,eF],uA),tF=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Wa(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(c=>c.value)}},vA=se([Lt,lp,op,nr],tF),H0=se([yA],BC);se([yA],Cbe);se([yA,Ibe],kq);se([Nd,pA,nr],qbe);function nF(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var K0=(e,t)=>t,G0=(e,t,n)=>n,fwe=se(y0,K0,G0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(nF)),hwe=se(v0,K0,G0,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(nF)),rF=(e,t)=>({width:e.width,height:t.height}),pwe=(e,t)=>{var n=typeof t.width=="number"?t.width:Jh;return{width:n,height:e.height}},iF=se(tr,$s,rF),mwe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},gwe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},ywe=se(Is,tr,fwe,K0,G0,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=rF(t,c);o==null&&(o=mwe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[c.id]=o-Number(f)*d.height,o+=(f?-1:1)*d.height}),a}),vwe=se(Ms,tr,hwe,K0,G0,(e,t,n,r,i)=>{var a={},o;return n.forEach(c=>{var d=pwe(t,c);o==null&&(o=gwe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[c.id]=o-Number(f)*d.width,o+=(f?-1:1)*d.width}),a}),xwe=(e,t)=>{var n=$s(e,t);if(n!=null)return ywe(e,n.orientation,n.mirror)},bwe=se([tr,$s,xwe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),wwe=(e,t)=>{var n=Bs(e,t);if(n!=null)return vwe(e,n.orientation,n.mirror)},Swe=se([tr,Bs,wwe,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n?.[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),aF=se(tr,Bs,(e,t)=>{var n=typeof t.width=="number"?t.width:Jh;return{width:n,height:e.height}}),cI=(e,t,n)=>{switch(t){case"xAxis":return iF(e,n).width;case"yAxis":return aF(e,n).height;default:return}},sF=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,c=Wa(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(o&&c&&a==="category"&&i&&XB(f))return d}},xA=se([Lt,lp,Gr,nr],sF),uI=se([Lt,zbe,Cd,H0,xA,vA,cp,gA,nr],(e,t,n,r,i,a,o,c,d)=>{if(t!=null){var f=Wa(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:c,range:o,realScaleType:n,scale:r}}}),jwe=(e,t,n,r,i,a,o,c,d)=>{if(!(t==null||r==null)){var f=Wa(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,S=p==="category"&&r.bandwidth?r.bandwidth()/v:0;S=d==="angleAxis"&&a!=null&&a.length>=2?ri(a[0]-a[1])*2*S:S;var b=m||i;return b?b.map((j,k)=>{var E=o?o.indexOf(j):j,C=r.map(E);return ft(C)?{index:k,coordinate:C+S,value:j,offset:S}:null}).filter(ii):f&&c?c.map((j,k)=>{var E=r.map(j);return ft(E)?{coordinate:E+S,value:j,index:k,offset:S}:null}).filter(ii):r.ticks?r.ticks(y).map((j,k)=>{var E=r.map(j);return ft(E)?{coordinate:E+S,value:j,index:k,offset:S}:null}).filter(ii):r.domain().map((j,k)=>{var E=r.map(j);return ft(E)?{coordinate:E+S,value:o?o[j]:j,index:k,offset:S}:null}).filter(ii)}},oF=se([Lt,op,Cd,H0,gA,cp,xA,vA,nr],jwe),Nwe=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Wa(e,o),{tickCount:d}=t,f=0;return f=o==="angleAxis"&&r?.length>=2?ri(r[0]-r[1])*2*f:f,c&&a?a.map((p,m)=>{var y=n.map(p);return ft(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(ii):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return ft(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(ii):n.domain().map((p,m)=>{var y=n.map(p);return ft(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(ii)}},Lo=se([Lt,op,H0,cp,xA,vA,nr],Nwe),$o=se(Gr,H0,(e,t)=>{if(!(e==null||t==null))return Jy(Jy({},e),{},{scale:t})}),kwe=se([Gr,Cd,mA,eF],uA),Cwe=se([kwe],BC);se((e,t,n)=>dA(e,n),Cwe,(e,t)=>{if(!(e==null||t==null))return Jy(Jy({},e),{},{scale:t})});var Awe=se([Lt,y0,v0],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),Owe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};se([Owe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);o<r&&(r=o,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var lF=e=>e.options.defaultTooltipEventType,cF=e=>e.options.validateTooltipEventTypes;function uF(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function up(e,t){var n=lF(e),r=cF(e);return uF(t,n,r)}function Ewe(e){return Ue(t=>up(t,e))}var dF=(e,t)=>{var n,r=Number(t);if(!(ya(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},_we=e=>e.tooltip.settings,So={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},zwe={itemInteraction:{click:So,hover:So},axisInteraction:{click:So,hover:So},keyboardInteraction:So,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},fF=Pr({name:"tooltip",initialState:zwe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:an()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Vi(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:an()},removeTooltipEntrySettings:{reducer(e,t){var n=Vi(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:an()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:Twe,replaceTooltipEntrySettings:Pwe,removeTooltipEntrySettings:Rwe,setTooltipSettingsState:Dwe,setActiveMouseOverItemIndex:hF,mouseLeaveItem:Mwe,mouseLeaveChart:pF,setActiveClickItemIndex:Iwe,setMouseOverAxisIndex:mF,setMouseClickAxisIndex:Lwe,setSyncInteraction:Wf,setKeyboardInteraction:nv}=fF.actions,$we=fF.reducer;function dI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dI(Object(n),!0).forEach(function(r){Bwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bwe(e,t,n){return(t=Uwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uwe(e){var t=qwe(e,"string");return typeof t=="symbol"?t:t+""}function qwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Fwe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function Hwe(e){return e.index!=null}var gF=(e,t,n,r)=>{if(t==null)return So;var i=Fwe(e,t,n);if(i==null)return So;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(Hwe(i)){if(a)return fg(fg({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return fg(fg({},So),{},{coordinate:i.coordinate})};function Kwe(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function Gwe(e,t){var n=Kwe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function Vwe(e,t,n){if(n==null||t==null)return!0;var r=En(e,t);return r==null||!Ua(n)?!0:Gwe(r,n)}var oh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!ft(a))return i;var o=0,c=1/0;t.length>0&&(c=t.length-1);var d=Math.max(o,Math.min(a,c)),f=t[d];return f==null||Vwe(f,n,r)?String(d):null},yF=(e,t,n,r,i,a,o)=>{if(a!=null){var c=o[0],d=c?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},vF=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(r!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var c;return((c=o.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},xF=e=>e.options.tooltipPayloadSearcher,Ad=e=>e.tooltip;function fI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fI(Object(n),!0).forEach(function(r){Qwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Qwe(e,t,n){return(t=Ywe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ywe(e){var t=Wwe(e,"string");return typeof t=="symbol"?t:t+""}function Wwe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zwe(e){if(typeof e=="string"||typeof e=="number")return e}function Xwe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Jwe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function pI(e){if(typeof e=="string")return e}function eSe(e){if(!(e==null||typeof e!="object")){var t="name"in e?Zwe(e.name):void 0,n="unit"in e?Xwe(e.unit):void 0,r="dataKey"in e?Jwe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?pI(e.color):void 0,o="fill"in e?pI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:o}}}function tSe(e,t){return e??t}var bF=(e,t,n,r,i,a,o)=>{if(!(t==null||a==null)){var{chartData:c,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var S,{dataDefinedOnItem:b,settings:j}=v,k=tSe(b,c),E=Array.isArray(k)?V6(k,f,p):k,C=(S=j?.dataKey)!==null&&S!==void 0?S:r,O=j?.nameKey,z;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&o==="axis"?z=JB(E,r,i):z=a(E,t,d,O),Array.isArray(z))z.forEach(_=>{var R,$,F=eSe(_),q=F?.name,B=F?.dataKey,V=F?.payload,X=hI(hI({},j),{},{name:q,unit:F?.unit,color:(R=F?.color)!==null&&R!==void 0?R:j?.color,fill:($=F?.fill)!==null&&$!==void 0?$:j?.fill});y.push(sD({tooltipEntrySettings:X,dataKey:B,payload:V,value:En(V,B),name:q==null?void 0:String(q)}))});else{var A;y.push(sD({tooltipEntrySettings:j,dataKey:C,payload:z,value:En(z,C),name:(A=En(z,O))!==null&&A!==void 0?A:j?.name}))}return y},m)}},bA=se([Vn,Oq,RC],Nq),nSe=se([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),rSe=se([rr,Sd],Eq),xc=se([nSe,Vn,rSe],_q,{memoizeOptions:{resultEqualityCheck:M0}}),iSe=se([xc],e=>e.filter(R0)),wF=se([xc],Pq,{memoizeOptions:{resultEqualityCheck:M0}}),aSe=se([xc],e=>e.some(t=>!t.data)),rc=se([wF,Na],Dq),sSe=se([iSe,Na,Vn],FU),wA=se([rc,Vn,xc,Na,aSe,wF],Mq),SF=se([Vn],hA),oSe=se([Vn],e=>e.allowDataOverflow),jF=se([SF,oSe],jU),lSe=se([xc],e=>e.filter(R0)),cSe=se([sSe,lSe,O0,MU],Lq),uSe=se([cSe,Na,rr,jF],$q),dSe=se([xc],Tq),fSe=se([rc,Vn,dSe,pA,rr,zve],qq,{memoizeOptions:{resultEqualityCheck:D0}}),hSe=se([Fq,rr,Sd],kd),pSe=se([hSe,rr],Gq),mSe=se([Hq,rr,Sd],kd),gSe=se([mSe,rr],Vq),ySe=se([Kq,rr,Sd],kd),vSe=se([ySe,rr],Qq),xSe=se([pSe,vSe,gSe],tv),bSe=se([Vn,SF,jF,uSe,fSe,xSe,Lt,rr],Yq),ad=se([Vn,Lt,rc,wA,O0,rr,bSe],Wq),wSe=se([ad,Vn,bA],Zq),SSe=se([Vn,ad,wSe,rr],Xq),NF=e=>{var t=rr(e),n=Sd(e),r=!1;return cp(e,t,n,r)},kF=se([Vn,NF],E0),jSe=se([Vn,bA,SSe,kF],uA),CF=se([jSe],BC),NSe=se([Lt,wA,Vn,rr],sF),kSe=se([Lt,wA,Vn,rr],tF),CSe=(e,t,n,r,i,a,o,c)=>{if(t){var{type:d}=t,f=Wa(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=c==="angleAxis"&&i!=null&&i?.length>=2?ri(i[0]-i[1])*2*m:m,f&&o?o.map((y,v)=>{var S=r.map(y);return ft(S)?{coordinate:S+m,value:y,index:v,offset:m}:null}).filter(ii):r.domain().map((y,v)=>{var S=r.map(y);return ft(S)?{coordinate:S+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(ii)}}},Us=se([Lt,Vn,bA,CF,NF,NSe,kSe,rr],CSe),SA=se([lF,cF,_we],(e,t,n)=>uF(n.shared,e,t)),AF=e=>e.tooltip.settings.trigger,jA=e=>e.tooltip.settings.defaultIndex,dp=se([Ad,SA,AF,jA],gF),ic=se([dp,rc,id,ad],oh),OF=se([Us,ic],dF),EF=se([dp],e=>{if(e)return e.dataKey}),ASe=se([dp],e=>{if(e)return e.graphicalItemId}),_F=se([Ad,SA,AF,jA],vF),OSe=se([Ms,Is,Lt,tr,Us,jA,_F],yF),ESe=se([dp,OSe],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),_Se=se([dp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),zSe=se([_F,ic,Na,id,OF,xF,SA],bF),TSe=se([zSe],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function mI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mI(Object(n),!0).forEach(function(r){PSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PSe(e,t,n){return(t=RSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RSe(e){var t=DSe(e,"string");return typeof t=="symbol"?t:t+""}function DSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var MSe=()=>Ue(Vn),ISe=()=>{var e=MSe(),t=Ue(Us),n=Ue(CF);return Xu(!e||!n?void 0:gI(gI({},e),{},{scale:n}),t)};function yI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yI(Object(n),!0).forEach(function(r){LSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LSe(e,t,n){return(t=$Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Se(e){var t=BSe(e,"string");return typeof t=="symbol"?t:t+""}function BSe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var USe=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.relativeY};if(e==="vertical")return{x:r.relativeX,y:i.coordinate}}return{x:0,y:0}},qSe=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return fu(fu(fu({},r),gr(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var c=i.coordinate,{angle:d}=r;return fu(fu(fu({},r),gr(r.cx,r.cy,c,d)),{},{angle:d,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function FSe(e,t){var{relativeX:n,relativeY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var zF=(e,t,n,r,i)=>{var a,o=(a=t?.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var c=0;c<o;c++){var d,f,p,m,y,v=c>0?(d=n[c-1])===null||d===void 0?void 0:d.coordinate:(f=n[o-1])===null||f===void 0?void 0:f.coordinate,S=(p=n[c])===null||p===void 0?void 0:p.coordinate,b=c>=o-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[c+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||S==null||b==null))if(ri(S-v)!==ri(b-S)){var k=[];if(ri(b-S)===ri(i[1]-i[0])){j=b;var E=S+i[1]-i[0];k[0]=Math.min(E,(E+v)/2),k[1]=Math.max(E,(E+v)/2)}else{j=v;var C=b+i[1]-i[0];k[0]=Math.min(S,(C+S)/2),k[1]=Math.max(S,(C+S)/2)}var O=[Math.min(S,(j+S)/2),Math.max(S,(j+S)/2)];if(e>O[0]&&e<=O[1]||e>=k[0]&&e<=k[1]){var z;return(z=n[c])===null||z===void 0?void 0:z.index}}else{var A=Math.min(v,b),_=Math.max(v,b);if(e>(A+S)/2&&e<=(_+S)/2){var R;return(R=n[c])===null||R===void 0?void 0:R.index}}}else if(t)for(var $=0;$<o;$++){var F=t[$];if(F!=null){var q=t[$+1],B=t[$-1];if($===0&&q!=null&&e<=(F.coordinate+q.coordinate)/2||$===o-1&&B!=null&&e>(F.coordinate+B.coordinate)/2||$>0&&$<o-1&&B!=null&&q!=null&&e>(F.coordinate+B.coordinate)/2&&e<=(F.coordinate+q.coordinate)/2)return F.index}}return-1},TF=()=>Ue(RC),NA=(e,t)=>t,PF=(e,t,n)=>n,kA=(e,t,n,r)=>r,HSe=se(Us,e=>s0(e,t=>t.coordinate)),CA=se([Ad,NA,PF,kA],gF),AA=se([CA,rc,id,ad],oh),KSe=(e,t,n)=>{if(t!=null){var r=Ad(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},RF=se([Ad,NA,PF,kA],vF),rv=se([Ms,Is,Lt,tr,Us,kA,RF],yF),GSe=se([CA,rv],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),DF=se([Us,AA],dF),VSe=se([RF,AA,Na,id,DF,xF,NA],bF),QSe=se([CA,AA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),YSe=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&FSe(e,o)){var c=Cme(e,t),d=zF(c,a,i,n,r),f=USe(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},WSe=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var c=bve(e,n);if(c){var d=Ame(c,t),f=zF(d,o,a,r,i),p=qSe(t,a,f,c);return{activeIndex:String(f),activeCoordinate:p}}}},ZSe=(e,t,n,r,i,a,o,c)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?YSe(e,t,r,i,a,o,c):WSe(e,t,n,r,i,a,o)},XSe=se(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),JSe=se(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(er)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:Gve}});function vI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vI(Object(n),!0).forEach(function(r){eje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eje(e,t,n){return(t=tje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tje(e){var t=nje(e,"string");return typeof t=="symbol"?t:t+""}function nje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rje={},ije={zIndexMap:Object.values(er).reduce((e,t)=>xI(xI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),rje)},aje=new Set(Object.values(er));function sje(e){return aje.has(e)}var MF=Pr({name:"zIndex",initialState:ije,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:an()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!sje(n)&&delete e.zIndexMap[n])},prepare:an()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:an()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:an()}}}),{registerZIndexPortal:oje,unregisterZIndexPortal:vj,registerZIndexPortalElement:lje,unregisterZIndexPortalElement:cje}=MF.actions,uje=MF.reducer;function ra(e){var{zIndex:t,children:n}=e,r=sge(),i=r&&t!==void 0&&t!==0,a=Rr(),o=x.useRef(void 0),c=x.useRef(new Set),d=on(),f=Ue(m=>XSe(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=c.current;m.forEach(v=>{d(vj({zIndex:v}))}),m.clear(),o.current=void 0;return}if(c.current.has(t)||(d(oje({zIndex:t})),c.current.add(t)),f){o.current=f;var y=c.current;y.forEach(v=>{v!==t&&(d(vj({zIndex:v})),y.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=c.current;return()=>{m.forEach(y=>{d(vj({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??o.current;return p?lc.createPortal(n,p):null}function pN(){return pN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pN.apply(null,arguments)}function bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(n),!0).forEach(function(r){dje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dje(e,t,n){return(t=fje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fje(e){var t=hje(e,"string");return typeof t=="symbol"?t:t+""}function hje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pje(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function mje(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:o,layout:c,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,y=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var S,b,j;if(p==="ScatterChart")S=m,b=Rye,j=er.cursorLine;else if(p==="BarChart")S=Dye(c,m,a,o),b=yU,j=er.cursorRectangle;else if(c==="radial"&&t6(m)){var{cx:k,cy:E,radius:C,startAngle:O,endAngle:z}=vU(m);S={cx:k,cy:E,startAngle:O,endAngle:z,innerRadius:C,outerRadius:C},b=bU,j=er.cursorLine}else S={points:Nve(c,m,a)},b=sh,j=er.cursorLine;var A=typeof d=="object"&&"className"in d?d.className:void 0,_=hg(hg(hg(hg({stroke:"#ccc",pointerEvents:"none"},a),S),Yh(d)),{},{payload:y,payloadIndex:v,className:Rt("recharts-tooltip-cursor",A)});return x.createElement(ra,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},x.createElement(pje,{cursor:d,cursorComp:b,cursorProps:_}))}function gje(e){var t=ISe(),n=tU(),r=gc(),i=TF();return t==null||n==null||r==null||i==null?null:x.createElement(mje,pN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var IF=x.createContext(null),yje=()=>x.useContext(IF),xj={exports:{}},wI;function vje(){return wI||(wI=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,y),S=n?n+f:f;return d._events[S]?d._events[S].fn?d._events[S]=[d._events[S],v]:d._events[S].push(v):(d._events[S]=v,d._eventsCount++),d}function o(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},c.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var y=0,v=m.length,S=new Array(v);y<v;y++)S[y]=m[y].fn;return S},c.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},c.prototype.emit=function(f,p,m,y,v,S){var b=n?n+f:f;if(!this._events[b])return!1;var j=this._events[b],k=arguments.length,E,C;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,y),!0;case 5:return j.fn.call(j.context,p,m,y,v),!0;case 6:return j.fn.call(j.context,p,m,y,v,S),!0}for(C=1,E=new Array(k-1);C<k;C++)E[C-1]=arguments[C];j.fn.apply(j.context,E)}else{var O=j.length,z;for(C=0;C<O;C++)switch(j[C].once&&this.removeListener(f,j[C].fn,void 0,!0),k){case 1:j[C].fn.call(j[C].context);break;case 2:j[C].fn.call(j[C].context,p);break;case 3:j[C].fn.call(j[C].context,p,m);break;case 4:j[C].fn.call(j[C].context,p,m,y);break;default:if(!E)for(z=1,E=new Array(k-1);z<k;z++)E[z-1]=arguments[z];j[C].fn.apply(j[C].context,E)}}return!0},c.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},c.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},c.prototype.removeListener=function(f,p,m,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return o(this,v),this;var S=this._events[v];if(S.fn)S.fn===p&&(!y||S.once)&&(!m||S.context===m)&&o(this,v);else{for(var b=0,j=[],k=S.length;b<k;b++)(S[b].fn!==p||y&&!S[b].once||m&&S[b].context!==m)&&j.push(S[b]);j.length?this._events[v]=j.length===1?j[0]:j:o(this,v)}return this},c.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&o(this,p)):(this._events=new r,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(xj)),xj.exports}var xje=vje();const bje=ba(xje);var Dh=new bje,mN="recharts.syncEvent.tooltip",SI="recharts.syncEvent.brush",LF=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!ya(n))return e[n]}},wje={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},$F=Pr({name:"options",initialState:wje,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Sje=$F.reducer,{createEventEmitter:jje}=$F.actions;function Nje(e){return e.tooltip.syncInteraction}var kje={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},BF=Pr({name:"chartData",initialState:kje,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:jI,setDataStartEndIndexes:Cje,setComputedData:bze}=BF.actions,Aje=BF.reducer,Oje=["x","y"];function NI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NI(Object(n),!0).forEach(function(r){Eje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Eje(e,t,n){return(t=_je(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _je(e){var t=zje(e,"string");return typeof t=="symbol"?t:t+""}function zje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Tje(e,t){if(e==null)return{};var n,r,i=Pje(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Pje(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Rje(){var e=Ue(DC),t=Ue(MC),n=on(),r=Ue(IU),i=Ue(Us),a=gc(),o=w0(),c=Ue(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return mc;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(Wf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(o&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:S,y:b}=v,j=Tje(v,Oje),{x:k,y:E,width:C,height:O}=p.payload.sourceViewBox,z=hu(hu({},j),{},{x:o.x+(C?(S-k)/C:0)*o.width,y:o.y+(O?(b-E)/O:0)*o.height});n(hu(hu({},p),{},{payload:hu(hu({},p.payload),{},{coordinate:z})}))}else n(p);return}if(i!=null){var A;if(typeof r=="function"){var _={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},R=r(i,_);A=i[R]}else r==="value"&&(A=i.find(H=>String(H.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||o==null){n(Wf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(A==null){n(Wf({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var{x:F,y:q}=$,B=Math.min(F,o.x+o.width),V=Math.min(q,o.y+o.height),X={x:a==="horizontal"?A.coordinate:B,y:a==="horizontal"?V:A.coordinate},Z=Wf({active:p.payload.active,coordinate:X,dataKey:p.payload.dataKey,index:String(A.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Z)}}};return Dh.on(mN,d),()=>{Dh.off(mN,d)}},[c,n,t,e,r,i,a,o])}function Dje(){var e=Ue(DC),t=Ue(MC),n=on();x.useEffect(()=>{if(e==null)return mc;var r=(i,a,o)=>{t!==o&&e===i&&n(Cje(a))};return Dh.on(SI,r),()=>{Dh.off(SI,r)}},[n,t,e])}function Mje(){var e=on();x.useEffect(()=>{e(jje())},[e]),Rje(),Dje()}function Ije(e,t,n,r,i,a){var o=Ue(S=>KSe(S,e,t)),c=Ue(ASe),d=Ue(MC),f=Ue(DC),p=Ue(IU),m=Ue(Nje),y=m?.sourceViewBox!=null,v=w0();x.useEffect(()=>{if(!y&&f!=null&&d!=null){var S=Wf({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Dh.emit(mN,f,S,d)}},[y,n,o,c,i,r,d,f,p,a,v])}function kI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function CI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kI(Object(n),!0).forEach(function(r){Lje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Lje(e,t,n){return(t=$je(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $je(e){var t=Bje(e,"string");return typeof t=="symbol"?t:t+""}function Bje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Uje(e){return e.dataKey}function qje(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(cye,t)}var AI=[],Fje={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function iv(e){var t,n,r=Tr(e,Fje),{active:i,allowEscapeViewBox:a,animationDuration:o,animationEasing:c,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:S,useTranslate3d:b,wrapperStyle:j,cursor:k,shared:E,trigger:C,defaultIndex:O,portal:z,axisId:A}=r,_=on(),R=typeof O=="number"?String(O):O;x.useEffect(()=>{_(Dwe({shared:E,trigger:C,axisId:A,active:i,defaultIndex:R}))},[_,E,C,A,i,R]);var $=w0(),F=fU(),q=Ewe(E),{activeIndex:B,isActive:V}=(t=Ue(_e=>QSe(_e,q,C,R)))!==null&&t!==void 0?t:{},X=Ue(_e=>VSe(_e,q,C,R)),Z=Ue(_e=>DF(_e,q,C,R)),H=Ue(_e=>GSe(_e,q,C,R)),J=X,ue=yje(),we=(n=i??V)!==null&&n!==void 0?n:!1,[I,D]=y6([J,we]),U=q==="axis"?Z:void 0;Ije(q,C,H,U,B,we);var M=z??ue;if(M==null||$==null||q==null)return null;var Q=J??AI;we||(Q=AI),f&&Q.length&&(Q=f6(Q.filter(_e=>_e.value!=null&&(_e.hide!==!0||r.includeHidden)),y,Uje));var oe=Q.length>0,ne=CI(CI({},r),{},{payload:Q,label:U,active:we,activeIndex:B,coordinate:H,accessibilityLayer:F}),Ae=x.createElement(bye,{allowEscapeViewBox:a,animationDuration:o,animationEasing:c,isAnimationActive:p,active:we,coordinate:H,hasPayload:oe,offset:m,position:v,reverseDirection:S,useTranslate3d:b,viewBox:$,wrapperStyle:j,lastBoundingBox:I,innerRef:D,hasPortalFromProps:!!z},qje(d,ne));return x.createElement(x.Fragment,null,lc.createPortal(Ae,M),we&&x.createElement(gje,{cursor:k,tooltipEventType:q,coordinate:H,payload:Q,index:B}))}var av=e=>null;av.displayName="Cell";function Hje(e,t,n){return(t=Kje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kje(e){var t=Gje(e,"string");return typeof t=="symbol"?t:t+""}function Gje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Vje{constructor(t){Hje(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function OI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Qje(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(n),!0).forEach(function(r){Yje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yje(e,t,n){return(t=Wje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wje(e){var t=Zje(e,"string");return typeof t=="symbol"?t:t+""}function Zje(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xje={cacheSize:2e3,enableCache:!0},UF=Qje({},Xje),EI=new Vje(UF.cacheSize),Jje={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},_I="recharts_measurement_span";function e1e(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",o=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(o,"|").concat(c)}var zI=(e,t)=>{try{var n=document.getElementById(_I);n||(n=document.createElement("span"),n.setAttribute("id",_I),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Jje,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},lh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||np.isSsr)return{width:0,height:0};if(!UF.enableCache)return zI(t,n);var r=e1e(t,n),i=EI.get(r);if(i)return i;var a=zI(t,n);return EI.set(r,a),a},qF;function t1e(e,t,n){return(t=n1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n1e(e){var t=r1e(e,"string");return typeof t=="symbol"?t:t+""}function r1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var TI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,PI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,i1e=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,a1e=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,s1e={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},o1e=["cm","mm","pt","pc","in","Q","px"];function l1e(e){return o1e.includes(e)}var Au="NaN";function c1e(e,t){return e*s1e[t]}class fr{static parse(t){var n,[,r,i]=(n=a1e.exec(t))!==null&&n!==void 0?n:[];return r==null?fr.NaN:new fr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,ya(t)&&(this.unit=""),n!==""&&!i1e.test(n)&&(this.num=NaN,this.unit=""),l1e(n)&&(this.num=c1e(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new fr(NaN,""):new fr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new fr(NaN,""):new fr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new fr(NaN,""):new fr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new fr(NaN,""):new fr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ya(this.num)}}qF=fr;t1e(fr,"NaN",new qF(NaN,""));function FF(e){if(e==null||e.includes(Au))return Au;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=TI.exec(t))!==null&&n!==void 0?n:[],o=fr.parse(r??""),c=fr.parse(a??""),d=i==="*"?o.multiply(c):o.divide(c);if(d.isNaN())return Au;t=t.replace(TI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=PI.exec(t))!==null&&f!==void 0?f:[],v=fr.parse(p??""),S=fr.parse(y??""),b=m==="+"?v.add(S):v.subtract(S);if(b.isNaN())return Au;t=t.replace(PI,b.toString())}return t}var RI=/\(([^()]*)\)/;function u1e(e){for(var t=e,n;(n=RI.exec(t))!=null;){var[,r]=n;t=t.replace(RI,FF(r))}return t}function d1e(e){var t=e.replace(/\s+/g,"");return t=u1e(t),t=FF(t),t}function f1e(e){try{return d1e(e)}catch{return Au}}function bj(e){var t=f1e(e.slice(5,-1));return t===Au?"":t}var h1e=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],p1e=["dx","dy","angle","className","breakAll"];function gN(){return gN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gN.apply(null,arguments)}function DI(e,t){if(e==null)return{};var n,r,i=m1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function m1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var HF=/[ \f\n\r\t\v\u2028\u2029]+/,KF=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];gn(t)||(n?i=t.toString().split(""):i=t.toString().split(HF));var a=i.map(c=>({word:c,width:lh(c,r).width})),o=n?0:lh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function GF(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function g1e(e){return gn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var VF=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:c}=a,d=i[i.length-1];if(d&&c!=null&&(t==null||r||d.width+c+n<Number(t)))d.words.push(o),d.width+=c+n;else{var f={words:[o],width:c};i.push(f)}return i},[]),QF=e=>e.reduce((t,n)=>t.width>n.width?t:n),y1e="…",MI=(e,t,n,r,i,a,o,c)=>{var d=e.slice(0,t),f=KF({breakAll:n,style:r,children:d+y1e});if(!f)return[!1,[]];var p=VF(f.wordsWithComputedWidth,a,o,c),m=p.length>i||QF(p).width>Number(a);return[m,p]},v1e=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:c,breakAll:d}=e,f=Te(a),p=String(o),m=VF(t,r,n,i);if(!f||i)return m;var y=m.length>a||QF(m).width>Number(r);if(!y)return m;for(var v=0,S=p.length-1,b=0,j;v<=S&&b<=p.length-1;){var k=Math.floor((v+S)/2),E=k-1,[C,O]=MI(p,E,d,c,a,r,n,i),[z]=MI(p,k,d,c,a,r,n,i);if(!C&&!z&&(v=k+1),C&&z&&(S=k-1),!C&&z){j=O;break}b++}return j||m},II=e=>{var t=gn(e)?[]:e.toString().split(HF);return[{words:t,width:void 0}]},x1e=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!np.isSsr){var c,d,f=KF({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;c=p,d=m}else return II(r);return v1e({breakAll:a,children:r,maxLines:o,style:i},c,d,t,!!n)}return II(r)},YF="#808080",b1e={angle:0,breakAll:!1,capHeight:"0.71em",fill:YF,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},OA=x.forwardRef((e,t)=>{var n=Tr(e,b1e),{x:r,y:i,lineHeight:a,capHeight:o,fill:c,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=DI(n,h1e),y=x.useMemo(()=>x1e({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:S,angle:b,className:j,breakAll:k}=m,E=DI(m,p1e);if(!Ka(r)||!Ka(i)||y.length===0)return null;var C=Number(r)+(Te(v)?v:0),O=Number(i)+(Te(S)?S:0);if(!ft(C)||!ft(O))return null;var z;switch(p){case"start":z=bj("calc(".concat(o,")"));break;case"middle":z=bj("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:z=bj("calc(".concat(y.length-1," * -").concat(a,")"));break}var A=[],_=y[0];if(d&&_!=null){var R=_.width,{width:$}=m;A.push("scale(".concat(Te($)&&Te(R)?$/R:1,")"))}return b&&A.push("rotate(".concat(b,", ").concat(C,", ").concat(O,")")),A.length&&(E.transform=A.join(" ")),x.createElement("text",gN({},Fr(E),{ref:t,x:C,y:O,className:Rt("recharts-text",j),textAnchor:f,fill:c.includes("url")?YF:c}),y.map((F,q)=>{var B=F.words.join(k?"":" ");return x.createElement("tspan",{x:C,dy:q===0?z:a,key:"".concat(B,"-").concat(q)},B)}))});OA.displayName="Text";function LI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pa(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LI(Object(n),!0).forEach(function(r){w1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function w1e(e,t,n){return(t=S1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S1e(e){var t=j1e(e,"string");return typeof t=="symbol"?t:t+""}function j1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var N1e=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:c,upperWidth:d,lowerWidth:f}=NC(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,S=p+d/2,b=c>=0?1:-1,j=b*r,k=b>0?"end":"start",E=b>0?"start":"end",C=d>=0?1:-1,O=C*r,z=C>0?"end":"start",A=C>0?"start":"end",_=i;if(n==="top"){var R={x:p+d/2,y:o-j,horizontalAnchor:"middle",verticalAnchor:k};return _&&(R.height=Math.max(o-_.y,0),R.width=d),R}if(n==="bottom"){var $={x:m+f/2,y:o+c+j,horizontalAnchor:"middle",verticalAnchor:E};return _&&($.height=Math.max(_.y+_.height-(o+c),0),$.width=f),$}if(n==="left"){var F={x:y-O,y:o+c/2,horizontalAnchor:z,verticalAnchor:"middle"};return _&&(F.width=Math.max(F.x-_.x,0),F.height=c),F}if(n==="right"){var q={x:y+v+O,y:o+c/2,horizontalAnchor:A,verticalAnchor:"middle"};return _&&(q.width=Math.max(_.x+_.width-q.x,0),q.height=c),q}var B=_?{width:v,height:c}:{};return n==="insideLeft"?Pa({x:y+O,y:o+c/2,horizontalAnchor:A,verticalAnchor:"middle"},B):n==="insideRight"?Pa({x:y+v-O,y:o+c/2,horizontalAnchor:z,verticalAnchor:"middle"},B):n==="insideTop"?Pa({x:p+d/2,y:o+j,horizontalAnchor:"middle",verticalAnchor:E},B):n==="insideBottom"?Pa({x:m+f/2,y:o+c-j,horizontalAnchor:"middle",verticalAnchor:k},B):n==="insideTopLeft"?Pa({x:p+O,y:o+j,horizontalAnchor:A,verticalAnchor:E},B):n==="insideTopRight"?Pa({x:p+d-O,y:o+j,horizontalAnchor:z,verticalAnchor:E},B):n==="insideBottomLeft"?Pa({x:m+O,y:o+c-j,horizontalAnchor:A,verticalAnchor:k},B):n==="insideBottomRight"?Pa({x:m+f-O,y:o+c-j,horizontalAnchor:z,verticalAnchor:k},B):n&&typeof n=="object"&&(Te(n.x)||Xl(n.x))&&(Te(n.y)||Xl(n.y))?Pa({x:a+va(n.x,v),y:o+va(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},B):Pa({x:S,y:o+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},k1e=["labelRef"],C1e=["content"];function $I(e,t){if(e==null)return{};var n,r,i=A1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function A1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function BI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Zf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BI(Object(n),!0).forEach(function(r){O1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function O1e(e,t,n){return(t=E1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E1e(e){var t=_1e(e,"string");return typeof t=="symbol"?t:t+""}function _1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ss(){return Ss=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ss.apply(null,arguments)}var WF=x.createContext(null),z1e=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o,children:c}=e,d=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:o}),[t,n,r,i,a,o]);return x.createElement(WF.Provider,{value:d},c)},ZF=()=>{var e=x.useContext(WF),t=w0();return e||(t?NC(t):void 0)},T1e=x.createContext(null),P1e=()=>{var e=x.useContext(T1e),t=Ue(qU);return e||t},R1e=e=>{var{value:t,formatter:n}=e,r=gn(e.children)?t:e.children;return typeof n=="function"?n(r):r},EA=e=>e!=null&&typeof e=="function",D1e=(e,t)=>{var n=ri(t-e),r=Math.min(Math.abs(t-e),360);return n*r},M1e=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:c,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,S=(f+p)/2,b=D1e(m,y),j=b>=0?1:-1,k,E;switch(t){case"insideStart":k=m+j*a,E=v;break;case"insideEnd":k=y-j*a,E=!v;break;case"end":k=y+j*a,E=v;break;default:throw new Error("Unsupported position ".concat(t))}E=b<=0?E:!E;var C=gr(c,d,S,k),O=gr(c,d,S,k+(E?1:-1)*359),z="M".concat(C.x,",").concat(C.y,`
|
|
288
|
+
A`).concat(S,",").concat(S,",0,1,").concat(E?0:1,`,
|
|
289
|
+
`).concat(O.x,",").concat(O.y),A=gn(e.id)?Sh("recharts-radial-line-"):e.id;return x.createElement("text",Ss({},r,{dominantBaseline:"central",className:Rt("recharts-radial-bar-label",o)}),x.createElement("defs",null,x.createElement("path",{id:A,d:z})),x.createElement("textPath",{xlinkHref:"#".concat(A)},n))},I1e=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:c,endAngle:d}=e,f=(c+d)/2;if(n==="outside"){var{x:p,y:m}=gr(r,i,o+t,f);return{x:p,y:m,textAnchor:p>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var y=(a+o)/2,{x:v,y:S}=gr(r,i,y,f);return{x:v,y:S,textAnchor:"middle",verticalAnchor:"middle"}},Lg=e=>e!=null&&"cx"in e&&Te(e.cx),L1e={angle:0,offset:5,zIndex:er.label,position:"middle",textBreakAll:!1};function $1e(e){if(!Lg(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function bo(e){var t=Tr(e,L1e),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:c,className:d="",textBreakAll:f,labelRef:p}=t,m=P1e(),y=ZF(),v=i==="center"?y:m??y,S,b,j;n==null?S=v:Lg(n)?S=n:S=NC(n);var k=$1e(S);if(!S||gn(a)&&gn(o)&&!x.isValidElement(c)&&typeof c!="function")return null;var E=Zf(Zf({},t),{},{viewBox:S});if(x.isValidElement(c)){var{labelRef:C}=E,O=$I(E,k1e);return x.cloneElement(c,O)}if(typeof c=="function"){var{content:z}=E,A=$I(E,C1e);if(b=x.createElement(c,A),x.isValidElement(b))return b}else b=R1e(t);var _=Fr(t);if(Lg(S)){if(i==="insideStart"||i==="insideEnd"||i==="end")return M1e(t,i,b,_,S);j=I1e(S,t.offset,t.position)}else{if(!k)return null;var R=N1e({viewBox:k,position:i,offset:t.offset,parentViewBox:Lg(r)?void 0:r});j=Zf(Zf({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return x.createElement(ra,{zIndex:t.zIndex},x.createElement(OA,Ss({ref:p,className:Rt("recharts-label",d)},_,j,{textAnchor:GF(_.textAnchor)?_.textAnchor:j.textAnchor,breakAll:f}),b))}bo.displayName="Label";var B1e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(bo,Ss({key:"label-implicit"},r)):Ka(e)?x.createElement(bo,Ss({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===bo?x.cloneElement(e,Zf({key:"label-implicit"},r)):x.createElement(bo,Ss({key:"label-implicit",content:e},r)):EA(e)?x.createElement(bo,Ss({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(bo,Ss({},e,{key:"label-implicit"},r)):null};function U1e(e){var{label:t,labelRef:n}=e,r=ZF();return B1e(t,r,n)||null}var q1e=["valueAccessor"],F1e=["dataKey","clockWise","id","textBreakAll","zIndex"];function sv(){return sv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sv.apply(null,arguments)}function UI(e,t){if(e==null)return{};var n,r,i=H1e(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function H1e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var K1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(g1e(t))return t},XF=x.createContext(void 0),JF=XF.Provider,e8=x.createContext(void 0);e8.Provider;function G1e(){return x.useContext(XF)}function V1e(){return x.useContext(e8)}function $g(e){var{valueAccessor:t=K1e}=e,n=UI(e,q1e),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:c}=n,d=UI(n,F1e),f=G1e(),p=V1e(),m=f||p;return!m||!m.length?null:x.createElement(ra,{zIndex:c??er.label},x.createElement(Er,{className:"recharts-label-list"},m.map((y,v)=>{var S,b=gn(r)?t(y,v):En(y.payload,r),j=gn(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(bo,sv({key:"label-".concat(v)},Fr(y),d,j,{fill:(S=n.fill)!==null&&S!==void 0?S:y.fill,parentViewBox:y.parentViewBox,value:b,textBreakAll:o,viewBox:y.viewBox,index:v,zIndex:0}))})))}$g.displayName="LabelList";function t8(e){var{label:t}=e;return t?t===!0?x.createElement($g,{key:"labelList-implicit"}):x.isValidElement(t)||EA(t)?x.createElement($g,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement($g,sv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function yN(){return yN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yN.apply(null,arguments)}var n8=e=>{var{cx:t,cy:n,r,className:i}=e,a=Rt("recharts-dot",i);return Te(t)&&Te(n)&&Te(r)?x.createElement("circle",yN({},Zi(e),hC(e),{className:a,cx:t,cy:n,r})):null},Q1e={radiusAxis:{},angleAxis:{}},r8=Pr({name:"polarAxis",initialState:Q1e,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:wze,removeRadiusAxis:Sze,addAngleAxis:jze,removeAngleAxis:Nze}=r8.actions,Y1e=r8.reducer;function W1e(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var wj={exports:{}},Kt={};var qI;function Z1e(){if(qI)return Kt;qI=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function S(b){if(typeof b=="object"&&b!==null){var j=b.$$typeof;switch(j){case e:switch(b=b.type,b){case n:case i:case r:case d:case f:case y:return b;default:switch(b=b&&b.$$typeof,b){case o:case c:case m:case p:return b;case a:return b;default:return j}}case t:return j}}}return Kt.ContextConsumer=a,Kt.ContextProvider=o,Kt.Element=e,Kt.ForwardRef=c,Kt.Fragment=n,Kt.Lazy=m,Kt.Memo=p,Kt.Portal=t,Kt.Profiler=i,Kt.StrictMode=r,Kt.Suspense=d,Kt.SuspenseList=f,Kt.isContextConsumer=function(b){return S(b)===a},Kt.isContextProvider=function(b){return S(b)===o},Kt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Kt.isForwardRef=function(b){return S(b)===c},Kt.isFragment=function(b){return S(b)===n},Kt.isLazy=function(b){return S(b)===m},Kt.isMemo=function(b){return S(b)===p},Kt.isPortal=function(b){return S(b)===t},Kt.isProfiler=function(b){return S(b)===i},Kt.isStrictMode=function(b){return S(b)===r},Kt.isSuspense=function(b){return S(b)===d},Kt.isSuspenseList=function(b){return S(b)===f},Kt.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===i||b===r||b===d||b===f||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===p||b.$$typeof===o||b.$$typeof===a||b.$$typeof===c||b.$$typeof===v||b.getModuleId!==void 0)},Kt.typeOf=S,Kt}var FI;function X1e(){return FI||(FI=1,wj.exports=Z1e()),wj.exports}var J1e=X1e(),HI=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",KI=null,Sj=null,i8=e=>{if(e===KI&&Array.isArray(Sj))return Sj;var t=[];return x.Children.forEach(e,n=>{gn(n)||(J1e.isFragment(n)?t=t.concat(i8(n.props.children)):t.push(n))}),Sj=t,KI=e,t};function eNe(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>HI(i)):r=[HI(t)],i8(e).forEach(i=>{var a=Wu(i,"type.displayName")||Wu(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var a8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,jj={},GI;function tNe(){return GI||(GI=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const i=n[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(n,Symbol.toStringTag)?.writable?!1:n.toString()===`[object ${i}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(jj)),jj}var Nj,VI;function nNe(){return VI||(VI=1,Nj=tNe().isPlainObject),Nj}var rNe=nNe();const iNe=ba(rNe);var QI,YI,WI,ZI,XI;function JI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JI(Object(n),!0).forEach(function(r){aNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aNe(e,t,n){return(t=sNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sNe(e){var t=oNe(e,"string");return typeof t=="symbol"?t:t+""}function oNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ov(){return ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ov.apply(null,arguments)}function qf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var tL=(e,t,n,r,i)=>{var a=n-r,o;return o=jn(QI||(QI=qf(["M ",",",""])),e,t),o+=jn(YI||(YI=qf(["L ",",",""])),e+n,t),o+=jn(WI||(WI=qf(["L ",",",""])),e+n-a/2,t+i),o+=jn(ZI||(ZI=qf(["L ",",",""])),e+n-a/2-r,t+i),o+=jn(XI||(XI=qf(["L ",","," Z"])),e,t),o},lNe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},cNe=e=>{var t=Tr(e,lNe),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:c}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,y=x.useRef(null),[v,S]=x.useState(-1),b=x.useRef(i),j=x.useRef(a),k=x.useRef(o),E=x.useRef(n),C=x.useRef(r),O=C0(e,"trapezoid-");if(x.useEffect(()=>{if(y.current&&y.current.getTotalLength)try{var X=y.current.getTotalLength();X&&S(X)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var z=Rt("recharts-trapezoid",c);if(!m)return x.createElement("g",null,x.createElement("path",ov({},Fr(t),{className:z,d:tL(n,r,i,a,o)})));var A=b.current,_=j.current,R=k.current,$=E.current,F=C.current,q="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),V=hU(["strokeDasharray"],f,d);return x.createElement(k0,{animationId:O,key:O,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},X=>{var Z=mn(A,i,X),H=mn(_,a,X),J=mn(R,o,X),ue=mn($,n,X),we=mn(F,r,X);y.current&&(b.current=Z,j.current=H,k.current=J,E.current=ue,C.current=we);var I=X>0?{transition:V,strokeDasharray:B}:{strokeDasharray:q};return x.createElement("path",ov({},Fr(t),{className:z,d:tL(ue,we,Z,H,J),ref:y,style:eL(eL({},I),t.style)}))})},uNe=["option","shapeType","activeClassName","inActiveClassName"];function dNe(e,t){if(e==null)return{};var n,r,i=fNe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function fNe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function nL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nL(Object(n),!0).forEach(function(r){hNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hNe(e,t,n){return(t=pNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pNe(e){var t=mNe(e,"string");return typeof t=="symbol"?t:t+""}function mNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function gNe(e,t){return lv(lv({},t),e)}function yNe(e,t){return e==="symbols"}function rL(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(yU,n);case"trapezoid":return x.createElement(cNe,n);case"sector":return x.createElement(bU,n);case"symbols":if(yNe(t))return x.createElement(fC,n);break;case"curve":return x.createElement(sh,n);default:return null}}function vNe(e){return x.isValidElement(e)?e.props:e}function xNe(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=dNe(e,uNe),o;if(x.isValidElement(t))o=x.cloneElement(t,lv(lv({},a),vNe(t)));else if(typeof t=="function")o=t(a,a.index);else if(iNe(t)&&typeof t!="boolean"){var c=gNe(t,a);o=x.createElement(rL,{shapeType:n,elementProps:c})}else{var d=a;o=x.createElement(rL,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(Er,{className:r},o):x.createElement(Er,{className:i},o)}var s8=(e,t,n)=>{var r=on();return(i,a)=>o=>{e?.(i,a,o),r(hF({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},o8=e=>{var t=on();return(n,r)=>i=>{e?.(n,r,i),t(Mwe())}},l8=(e,t,n)=>{var r=on();return(i,a)=>o=>{e?.(i,a,o),r(Iwe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function c8(e){var{tooltipEntrySettings:t}=e,n=on(),r=Rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Twe(t)):i.current!==t&&n(Pwe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(Rwe(i.current)),i.current=null)},[n]),null}function u8(e){var{legendPayload:t}=e,n=on(),r=Rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(bge(t)):i.current!==t&&n(wge({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Sge(i.current)),i.current=null)},[n]),null}var kj,bNe=()=>{var[e]=x.useState(()=>Sh("uid-"));return e},wNe=(kj=yv.useId)!==null&&kj!==void 0?kj:bNe;function SNe(e,t){var n=wNe();return t||(e?"".concat(e,"-").concat(n):n)}var jNe=x.createContext(void 0),d8=e=>{var{id:t,type:n,children:r}=e,i=SNe("recharts-".concat(n),t);return x.createElement(jNe.Provider,{value:i},r(i))},NNe={cartesianItems:[],polarItems:[]},f8=Pr({name:"graphicalItems",initialState:NNe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:an()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Vi(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:an()},removeCartesianGraphicalItem:{reducer(e,t){var n=Vi(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:an()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:an()},removePolarGraphicalItem:{reducer(e,t){var n=Vi(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:an()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Vi(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:an()}}}),{addCartesianGraphicalItem:kNe,replaceCartesianGraphicalItem:CNe,removeCartesianGraphicalItem:ANe,addPolarGraphicalItem:kze,removePolarGraphicalItem:Cze,replacePolarGraphicalItem:Aze}=f8.actions,ONe=f8.reducer,ENe=e=>{var t=on(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(kNe(e)):n.current!==e&&t(CNe({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(ANe(n.current)),n.current=null)},[t]),null},h8=x.memo(ENe),_Ne=["points"];function iL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iL(Object(n),!0).forEach(function(r){zNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zNe(e,t,n){return(t=TNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TNe(e){var t=PNe(e,"string");return typeof t=="symbol"?t:t+""}function PNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cv(){return cv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cv.apply(null,arguments)}function RNe(e,t){if(e==null)return{};var n,r,i=DNe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DNe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function MNe(e){var{option:t,dotProps:n,className:r}=e;if(x.isValidElement(t))return x.cloneElement(t,n);if(typeof t=="function")return t(n);var i=Rt(r,typeof t!="boolean"?t.className:""),a=n??{},{points:o}=a,c=RNe(a,_Ne);return x.createElement(n8,cv({},c,{className:i}))}function INe(e,t){return e==null?!1:t?!0:e.length===1}function LNe(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:c,clipPathId:d,zIndex:f=er.scatter}=e;if(!INe(t,n))return null;var p=a8(n),m=ofe(n),y=t.map((S,b)=>{var j,k,E=Cj(Cj(Cj({r:3},o),m),{},{index:b,cx:(j=S.x)!==null&&j!==void 0?j:void 0,cy:(k=S.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:S.value,payload:S.payload,points:t});return x.createElement(MNe,{key:"dot-".concat(b),option:n,dotProps:E,className:i})}),v={};return c&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(ra,{zIndex:f},x.createElement(Er,cv({className:r},v),y))}function aL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aL(Object(n),!0).forEach(function(r){$Ne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $Ne(e,t,n){return(t=BNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BNe(e){var t=UNe(e,"string");return typeof t=="symbol"?t:t+""}function UNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var p8=0,qNe={xAxis:{},yAxis:{},zAxis:{}},m8=Pr({name:"cartesianAxis",initialState:qNe,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:an()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:an()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:an()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:an()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:an()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:an()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:an()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:an()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:an()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,o=i.widthHistory||[];if(o.length===3&&o[0]===o[2]&&r===o[1]&&r!==i.width&&Math.abs(r-((a=o[0])!==null&&a!==void 0?a:0))<=1)return;var c=[...o,r].slice(-3);e.yAxis[n]=sL(sL({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:FNe,replaceXAxis:HNe,removeXAxis:KNe,addYAxis:GNe,replaceYAxis:VNe,removeYAxis:QNe,addZAxis:Oze,replaceZAxis:Eze,removeZAxis:_ze,updateYAxisWidth:YNe}=m8.actions,WNe=m8.reducer,ZNe=se([tr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),XNe=se([ZNe,Ms,Is],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),_A=()=>Ue(XNe),JNe=()=>Ue(TSe);function oL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Aj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oL(Object(n),!0).forEach(function(r){eke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eke(e,t,n){return(t=tke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tke(e){var t=nke(e,"string");return typeof t=="symbol"?t:t+""}function nke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rke=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var c={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=Aj(Aj(Aj({},c),Yh(i)),hC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(n8,d),x.createElement(Er,{className:"recharts-active-dot",clipPath:o},f)};function lL(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=er.activeDot}=e,c=Ue(ic),d=JNe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return gn(f)?null:x.createElement(ra,{zIndex:o},x.createElement(rke,{point:f,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var cL=(e,t,n)=>{var r=n??e;if(!gn(r))return va(r,t,0)},ike=(e,t,n)=>{var r={},i=e.filter(R0),a=e.filter(f=>f.stackId==null),o=i.reduce((f,p)=>{var m=f[p.stackId];return m==null&&(m=[]),m.push(p),f[p.stackId]=m,f},r),c=Object.entries(o).map(f=>{var p,[m,y]=f,v=y.map(b=>b.dataKey),S=cL(t,n,(p=y[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:S}}),d=a.map(f=>{var p=[f.dataKey].filter(y=>y!=null),m=cL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...c,...d]};function uL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uL(Object(n),!0).forEach(function(r){ake(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ake(e,t,n){return(t=ske(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ske(e){var t=oke(e,"string");return typeof t=="symbol"?t:t+""}function oke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lke(e,t,n,r,i){var a,o=r.length;if(!(o<1)){var c=va(e,n,0,!0),d,f=[];if(ft((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/o,y=r.reduce((E,C)=>E+(C.barSize||0),0);y+=(o-1)*c,y>=n&&(y-=(o-1)*c,c=0),y>=n&&m>0&&(p=!0,m*=.9,y=o*m);var v=(n-y)/2>>0,S={offset:v-c,size:0};d=r.reduce((E,C)=>{var O,z={stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:S.offset+S.size+c,size:p?m:(O=C.barSize)!==null&&O!==void 0?O:0}},A=[...E,z];return S=z.position,A},f)}else{var b=va(t,n,0,!0);n-2*b-(o-1)*c<=0&&(c=0);var j=(n-2*b-(o-1)*c)/o;j>1&&(j>>=0);var k=ft(i)?Math.min(j,i):j;d=r.reduce((E,C,O)=>[...E,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b+(j+c)*O+(j-k)/2,size:k}}],f)}return d}}var cke=(e,t,n,r,i,a,o)=>{var c=gn(o)?t:o,d=lke(n,r,i!==a?i:a,e,c);return i!==a&&d!=null&&(d=d.map(f=>pg(pg({},f),{},{position:pg(pg({},f.position),{},{offset:f.position.offset-i/2})}))),d},uke=(e,t)=>{var n=P0(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(o=>o.key===n)}}}},dke=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function fke(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ft(e.zIndex)?e.zIndex:t}var hke=e=>{var{chartData:t}=e,n=on(),r=Rr();return x.useEffect(()=>r?()=>{}:(n(jI(t)),()=>{n(jI(void 0))}),[t,n,r]),null},dL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},g8=Pr({name:"brush",initialState:dL,reducers:{setBrushSettings(e,t){return t.payload==null?dL:t.payload}}}),{setBrushSettings:zze}=g8.actions,pke=g8.reducer;function mke(e){return(e%180+180)%180}var gke=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=mke(i),o=a*Math.PI/180,c=Math.atan(r/n),d=o>c&&o<Math.PI-c?r/Math.sin(o):n/Math.cos(o);return Math.abs(d)},yke={dots:[],areas:[],lines:[]},y8=Pr({name:"referenceElements",initialState:yke,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Vi(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Vi(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Vi(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Tze,removeDot:Pze,addArea:Rze,removeArea:Dze,addLine:Mze,removeLine:Ize}=y8.actions,vke=y8.reducer,xke=x.createContext(void 0),bke=e=>{var{children:t}=e,[n]=x.useState("".concat(Sh("recharts"),"-clip")),r=_A();if(r==null)return null;var{x:i,y:a,width:o,height:c}=r;return x.createElement(xke.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:c,width:o}))),t)};function v8(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function wke(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return gke(r,n)}function Ske(e,t,n){var r=n==="width",{x:i,y:a,width:o,height:c}=e;return t===1?{start:r?i:a,end:r?i+o:a+c}:{start:r?i+o:a+c,end:r?i:a}}function Mh(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function jke(e,t){return v8(e,t+1)}function Nke(e,t,n,r,i){for(var a=(r||[]).slice(),{start:o,end:c}=t,d=0,f=1,p=o,m=function(){var S=r?.[d];if(S===void 0)return{v:v8(r,f)};var b=d,j,k=()=>(j===void 0&&(j=n(S,b)),j),E=S.coordinate,C=d===0||Mh(e,E,k,p,c);C||(d=0,p=o,f+=1),C&&(p=E+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function kke(e,t,n,r,i){var a=(r||[]).slice(),o=a.length;if(o===0)return[];for(var{start:c,end:d}=t,f=1;f<=o;f++){for(var p=(o-1)%f,m=c,y=!0,v=function(){var O=r[b];if(O==null)return 0;var z=b,A,_=()=>(A===void 0&&(A=n(O,z)),A),R=O.coordinate,$=b===p||Mh(e,R,_,m,d);if(!$)return y=!1,1;$&&(m=R+e*(_()/2+i))},S,b=p;b<o&&(S=v(),!(S!==0&&S===1));b+=f);if(y){for(var j=[],k=p;k<o;k+=f){var E=r[k];E!=null&&j.push(E)}return j}}return[]}function fL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fL(Object(n),!0).forEach(function(r){Cke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cke(e,t,n){return(t=Ake(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ake(e){var t=Oke(e,"string");return typeof t=="symbol"?t:t+""}function Oke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eke(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,{start:c}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var S=v,b,j=()=>(b===void 0&&(b=n(v,y)),b);if(y===o-1){var k=e*(S.coordinate+e*j()/2-d);a[y]=S=Sr(Sr({},S),{},{tickCoord:k>0?S.coordinate-k*e:S.coordinate})}else a[y]=S=Sr(Sr({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var E=Mh(e,S.tickCoord,j,c,d);E&&(d=S.tickCoord-e*(j()/2+i),a[y]=Sr(Sr({},S),{},{isShow:!0}))}},p=o-1;p>=0;p--)f(p);return a}function _ke(e,t,n,r,i,a){var o=(r||[]).slice(),c=o.length,{start:d,end:f}=t;if(a){var p=r[c-1];if(p!=null){var m=n(p,c-1),y=e*(p.coordinate+e*m/2-f);if(o[c-1]=p=Sr(Sr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=Mh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),o[c-1]=Sr(Sr({},p),{},{isShow:!0}))}}}for(var S=a?c-1:c,b=function(E){var C=o[E];if(C==null)return 1;var O=C,z,A=()=>(z===void 0&&(z=n(C,E)),z);if(E===0){var _=e*(O.coordinate-e*A()/2-d);o[E]=O=Sr(Sr({},O),{},{tickCoord:_<0?O.coordinate-_*e:O.coordinate})}else o[E]=O=Sr(Sr({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var R=Mh(e,O.tickCoord,A,d,f);R&&(d=O.tickCoord+e*(A()/2+i),o[E]=Sr(Sr({},O),{},{isShow:!0}))}},j=0;j<S;j++)b(j);return o}function zA(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:o,orientation:c,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Te(d)||np.isSsr){var y;return(y=jke(i,Te(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],S=c==="top"||c==="bottom"?"width":"height",b=p&&S==="width"?lh(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(z,A)=>{var _=typeof f=="function"?f(z.value,A):z.value;return S==="width"?wke(lh(_,{fontSize:t,letterSpacing:n}),b,m):lh(_,{fontSize:t,letterSpacing:n})[S]},k=i[0],E=i[1],C=i.length>=2&&k!=null&&E!=null?ri(E.coordinate-k.coordinate):1,O=Ske(a,C,S);return d==="equidistantPreserveStart"?Nke(C,O,j,i,o):d==="equidistantPreserveEnd"?kke(C,O,j,i,o):(d==="preserveStart"||d==="preserveStartEnd"?v=_ke(C,O,j,i,o,d==="preserveStartEnd"):v=Eke(C,O,j,i,o),v.filter(z=>z.isShow))}var zke=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,o=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>o&&(o=m.width)}});var c=n?n.getBoundingClientRect().width:0,d=i+a,f=o+d+c+(n?r:0);return Math.round(f)}return 0},Tke={xAxis:{},yAxis:{}},x8=Pr({name:"renderedTicks",initialState:Tke,reducers:{setRenderedTicks:(e,t)=>{var{axisType:n,axisId:r,ticks:i}=t.payload;e[n][r]=i},removeRenderedTicks:(e,t)=>{var{axisType:n,axisId:r}=t.payload;delete e[n][r]}}}),{setRenderedTicks:Pke,removeRenderedTicks:Rke}=x8.actions,Dke=x8.reducer,Mke=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Ike(e,t){if(e==null)return{};var n,r,i=Lke(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lke(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ac.apply(null,arguments)}function hL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hL(Object(n),!0).forEach(function(r){$ke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ke(e,t,n){return(t=Bke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bke(e){var t=Uke(e,"string");return typeof t=="symbol"?t:t+""}function Uke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Os={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:er.axis};function qke(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:o,axisLine:c,otherSvgProps:d}=e;if(!c)return null;var f=Sn(Sn(Sn({},d),Zi(c)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!o||a==="bottom"&&o);f=Sn(Sn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!o||a==="right"&&o);f=Sn(Sn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",ac({},f,{className:Rt("recharts-cartesian-axis-line",Wu(c,"className"))}))}function Fke(e,t,n,r,i,a,o,c,d){var f,p,m,y,v,S,b=c?-1:1,j=e.tickSize||o,k=Te(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!c*i,m=y-b*j,S=m-b*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!c*r,f=p-b*j,v=f-b*d,S=k;break;case"right":m=y=e.coordinate,p=t+ +c*r,f=p+b*j,v=f+b*d,S=k;break;default:f=p=e.coordinate,y=n+ +c*i,m=y+b*j,S=m+b*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:S}}}function Hke(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function Kke(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function Gke(e){var{option:t,tickProps:n,value:r}=e,i,a=Rt(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Sn(Sn({},n),{},{className:a}));else if(typeof t=="function")i=t(Sn(Sn({},n),{},{className:a}));else{var o="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(o=Rt(o,W1e(t))),i=x.createElement(OA,ac({},n,{className:o}),r)}return i}function Vke(e){var{ticks:t,axisType:n,axisId:r}=e,i=on();return x.useEffect(()=>{if(r==null||n==null)return mc;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(Pke({ticks:a,axisId:r,axisType:n})),()=>{i(Rke({axisId:r,axisType:n}))}},[i,t,r,n]),null}var Qke=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:o,unit:c,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:S,height:b,tickSize:j,tickMargin:k,fontSize:E,letterSpacing:C,getTicksConfig:O,events:z,axisType:A,axisId:_}=e,R=zA(Sn(Sn({},O),{},{ticks:n}),E,C),$=Zi(O),F=Yh(r),q=GF($.textAnchor)?$.textAnchor:Hke(p,m),B=Kke(p,m),V={};typeof i=="object"&&(V=i);var X=Sn(Sn({},$),{},{fill:"none"},V),Z=R.map(ue=>Sn({entry:ue},Fke(ue,y,v,S,b,p,j,m,k))),H=Z.map(ue=>{var{entry:we,line:I}=ue;return x.createElement(Er,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(we.value,"-").concat(we.coordinate,"-").concat(we.tickCoord)},i&&x.createElement("line",ac({},X,I,{className:Rt("recharts-cartesian-axis-tick-line",Wu(i,"className"))})))}),J=Z.map((ue,we)=>{var I,D,{entry:U,tick:M}=ue,Q=Sn(Sn(Sn(Sn({verticalAnchor:B},$),{},{textAnchor:q,stroke:"none",fill:a},M),{},{index:we,payload:U,visibleTicksCount:R.length,tickFormatter:o,padding:d},f),{},{angle:(I=(D=f?.angle)!==null&&D!==void 0?D:$.angle)!==null&&I!==void 0?I:0}),oe=Sn(Sn({},Q),F);return x.createElement(Er,ac({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},a0(z,U,we)),r&&x.createElement(Gke,{option:r,tickProps:oe,value:"".concat(typeof o=="function"?o(U.value,we):U.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},x.createElement(Vke,{ticks:R,axisId:_,axisType:A}),J.length>0&&x.createElement(ra,{zIndex:er.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},J)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},H))}),Yke=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:o,ticks:c,axisType:d,axisId:f}=e,p=Ike(e,Mke),[m,y]=x.useState(""),[v,S]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return zke({ticks:b.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=x.useCallback(k=>{if(k){var E=k.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=E;var C=E[0];if(C){var O=window.getComputedStyle(C),z=O.fontSize,A=O.letterSpacing;(z!==m||A!==v)&&(y(z),S(A))}}},[m,v]);return o||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(ra,{zIndex:e.zIndex},x.createElement(Er,{className:Rt("recharts-cartesian-axis",a)},x.createElement(qke,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Zi(e)}),x.createElement(Qke,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(z1e,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(U1e,{label:e.label,labelRef:e.labelRef}),e.children)))}),TA=x.forwardRef((e,t)=>{var n=Tr(e,Os);return x.createElement(Yke,ac({},n,{ref:t}))});TA.displayName="CartesianAxis";var Wke=["x1","y1","x2","y2","key"],Zke=["offset"],Xke=["xAxisId","yAxisId"],Jke=["xAxisId","yAxisId"];function pL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pL(Object(n),!0).forEach(function(r){eCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eCe(e,t,n){return(t=tCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tCe(e){var t=nCe(e,"string");return typeof t=="symbol"?t:t+""}function nCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Rl(){return Rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rl.apply(null,arguments)}function uv(e,t){if(e==null)return{};var n,r,i=rCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rCe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var iCe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:o,ry:c}=e;return x.createElement("rect",{x:r,y:i,ry:c,width:a,height:o,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function b8(e){var{option:t,lineItemProps:n}=e,r;if(x.isValidElement(t))r=x.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var i,{x1:a,y1:o,x2:c,y2:d,key:f}=n,p=uv(n,Wke),m=(i=Zi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=uv(m,Zke);r=x.createElement("line",Rl({},v,{x1:a,y1:o,x2:c,y2:d,fill:"none",key:f}))}return r}function aCe(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=uv(e,Xke),d=i.map((f,p)=>{var m=Cr(Cr({},c),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(b8,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function sCe(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:o}=e,c=uv(e,Jke),d=i.map((f,p)=>{var m=Cr(Cr({},c),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(b8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function oCe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:o,horizontalPoints:c,horizontal:d=!0}=e;if(!d||!t||!t.length||c==null)return null;var f=c.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],S=v==null,b=S?i+o-m:v-m;if(b<=0)return null;var j=y%t.length;return x.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:b,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function lCe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:o,height:c,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],S=v==null,b=S?i+o-m:v-m;if(b<=0)return null;var j=y%n.length;return x.createElement("rect",{key:"react-".concat(y),x:m,y:a,width:b,height:c,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var cCe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return Q6(zA(Cr(Cr(Cr({},Os),n),{},{ticks:Y6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},uCe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return Q6(zA(Cr(Cr(Cr({},Os),n),{},{ticks:Y6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},dCe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:er.grid};function w8(e){var t=kC(),n=CC(),r=tU(),i=Cr(Cr({},Tr(e,dCe)),{},{x:Te(e.x)?e.x:r.left,y:Te(e.y)?e.y:r.top,width:Te(e.width)?e.width:r.width,height:Te(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:o,x:c,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,S=Rr(),b=Ue($=>uI($,"xAxis",a,S)),j=Ue($=>uI($,"yAxis",o,S));if(!Ga(f)||!Ga(p)||!Te(c)||!Te(d))return null;var k=i.verticalCoordinatesGenerator||cCe,E=i.horizontalCoordinatesGenerator||uCe,{horizontalPoints:C,verticalPoints:O}=i;if((!C||!C.length)&&typeof E=="function"){var z=y&&y.length,A=E({yAxis:j?Cr(Cr({},j),{},{ticks:z?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},z?!0:m);zy(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(C=A)}if((!O||!O.length)&&typeof k=="function"){var _=v&&v.length,R=k({xAxis:b?Cr(Cr({},b),{},{ticks:_?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);zy(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(O=R)}return x.createElement(ra,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(iCe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(oCe,Rl({},i,{horizontalPoints:C})),x.createElement(lCe,Rl({},i,{verticalPoints:O})),x.createElement(aCe,Rl({},i,{offset:r,horizontalPoints:C,xAxis:b,yAxis:j})),x.createElement(sCe,Rl({},i,{offset:r,verticalPoints:O,xAxis:b,yAxis:j}))))}w8.displayName="CartesianGrid";var fCe={},S8=Pr({name:"errorBars",initialState:fCe,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:Lze,replaceErrorBar:$ze,removeErrorBar:Bze}=S8.actions,hCe=S8.reducer,pCe=["children"];function mCe(e,t){if(e==null)return{};var n,r,i=gCe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function gCe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yCe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},vCe=x.createContext(yCe);function xCe(e){var{children:t}=e,n=mCe(e,pCe);return x.createElement(vCe.Provider,{value:n},t)}function PA(e,t){var n,r,i=Ue(f=>$s(f,e)),a=Ue(f=>Bs(f,t)),o=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Fn.allowDataOverflow,c=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Hn.allowDataOverflow,d=o||c;return{needClip:d,needClipX:o,needClipY:c}}function j8(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=_A(),{needClipX:a,needClipY:o,needClip:c}=PA(t,n);if(!c||!i)return null;var{x:d,y:f,width:p,height:m}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:a?d:d-p/2,y:o?f:f-m/2,width:a?p:p*2,height:o?m:m*2}))}function bCe(e){var t=Yh(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),c=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(c)||c<0)&&(c=r),{r:o,strokeWidth:c}}return{r:n,strokeWidth:r}}function Za(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:p8}function Xa(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:p8}var N8=(e,t,n)=>$o(e,"xAxis",Za(e,t),n),k8=(e,t,n)=>Lo(e,"xAxis",Za(e,t),n),C8=(e,t,n)=>$o(e,"yAxis",Xa(e,t),n),A8=(e,t,n)=>Lo(e,"yAxis",Xa(e,t),n),wCe=se([Lt,N8,C8,k8,A8],(e,t,n,r,i)=>Wa(e,"xAxis")?Xu(t,r,!1):Xu(n,i,!1)),SCe=(e,t)=>t,O8=se([F0,SCe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),E8=e=>{var t=Lt(e),n=Wa(t,"xAxis");return n?"yAxis":"xAxis"},jCe=(e,t)=>{var n=E8(e);return n==="yAxis"?Xa(e,t):Za(e,t)},NCe=(e,t,n)=>ev(e,E8(e),jCe(e,t),n),kCe=se([O8,NCe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=P0(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a?.find(c=>c.key===i);if(o!=null)return o.map(c=>[c[0],c[1]])}}}),CCe=se([Lt,N8,C8,k8,A8,kCe,SU,wCe,O8,$ve],(e,t,n,r,i,a,o,c,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=o;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:v}=d,S;if(v&&v.length>0?S=v:S=p?.slice(m,y+1),S!=null)return GCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:S,chartBaseValue:f,bandSize:c})}}),ACe=["id"],OCe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function ql(){return ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ql.apply(null,arguments)}function _8(e,t){if(e==null)return{};var n,r,i=ECe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ECe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function mL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ou(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mL(Object(n),!0).forEach(function(r){_Ce(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Ce(e,t,n){return(t=zCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zCe(e){var t=TCe(e,"string");return typeof t=="symbol"?t:t+""}function TCe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dv(e,t){return e&&e!=="none"?e:t}var PCe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:dv(r,i),value:g0(n,t),payload:e}]},RCe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:c,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:mc,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:g0(o,t),hide:c,type:f,color:dv(r,a),unit:d,graphicalItemId:p}};return x.createElement(c8,{tooltipEntrySettings:m})});function DCe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,c=Zi(r);return x.createElement(LNe,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:c,needClip:i,clipPathId:t})}function MCe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,c,d={x:(o=a.x)!==null&&o!==void 0?o:0,y:(c=a.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ou(Ou({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(JF,{value:t?i:void 0},n)}function gL(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:c,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=_8(a,ACe),v=Zi(y),S=Fr(y);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Er,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(sh,ql({},S,{id:m,points:t,connectNulls:f,type:c,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(sh,ql({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(sh,ql({},v,{className:"recharts-area-curve",layout:o,type:c,connectNulls:f,fill:"none",points:n}))),x.createElement(DCe,{points:t,props:y,clipPathId:i}))}function ICe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,c=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!ft(c)||!ft(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.x||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Te(p)?x.createElement("rect",{x:0,y:c<d?c:c-f,width:p+(o?parseInt("".concat(o),10):1),height:Math.floor(f)}):null}function LCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,c=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!ft(c)||!ft(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.y||0));return Te(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Te(p)?x.createElement("rect",{x:c<d?c:c-f,y:0,width:f,height:Math.floor(p+(o?parseInt("".concat(o),10):1))}):null}function $Ce(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(ICe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(LCe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function BCe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:o,baseLine:c,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,S=x.useMemo(()=>({points:o,baseLine:c}),[o,c]),b=C0(S,"recharts-area-"),j=AC(),[k,E]=x.useState(!1),C=!k,O=x.useCallback(()=>{typeof v=="function"&&v(),E(!1)},[v]),z=x.useCallback(()=>{typeof y=="function"&&y(),E(!0)},[y]);if(j==null)return null;var A=i.current,_=a.current;return x.createElement(MCe,{showLabels:C,points:o},r.children,x.createElement(k0,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:O,onAnimationStart:z,key:b},R=>{if(A){var $=A.length/o.length,F=R===1?o:o.map((B,V)=>{var X=Math.floor(V*$);if(A[X]){var Z=A[X];return Ou(Ou({},B),{},{x:mn(Z.x,B.x,R),y:mn(Z.y,B.y,R)})}return B}),q;return Te(c)?q=mn(_,c,R):gn(c)||ya(c)?q=mn(_,0,R):q=c.map((B,V)=>{var X=Math.floor(V*$);if(Array.isArray(_)&&_[X]){var Z=_[X];return Ou(Ou({},B),{},{x:mn(Z.x,B.x,R),y:mn(Z.y,B.y,R)})}return B}),R>0&&(i.current=F,a.current=q),x.createElement(gL,{points:F,baseLine:q,needClip:t,clipPathId:n,props:r})}return R>0&&(i.current=o,a.current=c),x.createElement(Er,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement($Ce,{alpha:R,points:o,baseLine:c,layout:j,strokeWidth:r.strokeWidth}))),x.createElement(Er,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(gL,{points:o,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(t8,{label:r.label}))}function UCe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(BCe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class qCe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:c,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:S}=this.props;if(t)return null;var b=Rt("recharts-area",i),j=y,{r:k,strokeWidth:E}=bCe(n),C=a8(n),O=k*2+E,z=c?"url(#clipPath-".concat(C?"":"dots-").concat(j,")"):void 0;return x.createElement(ra,{zIndex:S},x.createElement(Er,{className:b},c&&x.createElement("defs",null,x.createElement(j8,{clipPathId:j,xAxisId:d,yAxisId:f}),!C&&x.createElement("clipPath",{id:"clipPath-dots-".concat(j)},x.createElement("rect",{x:o-O/2,y:a-O/2,width:p+O,height:m+O}))),x.createElement(UCe,{needClip:c,clipPathId:j,props:this.props})),x.createElement(lL,{points:r,mainColor:dv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:z}),this.props.isRange&&Array.isArray(v)&&x.createElement(lL,{points:v,mainColor:dv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:z}))}}var FCe={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:er.area};function HCe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:o,dot:c,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:S,yAxisId:b}=e,j=_8(e,OCe),k=gc(),E=TF(),{needClip:C}=PA(S,b),O=Rr(),{points:z,isRange:A,baseLine:_}=(t=Ue(V=>CCe(V,e.id,O)))!==null&&t!==void 0?t:{},R=_A();if(k!=="horizontal"&&k!=="vertical"||R==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:$,width:F,x:q,y:B}=R;return!z||!z.length?null:x.createElement(qCe,ql({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:_,connectNulls:o,dot:c,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:A,legendType:y,needClip:C,points:z,stroke:v,width:F,left:q,top:B,xAxisId:S,yAxisId:b}))}var KCe=(e,t,n,r,i)=>{var a=n??t;if(Te(a))return a;var o=e==="horizontal"?i:r,c=o.scale.domain();if(o.type==="number"){var d=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]};function GCe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:c,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,S=i&&i.length,b=KCe(a,o,n,c,d),j=a==="horizontal",k=!1,E=f.map((O,z)=>{var A,_,R,$;if(S)$=i[p+z];else{var F=En(O,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var q=(A=(_=$)===null||_===void 0?void 0:_[1])!==null&&A!==void 0?A:null,B=q==null||S&&!t&&En(O,r)==null;if(j){var V;return{x:nD({axis:c,ticks:m,bandSize:v,entry:O,index:z}),y:B?null:(V=d.scale.map(q))!==null&&V!==void 0?V:null,value:$,payload:O}}return{x:B?null:(R=c.scale.map(q))!==null&&R!==void 0?R:null,y:nD({axis:d,ticks:y,bandSize:v,entry:O,index:z}),value:$,payload:O}}),C;return S||k?C=E.map(O=>{var z,A=Array.isArray(O.value)?O.value[0]:null;if(j){var _;return{x:O.x,y:A!=null&&O.y!=null&&(_=d.scale.map(A))!==null&&_!==void 0?_:null,payload:O.payload}}return{x:A!=null&&(z=c.scale.map(A))!==null&&z!==void 0?z:null,y:O.y,payload:O.payload}}):C=j?d.scale.map(b):c.scale.map(b),{points:E,baseLine:C??0,isRange:k}}function VCe(e){var t=Tr(e,FCe),n=Rr();return x.createElement(d8,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(u8,{legendPayload:PCe(t)}),x.createElement(RCe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),x.createElement(h8,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:W6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(HCe,ql({},t,{id:r}))))}var Eu=x.memo(VCe,xd);Eu.displayName="Area";function vN(){return vN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vN.apply(null,arguments)}function RA(e){return x.createElement(xNe,vN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var QCe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Te(t))return t;var a=Te(r)||gn(r);return a?t(r,i):(a||Es(!1),n)}},YCe=(e,t,n)=>n,WCe=(e,t)=>t,fp=se([F0,WCe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),ZCe=se([fp],e=>e?.maxBarSize),XCe=(e,t,n,r)=>r,JCe=se([Lt,F0,Za,Xa,YCe],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),eAe=(e,t,n)=>{var r=Lt(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null))return r==="horizontal"?ev(e,"yAxis",a,n):ev(e,"xAxis",i,n)},tAe=(e,t)=>{var n=Lt(e),r=Za(e,t),i=Xa(e,t);if(!(r==null||i==null))return n==="horizontal"?cI(e,"xAxis",r):cI(e,"yAxis",i)},nAe=se([JCe,Lve,tAe],ike),rAe=(e,t,n)=>{var r,i,a=fp(e,t);if(a==null)return 0;var o=Za(e,t),c=Xa(e,t);if(o==null||c==null)return 0;var d=Lt(e),f=RU(e),{maxBarSize:p}=a,m=gn(p)?f:p,y,v;return d==="horizontal"?(y=$o(e,"xAxis",o,n),v=Lo(e,"xAxis",o,n)):(y=$o(e,"yAxis",c,n),v=Lo(e,"yAxis",c,n)),(r=(i=Xu(y,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},z8=(e,t,n)=>{var r=Lt(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null)){var o,c;return r==="horizontal"?(o=$o(e,"xAxis",i,n),c=Lo(e,"xAxis",i,n)):(o=$o(e,"yAxis",a,n),c=Lo(e,"yAxis",a,n)),Xu(o,c)}},iAe=se([nAe,RU,Ive,DU,rAe,z8,ZCe],cke),aAe=(e,t,n)=>{var r=Za(e,t);if(r!=null)return $o(e,"xAxis",r,n)},sAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return $o(e,"yAxis",r,n)},oAe=(e,t,n)=>{var r=Za(e,t);if(r!=null)return Lo(e,"xAxis",r,n)},lAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Lo(e,"yAxis",r,n)},cAe=se([iAe,fp],dke),uAe=se([eAe,fp],uke),dAe=se([tr,SC,aAe,sAe,oAe,lAe,cAe,Lt,SU,z8,uAe,fp,XCe],(e,t,n,r,i,a,o,c,d,f,p,m,y)=>{var{chartData:v,dataStartIndex:S,dataEndIndex:b}=d;if(!(m==null||o==null||t==null||c!=="horizontal"&&c!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:j}=m,k;if(j!=null&&j.length>0?k=j:k=v?.slice(S,b+1),k!=null)return $Ae({layout:c,barSettings:m,pos:o,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:k,offset:e,cells:y,dataStartIndex:S})}}),fAe=["index"];function xN(){return xN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xN.apply(null,arguments)}function hAe(e,t){if(e==null)return{};var n,r,i=pAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function pAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var T8=x.createContext(void 0),mAe=e=>{var t=x.useContext(T8);if(t!=null)return t.stackId;if(e!=null)return W6(e)},gAe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),yAe=e=>{var t=x.useContext(T8);if(t!=null){var{stackId:n}=t;return"url(#".concat(gAe(n,e),")")}},P8=e=>{var{index:t}=e,n=hAe(e,fAe),r=yAe(t);return x.createElement(Er,xN({className:"recharts-bar-stack-layer",clipPath:r},n))},vAe=["onMouseEnter","onMouseLeave","onClick"],xAe=["value","background","tooltipPosition"],bAe=["id"],wAe=["onMouseEnter","onClick","onMouseLeave"];function Bo(){return Bo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bo.apply(null,arguments)}function yL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yL(Object(n),!0).forEach(function(r){SAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SAe(e,t,n){return(t=jAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jAe(e){var t=NAe(e,"string");return typeof t=="symbol"?t:t+""}function NAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fv(e,t){if(e==null)return{};var n,r,i=kAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var CAe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:g0(n,t),payload:e}]},AAe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:o,unit:c,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:mc,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:g0(a,t),hide:o,type:d,color:i,unit:c,graphicalItemId:f}};return x.createElement(c8,{tooltipEntrySettings:p})});function OAe(e){var t=Ue(ic),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:o,onMouseLeave:c,onClick:d}=a,f=fv(a,vAe),p=s8(o,r,a.id),m=o8(c),y=l8(d,r,a.id);if(!i||n==null)return null;var v=Yh(i);return x.createElement(ra,{zIndex:fke(i,er.barBackground)},n.map((S,b)=>{var{value:j,background:k,tooltipPosition:E}=S,C=fv(S,xAe);if(!k)return null;var O=p(S,b),z=m(S,b),A=y(S,b),_=$r($r($r($r($r({option:i,isActive:String(b)===t},C),{},{fill:"#eee"},k),v),a0(f,S,b)),{},{onMouseEnter:O,onMouseLeave:z,onClick:A,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(RA,Bo({key:"background-bar-".concat(b)},_))}))}function EAe(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return $r($r({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return x.createElement(JF,{value:t?i:void 0},n)}function _Ae(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:o}=e,c=Ue(ic),d=Ue(EF),f=n&&String(i.originalDataIndex)===c&&(d==null||o===d),[p,m]=x.useState(!1),[y,v]=x.useState(!1);x.useEffect(()=>{var C;return f?(m(!0),C=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(C)}},[f]);var S=x.useCallback(()=>{f||m(!1)},[f]),b=f&&y,j=f||p,k;f?n===!0?k=t:k=n:k=t;var E=x.createElement(RA,Bo({},r,{name:String(r.name)},i,{isActive:b,option:k,index:a,dataKey:o,onTransitionEnd:S}));return j?x.createElement(ra,{zIndex:er.activeBar},x.createElement(P8,{index:i.originalDataIndex},E)):E}function zAe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(RA,Bo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function TAe(e){var t,{data:n,props:r}=e,i=(t=Zi(r))!==null&&t!==void 0?t:{},{id:a}=i,o=fv(i,bAe),{shape:c,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:y}=r,v=fv(r,wAe),S=s8(p,d,a),b=o8(y),j=l8(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,E)=>x.createElement(P8,Bo({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(E),className:"recharts-bar-rectangle"},a0(v,k,E),{onMouseEnter:S(k,E),onMouseLeave:b(k,E),onClick:j(k,E)}),f?x.createElement(_Ae,{shape:c,activeBar:f,baseProps:o,entry:k,index:E,dataKey:d}):x.createElement(zAe,{shape:c,baseProps:o,entry:k,index:E,dataKey:d})))):null}function PAe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:o,animationDuration:c,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,y=C0(t,"recharts-bar-"),[v,S]=x.useState(!1),b=!v,j=x.useCallback(()=>{typeof f=="function"&&f(),S(!1)},[f]),k=x.useCallback(()=>{typeof p=="function"&&p(),S(!0)},[p]);return x.createElement(EAe,{showLabels:b,rects:r},x.createElement(k0,{animationId:y,begin:o,duration:c,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:y},E=>{var C=E===1?r:r?.map((O,z)=>{var A=m&&m[z];if(A)return $r($r({},O),{},{x:mn(A.x,O.x,E),y:mn(A.y,O.y,E),width:mn(A.width,O.width,E),height:mn(A.height,O.height,E)});if(i==="horizontal"){var _=mn(0,O.height,E),R=mn(O.stackedBarStart,O.y,E);return $r($r({},O),{},{y:R,height:_})}var $=mn(0,O.width,E),F=mn(O.stackedBarStart,O.x,E);return $r($r({},O),{},{width:$,x:F})});return E>0&&(n.current=C??null),C==null?null:x.createElement(Er,null,x.createElement(TAe,{props:t,data:C}))}),x.createElement(t8,{label:t.label}),t.children)}function RAe(e){var t=x.useRef(null);return x.createElement(PAe,{previousRectanglesRef:t,props:e})}var R8=0,DAe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:En(e,t)}};class MAe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:o,needClip:c,background:d,id:f}=this.props;if(t||n==null)return null;var p=Rt("recharts-bar",i),m=f;return x.createElement(Er,{className:p,id:f},c&&x.createElement("defs",null,x.createElement(j8,{clipPathId:m,xAxisId:a,yAxisId:o})),x.createElement(Er,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(m,")"):void 0},x.createElement(OAe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(RAe,this.props)))}}var IAe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:R8,xAxisId:0,yAxisId:0,zIndex:er.bar};function LAe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=PA(t,n),y=gc(),v=Rr(),S=eNe(e.children,av),b=Ue(E=>dAe(E,e.id,v,S));if(y!=="vertical"&&y!=="horizontal")return null;var j,k=b?.[0];return k==null||k.height==null||k.width==null?j=0:j=y==="vertical"?k.height/2:k.width/2,x.createElement(xCe,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:DAe,errorBarOffset:j},x.createElement(MAe,Bo({},e,{layout:y,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:o,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function $Ae(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:o,xAxis:c,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:y,offset:v,cells:S,parentViewBox:b,dataStartIndex:j}=e,k=t==="horizontal"?d:c,E=m?k.scale.domain():null,C=Sme({numericAxis:k}),O=k.scale.map(C);return y.map((z,A)=>{var _,R,$,F,q,B;if(m){var V=m[A+j];if(V==null)return null;_=yme(V,E)}else _=En(z,n),Array.isArray(_)||(_=[C,_]);var X=QCe(r,R8)(_[1],A);if(t==="horizontal"){var Z,H=d.scale.map(_[0]),J=d.scale.map(_[1]);if(H==null||J==null)return null;R=rD({axis:c,ticks:f,bandSize:o,offset:a.offset,entry:z,index:A}),$=(Z=J??H)!==null&&Z!==void 0?Z:void 0,F=a.size;var ue=H-J;if(q=ya(ue)?0:ue,B={x:R,y:v.top,width:F,height:v.height},Math.abs(X)>0&&Math.abs(q)<Math.abs(X)){var we=ri(q||X)*(Math.abs(X)-Math.abs(q));$-=we,q+=we}}else{var I=c.scale.map(_[0]),D=c.scale.map(_[1]);if(I==null||D==null)return null;if(R=I,$=rD({axis:d,ticks:p,bandSize:o,offset:a.offset,entry:z,index:A}),F=D-I,q=a.size,B={x:v.left,y:$,width:v.width,height:q},Math.abs(X)>0&&Math.abs(F)<Math.abs(X)){var U=ri(F||X)*(Math.abs(X)-Math.abs(F));F+=U}}if(R==null||$==null||F==null||q==null||!i&&(F===0||q===0))return null;var M=$r($r({},z),{},{stackedBarStart:O,x:R,y:$,width:F,height:q,value:m?_:_[1],payload:z,background:B,tooltipPosition:{x:R+F/2,y:$+q/2},parentViewBox:b,originalDataIndex:A},S&&S[A]&&S[A].props);return M}).filter(Boolean)}function BAe(e){var t=Tr(e,IAe),n=mAe(t.stackId),r=Rr();return x.createElement(d8,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(u8,{legendPayload:CAe(t)}),x.createElement(AAe,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),x.createElement(h8,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),x.createElement(ra,{zIndex:t.zIndex},x.createElement(LAe,Bo({},t,{id:i})))))}var bN=x.memo(BAe,xd);bN.displayName="Bar";var UAe=["domain","range"],qAe=["domain","range"];function vL(e,t){if(e==null)return{};var n,r,i=FAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function FAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function xL(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function D8(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=vL(e,UAe),{domain:a,range:o}=t,c=vL(t,qAe);return!xL(n,a)||!xL(r,o)?!1:xd(i,c)}var HAe=["type"],KAe=["dangerouslySetInnerHTML","ticks","scale"],GAe=["id","scale"];function wN(){return wN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wN.apply(null,arguments)}function bL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bL(Object(n),!0).forEach(function(r){VAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VAe(e,t,n){return(t=QAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QAe(e){var t=YAe(e,"string");return typeof t=="symbol"?t:t+""}function YAe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function SN(e,t){if(e==null)return{};var n,r,i=WAe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function WAe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ZAe(e){var t=on(),n=x.useRef(null),r=AC(),{type:i}=e,a=SN(e,HAe),o=_0(r,"xAxis",i),c=x.useMemo(()=>{if(o!=null)return wL(wL({},a),{},{type:o})},[a,o]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(FNe(c)):n.current!==c&&t(HNe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(KNe(n.current)),n.current=null)},[t]),null}var XAe=e=>{var{xAxisId:t,className:n}=e,r=Ue(SC),i=Rr(),a="xAxis",o=Ue(k=>oF(k,a,t,i)),c=Ue(k=>iF(k,t)),d=Ue(k=>bwe(k,t)),f=Ue(k=>Cq(k,t));if(c==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=SN(e,KAe),{id:S,scale:b}=f,j=SN(f,GAe);return x.createElement(TA,wN({},v,j,{x:d.x,y:d.y,width:c.width,height:c.height,className:Rt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:o,axisType:a,axisId:t}))},JAe={allowDataOverflow:Fn.allowDataOverflow,allowDecimals:Fn.allowDecimals,allowDuplicatedCategory:Fn.allowDuplicatedCategory,angle:Fn.angle,axisLine:Os.axisLine,height:Fn.height,hide:!1,includeHidden:Fn.includeHidden,interval:Fn.interval,label:!1,minTickGap:Fn.minTickGap,mirror:Fn.mirror,orientation:Fn.orientation,padding:Fn.padding,reversed:Fn.reversed,scale:Fn.scale,tick:Fn.tick,tickCount:Fn.tickCount,tickLine:Os.tickLine,tickSize:Os.tickSize,type:Fn.type,niceTicks:Fn.niceTicks,xAxisId:0},eOe=e=>{var t=Tr(e,JAe);return x.createElement(x.Fragment,null,x.createElement(ZAe,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(XAe,t))},Ih=x.memo(eOe,D8);Ih.displayName="XAxis";var tOe=["type"],nOe=["dangerouslySetInnerHTML","ticks","scale"],rOe=["id","scale"];function jN(){return jN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jN.apply(null,arguments)}function SL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function jL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SL(Object(n),!0).forEach(function(r){iOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iOe(e,t,n){return(t=aOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aOe(e){var t=sOe(e,"string");return typeof t=="symbol"?t:t+""}function sOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NN(e,t){if(e==null)return{};var n,r,i=oOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oOe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function lOe(e){var t=on(),n=x.useRef(null),r=AC(),{type:i}=e,a=NN(e,tOe),o=_0(r,"yAxis",i),c=x.useMemo(()=>{if(o!=null)return jL(jL({},a),{},{type:o})},[o,a]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(GNe(c)):n.current!==c&&t(VNe({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(QNe(n.current)),n.current=null)},[t]),null}function cOe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),o=x.useRef(null),c=Ue(SC),d=Rr(),f=on(),p="yAxis",m=Ue(A=>aF(A,t)),y=Ue(A=>Swe(A,t)),v=Ue(A=>oF(A,p,t,d)),S=Ue(A=>Aq(A,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||EA(i)||x.isValidElement(i)||S==null)){var A=a.current;if(A){var _=A.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&f(YNe({id:t,width:_}))}}},[v,m,f,i,t,r,S]),m==null||y==null||S==null)return null;var{dangerouslySetInnerHTML:b,ticks:j,scale:k}=e,E=NN(e,nOe),{id:C,scale:O}=S,z=NN(S,rOe);return x.createElement(TA,jN({},E,z,{ref:a,labelRef:o,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Rt("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:v,axisType:p,axisId:t}))}var uOe={allowDataOverflow:Hn.allowDataOverflow,allowDecimals:Hn.allowDecimals,allowDuplicatedCategory:Hn.allowDuplicatedCategory,angle:Hn.angle,axisLine:Os.axisLine,hide:!1,includeHidden:Hn.includeHidden,interval:Hn.interval,label:!1,minTickGap:Hn.minTickGap,mirror:Hn.mirror,orientation:Hn.orientation,padding:Hn.padding,reversed:Hn.reversed,scale:Hn.scale,tick:Hn.tick,tickCount:Hn.tickCount,tickLine:Os.tickLine,tickSize:Os.tickSize,type:Hn.type,niceTicks:Hn.niceTicks,width:Hn.width,yAxisId:0},dOe=e=>{var t=Tr(e,uOe);return x.createElement(x.Fragment,null,x.createElement(lOe,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(cOe,t))},Lh=x.memo(dOe,D8);Lh.displayName="YAxis";var fOe=(e,t)=>t,DA=se([fOe,Lt,qU,rr,kF,Us,HSe,tr],ZSe);function hOe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function MA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(hOe(e)){var i=e.currentTarget.getBBox();n=i.width>0?t.width/i.width:1,r=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;n=a.offsetWidth>0?t.width/a.offsetWidth:1,r=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(c,d)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>o(c.clientX,c.clientY)):o(e.clientX,e.clientY)}var M8=Ai("mouseClick"),I8=Xh();I8.startListening({actionCreator:M8,effect:(e,t)=>{var n=e.payload,r=DA(t.getState(),MA(n));r?.activeIndex!=null&&t.dispatch(Lwe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var kN=Ai("mouseMove"),L8=Xh(),pu=null,yl=null,Oj=null;L8.startListening({actionCreator:kN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a?.includes("mousemove");pu!==null&&(cancelAnimationFrame(pu),pu=null),yl!==null&&(typeof i!="number"||!o)&&(clearTimeout(yl),yl=null),Oj=MA(n);var c=()=>{var d=t.getState(),f=up(d,d.tooltip.settings.shared);if(!Oj){pu=null,yl=null;return}if(f==="axis"){var p=DA(d,Oj);p?.activeIndex!=null?t.dispatch(mF({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(pF())}pu=null,yl=null};if(!o){c();return}i==="raf"?pu=requestAnimationFrame(c):typeof i=="number"&&yl===null&&(yl=setTimeout(c,i))}});function pOe(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var NL={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},$8=Pr({name:"rootProps",initialState:NL,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:NL.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),mOe=$8.reducer,{updateOptions:gOe}=$8.actions,yOe=null,vOe={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},B8=Pr({name:"polarOptions",initialState:yOe,reducers:vOe}),{updatePolarOptions:Uze}=B8.actions,xOe=B8.reducer,U8=Ai("keyDown"),q8=Ai("focus"),F8=Ai("blur"),V0=Xh(),mu=null,vl=null,mg=null;V0.startListening({actionCreator:U8,effect:(e,t)=>{mg=e.payload,mu!==null&&(cancelAnimationFrame(mu),mu=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");vl!==null&&(typeof r!="number"||!a)&&(clearTimeout(vl),vl=null);var o=()=>{try{var c=t.getState(),d=c.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=c.tooltip,p=mg;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=oh(f,rc(c),id(c),ad(c)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,S=Us(c),b=rc(c),j=up(c,c.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=rv(c,j,"hover",String(f.index));t.dispatch(nv({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var E=Awe(c),C=E==="left-to-right"?1:-1,O=p==="ArrowRight"?1:-1,z;if(v){var A=id(c),_=ad(c),R=O*C,$=X=>({active:!1,index:String(X),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(z=-1,R>0){for(var F=0;F<b.length;F++)if(oh($(F),b,A,_)!=null){z=F;break}}else for(var q=b.length-1;q>=0;q--)if(oh($(q),b,A,_)!=null){z=q;break}if(z<0)return}else{z=y+O*C;var B=S?.length||b.length;if(B===0||z>=B||z<0)return}var V=rv(c,j,"hover",String(z));t.dispatch(nv({active:!0,activeIndex:z.toString(),activeCoordinate:V}))}finally{mu=null,vl=null}};if(!a){o();return}r==="raf"?mu=requestAnimationFrame(o):typeof r=="number"&&vl===null&&(o(),mg=null,vl=setTimeout(()=>{mg?o():(vl=null,mu=null)},r))}});V0.startListening({actionCreator:q8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=up(n,n.tooltip.settings.shared),c=rv(n,o,"hover",String(a));t.dispatch(nv({active:!0,activeIndex:a,activeCoordinate:c}))}}}});V0.startListening({actionCreator:F8,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(nv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function H8(e){e.persist();var{currentTarget:t}=e;return new Proxy(e,{get:(n,r)=>{if(r==="currentTarget")return t;var i=Reflect.get(n,r);return typeof i=="function"?i.bind(n):i}})}var Ui=Ai("externalEvent"),K8=Xh(),gg=new Map,Ff=new Map,Ej=new Map;K8.startListening({actionCreator:Ui,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=H8(r);Ej.set(i,{handler:n,reactEvent:a});var o=gg.get(i);o!==void 0&&(cancelAnimationFrame(o),gg.delete(i));var c=t.getState(),{throttleDelay:d,throttledEvents:f}=c.eventSettings,p=f,m=p==="all"||p?.includes(i),y=Ff.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),Ff.delete(i));var v=()=>{var j=Ej.get(i);try{if(!j)return;var{handler:k,reactEvent:E}=j,C=t.getState(),O={activeCoordinate:ESe(C),activeDataKey:EF(C),activeIndex:ic(C),activeLabel:OF(C),activeTooltipIndex:ic(C),isTooltipActive:_Se(C)};k&&k(O,E)}finally{gg.delete(i),Ff.delete(i),Ej.delete(i)}};if(!m){v();return}if(d==="raf"){var S=requestAnimationFrame(v);gg.set(i,S)}else if(typeof d=="number"){if(!Ff.has(i)){v();var b=setTimeout(v,d);Ff.set(i,b)}}else v()}}});var bOe=se([Ad],e=>e.tooltipItemPayloads),wOe=se([bOe,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),G8=Ai("touchMove"),V8=Xh(),xl=null,mo=null,kL=null,Hf=null;V8.startListening({actionCreator:G8,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Hf=H8(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,o=a==="all"||a.includes("touchmove");xl!==null&&(cancelAnimationFrame(xl),xl=null),mo!==null&&(typeof i!="number"||!o)&&(clearTimeout(mo),mo=null),kL=Array.from(n.touches).map(d=>MA({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var c=()=>{if(Hf!=null){var d=t.getState(),f=up(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=kL)===null||p===void 0?void 0:p[0];if(m==null){xl=null,mo=null;return}var y=DA(d,m);y?.activeIndex!=null&&t.dispatch(mF({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,S=Hf.touches[0];if(document.elementFromPoint==null||S==null)return;var b=document.elementFromPoint(S.clientX,S.clientY);if(!b||!b.getAttribute)return;var j=b.getAttribute(Eme),k=(v=b.getAttribute(_me))!==null&&v!==void 0?v:void 0,E=xc(d).find(z=>z.id===k);if(j==null||E==null||k==null)return;var{dataKey:C}=E,O=wOe(d,j,k);t.dispatch(hF({activeDataKey:C,activeIndex:j,activeCoordinate:O,activeGraphicalItemId:k}))}xl=null,mo=null}};if(!o){c();return}i==="raf"?xl=requestAnimationFrame(c):typeof i=="number"&&mo===null&&(c(),Hf=null,mo=setTimeout(()=>{Hf?c():(mo=null,xl=null)},i))}}});var Q8={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Y8=Pr({name:"eventSettings",initialState:Q8,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:SOe}=Y8.actions,jOe=Y8.reducer,NOe=x6({brush:pke,cartesianAxis:WNe,chartData:Aje,errorBars:hCe,eventSettings:jOe,graphicalItems:ONe,layout:fme,legend:jge,options:Sje,polarAxis:Y1e,polarOptions:xOe,referenceElements:vke,renderedTicks:Dke,rootProps:mOe,tooltip:$we,zIndex:uje}),kOe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Ipe({reducer:NOe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([I8.middleware,L8.middleware,V0.middleware,K8.middleware,V8.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(R6({type:"raf"}))},devTools:{serialize:{replacer:pOe},name:"recharts-".concat(n)}})};function COe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Rr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=kOe(t,r));var o=mC;return x.createElement(Uge,{context:o,store:a.current},n)}function AOe(e){var{layout:t,margin:n}=e,r=on(),i=Rr();return x.useEffect(()=>{i||(r(cme(t)),r(lme(n)))},[r,i,t,n]),null}var OOe=x.memo(AOe,xd);function EOe(e){var t=on();return x.useEffect(()=>{t(gOe(e))},[t,e]),null}var _Oe=e=>{var t=on();return x.useEffect(()=>{t(SOe(e))},[t,e]),null},zOe=x.memo(_Oe,xd);function CL(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=on();return x.useLayoutEffect(()=>(r.current&&i(lje({zIndex:t,element:r.current,isPanorama:n})),()=>{i(cje({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function AL(e){var{children:t,isPanorama:n}=e,r=Ue(JSe);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return x.createElement(x.Fragment,null,i.map(o=>x.createElement(CL,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>x.createElement(CL,{key:o,zIndex:o,isPanorama:n})))}var TOe=["children"];function POe(e,t){if(e==null)return{};var n,r,i=ROe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ROe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function hv(){return hv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hv.apply(null,arguments)}var DOe={width:"100%",height:"100%",display:"block"},MOe=x.forwardRef((e,t)=>{var n=kC(),r=CC(),i=fU();if(!Ga(n)||!Ga(r))return null;var{children:a,otherAttributes:o,title:c,desc:d}=e,f,p;return o!=null&&(typeof o.tabIndex=="number"?f=o.tabIndex:f=i?0:void 0,typeof o.role=="string"?p=o.role:p=i?"application":void 0),x.createElement(aC,hv({},o,{title:c,desc:d,role:p,tabIndex:f,width:n,height:r,style:DOe,ref:t}),a)}),IOe=e=>{var{children:t}=e,n=Ue(b0);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return x.createElement(aC,{width:r,height:i,x:o,y:a},t)},OL=x.forwardRef((e,t)=>{var{children:n}=e,r=POe(e,TOe),i=Rr();return i?x.createElement(IOe,null,x.createElement(AL,{isPanorama:!0},n)):x.createElement(MOe,hv({ref:t},r),x.createElement(AL,{isPanorama:!1},n))});function LOe(){var e=on(),[t,n]=x.useState(null),r=Ue(Ome);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ft(a)&&a!==r&&e(dme(a))}},[t,e,r]),n}function EL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $Oe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EL(Object(n),!0).forEach(function(r){BOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BOe(e,t,n){return(t=UOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UOe(e){var t=qOe(e,"string");return typeof t=="symbol"?t:t+""}function qOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ro(){return Ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ro.apply(null,arguments)}var FOe=()=>(Mje(),null);function pv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var HOe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,o]=x.useState({containerWidth:pv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:pv((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((f,p)=>{o(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=x.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();c(p,m);var y=S=>{var b=S[0];if(b!=null){var{width:j,height:k}=b.contentRect;c(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,c]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(ep,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Ro({ref:d},e)))}),KOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:pv(n),containerHeight:pv(r)}),o=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),c=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();o(f,p)}},[t,o]);return x.createElement(x.Fragment,null,x.createElement(ep,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Ro({ref:c},e)))}),GOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(ep,{width:n,height:r}),x.createElement("div",Ro({ref:t},e)))}),VOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(KOe,Ro({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(GOe,Ro({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(ep,{width:n,height:r}),x.createElement("div",Ro({ref:t},e)))});function QOe(e){return e?HOe:VOe}var YOe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:c,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:S,onTouchStart:b,style:j,width:k,responsive:E,dispatchTouchEvents:C=!0}=e,O=x.useRef(null),z=on(),[A,_]=x.useState(null),[R,$]=x.useState(null),F=LOe(),q=jC(),B=q?.width>0?q.width:k,V=q?.height>0?q.height:i,X=x.useCallback(he=>{F(he),typeof t=="function"&&t(he),_(he),$(he),he!=null&&(O.current=he)},[F,t,_,$]),Z=x.useCallback(he=>{z(M8(he)),z(Ui({handler:a,reactEvent:he}))},[z,a]),H=x.useCallback(he=>{z(kN(he)),z(Ui({handler:f,reactEvent:he}))},[z,f]),J=x.useCallback(he=>{z(pF()),z(Ui({handler:p,reactEvent:he}))},[z,p]),ue=x.useCallback(he=>{z(kN(he)),z(Ui({handler:m,reactEvent:he}))},[z,m]),we=x.useCallback(()=>{z(q8())},[z]),I=x.useCallback(()=>{z(F8())},[z]),D=x.useCallback(he=>{z(U8(he.key))},[z]),U=x.useCallback(he=>{z(Ui({handler:o,reactEvent:he}))},[z,o]),M=x.useCallback(he=>{z(Ui({handler:c,reactEvent:he}))},[z,c]),Q=x.useCallback(he=>{z(Ui({handler:d,reactEvent:he}))},[z,d]),oe=x.useCallback(he=>{z(Ui({handler:y,reactEvent:he}))},[z,y]),ne=x.useCallback(he=>{z(Ui({handler:b,reactEvent:he}))},[z,b]),Ae=x.useCallback(he=>{C&&z(G8(he)),z(Ui({handler:S,reactEvent:he}))},[z,C,S]),_e=x.useCallback(he=>{z(Ui({handler:v,reactEvent:he}))},[z,v]),ee=QOe(E);return x.createElement(IF.Provider,{value:A},x.createElement(RB.Provider,{value:R},x.createElement(ee,{width:B??j?.width,height:V??j?.height,className:Rt("recharts-wrapper",r),style:$Oe({position:"relative",cursor:"default",width:B,height:V},j),onClick:Z,onContextMenu:U,onDoubleClick:M,onFocus:we,onBlur:I,onKeyDown:D,onMouseDown:Q,onMouseEnter:H,onMouseLeave:J,onMouseMove:ue,onMouseUp:oe,onTouchEnd:_e,onTouchMove:Ae,onTouchStart:ne,ref:X},x.createElement(FOe,null),n)))}),WOe=["width","height","responsive","children","className","style","compact","title","desc"];function ZOe(e,t){if(e==null)return{};var n,r,i=XOe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function XOe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var JOe=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:o,style:c,compact:d,title:f,desc:p}=e,m=ZOe(e,WOe),y=Zi(m);return d?x.createElement(x.Fragment,null,x.createElement(ep,{width:n,height:r}),x.createElement(OL,{otherAttributes:y,title:f,desc:p},a)):x.createElement(YOe,{className:o,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(OL,{otherAttributes:y,title:f,desc:p,ref:t},x.createElement(bke,null,a)))});function CN(){return CN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},CN.apply(null,arguments)}function _L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eEe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_L(Object(n),!0).forEach(function(r){tEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_L(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tEe(e,t,n){return(t=nEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nEe(e){var t=rEe(e,"string");return typeof t=="symbol"?t:t+""}function rEe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var iEe={top:5,right:5,bottom:5,left:5},aEe=eEe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:iEe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},Q8),W8=x.forwardRef(function(t,n){var r,i=Tr(t.categoricalChartProps,aEe),{chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:o,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(COe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(hke,{chartData:f.data}),x.createElement(OOe,{layout:i.layout,margin:i.margin}),x.createElement(zOe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(EOe,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),x.createElement(JOe,CN({},i,{ref:n})))}),sEe=["axis","item"],oEe=x.forwardRef((e,t)=>x.createElement(W8,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:sEe,tooltipPayloadSearcher:LF,categoricalChartProps:e,ref:t})),lEe=["axis"],AN=x.forwardRef((e,t)=>x.createElement(W8,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:lEe,tooltipPayloadSearcher:LF,categoricalChartProps:e,ref:t}));const Bu={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},Ao={fill:"#71717a",fontSize:11},cEe="#27272a",sd="#27272a",Uu=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function Z8(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function ON(e){return Z8(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function EN(e){const t=Z8(e);return`${t.getMonth()+1}/${t.getDate()}`}function IA(e){switch(e){case Vf.connected:return"positive";case Vf.paused:return"caution";case Vf.error:return"negative";case Vf.archived:return"neutral"}}function uEe(e){const t={};return e.kind&&e.kind!=="all"&&(t.kind=e.kind),e.sourceId&&(t.sourceId=e.sourceId),e.sinceMinutes!==void 0&&(t.since=new Date(Date.now()-e.sinceMinutes*6e4).toISOString()),e.limit!==void 0&&(t.limit=e.limit),t}function dEe(e){return Ar({queryKey:e?Re.serverTraffic.sources(e):["server-traffic","disabled"],queryFn:()=>cQ(e),enabled:!!e,staleTime:ws})}function fEe(e){return Ar({queryKey:e?Re.serverTraffic.status(e):["server-traffic","status-disabled"],queryFn:()=>uQ(e),enabled:!!e,staleTime:ws})}function hEe(e,t){return Ar({queryKey:e&&t?Re.serverTraffic.sourceDetail(e,t):["server-traffic","detail-disabled"],queryFn:()=>q5(e,t),enabled:!!(e&&t),staleTime:ws})}function pEe(e,t){return Ar({queryKey:e?Re.serverTraffic.events(e,t):["server-traffic","events-disabled"],queryFn:()=>dQ(e,uEe(t)),enabled:!!e,staleTime:ws})}function mEe(e){const t=Kr();return oc({mutationFn:n=>{if(!e)throw new Error("Project is required to connect a Cloud Run source");return fQ(e,n)},onSuccess:()=>{e&&t.invalidateQueries({queryKey:Re.serverTraffic.project(e)})}})}function gEe(e,t){const n=Kr();return oc({mutationFn:r=>{if(!e||!t)throw new Error("Project and sourceId are required to sync");return hQ(e,t,r??void 0)},onSuccess:()=>{e&&(n.invalidateQueries({queryKey:Re.serverTraffic.project(e)}),n.invalidateQueries({queryKey:Re.runs.all}))}})}const yEe=6,od="__other__",qu="_socialTotal";function vEe(e,t=yEe){const n=new Map;for(const p of e)n.set(p.source,(n.get(p.source)??0)+p.sessions);const r=[...n.entries()].sort((p,m)=>m[1]!==p[1]?m[1]-p[1]:p[0].localeCompare(m[0])),i=r.slice(0,t),a=new Set(i.map(([p])=>p)),o=Math.max(0,r.length-t),c=new Map;for(const p of e){let m=c.get(p.date);m||(m={date:p.date,[qu]:0},c.set(p.date,m));const y=a.has(p.source)?p.source:od;m[y]=(m[y]??0)+p.sessions,m[qu]=(m[qu]??0)+p.sessions}const d=[...c.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return o>0&&f.push(od),{data:d,sources:f,otherCount:o}}function Fu(e){return e.replace(/\+/g," ")}function X8(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const xEe=["7d","30d","90d","all"],wo=Uu,_N="#71717a",J8="#52525b",Kf=25;function yg(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function e9(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 r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function bEe({projectName:e}){const{data:t,isLoading:n,isError:r}=fEe(e);if(n)return l.jsx(ze,{className:"p-5",children:l.jsx("div",{className:"text-sm text-zinc-500",children:"Loading server activity…"})});if(r)return l.jsx(ze,{className:"p-5",children:l.jsx("div",{className:"text-sm text-rose-400",children:"Failed to load server activity."})});const i=t?.sources??[];return l.jsxs("section",{children:[l.jsx("div",{className:"flex items-baseline justify-between mb-3",children:l.jsxs("div",{children:[l.jsx("div",{className:"eyebrow",children:"Server activity (last 24h)"}),l.jsx("h2",{className:"text-lg font-semibold text-zinc-50",children:"Engine crawler hits & AI-referral sessions"}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Server-side log evidence of bots crawling the site and AI-referral sessions — orthogonal to GA4 click-through traffic below. "," ",l.jsx(jt,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Manage sources →"})]})]})}),i.length===0?l.jsx(ze,{className:"p-5",children:l.jsxs("div",{className:"text-sm text-zinc-400",children:["No server traffic source connected yet."," ",l.jsx(jt,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Connect a Cloud Run source"})," ","to surface bot crawls and AI referrals straight from server logs."]})}):l.jsx(ze,{className:"overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-zinc-900/50 text-[10px] uppercase tracking-wide text-zinc-500",children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Source"}),l.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Status"}),l.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Crawler hits 24h"}),l.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"AI sessions 24h"}),l.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Last sync"}),l.jsx("th",{className:"text-left px-4 py-2 font-medium","aria-label":"open"})]})}),l.jsx("tbody",{children:i.map(a=>l.jsxs("tr",{className:"border-t border-zinc-800/60",children:[l.jsx("td",{className:"px-4 py-3 text-zinc-100",children:a.displayName}),l.jsx("td",{className:"px-4 py-3",children:l.jsx(ct,{tone:IA(a.status),children:a.status})}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.crawlerHits.toLocaleString("en-US")}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.aiReferralHits.toLocaleString("en-US")}),l.jsx("td",{className:"px-4 py-3 text-right text-zinc-400 text-xs",children:a.lastSyncedAt?e9(a.lastSyncedAt):"never"}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsx(jt,{to:"/traffic/$projectName/$sourceId",params:{projectName:e,sourceId:a.id},className:"text-blue-400 hover:underline text-xs",children:"Detail →"})})]},a.id))})]})})]})}function wEe({projectName:e}){return l.jsxs("div",{className:"space-y-10",children:[l.jsx(bEe,{projectName:e}),l.jsx(SEe,{projectName:e})]})}function SEe({projectName:e}){const t=Kr(),[n,r]=x.useState(null),[i,a]=x.useState(null),[o,c]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(null),[S,b]=x.useState(null),[j,k]=x.useState("sessions"),[E,C]=x.useState("desc"),[O,z]=x.useState("sessions"),[A,_]=x.useState("desc"),[R,$]=x.useState("sessions"),[F,q]=x.useState("desc"),[B,V]=x.useState("sessions"),[X,Z]=x.useState("desc"),[H,J]=x.useState([]),[ue,we]=x.useState([]),[I,D]=x.useState([]),[U,M]=x.useState(!1),[Q,oe]=x.useState("30d");async function ne(je){c(!0),v(null);try{const Xe=await t.fetchQuery({queryKey:Re.traffic.status(e),queryFn:()=>nQ(e),staleTime:ws});if(je.current)return;if(r(Xe),!Xe.connected){a(null),J([]),we([]),D([]),c(!1);return}const[Ve,et,Wn,Ei]=await Promise.all([t.fetchQuery({queryKey:Re.traffic.summary(e,Q),queryFn:()=>rQ(e,void 0,Q),staleTime:ws}),t.fetchQuery({queryKey:Re.traffic.aiHistory(e,Q),queryFn:()=>aQ(e,Q).catch(()=>[]),staleTime:ws}),t.fetchQuery({queryKey:Re.traffic.sessionHistory(e,Q),queryFn:()=>oQ(e,Q).catch(()=>[]),staleTime:ws}),t.fetchQuery({queryKey:Re.traffic.socialHistory(e,Q),queryFn:()=>sQ(e,Q).catch(()=>[]),staleTime:ws})]);if(je.current)return;a(Ve),J(et),we(Wn),D(Ei),c(!1)}catch(Xe){if(je.current)return;v(Xe instanceof Error?Xe.message:"Failed to load GA4 data"),c(!1)}}x.useEffect(()=>{const je={current:!1};return ne(je),()=>{je.current=!0}},[e,Q,t]);async function Ae(){f(!0),v(null),b(null);try{const je=await U5(e);b(`Synced ${je.rowCount.toLocaleString()} page rows, ${je.aiReferralCount.toLocaleString()} AI and ${je.socialReferralCount.toLocaleString()} social referral rows (${je.days} days)`),await t.invalidateQueries({queryKey:Re.traffic.project(e)}),await ne({current:!1})}catch(je){v(je instanceof Error?je.message:"Sync failed")}finally{f(!1)}}async function _e(){m(!0),v(null),b(null);try{await lQ(e),await t.invalidateQueries({queryKey:Re.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(je){v(je instanceof Error?je.message:"Disconnect failed")}finally{m(!1)}}function ee(je){j===je?C(Xe=>Xe==="desc"?"asc":"desc"):(k(je),C("desc"))}function he(je){O===je?_(Xe=>Xe==="desc"?"asc":"desc"):(z(je),_("desc"))}function Ee(je){R===je?q(Xe=>Xe==="desc"?"asc":"desc"):($(je),q("desc"))}function G(je){B===je?Z(Xe=>Xe==="desc"?"asc":"desc"):(V(je),Z("desc"))}const Fe=x.useMemo(()=>i?.topPages?[...i.topPages].sort((je,Xe)=>{const Ve=je[j],et=Xe[j];return typeof Ve=="string"&&typeof et=="string"?E==="asc"?Ve.localeCompare(et):et.localeCompare(Ve):E==="asc"?Ve-et:et-Ve}):[],[i?.topPages,j,E]),De=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((je,Xe)=>{const Ve=je[O],et=Xe[O];return typeof Ve=="string"&&typeof et=="string"?A==="asc"?Ve.localeCompare(et):et.localeCompare(Ve):A==="asc"?Ve-et:et-Ve}):[],[i?.aiReferrals,O,A]),rt=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((je,Xe)=>{const Ve=je[B],et=Xe[B];return typeof Ve=="string"&&typeof et=="string"?X==="asc"?Ve.localeCompare(et):et.localeCompare(Ve):X==="asc"?Ve-et:et-Ve}):[],[i?.aiReferralLandingPages,B,X]),Qe=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((je,Xe)=>{const Ve=je[R],et=Xe[R];return typeof Ve=="string"&&typeof et=="string"?F==="asc"?Ve.localeCompare(et):et.localeCompare(Ve):F==="asc"?Ve-et:et-Ve}):[],[i?.socialReferrals,R,F]),{socialChartData:en,socialChartSources:Ut,socialOtherCount:ln}=x.useMemo(()=>{const je=vEe(I);return{socialChartData:je.data,socialChartSources:je.sources,socialOtherCount:je.otherCount}},[I]),{chartData:_t,chartSources:be,dateRange:Je}=x.useMemo(()=>{const je=[...new Set(H.map(Yt=>Yt.source))],Xe=new Map;for(const Yt of ue)Xe.set(Yt.date,{_totalSessions:Yt.sessions,_organicSessions:Yt.organicSessions});const Ve=new Map;for(const Yt of H){const fi=`${Yt.date}::${Yt.source}`,Ja=Ve.get(fi)??0;Ve.set(fi,Math.max(Ja,Yt.sessions))}for(const[Yt,fi]of Ve){const[Ja,ka]=Yt.split("::");let ia=Xe.get(Ja);ia||(ia={_totalSessions:0,_organicSessions:0},Xe.set(Ja,ia)),ia[ka]=(ia[ka]??0)+fi}const et=[...Xe.entries()].sort(([Yt],[fi])=>Yt.localeCompare(fi)).map(([Yt,fi])=>({date:Yt,...fi})),Wn=et.map(Yt=>Yt.date),Ei=Wn.length>0?{start:Wn[0],end:Wn[Wn.length-1]}:null;return{chartData:et,chartSources:je,dateRange:Ei}},[H,ue]);if(o&&!n)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!n?.connected)return l.jsx(jEe,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:Re.traffic.project(e)}),await ne({current:!1})))()}});const zt=i?.organicSharePctDisplay??"0%",Ct=i?.channelBreakdown?.organic.sharePctDisplay??zt,Ye=i?.channelBreakdown?.organic.sessions??i?.totalOrganicSessions??0,ce=i?.aiSessionsDeduped??0,Se=i?.channelBreakdown?.ai.sessions??i?.aiSessionsBySession??0,Pe=i?.channelBreakdown?.ai.sharePctDisplay??i?.aiSharePctBySessionDisplay??"0%",We=i?new Set(i.aiReferrals.map(je=>je.source.toLowerCase())).size:0,ut=De[0]??null,Qn=i?.totalDirectSessions??0,yr=i?.directSharePctDisplay??"0%",tn=i?.channelBreakdown?.direct.sessions??Qn,Gt=i?.channelBreakdown?.direct.sharePctDisplay??yr,cn=i?.channelBreakdown?.other.sessions??i?.otherSessions??0,it=i?.channelBreakdown?.other.sharePctDisplay??i?.otherSharePctDisplay??"0%",Yn=i?.socialSessions??0,me=i?.socialSharePctDisplay??"0%",Vr=i?.channelBreakdown?.social.sessions??Yn,vr=i?.channelBreakdown?.social.sharePctDisplay??me,kt=i?new Set(i.socialReferrals.map(je=>je.source.toLowerCase())).size:0,Qr=Qe[0]??null;return l.jsxs(l.Fragment,{children:[y&&l.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}),S&&l.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:S}),l.jsxs("div",{className:"flex items-center justify-between mb-6",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",l.jsx("span",{className:"text-zinc-300",children:n.propertyId}),n.clientEmail&&l.jsxs(l.Fragment,{children:[" · ",l.jsx("span",{className:"text-zinc-500",children:n.clientEmail})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(ge,{variant:"outline",size:"sm",disabled:d,onClick:Ae,children:[l.jsx(Jg,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),l.jsxs(ge,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:_e,children:[l.jsx(IY,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",l.jsx(mr,{text:`Aggregated traffic metrics from Google Analytics 4. Sessions and users are summed across the selected period.${i?.periodStart&&i?.periodEnd?` Data available: ${new Date(i.periodStart+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})} – ${new Date(i.periodEnd+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}.`:""} Organic sessions are Google organic search sessions specifically.`})]})]}),l.jsx("div",{className:"flex gap-1",children:xEe.map(je=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${Q===je?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>oe(je),children:je==="all"?"All":je},je))})]}),i?l.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[l.jsx(_j,{value:yg(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),l.jsx(_j,{value:yg(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${zt} of total`,tone:"positive"}),l.jsx(_j,{value:yg(i.totalUsers),label:"Total Users",subtitle:i.totalUsers.toLocaleString(),tone:"neutral"})]}):l.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),l.jsxs(ge,{variant:"outline",size:"sm",disabled:d,onClick:Ae,children:[l.jsx(Jg,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),"Sync from GA4"]})]})]}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Attribution"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Traffic by channel",l.jsx(mr,{text:"Decomposes GA4 sessions into five disjoint channels — known AI referrers first, then organic search, social, direct, and other channels. Known AI referrers are removed from their native GA4 channel before the residual Other bucket is computed. Other channels are the remaining GA4 session default channel groups, such as Referral, Email, Paid Search, Display, Cross-network, Shopping, Video, Affiliates, SMS, and Paid Other."})]})]}),Je&&l.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Je.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Je.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),_t.length>0&&l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:be.length>0?"AI vs. total sessions":"All sessions (baseline)"}),be.length===0&&l.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),be.length===0&&l.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),l.jsx("div",{className:"h-64",children:l.jsx(Ty,{width:"100%",height:"100%",children:l.jsxs(AN,{data:_t,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(Ih,{dataKey:"date",tick:Ao,tickLine:!1,axisLine:{stroke:sd},tickFormatter:EN}),l.jsx(Lh,{tick:Ao,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(iv,{...Bu,labelFormatter:ON,formatter:(je,Xe)=>{const Ve=typeof je=="number"?je.toLocaleString():String(je??0),et=String(Xe??"");return et==="_totalSessions"?[Ve,"Total Sessions"]:et==="_organicSessions"?[Ve,"Organic Sessions"]:[Ve,et]}}),l.jsx(uU,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:je=>je==="_totalSessions"?"Total Sessions":je==="_organicSessions"?"Organic Sessions":je}),l.jsx(Eu,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),be.map((je,Xe)=>l.jsx(Eu,{type:"monotone",dataKey:je,stackId:"ai",stroke:wo[Xe%wo.length],fill:wo[Xe%wo.length],fillOpacity:.4,strokeWidth:1.5},je))]})})})]}),l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[l.jsx(da,{label:"Organic",value:Ct,hint:`${Ye.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search'), after known AI referrers are removed for a disjoint channel breakdown."}),l.jsx(da,{label:"Social",value:vr,hint:`${Vr.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social'), after known AI referrers are removed for a disjoint channel breakdown."}),l.jsx(da,{label:"Direct",value:Gt,hint:`${tn.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions with no source — bookmarks, typed URLs, untagged email, in-app browsers, and AI-driven traffic whose referrer header was stripped. Known AI referrers are removed if GA4 classified them as Direct."}),l.jsx(da,{label:"Known AI referrers (lower bound)",value:Pe,hint:`${Se.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions whose current sessionSource matched a known AI engine (e.g. chatgpt.com, claude.ai, gemini.google.com). These sessions are removed from their native GA4 channel in this card grid so the five buckets stay disjoint. This is a strict lower bound: most AI traffic strips the referrer and falls into Direct, so the true AI share is typically higher than what's shown here. The detail table below also surfaces firstUserSource and UTM-tagged AI signals."}),l.jsx(da,{label:"Other channels",value:it,hint:`${cn.toLocaleString()} sessions`,tone:"neutral",tooltip:"Remaining GA4 session default channel groups after Known AI, Organic Search, Organic/Paid Social, and Direct are accounted for. This is a residual bucket, not a single source. It can include Referral, Email, Paid Search, Display, Cross-network, Shopping, Video, Affiliates, SMS, Mobile Push Notifications, Paid Other, and unclassified traffic."})]}),ut&&l.jsxs("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:["Top AI referrer: ",l.jsx("span",{className:"font-medium",children:ut.source})," via ",ut.medium,", accounting for ",ut.sessions.toLocaleString()," sessions."]})]}),l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:i.aiReferrals.length>0?`${We} unique sources, ${i.aiReferrals.length} rows`:"No source rows"})]}),i.aiReferrals.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(wr,{label:"Source",sortKey:"source",current:O,dir:A,onSort:he,align:"left"}),l.jsx(wr,{label:"Medium",sortKey:"medium",current:O,dir:A,onSort:he,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(wr,{label:"Sessions",sortKey:"sessions",current:O,dir:A,onSort:he,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(wr,{label:"Users",sortKey:"users",current:O,dir:A,onSort:he,align:"right"})]})}),l.jsx("tbody",{children:De.map(je=>l.jsx(kEe,{referral:je,totalSessions:ce},`${je.source}:${je.medium}:${je.sourceDimension}`))})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),l.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"AI engines that preserve a referrer (Perplexity, copy/paste from ChatGPT, etc.) will appear here. Most AI traffic strips the referrer — see the Direct cell above for the upper bound."})]})]}),l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — landing pages"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:rt.length>0?`${rt.length} rows`:"No landing-page rows"})]}),rt.length>0?l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(wr,{label:"Landing Page",sortKey:"landingPage",current:B,dir:X,onSort:G,align:"left"}),l.jsx(wr,{label:"Source",sortKey:"source",current:B,dir:X,onSort:G,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),l.jsx(wr,{label:"Sessions",sortKey:"sessions",current:B,dir:X,onSort:G,align:"right"}),l.jsx(wr,{label:"Users",sortKey:"users",current:B,dir:X,onSort:G,align:"right"})]})}),l.jsx("tbody",{children:rt.map(je=>l.jsx(CEe,{row:je},`${je.landingPage}:${je.source}:${je.medium}:${je.sourceDimension}`))})]})}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI landing pages detected yet"}),l.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"Known-AI landing pages appear after a GA4 sync records visits from AI referrers."})]})]})]})]}),i&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",l.jsx(mr,{text:"Tracks sessions classified as social traffic by GA4's default channel grouping (Organic Social and Paid Social). Google maintains the source-to-channel mapping."})]})]}),en.length>0&&l.jsxs(ze,{className:"surface-card p-5 mb-4",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]}),ln>0&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Ut.length-1," sources · ",ln," more grouped as Other"]})]}),l.jsx("div",{className:"h-64",children:l.jsx(Ty,{width:"100%",height:"100%",children:l.jsxs(AN,{data:en,margin:{top:4,right:4,bottom:0,left:0},children:[l.jsx(Ih,{dataKey:"date",tick:Ao,tickLine:!1,axisLine:{stroke:sd},tickFormatter:EN}),l.jsx(Lh,{tick:Ao,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),l.jsx(iv,{...Bu,labelFormatter:ON,formatter:(je,Xe)=>{const Ve=typeof je=="number"?je.toLocaleString():String(je??0),et=String(Xe??"");if(et===qu)return[Ve,"Total Social"];if(et===od){const Wn=`Other (${ln} source${ln===1?"":"s"})`;return[Ve,Wn]}return[Ve,Fu(et)]}}),l.jsx(Eu,{type:"monotone",dataKey:qu,stroke:J8,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Ut.map((je,Xe)=>{const et=je===od?_N:wo[Xe%wo.length];return l.jsx(Eu,{type:"monotone",dataKey:je,stackId:"social",stroke:et,fill:et,fillOpacity:.4,strokeWidth:1.5},je)})]})})}),l.jsx(OEe,{sources:Ut,otherCount:ln})]}),l.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),i.socialReferrals.length>0?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(da,{label:"Social Sessions",value:yg(Yn),hint:`${Yn.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),l.jsx(da,{label:"Share of Traffic",value:me,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),l.jsx(da,{label:"Platforms",value:String(kt),hint:`${i.socialReferrals.length} source rows`,tone:"neutral",tooltip:"Number of distinct social media platforms detected. Each unique source/medium combination counts as one source row."})]}),Qr&&l.jsxs("div",{className:"mt-4 rounded-lg border border-sky-800/40 bg-sky-500/6 px-4 py-3 text-sm text-sky-100",children:[l.jsx("p",{className:"text-xs uppercase tracking-wider text-sky-300/70 mb-1",children:"Top social source"}),l.jsx("p",{className:"font-medium truncate",title:`${Qr.source} via ${Qr.medium}`,children:X8(Fu(Qr.source),64)}),l.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Qr.medium,children:["via ",Fu(Qr.medium)," · ",Qr.sessions.toLocaleString()," sessions"]})]})]}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[l.jsx(da,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),l.jsx(da,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),l.jsx(da,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[l.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),l.jsx("p",{className:"text-xs text-zinc-500",children:"Sessions classified as Organic Social or Paid Social by GA4 will appear here. Google maintains the source-to-channel mapping, which includes Facebook, Instagram, X/Twitter, LinkedIn, Reddit, Pinterest, Snapchat, and other platforms."})]})]})]}),l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),l.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:i.socialReferrals.length>0?Qe.length>Kf&&!U?`Top ${Kf} of ${Qe.length}`:`${Qe.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm table-fixed",children:[l.jsxs("colgroup",{children:[l.jsx("col",{className:"w-[32%]"}),l.jsx("col",{className:"w-[22%]"}),l.jsx("col",{className:"w-[12%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[11%]"}),l.jsx("col",{className:"w-[12%]"})]}),l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(wr,{label:"Source",sortKey:"source",current:R,dir:F,onSort:Ee,align:"left"}),l.jsx(wr,{label:"Medium",sortKey:"medium",current:R,dir:F,onSort:Ee,align:"left"}),l.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),l.jsx(wr,{label:"Sessions",sortKey:"sessions",current:R,dir:F,onSort:Ee,align:"right"}),l.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),l.jsx(wr,{label:"Users",sortKey:"users",current:R,dir:F,onSort:Ee,align:"right"})]})}),l.jsx("tbody",{children:(U?Qe:Qe.slice(0,Kf)).map(je=>l.jsx(AEe,{referral:je,totalSessions:Yn},`${je.source}:${je.medium}:${je.channelGroup}`))})]})}),Qe.length>Kf&&l.jsx("div",{className:"mt-3 flex justify-center",children:l.jsx("button",{type:"button",onClick:()=>M(je=>!je),className:"text-xs text-zinc-400 hover:text-zinc-200 px-3 py-1 rounded-full border border-zinc-800 hover:border-zinc-700 transition-colors",children:U?`Show top ${Kf}`:`Show all ${Qe.length} sources`})})]}):l.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[l.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),l.jsx("p",{className:"text-xs text-zinc-500 max-w-sm",children:"When visitors arrive from Facebook, X/Twitter, LinkedIn, or other social platforms, their sessions will be broken down here by source and medium."})]})]})]})]})]}),i&&i.topPages.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"page-section-divider"}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),l.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",l.jsx(mr,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[l.jsx(wr,{label:"Landing Page",sortKey:"landingPage",current:j,dir:E,onSort:ee,align:"left"}),l.jsx(wr,{label:"Sessions",sortKey:"sessions",current:j,dir:E,onSort:ee,align:"right"}),l.jsx(wr,{label:"Organic",sortKey:"organicSessions",current:j,dir:E,onSort:ee,align:"right"}),l.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),l.jsx(wr,{label:"Users",sortKey:"users",current:j,dir:E,onSort:ee,align:"right"})]})}),l.jsx("tbody",{children:Fe.map(je=>l.jsx(NEe,{page:je},je.landingPage))})]})})]})]}),l.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[l.jsx("span",{children:i?.lastSyncedAt?`Last synced ${e9(i.lastSyncedAt)}`:"Never synced"}),l.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function jEe({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[o,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),y=x.useRef(null),v=x.useCallback(b=>{const j=b.target.files?.[0];if(!j)return;m(null),a(j.name);const k=new FileReader;k.onload=()=>{const E=k.result;try{const C=JSON.parse(E);if(!C.client_email||!C.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),c(null);return}c(E)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},k.onerror=()=>{m("Failed to read file."),c(null)},k.readAsText(j)},[]);async function S(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!o){m("Please upload a service account key file.");return}f(!0);try{await iQ(e,{propertyId:n.trim(),keyJson:o});try{await U5(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return l.jsxs(ze,{className:"surface-card p-6",children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),l.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."}),p&&l.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:p}),l.jsxs("div",{className:"mb-4",children:[l.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),l.jsx("input",{id:"ga4-property-id",type:"text",placeholder:"e.g. 123456789",value:n,onChange:b=>r(b.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"}),l.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)."})]}),l.jsxs("div",{className:"mb-5",children:[l.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),l.jsx("input",{ref:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),l.jsxs("button",{type:"button",onClick:()=>y.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:[l.jsx($Y,{className:"w-4 h-4 shrink-0"}),i?l.jsx("span",{className:"text-zinc-200 truncate",children:i}):l.jsx("span",{children:"Upload .json key file"})]}),l.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 ",l.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),l.jsx(ge,{variant:"default",size:"sm",disabled:d||!n.trim()||!o,onClick:S,children:d?"Connecting & syncing…":"Connect GA4"})]})}function wr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const o=n===t;return l.jsxs("th",{className:`py-1 font-medium cursor-pointer select-none hover:text-zinc-300 transition-colors ${a==="right"?"text-right":"text-left"}`,onClick:()=>i(t),children:[e,o&&l.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const t9={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function _j({value:e,label:t,subtitle:n,tone:r}){return l.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),l.jsx("p",{className:`text-2xl font-bold tabular-nums ${t9[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function da({value:e,label:t,hint:n,tone:r,tooltip:i}){return l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[l.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&l.jsx(mr,{text:i})]}),l.jsx("p",{className:`text-xl font-semibold tabular-nums ${t9[r]}`,children:e}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function NEe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const n9={session:"Session",first_user:"First Visit",manual_utm:"UTM"},r9={session:"Detected via GA4 sessionSource (referrer or utm_source for this session)",first_user:"Detected via GA4 firstUserSource (referrer from the user's first-ever visit)",manual_utm:"Detected via GA4 sessionManualSource (explicit utm_source parameter for the session)"};function kEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=n9[e.sourceDimension]??e.sourceDimension,i=r9[e.sourceDimension]??"";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),l.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),l.jsx("td",{className:"py-1.5",children:l.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:i,children:r})}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function CEe({row:e}){const t=n9[e.sourceDimension]??e.sourceDimension,n=r9[e.sourceDimension]??"";return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[360px] truncate",title:e.landingPage,children:e.landingPage}),l.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),l.jsx("td",{className:"py-1.5",children:l.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:n,children:t})}),l.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function AEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Fu(e.source),a=Fu(e.medium);return l.jsxs("tr",{className:"border-t border-zinc-800/40",children:[l.jsx("td",{className:"py-1.5 pr-3 text-zinc-200 truncate",title:e.source,children:i}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500 truncate",title:e.medium,children:a}),l.jsx("td",{className:"py-1.5 pr-3",children:l.jsx("span",{className:"inline-block text-[10px] px-1.5 py-0.5 rounded-full border border-zinc-700 text-zinc-400",title:`GA4 channel group: ${e.channelGroup}`,children:r})}),l.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),l.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),l.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function OEe({sources:e,otherCount:t}){const n=[{key:qu,color:J8,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===od)n.push({key:od,color:_N,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=Fu(i);n.push({key:i,color:wo[r%wo.length]??_N,label:X8(a,32),tooltip:a})}}return l.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5 text-[11px] text-zinc-400",children:n.map(r=>l.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[260px]",title:r.tooltip,children:[l.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm shrink-0",style:{backgroundColor:r.color},"aria-hidden":"true"}),l.jsx("span",{className:"truncate",children:r.label})]},r.key))})}function i9(e){e.invalidateQueries({queryKey:Re.runs.all}),e.invalidateQueries({queryKey:Re.projects.all})}function EEe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function _Ee(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 Q0(e,t){i3({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),gt({title:EEe(e.kind),detail:_Ee(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function zEe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){gt({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 i of t)i3({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=bne({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});gt({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:${r}`,dedupeMode:"replace"})}function Y0(e,t){if(e instanceof Or&&e.code==="RUN_IN_PROGRESS"){gt({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}gt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function a9(){const e=Kr();return oc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>hV(t,n),onSuccess:(t,n)=>{i9(e),Q0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Y0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function TEe(){const e=Kr();return oc({meta:{skipGlobalErrorToast:!0},mutationFn:t=>zV(t),onSuccess:t=>{i9(e),zEe(t)},onError:t=>{gt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function PEe(){const e=Kr();return oc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>I5(t,n),onSuccess:(t,n)=>{Kv(e,Nt["gsc-sync"],n.projectName),Q0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Y0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function REe(){const e=Kr();return oc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>HV(t),onSuccess:(t,n)=>{Kv(e,t.run.kind,n.projectName),Q0(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Y0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function DEe(){const e=Kr();return oc({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>qV(t,n),onSuccess:(t,n)=>{Kv(e,Nt["inspect-sitemap"],n.projectName),Q0(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Y0(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const MEe=["7d","30d","90d","all"];function IEe({projectName:e}){const t=Kr(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[o,c]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[y,v]=x.useState([]),[S,b]=x.useState(null),[j,k]=x.useState(""),[E,C]=x.useState(""),[O,z]=x.useState("30"),[A,_]=x.useState(!1),[R,$]=x.useState("30d"),[F,q]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,V]=x.useState(0),[X,Z]=x.useState(!1),[H,J]=x.useState(""),[ue,we]=x.useState(!0),[I,D]=x.useState(!1),[U,M]=x.useState(!1),[Q,oe]=x.useState(!1),[ne,Ae]=x.useState(!1),[_e,ee]=x.useState(!1),[he,Ee]=x.useState(!1),[G,Fe]=x.useState(null),[De,rt]=x.useState(!1),[Qe,en]=x.useState(!1),[Ut,ln]=x.useState(null),[_t,be]=x.useState(""),[Je,zt]=x.useState(!1),[Ct,Ye]=x.useState(!1),[ce,Se]=x.useState("indexed"),[Pe,We]=x.useState(null),ut=x.useMemo(()=>{if(!Pe)return d;const{key:Y,dir:Ne}=Pe;return[...d].sort((ht,Dt)=>{const $n=Y===ko.CTR?Number.isFinite(ht.ctr)?ht.ctr:0:ht[Y],Dr=Y===ko.CTR?Number.isFinite(Dt.ctr)?Dt.ctr:0:Dt[Y];return Ne==="asc"?$n-Dr:Dr-$n})},[d,Pe]),[Qn,yr]=x.useState([]),[tn,Gt]=x.useState(null),[cn,it]=x.useState(!1),[Yn,me]=x.useState(null),[Vr,vr]=x.useState(null),kt=i.find(Y=>Y.connectionType==="gsc"),Qr=d.length>0||p.length>0||y.length>0,je=PEe(),Xe=REe(),Ve=DEe();async function et(Y){if(!Y){c([]),k("");return}M(!0);try{const{sites:Ne}=await t.fetchQuery({queryKey:Re.gsc.properties(e),queryFn:()=>RV(e),staleTime:kr});c(Ne),k(Y.propertyId??Ne[0]?.siteUrl??"")}catch(Ne){c([]),me(Ne instanceof Error?Ne.message:"Failed to load Search Console properties")}finally{M(!1)}}async function Wn(Y){Ae(!0);const Ne=Y??B;try{const ht=parseInt(F.limit,10)||20,Dt=ht+1,$n={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:String(Dt),offset:String(Ne),window:R},Dr=await t.fetchQuery({queryKey:Re.gsc.performance(e,$n),queryFn:()=>IV(e,{startDate:F.startDate||void 0,endDate:F.endDate||void 0,query:F.query||void 0,page:F.page||void 0,limit:Dt,offset:Ne,window:R}),staleTime:kr});Z(Dr.length>ht),f(Dr.slice(0,ht))}catch(ht){f([]),Z(!1),me(ht instanceof Error?ht.message:"Failed to load GSC performance data")}finally{Ae(!1)}}async function Ei(){ee(!0);try{const Y=H.trim()||void 0,[Ne,ht]=await Promise.all([t.fetchQuery({queryKey:Re.gsc.inspections(e,Y),queryFn:()=>$V(e,{url:Y,limit:20}),staleTime:kr}),t.fetchQuery({queryKey:Re.gsc.deindexed(e),queryFn:()=>BV(e),staleTime:kr})]);m(Ne),v(ht)}catch(Y){m([]),v([]),me(Y instanceof Error?Y.message:"Failed to load GSC inspection history")}finally{ee(!1)}}async function Yt(){rt(!0);try{const[Y,Ne]=await Promise.all([t.fetchQuery({queryKey:Re.gsc.coverage(e),queryFn:()=>XN(e),staleTime:kr}),t.fetchQuery({queryKey:Re.gsc.coverageHistory(e),queryFn:()=>UV(e).catch(()=>[]),staleTime:kr})]);Fe(Y),yr(Ne)}catch(Y){Fe(null),yr([]),me(Y instanceof Error?Y.message:"Failed to load coverage data")}finally{rt(!1)}}async function fi(Y){it(!0),me(null);try{const Ne=await N2(e,{urls:Y}),{succeeded:ht,failed:Dt,total:$n}=Ne.summary;gt({title:"Indexing requested",detail:Dt===0?`${ht} URL${ht!==1?"s":""} submitted for indexing.`:`${ht}/${$n} submitted successfully, ${Dt} failed.`,tone:Dt===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(Ne){me(Ne instanceof Error?Ne.message:"Failed to request indexing")}finally{it(!1)}}async function Ja(){it(!0),me(null);try{const Y=await N2(e,{urls:[],allUnindexed:!0}),{succeeded:Ne,failed:ht,total:Dt}=Y.summary;gt({title:"Indexing requested",detail:ht===0?`${Ne} unindexed URL${Ne!==1?"s":""} submitted for indexing.`:`${Ne}/${Dt} submitted successfully, ${ht} failed.`,tone:ht===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Y){me(Y instanceof Error?Y.message:"Failed to request indexing")}finally{it(!1)}}async function ka(){if(_t.trim()){zt(!0),me(null);try{await MV(e,"gsc",_t.trim()),await t.invalidateQueries({queryKey:Re.gsc.project(e)}),a(Y=>Y.map(Ne=>Ne.connectionType==="gsc"?{...Ne,sitemapUrl:_t.trim()}:Ne)),gt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),be("")}catch(Y){me(Y instanceof Error?Y.message:"Failed to save sitemap URL")}finally{zt(!1)}}}async function ia(){me(null);try{const Y=await Xe.mutateAsync({projectName:e,projectLabel:e});ln(Y.sitemaps),a(Ne=>Ne.map(ht=>ht.connectionType==="gsc"?{...ht,sitemapUrl:Y.primarySitemapUrl}:ht))}catch{}}async function Ed(){en(!0),me(null);try{const Y=await FV(e);t.setQueryData(Re.gsc.sitemaps(e),Y),ln(Y.sitemaps),Y.sitemaps.length===0&&vr("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Y){me(Y instanceof Error?Y.message:"Failed to list sitemaps")}finally{en(!1)}}async function bc(){we(!0),me(null);try{const[Y,Ne]=await Promise.all([ZN().catch(()=>null),t.fetchQuery({queryKey:Re.gsc.connections(e),queryFn:()=>M5(e).catch(()=>[]),staleTime:kr})]);r(!!Y?.google?.configured),a(Ne);const ht=Ne.find(Dt=>Dt.connectionType==="gsc");await Promise.all([et(ht),Wn(),Ei(),Yt()])}finally{we(!1)}}x.useEffect(()=>{bc()},[e]),x.useEffect(()=>{V(0),Wn(0)},[R]);async function pp(){if(!n){me("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}D(!0),me(null),vr(null);try{const{authUrl:Y}=await TV(e,"gsc");if(!Y.startsWith("https://accounts.google.com/")){me("Unexpected OAuth redirect URL. Please try again.");return}const Ne=window.open(Y,"_blank","width=600,height=700");if(!Ne){window.location.assign(Y);return}vr("Finish the Google consent flow in the popup, then close it to refresh this project.");const ht=window.setInterval(()=>{Ne.closed&&(window.clearInterval(ht),vr(null),t.invalidateQueries({queryKey:Re.gsc.project(e)}),bc())},1e3)}catch(Y){me(Y instanceof Error?Y.message:"Failed to start OAuth flow")}finally{D(!1)}}async function mp(){me(null),vr(null);try{await PV(e,"gsc"),await t.invalidateQueries({queryKey:Re.gsc.project(e)}),a(Y=>Y.filter(Ne=>Ne.connectionType!=="gsc")),c([]),k("")}catch(Y){me(Y instanceof Error?Y.message:"Failed to disconnect")}}async function Ca(){if(j){oe(!0),me(null);try{await DV(e,"gsc",j),await t.invalidateQueries({queryKey:Re.gsc.project(e)}),a(Y=>Y.map(Ne=>Ne.connectionType==="gsc"?{...Ne,propertyId:j}:Ne)),gt({title:"GSC property updated",detail:`${e} is now linked to ${j}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Y){me(Y instanceof Error?Y.message:"Failed to save GSC property")}finally{oe(!1)}}}async function Ln(){me(null),vr(null);try{await je.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(O,10)||void 0,full:A||void 0}}),await t.invalidateQueries({queryKey:Re.gsc.project(e)})}catch{}}async function ar(){if(E.trim()){Ee(!0),me(null),vr(null);try{const Y=await LV(e,E.trim());await t.invalidateQueries({queryKey:Re.gsc.project(e)}),b(Y),C(""),await Ei()}catch(Y){me(Y instanceof Error?Y.message:"Failed to inspect URL")}finally{Ee(!1)}}}return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),l.jsx("h2",{children:"Google Search Console"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex gap-1",children:MEe.map(Y=>l.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${R===Y?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>$(Y),children:Y==="all"?"All":Y},Y))}),kt&&l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:ne,onClick:()=>{V(0),Wn(0)},children:ne?"Refreshing…":"Refresh data"})]})]}),Yn&&l.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:[Yn,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>me(null),children:"×"})]}),Vr&&l.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:[Vr,l.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>vr(null),children:"×"})]}),ue?l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):l.jsxs("div",{className:"space-y-3",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(ct,{tone:kt?"positive":n?"caution":"negative",children:kt?"Connected":n?"Ready to connect":"App credentials missing"})]}),kt?l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:kt.domain}),l.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:mp,children:"Disconnect"})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",l.jsx("code",{children:kt.domain}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:kt.propertyId??"No property selected yet"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ha(kt.updatedAt)})]})]})]}):l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[l.jsx("p",{className:"text-sm text-zinc-300",children:n?"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."}),l.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:I,onClick:pp,children:I?"Opening…":"Connect Google Search Console"}):l.jsx(ge,{type:"button",variant:"outline",size:"sm",asChild:!0,children:l.jsx(jt,{to:"/settings",children:"Open Settings"})}),!n&&l.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),kt&&!kt.sitemapUrl&&l.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:"mt-0.5 text-amber-400",children:l.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:l.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"})})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),l.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."}),l.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx(ge,{type:"button",size:"sm",disabled:Xe.isPending||!kt.propertyId,onClick:ia,children:Xe.isPending?"Discovering…":"Auto-discover from GSC"}),l.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:_t,onChange:Y=>be(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&void ka()}),l.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:Je||!_t.trim(),onClick:ka,children:Je?"Saving…":"Save sitemap URL"})]})]})]})]})}),(kt||Qr)&&l.jsxs(l.Fragment,{children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index coverage"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[G&&G.notIndexed.length>0&&l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:cn,onClick:()=>{Ja()},children:cn?"Requesting…":`Request indexing (${G.notIndexed.length})`}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:De,onClick:()=>{Yt()},children:De?"Loading…":"Refresh coverage"})]})]}),G&&G.summary.total>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Y=G.summary.indexed+G.summary.notIndexed,Ne=Y>0?G.summary.indexed/Y:0,ht=Y>0?G.summary.notIndexed/Y:0,Dt=54,$n=2*Math.PI*Dt,Dr=$n*(1-Ne),aa=$n*ht,hi=$n*Ne;return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"relative h-48 w-48",children:[l.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[l.jsx("circle",{cx:"64",cy:"64",r:Dt,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),l.jsx("circle",{cx:"64",cy:"64",r:Dt,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:$n,strokeDashoffset:Dr,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),G.summary.notIndexed>0&&l.jsx("circle",{cx:"64",cy:"64",r:Dt,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${aa} ${$n-aa}`,strokeDashoffset:-hi,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(Ne*100).toFixed(0),"%"]}),l.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:G.summary.indexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:G.summary.notIndexed.toLocaleString()}),l.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(G.reasonGroups??[]).length>0&&l.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(G.reasonGroups??[]).length," ",(G.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),G.summary.deindexed>0&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"h-8 w-px bg-zinc-800"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:G.summary.deindexed.toLocaleString()}),l.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),l.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Y=>{const Ne=Y==="indexed"?G.indexed.length:Y==="notIndexed"?G.notIndexed.length:G.deindexed.length,ht=Y==="indexed"?"Indexed":Y==="notIndexed"?"Not Indexed":"Deindexed";return l.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ce===Y?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Se(Y),Gt(null)},children:[ht," (",Ne,")"]},Y)})}),l.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ce==="indexed"&&G.indexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"text-left",children:"Mobile"})]})}),l.jsx("tbody",{children:G.indexed.map(Y=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),l.jsx("td",{className:"text-zinc-400",children:Y.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Y.crawlTime?Y.crawlTime.split("T")[0]:"—"}),l.jsx("td",{className:"text-zinc-400",children:Y.isMobileFriendly===!0?"Yes":Y.isMobileFriendly===!1?"No":"—"})]},Y.id))})]}),ce==="notIndexed"&&!tn&&(G.reasonGroups??[]).length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Reason"}),l.jsx("th",{className:"text-right",children:"Pages"})]})}),l.jsx("tbody",{children:(G.reasonGroups??[]).map(Y=>l.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Gt(Y.reason),children:[l.jsx("td",{className:"text-zinc-200",children:Y.reason}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Y.count})]},Y.reason))})]}),ce==="notIndexed"&&!tn&&(G.reasonGroups??[]).length===0&&G.notIndexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing State"}),l.jsx("th",{className:"text-left",children:"Coverage"})]})}),l.jsx("tbody",{children:G.notIndexed.map(Y=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),l.jsx("td",{className:"text-zinc-400",children:Y.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Y.coverageState??"Unknown"})]},Y.id))})]}),ce==="notIndexed"&&tn&&(()=>{const Y=(G.reasonGroups??[]).find(Ne=>Ne.reason===tn);return Y?l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-2 mb-3",children:l.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Gt(null),children:["←"," Back to reasons"]})}),l.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Y.reason}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Y.count," affected page",Y.count!==1?"s":""]})]}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:cn,onClick:()=>{fi(Y.urls.map(Ne=>Ne.url))},children:cn?"Requesting…":`Request indexing (${Y.count})`})]}),l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Last Crawl"}),l.jsx("th",{className:"w-8"})]})}),l.jsx("tbody",{children:Y.urls.map(Ne=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Ne.url}),l.jsx("td",{className:"text-zinc-400",children:Ne.crawlTime?Ne.crawlTime.split("T")[0]:"—"}),l.jsx("td",{children:l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:cn,onClick:()=>{fi([Ne.url])},title:"Request indexing",children:"Index"})})]},Ne.id))})]})]}):null})(),ce==="deindexed"&&G.deindexed.length>0&&l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Detected"})]})}),l.jsx("tbody",{children:G.deindexed.map((Y,Ne)=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),l.jsx("td",{className:"text-zinc-400",children:Y.previousState}),l.jsx("td",{className:"text-zinc-400",children:Y.currentState}),l.jsx("td",{className:"text-zinc-400",children:Y.transitionDate.split("T")[0]})]},`${Y.url}-${Ne}`))})]}),(ce==="indexed"&&G.indexed.length===0||ce==="notIndexed"&&!tn&&G.notIndexed.length===0||ce==="deindexed"&&G.deindexed.length===0)&&l.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:De?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),l.jsx("h3",{children:"Search performance"})]}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:ne,onClick:()=>{V(0),Wn(0)},children:ne?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Y=new Map;for(const bt of d){const Mt=Y.get(bt.date);Mt?(Mt.clicks+=bt.clicks,Mt.impressions+=bt.impressions):Y.set(bt.date,{clicks:bt.clicks,impressions:bt.impressions})}const Ne=[...Y.entries()].sort(([bt],[Mt])=>bt.localeCompare(Mt));if(Ne.length===0)return null;const ht=Math.max(...Ne.map(([,bt])=>bt.impressions),1),Dt=Ne.reduce((bt,[,Mt])=>bt+Mt.clicks,0),$n=Ne.reduce((bt,[,Mt])=>bt+Mt.impressions,0),Dr=$n>0?(Dt/$n*100).toFixed(1):"0.0",aa=700,hi=220,Bn={top:12,bottom:36,left:48,right:12},Yo=aa-Bn.left-Bn.right,pi=hi-Bn.top-Bn.bottom,un=Yo/Ne.length,Wo=Math.max(Math.min(un*.35,24),4),_d=Math.max(Wo*.15,1),es=bt=>{if(bt<=0)return 1;const Mt=Math.pow(10,Math.floor(Math.log10(bt))),xr=bt/Mt,Zn=xr<=1.5?1.5:xr<=3?3:xr<=5?5:10;return Math.ceil(Zn*Mt)},sa=4,wc=Math.ceil(es(ht)/sa)*sa,gp=Array.from({length:sa+1},(bt,Mt)=>wc/sa*Mt),yp=bt=>bt>=1e3?`${(bt/1e3).toFixed(bt>=1e4?0:1)}k`:String(bt);return l.jsxs("div",{className:"mt-3",children:[l.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:Dt.toLocaleString()})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),l.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",l.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:$n.toLocaleString()})]})]}),l.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",l.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Dr,"%"]})]})]}),l.jsx("div",{className:"relative w-full",style:{aspectRatio:`${aa} / ${hi}`},children:l.jsxs("svg",{viewBox:`0 0 ${aa} ${hi}`,className:"h-full w-full",children:[gp.map((bt,Mt)=>{const xr=Bn.top+pi-bt/wc*pi;return l.jsxs("g",{children:[l.jsx("line",{x1:Bn.left,y1:xr,x2:aa-Bn.right,y2:xr,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),l.jsx("text",{x:Bn.left-6,y:xr+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:yp(bt)})]},`t-${Mt}`)}),Ne.map(([bt,Mt],xr)=>{const Zn=Bn.left+un*xr+un/2,sr=Mt.impressions/wc*pi,zd=Mt.clicks/wc*pi;return l.jsxs("g",{children:[l.jsx("title",{children:`${bt}
|
|
290
|
+
Clicks: ${Mt.clicks}
|
|
291
|
+
Impressions: ${Mt.impressions}
|
|
292
|
+
CTR: ${Mt.impressions>0?(Mt.clicks/Mt.impressions*100).toFixed(1):0}%`}),l.jsx("rect",{x:Zn-Wo-_d/2,y:Bn.top+pi-sr,width:Wo,height:Math.max(sr,1),rx:2,fill:"#3b82f6",opacity:.85}),l.jsx("rect",{x:Zn+_d/2,y:Bn.top+pi-zd,width:Wo,height:Math.max(zd,1),rx:2,fill:"#10b981",opacity:.85})]},bt)}),(()=>{const bt=Math.min(Ne.length,7);return Array.from({length:bt},(Mt,xr)=>{const Zn=Ne.length===1?0:Math.round(xr/(bt-1)*(Ne.length-1)),sr=Bn.left+un*Zn+un/2;return l.jsx("text",{x:sr,y:hi-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:Ne[Zn][0].slice(5)},`xl-${Zn}`)})})()]})})]})})(),l.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[l.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:F.startDate,onChange:Y=>q(Ne=>({...Ne,startDate:Y.target.value}))}),l.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:F.endDate,onChange:Y=>q(Ne=>({...Ne,endDate:Y.target.value}))}),l.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:F.query,onChange:Y=>q(Ne=>({...Ne,query:Y.target.value}))}),l.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:F.page,onChange:Y=>q(Ne=>({...Ne,page:Y.target.value}))}),l.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:F.limit,onChange:Y=>q(Ne=>({...Ne,limit:Y.target.value}))})]}),d.length>0?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"Date"}),l.jsx("th",{className:"text-left",children:"Query"}),l.jsx("th",{className:"text-left",children:"Page"}),Object.values(ko).map(Y=>l.jsx("th",{className:"text-right","aria-sort":Pe?.key===Y?Pe.dir==="asc"?"ascending":"descending":"none",children:l.jsxs("button",{type:"button",className:"w-full cursor-pointer select-none text-right hover:text-zinc-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 rounded px-1 -mx-1",onClick:()=>We(Ne=>Ne?.key===Y?Ne.dir==="desc"?{key:Y,dir:"asc"}:null:{key:Y,dir:"desc"}),children:[ine[Y],Pe?.key===Y?Pe.dir==="desc"?" ↓":" ↑":""]})},Y))]})}),l.jsx("tbody",{children:ut.map((Y,Ne)=>l.jsxs("tr",{children:[l.jsx("td",{className:"text-zinc-400",children:Y.date}),l.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Y.query}),l.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Y.page}),l.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Y.clicks.toLocaleString()}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Y.impressions.toLocaleString()}),l.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Y.ctr)?Y.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Y.position.toFixed(1)})]},`${Y.date}:${Y.query}:${Y.page}:${Ne}`))})]})}),(B>0||X)&&(()=>{const Y=parseInt(F.limit,10)||20,Ne=B+1,ht=B+d.length;return l.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-zinc-500",children:[l.jsxs("span",{className:"tabular-nums",children:["Showing ",Ne.toLocaleString()," – ",ht.toLocaleString(),X?"+":""]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:ne||B===0,onClick:()=>{const Dt=Math.max(0,B-Y);V(Dt),Wn(Dt)},children:"Previous"}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:ne||!X,onClick:()=>{const Dt=B+Y;V(Dt),Wn(Dt)},children:"Next"})]})]})})()]}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),l.jsx("h3",{children:"Inspect a URL"})]})}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:E,onChange:Y=>C(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&void ar()}),l.jsx(ge,{type:"button",size:"sm",disabled:he||!kt?.propertyId||!E.trim(),onClick:ar,children:he?"Inspecting…":"Inspect URL"})]}),S&&l.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:S.indexingState??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:S.verdict??"Unknown"})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:rT(S.isMobileFriendly)})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ha(S.crawlTime)})]})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h3",{children:"Inspection log"})]}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:_e,onClick:()=>{Ei()},children:_e?"Loading…":"Refresh history"})]}),l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:H,onChange:Y=>J(Y.target.value)}),l.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:_e,onClick:()=>{Ei()},children:"Apply filter"})]}),p.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Indexing"}),l.jsx("th",{className:"text-left",children:"Verdict"}),l.jsx("th",{className:"text-left",children:"Coverage"}),l.jsx("th",{className:"text-left",children:"Mobile"}),l.jsx("th",{className:"text-left",children:"Inspected"})]})}),l.jsx("tbody",{children:p.map(Y=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),l.jsx("td",{className:"text-zinc-300",children:Y.indexingState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Y.verdict??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:Y.coverageState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:rT(Y.isMobileFriendly)}),l.jsx("td",{className:"text-zinc-400",children:ha(Y.inspectedAt)})]},Y.id))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),l.jsx("h3",{children:"Recent indexing losses"})]})}),y.length>0?l.jsx("div",{className:"mt-3 overflow-x-auto",children:l.jsxs("table",{className:"data-table w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{className:"text-left",children:"URL"}),l.jsx("th",{className:"text-left",children:"Previous"}),l.jsx("th",{className:"text-left",children:"Current"}),l.jsx("th",{className:"text-left",children:"Changed at"})]})}),l.jsx("tbody",{children:y.map(Y=>l.jsxs("tr",{children:[l.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Y.url}),l.jsx("td",{className:"text-zinc-400",children:Y.previousState??"Unknown"}),l.jsx("td",{className:"text-zinc-300",children:Y.currentState??"Unknown"}),l.jsx("td",{className:"text-zinc-400",children:ha(Y.transitionDate)})]},`${Y.url}:${Y.transitionDate}`))})]})}):l.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),kt&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:l.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>Ye(Y=>!Y),children:[l.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 ${Ct?"rotate-90":""}`,"aria-hidden":"true",children:l.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"})}),l.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),Ct&&l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),l.jsx("h3",{children:"Pick the Search Console property"})]})}),l.jsxs("div",{className:"mt-3 space-y-2",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),l.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:j,disabled:U||o.length===0,onChange:Y=>k(Y.target.value),children:o.length===0?l.jsx("option",{value:"",children:U?"Loading properties…":"No properties available"}):o.map(Y=>l.jsxs("option",{value:Y.siteUrl,children:[Y.siteUrl," · ",Y.permissionLevel]},Y.siteUrl))}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:U,onClick:()=>{et(kt)},children:U?"Refreshing…":"Refresh properties"}),l.jsx(ge,{type:"button",size:"sm",disabled:!j||Q,onClick:Ca,children:Q?"Saving…":"Save property"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),l.jsx("h3",{children:"Import GSC performance data"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),l.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:O,onChange:Y=>z(Y.target.value)})]}),l.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:[l.jsx("input",{type:"checkbox",checked:A,onChange:Y=>_(Y.target.checked)}),"Replace existing imported rows for the requested range"]})]}),l.jsx(ge,{type:"button",size:"sm",disabled:je.isPending||!kt.propertyId,onClick:Ln,children:je.isPending?"Queueing…":"Queue sync"}),!kt.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),l.jsx("h3",{children:"Sitemap configuration"})]})}),l.jsxs("div",{className:"mt-3 space-y-3",children:[kt.sitemapUrl&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:kt.sitemapUrl})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:Qe||!kt.propertyId,onClick:()=>{Ed()},children:Qe?"Loading…":"Browse sitemaps from GSC"}),l.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:Xe.isPending||!kt.propertyId,onClick:ia,children:Xe.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),l.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."}),Ut&&Ut.length>0&&l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[l.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Ut.length,")"]}),Ut.map(Y=>{const Ne=Y.contents?.[0];return l.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-200 break-all",children:Y.path}),Y.lastSubmitted&&l.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Y.lastSubmitted.split("T")[0]]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[Ne&&l.jsxs("div",{className:"text-right",children:[l.jsxs("p",{className:"text-zinc-300",children:[Ne.indexed," / ",Ne.submitted]}),l.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>be(Y.path),children:"Use"})]})]},Y.path)})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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:kt.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:_t,onChange:Y=>be(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&_t.trim()&&void ka()}),l.jsx(ge,{type:"button",size:"sm",disabled:Je||!_t.trim(),onClick:ka,children:Je?"Saving…":kt.sitemapUrl?"Update":"Save"})]}),l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.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}`}),l.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:Ve.isPending||!kt.propertyId,onClick:async()=>{const Ne=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||kt.sitemapUrl||void 0;me(null),vr(null);try{await Ve.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:Ne}})}catch{}},children:Ve.isPending?"Queueing…":"Inspect sitemap"})]}),!kt.propertyId&&l.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function zj({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,o]=x.useState(!1);return l.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[l.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:l.jsx(Y5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&l.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const bl=50;function gu(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function vg(e){return e.toLocaleString()}function LEe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function $Ee(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 r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function BEe(e){const t=e.filter(n=>n.kind===Nt["backlink-extract"]&&!mk(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function UEe(e,t){const n=new Date(e??t).getTime(),r=Math.max(0,Math.floor((Date.now()-n)/1e3));if(r<60)return`${r}s`;const i=Math.floor(r/60),a=r%60;return a===0?`${i}m`:`${i}m ${a}s`}function qEe({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,o]=x.useState([]),[c,d]=x.useState(null),[f,p]=x.useState(null),[m,y]=x.useState(null),[v,S]=x.useState(Date.now()),[b,j]=x.useState(0),[k,E]=x.useState(!0),[C,O]=x.useState(!1),[z,A]=x.useState(null),_=x.useRef(null),R=x.useCallback(async()=>{E(!0),A(null);try{const[ue,we,I,D,U]=await Promise.all([F5().catch(()=>null),NQ(e,{excludeCrawlers:!0}).catch(()=>null),kQ(e,{limit:bl,offset:b,excludeCrawlers:!0}).catch(Q=>{if(Q instanceof Or&&Q.code==="NOT_FOUND")return null;throw Q}),CQ(e).catch(()=>[]),oV(e).catch(()=>[])]);d(ue),n(we),i(I),o(D);const M=BEe(U);p(M),_.current=M?.id??null}catch(ue){A(ue instanceof Error?ue.message:"Failed to load backlinks")}finally{E(!1)}},[e,b]);x.useEffect(()=>{R()},[R]),x.useEffect(()=>{if(!f)return;const ue=f.id;let we=!1;const I=async()=>{try{const U=await Kl(ue);if(we)return;mk(U.status)?(p(null),y(U),await R()):p(M=>M?.id===U.id?{...M,...U}:M)}catch{}},D=window.setInterval(()=>{I()},3e3);return()=>{we=!0,window.clearInterval(D)}},[f,R]),x.useEffect(()=>{if(!f)return;const ue=window.setInterval(()=>S(Date.now()),1e3);return()=>window.clearInterval(ue)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const ue=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(ue)},[m]);async function $(){O(!0),A(null);try{const ue=await AQ(e);p(ue),_.current=ue.id}catch(ue){ue instanceof Or&&ue.code==="MISSING_DEPENDENCY"?A("DuckDB is not installed. Visit the Backlinks admin page to install it."):A(ue instanceof Error?ue.message:"Failed to trigger extract")}finally{O(!1)}}const F=x.useMemo(()=>a.slice().sort((ue,we)=>ue.queriedAt.localeCompare(we.queriedAt)).map(ue=>({date:ue.queriedAt,linkingDomains:ue.totalLinkingDomains})),[a]),q=r?.rows??[],B=r?.total??0,V=t?.excludedLinkingDomains??0,X=B>bl,Z=Math.floor(b/bl)+1,H=Math.max(1,Math.ceil(B/bl));return x.useEffect(()=>{b>0&&b>=B&&j(0)},[b,B]),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),l.jsx("h2",{children:"Referring domains"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",l.jsx("span",{className:"text-zinc-300",children:e}),", extracted from the Common Crawl hyperlink graph. Updates when a release sync completes — no live scraping, no paid API."]})]})}),z&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:z})}),f&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-sky-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(Z5,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),l.jsx(ct,{tone:"neutral",children:f.status}),l.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[UEe(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),l.jsxs("span",{className:"sr-only",children:["now=",v]})]}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",l.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",l.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&l.jsx(ze,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:l.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?l.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):l.jsx(Q5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:`text-sm font-medium ${m.status==="failed"?"text-rose-300":"text-emerald-300"}`,children:m.status==="failed"?"Extract failed":"Extract complete"}),m.error?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:ane(m.error)}):m.status!=="failed"?l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),J()]});function J(){if(k)return l.jsx(ze,{className:"surface-card p-6",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const ue=t!==null&&t.totalLinkingDomains>0,we=m?.status==="failed",I=t!==null&&t.totalLinkingDomains===0&&!we,D=c?.status==="ready",U=c?.status==="failed",M=c&&(c.status==="downloading"||c.status==="querying"||c.status==="queued");return ue?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"gauge-row",children:[l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:vg(t.totalLinkingDomains)})}),l.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:vg(t.totalHosts)})}),l.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),l.jsxs("div",{className:"metric-card",children:[l.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),l.jsx("p",{className:"metric-card-big-value",children:l.jsx("span",{className:"text-zinc-50",children:LEe(t.top10HostsShare)})}),l.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),l.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",l.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",$Ee(t.queriedAt),V>0&&l.jsxs(l.Fragment,{children:[" · ",l.jsxs("span",{className:"text-zinc-500",children:[V," crawler/proxy domain",V===1?"":"s"," hidden"]})]})]}),F.length>=2&&l.jsxs(ze,{className:"surface-card p-4 mt-4",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),l.jsx("div",{className:"h-40 mt-2",children:l.jsx(Ty,{width:"100%",height:"100%",children:l.jsxs(AN,{data:F,margin:{top:8,right:12,bottom:0,left:12},children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:Uu[0],stopOpacity:.4}),l.jsx("stop",{offset:"100%",stopColor:Uu[0],stopOpacity:0})]})}),l.jsx(Ih,{dataKey:"date",tick:Ao,stroke:sd,tickFormatter:EN}),l.jsx(Lh,{tick:Ao,stroke:sd,allowDecimals:!1}),l.jsx(iv,{contentStyle:Bu.contentStyle,labelStyle:Bu.labelStyle,itemStyle:Bu.itemStyle,labelFormatter:ON}),l.jsx(Eu,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:Uu[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),l.jsxs("div",{className:"mt-4",children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),X&&l.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Z," of ",H," · ",vg(B)," total"]})]}),l.jsx(ze,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),l.jsxs("tbody",{children:[q.map(Q=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:Q.linkingDomain}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:vg(Q.numHosts)})]},Q.linkingDomain)),q.length===0&&l.jsx("tr",{children:l.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:V>0&&B===0?`Every referring domain in this release was a crawler/proxy host (${V} hidden).`:"No referring domains in this release."})})]})]})}),X&&l.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>j(Q=>Math.max(0,Q-bl)),children:"Previous"}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:b+bl>=B,onClick:()=>j(Q=>Q+bl),children:"Next"})]})]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsxs(ge,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[l.jsx(kv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),l.jsxs(zj,{label:"What does Re-run extract do?",children:[l.jsxs("span",{className:"block",children:["Re-queries the ",l.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",l.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:[l.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",l.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),l.jsx(ge,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:gu("/backlinks"),children:"Open admin"})})]})]}):l.jsx(ze,{className:"surface-card p-6",children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:l.jsx(W5,{className:"h-5 w-5","aria-hidden":!0})}),l.jsxs("div",{className:"flex-1",children:[!c&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:"Run a workspace release sync to populate backlinks for every project in this workspace."}),l.jsx("div",{className:"mt-4",children:l.jsx(ge,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:gu("/backlinks"),children:"Set up backlinks"})})})]}),M&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",c.status,c.phaseDetail?` — ${c.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),l.jsx("div",{className:"mt-4",children:l.jsx(ge,{asChild:!0,type:"button",variant:"outline",size:"sm",children:l.jsx("a",{href:gu("/backlinks"),children:"View sync status"})})})]}),U&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),l.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:c.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),l.jsx("div",{className:"mt-4",children:l.jsx(ge,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:gu("/backlinks"),children:"Go to Backlinks admin"})})})]}),D&&!M&&!I&&!we&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",l.jsx("code",{className:"text-zinc-300",children:c.release})," is ready but no backlinks have been extracted for"," ",l.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsxs(ge,{type:"button",size:"sm",disabled:C||f!==null,onClick:$,children:[l.jsx(Zg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Run extract"]}),l.jsxs(zj,{label:"What does Run extract do?",children:[l.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",l.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",l.jsx("span",{className:"text-zinc-200",children:e}),"."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",l.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),we&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",l.jsx("code",{className:"text-zinc-300",children:c?.release})," are missing, re-sync the release from the Backlinks admin to restore the ~16 GB dump, then re-run the extract."]}),l.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:l.jsx(ge,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:gu("/backlinks"),children:"Go to Backlinks admin"})})})]}),I&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),l.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",l.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",l.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",l.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),l.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[l.jsx("li",{children:"the domain is newer than the release’s crawl window"}),l.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),l.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),l.jsx("p",{className:"text-sm text-zinc-500 mt-3",children:"Try syncing a newer release — each Common Crawl dump is a different snapshot of the web graph."}),l.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[l.jsx(ge,{asChild:!0,type:"button",size:"sm",children:l.jsx("a",{href:gu("/backlinks"),children:"Go to Backlinks admin"})}),l.jsxs(ge,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[l.jsx(Zg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),l.jsxs(zj,{label:"What does Re-run extract do?",children:[l.jsxs("span",{className:"block",children:["Re-queries the cached release for ",l.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),l.jsx("span",{className:"mt-2 block text-zinc-400",children:"No re-download. ~5 min. If the release genuinely has no links for your domain, this won’t help — sync a different release instead."})]})]})]})]})]})})}}function FEe({projectName:e}){const t=Ar({queryKey:Re.citationVisibility(e),queryFn:()=>mQ(e),staleTime:K5}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.jsx("p",{className:"text-sm text-rose-400",children:r instanceof Error?r.message:String(r)})]});if(!n)return null;if(n.status==="no-data")return l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),l.jsx("p",{className:"text-sm text-zinc-500",children:n.reason==="no-queries"?"Add queries to start tracking AI citations.":"Run a sweep to see which engines cite this project."})]});const{providersCiting:i,providersMentioning:a,providersConfigured:o}=n.summary;return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",o," engines",l.jsx(mr,{text:"An engine is ‘citing’ when our domain appears in its grounding source list (the structured citation/search-result attribution it returns alongside the answer). Counts each configured engine that cites the project on at least one tracked query in the latest snapshot per (query × provider)."})]}),l.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",o," engine answers",l.jsx(mr,{text:"An engine is ‘mentioning’ when our brand or domain appears inside the prose of the answer text — independent of whether it’s in the citation list. Models often name-drop from training without citing a fresh page."})]})]}),n.summary.latestRunAt&&l.jsxs("p",{className:"supporting-copy",children:["Latest run ",new Date(n.summary.latestRunAt).toLocaleString()]})]}),l.jsx(HEe,{data:n}),l.jsx(KEe,{data:n}),n.competitorGaps.length>0&&l.jsx(YEe,{data:n})]})}function HEe({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[l.jsx(xg,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),l.jsx(xg,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),l.jsx(xg,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),l.jsx(xg,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function xg({label:e,value:t,helper:n,tone:r}){const i=r==="positive"?"text-emerald-300":r==="positive-dim"?"text-emerald-400/70":r==="caution"?"text-amber-300":r==="negative"?"text-rose-300":"text-zinc-100";return l.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),l.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i}`,children:t}),l.jsx("p",{className:"text-[11px] text-zinc-500",children:n})]})}function KEe({data:e}){const t=x.useMemo(()=>{const n=new Set;for(const r of e.byQuery)for(const i of r.providers)n.add(i.provider);return Array.from(n).sort()},[e.byQuery]);return e.byQuery.length===0?l.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):l.jsxs("div",{children:[l.jsx(GEe,{}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),t.map(n=>l.jsx("th",{className:"text-center",children:l.jsx(Ql,{provider:n})},n)),l.jsx("th",{className:"text-right",children:"Cite"}),l.jsx("th",{className:"text-right",children:"Ment"})]})}),l.jsx("tbody",{children:e.byQuery.map(n=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return l.jsx("td",{className:"text-center",children:i==null?l.jsx(SY,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):l.jsx(VEe,{provider:i})},r)}),l.jsx("td",{className:"text-right tabular-nums",children:l.jsxs("span",{className:n.totalProviders>0&&n.citedCount===n.totalProviders?"text-emerald-300":n.citedCount>0?"text-emerald-400/70":"text-zinc-500",children:[n.citedCount,"/",n.totalProviders]})}),l.jsx("td",{className:"text-right tabular-nums",children:l.jsxs("span",{className:n.totalProviders>0&&n.mentionedCount===n.totalProviders?"text-sky-300":n.mentionedCount>0?"text-sky-400/70":"text-zinc-500",children:[n.mentionedCount,"/",n.totalProviders]})})]},n.queryId))})]})})]})}function GEe(){return l.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-3 text-[11px] text-zinc-500",children:[l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(_u,{active:!0,tone:"cited"}),l.jsx("span",{children:"cited (in sources)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(_u,{active:!0,tone:"mentioned"}),l.jsx("span",{children:"mentioned (in answer)"})]}),l.jsxs("span",{className:"flex items-center gap-1.5",children:[l.jsx(_u,{active:!1,tone:"cited"}),l.jsx(_u,{active:!1,tone:"mentioned"}),l.jsx("span",{children:"neither"})]})]})}function VEe({provider:e}){const t=QEe(e);return l.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[l.jsx(_u,{active:e.cited,tone:"cited"}),l.jsx(_u,{active:e.mentioned,tone:"mentioned"})]})}function QEe(e){return e.cited&&e.mentioned?"Cited in sources and mentioned in answer":e.cited?"Cited in sources, not mentioned in answer":e.mentioned?"Mentioned in answer, not in sources":"Not cited and not mentioned"}function _u({active:e,tone:t}){if(!e)return l.jsx("span",{className:"inline-block h-2 w-2 rounded-full border border-zinc-700/80 bg-transparent","aria-hidden":"true"});const n=t==="cited"?"inline-block h-2 w-2 rounded-full bg-emerald-400 shadow-[0_0_0_1px_rgba(16,185,129,0.25)]":"inline-block h-2 w-2 rounded-full bg-sky-400 shadow-[0_0_0_1px_rgba(56,189,248,0.25)]";return l.jsx("span",{className:n,"aria-hidden":"true"})}function YEe({data:e}){return l.jsxs("div",{className:"mt-4",children:[l.jsxs("h3",{className:"text-sm font-semibold text-zinc-200 mb-2 flex items-center gap-2",children:["Competitor gaps",l.jsx(mr,{text:"Queries where the project is not cited but a configured competitor is. Each row maps to one (query, engine) pair — the same query may surface for multiple engines."}),l.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Query"}),l.jsx("th",{children:"Engine"}),l.jsx("th",{children:"Competitors cited"})]})}),l.jsx("tbody",{children:e.competitorGaps.map(t=>l.jsxs("tr",{children:[l.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),l.jsx("td",{children:l.jsx(Ql,{provider:t.provider})}),l.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const WEe={critical:"negative",high:"negative",medium:"caution",low:"neutral"};function hr(e){return Number.isFinite(e)?Math.abs(e)>=1e6?`${(e/1e6).toFixed(1)}M`:Math.abs(e)>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString("en-US"):"—"}function ZEe(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function XEe(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function JEe({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),a=Ar({queryKey:Re.report(e),queryFn:()=>JV(e)});async function o(){n(!0),i(null);try{await tQ(e,"client")}catch(d){const f=d instanceof Or||d instanceof Error?d.message:"Download failed";i(f)}finally{n(!1)}}if(a.isLoading)return l.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(a.error){const d=a.error instanceof Error?a.error.message:"Failed to load report";return l.jsx("div",{className:"py-8 text-center",children:l.jsx("p",{className:"text-sm text-rose-400",children:d})})}const c=a.data;return c?l.jsxs("div",{children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("p",{className:"eyebrow",children:"AI Visibility Report"}),l.jsx("h1",{className:"page-title",children:c.meta.project.displayName}),l.jsxs("p",{className:"page-subtitle",children:[c.meta.project.canonicalDomain," · ",c.meta.project.country," / ",c.meta.project.language.toUpperCase(),c.meta.location?` · Location: ${XEe(c.meta.location)}`:" · No location set"," · ","Generated ",ZEe(c.meta.generatedAt)]}),r&&l.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),l.jsx("div",{className:"page-header-right",children:l.jsxs(ge,{variant:"secondary",size:"sm",onClick:o,disabled:t,children:[l.jsx(kv,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})})]}),l.jsx(s_e,{report:c}),l.jsx(h_e,{report:c,audience:"client"}),l.jsx(n_e,{report:c}),l.jsx(c_e,{report:c,audience:"client"}),l.jsx(u_e,{report:c})]}):null}const zL="AI Visibility — Server-Side",TL="AI engine attention",e_e="What AI engines actually do in your server logs over the last 7 days — the other half of citations.",t_e="Live telemetry from your server logs.";function n_e({report:e}){const t=e.serverActivity;if(!t)return null;if(!t.hasData)return l.jsxs("section",{className:"page-section-divider",children:[l.jsx($h,{eyebrow:TL,title:zL,subtitle:t_e}),l.jsx("p",{className:"text-sm text-zinc-500",children:"Your server-side traffic source is connected. Numbers will appear after the next sync."})]});const n={current:t.verifiedCrawlerHits.current+t.unverifiedCrawlerHits.current,prior:t.verifiedCrawlerHits.prior+t.unverifiedCrawlerHits.prior,deltaPct:rne(t.verifiedCrawlerHits.current+t.unverifiedCrawlerHits.current,t.verifiedCrawlerHits.prior+t.unverifiedCrawlerHits.prior)},r=nT(n,"requests"),i=`${hr(t.verifiedCrawlerHits.current)} verified · ${hr(t.unverifiedCrawlerHits.current)} unverified${r?` · ${r}`:""}`,a=nT(t.referralArrivals,"sessions"),o=t.byOperator.filter(c=>c.verifiedHits>0||c.unverifiedHits>0||c.referralArrivals>0).slice(0,5);return l.jsxs("section",{className:"page-section-divider",children:[l.jsx($h,{eyebrow:TL,title:zL,subtitle:e_e}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[l.jsx(ML,{label:"AI bot requests observed",value:hr(n.current),subtitle:i}),l.jsx(ML,{label:"AI referral sessions",value:hr(t.referralArrivals.current),subtitle:a})]}),o.length>0&&l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:"By AI tool"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"AI tool"}),l.jsx("th",{children:"Bot requests (7d)"}),l.jsx("th",{children:"Referral sessions"})]})}),l.jsx("tbody",{children:o.map(c=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:c.operator}),l.jsx("td",{children:hr(c.verifiedHits+c.unverifiedHits)}),l.jsx("td",{children:hr(c.referralArrivals)})]},c.operator))})]})}),l.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Verified requests are reverse-DNS confirmed. Unverified requests are user-agent claims shown separately in agency diagnostics."})]})]})}function r_e(e,t){return e.audience==="both"||e.audience===t}const i_e={gemini:"Gemini",openai:"ChatGPT",claude:"Claude",perplexity:"Perplexity",local:"Local model","cdp:chatgpt":"ChatGPT (browser)"};function mv(e){return i_e[e]??e.charAt(0).toUpperCase()+e.slice(1)}function a_e(e){return e?e.direction==="up"?{text:`Up ${e.deltaAbs.toFixed(1)} points since last check (was ${e.prior}%)`,tone:"positive",arrow:"↑"}:e.direction==="down"?{text:`Down ${Math.abs(e.deltaAbs).toFixed(1)} points since last check (was ${e.prior}%)`,tone:"negative",arrow:"↓"}:{text:`Holding steady since last check (was ${e.prior}%)`,tone:"neutral",arrow:"→"}:null}function s_e({report:e}){const t=e.executiveSummary,n=e.citationScorecard,r=t.totalQueryCount,i=r>0?`${t.citationRate}%`:"—",a=r>0?`When customers asked AI ${r} ${r===1?"question":"questions"} about your industry, AI linked to your website in ${t.citedQueryCount} of ${r===1?"them":"those answers"}.`:"No AI check has been run yet. Run a check to see how AI tools answer customer questions about your business.",o=a_e(e.whatsChanged.citationRate),c=n.providers.length>0?n.providers.map(mv).join(", "):`${hr(t.queryCount)} ${t.queryCount===1?"question":"questions"} tested`;return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"rounded-2xl border border-zinc-800/60 bg-zinc-900/40 p-6 sm:p-8",children:[l.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:"Overview"}),l.jsx("p",{className:"mt-3 text-6xl font-bold tracking-tight text-zinc-50 sm:text-7xl",children:i}),l.jsx("p",{className:"mt-3 max-w-2xl text-base text-zinc-300 sm:text-lg",children:a}),o&&l.jsxs("p",{className:`mt-3 text-sm font-medium ${o.tone==="positive"?"text-emerald-400":o.tone==="negative"?"text-rose-400":"text-zinc-400"}`,children:[l.jsx("span",{className:"mr-1",children:o.arrow}),o.text]})]}),l.jsxs("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:[l.jsx(Tj,{label:"AI mentions your name",value:`${t.mentionRate}%`,subtitle:r>0?`Says your name in ${t.mentionedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),l.jsx(Tj,{label:"AI links to your website",value:`${t.citationRate}%`,subtitle:r>0?`Cites your site as a source in ${t.citedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),l.jsx(Tj,{label:"AI tools tested",value:hr(t.providerCount),subtitle:c})]}),l.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 text-xs text-zinc-400",children:[l.jsx("span",{className:"font-semibold text-zinc-200",children:"Mentions and links are different."})," ","A ",l.jsx("span",{className:"font-medium text-zinc-200",children:"mention"})," is when AI says your name out loud in its answer. A ",l.jsx("span",{className:"font-medium text-zinc-200",children:"link"})," is when AI lists your website as a source it used. AI can do either, both, or neither — that's why we track both."]}),n.queries.length>0&&l.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Customer questions we tested"}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["These are the ",n.queries.length," ",n.queries.length===1?"question we asked":"questions we asked"," every AI tool. The numbers above measure how often you came up."]}),l.jsx("ol",{className:"mt-4 grid gap-2 sm:grid-cols-2",children:n.queries.map((d,f)=>l.jsxs("li",{className:"flex items-start gap-3 rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2 text-sm text-zinc-200",children:[l.jsx("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-zinc-500",children:String(f+1).padStart(2,"0")}),l.jsxs("span",{children:['"',d,'"']})]},f))})]}),n.providerRates.length>0&&l.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"How often each AI tool links to your website"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Higher is better. Each bar shows the share of customer questions where the AI cited your site."}),l.jsx("div",{className:"mt-4 space-y-3",children:n.providerRates.map(d=>l.jsxs("div",{className:"grid grid-cols-[120px_1fr_120px] items-center gap-3",children:[l.jsx("span",{className:"text-sm text-zinc-300",children:mv(d.provider)}),l.jsx("div",{className:"h-3 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:"h-full rounded-full bg-emerald-500/70",style:{width:`${Math.max(d.citationRate,1.5)}%`}})}),l.jsxs("span",{className:"text-right text-sm font-semibold text-zinc-100",children:[d.citationRate,"% ",l.jsxs("span",{className:"font-normal text-zinc-500",children:["(",d.citedCount,"/",d.totalCount,")"]})]})]},d.provider))})]}),e.clientSummary.confidenceNotes.length>0&&l.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((d,f)=>l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2 text-xs text-zinc-400",children:d},f))})]})}function Tj({label:e,value:t,subtitle:n}){return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:e}),l.jsx("p",{className:"mt-3 text-4xl font-bold tracking-tight text-zinc-50 sm:text-5xl",children:t}),l.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:n})]})}function o_e(e){switch(e){case"immediate":return"Do now";case"short-term":return"This month";case"medium-term":return"Next quarter"}}function l_e(e){switch(e){case"high":return"Strong evidence";case"medium":return"Some evidence";case"low":return"Worth trying"}}function c_e({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(a=>r_e(a,t)),r=$te(e,n),i=t==="client";return l.jsxs("section",{className:"page-section-divider",children:[l.jsx($h,{eyebrow:i?"Action plan":"Agency actions",title:i?"What to do next":"Agency Action Plan",subtitle:i?"Approve these in order. They are sorted by what will move the needle fastest.":"The highest-leverage work, sorted by urgency and evidence strength."}),r.length===0?l.jsx(BA,{message:"No recommendations yet — run an AI check to populate this."}):l.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:r.map((a,o)=>{const c=a.evidence.length>0?a.evidence:a.why,d=a.why.length>0||a.evidence.length>0;return l.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-zinc-800/80 text-sm font-semibold text-zinc-100",title:"Priority — 1 will move the needle fastest",children:o+1}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[l.jsx(ct,{tone:Tte(a),children:i?o_e(a.horizon):Rte(a.horizon)}),!i&&l.jsx(ct,{tone:"neutral",children:Dte(a.category)}),l.jsx(ct,{tone:"neutral",children:i?l_e(a.confidence):`${Mte(a.confidence)} confidence`})]}),l.jsx("p",{className:"text-sm font-medium text-zinc-100",children:a.title})]})]}),l.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:a.action}),l.jsx(p_e,{items:c,limit:3,className:"mt-3"}),d&&l.jsxs("details",{className:"mt-3 text-xs text-zinc-400",children:[l.jsx("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:i?"See the data behind this":"Evidence details"}),a.why.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"eyebrow-soft mb-1",children:i?"Why this matters":"Why"}),l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.why.map((f,p)=>l.jsx("li",{children:f},p))})]}),a.evidence.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"eyebrow-soft mb-1",children:i?"What we saw":"Evidence"}),l.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.evidence.map((f,p)=>l.jsx("li",{children:f},p))})]})]}),l.jsxs("p",{className:"mt-3 border-t border-zinc-800/60 pt-3 text-xs text-zinc-300",children:[l.jsx("span",{className:"font-medium",children:i?"What success looks like:":"Win condition:"})," ",a.successMetric]})]},`${a.priority}-${a.title}`)})})]})}function PL({label:e,value:t,displayValue:n,max:r,barClass:i}){const a=r>0?Math.max(t/r*100,1.5):0;return l.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-3 text-sm",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"truncate text-zinc-300",title:e,children:e}),l.jsx("div",{className:"mt-1 h-2 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:`h-full rounded-full ${i}`,style:{width:`${a}%`}})})]}),l.jsx("span",{className:"whitespace-nowrap text-sm font-semibold text-zinc-100",children:n})]})}function u_e({report:e}){const t=e.aiSourceOrigin.topDomains.slice(0,5),n=e.gsc,r=e.indexingHealth,i=Bte(e).slice(0,5),a=t.length>0?Math.max(...t.map(d=>d.count)):0,o=n?Math.max(...n.topQueries.slice(0,5).map(d=>d.impressions),1):0,c=t.length>0||n!==null||r!==null||i.length>0;return l.jsxs("section",{className:"page-section-divider",children:[l.jsx($h,{eyebrow:"What we based this on",title:"The signals behind this plan",subtitle:"The data behind the recommendations above. Switch to Agency for the full breakdowns."}),c?l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[t.length>0&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Where AI gets its answers"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"The websites AI tools cited most often when answering customer questions about your industry."}),l.jsx("div",{className:"mt-4 space-y-3",children:t.map(d=>l.jsx(PL,{label:d.domain+(d.isCompetitor?" (competitor)":""),value:d.count,displayValue:`${hr(d.count)}×`,max:a,barClass:"bg-zinc-400/70"},d.domain))})]}),r&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Pages Google can find on your site"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Google indexing your site increases the chances of it appearing in AI search (especially Gemini)."}),l.jsxs("p",{className:`mt-4 text-5xl font-bold tracking-tight ${r.indexedPct>=90?"text-emerald-400":r.indexedPct>=70?"text-amber-400":"text-rose-400"}`,children:[r.indexedPct,"%"]}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[hr(r.indexed)," of ",hr(r.total)," pages indexed"]}),l.jsx("div",{className:"mt-3 h-3 overflow-hidden rounded-full bg-zinc-800/80",children:l.jsx("div",{className:`h-full rounded-full ${r.indexedPct>=90?"bg-emerald-500/70":r.indexedPct>=70?"bg-amber-500/70":"bg-rose-500/70"}`,style:{width:`${Math.max(r.indexedPct,1.5)}%`}})}),l.jsxs("p",{className:"mt-3 text-xs text-zinc-400",children:[l.jsx("span",{className:"font-medium text-zinc-200",children:hr(r.notIndexed)})," ",r.notIndexed===1?"page is":"pages are"," not indexed yet."]})]}),n&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"What people search Google for"}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["You appeared in ",l.jsx("span",{className:"font-semibold text-zinc-200",children:hr(n.totalImpressions)})," Google searches and got ",l.jsx("span",{className:"font-semibold text-zinc-200",children:hr(n.totalClicks)})," ",n.totalClicks===1?"click":"clicks"," this period."]}),n.topQueries.length>0&&l.jsx("div",{className:"mt-4 space-y-3",children:n.topQueries.slice(0,5).map(d=>l.jsx(PL,{label:d.query,value:d.impressions,displayValue:`${hr(d.impressions)} ${d.impressions===1?"search":"searches"}`,max:o,barClass:"bg-sky-500/70"},d.query))})]}),i.length>0&&l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[l.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Topics where you could improve"}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Customer questions where better content on your site would help AI cite you."}),l.jsx("ul",{className:"mt-4 space-y-2 text-sm text-zinc-300",children:i.map((d,f)=>l.jsxs("li",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2",children:[l.jsx("p",{className:"font-medium text-zinc-100",children:d.query}),l.jsx("p",{className:"mt-0.5 text-xs text-zinc-400",children:yte(d.action)})]},f))})]})]}):l.jsx(BA,{message:"No supporting evidence yet — this fills in after the first AI check."})]})}const d_e=14;function LA(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function $A(e){return e==="up"?"↑":e==="down"?"↓":"→"}function Pj({label:e,delta:t,unit:n}){if(!t)return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"No prior data"})]});const r=n==="%"?"%":"",i=t.deltaAbs>0?"+":"",a=LA(t.direction),o=a==="positive"?"text-emerald-400":a==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${o}`,children:[t.current,r," ",l.jsx("span",{className:"text-sm font-medium",children:$A(t.direction)})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[i,n==="%"?t.deltaAbs.toFixed(1):t.deltaAbs,r," vs ",t.prior,r]})]})}function RL({label:e,delta:t,countLabel:n}){if(!t)return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Not enough trend data"})]});const r=t.deltaAbs>0?"+":"",i=LA(t.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${a}`,children:[hr(t.current)," ",l.jsx("span",{className:"text-sm font-medium",children:$A(t.direction)})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,hr(t.deltaAbs)," ",n," vs prior ",d_e," days"]})]})}function f_e({movements:e,audience:t}){const n=e.filter(i=>i.direction!=="flat");if(n.length===0)return null;const r=t==="client";return l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:r?"How each AI tool changed":"AI engine movements"}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:r?"AI tool":"Engine"}),l.jsx("th",{children:r?"Was":"Prior"}),l.jsx("th",{children:r?"Now":"Current"}),l.jsx("th",{children:"Change"})]})}),l.jsx("tbody",{children:n.map(i=>{const a=i.deltaAbs>0?"+":"",o=LA(i.direction),c=o==="positive"?"text-emerald-400":o==="negative"?"text-rose-400":"text-zinc-300";return l.jsxs("tr",{children:[l.jsx("td",{children:r?mv(i.provider):i.provider}),l.jsxs("td",{children:[i.prior,"%"]}),l.jsxs("td",{children:[i.current,"%"]}),l.jsxs("td",{className:c,children:[a,i.deltaAbs.toFixed(1),"% ",$A(i.direction)]})]},i.provider)})})]})})]})}function DL({insights:e,heading:t,emptyMessage:n,audience:r}){if(e.length===0)return l.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[l.jsx("p",{className:"eyebrow mb-1",children:t}),l.jsx("p",{className:"text-xs text-zinc-500",children:n})]});const i=r==="client";return l.jsxs("div",{className:"mt-4",children:[l.jsx("p",{className:"eyebrow mb-2",children:t}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[!i&&l.jsx("th",{children:"Severity"}),l.jsx("th",{children:i?"What changed":"Title"}),l.jsx("th",{children:i?"Customer question":"Query"}),l.jsx("th",{children:i?"AI tool":"Provider"})]})}),l.jsx("tbody",{children:e.map(a=>l.jsxs("tr",{children:[!i&&l.jsxs("td",{children:[l.jsx(ct,{tone:WEe[a.severity],children:Pte(a.severity)}),a.instanceCount>1&&l.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),l.jsxs("td",{className:"evidence-query-cell",children:[a.title,i&&a.instanceCount>1&&l.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),l.jsx("td",{className:"text-xs text-zinc-400",children:a.query}),l.jsx("td",{className:"text-xs text-zinc-400",children:i?mv(a.provider):a.provider})]},a.id))})]})})]})}function h_e({report:e,audience:t}){const n=e.whatsChanged,r=t==="client",i=!n.enoughHistory&&!n.gscClicksDelta&&!n.aiReferralsDelta&&n.wins.length===0&&n.regressions.length===0,a=l.jsx($h,{eyebrow:r?"Since last check":"Section 2",title:r?"What's different since last check":"What's Changed",subtitle:r?void 0:n.headline});return i?l.jsxs("section",{className:"page-section-divider",children:[a,l.jsx(BA,{message:r?"No comparison yet — trends will appear after a few more checks.":"Trends will appear after a few more checks."})]}):l.jsxs("section",{className:"page-section-divider",children:[a,l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[l.jsx(Pj,{label:r?"AI links to your website":"Citation rate",delta:n.citationRate,unit:"%"}),l.jsx(Pj,{label:r?"AI mentions your name":"Mention rate",delta:n.mentionRate,unit:"%"}),l.jsx(Pj,{label:r?"Questions AI answered with you":"Cited queries",delta:n.citedQueryCount,unit:"count"}),l.jsx(RL,{label:r?"Visitors from Google":"GSC clicks",delta:n.gscClicksDelta,countLabel:r?"visits":"clicks"}),l.jsx(RL,{label:r?"Visitors from AI tools":"AI referral sessions",delta:n.aiReferralsDelta,countLabel:r?"visits":"sessions"})]}),l.jsx(f_e,{movements:n.providerMovements,audience:t}),l.jsx(DL,{insights:n.wins,heading:r?"What got better":"Wins",emptyMessage:r?"No new wins this period.":"No new gains in the latest check.",audience:t}),l.jsx(DL,{insights:n.regressions,heading:r?"What got worse":"Regressions",emptyMessage:r?"Nothing got worse this period.":"No new regressions in the latest check.",audience:t})]})}function ML({label:e,value:t,tone:n,subtitle:r}){const i=n==="positive"?"text-emerald-400":n==="caution"?"text-amber-400":n==="negative"?"text-rose-400":"text-zinc-100";return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("p",{className:`text-2xl font-semibold tracking-tight ${i}`,children:t}),r&&l.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:r})]})}function $h({eyebrow:e,title:t,subtitle:n}){return l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"eyebrow-soft",children:e}),l.jsx("h2",{className:"page-title",children:t}),n&&l.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function p_e({items:e,limit:t=3,className:n}){if(e.length===0)return null;const r=e.slice(0,t),i=e.length-r.length;return l.jsxs("div",{className:`flex flex-wrap gap-1.5 ${n??""}`,children:[r.map((a,o)=>l.jsx("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-300",children:a},o)),i>0&&l.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/40 px-2 py-0.5 text-[11px] text-zinc-400",children:["+",i," more"]})]})}function BA({message:e}){return l.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function m_e({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,o]=x.useState(!1),[c,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,y]=x.useState(e.canonicalDomain),[v,S]=x.useState(e.country),[b,j]=x.useState(e.language),[k,E]=x.useState(e.ownedDomains??[]),[C,O]=x.useState(""),[z,A]=x.useState(null),[_,R]=x.useState(!1),[$,F]=x.useState(!1),[q,B]=x.useState(""),[V,X]=x.useState(""),[Z,H]=x.useState(""),[J,ue]=x.useState(""),[we,I]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),S(e.country),j(e.language),E(e.ownedDomains??[]))},[e,r]);function D(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),S(e.country),j(e.language),E(e.ownedDomains??[]),O("")}function U(){const G=C.trim();G&&(k.includes(G)||E([...k,G]),O(""))}function M(G){E(k.filter(Fe=>Fe!==G))}async function Q(){if(!(!f.trim()||!m.trim()||!v.trim()||!b.trim())){o(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:b.trim()}),i(!1),gt({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(G){d(G instanceof Error?G.message:"Failed to save")}finally{o(!1)}}}async function oe(){const G=q.trim(),Fe=V.trim(),De=Z.trim(),rt=J.trim();if(!(!G||!Fe||!De||!rt)){R(!0),A(null);try{const Qe={label:G,city:Fe,region:De,country:rt};we.trim()&&(Qe.timezone=we.trim()),await pV(e.name,Qe),n(),B(""),X(""),H(""),ue(""),I(""),F(!1),gt({title:"Location added",detail:`${G} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${G}`,dedupeMode:"drop"})}catch(Qe){A(Qe instanceof Error?Qe.message:"Failed to add location")}finally{R(!1)}}}async function ne(G){R(!0),A(null);try{await mV(e.name,G),n(),gt({title:"Location removed",detail:`${G} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${G}`,dedupeMode:"drop"})}catch(Fe){A(Fe instanceof Error?Fe.message:"Failed to remove location")}finally{R(!1)}}async function Ae(G){R(!0),A(null);try{await gV(e.name,G),n(),gt({title:"Default location updated",detail:`${G} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Fe){A(Fe instanceof Error?Fe.message:"Failed to set default location")}finally{R(!1)}}const _e=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||b!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[]),ee="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",he="block text-xs font-medium text-zinc-400 mb-1",Ee=q.trim()&&V.trim()&&Z.trim()&&J.trim();return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),l.jsx("h2",{children:"Project settings"})]}),!r&&l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&l.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:[c,l.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Display name"}),l.jsx("input",{className:ee,type:"text",value:f,onChange:G=>p(G.target.value),placeholder:"My Project"})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Canonical domain"}),l.jsx("input",{className:ee,type:"text",value:m,onChange:G=>y(G.target.value),placeholder:"example.com"})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Country"}),l.jsx("input",{className:ee,type:"text",value:v,onChange:G=>S(G.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Language"}),l.jsx("input",{className:ee,type:"text",value:b,onChange:G=>j(G.target.value),placeholder:"en"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:he,children:"Owned domains"}),l.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(G=>l.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:[G,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>M(G),"aria-label":`Remove ${G}`,children:"×"})]},G))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:C,onChange:G=>O(G.target.value),onKeyDown:G=>G.key==="Enter"&&(G.preventDefault(),U())}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:!C.trim(),onClick:U,children:"Add"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[l.jsx(ge,{type:"button",disabled:a||!_e||!f.trim()||!m.trim(),onClick:Q,children:a?"Saving...":"Save changes"}),l.jsx(ge,{type:"button",variant:"outline",disabled:a,onClick:D,children:"Cancel"})]})]}):l.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsx("table",{className:"w-full text-sm",children:l.jsxs("tbody",{children:[l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),l.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?l.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(G=>l.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:G},G))}):l.jsx("span",{className:"text-zinc-500",children:"—"})})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),l.jsxs("tr",{className:"border-b border-zinc-800/40",children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),l.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),l.jsxs("tr",{children:[l.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),l.jsxs("td",{className:"px-4 py-2.5",children:[z&&l.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:[z,l.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>A(null),children:"×"})]}),(e.locations??[]).length>0?l.jsxs("table",{className:"w-full text-xs mb-2",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-zinc-600",children:[l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),l.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),l.jsx("th",{className:"pb-1"})]})}),l.jsx("tbody",{children:e.locations.map(G=>l.jsxs("tr",{className:"border-t border-zinc-800/30",children:[l.jsx("td",{className:"py-1.5 pr-3",children:l.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${G.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:[G.label,G.label===e.defaultLocation?" ★":""]})}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:G.city}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:G.region}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:G.country}),l.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:G.timezone??"—"}),l.jsx("td",{className:"py-1.5",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[G.label!==e.defaultLocation&&l.jsx("button",{type:"button",disabled:_,onClick:()=>Ae(G.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${G.label} as default location`,children:"Set default"}),l.jsx("button",{type:"button",disabled:_,onClick:()=>ne(G.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${G.label}`,children:"Remove"})]})})]},G.label))})]}):l.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),$?l.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[l.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),l.jsx("input",{className:ee,type:"text",value:q,onChange:G=>B(G.target.value),placeholder:"nyc"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),l.jsx("input",{className:ee,type:"text",value:V,onChange:G=>X(G.target.value),placeholder:"New York"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),l.jsx("input",{className:ee,type:"text",value:Z,onChange:G=>H(G.target.value),placeholder:"NY"})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),l.jsx("input",{className:ee,type:"text",value:J,onChange:G=>ue(G.target.value),placeholder:"US",maxLength:2})]}),l.jsxs("div",{className:"col-span-2",children:[l.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),l.jsx("input",{className:ee,type:"text",value:we,onChange:G=>I(G.target.value),placeholder:"America/New_York"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[l.jsx(ge,{type:"button",size:"sm",disabled:_||!Ee,onClick:oe,children:_?"Adding...":"Add location"}),l.jsx(ge,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{F(!1),A(null)},children:"Cancel"})]})]}):l.jsx(ge,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const g_e=[{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"}],IL=["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 y_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState("daily"),[c,d]=x.useState(6),[f,p]=x.useState(""),[m,y]=x.useState("UTC"),[v,S]=x.useState(!1),[b,j]=x.useState(""),[k,E]=x.useState(!1),[C,O]=x.useState(!1),[z,A]=x.useState(null);x.useEffect(()=>{jV(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const q=lne(t.preset??null,t.cronExpr);o(q.freq),d(q.hour),p(q.customCron);const B=IL.includes(t.timezone);y(B?t.timezone:"Other"),S(!B),j(B?"":t.timezone)}else o("daily"),d(6),p(""),y("UTC"),S(!1),j("");A(null),i(!0)},R=async()=>{E(!0),A(null);try{const B={timezone:v?b.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=one(a,c);const V=await S2(e,B);n(V),i(!1),gt({title:"Schedule saved",detail:kw(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(q){A(q instanceof Error?q.message:"Failed to save schedule")}finally{E(!1)}},$=async()=>{if(!(!t||t==="loading")){E(!0),A(null);try{const q={timezone:t.timezone,enabled:!t.enabled};t.preset?q.preset=t.preset:q.cron=t.cronExpr;const B=await S2(e,q);n(B),gt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:kw(B.preset??null,B.cronExpr,B.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(q){A(q instanceof Error?q.message:"Failed to update schedule")}finally{E(!1)}}},F=async()=>{O(!0),A(null);try{await NV(e),n(null),i(!1),gt({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(q){A(q instanceof Error?q.message:"Failed to remove schedule")}finally{O(!1)}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:_,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&l.jsx(ze,{className:"surface-card compact-card",children:l.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&l.jsxs(ze,{className:"surface-card compact-card",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-sm font-medium text-zinc-200",children:kw(t.preset??null,t.cronExpr,t.timezone)}),l.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",l.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&l.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx(ct,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:$,children:t.enabled?"Pause":"Resume"}),l.jsx(ge,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:F,children:C?"Removing...":"Remove"})]})]}),z&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:z})]}),r&&l.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),l.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:a,onChange:q=>o(q.target.value),children:g_e.map(q=>l.jsx("option",{value:q.value,children:q.label},q.value))})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),l.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:c,disabled:a==="twice-daily"||a==="custom",onChange:q=>d(parseInt(q.target.value)),children:Array.from({length:24},(q,B)=>l.jsx("option",{value:B,children:a1(B)},B))})]})]}),a==="custom"&&l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),l.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:f,onChange:q=>p(q.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),l.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:v?"Other":m,onChange:q=>{q.target.value==="Other"?(S(!0),y("Other")):(S(!1),y(q.target.value))},children:[IL.map(q=>l.jsx("option",{value:q,children:q},q)),l.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&l.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:b,onChange:q=>j(q.target.value)})]}),z&&l.jsx("p",{className:"text-rose-400 text-sm",children:z}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),A(null)},children:"Cancel"}),l.jsx(ge,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:R,children:k?"Saving...":"Save schedule"})]})]})]})}const v_e=[{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 x_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,o]=x.useState(""),[c,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,y]=x.useState(null),[v,S]=x.useState({}),[b,j]=x.useState(new Set);x.useEffect(()=>{kV(e).then(n).catch(()=>n([]))},[e]);const k=z=>{d(A=>A.includes(z)?A.filter(_=>_!==z):[...A,z])},E=async()=>{if(!(!a.trim()||c.length===0)){p(!0),y(null);try{const z=await CV(e,{channel:"webhook",url:a.trim(),events:c});n(A=>A==="loading"?[z]:[...A,z]),o(""),d(["citation.lost","citation.gained"]),i(!1),gt({title:"Webhook added",detail:`Notifications will be sent to ${z.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(z){y(z instanceof Error?z.message:"Failed to add webhook")}finally{p(!1)}}},C=async z=>{if(!b.has(z)){j(A=>new Set(A).add(z));try{await AV(e,z),n(A=>A==="loading"?A:A.filter(_=>_.id!==z)),gt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${z}`,dedupeMode:"drop"})}catch(A){y(A instanceof Error?A.message:"Failed to remove webhook")}finally{j(A=>{const _=new Set(A);return _.delete(z),_})}}},O=async z=>{S(A=>({...A,[z]:{state:"testing"}}));try{const A=await OV(e,z);S(_=>({..._,[z]:{state:A.ok?"ok":"fail",status:A.status}})),A.ok&>({title:"Test notification sent",detail:`Webhook returned status ${A.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${z}`,dedupeMode:"replace"})}catch{S(A=>({...A,[z]:{state:"fail"}}))}};return l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),l.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),l.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:a,onChange:z=>o(z.target.value)})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),l.jsx("div",{className:"flex flex-wrap gap-3",children:v_e.map(z=>l.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[l.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:c.includes(z.value),onChange:()=>k(z.value)}),l.jsx("span",{className:"text-sm text-zinc-300",children:z.label})]},z.value))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm",children:m}),l.jsxs("div",{className:"flex gap-2 justify-end",children:[l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),l.jsx(ge,{type:"button",size:"sm",disabled:f||!a.trim()||c.length===0,onClick:E,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&l.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&l.jsx(ze,{className:"surface-card compact-card",children:l.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&&l.jsxs("div",{className:"evidence-table-wrap",children:[l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Endpoint"}),l.jsx("th",{children:"Events"}),l.jsx("th",{children:"Status"}),l.jsx("th",{})]})}),l.jsx("tbody",{children:t.map(z=>l.jsxs("tr",{children:[l.jsx("td",{className:"evidence-query-cell",children:l.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:z.urlHost,children:z.urlDisplay??z.url})}),l.jsx("td",{children:l.jsx("div",{className:"flex flex-wrap gap-1",children:z.events.map(A=>l.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:A.replace("."," ")},A))})}),l.jsx("td",{children:l.jsx(ct,{tone:z.enabled?"positive":"neutral",children:z.enabled?"Active":"Paused"})}),l.jsx("td",{children:l.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[z.id]&&(()=>{const A=v[z.id],_=A.state==="testing"?"Sending…":A.state==="ok"?`Delivered${A.status?` (${A.status})`:""}`:`Failed${A.status?` (${A.status})`:""}`;return l.jsx(ct,{tone:A.state==="ok"?"positive":A.state==="fail"?"negative":"neutral",children:_})})(),l.jsx(ge,{variant:"ghost",size:"sm",type:"button",disabled:v[z.id]?.state==="testing",onClick:()=>O(z.id),children:"Test"}),l.jsx(ge,{variant:"ghost",size:"sm",type:"button",disabled:b.has(z.id),onClick:()=>C(z.id),children:b.has(z.id)?"Removing…":"Remove"})]})})]},z.id))})]}),m&&l.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function b_e({projectName:e,refreshNonce:t}){const n=Kr(),[r,i]=x.useState(null),[a,o]=x.useState([]),[c,d]=x.useState(null),[f,p]=x.useState([]),[m,y]=x.useState([]),[v,S]=x.useState(null),[b,j]=x.useState(""),[k,E]=x.useState(""),[C,O]=x.useState(""),[z,A]=x.useState(!0),[_,R]=x.useState(!1),[$,F]=x.useState(null),[q,B]=x.useState("coverage");x.useEffect(()=>{V()},[e,t]);async function V(){A(!0),F(null);try{const D=await n.fetchQuery({queryKey:Re.bing.status(e),queryFn:()=>L5(e),staleTime:kr});if(i(D),D.connected){const[U,M,Q,oe]=await Promise.all([n.fetchQuery({queryKey:Re.bing.coverage(e),queryFn:()=>JN(e).catch(()=>null),staleTime:kr}),n.fetchQuery({queryKey:Re.bing.inspections(e),queryFn:()=>$5(e).catch(()=>[]),staleTime:kr}),n.fetchQuery({queryKey:Re.bing.performance(e),queryFn:()=>ZV(e).catch(()=>[]),staleTime:kr}),D.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:Re.bing.sites(e),queryFn:()=>QV(e).then(ne=>ne.sites).catch(()=>[]),staleTime:kr})]);d(U),p(M),y(Q),o(oe)}else d(null),p([]),y([]),o([])}catch(D){F(D instanceof Error?D.message:"Failed to load Bing data")}finally{A(!1)}}async function X(){if(k.trim()){F(null);try{const D=await GV(e,k.trim());await n.invalidateQueries({queryKey:Re.bing.project(e)}),E(""),D.availableSites.length>0&&o(D.availableSites),await V()}catch(D){F(D instanceof Error?D.message:"Failed to connect")}}}async function Z(){try{await VV(e),await n.invalidateQueries({queryKey:Re.bing.project(e)}),i(null),o([]),d(null),p([]),y([]),S(null),O(""),F(null)}catch(D){F(D instanceof Error?D.message:"Failed to disconnect")}}async function H(){if(C)try{await YV(e,C),await n.invalidateQueries({queryKey:Re.bing.project(e)}),await V()}catch(D){F(D instanceof Error?D.message:"Failed to set site")}}async function J(){if(b.trim())try{const D=await B5(e,b.trim());await n.invalidateQueries({queryKey:Re.bing.project(e)}),S(D),p(U=>[D,...U])}catch(D){F(D instanceof Error?D.message:"Inspection failed")}}async function ue(D){R(!0),F(null);try{const U=await k2(e,{urls:[D]}),{succeeded:M,failed:Q,total:oe}=U.summary;gt({title:"Bing submission requested",detail:Q===0?`${M} URL submitted to Bing.`:`${M}/${oe} submitted successfully, ${Q} failed.`,tone:Q===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${D}`,dedupeMode:"replace"})}catch(U){const M=U instanceof Error?U.message:"Submission failed";F(M),gt({title:"Bing submission failed",detail:M,tone:"negative",dedupeKey:`bing:indexing:${e}:${D}`,dedupeMode:"replace"})}finally{R(!1)}}async function we(){R(!0),F(null),gt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const D=await k2(e,{allUnindexed:!0}),{succeeded:U,failed:M,total:Q}=D.summary;gt({title:"Bing submissions requested",detail:M===0?`${U}/${Q} URL${Q!==1?"s":""} submitted to Bing.`:`${U}/${Q} submitted successfully, ${M} failed.`,tone:M===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(D){const U=D instanceof Error?D.message:"Batch submission failed";F(U),gt({title:"Bing submissions failed",detail:U,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{R(!1)}}if(z)return l.jsx(ze,{className:"surface-card",children:l.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsx(ct,{tone:"caution",children:"Not connected"})]}),l.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),l.jsxs("div",{className:"mt-3",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.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:k,onChange:D=>E(D.target.value),onKeyDown:D=>D.key==="Enter"&&X()}),l.jsx(ge,{size:"sm",disabled:!k.trim(),onClick:X,children:"Connect"})]}),l.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",l.jsx("a",{href:"https://www.bing.com/webmasters/",target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-300 underline underline-offset-2",children:"Bing Webmaster Tools"})]})]}),$&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});if(!r.siteUrl)return l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ct,{tone:"positive",children:"Connected"}),l.jsx(ge,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),l.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."})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.domain})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?ha(r.updatedAt):"—"})]})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?l.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[l.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:C,onChange:D=>O(D.target.value),children:[l.jsx("option",{value:"",children:"Select a site..."}),a.map(D=>l.jsxs("option",{value:D.url,children:[D.url,D.verified?" (verified)":""]},D.url))]}),l.jsx(ge,{size:"sm",disabled:!C,onClick:H,children:"Set Site"})]}):l.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."})]})]}),$&&l.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});const I=[{key:"coverage",label:"Coverage"},{key:"inspections",label:"Inspections"},{key:"performance",label:"Performance"}];return l.jsxs("div",{className:"space-y-3",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),l.jsx("h3",{children:"Domain authorization"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ct,{tone:"positive",children:"Connected"}),l.jsx(ge,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),$&&l.jsx("p",{className:"mb-3 text-xs text-rose-400",children:$}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),l.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),l.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),l.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",l.jsx("code",{children:r.siteUrl}),"."]})]}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.siteUrl})]}),l.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[l.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),l.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?ha(r.updatedAt):"—"})]})]})]})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),l.jsx("h3",{children:"Index monitoring"})]}),l.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${ha(c.lastInspectedAt)}`:"No inspection history yet"})]}),l.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:I.map(D=>l.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${q===D.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(D.key),children:D.label},D.key))}),q==="coverage"&&c&&l.jsxs("div",{className:"mt-4 space-y-4",children:[l.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[l.jsx(Jm,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),l.jsx(Jm,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),l.jsx(Jm,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),l.jsx(Jm,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.notIndexed.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",c.notIndexed.length,")"]}),l.jsx(ge,{size:"sm",variant:"ghost",disabled:_,onClick:we,children:_?"Submitting…":"Submit all to Bing"})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:c.notIndexed.map(D=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>ue(D.url),children:"Submit"})})]},D.id))})]})})]}),(c.unknown??[]).length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[l.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(c.unknown??[]).length,")"]}),l.jsx(ge,{size:"sm",variant:"ghost",disabled:_,onClick:we,children:_?"Submitting…":"Submit all to Bing"})]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),l.jsx("tbody",{children:(c.unknown??[]).map(D=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.lastCrawledDate?ha(D.lastCrawledDate):"—"}),l.jsx("td",{className:"py-1.5 px-3 text-right",children:l.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>ue(D.url),children:"Submit"})})]},D.id))})]})})]}),c.indexed.length>0&&l.jsxs("div",{children:[l.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.indexed.length,")"]}),l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),l.jsx("tbody",{children:c.indexed.map(D=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.lastCrawledDate?ha(D.lastCrawledDate):"—"})]},D.id))})]})})]})]}),q==="coverage"&&!c&&l.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),q==="inspections"&&l.jsxs("div",{className:"mt-4 space-y-3",children:[l.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[l.jsx("input",{type:"text",className:"flex-1 rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"URL to inspect",value:b,onChange:D=>j(D.target.value),onKeyDown:D=>D.key==="Enter"&&J()}),l.jsx(ge,{size:"sm",disabled:!b.trim(),onClick:J,children:"Inspect"})]}),v&&l.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[l.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),l.jsxs("div",{className:"text-zinc-400",children:["In Index: ",l.jsx("span",{className:v.inIndex?"text-emerald-400":"text-rose-400",children:v.inIndex?"Yes":"No"})," · ","HTTP: ",v.httpCode??"—"," · ","Crawled: ",v.lastCrawledDate??"—"]})]}),f.length>0&&l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),l.jsx("tbody",{children:f.map(D=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.url}),l.jsx("td",{className:"py-1.5 px-3",children:l.jsx(ct,{tone:D.inIndex?"positive":"negative",children:D.inIndex?"Yes":"No"})}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:D.httpCode??"—"}),l.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:ha(D.inspectedAt)})]},D.id))})]})})]}),q==="performance"&&l.jsx("div",{className:"mt-4",children:m.length===0?l.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):l.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:l.jsxs("table",{className:"w-full text-xs",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800",children:[l.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Dm[ko.Clicks]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Dm[ko.Impressions]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Dm[ko.CTR]}),l.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Dm[ko.Position]})]})}),l.jsx("tbody",{children:m.map((D,U)=>l.jsxs("tr",{className:"border-b border-zinc-800/50",children:[l.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:D.query}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:D.clicks}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:D.impressions}),l.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(D.ctr)?D.ctr*100:0).toFixed(1),"%"]}),l.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:D.averagePosition.toFixed(1)})]},U))})]})})})]})]})}function w_e({projectName:e}){const t=Kr(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[o,c]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,y]=x.useState(!1),[v,S]=x.useState(null),[b,j]=x.useState(null),[k,E]=x.useState(!1),[C,O]=x.useState(null),[z,A]=x.useState(null),[_,R]=x.useState(0);async function $(U=!1){U||a(!0),f(null);try{const[M,Q,oe]=await Promise.all([ZN().catch(()=>null),t.fetchQuery({queryKey:Re.gsc.connections(e),queryFn:()=>M5(e).catch(()=>[]),staleTime:kr}),t.fetchQuery({queryKey:Re.bing.status(e),queryFn:()=>L5(e).catch(()=>null),staleTime:kr})]),ne=Q.find(ee=>ee.connectionType==="gsc")??null;y(!!M?.google?.configured),E(!!M?.bing?.configured),S(ne),O(oe);const[Ae,_e]=await Promise.all([ne?t.fetchQuery({queryKey:Re.gsc.coverage(e),queryFn:()=>XN(e).catch(()=>null),staleTime:kr}):Promise.resolve(null),oe?.connected?t.fetchQuery({queryKey:Re.bing.coverage(e),queryFn:()=>JN(e).catch(()=>null),staleTime:kr}):Promise.resolve(null)]);j(Ae),A(_e)}catch(M){f(M instanceof Error?M.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(o!=="idle")return;p.current?.abort();const U=new AbortController;p.current=U;const M=U.signal;c("syncing"),f(null);const Q=[];try{async function oe(){if(!v)return;const ee=await I5(e);if(!ee?.id)return;const he=2e3,G=Date.now()+12e4;for(;Date.now()<G;){if(M.aborted||(await new Promise(De=>setTimeout(De,he)),M.aborted))return;const Fe=await Kl(ee.id).catch(()=>null);if(!Fe)break;if(["completed","failed","cancelled"].includes(Fe.status)){Fe.status!=="completed"&&Q.push(`Google sync ${Fe.status}`);break}}}const ne=10;async function Ae(){if(!C?.connected)return;const ee=await $5(e).catch(()=>[]),he=[...new Set(ee.map(Ee=>Ee.url))];if(he.length===0){await WV(e).catch(()=>null);return}for(let Ee=0;Ee<he.length;Ee+=ne){if(M.aborted)return;const G=he.slice(Ee,Ee+ne),De=(await Promise.allSettled(G.map(rt=>B5(e,rt)))).filter(rt=>rt.status==="rejected").length;De>0&&Q.push(`${De} Bing inspection(s) failed`)}}const _e=await Promise.allSettled([oe(),Ae()]);for(const ee of _e)ee.status==="rejected"&&Q.push(ee.reason instanceof Error?ee.reason.message:"Sync failed");if(M.aborted)return;c("reloading"),await Promise.all([t.invalidateQueries({queryKey:Re.gsc.project(e)}),t.invalidateQueries({queryKey:Re.bing.project(e)})]),await $(!0),R(ee=>ee+1),Q.length>0&&f(`Partial refresh: ${Q.join("; ")}`)}catch(oe){M.aborted||f(oe instanceof Error?oe.message:"Refresh failed")}finally{M.aborted||c("idle")}}x.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const q=v?"positive":m?"caution":"negative",B=v?"Connected":m?"Ready to connect":"Needs setup",V=b?`${b.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",X=b?`${b.summary.notIndexed} not indexed${b.summary.deindexed>0?` · ${b.summary.deindexed} deindexed`:""}`:v?"Run sitemap inspection to populate coverage":m?"Connect Search Console for this domain":"Add Google OAuth credentials in Settings",Z=b?.lastSyncedAt??b?.lastInspectedAt??v?.updatedAt??null,H=C?.connected?"positive":k?"caution":"negative",J=C?.connected?"Connected":k?"Ready to connect":"Needs setup",ue=z?`${z.summary.percentage}% indexed`:C?.connected?"Awaiting coverage":"No coverage data",we=z?z.summary.notIndexed+(z.summary.unknown??0):0,I=z?`${we} not in index`:C?.connected?"Inspect URLs to populate coverage":k?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",D=z?.lastInspectedAt??C?.updatedAt??null;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),l.jsx("h2",{children:"Search Engine Intelligence"}),l.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."})]}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:i||o!=="idle",onClick:()=>{F()},children:i?"Loading…":o==="syncing"?"Refreshing Google & Bing…":o==="reloading"?"Reloading workspaces…":"Refresh all"})]}),d&&l.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:d}),l.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[l.jsx(LP,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":B,tone:i?"neutral":q,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:i?"Loading…":V,note:i?"Loading overview…":X,updatedAt:Z,active:n==="google",onClick:()=>r("google")}),l.jsx(LP,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":J,tone:i?"neutral":H,targetLabel:"Selected site",targetValue:C?.siteUrl??"No site selected",coverageValue:i?"Loading…":ue,note:i?"Loading overview…":I,updatedAt:D,active:n==="bing",onClick:()=>r("bing")})]})]}),l.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([U,M])=>l.jsx("button",{type:"button",role:"tab","aria-selected":n===U,className:`project-subnav-link ${n===U?"project-subnav-link-active":""}`,onClick:()=>r(U),children:M},U))}),n==="google"&&l.jsx(IEe,{projectName:e}),n==="bing"&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),l.jsx("h2",{children:"Bing Webmaster Tools"})]})}),l.jsx(b_e,{projectName:e,refreshNonce:_})]})]})}function S_e({insights:e}){const{openEvidence:t}=fd(),[n,r]=x.useState(null);return l.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,o=i.affectedPhrases.length>0;return l.jsxs("div",{children:[l.jsxs("div",{className:`insight-row insight-row-${i.tone} ${o?"cursor-pointer":""}`,onClick:o?()=>r(a?null:i.id):void 0,children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o&&l.jsx(Uh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),l.jsx(ct,{tone:i.tone,children:i.actionLabel}),l.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),l.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),o&&l.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&l.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((c,d)=>l.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(E1,{state:c.citationState}),l.jsx("span",{className:"text-sm text-zinc-200 truncate",children:c.query}),l.jsx("div",{className:"hidden sm:flex gap-1",children:c.provider&&l.jsx(Ql,{provider:c.provider})})]}),c.evidenceId&&l.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(c.evidenceId)},children:"View →"})]},c.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function hp({tab:e}){const{projectId:t}=Bh({from:"/projects/$projectId"}),n=qo(),{dashboard:r,isLoading:i,refetch:a}=fc();if(!r||i)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-48"}),l.jsx("div",{className:"skeleton-text-sm w-32"})]}),l.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(be=>l.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[l.jsx("div",{className:"skeleton-circle size-20"}),l.jsx("div",{className:"skeleton-text w-16 mt-3"})]},be))}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-28"}),l.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(be=>l.jsx("div",{className:"skeleton-text-sm w-full"},be))})]})]});const o=mae(r,t),[c,d]=x.useState(!1),[f,p]=x.useState(!1),[m,y]=x.useState(!1),[v,S]=x.useState(""),[b,j]=x.useState(!1),[k,E]=x.useState(!1),[C,O]=x.useState(""),[z,A]=x.useState(!1),[_,R]=x.useState(!1),[$,F]=x.useState(""),[q,B]=x.useState(!1),[V,X]=x.useState(void 0),[Z,H]=x.useState(!1),[J,ue]=x.useState(null),[we,I]=x.useState(!1),D=o?.visibilityEvidence??[],U=o?.project.name??"",M=o?.project.displayName||o?.project.name||U,Q=a9(),oe=(o?.recentRuns??[]).some(be=>be.kind===Nt["answer-visibility"]&&(be.status===pr.running||be.status===pr.queued)),ne=x.useMemo(()=>new Set(D.map(be=>be.location??"")),[D]),Ae=ne.has(""),_e=x.useMemo(()=>[...ne].filter(Boolean),[ne]);x.useEffect(()=>{if(V===void 0||V===""||!U){ue(null),I(!1);return}I(!0),R5(U,V).then(be=>{ue(be),I(!1)}).catch(()=>{ue(null),I(!1)})},[V,U]);const ee=x.useMemo(()=>{if(!J)return null;const be=new Map;for(const Je of J){for(const[zt,Ct]of Object.entries(Je.providerRuns??{}))be.set(`${Je.query}::${zt}`,Ct.map(Ye=>({runId:Ye.runId,citationState:Ye.citationState,createdAt:Ye.createdAt,answerMentioned:Ye.answerMentioned,visibilityState:Ye.visibilityState,visibilityTransition:Ye.visibilityTransition})));(!Je.providerRuns||Object.keys(Je.providerRuns).length===0)&&be.set(`${Je.query}::`,Je.runs.map(zt=>({runId:zt.runId,citationState:zt.citationState,createdAt:zt.createdAt,answerMentioned:zt.answerMentioned,visibilityState:zt.visibilityState,visibilityTransition:zt.visibilityTransition})))}return be},[J]),he=x.useMemo(()=>{const be=V!==void 0?D.filter(Je=>V===""?!Je.location:Je.location===V):D;return ee?be.map(Je=>{const zt=ee.get(`${Je.query}::${Je.provider}`)??ee.get(`${Je.query}::`);return zt?{...Je,runHistory:zt}:Je}):be},[D,V,ee]);if(!o)return l.jsx("div",{className:"page-container",children:l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Project not found"}),l.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),l.jsx(ge,{asChild:!0,children:l.jsx(jt,{to:"/",children:"Return to overview"})})]})});async function Ee(){try{await Q.mutateAsync({projectName:U,projectLabel:M,sourceAction:"project-run"}),a()}catch{}}async function G(){p(!0);try{await yV(U),gt({title:"Project deleted",detail:`${M} was removed.`,tone:"positive",dedupeKey:`project:delete:${U}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(be){console.error("Failed to delete project:",be)}finally{p(!1)}}async function Fe(){try{const be=await vV(U),Je=typeof be=="string"?be:JSON.stringify(be,null,2),zt=new Blob([Je],{type:"text/yaml"}),Ct=URL.createObjectURL(zt),Ye=document.createElement("a");Ye.href=Ct,Ye.download=`${U}.yaml`,Ye.click()}catch(be){gt({title:"Export failed",detail:be instanceof Error?be.message:"Could not export project YAML.",tone:"negative"})}}async function De(){const be=v.split(`
|
|
293
|
+
`).map(Je=>Je.trim()).filter(Boolean);if(be.length!==0){j(!0);try{await dV(U,be),a(),S(""),y(!1)}finally{j(!1)}}}async function rt(){const be=C.trim();if(be){A(!0);try{const zt=(await P5(U)).map(Ye=>Ye.domain),Ct=[...new Set([...zt,be])];await D5(U,Ct),a(),O(""),E(!1)}finally{A(!1)}}}async function Qe(){const be=$.trim();if(be){B(!0);try{const Je=o?.project.ownedDomains??[];await b2(U,[...Je,be]),a(),F(""),R(!1)}finally{B(!1)}}}async function en(be){B(!0);try{const Je=o?.project.ownedDomains??[];await b2(U,Je.filter(zt=>zt!==be)),a()}finally{B(!1)}}async function Ut(be,Je){await fV(be,Je),a()}const ln=be=>!Number.isNaN(Number.parseInt(be,10)),_t=[{key:"overview",label:"Overview",href:`/projects/${o.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${o.project.id}/search-console`},{key:"activity",label:"Activity",href:`/projects/${o.project.id}/activity`},{key:"report",label:"Report",href:`/projects/${o.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${o.project.id}/inbound`}];return l.jsxs("div",{className:"page-container",children:[c?l.jsxs(ze,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[l.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),l.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",l.jsx("strong",{className:"text-zinc-200",children:o.project.displayName||o.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(ge,{type:"button",variant:"destructive",disabled:f,onClick:G,children:f?"Deleting...":"Yes, delete project"}),l.jsx(ge,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:o.project.displayName||o.project.name}),l.jsxs("p",{className:"page-subtitle",children:[o.project.canonicalDomain,(o.project.ownedDomains??[]).length===0&&!_&&l.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>R(!0),children:"+ add domain"})," "," · ",o.contextLabel]}),l.jsxs("div",{className:"tag-row",children:[l.jsx("span",{className:"tag",children:o.project.country}),l.jsx("span",{className:"tag",children:o.project.language.toUpperCase()}),o.project.tags.map(be=>l.jsx("span",{className:"tag",children:be},be))]}),((o.project.ownedDomains??[]).length>0||_)&&l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[l.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(o.project.ownedDomains??[]).map(be=>l.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:[be,l.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:q,onClick:()=>en(be),"aria-label":`Remove ${be}`,children:"×"})]},be)),_?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.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:$,onChange:be=>F(be.target.value),onKeyDown:be=>be.key==="Enter"&&Qe(),autoFocus:!0}),l.jsx(ge,{type:"button",size:"sm",disabled:!$.trim()||q,onClick:Qe,children:q?"...":"Add"}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{R(!1),F("")},children:"Cancel"})]}):l.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:()=>R(!0),children:"+ domain"})]})]}),l.jsxs("div",{className:"page-header-right",children:[l.jsx("p",{className:"text-sm text-zinc-500",children:o.dateRangeLabel}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ge,{type:"button",variant:"outline",size:"icon",onClick:Fe,"aria-label":"Export project as YAML",children:l.jsx(kv,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ge,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:l.jsx(J5,{className:"h-4 w-4 text-zinc-400"})}),l.jsx(ge,{type:"button",disabled:Q.isPending||oe,onClick:Ee,children:Q.isPending?"Starting…":oe?"Sweep running…":"Run now"})]})]})]}),l.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:_t.map(be=>l.jsx(jt,{to:be.href,className:`project-subnav-link ${be.key===e?"project-subnav-link-active":""}`,"aria-current":be.key===e?"page":void 0,children:be.label},be.key))}),e==="overview"?l.jsxs(l.Fragment,{children:[l.jsxs("section",{className:"gauge-row",children:[l.jsx(Rg,{value:o.visibilitySummary.value,label:o.visibilitySummary.label,delta:o.visibilitySummary.delta,tone:o.visibilitySummary.tone,description:o.visibilitySummary.description,tooltip:o.visibilitySummary.tooltip,isNumeric:ln(o.visibilitySummary.value),progress:o.visibilitySummary.progress,providerCoverage:o.visibilitySummary.providerCoverage}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",l.jsx(mr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),l.jsxs("p",{className:"metric-card-big-value",children:[l.jsx("span",{className:"text-zinc-50",children:o.gapQueries.value}),l.jsxs("span",{className:"text-zinc-600",children:[" / ",o.queryCounts.total]})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.gapQueries.tone}`,style:{width:o.gapQueries.progress!==void 0?`${Math.min(Math.max(o.gapQueries.progress,0),100)}%`:"0%"}})}),l.jsx("p",{className:"metric-card-detail",children:o.gapQueries.delta}),l.jsx("p",{className:"metric-card-sub",children:o.gapQueries.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",l.jsx(mr,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),l.jsxs("p",{className:"metric-card-big-value",children:[l.jsx("span",{className:"text-zinc-50",children:o.indexCoverage.value}),l.jsx("span",{className:"text-zinc-600",children:"%"})]}),l.jsx("div",{className:"metric-card-bar",children:l.jsx("div",{className:`metric-card-bar-fill progress-fill-${o.indexCoverage.tone}`,style:{width:`${Number.parseInt(o.indexCoverage.value,10)||0}%`}})}),l.jsx("p",{className:"metric-card-detail",children:o.indexCoverage.delta}),l.jsx("p",{className:"metric-card-sub",children:o.indexCoverage.description})]}),l.jsxs("div",{className:"metric-card",children:[l.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",l.jsx(mr,{text:"Query-level citation changes compared to the previous completed run."})]}),o.movementSummary.hasPreviousRun?l.jsxs("div",{className:"metric-card-movement",children:[l.jsxs("span",{className:o.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",o.movementSummary.gained," gained"]}),l.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),l.jsxs("span",{className:o.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",o.movementSummary.lost," lost"]})]}):l.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),l.jsx("p",{className:"metric-card-sub mt-auto",children:o.movementSummary.gained===0&&o.movementSummary.lost===0&&o.movementSummary.hasPreviousRun?"No changes since last run":o.movementSummary.gained>o.movementSummary.lost?"Visibility improving":o.movementSummary.lost>o.movementSummary.gained?"Visibility declining":""})]})]}),l.jsx(FEe,{projectName:o.project.name}),o.providerScores.length>1&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),l.jsxs("h2",{children:["Visibility by model ",l.jsx(mr,{text:"Per-model citation rate. Shows how often each AI model cites your domain across all tracked queries. Switching models can significantly affect citation rates."})]})]})}),l.jsx("div",{className:"evidence-table-wrap",children:l.jsxs("table",{className:"evidence-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:"Model"}),l.jsx("th",{children:"Score"}),l.jsx("th",{children:"Cited queries"})]})}),l.jsx("tbody",{children:o.providerScores.map(be=>l.jsxs("tr",{children:[l.jsx("td",{children:l.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[l.jsx(Ql,{provider:be.provider}),be.model&&l.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:be.model})]})}),l.jsx("td",{children:l.jsxs("span",{className:`font-semibold ${be.score>=70?"text-emerald-400":be.score>=40?"text-amber-400":"text-rose-400"}`,children:[be.score,"%"]})}),l.jsxs("td",{className:"text-zinc-500",children:[be.cited," of ",be.total]})]},`${be.provider}::${be.model??"unknown"}`))})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),l.jsx("h2",{children:"Citation signals"})]})}),l.jsx(S_e,{insights:o.insights})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),l.jsx("h2",{children:"Query citation tracking"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[new Set(o.visibilityEvidence.map(be=>be.query)).size," queries tracked"]}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>y(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&l.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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 queries, one per line",value:v,onChange:be=>S(be.target.value)}),l.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
294
|
+
`).filter(be=>be.trim()).length," queries"]}),l.jsx(ge,{type:"button",size:"sm",disabled:!v.trim()||b,onClick:De,children:b?"Adding...":"Add queries"})]})]}),o.project.locations&&o.project.locations.length>0&&l.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[l.jsx("button",{className:`filter-chip ${V===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":V===void 0,onClick:()=>{X(void 0)},children:"All locations"}),o.project.locations.map(be=>ne.has(be.label)&&l.jsx("button",{className:`filter-chip ${V===be.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===be.label,onClick:()=>{X(be.label),H(!1)},children:be.label},be.label)),Ae&&l.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{X(""),H(!1)},children:"No location"}),_e.length>1&&V===void 0&&l.jsx("button",{className:`filter-chip filter-chip-compare ${Z?"filter-chip-active":""}`,type:"button","aria-pressed":Z,onClick:()=>H(be=>!be),title:"Side-by-side location comparison",children:"Compare"})]}),l.jsx(nfe,{evidence:he})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),l.jsx("h2",{children:"Competitive landscape"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("p",{className:"supporting-copy",children:[o.competitors.length," tracked"]}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&l.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[l.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:C,onChange:be=>O(be.target.value),onKeyDown:be=>be.key==="Enter"&&rt()}),l.jsx(ge,{type:"button",size:"sm",disabled:!C.trim()||z,onClick:rt,children:z?"Adding...":"Add"})]}),l.jsx(rfe,{competitors:o.competitors})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),l.jsx("h2",{children:"Recent execution history"})]})}),l.jsx("div",{className:"run-list",children:o.recentRuns.map(be=>l.jsx(zB,{run:be},be.id))})]}),l.jsx(m_e,{project:{...o.project,displayName:o.project.displayName??o.project.name,defaultLocation:o.project.defaultLocation??null},onUpdateProject:Ut,onRefresh:()=>{a()}}),l.jsx(y_e,{projectName:o.project.name}),l.jsx(x_e,{projectName:o.project.name})]}):e==="report"?l.jsx(JEe,{projectName:o.project.name}):e==="activity"?l.jsx(wEe,{projectName:o.project.name}):e==="inbound"?l.jsx(qEe,{projectName:o.project.name}):l.jsx(w_e,{projectName:o.project.name})]})}function j_e(){const{dashboard:e,isLoading:t}=fc(),n=TEe();if(!e||t)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-20"}),l.jsx("div",{className:"skeleton-text-sm w-72"})]}),l.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 space-y-1.5",children:[l.jsx("div",{className:"skeleton-text w-40"}),l.jsx("div",{className:"skeleton-text-sm w-56"})]}),l.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=x.useState("all"),o=i==="all"?r:r.filter(d=>d.status===i),c=async()=>{try{await n.mutateAsync(void 0)}catch{}};return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Runs"}),l.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),l.jsx(ge,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},children:n.isPending?"Queueing…":"Run all projects"})]}),l.jsxs("section",{children:[l.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>l.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":zv(d)},d))}),l.jsx("div",{className:"run-list",children:o.length>0?o.map(d=>l.jsx(zB,{run:d},d.id)):l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h2",{children:"No runs match this filter"}),l.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function N_e({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,o]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,S]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(!1),[C,O]=x.useState(null),[z,A]=x.useState(!1),_=i?c.trim().length>0:a.trim().length>0;async function R(){if(_){E(!0),O(null),A(!1);try{const F=Z=>{const H=parseInt(Z.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},q={},B=F(m);B!==void 0&&(q.maxConcurrency=B);const V=F(v);V!==void 0&&(q.maxRequestsPerMinute=V);const X=F(b);X!==void 0&&(q.maxRequestsPerDay=X),await wV(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(q).length>0?{quota:q}:{}}),o(""),d(""),p(""),y(""),S(""),j(""),A(!0),gt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){O(F instanceof Error?F.message:"Failed to update provider")}finally{E(!1)}}}const $=n??"Use default model";return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),l.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:c,onChange:F=>d(F.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&l.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 ","↗"]})]}),l.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:i?"Optional — most local servers don't need one":`Enter ${e} API key`,value:a,onChange:F=>o(F.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),l.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:$,value:f,onChange:F=>p(F.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),l.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[l.jsxs("div",{children:[l.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:m,onChange:F=>y(F.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),l.jsxs("div",{children:[l.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:v,onChange:F=>S(F.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),l.jsxs("div",{children:[l.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:b,onChange:F=>j(F.target.value)}),l.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),C&&l.jsx("p",{className:"text-xs text-rose-400",children:C}),z&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),l.jsx(ge,{type:"button",size:"sm",disabled:!_||k,onClick:R,children:k?"Saving...":"Save"})]})}function k_e({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,o]=x.useState(!1),[c,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){o(!0),d(null),p(!1);try{await SV({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),gt({title:"Google OAuth app updated",detail:"Dashboard Google credentials were saved.",tone:"positive",dedupeKey:"settings:google-oauth",dedupeMode:"replace"}),e()}catch(v){d(v instanceof Error?v.message:"Failed to update Google OAuth credentials")}finally{o(!1)}}}return l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),l.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 ","↗"]})]}),l.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:v=>n(v.target.value)})]}),l.jsxs("div",{children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),l.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:r,onChange:v=>i(v.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),c&&l.jsx("p",{className:"text-xs text-rose-400",children:c}),f&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),l.jsx(ge,{type:"button",size:"sm",disabled:!m||a,onClick:y,children:a?"Saving...":"Save Google OAuth app"})]})}function C_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[o,c]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{j2().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),l.jsx("h2",{children:"ChatGPT (CDP)"})]}),l.jsx(ct,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&l.jsxs("div",{children:[l.jsx("dt",{children:"Endpoint"}),l.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&l.jsxs("div",{children:[l.jsx("dt",{children:"Browser"}),l.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:"Tabs"}),l.jsx("dd",{children:e.targets.map(y=>l.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.name))})]})]}),l.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"}),l.jsx("div",{className:"mt-2",children:l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&l.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async y=>{y.preventDefault(),m(!0);try{await KV(o,parseInt(d,10)||9222);const v=await j2().catch(()=>null);v&&t(v),a(!1),gt({title:"CDP endpoint saved",detail:`${o}:${parseInt(d,10)||9222} is now configured.`,tone:"positive",dedupeKey:"settings:cdp",dedupeMode:"replace"})}catch(v){r(v instanceof Error?v.message:String(v))}finally{m(!1)}},children:[l.jsxs("div",{className:"flex gap-2",children:[l.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:o,onChange:y=>c(y.target.value),"aria-label":"CDP host"}),l.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:d,onChange:y=>f(y.target.value),"aria-label":"CDP port"})]}),l.jsx("div",{children:l.jsx(ge,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const A_e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function O_e(){const e=qh(),{dashboard:t}=fc(),n=t?.settings??e?.dashboard?.settings,a=$v(!e,e?.health).data??e?.health??A_e,[o,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(""),[S,b]=x.useState(!1),[j,k]=x.useState(null),[E,C]=x.useState(!1);return n?l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Settings"}),l.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),l.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(O=>l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),l.jsx("h2",{children:O.displayName??O.name})]}),l.jsx(ct,{tone:O.state==="ready"?"positive":"caution",children:O.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Model"}),l.jsx("dd",{className:"font-mono text-xs",children:O.model})]}),O.quota&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Concurrency"}),l.jsx("dd",{children:O.quota.maxConcurrency})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Rate limit"}),l.jsxs("dd",{children:[O.quota.maxRequestsPerMinute,"/min · ",O.quota.maxRequestsPerDay,"/day"]})]})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:O.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>c(o===O.name?null:O.name),children:o===O.name?"Cancel":O.state==="ready"?O.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),o===O.name&&l.jsx(N_e,{providerName:O.name,keyUrl:O.keyUrl,modelHint:O.modelHint,onSaved:()=>{c(null)}})]},O.name)),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),l.jsx("h2",{children:"Search Console OAuth"})]}),l.jsx(ct,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&l.jsx(k_e,{onSaved:()=>{f(!1)}})]}),l.jsxs(ze,{className:"surface-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),l.jsx("h2",{children:"Webmaster Tools"})]}),l.jsx(ct,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),l.jsxs("dl",{className:"definition-list mt-3",children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Auth model"}),l.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Storage"}),l.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),l.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),l.jsx("div",{className:"mt-2",children:l.jsx(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&l.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),l.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"})]}),l.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:y,onChange:O=>v(O.target.value)})]}),l.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),j&&l.jsx("p",{className:"text-xs text-rose-400",children:j}),E&&l.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),l.jsx(ge,{type:"button",size:"sm",disabled:!y.trim()||S,onClick:async()=>{if(y.trim()){b(!0),k(null),C(!1);try{await XV(y.trim()),v(""),C(!0),m(!1),gt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(O){k(O instanceof Error?O.message:"Failed to update Bing API key")}finally{b(!1)}}},children:S?"Saving...":"Save Bing API key"})]})]}),l.jsx(C_e,{}),l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),l.jsx("h2",{children:"API and worker"})]})}),l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"API"}),l.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),l.jsx(ct,{tone:oy(a.apiStatus),title:Io(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),l.jsxs("div",{className:"health-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:"Worker"}),l.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),l.jsx(ct,{tone:oy(a.workerStatus),title:Io(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),l.jsx("section",{className:"page-section",children:l.jsxs(ze,{className:"surface-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),l.jsx("h2",{children:"Operational guidance"})]})}),l.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(O=>l.jsx("li",{children:O},O))}),l.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const E_e=[{label:"System check",description:"Verify your instance is ready"},{label:"Create project",description:"Name, domain, and locale"},{label:"Queries",description:"Add queries to track"},{label:"Competitors",description:"Add competitor domains"},{label:"Launch",description:"Start your first visibility sweep"}];function __e({current:e,labels:t}){return l.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return l.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[l.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),l.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function z_e(){const e=qh(),{dashboard:t,isLoading:n,refetch:r}=fc(),i=t??e?.dashboard;if(!i||n)return l.jsxs("div",{className:"page-skeleton",children:[l.jsxs("div",{className:"page-skeleton-header",children:[l.jsx("div",{className:"skeleton-text h-6 w-24"}),l.jsx("div",{className:"skeleton-text-sm w-80"})]}),l.jsxs("div",{className:"page-skeleton-card",children:[l.jsx("div",{className:"skeleton-text w-32"}),l.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(me=>l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-1 flex-1",children:[l.jsx("div",{className:"skeleton-text w-24"}),l.jsx("div",{className:"skeleton-text-sm w-48"})]}),l.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},me))})]})]});const a=i.settings,d=$v(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},f=pne(i.setup,d,a),p=qo(),[m,y]=x.useState(0),[v,S]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(""),[C,O]=x.useState("US"),[z,A]=x.useState("en"),[_,R]=x.useState(!1),[$,F]=x.useState(null),[q,B]=x.useState(null),[V,X]=x.useState(null),[Z,H]=x.useState(!1),[J,ue]=x.useState(""),[we,I]=x.useState(!1),[D,U]=x.useState(null),[M,Q]=x.useState(!1),oe=a.providerStatuses.filter(me=>me.state==="ready"),[ne,Ae]=x.useState(oe[0]?.name??""),[_e,ee]=x.useState(5),[he,Ee]=x.useState(!1),[G,Fe]=x.useState(null),[De,rt]=x.useState(""),[Qe,en]=x.useState(!1),[Ut,ln]=x.useState(null),[_t,be]=x.useState(!1),[Je,zt]=x.useState(!1),[Ct,Ye]=x.useState(!1),ce=a9(),Se=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Pe=J.split(`
|
|
295
|
+
`).map(me=>me.trim()).filter(Boolean),We=De.split(`
|
|
296
|
+
`).map(me=>me.trim()).filter(Boolean),ut=f.healthChecks.some(me=>me.id==="api"&&me.state==="ready"),Qn=async()=>{if(!(!Se||!k)){H(!0),X(null);try{const me=await Nv(Se,{displayName:b||v,canonicalDomain:k,country:C,language:z,autoExtractBacklinks:_});F(Se),B(me.id),gt({title:"Project created",detail:`${me.displayName||me.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${me.name}`,dedupeMode:"drop"}),r(),y(2)}catch(me){X(me instanceof Error?me.message:"Failed to create project")}finally{H(!1)}}},yr=async()=>{if(!$)return;const me=Pe;if(me.length!==0){Q(!0),U(null);try{await uV($,me),I(!0),r(),y(3)}catch(Vr){U(Vr instanceof Error?Vr.message:"Failed to save queries")}finally{Q(!1)}}},tn=async()=>{if(!(!$||!ne)){Ee(!0),Fe(null);try{const me=await EV($,ne,_e);if(me.queries.length>0){const Vr=J?J.trimEnd()+`
|
|
297
|
+
`+me.queries.join(`
|
|
298
|
+
`):me.queries.join(`
|
|
299
|
+
`);ue(Vr)}}catch(me){Fe(me instanceof Error?me.message:"Failed to generate queries")}finally{Ee(!1)}}},Gt=async()=>{if(!$)return;const me=We;if(me.length!==0){be(!0),ln(null);try{await D5($,me),en(!0),r(),y(4)}catch(Vr){ln(Vr instanceof Error?Vr.message:"Failed to save competitors")}finally{be(!1)}}},cn=async()=>{if($){Ye(!0);try{await ce.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"}),zt(!0),r()}catch{}finally{Ye(!1)}}},it=()=>y(me=>Math.max(0,me-1)),Yn=(()=>{switch(m){case 0:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsx("div",{className:"section-head",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),l.jsx("h2",{children:"System ready"})]})}),l.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),l.jsx("div",{className:"compact-stack",children:f.healthChecks.map(me=>l.jsxs("div",{className:"health-check-row",children:[l.jsxs("div",{children:[l.jsx("p",{className:"run-row-title",children:me.label}),l.jsx("p",{className:"supporting-copy",children:me.detail}),me.id==="provider"&&me.state!=="ready"&&l.jsx(jt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),l.jsx(ct,{tone:me.state==="ready"?"positive":"caution",title:me.id==="api"?Io(d.apiStatus):me.id==="worker"?Io(d.workerStatus):me.detail,children:me.state==="ready"?"Ready":"Attention"})]},me.id))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(ge,{type:"button",disabled:!ut,onClick:()=>y(1),children:"Continue"})]})]});case 1:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),l.jsx("h2",{children:"Create project"})]}),$?l.jsx(ct,{tone:"positive",children:"Created"}):null]}),$?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"text-zinc-300",children:["Project ",l.jsx("span",{className:"text-zinc-100 font-medium",children:$})," created successfully."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:it,children:"Back"}),l.jsx(ge,{type:"button",onClick:()=>y(2),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),l.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:me=>S(me.target.value)}),Se&&Se!==v?l.jsxs("p",{className:"supporting-copy",children:["Slug: ",Se]}):null]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),l.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:b,onChange:me=>j(me.target.value)})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),l.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:me=>E(me.target.value)})]}),l.jsxs("div",{className:"setup-field-row",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),l.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:C,onChange:me=>O(me.target.value.toUpperCase())})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),l.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:z,onChange:me=>A(me.target.value.toLowerCase())})]})]}),l.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[l.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:_,onChange:me=>R(me.target.checked)}),l.jsxs("span",{className:"flex-1",children:[l.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),l.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",l.jsx(jt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),V?l.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:it,children:"Back"}),l.jsx(ge,{type:"button",disabled:!Se||!k||Z,onClick:Qn,children:Z?"Creating...":"Create project"})]})]})]});case 2:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),l.jsx("h2",{children:"Add queries"})]}),we?l.jsxs(ct,{tone:"positive",children:[Pe.length," saved"]}):l.jsxs(ct,{tone:"neutral",children:[Pe.length," quer",Pe.length!==1?"ies":"y"]})]}),l.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),we?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:Pe.map(me=>l.jsx("li",{children:me},me))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:it,children:"Back"}),l.jsx(ge,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[oe.length>0?l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsxs("div",{className:"setup-field flex-1",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),l.jsx("select",{id:"gen-provider",className:"setup-input",value:ne,onChange:me=>Ae(me.target.value),children:oe.map(me=>l.jsxs("option",{value:me.name,children:[me.displayName??me.name,me.model?` (${me.model})`:""]},me.name))})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),l.jsx("select",{id:"gen-count",className:"setup-input",value:_e,onChange:me=>ee(Number(me.target.value)),children:[3,5,10,15,20].map(me=>l.jsx("option",{value:me,children:me},me))})]}),l.jsx(ge,{type:"button",variant:"outline",disabled:he||!ne,onClick:tn,children:he?"Analyzing site...":"Generate"})]}),G?l.jsx("p",{className:"text-rose-400 text-sm",children:G}):null]}):null,l.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[l.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",l.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),l.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
300
|
+
best invisalign downtown brooklyn
|
|
301
|
+
pediatric dentist brooklyn heights`,value:J,onChange:me=>ue(me.target.value)})]}),D?l.jsx("p",{className:"text-rose-400 text-sm",children:D}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:it,children:"Back"}),l.jsx(ge,{type:"button",disabled:Pe.length===0||M,onClick:yr,children:M?"Saving...":`Save ${Pe.length} quer${Pe.length!==1?"ies":"y"}`})]})]})]});case 3:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),l.jsx("h2",{children:"Add competitors"})]}),Qe?l.jsx(ct,{tone:"positive",children:"Saved"}):null]}),l.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Qe?l.jsxs("div",{className:"compact-stack",children:[l.jsx("ul",{className:"detail-list",children:We.map(me=>l.jsx("li",{children:me},me))}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:it,children:"Back"}),l.jsx(ge,{type:"button",onClick:()=>y(4),children:"Continue"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("div",{className:"setup-field",children:[l.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),l.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
302
|
+
competitor2.com`,value:De,onChange:me=>rt(me.target.value)})]}),Ut?l.jsx("p",{className:"text-rose-400 text-sm",children:Ut}):null,l.jsxs("div",{className:"setup-nav",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:it,children:"Back"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),l.jsx(ge,{type:"button",disabled:We.length===0||_t,onClick:Gt,children:_t?"Saving...":`Save ${We.length} competitor${We.length!==1?"s":""}`})]})]})]})]});case 4:return l.jsxs(ze,{className:"surface-card step-card",children:[l.jsxs("div",{className:"section-head",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),l.jsx("h2",{children:"Launch first run"})]}),Je?l.jsx(ct,{tone:"positive",children:"Queued"}):null]}),Je?l.jsxs("div",{className:"compact-stack",children:[l.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),l.jsxs("div",{className:"setup-nav",children:[l.jsx("span",{}),l.jsx(ge,{type:"button",onClick:()=>p({to:q?`/projects/${q}`:"/"}),children:"Open project"})]})]}):l.jsxs("div",{className:"compact-stack",children:[l.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",l.jsx("span",{className:"text-zinc-100 font-medium",children:$}),"."]}),l.jsxs("div",{className:"setup-nav",children:[l.jsx(ge,{type:"button",variant:"outline",onClick:it,children:"Back"}),l.jsx(ge,{type:"button",disabled:Ct,onClick:cn,children:Ct?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Setup"}),l.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),l.jsx(__e,{current:m,labels:E_e}),l.jsx("section",{className:"setup-wizard",children:Yn})]})}function yu({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,o]=x.useState(!1);return l.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[l.jsx("button",{type:"button","aria-label":t,"aria-describedby":a?i:void 0,className:"inline-flex h-4 w-4 items-center justify-center rounded-full text-zinc-500 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:l.jsx(Y5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&l.jsx("span",{id:i,role:"tooltip",className:`absolute z-50 w-64 rounded border border-zinc-700 bg-zinc-900 px-3 py-2 text-xs font-normal leading-relaxed text-zinc-200 shadow-lg ${n==="top"?"bottom-full mb-2":"top-full mt-2"} left-1/2 -translate-x-1/2 whitespace-normal`,children:e})]})}const T_e="https://commoncrawl.org/web-graphs";function Rj(e){return e==null?"—":e>=1e12?`${(e/1e12).toFixed(1)} TB`:e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${(e/1e6).toFixed(1)} MB`:e>=1e3?`${(e/1e3).toFixed(1)} KB`:`${e} B`}function bg(e){if(!e)return"—";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 r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Dj(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function P_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[o,c]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[y,v]=x.useState(!1),[S,b]=x.useState(!1),[j,k]=x.useState(""),[E,C]=x.useState(!1),[O,z]=x.useState(null),[A,_]=x.useState(null),R=x.useCallback(async()=>{m(!0),z(null);try{const[V,X,Z,H,J]=await Promise.all([yQ(),F5().catch(()=>null),xQ().catch(()=>[]),wQ().catch(()=>[]),SQ().catch(()=>null)]);t(V),r(X),a(Z),c(H),f(J)}catch(V){z(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{R()},[R]);async function $(){v(!0),z(null),_(null);try{const V=await vQ();_(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await R()}catch(V){z(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const V=j.trim()||void 0;b(!0),z(null),_(null);try{const X=await bQ(V);_(V?`Queued sync for ${X.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${X.release}. Download + query runs in the background.`),k(""),C(!1),await R()}catch(X){X instanceof Or&&X.code==="MISSING_DEPENDENCY"?z("DuckDB is not installed. Install it first."):z(X instanceof Error?X.message:"Failed to trigger sync")}finally{b(!1)}}async function q(V){z(null),_(null);try{await jQ(V),_(`Pruned cached release ${V}.`),await R()}catch(X){z(X instanceof Error?X.message:"Failed to prune release")}}const B=n?.status==="ready"&&o.every(V=>V.release!==n.release);return l.jsxs("div",{className:"page-container",children:[l.jsx("div",{className:"page-header",children:l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Backlinks"}),l.jsx("p",{className:"page-subtitle",children:"Find domains that link to your projects, computed from the open Common Crawl web graph. Runs entirely on your machine — nothing is sent to third parties."})]})}),l.jsx(ze,{className:"surface-card p-4 mb-6 border-amber-800/60",children:l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(ey,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[l.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),l.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[l.jsxs("li",{children:[l.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),l.jsxs("li",{children:[l.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),l.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),l.jsx("h2",{children:"How it works"})]})}),l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("p",{className:"text-sm text-zinc-400 leading-relaxed max-w-3xl mb-4",children:["Common Crawl publishes a quarterly snapshot of the public web’s hyperlink graph. Canonry downloads one"," ",l.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),l.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[l.jsxs("li",{className:"flex gap-3",children:[l.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"1"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"2"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Query (~5 min)"})," — one DuckDB pass scans the cached files and extracts referring domains for every project’s canonical domain. DuckDB is only used to ",l.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),l.jsxs("li",{className:"flex gap-3",children:[l.jsx("span",{className:"shrink-0 inline-flex h-6 w-6 items-center justify-center rounded-full border border-zinc-700 bg-zinc-900 text-xs font-semibold text-zinc-300 tabular-nums",children:"3"}),l.jsxs("span",{children:[l.jsx("span",{className:"text-zinc-200 font-medium",children:"Persist"})," — results land in the same SQLite database the rest of canonry uses. After the first sync, per-project reads (and re-run extracts against the cached release) are instant."]})]})]})]})]}),O&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-rose-800/60",children:l.jsx("p",{className:"text-sm text-rose-300",children:O})}),A&&l.jsx(ze,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:l.jsx("p",{className:"text-sm text-emerald-300",children:A})}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",l.jsxs(yu,{label:"Why DuckDB?",children:[l.jsx("span",{className:"block",children:"DuckDB is a query engine canonry uses to scan the ~16 GB Common Crawl dumps and pull out your referring domains."}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",l.jsx("span",{className:"text-zinc-200",children:"not"})," store any canonry data — your backlink results live in SQLite alongside the rest of your projects. DuckDB is purely a tool for processing the raw CSV files."]}),l.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/plugins/"})," so users who never run backlinks don’t pay the ~40 MB install cost."]})]})]})]}),e?.duckdbInstalled?l.jsx(ct,{tone:"positive",children:"Installed"}):l.jsx(ct,{tone:"caution",children:"Not installed"})]}),l.jsx(ze,{className:"surface-card p-5",children:p?l.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(Q5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",l.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx(ZQ,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"flex-1",children:[l.jsx("p",{className:"text-sm text-zinc-200",children:"DuckDB is not installed. It’s the query engine canonry uses to scan Common Crawl dumps — required before you can run a release sync or per-project extract."}),l.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Installing doesn’t touch your project data. DuckDB only reads the downloaded CSV files; backlink results are written to the same SQLite database canonry already uses."}),e&&l.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",l.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),l.jsx("div",{className:"mt-3",children:l.jsxs(ge,{type:"button",size:"sm",disabled:y,onClick:$,children:[l.jsx(kv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),y?"Installing…":"Install DuckDB"]})})]})]})})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsxs("div",{className:"section-head section-head-inline",children:[l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",l.jsx(yu,{label:"What is a release sync?",children:"A release sync downloads one Common Crawl dump (~16 GB) and extracts backlinks for every project in this workspace in one pass. This is the heavy job — subsequent per-project re-runs skip the download and just re-query the cached files."})]})]}),n&&l.jsx(ct,{tone:Dj(n.status),children:n.status})]}),l.jsxs(ze,{className:"surface-card p-5",children:[l.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",l.jsx("code",{className:"text-zinc-400",children:"cc-main-2026-jan-feb-mar"}),"). Syncing it downloads the graph and populates backlinks for every project in this workspace."]}),n?l.jsxs("div",{className:"space-y-2 text-sm",children:[l.jsxs("p",{className:"text-zinc-200",children:["Release ",l.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&l.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",l.jsx(yu,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:bg(n.downloadStartedAt??n.createdAt)})]}),l.jsxs("div",{children:[l.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),l.jsx("p",{className:"text-zinc-300 mt-0.5",children:bg(n.queryFinishedAt)})]})]}),n.error&&l.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):l.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),B&&l.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(ey,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),l.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[l.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),l.jsxs("p",{className:"mt-1 text-zinc-400",children:["The sync record in the database says this release finished successfully, but the ~16 GB dump at"," ",l.jsxs("code",{className:"text-zinc-300",children:["~/.canonry/cache/commoncrawl/",n?.release,"/"]})," isn’t on disk. Your backlink data is still intact (it lives in SQLite), but per-project re-run extracts will fail until you either re-sync this release or start a new one."]})]})]})}),l.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?l.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[l.jsx("code",{className:"text-zinc-100",children:d.release}),l.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",Rj(d.vertexBytes),", edges ",Rj(d.edgesBytes)]})]}):l.jsx("p",{className:"text-sm text-zinc-500 mt-0.5",children:p?"Probing Common Crawl…":"Could not auto-detect — pass an explicit release below."}),l.jsxs("a",{href:T_e,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200 focus:text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",children:["Browse all Common Crawl web-graph releases",l.jsx(iY,{className:"h-3 w-3","aria-hidden":!0})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsxs(ge,{type:"button",size:"sm",disabled:S||!e?.duckdbInstalled||!d&&!j.trim(),onClick:F,children:[l.jsx(Zg,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),S?"Queuing…":"Run sync"]}),l.jsxs(yu,{label:"What does Run sync do?",children:[l.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),", then runs a single DuckDB query that extracts referring domains for every project in this workspace."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",l.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",l.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),E?l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("input",{type:"text",className:"flex-1 min-w-[240px] rounded border border-zinc-700 bg-transparent px-2.5 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"cc-main-2026-jan-feb-mar",value:j,onChange:V=>k(V.target.value),disabled:S,autoFocus:!0}),l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>{k(""),C(!1)},disabled:S,children:"Cancel"})]}):l.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300 focus:text-zinc-300 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-500 rounded",onClick:()=>C(!0),disabled:S,children:"Use a different release →"})]}),!e?.duckdbInstalled&&l.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),l.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",l.jsxs(yu,{label:"What is this?",children:[l.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",l.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),l.jsxs("span",{className:"mt-2 block text-zinc-400",children:["These files are needed to re-run per-project extracts against a release without re-downloading. Pruning here ",l.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),l.jsx("p",{className:"text-xs text-zinc-500 mb-3 max-w-3xl",children:"Each cached release is a ~16 GB pair of gzipped files. They’re needed to re-query the graph (e.g. for a newly-added project) without re-downloading. Safe to prune — backlink results persist in SQLite."}),l.jsx(ze,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),l.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),l.jsxs("tbody",{children:[o.map(V=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:l.jsx("code",{children:V.release})}),l.jsx("td",{className:"px-4 py-2",children:V.syncStatus?l.jsx(ct,{tone:Dj(V.syncStatus),children:V.syncStatus}):l.jsx("span",{className:"text-zinc-600",children:"—"})}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Rj(V.bytes)}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:bg(V.lastUsedAt)}),l.jsx("td",{className:"px-4 py-2 text-right",children:l.jsxs("div",{className:"inline-flex items-center gap-1",children:[l.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>q(V.release),children:[l.jsx(J5,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),l.jsx(yu,{label:"What does Prune do?",placement:"top",children:"Deletes the ~16 GB cache for this release from disk. Backlink results already in SQLite remain untouched. To re-run extracts against this release, you’d have to sync it again (another ~16 GB download)."})]})})]},V.release)),o.length===0&&l.jsx("tr",{children:l.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:5,children:"No cached releases on this machine. If you ran a sync from a different machine (or deleted the cache), the backlink data is still in the database — but you’ll need to re-sync a release to run new extracts."})})]})]})})]}),i.length>1&&l.jsxs("section",{className:"page-section-divider",children:[l.jsx("div",{className:"section-head section-head-inline",children:l.jsxs("div",{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),l.jsx("h2",{children:"Past release syncs"})]})}),l.jsx(ze,{className:"surface-card overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[l.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),l.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),l.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),l.jsx("tbody",{children:i.map(V=>l.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[l.jsx("td",{className:"px-4 py-2 text-zinc-200",children:l.jsx("code",{children:V.release})}),l.jsx("td",{className:"px-4 py-2",children:l.jsx(ct,{tone:Dj(V.status),children:V.status})}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.projectsProcessed??"—"}),l.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.domainsDiscovered??"—"}),l.jsx("td",{className:"px-4 py-2 text-zinc-400",children:bg(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function R_e({open:e,onOpenChange:t,projectName:n}){const[r,i]=x.useState(""),[a,o]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,S]=x.useState(null),[b,j]=x.useState(null),k=mEe(n||null),E=()=>{i(""),o(""),d(""),p(""),y(""),S(null),j(null)},C=async z=>{if(z.preventDefault(),S(null),j(null),!r.trim()){S("GCP project ID is required.");return}if(!m.trim()){S("Service-account JSON content is required.");return}try{const A=await k.mutateAsync({gcpProjectId:r.trim(),serviceName:a.trim()||void 0,location:c.trim()||void 0,displayName:f.trim()||void 0,keyJson:m.trim()});y(""),j(`Connected ${A.displayName}.`)}catch(A){const _=A instanceof Or||A instanceof Error?A.message:String(A);S(_)}},O=async z=>{if(!z)return;const A=await z.text();y(A)};return l.jsx(i$,{open:e,onOpenChange:z=>{t(z),z||E()},children:l.jsxs(kk,{children:[l.jsxs(s$,{children:[l.jsx(Ck,{children:"Connect Cloud Run traffic source"}),l.jsxs(Ak,{children:["v1 supports service-account JSON only. The private key is stored in ",l.jsx("code",{children:"~/.canonry/config.yaml"})," on the server and never echoed back to the dashboard."]})]}),l.jsxs("form",{onSubmit:C,className:"mt-6 flex flex-col gap-5 overflow-y-auto pr-1",children:[l.jsx(vu,{label:"Project",description:"Canonry project this source attaches to.",children:l.jsx("input",{type:"text",value:n,disabled:!0,className:"w-full rounded border border-zinc-700 bg-zinc-900/50 px-2 py-1.5 text-sm text-zinc-300"})}),l.jsx(vu,{label:"GCP project ID",description:"The Google Cloud project hosting the Cloud Run service (e.g. my-prod-foo).",required:!0,children:l.jsx("input",{type:"text",value:r,onChange:z=>i(z.target.value),required:!0,autoComplete:"off",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"})}),l.jsx(vu,{label:"Service name (optional)",description:"Restrict log pulls to a specific Cloud Run service. Omit to pull all services in the project.",children:l.jsx("input",{type:"text",value:a,onChange:z=>o(z.target.value),autoComplete:"off",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"})}),l.jsx(vu,{label:"Location (optional)",description:"Region of the Cloud Run service (e.g. us-central1). Helpful when multiple regions emit logs.",children:l.jsx("input",{type:"text",value:c,onChange:z=>d(z.target.value),autoComplete:"off",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"})}),l.jsx(vu,{label:"Display name (optional)",description:"Friendly label shown in the dashboard. Defaults to the project + service combo.",children:l.jsx("input",{type:"text",value:f,onChange:z=>p(z.target.value),autoComplete:"off",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"})}),l.jsxs(vu,{label:"Service-account JSON",description:"Paste the contents of the SA key (JSON). The SA needs roles/logging.viewer (or any role granting logging.logEntries.list).",required:!0,children:[l.jsx("textarea",{value:m,onChange:z=>y(z.target.value),rows:6,spellCheck:!1,autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 font-mono text-[11px] text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:'{"type":"service_account","project_id":"…","private_key":"…"}',required:!0}),l.jsxs("label",{className:"mt-2 inline-flex cursor-pointer items-center gap-2 text-xs text-zinc-400 hover:text-zinc-200",children:[l.jsx("input",{type:"file",accept:"application/json,.json",className:"hidden",onChange:z=>{O(z.target.files?.[0]??null)}}),l.jsx("span",{className:"rounded-md border border-zinc-800 px-2 py-1",children:"Or upload a key file"})]})]}),v?l.jsx("p",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:v}):null,b?l.jsx("p",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:b}):null,l.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-zinc-800/60 pt-4",children:[l.jsx(ge,{type:"button",variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Close"}),l.jsx(ge,{type:"submit",disabled:k.isPending,size:"sm",children:k.isPending?"Connecting…":"Connect"})]})]})]})})}function vu({label:e,description:t,required:n,children:r}){return l.jsxs("label",{className:"flex flex-col gap-1",children:[l.jsxs("span",{className:"text-xs font-medium text-zinc-200",children:[e,n?l.jsx("span",{className:"ml-1 text-rose-400",children:"*"}):null]}),r,l.jsx("span",{className:"text-[11px] text-zinc-500",children:t})]})}function D_e(e){if(!e)return"never";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 r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Mj(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function M_e(){const[e,t]=x.useState(""),[n,r]=x.useState(!1),a=Ar({queryKey:Re.projects.all,queryFn:jv}).data??[],o=x.useMemo(()=>e||(a[0]?.name??""),[e,a]),c=dEe(o||null),d=c.data?.sources??[];return l.jsxs("div",{className:"page-container",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsx("h1",{className:"page-title",children:"Server traffic"}),l.jsx("p",{className:"page-subtitle",children:"Crawler hits and AI-referral sessions pulled directly from server logs (Cloud Run, etc.). Independent of GA — useful when you need server-side evidence that GPTBot or ChatGPT-User actually hit a page."})]}),l.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),disabled:!o,children:[l.jsx(Xg,{className:"size-3.5"}),"Connect Cloud Run"]})]}),l.jsxs("section",{children:[l.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Project picker",children:a.map(f=>l.jsx("button",{type:"button",className:`filter-chip ${o===f.name?"filter-chip-active":""}`,"aria-pressed":o===f.name,onClick:()=>t(f.name),children:f.displayName??f.name},f.id))}),o?c.isLoading?l.jsx(ze,{className:"p-6 text-center text-sm text-zinc-500",children:"Loading sources…"}):d.length===0?l.jsxs(ze,{className:"p-8 text-center",children:[l.jsxs("p",{className:"text-sm text-zinc-300",children:["No traffic sources connected for ",o,"."]}),l.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Connect a Cloud Run service to start ingesting crawler hits and AI-referral sessions from server logs."}),l.jsx("div",{className:"mt-4",children:l.jsxs(ge,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:[l.jsx(Xg,{className:"size-3.5"}),"Connect Cloud Run"]})})]}):l.jsx(I_e,{projectName:o,sources:d}):l.jsx(ze,{className:"p-6 text-center text-sm text-zinc-500",children:"No projects yet."})]}),l.jsx(R_e,{open:n,onOpenChange:r,projectName:o})]})}function I_e({projectName:e,sources:t}){const n=s5({queries:t.map(i=>({queryKey:Re.serverTraffic.sourceDetail(e,i.id),queryFn:()=>q5(e,i.id),staleTime:3e4}))}),r=t.map((i,a)=>({source:i,detail:n[a]?.data,isLoading:n[a]?.isLoading??!1}));return l.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-4 py-2 text-left",children:"Source"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Status"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Last sync"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"24h crawler"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"24h AI sessions"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"24h samples"}),l.jsx("th",{className:"px-4 py-2 text-right"})]})}),l.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:r.map(({source:i,detail:a,isLoading:o})=>l.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[l.jsxs("td",{className:"px-4 py-3",children:[l.jsx("div",{className:"font-medium text-zinc-100",children:i.displayName}),l.jsxs("div",{className:"text-[11px] text-zinc-500 font-mono",children:[i.sourceType," · ",i.id.slice(0,8)]})]}),l.jsxs("td",{className:"px-4 py-3",children:[l.jsx(ct,{tone:IA(i.status),children:i.status}),i.lastError?l.jsx("p",{className:"mt-1 max-w-[18rem] truncate text-[11px] text-rose-400/80",title:i.lastError,children:i.lastError}):null]}),l.jsx("td",{className:"px-4 py-3 text-zinc-300",children:D_e(i.lastSyncedAt)}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:o?"—":Mj(a?.totals24h.crawlerHits??0)}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:o?"—":Mj(a?.totals24h.aiReferralHits??0)}),l.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-300",children:o?"—":Mj(a?.totals24h.sampleCount??0)}),l.jsx("td",{className:"px-4 py-3 text-right",children:l.jsxs(jt,{to:"/traffic/$projectName/$sourceId",params:{projectName:e,sourceId:i.id},className:"inline-flex items-center gap-1 text-xs text-zinc-300 hover:text-zinc-100",children:[l.jsx(Jg,{className:"size-3"}),"View"]})})]},i.id))})]}),l.jsxs("p",{className:"border-t border-zinc-800/60 px-4 py-2 text-[11px] text-zinc-600",children:["Showing ",t.filter(i=>i.status!==Vf.archived).length," active source",t.length===1?"":"s"," for ",e,". Same shape as ",l.jsxs("code",{className:"text-zinc-400",children:["canonry traffic status ",e," --format json"]}),"."]})]})}function s9(e){return e.kind===La.crawler?e.botId:e.product}function L_e(e){return e.kind===La.crawler?e.pathNormalized:e.landingPathNormalized}function o9(e,t){if(t==="hour")return e;const n=new Date(e),r=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0");return`${r}-${i}-${a}`}function $_e(e,t,n){const r=t.pathQuery.trim().toLowerCase();return e.filter(i=>!(t.selectedBucket&&o9(i.tsHour,n)!==t.selectedBucket||t.identity&&s9(i)!==t.identity||t.operator&&i.operator!==t.operator||r&&!L_e(i).toLowerCase().includes(r)))}function B_e(e,t){if(!e||typeof e!="object")return null;const n=e.activeTooltipIndex;let r;if(typeof n=="number")r=n;else if(typeof n=="string"&&n!=="")r=Number(n);else return null;return!Number.isInteger(r)||r<0||r>=t.length?null:t[r]?.bucket??null}const gv=[{value:60,label:"1h",granularity:"hour",fetchLimit:500},{value:360,label:"6h",granularity:"hour",fetchLimit:500},{value:1440,label:"24h",granularity:"hour",fetchLimit:500},{value:10080,label:"7d",granularity:"hour",fetchLimit:1e3},{value:720*60,label:"30d",granularity:"day",fetchLimit:2e3},{value:2160*60,label:"90d",granularity:"day",fetchLimit:5e3}],LL=gv.find(e=>e.label==="7d")??gv[2],$L=Uu[0],BL=Uu[1];function l9(e){const t=new Date(e);return`${t.getMonth()+1}/${t.getDate()} ${String(t.getHours()).padStart(2,"0")}:00`}function U_e(e){const t=new Date(`${e}T00:00:00`);return`${t.getMonth()+1}/${t.getDate()}`}function wg(e){if(!e)return"never";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 r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function q_e(){const e=Bh({strict:!1}),t=e.projectName??"",n=e.sourceId??"",[r,i]=x.useState(LL.value),[a,o]=x.useState(()=>new Set(["crawler","ai-referral"])),[c,d]=x.useState(null),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,S]=x.useState(""),[b,j]=x.useState(null),[k,E]=x.useState(null),C=x.useMemo(()=>gv.find(D=>D.value===r)??LL,[r]),O=hEe(t||null,n||null),z=pEe(t||null,{kind:"all",sourceId:n||void 0,sinceMinutes:r,limit:C.fetchLimit}),A=gEe(t||null,n||null),_=O.data,R=z.data?.events??[],$=z.data?.totals,F=x.useMemo(()=>R.filter(D=>D.kind===La.crawler?a.has("crawler"):a.has("ai-referral")),[R,a]),q=x.useMemo(()=>{const D=new Set;for(const U of R)D.add(s9(U));return f&&D.add(f),[...D].sort((U,M)=>U.localeCompare(M))},[R,f]),B=x.useMemo(()=>{const D=new Set;for(const U of R)D.add(U.operator);return m&&D.add(m),[...D].sort((U,M)=>U.localeCompare(M))},[R,m]),V=x.useMemo(()=>$_e(F,{selectedBucket:c,identity:f,operator:m,pathQuery:v},C.granularity),[F,c,f,m,v,C.granularity]),X=x.useMemo(()=>c?Bg(c,C.granularity):null,[c,C.granularity]),Z=x.useMemo(()=>F_e(R,C.granularity,z.data?.windowStart,z.data?.windowEnd),[R,C.granularity,z.data?.windowStart,z.data?.windowEnd]),H=D=>{o(U=>{const M=new Set(U);return M.has(D)?M.size>1&&M.delete(D):M.add(D),M})},J=D=>{const U=B_e(D,Z);U&&d(M=>M===U?null:U)},ue=()=>{d(null),p(""),y(""),S("")},we=!!(c||f||m||v.trim()),I=async()=>{j(null),E(null);try{const D=await A.mutateAsync({sinceMinutes:60});E(`Pulled ${D.pulledEvents} entries · ${D.crawlerHits} crawler · ${D.aiReferralHits} AI referral · ${D.unknownHits} unknown`)}catch(D){const U=D instanceof Or||D instanceof Error?D.message:String(D);j(U)}};return!t||!n?l.jsx("div",{className:"page-container",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Missing project name or source id in URL."})}):O.isLoading?l.jsx("div",{className:"page-container",children:l.jsx("p",{className:"text-sm text-zinc-500",children:"Loading source…"})}):O.isError||!_?l.jsxs("div",{className:"page-container",children:[l.jsx("p",{className:"text-sm text-rose-300",children:"Could not load this source."}),l.jsxs(jt,{to:"/traffic",className:"mt-2 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200",children:[l.jsx(E2,{className:"size-3"})," Back to sources"]})]}):l.jsxs("div",{className:"page-container space-y-8",children:[l.jsxs("div",{className:"page-header",children:[l.jsxs("div",{className:"page-header-left",children:[l.jsxs(jt,{to:"/traffic",className:"inline-flex items-center gap-1 text-xs text-zinc-500 hover:text-zinc-200",children:[l.jsx(E2,{className:"size-3"})," All sources"]}),l.jsx("h1",{className:"page-title mt-2",children:_.displayName}),l.jsxs("p",{className:"page-subtitle",children:[_.sourceType," · project ",l.jsx("span",{className:"text-zinc-300",children:t})," ·",l.jsx("span",{className:"ml-1 font-mono text-zinc-400",children:_.id})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ct,{tone:IA(_.status),children:_.status}),l.jsxs(ge,{type:"button",variant:"outline",size:"sm",disabled:A.isPending,onClick:()=>{I()},children:[l.jsx(Jg,{className:`size-3.5 ${A.isPending?"animate-spin":""}`}),A.isPending?"Syncing…":"Sync now"]})]})]}),b?l.jsx("div",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:b}):null,k?l.jsx("div",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:k}):null,l.jsxs("section",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[l.jsx(Rg,{label:"24h crawler hits",value:String(_.totals24h.crawlerHits),delta:_.lastSyncedAt?`last sync ${wg(_.lastSyncedAt)}`:"never synced",tone:_.totals24h.crawlerHits>0?"positive":"neutral",description:"GPTBot, ChatGPT-User, PerplexityBot, etc. — verified crawler requests in the last 24h.",isNumeric:!0,progress:Math.min(100,Math.round(_.totals24h.crawlerHits/1e3*100))}),l.jsx(Rg,{label:"24h AI referral sessions",value:String(_.totals24h.aiReferralHits),delta:_.lastSyncedAt?`last sync ${wg(_.lastSyncedAt)}`:"never synced",tone:_.totals24h.aiReferralHits>0?"positive":"neutral",description:"Sessionized visits arriving from chat.openai.com, perplexity.ai, etc. (Referer header evidence).",isNumeric:!0,progress:Math.min(100,Math.round(_.totals24h.aiReferralHits/1e3*100))}),l.jsx(Rg,{label:"24h sample rows",value:String(_.totals24h.sampleCount),delta:"bounded per sync",tone:"neutral",description:"Per-request samples retained for evidence (capped to keep storage bounded).",isNumeric:!0,progress:Math.min(100,Math.round(_.totals24h.sampleCount/100*100))})]}),l.jsxs("section",{children:[l.jsx("p",{className:"mb-4 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Latest sync run"}),_.latestRun?l.jsxs(ze,{className:"p-4 text-sm",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-1.5",children:[l.jsxs("span",{className:"text-zinc-100",children:["Status: ",l.jsx("span",{className:"font-medium",children:_.latestRun.status})]}),l.jsxs("span",{className:"text-zinc-500",children:["Started: ",wg(_.latestRun.startedAt)]}),_.latestRun.finishedAt?l.jsxs("span",{className:"text-zinc-500",children:["Finished: ",wg(_.latestRun.finishedAt)]}):null,l.jsx("span",{className:"font-mono text-[11px] text-zinc-600",children:_.latestRun.runId})]}),_.latestRun.error?l.jsx("p",{className:"mt-2 rounded border border-rose-900/40 bg-rose-950/30 px-3 py-2 text-xs text-rose-300",children:_.latestRun.error}):null]}):l.jsx(ze,{className:"px-4 py-3 text-sm text-zinc-500",children:'No traffic-sync runs recorded yet. Hit "Sync now" above to create one.'})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Events"}),l.jsx("h2",{className:"mt-1 text-base font-semibold text-zinc-50",children:C.granularity==="day"?"Daily rollups":"Hourly rollups"}),$?l.jsxs("p",{className:"mt-1.5 text-xs text-zinc-500",children:[$.crawlerHits.toLocaleString("en-US")," crawler ·"," ",$.aiReferralHits.toLocaleString("en-US")," AI referral sessions · last ",C.label]}):null]}),l.jsx("div",{className:"filter-row mb-0",role:"toolbar","aria-label":"Window",children:gv.map(D=>l.jsx("button",{type:"button",className:`filter-chip ${r===D.value?"filter-chip-active":""}`,"aria-pressed":r===D.value,onClick:()=>{i(D.value),d(null)},children:D.label},D.value))})]}),l.jsxs(ze,{className:"p-4",children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",role:"toolbar","aria-label":"Series",children:[l.jsx(UL,{label:"Crawler",color:$L,count:$?.crawlerHits??0,active:a.has("crawler"),onToggle:()=>H("crawler")}),l.jsx(UL,{label:"AI referral sessions",color:BL,count:$?.aiReferralHits??0,active:a.has("ai-referral"),onToggle:()=>H("ai-referral")})]}),Z.length===0?l.jsx("p",{className:"py-12 text-center text-xs text-zinc-500",children:"No events in this window."}):l.jsx("div",{className:"h-72",children:l.jsx(Ty,{children:l.jsxs(oEe,{data:Z,margin:{top:4,right:4,bottom:0,left:0},onClick:J,style:{cursor:"pointer"},children:[l.jsx(w8,{stroke:cEe,strokeDasharray:"3 3"}),l.jsx(Ih,{dataKey:"label",tick:Ao,stroke:sd,interval:"preserveStartEnd",minTickGap:C.granularity==="day"?24:32}),l.jsx(Lh,{tick:Ao,stroke:sd,allowDecimals:!1}),l.jsx(iv,{...Bu}),a.has("crawler")?l.jsx(bN,{dataKey:"crawler",name:"Crawler",fill:$L,stackId:"a",children:Z.map(D=>l.jsx(av,{fillOpacity:c&&c!==D.bucket?.25:1},D.bucket))}):null,a.has("ai-referral")?l.jsx(bN,{dataKey:"aiReferral",name:"AI referral",fill:BL,stackId:"a",children:Z.map(D=>l.jsx(av,{fillOpacity:c&&c!==D.bucket?.25:1},D.bucket))}):null]})})})]})]}),l.jsxs("section",{children:[l.jsxs("div",{className:"mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-2",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Event rows"}),l.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["Showing ",l.jsx("span",{className:"tabular-nums text-zinc-300",children:V.length.toLocaleString("en-US")})," of"," ",l.jsx("span",{className:"tabular-nums text-zinc-500",children:F.length.toLocaleString("en-US")})," events"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("select",{"aria-label":"Filter by identity",value:f,onChange:D=>p(D.target.value),className:"rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600",children:[l.jsx("option",{value:"",children:"All identities"}),q.map(D=>l.jsx("option",{value:D,children:D},D))]}),l.jsxs("select",{"aria-label":"Filter by operator",value:m,onChange:D=>y(D.target.value),className:"rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600",children:[l.jsx("option",{value:"",children:"All operators"}),B.map(D=>l.jsx("option",{value:D,children:D},D))]}),l.jsx("input",{type:"search","aria-label":"Filter by path",placeholder:"path contains…",value:v,onChange:D=>S(D.target.value),className:"w-44 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600"})]})]}),we?l.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[X?l.jsx(Sg,{label:`Bucket: ${X}`,onClear:()=>d(null)}):null,f?l.jsx(Sg,{label:`Identity: ${f}`,onClear:()=>p("")}):null,m?l.jsx(Sg,{label:`Operator: ${m}`,onClear:()=>y("")}):null,v.trim()?l.jsx(Sg,{label:`Path: ${v.trim()}`,onClear:()=>S("")}):null,l.jsx("button",{type:"button",onClick:ue,className:"text-xs text-zinc-500 underline-offset-4 hover:text-zinc-200 hover:underline",children:"Clear all"})]}):null,l.jsx(H_e,{events:V})]})]})}function Bg(e,t){return t==="day"?U_e(e):l9(e)}function F_e(e,t,n,r){const i=new Map;for(const a of e){const o=o9(a.tsHour,t);let c=i.get(o);c||(c={bucket:o,label:Bg(o,t),crawler:0,aiReferral:0},i.set(o,c)),a.kind===La.crawler?c.crawler+=a.hits:c.aiReferral+=a.hits}if(n&&r){const a=new Date(n),o=new Date(r);if(t==="day"){const c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())),d=new Date(Date.UTC(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()));for(;c<=d;){const f=c.getUTCFullYear(),p=String(c.getUTCMonth()+1).padStart(2,"0"),m=String(c.getUTCDate()).padStart(2,"0"),y=`${f}-${p}-${m}`;i.has(y)||i.set(y,{bucket:y,label:Bg(y,t),crawler:0,aiReferral:0}),c.setUTCDate(c.getUTCDate()+1)}}else{const c=new Date(a);for(c.setUTCMinutes(0,0,0);c<=o;){const d=c.toISOString();i.has(d)||i.set(d,{bucket:d,label:Bg(d,t),crawler:0,aiReferral:0}),c.setUTCHours(c.getUTCHours()+1)}}}return[...i.values()].sort((a,o)=>a.bucket<o.bucket?-1:a.bucket>o.bucket?1:0)}function Sg({label:e,onClear:t}){return l.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-zinc-700 bg-zinc-800/60 px-2.5 py-1 text-[11px] text-zinc-200",children:[e,l.jsx("button",{type:"button",onClick:t,"aria-label":`Clear ${e}`,className:"rounded-full p-0.5 text-zinc-400 hover:bg-zinc-700/60 hover:text-zinc-100",children:l.jsx(cd,{className:"size-3"})})]})}function UL({label:e,color:t,count:n,active:r,onToggle:i}){return l.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs font-medium transition ${r?"border-zinc-700 bg-zinc-800/60 text-zinc-100":"border-zinc-800 bg-transparent text-zinc-500 hover:text-zinc-300"}`,children:[l.jsx("span",{"aria-hidden":"true",className:`size-2 rounded-full transition-opacity ${r?"opacity-100":"opacity-30"}`,style:{backgroundColor:t}}),l.jsx("span",{children:e}),l.jsx("span",{className:`tabular-nums ${r?"text-zinc-400":"text-zinc-600"}`,children:n.toLocaleString("en-US")})]})}function H_e({events:e}){return e.length===0?l.jsx(ze,{className:"p-6 text-center text-sm text-zinc-500",children:"No event rows match the current filters."}):l.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-4 py-2 text-left",children:"Hour"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Identity"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Evidence / status"}),l.jsx("th",{className:"px-4 py-2 text-left",children:"Path"}),l.jsx("th",{className:"px-4 py-2 text-right",children:"Hits"})]})}),l.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:e.map((t,n)=>l.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[l.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zinc-300",children:l9(t.tsHour)}),l.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===La.crawler?"Crawler":"AI referral"}),l.jsxs("td",{className:"px-4 py-2 text-zinc-100",children:[t.kind===La.crawler?t.botId:t.product,l.jsx("span",{className:"ml-2 text-[11px] text-zinc-500",children:t.operator})]}),l.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===La.crawler?`${t.verificationStatus} · HTTP ${t.status}`:`${t.evidenceType} · ${t.sourceDomain}`}),l.jsx("td",{className:"px-4 py-2 truncate font-mono text-xs text-zinc-300",children:t.kind===La.crawler?t.pathNormalized:t.landingPathNormalized}),l.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-zinc-100",children:t.hits})]},`${t.kind}:${t.tsHour}:${n}`))})]})})}function K_e(){return l.jsx("div",{className:"page-container",children:l.jsx("section",{className:"page-section",children:l.jsxs(ze,{className:"surface-card empty-card",children:[l.jsx("h1",{children:"Route not found"}),l.jsx("p",{children:"The current path does not map to a dashboard view."}),l.jsx(ge,{asChild:!0,children:l.jsx(jt,{to:"/",children:"Return to overview"})})]})})})}function G_e(){return l.jsx(Lue,{children:l.jsx(Iue,{})})}const li=qG()({component:G_e,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),V_e=_r({getParentRoute:()=>li,path:"/",component:Uue,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Re.projects.all);if(t&&t.length===0)throw UN({to:"/setup"})}}),Q_e=_r({getParentRoute:()=>li,path:"/projects",component:Jde}),Od=_r({getParentRoute:()=>li,path:"/projects/$projectId",component:()=>l.jsx(WN,{})}),Y_e=_r({getParentRoute:()=>Od,path:"/",component:()=>l.jsx(hp,{tab:"overview"})}),W_e=_r({getParentRoute:()=>Od,path:"/search-console",component:()=>l.jsx(hp,{tab:"search-console"})}),Z_e=_r({getParentRoute:()=>Od,path:"/report",component:()=>l.jsx(hp,{tab:"report"})}),X_e=_r({getParentRoute:()=>Od,path:"/activity",component:()=>l.jsx(hp,{tab:"activity"})}),J_e=_r({getParentRoute:()=>Od,path:"/inbound",component:()=>l.jsx(hp,{tab:"inbound"})}),eze=_r({getParentRoute:()=>li,path:"/runs",component:j_e}),tze=_r({getParentRoute:()=>li,path:"/settings",component:O_e,beforeLoad:({context:e})=>{}}),nze=_r({getParentRoute:()=>li,path:"/setup",component:z_e,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Re.projects.all);if(t&&t.length>0)throw UN({to:"/"})}}),rze=_r({getParentRoute:()=>li,path:"/backlinks",component:P_e}),ize=_r({getParentRoute:()=>li,path:"/traffic",component:M_e}),aze=_r({getParentRoute:()=>li,path:"/traffic/$projectName/$sourceId",component:q_e}),sze=_r({getParentRoute:()=>li,path:"*",component:K_e}),oze=li.addChildren([V_e,Q_e,Od.addChildren([Y_e,W_e,Z_e,X_e,J_e]),eze,tze,nze,rze,ize,aze,sze]);function lze(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const qL=lze(),cze=qL==="/"?"":qL.replace(/\/$/,"");function uze(e,t){return XG({routeTree:oze,basepath:cze||"/",context:{queryClient:e},...t?.initialEntries})}const dze=6e4;function fze(){const[e,t]=x.useState(bw()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[o,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),y=x.useRef(null),v=x.useRef(null),S=()=>{if(!y.current){const k=DQ();v.current=k,y.current=uze(k)}return{queryClient:v.current,router:y.current}};x.useEffect(()=>{if(bw())return;let k=!1;return w2().then(E=>{k||(E.authenticated?t("ready"):t(E.setupRequired?"setup":"login"))}).catch(E=>{k||(c(E instanceof Error?E.message:"Failed to reach the Canonry API"),t("login"))}),()=>{k=!0}},[]),x.useEffect(()=>{if(e!=="ready"||bw())return;const k=setInterval(()=>{w2().then(E=>{E.authenticated||(m(!0),t(E.setupRequired?"setup":"login"))}).catch(()=>{})},dze);return x2(()=>{m(!0),t("login")}),()=>{clearInterval(k),x2(null)}},[e]);const b=async k=>{if(k.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}f(!0),c(null);try{if(!(await xV(n.trim())).authenticated){c("Setup failed");return}r(""),a(""),m(!1),t("ready")}catch(E){c(E instanceof Or||E instanceof Error?E.message:"Setup failed")}finally{f(!1)}},j=async k=>{if(k.preventDefault(),!!n.trim()){f(!0),c(null);try{if(!(await bV(n.trim())).authenticated){c("Incorrect password");return}r(""),m(!1),t("ready")}catch(E){c(E instanceof Or||E instanceof Error?E.message:"Authentication failed")}finally{f(!1)}}};if(e==="ready"){const{queryClient:k,router:E}=S();return l.jsx(ZK,{client:k,children:l.jsx(tV,{router:E})})}return l.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:l.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:l.jsx(ze,{className:"surface-card w-full",children:e==="checking"?l.jsx(_g,{className:"py-8",children:l.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?l.jsxs(l.Fragment,{children:[l.jsxs(b1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),l.jsx(w1,{children:"Create a dashboard password"}),l.jsx(S1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),l.jsx(_g,{children:l.jsxs("form",{className:"space-y-4",onSubmit:b,children:[l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),l.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:k=>r(k.target.value),placeholder:"At least 8 characters"})]}),l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),l.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:i,onChange:k=>a(k.target.value),placeholder:"Re-enter password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(ge,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):l.jsxs(l.Fragment,{children:[l.jsxs(b1,{children:[l.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),l.jsx(w1,{children:"Sign in to Canonry"}),l.jsx(S1,{children:"Enter your dashboard password to continue."})]}),l.jsxs(_g,{children:[p?l.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,l.jsxs("form",{className:"space-y-4",onSubmit:j,children:[l.jsxs("label",{className:"block space-y-1.5",children:[l.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),l.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:k=>r(k.target.value),placeholder:"Dashboard password"})]}),o?l.jsx("p",{className:"text-sm text-rose-400",children:o}):null,l.jsx(ge,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})]})]})})})})}const c9=document.getElementById("root");if(!c9)throw new Error("Expected #root element for web app bootstrap.");CK.createRoot(c9).render(l.jsx(x.StrictMode,{children:l.jsx(fze,{})}));
|