@ainyc/canonry 4.7.2 → 4.10.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-BdAFw2Gy.js +302 -0
- package/assets/assets/{index-DAS6pOry.css → index-CGXCbiM_.css} +1 -1
- package/assets/index.html +2 -2
- package/dist/{chunk-VDEMEI64.js → chunk-GAC7BSL6.js} +1 -1
- package/dist/{chunk-XAW66QUX.js → chunk-GPJ3GLOE.js} +147 -0
- package/dist/{chunk-DVTPGC6O.js → chunk-TNW6Z3TW.js} +824 -217
- package/dist/{chunk-OOADR2Q5.js → chunk-XRDZ26OZ.js} +48 -2
- package/dist/cli.js +5 -5
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-ABHO5HHA.js → intelligence-service-TFDEKAOM.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +8 -8
- package/assets/assets/index-Ca3kZYGw.js +0 -302
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
function pK(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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 pa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rw={exports:{}},Af={};var Az;function mK(){if(Az)return Af;Az=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,a){var l=null;if(a!==void 0&&(l=""+a),i.key!==void 0&&(l=""+i.key),"key"in i){a={};for(var u in i)u!=="key"&&(a[u]=i[u])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return Af.Fragment=t,Af.jsx=n,Af.jsxs=n,Af}var Oz;function gK(){return Oz||(Oz=1,rw.exports=mK()),rw.exports}var s=gK(),iw={exports:{}},rt={};var Ez;function yK(){if(Ez)return rt;Ez=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"),l=Symbol.for("react.context"),u=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"),g=Symbol.iterator;function v(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,S={};function k(M,q,D){this.props=M,this.context=q,this.refs=S,this.updater=D||j}k.prototype.isReactComponent={},k.prototype.setState=function(M,q){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,q,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=k.prototype;function C(M,q,D){this.props=M,this.context=q,this.refs=S,this.updater=D||j}var A=C.prototype=new E;A.constructor=C,b(A,k.prototype),A.isPureReactComponent=!0;var P=Array.isArray;function O(){}var _={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function $(M,q,D){var G=D.ref;return{$$typeof:e,type:M,key:q,ref:G!==void 0?G:null,props:D}}function F(M,q){return $(M.type,q,M.props)}function U(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function B(M){var q={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(D){return q[D]})}var V=/\/+/g;function X(M,q){return typeof M=="object"&&M!==null&&M.key!=null?B(""+M.key):q.toString(36)}function Z(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(O,O):(M.status="pending",M.then(function(q){M.status==="pending"&&(M.status="fulfilled",M.value=q)},function(q){M.status==="pending"&&(M.status="rejected",M.reason=q)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function H(M,q,D,G,se){var ne=typeof M;(ne==="undefined"||ne==="boolean")&&(M=null);var Ce=!1;if(M===null)Ce=!0;else switch(ne){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(M.$$typeof){case e:case t:Ce=!0;break;case p:return Ce=M._init,H(Ce(M._payload),q,D,G,se)}}if(Ce)return se=se(M),Ce=G===""?"."+X(M,0):G,P(se)?(D="",Ce!=null&&(D=Ce.replace(V,"$&/")+"/"),H(se,q,D,"",function(pe){return pe})):se!=null&&(U(se)&&(se=F(se,D+(se.key==null||M&&M.key===se.key?"":(""+se.key).replace(V,"$&/")+"/")+Ce)),q.push(se)),1;Ce=0;var Se=G===""?".":G+":";if(P(M))for(var ee=0;ee<M.length;ee++)G=M[ee],ne=Se+X(G,ee),Ce+=H(G,q,D,ne,se);else if(ee=v(M),typeof ee=="function")for(M=ee.call(M),ee=0;!(G=M.next()).done;)G=G.value,ne=Se+X(G,ee++),Ce+=H(G,q,D,ne,se);else if(ne==="object"){if(typeof M.then=="function")return H(Z(M),q,D,G,se);throw q=String(M),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function J(M,q,D){if(M==null)return M;var G=[],se=0;return H(M,G,"","",function(ne){return q.call(D,ne,se++)}),G}function oe(M){if(M._status===-1){var q=M._result;q=q(),q.then(function(D){(M._status===0||M._status===-1)&&(M._status=1,M._result=D)},function(D){(M._status===0||M._status===-1)&&(M._status=2,M._result=D)}),M._status===-1&&(M._status=0,M._result=q)}if(M._status===1)return M._result.default;throw M._result}var ye=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},I={map:J,forEach:function(M,q,D){J(M,function(){q.apply(this,arguments)},D)},count:function(M){var q=0;return J(M,function(){q++}),q},toArray:function(M){return J(M,function(q){return q})||[]},only:function(M){if(!U(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return rt.Activity=m,rt.Children=I,rt.Component=k,rt.Fragment=n,rt.Profiler=i,rt.PureComponent=C,rt.StrictMode=r,rt.Suspense=d,rt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,rt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return _.H.useMemoCache(M)}},rt.cache=function(M){return function(){return M.apply(null,arguments)}},rt.cacheSignal=function(){return null},rt.cloneElement=function(M,q,D){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var G=b({},M.props),se=M.key;if(q!=null)for(ne in q.key!==void 0&&(se=""+q.key),q)!T.call(q,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&q.ref===void 0||(G[ne]=q[ne]);var ne=arguments.length-2;if(ne===1)G.children=D;else if(1<ne){for(var Ce=Array(ne),Se=0;Se<ne;Se++)Ce[Se]=arguments[Se+2];G.children=Ce}return $(M.type,se,G)},rt.createContext=function(M){return M={$$typeof:l,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:a,_context:M},M},rt.createElement=function(M,q,D){var G,se={},ne=null;if(q!=null)for(G in q.key!==void 0&&(ne=""+q.key),q)T.call(q,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(se[G]=q[G]);var Ce=arguments.length-2;if(Ce===1)se.children=D;else if(1<Ce){for(var Se=Array(Ce),ee=0;ee<Ce;ee++)Se[ee]=arguments[ee+2];se.children=Se}if(M&&M.defaultProps)for(G in Ce=M.defaultProps,Ce)se[G]===void 0&&(se[G]=Ce[G]);return $(M,ne,se)},rt.createRef=function(){return{current:null}},rt.forwardRef=function(M){return{$$typeof:u,render:M}},rt.isValidElement=U,rt.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:oe}},rt.memo=function(M,q){return{$$typeof:f,type:M,compare:q===void 0?null:q}},rt.startTransition=function(M){var q=_.T,D={};_.T=D;try{var G=M(),se=_.S;se!==null&&se(D,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(O,ye)}catch(ne){ye(ne)}finally{q!==null&&D.types!==null&&(q.types=D.types),_.T=q}},rt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},rt.use=function(M){return _.H.use(M)},rt.useActionState=function(M,q,D){return _.H.useActionState(M,q,D)},rt.useCallback=function(M,q){return _.H.useCallback(M,q)},rt.useContext=function(M){return _.H.useContext(M)},rt.useDebugValue=function(){},rt.useDeferredValue=function(M,q){return _.H.useDeferredValue(M,q)},rt.useEffect=function(M,q){return _.H.useEffect(M,q)},rt.useEffectEvent=function(M){return _.H.useEffectEvent(M)},rt.useId=function(){return _.H.useId()},rt.useImperativeHandle=function(M,q,D){return _.H.useImperativeHandle(M,q,D)},rt.useInsertionEffect=function(M,q){return _.H.useInsertionEffect(M,q)},rt.useLayoutEffect=function(M,q){return _.H.useLayoutEffect(M,q)},rt.useMemo=function(M,q){return _.H.useMemo(M,q)},rt.useOptimistic=function(M,q){return _.H.useOptimistic(M,q)},rt.useReducer=function(M,q,D){return _.H.useReducer(M,q,D)},rt.useRef=function(M){return _.H.useRef(M)},rt.useState=function(M){return _.H.useState(M)},rt.useSyncExternalStore=function(M,q,D){return _.H.useSyncExternalStore(M,q,D)},rt.useTransition=function(){return _.H.useTransition()},rt.version="19.2.4",rt}var _z;function md(){return _z||(_z=1,iw.exports=yK()),iw.exports}var x=md();const Li=pa(x),bv=pK({__proto__:null,default:Li},[x]);var aw={exports:{}},Of={},sw={exports:{}},ow={};var zz;function vK(){return zz||(zz=1,(function(e){function t(H,J){var oe=H.length;H.push(J);e:for(;0<oe;){var ye=oe-1>>>1,I=H[ye];if(0<i(I,J))H[ye]=J,H[oe]=I,oe=ye;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],oe=H.pop();if(oe!==J){H[0]=oe;e:for(var ye=0,I=H.length,M=I>>>1;ye<M;){var q=2*(ye+1)-1,D=H[q],G=q+1,se=H[G];if(0>i(D,oe))G<I&&0>i(se,D)?(H[ye]=se,H[G]=oe,ye=G):(H[ye]=D,H[q]=oe,ye=q);else if(G<I&&0>i(se,oe))H[ye]=se,H[G]=oe,ye=G;else break e}}return J}function i(H,J){var oe=H.sortIndex-J.sortIndex;return oe!==0?oe: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 l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],f=[],p=1,m=null,g=3,v=!1,j=!1,b=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(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 P(H){if(b=!1,A(H),!j)if(n(d)!==null)j=!0,O||(O=!0,B());else{var J=n(f);J!==null&&Z(P,J.startTime-H)}}var O=!1,_=-1,T=5,$=-1;function F(){return S?!0:!(e.unstable_now()-$<T)}function U(){if(S=!1,O){var H=e.unstable_now();$=H;var J=!0;try{e:{j=!1,b&&(b=!1,E(_),_=-1),v=!0;var oe=g;try{t:{for(A(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var ye=m.callback;if(typeof ye=="function"){m.callback=null,g=m.priorityLevel;var I=ye(m.expirationTime<=H);if(H=e.unstable_now(),typeof I=="function"){m.callback=I,A(H),J=!0;break t}m===n(d)&&r(d),A(H)}else r(d);m=n(d)}if(m!==null)J=!0;else{var M=n(f);M!==null&&Z(P,M.startTime-H),J=!1}}break e}finally{m=null,g=oe,v=!1}J=void 0}}finally{J?B():O=!1}}}var B;if(typeof C=="function")B=function(){C(U)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,X=V.port2;V.port1.onmessage=U,B=function(){X.postMessage(null)}}else B=function(){k(U,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"):T=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(H){switch(g){case 1:case 2:case 3:var J=3;break;default:J=g}var oe=g;g=J;try{return H()}finally{g=oe}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(H,J){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var oe=g;g=H;try{return J()}finally{g=oe}},e.unstable_scheduleCallback=function(H,J,oe){var ye=e.unstable_now();switch(typeof oe=="object"&&oe!==null?(oe=oe.delay,oe=typeof oe=="number"&&0<oe?ye+oe:ye):oe=ye,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=oe+I,H={id:p++,callback:J,priorityLevel:H,startTime:oe,expirationTime:I,sortIndex:-1},oe>ye?(H.sortIndex=oe,t(f,H),n(d)===null&&H===n(f)&&(b?(E(_),_=-1):b=!0,Z(P,oe-ye))):(H.sortIndex=I,t(d,H),j||v||(j=!0,O||(O=!0,B()))),H},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(H){var J=g;return function(){var oe=g;g=J;try{return H.apply(this,arguments)}finally{g=oe}}}})(ow)),ow}var Pz;function xK(){return Pz||(Pz=1,sw.exports=vK()),sw.exports}var lw={exports:{}},yr={};var Tz;function bK(){if(Tz)return yr;Tz=1;var e=md();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 l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return yr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,yr.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)},yr.flushSync=function(d){var f=l.T,p=r.p;try{if(l.T=null,r.p=2,d)return d()}finally{l.T=f,r.p=p,r.d.f()}},yr.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))},yr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},yr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=u(p,f.crossOrigin),g=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:g,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:g,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},yr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(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)},yr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=u(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})}},yr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=u(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)},yr.requestFormReset=function(d){r.d.r(d)},yr.unstable_batchedUpdates=function(d,f){return d(f)},yr.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},yr.useFormStatus=function(){return l.H.useHostTransitionStatus()},yr.version="19.2.4",yr}var Rz;function UL(){if(Rz)return lw.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(),lw.exports=bK(),lw.exports}var Dz;function wK(){if(Dz)return Of;Dz=1;var e=xK(),t=md(),n=UL();function r(o){var c="https://react.dev/errors/"+o;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)c+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function a(o){var c=o,h=o;if(o.alternate)for(;c.return;)c=c.return;else{o=c;do c=o,(c.flags&4098)!==0&&(h=c.return),o=c.return;while(o)}return c.tag===3?h:null}function l(o){if(o.tag===13){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function u(o){if(o.tag===31){var c=o.memoizedState;if(c===null&&(o=o.alternate,o!==null&&(c=o.memoizedState)),c!==null)return c.dehydrated}return null}function d(o){if(a(o)!==o)throw Error(r(188))}function f(o){var c=o.alternate;if(!c){if(c=a(o),c===null)throw Error(r(188));return c!==o?null:o}for(var h=o,y=c;;){var w=h.return;if(w===null)break;var N=w.alternate;if(N===null){if(y=w.return,y!==null){h=y;continue}break}if(w.child===N.child){for(N=w.child;N;){if(N===h)return d(w),o;if(N===y)return d(w),c;N=N.sibling}throw Error(r(188))}if(h.return!==y.return)h=w,y=N;else{for(var z=!1,L=w.child;L;){if(L===h){z=!0,h=w,y=N;break}if(L===y){z=!0,y=w,h=N;break}L=L.sibling}if(!z){for(L=N.child;L;){if(L===h){z=!0,h=N,y=w;break}if(L===y){z=!0,y=N,h=w;break}L=L.sibling}if(!z)throw Error(r(189))}}if(h.alternate!==y)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:c}function p(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o;for(o=o.child;o!==null;){if(c=p(o),c!==null)return c;o=o.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function B(o){return o===null||typeof o!="object"?null:(o=U&&o[U]||o["@@iterator"],typeof o=="function"?o:null)}var V=Symbol.for("react.client.reference");function X(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===V?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case k:return"Profiler";case S:return"StrictMode";case P:return"Suspense";case O:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case j:return"Portal";case C:return o.displayName||"Context";case E:return(o._context.displayName||"Context")+".Consumer";case A:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case _:return c=o.displayName||null,c!==null?c:X(o.type)||"Memo";case T:c=o._payload,o=o._init;try{return X(o(c))}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,oe={pending:!1,data:null,method:null,action:null},ye=[],I=-1;function M(o){return{current:o}}function q(o){0>I||(o.current=ye[I],ye[I]=null,I--)}function D(o,c){I++,ye[I]=o.current,o.current=c}var G=M(null),se=M(null),ne=M(null),Ce=M(null);function Se(o,c){switch(D(ne,c),D(se,o),D(G,null),c.nodeType){case 9:case 11:o=(o=c.documentElement)&&(o=o.namespaceURI)?Y_(o):0;break;default:if(o=c.tagName,c=c.namespaceURI)c=Y_(c),o=Z_(c,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}q(G),D(G,o)}function ee(){q(G),q(se),q(ne)}function pe(o){o.memoizedState!==null&&D(Ce,o);var c=G.current,h=Z_(c,o.type);c!==h&&(D(se,o),D(G,h))}function Ee(o){se.current===o&&(q(G),q(se)),Ce.current===o&&(q(Ce),Sf._currentValue=oe)}var Y,He;function Te(o){if(Y===void 0)try{throw Error()}catch(h){var c=h.stack.trim().match(/\n( *(at )?)/);Y=c&&c[1]||"",He=-1<h.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Y+o+He}var at=!1;function Ve(o,c){if(!o||at)return"";at=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var y={DetermineComponentFrameRoot:function(){try{if(c){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(ue){var le=ue}Reflect.construct(o,[],we)}else{try{we.call()}catch(ue){le=ue}o.call(we.prototype)}}else{try{throw Error()}catch(ue){le=ue}(we=o())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(ue){if(ue&&le&&typeof ue.stack=="string")return[ue.stack,le.stack]}return[null,null]}};y.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(y.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(y.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=y.DetermineComponentFrameRoot(),z=N[0],L=N[1];if(z&&L){var K=z.split(`
|
|
4
|
+
`),ae=L.split(`
|
|
5
|
+
`);for(w=y=0;y<K.length&&!K[y].includes("DetermineComponentFrameRoot");)y++;for(;w<ae.length&&!ae[w].includes("DetermineComponentFrameRoot");)w++;if(y===K.length||w===ae.length)for(y=K.length-1,w=ae.length-1;1<=y&&0<=w&&K[y]!==ae[w];)w--;for(;1<=y&&0<=w;y--,w--)if(K[y]!==ae[w]){if(y!==1||w!==1)do if(y--,w--,0>w||K[y]!==ae[w]){var me=`
|
|
6
|
+
`+K[y].replace(" at new "," at ");return o.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",o.displayName)),me}while(1<=y&&0<=w);break}}}finally{at=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Te(h):""}function Ht(o,c){switch(o.tag){case 26:case 27:case 5:return Te(o.type);case 16:return Te("Lazy");case 13:return o.child!==c&&c!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return Ve(o.type,!1);case 11:return Ve(o.type.render,!1);case 1:return Ve(o.type,!0);case 31:return Te("Activity");default:return""}}function Lt(o){try{var c="",h=null;do c+=Ht(o,h),h=o,o=o.return;while(o);return c}catch(y){return`
|
|
7
|
+
Error generating stack: `+y.message+`
|
|
8
|
+
`+y.stack}}var cn=Object.prototype.hasOwnProperty,en=e.unstable_scheduleCallback,je=e.unstable_cancelCallback,Ze=e.unstable_shouldYield,Rt=e.unstable_requestPaint,mt=e.unstable_now,Je=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Me=e.unstable_NormalPriority,Ge=e.unstable_LowPriority,pt=e.unstable_IdlePriority,mn=e.log,On=e.unstable_setDisableYieldValue,gn=null,We=null;function Kt(o){if(typeof mn=="function"&&On(o),We&&typeof We.setStrictMode=="function")try{We.setStrictMode(gn,o)}catch{}}var de=Math.clz32?Math.clz32:Qe,ze=Math.log,fe=Math.LN2;function Qe(o){return o>>>=0,o===0?32:31-(ze(o)/fe|0)|0}var Fn=256,wi=262144,tn=4194304;function En(o){var c=o&42;if(c!==0)return c;switch(o&-o){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 o&261888;case 262144:case 524288:case 1048576:case 2097152:return o&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function $r(o,c,h){var y=o.pendingLanes;if(y===0)return 0;var w=0,N=o.suspendedLanes,z=o.pingedLanes;o=o.warmLanes;var L=y&134217727;return L!==0?(y=L&~N,y!==0?w=En(y):(z&=L,z!==0?w=En(z):h||(h=L&~o,h!==0&&(w=En(h))))):(L=y&~N,L!==0?w=En(L):z!==0?w=En(z):h||(h=y&~o,h!==0&&(w=En(h)))),w===0?0:c!==0&&c!==w&&(c&N)===0&&(N=w&-w,h=c&-c,N>=h||N===32&&(h&4194048)!==0)?c:w}function Zi(o,c){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&c)===0}function ba(o,c){switch(o){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 Sp(){var o=tn;return tn<<=1,(tn&62914560)===0&&(tn=4194304),o}function Ks(o){for(var c=[],h=0;31>h;h++)c.push(o);return c}function Gs(o,c){o.pendingLanes|=c,c!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Wx(o,c,h,y,w,N){var z=o.pendingLanes;o.pendingLanes=h,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=h,o.entangledLanes&=h,o.errorRecoveryDisabledLanes&=h,o.shellSuspendCounter=0;var L=o.entanglements,K=o.expirationTimes,ae=o.hiddenUpdates;for(h=z&~h;0<h;){var me=31-de(h),we=1<<me;L[me]=0,K[me]=-1;var le=ae[me];if(le!==null)for(ae[me]=null,me=0;me<le.length;me++){var ue=le[me];ue!==null&&(ue.lane&=-536870913)}h&=~we}y!==0&&Dd(o,y,0),N!==0&&w===0&&o.tag!==0&&(o.suspendedLanes|=N&~(z&~c))}function Dd(o,c,h){o.pendingLanes|=c,o.suspendedLanes&=~c;var y=31-de(c);o.entangledLanes|=c,o.entanglements[y]=o.entanglements[y]|1073741824|h&261930}function Np(o,c){var h=o.entangledLanes|=c;for(o=o.entanglements;h;){var y=31-de(h),w=1<<y;w&c|o[y]&c&&(o[y]|=c),h&=~w}}function kp(o,c){var h=c&-c;return h=(h&42)!==0?1:Md(h),(h&(o.suspendedLanes|c))!==0?0:h}function Md(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=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:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function Id(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function Ld(){var o=J.p;return o!==0?o:(o=window.event,o===void 0?32:bz(o.type))}function Q(o,c){var h=J.p;try{return J.p=o,c()}finally{J.p=h}}var ke=Math.random().toString(36).slice(2),tt="__reactFiber$"+ke,St="__reactProps$"+ke,_n="__reactContainer$"+ke,wa="__reactEvents$"+ke,Ja="__reactListeners$"+ke,Vs="__reactHandles$"+ke,Er="__reactResources$"+ke,rl="__reactMarker$"+ke;function ja(o){delete o[tt],delete o[St],delete o[wa],delete o[Ja],delete o[Vs]}function ji(o){var c=o[tt];if(c)return c;for(var h=o.parentNode;h;){if(c=h[_n]||h[tt]){if(h=c.alternate,c.child!==null||h!==null&&h.child!==null)for(o=iz(o);o!==null;){if(h=o[tt])return h;o=iz(o)}return c}o=h,h=o.parentNode}return null}function Xi(o){if(o=o[tt]||o[_n]){var c=o.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return o}return null}function Qs(o){var c=o.tag;if(c===5||c===26||c===27||c===6)return o.stateNode;throw Error(r(33))}function Ws(o){var c=o[Er];return c||(c=o[Er]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function yn(o){o[rl]=!0}var il=new Set,Cp={};function es(o,c){ut(o,c),ut(o+"Capture",c)}function ut(o,c){for(Cp[o]=c,o=0;o<c.length;o++)il.add(c[o])}var Gt=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]*$"),Br={},Ji={};function Oc(o){return cn.call(Ji,o)?!0:cn.call(Br,o)?!1:Gt.test(o)?Ji[o]=!0:(Br[o]=!0,!1)}function al(o,c,h){if(Oc(c))if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(c);return;case"boolean":var y=c.toLowerCase().slice(0,5);if(y!=="data-"&&y!=="aria-"){o.removeAttribute(c);return}}o.setAttribute(c,""+h)}}function Ap(o,c,h){if(h===null)o.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(c);return}o.setAttribute(c,""+h)}}function ts(o,c,h,y){if(y===null)o.removeAttribute(h);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(c,h,""+y)}}function Si(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function qA(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function o9(o,c,h){var y=Object.getOwnPropertyDescriptor(o.constructor.prototype,c);if(!o.hasOwnProperty(c)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var w=y.get,N=y.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return w.call(this)},set:function(z){h=""+z,N.call(this,z)}}),Object.defineProperty(o,c,{enumerable:y.enumerable}),{getValue:function(){return h},setValue:function(z){h=""+z},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function Yx(o){if(!o._valueTracker){var c=qA(o)?"checked":"value";o._valueTracker=o9(o,c,""+o[c])}}function FA(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var h=c.getValue(),y="";return o&&(y=qA(o)?o.checked?"true":"false":o.value),o=y,o!==h?(c.setValue(o),!0):!1}function Op(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var l9=/[\n"\\]/g;function Ni(o){return o.replace(l9,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function Zx(o,c,h,y,w,N,z,L){o.name="",z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?o.type=z:o.removeAttribute("type"),c!=null?z==="number"?(c===0&&o.value===""||o.value!=c)&&(o.value=""+Si(c)):o.value!==""+Si(c)&&(o.value=""+Si(c)):z!=="submit"&&z!=="reset"||o.removeAttribute("value"),c!=null?Xx(o,z,Si(c)):h!=null?Xx(o,z,Si(h)):y!=null&&o.removeAttribute("value"),w==null&&N!=null&&(o.defaultChecked=!!N),w!=null&&(o.checked=w&&typeof w!="function"&&typeof w!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?o.name=""+Si(L):o.removeAttribute("name")}function HA(o,c,h,y,w,N,z,L){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.type=N),c!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||c!=null)){Yx(o);return}h=h!=null?""+Si(h):"",c=c!=null?""+Si(c):h,L||c===o.value||(o.value=c),o.defaultValue=c}y=y??w,y=typeof y!="function"&&typeof y!="symbol"&&!!y,o.checked=L?o.checked:!!y,o.defaultChecked=!!y,z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"&&(o.name=z),Yx(o)}function Xx(o,c,h){c==="number"&&Op(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function Ec(o,c,h,y){if(o=o.options,c){c={};for(var w=0;w<h.length;w++)c["$"+h[w]]=!0;for(h=0;h<o.length;h++)w=c.hasOwnProperty("$"+o[h].value),o[h].selected!==w&&(o[h].selected=w),w&&y&&(o[h].defaultSelected=!0)}else{for(h=""+Si(h),c=null,w=0;w<o.length;w++){if(o[w].value===h){o[w].selected=!0,y&&(o[w].defaultSelected=!0);return}c!==null||o[w].disabled||(c=o[w])}c!==null&&(c.selected=!0)}}function KA(o,c,h){if(c!=null&&(c=""+Si(c),c!==o.value&&(o.value=c),h==null)){o.defaultValue!==c&&(o.defaultValue=c);return}o.defaultValue=h!=null?""+Si(h):""}function GA(o,c,h,y){if(c==null){if(y!=null){if(h!=null)throw Error(r(92));if(Z(y)){if(1<y.length)throw Error(r(93));y=y[0]}h=y}h==null&&(h=""),c=h}h=Si(c),o.defaultValue=h,y=o.textContent,y===h&&y!==""&&y!==null&&(o.value=y),Yx(o)}function _c(o,c){if(c){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=c;return}}o.textContent=c}var c9=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 VA(o,c,h){var y=c.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?y?o.setProperty(c,""):c==="float"?o.cssFloat="":o[c]="":y?o.setProperty(c,h):typeof h!="number"||h===0||c9.has(c)?c==="float"?o.cssFloat=h:o[c]=(""+h).trim():o[c]=h+"px"}function QA(o,c,h){if(c!=null&&typeof c!="object")throw Error(r(62));if(o=o.style,h!=null){for(var y in h)!h.hasOwnProperty(y)||c!=null&&c.hasOwnProperty(y)||(y.indexOf("--")===0?o.setProperty(y,""):y==="float"?o.cssFloat="":o[y]="");for(var w in c)y=c[w],c.hasOwnProperty(w)&&h[w]!==y&&VA(o,w,y)}else for(var N in c)c.hasOwnProperty(N)&&VA(o,N,c[N])}function Jx(o){if(o.indexOf("-")===-1)return!1;switch(o){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 u9=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"]]),d9=/^[\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 Ep(o){return d9.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function ns(){}var e0=null;function t0(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var zc=null,Pc=null;function WA(o){var c=Xi(o);if(c&&(o=c.stateNode)){var h=o[St]||null;e:switch(o=c.stateNode,c.type){case"input":if(Zx(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),c=h.name,h.type==="radio"&&c!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+Ni(""+c)+'"][type="radio"]'),c=0;c<h.length;c++){var y=h[c];if(y!==o&&y.form===o.form){var w=y[St]||null;if(!w)throw Error(r(90));Zx(y,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(c=0;c<h.length;c++)y=h[c],y.form===o.form&&FA(y)}break e;case"textarea":KA(o,h.value,h.defaultValue);break e;case"select":c=h.value,c!=null&&Ec(o,!!h.multiple,c,!1)}}}var n0=!1;function YA(o,c,h){if(n0)return o(c,h);n0=!0;try{var y=o(c);return y}finally{if(n0=!1,(zc!==null||Pc!==null)&&(gm(),zc&&(c=zc,o=Pc,Pc=zc=null,WA(c),o)))for(c=0;c<o.length;c++)WA(o[c])}}function $d(o,c){var h=o.stateNode;if(h===null)return null;var y=h[St]||null;if(y===null)return null;h=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(o=o.type,y=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!y;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,c,typeof h));return h}var rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),r0=!1;if(rs)try{var Bd={};Object.defineProperty(Bd,"passive",{get:function(){r0=!0}}),window.addEventListener("test",Bd,Bd),window.removeEventListener("test",Bd,Bd)}catch{r0=!1}var Ys=null,i0=null,_p=null;function ZA(){if(_p)return _p;var o,c=i0,h=c.length,y,w="value"in Ys?Ys.value:Ys.textContent,N=w.length;for(o=0;o<h&&c[o]===w[o];o++);var z=h-o;for(y=1;y<=z&&c[h-y]===w[N-y];y++);return _p=w.slice(o,1<y?1-y:void 0)}function zp(o){var c=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&c===13&&(o=13)):o=c,o===10&&(o=13),32<=o||o===13?o:0}function Pp(){return!0}function XA(){return!1}function Ur(o){function c(h,y,w,N,z){this._reactName=h,this._targetInst=w,this.type=y,this.nativeEvent=N,this.target=z,this.currentTarget=null;for(var L in o)o.hasOwnProperty(L)&&(h=o[L],this[L]=h?h(N):N[L]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Pp:XA,this.isPropagationStopped=XA,this}return m(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Pp)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Pp)},persist:function(){},isPersistent:Pp}),c}var sl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tp=Ur(sl),Ud=m({},sl,{view:0,detail:0}),f9=Ur(Ud),a0,s0,qd,Rp=m({},Ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:l0,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==qd&&(qd&&o.type==="mousemove"?(a0=o.screenX-qd.screenX,s0=o.screenY-qd.screenY):s0=a0=0,qd=o),a0)},movementY:function(o){return"movementY"in o?o.movementY:s0}}),JA=Ur(Rp),h9=m({},Rp,{dataTransfer:0}),p9=Ur(h9),m9=m({},Ud,{relatedTarget:0}),o0=Ur(m9),g9=m({},sl,{animationName:0,elapsedTime:0,pseudoElement:0}),y9=Ur(g9),v9=m({},sl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),x9=Ur(v9),b9=m({},sl,{data:0}),eO=Ur(b9),w9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j9={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"},S9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N9(o){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(o):(o=S9[o])?!!c[o]:!1}function l0(){return N9}var k9=m({},Ud,{key:function(o){if(o.key){var c=w9[o.key]||o.key;if(c!=="Unidentified")return c}return o.type==="keypress"?(o=zp(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?j9[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:l0,charCode:function(o){return o.type==="keypress"?zp(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?zp(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),C9=Ur(k9),A9=m({},Rp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tO=Ur(A9),O9=m({},Ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:l0}),E9=Ur(O9),_9=m({},sl,{propertyName:0,elapsedTime:0,pseudoElement:0}),z9=Ur(_9),P9=m({},Rp,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),T9=Ur(P9),R9=m({},sl,{newState:0,oldState:0}),D9=Ur(R9),M9=[9,13,27,32],c0=rs&&"CompositionEvent"in window,Fd=null;rs&&"documentMode"in document&&(Fd=document.documentMode);var I9=rs&&"TextEvent"in window&&!Fd,nO=rs&&(!c0||Fd&&8<Fd&&11>=Fd),rO=" ",iO=!1;function aO(o,c){switch(o){case"keyup":return M9.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sO(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Tc=!1;function L9(o,c){switch(o){case"compositionend":return sO(c);case"keypress":return c.which!==32?null:(iO=!0,rO);case"textInput":return o=c.data,o===rO&&iO?null:o;default:return null}}function $9(o,c){if(Tc)return o==="compositionend"||!c0&&aO(o,c)?(o=ZA(),_p=i0=Ys=null,Tc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return nO&&c.locale!=="ko"?null:c.data;default:return null}}var B9={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 oO(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c==="input"?!!B9[o.type]:c==="textarea"}function lO(o,c,h,y){zc?Pc?Pc.push(y):Pc=[y]:zc=y,c=Sm(c,"onChange"),0<c.length&&(h=new Tp("onChange","change",null,h,y),o.push({event:h,listeners:c}))}var Hd=null,Kd=null;function U9(o){H_(o,0)}function Dp(o){var c=Qs(o);if(FA(c))return o}function cO(o,c){if(o==="change")return c}var uO=!1;if(rs){var u0;if(rs){var d0="oninput"in document;if(!d0){var dO=document.createElement("div");dO.setAttribute("oninput","return;"),d0=typeof dO.oninput=="function"}u0=d0}else u0=!1;uO=u0&&(!document.documentMode||9<document.documentMode)}function fO(){Hd&&(Hd.detachEvent("onpropertychange",hO),Kd=Hd=null)}function hO(o){if(o.propertyName==="value"&&Dp(Kd)){var c=[];lO(c,Kd,o,t0(o)),YA(U9,c)}}function q9(o,c,h){o==="focusin"?(fO(),Hd=c,Kd=h,Hd.attachEvent("onpropertychange",hO)):o==="focusout"&&fO()}function F9(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Dp(Kd)}function H9(o,c){if(o==="click")return Dp(c)}function K9(o,c){if(o==="input"||o==="change")return Dp(c)}function G9(o,c){return o===c&&(o!==0||1/o===1/c)||o!==o&&c!==c}var ii=typeof Object.is=="function"?Object.is:G9;function Gd(o,c){if(ii(o,c))return!0;if(typeof o!="object"||o===null||typeof c!="object"||c===null)return!1;var h=Object.keys(o),y=Object.keys(c);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var w=h[y];if(!cn.call(c,w)||!ii(o[w],c[w]))return!1}return!0}function pO(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function mO(o,c){var h=pO(o);o=0;for(var y;h;){if(h.nodeType===3){if(y=o+h.textContent.length,o<=c&&y>=c)return{node:h,offset:c-o};o=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=pO(h)}}function gO(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?gO(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function yO(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var c=Op(o.document);c instanceof o.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)o=c.contentWindow;else break;c=Op(o.document)}return c}function f0(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}var V9=rs&&"documentMode"in document&&11>=document.documentMode,Rc=null,h0=null,Vd=null,p0=!1;function vO(o,c,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;p0||Rc==null||Rc!==Op(y)||(y=Rc,"selectionStart"in y&&f0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Vd&&Gd(Vd,y)||(Vd=y,y=Sm(h0,"onSelect"),0<y.length&&(c=new Tp("onSelect","select",null,c,h),o.push({event:c,listeners:y}),c.target=Rc)))}function ol(o,c){var h={};return h[o.toLowerCase()]=c.toLowerCase(),h["Webkit"+o]="webkit"+c,h["Moz"+o]="moz"+c,h}var Dc={animationend:ol("Animation","AnimationEnd"),animationiteration:ol("Animation","AnimationIteration"),animationstart:ol("Animation","AnimationStart"),transitionrun:ol("Transition","TransitionRun"),transitionstart:ol("Transition","TransitionStart"),transitioncancel:ol("Transition","TransitionCancel"),transitionend:ol("Transition","TransitionEnd")},m0={},xO={};rs&&(xO=document.createElement("div").style,"AnimationEvent"in window||(delete Dc.animationend.animation,delete Dc.animationiteration.animation,delete Dc.animationstart.animation),"TransitionEvent"in window||delete Dc.transitionend.transition);function ll(o){if(m0[o])return m0[o];if(!Dc[o])return o;var c=Dc[o],h;for(h in c)if(c.hasOwnProperty(h)&&h in xO)return m0[o]=c[h];return o}var bO=ll("animationend"),wO=ll("animationiteration"),jO=ll("animationstart"),Q9=ll("transitionrun"),W9=ll("transitionstart"),Y9=ll("transitioncancel"),SO=ll("transitionend"),NO=new Map,g0="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(" ");g0.push("scrollEnd");function ea(o,c){NO.set(o,c),es(c,[o])}var Mp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},ki=[],Mc=0,y0=0;function Ip(){for(var o=Mc,c=y0=Mc=0;c<o;){var h=ki[c];ki[c++]=null;var y=ki[c];ki[c++]=null;var w=ki[c];ki[c++]=null;var N=ki[c];if(ki[c++]=null,y!==null&&w!==null){var z=y.pending;z===null?w.next=w:(w.next=z.next,z.next=w),y.pending=w}N!==0&&kO(h,w,N)}}function Lp(o,c,h,y){ki[Mc++]=o,ki[Mc++]=c,ki[Mc++]=h,ki[Mc++]=y,y0|=y,o.lanes|=y,o=o.alternate,o!==null&&(o.lanes|=y)}function v0(o,c,h,y){return Lp(o,c,h,y),$p(o)}function cl(o,c){return Lp(o,null,null,c),$p(o)}function kO(o,c,h){o.lanes|=h;var y=o.alternate;y!==null&&(y.lanes|=h);for(var w=!1,N=o.return;N!==null;)N.childLanes|=h,y=N.alternate,y!==null&&(y.childLanes|=h),N.tag===22&&(o=N.stateNode,o===null||o._visibility&1||(w=!0)),o=N,N=N.return;return o.tag===3?(N=o.stateNode,w&&c!==null&&(w=31-de(h),o=N.hiddenUpdates,y=o[w],y===null?o[w]=[c]:y.push(c),c.lane=h|536870912),N):null}function $p(o){if(50<gf)throw gf=0,Ab=null,Error(r(185));for(var c=o.return;c!==null;)o=c,c=o.return;return o.tag===3?o.stateNode:null}var Ic={};function Z9(o,c,h,y){this.tag=o,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=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(o,c,h,y){return new Z9(o,c,h,y)}function x0(o){return o=o.prototype,!(!o||!o.isReactComponent)}function is(o,c){var h=o.alternate;return h===null?(h=ai(o.tag,c,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=c,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&65011712,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,c=o.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function CO(o,c){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=c,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=h.childLanes,o.lanes=h.lanes,o.child=h.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=h.memoizedProps,o.memoizedState=h.memoizedState,o.updateQueue=h.updateQueue,o.type=h.type,c=h.dependencies,o.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),o}function Bp(o,c,h,y,w,N){var z=0;if(y=o,typeof o=="function")x0(o)&&(z=1);else if(typeof o=="string")z=nK(o,h,G.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case $:return o=ai(31,h,c,w),o.elementType=$,o.lanes=N,o;case b:return ul(h.children,w,N,c);case S:z=8,w|=24;break;case k:return o=ai(12,h,c,w|2),o.elementType=k,o.lanes=N,o;case P:return o=ai(13,h,c,w),o.elementType=P,o.lanes=N,o;case O:return o=ai(19,h,c,w),o.elementType=O,o.lanes=N,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case C:z=10;break e;case E:z=9;break e;case A:z=11;break e;case _:z=14;break e;case T:z=16,y=null;break e}z=29,h=Error(r(130,o===null?"null":typeof o,"")),y=null}return c=ai(z,h,c,w),c.elementType=o,c.type=y,c.lanes=N,c}function ul(o,c,h,y){return o=ai(7,o,y,c),o.lanes=h,o}function b0(o,c,h){return o=ai(6,o,null,c),o.lanes=h,o}function AO(o){var c=ai(18,null,null,0);return c.stateNode=o,c}function w0(o,c,h){return c=ai(4,o.children!==null?o.children:[],o.key,c),c.lanes=h,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}var OO=new WeakMap;function Ci(o,c){if(typeof o=="object"&&o!==null){var h=OO.get(o);return h!==void 0?h:(c={value:o,source:c,stack:Lt(c)},OO.set(o,c),c)}return{value:o,source:c,stack:Lt(c)}}var Lc=[],$c=0,Up=null,Qd=0,Ai=[],Oi=0,Zs=null,Sa=1,Na="";function as(o,c){Lc[$c++]=Qd,Lc[$c++]=Up,Up=o,Qd=c}function EO(o,c,h){Ai[Oi++]=Sa,Ai[Oi++]=Na,Ai[Oi++]=Zs,Zs=o;var y=Sa;o=Na;var w=32-de(y)-1;y&=~(1<<w),h+=1;var N=32-de(c)+w;if(30<N){var z=w-w%5;N=(y&(1<<z)-1).toString(32),y>>=z,w-=z,Sa=1<<32-de(c)+w|h<<w|y,Na=N+o}else Sa=1<<N|h<<w|y,Na=o}function j0(o){o.return!==null&&(as(o,1),EO(o,1,0))}function S0(o){for(;o===Up;)Up=Lc[--$c],Lc[$c]=null,Qd=Lc[--$c],Lc[$c]=null;for(;o===Zs;)Zs=Ai[--Oi],Ai[Oi]=null,Na=Ai[--Oi],Ai[Oi]=null,Sa=Ai[--Oi],Ai[Oi]=null}function _O(o,c){Ai[Oi++]=Sa,Ai[Oi++]=Na,Ai[Oi++]=Zs,Sa=c.id,Na=c.overflow,Zs=o}var or=null,nn=null,wt=!1,Xs=null,Ei=!1,N0=Error(r(519));function Js(o){var c=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Wd(Ci(c,o)),N0}function zO(o){var c=o.stateNode,h=o.type,y=o.memoizedProps;switch(c[tt]=o,c[St]=y,h){case"dialog":yt("cancel",c),yt("close",c);break;case"iframe":case"object":case"embed":yt("load",c);break;case"video":case"audio":for(h=0;h<vf.length;h++)yt(vf[h],c);break;case"source":yt("error",c);break;case"img":case"image":case"link":yt("error",c),yt("load",c);break;case"details":yt("toggle",c);break;case"input":yt("invalid",c),HA(c,y.value,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name,!0);break;case"select":yt("invalid",c);break;case"textarea":yt("invalid",c),GA(c,y.value,y.defaultValue,y.children)}h=y.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||c.textContent===""+h||y.suppressHydrationWarning===!0||Q_(c.textContent,h)?(y.popover!=null&&(yt("beforetoggle",c),yt("toggle",c)),y.onScroll!=null&&yt("scroll",c),y.onScrollEnd!=null&&yt("scrollend",c),y.onClick!=null&&(c.onclick=ns),c=!0):c=!1,c||Js(o,!0)}function PO(o){for(or=o.return;or;)switch(or.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:or=or.return}}function Bc(o){if(o!==or)return!1;if(!wt)return PO(o),wt=!0,!1;var c=o.tag,h;if((h=c!==3&&c!==27)&&((h=c===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||qb(o.type,o.memoizedProps)),h=!h),h&&nn&&Js(o),PO(o),c===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));nn=rz(o)}else if(c===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));nn=rz(o)}else c===27?(c=nn,po(o.type)?(o=Vb,Vb=null,nn=o):nn=c):nn=or?zi(o.stateNode.nextSibling):null;return!0}function dl(){nn=or=null,wt=!1}function k0(){var o=Xs;return o!==null&&(Kr===null?Kr=o:Kr.push.apply(Kr,o),Xs=null),o}function Wd(o){Xs===null?Xs=[o]:Xs.push(o)}var C0=M(null),fl=null,ss=null;function eo(o,c,h){D(C0,c._currentValue),c._currentValue=h}function os(o){o._currentValue=C0.current,q(C0)}function A0(o,c,h){for(;o!==null;){var y=o.alternate;if((o.childLanes&c)!==c?(o.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),o===h)break;o=o.return}}function O0(o,c,h,y){var w=o.child;for(w!==null&&(w.return=o);w!==null;){var N=w.dependencies;if(N!==null){var z=w.child;N=N.firstContext;e:for(;N!==null;){var L=N;N=w;for(var K=0;K<c.length;K++)if(L.context===c[K]){N.lanes|=h,L=N.alternate,L!==null&&(L.lanes|=h),A0(N.return,h,o),y||(z=null);break e}N=L.next}}else if(w.tag===18){if(z=w.return,z===null)throw Error(r(341));z.lanes|=h,N=z.alternate,N!==null&&(N.lanes|=h),A0(z,h,o),z=null}else z=w.child;if(z!==null)z.return=w;else for(z=w;z!==null;){if(z===o){z=null;break}if(w=z.sibling,w!==null){w.return=z.return,z=w;break}z=z.return}w=z}}function Uc(o,c,h,y){o=null;for(var w=c,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 z=w.alternate;if(z===null)throw Error(r(387));if(z=z.memoizedProps,z!==null){var L=w.type;ii(w.pendingProps.value,z.value)||(o!==null?o.push(L):o=[L])}}else if(w===Ce.current){if(z=w.alternate,z===null)throw Error(r(387));z.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(o!==null?o.push(Sf):o=[Sf])}w=w.return}o!==null&&O0(c,o,h,y),c.flags|=262144}function qp(o){for(o=o.firstContext;o!==null;){if(!ii(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function hl(o){fl=o,ss=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function lr(o){return TO(fl,o)}function Fp(o,c){return fl===null&&hl(o),TO(o,c)}function TO(o,c){var h=c._currentValue;if(c={context:c,memoizedValue:h,next:null},ss===null){if(o===null)throw Error(r(308));ss=c,o.dependencies={lanes:0,firstContext:c},o.flags|=524288}else ss=ss.next=c;return h}var X9=typeof AbortController<"u"?AbortController:function(){var o=[],c=this.signal={aborted:!1,addEventListener:function(h,y){o.push(y)}};this.abort=function(){c.aborted=!0,o.forEach(function(h){return h()})}},J9=e.unstable_scheduleCallback,eH=e.unstable_NormalPriority,Mn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function E0(){return{controller:new X9,data:new Map,refCount:0}}function Yd(o){o.refCount--,o.refCount===0&&J9(eH,function(){o.controller.abort()})}var Zd=null,_0=0,qc=0,Fc=null;function tH(o,c){if(Zd===null){var h=Zd=[];_0=0,qc=Tb(),Fc={status:"pending",value:void 0,then:function(y){h.push(y)}}}return _0++,c.then(RO,RO),c}function RO(){if(--_0===0&&Zd!==null){Fc!==null&&(Fc.status="fulfilled");var o=Zd;Zd=null,qc=0,Fc=null;for(var c=0;c<o.length;c++)(0,o[c])()}}function nH(o,c){var h=[],y={status:"pending",value:null,reason:null,then:function(w){h.push(w)}};return o.then(function(){y.status="fulfilled",y.value=c;for(var w=0;w<h.length;w++)(0,h[w])(c)},function(w){for(y.status="rejected",y.reason=w,w=0;w<h.length;w++)(0,h[w])(void 0)}),y}var DO=H.S;H.S=function(o,c){v_=mt(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&tH(o,c),DO!==null&&DO(o,c)};var pl=M(null);function z0(){var o=pl.current;return o!==null?o:Vt.pooledCache}function Hp(o,c){c===null?D(pl,pl.current):D(pl,c.pool)}function MO(){var o=z0();return o===null?null:{parent:Mn._currentValue,pool:o}}var Hc=Error(r(460)),P0=Error(r(474)),Kp=Error(r(542)),Gp={then:function(){}};function IO(o){return o=o.status,o==="fulfilled"||o==="rejected"}function LO(o,c,h){switch(h=o[h],h===void 0?o.push(c):h!==c&&(c.then(ns,ns),c=h),c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,BO(o),o;default:if(typeof c.status=="string")c.then(ns,ns);else{if(o=Vt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=c,o.status="pending",o.then(function(y){if(c.status==="pending"){var w=c;w.status="fulfilled",w.value=y}},function(y){if(c.status==="pending"){var w=c;w.status="rejected",w.reason=y}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw o=c.reason,BO(o),o}throw gl=c,Hc}}function ml(o){try{var c=o._init;return c(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(gl=h,Hc):h}}var gl=null;function $O(){if(gl===null)throw Error(r(459));var o=gl;return gl=null,o}function BO(o){if(o===Hc||o===Kp)throw Error(r(483))}var Kc=null,Xd=0;function Vp(o){var c=Xd;return Xd+=1,Kc===null&&(Kc=[]),LO(Kc,o,c)}function Jd(o,c){c=c.props.ref,o.ref=c!==void 0?c:null}function Qp(o,c){throw c.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(c),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":o)))}function UO(o){function c(te,W){if(o){var ie=te.deletions;ie===null?(te.deletions=[W],te.flags|=16):ie.push(W)}}function h(te,W){if(!o)return null;for(;W!==null;)c(te,W),W=W.sibling;return null}function y(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=is(te,W),te.index=0,te.sibling=null,te}function N(te,W,ie){return te.index=ie,o?(ie=te.alternate,ie!==null?(ie=ie.index,ie<W?(te.flags|=67108866,W):ie):(te.flags|=67108866,W)):(te.flags|=1048576,W)}function z(te){return o&&te.alternate===null&&(te.flags|=67108866),te}function L(te,W,ie,xe){return W===null||W.tag!==6?(W=b0(ie,te.mode,xe),W.return=te,W):(W=w(W,ie),W.return=te,W)}function K(te,W,ie,xe){var Ke=ie.type;return Ke===b?me(te,W,ie.props.children,xe,ie.key):W!==null&&(W.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&ml(Ke)===W.type)?(W=w(W,ie.props),Jd(W,ie),W.return=te,W):(W=Bp(ie.type,ie.key,ie.props,null,te.mode,xe),Jd(W,ie),W.return=te,W)}function ae(te,W,ie,xe){return W===null||W.tag!==4||W.stateNode.containerInfo!==ie.containerInfo||W.stateNode.implementation!==ie.implementation?(W=w0(ie,te.mode,xe),W.return=te,W):(W=w(W,ie.children||[]),W.return=te,W)}function me(te,W,ie,xe,Ke){return W===null||W.tag!==7?(W=ul(ie,te.mode,xe,Ke),W.return=te,W):(W=w(W,ie),W.return=te,W)}function we(te,W,ie){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=b0(""+W,te.mode,ie),W.return=te,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return ie=Bp(W.type,W.key,W.props,null,te.mode,ie),Jd(ie,W),ie.return=te,ie;case j:return W=w0(W,te.mode,ie),W.return=te,W;case T:return W=ml(W),we(te,W,ie)}if(Z(W)||B(W))return W=ul(W,te.mode,ie,null),W.return=te,W;if(typeof W.then=="function")return we(te,Vp(W),ie);if(W.$$typeof===C)return we(te,Fp(te,W),ie);Qp(te,W)}return null}function le(te,W,ie,xe){var Ke=W!==null?W.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ke!==null?null:L(te,W,""+ie,xe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case v:return ie.key===Ke?K(te,W,ie,xe):null;case j:return ie.key===Ke?ae(te,W,ie,xe):null;case T:return ie=ml(ie),le(te,W,ie,xe)}if(Z(ie)||B(ie))return Ke!==null?null:me(te,W,ie,xe,null);if(typeof ie.then=="function")return le(te,W,Vp(ie),xe);if(ie.$$typeof===C)return le(te,W,Fp(te,ie),xe);Qp(te,ie)}return null}function ue(te,W,ie,xe,Ke){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return te=te.get(ie)||null,L(W,te,""+xe,Ke);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case v:return te=te.get(xe.key===null?ie:xe.key)||null,K(W,te,xe,Ke);case j:return te=te.get(xe.key===null?ie:xe.key)||null,ae(W,te,xe,Ke);case T:return xe=ml(xe),ue(te,W,ie,xe,Ke)}if(Z(xe)||B(xe))return te=te.get(ie)||null,me(W,te,xe,Ke,null);if(typeof xe.then=="function")return ue(te,W,ie,Vp(xe),Ke);if(xe.$$typeof===C)return ue(te,W,ie,Fp(W,xe),Ke);Qp(W,xe)}return null}function De(te,W,ie,xe){for(var Ke=null,kt=null,Be=W,ot=W=0,bt=null;Be!==null&&ot<ie.length;ot++){Be.index>ot?(bt=Be,Be=null):bt=Be.sibling;var Ct=le(te,Be,ie[ot],xe);if(Ct===null){Be===null&&(Be=bt);break}o&&Be&&Ct.alternate===null&&c(te,Be),W=N(Ct,W,ot),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct,Be=bt}if(ot===ie.length)return h(te,Be),wt&&as(te,ot),Ke;if(Be===null){for(;ot<ie.length;ot++)Be=we(te,ie[ot],xe),Be!==null&&(W=N(Be,W,ot),kt===null?Ke=Be:kt.sibling=Be,kt=Be);return wt&&as(te,ot),Ke}for(Be=y(Be);ot<ie.length;ot++)bt=ue(Be,te,ot,ie[ot],xe),bt!==null&&(o&&bt.alternate!==null&&Be.delete(bt.key===null?ot:bt.key),W=N(bt,W,ot),kt===null?Ke=bt:kt.sibling=bt,kt=bt);return o&&Be.forEach(function(xo){return c(te,xo)}),wt&&as(te,ot),Ke}function Ye(te,W,ie,xe){if(ie==null)throw Error(r(151));for(var Ke=null,kt=null,Be=W,ot=W=0,bt=null,Ct=ie.next();Be!==null&&!Ct.done;ot++,Ct=ie.next()){Be.index>ot?(bt=Be,Be=null):bt=Be.sibling;var xo=le(te,Be,Ct.value,xe);if(xo===null){Be===null&&(Be=bt);break}o&&Be&&xo.alternate===null&&c(te,Be),W=N(xo,W,ot),kt===null?Ke=xo:kt.sibling=xo,kt=xo,Be=bt}if(Ct.done)return h(te,Be),wt&&as(te,ot),Ke;if(Be===null){for(;!Ct.done;ot++,Ct=ie.next())Ct=we(te,Ct.value,xe),Ct!==null&&(W=N(Ct,W,ot),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return wt&&as(te,ot),Ke}for(Be=y(Be);!Ct.done;ot++,Ct=ie.next())Ct=ue(Be,te,ot,Ct.value,xe),Ct!==null&&(o&&Ct.alternate!==null&&Be.delete(Ct.key===null?ot:Ct.key),W=N(Ct,W,ot),kt===null?Ke=Ct:kt.sibling=Ct,kt=Ct);return o&&Be.forEach(function(hK){return c(te,hK)}),wt&&as(te,ot),Ke}function Ut(te,W,ie,xe){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 Ke=ie.key;W!==null;){if(W.key===Ke){if(Ke=ie.type,Ke===b){if(W.tag===7){h(te,W.sibling),xe=w(W,ie.props.children),xe.return=te,te=xe;break e}}else if(W.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===T&&ml(Ke)===W.type){h(te,W.sibling),xe=w(W,ie.props),Jd(xe,ie),xe.return=te,te=xe;break e}h(te,W);break}else c(te,W);W=W.sibling}ie.type===b?(xe=ul(ie.props.children,te.mode,xe,ie.key),xe.return=te,te=xe):(xe=Bp(ie.type,ie.key,ie.props,null,te.mode,xe),Jd(xe,ie),xe.return=te,te=xe)}return z(te);case j:e:{for(Ke=ie.key;W!==null;){if(W.key===Ke)if(W.tag===4&&W.stateNode.containerInfo===ie.containerInfo&&W.stateNode.implementation===ie.implementation){h(te,W.sibling),xe=w(W,ie.children||[]),xe.return=te,te=xe;break e}else{h(te,W);break}else c(te,W);W=W.sibling}xe=w0(ie,te.mode,xe),xe.return=te,te=xe}return z(te);case T:return ie=ml(ie),Ut(te,W,ie,xe)}if(Z(ie))return De(te,W,ie,xe);if(B(ie)){if(Ke=B(ie),typeof Ke!="function")throw Error(r(150));return ie=Ke.call(ie),Ye(te,W,ie,xe)}if(typeof ie.then=="function")return Ut(te,W,Vp(ie),xe);if(ie.$$typeof===C)return Ut(te,W,Fp(te,ie),xe);Qp(te,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,W!==null&&W.tag===6?(h(te,W.sibling),xe=w(W,ie),xe.return=te,te=xe):(h(te,W),xe=b0(ie,te.mode,xe),xe.return=te,te=xe),z(te)):h(te,W)}return function(te,W,ie,xe){try{Xd=0;var Ke=Ut(te,W,ie,xe);return Kc=null,Ke}catch(Be){if(Be===Hc||Be===Kp)throw Be;var kt=ai(29,Be,null,te.mode);return kt.lanes=xe,kt.return=te,kt}}}var yl=UO(!0),qO=UO(!1),to=!1;function T0(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function R0(o,c){o=o.updateQueue,c.updateQueue===o&&(c.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function no(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function ro(o,c,h){var y=o.updateQueue;if(y===null)return null;if(y=y.shared,(zt&2)!==0){var w=y.pending;return w===null?c.next=c:(c.next=w.next,w.next=c),y.pending=c,c=$p(o),kO(o,null,h),c}return Lp(o,y,c,h),$p(o)}function ef(o,c,h){if(c=c.updateQueue,c!==null&&(c=c.shared,(h&4194048)!==0)){var y=c.lanes;y&=o.pendingLanes,h|=y,c.lanes=h,Np(o,h)}}function D0(o,c){var h=o.updateQueue,y=o.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var w=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var z={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?w=N=z:N=N.next=z,h=h.next}while(h!==null);N===null?w=N=c:N=N.next=c}else w=N=c;h={baseState:y.baseState,firstBaseUpdate:w,lastBaseUpdate:N,shared:y.shared,callbacks:y.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=c}var M0=!1;function tf(){if(M0){var o=Fc;if(o!==null)throw o}}function nf(o,c,h,y){M0=!1;var w=o.updateQueue;to=!1;var N=w.firstBaseUpdate,z=w.lastBaseUpdate,L=w.shared.pending;if(L!==null){w.shared.pending=null;var K=L,ae=K.next;K.next=null,z===null?N=ae:z.next=ae,z=K;var me=o.alternate;me!==null&&(me=me.updateQueue,L=me.lastBaseUpdate,L!==z&&(L===null?me.firstBaseUpdate=ae:L.next=ae,me.lastBaseUpdate=K))}if(N!==null){var we=w.baseState;z=0,me=ae=K=null,L=N;do{var le=L.lane&-536870913,ue=le!==L.lane;if(ue?(xt&le)===le:(y&le)===le){le!==0&&le===qc&&(M0=!0),me!==null&&(me=me.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var De=o,Ye=L;le=c;var Ut=h;switch(Ye.tag){case 1:if(De=Ye.payload,typeof De=="function"){we=De.call(Ut,we,le);break e}we=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ye.payload,le=typeof De=="function"?De.call(Ut,we,le):De,le==null)break e;we=m({},we,le);break e;case 2:to=!0}}le=L.callback,le!==null&&(o.flags|=64,ue&&(o.flags|=8192),ue=w.callbacks,ue===null?w.callbacks=[le]:ue.push(le))}else ue={lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},me===null?(ae=me=ue,K=we):me=me.next=ue,z|=le;if(L=L.next,L===null){if(L=w.shared.pending,L===null)break;ue=L,L=ue.next,ue.next=null,w.lastBaseUpdate=ue,w.shared.pending=null}}while(!0);me===null&&(K=we),w.baseState=K,w.firstBaseUpdate=ae,w.lastBaseUpdate=me,N===null&&(w.shared.lanes=0),lo|=z,o.lanes=z,o.memoizedState=we}}function FO(o,c){if(typeof o!="function")throw Error(r(191,o));o.call(c)}function HO(o,c){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)FO(h[o],c)}var Gc=M(null),Wp=M(0);function KO(o,c){o=gs,D(Wp,o),D(Gc,c),gs=o|c.baseLanes}function I0(){D(Wp,gs),D(Gc,Gc.current)}function L0(){gs=Wp.current,q(Gc),q(Wp)}var si=M(null),_i=null;function io(o){var c=o.alternate;D(zn,zn.current&1),D(si,o),_i===null&&(c===null||Gc.current!==null||c.memoizedState!==null)&&(_i=o)}function $0(o){D(zn,zn.current),D(si,o),_i===null&&(_i=o)}function GO(o){o.tag===22?(D(zn,zn.current),D(si,o),_i===null&&(_i=o)):ao()}function ao(){D(zn,zn.current),D(si,si.current)}function oi(o){q(si),_i===o&&(_i=null),q(zn)}var zn=M(0);function Yp(o){for(var c=o;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||Kb(h)||Gb(h)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var ls=0,st=null,$t=null,In=null,Zp=!1,Vc=!1,vl=!1,Xp=0,rf=0,Qc=null,rH=0;function jn(){throw Error(r(321))}function B0(o,c){if(c===null)return!1;for(var h=0;h<c.length&&h<o.length;h++)if(!ii(o[h],c[h]))return!1;return!0}function U0(o,c,h,y,w,N){return ls=N,st=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,H.H=o===null||o.memoizedState===null?EE:nb,vl=!1,N=h(y,w),vl=!1,Vc&&(N=QO(c,h,y,w)),VO(o),N}function VO(o){H.H=of;var c=$t!==null&&$t.next!==null;if(ls=0,In=$t=st=null,Zp=!1,rf=0,Qc=null,c)throw Error(r(300));o===null||Ln||(o=o.dependencies,o!==null&&qp(o)&&(Ln=!0))}function QO(o,c,h,y){st=o;var w=0;do{if(Vc&&(Qc=null),rf=0,Vc=!1,25<=w)throw Error(r(301));if(w+=1,In=$t=null,o.updateQueue!=null){var N=o.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}H.H=_E,N=c(h,y)}while(Vc);return N}function iH(){var o=H.H,c=o.useState()[0];return c=typeof c.then=="function"?af(c):c,o=o.useState()[0],($t!==null?$t.memoizedState:null)!==o&&(st.flags|=1024),c}function q0(){var o=Xp!==0;return Xp=0,o}function F0(o,c,h){c.updateQueue=o.updateQueue,c.flags&=-2053,o.lanes&=~h}function H0(o){if(Zp){for(o=o.memoizedState;o!==null;){var c=o.queue;c!==null&&(c.pending=null),o=o.next}Zp=!1}ls=0,In=$t=st=null,Vc=!1,rf=Xp=0,Qc=null}function _r(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?st.memoizedState=In=o:In=In.next=o,In}function Pn(){if($t===null){var o=st.alternate;o=o!==null?o.memoizedState:null}else o=$t.next;var c=In===null?st.memoizedState:In.next;if(c!==null)In=c,$t=o;else{if(o===null)throw st.alternate===null?Error(r(467)):Error(r(310));$t=o,o={memoizedState:$t.memoizedState,baseState:$t.baseState,baseQueue:$t.baseQueue,queue:$t.queue,next:null},In===null?st.memoizedState=In=o:In=In.next=o}return In}function Jp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function af(o){var c=rf;return rf+=1,Qc===null&&(Qc=[]),o=LO(Qc,o,c),c=st,(In===null?c.memoizedState:In.next)===null&&(c=c.alternate,H.H=c===null||c.memoizedState===null?EE:nb),o}function em(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return af(o);if(o.$$typeof===C)return lr(o)}throw Error(r(438,String(o)))}function K0(o){var c=null,h=st.updateQueue;if(h!==null&&(c=h.memoCache),c==null){var y=st.alternate;y!==null&&(y=y.updateQueue,y!==null&&(y=y.memoCache,y!=null&&(c={data:y.data.map(function(w){return w.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),h===null&&(h=Jp(),st.updateQueue=h),h.memoCache=c,h=c.data[c.index],h===void 0)for(h=c.data[c.index]=Array(o),y=0;y<o;y++)h[y]=F;return c.index++,h}function cs(o,c){return typeof c=="function"?c(o):c}function tm(o){var c=Pn();return G0(c,$t,o)}function G0(o,c,h){var y=o.queue;if(y===null)throw Error(r(311));y.lastRenderedReducer=h;var w=o.baseQueue,N=y.pending;if(N!==null){if(w!==null){var z=w.next;w.next=N.next,N.next=z}c.baseQueue=w=N,y.pending=null}if(N=o.baseState,w===null)o.memoizedState=N;else{c=w.next;var L=z=null,K=null,ae=c,me=!1;do{var we=ae.lane&-536870913;if(we!==ae.lane?(xt&we)===we:(ls&we)===we){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}),we===qc&&(me=!0);else if((ls&le)===le){ae=ae.next,le===qc&&(me=!0);continue}else we={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=we,z=N):K=K.next=we,st.lanes|=le,lo|=le;we=ae.action,vl&&h(N,we),N=ae.hasEagerState?ae.eagerState:h(N,we)}else le={lane:we,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},K===null?(L=K=le,z=N):K=K.next=le,st.lanes|=we,lo|=we;ae=ae.next}while(ae!==null&&ae!==c);if(K===null?z=N:K.next=L,!ii(N,o.memoizedState)&&(Ln=!0,me&&(h=Fc,h!==null)))throw h;o.memoizedState=N,o.baseState=z,o.baseQueue=K,y.lastRenderedState=N}return w===null&&(y.lanes=0),[o.memoizedState,y.dispatch]}function V0(o){var c=Pn(),h=c.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var y=h.dispatch,w=h.pending,N=c.memoizedState;if(w!==null){h.pending=null;var z=w=w.next;do N=o(N,z.action),z=z.next;while(z!==w);ii(N,c.memoizedState)||(Ln=!0),c.memoizedState=N,c.baseQueue===null&&(c.baseState=N),h.lastRenderedState=N}return[N,y]}function WO(o,c,h){var y=st,w=Pn(),N=wt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=c();var z=!ii(($t||w).memoizedState,h);if(z&&(w.memoizedState=h,Ln=!0),w=w.queue,Y0(XO.bind(null,y,w,o),[o]),w.getSnapshot!==c||z||In!==null&&In.memoizedState.tag&1){if(y.flags|=2048,Wc(9,{destroy:void 0},ZO.bind(null,y,w,h,c),null),Vt===null)throw Error(r(349));N||(ls&127)!==0||YO(y,c,h)}return h}function YO(o,c,h){o.flags|=16384,o={getSnapshot:c,value:h},c=st.updateQueue,c===null?(c=Jp(),st.updateQueue=c,c.stores=[o]):(h=c.stores,h===null?c.stores=[o]:h.push(o))}function ZO(o,c,h,y){c.value=h,c.getSnapshot=y,JO(c)&&eE(o)}function XO(o,c,h){return h(function(){JO(c)&&eE(o)})}function JO(o){var c=o.getSnapshot;o=o.value;try{var h=c();return!ii(o,h)}catch{return!0}}function eE(o){var c=cl(o,2);c!==null&&Gr(c,o,2)}function Q0(o){var c=_r();if(typeof o=="function"){var h=o;if(o=h(),vl){Kt(!0);try{h()}finally{Kt(!1)}}}return c.memoizedState=c.baseState=o,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:o},c}function tE(o,c,h,y){return o.baseState=h,G0(o,$t,typeof y=="function"?y:cs)}function aH(o,c,h,y,w){if(im(o))throw Error(r(485));if(o=c.action,o!==null){var N={payload:w,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(z){N.listeners.push(z)}};H.T!==null?h(!0):N.isTransition=!1,y(N),h=c.pending,h===null?(N.next=c.pending=N,nE(c,N)):(N.next=h.next,c.pending=h.next=N)}}function nE(o,c){var h=c.action,y=c.payload,w=o.state;if(c.isTransition){var N=H.T,z={};H.T=z;try{var L=h(w,y),K=H.S;K!==null&&K(z,L),rE(o,c,L)}catch(ae){W0(o,c,ae)}finally{N!==null&&z.types!==null&&(N.types=z.types),H.T=N}}else try{N=h(w,y),rE(o,c,N)}catch(ae){W0(o,c,ae)}}function rE(o,c,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(y){iE(o,c,y)},function(y){return W0(o,c,y)}):iE(o,c,h)}function iE(o,c,h){c.status="fulfilled",c.value=h,aE(c),o.state=h,c=o.pending,c!==null&&(h=c.next,h===c?o.pending=null:(h=h.next,c.next=h,nE(o,h)))}function W0(o,c,h){var y=o.pending;if(o.pending=null,y!==null){y=y.next;do c.status="rejected",c.reason=h,aE(c),c=c.next;while(c!==y)}o.action=null}function aE(o){o=o.listeners;for(var c=0;c<o.length;c++)(0,o[c])()}function sE(o,c){return c}function oE(o,c){if(wt){var h=Vt.formState;if(h!==null){e:{var y=st;if(wt){if(nn){t:{for(var w=nn,N=Ei;w.nodeType!==8;){if(!N){w=null;break t}if(w=zi(w.nextSibling),w===null){w=null;break t}}N=w.data,w=N==="F!"||N==="F"?w:null}if(w){nn=zi(w.nextSibling),y=w.data==="F!";break e}}Js(y)}y=!1}y&&(c=h[0])}}return h=_r(),h.memoizedState=h.baseState=c,y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sE,lastRenderedState:c},h.queue=y,h=CE.bind(null,st,y),y.dispatch=h,y=Q0(!1),N=tb.bind(null,st,!1,y.queue),y=_r(),w={state:c,dispatch:null,action:o,pending:null},y.queue=w,h=aH.bind(null,st,w,N,h),w.dispatch=h,y.memoizedState=o,[c,h,!1]}function lE(o){var c=Pn();return cE(c,$t,o)}function cE(o,c,h){if(c=G0(o,c,sE)[0],o=tm(cs)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var y=af(c)}catch(z){throw z===Hc?Kp:z}else y=c;c=Pn();var w=c.queue,N=w.dispatch;return h!==c.memoizedState&&(st.flags|=2048,Wc(9,{destroy:void 0},sH.bind(null,w,h),null)),[y,N,o]}function sH(o,c){o.action=c}function uE(o){var c=Pn(),h=$t;if(h!==null)return cE(c,h,o);Pn(),c=c.memoizedState,h=Pn();var y=h.queue.dispatch;return h.memoizedState=o,[c,y,!1]}function Wc(o,c,h,y){return o={tag:o,create:h,deps:y,inst:c,next:null},c=st.updateQueue,c===null&&(c=Jp(),st.updateQueue=c),h=c.lastEffect,h===null?c.lastEffect=o.next=o:(y=h.next,h.next=o,o.next=y,c.lastEffect=o),o}function dE(){return Pn().memoizedState}function nm(o,c,h,y){var w=_r();st.flags|=o,w.memoizedState=Wc(1|c,{destroy:void 0},h,y===void 0?null:y)}function rm(o,c,h,y){var w=Pn();y=y===void 0?null:y;var N=w.memoizedState.inst;$t!==null&&y!==null&&B0(y,$t.memoizedState.deps)?w.memoizedState=Wc(c,N,h,y):(st.flags|=o,w.memoizedState=Wc(1|c,N,h,y))}function fE(o,c){nm(8390656,8,o,c)}function Y0(o,c){rm(2048,8,o,c)}function oH(o){st.flags|=4;var c=st.updateQueue;if(c===null)c=Jp(),st.updateQueue=c,c.events=[o];else{var h=c.events;h===null?c.events=[o]:h.push(o)}}function hE(o){var c=Pn().memoizedState;return oH({ref:c,nextImpl:o}),function(){if((zt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}function pE(o,c){return rm(4,2,o,c)}function mE(o,c){return rm(4,4,o,c)}function gE(o,c){if(typeof c=="function"){o=o();var h=c(o);return function(){typeof h=="function"?h():c(null)}}if(c!=null)return o=o(),c.current=o,function(){c.current=null}}function yE(o,c,h){h=h!=null?h.concat([o]):null,rm(4,4,gE.bind(null,c,o),h)}function Z0(){}function vE(o,c){var h=Pn();c=c===void 0?null:c;var y=h.memoizedState;return c!==null&&B0(c,y[1])?y[0]:(h.memoizedState=[o,c],o)}function xE(o,c){var h=Pn();c=c===void 0?null:c;var y=h.memoizedState;if(c!==null&&B0(c,y[1]))return y[0];if(y=o(),vl){Kt(!0);try{o()}finally{Kt(!1)}}return h.memoizedState=[y,c],y}function X0(o,c,h){return h===void 0||(ls&1073741824)!==0&&(xt&261930)===0?o.memoizedState=c:(o.memoizedState=h,o=b_(),st.lanes|=o,lo|=o,h)}function bE(o,c,h,y){return ii(h,c)?h:Gc.current!==null?(o=X0(o,h,y),ii(o,c)||(Ln=!0),o):(ls&42)===0||(ls&1073741824)!==0&&(xt&261930)===0?(Ln=!0,o.memoizedState=h):(o=b_(),st.lanes|=o,lo|=o,c)}function wE(o,c,h,y,w){var N=J.p;J.p=N!==0&&8>N?N:8;var z=H.T,L={};H.T=L,tb(o,!1,c,h);try{var K=w(),ae=H.S;if(ae!==null&&ae(L,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var me=nH(K,y);sf(o,c,me,ui(o))}else sf(o,c,y,ui(o))}catch(we){sf(o,c,{then:function(){},status:"rejected",reason:we},ui())}finally{J.p=N,z!==null&&L.types!==null&&(z.types=L.types),H.T=z}}function lH(){}function J0(o,c,h,y){if(o.tag!==5)throw Error(r(476));var w=jE(o).queue;wE(o,w,c,oe,h===null?lH:function(){return SE(o),h(y)})}function jE(o){var c=o.memoizedState;if(c!==null)return c;c={memoizedState:oe,baseState:oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:oe},next:null};var h={};return c.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:h},next:null},o.memoizedState=c,o=o.alternate,o!==null&&(o.memoizedState=c),c}function SE(o){var c=jE(o);c.next===null&&(c=o.alternate.memoizedState),sf(o,c.next.queue,{},ui())}function eb(){return lr(Sf)}function NE(){return Pn().memoizedState}function kE(){return Pn().memoizedState}function cH(o){for(var c=o.return;c!==null;){switch(c.tag){case 24:case 3:var h=ui();o=no(h);var y=ro(c,o,h);y!==null&&(Gr(y,c,h),ef(y,c,h)),c={cache:E0()},o.payload=c;return}c=c.return}}function uH(o,c,h){var y=ui();h={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},im(o)?AE(c,h):(h=v0(o,c,h,y),h!==null&&(Gr(h,o,y),OE(h,c,y)))}function CE(o,c,h){var y=ui();sf(o,c,h,y)}function sf(o,c,h,y){var w={lane:y,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(im(o))AE(c,w);else{var N=o.alternate;if(o.lanes===0&&(N===null||N.lanes===0)&&(N=c.lastRenderedReducer,N!==null))try{var z=c.lastRenderedState,L=N(z,h);if(w.hasEagerState=!0,w.eagerState=L,ii(L,z))return Lp(o,c,w,0),Vt===null&&Ip(),!1}catch{}if(h=v0(o,c,w,y),h!==null)return Gr(h,o,y),OE(h,c,y),!0}return!1}function tb(o,c,h,y){if(y={lane:2,revertLane:Tb(),gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},im(o)){if(c)throw Error(r(479))}else c=v0(o,h,y,2),c!==null&&Gr(c,o,2)}function im(o){var c=o.alternate;return o===st||c!==null&&c===st}function AE(o,c){Vc=Zp=!0;var h=o.pending;h===null?c.next=c:(c.next=h.next,h.next=c),o.pending=c}function OE(o,c,h){if((h&4194048)!==0){var y=c.lanes;y&=o.pendingLanes,h|=y,c.lanes=h,Np(o,h)}}var of={readContext:lr,use:em,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useLayoutEffect:jn,useInsertionEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useSyncExternalStore:jn,useId:jn,useHostTransitionStatus:jn,useFormState:jn,useActionState:jn,useOptimistic:jn,useMemoCache:jn,useCacheRefresh:jn};of.useEffectEvent=jn;var EE={readContext:lr,use:em,useCallback:function(o,c){return _r().memoizedState=[o,c===void 0?null:c],o},useContext:lr,useEffect:fE,useImperativeHandle:function(o,c,h){h=h!=null?h.concat([o]):null,nm(4194308,4,gE.bind(null,c,o),h)},useLayoutEffect:function(o,c){return nm(4194308,4,o,c)},useInsertionEffect:function(o,c){nm(4,2,o,c)},useMemo:function(o,c){var h=_r();c=c===void 0?null:c;var y=o();if(vl){Kt(!0);try{o()}finally{Kt(!1)}}return h.memoizedState=[y,c],y},useReducer:function(o,c,h){var y=_r();if(h!==void 0){var w=h(c);if(vl){Kt(!0);try{h(c)}finally{Kt(!1)}}}else w=c;return y.memoizedState=y.baseState=w,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:w},y.queue=o,o=o.dispatch=uH.bind(null,st,o),[y.memoizedState,o]},useRef:function(o){var c=_r();return o={current:o},c.memoizedState=o},useState:function(o){o=Q0(o);var c=o.queue,h=CE.bind(null,st,c);return c.dispatch=h,[o.memoizedState,h]},useDebugValue:Z0,useDeferredValue:function(o,c){var h=_r();return X0(h,o,c)},useTransition:function(){var o=Q0(!1);return o=wE.bind(null,st,o.queue,!0,!1),_r().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,c,h){var y=st,w=_r();if(wt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),Vt===null)throw Error(r(349));(xt&127)!==0||YO(y,c,h)}w.memoizedState=h;var N={value:h,getSnapshot:c};return w.queue=N,fE(XO.bind(null,y,N,o),[o]),y.flags|=2048,Wc(9,{destroy:void 0},ZO.bind(null,y,N,h,c),null),h},useId:function(){var o=_r(),c=Vt.identifierPrefix;if(wt){var h=Na,y=Sa;h=(y&~(1<<32-de(y)-1)).toString(32)+h,c="_"+c+"R_"+h,h=Xp++,0<h&&(c+="H"+h.toString(32)),c+="_"}else h=rH++,c="_"+c+"r_"+h.toString(32)+"_";return o.memoizedState=c},useHostTransitionStatus:eb,useFormState:oE,useActionState:oE,useOptimistic:function(o){var c=_r();c.memoizedState=c.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=h,c=tb.bind(null,st,!0,h),h.dispatch=c,[o,c]},useMemoCache:K0,useCacheRefresh:function(){return _r().memoizedState=cH.bind(null,st)},useEffectEvent:function(o){var c=_r(),h={impl:o};return c.memoizedState=h,function(){if((zt&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},nb={readContext:lr,use:em,useCallback:vE,useContext:lr,useEffect:Y0,useImperativeHandle:yE,useInsertionEffect:pE,useLayoutEffect:mE,useMemo:xE,useReducer:tm,useRef:dE,useState:function(){return tm(cs)},useDebugValue:Z0,useDeferredValue:function(o,c){var h=Pn();return bE(h,$t.memoizedState,o,c)},useTransition:function(){var o=tm(cs)[0],c=Pn().memoizedState;return[typeof o=="boolean"?o:af(o),c]},useSyncExternalStore:WO,useId:NE,useHostTransitionStatus:eb,useFormState:lE,useActionState:lE,useOptimistic:function(o,c){var h=Pn();return tE(h,$t,o,c)},useMemoCache:K0,useCacheRefresh:kE};nb.useEffectEvent=hE;var _E={readContext:lr,use:em,useCallback:vE,useContext:lr,useEffect:Y0,useImperativeHandle:yE,useInsertionEffect:pE,useLayoutEffect:mE,useMemo:xE,useReducer:V0,useRef:dE,useState:function(){return V0(cs)},useDebugValue:Z0,useDeferredValue:function(o,c){var h=Pn();return $t===null?X0(h,o,c):bE(h,$t.memoizedState,o,c)},useTransition:function(){var o=V0(cs)[0],c=Pn().memoizedState;return[typeof o=="boolean"?o:af(o),c]},useSyncExternalStore:WO,useId:NE,useHostTransitionStatus:eb,useFormState:uE,useActionState:uE,useOptimistic:function(o,c){var h=Pn();return $t!==null?tE(h,$t,o,c):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:K0,useCacheRefresh:kE};_E.useEffectEvent=hE;function rb(o,c,h,y){c=o.memoizedState,h=h(y,c),h=h==null?c:m({},c,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var ib={enqueueSetState:function(o,c,h){o=o._reactInternals;var y=ui(),w=no(y);w.payload=c,h!=null&&(w.callback=h),c=ro(o,w,y),c!==null&&(Gr(c,o,y),ef(c,o,y))},enqueueReplaceState:function(o,c,h){o=o._reactInternals;var y=ui(),w=no(y);w.tag=1,w.payload=c,h!=null&&(w.callback=h),c=ro(o,w,y),c!==null&&(Gr(c,o,y),ef(c,o,y))},enqueueForceUpdate:function(o,c){o=o._reactInternals;var h=ui(),y=no(h);y.tag=2,c!=null&&(y.callback=c),c=ro(o,y,h),c!==null&&(Gr(c,o,h),ef(c,o,h))}};function zE(o,c,h,y,w,N,z){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(y,N,z):c.prototype&&c.prototype.isPureReactComponent?!Gd(h,y)||!Gd(w,N):!0}function PE(o,c,h,y){o=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(h,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(h,y),c.state!==o&&ib.enqueueReplaceState(c,c.state,null)}function xl(o,c){var h=c;if("ref"in c){h={};for(var y in c)y!=="ref"&&(h[y]=c[y])}if(o=o.defaultProps){h===c&&(h=m({},h));for(var w in o)h[w]===void 0&&(h[w]=o[w])}return h}function TE(o){Mp(o)}function RE(o){console.error(o)}function DE(o){Mp(o)}function am(o,c){try{var h=o.onUncaughtError;h(c.value,{componentStack:c.stack})}catch(y){setTimeout(function(){throw y})}}function ME(o,c,h){try{var y=o.onCaughtError;y(h.value,{componentStack:h.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function ab(o,c,h){return h=no(h),h.tag=3,h.payload={element:null},h.callback=function(){am(o,c)},h}function IE(o){return o=no(o),o.tag=3,o}function LE(o,c,h,y){var w=h.type.getDerivedStateFromError;if(typeof w=="function"){var N=y.value;o.payload=function(){return w(N)},o.callback=function(){ME(c,h,y)}}var z=h.stateNode;z!==null&&typeof z.componentDidCatch=="function"&&(o.callback=function(){ME(c,h,y),typeof w!="function"&&(co===null?co=new Set([this]):co.add(this));var L=y.stack;this.componentDidCatch(y.value,{componentStack:L!==null?L:""})})}function dH(o,c,h,y,w){if(h.flags|=32768,y!==null&&typeof y=="object"&&typeof y.then=="function"){if(c=h.alternate,c!==null&&Uc(c,h,w,!0),h=si.current,h!==null){switch(h.tag){case 31:case 13:return _i===null?ym():h.alternate===null&&Sn===0&&(Sn=3),h.flags&=-257,h.flags|=65536,h.lanes=w,y===Gp?h.flags|=16384:(c=h.updateQueue,c===null?h.updateQueue=new Set([y]):c.add(y),_b(o,y,w)),!1;case 22:return h.flags|=65536,y===Gp?h.flags|=16384:(c=h.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([y])},h.updateQueue=c):(h=c.retryQueue,h===null?c.retryQueue=new Set([y]):h.add(y)),_b(o,y,w)),!1}throw Error(r(435,h.tag))}return _b(o,y,w),ym(),!1}if(wt)return c=si.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=w,y!==N0&&(o=Error(r(422),{cause:y}),Wd(Ci(o,h)))):(y!==N0&&(c=Error(r(423),{cause:y}),Wd(Ci(c,h))),o=o.current.alternate,o.flags|=65536,w&=-w,o.lanes|=w,y=Ci(y,h),w=ab(o.stateNode,y,w),D0(o,w),Sn!==4&&(Sn=2)),!1;var N=Error(r(520),{cause:y});if(N=Ci(N,h),mf===null?mf=[N]:mf.push(N),Sn!==4&&(Sn=2),c===null)return!0;y=Ci(y,h),h=c;do{switch(h.tag){case 3:return h.flags|=65536,o=w&-w,h.lanes|=o,o=ab(h.stateNode,y,o),D0(h,o),!1;case 1:if(c=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(co===null||!co.has(N))))return h.flags|=65536,w&=-w,h.lanes|=w,w=IE(w),LE(w,o,h,y),D0(h,w),!1}h=h.return}while(h!==null);return!1}var sb=Error(r(461)),Ln=!1;function cr(o,c,h,y){c.child=o===null?qO(c,null,h,y):yl(c,o.child,h,y)}function $E(o,c,h,y,w){h=h.render;var N=c.ref;if("ref"in y){var z={};for(var L in y)L!=="ref"&&(z[L]=y[L])}else z=y;return hl(c),y=U0(o,c,h,z,N,w),L=q0(),o!==null&&!Ln?(F0(o,c,w),us(o,c,w)):(wt&&L&&j0(c),c.flags|=1,cr(o,c,y,w),c.child)}function BE(o,c,h,y,w){if(o===null){var N=h.type;return typeof N=="function"&&!x0(N)&&N.defaultProps===void 0&&h.compare===null?(c.tag=15,c.type=N,UE(o,c,N,y,w)):(o=Bp(h.type,null,y,c,c.mode,w),o.ref=c.ref,o.return=c,c.child=o)}if(N=o.child,!pb(o,w)){var z=N.memoizedProps;if(h=h.compare,h=h!==null?h:Gd,h(z,y)&&o.ref===c.ref)return us(o,c,w)}return c.flags|=1,o=is(N,y),o.ref=c.ref,o.return=c,c.child=o}function UE(o,c,h,y,w){if(o!==null){var N=o.memoizedProps;if(Gd(N,y)&&o.ref===c.ref)if(Ln=!1,c.pendingProps=y=N,pb(o,w))(o.flags&131072)!==0&&(Ln=!0);else return c.lanes=o.lanes,us(o,c,w)}return ob(o,c,h,y,w)}function qE(o,c,h,y){var w=y.children,N=o!==null?o.memoizedState:null;if(o===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),y.mode==="hidden"){if((c.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,o!==null){for(y=c.child=o.child,w=0;y!==null;)w=w|y.lanes|y.childLanes,y=y.sibling;y=w&~N}else y=0,c.child=null;return FE(o,c,N,h,y)}if((h&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},o!==null&&Hp(c,N!==null?N.cachePool:null),N!==null?KO(c,N):I0(),GO(c);else return y=c.lanes=536870912,FE(o,c,N!==null?N.baseLanes|h:h,h,y)}else N!==null?(Hp(c,N.cachePool),KO(c,N),ao(),c.memoizedState=null):(o!==null&&Hp(c,null),I0(),ao());return cr(o,c,w,h),c.child}function lf(o,c){return o!==null&&o.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function FE(o,c,h,y,w){var N=z0();return N=N===null?null:{parent:Mn._currentValue,pool:N},c.memoizedState={baseLanes:h,cachePool:N},o!==null&&Hp(c,null),I0(),GO(c),o!==null&&Uc(o,c,y,!0),c.childLanes=w,null}function sm(o,c){return c=lm({mode:c.mode,children:c.children},o.mode),c.ref=o.ref,o.child=c,c.return=o,c}function HE(o,c,h){return yl(c,o.child,null,h),o=sm(c,c.pendingProps),o.flags|=2,oi(c),c.memoizedState=null,o}function fH(o,c,h){var y=c.pendingProps,w=(c.flags&128)!==0;if(c.flags&=-129,o===null){if(wt){if(y.mode==="hidden")return o=sm(c,y),c.lanes=536870912,lf(null,o);if($0(c),(o=nn)?(o=nz(o,Ei),o=o!==null&&o.data==="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Zs!==null?{id:Sa,overflow:Na}:null,retryLane:536870912,hydrationErrors:null},h=AO(o),h.return=c,c.child=h,or=c,nn=null)):o=null,o===null)throw Js(c);return c.lanes=536870912,null}return sm(c,y)}var N=o.memoizedState;if(N!==null){var z=N.dehydrated;if($0(c),w)if(c.flags&256)c.flags&=-257,c=HE(o,c,h);else if(c.memoizedState!==null)c.child=o.child,c.flags|=128,c=null;else throw Error(r(558));else if(Ln||Uc(o,c,h,!1),w=(h&o.childLanes)!==0,Ln||w){if(y=Vt,y!==null&&(z=kp(y,h),z!==0&&z!==N.retryLane))throw N.retryLane=z,cl(o,z),Gr(y,o,z),sb;ym(),c=HE(o,c,h)}else o=N.treeContext,nn=zi(z.nextSibling),or=c,wt=!0,Xs=null,Ei=!1,o!==null&&_O(c,o),c=sm(c,y),c.flags|=4096;return c}return o=is(o.child,{mode:y.mode,children:y.children}),o.ref=c.ref,c.child=o,o.return=c,o}function om(o,c){var h=c.ref;if(h===null)o!==null&&o.ref!==null&&(c.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(c.flags|=4194816)}}function ob(o,c,h,y,w){return hl(c),h=U0(o,c,h,y,void 0,w),y=q0(),o!==null&&!Ln?(F0(o,c,w),us(o,c,w)):(wt&&y&&j0(c),c.flags|=1,cr(o,c,h,w),c.child)}function KE(o,c,h,y,w,N){return hl(c),c.updateQueue=null,h=QO(c,y,h,w),VO(o),y=q0(),o!==null&&!Ln?(F0(o,c,N),us(o,c,N)):(wt&&y&&j0(c),c.flags|=1,cr(o,c,h,N),c.child)}function GE(o,c,h,y,w){if(hl(c),c.stateNode===null){var N=Ic,z=h.contextType;typeof z=="object"&&z!==null&&(N=lr(z)),N=new h(y,N),c.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=ib,c.stateNode=N,N._reactInternals=c,N=c.stateNode,N.props=y,N.state=c.memoizedState,N.refs={},T0(c),z=h.contextType,N.context=typeof z=="object"&&z!==null?lr(z):Ic,N.state=c.memoizedState,z=h.getDerivedStateFromProps,typeof z=="function"&&(rb(c,h,z,y),N.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(z=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),z!==N.state&&ib.enqueueReplaceState(N,N.state,null),nf(c,y,N,w),tf(),N.state=c.memoizedState),typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!0}else if(o===null){N=c.stateNode;var L=c.memoizedProps,K=xl(h,L);N.props=K;var ae=N.context,me=h.contextType;z=Ic,typeof me=="object"&&me!==null&&(z=lr(me));var we=h.getDerivedStateFromProps;me=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function",L=c.pendingProps!==L,me||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(L||ae!==z)&&PE(c,N,y,z),to=!1;var le=c.memoizedState;N.state=le,nf(c,y,N,w),tf(),ae=c.memoizedState,L||le!==ae||to?(typeof we=="function"&&(rb(c,h,we,y),ae=c.memoizedState),(K=to||zE(c,h,K,y,le,ae,z))?(me||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"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=ae),N.props=y,N.state=ae,N.context=z,y=K):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{N=c.stateNode,R0(o,c),z=c.memoizedProps,me=xl(h,z),N.props=me,we=c.pendingProps,le=N.context,ae=h.contextType,K=Ic,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"||(z!==we||le!==K)&&PE(c,N,y,K),to=!1,le=c.memoizedState,N.state=le,nf(c,y,N,w),tf();var ue=c.memoizedState;z!==we||le!==ue||to||o!==null&&o.dependencies!==null&&qp(o.dependencies)?(typeof L=="function"&&(rb(c,h,L,y),ue=c.memoizedState),(me=to||zE(c,h,me,y,le,ue,K)||o!==null&&o.dependencies!==null&&qp(o.dependencies))?(ae||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,ue,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,ue,K)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=ue),N.props=y,N.state=ue,N.context=K,y=me):(typeof N.componentDidUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||z===o.memoizedProps&&le===o.memoizedState||(c.flags|=1024),y=!1)}return N=y,om(o,c),y=(c.flags&128)!==0,N||y?(N=c.stateNode,h=y&&typeof h.getDerivedStateFromError!="function"?null:N.render(),c.flags|=1,o!==null&&y?(c.child=yl(c,o.child,null,w),c.child=yl(c,null,h,w)):cr(o,c,h,w),c.memoizedState=N.state,o=c.child):o=us(o,c,w),o}function VE(o,c,h,y){return dl(),c.flags|=256,cr(o,c,h,y),c.child}var lb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cb(o){return{baseLanes:o,cachePool:MO()}}function ub(o,c,h){return o=o!==null?o.childLanes&~h:0,c&&(o|=ci),o}function QE(o,c,h){var y=c.pendingProps,w=!1,N=(c.flags&128)!==0,z;if((z=N)||(z=o!==null&&o.memoizedState===null?!1:(zn.current&2)!==0),z&&(w=!0,c.flags&=-129),z=(c.flags&32)!==0,c.flags&=-33,o===null){if(wt){if(w?io(c):ao(),(o=nn)?(o=nz(o,Ei),o=o!==null&&o.data!=="&"?o:null,o!==null&&(c.memoizedState={dehydrated:o,treeContext:Zs!==null?{id:Sa,overflow:Na}:null,retryLane:536870912,hydrationErrors:null},h=AO(o),h.return=c,c.child=h,or=c,nn=null)):o=null,o===null)throw Js(c);return Gb(o)?c.lanes=32:c.lanes=536870912,null}var L=y.children;return y=y.fallback,w?(ao(),w=c.mode,L=lm({mode:"hidden",children:L},w),y=ul(y,w,h,null),L.return=c,y.return=c,L.sibling=y,c.child=L,y=c.child,y.memoizedState=cb(h),y.childLanes=ub(o,z,h),c.memoizedState=lb,lf(null,y)):(io(c),db(c,L))}var K=o.memoizedState;if(K!==null&&(L=K.dehydrated,L!==null)){if(N)c.flags&256?(io(c),c.flags&=-257,c=fb(o,c,h)):c.memoizedState!==null?(ao(),c.child=o.child,c.flags|=128,c=null):(ao(),L=y.fallback,w=c.mode,y=lm({mode:"visible",children:y.children},w),L=ul(L,w,h,null),L.flags|=2,y.return=c,L.return=c,y.sibling=L,c.child=y,yl(c,o.child,null,h),y=c.child,y.memoizedState=cb(h),y.childLanes=ub(o,z,h),c.memoizedState=lb,c=lf(null,y));else if(io(c),Gb(L)){if(z=L.nextSibling&&L.nextSibling.dataset,z)var ae=z.dgst;z=ae,y=Error(r(419)),y.stack="",y.digest=z,Wd({value:y,source:null,stack:null}),c=fb(o,c,h)}else if(Ln||Uc(o,c,h,!1),z=(h&o.childLanes)!==0,Ln||z){if(z=Vt,z!==null&&(y=kp(z,h),y!==0&&y!==K.retryLane))throw K.retryLane=y,cl(o,y),Gr(z,o,y),sb;Kb(L)||ym(),c=fb(o,c,h)}else Kb(L)?(c.flags|=192,c.child=o.child,c=null):(o=K.treeContext,nn=zi(L.nextSibling),or=c,wt=!0,Xs=null,Ei=!1,o!==null&&_O(c,o),c=db(c,y.children),c.flags|=4096);return c}return w?(ao(),L=y.fallback,w=c.mode,K=o.child,ae=K.sibling,y=is(K,{mode:"hidden",children:y.children}),y.subtreeFlags=K.subtreeFlags&65011712,ae!==null?L=is(ae,L):(L=ul(L,w,h,null),L.flags|=2),L.return=c,y.return=c,y.sibling=L,c.child=y,lf(null,y),y=c.child,L=o.child.memoizedState,L===null?L=cb(h):(w=L.cachePool,w!==null?(K=Mn._currentValue,w=w.parent!==K?{parent:K,pool:K}:w):w=MO(),L={baseLanes:L.baseLanes|h,cachePool:w}),y.memoizedState=L,y.childLanes=ub(o,z,h),c.memoizedState=lb,lf(o.child,y)):(io(c),h=o.child,o=h.sibling,h=is(h,{mode:"visible",children:y.children}),h.return=c,h.sibling=null,o!==null&&(z=c.deletions,z===null?(c.deletions=[o],c.flags|=16):z.push(o)),c.child=h,c.memoizedState=null,h)}function db(o,c){return c=lm({mode:"visible",children:c},o.mode),c.return=o,o.child=c}function lm(o,c){return o=ai(22,o,null,c),o.lanes=0,o}function fb(o,c,h){return yl(c,o.child,null,h),o=db(c,c.pendingProps.children),o.flags|=2,c.memoizedState=null,o}function WE(o,c,h){o.lanes|=c;var y=o.alternate;y!==null&&(y.lanes|=c),A0(o.return,c,h)}function hb(o,c,h,y,w,N){var z=o.memoizedState;z===null?o.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:w,treeForkCount:N}:(z.isBackwards=c,z.rendering=null,z.renderingStartTime=0,z.last=y,z.tail=h,z.tailMode=w,z.treeForkCount=N)}function YE(o,c,h){var y=c.pendingProps,w=y.revealOrder,N=y.tail;y=y.children;var z=zn.current,L=(z&2)!==0;if(L?(z=z&1|2,c.flags|=128):z&=1,D(zn,z),cr(o,c,y,h),y=wt?Qd:0,!L&&o!==null&&(o.flags&128)!==0)e:for(o=c.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&WE(o,h,c);else if(o.tag===19)WE(o,h,c);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===c)break e;for(;o.sibling===null;){if(o.return===null||o.return===c)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(w){case"forwards":for(h=c.child,w=null;h!==null;)o=h.alternate,o!==null&&Yp(o)===null&&(w=h),h=h.sibling;h=w,h===null?(w=c.child,c.child=null):(w=h.sibling,h.sibling=null),hb(c,!1,w,h,N,y);break;case"backwards":case"unstable_legacy-backwards":for(h=null,w=c.child,c.child=null;w!==null;){if(o=w.alternate,o!==null&&Yp(o)===null){c.child=w;break}o=w.sibling,w.sibling=h,h=w,w=o}hb(c,!0,h,null,N,y);break;case"together":hb(c,!1,null,null,void 0,y);break;default:c.memoizedState=null}return c.child}function us(o,c,h){if(o!==null&&(c.dependencies=o.dependencies),lo|=c.lanes,(h&c.childLanes)===0)if(o!==null){if(Uc(o,c,h,!1),(h&c.childLanes)===0)return null}else return null;if(o!==null&&c.child!==o.child)throw Error(r(153));if(c.child!==null){for(o=c.child,h=is(o,o.pendingProps),c.child=h,h.return=c;o.sibling!==null;)o=o.sibling,h=h.sibling=is(o,o.pendingProps),h.return=c;h.sibling=null}return c.child}function pb(o,c){return(o.lanes&c)!==0?!0:(o=o.dependencies,!!(o!==null&&qp(o)))}function hH(o,c,h){switch(c.tag){case 3:Se(c,c.stateNode.containerInfo),eo(c,Mn,o.memoizedState.cache),dl();break;case 27:case 5:pe(c);break;case 4:Se(c,c.stateNode.containerInfo);break;case 10:eo(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,$0(c),null;break;case 13:var y=c.memoizedState;if(y!==null)return y.dehydrated!==null?(io(c),c.flags|=128,null):(h&c.child.childLanes)!==0?QE(o,c,h):(io(c),o=us(o,c,h),o!==null?o.sibling:null);io(c);break;case 19:var w=(o.flags&128)!==0;if(y=(h&c.childLanes)!==0,y||(Uc(o,c,h,!1),y=(h&c.childLanes)!==0),w){if(y)return YE(o,c,h);c.flags|=128}if(w=c.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),D(zn,zn.current),y)break;return null;case 22:return c.lanes=0,qE(o,c,h,c.pendingProps);case 24:eo(c,Mn,o.memoizedState.cache)}return us(o,c,h)}function ZE(o,c,h){if(o!==null)if(o.memoizedProps!==c.pendingProps)Ln=!0;else{if(!pb(o,h)&&(c.flags&128)===0)return Ln=!1,hH(o,c,h);Ln=(o.flags&131072)!==0}else Ln=!1,wt&&(c.flags&1048576)!==0&&EO(c,Qd,c.index);switch(c.lanes=0,c.tag){case 16:e:{var y=c.pendingProps;if(o=ml(c.elementType),c.type=o,typeof o=="function")x0(o)?(y=xl(o,y),c.tag=1,c=GE(null,c,o,y,h)):(c.tag=0,c=ob(null,c,o,y,h));else{if(o!=null){var w=o.$$typeof;if(w===A){c.tag=11,c=$E(null,c,o,y,h);break e}else if(w===_){c.tag=14,c=BE(null,c,o,y,h);break e}}throw c=X(o)||o,Error(r(306,c,""))}}return c;case 0:return ob(o,c,c.type,c.pendingProps,h);case 1:return y=c.type,w=xl(y,c.pendingProps),GE(o,c,y,w,h);case 3:e:{if(Se(c,c.stateNode.containerInfo),o===null)throw Error(r(387));y=c.pendingProps;var N=c.memoizedState;w=N.element,R0(o,c),nf(c,y,null,h);var z=c.memoizedState;if(y=z.cache,eo(c,Mn,y),y!==N.cache&&O0(c,[Mn],h,!0),tf(),y=z.element,N.isDehydrated)if(N={element:y,isDehydrated:!1,cache:z.cache},c.updateQueue.baseState=N,c.memoizedState=N,c.flags&256){c=VE(o,c,y,h);break e}else if(y!==w){w=Ci(Error(r(424)),c),Wd(w),c=VE(o,c,y,h);break e}else for(o=c.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,nn=zi(o.firstChild),or=c,wt=!0,Xs=null,Ei=!0,h=qO(c,null,y,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(dl(),y===w){c=us(o,c,h);break e}cr(o,c,y,h)}c=c.child}return c;case 26:return om(o,c),o===null?(h=lz(c.type,null,c.pendingProps,null))?c.memoizedState=h:wt||(h=c.type,o=c.pendingProps,y=Nm(ne.current).createElement(h),y[tt]=c,y[St]=o,ur(y,h,o),yn(y),c.stateNode=y):c.memoizedState=lz(c.type,o.memoizedProps,c.pendingProps,o.memoizedState),null;case 27:return pe(c),o===null&&wt&&(y=c.stateNode=az(c.type,c.pendingProps,ne.current),or=c,Ei=!0,w=nn,po(c.type)?(Vb=w,nn=zi(y.firstChild)):nn=w),cr(o,c,c.pendingProps.children,h),om(o,c),o===null&&(c.flags|=4194304),c.child;case 5:return o===null&&wt&&((w=y=nn)&&(y=FH(y,c.type,c.pendingProps,Ei),y!==null?(c.stateNode=y,or=c,nn=zi(y.firstChild),Ei=!1,w=!0):w=!1),w||Js(c)),pe(c),w=c.type,N=c.pendingProps,z=o!==null?o.memoizedProps:null,y=N.children,qb(w,N)?y=null:z!==null&&qb(w,z)&&(c.flags|=32),c.memoizedState!==null&&(w=U0(o,c,iH,null,null,h),Sf._currentValue=w),om(o,c),cr(o,c,y,h),c.child;case 6:return o===null&&wt&&((o=h=nn)&&(h=HH(h,c.pendingProps,Ei),h!==null?(c.stateNode=h,or=c,nn=null,o=!0):o=!1),o||Js(c)),null;case 13:return QE(o,c,h);case 4:return Se(c,c.stateNode.containerInfo),y=c.pendingProps,o===null?c.child=yl(c,null,y,h):cr(o,c,y,h),c.child;case 11:return $E(o,c,c.type,c.pendingProps,h);case 7:return cr(o,c,c.pendingProps,h),c.child;case 8:return cr(o,c,c.pendingProps.children,h),c.child;case 12:return cr(o,c,c.pendingProps.children,h),c.child;case 10:return y=c.pendingProps,eo(c,c.type,y.value),cr(o,c,y.children,h),c.child;case 9:return w=c.type._context,y=c.pendingProps.children,hl(c),w=lr(w),y=y(w),c.flags|=1,cr(o,c,y,h),c.child;case 14:return BE(o,c,c.type,c.pendingProps,h);case 15:return UE(o,c,c.type,c.pendingProps,h);case 19:return YE(o,c,h);case 31:return fH(o,c,h);case 22:return qE(o,c,h,c.pendingProps);case 24:return hl(c),y=lr(Mn),o===null?(w=z0(),w===null&&(w=Vt,N=E0(),w.pooledCache=N,N.refCount++,N!==null&&(w.pooledCacheLanes|=h),w=N),c.memoizedState={parent:y,cache:w},T0(c),eo(c,Mn,w)):((o.lanes&h)!==0&&(R0(o,c),nf(c,null,null,h),tf()),w=o.memoizedState,N=c.memoizedState,w.parent!==y?(w={parent:y,cache:y},c.memoizedState=w,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=w),eo(c,Mn,y)):(y=N.cache,eo(c,Mn,y),y!==w.cache&&O0(c,[Mn],h,!0))),cr(o,c,c.pendingProps.children,h),c.child;case 29:throw c.pendingProps}throw Error(r(156,c.tag))}function ds(o){o.flags|=4}function mb(o,c,h,y,w){if((c=(o.mode&32)!==0)&&(c=!1),c){if(o.flags|=16777216,(w&335544128)===w)if(o.stateNode.complete)o.flags|=8192;else if(N_())o.flags|=8192;else throw gl=Gp,P0}else o.flags&=-16777217}function XE(o,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!hz(c))if(N_())o.flags|=8192;else throw gl=Gp,P0}function cm(o,c){c!==null&&(o.flags|=4),o.flags&16384&&(c=o.tag!==22?Sp():536870912,o.lanes|=c,Jc|=c)}function cf(o,c){if(!wt)switch(o.tailMode){case"hidden":c=o.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?c||o.tail===null?o.tail=null:o.tail.sibling=null:y.sibling=null}}function rn(o){var c=o.alternate!==null&&o.alternate.child===o.child,h=0,y=0;if(c)for(var w=o.child;w!==null;)h|=w.lanes|w.childLanes,y|=w.subtreeFlags&65011712,y|=w.flags&65011712,w.return=o,w=w.sibling;else for(w=o.child;w!==null;)h|=w.lanes|w.childLanes,y|=w.subtreeFlags,y|=w.flags,w.return=o,w=w.sibling;return o.subtreeFlags|=y,o.childLanes=h,c}function pH(o,c,h){var y=c.pendingProps;switch(S0(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(c),null;case 1:return rn(c),null;case 3:return h=c.stateNode,y=null,o!==null&&(y=o.memoizedState.cache),c.memoizedState.cache!==y&&(c.flags|=2048),os(Mn),ee(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Bc(c)?ds(c):o===null||o.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,k0())),rn(c),null;case 26:var w=c.type,N=c.memoizedState;return o===null?(ds(c),N!==null?(rn(c),XE(c,N)):(rn(c),mb(c,w,null,y,h))):N?N!==o.memoizedState?(ds(c),rn(c),XE(c,N)):(rn(c),c.flags&=-16777217):(o=o.memoizedProps,o!==y&&ds(c),rn(c),mb(c,w,o,y,h)),null;case 27:if(Ee(c),h=ne.current,w=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&ds(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return rn(c),null}o=G.current,Bc(c)?zO(c):(o=az(w,y,h),c.stateNode=o,ds(c))}return rn(c),null;case 5:if(Ee(c),w=c.type,o!==null&&c.stateNode!=null)o.memoizedProps!==y&&ds(c);else{if(!y){if(c.stateNode===null)throw Error(r(166));return rn(c),null}if(N=G.current,Bc(c))zO(c);else{var z=Nm(ne.current);switch(N){case 1:N=z.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:N=z.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":N=z.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":N=z.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":N=z.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof y.is=="string"?z.createElement("select",{is:y.is}):z.createElement("select"),y.multiple?N.multiple=!0:y.size&&(N.size=y.size);break;default:N=typeof y.is=="string"?z.createElement(w,{is:y.is}):z.createElement(w)}}N[tt]=c,N[St]=y;e:for(z=c.child;z!==null;){if(z.tag===5||z.tag===6)N.appendChild(z.stateNode);else if(z.tag!==4&&z.tag!==27&&z.child!==null){z.child.return=z,z=z.child;continue}if(z===c)break e;for(;z.sibling===null;){if(z.return===null||z.return===c)break e;z=z.return}z.sibling.return=z.return,z=z.sibling}c.stateNode=N;e:switch(ur(N,w,y),w){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}y&&ds(c)}}return rn(c),mb(c,c.type,o===null?null:o.memoizedProps,c.pendingProps,h),null;case 6:if(o&&c.stateNode!=null)o.memoizedProps!==y&&ds(c);else{if(typeof y!="string"&&c.stateNode===null)throw Error(r(166));if(o=ne.current,Bc(c)){if(o=c.stateNode,h=c.memoizedProps,y=null,w=or,w!==null)switch(w.tag){case 27:case 5:y=w.memoizedProps}o[tt]=c,o=!!(o.nodeValue===h||y!==null&&y.suppressHydrationWarning===!0||Q_(o.nodeValue,h)),o||Js(c,!0)}else o=Nm(o).createTextNode(y),o[tt]=c,c.stateNode=o}return rn(c),null;case 31:if(h=c.memoizedState,o===null||o.memoizedState!==null){if(y=Bc(c),h!==null){if(o===null){if(!y)throw Error(r(318));if(o=c.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[tt]=c}else dl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;rn(c),o=!1}else h=k0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return c.flags&256?(oi(c),c):(oi(c),null);if((c.flags&128)!==0)throw Error(r(558))}return rn(c),null;case 13:if(y=c.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(w=Bc(c),y!==null&&y.dehydrated!==null){if(o===null){if(!w)throw Error(r(318));if(w=c.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(r(317));w[tt]=c}else dl(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;rn(c),w=!1}else w=k0(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=w),w=!0;if(!w)return c.flags&256?(oi(c),c):(oi(c),null)}return oi(c),(c.flags&128)!==0?(c.lanes=h,c):(h=y!==null,o=o!==null&&o.memoizedState!==null,h&&(y=c.child,w=null,y.alternate!==null&&y.alternate.memoizedState!==null&&y.alternate.memoizedState.cachePool!==null&&(w=y.alternate.memoizedState.cachePool.pool),N=null,y.memoizedState!==null&&y.memoizedState.cachePool!==null&&(N=y.memoizedState.cachePool.pool),N!==w&&(y.flags|=2048)),h!==o&&h&&(c.child.flags|=8192),cm(c,c.updateQueue),rn(c),null);case 4:return ee(),o===null&&Ib(c.stateNode.containerInfo),rn(c),null;case 10:return os(c.type),rn(c),null;case 19:if(q(zn),y=c.memoizedState,y===null)return rn(c),null;if(w=(c.flags&128)!==0,N=y.rendering,N===null)if(w)cf(y,!1);else{if(Sn!==0||o!==null&&(o.flags&128)!==0)for(o=c.child;o!==null;){if(N=Yp(o),N!==null){for(c.flags|=128,cf(y,!1),o=N.updateQueue,c.updateQueue=o,cm(c,o),c.subtreeFlags=0,o=h,h=c.child;h!==null;)CO(h,o),h=h.sibling;return D(zn,zn.current&1|2),wt&&as(c,y.treeForkCount),c.child}o=o.sibling}y.tail!==null&&mt()>pm&&(c.flags|=128,w=!0,cf(y,!1),c.lanes=4194304)}else{if(!w)if(o=Yp(N),o!==null){if(c.flags|=128,w=!0,o=o.updateQueue,c.updateQueue=o,cm(c,o),cf(y,!0),y.tail===null&&y.tailMode==="hidden"&&!N.alternate&&!wt)return rn(c),null}else 2*mt()-y.renderingStartTime>pm&&h!==536870912&&(c.flags|=128,w=!0,cf(y,!1),c.lanes=4194304);y.isBackwards?(N.sibling=c.child,c.child=N):(o=y.last,o!==null?o.sibling=N:c.child=N,y.last=N)}return y.tail!==null?(o=y.tail,y.rendering=o,y.tail=o.sibling,y.renderingStartTime=mt(),o.sibling=null,h=zn.current,D(zn,w?h&1|2:h&1),wt&&as(c,y.treeForkCount),o):(rn(c),null);case 22:case 23:return oi(c),L0(),y=c.memoizedState!==null,o!==null?o.memoizedState!==null!==y&&(c.flags|=8192):y&&(c.flags|=8192),y?(h&536870912)!==0&&(c.flags&128)===0&&(rn(c),c.subtreeFlags&6&&(c.flags|=8192)):rn(c),h=c.updateQueue,h!==null&&cm(c,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),y=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),y!==h&&(c.flags|=2048),o!==null&&q(pl),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),c.memoizedState.cache!==h&&(c.flags|=2048),os(Mn),rn(c),null;case 25:return null;case 30:return null}throw Error(r(156,c.tag))}function mH(o,c){switch(S0(c),c.tag){case 1:return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return os(Mn),ee(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 26:case 27:case 5:return Ee(c),null;case 31:if(c.memoizedState!==null){if(oi(c),c.alternate===null)throw Error(r(340));dl()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 13:if(oi(c),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));dl()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return q(zn),null;case 4:return ee(),null;case 10:return os(c.type),null;case 22:case 23:return oi(c),L0(),o!==null&&q(pl),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 24:return os(Mn),null;case 25:return null;default:return null}}function JE(o,c){switch(S0(c),c.tag){case 3:os(Mn),ee();break;case 26:case 27:case 5:Ee(c);break;case 4:ee();break;case 31:c.memoizedState!==null&&oi(c);break;case 13:oi(c);break;case 19:q(zn);break;case 10:os(c.type);break;case 22:case 23:oi(c),L0(),o!==null&&q(pl);break;case 24:os(Mn)}}function uf(o,c){try{var h=c.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var w=y.next;h=w;do{if((h.tag&o)===o){y=void 0;var N=h.create,z=h.inst;y=N(),z.destroy=y}h=h.next}while(h!==w)}}catch(L){It(c,c.return,L)}}function so(o,c,h){try{var y=c.updateQueue,w=y!==null?y.lastEffect:null;if(w!==null){var N=w.next;y=N;do{if((y.tag&o)===o){var z=y.inst,L=z.destroy;if(L!==void 0){z.destroy=void 0,w=c;var K=h,ae=L;try{ae()}catch(me){It(w,K,me)}}}y=y.next}while(y!==N)}}catch(me){It(c,c.return,me)}}function e_(o){var c=o.updateQueue;if(c!==null){var h=o.stateNode;try{HO(c,h)}catch(y){It(o,o.return,y)}}}function t_(o,c,h){h.props=xl(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(y){It(o,c,y)}}function df(o,c){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var y=o.stateNode;break;case 30:y=o.stateNode;break;default:y=o.stateNode}typeof h=="function"?o.refCleanup=h(y):h.current=y}}catch(w){It(o,c,w)}}function ka(o,c){var h=o.ref,y=o.refCleanup;if(h!==null)if(typeof y=="function")try{y()}catch(w){It(o,c,w)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(w){It(o,c,w)}else h.current=null}function n_(o){var c=o.type,h=o.memoizedProps,y=o.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":h.autoFocus&&y.focus();break e;case"img":h.src?y.src=h.src:h.srcSet&&(y.srcset=h.srcSet)}}catch(w){It(o,o.return,w)}}function gb(o,c,h){try{var y=o.stateNode;IH(y,o.type,h,c),y[St]=c}catch(w){It(o,o.return,w)}}function r_(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&po(o.type)||o.tag===4}function yb(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||r_(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&po(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function vb(o,c,h){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,c):(c=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,c.appendChild(o),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ns));else if(y!==4&&(y===27&&po(o.type)&&(h=o.stateNode,c=null),o=o.child,o!==null))for(vb(o,c,h),o=o.sibling;o!==null;)vb(o,c,h),o=o.sibling}function um(o,c,h){var y=o.tag;if(y===5||y===6)o=o.stateNode,c?h.insertBefore(o,c):h.appendChild(o);else if(y!==4&&(y===27&&po(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(um(o,c,h),o=o.sibling;o!==null;)um(o,c,h),o=o.sibling}function i_(o){var c=o.stateNode,h=o.memoizedProps;try{for(var y=o.type,w=c.attributes;w.length;)c.removeAttributeNode(w[0]);ur(c,y,h),c[tt]=o,c[St]=h}catch(N){It(o,o.return,N)}}var fs=!1,$n=!1,xb=!1,a_=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function gH(o,c){if(o=o.containerInfo,Bb=zm,o=yO(o),f0(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var w=y.anchorOffset,N=y.focusNode;y=y.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var z=0,L=-1,K=-1,ae=0,me=0,we=o,le=null;t:for(;;){for(var ue;we!==h||w!==0&&we.nodeType!==3||(L=z+w),we!==N||y!==0&&we.nodeType!==3||(K=z+y),we.nodeType===3&&(z+=we.nodeValue.length),(ue=we.firstChild)!==null;)le=we,we=ue;for(;;){if(we===o)break t;if(le===h&&++ae===w&&(L=z),le===N&&++me===y&&(K=z),(ue=we.nextSibling)!==null)break;we=le,le=we.parentNode}we=ue}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:o,selectionRange:h},zm=!1,Xn=c;Xn!==null;)if(c=Xn,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,Xn=o;else for(;Xn!==null;){switch(c=Xn,N=c.alternate,o=c.flags,c.tag){case 0:if((o&4)!==0&&(o=c.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)w=o[h],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&N!==null){o=void 0,h=c,w=N.memoizedProps,N=N.memoizedState,y=h.stateNode;try{var De=xl(h.type,w);o=y.getSnapshotBeforeUpdate(De,N),y.__reactInternalSnapshotBeforeUpdate=o}catch(Ye){It(h,h.return,Ye)}}break;case 3:if((o&1024)!==0){if(o=c.stateNode.containerInfo,h=o.nodeType,h===9)Hb(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":Hb(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=c.sibling,o!==null){o.return=c.return,Xn=o;break}Xn=c.return}}function s_(o,c,h){var y=h.flags;switch(h.tag){case 0:case 11:case 15:ps(o,h),y&4&&uf(5,h);break;case 1:if(ps(o,h),y&4)if(o=h.stateNode,c===null)try{o.componentDidMount()}catch(z){It(h,h.return,z)}else{var w=xl(h.type,c.memoizedProps);c=c.memoizedState;try{o.componentDidUpdate(w,c,o.__reactInternalSnapshotBeforeUpdate)}catch(z){It(h,h.return,z)}}y&64&&e_(h),y&512&&df(h,h.return);break;case 3:if(ps(o,h),y&64&&(o=h.updateQueue,o!==null)){if(c=null,h.child!==null)switch(h.child.tag){case 27:case 5:c=h.child.stateNode;break;case 1:c=h.child.stateNode}try{HO(o,c)}catch(z){It(h,h.return,z)}}break;case 27:c===null&&y&4&&i_(h);case 26:case 5:ps(o,h),c===null&&y&4&&n_(h),y&512&&df(h,h.return);break;case 12:ps(o,h);break;case 31:ps(o,h),y&4&&c_(o,h);break;case 13:ps(o,h),y&4&&u_(o,h),y&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=kH.bind(null,h),KH(o,h))));break;case 22:if(y=h.memoizedState!==null||fs,!y){c=c!==null&&c.memoizedState!==null||$n,w=fs;var N=$n;fs=y,($n=c)&&!N?ms(o,h,(h.subtreeFlags&8772)!==0):ps(o,h),fs=w,$n=N}break;case 30:break;default:ps(o,h)}}function o_(o){var c=o.alternate;c!==null&&(o.alternate=null,o_(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&ja(c)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var un=null,qr=!1;function hs(o,c,h){for(h=h.child;h!==null;)l_(o,c,h),h=h.sibling}function l_(o,c,h){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(gn,h)}catch{}switch(h.tag){case 26:$n||ka(h,c),hs(o,c,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:$n||ka(h,c);var y=un,w=qr;po(h.type)&&(un=h.stateNode,qr=!1),hs(o,c,h),bf(h.stateNode),un=y,qr=w;break;case 5:$n||ka(h,c);case 6:if(y=un,w=qr,un=null,hs(o,c,h),un=y,qr=w,un!==null)if(qr)try{(un.nodeType===9?un.body:un.nodeName==="HTML"?un.ownerDocument.body:un).removeChild(h.stateNode)}catch(N){It(h,c,N)}else try{un.removeChild(h.stateNode)}catch(N){It(h,c,N)}break;case 18:un!==null&&(qr?(o=un,ez(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),ou(o)):ez(un,h.stateNode));break;case 4:y=un,w=qr,un=h.stateNode.containerInfo,qr=!0,hs(o,c,h),un=y,qr=w;break;case 0:case 11:case 14:case 15:so(2,h,c),$n||so(4,h,c),hs(o,c,h);break;case 1:$n||(ka(h,c),y=h.stateNode,typeof y.componentWillUnmount=="function"&&t_(h,c,y)),hs(o,c,h);break;case 21:hs(o,c,h);break;case 22:$n=(y=$n)||h.memoizedState!==null,hs(o,c,h),$n=y;break;default:hs(o,c,h)}}function c_(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{ou(o)}catch(h){It(c,c.return,h)}}}function u_(o,c){if(c.memoizedState===null&&(o=c.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{ou(o)}catch(h){It(c,c.return,h)}}function yH(o){switch(o.tag){case 31:case 13:case 19:var c=o.stateNode;return c===null&&(c=o.stateNode=new a_),c;case 22:return o=o.stateNode,c=o._retryCache,c===null&&(c=o._retryCache=new a_),c;default:throw Error(r(435,o.tag))}}function dm(o,c){var h=yH(o);c.forEach(function(y){if(!h.has(y)){h.add(y);var w=CH.bind(null,o,y);y.then(w,w)}})}function Fr(o,c){var h=c.deletions;if(h!==null)for(var y=0;y<h.length;y++){var w=h[y],N=o,z=c,L=z;e:for(;L!==null;){switch(L.tag){case 27:if(po(L.type)){un=L.stateNode,qr=!1;break e}break;case 5:un=L.stateNode,qr=!1;break e;case 3:case 4:un=L.stateNode.containerInfo,qr=!0;break e}L=L.return}if(un===null)throw Error(r(160));l_(N,z,w),un=null,qr=!1,N=w.alternate,N!==null&&(N.return=null),w.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)d_(c,o),c=c.sibling}var ta=null;function d_(o,c){var h=o.alternate,y=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Fr(c,o),Hr(o),y&4&&(so(3,o,o.return),uf(3,o),so(5,o,o.return));break;case 1:Fr(c,o),Hr(o),y&512&&($n||h===null||ka(h,h.return)),y&64&&fs&&(o=o.updateQueue,o!==null&&(y=o.callbacks,y!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?y:h.concat(y))));break;case 26:var w=ta;if(Fr(c,o),Hr(o),y&512&&($n||h===null||ka(h,h.return)),y&4){var N=h!==null?h.memoizedState:null;if(y=o.memoizedState,h===null)if(y===null)if(o.stateNode===null){e:{y=o.type,h=o.memoizedProps,w=w.ownerDocument||w;t:switch(y){case"title":N=w.getElementsByTagName("title")[0],(!N||N[rl]||N[tt]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=w.createElement(y),w.head.insertBefore(N,w.querySelector("head > title"))),ur(N,y,h),N[tt]=o,yn(N),y=N;break e;case"link":var z=dz("link","href",w).get(y+(h.href||""));if(z){for(var L=0;L<z.length;L++)if(N=z[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)){z.splice(L,1);break t}}N=w.createElement(y),ur(N,y,h),w.head.appendChild(N);break;case"meta":if(z=dz("meta","content",w).get(y+(h.content||""))){for(L=0;L<z.length;L++)if(N=z[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)){z.splice(L,1);break t}}N=w.createElement(y),ur(N,y,h),w.head.appendChild(N);break;default:throw Error(r(468,y))}N[tt]=o,yn(N),y=N}o.stateNode=y}else fz(w,o.type,o.stateNode);else o.stateNode=uz(w,y,o.memoizedProps);else N!==y?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,y===null?fz(w,o.type,o.stateNode):uz(w,y,o.memoizedProps)):y===null&&o.stateNode!==null&&gb(o,o.memoizedProps,h.memoizedProps)}break;case 27:Fr(c,o),Hr(o),y&512&&($n||h===null||ka(h,h.return)),h!==null&&y&4&&gb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Fr(c,o),Hr(o),y&512&&($n||h===null||ka(h,h.return)),o.flags&32){w=o.stateNode;try{_c(w,"")}catch(De){It(o,o.return,De)}}y&4&&o.stateNode!=null&&(w=o.memoizedProps,gb(o,w,h!==null?h.memoizedProps:w)),y&1024&&(xb=!0);break;case 6:if(Fr(c,o),Hr(o),y&4){if(o.stateNode===null)throw Error(r(162));y=o.memoizedProps,h=o.stateNode;try{h.nodeValue=y}catch(De){It(o,o.return,De)}}break;case 3:if(Am=null,w=ta,ta=km(c.containerInfo),Fr(c,o),ta=w,Hr(o),y&4&&h!==null&&h.memoizedState.isDehydrated)try{ou(c.containerInfo)}catch(De){It(o,o.return,De)}xb&&(xb=!1,f_(o));break;case 4:y=ta,ta=km(o.stateNode.containerInfo),Fr(c,o),Hr(o),ta=y;break;case 12:Fr(c,o),Hr(o);break;case 31:Fr(c,o),Hr(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,dm(o,y)));break;case 13:Fr(c,o),Hr(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(hm=mt()),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,dm(o,y)));break;case 22:w=o.memoizedState!==null;var K=h!==null&&h.memoizedState!==null,ae=fs,me=$n;if(fs=ae||w,$n=me||K,Fr(c,o),$n=me,fs=ae,Hr(o),y&8192)e:for(c=o.stateNode,c._visibility=w?c._visibility&-2:c._visibility|1,w&&(h===null||K||fs||$n||bl(o)),h=null,c=o;;){if(c.tag===5||c.tag===26){if(h===null){K=h=c;try{if(N=K.stateNode,w)z=N.style,typeof z.setProperty=="function"?z.setProperty("display","none","important"):z.display="none";else{L=K.stateNode;var we=K.memoizedProps.style,le=we!=null&&we.hasOwnProperty("display")?we.display:null;L.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(De){It(K,K.return,De)}}}else if(c.tag===6){if(h===null){K=c;try{K.stateNode.nodeValue=w?"":K.memoizedProps}catch(De){It(K,K.return,De)}}}else if(c.tag===18){if(h===null){K=c;try{var ue=K.stateNode;w?tz(ue,!0):tz(K.stateNode,!1)}catch(De){It(K,K.return,De)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===o)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break e;for(;c.sibling===null;){if(c.return===null||c.return===o)break e;h===c&&(h=null),c=c.return}h===c&&(h=null),c.sibling.return=c.return,c=c.sibling}y&4&&(y=o.updateQueue,y!==null&&(h=y.retryQueue,h!==null&&(y.retryQueue=null,dm(o,h))));break;case 19:Fr(c,o),Hr(o),y&4&&(y=o.updateQueue,y!==null&&(o.updateQueue=null,dm(o,y)));break;case 30:break;case 21:break;default:Fr(c,o),Hr(o)}}function Hr(o){var c=o.flags;if(c&2){try{for(var h,y=o.return;y!==null;){if(r_(y)){h=y;break}y=y.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var w=h.stateNode,N=yb(o);um(o,N,w);break;case 5:var z=h.stateNode;h.flags&32&&(_c(z,""),h.flags&=-33);var L=yb(o);um(o,L,z);break;case 3:case 4:var K=h.stateNode.containerInfo,ae=yb(o);vb(o,ae,K);break;default:throw Error(r(161))}}catch(me){It(o,o.return,me)}o.flags&=-3}c&4096&&(o.flags&=-4097)}function f_(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var c=o;f_(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),o=o.sibling}}function ps(o,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)s_(o,c.alternate,c),c=c.sibling}function bl(o){for(o=o.child;o!==null;){var c=o;switch(c.tag){case 0:case 11:case 14:case 15:so(4,c,c.return),bl(c);break;case 1:ka(c,c.return);var h=c.stateNode;typeof h.componentWillUnmount=="function"&&t_(c,c.return,h),bl(c);break;case 27:bf(c.stateNode);case 26:case 5:ka(c,c.return),bl(c);break;case 22:c.memoizedState===null&&bl(c);break;case 30:bl(c);break;default:bl(c)}o=o.sibling}}function ms(o,c,h){for(h=h&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var y=c.alternate,w=o,N=c,z=N.flags;switch(N.tag){case 0:case 11:case 15:ms(w,N,h),uf(4,N);break;case 1:if(ms(w,N,h),y=N,w=y.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ae){It(y,y.return,ae)}if(y=N,w=y.updateQueue,w!==null){var L=y.stateNode;try{var K=w.shared.hiddenCallbacks;if(K!==null)for(w.shared.hiddenCallbacks=null,w=0;w<K.length;w++)FO(K[w],L)}catch(ae){It(y,y.return,ae)}}h&&z&64&&e_(N),df(N,N.return);break;case 27:i_(N);case 26:case 5:ms(w,N,h),h&&y===null&&z&4&&n_(N),df(N,N.return);break;case 12:ms(w,N,h);break;case 31:ms(w,N,h),h&&z&4&&c_(w,N);break;case 13:ms(w,N,h),h&&z&4&&u_(w,N);break;case 22:N.memoizedState===null&&ms(w,N,h),df(N,N.return);break;case 30:break;default:ms(w,N,h)}c=c.sibling}}function bb(o,c){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(o=c.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&Yd(h))}function wb(o,c){o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Yd(o))}function na(o,c,h,y){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)h_(o,c,h,y),c=c.sibling}function h_(o,c,h,y){var w=c.flags;switch(c.tag){case 0:case 11:case 15:na(o,c,h,y),w&2048&&uf(9,c);break;case 1:na(o,c,h,y);break;case 3:na(o,c,h,y),w&2048&&(o=null,c.alternate!==null&&(o=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==o&&(c.refCount++,o!=null&&Yd(o)));break;case 12:if(w&2048){na(o,c,h,y),o=c.stateNode;try{var N=c.memoizedProps,z=N.id,L=N.onPostCommit;typeof L=="function"&&L(z,c.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(K){It(c,c.return,K)}}else na(o,c,h,y);break;case 31:na(o,c,h,y);break;case 13:na(o,c,h,y);break;case 23:break;case 22:N=c.stateNode,z=c.alternate,c.memoizedState!==null?N._visibility&2?na(o,c,h,y):ff(o,c):N._visibility&2?na(o,c,h,y):(N._visibility|=2,Yc(o,c,h,y,(c.subtreeFlags&10256)!==0||!1)),w&2048&&bb(z,c);break;case 24:na(o,c,h,y),w&2048&&wb(c.alternate,c);break;default:na(o,c,h,y)}}function Yc(o,c,h,y,w){for(w=w&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var N=o,z=c,L=h,K=y,ae=z.flags;switch(z.tag){case 0:case 11:case 15:Yc(N,z,L,K,w),uf(8,z);break;case 23:break;case 22:var me=z.stateNode;z.memoizedState!==null?me._visibility&2?Yc(N,z,L,K,w):ff(N,z):(me._visibility|=2,Yc(N,z,L,K,w)),w&&ae&2048&&bb(z.alternate,z);break;case 24:Yc(N,z,L,K,w),w&&ae&2048&&wb(z.alternate,z);break;default:Yc(N,z,L,K,w)}c=c.sibling}}function ff(o,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var h=o,y=c,w=y.flags;switch(y.tag){case 22:ff(h,y),w&2048&&bb(y.alternate,y);break;case 24:ff(h,y),w&2048&&wb(y.alternate,y);break;default:ff(h,y)}c=c.sibling}}var hf=8192;function Zc(o,c,h){if(o.subtreeFlags&hf)for(o=o.child;o!==null;)p_(o,c,h),o=o.sibling}function p_(o,c,h){switch(o.tag){case 26:Zc(o,c,h),o.flags&hf&&o.memoizedState!==null&&rK(h,ta,o.memoizedState,o.memoizedProps);break;case 5:Zc(o,c,h);break;case 3:case 4:var y=ta;ta=km(o.stateNode.containerInfo),Zc(o,c,h),ta=y;break;case 22:o.memoizedState===null&&(y=o.alternate,y!==null&&y.memoizedState!==null?(y=hf,hf=16777216,Zc(o,c,h),hf=y):Zc(o,c,h));break;default:Zc(o,c,h)}}function m_(o){var c=o.alternate;if(c!==null&&(o=c.child,o!==null)){c.child=null;do c=o.sibling,o.sibling=null,o=c;while(o!==null)}}function pf(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var y=c[h];Xn=y,y_(y,o)}m_(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)g_(o),o=o.sibling}function g_(o){switch(o.tag){case 0:case 11:case 15:pf(o),o.flags&2048&&so(9,o,o.return);break;case 3:pf(o);break;case 12:pf(o);break;case 22:var c=o.stateNode;o.memoizedState!==null&&c._visibility&2&&(o.return===null||o.return.tag!==13)?(c._visibility&=-3,fm(o)):pf(o);break;default:pf(o)}}function fm(o){var c=o.deletions;if((o.flags&16)!==0){if(c!==null)for(var h=0;h<c.length;h++){var y=c[h];Xn=y,y_(y,o)}m_(o)}for(o=o.child;o!==null;){switch(c=o,c.tag){case 0:case 11:case 15:so(8,c,c.return),fm(c);break;case 22:h=c.stateNode,h._visibility&2&&(h._visibility&=-3,fm(c));break;default:fm(c)}o=o.sibling}}function y_(o,c){for(;Xn!==null;){var h=Xn;switch(h.tag){case 0:case 11:case 15:so(8,h,c);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var y=h.memoizedState.cachePool.pool;y!=null&&y.refCount++}break;case 24:Yd(h.memoizedState.cache)}if(y=h.child,y!==null)y.return=h,Xn=y;else e:for(h=o;Xn!==null;){y=Xn;var w=y.sibling,N=y.return;if(o_(y),y===h){Xn=null;break e}if(w!==null){w.return=N,Xn=w;break e}Xn=N}}}var vH={getCacheForType:function(o){var c=lr(Mn),h=c.data.get(o);return h===void 0&&(h=o(),c.data.set(o,h)),h},cacheSignal:function(){return lr(Mn).controller.signal}},xH=typeof WeakMap=="function"?WeakMap:Map,zt=0,Vt=null,gt=null,xt=0,Mt=0,li=null,oo=!1,Xc=!1,jb=!1,gs=0,Sn=0,lo=0,wl=0,Sb=0,ci=0,Jc=0,mf=null,Kr=null,Nb=!1,hm=0,v_=0,pm=1/0,mm=null,co=null,Hn=0,uo=null,eu=null,ys=0,kb=0,Cb=null,x_=null,gf=0,Ab=null;function ui(){return(zt&2)!==0&&xt!==0?xt&-xt:H.T!==null?Tb():Ld()}function b_(){if(ci===0)if((xt&536870912)===0||wt){var o=wi;wi<<=1,(wi&3932160)===0&&(wi=262144),ci=o}else ci=536870912;return o=si.current,o!==null&&(o.flags|=32),ci}function Gr(o,c,h){(o===Vt&&(Mt===2||Mt===9)||o.cancelPendingCommit!==null)&&(tu(o,0),fo(o,xt,ci,!1)),Gs(o,h),((zt&2)===0||o!==Vt)&&(o===Vt&&((zt&2)===0&&(wl|=h),Sn===4&&fo(o,xt,ci,!1)),Ca(o))}function w_(o,c,h){if((zt&6)!==0)throw Error(r(327));var y=!h&&(c&127)===0&&(c&o.expiredLanes)===0||Zi(o,c),w=y?jH(o,c):Eb(o,c,!0),N=y;do{if(w===0){Xc&&!y&&fo(o,c,0,!1);break}else{if(h=o.current.alternate,N&&!bH(h)){w=Eb(o,c,!1),N=!1;continue}if(w===2){if(N=c,o.errorRecoveryDisabledLanes&N)var z=0;else z=o.pendingLanes&-536870913,z=z!==0?z:z&536870912?536870912:0;if(z!==0){c=z;e:{var L=o;w=mf;var K=L.current.memoizedState.isDehydrated;if(K&&(tu(L,z).flags|=256),z=Eb(L,z,!1),z!==2){if(jb&&!K){L.errorRecoveryDisabledLanes|=N,wl|=N,w=4;break e}N=Kr,Kr=w,N!==null&&(Kr===null?Kr=N:Kr.push.apply(Kr,N))}w=z}if(N=!1,w!==2)continue}}if(w===1){tu(o,0),fo(o,c,0,!0);break}e:{switch(y=o,N=w,N){case 0:case 1:throw Error(r(345));case 4:if((c&4194048)!==c)break;case 6:fo(y,c,ci,!oo);break e;case 2:Kr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((c&62914560)===c&&(w=hm+300-mt(),10<w)){if(fo(y,c,ci,!oo),$r(y,0,!0)!==0)break e;ys=c,y.timeoutHandle=X_(j_.bind(null,y,h,Kr,mm,Nb,c,ci,wl,Jc,oo,N,"Throttled",-0,0),w);break e}j_(y,h,Kr,mm,Nb,c,ci,wl,Jc,oo,N,null,-0,0)}}break}while(!0);Ca(o)}function j_(o,c,h,y,w,N,z,L,K,ae,me,we,le,ue){if(o.timeoutHandle=-1,we=c.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ns},p_(c,N,we);var De=(N&62914560)===N?hm-mt():(N&4194048)===N?v_-mt():0;if(De=iK(we,De),De!==null){ys=N,o.cancelPendingCommit=De(__.bind(null,o,c,N,h,y,w,z,L,K,me,we,null,le,ue)),fo(o,N,z,!ae);return}}__(o,c,N,h,y,w,z,L,K)}function bH(o){for(var c=o;;){var h=c.tag;if((h===0||h===11||h===15)&&c.flags&16384&&(h=c.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var y=0;y<h.length;y++){var w=h[y],N=w.getSnapshot;w=w.value;try{if(!ii(N(),w))return!1}catch{return!1}}if(h=c.child,c.subtreeFlags&16384&&h!==null)h.return=c,c=h;else{if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function fo(o,c,h,y){c&=~Sb,c&=~wl,o.suspendedLanes|=c,o.pingedLanes&=~c,y&&(o.warmLanes|=c),y=o.expirationTimes;for(var w=c;0<w;){var N=31-de(w),z=1<<N;y[N]=-1,w&=~z}h!==0&&Dd(o,h,c)}function gm(){return(zt&6)===0?(yf(0),!1):!0}function Ob(){if(gt!==null){if(Mt===0)var o=gt.return;else o=gt,ss=fl=null,H0(o),Kc=null,Xd=0,o=gt;for(;o!==null;)JE(o.alternate,o),o=o.return;gt=null}}function tu(o,c){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,BH(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),ys=0,Ob(),Vt=o,gt=h=is(o.current,null),xt=c,Mt=0,li=null,oo=!1,Xc=Zi(o,c),jb=!1,Jc=ci=Sb=wl=lo=Sn=0,Kr=mf=null,Nb=!1,(c&8)!==0&&(c|=c&32);var y=o.entangledLanes;if(y!==0)for(o=o.entanglements,y&=c;0<y;){var w=31-de(y),N=1<<w;c|=o[w],y&=~N}return gs=c,Ip(),h}function S_(o,c){st=null,H.H=of,c===Hc||c===Kp?(c=$O(),Mt=3):c===P0?(c=$O(),Mt=4):Mt=c===sb?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,li=c,gt===null&&(Sn=1,am(o,Ci(c,o.current)))}function N_(){var o=si.current;return o===null?!0:(xt&4194048)===xt?_i===null:(xt&62914560)===xt||(xt&536870912)!==0?o===_i:!1}function k_(){var o=H.H;return H.H=of,o===null?of:o}function C_(){var o=H.A;return H.A=vH,o}function ym(){Sn=4,oo||(xt&4194048)!==xt&&si.current!==null||(Xc=!0),(lo&134217727)===0&&(wl&134217727)===0||Vt===null||fo(Vt,xt,ci,!1)}function Eb(o,c,h){var y=zt;zt|=2;var w=k_(),N=C_();(Vt!==o||xt!==c)&&(mm=null,tu(o,c)),c=!1;var z=Sn;e:do try{if(Mt!==0&>!==null){var L=gt,K=li;switch(Mt){case 8:Ob(),z=6;break e;case 3:case 2:case 9:case 6:si.current===null&&(c=!0);var ae=Mt;if(Mt=0,li=null,nu(o,L,K,ae),h&&Xc){z=0;break e}break;default:ae=Mt,Mt=0,li=null,nu(o,L,K,ae)}}wH(),z=Sn;break}catch(me){S_(o,me)}while(!0);return c&&o.shellSuspendCounter++,ss=fl=null,zt=y,H.H=w,H.A=N,gt===null&&(Vt=null,xt=0,Ip()),z}function wH(){for(;gt!==null;)A_(gt)}function jH(o,c){var h=zt;zt|=2;var y=k_(),w=C_();Vt!==o||xt!==c?(mm=null,pm=mt()+500,tu(o,c)):Xc=Zi(o,c);e:do try{if(Mt!==0&>!==null){c=gt;var N=li;t:switch(Mt){case 1:Mt=0,li=null,nu(o,c,N,1);break;case 2:case 9:if(IO(N)){Mt=0,li=null,O_(c);break}c=function(){Mt!==2&&Mt!==9||Vt!==o||(Mt=7),Ca(o)},N.then(c,c);break e;case 3:Mt=7;break e;case 4:Mt=5;break e;case 7:IO(N)?(Mt=0,li=null,O_(c)):(Mt=0,li=null,nu(o,c,N,7));break;case 5:var z=null;switch(gt.tag){case 26:z=gt.memoizedState;case 5:case 27:var L=gt;if(z?hz(z):L.stateNode.complete){Mt=0,li=null;var K=L.sibling;if(K!==null)gt=K;else{var ae=L.return;ae!==null?(gt=ae,vm(ae)):gt=null}break t}}Mt=0,li=null,nu(o,c,N,5);break;case 6:Mt=0,li=null,nu(o,c,N,6);break;case 8:Ob(),Sn=6;break e;default:throw Error(r(462))}}SH();break}catch(me){S_(o,me)}while(!0);return ss=fl=null,H.H=y,H.A=w,zt=h,gt!==null?0:(Vt=null,xt=0,Ip(),Sn)}function SH(){for(;gt!==null&&!Ze();)A_(gt)}function A_(o){var c=ZE(o.alternate,o,gs);o.memoizedProps=o.pendingProps,c===null?vm(o):gt=c}function O_(o){var c=o,h=c.alternate;switch(c.tag){case 15:case 0:c=KE(h,c,c.pendingProps,c.type,void 0,xt);break;case 11:c=KE(h,c,c.pendingProps,c.type.render,c.ref,xt);break;case 5:H0(c);default:JE(h,c),c=gt=CO(c,gs),c=ZE(h,c,gs)}o.memoizedProps=o.pendingProps,c===null?vm(o):gt=c}function nu(o,c,h,y){ss=fl=null,H0(c),Kc=null,Xd=0;var w=c.return;try{if(dH(o,w,c,h,xt)){Sn=1,am(o,Ci(h,o.current)),gt=null;return}}catch(N){if(w!==null)throw gt=w,N;Sn=1,am(o,Ci(h,o.current)),gt=null;return}c.flags&32768?(wt||y===1?o=!0:Xc||(xt&536870912)!==0?o=!1:(oo=o=!0,(y===2||y===9||y===3||y===6)&&(y=si.current,y!==null&&y.tag===13&&(y.flags|=16384))),E_(c,o)):vm(c)}function vm(o){var c=o;do{if((c.flags&32768)!==0){E_(c,oo);return}o=c.return;var h=pH(c.alternate,c,gs);if(h!==null){gt=h;return}if(c=c.sibling,c!==null){gt=c;return}gt=c=o}while(c!==null);Sn===0&&(Sn=5)}function E_(o,c){do{var h=mH(o.alternate,o);if(h!==null){h.flags&=32767,gt=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!c&&(o=o.sibling,o!==null)){gt=o;return}gt=o=h}while(o!==null);Sn=6,gt=null}function __(o,c,h,y,w,N,z,L,K){o.cancelPendingCommit=null;do xm();while(Hn!==0);if((zt&6)!==0)throw Error(r(327));if(c!==null){if(c===o.current)throw Error(r(177));if(N=c.lanes|c.childLanes,N|=y0,Wx(o,h,N,z,L,K),o===Vt&&(gt=Vt=null,xt=0),eu=c,uo=o,ys=h,kb=N,Cb=w,x_=y,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,AH(Me,function(){return D_(),null})):(o.callbackNode=null,o.callbackPriority=0),y=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||y){y=H.T,H.T=null,w=J.p,J.p=2,z=zt,zt|=4;try{gH(o,c,h)}finally{zt=z,J.p=w,H.T=y}}Hn=1,z_(),P_(),T_()}}function z_(){if(Hn===1){Hn=0;var o=uo,c=eu,h=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var y=J.p;J.p=2;var w=zt;zt|=4;try{d_(c,o);var N=Ub,z=yO(o.containerInfo),L=N.focusedElem,K=N.selectionRange;if(z!==L&&L&&L.ownerDocument&&gO(L.ownerDocument.documentElement,L)){if(K!==null&&f0(L)){var ae=K.start,me=K.end;if(me===void 0&&(me=ae),"selectionStart"in L)L.selectionStart=ae,L.selectionEnd=Math.min(me,L.value.length);else{var we=L.ownerDocument||document,le=we&&we.defaultView||window;if(le.getSelection){var ue=le.getSelection(),De=L.textContent.length,Ye=Math.min(K.start,De),Ut=K.end===void 0?Ye:Math.min(K.end,De);!ue.extend&&Ye>Ut&&(z=Ut,Ut=Ye,Ye=z);var te=mO(L,Ye),W=mO(L,Ut);if(te&&W&&(ue.rangeCount!==1||ue.anchorNode!==te.node||ue.anchorOffset!==te.offset||ue.focusNode!==W.node||ue.focusOffset!==W.offset)){var ie=we.createRange();ie.setStart(te.node,te.offset),ue.removeAllRanges(),Ye>Ut?(ue.addRange(ie),ue.extend(W.node,W.offset)):(ie.setEnd(W.node,W.offset),ue.addRange(ie))}}}}for(we=[],ue=L;ue=ue.parentNode;)ue.nodeType===1&&we.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<we.length;L++){var xe=we[L];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}zm=!!Bb,Ub=Bb=null}finally{zt=w,J.p=y,H.T=h}}o.current=c,Hn=2}}function P_(){if(Hn===2){Hn=0;var o=uo,c=eu,h=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var y=J.p;J.p=2;var w=zt;zt|=4;try{s_(o,c.alternate,c)}finally{zt=w,J.p=y,H.T=h}}Hn=3}}function T_(){if(Hn===4||Hn===3){Hn=0,Rt();var o=uo,c=eu,h=ys,y=x_;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?Hn=5:(Hn=0,eu=uo=null,R_(o,o.pendingLanes));var w=o.pendingLanes;if(w===0&&(co=null),Id(h),c=c.stateNode,We&&typeof We.onCommitFiberRoot=="function")try{We.onCommitFiberRoot(gn,c,void 0,(c.current.flags&128)===128)}catch{}if(y!==null){c=H.T,w=J.p,J.p=2,H.T=null;try{for(var N=o.onRecoverableError,z=0;z<y.length;z++){var L=y[z];N(L.value,{componentStack:L.stack})}}finally{H.T=c,J.p=w}}(ys&3)!==0&&xm(),Ca(o),w=o.pendingLanes,(h&261930)!==0&&(w&42)!==0?o===Ab?gf++:(gf=0,Ab=o):gf=0,yf(0)}}function R_(o,c){(o.pooledCacheLanes&=c)===0&&(c=o.pooledCache,c!=null&&(o.pooledCache=null,Yd(c)))}function xm(){return z_(),P_(),T_(),D_()}function D_(){if(Hn!==5)return!1;var o=uo,c=kb;kb=0;var h=Id(ys),y=H.T,w=J.p;try{J.p=32>h?32:h,H.T=null,h=Cb,Cb=null;var N=uo,z=ys;if(Hn=0,eu=uo=null,ys=0,(zt&6)!==0)throw Error(r(331));var L=zt;if(zt|=4,g_(N.current),h_(N,N.current,z,h),zt=L,yf(0,!1),We&&typeof We.onPostCommitFiberRoot=="function")try{We.onPostCommitFiberRoot(gn,N)}catch{}return!0}finally{J.p=w,H.T=y,R_(o,c)}}function M_(o,c,h){c=Ci(h,c),c=ab(o.stateNode,c,2),o=ro(o,c,2),o!==null&&(Gs(o,2),Ca(o))}function It(o,c,h){if(o.tag===3)M_(o,o,h);else for(;c!==null;){if(c.tag===3){M_(c,o,h);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(co===null||!co.has(y))){o=Ci(h,o),h=IE(2),y=ro(c,h,2),y!==null&&(LE(h,y,c,o),Gs(y,2),Ca(y));break}}c=c.return}}function _b(o,c,h){var y=o.pingCache;if(y===null){y=o.pingCache=new xH;var w=new Set;y.set(c,w)}else w=y.get(c),w===void 0&&(w=new Set,y.set(c,w));w.has(h)||(jb=!0,w.add(h),o=NH.bind(null,o,c,h),c.then(o,o))}function NH(o,c,h){var y=o.pingCache;y!==null&&y.delete(c),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,Vt===o&&(xt&h)===h&&(Sn===4||Sn===3&&(xt&62914560)===xt&&300>mt()-hm?(zt&2)===0&&tu(o,0):Sb|=h,Jc===xt&&(Jc=0)),Ca(o)}function I_(o,c){c===0&&(c=Sp()),o=cl(o,c),o!==null&&(Gs(o,c),Ca(o))}function kH(o){var c=o.memoizedState,h=0;c!==null&&(h=c.retryLane),I_(o,h)}function CH(o,c){var h=0;switch(o.tag){case 31:case 13:var y=o.stateNode,w=o.memoizedState;w!==null&&(h=w.retryLane);break;case 19:y=o.stateNode;break;case 22:y=o.stateNode._retryCache;break;default:throw Error(r(314))}y!==null&&y.delete(c),I_(o,h)}function AH(o,c){return en(o,c)}var bm=null,ru=null,zb=!1,wm=!1,Pb=!1,ho=0;function Ca(o){o!==ru&&o.next===null&&(ru===null?bm=ru=o:ru=ru.next=o),wm=!0,zb||(zb=!0,EH())}function yf(o,c){if(!Pb&&wm){Pb=!0;do for(var h=!1,y=bm;y!==null;){if(o!==0){var w=y.pendingLanes;if(w===0)var N=0;else{var z=y.suspendedLanes,L=y.pingedLanes;N=(1<<31-de(42|o)+1)-1,N&=w&~(z&~L),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,U_(y,N))}else N=xt,N=$r(y,y===Vt?N:0,y.cancelPendingCommit!==null||y.timeoutHandle!==-1),(N&3)===0||Zi(y,N)||(h=!0,U_(y,N));y=y.next}while(h);Pb=!1}}function OH(){L_()}function L_(){wm=zb=!1;var o=0;ho!==0&&$H()&&(o=ho);for(var c=mt(),h=null,y=bm;y!==null;){var w=y.next,N=$_(y,c);N===0?(y.next=null,h===null?bm=w:h.next=w,w===null&&(ru=h)):(h=y,(o!==0||(N&3)!==0)&&(wm=!0)),y=w}Hn!==0&&Hn!==5||yf(o),ho!==0&&(ho=0)}function $_(o,c){for(var h=o.suspendedLanes,y=o.pingedLanes,w=o.expirationTimes,N=o.pendingLanes&-62914561;0<N;){var z=31-de(N),L=1<<z,K=w[z];K===-1?((L&h)===0||(L&y)!==0)&&(w[z]=ba(L,c)):K<=c&&(o.expiredLanes|=L),N&=~L}if(c=Vt,h=xt,h=$r(o,o===c?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y=o.callbackNode,h===0||o===c&&(Mt===2||Mt===9)||o.cancelPendingCommit!==null)return y!==null&&y!==null&&je(y),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Zi(o,h)){if(c=h&-h,c===o.callbackPriority)return c;switch(y!==null&&je(y),Id(h)){case 2:case 8:h=Ne;break;case 32:h=Me;break;case 268435456:h=pt;break;default:h=Me}return y=B_.bind(null,o),h=en(h,y),o.callbackPriority=c,o.callbackNode=h,c}return y!==null&&y!==null&&je(y),o.callbackPriority=2,o.callbackNode=null,2}function B_(o,c){if(Hn!==0&&Hn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(xm()&&o.callbackNode!==h)return null;var y=xt;return y=$r(o,o===Vt?y:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),y===0?null:(w_(o,y,c),$_(o,mt()),o.callbackNode!=null&&o.callbackNode===h?B_.bind(null,o):null)}function U_(o,c){if(xm())return null;w_(o,c,!0)}function EH(){UH(function(){(zt&6)!==0?en(ce,OH):L_()})}function Tb(){if(ho===0){var o=qc;o===0&&(o=Fn,Fn<<=1,(Fn&261888)===0&&(Fn=256)),ho=o}return ho}function q_(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ep(""+o)}function F_(o,c){var h=c.ownerDocument.createElement("input");return h.name=c.name,h.value=c.value,o.id&&h.setAttribute("form",o.id),c.parentNode.insertBefore(h,c),o=new FormData(o),h.parentNode.removeChild(h),o}function _H(o,c,h,y,w){if(c==="submit"&&h&&h.stateNode===w){var N=q_((w[St]||null).action),z=y.submitter;z&&(c=(c=z[St]||null)?q_(c.formAction):z.getAttribute("formAction"),c!==null&&(N=c,z=null));var L=new Tp("action","action",null,y,w);o.push({event:L,listeners:[{instance:null,listener:function(){if(y.defaultPrevented){if(ho!==0){var K=z?F_(w,z):new FormData(w);J0(h,{pending:!0,data:K,method:w.method,action:N},null,K)}}else typeof N=="function"&&(L.preventDefault(),K=z?F_(w,z):new FormData(w),J0(h,{pending:!0,data:K,method:w.method,action:N},N,K))},currentTarget:w}]})}}for(var Rb=0;Rb<g0.length;Rb++){var Db=g0[Rb],zH=Db.toLowerCase(),PH=Db[0].toUpperCase()+Db.slice(1);ea(zH,"on"+PH)}ea(bO,"onAnimationEnd"),ea(wO,"onAnimationIteration"),ea(jO,"onAnimationStart"),ea("dblclick","onDoubleClick"),ea("focusin","onFocus"),ea("focusout","onBlur"),ea(Q9,"onTransitionRun"),ea(W9,"onTransitionStart"),ea(Y9,"onTransitionCancel"),ea(SO,"onTransitionEnd"),ut("onMouseEnter",["mouseout","mouseover"]),ut("onMouseLeave",["mouseout","mouseover"]),ut("onPointerEnter",["pointerout","pointerover"]),ut("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 vf="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(" "),TH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vf));function H_(o,c){c=(c&4)!==0;for(var h=0;h<o.length;h++){var y=o[h],w=y.event;y=y.listeners;e:{var N=void 0;if(c)for(var z=y.length-1;0<=z;z--){var L=y[z],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(me){Mp(me)}w.currentTarget=null,N=K}else for(z=0;z<y.length;z++){if(L=y[z],K=L.instance,ae=L.currentTarget,L=L.listener,K!==N&&w.isPropagationStopped())break e;N=L,w.currentTarget=ae;try{N(w)}catch(me){Mp(me)}w.currentTarget=null,N=K}}}}function yt(o,c){var h=c[wa];h===void 0&&(h=c[wa]=new Set);var y=o+"__bubble";h.has(y)||(K_(c,o,2,!1),h.add(y))}function Mb(o,c,h){var y=0;c&&(y|=4),K_(h,o,y,c)}var jm="_reactListening"+Math.random().toString(36).slice(2);function Ib(o){if(!o[jm]){o[jm]=!0,il.forEach(function(h){h!=="selectionchange"&&(TH.has(h)||Mb(h,!1,o),Mb(h,!0,o))});var c=o.nodeType===9?o:o.ownerDocument;c===null||c[jm]||(c[jm]=!0,Mb("selectionchange",!1,c))}}function K_(o,c,h,y){switch(bz(c)){case 2:var w=oK;break;case 8:w=lK;break;default:w=Xb}h=w.bind(null,c,h,o),w=void 0,!r0||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(w=!0),y?w!==void 0?o.addEventListener(c,h,{capture:!0,passive:w}):o.addEventListener(c,h,!0):w!==void 0?o.addEventListener(c,h,{passive:w}):o.addEventListener(c,h,!1)}function Lb(o,c,h,y,w){var N=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var z=y.tag;if(z===3||z===4){var L=y.stateNode.containerInfo;if(L===w)break;if(z===4)for(z=y.return;z!==null;){var K=z.tag;if((K===3||K===4)&&z.stateNode.containerInfo===w)return;z=z.return}for(;L!==null;){if(z=ji(L),z===null)return;if(K=z.tag,K===5||K===6||K===26||K===27){y=N=z;continue e}L=L.parentNode}}y=y.return}YA(function(){var ae=N,me=t0(h),we=[];e:{var le=NO.get(o);if(le!==void 0){var ue=Tp,De=o;switch(o){case"keypress":if(zp(h)===0)break e;case"keydown":case"keyup":ue=C9;break;case"focusin":De="focus",ue=o0;break;case"focusout":De="blur",ue=o0;break;case"beforeblur":case"afterblur":ue=o0;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":ue=JA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=p9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=E9;break;case bO:case wO:case jO:ue=y9;break;case SO:ue=z9;break;case"scroll":case"scrollend":ue=f9;break;case"wheel":ue=T9;break;case"copy":case"cut":case"paste":ue=x9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=tO;break;case"toggle":case"beforetoggle":ue=D9}var Ye=(c&4)!==0,Ut=!Ye&&(o==="scroll"||o==="scrollend"),te=Ye?le!==null?le+"Capture":null:le;Ye=[];for(var W=ae,ie;W!==null;){var xe=W;if(ie=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ie===null||te===null||(xe=$d(W,te),xe!=null&&Ye.push(xf(W,xe,ie))),Ut)break;W=W.return}0<Ye.length&&(le=new ue(le,De,null,h,me),we.push({event:le,listeners:Ye}))}}if((c&7)===0){e:{if(le=o==="mouseover"||o==="pointerover",ue=o==="mouseout"||o==="pointerout",le&&h!==e0&&(De=h.relatedTarget||h.fromElement)&&(ji(De)||De[_n]))break e;if((ue||le)&&(le=me.window===me?me:(le=me.ownerDocument)?le.defaultView||le.parentWindow:window,ue?(De=h.relatedTarget||h.toElement,ue=ae,De=De?ji(De):null,De!==null&&(Ut=a(De),Ye=De.tag,De!==Ut||Ye!==5&&Ye!==27&&Ye!==6)&&(De=null)):(ue=null,De=ae),ue!==De)){if(Ye=JA,xe="onMouseLeave",te="onMouseEnter",W="mouse",(o==="pointerout"||o==="pointerover")&&(Ye=tO,xe="onPointerLeave",te="onPointerEnter",W="pointer"),Ut=ue==null?le:Qs(ue),ie=De==null?le:Qs(De),le=new Ye(xe,W+"leave",ue,h,me),le.target=Ut,le.relatedTarget=ie,xe=null,ji(me)===ae&&(Ye=new Ye(te,W+"enter",De,h,me),Ye.target=ie,Ye.relatedTarget=Ut,xe=Ye),Ut=xe,ue&&De)t:{for(Ye=RH,te=ue,W=De,ie=0,xe=te;xe;xe=Ye(xe))ie++;xe=0;for(var Ke=W;Ke;Ke=Ye(Ke))xe++;for(;0<ie-xe;)te=Ye(te),ie--;for(;0<xe-ie;)W=Ye(W),xe--;for(;ie--;){if(te===W||W!==null&&te===W.alternate){Ye=te;break t}te=Ye(te),W=Ye(W)}Ye=null}else Ye=null;ue!==null&&G_(we,le,ue,Ye,!1),De!==null&&Ut!==null&&G_(we,Ut,De,Ye,!0)}}e:{if(le=ae?Qs(ae):window,ue=le.nodeName&&le.nodeName.toLowerCase(),ue==="select"||ue==="input"&&le.type==="file")var kt=cO;else if(oO(le))if(uO)kt=K9;else{kt=F9;var Be=q9}else ue=le.nodeName,!ue||ue.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ae&&Jx(ae.elementType)&&(kt=cO):kt=H9;if(kt&&(kt=kt(o,ae))){lO(we,kt,h,me);break e}Be&&Be(o,le,ae),o==="focusout"&&ae&&le.type==="number"&&ae.memoizedProps.value!=null&&Xx(le,"number",le.value)}switch(Be=ae?Qs(ae):window,o){case"focusin":(oO(Be)||Be.contentEditable==="true")&&(Rc=Be,h0=ae,Vd=null);break;case"focusout":Vd=h0=Rc=null;break;case"mousedown":p0=!0;break;case"contextmenu":case"mouseup":case"dragend":p0=!1,vO(we,h,me);break;case"selectionchange":if(V9)break;case"keydown":case"keyup":vO(we,h,me)}var ot;if(c0)e:{switch(o){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Tc?aO(o,h)&&(bt="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(bt="onCompositionStart");bt&&(nO&&h.locale!=="ko"&&(Tc||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Tc&&(ot=ZA()):(Ys=me,i0="value"in Ys?Ys.value:Ys.textContent,Tc=!0)),Be=Sm(ae,bt),0<Be.length&&(bt=new eO(bt,o,null,h,me),we.push({event:bt,listeners:Be}),ot?bt.data=ot:(ot=sO(h),ot!==null&&(bt.data=ot)))),(ot=I9?L9(o,h):$9(o,h))&&(bt=Sm(ae,"onBeforeInput"),0<bt.length&&(Be=new eO("onBeforeInput","beforeinput",null,h,me),we.push({event:Be,listeners:bt}),Be.data=ot)),_H(we,o,ae,h,me)}H_(we,c)})}function xf(o,c,h){return{instance:o,listener:c,currentTarget:h}}function Sm(o,c){for(var h=c+"Capture",y=[];o!==null;){var w=o,N=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||N===null||(w=$d(o,h),w!=null&&y.unshift(xf(o,w,N)),w=$d(o,c),w!=null&&y.push(xf(o,w,N))),o.tag===3)return y;o=o.return}return[]}function RH(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function G_(o,c,h,y,w){for(var N=c._reactName,z=[];h!==null&&h!==y;){var L=h,K=L.alternate,ae=L.stateNode;if(L=L.tag,K!==null&&K===y)break;L!==5&&L!==26&&L!==27||ae===null||(K=ae,w?(ae=$d(h,N),ae!=null&&z.unshift(xf(h,ae,K))):w||(ae=$d(h,N),ae!=null&&z.push(xf(h,ae,K)))),h=h.return}z.length!==0&&o.push({event:c,listeners:z})}var DH=/\r\n?/g,MH=/\u0000|\uFFFD/g;function V_(o){return(typeof o=="string"?o:""+o).replace(DH,`
|
|
9
|
+
`).replace(MH,"")}function Q_(o,c){return c=V_(c),V_(o)===c}function Bt(o,c,h,y,w,N){switch(h){case"children":typeof y=="string"?c==="body"||c==="textarea"&&y===""||_c(o,y):(typeof y=="number"||typeof y=="bigint")&&c!=="body"&&_c(o,""+y);break;case"className":Ap(o,"class",y);break;case"tabIndex":Ap(o,"tabindex",y);break;case"dir":case"role":case"viewBox":case"width":case"height":Ap(o,h,y);break;case"style":QA(o,y,N);break;case"data":if(c!=="object"){Ap(o,"data",y);break}case"src":case"href":if(y===""&&(c!=="a"||h!=="href")){o.removeAttribute(h);break}if(y==null||typeof y=="function"||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(h);break}y=Ep(""+y),o.setAttribute(h,y);break;case"action":case"formAction":if(typeof y=="function"){o.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"?(c!=="input"&&Bt(o,c,"name",w.name,w,null),Bt(o,c,"formEncType",w.formEncType,w,null),Bt(o,c,"formMethod",w.formMethod,w,null),Bt(o,c,"formTarget",w.formTarget,w,null)):(Bt(o,c,"encType",w.encType,w,null),Bt(o,c,"method",w.method,w,null),Bt(o,c,"target",w.target,w,null)));if(y==null||typeof y=="symbol"||typeof y=="boolean"){o.removeAttribute(h);break}y=Ep(""+y),o.setAttribute(h,y);break;case"onClick":y!=null&&(o.onclick=ns);break;case"onScroll":y!=null&&yt("scroll",o);break;case"onScrollEnd":y!=null&&yt("scrollend",o);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(w.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=y&&typeof y!="function"&&typeof y!="symbol";break;case"muted":o.muted=y&&typeof y!="function"&&typeof y!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(y==null||typeof y=="function"||typeof y=="boolean"||typeof y=="symbol"){o.removeAttribute("xlink:href");break}h=Ep(""+y),o.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":y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,""+y):o.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":y&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":y===!0?o.setAttribute(h,""):y!==!1&&y!=null&&typeof y!="function"&&typeof y!="symbol"?o.setAttribute(h,y):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":y!=null&&typeof y!="function"&&typeof y!="symbol"&&!isNaN(y)&&1<=y?o.setAttribute(h,y):o.removeAttribute(h);break;case"rowSpan":case"start":y==null||typeof y=="function"||typeof y=="symbol"||isNaN(y)?o.removeAttribute(h):o.setAttribute(h,y);break;case"popover":yt("beforetoggle",o),yt("toggle",o),al(o,"popover",y);break;case"xlinkActuate":ts(o,"http://www.w3.org/1999/xlink","xlink:actuate",y);break;case"xlinkArcrole":ts(o,"http://www.w3.org/1999/xlink","xlink:arcrole",y);break;case"xlinkRole":ts(o,"http://www.w3.org/1999/xlink","xlink:role",y);break;case"xlinkShow":ts(o,"http://www.w3.org/1999/xlink","xlink:show",y);break;case"xlinkTitle":ts(o,"http://www.w3.org/1999/xlink","xlink:title",y);break;case"xlinkType":ts(o,"http://www.w3.org/1999/xlink","xlink:type",y);break;case"xmlBase":ts(o,"http://www.w3.org/XML/1998/namespace","xml:base",y);break;case"xmlLang":ts(o,"http://www.w3.org/XML/1998/namespace","xml:lang",y);break;case"xmlSpace":ts(o,"http://www.w3.org/XML/1998/namespace","xml:space",y);break;case"is":al(o,"is",y);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=u9.get(h)||h,al(o,h,y))}}function $b(o,c,h,y,w,N){switch(h){case"style":QA(o,y,N);break;case"dangerouslySetInnerHTML":if(y!=null){if(typeof y!="object"||!("__html"in y))throw Error(r(61));if(h=y.__html,h!=null){if(w.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof y=="string"?_c(o,y):(typeof y=="number"||typeof y=="bigint")&&_c(o,""+y);break;case"onScroll":y!=null&&yt("scroll",o);break;case"onScrollEnd":y!=null&&yt("scrollend",o);break;case"onClick":y!=null&&(o.onclick=ns);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cp.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(w=h.endsWith("Capture"),c=h.slice(2,w?h.length-7:void 0),N=o[St]||null,N=N!=null?N[h]:null,typeof N=="function"&&o.removeEventListener(c,N,w),typeof y=="function")){typeof N!="function"&&N!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(c,y,w);break e}h in o?o[h]=y:y===!0?o.setAttribute(h,""):al(o,h,y)}}}function ur(o,c,h){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",o),yt("load",o);var y=!1,w=!1,N;for(N in h)if(h.hasOwnProperty(N)){var z=h[N];if(z!=null)switch(N){case"src":y=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Bt(o,c,N,z,h,null)}}w&&Bt(o,c,"srcSet",h.srcSet,h,null),y&&Bt(o,c,"src",h.src,h,null);return;case"input":yt("invalid",o);var L=N=z=w=null,K=null,ae=null;for(y in h)if(h.hasOwnProperty(y)){var me=h[y];if(me!=null)switch(y){case"name":w=me;break;case"type":z=me;break;case"checked":K=me;break;case"defaultChecked":ae=me;break;case"value":N=me;break;case"defaultValue":L=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,c));break;default:Bt(o,c,y,me,h,null)}}HA(o,N,L,K,ae,z,w,!1);return;case"select":yt("invalid",o),y=z=N=null;for(w in h)if(h.hasOwnProperty(w)&&(L=h[w],L!=null))switch(w){case"value":N=L;break;case"defaultValue":z=L;break;case"multiple":y=L;default:Bt(o,c,w,L,h,null)}c=N,h=z,o.multiple=!!y,c!=null?Ec(o,!!y,c,!1):h!=null&&Ec(o,!!y,h,!0);return;case"textarea":yt("invalid",o),N=w=y=null;for(z in h)if(h.hasOwnProperty(z)&&(L=h[z],L!=null))switch(z){case"value":y=L;break;case"defaultValue":w=L;break;case"children":N=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:Bt(o,c,z,L,h,null)}GA(o,y,w,N);return;case"option":for(K in h)h.hasOwnProperty(K)&&(y=h[K],y!=null)&&(K==="selected"?o.selected=y&&typeof y!="function"&&typeof y!="symbol":Bt(o,c,K,y,h,null));return;case"dialog":yt("beforetoggle",o),yt("toggle",o),yt("cancel",o),yt("close",o);break;case"iframe":case"object":yt("load",o);break;case"video":case"audio":for(y=0;y<vf.length;y++)yt(vf[y],o);break;case"image":yt("error",o),yt("load",o);break;case"details":yt("toggle",o);break;case"embed":case"source":case"link":yt("error",o),yt("load",o);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)&&(y=h[ae],y!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Bt(o,c,ae,y,h,null)}return;default:if(Jx(c)){for(me in h)h.hasOwnProperty(me)&&(y=h[me],y!==void 0&&$b(o,c,me,y,h,void 0));return}}for(L in h)h.hasOwnProperty(L)&&(y=h[L],y!=null&&Bt(o,c,L,y,h,null))}function IH(o,c,h,y){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,N=null,z=null,L=null,K=null,ae=null,me=null;for(ue in h){var we=h[ue];if(h.hasOwnProperty(ue)&&we!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":K=we;default:y.hasOwnProperty(ue)||Bt(o,c,ue,null,y,we)}}for(var le in y){var ue=y[le];if(we=h[le],y.hasOwnProperty(le)&&(ue!=null||we!=null))switch(le){case"type":N=ue;break;case"name":w=ue;break;case"checked":ae=ue;break;case"defaultChecked":me=ue;break;case"value":z=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,c));break;default:ue!==we&&Bt(o,c,le,ue,y,we)}}Zx(o,z,L,K,ae,me,N,w);return;case"select":ue=z=L=le=null;for(N in h)if(K=h[N],h.hasOwnProperty(N)&&K!=null)switch(N){case"value":break;case"multiple":ue=K;default:y.hasOwnProperty(N)||Bt(o,c,N,null,y,K)}for(w in y)if(N=y[w],K=h[w],y.hasOwnProperty(w)&&(N!=null||K!=null))switch(w){case"value":le=N;break;case"defaultValue":L=N;break;case"multiple":z=N;default:N!==K&&Bt(o,c,w,N,y,K)}c=L,h=z,y=ue,le!=null?Ec(o,!!h,le,!1):!!y!=!!h&&(c!=null?Ec(o,!!h,c,!0):Ec(o,!!h,h?[]:"",!1));return;case"textarea":ue=le=null;for(L in h)if(w=h[L],h.hasOwnProperty(L)&&w!=null&&!y.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Bt(o,c,L,null,y,w)}for(z in y)if(w=y[z],N=h[z],y.hasOwnProperty(z)&&(w!=null||N!=null))switch(z){case"value":le=w;break;case"defaultValue":ue=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:w!==N&&Bt(o,c,z,w,y,N)}KA(o,le,ue);return;case"option":for(var De in h)le=h[De],h.hasOwnProperty(De)&&le!=null&&!y.hasOwnProperty(De)&&(De==="selected"?o.selected=!1:Bt(o,c,De,null,y,le));for(K in y)le=y[K],ue=h[K],y.hasOwnProperty(K)&&le!==ue&&(le!=null||ue!=null)&&(K==="selected"?o.selected=le&&typeof le!="function"&&typeof le!="symbol":Bt(o,c,K,le,y,ue));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 Ye in h)le=h[Ye],h.hasOwnProperty(Ye)&&le!=null&&!y.hasOwnProperty(Ye)&&Bt(o,c,Ye,null,y,le);for(ae in y)if(le=y[ae],ue=h[ae],y.hasOwnProperty(ae)&&le!==ue&&(le!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,c));break;default:Bt(o,c,ae,le,y,ue)}return;default:if(Jx(c)){for(var Ut in h)le=h[Ut],h.hasOwnProperty(Ut)&&le!==void 0&&!y.hasOwnProperty(Ut)&&$b(o,c,Ut,void 0,y,le);for(me in y)le=y[me],ue=h[me],!y.hasOwnProperty(me)||le===ue||le===void 0&&ue===void 0||$b(o,c,me,le,y,ue);return}}for(var te in h)le=h[te],h.hasOwnProperty(te)&&le!=null&&!y.hasOwnProperty(te)&&Bt(o,c,te,null,y,le);for(we in y)le=y[we],ue=h[we],!y.hasOwnProperty(we)||le===ue||le==null&&ue==null||Bt(o,c,we,le,y,ue)}function W_(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function LH(){if(typeof performance.getEntriesByType=="function"){for(var o=0,c=0,h=performance.getEntriesByType("resource"),y=0;y<h.length;y++){var w=h[y],N=w.transferSize,z=w.initiatorType,L=w.duration;if(N&&L&&W_(z)){for(z=0,L=w.responseEnd,y+=1;y<h.length;y++){var K=h[y],ae=K.startTime;if(ae>L)break;var me=K.transferSize,we=K.initiatorType;me&&W_(we)&&(K=K.responseEnd,z+=me*(K<L?1:(L-ae)/(K-ae)))}if(--y,c+=8*(N+z)/(w.duration/1e3),o++,10<o)break}}if(0<o)return c/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Bb=null,Ub=null;function Nm(o){return o.nodeType===9?o:o.ownerDocument}function Y_(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Z_(o,c){if(o===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&c==="foreignObject"?0:o}function qb(o,c){return o==="textarea"||o==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Fb=null;function $H(){var o=window.event;return o&&o.type==="popstate"?o===Fb?!1:(Fb=o,!0):(Fb=null,!1)}var X_=typeof setTimeout=="function"?setTimeout:void 0,BH=typeof clearTimeout=="function"?clearTimeout:void 0,J_=typeof Promise=="function"?Promise:void 0,UH=typeof queueMicrotask=="function"?queueMicrotask:typeof J_<"u"?function(o){return J_.resolve(null).then(o).catch(qH)}:X_;function qH(o){setTimeout(function(){throw o})}function po(o){return o==="head"}function ez(o,c){var h=c,y=0;do{var w=h.nextSibling;if(o.removeChild(h),w&&w.nodeType===8)if(h=w.data,h==="/$"||h==="/&"){if(y===0){o.removeChild(w),ou(c);return}y--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")y++;else if(h==="html")bf(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,bf(h);for(var N=h.firstChild;N;){var z=N.nextSibling,L=N.nodeName;N[rl]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=z}}else h==="body"&&bf(o.ownerDocument.body);h=w}while(h);ou(c)}function tz(o,c){var h=o;o=0;do{var y=h.nextSibling;if(h.nodeType===1?c?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(c?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),y&&y.nodeType===8)if(h=y.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=y}while(h)}function Hb(o){var c=o.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var h=c;switch(c=c.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":Hb(h),ja(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function FH(o,c,h,y){for(;o.nodeType===1;){var w=h;if(o.nodeName.toLowerCase()!==c.toLowerCase()){if(!y&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(y){if(!o[rl])switch(c){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(N=o.getAttribute("rel"),N==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(N!==w.rel||o.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||o.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||o.getAttribute("title")!==(w.title==null?null:w.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(N=o.getAttribute("src"),(N!==(w.src==null?null:w.src)||o.getAttribute("type")!==(w.type==null?null:w.type)||o.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&N&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(c==="input"&&o.type==="hidden"){var N=w.name==null?null:""+w.name;if(w.type==="hidden"&&o.getAttribute("name")===N)return o}else return o;if(o=zi(o.nextSibling),o===null)break}return null}function HH(o,c,h){if(c==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=zi(o.nextSibling),o===null))return null;return o}function nz(o,c){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!c||(o=zi(o.nextSibling),o===null))return null;return o}function Kb(o){return o.data==="$?"||o.data==="$~"}function Gb(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function KH(o,c){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=c;else if(o.data!=="$?"||h.readyState!=="loading")c();else{var y=function(){c(),h.removeEventListener("DOMContentLoaded",y)};h.addEventListener("DOMContentLoaded",y),o._reactRetry=y}}function zi(o){for(;o!=null;o=o.nextSibling){var c=o.nodeType;if(c===1||c===3)break;if(c===8){if(c=o.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return o}var Vb=null;function rz(o){o=o.nextSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(c===0)return zi(o.nextSibling);c--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||c++}o=o.nextSibling}return null}function iz(o){o=o.previousSibling;for(var c=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(c===0)return o;c--}else h!=="/$"&&h!=="/&"||c++}o=o.previousSibling}return null}function az(o,c,h){switch(c=Nm(h),o){case"html":if(o=c.documentElement,!o)throw Error(r(452));return o;case"head":if(o=c.head,!o)throw Error(r(453));return o;case"body":if(o=c.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function bf(o){for(var c=o.attributes;c.length;)o.removeAttributeNode(c[0]);ja(o)}var Pi=new Map,sz=new Set;function km(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var vs=J.d;J.d={f:GH,r:VH,D:QH,C:WH,L:YH,m:ZH,X:JH,S:XH,M:eK};function GH(){var o=vs.f(),c=gm();return o||c}function VH(o){var c=Xi(o);c!==null&&c.tag===5&&c.type==="form"?SE(c):vs.r(o)}var iu=typeof document>"u"?null:document;function oz(o,c,h){var y=iu;if(y&&typeof c=="string"&&c){var w=Ni(c);w='link[rel="'+o+'"][href="'+w+'"]',typeof h=="string"&&(w+='[crossorigin="'+h+'"]'),sz.has(w)||(sz.add(w),o={rel:o,crossOrigin:h,href:c},y.querySelector(w)===null&&(c=y.createElement("link"),ur(c,"link",o),yn(c),y.head.appendChild(c)))}}function QH(o){vs.D(o),oz("dns-prefetch",o,null)}function WH(o,c){vs.C(o,c),oz("preconnect",o,c)}function YH(o,c,h){vs.L(o,c,h);var y=iu;if(y&&o&&c){var w='link[rel="preload"][as="'+Ni(c)+'"]';c==="image"&&h&&h.imageSrcSet?(w+='[imagesrcset="'+Ni(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(w+='[imagesizes="'+Ni(h.imageSizes)+'"]')):w+='[href="'+Ni(o)+'"]';var N=w;switch(c){case"style":N=au(o);break;case"script":N=su(o)}Pi.has(N)||(o=m({rel:"preload",href:c==="image"&&h&&h.imageSrcSet?void 0:o,as:c},h),Pi.set(N,o),y.querySelector(w)!==null||c==="style"&&y.querySelector(wf(N))||c==="script"&&y.querySelector(jf(N))||(c=y.createElement("link"),ur(c,"link",o),yn(c),y.head.appendChild(c)))}}function ZH(o,c){vs.m(o,c);var h=iu;if(h&&o){var y=c&&typeof c.as=="string"?c.as:"script",w='link[rel="modulepreload"][as="'+Ni(y)+'"][href="'+Ni(o)+'"]',N=w;switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=su(o)}if(!Pi.has(N)&&(o=m({rel:"modulepreload",href:o},c),Pi.set(N,o),h.querySelector(w)===null)){switch(y){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(jf(N)))return}y=h.createElement("link"),ur(y,"link",o),yn(y),h.head.appendChild(y)}}}function XH(o,c,h){vs.S(o,c,h);var y=iu;if(y&&o){var w=Ws(y).hoistableStyles,N=au(o);c=c||"default";var z=w.get(N);if(!z){var L={loading:0,preload:null};if(z=y.querySelector(wf(N)))L.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":c},h),(h=Pi.get(N))&&Qb(o,h);var K=z=y.createElement("link");yn(K),ur(K,"link",o),K._p=new Promise(function(ae,me){K.onload=ae,K.onerror=me}),K.addEventListener("load",function(){L.loading|=1}),K.addEventListener("error",function(){L.loading|=2}),L.loading|=4,Cm(z,c,y)}z={type:"stylesheet",instance:z,count:1,state:L},w.set(N,z)}}}function JH(o,c){vs.X(o,c);var h=iu;if(h&&o){var y=Ws(h).hoistableScripts,w=su(o),N=y.get(w);N||(N=h.querySelector(jf(w)),N||(o=m({src:o,async:!0},c),(c=Pi.get(w))&&Wb(o,c),N=h.createElement("script"),yn(N),ur(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},y.set(w,N))}}function eK(o,c){vs.M(o,c);var h=iu;if(h&&o){var y=Ws(h).hoistableScripts,w=su(o),N=y.get(w);N||(N=h.querySelector(jf(w)),N||(o=m({src:o,async:!0,type:"module"},c),(c=Pi.get(w))&&Wb(o,c),N=h.createElement("script"),yn(N),ur(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},y.set(w,N))}}function lz(o,c,h,y){var w=(w=ne.current)?km(w):null;if(!w)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(c=au(h.href),h=Ws(w).hoistableStyles,y=h.get(c),y||(y={type:"style",instance:null,count:0,state:null},h.set(c,y)),y):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=au(h.href);var N=Ws(w).hoistableStyles,z=N.get(o);if(z||(w=w.ownerDocument||w,z={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(o,z),(N=w.querySelector(wf(o)))&&!N._p&&(z.instance=N,z.state.loading=5),Pi.has(o)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Pi.set(o,h),N||tK(w,o,h,z.state))),c&&y===null)throw Error(r(528,""));return z}if(c&&y!==null)throw Error(r(529,""));return null;case"script":return c=h.async,h=h.src,typeof h=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=su(h),h=Ws(w).hoistableScripts,y=h.get(c),y||(y={type:"script",instance:null,count:0,state:null},h.set(c,y)),y):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function au(o){return'href="'+Ni(o)+'"'}function wf(o){return'link[rel="stylesheet"]['+o+"]"}function cz(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function tK(o,c,h,y){o.querySelector('link[rel="preload"][as="style"]['+c+"]")?y.loading=1:(c=o.createElement("link"),y.preload=c,c.addEventListener("load",function(){return y.loading|=1}),c.addEventListener("error",function(){return y.loading|=2}),ur(c,"link",h),yn(c),o.head.appendChild(c))}function su(o){return'[src="'+Ni(o)+'"]'}function jf(o){return"script[async]"+o}function uz(o,c,h){if(c.count++,c.instance===null)switch(c.type){case"style":var y=o.querySelector('style[data-href~="'+Ni(h.href)+'"]');if(y)return c.instance=y,yn(y),y;var w=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return y=(o.ownerDocument||o).createElement("style"),yn(y),ur(y,"style",w),Cm(y,h.precedence,o),c.instance=y;case"stylesheet":w=au(h.href);var N=o.querySelector(wf(w));if(N)return c.state.loading|=4,c.instance=N,yn(N),N;y=cz(h),(w=Pi.get(w))&&Qb(y,w),N=(o.ownerDocument||o).createElement("link"),yn(N);var z=N;return z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),ur(N,"link",y),c.state.loading|=4,Cm(N,h.precedence,o),c.instance=N;case"script":return N=su(h.src),(w=o.querySelector(jf(N)))?(c.instance=w,yn(w),w):(y=h,(w=Pi.get(N))&&(y=m({},h),Wb(y,w)),o=o.ownerDocument||o,w=o.createElement("script"),yn(w),ur(w,"link",y),o.head.appendChild(w),c.instance=w);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(y=c.instance,c.state.loading|=4,Cm(y,h.precedence,o));return c.instance}function Cm(o,c,h){for(var y=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=y.length?y[y.length-1]:null,N=w,z=0;z<y.length;z++){var L=y[z];if(L.dataset.precedence===c)N=L;else if(N!==w)break}N?N.parentNode.insertBefore(o,N.nextSibling):(c=h.nodeType===9?h.head:h,c.insertBefore(o,c.firstChild))}function Qb(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.title==null&&(o.title=c.title)}function Wb(o,c){o.crossOrigin==null&&(o.crossOrigin=c.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=c.referrerPolicy),o.integrity==null&&(o.integrity=c.integrity)}var Am=null;function dz(o,c,h){if(Am===null){var y=new Map,w=Am=new Map;w.set(h,y)}else w=Am,y=w.get(h),y||(y=new Map,w.set(h,y));if(y.has(o))return y;for(y.set(o,null),h=h.getElementsByTagName(o),w=0;w<h.length;w++){var N=h[w];if(!(N[rl]||N[tt]||o==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var z=N.getAttribute(c)||"";z=o+z;var L=y.get(z);L?L.push(N):y.set(z,[N])}}return y}function fz(o,c,h){o=o.ownerDocument||o,o.head.insertBefore(h,c==="title"?o.querySelector("head > title"):null)}function nK(o,c,h){if(h===1||c.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(o=c.disabled,typeof c.precedence=="string"&&o==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function hz(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function rK(o,c,h,y){if(h.type==="stylesheet"&&(typeof y.media!="string"||matchMedia(y.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var w=au(y.href),N=c.querySelector(wf(w));if(N){c=N._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(o.count++,o=Om.bind(o),c.then(o,o)),h.state.loading|=4,h.instance=N,yn(N);return}N=c.ownerDocument||c,y=cz(y),(w=Pi.get(w))&&Qb(y,w),N=N.createElement("link"),yn(N);var z=N;z._p=new Promise(function(L,K){z.onload=L,z.onerror=K}),ur(N,"link",y),h.instance=N}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,c),(c=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Om.bind(o),c.addEventListener("load",h),c.addEventListener("error",h))}}var Yb=0;function iK(o,c){return o.stylesheets&&o.count===0&&_m(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var y=setTimeout(function(){if(o.stylesheets&&_m(o,o.stylesheets),o.unsuspend){var N=o.unsuspend;o.unsuspend=null,N()}},6e4+c);0<o.imgBytes&&Yb===0&&(Yb=62500*LH());var w=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&_m(o,o.stylesheets),o.unsuspend)){var N=o.unsuspend;o.unsuspend=null,N()}},(o.imgBytes>Yb?50:800)+c);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(y),clearTimeout(w)}}:null}function Om(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_m(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Em=null;function _m(o,c){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Em=new Map,c.forEach(aK,o),Em=null,Om.call(o))}function aK(o,c){if(!(c.state.loading&4)){var h=Em.get(o);if(h)var y=h.get(null);else{h=new Map,Em.set(o,h);for(var w=o.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<w.length;N++){var z=w[N];(z.nodeName==="LINK"||z.getAttribute("media")!=="not all")&&(h.set(z.dataset.precedence,z),y=z)}y&&h.set(null,y)}w=c.instance,z=w.getAttribute("data-precedence"),N=h.get(z)||y,N===y&&h.set(null,w),h.set(z,w),this.count++,y=Om.bind(this),w.addEventListener("load",y),w.addEventListener("error",y),N?N.parentNode.insertBefore(w,N.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(w,o.firstChild)),c.state.loading|=4}}var Sf={$$typeof:C,Provider:null,Consumer:null,_currentValue:oe,_currentValue2:oe,_threadCount:0};function sK(o,c,h,y,w,N,z,L,K){this.tag=1,this.containerInfo=o,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=Ks(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ks(0),this.hiddenUpdates=Ks(null),this.identifierPrefix=y,this.onUncaughtError=w,this.onCaughtError=N,this.onRecoverableError=z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function pz(o,c,h,y,w,N,z,L,K,ae,me,we){return o=new sK(o,c,h,z,K,ae,me,we,L),c=1,N===!0&&(c|=24),N=ai(3,null,null,c),o.current=N,N.stateNode=o,c=E0(),c.refCount++,o.pooledCache=c,c.refCount++,N.memoizedState={element:y,isDehydrated:h,cache:c},T0(N),o}function mz(o){return o?(o=Ic,o):Ic}function gz(o,c,h,y,w,N){w=mz(w),y.context===null?y.context=w:y.pendingContext=w,y=no(c),y.payload={element:h},N=N===void 0?null:N,N!==null&&(y.callback=N),h=ro(o,y,c),h!==null&&(Gr(h,o,c),ef(h,o,c))}function yz(o,c){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<c?h:c}}function Zb(o,c){yz(o,c),(o=o.alternate)&&yz(o,c)}function vz(o){if(o.tag===13||o.tag===31){var c=cl(o,67108864);c!==null&&Gr(c,o,67108864),Zb(o,67108864)}}function xz(o){if(o.tag===13||o.tag===31){var c=ui();c=Md(c);var h=cl(o,c);h!==null&&Gr(h,o,c),Zb(o,c)}}var zm=!0;function oK(o,c,h,y){var w=H.T;H.T=null;var N=J.p;try{J.p=2,Xb(o,c,h,y)}finally{J.p=N,H.T=w}}function lK(o,c,h,y){var w=H.T;H.T=null;var N=J.p;try{J.p=8,Xb(o,c,h,y)}finally{J.p=N,H.T=w}}function Xb(o,c,h,y){if(zm){var w=Jb(y);if(w===null)Lb(o,c,y,Pm,h),wz(o,y);else if(uK(w,o,c,h,y))y.stopPropagation();else if(wz(o,y),c&4&&-1<cK.indexOf(o)){for(;w!==null;){var N=Xi(w);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var z=En(N.pendingLanes);if(z!==0){var L=N;for(L.pendingLanes|=2,L.entangledLanes|=2;z;){var K=1<<31-de(z);L.entanglements[1]|=K,z&=~K}Ca(N),(zt&6)===0&&(pm=mt()+500,yf(0))}}break;case 31:case 13:L=cl(N,2),L!==null&&Gr(L,N,2),gm(),Zb(N,2)}if(N=Jb(y),N===null&&Lb(o,c,y,Pm,h),N===w)break;w=N}w!==null&&y.stopPropagation()}else Lb(o,c,y,null,h)}}function Jb(o){return o=t0(o),ew(o)}var Pm=null;function ew(o){if(Pm=null,o=ji(o),o!==null){var c=a(o);if(c===null)o=null;else{var h=c.tag;if(h===13){if(o=l(c),o!==null)return o;o=null}else if(h===31){if(o=u(c),o!==null)return o;o=null}else if(h===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;o=null}else c!==o&&(o=null)}}return Pm=o,null}function bz(o){switch(o){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(Je()){case ce:return 2;case Ne:return 8;case Me:case Ge:return 32;case pt:return 268435456;default:return 32}default:return 32}}var tw=!1,mo=null,go=null,yo=null,Nf=new Map,kf=new Map,vo=[],cK="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 wz(o,c){switch(o){case"focusin":case"focusout":mo=null;break;case"dragenter":case"dragleave":go=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":Nf.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":kf.delete(c.pointerId)}}function Cf(o,c,h,y,w,N){return o===null||o.nativeEvent!==N?(o={blockedOn:c,domEventName:h,eventSystemFlags:y,nativeEvent:N,targetContainers:[w]},c!==null&&(c=Xi(c),c!==null&&vz(c)),o):(o.eventSystemFlags|=y,c=o.targetContainers,w!==null&&c.indexOf(w)===-1&&c.push(w),o)}function uK(o,c,h,y,w){switch(c){case"focusin":return mo=Cf(mo,o,c,h,y,w),!0;case"dragenter":return go=Cf(go,o,c,h,y,w),!0;case"mouseover":return yo=Cf(yo,o,c,h,y,w),!0;case"pointerover":var N=w.pointerId;return Nf.set(N,Cf(Nf.get(N)||null,o,c,h,y,w)),!0;case"gotpointercapture":return N=w.pointerId,kf.set(N,Cf(kf.get(N)||null,o,c,h,y,w)),!0}return!1}function jz(o){var c=ji(o.target);if(c!==null){var h=a(c);if(h!==null){if(c=h.tag,c===13){if(c=l(h),c!==null){o.blockedOn=c,Q(o.priority,function(){xz(h)});return}}else if(c===31){if(c=u(h),c!==null){o.blockedOn=c,Q(o.priority,function(){xz(h)});return}}else if(c===3&&h.stateNode.current.memoizedState.isDehydrated){o.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Tm(o){if(o.blockedOn!==null)return!1;for(var c=o.targetContainers;0<c.length;){var h=Jb(o.nativeEvent);if(h===null){h=o.nativeEvent;var y=new h.constructor(h.type,h);e0=y,h.target.dispatchEvent(y),e0=null}else return c=Xi(h),c!==null&&vz(c),o.blockedOn=h,!1;c.shift()}return!0}function Sz(o,c,h){Tm(o)&&h.delete(c)}function dK(){tw=!1,mo!==null&&Tm(mo)&&(mo=null),go!==null&&Tm(go)&&(go=null),yo!==null&&Tm(yo)&&(yo=null),Nf.forEach(Sz),kf.forEach(Sz)}function Rm(o,c){o.blockedOn===c&&(o.blockedOn=null,tw||(tw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,dK)))}var Dm=null;function Nz(o){Dm!==o&&(Dm=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Dm===o&&(Dm=null);for(var c=0;c<o.length;c+=3){var h=o[c],y=o[c+1],w=o[c+2];if(typeof y!="function"){if(ew(y||h)===null)continue;break}var N=Xi(h);N!==null&&(o.splice(c,3),c-=3,J0(N,{pending:!0,data:w,method:h.method,action:y},y,w))}}))}function ou(o){function c(K){return Rm(K,o)}mo!==null&&Rm(mo,o),go!==null&&Rm(go,o),yo!==null&&Rm(yo,o),Nf.forEach(c),kf.forEach(c);for(var h=0;h<vo.length;h++){var y=vo[h];y.blockedOn===o&&(y.blockedOn=null)}for(;0<vo.length&&(h=vo[0],h.blockedOn===null);)jz(h),h.blockedOn===null&&vo.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(y=0;y<h.length;y+=3){var w=h[y],N=h[y+1],z=w[St]||null;if(typeof N=="function")z||Nz(h);else if(z){var L=null;if(N&&N.hasAttribute("formAction")){if(w=N,z=N[St]||null)L=z.formAction;else if(ew(w)!==null)continue}else L=z.action;typeof L=="function"?h[y+1]=L:(h.splice(y,3),y-=3),Nz(h)}}}function kz(){function o(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(z){return w=z})},focusReset:"manual",scroll:"manual"})}function c(){w!==null&&(w(),w=null),y||setTimeout(h,20)}function h(){if(!y&&!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 y=!1,w=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(h,100),function(){y=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),w!==null&&(w(),w=null)}}}function nw(o){this._internalRoot=o}Mm.prototype.render=nw.prototype.render=function(o){var c=this._internalRoot;if(c===null)throw Error(r(409));var h=c.current,y=ui();gz(h,y,o,c,null,null)},Mm.prototype.unmount=nw.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var c=o.containerInfo;gz(o.current,2,null,o,null,null),gm(),c[_n]=null}};function Mm(o){this._internalRoot=o}Mm.prototype.unstable_scheduleHydration=function(o){if(o){var c=Ld();o={blockedOn:null,target:o,priority:c};for(var h=0;h<vo.length&&c!==0&&c<vo[h].priority;h++);vo.splice(h,0,o),h===0&&jz(o)}};var Cz=t.version;if(Cz!=="19.2.4")throw Error(r(527,Cz,"19.2.4"));J.findDOMNode=function(o){var c=o._reactInternals;if(c===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(c),o=o!==null?p(o):null,o=o===null?null:o.stateNode,o};var fK={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Im=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Im.isDisabled&&Im.supportsFiber)try{gn=Im.inject(fK),We=Im}catch{}}return Of.createRoot=function(o,c){if(!i(o))throw Error(r(299));var h=!1,y="",w=TE,N=RE,z=DE;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onUncaughtError!==void 0&&(w=c.onUncaughtError),c.onCaughtError!==void 0&&(N=c.onCaughtError),c.onRecoverableError!==void 0&&(z=c.onRecoverableError)),c=pz(o,1,!1,null,null,h,y,null,w,N,z,kz),o[_n]=c.current,Ib(o),new nw(c)},Of.hydrateRoot=function(o,c,h){if(!i(o))throw Error(r(299));var y=!1,w="",N=TE,z=RE,L=DE,K=null;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(w=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(z=h.onCaughtError),h.onRecoverableError!==void 0&&(L=h.onRecoverableError),h.formState!==void 0&&(K=h.formState)),c=pz(o,1,!0,c,h??null,y,w,K,N,z,L,kz),c.context=mz(null),h=c.current,y=ui(),y=Md(y),w=no(y),w.callback=null,ro(h,w,y),h=y,c.current.lanes=h,Gs(c,h),Ca(c),o[_n]=c.current,Ib(o),new Mm(c)},Of.version="19.2.4",Of}var Mz;function jK(){if(Mz)return aw.exports;Mz=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=wK(),aw.exports}var SK=jK(),mc=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(){}},NK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},kK=class{#t=NK;#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)}},Rl=new kK;function CK(e){setTimeout(e,0)}var Xl=typeof window>"u"||"Deno"in globalThis;function br(){}function AK(e,t){return typeof e=="function"?e(t):e}function TS(e){return typeof e=="number"&&e>=0&&e!==1/0}function qL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Do(e,t){return typeof e=="function"?e(t):e}function Ii(e,t){return typeof e=="function"?e(t):e}function Iz(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:u}=e;if(l){if(r){if(t.queryHash!==CN(l,t.options))return!1}else if(!mh(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||a&&!a(t))}function Lz(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Jl(t.options.mutationKey)!==Jl(a))return!1}else if(!mh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function CN(e,t){return(t?.queryKeyHashFn||Jl)(e)}function Jl(e){return JSON.stringify(e,(t,n)=>RS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function mh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>mh(e[n],t[n])):!1}var OK=Object.prototype.hasOwnProperty;function AN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=$z(e)&&$z(t);if(!r&&!(RS(e)&&RS(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),u=l.length,d=r?new Array(u):{};let f=0;for(let p=0;p<u;p++){const m=r?p:l[p],g=e[m],v=t[m];if(g===v){d[m]=g,(r?p<a:OK.call(e,m))&&f++;continue}if(g===null||v===null||typeof g!="object"||typeof v!="object"){d[m]=v;continue}const j=AN(g,v,n+1);d[m]=j,j===g&&f++}return a===u&&f===a?e:d}function gh(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 $z(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function RS(e){if(!Bz(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Bz(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Bz(e){return Object.prototype.toString.call(e)==="[object Object]"}function EK(e){return new Promise(t=>{Rl.setTimeout(t,e)})}function DS(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?AN(e,t):t}function _K(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function zK(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ON=Symbol();function FL(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ON?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function EN(e,t){return typeof e=="function"?e(...t):!!e}function PK(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 TK=class extends mc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Xl&&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"}},_N=new TK;function MS(){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 RK=CK;function DK(){let e=[],t=0,n=u=>{u()},r=u=>{u()},i=RK;const a=u=>{t?e.push(u):i(()=>{n(u)})},l=()=>{const u=e;e=[],u.length&&i(()=>{r(()=>{u.forEach(d=>{n(d)})})})};return{batch:u=>{let d;t++;try{d=u()}finally{t--,t||l()}return d},batchCalls:u=>(...d)=>{a(()=>{u(...d)})},schedule:a,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var Cn=DK(),MK=class extends mc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Xl&&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}},Vg=new MK;function IK(e){return Math.min(1e3*2**e,3e4)}function HL(e){return(e??"online")==="online"?Vg.isOnline():!0}var IS=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function KL(e){let t=!1,n=0,r;const i=MS(),a=()=>i.status!=="pending",l=b=>{if(!a()){const S=new IS(b);g(S),e.onCancel?.(S)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>_N.isFocused()&&(e.networkMode==="always"||Vg.isOnline())&&e.canRun(),p=()=>HL(e.networkMode)&&e.canRun(),m=b=>{a()||(r?.(),i.resolve(b))},g=b=>{a()||(r?.(),i.reject(b))},v=()=>new Promise(b=>{r=S=>{(a()||f())&&b(S)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),j=()=>{if(a())return;let b;const S=n===0?e.initialPromise:void 0;try{b=S??e.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(m).catch(k=>{if(a())return;const E=e.retry??(Xl?0:3),C=e.retryDelay??IK,A=typeof C=="function"?C(n,k):C,P=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!P){g(k);return}n++,e.onFail?.(n,k),EK(A).then(()=>f()?void 0:v()).then(()=>{t?g(k):j()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?j():v().then(j),i)}}var GL=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),TS(this.gcTime)&&(this.#t=Rl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xl?1/0:300*1e3))}clearGcTimeout(){this.#t&&(Rl.clearTimeout(this.#t),this.#t=void 0)}},LK=class extends GL{#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=qz(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=qz(this.options);t.data!==void 0&&(this.setState(Uz(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=DS(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(br).catch(br):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>Ii(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ON||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Do(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:!qL(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 u=this.observers.find(d=>d.options.queryFn);u&&this.setOptions(u.options)}const n=new AbortController,r=u=>{Object.defineProperty(u,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const u=FL(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(u,f,this):u(f)},l=(()=>{const u={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(u),u})();this.options.behavior?.onFetch(l,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==l.fetchOptions?.meta)&&this.#s({type:"fetch",meta:l.fetchOptions?.meta}),this.#r=KL({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:u=>{u instanceof IS&&u.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(u,d)=>{this.#s({type:"failed",failureCount:u,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const u=await this.#r.start();if(u===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(u),this.#n.config.onSuccess?.(u,this),this.#n.config.onSettled?.(u,this.state.error,this),u}catch(u){if(u instanceof IS){if(u.silent)return this.#r.promise;if(u.revert){if(this.state.data===void 0)throw u;return this.state.data}}throw this.#s({type:"error",error:u}),this.#n.config.onError?.(u,this),this.#n.config.onSettled?.(this.state.data,u,this),u}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,...VL(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...Uz(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),Cn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function VL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Uz(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function qz(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 zN=class extends mc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=MS(),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),Fz(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return LS(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return LS(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 Ii(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!gh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&Hz(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||Ii(this.options.enabled,this.#e)!==Ii(t.enabled,this.#e)||Do(this.options.staleTime,this.#e)!==Do(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||Ii(this.options.enabled,this.#e)!==Ii(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 BK(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.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(br)),t}#g(){this.#b();const e=Do(this.options.staleTime,this.#e);if(Xl||this.#i.isStale||!TS(e))return;const n=qL(this.#i.dataUpdatedAt,e)+1;this.#c=Rl.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,!(Xl||Ii(this.options.enabled,this.#e)===!1||!TS(this.#l)||this.#l===0)&&(this.#u=Rl.setInterval(()=>{(this.options.refetchIntervalInBackground||_N.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&(Rl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(Rl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#i,a=this.#r,l=this.#a,d=e!==n?e.state:this.#n,{state:f}=e;let p={...f},m=!1,g;if(t._optimisticResults){const T=this.hasListeners(),$=!T&&Fz(e,t),F=T&&Hz(e,n,t,r);($||F)&&(p={...p,...VL(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:j,status:b}=p;g=p.data;let S=!1;if(t.placeholderData!==void 0&&g===void 0&&b==="pending"){let T;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(T=i.data,S=!0):T=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,T!==void 0&&(b="success",g=DS(i?.data,T,t),m=!0)}if(t.select&&g!==void 0&&!S)if(i&&g===a?.data&&t.select===this.#p)g=this.#d;else try{this.#p=t.select,g=t.select(g),g=DS(i?.data,g,t),this.#d=g,this.#s=null}catch(T){this.#s=T}this.#s&&(v=this.#s,g=this.#d,j=Date.now(),b="error");const k=p.fetchStatus==="fetching",E=b==="pending",C=b==="error",A=E&&k,P=g!==void 0,_={status:b,fetchStatus:p.fetchStatus,isPending:E,isSuccess:b==="success",isError:C,isInitialLoading:A,isLoading:A,data:g,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:j,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&&!P,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:C&&P,isStale:PN(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Ii(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const T=_.data!==void 0,$=_.status==="error"&&!T,F=V=>{$?V.reject(_.error):T&&V.resolve(_.data)},U=()=>{const V=this.#o=_.promise=MS();F(V)},B=this.#o;switch(B.status){case"pending":e.queryHash===n.queryHash&&F(B);break;case"fulfilled":($||_.data!==B.value)&&U();break;case"rejected":(!$||_.error!==B.reason)&&U();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),gh(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(l=>{const u=l;return this.#i[u]!==e[u]&&a.has(u)})};this.#S({listeners:n()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#S(e){Cn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function $K(e,t){return Ii(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Fz(e,t){return $K(e,t)||e.state.data!==void 0&&LS(e,t,t.refetchOnMount)}function LS(e,t,n){if(Ii(t.enabled,e)!==!1&&Do(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&PN(e,t)}return!1}function Hz(e,t,n,r){return(e!==t||Ii(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&PN(e,n)}function PN(e,t){return Ii(t.enabled,e)!==!1&&e.isStaleByTime(Do(t.staleTime,e))}function BK(e,t){return!gh(e.getCurrentResult(),t)}function Kz(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],l=t.state.data?.pageParams||[];let u={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=j=>{PK(j,()=>t.signal,()=>p=!0)},g=FL(t.options,t.fetchOptions),v=async(j,b,S)=>{if(p)return Promise.reject();if(b==null&&j.pages.length)return Promise.resolve(j);const E=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:S?"backward":"forward",meta:t.options.meta};return m(O),O})(),C=await g(E),{maxPages:A}=t.options,P=S?zK:_K;return{pages:P(j.pages,C,A),pageParams:P(j.pageParams,b,A)}};if(i&&a.length){const j=i==="backward",b=j?UK:Gz,S={pages:a,pageParams:l},k=b(r,S);u=await v(S,k,j)}else{const j=e??a.length;do{const b=d===0?l[0]??r.initialPageParam:Gz(r,u);if(d>0&&b==null)break;u=await v(u,b),d++}while(d<j)}return u};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 Gz(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 UK(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var qK=class extends GL{#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||QL(),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=KL({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,l)=>{this.#r({type:"failed",failureCount:a,error:l})},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 l=await this.options.onMutate?.(e,n);l!==this.state.context&&this.#r({type:"pending",context:l,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(l){Promise.reject(l)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(l){Promise.reject(l)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(l){Promise.reject(l)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(l){Promise.reject(l)}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),Cn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function QL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var WL=class extends mc{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 qK({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=Lm(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=Lm(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=Lm(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=Lm(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Cn.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=>Lz(t,n))}findAll(e={}){return this.getAll().filter(t=>Lz(e,t))}notify(e){Cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Cn.batch(()=>Promise.all(e.map(t=>t.continue().catch(br))))}};function Lm(e){return e.options.scope?.id}var FK=class extends mc{#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),gh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Jl(n.mutationKey)!==Jl(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??QL();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){Cn.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 Vz(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function HK(e,t,n){const r=e.slice(0);return r[t]=n,r}var KK=class extends mc{#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,Cn.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()),l=n.length!==i.length,u=i.some((p,m)=>p!==n[m]),d=l||u,f=d?!0:a.some((p,m)=>{const g=this.#e[m];return!g||!gh(p,g)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(Vz(n,i).forEach(p=>{p.destroy()}),Vz(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(l=>{l.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,l)=>a!==r[l]));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=AN(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),l=t.get(i.queryHash)?.shift()??new zN(this.#t,i);n.push({defaultedQueryOptions:i,observer:l})}),n}#l(e,t){const n=this.#r.indexOf(e);n!==-1&&(this.#e=HK(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&&Cn.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},GK=class extends mc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??CN(r,t);let a=this.get(i);return a||(a=new LK({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(){Cn.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=>Iz(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Iz(e,n)):t}notify(e){Cn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Cn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},VK=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new GK,this.#e=e.mutationCache||new WL,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=_N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Vg.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(Do(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,l=AK(t,a);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Cn.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;Cn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Cn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Cn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(br).catch(br)}invalidateQueries(e,t={}){return Cn.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=Cn.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(br)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(br)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Do(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(br).catch(br)}fetchInfiniteQuery(e){return e.behavior=Kz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(br).catch(br)}ensureInfiniteQueryData(e){return e.behavior=Kz(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vg.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(Jl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{mh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Jl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{mh(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=CN(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===ON&&(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()}},YL=x.createContext(void 0),xi=e=>{const t=x.useContext(YL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},QK=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(YL.Provider,{value:e,children:t})),ZL=x.createContext(!1),XL=()=>x.useContext(ZL);ZL.Provider;function WK(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var YK=x.createContext(WK()),JL=()=>x.useContext(YK),e5=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?EN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},t5=e=>{x.useEffect(()=>{e.clearReset()},[e])},n5=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||EN(n,[e.error,r])),r5=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))}},ZK=(e,t)=>e.isLoading&&e.isFetching&&!t,$S=(e,t)=>e?.suspense&&t.isPending,BS=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function XK({queries:e,...t},n){const r=xi(),i=XL(),a=JL(),l=x.useMemo(()=>e.map(b=>{const S=r.defaultQueryOptions(b);return S._optimisticResults=i?"isRestoring":"optimistic",S}),[e,r,i]);l.forEach(b=>{r5(b);const S=r.getQueryCache().get(b.queryHash);e5(b,a,S)}),t5(a);const[u]=x.useState(()=>new KK(r,l,t)),[d,f,p]=u.getOptimisticResult(l,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?u.subscribe(Cn.batchCalls(b)):br,[u,m]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setQueries(l,t)},[l,t,u]);const v=d.some((b,S)=>$S(l[S],b))?d.flatMap((b,S)=>{const k=l[S];if(k&&$S(k,b)){const E=new zN(r,k);return BS(k,E,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const j=d.find((b,S)=>{const k=l[S];return k&&n5({result:b,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(j?.error)throw j.error;return f(p())}function JK(e,t,n){const r=XL(),i=JL(),a=xi(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const u=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",r5(l),e5(l,i,u),t5(i);const d=!a.getQueryCache().get(l.queryHash),[f]=x.useState(()=>new t(a,l)),p=f.getOptimisticResult(l),m=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(g=>{const v=m?f.subscribe(Cn.batchCalls(g)):br;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(l)},[l,f]),$S(l,p))throw BS(l,f,i);if(n5({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!Xl&&ZK(p,r)&&(d?BS(l,f,i):u?.promise)?.catch(br).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?p:f.trackResult(p)}function ca(e,t){return JK(e,zN)}function Fh(e,t){const n=xi(),[r]=x.useState(()=>new FK(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(Cn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((l,u)=>{r.mutate(l,u).catch(br)},[r]);if(i.error&&EN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $m=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 e7(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 t7(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var n7=!1;function yh(e){return e[e.length-1]}function r7(e){return typeof e=="function"}function zo(e,t){return r7(e)?e(t):e}var i7=Object.prototype.hasOwnProperty,Qz=Object.prototype.propertyIsEnumerable,a7=()=>Object.create(null),jl=(e,t)=>Dl(e,t,a7);function Dl(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=Zz(e)&&Zz(i);if(!a&&!(Qg(e)&&Qg(i)))return i;const l=a?e:Wz(e);if(!l)return i;const u=a?i:Wz(i);if(!u)return i;const d=l.length,f=u.length,p=a?new Array(f):n();let m=0;for(let g=0;g<f;g++){const v=a?g:u[g],j=e[v],b=i[v];if(j===b){p[v]=j,(a?g<d:i7.call(e,v))&&m++;continue}if(j===null||b===null||typeof j!="object"||typeof b!="object"){p[v]=b;continue}const S=Dl(j,b,n,r+1);p[v]=S,S===j&&m++}return d===f&&m===d?e:p}function Wz(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!Qz.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(!Qz.call(e,i))return!1;r.push(i)}return r}function Qg(e){if(!Yz(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Yz(n)||!n.hasOwnProperty("isPrototypeOf"))}function Yz(e){return Object.prototype.toString.call(e)==="[object Object]"}function Zz(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hl(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(!Hl(e[r],t[r],n))return!1;return!0}if(Qg(e)&&Qg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Hl(e[l],t[l],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let a=0;for(const l in t)if((!r||t[l]!==void 0)&&(a++,a>i||!Hl(e[l],t[l],n)))return!1;return i===a}return!1}function Qu(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 vh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function s7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Xz(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 s7(t)}var o7=["http:","https:","mailto:","tel:"];function Wg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Ef(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+=Xz(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+Xz(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function l7(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Yg(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 l=t.get(a);if(l)return i(l),l.value},set(a,l){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 u=t.get(a);if(u)u.value=l,i(u);else{const d={key:a,value:l,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 c7="Invariant failed";function _s(e,t){if(!e)throw new Error(c7)}var Ml=4,i5=5;function u7(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 TN(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 u=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=u,n[4]=u,n[5]=u,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 l=u7(a);if(l){const[u,d]=l,f=a.charCodeAt(u+1);if(f===45){if(u+2<a.length&&a.charCodeAt(u+2)===36){const p=u+3,m=d;if(p<m)return n[0]=3,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=u+1,m=u+2;return m===d?(n[0]=2,n[1]=t+u,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+u,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 wv(e,t,n,r,i,a,l){l?.(n);let u=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(;u<f;){const v=TN(d,u,t);let j;const b=u,S=v[5];switch(u=S+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const E=i.static?.get(k);if(E)j=E;else{i.static??=new Map;const C=Il(n.fullPath??n.from);C.parent=i,C.depth=a,j=C,i.static.set(k,C)}}else{const E=k.toLowerCase(),C=i.staticInsensitive?.get(E);if(C)j=C;else{i.staticInsensitive??=new Map;const A=Il(n.fullPath??n.from);A.parent=i,A.depth=a,j=A,i.staticInsensitive.set(E,A)}}break}case 1:{const k=d.substring(b,v[1]),E=d.substring(v[4],S),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,P=E?C?E:E.toLowerCase():void 0,O=!m&&i.dynamic?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===P);if(O)j=O;else{const _=dw(1,n.fullPath??n.from,C,A,P);j=_,_.depth=a,_.parent=i,i.dynamic??=[],i.dynamic.push(_)}break}case 3:{const k=d.substring(b,v[1]),E=d.substring(v[4],S),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,P=E?C?E:E.toLowerCase():void 0,O=!m&&i.optional?.find(_=>!_.skipOnParamError&&_.caseSensitive===C&&_.prefix===A&&_.suffix===P);if(O)j=O;else{const _=dw(3,n.fullPath??n.from,C,A,P);j=_,_.parent=i,_.depth=a,i.optional??=[],i.optional.push(_)}break}case 2:{const k=d.substring(b,v[1]),E=d.substring(v[4],S),C=p&&!!(k||E),A=k?C?k:k.toLowerCase():void 0,P=E?C?E:E.toLowerCase():void 0,O=dw(2,n.fullPath??n.from,C,A,P);j=O,O.parent=i,O.depth=a,i.wildcard??=[],i.wildcard.push(O)}}i=j}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=Il(n.fullPath??n.from);v.kind=i5,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const g=(n.path||!n.children)&&!n.isRoot;if(g&&d.endsWith("/")){const v=Il(n.fullPath??n.from);v.kind=Ml,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,g&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)wv(e,t,d,u,i,a,l)}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 ko(e){if(e.pathless)for(const t of e.pathless)ko(t);if(e.static)for(const t of e.static.values())ko(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())ko(t);if(e.dynamic?.length){e.dynamic.sort(uw);for(const t of e.dynamic)ko(t)}if(e.optional?.length){e.optional.sort(uw);for(const t of e.optional)ko(t)}if(e.wildcard?.length){e.wildcard.sort(uw);for(const t of e.wildcard)ko(t)}}function Il(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 d7(e,t){const n=Il("/"),r=new Uint16Array(6);for(const i of e)wv(!1,r,i,1,n,0);ko(n),t.masksTree=n,t.flatCache=Yg(1e3)}function f7(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=RN(e,t.masksTree);return t.flatCache.set(e,r),r}function h7(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=Il("/"),wv(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),RN(r,l,n)}function p7(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=RN(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=y7(a.route)),t.matchCache.set(r,a),a}function m7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function g7(e,t=!1,n){const r=Il(e.fullPath),i=new Uint16Array(6),a={},l={};let u=0;return wv(t,i,e,1,r,0,d=>{if(n?.(d,u),_s(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,u!==0&&d.path){const f=m7(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}u++}),ko(r),{processedTree:{segmentTree:r,singleCache:Yg(1e3),matchCache:Yg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function RN(e,t,n=!1){const r=e.split("/"),i=x7(e,r,t,n);if(!i)return null;const[a]=a5(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function a5(e,t,n){const r=v7(n.node);let i=null;const a=Object.create(null);let l=n.extract?.part??0,u=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;u<r.length;l++,u++,d++,f++){const p=r[u];if(p.kind===Ml)break;if(p.kind===i5){f--,l--,d--;continue}const m=t[l],g=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],j=p.prefix?.length??0;if(v.charCodeAt(j)===123){const b=p.suffix?.length??0,S=v.substring(j+2,v.length-b-1),k=m.substring(j,m.length-b);a[S]=decodeURIComponent(k)}else{const b=v.substring(1);a[b]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<u){l--,d=g-1;continue}i??=n.node.fullPath.split("/");const v=i[f],j=p.prefix?.length??0,b=p.suffix?.length??0,S=v.substring(j+3,v.length-b-1),k=p.suffix||p.prefix?m.substring(j,m.length-b):m;k&&(a[S]=decodeURIComponent(k))}else if(p.kind===2){const v=p,j=e.substring(g+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),b=decodeURIComponent(j);a["*"]=b,a._splat=b;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:u,path:d,segment:f}]}function y7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function v7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function x7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!yh(t),a=i&&e!=="/",l=t.length-(i?1:0),u=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;u.length;){const m=u.pop(),{node:g,index:v,skipped:j,depth:b,statics:S,dynamics:k,optionals:E}=m;let{extract:C,rawParams:A,parsedParams:P}=m;if(g.skipOnParamError){if(!fw(e,t,m))continue;A=m.rawParams,C=m.extract,P=m.parsedParams}r&&g.route&&g.kind!==Ml&&_f(f,m)&&(f=m);const O=v===l;if(O&&(g.route&&!a&&_f(p,m)&&(p=m),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const _=O?void 0:t[v];let T;if(O&&g.index){const $={node:g.index,index:v,skipped:j,depth:b+1,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P};let F=!0;if(g.index.skipOnParamError&&(fw(e,t,$)||(F=!1)),F){if(S===l&&!k&&!E&&!j)return $;_f(p,$)&&(p=$)}}if(g.wildcard&&_f(d,m))for(const $ of g.wildcard){const{prefix:F,suffix:U}=$;if(F&&(O||!($.caseSensitive?_:T??=_.toLowerCase()).startsWith(F)))continue;if(U){if(O)continue;const V=t.slice(v).join("/").slice(-U.length);if(($.caseSensitive?V:V.toLowerCase())!==U)continue}const B={node:$,index:l,skipped:j,depth:b,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P};if(!($.skipOnParamError&&!fw(e,t,B))){d=B;break}}if(g.optional){const $=j|1<<b,F=b+1;for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U];u.push({node:B,index:v,skipped:$,depth:F,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(!O)for(let U=g.optional.length-1;U>=0;U--){const B=g.optional[U],{prefix:V,suffix:X}=B;if(V||X){const Z=B.caseSensitive?_:T??=_.toLowerCase();if(V&&!Z.startsWith(V)||X&&!Z.endsWith(X))continue}u.push({node:B,index:v+1,skipped:j,depth:F,statics:S,dynamics:k,optionals:E+1,extract:C,rawParams:A,parsedParams:P})}}if(!O&&g.dynamic&&_)for(let $=g.dynamic.length-1;$>=0;$--){const F=g.dynamic[$],{prefix:U,suffix:B}=F;if(U||B){const V=F.caseSensitive?_:T??=_.toLowerCase();if(U&&!V.startsWith(U)||B&&!V.endsWith(B))continue}u.push({node:F,index:v+1,skipped:j,depth:b+1,statics:S,dynamics:k+1,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(!O&&g.staticInsensitive){const $=g.staticInsensitive.get(T??=_.toLowerCase());$&&u.push({node:$,index:v+1,skipped:j,depth:b+1,statics:S+1,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(!O&&g.static){const $=g.static.get(_);$&&u.push({node:$,index:v+1,skipped:j,depth:b+1,statics:S+1,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}if(g.pathless){const $=b+1;for(let F=g.pathless.length-1;F>=0;F--){const U=g.pathless[F];u.push({node:U,index:v,skipped:j,depth:$,statics:S,dynamics:k,optionals:E,extract:C,rawParams:A,parsedParams:P})}}}if(p&&d)return _f(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 g=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(g),f}return null}function fw(e,t,n){try{const[r,i]=a5(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 _f(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===Ml)>(e.node.kind===Ml)||t.node.kind===Ml==(e.node.kind===Ml)&&t.depth>e.depth))):!0}function zg(e){return DN(e.filter(t=>t!==void 0).join("/"))}function DN(e){return e.replace(/\/{2,}/g,"/")}function s5(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Mo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function o5(e){return Mo(s5(e))}function Zg(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function b7(e,t,n){return Zg(e,n)===Zg(t,n)}function w7({base:e,to:t,trailingSlash:n="never",cache:r}){const i=t.startsWith("/"),a=!i&&t===".";let l;if(r){l=i?t:a?e:e+"\0"+t;const m=r.get(l);if(m)return m}let u;if(a)u=e.split("/");else if(i)u=t.split("/");else{for(u=e.split("/");u.length>1&&yh(u)==="";)u.pop();const m=t.split("/");for(let g=0,v=m.length;g<v;g++){const j=m[g];j===""?g?g===v-1&&u.push(j):u=[j]:j===".."?u.pop():j==="."||u.push(j)}}u.length>1&&(yh(u)===""?n==="never"&&u.pop():n==="always"&&u.push(""));let d,f="";for(let m=0;m<u.length;m++){m>0&&(f+="/");const g=u[m];if(!g)continue;d=TN(g,0,d);const v=d[0];if(v===0){f+=g;continue}const j=d[5],b=g.substring(0,d[1]),S=g.substring(d[4],j),k=g.substring(d[2],d[3]);v===1?f+=b||S?`${b}{$${k}}${S}`:`$${k}`:v===2?f+=b||S?`${b}{$}${S}`:"$":f+=`${b}{-$${k}}${S}`}f=DN(f);const p=f||"/";return l&&r&&r.set(l,p),p}function j7(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=>e2(i,n)).join("/"):e2(r,n)}function Jz({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 l=e.length;let u=0,d,f="";for(;u<l;){const p=u;d=TN(e,p,d);const m=d[5];if(u=m+1,p===m)continue;const g=d[0];if(g===0){f+="/"+e.substring(p,m);continue}if(g===2){const v=t._splat;a._splat=v,a["*"]=v;const j=e.substring(p,d[1]),b=e.substring(d[4],m);if(!v){i=!0,(j||b)&&(f+="/"+j+b);continue}const S=hw("_splat",t,n);f+="/"+j+S+b;continue}if(g===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const j=e.substring(p,d[1]),b=e.substring(d[4],m),S=hw(v,t,n)??"undefined";f+="/"+j+S+b;continue}if(g===3){const v=e.substring(d[2],d[3]),j=t[v];if(j==null)continue;a[v]=j;const b=e.substring(p,d[1]),S=e.substring(d[4],m),k=hw(v,t,n)??"";f+="/"+b+k+S;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function e2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Dr(e){return!!e?.isNotFound}function S7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var US="tsr-scroll-restoration-v1_3",N7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function k7(){const e=S7();if(!e)return null;const t=e.getItem(US);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=zo(r,n)||n;try{e.setItem(US,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var Bm=k7(),C7=e=>e.state.__TSR_key||e.href;function A7(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 Xg=!1;function O7({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(f){console.error(f);return}const u=t||window.history.state?.__TSR_key,d=l[u];Xg=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const g=d[m];if(m==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=g.scrollX,v.scrollTop=g.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const g=document.getElementById(f);g&&g.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 g=typeof m=="function"?m():document.querySelector(m);g&&g.scrollTo(p)}}Xg=!1}function E7(e,t){if(!Bm||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Bm))return;e.isScrollRestorationSetup=!0,Xg=!1;const n=e.options.getScrollRestorationKey||C7;window.history.scrollRestoration="manual";const r=i=>{if(Xg||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const u=i.target.getAttribute("data-scroll-restoration-id");u?a=`[data-scroll-restoration-id="${u}"]`:a=A7(i.target)}const l=n(e.state.location);Bm.set(u=>{const d=u[l]||={},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 u})};typeof document<"u"&&document.addEventListener("scroll",N7(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})||(O7({storageKey:US,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Bm.set(l=>(l[a]||={},l)))})}function _7(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 z7(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 P7(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 T7=D7(JSON.parse),R7=M7(JSON.stringify,JSON.parse);function D7(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=P7(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function M7(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=z7(i,r);return a?`?${a}`:""}}var Kl="__root__";function MN(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 Qr(e){return e instanceof Response&&!!e.options}function I7(e){return{input:({url:t})=>{for(const n of e)t=qS(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=l5(e[n],t);return t}}}function L7(e){const t=o5(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===i?l.pathname="/":u.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=zg(["/",t,l.pathname]),l)}}function qS(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 l5(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 dn=(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))(dn||{});function c5({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:u};function r(f,p,m){const g=p.depsTail;if(g!==void 0&&g.dep===f)return;const v=g!==void 0?g.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const j=f.subsTail;if(j!==void 0&&j.version===m&&j.sub===p)return;const b=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:g,nextDep:v,prevSub:j,nextSub:void 0};v!==void 0&&(v.prevDep=b),g!==void 0?g.nextDep=b:p.deps=b,j!==void 0?j.nextSub=b:f.subs=b}function i(f,p=f.sub){const m=f.dep,g=f.prevDep,v=f.nextDep,j=f.nextSub,b=f.prevSub;return v!==void 0?v.prevDep=g:p.depsTail=g,g!==void 0?g.nextDep=v:p.deps=v,j!==void 0?j.prevSub=b:m.subsTail=b,b!==void 0?b.nextSub=j:(m.subs=j)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const g=f.sub;let v=g.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,g)?(g.flags=v|40,v&=1):v=0:g.flags=v&-9|32:v=0:g.flags=v|32,v&2&&t(g),v&1){const j=g.subs;if(j!==void 0){const b=(f=j).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 l(f,p){let m,g=0,v=!1;e:do{const j=f.dep,b=j.flags;if(p.flags&16)v=!0;else if((b&17)===17){if(e(j)){const S=j.subs;S.nextSub!==void 0&&u(S),v=!0}}else if((b&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=j.deps,p=j,++g;continue}if(!v){const S=f.nextDep;if(S!==void 0){f=S;continue}}for(;g--;){const S=p.subs,k=S.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=S,v){if(e(p)){k&&u(S),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 u(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 IN=0,Sl=0,ih=0;const ws=[],{link:eze,unlink:u5,propagate:tze,checkDirty:$7,shallowPropagate:nze}=c5({update(e){return e.depsTail!==void 0?F7(e):H7(e)},notify(e){let t=ih,n=t;do if(ws[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ih=t;n<--t;){const r=ws[n];ws[n++]=ws[t],ws[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,jv(e)):V7.call(e)}});function B7(){return IN}function U7(){++IN}function q7(){--IN||G7()}function F7(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,jv(e)}}function H7(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function K7(e){const t=e.flags;if(t&16||t&32&&$7(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,jv(e)}}else e.flags=2}function G7(){try{for(;Sl<ih;){const e=ws[Sl];ws[Sl++]=void 0,K7(e)}}finally{for(;Sl<ih;){const e=ws[Sl];ws[Sl++]=void 0,e.flags|=10}Sl=0,ih=0}}function V7(){this.depsTail=void 0,this.flags=0,jv(this);const e=this.subs;e!==void 0&&u5(e)}function jv(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=u5(n,e)}function LN(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 FS=[];let Pg=0;const{link:t2,unlink:Q7,propagate:W7,checkDirty:d5,shallowPropagate:n2}=c5({update(e){return e._update()},notify(e){FS[HS++]=e,e.flags&=~dn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=dn.Mutable|dn.Dirty,Jg(e))}});let Um=0,HS=0,Pa;function Jg(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=Q7(n,e)}function f5(){if(!(B7()>0)){for(;Um<HS;){const e=FS[Um];FS[Um++]=void 0,e.notify()}Um=0,HS=0}}function h5(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?dn.None:dn.Mutable,get(){return Pa!==void 0&&t2(i,Pa,Pg),i._snapshot},subscribe(a){const l=LN(a),u={current:!1},d=Y7(()=>{i.get(),u.current?l.next?.(i._snapshot):u.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Pa,u=Object.is;if(n)Pa=i,++Pg,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=dn.Mutable|dn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!u(d,f)?(i._snapshot=f,!0):!1}finally{Pa=l,n&&(i.flags&=~dn.RecursedCheck),Jg(i)}}};return n?(i.flags=dn.Mutable|dn.Dirty,i.get=function(){const a=i.flags;if(a&dn.Dirty||a&dn.Pending&&d5(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&n2(l)}}else a&dn.Pending&&(i.flags=a&~dn.Pending);return Pa!==void 0&&t2(i,Pa,Pg),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(W7(l),n2(l),f5())}},i}function Y7(e){const t=()=>{const r=Pa;Pa=n,++Pg,n.depsTail=void 0,n.flags=dn.Watching|dn.RecursedCheck;try{return e()}finally{Pa=r,n.flags&=~dn.RecursedCheck,Jg(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:dn.Watching|dn.RecursedCheck,notify(){const r=this.flags;r&dn.Dirty||r&dn.Pending&&d5(this.deps,this)?t():this.flags=dn.Watching},stop(){this.flags=dn.None,this.depsTail=void 0,Jg(this)}};return t(),n}class Z7{constructor(t){this.atom=h5(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(LN(t))}}class X7{constructor(t){this.atom=h5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(LN(t))}}function J7(e){return typeof e=="function"?new X7(e):new Z7(e)}function eG(e){try{U7(),e()}finally{q7(),f5()}}function ah(e){let t;return eG(()=>{t=e()}),t}var KS=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Sv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Gl=(e,t,n=!0)=>{const r={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const l=e.matches[a];if(!l)continue;const u=e.router.getMatch(l.id);u&&Object.assign(r,u.__routeContext,u.__beforeLoadContext)}return r},r2=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,r=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=r>=0?r:0;let a=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let l=a;l>=0;l--){const u=e.matches[l];if(e.router.looseRoutesById[u.routeId].options.notFoundComponent)return l}return n?a:i},Po=(e,t,n)=>{if(!(!Qr(n)&&!Dr(n)))throw Qr(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:Qr(n)?"redirected":r.status==="pending"?"success":r.status,context:Gl(e,t.index),isFetching:!1,error:n})),Dr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Qr(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},p5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},i2=(e,t,n)=>{const r=Gl(e,n);e.updateMatch(t,i=>({...i,context:r}))},zf=(e,t,n,r)=>{const{id:i,routeId:a}=e.matches[t],l=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Po(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(u){n=u,Po(e,e.router.getMatch(i),n)}e.updateMatch(i,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Qr(n)&&!Dr(n)&&(e.serialError??=n)},m5=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Sv(e,t)&&(n.options.loader||n.options.beforeLoad||y5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{KS(e)},i);r._nonReactive.pendingTimeout=a}},tG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;m5(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Po(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},nG=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Qu(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:u}=i;l&&zf(e,n,l,"PARSE_PARAMS"),u&&zf(e,n,u,"VALIDATE_SEARCH"),m5(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,A=>({...A,isFetching:"beforeLoad",fetchCount:A.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,A=>({...A,isFetching:!1}))};if(!r.options.beforeLoad){ah(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=Qu();const g={...Gl(e,n,!1),...i.__routeContext},{search:v,params:j,cause:b}=i,S=Sv(e,t),k={search:v,abortController:d,params:j,preload:S,context:g,location:e.location,navigate:A=>e.router.navigate({...A,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:S?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=A=>{if(A===void 0){ah(()=>{p(),m()});return}(Qr(A)||Dr(A))&&(p(),zf(e,n,A,"BEFORE_LOAD")),ah(()=>{p(),e.updateMatch(t,P=>({...P,__beforeLoadContext:A})),m()})};let C;try{if(C=r.options.beforeLoad(k),vh(C))return p(),C.catch(A=>{zf(e,n,A,"BEFORE_LOAD")}).then(E)}catch(A){p(),zf(e,n,A,"BEFORE_LOAD")}E(C)},rG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>u(),l=()=>nG(e,n,t,i),u=()=>{if(p5(e,n))return;const d=tG(e,n,i);return vh(d)?d.then(l):l()};return a()},iG=(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,l,u])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:u,scripts:l,styles:a?.styles}))},g5=(e,t,n,r,i)=>{const a=t[r-1],{params:l,loaderDeps:u,abortController:d,cause:f}=e.router.getMatch(n),p=Gl(e,r),m=Sv(e,n);return{params:l,deps:u,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:g=>e.router.navigate({...g,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},a2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(n7??e.router.isServer)||a.ssr===!0)&&xh(i);const l=i.options.loader,u=typeof l=="function"?l:l?.handler,d=u?.(g5(e,t,n,r,i)),f=!!u&&vh(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"})),u){const m=f?await d:d;Po(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,g=>({...g,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:Gl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.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:Gl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Dr(l)&&await i.options.notFoundComponent?.preload?.(),Po(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(f){u=f,Po(e,e.router.getMatch(n),f)}!Qr(u)&&!Dr(u)&&await xh(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:u,context:Gl(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),Po(e,l,a)}},aG=async(e,t,n)=>{async function r(v,j,b,S,k){const E=Date.now()-j.updatedAt,C=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,A=k.options.shouldReload,P=typeof A=="function"?A(g5(e,t,i,n,k)):A,{status:O,invalid:_}=S,T=E>C&&(!!e.forceStaleReload||S.cause==="enter"||b!==void 0&&b!==S.id);l=O==="success"&&(_||(P??T)),v&&k.options.preload===!1||(l&&!e.sync&&p?(u=!0,(async()=>{try{await a2(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($){Qr($)&&await e.router.navigate($.options)}})()):O!=="success"||l?await a2(e,t,i,n,k):i2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let l=!1,u=!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(p5(e,i)){if(!e.router.getMatch(i))return e.matches[n];i2(e,i,n)}else{const v=e.router.getMatch(i),j=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(S=>S.routeId===a)?.id,b=Sv(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const S=e.router.getMatch(i),k=S._nonReactive.error||S.error;k&&Po(e,S,k),S.status==="pending"&&await r(b,v,j,S,d)}else{const S=b&&!e.router.state.matches.some(E=>E.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=Qu(),S!==k.preload&&e.updateMatch(i,E=>({...E,preload:S})),await r(b,v,j,k,d)}}const m=e.router.getMatch(i);u||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,u||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const g=u?m.isFetching:!1;return g!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:g,invalid:!1})),e.router.getMatch(i)):m};async function s2(e){const t=e,n=[];t.router.state.matches.some(g=>g._forcePending)&&KS(t);let r;for(let g=0;g<t.matches.length;g++){try{const v=rG(t,g);vh(v)&&await v}catch(v){if(Qr(v))throw v;if(Dr(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?r2(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let u,d;for(let g=0;g<l;g++)n.push(aG(t,n,g));try{await Promise.all(n)}catch{const g=await Promise.allSettled(n);for(const v of g){if(v.status!=="rejected")continue;const j=v.reason;if(Qr(j))throw j;Dr(j)?u??=j:d??=j}if(d!==void 0)throw d}const f=u??(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 g=r2(t,f);_s(g!==void 0);const v=t.matches[g],j=t.router.looseRoutesById[v.routeId],b=t.router.options?.defaultNotFoundComponent;!j.options.notFoundComponent&&b&&(j.options.notFoundComponent=b),f.routeId=v.routeId;const S=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...S?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=g,await xh(j,["notFoundComponent"])}else if(!t.preload){const g=t.matches[0];g.globalNotFound||t.router.getMatch(g.id)?.globalNotFound&&t.updateMatch(g.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const g=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await xh(g,["errorComponent"])}for(let g=0;g<=p;g++){const{id:v,routeId:j}=t.matches[g],b=t.router.looseRoutesById[j];try{const S=iG(t,v,b);if(S){const k=await S;t.updateMatch(v,E=>({...E,...k}))}}catch(S){console.error(`Error executing head for route ${j}:`,S)}}const m=KS(t);if(vh(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function o2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function xh(e,t=Tg){!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===Tg?(()=>{if(e._componentsPromise===void 0){const r=o2(e,Tg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():o2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function y5(e){for(const t of Tg)if(e.options[t]?.preload)return!0;return!1}var Tg=["component","errorComponent","pendingComponent","notFoundComponent"],Io="__TSR_index",l2="popstate",c2="beforeunload";function sG(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();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 g=ey(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:g,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const f=t.state[Io];u=u2(f+1,u),a({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const f=t.state[Io];u=u2(f,u),a({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{a({task:()=>{e.back(l?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{a({task:()=>{e.forward(l?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Io]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function u2(e,t){t||(t={});const n=$N();return{...t,key:n,__TSR_key:n,[Io]:e}}function oG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,l=T=>i=T,u=(T=>T),d=(()=>ey(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const T=$N();t.history.replaceState({[Io]:0,key:T,__TSR_key:T},"")}let f=d(),p,m=!1,g=!1,v=!1,j=!1;const b=()=>f;let S,k;const E=()=>{S&&(_._ignoreSubscribers=!0,(S.isPush?t.history.pushState:t.history.replaceState)(S.state,"",S.href),_._ignoreSubscribers=!1,S=void 0,k=void 0,p=void 0)},C=(T,$,F)=>{const U=u($);k||(p=f),f=ey($,F),S={href:U,state:F,isPush:S?.isPush||T==="push"},k||(k=Promise.resolve().then(()=>E()))},A=T=>{f=d(),_.notify({type:T})},P=async()=>{if(g){g=!1;return}const T=d(),$=T.state[Io]-f.state[Io],F=$===1,U=$===-1,B=!F&&!U||m;m=!1;const V=B?"GO":U?"BACK":"FORWARD",X=B?{type:"GO",index:$}:{type:U?"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:T,action:V})){g=!0,t.history.go(1),_.notify(X);return}}}f=d(),_.notify(X)},O=T=>{if(j){j=!1;return}let $=!1;const F=a();if(typeof document<"u"&&F.length)for(const U of F){const B=U.enableBeforeUnload??!0;if(B===!0){$=!0;break}if(typeof B=="function"&&B()===!0){$=!0;break}}if($)return T.preventDefault(),T.returnValue=""},_=sG({getLocation:b,getLength:()=>t.history.length,pushState:(T,$)=>C("push",T,$),replaceState:(T,$)=>C("replace",T,$),back:T=>(T&&(v=!0),j=!0,t.history.back()),forward:T=>{T&&(v=!0),j=!0,t.history.forward()},go:T=>{m=!0,t.history.go(T)},createHref:T=>u(T),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(c2,O,{capture:!0}),t.removeEventListener(l2,P)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(c2,O,{capture:!0}),t.addEventListener(l2,P),t.history.pushState=function(...T){const $=n.apply(t.history,T);return _._ignoreSubscribers||A("PUSH"),$},t.history.replaceState=function(...T){const $=r.apply(t.history,T);return _._ignoreSubscribers||A("REPLACE"),$},_}function lG(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ey(e,t){const n=lG(e),r=n.indexOf("#"),i=n.indexOf("?"),a=$N();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||{[Io]:0,key:a,__TSR_key:a}}}function $N(){return(Math.random()+1).toString(36).substring(7)}function Vl(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 cG(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var uG=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=j7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=oG()),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=Yg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=J7(fG(this.latestLocation)),E7(this));let l=!1;const u=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==u||a!==d){this.basepath=u;const f=[],p=o5(u);p&&p!=="/"&&f.push(L7({basepath:u})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:I7(f),this.history&&this.updateLatestLocation(),l=!0}l&&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=g7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&d7(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:u,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){const S=this.options.parseSearch(d),k=this.options.stringifySearch(S);return{href:u+k+f,publicHref:p,pathname:Ef(u).path,external:!1,searchStr:k,search:jl(n?.search,S),hash:Ef(f.slice(1)).path,state:Dl(n?.state,m)}}const g=new URL(p,this.origin),v=qS(this.rewrite,g),j=this.options.parseSearch(v.search),b=this.options.stringifySearch(j);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Ef(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:jl(n?.search,j),hash:Ef(v.hash.slice(1)).path,state:Dl(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:l}=i.state;if(a&&(!l||l===this.tempLocationKey)){const u=r(a);return u.state.key=i.state.key,u.state.__TSR_key=i.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>w7({base:t,to:DN(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=>hG({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,l=this.matchRoutesLightweight(a);i.from;const u=i.unsafeRelative==="path"?a.pathname:i.from??l.fullPath,d=this.resolvePathWithBase(u,"."),f=l.search,p=Object.assign(Object.create(null),l.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),g=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,zo(i.params,p)),v=this.getMatchedRoutes(m);let j=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(j=[...j,this.options.notFoundRoute]),Object.keys(g).length>0)for(const $ of j){const F=$.options.params?.stringify??$.options.stringifyParams;if(F)try{Object.assign(g,F(g))}catch{}}const b=t.leaveParams?m:Ef(Jz({path:m,params:g,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let S=f;if(t._includeValidateSearch&&this.options.search?.strict){const $={};j.forEach(F=>{if(F.options.validateSearch)try{Object.assign($,Rg(F.options.validateSearch,{...$,...S}))}catch{}}),S=$}S=pG({search:S,dest:i,destRoutes:j,_includeValidateSearch:t._includeValidateSearch}),S=jl(f,S);const k=this.options.stringifySearch(S),E=i.hash===!0?a.hash:i.hash?zo(i.hash,a.hash):void 0,C=E?`#${E}`:"";let A=i.state===!0?a.state:i.state?zo(i.state,a.state):{};A=Dl(a.state,A);const P=`${b}${k}${C}`;let O,_,T=!1;if(this.rewrite){const $=new URL(P,this.origin),F=l5(this.rewrite,$);O=$.href.replace($.origin,""),F.origin!==this.origin?(_=F.href,T=!0):_=F.pathname+F.search+F.hash}else O=l7(P),_=O;return{publicHref:_,href:O,pathname:b,search:S,searchStr:k,state:A,hash:E??"",external:T,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const l=n(i);let u=a?n(a):void 0;if(!u){const d=Object.create(null);if(this.options.routeMasks){const f=f7(l.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...g}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,zo(m,d));a={from:t.from,...g,params:v},u=n(a)}}}return u&&(l.maskedLocation=u),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const u=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];u.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Hl(r.state,this.latestLocation.state);return u.forEach(f=>{delete r.state[f]}),d},a=Mo(this.latestLocation.href)===Mo(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=Qu(()=>{l?.resolve(),l=void 0}),a&&i())this.load();else{let{maskedLocation:u,hashScrollIntoView:d,...f}=r;u&&(f={...u,state:{...u.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:l,...u}={})=>{if(l){const p=this.history.location.state.__TSR_index,m=ey(l,{__TSR_index:t?p:p+1}),g=new URL(m.pathname,this.origin);u.to=qS(this.rewrite,g).pathname,u.search=this.options.parseSearch(m.search),u.hash=m.hash.slice(1)}const d=this.buildLocation({...u,_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 l=!1;if(r)try{new URL(`${r}`),l=!0}catch{}if(l&&!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 u=!l&&i?i:r;if(Wg(u,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(u):window.location.href=u,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(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Vl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Vl({resolvedLocation:f,location:d})}),await s2({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=[],g=[],v=[];ah(()=>{this.__store.setState(j=>{const b=j.matches,S=j.pendingMatches||j.matches;return p=b.filter(k=>!S.some(E=>E.id===k.id)),m=b.filter(k=>!S.some(E=>E.routeId===k.routeId)),g=S.filter(k=>!b.some(E=>E.routeId===k.routeId)),v=S.filter(k=>b.some(E=>E.routeId===k.routeId)),{...j,isLoading:!1,loadedAt:Date.now(),matches:S,pendingMatches:void 0,cachedMatches:[...j.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[g,"onEnter"],[v,"onStay"]].forEach(([j,b])=>{j.forEach(S=>{this.looseRoutesById[S.routeId].options[b]?.(S)})})})})}})}catch(d){Qr(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Dr(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),u()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},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,l=typeof n.types=="function"?n.types(Vl({resolvedLocation:a,location:i})):n.types;if(l===!1){t();return}r={update:t,types:l}}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:cG(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&&Wg(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=xh,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(l=>l.id)),a=new Set([...i,...this.state.cachedMatches.map(l=>l.id)]);ah(()=>{r.forEach(l=>{a.has(l.id)||this.__store.setState(u=>({...u,cachedMatches:[...u.cachedMatches,l]}))})});try{return r=await s2({router:this,matches:r,location:n,preload:!0,updateMatch:(l,u)=>{i.has(l)?r=r.map(d=>d.id===l?u(d):d):this.updateMatch(l,u)}}),r}catch(l){if(Qr(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});Dr(l)||console.error(l);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,l=h7(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!l||t.params&&!Hl(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Hl(a.search,i.search,{partial:!0})?l.rawParams:!1:l.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??R7,parseSearch:e.parseSearch??T7,protocolAllowlist:e.protocolAllowlist??o7}),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:l}=n,u=!1;(r?r.path!=="/"&&i["**"]:Mo(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:u=!0);const d=u?gG(this.options.notFoundMode,l):void 0,f=new Array(l.length),p=new Map(this.state.matches.map(m=>[m.routeId,m]));for(let m=0;m<l.length;m++){const g=l[m],v=f[m-1];let j,b,S;{const V=v?.search??e.search,X=v?._strictSearch??void 0;try{const Z=Rg(g.options.validateSearch,{...V})??void 0;j={...V,...Z},b={...X,...Z},S=void 0}catch(Z){let H=Z;if(Z instanceof ty||(H=new ty(Z.message,{cause:Z})),t?.throwOnError)throw H;j=V,b={},S=H}}const k=g.options.loaderDeps?.({search:j})??"",E=k?JSON.stringify(k):"",{interpolatedPath:C,usedParams:A}=Jz({path:g.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),P=g.id+C+E,O=this.getMatch(P),_=p.get(g.id),T=O?._strictParams??A;let $;if(!O)try{d2(g,A,a,T)}catch(V){if(Dr(V)||Qr(V)?$=V:$=new dG(V.message,{cause:V}),t?.throwOnError)throw $}Object.assign(i,T);const F=_?"stay":"enter";let U;if(O)U={...O,cause:F,params:_?.params??i,_strictParams:T,search:jl(_?_.search:O.search,j),_strictSearch:b};else{const V=g.options.loader||g.options.beforeLoad||g.lazyFn||y5(g)?"pending":"success";U={id:P,ssr:g.options.ssr,index:m,routeId:g.id,params:_?.params??i,_strictParams:T,pathname:C,updatedAt:Date.now(),search:_?jl(_.search,j):j,_strictSearch:b,searchError:void 0,status:V,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:Qu()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:_?Dl(_.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}t?.preload||(U.globalNotFound=d===g.id),U.searchError=S;const B=this.getParentContext(v);U.context={...B,...U.__routeContext,...U.__beforeLoadContext},f[m]=U}for(let m=0;m<f.length;m++){const g=f[m],v=this.looseRoutesById[g.routeId],j=this.getMatch(g.id),b=p.get(g.routeId);if(g.params=b?jl(b.params,i):i,!j){const S=f[m-1],k=this.getParentContext(S);if(v.options.context){const E={deps:g.loaderDeps,params:g.params,context:k??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:f,routeId:v.id};g.__routeContext=v.options.context(E)??void 0}g.context={...k,...g.__routeContext,...g.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=yh(t),a={...e.search};for(const f of t)try{Object.assign(a,Rg(f.options.validateSearch,a))}catch{}const l=yh(this.state.matches),u=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(u)d=l.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{d2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},ty=class extends Error{},dG=class extends Error{};function fG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Rg(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new ty("Async validation not supported");if(n.issues)throw new ty(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 hG({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Mo(e);let a,l;const u=p7(i,n,!0);return u&&(a=u.route,Object.assign(r,u.rawParams),l=Object.assign(Object.create(null),u.parsedParams)),{matchedRoutes:u?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:l}}function pG({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return mG(n)(e,t,r??!1)}function mG(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:l,next:u})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),l));const f=u(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:l,next:u})=>{const d=u(l);if(!t._includeValidateSearch)return d;try{return{...d,...Rg(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:zo(a.search,i):{}};t.middlewares.push(n);const r=(i,a,l)=>{if(i>=l.length)return a;const u=l[i];return u({search:a,next:f=>r(i+1,f,l)})};return function(a,l,u){return t.dest=l,t._includeValidateSearch=u,r(0,a,t.middlewares)}}function gG(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 Kl}function d2(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 yG="Error preloading route! ☝️",v5=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=Kl:this.parentRoute||_s(!1);let i=r?Kl:n?.path;i&&i!=="/"&&(i=s5(i));const a=n?.id||i;let l=r?Kl:zg([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=zg(["/",l]));const u=l==="__root__"?"/":zg([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=u,this._to=Mo(u)},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=>MN({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.")}},vG=class extends v5{constructor(e){super(e)}};function BN(e){const t=e.errorComponent??UN;return s.jsx(xG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var xG=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 UN({error:e}){const[t,n]=x.useState(!1);return s.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[s.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),s.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"})]}),s.jsx("div",{style:{height:".25rem"}}),t?s.jsx("div",{children:s.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?s.jsx("code",{children:e.message}):null})}):null]})}function bG({children:e,fallback:t=null}){return x5()?s.jsx(Li.Fragment,{children:e}):s.jsx(Li.Fragment,{children:t})}function x5(){return Li.useSyncExternalStore(wG,()=>!0,()=>!1)}function wG(){return()=>{}}var b5=x.createContext(null);function Vi(e){const t=x.useContext(b5);return e?.warn,t}var mw={exports:{}},gw={},yw={exports:{}},vw={};var f2;function jG(){if(f2)return vw;f2=1;var e=md();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,g){var v=g(),j=r({inst:{value:v,getSnapshot:g}}),b=j[0].inst,S=j[1];return a(function(){b.value=v,b.getSnapshot=g,d(b)&&S({inst:b})},[m,v,g]),i(function(){return d(b)&&S({inst:b}),m(function(){d(b)&&S({inst:b})})},[m]),l(v),v}function d(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!n(m,v)}catch{return!0}}function f(m,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return vw.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,vw}var h2;function SG(){return h2||(h2=1,yw.exports=jG()),yw.exports}var p2;function NG(){if(p2)return gw;p2=1;var e=md(),t=SG();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,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return gw.useSyncExternalStoreWithSelector=function(f,p,m,g,v){var j=a(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function k(O){if(!E){if(E=!0,C=O,O=g(O),v!==void 0&&b.hasValue){var _=b.value;if(v(_,O))return A=_}return A=O}if(_=A,r(C,O))return _;var T=g(O);return v!==void 0&&v(_,T)?(C=O,_):(C=O,A=T)}var E=!1,C,A,P=m===void 0?null:m;return[function(){return k(p())},P===null?void 0:function(){return k(P())}]},[p,m,g,v]);var S=i(f,j[0],j[1]);return l(function(){b.hasValue=!0,b.value=S},[S]),d(S),S},gw}var m2;function kG(){return m2||(m2=1,mw.exports=NG()),mw.exports}var w5=kG();function CG(e,t){return e===t}function AG(e,t,n=CG){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:u}=e.subscribe(l);return u},[e]),i=x.useCallback(()=>e?.get(),[e]);return w5.useSyncExternalStoreWithSelector(r,i,i,t,n)}function Xr(e){const t=Vi({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return AG(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Dl(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Nv=x.createContext(void 0),OG=x.createContext(void 0);function Vo(e){const t=x.useContext(e.from?OG:Nv);return Xr({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(_s(!((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 qN(e){return Vo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function FN(e){const{select:t,...n}=e;return Vo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function kv(e){return Vo({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 Cv(e){return Vo({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=Vi();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function HN(e){return Vo({...e,select:t=>e.select?e.select(t.context):t.context})}var gc=UL();const EG=pa(gc);function _G(e,t){const n=Vi(),r=t7(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:g,resetScroll:v,viewTransition:j,children:b,target:S,disabled:k,style:E,className:C,onClick:A,onBlur:P,onFocus:O,onMouseEnter:_,onMouseLeave:T,onTouchStart:$,ignoreBlocker:F,params:U,search:B,hash:V,state:X,mask:Z,reloadDocument:H,unsafeRelative:J,from:oe,_fromLocation:ye,...I}=e,M=x5(),q=Xr({select:Je=>{const ce=Je.matches[Je.matches.length-1];return{search:ce?.search,hash:Je.location.hash,path:ce?.pathname}},structuralSharing:!0}),D=e.from,G=x.useMemo(()=>({...e,from:D}),[n,q,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=x.useMemo(()=>n.buildLocation({...G}),[n,G]),ne=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,Ce=se.maskedLocation?se.maskedLocation.external:se.external,Se=x.useMemo(()=>MG(ne,Ce,n.history,k),[k,Ce,ne,n.history]),ee=x.useMemo(()=>{if(Se?.external)return Wg(Se.href,n.protocolAllowlist)?void 0:Se.href;if(!IG(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{return new URL(u),Wg(u,n.protocolAllowlist)?void 0:u}catch{}},[u,Se,n.protocolAllowlist]),pe=Xr({select:Je=>{if(ee)return!1;if(l?.exact){if(!b7(Je.location.pathname,se.pathname,n.basepath))return!1}else{const ce=Zg(Je.location.pathname,n.basepath),Ne=Zg(se.pathname,n.basepath);if(!(ce.startsWith(Ne)&&(ce.length===Ne.length||ce[Ne.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Hl(Je.location.search,se.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?M&&Je.location.hash===se.hash:!0}}),Ee=pe?zo(i,{})??zG:xw,Y=pe?xw:zo(a,{})??xw,He=[C,Ee.className,Y.className].filter(Boolean).join(" "),Te=(E||Ee.style||Y.style)&&{...E,...Ee.style,...Y.style},[at,Ve]=x.useState(!1),Ht=x.useRef(!1),Lt=e.reloadDocument||ee?!1:d??n.options.defaultPreload,cn=f??n.options.defaultPreloadDelay??0,en=x.useCallback(()=>{n.preloadRoute({...G,_builtLocation:se}).catch(Je=>{console.warn(Je),console.warn(yG)})},[n,G,se]);e7(r,x.useCallback(Je=>{Je?.isIntersecting&&en()},[en]),DG,{disabled:!!k||Lt!=="viewport"}),x.useEffect(()=>{Ht.current||!k&&Lt==="render"&&(en(),Ht.current=!0)},[k,en,Lt]);const je=Je=>{const ce=Je.currentTarget.getAttribute("target"),Ne=S!==void 0?S:ce;if(!k&&!LG(Je)&&!Je.defaultPrevented&&(!Ne||Ne==="_self")&&Je.button===0){Je.preventDefault(),gc.flushSync(()=>{Ve(!0)});const Me=n.subscribe("onResolved",()=>{Me(),Ve(!1)});n.navigate({...G,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:g,viewTransition:j,ignoreBlocker:F})}};if(ee)return{...I,ref:r,href:ee,...b&&{children:b},...S&&{target:S},...k&&{disabled:k},...E&&{style:E},...C&&{className:C},...A&&{onClick:A},...P&&{onBlur:P},...O&&{onFocus:O},..._&&{onMouseEnter:_},...T&&{onMouseLeave:T},...$&&{onTouchStart:$}};const Ze=Je=>{if(k||Lt!=="intent")return;if(!cn){en();return}const ce=Je.currentTarget;if(Pf.has(ce))return;const Ne=setTimeout(()=>{Pf.delete(ce),en()},cn);Pf.set(ce,Ne)},Rt=Je=>{k||Lt!=="intent"||en()},mt=Je=>{if(k||!Lt||!cn)return;const ce=Je.currentTarget,Ne=Pf.get(ce);Ne&&(clearTimeout(Ne),Pf.delete(ce))};return{...I,...Ee,...Y,href:Se?.href,ref:r,onClick:lu([A,je]),onBlur:lu([P,mt]),onFocus:lu([O,Ze]),onMouseEnter:lu([_,Ze]),onMouseLeave:lu([T,mt]),onTouchStart:lu([$,Rt]),disabled:!!k,target:S,...Te&&{style:Te},...He&&{className:He},...k&&PG,...pe&&TG,...M&&at&&RG}}var xw={},zG={className:"active"},PG={role:"link","aria-disabled":!0},TG={"data-status":"active","aria-current":"page"},RG={"data-transitioning":"transitioning"},Pf=new WeakMap,DG={rootMargin:"100px"},lu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function MG(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function IG(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Yt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=_G(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:u,...d}=a;return x.createElement("a",d,l)}return x.createElement(n,a,l)});function LG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var $G=class extends v5{constructor(e){super(e),this.useMatch=t=>Vo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>HN({...t,from:this.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>FN({...t,from:this.id}),this.useLoaderData=t=>qN({...t,from:this.id}),this.useNavigate=()=>Qo({from:this.fullPath}),this.Link=Li.forwardRef((t,n)=>s.jsx(Yt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ti(e){return new $G(e)}function BG(){return e=>qG(e)}var UG=class extends vG{constructor(e){super(e),this.useMatch=t=>Vo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>HN({...t,from:this.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>FN({...t,from:this.id}),this.useLoaderData=t=>qN({...t,from:this.id}),this.useNavigate=()=>Qo({from:this.fullPath}),this.Link=Li.forwardRef((t,n)=>s.jsx(Yt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function qG(e){return new UG(e)}function g2(e){return typeof e=="object"?new y2(e,{silent:!0}).createRoute(e):new y2(e,{silent:!0}).createRoute}var y2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ti(n);return r.isRoot=!1,r},this.silent=t?.silent}},v2=class{constructor(e){this.useMatch=t=>Vo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>HN({...t,from:this.options.id}),this.useSearch=t=>Cv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>kv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>FN({...t,from:this.options.id}),this.useLoaderData=t=>qN({...t,from:this.options.id}),this.useNavigate=()=>Qo({from:Vi().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function x2(e){return typeof e=="object"?new v2(e):t=>new v2({id:e,...t})}function FG(e){const t=Xr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return s.jsx(BN,{getResetKey:()=>t,onCatch:(n,r)=>{if(Dr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Dr(n))return e.fallback?.(n);throw n},children:e.children})}function HG(){return s.jsx("p",{children:"Not Found"})}function ku(e){return s.jsx(s.Fragment,{children:e.children})}function j5(e,t,n){return t.options.notFoundComponent?s.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?s.jsx(e.options.defaultNotFoundComponent,{...n}):s.jsx(HG,{})}function KG(){return Vi().isScrollRestoring,null}var S5=x.memo(function({matchId:t}){const n=Vi(),r=Xr({select:j=>{const b=j.matches.findIndex(k=>k.id===t),S=j.matches[b];return _s(S),{routeId:S.routeId,ssr:S.ssr,_displayPending:S._displayPending,resetKey:j.loadedAt,parentRouteId:j.matches[b-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,l=a?s.jsx(a,{}):null,u=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:ku,g=u?BN:ku,v=f?FG:ku;return s.jsxs(i.isRoot?i.options.shellComponent??ku:ku,{children:[s.jsx(Nv.Provider,{value:t,children:s.jsx(m,{fallback:l,children:s.jsx(g,{getResetKey:()=>r.resetKey,errorComponent:u||UN,onCatch:(j,b)=>{if(Dr(j))throw j;d?.(j,b)},children:s.jsx(v,{fallback:j=>{if(!f||j.routeId&&j.routeId!==r.routeId||!j.routeId&&!i.isRoot)throw j;return x.createElement(f,j)},children:p||r._displayPending?s.jsx(bG,{fallback:l,children:s.jsx(b2,{matchId:t})}):s.jsx(b2,{matchId:t})})})})}),r.parentRouteId===Kl&&n.options.scrollRestoration?s.jsxs(s.Fragment,{children:[s.jsx(GG,{}),s.jsx(KG,{})]}):null]})});function GG(){const e=Vi(),t=x.useRef(void 0);return s.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...Vl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var b2=x.memo(function({matchId:t}){const n=Vi(),{match:r,key:i,routeId:a}=Xr({select:d=>{const f=d.matches.find(g=>g.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}),l=n.routesById[a],u=x.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?s.jsx(d,{},i):s.jsx(KN,{})},[i,l.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=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const f=n.getMatch(r.id);if(f&&!f._nonReactive.minPendingPromise){const p=Qu();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 _s(Dr(r.error)),j5(n,l,r.error);if(r.status==="redirected")throw _s(Qr(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return u}),KN=x.memo(function(){const t=Vi(),n=x.useContext(Nv),r=Xr({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=Xr({select:f=>{const p=f.matches.find(m=>m.id===n);return _s(p),p.globalNotFound}}),l=Xr({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),u=t.options.defaultPendingComponent?s.jsx(t.options.defaultPendingComponent,{}):null;if(a)return j5(t,i,void 0);if(!l)return null;const d=s.jsx(S5,{matchId:l});return r===Kl?s.jsx(x.Suspense,{fallback:u,children:d}):d});function VG(){const e=Vi(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=Xr({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=cw(a),u=a||n||i,d=cw(u),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),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Mo(e.latestLocation.publicHref)!==Mo(g.publicHref)&&e.commitLocation({...g,replace:!0}),()=>{m()}},[e,e.history]),$m(()=>{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(g){console.error(g)}})()},[e]),$m(()=>{l&&!a&&e.emit({type:"onLoad",...Vl(e.state)})},[l,e,a]),$m(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Vl(e.state)})},[f,p,e]),$m(()=>{if(d&&!u){const m=Vl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),m.hrefChanged&&_7(e)}},[u,d,e]),null}function QG(){const e=Vi(),t=e.routesById[Kl].options.pendingComponent??e.options.defaultPendingComponent,n=t?s.jsx(t,{}):null,r=s.jsxs(typeof document<"u"&&e.ssr?ku:x.Suspense,{fallback:n,children:[s.jsx(VG,{}),s.jsx(WG,{})]});return e.options.InnerWrap?s.jsx(e.options.InnerWrap,{children:r}):r}function WG(){const e=Vi(),t=Xr({select:i=>i.matches[0]?.id}),n=Xr({select:i=>i.loadedAt}),r=t?s.jsx(S5,{matchId:t}):null;return s.jsx(Nv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:s.jsx(BN,{getResetKey:()=>n,errorComponent:UN,onCatch:void 0,children:r})})}var YG=e=>new ZG(e),ZG=class extends uG{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=g2,globalThis.createLazyFileRoute=x2):typeof window<"u"&&(window.createFileRoute=g2,window.createLazyFileRoute=x2);function XG({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=s.jsx(b5.Provider,{value:e,children:t});return e.options.Wrap?s.jsx(e.options.Wrap,{children:r}):r}function JG({router:e,...t}){return s.jsx(XG,{router:e,...t,children:s.jsx(QG,{})})}function N5(e){return Xr({select:t=>t.location})}class ei extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function eV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const k5=eV();function tV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function nV(e){return`${tV()}${e}`}function rV(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 iV(){return""}function w2(){return!!iV()}async function _e(e,t){const n=t?.body!=null,r=await fetch(`${k5}${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}`,l;if(i)try{const u=JSON.parse(i);typeof u.error=="string"?a=u.error:u.error?.message?(a=u.error.message,l=u.error.code):u.message&&(a=u.message)}catch{a=i}throw new ei(a,r.status,l)}if(r.status!==204)return r.json()}function GN(){return _e("/projects")}function C5(e){return _e(`/projects/${encodeURIComponent(e)}`)}function A5(){return _e("/runs")}function aV(e){return _e(`/projects/${encodeURIComponent(e)}/runs`)}function ec(e){return _e(`/runs/${encodeURIComponent(e)}`)}function sV(e){return _e(`/projects/${encodeURIComponent(e)}/queries`)}function O5(e){return _e(`/projects/${encodeURIComponent(e)}/competitors`)}function E5(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function oV(e,t){const r=new URLSearchParams().toString();return _e(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function Av(e,t){return _e(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function lV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function cV(e,t){return _e(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function _5(e,t){return _e(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function j2(e,t){const n=await C5(e);return Av(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 uV(e,t){const n=await C5(e);return Av(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 dV(e,t){const n={};return t?.location&&(n.location=t.location),t?.allLocations&&(n.allLocations=!0),t?.noLocation&&(n.noLocation=!0),_e(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function fV(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function hV(e,t){await _e(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function pV(e,t){return _e(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function mV(e){await _e(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function gV(e){return _e(`/projects/${encodeURIComponent(e)}/export`)}function VN(){return _e("/settings")}function yV(){return _e("/session")}function vV(e){return _e("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function xV(e){return _e("/session",{method:"POST",body:JSON.stringify({password:e})})}function bV(e,t){return _e(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function wV(e){return _e("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function jV(e){try{return await _e(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof ei&&t.statusCode===404)return null;throw t}}function S2(e,t){return _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function SV(e){await _e(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function NV(e){return _e(`/projects/${encodeURIComponent(e)}/notifications`)}function kV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function CV(e,t){await _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function AV(e,t){return _e(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function OV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function EV(e){return _e("/apply",{method:"POST",body:JSON.stringify(e)})}function _V(e){return _e("/runs",{method:"POST",body:JSON.stringify(e??{})})}function z5(e){return _e(`/projects/${encodeURIComponent(e)}/google/connections`)}function zV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function PV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function TV(e){return _e(`/projects/${encodeURIComponent(e)}/google/properties`)}function RV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function DV(e,t,n){return _e(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function P5(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function MV(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));const r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function IV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function LV(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 _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function $V(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function QN(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function BV(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function UV(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function qV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function FV(e){return _e(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function N2(){return _e("/cdp/status")}function HV(e,t){return _e("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function k2(e,t){return _e(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function T5(e){return _e(`/projects/${encodeURIComponent(e)}/bing/status`)}function KV(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function GV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function VV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/sites`)}function QV(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function WN(e){return _e(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function R5(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return _e(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function D5(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function C2(e,t){return _e(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function WV(e){return _e(`/projects/${encodeURIComponent(e)}/bing/performance`)}function YV(e){return _e("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function ZV(e){return _e(`/projects/${encodeURIComponent(e)}/report`)}function XV(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function JV(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${k5}/projects/${encodeURIComponent(e)}/report.html?${n.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new ei(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),l=XV(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,u=document.createElement("a");u.href=a,u.download=l,document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(a)}function eQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/status`)}function tQ(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function M5(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function nQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function rQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function iQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function aQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return _e(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function sQ(e){return _e(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function oQ(e,t){const n=t?`?runId=${encodeURIComponent(t)}`:"";return _e(`/projects/${encodeURIComponent(e)}/insights${n}`)}function lQ(e){return _e(`/projects/${encodeURIComponent(e)}/citations/visibility`)}async function cQ(e,t){const n=nV(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:rV(e,r.status)};const i=await r.json(),a=typeof i.version=="string"?i.version:"unknown",l=typeof i.databaseUrlConfigured=="boolean"?i.databaseUrlConfigured:void 0,u=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=[a,l===!1?"database not configured":"database configured",u?`heartbeat ${u}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:d,version:a,databaseConfigured:l,lastHeartbeatAt:u}}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 uQ(){return _e("/backlinks/status")}function dQ(){return _e("/backlinks/install",{method:"POST"})}function I5(){return _e("/backlinks/syncs/latest")}function fQ(){return _e("/backlinks/syncs")}function hQ(e){return _e("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function pQ(){return _e("/backlinks/releases")}function mQ(){return _e("/backlinks/latest-release")}function gQ(e){return _e(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function yQ(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return _e(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function vQ(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 _e(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function xQ(e){return _e(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function bQ(e,t){return _e(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}const wQ=6e3,jQ=5,SQ=180;let wr=[],NQ=0;const GS=new Set,VS=new Map,QS=new Map;function ny(){const e=[...wr];for(const t of GS)t(e)}function YN(e){const t=VS.get(e);t&&(clearTimeout(t),VS.delete(e));const n=QS.get(e);n&&(clearTimeout(n),QS.delete(e))}function L5(e){YN(e);const t=wr.length;wr=wr.filter(n=>n.id!==e),wr.length!==t&&ny()}function A2(e){YN(e.id),VS.set(e.id,setTimeout(()=>{WS(e.id)},e.durationMs))}function kQ(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function vt(e,t="negative",n=wQ){const r=kQ(e,t,n),i={id:String(++NQ),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=wr.find(l=>l.dedupeKey===r.dedupeKey);if(a){if((r.dedupeMode??"drop")==="drop")return a.id;const l={...a,title:i.title,detail:i.detail,tone:i.tone,durationMs:i.durationMs,cta:i.cta,state:"open"};return wr=wr.map(u=>u.id===a.id?l:u),ny(),A2(l),a.id}}return wr.length>=jQ&&L5(wr[0].id),wr=[...wr,i],ny(),A2(i),i.id}function WS(e){const t=wr.find(n=>n.id===e);!t||t.state==="closing"||(YN(e),wr=wr.map(n=>n.id===e?{...n,state:"closing"}:n),ny(),QS.set(e,setTimeout(()=>{L5(e)},SQ)))}function CQ(e){return GS.add(e),()=>{GS.delete(e)}}function O2(){return wr}const AQ=5*6e4,$5=30*6e4,Tf=3e4,jr=6e4,YS=3e4;function OQ(){return new VK({defaultOptions:{queries:{staleTime:AQ,retry:1,refetchOnWindowFocus:!1}},mutationCache:new WL({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||vt({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const EQ=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_Q=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),E2=e=>{const t=_Q(e);return t.charAt(0).toUpperCase()+t.slice(1)},B5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),zQ=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var PQ={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 TQ=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...u},d)=>x.createElement("svg",{ref:d,...PQ,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:B5("lucide",i),...!a&&!zQ(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const Nt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(TQ,{ref:a,iconNode:t,className:B5(`lucide-${EQ(E2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=E2(e),n};const RQ=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],DQ=Nt("arrow-up",RQ);const MQ=[["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"}]],IQ=Nt("book-open",MQ);const LQ=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],U5=Nt("check",LQ);const $Q=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],BQ=Nt("chevron-down",$Q);const UQ=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Hh=Nt("chevron-right",UQ);const qQ=[["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"}]],FQ=Nt("circle-alert",qQ);const HQ=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],q5=Nt("circle-check",HQ);const KQ=[["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"}]],F5=Nt("circle-question-mark",KQ);const GQ=[["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"}]],VQ=Nt("copy",GQ);const QQ=[["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"}]],Ov=Nt("download",QQ);const WQ=[["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"}]],YQ=Nt("external-link",WQ);const ZQ=[["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"}]],XQ=Nt("file-text",ZQ);const JQ=[["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"}]],eW=Nt("github",JQ);const tW=[["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"}]],nW=Nt("globe",tW);const rW=[["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"}]],iW=Nt("layout-dashboard",rW);const aW=[["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"}]],H5=Nt("link-2",aW);const sW=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],K5=Nt("loader-circle",sW);const oW=[["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"}]],lW=Nt("maximize-2",oW);const cW=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],uW=Nt("menu",cW);const dW=[["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"}]],fW=Nt("minimize-2",dW);const hW=[["path",{d:"M5 12h14",key:"1ays0h"}]],pW=Nt("minus",hW);const mW=[["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"}]],ry=Nt("play",mW);const gW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],_2=Nt("plus",gW);const yW=[["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"}]],z2=Nt("refresh-cw",yW);const vW=[["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"}]],xW=Nt("rocket",vW);const bW=[["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"}]],G5=Nt("rotate-ccw",bW);const wW=[["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"}]],jW=Nt("settings",wW);const SW=[["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"}]],P2=Nt("sparkles",SW);const NW=[["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"}]],V5=Nt("trash-2",NW);const kW=[["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"}]],iy=Nt("triangle-alert",kW);const CW=[["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"}]],AW=Nt("unplug",CW);const OW=[["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"}]],EW=Nt("upload",OW);const _W=[["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"}]],zW=Nt("wrench",_W);const PW=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kh=Nt("x",PW);function ve(e,t,n){function r(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);const f=l.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const g=p[m];g in u||(u[g]=f[g].bind(u))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(u){var d;const f=n?.Parent?new a:this;r(f,u),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Iu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Q5 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const W5={};function qo(e){return W5}function Y5(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 ZS(e,t){return typeof t=="bigint"?t.toString():t}function Ev(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ZN(e){return e==null}function XN(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function TW(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,l=Number.parseInt(e.toFixed(a).replace(".","")),u=Number.parseInt(t.toFixed(a).replace(".",""));return l%u/10**a}const T2=Symbol("evaluating");function Dt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==T2)return r===void 0&&(r=T2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function yc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Wo(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function R2(e){return JSON.stringify(e)}function RW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z5="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function bh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const DW=Ev(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Wu(e){if(bh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(bh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function X5(e){return Wu(e)?{...e}:Array.isArray(e)?[...e]:e}const MW=new Set(["string","number","symbol"]);function Yu(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Fe(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 IW(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const LW={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 $W(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=Wo(e._zod.def,{get shape(){const l={};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(l[u]=n.shape[u])}return yc(this,"shape",l),l},checks:[]});return Yo(e,a)}function BW(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=Wo(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete l[u]}return yc(this,"shape",l),l},checks:[]});return Yo(e,a)}function UW(e,t){if(!Wu(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 l in t)if(Object.getOwnPropertyDescriptor(a,l)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=Wo(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return yc(this,"shape",a),a}});return Yo(e,i)}function qW(e,t){if(!Wu(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Wo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return yc(this,"shape",r),r}});return Yo(e,n)}function FW(e,t){const n=Wo(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return yc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Yo(e,n)}function HW(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 l=Wo(t._zod.def,{get shape(){const u=t._zod.def.shape,d={...u};if(n)for(const f in n){if(!(f in u))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:u[f]}):u[f])}else for(const f in u)d[f]=e?new e({type:"optional",innerType:u[f]}):u[f];return yc(this,"shape",d),d},checks:[]});return Yo(t,l)}function KW(e,t,n){const r=Wo(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(a[l]=new e({type:"nonoptional",innerType:i[l]}))}else for(const l in i)a[l]=new e({type:"nonoptional",innerType:i[l]});return yc(this,"shape",a),a}});return Yo(t,r)}function Au(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 Ou(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function qm(e){return typeof e=="string"?e:e?.message}function Fo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=qm(e.inst?._zod.def?.error?.(e))??qm(t?.error?.(e))??qm(n.customError?.(e))??qm(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function JN(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function wh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const J5=(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,ZS,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},e4=ve("$ZodError",J5),t4=ve("$ZodError",J5,{Parent:Error});function GW(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 VW(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(l=>r({issues:l}));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 l=n,u=0;for(;u<a.path.length;){const d=a.path[u];u===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return r(e),n}const ek=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise)throw new Iu;if(l.issues.length){const u=new(i?.Err??e)(l.issues.map(d=>Fo(d,a,qo())));throw Z5(u,i?.callee),u}return l.value},tk=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let l=t._zod.run({value:n,issues:[]},a);if(l instanceof Promise&&(l=await l),l.issues.length){const u=new(i?.Err??e)(l.issues.map(d=>Fo(d,a,qo())));throw Z5(u,i?.callee),u}return l.value},_v=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 Iu;return a.issues.length?{success:!1,error:new(e??e4)(a.issues.map(l=>Fo(l,i,qo())))}:{success:!0,data:a.value}},QW=_v(t4),zv=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(l=>Fo(l,i,qo())))}:{success:!0,data:a.value}},WW=zv(t4),YW=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ek(e)(t,n,i)},ZW=e=>(t,n,r)=>ek(e)(t,n,r),XW=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return tk(e)(t,n,i)},JW=e=>async(t,n,r)=>tk(e)(t,n,r),eY=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return _v(e)(t,n,i)},tY=e=>(t,n,r)=>_v(e)(t,n,r),nY=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return zv(e)(t,n,i)},rY=e=>async(t,n,r)=>zv(e)(t,n,r),iY=/^[cC][^\s-]{8,}$/,aY=/^[0-9a-z]+$/,sY=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oY=/^[0-9a-vA-V]{20}$/,lY=/^[A-Za-z0-9]{27}$/,cY=/^[a-zA-Z0-9_-]{21}$/,uY=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dY=/^([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})$/,D2=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)$/,fY=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function pY(){return new RegExp(hY,"u")}const mY=/^(?:(?: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])$/,gY=/^(([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}|:))$/,yY=/^((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])$/,vY=/^(([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])$/,xY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,n4=/^[A-Za-z0-9_-]*$/,bY=/^\+[1-9]\d{6,14}$/,r4="(?:(?:\\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])))",wY=new RegExp(`^${r4}$`);function i4(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 jY(e){return new RegExp(`^${i4(e)}$`)}function SY(e){const t=i4({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(`^${r4}T(?:${r})$`)}const NY=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},kY=/^-?\d+$/,a4=/^-?\d+(?:\.\d+)?$/,CY=/^(?:true|false)$/i,AY=/^[^A-Z]*$/,OY=/^[^a-z]*$/,ni=ve("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),s4={number:"number",bigint:"bigint",object:"date"},o4=ve("$ZodCheckLessThan",(e,t)=>{ni.init(e,t);const n=s4[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})}}),l4=ve("$ZodCheckGreaterThan",(e,t)=>{ni.init(e,t);const n=s4[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})}}),EY=ve("$ZodCheckMultipleOf",(e,t)=>{ni.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):TW(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})}}),_Y=ve("$ZodCheckNumberFormat",(e,t)=>{ni.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=LW[t.format];e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,u.minimum=i,u.maximum=a,n&&(u.pattern=kY)}),e._zod.check=l=>{const u=l.value;if(n){if(!Number.isInteger(u)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?l.issues.push({input:u,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}):l.issues.push({input:u,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}}u<i&&l.issues.push({origin:"number",input:u,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),u>a&&l.issues.push({origin:"number",input:u,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),zY=ve("$ZodCheckMaxLength",(e,t)=>{var n;ni.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!ZN(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 l=JN(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),PY=ve("$ZodCheckMinLength",(e,t)=>{var n;ni.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!ZN(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 l=JN(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),TY=ve("$ZodCheckLengthEquals",(e,t)=>{var n;ni.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!ZN(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 l=JN(i),u=a>t.length;r.issues.push({origin:l,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Pv=ve("$ZodCheckStringFormat",(e,t)=>{var n,r;ni.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=()=>{})}),RY=ve("$ZodCheckRegex",(e,t)=>{Pv.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})}}),DY=ve("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=AY),Pv.init(e,t)}),MY=ve("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=OY),Pv.init(e,t)}),IY=ve("$ZodCheckIncludes",(e,t)=>{ni.init(e,t);const n=Yu(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})}}),LY=ve("$ZodCheckStartsWith",(e,t)=>{ni.init(e,t);const n=new RegExp(`^${Yu(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})}}),$Y=ve("$ZodCheckEndsWith",(e,t)=>{ni.init(e,t);const n=new RegExp(`.*${Yu(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})}}),BY=ve("$ZodCheckOverwrite",(e,t)=>{ni.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class UY{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(l=>l),i=Math.min(...r.map(l=>l.length-l.trimStart().length)),a=r.map(l=>l.slice(i)).map(l=>" ".repeat(this.indent*2)+l);for(const l of a)this.content.push(l)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
11
|
+
`))}}const qY={major:4,minor:3,patch:6},xn=ve("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qY;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=(l,u,d)=>{let f=Au(l),p;for(const m of u){if(m._zod.def.when){if(!m._zod.def.when(l))continue}else if(f)continue;const g=l.issues.length,v=m._zod.check(l);if(v instanceof Promise&&d?.async===!1)throw new Iu;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,l.issues.length!==g&&(f||(f=Au(l,g)))});else{if(l.issues.length===g)continue;f||(f=Au(l,g))}}return p?p.then(()=>l):l},a=(l,u,d)=>{if(Au(l))return l.aborted=!0,l;const f=i(u,r,d);if(f instanceof Promise){if(d.async===!1)throw new Iu;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(l,u)=>{if(u.skipChecks)return e._zod.parse(l,u);if(u.direction==="backward"){const f=e._zod.parse({value:l.value,issues:[]},{...u,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,l,u)):a(f,l,u)}const d=e._zod.parse(l,u);if(d instanceof Promise){if(u.async===!1)throw new Iu;return d.then(f=>i(f,r,u))}return i(d,r,u)}}Dt(e,"~standard",()=>({validate:i=>{try{const a=QW(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return WW(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),nk=ve("$ZodString",(e,t)=>{xn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??NY(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=ve("$ZodStringFormat",(e,t)=>{Pv.init(e,t),nk.init(e,t)}),FY=ve("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dY),pn.init(e,t)}),HY=ve("$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=D2(r))}else t.pattern??(t.pattern=D2());pn.init(e,t)}),KY=ve("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=fY),pn.init(e,t)}),GY=ve("$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})}}}),VY=ve("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=pY()),pn.init(e,t)}),QY=ve("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=cY),pn.init(e,t)}),WY=ve("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=iY),pn.init(e,t)}),YY=ve("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=aY),pn.init(e,t)}),ZY=ve("$ZodULID",(e,t)=>{t.pattern??(t.pattern=sY),pn.init(e,t)}),XY=ve("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oY),pn.init(e,t)}),JY=ve("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=lY),pn.init(e,t)}),eZ=ve("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=SY(t)),pn.init(e,t)}),tZ=ve("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wY),pn.init(e,t)}),nZ=ve("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=jY(t)),pn.init(e,t)}),rZ=ve("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=uY),pn.init(e,t)}),iZ=ve("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=mY),pn.init(e,t),e._zod.bag.format="ipv4"}),aZ=ve("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gY),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})}}}),sZ=ve("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=yY),pn.init(e,t)}),oZ=ve("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vY),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 l=Number(a);if(`${l}`!==a)throw new Error;if(l<0||l>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 c4(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const lZ=ve("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=xY),pn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{c4(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function cZ(e){if(!n4.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return c4(n)}const uZ=ve("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=n4),pn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{cZ(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),dZ=ve("$ZodE164",(e,t)=>{t.pattern??(t.pattern=bY),pn.init(e,t)});function fZ(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 hZ=ve("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{fZ(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),u4=ve("$ZodNumber",(e,t)=>{xn.init(e,t),e._zod.pattern=e._zod.bag.pattern??a4,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}}),pZ=ve("$ZodNumberFormat",(e,t)=>{_Y.init(e,t),u4.init(e,t)}),mZ=ve("$ZodBoolean",(e,t)=>{xn.init(e,t),e._zod.pattern=CY,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}}),gZ=ve("$ZodUnknown",(e,t)=>{xn.init(e,t),e._zod.parse=n=>n}),yZ=ve("$ZodNever",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function M2(e,t,n){e.issues.length&&t.issues.push(...Ou(n,e.issues)),t.value[n]=e.value}const vZ=ve("$ZodArray",(e,t)=>{xn.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 l=0;l<i.length;l++){const u=i[l],d=t.element._zod.run({value:u,issues:[]},r);d instanceof Promise?a.push(d.then(f=>M2(f,n,l))):M2(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function ay(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Ou(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function d4(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=IW(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function f4(e,t,n,r,i,a){const l=[],u=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(u.has(m))continue;if(f==="never"){l.push(m);continue}const g=d.run({value:t[m],issues:[]},r);g instanceof Promise?e.push(g.then(v=>ay(v,n,m,t,p))):ay(g,n,m,t,p)}return l.length&&n.issues.push({code:"unrecognized_keys",keys:l,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const xZ=ve("$ZodObject",(e,t)=>{if(xn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...u};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Ev(()=>d4(t));Dt(e._zod,"propValues",()=>{const u=t.shape,d={};for(const f in u){const p=u[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=bh,a=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=r.value);const f=u.value;if(!i(f))return u.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),u;u.value={};const p=[],m=l.shape;for(const g of l.keys){const v=m[g],j=v._zod.optout==="optional",b=v._zod.run({value:f[g],issues:[]},d);b instanceof Promise?p.push(b.then(S=>ay(S,u,g,f,j))):ay(b,u,g,f,j)}return a?f4(p,f,u,d,r.value,e):p.length?Promise.all(p).then(()=>u):u}}),bZ=ve("$ZodObjectJIT",(e,t)=>{xZ.init(e,t);const n=e._zod.parse,r=Ev(()=>d4(t)),i=g=>{const v=new UY(["shape","payload","ctx"]),j=r.value,b=C=>{const A=R2(C);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};v.write("const input = payload.value;");const S=Object.create(null);let k=0;for(const C of j.keys)S[C]=`key_${k++}`;v.write("const newResult = {};");for(const C of j.keys){const A=S[C],P=R2(C),_=g[C]?._zod?.optout==="optional";v.write(`const ${A} = ${b(C)};`),_?v.write(`
|
|
12
|
+
if (${A}.issues.length) {
|
|
13
|
+
if (${P} in input) {
|
|
14
|
+
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
15
|
+
...iss,
|
|
16
|
+
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (${A}.value === undefined) {
|
|
22
|
+
if (${P} in input) {
|
|
23
|
+
newResult[${P}] = undefined;
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
newResult[${P}] = ${A}.value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`):v.write(`
|
|
30
|
+
if (${A}.issues.length) {
|
|
31
|
+
payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
|
|
32
|
+
...iss,
|
|
33
|
+
path: iss.path ? [${P}, ...iss.path] : [${P}]
|
|
34
|
+
})));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (${A}.value === undefined) {
|
|
38
|
+
if (${P} in input) {
|
|
39
|
+
newResult[${P}] = undefined;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
newResult[${P}] = ${A}.value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(C,A)=>E(g,C,A)};let a;const l=bh,u=!W5.jitless,f=u&&DW.value,p=t.catchall;let m;e._zod.parse=(g,v)=>{m??(m=r.value);const j=g.value;return l(j)?u&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),g=a(g,v),p?f4([],j,g,v,m,e):g):n(g,v):(g.issues.push({expected:"object",code:"invalid_type",input:j,inst:e}),g)}});function I2(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=>!Au(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(l=>Fo(l,r,qo())))}),t)}const h4=ve("$ZodUnion",(e,t)=>{xn.init(e,t),Dt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Dt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Dt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Dt(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=>XN(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 l=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)u.push(f),l=!0;else{if(f.issues.length===0)return f;u.push(f)}}return l?Promise.all(u).then(d=>I2(d,i,e,a)):I2(u,i,e,a)}}),wZ=ve("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,h4.init(e,t);const n=e._zod.parse;Dt(e._zod,"propValues",()=>{const i={};for(const a of t.options){const l=a._zod.propValues;if(!l||Object.keys(l).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const[u,d]of Object.entries(l)){i[u]||(i[u]=new Set);for(const f of d)i[u].add(f)}}return i});const r=Ev(()=>{const i=t.options,a=new Map;for(const l of i){const u=l._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of u){if(a.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);a.set(d,l)}}return a});e._zod.parse=(i,a)=>{const l=i.value;if(!bh(l))return i.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),i;const u=r.value.get(l?.[t.discriminator]);return u?u._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),i)}}),jZ=ve("$ZodIntersection",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},r),l=t.right._zod.run({value:i,issues:[]},r);return a instanceof Promise||l instanceof Promise?Promise.all([a,l]).then(([d,f])=>L2(n,d,f)):L2(n,a,l)}});function XS(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(Wu(e)&&Wu(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 l=XS(e[a],t[a]);if(!l.valid)return{valid:!1,mergeErrorPath:[a,...l.mergeErrorPath]};i[a]=l.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],l=XS(i,a);if(!l.valid)return{valid:!1,mergeErrorPath:[r,...l.mergeErrorPath]};n.push(l.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function L2(e,t,n){const r=new Map;let i;for(const u of t.issues)if(u.code==="unrecognized_keys"){i??(i=u);for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(u);for(const u of n.issues)if(u.code==="unrecognized_keys")for(const d of u.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length&&i&&e.issues.push({...i,keys:a}),Au(e))return e;const l=XS(t.value,n.value);if(!l.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`);return e.value=l.data,e}const SZ=ve("$ZodRecord",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Wu(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],l=t.keyType._zod.values;if(l){n.value={};const u=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){u.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(...Ou(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Ou(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)u.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 u of Reflect.ownKeys(i)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&a4.test(u)&&d.issues.length){const m=t.keyType._zod.run({value:Number(u),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[u]=i[u]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Fo(m,r,qo())),input:u,path:[u],inst:e});continue}const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Ou(u,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Ou(u,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),NZ=ve("$ZodEnum",(e,t)=>{xn.init(e,t);const n=Y5(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>MW.has(typeof i)).map(i=>typeof i=="string"?Yu(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const l=i.value;return r.has(l)||i.issues.push({code:"invalid_value",values:n,input:l,inst:e}),i}}),kZ=ve("$ZodLiteral",(e,t)=>{if(xn.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"?Yu(r):r?Yu(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}}),CZ=ve("$ZodTransform",(e,t)=>{xn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Q5(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(l=>(n.value=l,n));if(i instanceof Promise)throw new Iu;return n.value=i,n}});function $2(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const p4=ve("$ZodOptional",(e,t)=>{xn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${XN(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=>$2(a,n.value)):$2(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),AZ=ve("$ZodExactOptional",(e,t)=>{p4.init(e,t),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),OZ=ve("$ZodNullable",(e,t)=>{xn.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${XN(n.source)}|null)$`):void 0}),Dt(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)}),EZ=ve("$ZodDefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",Dt(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=>B2(a,t)):B2(i,t)}});function B2(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const _Z=ve("$ZodPrefault",(e,t)=>{xn.init(e,t),e._zod.optin="optional",Dt(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))}),zZ=ve("$ZodNonOptional",(e,t)=>{xn.init(e,t),Dt(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=>U2(a,e)):U2(i,e)}});function U2(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 PZ=ve("$ZodCatch",(e,t)=>{xn.init(e,t),Dt(e._zod,"optin",()=>t.innerType._zod.optin),Dt(e._zod,"optout",()=>t.innerType._zod.optout),Dt(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(l=>Fo(l,r,qo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Fo(a,r,qo()))},input:n.value}),n.issues=[]),n)}}),TZ=ve("$ZodPipe",(e,t)=>{xn.init(e,t),Dt(e._zod,"values",()=>t.in._zod.values),Dt(e._zod,"optin",()=>t.in._zod.optin),Dt(e._zod,"optout",()=>t.out._zod.optout),Dt(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(l=>Fm(l,t.in,r)):Fm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>Fm(a,t.out,r)):Fm(i,t.out,r)}});function Fm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const RZ=ve("$ZodReadonly",(e,t)=>{xn.init(e,t),Dt(e._zod,"propValues",()=>t.innerType._zod.propValues),Dt(e._zod,"values",()=>t.innerType._zod.values),Dt(e._zod,"optin",()=>t.innerType?._zod?.optin),Dt(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(q2):q2(i)}});function q2(e){return e.value=Object.freeze(e.value),e}const DZ=ve("$ZodCustom",(e,t)=>{ni.init(e,t),xn.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=>F2(a,n,r,e));F2(i,n,r,e)}});function F2(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(wh(i))}}var H2;class MZ{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 IZ(){return new MZ}(H2=globalThis).__zod_globalRegistry??(H2.__zod_globalRegistry=IZ());const Jf=globalThis.__zod_globalRegistry;function LZ(e,t){return new e({type:"string",...Fe(t)})}function $Z(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function K2(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function BZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function UZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function qZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function FZ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function HZ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function KZ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function GZ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function VZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function QZ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function WZ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function YZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function ZZ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function XZ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function JZ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function eX(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function tX(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function nX(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function rX(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function iX(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function aX(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function sX(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function oX(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function lX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function cX(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function uX(e,t){return new e({type:"number",checks:[],...Fe(t)})}function dX(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function fX(e,t){return new e({type:"boolean",...Fe(t)})}function hX(e){return new e({type:"unknown"})}function pX(e,t){return new e({type:"never",...Fe(t)})}function G2(e,t){return new o4({check:"less_than",...Fe(t),value:e,inclusive:!1})}function bw(e,t){return new o4({check:"less_than",...Fe(t),value:e,inclusive:!0})}function V2(e,t){return new l4({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function ww(e,t){return new l4({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function Q2(e,t){return new EY({check:"multiple_of",...Fe(t),value:e})}function m4(e,t){return new zY({check:"max_length",...Fe(t),maximum:e})}function sy(e,t){return new PY({check:"min_length",...Fe(t),minimum:e})}function g4(e,t){return new TY({check:"length_equals",...Fe(t),length:e})}function mX(e,t){return new RY({check:"string_format",format:"regex",...Fe(t),pattern:e})}function gX(e){return new DY({check:"string_format",format:"lowercase",...Fe(e)})}function yX(e){return new MY({check:"string_format",format:"uppercase",...Fe(e)})}function vX(e,t){return new IY({check:"string_format",format:"includes",...Fe(t),includes:e})}function xX(e,t){return new LY({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function bX(e,t){return new $Y({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function gd(e){return new BY({check:"overwrite",tx:e})}function wX(e){return gd(t=>t.normalize(e))}function jX(){return gd(e=>e.trim())}function SX(){return gd(e=>e.toLowerCase())}function NX(){return gd(e=>e.toUpperCase())}function kX(){return gd(e=>RW(e))}function CX(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function AX(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function OX(e){const t=EX(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(wh(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(wh(i))}},e(n.value,n)));return t}function EX(e,t){const n=new ni({check:"custom",...Fe(t)});return n._zod.check=e,n}function y4(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??Jf,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 Un(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 l={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,l);const u=e._zod.toJSONSchema?.();if(u)l.schema=u;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const g=l.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,g,p)}const m=e._zod.parent;m&&(l.ref||(l.ref=m),Un(m,t,p),t.seen.get(m).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(l.schema,d),t.io==="input"&&zr(e)&&(delete l.schema.examples,delete l.schema.default),t.io==="input"&&l.schema._prefault&&((r=l.schema).default??(r.default=l.schema._prefault)),delete l.schema._prefault,t.seen.get(e).schema}function v4(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 l of e.seen.entries()){const u=e.metadataRegistry.get(l[0])?.id;if(u){const d=r.get(u);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(u,l[0])}}const i=l=>{const u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(l[0])?.id,g=e.external.uri??(j=>j);if(m)return{ref:g(m)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${g("__shared")}#/${u}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${u}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=l=>{if(l[1].schema.$ref)return;const u=l[1],{ref:d,defId:f}=i(l);u.def={...u.schema},f&&(u.defId=f);const p=u.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const u=l[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
46
|
+
|
|
47
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const u=l[1];if(t===l[0]){a(l);continue}if(e.external){const f=e.external.registry.get(l[0])?.id;if(t!==l[0]&&f){a(l);continue}}if(e.metadataRegistry.get(l[0])?.id){a(l);continue}if(u.cycle){a(l);continue}if(u.count>1&&e.reused==="ref"){a(l);continue}}}function x4(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const u=e.seen.get(l);if(u.ref===null)return;const d=u.def??u.schema,f={...d},p=u.ref;if(u.ref=null,p){r(p);const g=e.seen.get(p),v=g.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),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&g.def)for(const b in d)b==="$ref"||b==="allOf"||b in g.def&&JSON.stringify(d[b])===JSON.stringify(g.def[b])&&delete d[b]}const m=l._zod.parent;if(m&&m!==p){r(m);const g=e.seen.get(m);if(g?.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const v in d)v==="$ref"||v==="allOf"||v in g.def&&JSON.stringify(d[v])===JSON.stringify(g.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:u.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[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 l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(a[u.defId]=u.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:oy(t,"input",e.processors),output:oy(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function zr(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 zr(r.element,n);if(r.type==="set")return zr(r.valueType,n);if(r.type==="lazy")return zr(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 zr(r.innerType,n);if(r.type==="intersection")return zr(r.left,n)||zr(r.right,n);if(r.type==="record"||r.type==="map")return zr(r.keyType,n)||zr(r.valueType,n);if(r.type==="pipe")return zr(r.in,n)||zr(r.out,n);if(r.type==="object"){for(const i in r.shape)if(zr(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(zr(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(zr(i,n))return!0;return!!(r.rest&&zr(r.rest,n))}return!1}const _X=(e,t={})=>n=>{const r=y4({...n,processors:t});return Un(e,r),v4(r,e),x4(r,e)},oy=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},l=y4({...i??{},target:a,io:t,processors:n});return Un(e,l),v4(l,e),x4(l,e)},zX={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},PX=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:u,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),u&&(i.format=zX[u]??u,i.format===""&&delete i.format,u==="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}))])}},TX=(e,t,n,r)=>{const i=n,{minimum:a,maximum:l,format:u,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof u=="string"&&u.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 l=="number"&&(i.maximum=l,typeof f=="number"&&t.target!=="draft-04"&&(f<=l?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},RX=(e,t,n,r)=>{n.type="boolean"},DX=(e,t,n,r)=>{n.not={}},MX=(e,t,n,r)=>{},IX=(e,t,n,r)=>{const i=e._zod.def,a=Y5(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},LX=(e,t,n,r)=>{const i=e._zod.def,a=[];for(const l of i.values)if(l===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof l=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(l))}else a.push(l);if(a.length!==0)if(a.length===1){const l=a[0];n.type=l===null?"null":typeof l,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[l]:n.const=l}else a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),a.every(l=>typeof l=="boolean")&&(n.type="boolean"),a.every(l=>l===null)&&(n.type="null"),n.enum=a},$X=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},UX=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:l,maximum:u}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof u=="number"&&(i.maxItems=u),i.type="array",i.items=Un(a.element,t,{...r,path:[...r.path,"items"]})},qX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const l=a.shape;for(const f in l)i.properties[f]=Un(l[f],t,{...r,path:[...r.path,"properties",f]});const u=new Set(Object.keys(l)),d=new Set([...u].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=Un(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},FX=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((u,d)=>Un(u,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},HX=(e,t,n,r)=>{const i=e._zod.def,a=Un(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=Un(i.right,t,{...r,path:[...r.path,"allOf",1]}),u=f=>"allOf"in f&&Object.keys(f).length===1,d=[...u(a)?a.allOf:[a],...u(l)?l.allOf:[l]];n.allOf=d},KX=(e,t,n,r)=>{const i=n,a=e._zod.def;i.type="object";const l=a.keyType,d=l._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const p=Un(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=Un(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Un(a.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const f=l._zod.values;if(f){const p=[...f].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},GX=(e,t,n,r)=>{const i=e._zod.def,a=Un(i.innerType,t,r),l=t.seen.get(e);t.target==="openapi-3.0"?(l.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},VX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},QX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},WX=(e,t,n,r)=>{const i=e._zod.def;Un(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)))},YX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType;let l;try{l=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=l},ZX=(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;Un(a,t,r);const l=t.seen.get(e);l.ref=a},XX=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},b4=(e,t,n,r)=>{const i=e._zod.def;Un(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},JX=ve("ZodISODateTime",(e,t)=>{eZ.init(e,t),wn.init(e,t)});function eJ(e){return sX(JX,e)}const tJ=ve("ZodISODate",(e,t)=>{tZ.init(e,t),wn.init(e,t)});function nJ(e){return oX(tJ,e)}const rJ=ve("ZodISOTime",(e,t)=>{nZ.init(e,t),wn.init(e,t)});function iJ(e){return lX(rJ,e)}const aJ=ve("ZodISODuration",(e,t)=>{rZ.init(e,t),wn.init(e,t)});function sJ(e){return cX(aJ,e)}const oJ=(e,t)=>{e4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>VW(e,n)},flatten:{value:n=>GW(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,ZS,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,ZS,2)}},isEmpty:{get(){return e.issues.length===0}}})},Qi=ve("ZodError",oJ,{Parent:Error}),lJ=ek(Qi),cJ=tk(Qi),uJ=_v(Qi),dJ=zv(Qi),fJ=YW(Qi),hJ=ZW(Qi),pJ=XW(Qi),mJ=JW(Qi),gJ=eY(Qi),yJ=tY(Qi),vJ=nY(Qi),xJ=rY(Qi),bn=ve("ZodType",(e,t)=>(xn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:oy(e,"input"),output:oy(e,"output")}}),e.toJSONSchema=_X(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Wo(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)=>Yo(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>lJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>uJ(e,n,r),e.parseAsync=async(n,r)=>cJ(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>dJ(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>fJ(e,n,r),e.decode=(n,r)=>hJ(e,n,r),e.encodeAsync=async(n,r)=>pJ(e,n,r),e.decodeAsync=async(n,r)=>mJ(e,n,r),e.safeEncode=(n,r)=>gJ(e,n,r),e.safeDecode=(n,r)=>yJ(e,n,r),e.safeEncodeAsync=async(n,r)=>vJ(e,n,r),e.safeDecodeAsync=async(n,r)=>xJ(e,n,r),e.refine=(n,r)=>e.check(pee(n,r)),e.superRefine=n=>e.check(mee(n)),e.overwrite=n=>e.check(gd(n)),e.optional=()=>Z2(e),e.exactOptional=()=>tee(e),e.nullable=()=>X2(e),e.nullish=()=>Z2(X2(e)),e.nonoptional=n=>oee(e,n),e.array=()=>Ae(e),e.or=n=>KJ([e,n]),e.and=n=>WJ(e,n),e.transform=n=>J2(e,JJ(n)),e.default=n=>iee(e,n),e.prefault=n=>see(e,n),e.catch=n=>cee(e,n),e.pipe=n=>J2(e,n),e.readonly=()=>fee(e),e.describe=n=>{const r=e.clone();return Jf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Jf.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Jf.get(e);const r=e.clone();return Jf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),w4=ve("_ZodString",(e,t)=>{nk.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>PX(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(mX(...r)),e.includes=(...r)=>e.check(vX(...r)),e.startsWith=(...r)=>e.check(xX(...r)),e.endsWith=(...r)=>e.check(bX(...r)),e.min=(...r)=>e.check(sy(...r)),e.max=(...r)=>e.check(m4(...r)),e.length=(...r)=>e.check(g4(...r)),e.nonempty=(...r)=>e.check(sy(1,...r)),e.lowercase=r=>e.check(gX(r)),e.uppercase=r=>e.check(yX(r)),e.trim=()=>e.check(jX()),e.normalize=(...r)=>e.check(wX(...r)),e.toLowerCase=()=>e.check(SX()),e.toUpperCase=()=>e.check(NX()),e.slugify=()=>e.check(kX())}),bJ=ve("ZodString",(e,t)=>{nk.init(e,t),w4.init(e,t),e.email=n=>e.check($Z(wJ,n)),e.url=n=>e.check(HZ(jJ,n)),e.jwt=n=>e.check(aX(IJ,n)),e.emoji=n=>e.check(KZ(SJ,n)),e.guid=n=>e.check(K2(W2,n)),e.uuid=n=>e.check(BZ(Hm,n)),e.uuidv4=n=>e.check(UZ(Hm,n)),e.uuidv6=n=>e.check(qZ(Hm,n)),e.uuidv7=n=>e.check(FZ(Hm,n)),e.nanoid=n=>e.check(GZ(NJ,n)),e.guid=n=>e.check(K2(W2,n)),e.cuid=n=>e.check(VZ(kJ,n)),e.cuid2=n=>e.check(QZ(CJ,n)),e.ulid=n=>e.check(WZ(AJ,n)),e.base64=n=>e.check(nX(RJ,n)),e.base64url=n=>e.check(rX(DJ,n)),e.xid=n=>e.check(YZ(OJ,n)),e.ksuid=n=>e.check(ZZ(EJ,n)),e.ipv4=n=>e.check(XZ(_J,n)),e.ipv6=n=>e.check(JZ(zJ,n)),e.cidrv4=n=>e.check(eX(PJ,n)),e.cidrv6=n=>e.check(tX(TJ,n)),e.e164=n=>e.check(iX(MJ,n)),e.datetime=n=>e.check(eJ(n)),e.date=n=>e.check(nJ(n)),e.time=n=>e.check(iJ(n)),e.duration=n=>e.check(sJ(n))});function R(e){return LZ(bJ,e)}const wn=ve("ZodStringFormat",(e,t)=>{pn.init(e,t),w4.init(e,t)}),wJ=ve("ZodEmail",(e,t)=>{KY.init(e,t),wn.init(e,t)}),W2=ve("ZodGUID",(e,t)=>{FY.init(e,t),wn.init(e,t)}),Hm=ve("ZodUUID",(e,t)=>{HY.init(e,t),wn.init(e,t)}),jJ=ve("ZodURL",(e,t)=>{GY.init(e,t),wn.init(e,t)}),SJ=ve("ZodEmoji",(e,t)=>{VY.init(e,t),wn.init(e,t)}),NJ=ve("ZodNanoID",(e,t)=>{QY.init(e,t),wn.init(e,t)}),kJ=ve("ZodCUID",(e,t)=>{WY.init(e,t),wn.init(e,t)}),CJ=ve("ZodCUID2",(e,t)=>{YY.init(e,t),wn.init(e,t)}),AJ=ve("ZodULID",(e,t)=>{ZY.init(e,t),wn.init(e,t)}),OJ=ve("ZodXID",(e,t)=>{XY.init(e,t),wn.init(e,t)}),EJ=ve("ZodKSUID",(e,t)=>{JY.init(e,t),wn.init(e,t)}),_J=ve("ZodIPv4",(e,t)=>{iZ.init(e,t),wn.init(e,t)}),zJ=ve("ZodIPv6",(e,t)=>{aZ.init(e,t),wn.init(e,t)}),PJ=ve("ZodCIDRv4",(e,t)=>{sZ.init(e,t),wn.init(e,t)}),TJ=ve("ZodCIDRv6",(e,t)=>{oZ.init(e,t),wn.init(e,t)}),RJ=ve("ZodBase64",(e,t)=>{lZ.init(e,t),wn.init(e,t)}),DJ=ve("ZodBase64URL",(e,t)=>{uZ.init(e,t),wn.init(e,t)}),MJ=ve("ZodE164",(e,t)=>{dZ.init(e,t),wn.init(e,t)}),IJ=ve("ZodJWT",(e,t)=>{hZ.init(e,t),wn.init(e,t)}),j4=ve("ZodNumber",(e,t)=>{u4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>TX(e,r,i),e.gt=(r,i)=>e.check(V2(r,i)),e.gte=(r,i)=>e.check(ww(r,i)),e.min=(r,i)=>e.check(ww(r,i)),e.lt=(r,i)=>e.check(G2(r,i)),e.lte=(r,i)=>e.check(bw(r,i)),e.max=(r,i)=>e.check(bw(r,i)),e.int=r=>e.check(Y2(r)),e.safe=r=>e.check(Y2(r)),e.positive=r=>e.check(V2(0,r)),e.nonnegative=r=>e.check(ww(0,r)),e.negative=r=>e.check(G2(0,r)),e.nonpositive=r=>e.check(bw(0,r)),e.multipleOf=(r,i)=>e.check(Q2(r,i)),e.step=(r,i)=>e.check(Q2(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 he(e){return uX(j4,e)}const LJ=ve("ZodNumberFormat",(e,t)=>{pZ.init(e,t),j4.init(e,t)});function Y2(e){return dX(LJ,e)}const $J=ve("ZodBoolean",(e,t)=>{mZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RX(e,n,r)});function ct(e){return fX($J,e)}const BJ=ve("ZodUnknown",(e,t)=>{gZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MX()});function Zu(){return hX(BJ)}const UJ=ve("ZodNever",(e,t)=>{yZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DX(e,n,r)});function qJ(e){return pX(UJ,e)}const FJ=ve("ZodArray",(e,t)=>{vZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UX(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(sy(n,r)),e.nonempty=n=>e.check(sy(1,n)),e.max=(n,r)=>e.check(m4(n,r)),e.length=(n,r)=>e.check(g4(n,r)),e.unwrap=()=>e.element});function Ae(e,t){return CX(FJ,e,t)}const HJ=ve("ZodObject",(e,t)=>{bZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qX(e,n,r,i),Dt(e,"shape",()=>t.shape),e.keyof=()=>nt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Zu()}),e.loose=()=>e.clone({...e._zod.def,catchall:Zu()}),e.strict=()=>e.clone({...e._zod.def,catchall:qJ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>UW(e,n),e.safeExtend=n=>qW(e,n),e.merge=n=>FW(e,n),e.pick=n=>$W(e,n),e.omit=n=>BW(e,n),e.partial=(...n)=>HW(N4,e,n[0]),e.required=(...n)=>KW(k4,e,n[0])});function ge(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new HJ(n)}const S4=ve("ZodUnion",(e,t)=>{h4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FX(e,n,r,i),e.options=t.options});function KJ(e,t){return new S4({type:"union",options:e,...Fe(t)})}const GJ=ve("ZodDiscriminatedUnion",(e,t)=>{S4.init(e,t),wZ.init(e,t)});function VJ(e,t,n){return new GJ({type:"union",options:t,discriminator:e,...Fe(n)})}const QJ=ve("ZodIntersection",(e,t)=>{jZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>HX(e,n,r,i)});function WJ(e,t){return new QJ({type:"intersection",left:e,right:t})}const YJ=ve("ZodRecord",(e,t)=>{SZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>KX(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function vc(e,t,n){return new YJ({type:"record",keyType:e,valueType:t,...Fe(n)})}const JS=ve("ZodEnum",(e,t)=>{NZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>IX(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 l of r)if(n.has(l))a[l]=t.entries[l];else throw new Error(`Key ${l} not found in enum`);return new JS({...t,checks:[],...Fe(i),entries:a})},e.exclude=(r,i)=>{const a={...t.entries};for(const l of r)if(n.has(l))delete a[l];else throw new Error(`Key ${l} not found in enum`);return new JS({...t,checks:[],...Fe(i),entries:a})}});function nt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new JS({type:"enum",entries:n,...Fe(t)})}const ZJ=ve("ZodLiteral",(e,t)=>{kZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LX(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 Ba(e,t){return new ZJ({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const XJ=ve("ZodTransform",(e,t)=>{CZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Q5(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(wh(a,n.value,t));else{const l=a;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=n.value),l.inst??(l.inst=e),n.issues.push(wh(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function JJ(e){return new XJ({type:"transform",transform:e})}const N4=ve("ZodOptional",(e,t)=>{p4.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>b4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Z2(e){return new N4({type:"optional",innerType:e})}const eee=ve("ZodExactOptional",(e,t)=>{AZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>b4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function tee(e){return new eee({type:"optional",innerType:e})}const nee=ve("ZodNullable",(e,t)=>{OZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>GX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function X2(e){return new nee({type:"nullable",innerType:e})}const ree=ve("ZodDefault",(e,t)=>{EZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>QX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function iee(e,t){return new ree({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():X5(t)}})}const aee=ve("ZodPrefault",(e,t)=>{_Z.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>WX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function see(e,t){return new aee({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():X5(t)}})}const k4=ve("ZodNonOptional",(e,t)=>{zZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>VX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function oee(e,t){return new k4({type:"nonoptional",innerType:e,...Fe(t)})}const lee=ve("ZodCatch",(e,t)=>{PZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cee(e,t){return new lee({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const uee=ve("ZodPipe",(e,t)=>{TZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ZX(e,n,r,i),e.in=t.in,e.out=t.out});function J2(e,t){return new uee({type:"pipe",in:e,out:t})}const dee=ve("ZodReadonly",(e,t)=>{RZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function fee(e){return new dee({type:"readonly",innerType:e})}const hee=ve("ZodCustom",(e,t)=>{DZ.init(e,t),bn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$X(e,n)});function pee(e,t={}){return AX(hee,e,t)}function mee(e){return OX(e)}ge({maxConcurrency:he().int().positive(),maxRequestsPerMinute:he().int().positive(),maxRequestsPerDay:he().int().positive()});const Is=R().min(1);R().min(1);const rk=ge({label:R().min(1),city:R().min(1),region:R().min(1),country:R().length(2),timezone:R().optional()}),ik=nt(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);ge({id:R(),projectId:R(),channel:Ba("webhook"),url:R().url(),urlDisplay:R(),urlHost:R(),events:Ae(ik),enabled:ct().default(!0),source:R().optional(),webhookSecret:R().optional(),createdAt:R(),updatedAt:R()});ge({channel:Ba("webhook"),url:R().url(),events:Ae(ik).min(1),source:R().optional()});const C4=nt(["cli","api","config-file"]);function gee(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 yee(e,t){return t?e.some(n=>n.label===t):!0}ge({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional(),country:R().length(2),language:R().min(2),tags:Ae(R()).optional(),labels:vc(R(),R()).optional(),providers:Ae(Is).optional(),locations:Ae(rk).optional(),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().optional(),configSource:C4.optional()});ge({id:R(),name:R(),displayName:R().optional(),canonicalDomain:R(),ownedDomains:Ae(R()).default([]),country:R().length(2),language:R().min(2),tags:Ae(R()).default([]),labels:vc(R(),R()).default({}),locations:Ae(rk).default([]),defaultLocation:R().nullable().optional(),autoExtractBacklinks:ct().default(!1),configSource:C4.default("cli"),configRevision:he().int().positive().default(1),createdAt:R().optional(),updatedAt:R().optional()});ge({id:R(),query:R(),createdAt:R()});ge({id:R(),keyword:R(),createdAt:R()});ge({queries:Ae(R().trim().min(1)).min(1)});ge({keywords:Ae(R().trim().min(1)).min(1)});ge({provider:Is,count:he().int().min(1).max(20).optional()});ge({id:R(),domain:R(),createdAt:R()});ge({competitors:Ae(R().trim().min(1)).min(1)});function ly(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const vee=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 xee(e){const t=ly(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 vee.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function bee(e){const t=xee(e);return t?t.split(".")[0]??"":""}function wee(e){const t=[e.canonicalDomain,...e.ownedDomains??[]],n=new Set,r=[];for(const i of t){const a=i.trim();if(!a)continue;const l=ly(a);n.has(l)||(n.add(l),r.push(a))}return r}const jee=ge({name:R().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:vc(R(),R()).optional().default({})}),See=ge({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),providers:Ae(Is).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),Nee=ge({channel:Ba("webhook"),url:R().url(),events:Ae(ik).min(1)}),kee=ge({gsc:ge({propertyUrl:R()}).optional(),syncSchedule:ge({preset:R().optional(),cron:R().optional()}).optional()}).optional(),eP=Ae(R().min(1)),Cee=ge({displayName:R().min(1),canonicalDomain:R().min(1),ownedDomains:Ae(R().min(1)).optional().default([]),country:R().length(2),language:R().min(2),queries:eP.optional(),keywords:eP.optional(),competitors:Ae(R().min(1)).optional().default([]),providers:Ae(Is).optional().default([]),locations:Ae(rk).optional().default([]),defaultLocation:R().optional(),schedule:See,notifications:Ae(Nee).optional().default([]),google:kee,autoExtractBacklinks:ct().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=gee(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),yee(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ge({apiVersion:Ba("canonry/v1"),kind:Ba("Project"),metadata:jee,spec:Cee});const Aee=nt(["gsc","ga4"]);ge({id:R(),domain:R(),connectionType:Aee,propertyId:R().nullable().optional(),sitemapUrl:R().nullable().optional(),scopes:Ae(R()).default([]),createdAt:R(),updatedAt:R()});ge({date:R(),query:R(),page:R(),country:R().nullable().optional(),device:R().nullable().optional(),clicks:he(),impressions:he(),ctr:he(),position:he()});const e1=ge({id:R(),url:R(),indexingState:R().nullable().optional(),verdict:R().nullable().optional(),coverageState:R().nullable().optional(),pageFetchState:R().nullable().optional(),robotsTxtState:R().nullable().optional(),crawlTime:R().nullable().optional(),lastCrawlResult:R().nullable().optional(),isMobileFriendly:ct().nullable().optional(),richResults:Ae(R()).default([]),inspectedAt:R()});nt(["stable","reindexed","deindexed","still-missing","new"]);const Oee=ge({url:R(),previousState:R().nullable(),currentState:R().nullable(),transitionDate:R()}),Eee=ge({reason:R(),count:he(),urls:Ae(e1).default([])});ge({summary:ge({total:he(),indexed:he(),notIndexed:he(),deindexed:he(),percentage:he()}),lastInspectedAt:R().nullable(),lastSyncedAt:R().nullable(),indexed:Ae(e1).default([]),notIndexed:Ae(e1).default([]),deindexed:Ae(Oee).default([]),reasonGroups:Ae(Eee).default([])});ge({url:R(),type:nt(["URL_UPDATED","URL_DELETED"]),notifiedAt:R()});ge({url:R(),type:nt(["URL_UPDATED","URL_DELETED"]),notifiedAt:R(),status:nt(["success","error"]),error:R().optional()});ge({date:R(),indexed:he(),notIndexed:he(),reasonBreakdown:vc(R(),he()).default({})});ge({id:R(),domain:R(),siteUrl:R().nullable().optional(),createdAt:R(),updatedAt:R()});const jw=ge({id:R(),url:R(),httpCode:he().nullable().optional(),inIndex:ct().nullable().optional(),lastCrawledDate:R().nullable().optional(),inIndexDate:R().nullable().optional(),inspectedAt:R(),documentSize:he().nullable().optional(),anchorCount:he().nullable().optional(),discoveryDate:R().nullable().optional()});ge({summary:ge({total:he(),indexed:he(),notIndexed:he(),unknown:he().optional(),percentage:he()}),lastInspectedAt:R().nullable(),indexed:Ae(jw).default([]),notIndexed:Ae(jw).default([]),unknown:Ae(jw).default([]).optional()});ge({query:R(),impressions:he(),clicks:he(),ctr:he(),averagePosition:he()});ge({date:R(),indexed:he(),notIndexed:he(),unknown:he()});ge({url:R(),status:nt(["success","error"]),submittedAt:R(),error:R().optional()});const yd=nt(["live","staging"]);ge({projectName:R(),url:R(),stagingUrl:R().optional(),username:R(),defaultEnv:yd,createdAt:R(),updatedAt:R()});const tP=ge({url:R(),reachable:ct(),pageCount:he().nullable().optional(),version:R().nullable().optional(),error:R().nullable().optional(),plugins:Ae(R()).optional(),authenticatedUser:ge({id:he(),slug:R()}).nullable().optional()});ge({connected:ct(),projectName:R(),defaultEnv:yd,live:tP.nullable(),staging:tP.nullable(),adminUrl:R().nullable().optional()});const _ee=ge({id:he(),slug:R(),title:R(),status:R(),modifiedAt:R().nullable().optional(),link:R().nullable().optional()}),A4=ge({title:R().nullable(),description:R().nullable(),noindex:ct().nullable(),writable:ct().default(!1),writeTargets:Ae(R()).default([])}),zee=ge({type:R(),json:vc(R(),Zu())}),Pee=_ee.extend({env:yd,content:R(),seo:A4,schemaBlocks:Ae(zee).default([])}),nP=Pee.extend({contentHash:R(),contentSnippet:R()}),O4=ge({manualRequired:Ba(!0),targetUrl:R(),adminUrl:R().nullable().optional(),content:R(),nextSteps:Ae(R()).default([])}),Tee=ge({slug:R(),severity:nt(["high","medium","low"]),code:nt(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:R()});ge({slug:R(),title:R(),status:R(),wordCount:he(),seo:A4,schemaPresent:ct(),issues:Ae(Tee).default([])});const Ree=ge({slug:R(),status:nt(["applied","skipped","manual"]),error:R().optional(),manualAssist:O4.optional()});ge({env:yd,strategy:nt(["plugin","manual"]),results:Ae(Ree)});const Dee=ge({slug:R(),status:nt(["deployed","stripped","skipped","failed"]),schemasInjected:Ae(R()).optional(),manualAssist:O4.optional(),error:R().optional()});ge({env:yd,results:Ae(Dee)});const Mee=ge({slug:R(),title:R(),canonrySchemas:Ae(R()),thirdPartySchemas:Ae(R()),hasCanonrySchema:ct()});ge({env:yd,pages:Ae(Mee)});const Iee=ge({name:R(),status:nt(["completed","skipped","failed"]),summary:R().optional(),error:R().optional()});ge({projectName:R(),steps:Ae(Iee)});ge({slug:R(),live:nP,staging:nP,hasDifferences:ct(),differences:ge({title:ct(),slug:ct(),content:ct(),seoTitle:ct(),seoDescription:ct(),noindex:ct(),schema:ct()})});const E4=nt(["queued","running","completed","partial","failed","cancelled"]),hr=E4.enum,_4=nt(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract"]),Pt=_4.enum,z4=nt(["manual","scheduled","config-apply"]),sh=z4.enum,Xu=nt(["cited","not-cited"]),Ju=Xu.enum,cy=nt(["visible","not-visible"]);cy.enum;const P4=nt(["new","cited","lost","emerging","not-cited"]);P4.enum;ge({kind:Ba(Pt["answer-visibility"]).optional(),trigger:Ba(sh.manual).optional(),providers:Ae(Is).optional(),location:R().min(1).optional(),allLocations:ct().optional(),noLocation:ct().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const Lee=ge({message:R(),raw:Zu().optional()}),$ee=ge({message:R().optional(),providers:vc(R(),Lee).optional()}),Bee=ge({id:R(),projectId:R(),kind:_4,status:E4,trigger:z4.default("manual"),location:R().nullable().optional(),startedAt:R().nullable().optional(),finishedAt:R().nullable().optional(),error:$ee.nullable().optional(),createdAt:R()});function ak(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 T4=ge({uri:R(),title:R()}),R4=ge({id:R(),runId:R(),queryId:R(),query:R().optional(),provider:Is,citationState:Xu,answerMentioned:ct().optional(),visibilityState:cy.optional(),transition:P4.optional(),answerText:R().nullable().optional(),citedDomains:Ae(R()).default([]),competitorOverlap:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),matchedTerms:Ae(R()).default([]),groundingSources:Ae(T4).default([]),searchQueries:Ae(R()).default([]),model:R().nullable().optional(),location:R().nullable().optional(),createdAt:R()});ge({snapshots:Ae(R4),total:he().int().nonnegative()});const Uee=ge({queryId:R().nullable(),query:R().nullable(),run1State:Xu.nullable(),run2State:Xu.nullable(),run1AnswerMentioned:ct().nullable(),run2AnswerMentioned:ct().nullable(),run1VisibilityState:cy.nullable(),run2VisibilityState:cy.nullable(),changed:ct(),visibilityChanged:ct()});ge({run1:R(),run2:R(),diff:Ae(Uee)});const qee=Bee.extend({snapshots:Ae(R4).optional()});ge({totalRuns:he().int().nonnegative(),run:qee.nullable()});ge({id:R(),projectId:R().nullable().optional(),actor:R(),action:R(),entityType:R(),entityId:R().nullable().optional(),diff:Zu().optional(),createdAt:R()});const Fee=nt(["yes","no","unknown","not-mentioned"]),rP=Ae(R().min(1));ge({companyName:R().min(1),domain:R().min(1),queries:rP.optional(),phrases:rP.optional(),competitors:Ae(R().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 Hee=ge({name:R(),count:he().int().nonnegative()}),Kee=ge({id:R(),name:R(),weight:he(),score:he(),grade:R(),status:nt(["pass","partial","fail"]),findings:Ae(ge({type:R(),message:R()})).default([]),recommendations:Ae(R()).default([])}),Gee=ge({url:R(),finalUrl:R(),auditedAt:R(),overallScore:he(),overallGrade:R(),summary:R(),factors:Ae(Kee).default([])}),Vee=ge({industry:R(),summary:R(),services:Ae(R()).default([]),categoryTerms:Ae(R()).default([])}),Qee=ge({provider:R(),displayName:R(),model:R().nullable().optional(),mentioned:ct(),cited:ct(),describedAccurately:Fee,accuracyNotes:R().nullable().optional(),incorrectClaims:Ae(R()).default([]),recommendedCompetitors:Ae(R()).default([]),citedDomains:Ae(R()).default([]),groundingSources:Ae(T4).default([]),searchQueries:Ae(R()).default([]),answerText:R(),error:R().nullable().optional()}),Wee=ge({query:R(),providerResults:Ae(Qee).default([])}),Yee=ge({totalQueries:he().int().nonnegative(),totalProviders:he().int().nonnegative(),totalComparisons:he().int().nonnegative(),mentionCount:he().int().nonnegative(),citationCount:he().int().nonnegative(),topCompetitors:Ae(Hee).default([]),visibilityGap:R(),whatThisMeans:Ae(R()).default([]),recommendedActions:Ae(R()).default([])});ge({companyName:R(),domain:R(),homepageUrl:R(),generatedAt:R(),queries:Ae(R()).default([]),competitors:Ae(R()).default([]),profile:Vee,audit:Gee,queryResults:Ae(Wee).default([]),summary:Yee});ge({id:R(),projectId:R(),cronExpr:R(),preset:R().nullable().optional(),timezone:R().default("UTC"),enabled:ct().default(!0),providers:Ae(Is).default([]),lastRunAt:R().nullable().optional(),nextRunAt:R().nullable().optional(),createdAt:R(),updatedAt:R()});ge({preset:R().optional(),cron:R().optional(),timezone:R().optional().default("UTC"),enabled:ct().optional().default(!0),providers:Ae(Is).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const Zee=nt(["mentioned","cited"]);Zee.enum;ge({id:R(),projectId:R(),propertyId:R(),clientEmail:R(),connected:ct(),createdAt:R(),updatedAt:R()});ge({date:R(),landingPage:R(),sessions:he(),organicSessions:he(),users:he()});const sk=nt(["session","first_user","manual_utm"]),Xee=ge({source:R(),medium:R(),sessions:he(),users:he(),sourceDimension:sk}),Jee=ge({source:R(),medium:R(),sourceDimension:sk,landingPage:R(),sessions:he(),users:he()}),ete=ge({source:R(),medium:R(),sessions:he(),users:he(),channelGroup:R()});ge({totalSessions:he(),totalOrganicSessions:he(),totalDirectSessions:he(),totalUsers:he(),topPages:Ae(ge({landingPage:R(),sessions:he(),organicSessions:he(),directSessions:he(),users:he()})),aiReferrals:Ae(Xee),aiReferralLandingPages:Ae(Jee),aiSessionsDeduped:he(),aiUsersDeduped:he(),aiSessionsBySession:he(),aiUsersBySession:he(),socialReferrals:Ae(ete),socialSessions:he(),socialUsers:he(),organicSharePct:he(),aiSharePct:he(),aiSharePctBySession:he(),directSharePct:he(),socialSharePct:he(),organicSharePctDisplay:R(),aiSharePctDisplay:R(),aiSharePctBySessionDisplay:R(),directSharePctDisplay:R(),socialSharePctDisplay:R(),lastSyncedAt:R().nullable()});ge({date:R(),source:R(),medium:R(),landingPage:R(),sessions:he(),users:he(),sourceDimension:sk});ge({date:R(),source:R(),medium:R(),sessions:he(),users:he(),channelGroup:R()});ge({date:R(),sessions:he(),organicSessions:he(),users:he()});function uy(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const tte=nt(["aero","user","compaction"]);tte.enum;const D4=128;ge({key:R().min(1).max(D4),value:R().min(1)});ge({key:R().min(1).max(D4)});const ok=nt(["queued","downloading","querying","ready","failed"]);ok.enum;ge({id:R(),release:R(),status:ok,phaseDetail:R().nullable().optional(),vertexPath:R().nullable().optional(),edgesPath:R().nullable().optional(),vertexSha256:R().nullable().optional(),edgesSha256:R().nullable().optional(),vertexBytes:he().int().nullable().optional(),edgesBytes:he().int().nullable().optional(),projectsProcessed:he().int().nullable().optional(),domainsDiscovered:he().int().nullable().optional(),downloadStartedAt:R().nullable().optional(),downloadFinishedAt:R().nullable().optional(),queryStartedAt:R().nullable().optional(),queryFinishedAt:R().nullable().optional(),error:R().nullable().optional(),createdAt:R(),updatedAt:R()});const nte=ge({linkingDomain:R(),numHosts:he().int()}),rte=ge({projectId:R(),release:R(),targetDomain:R(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:R(),queriedAt:R(),excludedLinkingDomains:he().int().optional(),excludedHosts:he().int().optional()});ge({summary:rte.nullable(),total:he().int(),rows:Ae(nte)});ge({release:R(),totalLinkingDomains:he().int(),totalHosts:he().int(),top10HostsShare:R(),queriedAt:R()});ge({duckdbInstalled:ct(),duckdbVersion:R().nullable().optional(),duckdbSpec:R(),pluginDir:R()});ge({installed:ct(),version:R(),path:R(),alreadyPresent:ct()});ge({release:R(),vertexUrl:R(),edgesUrl:R(),vertexBytes:he().int().nullable(),edgesBytes:he().int().nullable(),lastModified:R().nullable()});ge({release:R(),syncStatus:ok.nullable(),bytes:he().int(),lastUsedAt:R().nullable()});nt(["snapshot","insight"]);const ite=ge({kind:Ba("snapshot"),id:R(),runId:R(),query:R(),provider:R(),model:R().nullable(),citationState:Xu,matchedField:nt(["answerText","citedDomains","searchQueries","query"]),snippet:R(),createdAt:R()}),ate=ge({kind:Ba("insight"),id:R(),runId:R().nullable(),type:nt(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:nt(["critical","high","medium","low"]),title:R(),query:R(),provider:R(),matchedField:nt(["title","query","recommendation","cause"]),snippet:R(),dismissed:ct(),createdAt:R()}),ste=VJ("kind",[ite,ate]);ge({query:R(),totalHits:he().int().nonnegative(),truncated:ct(),hits:Ae(ste)});const M4=nt(["create","expand","refresh","add-schema"]);M4.enum;function iP(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const I4=nt(["gsc","competitor-evidence","both"]);I4.enum;const L4=nt(["high","medium","low"]);L4.enum;function aP(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const ote=nt(["blog-post","comparison","listicle","how-to","guide","glossary"]);ote.enum;const $4=nt(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);$4.enum;const lte=ge({url:R(),gscImpressions:he().nonnegative(),gscClicks:he().nonnegative(),gscAvgPosition:he().nonnegative().nullable(),organicSessions:he().nonnegative()}),cte=ge({domain:R(),url:R(),title:R(),citationCount:he().int().nonnegative()}),ute=ge({demand:he(),competitor:he(),absence:he(),gapSeverity:he()}),dte=ge({actionId:R(),state:$4,lastUpdated:R()}),fte=ge({targetRef:R(),query:R(),action:M4,ourBestPage:lte.nullable(),winningCompetitor:cte.nullable(),score:he(),scoreBreakdown:ute,drivers:Ae(R()),demandSource:I4,actionConfidence:L4,existingAction:dte.nullable()});ge({targets:Ae(fte),contextMetrics:ge({totalAiReferralSessions:he().int().nonnegative(),latestRunId:R(),runTimestamp:R()})});const hte=ge({uri:R(),title:R(),domain:R(),isOurDomain:ct(),isCompetitor:ct(),citationCount:he().int().nonnegative(),providers:Ae(Is)}),pte=ge({query:R(),groundingSources:Ae(hte)});ge({sources:Ae(pte),latestRunId:R()});const mte=ge({query:R(),competitorDomains:Ae(R()),competitorCount:he().int().nonnegative(),missRate:he().min(0).max(1),lastSeenInRunId:R()});ge({gaps:Ae(mte),latestRunId:R()});const B4=nt(["ok","warn","fail","skipped"]);B4.enum;const lk=nt(["global","project"]);lk.enum;const U4=nt(["auth","config","providers","integrations","database","schedules"]);U4.enum;const gte=ge({id:R(),category:U4,scope:lk,title:R(),status:B4,code:R().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:R(),remediation:R().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:vc(R(),Zu()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:he().int().nonnegative().describe("How long the check took to execute.")});ge({scope:lk,project:R().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:R().describe("ISO-8601 timestamp when this doctor run started."),durationMs:he().int().nonnegative(),summary:ge({total:he().int().nonnegative(),ok:he().int().nonnegative(),warn:he().int().nonnegative(),fail:he().int().nonnegative(),skipped:he().int().nonnegative()}),checks:Ae(gte)});function yte(e,t){if(!e)return"";const n=e.trim();if(!n)return"";if(/^https?:\/\//i.test(n))return n;if(n.startsWith("//"))return`https:${n}`;const r=t.trim().replace(/^https?:\/\//i,"").replace(/\/+$/,"");return r?n.startsWith("/")?`https://${r}${n}`:`https://${r}/${n}`:n}const vte=ge({provider:R(),citationState:Xu,cited:ct(),mentioned:ct(),runId:R(),runCreatedAt:R()}),xte=ge({queryId:R(),query:R(),providers:Ae(vte),citedCount:he().int().nonnegative(),mentionedCount:he().int().nonnegative(),totalProviders:he().int().nonnegative()}),bte=ge({queryId:R(),query:R(),provider:R(),citingCompetitors:Ae(R()),runId:R(),runCreatedAt:R()}),wte=ge({providersConfigured:he().int().nonnegative(),providersCiting:he().int().nonnegative(),providersMentioning:he().int().nonnegative(),totalQueries:he().int().nonnegative(),queriesCitedAndMentioned:he().int().nonnegative(),queriesCitedOnly:he().int().nonnegative(),queriesMentionedOnly:he().int().nonnegative(),queriesInvisible:he().int().nonnegative(),latestRunId:R().nullable(),latestRunAt:R().nullable()});ge({summary:wte,byQuery:Ae(xte),competitorGaps:Ae(bte),status:nt(["ready","no-data"]),reason:nt(["no-runs-yet","no-queries"]).optional()});function jte(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function q4(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function F4(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function Ste(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 Nte(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const kte=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function H4(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function K4(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 G4(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(H4).map(K4).filter(Boolean)):new Set}function V4(e,t){const n=H4(e).map(K4).filter(Boolean).filter(r=>!kte.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function Cte(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function Q4(e,t){const n=G4(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 l=V4(Cte(a),n);!l||r.has(l)||(r.add(l),i.push(a))}return i}function W4(e){const t=G4(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=V4(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const Ate=nt(["claude","codex"]);Ate.enum;const Ote=nt(["claude","codex","all"]);Ote.enum;var To=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(To||{});const Ete={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Km={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},_te=ak;function zte(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 Tv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function aa(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function sP(e){return e===null?"Unknown":e?"Pass":"Fail"}function t1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function Pte(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function Tte(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 Sw(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 l=i[1]?parseInt(i[1]):6;return`Every day at ${t1(l)} · ${r}`}const a=e.match(/^weekly@(mon|tue|wed|thu|fri|sat|sun)(?:@(\d+))?$/);if(a){const l={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"},u=a[2]?parseInt(a[2]):6;return`Every ${l[a[1]]} at ${t1(u)} · ${r}`}return`${e} · ${r}`}function dy(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function Y4(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 Rte(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 Dte(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Mte(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Ho(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
+
`):void 0}function Ite(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:dy(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:dy(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,l=i>0,u=n.providerStatuses.filter(d=>d.state==="ready").map(d=>Mte(d)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${a} configured`,meta:u||"None configured"}})}function Lte(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 $te(e,t,n){const r=Lte(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 l=n.providerStatuses.some(u=>u.state==="ready");return{...a,detail:l?"At least one provider configured.":"No providers configured.",state:l?"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 Z4="canonry.run-tracker",n1=new Set;let oP=!1,Bte=0,Rv={runs:{},batches:{}};function Ute(){const e=tc();for(const t of n1)t(e)}function qte(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function Fte(){typeof window>"u"||window.sessionStorage.setItem(Z4,JSON.stringify(Rv))}function X4(){oP||(oP=!0,!(typeof window>"u")&&(Rv=qte(window.sessionStorage.getItem(Z4))))}function Dv(e){Rv=e,Fte(),Ute()}function tc(){return X4(),Rv}function Hte(e){return X4(),n1.add(e),()=>{n1.delete(e)}}function J4(e){const t=tc();Dv({...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 lP(e){const t=tc();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Dv({...t,runs:r})}function Kte(e){const t=tc(),n=`batch_${Date.now()}_${++Bte}`;return Dv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function Gte(e){const t=tc();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Dv({...t,batches:r})}function ck(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function Vte(e,t){let n=0,r=0,i=0,a=0,l=0;for(const u of e){const d=t[u]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:l,finished:l===0}}function cP(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function uk(...e){return t=>{let n=!1;const r=e.map(i=>{const a=cP(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():cP(e[i],null)}}}}function xc(...e){return x.useCallback(uk(...e),e)}var Qte=Symbol.for("react.lazy"),fy=bv[" use ".trim().toString()];function Wte(e){return typeof e=="object"&&e!==null&&"then"in e}function e$(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Qte&&"_payload"in e&&Wte(e._payload)}function Yte(e){const t=Xte(e),n=x.forwardRef((r,i)=>{let{children:a,...l}=r;e$(a)&&typeof fy=="function"&&(a=fy(a._payload));const u=x.Children.toArray(a),d=u.find(ene);if(d){const f=d.props.children,p=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return s.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}var Zte=Yte("Slot");function Xte(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(e$(i)&&typeof fy=="function"&&(i=fy(i._payload)),x.isValidElement(i)){const l=nne(i),u=tne(a,i.props);return i.type!==x.Fragment&&(u.ref=r?uk(r,l):l),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jte=Symbol("radix.slottable");function ene(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jte}function tne(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]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function nne(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 t$(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=t$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ot(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=t$(e))&&(r&&(r+=" "),r+=t);return r}const uP=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,dP=Ot,n$=(e,t)=>n=>{var r;if(t?.variants==null)return dP(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,l=Object.keys(i).map(f=>{const p=n?.[f],m=a?.[f];if(p===null)return null;const g=uP(p)||uP(m);return i[f][g]}),u=n&&Object.entries(n).reduce((f,p)=>{let[m,g]=p;return g===void 0||(f[m]=g),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:g,...v}=p;return Object.entries(v).every(j=>{let[b,S]=j;return Array.isArray(S)?S.includes({...a,...u}[b]):{...a,...u}[b]===S})?[...f,m,g]:f},[]);return dP(e,l,d,n?.class,n?.className)},rne=(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},ine=(e,t)=>({classGroupId:e,validator:t}),r$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hy="-",fP=[],ane="arbitrary..",sne=e=>{const t=lne(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return one(l);const u=l.split(hy),d=u[0]===""&&u.length>1?1:0;return i$(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],f=n[l];return d?f?rne(f,d):d:f||fP}return n[l]||fP}}},i$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=i$(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const u=t===0?e.join(hy):e.slice(t).join(hy),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(u))return p.classGroupId}},one=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?ane+r:void 0})(),lne=e=>{const{theme:t,classGroups:n}=e;return cne(n,t)},cne=(e,t)=>{const n=r$();for(const r in e){const i=e[r];dk(i,n,r,t)}return n},dk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];une(l,t,n,r)}},une=(e,t,n,r)=>{if(typeof e=="string"){dne(e,t,n);return}if(typeof e=="function"){fne(e,t,n,r);return}hne(e,t,n,r)},dne=(e,t,n)=>{const r=e===""?t:a$(t,e);r.classGroupId=n},fne=(e,t,n,r)=>{if(pne(e)){dk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ine(n,e))},hne=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[u,d]=i[l];dk(d,a$(t,u),n,r)}},a$=(e,t)=>{let n=e;const r=t.split(hy),i=r.length;for(let a=0;a<i;a++){const l=r[a];let u=n.nextPart.get(l);u||(u=r$(),n.nextPart.set(l,u)),n=u}return n},pne=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,mne=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(a,l)=>{n[a]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=r[a])!==void 0)return i(a,l),l},set(a,l){a in n?n[a]=l:i(a,l)}}},r1="!",hP=":",gne=[],pP=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),yne=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let l=0,u=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const S=i[b];if(l===0&&u===0){if(S===hP){a.push(i.slice(d,b)),d=b+1;continue}if(S==="/"){f=b;continue}}S==="["?l++:S==="]"?l--:S==="("?u++:S===")"&&u--}const m=a.length===0?i:i.slice(d);let g=m,v=!1;m.endsWith(r1)?(g=m.slice(0,-1),v=!0):m.startsWith(r1)&&(g=m.slice(1),v=!0);const j=f&&f>d?f-d:void 0;return pP(a,v,g,j)};if(t){const i=t+hP,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):pP(gne,!1,l,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 l=n[a],u=l[0]==="[",d=t.has(l);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},xne=e=>({cache:mne(e.cacheSize),parseClassName:yne(e),sortModifiers:vne(e),...sne(e)}),bne=/\s+/,wne=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],u=e.trim().split(bne);let d="";for(let f=u.length-1;f>=0;f-=1){const p=u[f],{isExternal:m,modifiers:g,hasImportantModifier:v,baseClassName:j,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let S=!!b,k=r(S?j.substring(0,b):j);if(!k){if(!S){d=p+(d.length>0?" "+d:d);continue}if(k=r(j),!k){d=p+(d.length>0?" "+d:d);continue}S=!1}const E=g.length===0?"":g.length===1?g[0]:a(g).join(":"),C=v?E+r1:E,A=C+k;if(l.indexOf(A)>-1)continue;l.push(A);const P=i(k,S);for(let O=0;O<P.length;++O){const _=P[O];l.push(C+_)}d=p+(d.length>0?" "+d:d)}return d},jne=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=s$(n))&&(i&&(i+=" "),i+=r);return i},s$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=s$(e[r]))&&(n&&(n+=" "),n+=t);return n},Sne=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=xne(f),r=n.cache.get,i=n.cache.set,a=u,u(d)},u=d=>{const f=r(d);if(f)return f;const p=wne(d,n);return i(d,p),p};return a=l,(...d)=>a(jne(...d))},Nne=[],Kn=e=>{const t=n=>n[e]||Nne;return t.isThemeGetter=!0,t},o$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,l$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kne=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cne=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ane=/\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$/,One=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ene=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_ne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bo=e=>kne.test(e),dt=e=>!!e&&!Number.isNaN(Number(e)),wo=e=>!!e&&Number.isInteger(Number(e)),Nw=e=>e.endsWith("%")&&dt(e.slice(0,-1)),xs=e=>Cne.test(e),c$=()=>!0,zne=e=>Ane.test(e)&&!One.test(e),fk=()=>!1,Pne=e=>Ene.test(e),Tne=e=>_ne.test(e),Rne=e=>!Ie(e)&&!Le(e),Dne=e=>Zo(e,f$,fk),Ie=e=>o$.test(e),Nl=e=>Zo(e,h$,zne),mP=e=>Zo(e,Fne,dt),Mne=e=>Zo(e,m$,c$),Ine=e=>Zo(e,p$,fk),gP=e=>Zo(e,u$,fk),Lne=e=>Zo(e,d$,Tne),Gm=e=>Zo(e,g$,Pne),Le=e=>l$.test(e),Rf=e=>bc(e,h$),$ne=e=>bc(e,p$),yP=e=>bc(e,u$),Bne=e=>bc(e,f$),Une=e=>bc(e,d$),Vm=e=>bc(e,g$,!0),qne=e=>bc(e,m$,!0),Zo=(e,t,n)=>{const r=o$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},bc=(e,t,n=!1)=>{const r=l$.exec(e);return r?r[1]?t(r[1]):n:!1},u$=e=>e==="position"||e==="percentage",d$=e=>e==="image"||e==="url",f$=e=>e==="length"||e==="size"||e==="bg-size",h$=e=>e==="length",Fne=e=>e==="number",p$=e=>e==="family-name",m$=e=>e==="number"||e==="weight",g$=e=>e==="shadow",Hne=()=>{const e=Kn("color"),t=Kn("font"),n=Kn("text"),r=Kn("font-weight"),i=Kn("tracking"),a=Kn("leading"),l=Kn("breakpoint"),u=Kn("container"),d=Kn("spacing"),f=Kn("radius"),p=Kn("shadow"),m=Kn("inset-shadow"),g=Kn("text-shadow"),v=Kn("drop-shadow"),j=Kn("blur"),b=Kn("perspective"),S=Kn("aspect"),k=Kn("ease"),E=Kn("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...A(),Le,Ie],O=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],T=()=>[Le,Ie,d],$=()=>[bo,"full","auto",...T()],F=()=>[wo,"none","subgrid",Le,Ie],U=()=>["auto",{span:["full",wo,Le,Ie]},wo,Le,Ie],B=()=>[wo,"auto",Le,Ie],V=()=>["auto","min","max","fr",Le,Ie],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...T()],J=()=>[bo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],oe=()=>[bo,"screen","full","dvw","lvw","svw","min","max","fit",...T()],ye=()=>[bo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],I=()=>[e,Le,Ie],M=()=>[...A(),yP,gP,{position:[Le,Ie]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",Bne,Dne,{size:[Le,Ie]}],G=()=>[Nw,Rf,Nl],se=()=>["","none","full",f,Le,Ie],ne=()=>["",dt,Rf,Nl],Ce=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ee=()=>[dt,Nw,yP,gP],pe=()=>["","none",j,Le,Ie],Ee=()=>["none",dt,Le,Ie],Y=()=>["none",dt,Le,Ie],He=()=>[dt,Le,Ie],Te=()=>[bo,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xs],breakpoint:[xs],color:[c$],container:[xs],"drop-shadow":[xs],ease:["in","out","in-out"],font:[Rne],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xs],shadow:[xs],spacing:["px",dt],text:[xs],"text-shadow":[xs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",bo,Ie,Le,S]}],container:["container"],columns:[{columns:[dt,Ie,Le,u]}],"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:P()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],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:[wo,"auto",Le,Ie]}],basis:[{basis:[bo,"full","auto",u,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[dt,bo,"auto","initial","none",Ie]}],grow:[{grow:["",dt,Le,Ie]}],shrink:[{shrink:["",dt,Le,Ie]}],order:[{order:[wo,"first","last","none",Le,Ie]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:U()}],"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:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"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:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],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":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:J()}],"inline-size":[{inline:["auto",...oe()]}],"min-inline-size":[{"min-inline":["auto",...oe()]}],"max-inline-size":[{"max-inline":["none",...oe()]}],"block-size":[{block:["auto",...ye()]}],"min-block-size":[{"min-block":["auto",...ye()]}],"max-block-size":[{"max-block":["none",...ye()]}],w:[{w:[u,"screen",...J()]}],"min-w":[{"min-w":[u,"screen","none",...J()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...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,Rf,Nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,qne,Mne]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Nw,Ie]}],"font-family":[{font:[$ne,Ine,t]}],"font-features":[{"font-features":[Ie]}],"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,Le,Ie]}],"line-clamp":[{"line-clamp":[dt,"none",Le,mP]}],leading:[{leading:[a,...T()]}],"list-image":[{"list-image":["none",Le,Ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Ie]}],"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:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[dt,"from-font","auto",Le,Nl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[dt,"auto",Le,Ie]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Ie]}],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",Le,Ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wo,Le,Ie],radial:["",Le,Ie],conic:[wo,Le,Ie]},Une,Lne]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"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:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"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:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[dt,Le,Ie]}],"outline-w":[{outline:["",dt,Rf,Nl]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",p,Vm,Gm]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",m,Vm,Gm]}],"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,Nl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",g,Vm,Gm]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[dt,Le,Ie]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"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":[Le,Ie]}],"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":A()}],"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:M()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Ie]}],filter:[{filter:["","none",Le,Ie]}],blur:[{blur:pe()}],brightness:[{brightness:[dt,Le,Ie]}],contrast:[{contrast:[dt,Le,Ie]}],"drop-shadow":[{"drop-shadow":["","none",v,Vm,Gm]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",dt,Le,Ie]}],"hue-rotate":[{"hue-rotate":[dt,Le,Ie]}],invert:[{invert:["",dt,Le,Ie]}],saturate:[{saturate:[dt,Le,Ie]}],sepia:[{sepia:["",dt,Le,Ie]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Ie]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[dt,Le,Ie]}],"backdrop-contrast":[{"backdrop-contrast":[dt,Le,Ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",dt,Le,Ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[dt,Le,Ie]}],"backdrop-invert":[{"backdrop-invert":["",dt,Le,Ie]}],"backdrop-opacity":[{"backdrop-opacity":[dt,Le,Ie]}],"backdrop-saturate":[{"backdrop-saturate":[dt,Le,Ie]}],"backdrop-sepia":[{"backdrop-sepia":["",dt,Le,Ie]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[dt,"initial",Le,Ie]}],ease:[{ease:["linear","initial",k,Le,Ie]}],delay:[{delay:[dt,Le,Ie]}],animate:[{animate:["none",E,Le,Ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Le,Ie]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:Y()}],"scale-x":[{"scale-x":Y()}],"scale-y":[{"scale-y":Y()}],"scale-z":[{"scale-z":Y()}],"scale-3d":["scale-3d"],skew:[{skew:He()}],"skew-x":[{"skew-x":He()}],"skew-y":[{"skew-y":He()}],transform:[{transform:[Le,Ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"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",Le,Ie]}],"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":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",Le,Ie]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[dt,Rf,Nl,mP]}],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"]}},Kne=Sne(Hne);function Wi(...e){return Kne(Ot(e))}const Gne=n$("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"}}),be=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const l=r?Zte:"button";return s.jsx(l,{ref:a,className:Wi(Gne({variant:t,size:n,className:e})),...i})});be.displayName="Button";const Vne=n$("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 y$({className:e,variant:t,...n}){return s.jsx("div",{className:Wi(Vne({variant:t}),e),...n})}function vP({compact:e=!1,version:t}){const n=!e&&t&&t!=="unknown";return s.jsxs(Yt,{to:"/",className:`brand-lockup ${e?"brand-lockup-compact":""}`,"aria-label":"Canonry home",children:[s.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),s.jsxs("span",{className:"brand-copy",children:[s.jsx("span",{className:"brand-mark",children:"Canonry"}),n?s.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function nc({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 s.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 Xe({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return s.jsx(y$,{variant:r,...n,children:t})}function Mv({status:e}){return s.jsx(Xe,{tone:Y4(e),children:Tv(e)})}function Lo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function Qne(e,t){const n=x.createContext(t),r=a=>{const{children:l,...u}=a,d=x.useMemo(()=>u,Object.values(u));return s.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function i(a){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,i]}function Wne(e,t=[]){let n=[];function r(a,l){const u=x.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:g,children:v,...j}=m,b=g?.[e]?.[d]||u,S=x.useMemo(()=>j,Object.values(j));return s.jsx(b.Provider,{value:S,children:v})};f.displayName=a+"Provider";function p(m,g){const v=g?.[e]?.[d]||u,j=x.useContext(v);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[f,p]}const i=()=>{const a=n.map(l=>x.createContext(l));return function(u){const d=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,Yne(i,...t)]}function Yne(...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 l=r.reduce((u,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var jh=globalThis?.document?x.useLayoutEffect:()=>{},Zne=bv[" useId ".trim().toString()]||(()=>{}),Xne=0;function kw(e){const[t,n]=x.useState(Zne());return jh(()=>{n(r=>r??String(Xne++))},[e]),e||(t?`radix-${t}`:"")}var Jne=bv[" useInsertionEffect ".trim().toString()]||jh;function ere({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,l]=tre({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"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=u},[u,r])}const f=x.useCallback(p=>{if(u){const m=nre(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[u,e,a,l]);return[d,f]}function tre({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return Jne(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function nre(e){return typeof e=="function"}function v$(e){const t=rre(e),n=x.forwardRef((r,i)=>{const{children:a,...l}=r,u=x.Children.toArray(a),d=u.find(are);if(d){const f=d.props.children,p=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return s.jsx(t,{...l,ref:i,children:x.isValidElement(f)?x.cloneElement(f,void 0,p):null})}return s.jsx(t,{...l,ref:i,children:a})});return n.displayName=`${e}.Slot`,n}function rre(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const l=ore(i),u=sre(a,i.props);return i.type!==x.Fragment&&(u.ref=r?uk(r,l):l),x.cloneElement(i,u)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ire=Symbol("radix.slottable");function are(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ire}function sre(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]=(...u)=>{const d=a(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function ore(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 lre=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ls=lre.reduce((e,t)=>{const n=v$(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:l,...u}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cre(e,t){e&&gc.flushSync(()=>e.dispatchEvent(t))}function Sh(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function ure(e,t=globalThis?.document){const n=Sh(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 dre="DismissableLayer",i1="dismissableLayer.update",fre="dismissableLayer.pointerDownOutside",hre="dismissableLayer.focusOutside",xP,x$=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),b$=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...d}=e,f=x.useContext(x$),[p,m]=x.useState(null),g=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),j=xc(t,_=>m(_)),b=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=b.indexOf(S),E=p?b.indexOf(p):-1,C=f.layersWithOutsidePointerEventsDisabled.size>0,A=E>=k,P=gre(_=>{const T=_.target,$=[...f.branches].some(F=>F.contains(T));!A||$||(i?.(_),l?.(_),_.defaultPrevented||u?.())},g),O=yre(_=>{const T=_.target;[...f.branches].some(F=>F.contains(T))||(a?.(_),l?.(_),_.defaultPrevented||u?.())},g);return ure(_=>{E===f.layers.size-1&&(r?.(_),!_.defaultPrevented&&u&&(_.preventDefault(),u()))},g),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(xP=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),bP(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=xP)}},[p,g,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),bP())},[p,f]),x.useEffect(()=>{const _=()=>v({});return document.addEventListener(i1,_),()=>document.removeEventListener(i1,_)},[]),s.jsx(Ls.div,{...d,ref:j,style:{pointerEvents:C?A?"auto":"none":void 0,...e.style},onFocusCapture:Lo(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Lo(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Lo(e.onPointerDownCapture,P.onPointerDownCapture)})});b$.displayName=dre;var pre="DismissableLayerBranch",mre=x.forwardRef((e,t)=>{const n=x.useContext(x$),r=x.useRef(null),i=xc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx(Ls.div,{...e,ref:i})});mre.displayName=pre;function gre(e,t=globalThis?.document){const n=Sh(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!r.current){let d=function(){w$(fre,n,f,{discrete:!0})};const f={originalEvent:u};u.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},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yre(e,t=globalThis?.document){const n=Sh(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&w$(hre,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 bP(){const e=new CustomEvent(i1);document.dispatchEvent(e)}function w$(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?cre(i,a):i.dispatchEvent(a)}var Cw="focusScope.autoFocusOnMount",Aw="focusScope.autoFocusOnUnmount",wP={bubbles:!1,cancelable:!0},vre="FocusScope",j$=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...l}=e,[u,d]=x.useState(null),f=Sh(i),p=Sh(a),m=x.useRef(null),g=xc(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||!u)return;const A=C.target;u.contains(A)?m.current=A:No(m.current,{select:!0})},S=function(C){if(v.paused||!u)return;const A=C.relatedTarget;A!==null&&(u.contains(A)||No(m.current,{select:!0}))},k=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&No(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",S);const E=new MutationObserver(k);return u&&E.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",S),E.disconnect()}}},[r,u,v.paused]),x.useEffect(()=>{if(u){SP.add(v);const b=document.activeElement;if(!u.contains(b)){const k=new CustomEvent(Cw,wP);u.addEventListener(Cw,f),u.dispatchEvent(k),k.defaultPrevented||(xre(Nre(S$(u)),{select:!0}),document.activeElement===b&&No(u))}return()=>{u.removeEventListener(Cw,f),setTimeout(()=>{const k=new CustomEvent(Aw,wP);u.addEventListener(Aw,p),u.dispatchEvent(k),k.defaultPrevented||No(b??document.body,{select:!0}),u.removeEventListener(Aw,p),SP.remove(v)},0)}}},[u,f,p,v]);const j=x.useCallback(b=>{if(!n&&!r||v.paused)return;const S=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,k=document.activeElement;if(S&&k){const E=b.currentTarget,[C,A]=bre(E);C&&A?!b.shiftKey&&k===A?(b.preventDefault(),n&&No(C,{select:!0})):b.shiftKey&&k===C&&(b.preventDefault(),n&&No(A,{select:!0})):k===E&&b.preventDefault()}},[n,r,v.paused]);return s.jsx(Ls.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});j$.displayName=vre;function xre(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(No(r,{select:t}),document.activeElement!==n)return}function bre(e){const t=S$(e),n=jP(t,e),r=jP(t.reverse(),e);return[n,r]}function S$(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 jP(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 jre(e){return e instanceof HTMLInputElement&&"select"in e}function No(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jre(e)&&t&&e.select()}}var SP=Sre();function Sre(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=NP(e,t),e.unshift(t)},remove(t){e=NP(e,t),e[0]?.resume()}}}function NP(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Nre(e){return e.filter(t=>t.tagName!=="A")}var kre="Portal",N$=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);jh(()=>a(!0),[]);const l=n||i&&globalThis?.document?.body;return l?EG.createPortal(s.jsx(Ls.div,{...r,ref:t}),l):null});N$.displayName=kre;function Cre(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Iv=e=>{const{present:t,children:n}=e,r=Are(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=xc(r.ref,Ore(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};Iv.displayName="Presence";function Are(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,d]=Cre(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Qm(r.current);a.current=u==="mounted"?f:"none"},[u]),jh(()=>{const f=r.current,p=i.current;if(p!==e){const g=a.current,v=Qm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&g!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),jh(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=Qm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!i.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},g=v=>{v.target===t&&(a.current=Qm(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Qm(e){return e?.animationName||"none"}function Ore(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 Ow=0;function Ere(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kP()),document.body.insertAdjacentElement("beforeend",e[1]??kP()),Ow++,()=>{Ow===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ow--}},[])}function kP(){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 Ra=function(){return Ra=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},Ra.apply(this,arguments)};function k$(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 _re(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 Dg="right-scroll-bar-position",Mg="width-before-scroll-bar",zre="with-scroll-bars-hidden",Pre="--removed-body-scroll-bar-size";function Ew(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tre(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 Rre=typeof window<"u"?x.useLayoutEffect:x.useEffect,CP=new WeakMap;function Dre(e,t){var n=Tre(null,function(r){return e.forEach(function(i){return Ew(i,r)})});return Rre(function(){var r=CP.get(n);if(r){var i=new Set(r),a=new Set(e),l=n.current;i.forEach(function(u){a.has(u)||Ew(u,null)}),a.forEach(function(u){i.has(u)||Ew(u,l)})}CP.set(n,e)},[e]),n}function Mre(e){return e}function Ire(e,t){t===void 0&&(t=Mre);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 l=t(a,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var d=function(){var p=l;l=[],p.forEach(a)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(p){l.push(p),f()},filter:function(p){return l=l.filter(p),n}}}};return i}function Lre(e){e===void 0&&(e={});var t=Ire(null);return t.options=Ra({async:!0,ssr:!1},e),t}var C$=function(e){var t=e.sideCar,n=k$(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,Ra({},n))};C$.isSideCarExport=!0;function $re(e,t){return e.useMedium(t),C$}var A$=Lre(),_w=function(){},Lv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:_w,onWheelCapture:_w,onTouchMoveCapture:_w}),i=r[0],a=r[1],l=e.forwardProps,u=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,v=e.noRelative,j=e.noIsolation,b=e.inert,S=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,C=e.gapMode,A=k$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=g,O=Dre([n,t]),_=Ra(Ra({},A),i);return x.createElement(x.Fragment,null,p&&x.createElement(P,{sideCar:A$,removeScrollBar:f,shards:m,noRelative:v,noIsolation:j,inert:b,setCallbacks:a,allowPinchZoom:!!S,lockRef:n,gapMode:C}),l?x.cloneElement(x.Children.only(u),Ra(Ra({},_),{ref:O})):x.createElement(E,Ra({},_,{className:d,ref:O}),u))});Lv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Lv.classNames={fullWidth:Mg,zeroRight:Dg};var Bre=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ure(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Bre();return t&&e.setAttribute("nonce",t),e}function qre(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Fre(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Hre=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ure())&&(qre(t,n),Fre(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kre=function(){var e=Hre();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},O$=function(){var e=Kre(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Gre={left:0,top:0,right:0,gap:0},zw=function(e){return parseInt(e||"",10)||0},Vre=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[zw(n),zw(r),zw(i)]},Qre=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Gre;var t=Vre(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])}},Wre=O$(),Lu="data-scroll-locked",Yre=function(e,t,n,r){var i=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
+
.`.concat(zre,` {
|
|
54
|
+
overflow: hidden `).concat(r,`;
|
|
55
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
56
|
+
}
|
|
57
|
+
body[`).concat(Lu,`] {
|
|
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(l,`px;
|
|
64
|
+
margin-left:0;
|
|
65
|
+
margin-top:0;
|
|
66
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
67
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.`).concat(Dg,` {
|
|
71
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.`).concat(Mg,` {
|
|
75
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(Dg," .").concat(Dg,` {
|
|
79
|
+
right: 0 `).concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(Mg," .").concat(Mg,` {
|
|
83
|
+
margin-right: 0 `).concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
body[`).concat(Lu,`] {
|
|
87
|
+
`).concat(Pre,": ").concat(u,`px;
|
|
88
|
+
}
|
|
89
|
+
`)},AP=function(){var e=parseInt(document.body.getAttribute(Lu)||"0",10);return isFinite(e)?e:0},Zre=function(){x.useEffect(function(){return document.body.setAttribute(Lu,(AP()+1).toString()),function(){var e=AP()-1;e<=0?document.body.removeAttribute(Lu):document.body.setAttribute(Lu,e.toString())}},[])},Xre=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Zre();var a=x.useMemo(function(){return Qre(i)},[i]);return x.createElement(Wre,{styles:Yre(a,!t,i,n?"":"!important")})},a1=!1;if(typeof window<"u")try{var Wm=Object.defineProperty({},"passive",{get:function(){return a1=!0,!0}});window.addEventListener("test",Wm,Wm),window.removeEventListener("test",Wm,Wm)}catch{a1=!1}var cu=a1?{passive:!1}:!1,Jre=function(e){return e.tagName==="TEXTAREA"},E$=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Jre(e)&&n[t]==="visible")},eie=function(e){return E$(e,"overflowY")},tie=function(e){return E$(e,"overflowX")},OP=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=_$(e,r);if(i){var a=z$(e,r),l=a[1],u=a[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nie=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rie=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_$=function(e,t){return e==="v"?eie(t):tie(t)},z$=function(e,t){return e==="v"?nie(t):rie(t)},iie=function(e,t){return e==="h"&&t==="rtl"?-1:1},aie=function(e,t,n,r,i){var a=iie(e,window.getComputedStyle(t).direction),l=a*r,u=n.target,d=t.contains(u),f=!1,p=l>0,m=0,g=0;do{if(!u)break;var v=z$(e,u),j=v[0],b=v[1],S=v[2],k=b-S-a*j;(j||k)&&_$(e,u)&&(m+=k,g+=j);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(g)<1)&&(f=!0),f},Ym=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},EP=function(e){return[e.deltaX,e.deltaY]},_P=function(e){return e&&"current"in e?e.current:e},sie=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oie=function(e){return`
|
|
90
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
+
`)},lie=0,uu=[];function cie(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(lie++)[0],a=x.useState(O$)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var b=_re([e.lockRef.current],(e.shards||[]).map(_P),!0).filter(Boolean);return b.forEach(function(S){return S.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(b,S){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var k=Ym(b),E=n.current,C="deltaX"in b?b.deltaX:E[0]-k[0],A="deltaY"in b?b.deltaY:E[1]-k[1],P,O=b.target,_=Math.abs(C)>Math.abs(A)?"h":"v";if("touches"in b&&_==="h"&&O.type==="range")return!1;var T=window.getSelection(),$=T&&T.anchorNode,F=$?$===O||$.contains(O):!1;if(F)return!1;var U=OP(_,O);if(!U)return!0;if(U?P=_:(P=_==="v"?"h":"v",U=OP(_,O)),!U)return!1;if(!r.current&&"changedTouches"in b&&(C||A)&&(r.current=P),!P)return!0;var B=r.current||P;return aie(B,S,b,B==="h"?C:A)},[]),d=x.useCallback(function(b){var S=b;if(!(!uu.length||uu[uu.length-1]!==a)){var k="deltaY"in S?EP(S):Ym(S),E=t.current.filter(function(P){return P.name===S.type&&(P.target===S.target||S.target===P.shadowParent)&&sie(P.delta,k)})[0];if(E&&E.should){S.cancelable&&S.preventDefault();return}if(!E){var C=(l.current.shards||[]).map(_P).filter(Boolean).filter(function(P){return P.contains(S.target)}),A=C.length>0?u(S,C[0]):!l.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),f=x.useCallback(function(b,S,k,E){var C={name:b,delta:S,target:k,should:E,shadowParent:uie(k)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(A){return A!==C})},1)},[]),p=x.useCallback(function(b){n.current=Ym(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,EP(b),b.target,u(b,e.lockRef.current))},[]),g=x.useCallback(function(b){f(b.type,Ym(b),b.target,u(b,e.lockRef.current))},[]);x.useEffect(function(){return uu.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,cu),document.addEventListener("touchmove",d,cu),document.addEventListener("touchstart",p,cu),function(){uu=uu.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,cu),document.removeEventListener("touchmove",d,cu),document.removeEventListener("touchstart",p,cu)}},[]);var v=e.removeScrollBar,j=e.inert;return x.createElement(x.Fragment,null,j?x.createElement(a,{styles:oie(i)}):null,v?x.createElement(Xre,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function uie(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const die=$re(A$,cie);var P$=x.forwardRef(function(e,t){return x.createElement(Lv,Ra({},e,{ref:t,sideCar:die}))});P$.classNames=Lv.classNames;var fie=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},du=new WeakMap,Zm=new WeakMap,Xm={},Pw=0,T$=function(e){return e&&(e.host||T$(e.parentNode))},hie=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=T$(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})},pie=function(e,t,n,r){var i=hie(t,Array.isArray(e)?e:[e]);Xm[n]||(Xm[n]=new WeakMap);var a=Xm[n],l=[],u=new Set,d=new Set(i),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))p(g);else try{var v=g.getAttribute(r),j=v!==null&&v!=="false",b=(du.get(g)||0)+1,S=(a.get(g)||0)+1;du.set(g,b),a.set(g,S),l.push(g),b===1&&j&&Zm.set(g,!0),S===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",g,k)}})};return p(t),u.clear(),Pw++,function(){l.forEach(function(m){var g=du.get(m)-1,v=a.get(m)-1;du.set(m,g),a.set(m,v),g||(Zm.has(m)||m.removeAttribute(r),Zm.delete(m)),v||m.removeAttribute(n)}),Pw--,Pw||(du=new WeakMap,du=new WeakMap,Zm=new WeakMap,Xm={})}},mie=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=fie(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),pie(r,i,n,"aria-hidden")):function(){return null}},$v="Dialog",[R$]=Wne($v),[gie,ma]=R$($v),D$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:l=!0}=e,u=x.useRef(null),d=x.useRef(null),[f,p]=ere({prop:r,defaultProp:i??!1,onChange:a,caller:$v});return s.jsx(gie,{scope:t,triggerRef:u,contentRef:d,contentId:kw(),titleId:kw(),descriptionId:kw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};D$.displayName=$v;var M$="DialogTrigger",yie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(M$,n),a=xc(t,i.triggerRef);return s.jsx(Ls.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":mk(i.open),...r,ref:a,onClick:Lo(e.onClick,i.onOpenToggle)})});yie.displayName=M$;var hk="DialogPortal",[vie,I$]=R$(hk,{forceMount:void 0}),L$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ma(hk,t);return s.jsx(vie,{scope:t,forceMount:n,children:x.Children.map(r,l=>s.jsx(Iv,{present:n||a.open,children:s.jsx(N$,{asChild:!0,container:i,children:l})}))})};L$.displayName=hk;var py="DialogOverlay",$$=x.forwardRef((e,t)=>{const n=I$(py,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ma(py,e.__scopeDialog);return a.modal?s.jsx(Iv,{present:r||a.open,children:s.jsx(bie,{...i,ref:t})}):null});$$.displayName=py;var xie=v$("DialogOverlay.RemoveScroll"),bie=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(py,n);return s.jsx(P$,{as:xie,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx(Ls.div,{"data-state":mk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),rc="DialogContent",B$=x.forwardRef((e,t)=>{const n=I$(rc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ma(rc,e.__scopeDialog);return s.jsx(Iv,{present:r||a.open,children:a.modal?s.jsx(wie,{...i,ref:t}):s.jsx(jie,{...i,ref:t})})});B$.displayName=rc;var wie=x.forwardRef((e,t)=>{const n=ma(rc,e.__scopeDialog),r=x.useRef(null),i=xc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return mie(a)},[]),s.jsx(U$,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Lo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Lo(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:Lo(e.onFocusOutside,a=>a.preventDefault())})}),jie=x.forwardRef((e,t)=>{const n=ma(rc,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return s.jsx(U$,{...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 l=a.target;n.triggerRef.current?.contains(l)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&i.current&&a.preventDefault()}})}),U$=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...l}=e,u=ma(rc,n),d=x.useRef(null),f=xc(t,d);return Ere(),s.jsxs(s.Fragment,{children:[s.jsx(j$,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(b$,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":mk(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Sie,{titleId:u.titleId}),s.jsx(kie,{contentRef:d,descriptionId:u.descriptionId})]})]})}),pk="DialogTitle",q$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(pk,n);return s.jsx(Ls.h2,{id:i.titleId,...r,ref:t})});q$.displayName=pk;var F$="DialogDescription",H$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(F$,n);return s.jsx(Ls.p,{id:i.descriptionId,...r,ref:t})});H$.displayName=F$;var K$="DialogClose",G$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ma(K$,n);return s.jsx(Ls.button,{type:"button",...r,ref:t,onClick:Lo(e.onClick,()=>i.onOpenChange(!1))})});G$.displayName=K$;function mk(e){return e?"open":"closed"}var V$="DialogTitleWarning",[rze,Q$]=Qne(V$,{contentName:rc,titleName:pk,docsSlug:"dialog"}),Sie=({titleId:e})=>{const t=Q$(V$),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},Nie="DialogDescriptionWarning",kie=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q$(Nie).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},W$=D$,Y$=L$,gk=$$,yk=B$,vk=q$,Z$=H$,X$=G$;const Cie=W$,Aie=Y$,J$=x.forwardRef(({className:e,...t},n)=>s.jsx(gk,{ref:n,className:Wi("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));J$.displayName=gk.displayName;const Oie=400,Eie=1200,_ie=720,e3=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(_ie),l=x.useRef(!1),u=x.useRef(0),d=x.useRef(0),f=x.useCallback(g=>{l.current=!0,u.current=g.clientX,d.current=i,g.target.setPointerCapture(g.pointerId),g.preventDefault()},[i]),p=x.useCallback(g=>{if(!l.current)return;const v=u.current-g.clientX,j=Math.min(Eie,Math.max(Oie,d.current+v));a(j)},[]),m=x.useCallback(()=>{l.current=!1},[]);return s.jsxs(Aie,{children:[s.jsx(J$,{}),s.jsxs(yk,{ref:r,className:Wi("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:[s.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,s.jsxs(X$,{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:[s.jsx(Kh,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});e3.displayName=yk.displayName;const zie=({className:e,...t})=>s.jsx("div",{className:Wi("flex flex-col gap-1.5 pr-10",e),...t}),t3=x.forwardRef(({className:e,...t},n)=>s.jsx(vk,{ref:n,className:Wi("text-lg font-medium text-zinc-50",e),...t}));t3.displayName=vk.displayName;const n3=x.forwardRef(({className:e,...t},n)=>s.jsx(Z$,{ref:n,className:Wi("text-sm text-zinc-500",e),...t}));n3.displayName=Z$.displayName;function Pie({title:e,subtitle:t,children:n,open:r,onClose:i}){return s.jsx(Cie,{open:r,onOpenChange:a=>a?void 0:i(),children:s.jsxs(e3,{children:[s.jsxs(zie,{className:"drawer-head",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),s.jsx(t3,{id:"drawer-title",children:e}),s.jsx(n3,{className:"sr-only",children:t})]}),s.jsx("div",{className:"drawer-body",children:n})]})})}function pr({text:e}){const[t,n]=x.useState(null),r=x.useRef(null),i=x.useCallback(()=>{if(!r.current)return;const l=r.current.getBoundingClientRect();n({top:l.top,left:l.left+l.width/2})},[]),a=x.useCallback(()=>n(null),[]);return s.jsxs("span",{className:"info-tooltip-wrapper",onMouseEnter:i,onMouseLeave:a,onFocus:i,onBlur:a,children:[s.jsxs("svg",{ref:r,className:"info-tooltip-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M8 7v4M8 5.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),t!==null&&gc.createPortal(s.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 Tie=/[\s\-_]+/;function Rie(e){const t=e.split(Tie).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function zP(e,t){const n=Die(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"?Li.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const l=[...i].sort((f,p)=>p.length-f.length).map(Rie).filter(f=>!!f);if(l.length===0)return r.map((f,p)=>f.type==="bold"?Li.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const u=new RegExp(`(${l.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=uy(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(u).map((g,v)=>{if(!g)return null;if(v%2===1){const b=d.get(uy(g))??"answer-highlight";return f.type==="bold"?Li.createElement("mark",{key:`hl-${p}-${v}`,className:b},Li.createElement("strong",{className:"text-zinc-200 font-semibold"},g)):Li.createElement("mark",{key:`hl-${p}-${v}`,className:b},g)}return f.type==="bold"?Li.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},g):g})).filter(Boolean)}function Die(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Tw(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 Mie({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,l]=x.useState("mentions"),[u,d]=x.useState(-1),[f,p]=x.useState(null),[m,g]=x.useState(!1),[v,j]=x.useState({}),b=wee(t.project),S=new Set(b.map(ly)),k=e.runHistory,E=k.length>1,[C,A]=x.useState(null),P=x.useRef(!1);x.useEffect(()=>{if(P.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const G=k.at(-1);G&&(P.current=!0,ec(G.runId).then(se=>{const ne=se.snapshots.find(Ce=>Ce.query===e.query&&Ce.provider===e.provider);ne&&A({citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:G.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 O=u>=0&&f!==null,_=O?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},T=_.visibilityState==="pending"||_.citationState==="pending",$=T?!1:_.visibilityState!=null?_.visibilityState==="visible":_.answerMentioned!=null?_.answerMentioned:_.citationState===Ju.cited||_.citationState==="emerging",F=_.answerMentioned!=null||_.visibilityState!=null||_.recommendedCompetitors.length>0,U=_.citedDomains.length>0||_.groundingSources.length>0||_.evidenceUrls.length>0,B=t.project.displayName||t.project.name,V=[...b.map(ly),B,B.split(" ").slice(0,2).join(" "),..._.matchedTerms].filter(G=>G.trim().length>2),X=[..._.competitorDomains.flatMap(G=>{const se=bee(G);return se.length>=4?[se]:[]}),..._.recommendedCompetitors].filter(G=>G.trim().length>2),Z=[{terms:V,className:"answer-highlight-brand"},...X.length>0?[{terms:X,className:"answer-highlight-competitor"}]:[]],H=T?"pending":_.visibilityTransition==="lost"?"lost":$?"cited":"not-cited",J=x.useRef(0),oe=x.useCallback(async G=>{const se=++J.current;if(G===-1||G===k.length-1){d(-1),p(null),i(!1);return}d(G),i(!1);const ne=k[G],Ce=`${ne.runId}::${e.query}::${e.provider}`;if(v[Ce]){p(v[Ce]);return}g(!0);try{const Se=await ec(ne.runId);if(se!==J.current)return;const ee=Se.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider)??Se.snapshots.find(Ee=>Ee.query===e.query),pe=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:Tw(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:Tw(ne.visibilityTransition,ne.visibilityState),summary:"Snapshot data not available for this run."};j(Ee=>({...Ee,[Ce]:pe})),p(pe)}catch{if(se!==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:Tw(ne.visibilityTransition,ne.visibilityState),summary:"Failed to load historical run data."})}finally{se===J.current&&g(!1)}},[k,e.query,e.provider,v]),I=(O||e.historyScope!=="provider")&&_.model?`${_.provider} (${_.model}) · ${_.changeLabel.toLowerCase()}`:`${_.provider} · ${_.changeLabel.toLowerCase()}`,M=!O&&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(" · "):"",q=$?{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}:T?{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},D=()=>{if(!_.answerSnippet)return null;const G=_.answerSnippet.split(`
|
|
97
|
+
`),se=[];let ne=[],Ce=0;const Se=()=>{if(ne.length===0)return;const ee=ne.join(" ").trim();ee&&se.push(s.jsx("p",{className:se.length>0?"mt-2.5":"",children:zP(ee,Z)},Ce++)),ne=[]};for(const ee of G){const pe=ee.trim();if(/^[-\u2013\u2014]{3,}$/.test(pe)){Se(),se.push(s.jsx("hr",{className:"border-zinc-800/60 my-3"},Ce++));continue}const Ee=pe.match(/^(#{1,3})\s+(.+)$/);if(Ee){Se();const Y=Ee[1].length,He=Ee[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s#]+/u,"").trim()||Ee[2],Te=Y===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":Y===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";se.push(s.jsx("p",{className:Te,children:zP(He,Z)},Ce++));continue}if(pe===""){Se();continue}ne.push(pe)}return Se(),se};return s.jsx(W$,{open:!0,onOpenChange:G=>{G||n()},children:s.jsxs(Y$,{children:[s.jsx(gk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),s.jsxs(yk,{className:"evidence-modal","aria-describedby":void 0,children:[s.jsxs("div",{className:"evidence-modal-header",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"eyebrow eyebrow-soft",children:[t.project.name," ","·"," ",_.provider||"All providers"]}),s.jsx(vk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),s.jsxs(X$,{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:[s.jsx(Kh,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]}),E&&s.jsxs("div",{className:"evidence-modal-timeline",children:[s.jsx("p",{className:"drawer-section-label mb-1.5",children:"Run history"}),s.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1",children:k.map((G,se)=>{const ne=u===-1&&se===k.length-1||u===se,Ce=G.visibilityState??(G.answerMentioned?"visible":"not-visible"),Se=G.visibilityTransition??Ce,ee=Ce==="visible"?"bg-emerald-400":Se==="emerging"?"bg-amber-400":Se==="lost"?"bg-rose-400":"bg-zinc-600",Ee=new Date(G.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),Y=!!(G.model&&se>0&&k[se-1]?.model&&k[se-1].model!==G.model);return s.jsxs("button",{type:"button",className:`evidence-run-dot ${ne?"evidence-run-dot--selected":""}`,onClick:()=>oe(se===k.length-1?-1:se),"aria-label":[`Run ${Ee}: ${Ce}`,G.model?`model ${G.model}`:null,Y?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ne,children:[s.jsx("span",{className:`size-2 rounded-full ${ee} ${Y?"ring-1 ring-amber-300/80 ring-offset-2 ring-offset-zinc-950":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"text-[10px] text-zinc-500",children:Ee})]},se)})}),u>=0&&u<k.length&&s.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[u].createdAt).toLocaleString()," ","—"," ",s.jsx("span",{className:"capitalize",children:k[u].visibilityState??(k[u].answerMentioned?"visible":"not-visible")}),s.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>oe(-1),children:["←"," Back to latest"]})]}),!O&&(e.modelTransitions?.length??0)>0&&s.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.modelTransitions.map(G=>s.jsx("span",{className:"inline-flex items-center rounded-full border border-amber-400/30 bg-amber-400/10 px-2 py-1 text-[10px] text-amber-100",children:`${G.fromModel??"unknown"} -> ${G.toModel??"unknown"} on ${new Date(G.createdAt).toLocaleDateString()}`},`${G.runId}:${G.toModel??"unknown"}`))})]}),s.jsxs("div",{className:"evidence-modal-body",children:[m&&s.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&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"evidence-modal-main",children:[s.jsxs("div",{className:`evidence-position-hero evidence-position-hero--${H}`,children:[s.jsx("p",{className:`evidence-position-label evidence-position-label--${H}`,children:q.label}),s.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:q.title}),s.jsx("p",{className:"evidence-position-meta",children:q.meta}),M&&s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:M})]}),_.answerSnippet&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:"What the AI said"}),s.jsx("div",{className:`answer-snippet-block ${r?"evidence-answer-expanded":"evidence-answer-collapsed"}`,children:D()}),_.answerSnippet.length>280&&s.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&&s.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"}),!O&&e.relatedTechnicalSignals.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:$?"Why you're visible":"What to fix"}),s.jsx("div",{className:"action-items-list",children:e.relatedTechnicalSignals.map((G,se)=>s.jsxs("div",{className:"action-item",children:[s.jsx("svg",{className:`action-item-icon ${$?"text-emerald-400":"text-amber-400"}`,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:$?s.jsx("path",{d:"M3 8l3.5 3.5L13 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}):s.jsxs(s.Fragment,{children:[s.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),s.jsx("path",{d:"M8 5v3.5M8 10.5v0",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}),s.jsx("span",{className:"action-item-text",children:G})]},se))})]}),_.summary&&s.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:_.summary})]}),s.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||U)&&s.jsxs("div",{className:"sidebar-tabs",children:[s.jsx("button",{className:`sidebar-tab ${a==="mentions"?"sidebar-tab--active":""}`,onClick:()=>l("mentions"),type:"button",title:"Canonry's answer-level visibility assessment and any company names extracted from the answer text.",children:"Mentions"}),s.jsx("button",{className:`sidebar-tab ${a==="sources"?"sidebar-tab--active":""}`,onClick:()=>l("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"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Answer visibility"}),s.jsx(pr,{text:"Canonry scans the AI answer for your owned domains and project name. This is independent from grounding or citation sources."})]}),s.jsxs("div",{className:`mention-status mention-status--${$?"visible":"not-visible"}`,children:[s.jsx("span",{className:"mention-status-icon",children:T?"…":$?"✓":"—"}),s.jsx("span",{className:"mention-status-label",children:T?"Pending":$?"Visible":"Not visible"})]}),_.matchedTerms.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Matched in answer"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.matchedTerms.map(G=>s.jsx("span",{className:"mention-chip mention-chip--brand",children:G},G))})]}),!T&&!$&&_.matchedTerms.length===0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mb-1.5",children:"Searched for"}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:V.map(G=>s.jsx("span",{className:"mention-chip mention-chip--muted",children:G},G))}),s.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)&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Competitors in answer"}),s.jsx(pr,{text:"Competitors detected in the answer text or cited source links. Includes both tracked competitors and names extracted by Canonry."})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:(()=>{const G=_.competitorDomains.map(Ce=>Ce.replace(/^www\./,"")),se=new Set(G.map(Ce=>uy(Ce.replace(/\.[^.]+$/,""))));return[..._.recommendedCompetitors.filter(Ce=>!se.has(uy(Ce))),...G].map(Ce=>s.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ce},Ce))})()})]})]}),a==="sources"&&s.jsxs(s.Fragment,{children:[_.citedDomains.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsx("span",{children:"Domains from source links"}),s.jsx(pr,{text:"These domains were extracted from grounding or citation URLs. They are supporting-source metadata, not proof that the answer text mentioned them."})]}),s.jsx("div",{className:"citation-leaderboard",children:_.citedDomains.map((G,se)=>{const ne=G.toLowerCase().replace(/^www\./,""),Ce=S.has(ne),Se=!Ce&&_.competitorDomains.some(pe=>pe.toLowerCase().replace(/^www\./,"")===ne),ee=Ce?"you":Se?"competitor":"other";return s.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ee}`,children:[s.jsxs("span",{className:"citation-leaderboard-rank",children:["#",se+1]}),s.jsx("span",{className:"citation-leaderboard-domain",children:G}),Ce&&s.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),Se&&s.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},G)})})]}),_.groundingSources.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"drawer-section-label flex items-center",children:[s.jsxs("span",{children:["Grounding source links (",_.groundingSources.length,")"]}),s.jsx(pr,{text:"Links the model used as grounding or supporting context while producing the answer. These are not the same thing as answer visibility."})]}),s.jsx("ul",{className:"grid gap-0.5",children:_.groundingSources.map((G,se)=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:G.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G.title||G.uri})},se))})]}),_.evidenceUrls.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"drawer-section-label",children:"Evidence URLs"}),s.jsx("ul",{className:"grid gap-1",children:_.evidenceUrls.map(G=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:G,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:G})},G))})]}),_.citedDomains.length===0&&_.groundingSources.length===0&&_.evidenceUrls.length===0&&s.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No source data ",O?"for this run":"yet"]})]}),!F&&!U&&s.jsxs("div",{className:"flex items-center justify-center h-24 text-zinc-600 text-sm",children:["No answer visibility data ",O?"for this run":"yet"]})]})]})]})]})]})})}function ia(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 Rw=[{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 Bv(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 Iie=Bv({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"}),Lie=Bv({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"}),$ie=Bv({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"}),Bie=Bv({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"}),Uie=[{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:ia(["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:ia(["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:ia(["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:ia(["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:ia(["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:ia(["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:ia(["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:ia(["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:ia(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Rw[0],Rw[1],ia(["cited","cited","cited","cited","cited"]),Rw[2],2/7,ia(["not-cited","not-cited","not-cited","cited"]);function qie(e,t){return e.projects.find(n=>n.project.id===t)}function Fie(e,t){return e.runs.find(n=>n.id===t)}function Hie(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 Kie={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},Gie={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},Vie={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function Qie(e){return{id:e.id,tone:Kie[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??Vie[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:Gie[e.type]}]}}function Wie(e){return e.filter(t=>!t.dismissed).map(Qie)}function r3(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 PP(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function Yie(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 i3(e){switch(e){case Pt["answer-visibility"]:return"Answer visibility sweep";case Pt["gsc-sync"]:return"GSC sync";case Pt["inspect-sitemap"]:return"Sitemap inspection";case Pt["ga-sync"]:return"GA sync";case Pt["bing-inspect"]:return"Bing URL inspection";case Pt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Pt["site-audit"]:return"Site audit";case Pt["backlink-extract"]:return"Backlink extract"}}function Zie(e){return e===sh.manual?"Manual":e===sh.scheduled?"Scheduled":e===sh["config-apply"]?"Config apply":e}function xk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:i3(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?PP(e.startedAt):PP(e.createdAt),duration:Yie(e.startedAt,e.finishedAt),statusDetail:e.error?a3(e.error):Xie(e),summary:Jie(e),triggerLabel:Zie(e.trigger)}}function a3(e){const t=ak(e);return t.length>200?t.slice(0,200)+"…":t}function Xie(e){switch(e.status){case hr.queued:return"Waiting for execution slot.";case hr.running:return"Provider queries in progress.";case hr.completed:return"All queries checked.";case hr.partial:return"Run completed with some queries skipped.";case hr.failed:return e.error?a3(e.error):"Run failed.";case hr.cancelled:return"Run was cancelled.";default:return""}}function Jie(e){const t=i3(e.kind);switch(e.status){case hr.queued:return`${t} queued`;case hr.running:return`${t} in progress`;case hr.completed:return`${t} completed`;case hr.partial:return`${t} partially completed`;case hr.failed:return`${t} failed`;case hr.cancelled:return`${t} cancelled`;default:return e.status}}function eae(e,t,n,r){const i=[];let a=0;const l=new Set;if(n){const u=new Map;for(const g of n.snapshots)if(g.query){const v=`${g.query}::${g.provider}`;u.set(v,g)}const d=new Set(n.snapshots.map(g=>g.provider)),f=new Set(t.flatMap(g=>Object.keys(g.providerRuns??{}))),p=[...new Set([...d,...f])].sort(),m=p.length>0?p:["gemini"];for(const g of t){if(g.runs.length===0)continue;l.add(g.query);const v=g.runs.at(-1),j=v?.transition??"not-cited";for(const b of m){const S=u.get(`${g.query}::${b}`),k=(g.providerRuns?.[b]?.length??0)>0;if(!S&&!k)continue;const E=S?.model??null,C=E?`${b}:${E}`:null,A=C?g.modelRuns?.[C]:void 0,P=g.providerRuns?.[b],O=(P?.length?P:null)??(A?.length?A:null),_=P?.length?"provider":A?.length?"model":"query",T=O?O.at(-1).transition:j,$=O?O.at(-1).visibilityTransition??(O.at(-1).visibilityState==="visible"?"visible":"not-visible"):v?.visibilityTransition??(v?.visibilityState==="visible"?"visible":"not-visible"),F=O?.at(-1)?.citationState,U=O?.at(-1)?.visibilityState,B=S?T==="lost"?"lost":T==="emerging"?"emerging":S.citationState===Ju.cited?"cited":"not-cited":F===Ju.cited?"cited":"not-cited",V=S?.visibilityState??(U==="visible"?"visible":U==="pending"?"pending":"not-visible"),X=TP(O||g.runs),Z=RP(O||g.runs),H=tae(g,b),J=(O??g.runs).map(M=>({runId:M.runId,citationState:M.citationState,createdAt:M.createdAt,model:H.get(M.runId)??null,answerMentioned:M.answerMentioned,visibilityState:M.visibilityState,visibilityTransition:M.visibilityTransition})),oe=nae(J),ye=_==="provider"&&oe.length<=1?"model":_,I=rae(J);i.push({id:`evidence_${e}_${a++}`,query:g.query,provider:S?.provider??b,model:S?.model??null,location:S?.location??null,citationState:B,answerMentioned:S?.answerMentioned,visibilityState:V,visibilityChangeLabel:DP($,Z,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:DP(T,X),answerSnippet:S?.answerText??"",citedDomains:S?.citedDomains??[],evidenceUrls:[],competitorDomains:S?.competitorOverlap??[],recommendedCompetitors:S?.recommendedCompetitors??[],matchedTerms:S?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:S?.groundingSources??[],summary:iae(V,$,g.query),runHistory:J,historyScope:ye,modelsSeen:oe,modelTransitions:I})}}}for(const u of r)l.has(u.query)||i.push({id:`evidence_${e}_${a++}`,query:u.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:`"${u.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function tae(e,t){const n=new Map,r=`${t}:`;for(const[i,a]of Object.entries(e.modelRuns??{})){if(!i.startsWith(r))continue;const l=i.slice(r.length),u=l==="unknown"?null:l;for(const d of a)n.set(d.runId,u)}return n}function nae(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function rae(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 TP(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 RP(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 DP(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?`${Df(r.positive)} in latest run`:`${Df(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return Df(r.first);case"not-cited":case"not-visible":return t<=1?`${Df(r.negative)} in latest run`:`${Df(r.negative)} across ${t} runs`;default:return e}}function Df(e){return e.charAt(0).toUpperCase()+e.slice(1)}function iae(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 aae(e){const t=r3(e.project),n=eae(t.name,e.timeline,e.latestRunDetail,e.queries),i=[...e.runs].sort((a,l)=>l.createdAt.localeCompare(a.createdAt)).map(a=>xk(a,e.project.displayName||e.project.name));return e.overview?sae(t,e.overview,n,i):oae(t,n,i)}function sae(e,t,n,r){const i=Wie(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 oae(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 lae(e){const t=r3(e.project),n=[...e.runs].sort((g,v)=>v.createdAt.localeCompare(g.createdAt)),r=n.find(g=>g.kind===Pt["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?xk(r,i):cae(e.project.id,i),l=e.overview;if(!l)return{project:t,visibilityScore:0,visibilityDelta:"No data",visibilityTone:"neutral",lastRun:a,insight:"No runs completed yet.",trend:[],competitorPressureLabel:"None"};const u=l.scores.visibility,d=u.progress??0,f=l.queryCounts.citedQueries,p=l.queryCounts.totalQueries,m=l.providers.length;return{project:t,visibilityScore:d,visibilityDelta:p>0?`${f} of ${p} queries`:"No data",visibilityTone:u.tone,providerCoverage:u.providerCoverage,lastRun:a,insight:p>0?`${f} of ${p} queries visible across ${m} provider${m===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:l.scores.competitorPressure.value}}function cae(e,t){return{id:"none",projectId:e,projectName:t,kind:Pt["answer-visibility"],kindLabel:"No runs yet",status:hr.queued,trigger:sh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function uae(e,t){const n=[],r=[],i=[];for(const l of e){r.push(aae(l)),i.push(lae(l));const u=[...l.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of u)n.push(xk(d,l.project.displayName||l.project.name))}n.sort((l,u)=>u.createdAt.localeCompare(l.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?dae(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(l=>({name:l.name,displayName:l.displayName,keyUrl:l.keyUrl,modelHint:l.modelHint,model:l.model,state:l.configured?"ready":"needs-config",detail:l.configured?"Provider is configured.":"API key is missing.",quota:l.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 dae(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===hr.running||a.status===hr.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 qe={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]}},s3=x.createContext(null);s3.Provider;function Gh(){return x.useContext(s3)}function wc(e){const n=Gh()?.dashboard??null,r=ca({queryKey:qe.projects.all,queryFn:GN,enabled:!n}),i=ca({queryKey:qe.runs.all,queryFn:A5,enabled:!n,staleTime:YS,refetchInterval:j=>j.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:YS}),a=ca({queryKey:qe.settings,queryFn:()=>VN().catch(()=>null),enabled:!n}),l=r.data??[],u=i.data??[],d=XK({queries:l.map(j=>{const b=u.filter(k=>k.projectId===j.id),S=b.filter(k=>(k.status==="completed"||k.status==="partial")&&k.kind==="answer-visibility").sort((k,E)=>E.createdAt.localeCompare(k.createdAt));return{queryKey:qe.projects.detail(j.id,S[0]?.id),queryFn:async()=>{const k=S[0]?.id,[E,C,A,P,O,_,T,$,F]=await Promise.all([sV(j.name).catch(()=>[]),O5(j.name).catch(()=>[]),E5(j.name).catch(()=>[]),k?ec(k).catch(()=>null):Promise.resolve(null),S[1]?ec(S[1].id).catch(()=>null):Promise.resolve(null),QN(j.name).catch(()=>null),WN(j.name).catch(()=>null),k?oQ(j.name,k).catch(()=>null):Promise.resolve(null),oV(j.name).catch(()=>null)]);return{project:j,runs:b,queries:E,competitors:C,timeline:A,latestRunDetail:P,previousRunDetail:O,gscCoverage:_,bingCoverage:T,dbInsights:$,overview:F}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:$5}})}),f=d.every(j=>j.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!f)return null;const j=d.map(b=>b.data?{...b.data,runs:u.filter(S=>S.projectId===b.data.project.id)}:null).filter(b=>b!=null);return uae(j,a.data??null)},[n,r.data,i.data,a.data,f,d,l.length,u]),m=!n&&(r.isError||i.isError),g=!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:g,isError:m,refetch:v}}async function fae(){const e=await cQ("/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 Uv(e,t){return ca({queryKey:qe.health,queryFn:fae,enabled:e,refetchInterval:15e3,initialData:t})}function hae(e){return ca({queryKey:qe.runs.detail(e??""),queryFn:()=>ec(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function vd(){const e=Qo(),t=Cv({strict:!1}),n=Xr({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>e({to:n,from:Hi.to,search:f=>({...f,runId:d,evidenceId:void 0})}),openEvidence:d=>e({to:n,from:Hi.to,search:f=>({...f,evidenceId:d,runId:void 0})}),closeDrawer:()=>e({to:n,from:Hi.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}const pae={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function mae(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function gae(){const e=x.useSyncExternalStore(CQ,O2,O2),t=Qo(),{openRun:n}=vd(),r=x.useCallback(a=>{WS(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),WS(a.id))},[t,n]);return e.length===0?null:s.jsx("div",{className:"toast-viewport","aria-label":"Notifications",children:e.map(a=>s.jsxs("section",{role:a.tone==="negative"?"alert":"status","aria-live":a.tone==="negative"?"assertive":"polite","data-state":a.state,className:`toast-card ${pae[a.tone]}`,children:[s.jsxs("div",{className:"toast-copy",children:[s.jsx("p",{className:"toast-title",children:a.title}),a.detail?s.jsx("p",{className:"toast-detail",children:a.detail}):null,a.cta?s.jsx("button",{type:"button",className:"toast-action",onClick:()=>i(a),"aria-label":mae(a),children:a.cta.label}):null]}),s.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:s.jsx(Kh,{className:"size-3.5"})})]},a.id))})}function yae(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bae={};function MP(e,t){return(bae.jsx?xae:vae).test(e)}const wae=/[ \t\n\f\r]/g;function jae(e){return typeof e=="object"?e.type==="text"?IP(e.value):!1:IP(e)}function IP(e){return e.replace(wae,"")===""}let Vh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Vh.prototype.normal={};Vh.prototype.property={};Vh.prototype.space=void 0;function o3(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Vh(n,r,t)}function s1(e){return e.toLowerCase()}class ri{constructor(t,n){this.attribute=n,this.property=t}}ri.prototype.attribute="";ri.prototype.booleanish=!1;ri.prototype.boolean=!1;ri.prototype.commaOrSpaceSeparated=!1;ri.prototype.commaSeparated=!1;ri.prototype.defined=!1;ri.prototype.mustUseProperty=!1;ri.prototype.number=!1;ri.prototype.overloadedBoolean=!1;ri.prototype.property="";ri.prototype.spaceSeparated=!1;ri.prototype.space=void 0;let Sae=0;const lt=jc(),Bn=jc(),o1=jc(),Oe=jc(),Wt=jc(),$u=jc(),di=jc();function jc(){return 2**++Sae}const l1=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:Bn,commaOrSpaceSeparated:di,commaSeparated:$u,number:Oe,overloadedBoolean:o1,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),Dw=Object.keys(l1);class bk extends ri{constructor(t,n,r,i){let a=-1;if(super(t,n),LP(this,"space",i),typeof r=="number")for(;++a<Dw.length;){const l=Dw[a];LP(this,Dw[a],(r&l1[l])===l1[l])}}}bk.prototype.defined=!0;function LP(e,t,n){n&&(e[t]=n)}function xd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new bk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[s1(r)]=r,n[s1(a.attribute)]=r}return new Vh(t,n,e.space)}const l3=xd({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Wt,ariaCurrent:null,ariaDescribedBy:Wt,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:Wt,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:Wt,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wt,ariaLevel:Oe,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:Wt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Bn,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 c3(e,t){return t in e?e[t]:t}function u3(e,t){return c3(e,t.toLowerCase())}const Nae=xd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$u,acceptCharset:Wt,accessKey:Wt,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:Wt,autoFocus:lt,autoPlay:lt,blocking:Wt,capture:null,charSet:null,checked:lt,cite:null,className:Wt,cols:Oe,colSpan:null,content:null,contentEditable:Bn,controls:lt,controlsList:Wt,coords:Oe|$u,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:o1,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:Wt,height:Oe,hidden:o1,high:Oe,href:null,hrefLang:null,htmlFor:Wt,httpEquiv:Wt,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:Wt,itemRef:Wt,itemScope:lt,itemType:Wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,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:lt,optimum:Oe,pattern:null,ping:Wt,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:Wt,required:lt,reversed:lt,rows:Oe,rowSpan:Oe,sandbox:Wt,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Bn,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:lt,useMap:null,value:Bn,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:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Bn,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:lt,disableRemotePlayback:lt,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:u3}),kae=xd({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:di,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:lt,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:$u,g2:$u,glyphName:$u,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:di,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:di,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:di,rev:di,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:di,requiredFeatures:di,requiredFonts:di,requiredFormats:di,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:di,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:di,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:di,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:c3}),d3=xd({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()}}),f3=xd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:u3}),h3=xd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Cae={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"},Aae=/[A-Z]/g,$P=/-[a-z]/g,Oae=/^data[-\w.:]+$/i;function Eae(e,t){const n=s1(t);let r=t,i=ri;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Oae.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace($P,zae);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!$P.test(a)){let l=a.replace(Aae,_ae);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=bk}return new i(r,t)}function _ae(e){return"-"+e.toLowerCase()}function zae(e){return e.charAt(1).toUpperCase()}const Pae=o3([l3,Nae,d3,f3,h3],"html"),wk=o3([l3,kae,d3,f3,h3],"svg");function Tae(e){return e.join(" ").trim()}var fu={},Mw,BP;function Rae(){if(BP)return Mw;BP=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
98
|
+
`,f="/",p="*",m="",g="comment",v="declaration";function j(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var E=1,C=1;function A(X){var Z=X.match(t);Z&&(E+=Z.length);var H=X.lastIndexOf(d);C=~H?X.length-H:C+X.length}function P(){var X={line:E,column:C};return function(Z){return Z.position=new O(X),$(),Z}}function O(X){this.start=X,this.end={line:E,column:C},this.source=k.source}O.prototype.content=S;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=S,!k.silent)throw Z}function T(X){var Z=X.exec(S);if(Z){var H=Z[0];return A(H),S=S.slice(H.length),Z}}function $(){T(n)}function F(X){var Z;for(X=X||[];Z=U();)Z!==!1&&X.push(Z);return X}function U(){var X=P();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var Z=2;m!=S.charAt(Z)&&(p!=S.charAt(Z)||f!=S.charAt(Z+1));)++Z;if(Z+=2,m===S.charAt(Z-1))return _("End of comment missing");var H=S.slice(2,Z-2);return C+=2,A(H),S=S.slice(Z),C+=2,X({type:g,comment:H})}}function B(){var X=P(),Z=T(r);if(Z){if(U(),!T(i))return _("property missing ':'");var H=T(a),J=X({type:v,property:b(Z[0].replace(e,m)),value:H?b(H[0].replace(e,m)):m});return T(l),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(S){return S?S.replace(u,m):m}return Mw=j,Mw}var UP;function Dae(){if(UP)return fu;UP=1;var e=fu&&fu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fu,"__esModule",{value:!0}),fu.default=n;const t=e(Rae());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),u=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;u?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return fu}var Mf={},qP;function Mae(){if(qP)return Mf;qP=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.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)},l=function(f,p){return p.toUpperCase()},u=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,u):f=f.replace(r,u),f.replace(t,l))};return Mf.camelCase=d,Mf}var If,FP;function Iae(){if(FP)return If;FP=1;var e=If&&If.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Dae()),n=Mae();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(u,d){u&&d&&(l[(0,n.camelCase)(u,a)]=d)}),l}return r.default=r,If=r,If}var Lae=Iae();const $ae=pa(Lae),p3=m3("end"),jk=m3("start");function m3(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 Bae(e){const t=jk(e),n=p3(e);if(t&&n)return{start:t,end:n}}function oh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?HP(e.position):"start"in e||"end"in e?HP(e):"line"in e||"column"in e?c1(e):""}function c1(e){return KP(e&&e.line)+":"+KP(e&&e.column)}function HP(e){return c1(e&&e.start)+"-"+c1(e&&e.end)}function KP(e){return e&&typeof e=="number"?e:1}class Ar extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},l=!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&&(l=!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 u=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=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=oh(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=l&&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}}Ar.prototype.file="";Ar.prototype.name="";Ar.prototype.reason="";Ar.prototype.message="";Ar.prototype.stack="";Ar.prototype.column=void 0;Ar.prototype.line=void 0;Ar.prototype.ancestors=void 0;Ar.prototype.cause=void 0;Ar.prototype.fatal=void 0;Ar.prototype.place=void 0;Ar.prototype.ruleId=void 0;Ar.prototype.source=void 0;const Sk={}.hasOwnProperty,Uae=new Map,qae=/[A-Z]/g,Fae=new Set(["table","tbody","thead","tfoot","tr"]),Hae=new Set(["td","th"]),g3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Kae(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=Jae(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=Xae(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"?wk:Pae,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=y3(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function y3(e,t,n){if(t.type==="element")return Gae(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vae(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Wae(e,t,n);if(t.type==="mdxjsEsm")return Qae(e,t);if(t.type==="root")return Yae(e,t,n);if(t.type==="text")return Zae(e,t)}function Gae(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=wk,e.schema=i),e.ancestors.push(t);const a=x3(e,t.tagName,!1),l=ese(e,t);let u=kk(e,t);return Fae.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!jae(d):!0})),v3(e,l,a,t),Nk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Vae(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)}Nh(e,t.position)}function Qae(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Nh(e,t.position)}function Wae(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=wk,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:x3(e,t.name,!0),l=tse(e,t),u=kk(e,t);return v3(e,l,a,t),Nk(l,u),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function Yae(e,t,n){const r={};return Nk(r,kk(e,t)),e.create(t,e.Fragment,r,n)}function Zae(e,t){return t.value}function v3(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Nk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Xae(e,t,n){return r;function r(i,a,l,u){const f=Array.isArray(l.children)?n:t;return u?f(a,l,u):f(a,l)}}function Jae(e,t){return n;function n(r,i,a,l){const u=Array.isArray(a.children),d=jk(r);return t(i,a,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function ese(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Sk.call(t.properties,i)){const a=nse(e,i,t.properties[i]);if(a){const[l,u]=a;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&Hae.has(t.tagName)?r=u:n[l]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tse(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 l=a.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else Nh(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 u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else Nh(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function kk(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Uae;for(;++r<t.children.length;){const a=t.children[r];let l;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;l=d+"-"+f,i.set(d,f+1)}}const u=y3(e,a,l);u!==void 0&&n.push(u)}return n}function nse(e,t,n){const r=Eae(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?yae(n):Tae(n)),r.property==="style"){let i=typeof n=="object"?n:rse(e,String(n));return e.stylePropertyNameCase==="css"&&(i=ise(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Cae[r.property]||r.property:r.attribute,n]}}function rse(e,t){try{return $ae(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Ar("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=g3+"#cannot-parse-style-attribute",i}}function x3(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,l;for(;++a<i.length;){const u=MP(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=l}else r=MP(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Sk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Nh(e)}function Nh(e,t){const n=new Ar("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=g3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function ise(e){const t={};let n;for(n in e)Sk.call(e,n)&&(t[ase(n)]=e[n]);return t}function ase(e){let t=e.replace(qae,sse);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function sse(e){return"-"+e.toLowerCase()}const Iw={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"]},ose={};function lse(e,t){const n=ose,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return b3(e,r,i)}function b3(e,t,n){if(cse(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 GP(e.children,t,n)}return Array.isArray(e)?GP(e,t,n):""}function GP(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=b3(e[i],t,n);return r.join("")}function cse(e){return!!(e&&typeof e=="object")}const VP=document.createElement("i");function Ck(e){const t="&"+e+";";VP.innerHTML=t;const n=VP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ua(e,t,n,r){const i=e.length;let a=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);a<r.length;)l=r.slice(a,a+1e4),l.unshift(t,0),e.splice(...l),a+=1e4,t+=1e4}function $i(e,t){return e.length>0?(Ua(e,e.length,0,t),e):t}const QP={}.hasOwnProperty;function use(e){const t={};let n=-1;for(;++n<e.length;)dse(t,e[n]);return t}function dse(e,t){let n;for(n in t){const i=(QP.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){QP.call(i,l)||(i[l]=[]);const u=a[l];fse(i[l],Array.isArray(u)?u:u?[u]:[])}}}function fse(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ua(e,0,0,r)}function w3(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 Bu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Da=Xo(/[A-Za-z]/),hi=Xo(/[\dA-Za-z]/),hse=Xo(/[#-'*+\--9=?A-Z^-~]/);function u1(e){return e!==null&&(e<32||e===127)}const d1=Xo(/\d/),pse=Xo(/[\dA-Fa-f]/),mse=Xo(/[!-/:-@[-`{-~]/);function et(e){return e!==null&&e<-2}function Jr(e){return e!==null&&(e<0||e===32)}function Tt(e){return e===-2||e===-1||e===32}const gse=Xo(new RegExp("\\p{P}|\\p{S}","u")),yse=Xo(/\s/);function Xo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function bd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&hi(e.charCodeAt(n+1))&&hi(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(l=String.fromCharCode(a,u),i=1):l="�"}else l=String.fromCharCode(a);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),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 l;function l(d){return Tt(d)?(e.enter(n),u(d)):t(d)}function u(d){return Tt(d)&&a++<i?(e.consume(d),u):(e.exit(n),t(d))}}const vse={tokenize:xse};function xse(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Xt(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),a(u)}function a(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return et(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),l)}}const bse={tokenize:wse},WP={tokenize:jse};function wse(e){const t=this,n=[];let r=0,i,a,l;return u;function u(C){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,d,f)(C)}return f(C)}function d(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const A=t.events.length;let P=A,O;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){O=t.events[P][1].end;break}k(r);let _=A;for(;_<t.events.length;)t.events[_][1].end={...O},_++;return Ua(t.events,P+1,0,t.events.slice(A)),t.events.length=_,f(C)}return u(C)}function f(C){if(r===n.length){if(!i)return g(C);if(i.currentConstruct&&i.currentConstruct.concrete)return j(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(WP,p,m)(C)}function p(C){return i&&E(),k(r),g(C)}function m(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,j(C)}function g(C){return t.containerState={},e.attempt(WP,v,j)(C)}function v(C){return r++,n.push([t.currentConstruct,t.containerState]),g(C)}function j(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){S(e.exit("chunkFlow"),!0),k(0),e.consume(C);return}return et(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(C),b)}function S(C,A){const P=t.sliceStream(C);if(A&&P.push(null),C.previous=a,a&&(a.next=C),a=C,i.defineSkip(C.start),i.write(P),t.parser.lazy[C.start.line]){let O=i.events.length;for(;O--;)if(i.events[O][1].start.offset<l&&(!i.events[O][1].end||i.events[O][1].end.offset>l))return;const _=t.events.length;let T=_,$,F;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if($){F=t.events[T][1].end;break}$=!0}for(k(r),O=_;O<t.events.length;)t.events[O][1].end={...F},O++;Ua(t.events,T+1,0,t.events.slice(_)),t.events.length=O}}function k(C){let A=n.length;for(;A-- >C;){const P=n[A];t.containerState=P[1],P[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 jse(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 YP(e){if(e===null||Jr(e)||yse(e))return 1;if(gse(e))return 2}function Ak(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 f1={name:"attention",resolveAll:Sse,tokenize:Nse};function Sse(e,t){let n=-1,r,i,a,l,u,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},g={...e[n][1].start};ZP(m,-d),ZP(g,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=$i(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=$i(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=$i(f,Ak(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=$i(f,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=$i(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ua(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 Nse(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=YP(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===a)return e.consume(d),u;const f=e.exit("attentionSequence"),p=YP(d),m=!p||p===2&&i||n.includes(d),g=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!g)),f._close=!!(a===42?g:g&&(p||!m)),t(d)}}function ZP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const kse={name:"autolink",tokenize:Cse};function Cse(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 Da(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||hi(v)?(r=1,u(v)):f(v)}function u(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||hi(v))&&r++<32?(e.consume(v),u):(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||u1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):hse(v)?(e.consume(v),f):n(v)}function p(v){return hi(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):g(v)}function g(v){if((v===45||hi(v))&&r++<63){const j=v===45?g:m;return e.consume(v),j}return n(v)}}const qv={partial:!0,tokenize:Ase};function Ase(e,t,n){return r;function r(a){return Tt(a)?Xt(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||et(a)?t(a):n(a)}}const j3={continuation:{tokenize:Ese},exit:_se,name:"blockQuote",tokenize:Ose};function Ose(e,t,n){const r=this;return i;function i(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Tt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Ese(e,t,n){const r=this;return i;function i(l){return Tt(l)?Xt(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(j3,t,n)(l)}}function _se(e){e.exit("blockQuote")}const S3={name:"characterEscape",tokenize:zse};function zse(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 mse(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const N3={name:"characterReference",tokenize:Pse};function Pse(e,t,n){const r=this;let i=0,a,l;return u;function u(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,l=hi,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=pse,p):(e.enter("characterReferenceValue"),a=7,l=d1,p(m))}function p(m){if(m===59&&i){const g=e.exit("characterReferenceValue");return l===hi&&!Ck(r.sliceSerialize(g))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&i++<a?(e.consume(m),p):n(m)}}const XP={partial:!0,tokenize:Rse},JP={concrete:!0,name:"codeFenced",tokenize:Tse};function Tse(e,t,n){const r=this,i={partial:!0,tokenize:P};let a=0,l=0,u;return d;function d(O){return f(O)}function f(O){const _=r.events[r.events.length-1];return a=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,u=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===u?(l++,e.consume(O),p):l<3?n(O):(e.exit("codeFencedFenceSequence"),Tt(O)?Xt(e,m,"whitespace")(O):m(O))}function m(O){return O===null||et(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(XP,b,A)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(O))}function g(O){return O===null||et(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):Tt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Xt(e,v,"whitespace")(O)):O===96&&O===u?n(O):(e.consume(O),g)}function v(O){return O===null||et(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),j(O))}function j(O){return O===null||et(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===u?n(O):(e.consume(O),j)}function b(O){return e.attempt(i,A,S)(O)}function S(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),k}function k(O){return a>0&&Tt(O)?Xt(e,E,"linePrefix",a+1)(O):E(O)}function E(O){return O===null||et(O)?e.check(XP,b,A)(O):(e.enter("codeFlowValue"),C(O))}function C(O){return O===null||et(O)?(e.exit("codeFlowValue"),E(O)):(e.consume(O),C)}function A(O){return e.exit("codeFenced"),t(O)}function P(O,_,T){let $=0;return F;function F(Z){return O.enter("lineEnding"),O.consume(Z),O.exit("lineEnding"),U}function U(Z){return O.enter("codeFencedFence"),Tt(Z)?Xt(O,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):B(Z)}function B(Z){return Z===u?(O.enter("codeFencedFenceSequence"),V(Z)):T(Z)}function V(Z){return Z===u?($++,O.consume(Z),V):$>=l?(O.exit("codeFencedFenceSequence"),Tt(Z)?Xt(O,X,"whitespace")(Z):X(Z)):T(Z)}function X(Z){return Z===null||et(Z)?(O.exit("codeFencedFence"),_(Z)):T(Z)}}}function Rse(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Lw={name:"codeIndented",tokenize:Mse},Dse={partial:!0,tokenize:Ise};function Mse(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?l(f):n(f)}function l(f){return f===null?d(f):et(f)?e.attempt(Dse,l,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||et(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function Ise(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):Xt(e,a,"linePrefix",5)(l)}function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):et(l)?i(l):n(l)}}const Lse={name:"codeText",previous:Bse,resolve:$se,tokenize:Use};function $se(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 Bse(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Use(e,t,n){let r=0,i,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),r++,u):(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)):et(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||et(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 qse{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&&Lf(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),Lf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Lf(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);Lf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Lf(this.left,n.reverse())}}}function Lf(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 k3(e){const t={};let n=-1,r,i,a,l,u,d,f;const p=new qse(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,Fse(p,n)),n=t[n],f=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(l=p.get(a),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(p.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=a);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...p.get(i)[1].start},u=p.slice(i,n),u.unshift(r),p.splice(i,n-i+1,u))}}return Ua(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function Fse(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],f={};let p,m,g=-1,v=n,j=0,b=0;const S=[b];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&l.defineSkip(v.start),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(p),v._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=v,v=v.next}for(v=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(b=g+1,S.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):S.pop(),g=S.length;g--;){const k=u.slice(S[g],S[g+1]),E=a.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),g=-1;++g<d.length;)f[j+d[g][0]]=j+d[g][1],j+=d[g][1]-d[g][0]-1;return f}const Hse={resolve:Gse,tokenize:Vse},Kse={partial:!0,tokenize:Qse};function Gse(e){return k3(e),e}function Vse(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):et(u)?e.check(Kse,l,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Qse(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Xt(e,a,"linePrefix")}function a(l){if(l===null||et(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function C3(e,t,n,r,i,a,l,u,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),g):k===null||k===32||k===41||u1(k)?n(k):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function g(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(u),g(k)):k===null||k===60||et(k)?n(k):(e.consume(k),k===92?j:v)}function j(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function b(k){return!p&&(k===null||k===41||Jr(k))?(e.exit("chunkString"),e.exit(u),e.exit(l),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||u1(k)?n(k):(e.consume(k),k===92?S:b)}function S(k){return k===40||k===41||k===92?(e.consume(k),b):b(k)}}function A3(e,t,n,r,i,a){const l=this;let u=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 u>999||v===null||v===91||v===93&&!d||v===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):et(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||et(v)||u++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Tt(v)),v===92?g:m)}function g(v){return v===91||v===92||v===93?(e.consume(v),u++,m):m(v)}}function O3(e,t,n,r,i,a){let l;return u;function u(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),l=g===40?41:g,d):n(g)}function d(g){return g===l?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),f(g))}function f(g){return g===l?(e.exit(a),d(l)):g===null?n(g):et(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Xt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===l||g===null||et(g)?(e.exit("chunkString"),f(g)):(e.consume(g),g===92?m:p)}function m(g){return g===l||g===92?(e.consume(g),p):p(g)}}function lh(e,t){let n;return r;function r(i){return et(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Tt(i)?Xt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Wse={name:"definition",tokenize:Zse},Yse={partial:!0,tokenize:Xse};function Zse(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return A3.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function u(v){return i=Bu(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 Jr(v)?lh(e,f)(v):f(v)}function f(v){return C3(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(Yse,m,m)(v)}function m(v){return Tt(v)?Xt(e,g,"whitespace")(v):g(v)}function g(v){return v===null||et(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function Xse(e,t,n){return r;function r(u){return Jr(u)?lh(e,i)(u):n(u)}function i(u){return O3(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Tt(u)?Xt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||et(u)?t(u):n(u)}}const Jse={name:"hardBreakEscape",tokenize:eoe};function eoe(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return et(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const toe={name:"headingAtx",resolve:noe,tokenize:roe};function noe(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"},Ua(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function roe(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),a(p)}function a(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Jr(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||et(p)?(e.exit("atxHeading"),t(p)):Tt(p)?Xt(e,u,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),u(p))}function f(p){return p===null||p===35||Jr(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),f)}}const ioe=["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"],eT=["pre","script","style","textarea"],aoe={concrete:!0,name:"htmlFlow",resolveTo:loe,tokenize:coe},soe={partial:!0,tokenize:doe},ooe={partial:!0,tokenize:uoe};function loe(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 coe(e,t,n){const r=this;let i,a,l,u,d;return f;function f(D){return p(D)}function p(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),m}function m(D){return D===33?(e.consume(D),g):D===47?(e.consume(D),a=!0,b):D===63?(e.consume(D),i=3,r.interrupt?t:I):Da(D)?(e.consume(D),l=String.fromCharCode(D),S):n(D)}function g(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,u=0,j):Da(D)?(e.consume(D),i=4,r.interrupt?t:I):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:I):n(D)}function j(D){const G="CDATA[";return D===G.charCodeAt(u++)?(e.consume(D),u===G.length?r.interrupt?t:B:j):n(D)}function b(D){return Da(D)?(e.consume(D),l=String.fromCharCode(D),S):n(D)}function S(D){if(D===null||D===47||D===62||Jr(D)){const G=D===47,se=l.toLowerCase();return!G&&!a&&eT.includes(se)?(i=1,r.interrupt?t(D):B(D)):ioe.includes(l.toLowerCase())?(i=6,G?(e.consume(D),k):r.interrupt?t(D):B(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?E(D):C(D))}return D===45||hi(D)?(e.consume(D),l+=String.fromCharCode(D),S):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:B):n(D)}function E(D){return Tt(D)?(e.consume(D),E):F(D)}function C(D){return D===47?(e.consume(D),F):D===58||D===95||Da(D)?(e.consume(D),A):Tt(D)?(e.consume(D),C):F(D)}function A(D){return D===45||D===46||D===58||D===95||hi(D)?(e.consume(D),A):P(D)}function P(D){return D===61?(e.consume(D),O):Tt(D)?(e.consume(D),P):C(D)}function O(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),d=D,_):Tt(D)?(e.consume(D),O):T(D)}function _(D){return D===d?(e.consume(D),d=null,$):D===null||et(D)?n(D):(e.consume(D),_)}function T(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Jr(D)?P(D):(e.consume(D),T)}function $(D){return D===47||D===62||Tt(D)?C(D):n(D)}function F(D){return D===62?(e.consume(D),U):n(D)}function U(D){return D===null||et(D)?B(D):Tt(D)?(e.consume(D),U):n(D)}function B(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),J):D===62&&i===4?(e.consume(D),M):D===63&&i===3?(e.consume(D),I):D===93&&i===5?(e.consume(D),ye):et(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(soe,q,V)(D)):D===null||et(D)?(e.exit("htmlFlowData"),V(D)):(e.consume(D),B)}function V(D){return e.check(ooe,X,q)(D)}function X(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return D===null||et(D)?V(D):(e.enter("htmlFlowData"),B(D))}function H(D){return D===45?(e.consume(D),I):B(D)}function J(D){return D===47?(e.consume(D),l="",oe):B(D)}function oe(D){if(D===62){const G=l.toLowerCase();return eT.includes(G)?(e.consume(D),M):B(D)}return Da(D)&&l.length<8?(e.consume(D),l+=String.fromCharCode(D),oe):B(D)}function ye(D){return D===93?(e.consume(D),I):B(D)}function I(D){return D===62?(e.consume(D),M):D===45&&i===2?(e.consume(D),I):B(D)}function M(D){return D===null||et(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),M)}function q(D){return e.exit("htmlFlow"),t(D)}}function uoe(e,t,n){const r=this;return i;function i(l){return et(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):n(l)}function a(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function doe(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(qv,t,n)}}const foe={name:"htmlText",tokenize:hoe};function hoe(e,t,n){const r=this;let i,a,l;return u;function u(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),P):I===63?(e.consume(I),C):Da(I)?(e.consume(I),T):n(I)}function f(I){return I===45?(e.consume(I),p):I===91?(e.consume(I),a=0,j):Da(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),g):et(I)?(l=m,J(I)):(e.consume(I),m)}function g(I){return I===45?(e.consume(I),v):m(I)}function v(I){return I===62?H(I):I===45?g(I):m(I)}function j(I){const M="CDATA[";return I===M.charCodeAt(a++)?(e.consume(I),a===M.length?b:j):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),S):et(I)?(l=b,J(I)):(e.consume(I),b)}function S(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):et(I)?(l=E,J(I)):(e.consume(I),E)}function C(I){return I===null?n(I):I===63?(e.consume(I),A):et(I)?(l=C,J(I)):(e.consume(I),C)}function A(I){return I===62?H(I):C(I)}function P(I){return Da(I)?(e.consume(I),O):n(I)}function O(I){return I===45||hi(I)?(e.consume(I),O):_(I)}function _(I){return et(I)?(l=_,J(I)):Tt(I)?(e.consume(I),_):H(I)}function T(I){return I===45||hi(I)?(e.consume(I),T):I===47||I===62||Jr(I)?$(I):n(I)}function $(I){return I===47?(e.consume(I),H):I===58||I===95||Da(I)?(e.consume(I),F):et(I)?(l=$,J(I)):Tt(I)?(e.consume(I),$):H(I)}function F(I){return I===45||I===46||I===58||I===95||hi(I)?(e.consume(I),F):U(I)}function U(I){return I===61?(e.consume(I),B):et(I)?(l=U,J(I)):Tt(I)?(e.consume(I),U):$(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):et(I)?(l=B,J(I)):Tt(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):et(I)?(l=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||Jr(I)?$(I):(e.consume(I),X)}function Z(I){return I===47||I===62||Jr(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"),oe}function oe(I){return Tt(I)?Xt(e,ye,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):ye(I)}function ye(I){return e.enter("htmlTextData"),l(I)}}const Ok={name:"labelEnd",resolveAll:yoe,resolveTo:voe,tokenize:xoe},poe={tokenize:boe},moe={tokenize:woe},goe={tokenize:joe};function yoe(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&&Ua(e,0,e.length,n),e}function voe(e,t){let n=e.length,r=0,i,a,l,u;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(l){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"&&(l=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[l][1].end}},p={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=$i(u,e.slice(a+1,a+r+3)),u=$i(u,[["enter",p,t]]),u=$i(u,Ak(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),u=$i(u,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),u=$i(u,e.slice(l+1)),u=$i(u,[["exit",d,t]]),Ua(e,a,e.length,u),e}function xoe(e,t,n){const r=this;let i=r.events.length,a,l;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 u;function u(g){return a?a._inactive?m(g):(l=r.parser.defined.includes(Bu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),d):n(g)}function d(g){return g===40?e.attempt(poe,p,l?p:m)(g):g===91?e.attempt(moe,p,l?f:m)(g):l?p(g):m(g)}function f(g){return e.attempt(goe,p,m)(g)}function p(g){return t(g)}function m(g){return a._balanced=!0,n(g)}}function boe(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 Jr(m)?lh(e,a)(m):a(m)}function a(m){return m===41?p(m):C3(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Jr(m)?lh(e,d)(m):p(m)}function u(m){return n(m)}function d(m){return m===34||m===39||m===40?O3(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return Jr(m)?lh(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 woe(e,t,n){const r=this;return i;function i(u){return A3.call(r,e,a,l,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(Bu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function joe(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 Soe={name:"labelStartImage",resolveAll:Ok.resolveAll,tokenize:Noe};function Noe(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const koe={name:"labelStartLink",resolveAll:Ok.resolveAll,tokenize:Coe};function Coe(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),a}function a(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const $w={name:"lineEnding",tokenize:Aoe};function Aoe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Xt(e,t,"linePrefix")}}const Ig={name:"thematicBreak",tokenize:Ooe};function Ooe(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,u(f)}function u(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||et(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Tt(f)?Xt(e,u,"whitespace")(f):u(f))}}const Vr={continuation:{tokenize:Poe},exit:Roe,name:"list",tokenize:zoe},Eoe={partial:!0,tokenize:Doe},_oe={partial:!0,tokenize:Toe};function zoe(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,l=0;return u;function u(v){const j=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(j==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:d1(v)){if(r.containerState.type||(r.containerState.type=j,e.enter(j,{_container:!0})),j==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ig,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 d1(v)&&++l<10?(e.consume(v),d):(!r.interrupt||l<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(qv,r.interrupt?n:p,e.attempt(Eoe,g,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,g(v)}function m(v){return Tt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),g):n(v)}function g(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Poe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(qv,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xt(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Tt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(_oe,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xt(e,e.attempt(Vr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function Toe(e,t,n){const r=this;return Xt(e,i,"listItemIndent",r.containerState.size+1);function i(a){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(a):n(a)}}function Roe(e){e.exit(this.containerState.type)}function Doe(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 l=r.events[r.events.length-1];return!Tt(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const tT={name:"setextUnderline",resolveTo:Moe,tokenize:Ioe};function Moe(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 l={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",l,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ioe(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,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===i?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),Tt(f)?Xt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||et(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Loe={tokenize:$oe};function $oe(e){const t=this,n=e.attempt(qv,r,e.attempt(this.parser.constructs.flowInitial,i,Xt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Hse,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 Boe={resolveAll:_3()},Uoe=E3("string"),qoe=E3("text");function E3(e){return{resolveAll:_3(e==="text"?Foe:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,u);return l;function l(p){return f(p)?a(p):u(p)}function u(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 g=-1;if(m)for(;++g<m.length;){const v=m[g];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function _3(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 Foe(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,l=-1,u=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(f===-2)d=!0,u++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const f={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},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 Hoe={42:Vr,43:Vr,45:Vr,48:Vr,49:Vr,50:Vr,51:Vr,52:Vr,53:Vr,54:Vr,55:Vr,56:Vr,57:Vr,62:j3},Koe={91:Wse},Goe={[-2]:Lw,[-1]:Lw,32:Lw},Voe={35:toe,42:Ig,45:[tT,Ig],60:aoe,61:tT,95:Ig,96:JP,126:JP},Qoe={38:N3,92:S3},Woe={[-5]:$w,[-4]:$w,[-3]:$w,33:Soe,38:N3,42:f1,60:[kse,foe],91:koe,92:[Jse,S3],93:Ok,95:f1,96:Lse},Yoe={null:[f1,Boe]},Zoe={null:[42,95]},Xoe={null:[]},Joe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Zoe,contentInitial:Koe,disable:Xoe,document:Hoe,flow:Voe,flowInitial:Goe,insideSpan:Yoe,string:Qoe,text:Woe},Symbol.toStringTag,{value:"Module"}));function ele(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 l=[],u=[];const d={attempt:_(P),check:_(O),consume:E,enter:C,exit:A,interrupt:_(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:j,parser:e,previous:null,sliceSerialize:g,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(U){return l=$i(l,U),S(),l[l.length-1]!==null?[]:(T(t,0),f.events=Ak(a,f.events,f),f.events)}function g(U,B){return nle(v(U),B)}function v(U){return tle(l,U)}function j(){const{_bufferIndex:U,_index:B,line:V,column:X,offset:Z}=r;return{_bufferIndex:U,_index:B,line:V,column:X,offset:Z}}function b(U){i[U.line]=U.column,F()}function S(){let U;for(;r._index<l.length;){const B=l[r._index];if(typeof B=="string")for(U=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===U&&r._bufferIndex<B.length;)k(B.charCodeAt(r._bufferIndex));else k(B)}}function k(U){p=p(U)}function E(U){et(U)?(r.line++,r.column=1,r.offset+=U===-3?2:1,F()):U!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=U}function C(U,B){const V=B||{};return V.type=U,V.start=j(),f.events.push(["enter",V,f]),u.push(V),V}function A(U){const B=u.pop();return B.end=j(),f.events.push(["exit",B,f]),B}function P(U,B){T(U,B.from)}function O(U,B){B.restore()}function _(U,B){return V;function V(X,Z,H){let J,oe,ye,I;return Array.isArray(X)?q(X):"tokenize"in X?q([X]):M(X);function M(ne){return Ce;function Ce(Se){const ee=Se!==null&&ne[Se],pe=Se!==null&&ne.null,Ee=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return q(Ee)(Se)}}function q(ne){return J=ne,oe=0,ne.length===0?H:D(ne[oe])}function D(ne){return Ce;function Ce(Se){return I=$(),ye=ne,ne.partial||(f.currentConstruct=ne),ne.name&&f.parser.constructs.disable.null.includes(ne.name)?se():ne.tokenize.call(B?Object.assign(Object.create(f),B):f,d,G,se)(Se)}}function G(ne){return U(ye,I),Z}function se(ne){return I.restore(),++oe<J.length?D(J[oe]):H}}}function T(U,B){U.resolveAll&&!a.includes(U)&&a.push(U),U.resolve&&Ua(f.events,B,f.events.length-B,U.resolve(f.events.slice(B),f)),U.resolveTo&&(f.events=U.resolveTo(f.events,f))}function $(){const U=j(),B=f.previous,V=f.currentConstruct,X=f.events.length,Z=Array.from(u);return{from:X,restore:H};function H(){r=U,f.previous=B,f.currentConstruct=V,f.events.length=X,u=Z,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function tle(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,a)];else{if(l=e.slice(n,i),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function nle(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let l;if(typeof a=="string")l=a;else switch(a){case-5:{l="\r";break}case-4:{l=`
|
|
99
|
+
`;break}case-3:{l=`\r
|
|
100
|
+
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(a)}i=a===-2,r.push(l)}return r.join("")}function rle(e){const r={constructs:use([Joe,...(e||{}).extensions||[]]),content:i(vse),defined:[],document:i(bse),flow:i(Loe),lazy:{},string:i(Uoe),text:i(qoe)};return r;function i(a){return l;function l(u){return ele(r,a,u)}}}function ile(e){for(;!k3(e););return e}const nT=/[\0\t\n\r]/g;function ale(){let e=1,t="",n=!0,r;return i;function i(a,l,u){const d=[];let f,p,m,g,v;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(l||void 0).decode(a)),m=0,t="",n&&(a.charCodeAt(0)===65279&&m++,n=void 0);m<a.length;){if(nT.lastIndex=m,f=nT.exec(a),g=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(g),!f){t=a.slice(m);break}if(v===10&&m===g&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<g&&(d.push(a.slice(m,g)),e+=g-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=g+1}return u&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const sle=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ole(e){return e.replace(sle,lle)}function lle(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return w3(n.slice(a?2:1),a?16:10)}return Ck(n)||e}const z3={}.hasOwnProperty;function cle(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ule(n)(ile(rle(n).document().write(ale()(e,t,!0))))}function ule(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(cn),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(at),blockQuote:a(pe),characterEscape:$,characterReference:$,codeFenced:a(Ee),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(Ee,l),codeText:a(Y,l),codeTextData:$,data:$,codeFlowValue:$,definition:a(He),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Te),hardBreakEscape:a(Ve),hardBreakTrailing:a(Ve),htmlFlow:a(Ht,l),htmlFlowData:$,htmlText:a(Ht,l),htmlTextData:$,image:a(Lt),label:l,link:a(cn),listItem:a(je),listItemValue:g,listOrdered:a(en,m),listUnordered:a(en),paragraph:a(Ze),reference:D,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(at),strong:a(Rt),thematicBreak:a(Je)},exit:{atxHeading:d(),atxHeadingSequence:P,autolink:d(),autolinkEmail:ee,autolinkProtocol:Se,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ne,characterReference:Ce,codeFenced:d(S),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:j,codeFlowValue:F,codeIndented:d(k),codeText:d(Z),codeTextData:F,data:F,definition:d(),definitionDestinationString:A,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:ye,labelText:oe,lineEnding:U,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:G,resourceDestinationString:I,resourceTitleString:M,resource:q,setextHeading:d(T),setextHeadingLineSequence:_,setextHeadingText:O,strong:d(),thematicBreak:d()}};P3(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Ne={type:"root",children:[]};const Me={stack:[Ne],tokenStack:[],config:t,enter:u,exit:f,buffer:l,resume:p,data:n},Ge=[];let pt=-1;for(;++pt<ce.length;)if(ce[pt][1].type==="listOrdered"||ce[pt][1].type==="listUnordered")if(ce[pt][0]==="enter")Ge.push(pt);else{const mn=Ge.pop();pt=i(ce,mn,pt)}for(pt=-1;++pt<ce.length;){const mn=t[ce[pt][0]];z3.call(mn,ce[pt][1].type)&&mn[ce[pt][1].type].call(Object.assign({sliceSerialize:ce[pt][2].sliceSerialize},Me),ce[pt][1])}if(Me.tokenStack.length>0){const mn=Me.tokenStack[Me.tokenStack.length-1];(mn[1]||rT).call(Me,void 0,mn[0])}for(Ne.position={start:jo(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:jo(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},pt=-1;++pt<t.transforms.length;)Ne=t.transforms[pt](Ne)||Ne;return Ne}function i(ce,Ne,Me){let Ge=Ne-1,pt=-1,mn=!1,On,gn,We,Kt;for(;++Ge<=Me;){const de=ce[Ge];switch(de[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{de[0]==="enter"?pt++:pt--,Kt=void 0;break}case"lineEndingBlank":{de[0]==="enter"&&(On&&!Kt&&!pt&&!We&&(We=Ge),Kt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kt=void 0}if(!pt&&de[0]==="enter"&&de[1].type==="listItemPrefix"||pt===-1&&de[0]==="exit"&&(de[1].type==="listUnordered"||de[1].type==="listOrdered")){if(On){let ze=Ge;for(gn=void 0;ze--;){const fe=ce[ze];if(fe[1].type==="lineEnding"||fe[1].type==="lineEndingBlank"){if(fe[0]==="exit")continue;gn&&(ce[gn][1].type="lineEndingBlank",mn=!0),fe[1].type="lineEnding",gn=ze}else if(!(fe[1].type==="linePrefix"||fe[1].type==="blockQuotePrefix"||fe[1].type==="blockQuotePrefixWhitespace"||fe[1].type==="blockQuoteMarker"||fe[1].type==="listItemIndent"))break}We&&(!gn||We<gn)&&(On._spread=!0),On.end=Object.assign({},gn?ce[gn][1].start:de[1].end),ce.splice(gn||Ge,0,["exit",On,de[2]]),Ge++,Me++}if(de[1].type==="listItemPrefix"){const ze={type:"listItem",_spread:!1,start:Object.assign({},de[1].start),end:void 0};On=ze,ce.splice(Ge,0,["enter",ze,de[2]]),Ge++,Me++,We=void 0,Kt=!0}}}return ce[Ne][1]._spread=mn,Me}function a(ce,Ne){return Me;function Me(Ge){u.call(this,ce(Ge),Ge),Ne&&Ne.call(this,Ge)}}function l(){this.stack.push({type:"fragment",children:[]})}function u(ce,Ne,Me){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Ne,Me||void 0]),ce.position={start:jo(Ne.start),end:void 0}}function d(ce){return Ne;function Ne(Me){ce&&ce.call(this,Me),f.call(this,Me)}}function f(ce,Ne){const Me=this.stack.pop(),Ge=this.tokenStack.pop();if(Ge)Ge[0].type!==ce.type&&(Ne?Ne.call(this,ce,Ge[0]):(Ge[1]||rT).call(this,ce,Ge[0]));else throw new Error("Cannot close `"+ce.type+"` ("+oh({start:ce.start,end:ce.end})+"): it’s not open");Me.position.end=jo(ce.end)}function p(){return lse(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function g(ce){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function v(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=ce}function j(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=ce}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Bu(this.sliceSerialize(ce)).toLowerCase()}function C(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function A(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function P(ce){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Me=this.sliceSerialize(ce).length;Ne.depth=Me}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function _(ce){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ce){const Me=this.stack[this.stack.length-1].children;let Ge=Me[Me.length-1];(!Ge||Ge.type!=="text")&&(Ge=mt(),Ge.position={start:jo(ce.start),end:void 0},Me.push(Ge)),this.stack.push(Ge)}function F(ce){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(ce),Ne.position.end=jo(ce.end)}function U(ce){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Me=Ne.children[Ne.children.length-1];Me.position.end=jo(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&($.call(this,ce),F.call(this,ce))}function B(){this.data.atHardBreak=!0}function V(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function X(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function Z(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=ce}function H(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,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 Ne=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ne,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function oe(ce){const Ne=this.sliceSerialize(ce),Me=this.stack[this.stack.length-2];Me.label=ole(Ne),Me.identifier=Bu(Ne).toLowerCase()}function ye(){const ce=this.stack[this.stack.length-1],Ne=this.resume(),Me=this.stack[this.stack.length-1];if(this.data.inReference=!0,Me.type==="link"){const Ge=ce.children;Me.children=Ge}else Me.alt=Ne}function I(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=ce}function M(){const ce=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=ce}function q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function G(ce){const Ne=this.resume(),Me=this.stack[this.stack.length-1];Me.label=Ne,Me.identifier=Bu(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function se(ce){this.data.characterReferenceType=ce.type}function ne(ce){const Ne=this.sliceSerialize(ce),Me=this.data.characterReferenceType;let Ge;Me?(Ge=w3(Ne,Me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ge=Ck(Ne);const pt=this.stack[this.stack.length-1];pt.value+=Ge}function Ce(ce){const Ne=this.stack.pop();Ne.position.end=jo(ce.end)}function Se(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(ce)}function ee(ce){F.call(this,ce);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(ce)}function pe(){return{type:"blockquote",children:[]}}function Ee(){return{type:"code",lang:null,meta:null,value:""}}function Y(){return{type:"inlineCode",value:""}}function He(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function at(){return{type:"heading",depth:0,children:[]}}function Ve(){return{type:"break"}}function Ht(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function cn(){return{type:"link",title:null,url:"",children:[]}}function en(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function je(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Ze(){return{type:"paragraph",children:[]}}function Rt(){return{type:"strong",children:[]}}function mt(){return{type:"text",value:""}}function Je(){return{type:"thematicBreak"}}}function jo(e){return{line:e.line,column:e.column,offset:e.offset}}function P3(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?P3(e,r):dle(e,r)}}function dle(e,t){let n;for(n in t)if(z3.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 rT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+oh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+oh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+oh({start:t.start,end:t.end})+") is still open")}function fle(e){const t=this;t.parser=n;function n(r){return cle(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hle(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 ple(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
+
`}]}function mle(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 gle(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yle(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vle(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=bd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,u+=1,e.footnoteCounts.set(r,u);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function xle(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 ble(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function T3(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 l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function wle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return T3(e,t);const i={src:bd(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 jle(e,t){const n={src:bd(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 Sle(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 Nle(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return T3(e,t);const i={href:bd(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 kle(e,t){const n={href:bd(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 Cle(e,t,n){const r=e.all(t),i=n?Ale(n):R3(t),a={},l=[];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 u=-1;for(;++u<r.length;){const p=r[u];(i||u!==0||p.type!=="element"||p.tagName!=="p")&&l.push({type:"text",value:`
|
|
103
|
+
`}),p.type==="element"&&p.tagName==="p"&&!i?l.push(...p.children):l.push(p)}const d=r[r.length-1];d&&(i||d.type!=="element"||d.tagName!=="p")&&l.push({type:"text",value:`
|
|
104
|
+
`});const f={type:"element",tagName:"li",properties:a,children:l};return e.patch(t,f),e.applyData(t,f)}function Ale(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=R3(n[r])}return t}function R3(e){const t=e.spread;return t??e.children.length>1}function Ole(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 l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.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 Ele(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _le(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zle(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ple(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=jk(t.children[1]),d=p3(t.children[t.children.length-1]);u&&d&&(l.position={start:u,end:d}),i.push(l)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Tle(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<u;){const m=t.children[d],g={},v=l?l[d]:void 0;v&&(g.align=v);let j={type:"element",tagName:a,properties:g,children:[]};m&&(j.children=e.all(m),e.patch(m,j),j=e.applyData(m,j)),f.push(j)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function Rle(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const iT=9,aT=32;function Dle(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(sT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(sT(t.slice(i),i>0,!1)),a.join("")}function sT(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===iT||a===aT;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===iT||a===aT;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Mle(e,t){const n={type:"text",value:Dle(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ile(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Lle={blockquote:hle,break:ple,code:mle,delete:gle,emphasis:yle,footnoteReference:vle,heading:xle,html:ble,imageReference:wle,image:jle,inlineCode:Sle,linkReference:Nle,link:kle,listItem:Cle,list:Ole,paragraph:Ele,root:_le,strong:zle,table:Ple,tableCell:Rle,tableRow:Tle,text:Mle,thematicBreak:Ile,toml:Jm,yaml:Jm,definition:Jm,footnoteDefinition:Jm};function Jm(){}const D3=-1,Fv=0,ch=1,my=2,Ek=3,_k=4,zk=5,Pk=6,M3=7,I3=8,oT=typeof self=="object"?self:globalThis,$le=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,l]=t[i];switch(a){case Fv:case D3:return n(l,i);case ch:{const u=n([],i);for(const d of l)u.push(r(d));return u}case my:{const u=n({},i);for(const[d,f]of l)u[r(d)]=r(f);return u}case Ek:return n(new Date(l),i);case _k:{const{source:u,flags:d}=l;return n(new RegExp(u,d),i)}case zk:{const u=n(new Map,i);for(const[d,f]of l)u.set(r(d),r(f));return u}case Pk:{const u=n(new Set,i);for(const d of l)u.add(r(d));return u}case M3:{const{name:u,message:d}=l;return n(new oT[u](d),i)}case I3:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new oT[a](l),i)};return r},lT=e=>$le(new Map,e)(0),hu="",{toString:Ble}={},{keys:Ule}=Object,$f=e=>{const t=typeof e;if(t!=="object"||!e)return[Fv,t];const n=Ble.call(e).slice(8,-1);switch(n){case"Array":return[ch,hu];case"Object":return[my,hu];case"Date":return[Ek,hu];case"RegExp":return[_k,hu];case"Map":return[zk,hu];case"Set":return[Pk,hu];case"DataView":return[ch,n]}return n.includes("Array")?[ch,n]:n.includes("Error")?[M3,n]:[my,n]},eg=([e,t])=>e===Fv&&(t==="function"||t==="symbol"),qle=(e,t,n,r)=>{const i=(l,u)=>{const d=r.push(l)-1;return n.set(u,d),d},a=l=>{if(n.has(l))return n.get(l);let[u,d]=$f(l);switch(u){case Fv:{let p=l;switch(d){case"bigint":u=I3,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([D3],l)}return i([u,p],l)}case ch:{if(d){let g=l;return d==="DataView"?g=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(g=new Uint8Array(l)),i([d,[...g]],l)}const p=[],m=i([u,p],l);for(const g of l)p.push(a(g));return m}case my:{if(d)switch(d){case"BigInt":return i([d,l.toString()],l);case"Boolean":case"Number":case"String":return i([d,l.valueOf()],l)}if(t&&"toJSON"in l)return a(l.toJSON());const p=[],m=i([u,p],l);for(const g of Ule(l))(e||!eg($f(l[g])))&&p.push([a(g),a(l[g])]);return m}case Ek:return i([u,l.toISOString()],l);case _k:{const{source:p,flags:m}=l;return i([u,{source:p,flags:m}],l)}case zk:{const p=[],m=i([u,p],l);for(const[g,v]of l)(e||!(eg($f(g))||eg($f(v))))&&p.push([a(g),a(v)]);return m}case Pk:{const p=[],m=i([u,p],l);for(const g of l)(e||!eg($f(g)))&&p.push(a(g));return m}}const{message:f}=l;return i([u,{name:d,message:f}],l)};return a},cT=(e,{json:t,lossy:n}={})=>{const r=[];return qle(!(t||n),!!t,new Map,r)(e),r},gy=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?lT(cT(e,t)):structuredClone(e):(e,t)=>lT(cT(e,t));function Fle(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 Hle(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Kle(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Fle,r=e.options.footnoteBackLabel||Hle,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];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(),g=bd(m.toLowerCase());let v=0;const j=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++v<=b;){j.length>0&&j.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,v);typeof E=="string"&&(E={type:"text",value:E}),j.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const E=S.children[S.children.length-1];E&&E.type==="text"?E.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...j)}else p.push(...j);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(p,!0)};e.patch(f,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...gy(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
105
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
106
|
+
`}]}}const L3=(function(e){if(e==null)return Wle;if(typeof e=="function")return Hv(e);if(typeof e=="object")return Array.isArray(e)?Gle(e):Vle(e);if(typeof e=="string")return Qle(e);throw new Error("Expected function, string, or object as test")});function Gle(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=L3(e[n]);return Hv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Vle(e){const t=e;return Hv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function Qle(e){return Hv(t);function t(n){return n&&n.type===e}}function Hv(e){return t;function t(n,r,i){return!!(Yle(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Wle(){return!0}function Yle(e){return e!==null&&typeof e=="object"&&"type"in e}const $3=[],Zle=!0,uT=!1,Xle="skip";function Jle(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=L3(i),l=r?-1:1;u(e,void 0,[])();function u(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(g,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return g;function g(){let v=$3,j,b,S;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=ece(n(d,p)),v[0]===uT))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==Xle)for(b=(r?k.children.length:-1)+l,S=p.concat(k);b>-1&&b<k.children.length;){const E=k.children[b];if(j=u(E,b,S)(),j[0]===uT)return j;b=typeof j[1]=="number"?j[1]:b+l}}return v}}}function ece(e){return Array.isArray(e)?e:typeof e=="number"?[Zle,e]:e==null?$3:[e]}function B3(e,t,n,r){let i,a,l;typeof t=="function"&&typeof n!="function"?(a=void 0,l=t,i=n):(a=t,l=n,i=r),Jle(e,a,u,i);function u(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const h1={}.hasOwnProperty,tce={};function nce(e,t){const n=t||tce,r=new Map,i=new Map,a=new Map,l={...Lle,...n.handlers},u={all:f,applyData:ice,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:rce,wrap:sce};return B3(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,g=String(p.identifier).toUpperCase();m.has(g)||m.set(g,p)}}),u;function d(p,m){const g=p.type,v=u.handlers[g];if(h1.call(u.handlers,g)&&v)return v(u,p,m);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in p){const{children:b,...S}=p,k=gy(S);return k.children=u.all(p),k}return gy(p)}return(u.options.unknownHandler||ace)(u,p,m)}function f(p){const m=[];if("children"in p){const g=p.children;let v=-1;for(;++v<g.length;){const j=u.one(g[v],p);if(j){if(v&&g[v-1].type==="break"&&(!Array.isArray(j)&&j.type==="text"&&(j.value=dT(j.value)),!Array.isArray(j)&&j.type==="element")){const b=j.children[0];b&&b.type==="text"&&(b.value=dT(b.value))}Array.isArray(j)?m.push(...j):m.push(j)}}}return m}}function rce(e,t){e.position&&(t.position=Bae(e))}function ice(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 l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&a&&Object.assign(n.properties,gy(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function ace(e,t){const n=t.data||{},r="value"in t&&!(h1.call(n,"hProperties")||h1.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 sce(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 dT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function fT(e,t){const n=nce(e,t),r=n.one(e,void 0),i=Kle(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 oce(e,t){return e&&"run"in e?async function(n,r){const i=fT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return fT(n,{file:r,...e||t})}}function hT(e){if(e)throw e}var Bw,pT;function lce(){if(pT)return Bw;pT=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 g;for(g in f);return typeof g>"u"||e.call(f,g)},l=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},u=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Bw=function d(){var f,p,m,g,v,j,b=arguments[0],S=1,k=arguments.length,E=!1;for(typeof b=="boolean"&&(E=b,b=arguments[1]||{},S=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});S<k;++S)if(f=arguments[S],f!=null)for(p in f)m=u(b,p),g=u(f,p),b!==g&&(E&&g&&(a(g)||(v=i(g)))?(v?(v=!1,j=m&&i(m)?m:[]):j=m&&a(m)?m:{},l(b,{name:p,newValue:d(E,j,g)})):typeof g<"u"&&l(b,{name:p,newValue:g}));return b},Bw}var cce=lce();const Uw=pa(cce);function p1(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 uce(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);u(null,...i);function u(d,...f){const p=e[++a];let m=-1;if(d){l(d);return}for(;++m<i.length;)(f[m]===null||f[m]===void 0)&&(f[m]=i[m]);i=f,p?dce(p,u)(...f):l(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 dce(e,t){let n;return r;function r(...l){const u=e.length>l.length;let d;u&&l.push(i);try{d=e.apply(this,l)}catch(f){const p=f;if(u&&n)throw p;return i(p)}u||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(l,...u){n||(n=!0,t(l,...u))}function a(l){i(null,l)}}const za={basename:fce,dirname:hce,extname:pce,join:mce,sep:"/"};function fce(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Qh(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 l=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function hce(e){if(Qh(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 pce(e){Qh(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===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 mce(...e){let t=-1,n;for(;++t<e.length;)Qh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gce(n)}function gce(e){Qh(e);const t=e.codePointAt(0)===47;let n=yce(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yce(e,t){let n="",r=0,i=-1,a=0,l=-1,u,d;for(;++l<=e.length;){if(l<e.length)u=e.codePointAt(l);else{if(u===47)break;u=47}if(u===47){if(!(i===l-1||a===1))if(i!==l-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=l,a=0;continue}}else if(n.length>0){n="",r=0,i=l,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,a=0}else u===46&&a>-1?a++:a=-1}return n}function Qh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const vce={cwd:xce};function xce(){return"/"}function m1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function bce(e){if(typeof e=="string")e=new URL(e);else if(!m1(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 wce(e)}function wce(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 qw=["history","path","basename","stem","extname","dirname"];class U3{constructor(t){let n;t?m1(t)?n={path:t}:typeof t=="string"||jce(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":vce.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<qw.length;){const a=qw[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)qw.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?za.basename(this.path):void 0}set basename(t){Hw(t,"basename"),Fw(t,"basename"),this.path=za.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?za.dirname(this.path):void 0}set dirname(t){mT(this.basename,"dirname"),this.path=za.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?za.extname(this.path):void 0}set extname(t){if(Fw(t,"extname"),mT(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=za.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){m1(t)&&(t=bce(t)),Hw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?za.basename(this.path,this.extname):void 0}set stem(t){Hw(t,"stem"),Fw(t,"stem"),this.path=za.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 Ar(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 Fw(e,t){if(e&&e.includes(za.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+za.sep+"`")}function Hw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function mT(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function jce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Sce=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Nce={}.hasOwnProperty;class Tk extends Sce{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=uce()}copy(){const t=new Tk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Uw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vw("data",this.frozen),this.namespace[t]=n,this):Nce.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vw("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=tg(t),r=this.parser||this.Parser;return Kw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Kw("process",this.parser||this.Parser),Gw("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const u=tg(t),d=r.parse(u);r.run(d,u,function(p,m,g){if(p||!m||!g)return f(p);const v=m,j=r.stringify(v,g);Ace(j)?g.value=j:g.result=j,f(p,g)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Kw("processSync",this.parser||this.Parser),Gw("processSync",this.compiler||this.Compiler),this.process(t,i),yT("processSync","process",n),r;function i(a,l){n=!0,hT(a),r=l}}run(t,n,r){gT(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(l,u){const d=tg(n);i.run(t,d,f);function f(p,m,g){const v=m||t;p?u(p):l?l(v):r(void 0,v,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),yT("runSync","run",r),i;function a(l,u){hT(l),i=u,r=!0}}stringify(t,n){this.freeze();const r=tg(n),i=this.compiler||this.Compiler;return Gw("stringify",i),gT(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Vw("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):l(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 l(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function l(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");u(f.plugins),f.settings&&(i.settings=Uw(!0,i.settings,f.settings))}function u(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,g=-1;for(;++m<r.length;)if(r[m][0]===f){g=m;break}if(g===-1)r.push([f,...p]);else if(p.length>0){let[v,...j]=p;const b=r[g][1];p1(b)&&p1(v)&&(v=Uw(!0,b,v)),r[g]=[f,v,...j]}}}}const kce=new Tk().freeze();function Kw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Gw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vw(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 gT(e){if(!p1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function yT(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function tg(e){return Cce(e)?e:new U3(e)}function Cce(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ace(e){return typeof e=="string"||Oce(e)}function Oce(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Ece="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",vT=[],xT={allowDangerousHtml:!0},_ce=/^(https?|ircs?|mailto|xmpp)$/i,zce=[{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 Pce(e){const t=Tce(e),n=Rce(e);return Dce(t.runSync(t.parse(n),n),e)}function Tce(e){const t=e.rehypePlugins||vT,n=e.remarkPlugins||vT,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xT}:xT;return kce().use(fle).use(n).use(oce,r).use(t)}function Rce(e){const t=e.children||"",n=new U3;return typeof t=="string"&&(n.value=t),n}function Dce(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,u=t.unwrapDisallowed,d=t.urlTransform||Mce;for(const p of zce)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ece+p.id,void 0);return B3(e,f),Kae(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function f(p,m,g){if(p.type==="raw"&&g&&typeof m=="number")return l?g.children.splice(m,1):g.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Iw)if(Object.hasOwn(Iw,v)&&Object.hasOwn(p.properties,v)){const j=p.properties[v],b=Iw[v];(b===null||b.includes(p.tagName))&&(p.properties[v]=d(String(j||""),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,g)),v&&g&&typeof m=="number")return u&&p.children?g.children.splice(m,1,...p.children):g.children.splice(m,1),m}}}function Mce(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||_ce.test(e.slice(0,t))?e:""}function Ice(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Kv=Ice();async function bT(e){const t=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ei(n?.error?.message??`transcript fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function Lce(e){const t=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ei(n?.error?.message??`providers fetch failed: ${t.status}`,t.status,n?.error?.code)}return t.json()}async function $ce(e){const t=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){const n=await t.json().catch(()=>({}));throw new ei(n?.error?.message??`reset failed: ${t.status}`,t.status,n?.error?.code)}}async function Bce({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:l}){const u={prompt:t};n&&(u.provider=n),r&&(u.modelId=r),i&&(u.scope=i);const d=await fetch(`${Kv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(u),signal:a});if(!d.ok||!d.body){const v=await d.json().catch(()=>({}));throw new ei(v?.error?.message??`prompt failed: ${d.status}`,d.status,v?.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const g=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",g,{once:!0});try{for(;;){const{value:v,done:j}=await f.read();if(j)break;m+=p.decode(v,{stream:!0});let b=m.indexOf(`
|
|
111
|
+
|
|
112
|
+
`);for(;b!==-1;){const S=m.slice(0,b);m=m.slice(b+2);for(const k of S.split(`
|
|
113
|
+
`)){if(!k.startsWith("data:"))continue;const E=k.slice(5).trim();if(E)try{l(JSON.parse(E))}catch{}}b=m.indexOf(`
|
|
114
|
+
|
|
115
|
+
`)}}}finally{a?.removeEventListener("abort",g);try{f.releaseLock()}catch{}}}function q3(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const Uce=[{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?"}],qce=[{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"}],ng=e=>`canonry:aero:provider:${e}`,wT=e=>`canonry:aero:scope:${e}`;function Fce({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,l]=x.useState([]),[u,d]=x.useState(""),[f,p]=x.useState(!1),[m,g]=x.useState([]),[v,j]=x.useState(""),[b,S]=x.useState(null),[k,E]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(ng(e))??null),[C,A]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(wT(e))==="all"?"all":"read-only"),P=x.useRef(null),O=x.useRef(null),_=x.useRef(null),[T,$]=x.useState(0),F=x.useMemo(()=>{const q=u.trimStart();if(!q.startsWith("/"))return[];if(/\s/.test(q))return[];const D=q.toLowerCase();return qce.filter(G=>G.command.startsWith(D)||G.label.toLowerCase().includes(D.slice(1)))},[u]);x.useEffect(()=>{$(q=>F.length===0?0:Math.min(q,F.length-1))},[F.length]);const U=ca({queryKey:qe.agent.providers(e),queryFn:()=>Lce(e),enabled:t,staleTime:6e4}),B=x.useMemo(()=>{const q=U.data?.providers??[];if(k){const G=q.find(se=>se.id===k&&se.configured);if(G)return G}const D=U.data?.defaultProvider;return D?q.find(G=>G.id===D)??null:null},[k,U.data]);x.useEffect(()=>{if(!U.data||!k)return;U.data.providers.find(D=>D.id===k&&D.configured)||(E(null),window.localStorage.removeItem(ng(e)))},[U.data,k,e]);const V=x.useCallback(q=>{E(q),!(typeof window>"u")&&(q?window.localStorage.setItem(ng(e),q):window.localStorage.removeItem(ng(e)))},[e]),X=x.useCallback(()=>{A(q=>{const D=q==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(wT(e),D),D})},[e]);x.useEffect(()=>{if(!t)return;const q=D=>{D.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[t,r]),x.useEffect(()=>{if(!t)return;let q=!1;S(null);const D=()=>{q||f||bT(e).then(ne=>{q||l(ne.messages)}).catch(ne=>{q||S(ne instanceof Error?ne.message:"Failed to load transcript")})};D();const se=window.setInterval(D,15e3);return()=>{q=!0,window.clearInterval(se)}},[t,e,f]),x.useEffect(()=>()=>{P.current?.abort()},[e]),x.useEffect(()=>{const q=O.current;q&&(q.scrollTop=q.scrollHeight)},[a,v,m]);async function Z(q){const D=q.trim();if(!D||f)return;S(null),d(""),p(!0),j(""),g([]);const G={role:"user",content:D,timestamp:Date.now()};l(ne=>[...ne,G]);const se=new AbortController;P.current=se;try{await Bce({project:e,prompt:D,provider:k??void 0,scope:C,signal:se.signal,onEvent:H});const ne=await bT(e);l(ne.messages)}catch(ne){ne.name!=="AbortError"&&S(ne instanceof Error?ne.message:"Prompt failed")}finally{p(!1),j(""),P.current=null}}function H(q){switch(q.type){case"message_update":j(q3(q.message));break;case"message_end":q.message.role==="assistant"&&j("");break;case"tool_execution_start":g(D=>[...D,{id:q.toolCallId,name:q.toolName,args:q.args,startedAt:Date.now()}]);break;case"tool_execution_end":g(D=>D.map(G=>G.id===q.toolCallId?{...G,endedAt:Date.now(),isError:q.isError,result:q.result}:G));break;case"error":S(q.message);break}}async function J(){P.current?.abort();try{await $ce(e),l([]),S(null)}catch(q){S(q instanceof Error?q.message:"Reset failed")}}const oe=a.length===0,ye=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",M=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 s.jsx("div",{className:ye,onClick:q=>{r&&q.target===q.currentTarget&&i(!1)},children:s.jsx("div",{className:I,children:t?s.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:[s.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(P2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),s.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:f?"working…":e})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Hce,{providers:U.data?.providers??[],active:B,override:k,onPick:V,disabled:f}),s.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:s.jsx(G5,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.jsx("button",{type:"button",onClick:()=>i(q=>!q),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?s.jsx(fW,{className:"h-3.5 w-3.5","aria-hidden":"true"}):s.jsx(lW,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.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:s.jsx(Kh,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),s.jsxs("div",{ref:O,className:M,children:[b&&s.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}),oe&&!f&&s.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[s.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",s.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:Uce.map(q=>s.jsx("button",{type:"button",onClick:()=>Z(q.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:q.label},q.label))})]}),Wce(a,e,k,C),m.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(q=>s.jsx(F3,{trail:q},q.id))}),f&&v&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsx(H3,{content:v})]}),f&&!v&&m.every(q=>q.endedAt!==void 0)&&s.jsx(Jce,{})]}),s.jsx(Kce,{projectName:e,activeProvider:B,scope:C,onToggleScope:X,disabled:f}),s.jsxs("div",{className:"relative",children:[F.length>0&&s.jsx(Gce,{matches:F,selectedIndex:T,onHover:$,onPick:q=>{d(""),_.current?.focus(),q.action==="clear"?J():Z(q.prompt)}}),s.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:q=>{if(q.preventDefault(),F.length>0){const D=F[T];d(""),D.action==="clear"?J():Z(D.prompt);return}Z(u)},children:[s.jsx("textarea",{ref:_,value:u,onChange:q=>d(q.target.value),onKeyDown:q=>{if(F.length>0){if(q.key==="ArrowDown"){q.preventDefault(),$(D=>(D+1)%F.length);return}if(q.key==="ArrowUp"){q.preventDefault(),$(D=>(D-1+F.length)%F.length);return}if(q.key==="Tab"){q.preventDefault();const D=F[T];d(`${D.command} `);return}if(q.key==="Escape"){q.preventDefault(),d("");return}}if(q.key==="Enter"&&!q.shiftKey)if(q.preventDefault(),F.length>0){const D=F[T];d(""),D.action==="clear"?J():Z(D.prompt)}else Z(u)},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"}),s.jsx("button",{type:"submit",disabled:f||!u.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:s.jsx(DQ,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):s.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:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(P2,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),s.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function Hce({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,l]=x.useState(!1),u=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=g=>{u.current?.contains(g.target)||l(!1)},m=g=>{g.key==="Escape"&&l(!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 s.jsxs("div",{ref:u,className:"relative",children:[s.jsxs("button",{type:"button",onClick:()=>l(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:[s.jsx("span",{className:"font-medium text-zinc-200",children:d}),f&&s.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:f}),s.jsx(BQ,{className:"h-3 w-3","aria-hidden":"true"})]}),a&&s.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:[s.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),s.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(p=>{const m=t?.id===p.id,g=n===p.id;return s.jsx("li",{children:s.jsxs("button",{type:"button",role:"option","aria-selected":m,disabled:!p.configured,onClick:()=>{p.configured&&(r(g?null:p.id),l(!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:[s.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:m?s.jsx(U5,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),s.jsxs("span",{className:"flex-1",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"font-medium text-zinc-100",children:p.label}),g&&s.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&&s.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),s.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:p.defaultModel}),p.keySource==="env"&&s.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!p.configured&&s.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",s.jsx("code",{className:"font-mono text-zinc-400",children:Vce(p.id)})]})]})]})},p.id)})}),n&&s.jsx("button",{type:"button",onClick:()=>{r(null),l(!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 Kce({projectName:e,activeProvider:t,scope:n,onToggleScope:r,disabled:i}){const a=t?.label.replace(/\s+\(.+\)$/,"")??null,l=n==="all";return s.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:[s.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:[s.jsx("span",{className:"text-zinc-600",children:"project"}),s.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),a&&s.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:[s.jsx("span",{className:"text-zinc-600",children:"model"}),s.jsx("span",{className:"font-medium text-zinc-200",children:a})]}),s.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 ${l?"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:l?"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:[s.jsx("span",{className:l?"text-amber-500":"text-zinc-600",children:"scope"}),s.jsx("span",{className:"font-medium",children:l?"all tools":"read-only"})]})]})}function Gce({matches:e,selectedIndex:t,onHover:n,onPick:r}){return s.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:[s.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),s.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((i,a)=>{const l=a===t;return s.jsx("li",{children:s.jsxs("button",{type:"button",role:"option","aria-selected":l,onMouseEnter:()=>n(a),onClick:()=>r(i),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${l?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[s.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:i.command}),s.jsx("span",{className:"font-medium",children:i.label}),s.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:i.hint})]})},i.command)})}),s.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[s.jsx("span",{className:"mr-3",children:"↑↓ to select"}),s.jsx("span",{className:"mr-3",children:"Enter to run"}),s.jsx("span",{children:"Tab to autocomplete"})]})]})}function Vce(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 Qce(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function Wce(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const l=e[a],u=Qce(l,a);if(l.role==="user"){const d=typeof l.content=="string"?l.content:JSON.stringify(l.content);if(d.startsWith("[system]"))continue;i.push(s.jsx(Yce,{text:d,projectName:t,providerOverride:n,scope:r},u));continue}if(l.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const g=e[f];d.set(g.toolCallId,g),f++}const p=Xce(l,d,l.timestamp??0),m=q3(l);i.push(s.jsxs(x.Fragment,{children:[p.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(g=>s.jsx(F3,{trail:g},g.id))}),m.trim()&&s.jsxs("div",{className:"mt-3",children:[s.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsx(H3,{content:m})]})]},u)),a=f-1;continue}}return i}function Yce({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),l=x.useMemo(()=>Zce(t,e,n,r),[t,e,n,r]);async function u(){try{await navigator.clipboard.writeText(l),a(!0),window.setTimeout(()=>a(!1),1500)}catch{}}return s.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),s.jsx("button",{type:"button",onClick:u,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:l,children:i?s.jsxs(s.Fragment,{children:[s.jsx(U5,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):s.jsxs(s.Fragment,{children:[s.jsx(VQ,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),s.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function Zce(e,t,n,r){const i=["canonry","agent","ask",jT(e),jT(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function jT(e){return`'${e.replace(/'/g,"'\\''")}'`}function Xce(e,t,n){const r=[];for(const i of e.content){if(i.type!=="toolCall")continue;const a=i,l=t.get(a.id);r.push({id:a.id,name:a.name,args:a.arguments,startedAt:n,endedAt:l?.timestamp,isError:l?.isError,result:l?.content})}return r}function F3({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,l=a==null||a<0?null:a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`,u=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 s.jsxs("div",{className:`rounded-md border ${u} ${d} font-mono`,children:[s.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:[s.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?s.jsx(K5,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?s.jsx(iy,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):s.jsx(zW,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),s.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),s.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?s.jsx("span",{className:"text-emerald-400",children:"running…"}):s.jsxs(s.Fragment,{children:[s.jsx("span",{children:i?"failed":"ok"}),l&&s.jsx("span",{children:l})]}),s.jsx(Hh,{className:`h-3 w-3 transition-transform ${t?"rotate-90":""}`,"aria-hidden":"true"})]})]}),t&&s.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[s.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),s.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:ST(e.args)}),!r&&e.result!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:i?"Error":"Result"}),s.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:ST(e.result)})]})]})]})}function ST(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 H3({content:e}){return s.jsx("div",{className:"aero-markdown text-zinc-100",children:s.jsx(Pce,{components:{h1:t=>s.jsx("h1",{...t,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:t=>s.jsx("h2",{...t,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:t=>s.jsx("h3",{...t,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:t=>s.jsx("h4",{...t,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:t=>s.jsx("p",{...t,className:"mb-2 leading-relaxed"}),ul:t=>s.jsx("ul",{...t,className:"mb-2 ml-4 list-disc space-y-1"}),ol:t=>s.jsx("ol",{...t,className:"mb-2 ml-4 list-decimal space-y-1"}),li:t=>s.jsx("li",{...t,className:"marker:text-zinc-600"}),strong:t=>s.jsx("strong",{...t,className:"font-semibold text-zinc-50"}),em:t=>s.jsx("em",{...t,className:"text-zinc-200"}),code:({children:t,...n})=>s.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=>s.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=>s.jsx("a",{...t,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:t=>s.jsx("div",{className:"mb-2 overflow-x-auto",children:s.jsx("table",{...t,className:"w-full border-collapse text-xs"})}),thead:t=>s.jsx("thead",{...t,className:"border-b border-zinc-800"}),th:t=>s.jsx("th",{...t,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:t=>s.jsx("tr",{...t,className:"border-b border-zinc-900"}),td:t=>s.jsx("td",{...t,className:"px-2 py-1 text-zinc-200"}),blockquote:t=>s.jsx("blockquote",{...t,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>s.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function Jce(){return s.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[s.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),s.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[s.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),s.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),s.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function eue(){const e=N5(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=ca({queryKey:qe.projects.all,queryFn:GN,enabled:n!==null,staleTime:6e4});if(!n)return null;const i=r.data??[],a=i.find(l=>l.id===n)??i.find(l=>l.name===n);return a?s.jsx(Fce,{projectName:a.name},a.name):null}function Gv(e,t,n){switch(e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all}),t){case Pt["answer-visibility"]:case Pt["site-audit"]:case Pt["backlink-extract"]:return;case Pt["gsc-sync"]:case Pt["inspect-sitemap"]:e.invalidateQueries({queryKey:qe.gsc.project(n)});return;case Pt["ga-sync"]:e.invalidateQueries({queryKey:qe.traffic.project(n)});return;case Pt["bing-inspect"]:case Pt["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:qe.bing.project(n)});return;default:return t}}const NT=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:eW},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:IQ},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:XQ}],kT=e=>({label:e,state:"checking",detail:"Checking service health"}),tue={apiStatus:kT("API"),workerStatus:kT("Worker")};function nue(e){switch(e){case Pt["answer-visibility"]:return"Visibility sweep";case Pt["gsc-sync"]:return"GSC sync";case Pt["inspect-sitemap"]:return"Sitemap inspection";case Pt["ga-sync"]:return"GA sync";case Pt["bing-inspect"]:return"Bing URL inspection";case Pt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Pt["site-audit"]:return"Site audit";case Pt["backlink-extract"]:return"Backlink extract"}}function rue(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function iue(e){const t=nue(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function aue(e,t){return e.error?`${t}: ${ak(e.error)}`:e.location?`${t} · ${e.location}`:t}function sue(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function oue(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 lue(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function cue(){const e=xi(),t=x.useSyncExternalStore(Hte,tc,tc),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=ca({queryKey:qe.runs.all,queryFn:A5,enabled:n,staleTime:YS,refetchInterval:3e3}),i=ca({queryKey:qe.projects.all,queryFn:GN,enabled:n}),a=x.useRef({}),l=x.useCallback(()=>{r.refetch()},[r.refetch]);return x.useEffect(()=>{n&&l()},[n,l]),x.useEffect(()=>{if(!n||typeof window>"u")return;const u=()=>{document.visibilityState==="visible"&&l()};return window.addEventListener("focus",l),document.addEventListener("visibilitychange",u),()=>{window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",u)}},[n,l]),x.useEffect(()=>{const u=r.data??[],d=i.data??[],f=Object.fromEntries(u.map(m=>[m.id,m])),p=Object.fromEntries(u.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const g=f[m.runId];if(!g||!ck(g.status)||(a.current[g.id]??m.lastAnnouncedStatus)===g.status)continue;const j=d.find(S=>S.id===g.projectId);if(j&&Gv(e,g.kind,j.name),m.sourceAction==="run-all"){lP(g.id);continue}const b=sue(g.projectId,m.projectLabel,d);vt({title:iue(g),detail:aue(g,b),tone:rue(g.status),dedupeKey:`run:${g.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:g.id}}),lP(g.id)}for(const m of Object.values(t.batches)){const g=Vte(m.runIds,f);g.finished&&(vt({title:"Run-all batch finished",detail:oue(g,m.skippedCount),tone:lue(g),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),Gte(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function uue(){const e=Gh(),{dashboard:t,isLoading:n,refetch:r}=wc(),l=Uv(!e,e?.health).data??e?.health??tue,u=N5(),{runId:d,evidenceId:f,closeDrawer:p}=vd(),[m,g]=x.useState(!1),v=hae(d),j=v.data??null,b=v.isLoading;x.useEffect(()=>{j&&j.status!=="running"&&j.status!=="queued"&&r()},[j?.status,r]),x.useEffect(()=>{g(!1)},[u.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const A=P=>{P.key==="Escape"&&p()};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A)}},[d,f,p]);const S=t??e?.dashboard??null,k=d&&S?Fie(S,d):void 0,E=f&&S?Hie(S,f):void 0,C=(()=>{const A=u.pathname;if(A==="/")return"Portfolio";if(A==="/projects")return"Projects";if(A==="/runs")return"Runs";if(A==="/settings")return"Settings";if(A==="/setup")return"Setup";if(A==="/backlinks")return"Backlinks";if(A.startsWith("/projects/")){const O=A.split("/").filter(Boolean)[1];if(O&&S){const _=S.projects.find(T=>T.project.id===O);if(_)return _.project.name}return"Project"}return"Not found"})();return s.jsxs("div",{className:"app-shell",children:[s.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),s.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[s.jsx("div",{className:"sidebar-brand",children:s.jsx(vP,{version:l.apiStatus.version})}),s.jsxs("nav",{className:"sidebar-nav",children:[s.jsxs(Yt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(iW,{className:"sidebar-icon"}),s.jsx("span",{children:"Overview"})]}),s.jsxs(Yt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[s.jsx(nW,{className:"sidebar-icon"}),s.jsx("span",{children:"Projects"})]}),s.jsxs(Yt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(ry,{className:"sidebar-icon"}),s.jsx("span",{children:"Runs"})]}),s.jsxs(Yt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(H5,{className:"sidebar-icon"}),s.jsx("span",{children:"Backlinks"})]}),s.jsxs(Yt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(jW,{className:"sidebar-icon"}),s.jsx("span",{children:"Settings"})]}),n?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(A=>s.jsxs("div",{className:"sidebar-skeleton-item",children:[s.jsx("span",{className:"skeleton-circle size-2"}),s.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+A*15}%`}})]},A))]}):S&&S.projects.length>0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Projects"}),S.projects.map(A=>{const P=A.visibilitySummary.tone;return s.jsxs(Yt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[s.jsx("span",{className:`sidebar-dot sidebar-dot-${P}`}),s.jsx("span",{children:A.project.name})]},A.project.id)})]}):n?null:s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Resources"}),s.jsxs(Yt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(xW,{className:"sidebar-icon"}),s.jsx("span",{children:"Setup"})]})]})]}),s.jsx("div",{className:"sidebar-footer",children:NT.map(({label:A,href:P,Icon:O})=>s.jsx("a",{className:"sidebar-footer-icon",href:P,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,children:s.jsx(O,{className:"size-4"})},P))})]}),s.jsxs("div",{className:"main-area",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-left",children:[s.jsx("div",{className:"topbar-brand-mobile",children:s.jsx(vP,{compact:!0})}),s.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[s.jsx(Yt,{to:"/",children:"Home"}),s.jsx(Hh,{className:"breadcrumb-sep size-3"}),s.jsx("span",{className:"breadcrumb-current",children:C})]})]}),s.jsxs("div",{className:"topbar-actions",children:[s.jsxs("div",{className:"health-pill-row",children:[s.jsxs("span",{className:`health-pill health-pill-${l.apiStatus.state}`,title:Ho(l.apiStatus),children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),s.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,title:Ho(l.workerStatus),children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),s.jsxs(be,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>g(A=>!A),children:[s.jsx(uW,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),s.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${m?"mobile-nav-open":""}`,children:[s.jsxs(be,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>g(!1),children:[s.jsx(Kh,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Close navigation"})]}),s.jsx(Yt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),s.jsx(Yt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),s.jsx(Yt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),s.jsx(Yt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),S&&S.projects.length>0?s.jsxs("div",{className:"mobile-nav-section",children:[s.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),S.projects.map(A=>s.jsx(Yt,{to:"/projects/$projectId",params:{projectId:A.project.id},className:"mobile-nav-link",children:A.project.name},A.project.id))]}):null]}),s.jsx("main",{id:"content",className:"page-shell",children:n&&!e?s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-40"}),s.jsx("div",{className:"skeleton-text-sm w-72"})]}),s.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(A=>s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton-text w-full"}),s.jsx("div",{className:"skeleton-text-sm w-3/4"})]},A))}),s.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(A=>s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-20"}),s.jsx("div",{className:"space-y-2",children:[1,2,3].map(P=>s.jsx("div",{className:"skeleton-text-sm w-full"},P))})]},A))})]}):s.jsx(KN,{})}),s.jsxs("footer",{className:"footer",children:[s.jsxs("span",{className:"footer-brand",children:[s.jsx("span",{children:"Canonry"}),l.apiStatus.version&&l.apiStatus.version!=="unknown"?s.jsxs("span",{className:"footer-version",children:["v",l.apiStatus.version]}):null]}),s.jsx("div",{className:"footer-links",children:NT.map(({label:A,href:P,Icon:O})=>s.jsx("a",{href:P,target:"_blank",rel:"noopener noreferrer",title:A,"aria-label":A,className:"footer-icon",children:s.jsx(O,{className:"size-3.5"})},P))})]})]}),k?s.jsxs(Pie,{open:k!==void 0,title:k.summary,subtitle:`${k.projectName} · ${k.kindLabel}`,onClose:p,children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[s.jsx(Mv,{status:k.status}),s.jsx("span",{className:"text-zinc-400",children:k.startedAt}),s.jsx("span",{className:"text-zinc-500",children:k.duration}),s.jsx("span",{className:"text-zinc-600",children:k.triggerLabel})]}),k.status==="failed"&&k.statusDetail&&s.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:k.statusDetail}),s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),b?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):j&&j.snapshots.length>0?s.jsxs("div",{className:"space-y-2",children:[j.snapshots.map(A=>s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:A.query??"Unknown query"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(nc,{provider:A.provider}),s.jsx(y$,{variant:A.citationState===Ju.cited?"success":"neutral",children:A.citationState})]})]}),A.model&&s.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:A.model}),A.citedDomains.length>0&&s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[s.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",A.citedDomains.join(", ")]}),A.competitorOverlap.length>0&&s.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",A.competitorOverlap.join(", ")]}),A.groundingSources&&A.groundingSources.length>0&&s.jsxs("details",{className:"mt-2",children:[s.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[A.groundingSources.length," grounding source",A.groundingSources.length!==1?"s":""]}),s.jsx("ul",{className:"mt-1 space-y-0.5",children:A.groundingSources.map((P,O)=>s.jsx("li",{className:"text-xs text-zinc-500 truncate",children:s.jsx("a",{href:P.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:P.title||P.uri})},O))})]}),A.answerText&&s.jsxs("details",{className:"mt-1",children:[s.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:A.answerText})]})]},A.id)),j.status==="running"&&s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):j&&j.status==="running"?s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):j&&j.status==="queued"?s.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):j&&j.error?s.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[s.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),s.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:zte(j.error)})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,E?s.jsx(Mie,{evidence:E.evidence,project:E.project,onClose:p}):null,s.jsx(cue,{}),s.jsx(gae,{}),s.jsx(eue,{})]})}class due 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?s.jsx("div",{className:"page-container",children:s.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[s.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:s.jsx(iy,{className:"size-6 text-rose-400"})}),s.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),s.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),s.jsxs("div",{className:"flex gap-3 mt-2",children:[s.jsxs(be,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[s.jsx(G5,{className:"size-3.5 mr-1.5"}),"Try again"]}),s.jsx(be,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const $e=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Wi("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}));$e.displayName="Card";const g1=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Wi("flex flex-col gap-1.5 p-5",e),...t}));g1.displayName="CardHeader";const y1=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:Wi("font-medium tracking-tight text-zinc-50",e),...t}));y1.displayName="CardTitle";const v1=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:Wi("text-sm text-zinc-500",e),...t}));v1.displayName="CardDescription";const Lg=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:Wi("p-5 pt-0",e),...t}));Lg.displayName="CardContent";function fue({points:e,tone:t}){const n=x.useId();if(e.length===0)return null;const r=42,i=132,a=5,l=Math.min(...e),d=Math.max(...e)-l||1,f=i-a*2,p=r-a*2,m=e.map((g,v)=>{const j=a+v/Math.max(e.length-1,1)*f,b=a+(1-(g-l)/d)*p;return`${j},${b}`}).join(" ");return s.jsxs("svg",{className:`sparkline sparkline-${t}`,viewBox:`0 0 ${i} ${r}`,"aria-hidden":"true",children:[s.jsx("defs",{children:s.jsx("clipPath",{id:n,children:s.jsx("rect",{x:a,y:a,width:f,height:p,rx:"8"})})}),s.jsx("line",{className:"sparkline-guide",x1:a,x2:i-a,y1:r-a,y2:r-a}),s.jsx("polyline",{clipPath:`url(#${n})`,points:m,vectorEffect:"non-scaling-stroke"})]})}function hue({project:e}){return s.jsxs(Yt,{to:"/projects/$projectId",params:{projectId:e.project.id},className:"project-row cursor-pointer",children:[s.jsxs("div",{className:"project-row-primary",children:[s.jsxs("div",{children:[s.jsx("p",{className:"project-name",children:e.project.name}),s.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),s.jsx("p",{className:"project-insight",children:e.insight})]}),s.jsx("div",{className:"project-row-stat",children:s.jsxs("div",{className:"metric-inline-block",children:[s.jsx("p",{className:"metric-inline-label",children:"Answer Visibility"}),s.jsx("p",{className:`metric-inline-value ${e.visibilityTone==="caution"?"text-amber-400":""}`,children:e.visibilityScore}),s.jsx("p",{className:"metric-inline-delta",children:e.visibilityDelta}),e.providerCoverage&&s.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),s.jsx("div",{className:"project-row-stat",children:s.jsxs("div",{className:"metric-inline-block",children:[s.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),s.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel}),s.jsxs("p",{className:"metric-inline-delta",children:[e.lastRun.kindLabel," · ",Tv(e.lastRun.status)]})]})}),s.jsx("div",{className:"project-row-chart",children:s.jsx(fue,{points:e.trend,tone:Y4(e.lastRun.status)})}),s.jsx("span",{className:"project-row-link",children:s.jsx(Hh,{className:"h-4 w-4 text-zinc-500"})})]})}function pue(){const e=Gh(),{dashboard:t,isLoading:n}=wc(),r=t??e?.dashboard;if(!r||n)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-32"}),s.jsx("div",{className:"skeleton-text-sm w-64"})]}),s.jsx("div",{className:"space-y-3",children:[1,2,3].map(p=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsx("div",{className:"skeleton-text w-36"}),s.jsx("div",{className:"skeleton-text-sm w-48"})]}),s.jsx("div",{className:"skeleton-text w-16"}),s.jsx("div",{className:"skeleton-text w-16"}),s.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},p))})]});const i=r.portfolioOverview,u=Uv(!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=Ite(i.systemHealth,u,r.settings),{openRun:f}=vd();return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Portfolio"}),s.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),s.jsx("div",{className:"page-header-right",children:s.jsx("p",{className:"text-[11px] text-zinc-600",children:i.lastUpdatedAt})})]}),i.projects.length>0?s.jsx("div",{className:"project-list project-list-scrollable",children:i.projects.map(p=>s.jsx(hue,{project:p},p.project.id))}):s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h3",{children:i.emptyState?.title??"No projects yet"}),s.jsx("p",{className:"supporting-copy",children:i.emptyState?.detail}),s.jsx(be,{size:"sm",asChild:!0,children:s.jsx(Yt,{to:i.emptyState?.ctaHref==="/setup"||!i.emptyState?.ctaHref?"/setup":"/",children:i.emptyState?.ctaLabel??"Launch setup"})})]}),s.jsxs("div",{className:"overview-secondary-grid",children:[i.attentionItems.length>0&&s.jsxs("section",{className:"overview-secondary-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),s.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),s.jsx("div",{className:"attention-list attention-list-scrollable",children:i.attentionItems.map(p=>s.jsxs(Yt,{to:p.href,className:`attention-item attention-item-${p.tone}`,children:[s.jsxs("div",{children:[s.jsx("p",{className:"attention-title",children:p.title}),s.jsx("p",{className:"attention-detail",children:p.detail})]}),s.jsx("span",{className:"attention-action",children:p.actionLabel})]},p.id))})]}),s.jsxs("section",{className:"overview-secondary-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),s.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),s.jsx("div",{className:"compact-stack compact-stack-scrollable",children:i.recentRuns.length>0?i.recentRuns.map(p=>s.jsxs("button",{className:"compact-run",type:"button",onClick:()=>f(p.id),children:[s.jsxs("div",{children:[s.jsx("p",{className:"compact-run-title",children:p.projectName}),s.jsx("p",{className:"compact-run-detail",children:p.summary})]}),s.jsx(Mv,{status:p.status})]},p.id)):s.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),s.jsxs("section",{className:"page-section",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),s.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),s.jsx("div",{className:"health-grid",children:d.map(p=>s.jsxs($e,{className:"surface-card compact-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:p.label}),s.jsx("h3",{children:p.detail})]}),s.jsx(Xe,{tone:p.tone,title:p.id==="api"?Ho(u.apiStatus):p.id==="worker"?Ho(u.workerStatus):void 0,children:p.label})]}),s.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const Rk=Symbol.for("yaml.alias"),x1=Symbol.for("yaml.document"),$o=Symbol.for("yaml.map"),K3=Symbol.for("yaml.pair"),qa=Symbol.for("yaml.scalar"),wd=Symbol.for("yaml.seq"),Ki=Symbol.for("yaml.node.type"),Sc=e=>!!e&&typeof e=="object"&&e[Ki]===Rk,Vv=e=>!!e&&typeof e=="object"&&e[Ki]===x1,Wh=e=>!!e&&typeof e=="object"&&e[Ki]===$o,Dn=e=>!!e&&typeof e=="object"&&e[Ki]===K3,Jt=e=>!!e&&typeof e=="object"&&e[Ki]===qa,Yh=e=>!!e&&typeof e=="object"&&e[Ki]===wd;function Tn(e){if(e&&typeof e=="object")switch(e[Ki]){case $o:case wd:return!0}return!1}function Rn(e){if(e&&typeof e=="object")switch(e[Ki]){case Rk:case $o:case qa:case wd:return!0}return!1}const G3=e=>(Jt(e)||Tn(e))&&!!e.anchor,_l=Symbol("break visit"),mue=Symbol("skip children"),uh=Symbol("remove node");function jd(e,t){const n=gue(t);Vv(e)?Eu(null,e.contents,n,Object.freeze([e]))===uh&&(e.contents=null):Eu(null,e,n,Object.freeze([]))}jd.BREAK=_l;jd.SKIP=mue;jd.REMOVE=uh;function Eu(e,t,n,r){const i=yue(e,t,n,r);if(Rn(i)||Dn(i))return vue(e,r,i),Eu(e,i,n,r);if(typeof i!="symbol"){if(Tn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const l=Eu(a,t.items[a],n,r);if(typeof l=="number")a=l-1;else{if(l===_l)return _l;l===uh&&(t.items.splice(a,1),a-=1)}}}else if(Dn(t)){r=Object.freeze(r.concat(t));const a=Eu("key",t.key,n,r);if(a===_l)return _l;a===uh&&(t.key=null);const l=Eu("value",t.value,n,r);if(l===_l)return _l;l===uh&&(t.value=null)}}return i}function gue(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 yue(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(Wh(t))return n.Map?.(e,t,r);if(Yh(t))return n.Seq?.(e,t,r);if(Dn(t))return n.Pair?.(e,t,r);if(Jt(t))return n.Scalar?.(e,t,r);if(Sc(t))return n.Alias?.(e,t,r)}function vue(e,t,n){const r=t[t.length-1];if(Tn(r))r.items[e]=n;else if(Dn(r))e==="key"?r.key=n:r.value=n;else if(Vv(r))r.contents=n;else{const i=Sc(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const xue={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},bue=e=>e.replace(/[!,[\]{}]/g,t=>xue[t]);class Pr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Pr.defaultYaml,t),this.tags=Object.assign({},Pr.defaultTags,n)}clone(){const t=new Pr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Pr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Pr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Pr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Pr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Pr.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,l]=r;return this.tags[a]=l,!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 l=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,l),!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 l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}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(l){return n(String(l)),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+bue(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&&Rn(t.contents)){const a={};jd(t.contents,(l,u)=>{Rn(u)&&u.tag&&(a[u.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,l]of r)a==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(u=>u.startsWith(l)))&&n.push(`%TAG ${a} ${l}`);return n.join(`
|
|
117
|
+
`)}}Pr.defaultYaml={explicit:!1,version:"1.2"};Pr.defaultTags={"!!":"tag:yaml.org,2002:"};function V3(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 Q3(e){const t=new Set;return jd(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function W3(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function wue(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=Q3(e));const l=W3(t,i);return i.add(l),l},setAnchors:()=>{for(const a of n){const l=r.get(a);if(typeof l=="object"&&l.anchor&&(Jt(l.node)||Tn(l.node)))l.node.anchor=l.anchor;else{const u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=a,u}}},sourceObjects:r}}function _u(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,a=r.length;i<a;++i){const l=r[i],u=_u(e,r,String(i),l);u===void 0?delete r[i]:u!==l&&(r[i]=u)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),l=_u(e,r,i,a);l===void 0?r.delete(i):l!==a&&r.set(i,l)}else if(r instanceof Set)for(const i of Array.from(r)){const a=_u(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 l=_u(e,r,i,a);l===void 0?delete r[i]:l!==a&&(r[i]=l)}return e.call(t,n,r)}function Fi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Fi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!G3(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 Dk{constructor(t){Object.defineProperty(this,Ki,{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(!Vv(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},u=Fi(this,"",l);if(typeof i=="function")for(const{count:d,res:f}of l.anchors.values())i(f,d);return typeof a=="function"?_u(a,{"":u},"",u):u}}class Mk extends Dk{constructor(t){super(Rk),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=[],jd(t,{Node:(a,l)=>{(Sc(l)||G3(l))&&r.push(l)}}),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,l=this.resolve(i,n);if(!l){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let u=r.get(l);if(u||(Fi(l,null,n),u=r.get(l)),u?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=$g(i,l,r)),u.count*u.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return u.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(V3(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 $g(e,t,n){if(Sc(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Tn(t)){let r=0;for(const i of t.items){const a=$g(e,i,n);a>r&&(r=a)}return r}else if(Dn(t)){const r=$g(e,t.key,n),i=$g(e,t.value,n);return Math.max(r,i)}return 1}const Y3=e=>!e||typeof e!="function"&&typeof e!="object";class it extends Dk{constructor(t){super(qa),this.value=t}toJSON(t,n){return n?.keep?this.value:Fi(this.value,t,n)}toString(){return String(this.value)}}it.BLOCK_FOLDED="BLOCK_FOLDED";it.BLOCK_LITERAL="BLOCK_LITERAL";it.PLAIN="PLAIN";it.QUOTE_DOUBLE="QUOTE_DOUBLE";it.QUOTE_SINGLE="QUOTE_SINGLE";const jue="tag:yaml.org,2002:";function Sue(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 kh(e,t,n){if(Vv(e)&&(e=e.contents),Rn(e))return e;if(Dn(e)){const m=n.schema[$o].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:l,sourceObjects:u}=n;let d;if(r&&e&&typeof e=="object"){if(d=u.get(e),d)return d.anchor??(d.anchor=i(e)),new Mk(d.anchor);d={anchor:null,node:null},u.set(e,d)}t?.startsWith("!!")&&(t=jue+t.slice(2));let f=Sue(e,t,l.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new it(e);return d&&(d.node=m),m}f=e instanceof Map?l[$o]:Symbol.iterator in Object(e)?l[wd]:l[$o]}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 it(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function yy(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 l=[];l[a]=r,r=l}else r=new Map([[a,r]])}return kh(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 eh=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Z3 extends Dk{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=>Rn(r)||Dn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(eh(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(Tn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(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(Tn(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:Tn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Dn(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 Tn(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(Tn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,yy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Nue=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ss(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ll=(e,t,n)=>e.endsWith(`
|
|
118
|
+
`)?Ss(n,t):n.includes(`
|
|
119
|
+
`)?`
|
|
120
|
+
`+Ss(n,t):(e.endsWith(" ")?"":" ")+n,X3="flow",b1="block",Bg="quoted";function Qv(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:l,onOverflow:u}={}){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 g,v,j=!1,b=-1,S=-1,k=-1;n===b1&&(b=CT(e,b,t.length),b!==-1&&(m=b+d));for(let C;C=e[b+=1];){if(n===Bg&&C==="\\"){switch(S=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===b1&&(b=CT(e,b,t.length)),m=b+t.length+d,g=void 0;else{if(C===" "&&v&&v!==" "&&v!==`
|
|
122
|
+
`&&v!==" "){const A=e[b+1];A&&A!==" "&&A!==`
|
|
123
|
+
`&&A!==" "&&(g=b)}if(b>=m)if(g)f.push(g),m=g+d,g=void 0;else if(n===Bg){for(;v===" "||v===" ";)v=C,C=e[b+=1],j=!0;const A=b>k+1?b-2:S-1;if(p[A])return e;f.push(A),p[A]=!0,m=A+d,g=void 0}else j=!0}v=C}if(j&&u&&u(),f.length===0)return e;l&&l();let E=e.slice(0,f[0]);for(let C=0;C<f.length;++C){const A=f[C],P=f[C+1]||e.length;A===0?E=`
|
|
124
|
+
${t}${e.slice(0,P)}`:(n===Bg&&p[A]&&(E+=`${e[A]}\\`),E+=`
|
|
125
|
+
${t}${e.slice(A+1,P)}`)}return E}function CT(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 Wv=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yv=e=>/^(%|---|\.\.\.)/m.test(e);function kue(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,l=0;a<i;++a)if(e[a]===`
|
|
127
|
+
`){if(a-l>r)return!0;if(l=a+1,i-l<=r)return!1}return!0}function dh(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 l="",u=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(l+=n.slice(u,d)+"\\ ",d+=1,u=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{l+=n.slice(u,d);const p=n.substr(d+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(d,6)}d+=5,u=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(l+=n.slice(u,d)+`
|
|
128
|
+
|
|
129
|
+
`;n[d+2]==="\\"&&n[d+3]==="n"&&n[d+4]!=='"';)l+=`
|
|
130
|
+
`,d+=2;l+=a,n[d+2]===" "&&(l+="\\"),d+=1,u=d+1}break;default:d+=1}return l=u?l+n.slice(u):n,r?l:Qv(l,a,Bg,Wv(t,!1))}function w1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return dh(e,t);const n=t.indent||(Yv(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
+
${n}`)+"'";return t.implicitKey?r:Qv(r,n,X3,Wv(t,!1))}function zu(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=dh;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=w1:a&&!i?r=dh:r=n?w1:dh}return r(e,t)}let j1;try{j1=new RegExp(`(^|(?<!
|
|
133
|
+
))
|
|
134
|
+
+(?!
|
|
135
|
+
|$)`,"g")}catch{j1=/\n+(?!\n|$)/g}function Ug({comment:e,type:t,value:n},r,i,a){const{blockQuote:l,commentString:u,lineWidth:d}=r.options;if(!l||/\n[\t ]+$/.test(n))return zu(n,r);const f=r.indent||(r.forceBlockIndent||Yv(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===it.BLOCK_FOLDED?!1:t===it.BLOCK_LITERAL?!0:!kue(n,d,f.length);if(!n)return p?`|
|
|
136
|
+
`:`>
|
|
137
|
+
`;let m,g;for(g=n.length;g>0;--g){const P=n[g-1];if(P!==`
|
|
138
|
+
`&&P!==" "&&P!==" ")break}let v=n.substring(g);const j=v.indexOf(`
|
|
139
|
+
`);j===-1?m="-":n===v||j!==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(j1,`$&${f}`));let b=!1,S,k=-1;for(S=0;S<n.length;++S){const P=n[S];if(P===" ")b=!0;else if(P===`
|
|
141
|
+
`)k=S;else break}let E=n.substring(0,k<S?k+1:S);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${f}`));let A=(b?f?"2":"1":"")+m;if(e&&(A+=" "+u(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const P=n.replace(/\n+/g,`
|
|
142
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let O=!1;const _=Wv(r,!0);l!=="folded"&&t!==it.BLOCK_FOLDED&&(_.onOverflow=()=>{O=!0});const T=Qv(`${E}${P}${v}`,f,b1,_);if(!O)return`>${A}
|
|
143
|
+
${f}${T}`}return n=n.replace(/\n+/g,`$&${f}`),`|${A}
|
|
144
|
+
${f}${E}${n}${v}`}function Cue(e,t,n,r){const{type:i,value:a}=e,{actualString:l,implicitKey:u,indent:d,indentStep:f,inFlow:p}=t;if(u&&a.includes(`
|
|
145
|
+
`)||p&&/[[\]{},]/.test(a))return zu(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return u||p||!a.includes(`
|
|
146
|
+
`)?zu(a,t):Ug(e,t,n,r);if(!u&&!p&&i!==it.PLAIN&&a.includes(`
|
|
147
|
+
`))return Ug(e,t,n,r);if(Yv(a)){if(d==="")return t.forceBlockIndent=!0,Ug(e,t,n,r);if(u&&d===f)return zu(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
+
${d}`);if(l){const g=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(m),{compat:v,tags:j}=t.doc.schema;if(j.some(g)||v?.some(g))return zu(a,t)}return u?m:Qv(m,d,X3,Wv(t,!1))}function Ik(e,t,n,r){const{implicitKey:i,inFlow:a}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:u}=e;u!==it.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(u=it.QUOTE_DOUBLE);const d=p=>{switch(p){case it.BLOCK_FOLDED:case it.BLOCK_LITERAL:return i||a?zu(l.value,t):Ug(l,t,n,r);case it.QUOTE_DOUBLE:return dh(l.value,t);case it.QUOTE_SINGLE:return w1(l.value,t);case it.PLAIN:return Cue(l,t,n,r);default:return null}};let f=d(u);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,g=i&&p||m;if(f=d(g),f===null)throw new Error(`Unsupported default string type ${g}`)}return f}function J3(e,t){const n=Object.assign({blockQuote:!0,commentString:Nue,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 Aue(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(l=>l.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 Oue(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(Jt(e)||Tn(e))&&e.anchor;a&&V3(a)&&(n.add(a),i.push(`&${a}`));const l=e.tag??(t.default?null:t.tag);return l&&i.push(r.directives.tagString(l)),i.join(" ")}function ed(e,t,n,r){if(Dn(e))return e.toString(t,n,r);if(Sc(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=Rn(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Aue(t.doc.schema.tags,a));const l=Oue(a,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const u=typeof i.stringify=="function"?i.stringify(a,t,n,r):Jt(a)?Ik(a,t,n,r):a.toString(t,n,r);return l?Jt(a)||u[0]==="{"||u[0]==="["?`${l} ${u}`:`${l}
|
|
149
|
+
${t.indent}${u}`:u}function Eue({key:e,value:t},n,r,i){const{allNullValues:a,doc:l,indent:u,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let g=Rn(e)&&e.comment||null;if(m){if(g)throw new Error("With simple keys, key nodes cannot have comments");if(Tn(e)||!Rn(e)&&typeof e=="object"){const _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let v=!m&&(!e||g&&t==null&&!n.inFlow||Tn(e)||(Jt(e)?e.type===it.BLOCK_FOLDED||e.type===it.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:u+d});let j=!1,b=!1,S=ed(e,n,()=>j=!0,()=>b=!0);if(!v&&!n.inFlow&&S.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 j&&r&&r(),S===""?"?":v?`? ${S}`:S}else if(a&&!m||t==null&&v)return S=`? ${S}`,g&&!j?S+=Ll(S,n.indent,f(g)):b&&i&&i(),S;j&&(g=null),v?(g&&(S+=Ll(S,n.indent,f(g))),S=`? ${S}
|
|
150
|
+
${u}:`):(S=`${S}:`,g&&(S+=Ll(S,n.indent,f(g))));let k,E,C;Rn(t)?(k=!!t.spaceBefore,E=t.commentBefore,C=t.comment):(k=!1,E=null,C=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!g&&Jt(t)&&(n.indentAtStart=S.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&Yh(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let A=!1;const P=ed(t,n,()=>A=!0,()=>b=!0);let O=" ";if(g||k||E){if(O=k?`
|
|
151
|
+
`:"",E){const _=f(E);O+=`
|
|
152
|
+
${Ss(_,n.indent)}`}P===""&&!n.inFlow?O===`
|
|
153
|
+
`&&C&&(O=`
|
|
154
|
+
|
|
155
|
+
`):O+=`
|
|
156
|
+
${n.indent}`}else if(!v&&Tn(t)){const _=P[0],T=P.indexOf(`
|
|
157
|
+
`),$=T!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let U=!1;if($&&(_==="&"||_==="!")){let B=P.indexOf(" ");_==="&"&&B!==-1&&B<T&&P[B+1]==="!"&&(B=P.indexOf(" ",B+1)),(B===-1||T<B)&&(U=!0)}U||(O=`
|
|
158
|
+
${n.indent}`)}}else(P===""||P[0]===`
|
|
159
|
+
`)&&(O="");return S+=O+P,n.inFlow?A&&r&&r():C&&!A?S+=Ll(S,n.indent,f(C)):b&&i&&i(),S}function _ue(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const rg="<<",Cs={identify:e=>e===rg||typeof e=="symbol"&&e.description===rg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new it(Symbol(rg)),{addToJSMap:eB}),stringify:()=>rg},zue=(e,t)=>(Cs.identify(t)||Jt(t)&&(!t.type||t.type===it.PLAIN)&&Cs.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===Cs.tag&&n.default);function eB(e,t,n){if(n=e&&Sc(n)?n.resolve(e.doc):n,Yh(n))for(const r of n.items)Qw(e,t,r);else if(Array.isArray(n))for(const r of n)Qw(e,t,r);else Qw(e,t,n)}function Qw(e,t,n){const r=e&&Sc(n)?n.resolve(e.doc):n;if(!Wh(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,e,Map);for(const[a,l]of i)t instanceof Map?t.has(a)||t.set(a,l):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function tB(e,t,{key:n,value:r}){if(Rn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(zue(e,n))eB(e,t,r);else{const i=Fi(n,"",e);if(t instanceof Map)t.set(i,Fi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Pue(n,i,e),l=Fi(r,a,e);a in t?Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[a]=l}}return t}function Pue(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(Rn(e)&&n?.doc){const r=J3(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)+'..."'),_ue(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 Lk(e,t,n){const r=kh(e,void 0,n),i=kh(t,void 0,n);return new Mr(r,i)}class Mr{constructor(t,n=null){Object.defineProperty(this,Ki,{value:K3}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return Rn(n)&&(n=n.clone(t)),Rn(r)&&(r=r.clone(t)),new Mr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return tB(n,r,this)}toString(t,n,r){return t?.doc?Eue(this,t,n,r):JSON.stringify(this)}}function nB(e,t,n){return(t.inFlow??e.flow?Rue:Tue)(e,t,n)}function Tue({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:l,onComment:u}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const g=[];for(let j=0;j<t.length;++j){const b=t[j];let S=null;if(Rn(b))!m&&b.spaceBefore&&g.push(""),vy(n,g,b.commentBefore,m),b.comment&&(S=b.comment);else if(Dn(b)){const E=Rn(b.key)?b.key:null;E&&(!m&&E.spaceBefore&&g.push(""),vy(n,g,E.commentBefore,m))}m=!1;let k=ed(b,p,()=>S=null,()=>m=!0);S&&(k+=Ll(k,a,f(S))),m&&S&&(m=!1),g.push(r+k)}let v;if(g.length===0)v=i.start+i.end;else{v=g[0];for(let j=1;j<g.length;++j){const b=g[j];v+=b?`
|
|
160
|
+
${d}${b}`:`
|
|
161
|
+
`}}return e?(v+=`
|
|
162
|
+
`+Ss(f(e),d),u&&u()):m&&l&&l(),v}function Rue({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:l,options:{commentString:u}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let j=0;j<e.length;++j){const b=e[j];let S=null;if(Rn(b))b.spaceBefore&&m.push(""),vy(t,m,b.commentBefore,!1),b.comment&&(S=b.comment);else if(Dn(b)){const E=Rn(b.key)?b.key:null;E&&(E.spaceBefore&&m.push(""),vy(t,m,E.commentBefore,!1),E.comment&&(f=!0));const C=Rn(b.value)?b.value:null;C?(C.comment&&(S=C.comment),C.commentBefore&&(f=!0)):b.value==null&&E?.comment&&(S=E.comment)}S&&(f=!0);let k=ed(b,d,()=>S=null);j<e.length-1&&(k+=","),S&&(k+=Ll(k,r,u(S))),!f&&(m.length>p||k.includes(`
|
|
163
|
+
`))&&(f=!0),m.push(k),p=m.length}const{start:g,end:v}=n;if(m.length===0)return g+v;if(!f){const j=m.reduce((b,S)=>b+S.length+2,2);f=t.options.lineWidth>0&&j>t.options.lineWidth}if(f){let j=g;for(const b of m)j+=b?`
|
|
164
|
+
${a}${i}${b}`:`
|
|
165
|
+
`;return`${j}
|
|
166
|
+
${i}${v}`}else return`${g}${l}${m.join(" ")}${l}${v}`}function vy({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=Ss(t(r),e);n.push(a.trimStart())}}function $l(e,t){const n=Jt(t)?t.value:t;for(const r of e)if(Dn(r)&&(r.key===t||r.key===n||Jt(r.key)&&r.key.value===n))return r}class Bi extends Z3{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super($o,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,l=new this(t),u=(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)&&l.items.push(Lk(d,f,r))};if(n instanceof Map)for(const[d,f]of n)u(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))u(d,n[d]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;Dn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Mr(t,t?.value):r=new Mr(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)&&Y3(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const l=this.items.findIndex(u=>a(r,u)<0);l===-1?this.items.push(r):this.items.splice(l,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 Mr(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)tB(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Dn(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})),nB(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Sd={collection:"map",default:!0,nodeClass:Bi,tag:"tag:yaml.org,2002:map",resolve(e,t){return Wh(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Bi.from(e,t,n)};class ic extends Z3{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(wd,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=ig(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=ig(t);if(typeof r!="number")return;const i=this.items[r];return!n&&Jt(i)?i.value:i}has(t){const n=ig(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=ig(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];Jt(i)&&Y3(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(Fi(a,String(i++),n));return r}toString(t,n,r){return t?nB(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 l=0;for(let u of n){if(typeof i=="function"){const d=n instanceof Set?u:String(l++);u=i.call(n,d,u)}a.items.push(kh(u,void 0,r))}}return a}}function ig(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 Nd={collection:"seq",default:!0,nodeClass:ic,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Yh(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ic.from(e,t,n)},Zv={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),Ik(e,t,n,r)}},Xv={identify:e=>e==null,createNode:()=>new it(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new it(null),stringify:({source:e},t)=>typeof e=="string"&&Xv.test.test(e)?e:t.options.nullStr},$k={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new it(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&$k.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 ga({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 l=a.indexOf(".");l<0&&(l=a.length,a+=".");let u=t-(a.length-l-1);for(;u-- >0;)a+="0"}return a}const rB={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:ga},iB={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():ga(e)}},aB={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 it(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ga},Jv=e=>typeof e=="bigint"||Number.isInteger(e),Bk=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function sB(e,t,n){const{value:r}=e;return Jv(r)&&r>=0?n+r.toString(t):ga(e)}const oB={identify:e=>Jv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Bk(e,2,8,n),stringify:e=>sB(e,8,"0o")},lB={identify:Jv,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Bk(e,0,10,n),stringify:ga},cB={identify:e=>Jv(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Bk(e,2,16,n),stringify:e=>sB(e,16,"0x")},Due=[Sd,Nd,Zv,Xv,$k,oB,lB,cB,rB,iB,aB];function AT(e){return typeof e=="bigint"||Number.isInteger(e)}const ag=({value:e})=>JSON.stringify(e),Mue=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ag},{identify:e=>e==null,createNode:()=>new it(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ag},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ag},{identify:AT,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})=>AT(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:ag}],Iue={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Lue=[Sd,Nd].concat(Mue,Iue),Uk={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 l=n;let u;if(typeof btoa=="function"){let d="";for(let f=0;f<l.length;++f)d+=String.fromCharCode(l[f]);u=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=it.BLOCK_LITERAL),t!==it.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(u.length/d),p=new Array(f);for(let m=0,g=0;m<f;++m,g+=d)p[m]=u.substr(g,d);u=p.join(t===it.BLOCK_LITERAL?`
|
|
167
|
+
`:" ")}return Ik({comment:e,type:t,value:u},r,i,a)}};function uB(e,t){if(Yh(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Dn(r)){if(Wh(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Mr(new it(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]=Dn(r)?r:new Mr(r)}}else t("Expected a sequence for this tag");return e}function dB(e,t,n){const{replacer:r}=n,i=new ic(e);i.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(a++),l));let u,d;if(Array.isArray(l))if(l.length===2)u=l[0],d=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const f=Object.keys(l);if(f.length===1)u=f[0],d=l[u];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else u=l;i.items.push(Lk(u,d,n))}return i}const qk={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:uB,createNode:dB};class Uu extends ic{constructor(){super(),this.add=Bi.prototype.add.bind(this),this.delete=Bi.prototype.delete.bind(this),this.get=Bi.prototype.get.bind(this),this.has=Bi.prototype.has.bind(this),this.set=Bi.prototype.set.bind(this),this.tag=Uu.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,l;if(Dn(i)?(a=Fi(i.key,"",n),l=Fi(i.value,a,n)):a=Fi(i,"",n),r.has(a))throw new Error("Ordered maps must not include duplicate keys");r.set(a,l)}return r}static from(t,n,r){const i=dB(t,n,r),a=new this;return a.items=i.items,a}}Uu.tag="tag:yaml.org,2002:omap";const Fk={collection:"seq",identify:e=>e instanceof Map,nodeClass:Uu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=uB(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 Uu,n)},createNode:(e,t,n)=>Uu.from(e,t,n)};function fB({value:e,source:t},n){return t&&(e?hB:pB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const hB={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 it(!0),stringify:fB},pB={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 it(!1),stringify:fB},$ue={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:ga},Bue={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():ga(e)}},Uue={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 it(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:ga},Zh=e=>typeof e=="bigint"||Number.isInteger(e);function ex(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 l=BigInt(e);return i==="-"?BigInt(-1)*l:l}const a=parseInt(e,n);return i==="-"?-1*a:a}function Hk(e,t,n){const{value:r}=e;if(Zh(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return ga(e)}const que={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>ex(e,2,2,n),stringify:e=>Hk(e,2,"0b")},Fue={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>ex(e,1,8,n),stringify:e=>Hk(e,8,"0")},Hue={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>ex(e,0,10,n),stringify:ga},Kue={identify:Zh,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>ex(e,2,16,n),stringify:e=>Hk(e,16,"0x")};class qu extends Bi{constructor(t){super(t),this.tag=qu.tag}add(t){let n;Dn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Mr(t.key,null):n=new Mr(t,null),$l(this.items,n.key)||this.items.push(n)}get(t,n){const r=$l(this.items,t);return!n&&Dn(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 Mr(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 l of n)typeof i=="function"&&(l=i.call(n,l,l)),a.items.push(Lk(l,null,r));return a}}qu.tag="tag:yaml.org,2002:set";const Kk={collection:"map",identify:e=>e instanceof Set,nodeClass:qu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>qu.from(e,t,n),resolve(e,t){if(Wh(e)){if(e.hasAllNullValues(!0))return Object.assign(new qu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function Gk(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,i=l=>t?BigInt(l):Number(l),a=r.replace(/_/g,"").split(":").reduce((l,u)=>l*i(60)+i(u),i(0));return n==="-"?i(-1)*a:a}function mB(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return ga(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(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const gB={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})=>Gk(e,n),stringify:mB},yB={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=>Gk(e,!1),stringify:mB},tx={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(tx.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,l,u]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,l||0,u||0,d);const p=t[8];if(p&&p!=="Z"){let m=Gk(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$/,"")??""},OT=[Sd,Nd,Zv,Xv,hB,pB,que,Fue,Hue,Kue,$ue,Bue,Uue,Uk,Cs,Fk,qk,Kk,gB,yB,tx],ET=new Map([["core",Due],["failsafe",[Sd,Nd,Zv]],["json",Lue],["yaml11",OT],["yaml-1.1",OT]]),_T={binary:Uk,bool:$k,float:aB,floatExp:iB,floatNaN:rB,floatTime:yB,int:lB,intHex:cB,intOct:oB,intTime:gB,map:Sd,merge:Cs,null:Xv,omap:Fk,pairs:qk,seq:Nd,set:Kk,timestamp:tx},Gue={"tag:yaml.org,2002:binary":Uk,"tag:yaml.org,2002:merge":Cs,"tag:yaml.org,2002:omap":Fk,"tag:yaml.org,2002:pairs":qk,"tag:yaml.org,2002:set":Kk,"tag:yaml.org,2002:timestamp":tx};function Ww(e,t,n){const r=ET.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(ET.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).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,l)=>{const u=typeof l=="string"?_T[l]:l;if(!u){const d=JSON.stringify(l),f=Object.keys(_T).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(u)||a.push(u),a},[])}const Vue=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class Vk{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:l,toStringDefaults:u}){this.compat=Array.isArray(t)?Ww(t,"compat"):t?Ww(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?Gue:{},this.tags=Ww(n,this.name,r),this.toStringOptions=u??null,Object.defineProperty(this,$o,{value:Sd}),Object.defineProperty(this,qa,{value:Zv}),Object.defineProperty(this,wd,{value:Nd}),this.sortMapEntries=typeof l=="function"?l:l===!0?Vue:null}clone(){const t=Object.create(Vk.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function Que(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=J3(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(Ss(d,""))}let l=!1,u=null;if(e.contents){if(Rn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(Ss(p,""))}i.forceBlockIndent=!!e.comment,u=e.contents.comment}const d=u?void 0:()=>l=!0;let f=ed(e.contents,i,()=>u=null,d);u&&(f+=Ll(f,"",a(u))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(ed(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
+
`)?(n.push("..."),n.push(Ss(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&l&&(d=d.replace(/^\n+/,"")),d&&((!l||u)&&n[n.length-1]!==""&&n.push(""),n.push(Ss(a(d),"")))}return n.join(`
|
|
171
|
+
`)+`
|
|
172
|
+
`}class nx{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ki,{value:x1});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:l}=a;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Pr({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(nx.prototype,{[Ki]:{value:x1}});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=Rn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){pu(this.contents)&&this.contents.add(t)}addIn(t,n){pu(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=Q3(this);t.anchor=!n||r.has(n)?W3(n||"a",r):n}return new Mk(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 S=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=n.filter(S).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:l,flow:u,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:g,sourceObjects:v}=wue(this,l||"a"),j={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=kh(t,p,j);return u&&Tn(b)&&(b.flow=!0),g(),b}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new Mr(i,a)}delete(t){return pu(this.contents)?this.contents.delete(t):!1}deleteIn(t){return eh(t)?this.contents==null?!1:(this.contents=null,!0):pu(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return Tn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return eh(t)?!n&&Jt(this.contents)?this.contents.value:this.contents:Tn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return Tn(this.contents)?this.contents.has(t):!1}hasIn(t){return eh(t)?this.contents!==void 0:Tn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=yy(this.schema,[t],n):pu(this.contents)&&this.contents.set(t,n)}setIn(t,n){eh(t)?this.contents=n:this.contents==null?this.contents=yy(this.schema,Array.from(t),n):pu(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 Pr({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 Pr({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 Vk(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:l}={}){const u={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Fi(this.contents,n??"",u);if(typeof a=="function")for(const{count:f,res:p}of u.anchors.values())a(p,f);return typeof l=="function"?_u(l,{"":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 Que(this,t)}}function pu(e){if(Tn(e))return!0;throw new Error("Expected a YAML collection as document contents")}class vB extends Error{constructor(t,n,r,i){super(),this.name=t,this.code=r,this.message=i,this.pos=n}}class sg extends vB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class Wue extends vB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const zT=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(u=>t.linePos(u));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){const u=Math.min(a-39,l.length-79);l="…"+l.substring(u),a-=u-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,a))){let u=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);u.length>80&&(u=u.substring(0,79)+`…
|
|
173
|
+
`),l=u+l}if(/[^ ]/.test(l)){let u=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(u=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(u);n.message+=`:
|
|
174
|
+
|
|
175
|
+
${l}
|
|
176
|
+
${f}
|
|
177
|
+
`}};function td(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:l,startOnNewline:u}){let d=!1,f=u,p=u,m="",g="",v=!1,j=!1,b=null,S=null,k=null,E=null,C=null,A=null,P=null;for(const T of e)switch(j&&(T.type!=="space"&&T.type!=="newline"&&T.type!=="comma"&&a(T.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),j=!1),b&&(f&&T.type!=="comment"&&T.type!=="newline"&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),T.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&T.source.includes(" ")&&(b=T),p=!0;break;case"comment":{p||a(T,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=T.source.substring(1)||" ";m?m+=g+$:m=$,g="",f=!1;break}case"newline":f?m?m+=T.source:(!A||n!=="seq-item-ind")&&(d=!0):g+=T.source,f=!0,v=!0,(S||k)&&(E=T),p=!0;break;case"anchor":S&&a(T,"MULTIPLE_ANCHORS","A node can have at most one anchor"),T.source.endsWith(":")&&a(T.offset+T.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),S=T,P??(P=T.offset),f=!1,p=!1,j=!0;break;case"tag":{k&&a(T,"MULTIPLE_TAGS","A node can have at most one tag"),k=T,P??(P=T.offset),f=!1,p=!1,j=!0;break}case n:(S||k)&&a(T,"BAD_PROP_ORDER",`Anchors and tags must be after the ${T.source} indicator`),A&&a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.source} in ${t??"collection"}`),A=T,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){C&&a(T,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),C=T,f=!1,p=!1;break}default:a(T,"UNEXPECTED_TOKEN",`Unexpected ${T.type} token`),f=!1,p=!1}const O=e[e.length-1],_=O?O.offset+O.source.length:i;return j&&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<=l||r?.type==="block-map"||r?.type==="block-seq")&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:C,found:A,spaceBefore:d,comment:m,hasNewline:v,anchor:S,tag:k,newlineAfterProp:E,end:_,start:P??_}}function Ch(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(Ch(t.key)||Ch(t.value))return!0}return!1;default:return!0}}function S1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Ch(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function xB(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,l)=>a===l||Jt(a)&&Jt(l)&&a.value===l.value;return t.some(a=>i(a.key,n))}const PT="All mapping items must start at the same column";function Yue({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??Bi,u=new l(n.schema);n.atRoot&&(n.atRoot=!1);let d=r.offset,f=null;for(const p of r.items){const{start:m,key:g,sep:v,value:j}=p,b=td(m,{indicator:"explicit-key-ind",next:g??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),S=!b.found;if(S){if(g&&(g.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==r.indent&&i(d,"BAD_INDENT",PT)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(u.comment?u.comment+=`
|
|
179
|
+
`+b.comment:u.comment=b.comment);continue}(b.newlineAfterProp||Ch(g))&&i(g??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",PT);n.atKey=!0;const k=b.end,E=g?e(n,g,b,i):t(n,k,m,null,b,i);n.schema.compat&&S1(r.indent,g,i),n.atKey=!1,xB(n,u.items,E)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const C=td(v??[],{indicator:"map-value-ind",next:j,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!g||g.type==="block-scalar"});if(d=C.end,C.found){S&&(j?.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 A=j?e(n,j,C,i):t(n,d,v,null,C,i);n.schema.compat&&S1(r.indent,j,i),d=A.range[2];const P=new Mr(E,A);n.options.keepSourceTokens&&(P.srcToken=p),u.items.push(P)}else{S&&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 A=new Mr(E);n.options.keepSourceTokens&&(A.srcToken=p),u.items.push(A)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),u.range=[r.offset,d,f??d],u}function Zue({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??ic,u=new l(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 g=td(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!g.found)if(g.anchor||g.tag||m)m?.type==="block-seq"?i(g.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=g.end,g.comment&&(u.comment=g.comment);continue}const v=m?e(n,m,g,i):t(n,g.end,p,null,g,i);n.schema.compat&&S1(r.indent,m,i),d=v.range[2],u.items.push(v)}return u.range=[r.offset,d,f??d],u}function Xh(e,t,n,r){let i="";if(e){let a=!1,l="";for(const u of e){const{source:d,type:f}=u;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=d),a=!0;break;default:r(u,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const Yw="Block collections are not allowed within flow collections",Zw=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Xue({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=r.start.source==="{",u=l?"flow map":"flow sequence",d=a?.nodeClass??(l?Bi:ic),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 S=0;S<r.items.length;++S){const k=r.items[S],{start:E,key:C,sep:A,value:P}=k,O=td(E,{flow:u,indicator:"explicit-key-ind",next:C??A?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!A&&!P){S===0&&O.comma?i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):S<r.items.length-1&&i(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),O.comment&&(f.comment?f.comment+=`
|
|
181
|
+
`+O.comment:f.comment=O.comment),m=O.end;continue}!l&&n.options.strict&&Ch(C)&&i(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0)O.comma&&i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(O.comma||i(O.start,"MISSING_CHAR",`Missing , between ${u} items`),O.comment){let _="";e:for(const T of E)switch(T.type){case"comma":case"space":break;case"comment":_=T.source.substring(1);break e;default:break e}if(_){let T=f.items[f.items.length-1];Dn(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
182
|
+
`+_:T.comment=_,O.comment=O.comment.substring(_.length+1)}}if(!l&&!A&&!O.found){const _=P?e(n,P,O,i):t(n,O.end,A,null,O,i);f.items.push(_),m=_.range[2],Zw(P)&&i(_.range,"BLOCK_IN_FLOW",Yw)}else{n.atKey=!0;const _=O.end,T=C?e(n,C,O,i):t(n,_,E,null,O,i);Zw(C)&&i(T.range,"BLOCK_IN_FLOW",Yw),n.atKey=!1;const $=td(A??[],{flow:u,indicator:"map-value-ind",next:P,offset:T.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!l&&!O.found&&n.options.strict){if(A)for(const B of A){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}}O.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 P&&("source"in P&&P.source?.[0]===":"?i(P,"MISSING_CHAR",`Missing space after : in ${u}`):i($.start,"MISSING_CHAR",`Missing , or : between ${u} items`));const F=P?e(n,P,$,i):$.found?t(n,$.end,A,null,$,i):null;F?Zw(P)&&i(F.range,"BLOCK_IN_FLOW",Yw):$.comment&&(T.comment?T.comment+=`
|
|
183
|
+
`+$.comment:T.comment=$.comment);const U=new Mr(T,F);if(n.options.keepSourceTokens&&(U.srcToken=k),l){const B=f;xB(n,B.items,T)&&i(_,"DUPLICATE_KEY","Map keys must be unique"),B.items.push(U)}else{const B=new Bi(n.schema);B.flow=!0,B.items.push(U);const V=(F??T).range;B.range=[T.range[0],V[1],V[2]],f.items.push(B)}m=F?F.range[2]:$.end}}const g=l?"}":"]",[v,...j]=r.end;let b=m;if(v?.source===g)b=v.offset+v.source.length;else{const S=u[0].toUpperCase()+u.substring(1),k=p?`${S} must end with a ${g}`:`${S} in block collection must be sufficiently indented and end with a ${g}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&j.unshift(v)}if(j.length>0){const S=Xh(j,b,n.options.strict,i);S.comment&&(f.comment?f.comment+=`
|
|
184
|
+
`+S.comment:f.comment=S.comment),f.range=[r.offset,b,S.offset]}else f.range=[r.offset,b,b];return f}function Xw(e,t,n,r,i,a){const l=n.type==="block-map"?Yue(e,t,n,r,a):n.type==="block-seq"?Zue(e,t,n,r,a):Xue(e,t,n,r,a),u=l.constructor;return i==="!"||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function Jue(e,t,n,r,i){const a=r.tag,l=a?t.directives.tagName(a.source,g=>i(a,"TAG_RESOLVE_FAILED",g)):null;if(n.type==="block-seq"){const{anchor:g,newlineAfterProp:v}=r,j=g&&a?g.offset>a.offset?g:a:g??a;j&&(!v||v.offset<j.offset)&&i(j,"MISSING_CHAR","Missing newline after block sequence props")}const u=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!l||l==="!"||l===Bi.tagName&&u==="map"||l===ic.tagName&&u==="seq")return Xw(e,t,n,i,l);let d=t.schema.tags.find(g=>g.tag===l&&g.collection===u);if(!d){const g=t.schema.knownTags[l];if(g?.collection===u)t.schema.tags.push(Object.assign({},g,{default:!1})),d=g;else return g?i(a,"BAD_COLLECTION_TYPE",`${g.tag} used for ${u} collection, but expects ${g.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Xw(e,t,n,i,l)}const f=Xw(e,t,n,i,l,d),p=d.resolve?.(f,g=>i(a,"TAG_RESOLVE_FAILED",g),t.options)??f,m=Rn(p)?p:new it(p);return m.range=f.range,m.tag=l,d?.format&&(m.format=d.format),m}function ede(e,t,n){const r=t.offset,i=tde(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?it.BLOCK_FOLDED:it.BLOCK_LITERAL,l=t.source?nde(t.source):[];let u=l.length;for(let b=l.length-1;b>=0;--b){const S=l[b][1];if(S===""||S==="\r")u=b;else break}if(u===0){const b=i.chomp==="+"&&l.length>0?`
|
|
185
|
+
`.repeat(Math.max(1,l.length-1)):"";let S=r+i.length;return t.source&&(S+=t.source.length),{value:b,type:a,comment:i.comment,range:[r,S,S]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let b=0;b<u;++b){const[S,k]=l[b];if(k===""||k==="\r")i.indent===0&&S.length>d&&(d=S.length);else{S.length<d&&n(f+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=S.length),p=b,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=S.length+k.length+1}for(let b=l.length-1;b>=u;--b)l[b][0].length>d&&(u=b+1);let m="",g="",v=!1;for(let b=0;b<p;++b)m+=l[b][0].slice(d)+`
|
|
186
|
+
`;for(let b=p;b<u;++b){let[S,k]=l[b];f+=S.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&S.length<d){const A=`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",A),S=""}a===it.BLOCK_LITERAL?(m+=g+S.slice(d)+k,g=`
|
|
187
|
+
`):S.length>d||k[0]===" "?(g===" "?g=`
|
|
188
|
+
`:!v&&g===`
|
|
189
|
+
`&&(g=`
|
|
190
|
+
|
|
191
|
+
`),m+=g+S.slice(d)+k,g=`
|
|
192
|
+
`,v=!0):k===""?g===`
|
|
193
|
+
`?m+=`
|
|
194
|
+
`:g=`
|
|
195
|
+
`:(m+=g+k,g=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let b=u;b<l.length;++b)m+=`
|
|
196
|
+
`+l[b][0].slice(d);m[m.length-1]!==`
|
|
197
|
+
`&&(m+=`
|
|
198
|
+
`);break;default:m+=`
|
|
199
|
+
`}const j=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,j,j]}}function tde({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 l=0,u="",d=-1;for(let g=1;g<i.length;++g){const v=i[g];if(!u&&(v==="-"||v==="+"))u=v;else{const j=Number(v);!l&&j?l=j:d===-1&&(d=e+g)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let g=1;g<t.length;++g){const v=t[g];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 j=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",j);const b=v.source;b&&typeof b=="string"&&(m+=b.length)}}}return{mode:a,indent:l,chomp:u,comment:p,length:m}}function nde(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 l=1;l<t.length;l+=2)a.push([t[l],t[l+1]]);return a}function rde(e,t,n){const{offset:r,type:i,source:a,end:l}=e;let u,d;const f=(g,v,j)=>n(r+g,v,j);switch(i){case"scalar":u=it.PLAIN,d=ide(a,f);break;case"single-quoted-scalar":u=it.QUOTE_SINGLE,d=ade(a,f);break;case"double-quoted-scalar":u=it.QUOTE_DOUBLE,d=sde(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=Xh(l,p,t,n);return{value:d,type:u,comment:m.comment,range:[r,p,m.offset]}}function ide(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}`),bB(e)}function ade(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),bB(e.slice(1,-1)).replace(/''/g,"'")}function bB(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=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?a===`
|
|
202
|
+
`?i+=a:a=`
|
|
203
|
+
`:(i+=a+r[1],a=" "),l=n.lastIndex;const u=/[ \t]*(.*)/sy;return u.lastIndex=l,r=u.exec(e),i+a+(r?.[1]??"")}function sde(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:l}=ode(e,r);n+=a,r=l}else if(i==="\\"){let a=e[++r];const l=lde[a];if(l)n+=l;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 u={x:2,u:4,U:8}[a];n+=cde(e,r+1,u,t),r+=u}else{const u=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),n+=u}}else if(i===" "||i===" "){const a=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
|
|
208
|
+
`&&!(l==="\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 ode(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 lde={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function cde(e,t,n,r){const i=e.substr(t,n),l=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(l)){const u=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(l)}function wB(e,t,n,r){const{value:i,type:a,comment:l,range:u}=t.type==="block-scalar"?ede(e,t,r):rde(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[qa]:d?f=ude(e.schema,i,d,n,r):t.type==="scalar"?f=dde(e,i,t,r):f=e.schema[qa];let p;try{const m=f.resolve(i,g=>r(n??t,"TAG_RESOLVE_FAILED",g),e.options);p=Jt(m)?m:new it(m)}catch(m){const g=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",g),p=new it(i)}return p.range=u,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),l&&(p.comment=l),p}function ude(e,t,n,r,i){if(n==="!")return e[qa];const a=[];for(const u of e.tags)if(!u.collection&&u.tag===n)if(u.default&&u.test)a.push(u);else return u;for(const u of a)if(u.test?.test(t))return u;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[qa])}function dde({atKey:e,directives:t,schema:n},r,i,a){const l=n.tags.find(u=>(u.default===!0||e&&u.default==="key")&&u.test?.test(r))||n[qa];if(n.compat){const u=n.compat.find(d=>d.default&&d.test?.test(r))??n[qa];if(l.tag!==u.tag){const d=t.tagString(l.tag),f=t.tagString(u.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function fde(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 hde={composeNode:jB,composeEmptyNode:Qk};function jB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:l,anchor:u,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=pde(e,t,r),(u||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=wB(e,t,d,r),u&&(f.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=Jue(hde,e,t,n,r),u&&(f.anchor=u.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=Qk(e,t.offset,void 0,null,n,r),p=!1}}return u&&f.anchor===""&&r(u,"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),l&&(t.type==="scalar"&&t.source===""?f.comment=l:f.commentBefore=l),e.options.keepSourceTokens&&p&&(f.srcToken=t),f}function Qk(e,t,n,r,{spaceBefore:i,comment:a,anchor:l,tag:u,end:d},f){const p={type:"scalar",offset:fde(t,n,r),indent:-1,source:""},m=wB(e,p,u,f);return l&&(m.anchor=l.source.substring(1),m.anchor===""&&f(l,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),a&&(m.comment=a,m.range[2]=d),m}function pde({options:e},{offset:t,source:n,end:r},i){const a=new Mk(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 l=t+n.length,u=Xh(r,l,e.strict,i);return a.range=[t,l,u.offset],u.comment&&(a.comment=u.comment),a}function mde(e,t,{offset:n,start:r,value:i,end:a},l){const u=Object.assign({_directives:t},e),d=new nx(void 0,u),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=td(r,{indicator:"doc-start",next:i??a?.[0],offset:n,onError:l,parentIndent:0,startOnNewline:!0});p.found&&(d.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=i?jB(f,i,p,l):Qk(f,p.end,r,null,p,l);const m=d.contents.range[2],g=Xh(a,m,!1,l);return g.comment&&(d.comment=g.comment),d.range=[n,m,g.offset],d}function Bf(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 TT(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 gde{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const l=Bf(n);a?this.warnings.push(new Wue(l,r,i)):this.errors.push(new sg(l,r,i))},this.directives=new Pr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=TT(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(Tn(a)&&!a.flow&&a.items.length>0){let l=a.items[0];Dn(l)&&(l=l.key);const u=l.commentBefore;l.commentBefore=u?`${r}
|
|
219
|
+
${u}`:r}else{const l=a.commentBefore;a.commentBefore=l?`${r}
|
|
220
|
+
${l}`: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:TT(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=Bf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=mde(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 sg(Bf(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 sg(Bf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Xh(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 sg(Bf(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 nx(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 SB="\uFEFF",NB="",kB="",N1="";function yde(e){switch(e){case SB:return"byte-order-mark";case NB:return"doc-mode";case kB:return"flow-error-end";case N1: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 ra(e){switch(e){case void 0:case" ":case`
|
|
224
|
+
`:case"\r":case" ":return!0;default:return!1}}const RT=new Set("0123456789ABCDEFabcdef"),vde=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),og=new Set(",[]{}"),xde=new Set(` ,[]{}
|
|
225
|
+
\r `),Jw=e=>!e||xde.has(e);class bde{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==="...")&&ra(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]===SB&&(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 NB,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==="...")&&ra(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&&!ra(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===":")&&ra(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(Jw),"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("..."))&&ra(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield kB,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(Jw),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||ra(l)||l===",")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=>ra(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 l=this.buffer[a+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
|
|
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,l=this.buffer[a];l==="\r"&&(l=this.buffer[--a]);const u=a;for(;l===" ";)l=this.buffer[--a];if(l===`
|
|
237
|
+
`&&a>=this.pos&&a+1+n>u)t=a;else break}while(!0);return yield N1,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(ra(a)||t&&og.has(a))break;n=r}else if(ra(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&&og.has(a))break;if(i===`
|
|
240
|
+
`){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&og.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield N1,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(Jw))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ra(n)||t&&og.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(;!ra(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(vde.has(n))n=this.buffer[++t];else if(n==="%"&&RT.has(this.buffer[t+1])&&RT.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 wde{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 Co(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function DT(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 CB(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 lg(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 mu(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 MT(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Co(t.start,"explicit-key-ind")&&!Co(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,CB(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 jde{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 bde,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=yde(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"&&MT(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&&DT(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":{DT(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=lg(this.peek(2)),r=mu(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 l=[];for(let u=0;u<n.sep.length;++u){const d=n.sep[u];switch(d.type){case"newline":l.push(u);break;case"space":break;case"comment":d.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(a=n.sep.splice(l[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(Co(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(CB(n.key)&&!Co(n.sep,"newline")){const l=mu(n.start),u=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:l,key:u,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Co(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=mu(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):Co(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 l=this.flowScalar(this.type);i||n.value?(t.items.push({start:a,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Co(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(l);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||Co(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=lg(r),a=mu(i);MT(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const u={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}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=lg(t),r=mu(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=lg(t),r=mu(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 Sde(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new wde||null,prettyErrors:t}}function Nde(e,t={}){const{lineCounter:n,prettyErrors:r}=Sde(t),i=new jde(n?.addNewLine),a=new gde(t),l=Array.from(a.compose(i.parse(e)));if(r&&n)for(const u of l)u.errors.forEach(zT(e,n)),u.warnings.forEach(zT(e,n));return l.length>0?l:Object.assign([],{empty:!0},a.streamInfo())}function kde({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,l]=x.useState([]),[u,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),l([]),d([]);const p=Nde(t),m=[],g=[];for(let v=0;v<p.length;v++){const j=p[v];if(j.errors.length>0){m.push(`Document ${v+1}: ${j.errors[0]?.message}`);continue}const b=j.toJSON();if(!(!b||typeof b!="object"))try{const S=await EV(b);g.push(`Applied "${S.displayName||S.name}" (revision ${S.configRevision})`)}catch(S){m.push(`Document ${v+1}: ${S instanceof Error?S.message:String(S)}`)}}l(g),d(m),i(!1),g.length>0&&(vt({title:"YAML applied",detail:`Applied ${g.length} document${g.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return s.jsxs("section",{className:"mt-8",children:[s.jsx("div",{className:"page-section-divider"}),s.jsx("div",{className:"section-head mt-6",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Config as code"}),s.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Apply YAML"})]})}),s.jsxs("p",{className:"text-zinc-500 text-sm mb-3",children:["Paste a ",s.jsx("code",{className:"text-zinc-400",children:"canonry.yaml"})," config (multi-document YAML with ",s.jsx("code",{className:"text-zinc-400",children:"---"})," separators supported)."]}),s.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&&s.jsx("ul",{className:"mt-2 space-y-1",children:a.map((p,m)=>s.jsx("li",{className:"text-emerald-400 text-sm",children:p},m))}),u.length>0&&s.jsx("ul",{className:"mt-2 space-y-1",children:u.map((p,m)=>s.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),s.jsx("div",{className:"mt-3",children:s.jsx(be,{type:"button",disabled:!t.trim()||r,onClick:f,children:r?"Applying...":"Apply"})})]})}function Cde(){const{dashboard:e,isLoading:t,refetch:n}=wc();if(!e||t)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-28"}),s.jsx("div",{className:"skeleton-text-sm w-40"})]}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[s.jsx("div",{className:"p-3 border-b border-zinc-800/60 flex gap-8",children:["Name","Domain","Visibility","Last run","Country"].map(_=>s.jsx("div",{className:"skeleton-text-sm w-16"},_))}),[1,2,3].map(_=>s.jsxs("div",{className:"p-3 border-b border-zinc-800/40 flex gap-8 items-center",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsx("div",{className:"skeleton-text w-28"}),s.jsx("div",{className:"skeleton-text-sm w-16"})]}),s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton h-5 w-14 rounded-full"}),s.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),s.jsx("div",{className:"skeleton-text-sm w-8"})]},_))]})]});const r=e.projects,i=Qo(),[a,l]=x.useState(!1),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,j]=x.useState("US"),[b,S]=x.useState("en"),[k,E]=x.useState(!1),[C,A]=x.useState(null),P=u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),O=async()=>{if(!(!P||!m)){E(!0),A(null);try{const _=await Av(P,{displayName:f||u,canonicalDomain:m,country:v,language:b});vt({title:"Project created",detail:`${_.displayName||_.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${_.name}`,dedupeMode:"drop"}),n(),d(""),p(""),g(""),j("US"),S("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:_.id}})}catch(_){A(_ instanceof Error?_.message:"Failed to create project")}finally{E(!1)}}};return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Projects"}),s.jsxs("p",{className:"page-subtitle",children:[r.length," project",r.length!==1?"s":""," tracked"]})]}),s.jsx("div",{className:"page-header-right",children:s.jsxs(be,{type:"button",onClick:()=>l(_=>!_),children:[s.jsx(_2,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?s.jsxs($e,{className:"surface-card mb-6",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"New project"}),s.jsx("h2",{className:"text-sm font-medium text-zinc-200",children:"Create a new monitoring project"})]})}),s.jsxs("div",{className:"compact-stack mt-4",children:[s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-project-name",children:"Project name"}),s.jsx("input",{id:"new-project-name",className:"setup-input",type:"text",placeholder:"my-project",value:u,onChange:_=>d(_.target.value)}),P&&P!==u?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",P]}):null]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-display-name",children:"Display name"}),s.jsx("input",{id:"new-display-name",className:"setup-input",type:"text",placeholder:"My Project",value:f,onChange:_=>p(_.target.value)})]})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-domain",children:"Canonical domain"}),s.jsx("input",{id:"new-domain",className:"setup-input",type:"text",placeholder:"example.com",value:m,onChange:_=>g(_.target.value)})]}),s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-country",children:"Country"}),s.jsx("input",{id:"new-country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:v,onChange:_=>j(_.target.value.toUpperCase())})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"new-language",children:"Language"}),s.jsx("input",{id:"new-language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:b,onChange:_=>S(_.target.value.toLowerCase())})]})]})]}),C?s.jsx("p",{className:"text-rose-400 text-sm mt-3",children:C}):null,s.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[s.jsx(be,{type:"button",disabled:!P||!m||k,onClick:O,children:k?"Creating...":"Create project"}),s.jsx(be,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancel"})]})]}):null,r.length>0?s.jsx("div",{className:"data-table-wrapper",children:s.jsxs("table",{className:"data-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Visibility"}),s.jsx("th",{children:"Last run"}),s.jsx("th",{className:"text-right",children:"Country"})]})}),s.jsx("tbody",{children:r.map(_=>{const T=_.recentRuns[0];return s.jsxs("tr",{className:"cursor-pointer",onClick:()=>i({to:"/projects/$projectId",params:{projectId:_.project.id}}),children:[s.jsxs("td",{children:[s.jsx(Yt,{to:"/projects/$projectId",params:{projectId:_.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:_.project.displayName||_.project.name}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:_.project.name})]}),s.jsx("td",{className:"text-zinc-400",children:_.project.canonicalDomain}),s.jsx("td",{children:s.jsx(Xe,{tone:_.visibilitySummary.tone,children:_.visibilitySummary.value})}),s.jsx("td",{className:"text-zinc-500 text-sm",children:T?s.jsx(Mv,{status:T.status}):s.jsx("span",{className:"text-zinc-600",children:"No runs"})}),s.jsx("td",{className:"text-right text-zinc-500",children:_.project.country})]},_.project.id)})})]})}):a?null:s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h3",{children:"No projects yet"}),s.jsx("p",{className:"supporting-copy",children:"Create your first monitoring project to start tracking AI visibility."}),s.jsxs(be,{type:"button",onClick:()=>l(!0),children:[s.jsx(_2,{className:"size-4 mr-1.5"}),"Add project"]})]}),s.jsx(kde,{onApplied:()=>{n()}})]})}function k1({state:e,label:t}){return s.jsx(Xe,{tone:Rte(e),children:t??Tv(e)})}function AB({run:e}){const{openRun:t}=vd();return s.jsxs("article",{className:"run-row",children:[s.jsxs("div",{className:"run-row-main",children:[s.jsxs("div",{className:"run-row-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:e.summary}),s.jsxs("p",{className:"run-row-subtitle",children:[e.projectName,e.location?` · ${e.location}`:""," · ",e.kindLabel]})]}),s.jsx(Mv,{status:e.status})]}),s.jsx("p",{className:"run-row-detail",children:e.statusDetail})]}),s.jsxs("dl",{className:"run-row-meta",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:e.startedAt})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Duration"}),s.jsx("dd",{children:e.duration})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Trigger"}),s.jsx("dd",{children:e.triggerLabel})]})]}),s.jsx(be,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function Ade({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:l=!0,progress:u,providerCoverage:d}){const m=2*Math.PI*48,g=Number.parseInt(e,10),v=typeof u=="number"&&Number.isFinite(u)?Math.min(Math.max(u,0),100)/100:l&&!Number.isNaN(g)?Math.min(g/100,1):.5,j=m*(1-v);return s.jsxs("div",{className:"score-gauge",children:[s.jsxs("div",{className:"gauge-ring-wrapper",children:[s.jsxs("svg",{className:"gauge-ring",viewBox:"0 0 120 120","aria-hidden":"true",children:[s.jsx("circle",{className:"gauge-bg",cx:"60",cy:"60",r:48,strokeWidth:6}),s.jsx("circle",{className:`gauge-fill gauge-fill-${r}`,cx:"60",cy:"60",r:48,strokeWidth:6,strokeDasharray:m,strokeDashoffset:j,transform:"rotate(-90 60 60)"})]}),s.jsx("div",{className:"gauge-center",children:s.jsx("span",{className:l?"gauge-value":"gauge-value-text",children:e.split(" / ")[0]})})]}),s.jsxs("p",{className:"gauge-label",children:[t,a&&s.jsx(pr,{text:a})]}),s.jsx("p",{className:"gauge-delta",children:n}),d&&s.jsx("p",{className:"gauge-provider-coverage",children:d}),s.jsx("p",{className:"gauge-description",children:i})]})}function IT({history:e,maxDots:t=12}){const n=e.slice(-t);if(n.length===0)return s.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 s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:i}),s.jsx("div",{className:"flex items-center gap-[3px]",title:`${n.length} runs`,children:n.map((l,u)=>s.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&u>0&&n[u-1]?.model&&n[u-1].model!==l.model?"ring-1 ring-amber-300/80 ring-offset-1 ring-offset-zinc-950":""}`,title:[l.citationState,new Date(l.createdAt).toLocaleDateString(),l.model?`model ${l.model}`:null,l.model&&u>0&&n[u-1]?.model&&n[u-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},u))}),s.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function Ode(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 LT(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 $T(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 BT(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 l=0;for(let u=e.length-1;u>=0&&e[u].citationState===i;u--)l++;return i==="cited"?l<=1?`${r} in latest run`:`${r} for ${l} runs`:l<=1?`Not ${n} in latest run`:`Not ${n} across ${l} runs`}function Ede(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:LT(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:LT(r,t)}))}))}function _de({evidence:e}){const{openEvidence:t}=vd(),[n,r]=x.useState(new Set),[i,a]=x.useState("citations"),l=x.useMemo(()=>{const m=Ede(e,i),g=new Map;for(const v of m){const j=g.get(v.query)??[];g.set(v.query,[...j,v])}return[...g.entries()].map(([v,j])=>({phrase:v,items:j}))},[e,i]),u=m=>{r(g=>{const v=new Set(g);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 s.jsxs("div",{children:[s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"View by"}),s.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:[s.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"}),s.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"})]}),s.jsx("span",{className:"text-[11px] text-zinc-500",children:i==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"})]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:{width:"2rem"}}),s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Status"}),s.jsx("th",{children:f}),s.jsx("th",{children:"Change"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:l.map(({phrase:m,items:g})=>{const v=n.has(m),j=g.map(C=>C.citationState),b=j.includes("cited")?"cited":j.includes("emerging")?"emerging":j.includes("lost")?"lost":j.every(C=>C==="pending")?"pending":"not-cited",S=Ode(g),k=g.filter(C=>C.citationState===Ju.cited||C.citationState==="emerging").length,E=BT(S,i);return s.jsxs(x.Fragment,{children:[s.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>u(m),"aria-expanded":v,children:[s.jsx("td",{children:s.jsx(Hh,{size:14,className:`transition-transform duration-150 text-zinc-500 ${v?"rotate-90":""}`})}),s.jsx("td",{className:"evidence-query-cell",children:s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-zinc-100",children:m}),s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:g.map(C=>s.jsx(nc,{provider:C.provider},C.id))})]})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(k1,{state:b,label:$T(b,i)}),s.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${k} of ${g.length} engines ${p}`,children:[k,"/",g.length]})]})}),s.jsx("td",{children:s.jsx(IT,{history:S})}),s.jsx("td",{className:"evidence-change-cell",children:E}),s.jsx("td",{})]}),v&&g.map(C=>s.jsxs("tr",{className:"bg-zinc-900/30",children:[s.jsx("td",{}),s.jsx("td",{className:"evidence-query-cell pl-5",children:s.jsx(nc,{provider:C.provider})}),s.jsx("td",{children:s.jsx(k1,{state:C.citationState,label:$T(C.citationState,i)})}),s.jsx("td",{children:s.jsx(IT,{history:C.runHistory})}),s.jsx("td",{className:"evidence-change-cell",children:BT(C.runHistory,i)}),s.jsx("td",{children:s.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:A=>{A.stopPropagation(),t(C.id)},children:"View"})})]},C.id))]},m)})})]})}),s.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",d==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function zde({competitors:e}){return e.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."}):s.jsx("div",{className:"competitor-table-wrap",children:s.jsxs("table",{className:"competitor-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Pressure"}),s.jsx("th",{children:"Citations"}),s.jsx("th",{children:"Queries"})]})}),s.jsx("tbody",{children:e.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:t.domain}),s.jsx("td",{children:s.jsx(Xe,{tone:Dte(t.pressureLabel),children:t.pressureLabel})}),s.jsx("td",{className:"text-zinc-300 tabular-nums",children:t.totalQueries>0?`${t.citationCount} / ${t.totalQueries}`:"—"}),s.jsx("td",{className:"text-zinc-500 text-xs",children:t.citedQueries.length>0?t.citedQueries.join(", "):"Not cited"})]},t.id))})]})})}function UT({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:l,note:u,updatedAt:d,active:f,onClick:p}){return s.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:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:e}),s.jsx("h3",{children:t})]}),s.jsx(Xe,{tone:r,children:n})]}),s.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:i}),s.jsx("p",{className:"mt-1 truncate text-sm text-zinc-200",children:a})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Coverage"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:l})]})]}),s.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:[s.jsx("span",{children:u}),s.jsx("span",{children:d?`Updated ${aa(d)}`:"No recent sync yet"})]})]})}function cg({label:e,value:t,tone:n}){const r=n==="positive"?"text-emerald-400":n==="negative"?"text-rose-400":"text-zinc-200";return s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:e}),s.jsx("p",{className:`mt-2 text-2xl font-semibold ${r}`,children:t})]})}var Pde=["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 Wk(e){if(typeof e!="string")return!1;var t=Pde;return t.includes(e)}var Tde=["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"],Rde=new Set(Tde);function OB(e){return typeof e!="string"?!1:Rde.has(e)}function EB(e){return typeof e=="string"&&e.startsWith("data-")}function gi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(OB(n)||EB(n))&&(t[n]=e[n]);return t}function Jh(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return gi(t)}return typeof e=="object"&&!Array.isArray(e)?gi(e):null}function kr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(OB(n)||EB(n)||Wk(n))&&(t[n]=e[n]);return t}function Dde(e){return e==null?null:x.isValidElement(e)?kr(e.props):typeof e=="object"&&!Array.isArray(e)?kr(e):null}var Mde=["children","width","height","viewBox","className","style","title","desc"];function C1(){return C1=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},C1.apply(null,arguments)}function Ide(e,t){if(e==null)return{};var n,r,i=Lde(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 Lde(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 Yk=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:u,title:d,desc:f}=e,p=Ide(e,Mde),m=a||{width:r,height:i,x:0,y:0},g=Ot("recharts-surface",l);return x.createElement("svg",C1({},kr(p),{className:g,width:r,height:i,style:u,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)}),$de=["children","className"];function A1(){return A1=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},A1.apply(null,arguments)}function Bde(e,t){if(e==null)return{};var n,r,i=Ude(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 Ude(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 gr=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=Bde(e,$de),a=Ot("recharts-layer",r);return x.createElement("g",A1({className:a},kr(i),{ref:t}),n)}),_B=x.createContext(null),qde=()=>x.useContext(_B);function Zt(e){return function(){return e}}const zB=Math.cos,xy=Math.sin,ya=Math.sqrt,by=Math.PI,rx=2*by,O1=Math.PI,E1=2*O1,zl=1e-6,Fde=E1-zl;function PB(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Hde(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return PB;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 Kde{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?PB:Hde(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,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}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 l=this._x1,u=this._y1,d=r-t,f=i-n,p=l-t,m=u-n,g=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>zl)if(!(Math.abs(m*d-f*p)>zl)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,j=i-u,b=d*d+f*f,S=v*v+j*j,k=Math.sqrt(b),E=Math.sqrt(g),C=a*Math.tan((O1-Math.acos((b+g-S)/(2*k*E)))/2),A=C/E,P=C/k;Math.abs(A-1)>zl&&this._append`L${t+A*p},${n+A*m}`,this._append`A${a},${a},0,0,${+(m*v>p*j)},${this._x1=t+P*d},${this._y1=n+P*f}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),f=t+u,p=n+d,m=1^l,g=l?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>zl||Math.abs(this._y1-p)>zl)&&this._append`L${f},${p}`,r&&(g<0&&(g=g%E1+E1),g>Fde?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:g>zl&&this._append`A${r},${r},0,${+(g>=O1)},${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 Zk(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 Kde(t)}function Xk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TB(e){this._context=e}TB.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 ix(e){return new TB(e)}function RB(e){return e[0]}function DB(e){return e[1]}function MB(e,t){var n=Zt(!0),r=null,i=ix,a=null,l=Zk(u);e=typeof e=="function"?e:e===void 0?RB:Zt(e),t=typeof t=="function"?t:t===void 0?DB:Zt(t);function u(d){var f,p=(d=Xk(d)).length,m,g=!1,v;for(r==null&&(a=i(v=l())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Zt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Zt(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:Zt(!!d),u):n},u.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),u):i},u.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),u):r},u}function ug(e,t,n){var r=null,i=Zt(!0),a=null,l=ix,u=null,d=Zk(f);e=typeof e=="function"?e:e===void 0?RB:Zt(+e),t=typeof t=="function"?t:Zt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?DB:Zt(+n);function f(m){var g,v,j,b=(m=Xk(m)).length,S,k=!1,E,C=new Array(b),A=new Array(b);for(a==null&&(u=l(E=d())),g=0;g<=b;++g){if(!(g<b&&i(S=m[g],g,m))===k)if(k=!k)v=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),j=g-1;j>=v;--j)u.point(C[j],A[j]);u.lineEnd(),u.areaEnd()}k&&(C[g]=+e(S,g,m),A[g]=+t(S,g,m),u.point(r?+r(S,g,m):C[g],n?+n(S,g,m):A[g]))}if(E)return u=null,E+""||null}function p(){return MB().defined(i).curve(l).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?(l=m,a!=null&&(u=l(a)),f):l},f.context=function(m){return arguments.length?(m==null?a=u=null:u=l(a=m),f):a},f}class IB{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 Gde(e){return new IB(e,!0)}function Vde(e){return new IB(e,!1)}const Jk={draw(e,t){const n=ya(t/by);e.moveTo(n,0),e.arc(0,0,n,0,rx)}},Qde={draw(e,t){const n=ya(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()}},LB=ya(1/3),Wde=LB*2,Yde={draw(e,t){const n=ya(t/Wde),r=n*LB;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Zde={draw(e,t){const n=ya(t),r=-n/2;e.rect(r,r,n,n)}},Xde=.8908130915292852,$B=xy(by/10)/xy(7*by/10),Jde=xy(rx/10)*$B,efe=-zB(rx/10)*$B,tfe={draw(e,t){const n=ya(t*Xde),r=Jde*n,i=efe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=rx*a/5,u=zB(l),d=xy(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},ej=ya(3),nfe={draw(e,t){const n=-ya(t/(ej*3));e.moveTo(0,n*2),e.lineTo(-ej*n,-n),e.lineTo(ej*n,-n),e.closePath()}},Ti=-.5,Ri=ya(3)/2,_1=1/ya(12),rfe=(_1/2+1)*3,ife={draw(e,t){const n=ya(t/rfe),r=n/2,i=n*_1,a=r,l=n*_1+n,u=-a,d=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(u,d),e.lineTo(Ti*r-Ri*i,Ri*r+Ti*i),e.lineTo(Ti*a-Ri*l,Ri*a+Ti*l),e.lineTo(Ti*u-Ri*d,Ri*u+Ti*d),e.lineTo(Ti*r+Ri*i,Ti*i-Ri*r),e.lineTo(Ti*a+Ri*l,Ti*l-Ri*a),e.lineTo(Ti*u+Ri*d,Ti*d-Ri*u),e.closePath()}};function afe(e,t){let n=null,r=Zk(i);e=typeof e=="function"?e:Zt(e||Jk),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 wy(){}function jy(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 BB(e){this._context=e}BB.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:jy(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:jy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function sfe(e){return new BB(e)}function UB(e){this._context=e}UB.prototype={areaStart:wy,areaEnd:wy,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:jy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ofe(e){return new UB(e)}function qB(e){this._context=e}qB.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:jy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lfe(e){return new qB(e)}function FB(e){this._context=e}FB.prototype={areaStart:wy,areaEnd:wy,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 cfe(e){return new FB(e)}function qT(e){return e<0?-1:1}function FT(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),u=(a*i+l*r)/(r+i);return(qT(a)+qT(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(u))||0}function HT(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function tj(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,l-u*n,a,l)}function Sy(e){this._context=e}Sy.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:tj(this,this._t0,HT(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,tj(this,HT(this,n=FT(this,e,t)),n);break;default:tj(this,this._t0,n=FT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function HB(e){this._context=new KB(e)}(HB.prototype=Object.create(Sy.prototype)).point=function(e,t){Sy.prototype.point.call(this,t,e)};function KB(e){this._context=e}KB.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 ufe(e){return new Sy(e)}function dfe(e){return new HB(e)}function GB(e){this._context=e}GB.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=KT(e),i=KT(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(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 KT(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[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 ffe(e){return new GB(e)}function ax(e,t){this._context=e,this._t=t}ax.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 hfe(e){return new ax(e,.5)}function pfe(e){return new ax(e,0)}function mfe(e){return new ax(e,1)}function ac(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,u=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<u;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function z1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function gfe(e,t){return e[t]}function yfe(e){const t=[];return t.key=e,t}function vfe(){var e=Zt([]),t=z1,n=ac,r=gfe;function i(a){var l=Array.from(e.apply(this,arguments),yfe),u,d=l.length,f=-1,p;for(const m of a)for(u=0,++f;u<d;++u)(l[u][f]=[0,+r(m,l[u].key,f,a)]).data=m;for(u=0,p=Xk(t(l));u<d;++u)l[p[u]].index=u;return n(l,p),l}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?z1:typeof a=="function"?a:Zt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??ac,i):n},i}function xfe(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}ac(e,t)}}function bfe(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,u=0;l<i;++l)u+=e[l][n][1]||0;r[n][1]+=r[n][0]=-u/2}ac(e,t)}}function wfe(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var u=0,d=0,f=0;u<l;++u){for(var p=e[t[u]],m=p[r][1]||0,g=p[r-1][1]||0,v=(m-g)/2,j=0;j<u;++j){var b=e[t[j]],S=b[r][1]||0,k=b[r-1][1]||0;v+=S-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,ac(e,t)}}var nj={},rj={},GT;function jfe(){return GT||(GT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(rj)),rj}var ij={},VT;function VB(){return VT||(VT=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})(ij)),ij}var aj={},QT;function eC(){return QT||(QT=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})(aj)),aj}var sj={},oj={},WT;function Sfe(){return WT||(WT=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})(oj)),oj}var YT;function tC(){return YT||(YT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sfe(),n=eC();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],l=i.length;if(l===0)return a;let u=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<l;){const m=i[u];f?m==="\\"&&u+1<l?(u++,d+=i[u]):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,u++}return d&&a.push(d),a}e.toPath=r})(sj)),sj}var ZT;function nC(){return ZT||(ZT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jfe(),n=VB(),r=eC(),i=tC();function a(u,d,f){if(u==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?n.isDeepKey(d)?a(u,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=u[d];return p===void 0?f:p}default:{if(Array.isArray(d))return l(u,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=u[d];return p===void 0?f:p}}}function l(u,d,f){if(d.length===0)return f;let p=u;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})(nj)),nj}var lj,XT;function Nfe(){return XT||(XT=1,lj=nC().get),lj}var kfe=Nfe();const nd=pa(kfe);var Cfe=4;function Ro(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Cfe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function kn(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,l)=>{var u=n[l-1];return typeof u=="string"?i+u+a:u!==void 0?i+Ro(u)+a:i+a},"")}var Wr=e=>e===0?0:e>0?1:-1,da=e=>typeof e=="number"&&e!=+e,sc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Pe=e=>(typeof e=="number"||e instanceof Number)&&!da(e),Fa=e=>Pe(e)||typeof e=="string",Afe=0,Ah=e=>{var t=++Afe;return"".concat(e||"").concat(t)},fa=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(!Pe(t)&&typeof t!="string")return r;var a;if(sc(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return da(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},QB=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 Ft(e,t,n){return Pe(e)&&Pe(t)?Ro(e+n*(t-e)):t}function WB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):nd(r,t))===n)}var on=e=>e===null||typeof e>"u",ep=e=>on(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Yr(e){return e!=null}function Jo(){}var Ofe=["type","size","sizeType"];function P1(){return P1=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},P1.apply(null,arguments)}function JT(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 eR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JT(Object(n),!0).forEach(function(r){Efe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Efe(e,t,n){return(t=_fe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _fe(e){var t=zfe(e,"string");return typeof t=="symbol"?t:t+""}function zfe(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 Pfe(e,t){if(e==null)return{};var n,r,i=Tfe(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 Tfe(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 YB={symbolCircle:Jk,symbolCross:Qde,symbolDiamond:Yde,symbolSquare:Zde,symbolStar:tfe,symbolTriangle:nfe,symbolWye:ife},Rfe=Math.PI/180,Dfe=e=>{var t="symbol".concat(ep(e));return YB[t]||Jk},Mfe=(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*Rfe;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}},Ife=(e,t)=>{YB["symbol".concat(ep(e))]=t},rC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Pfe(e,Ofe),a=eR(eR({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var g=Dfe(l),v=afe().type(g).size(Mfe(n,r,l)),j=v();if(j!==null)return j},{className:d,cx:f,cy:p}=a,m=kr(a);return Pe(f)&&Pe(p)&&Pe(n)?x.createElement("path",P1({},m,{className:Ot("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:u()})):null};rC.registerSymbol=Ife;var ZB=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,iC=(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=>{Wk(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},Lfe=(e,t,n)=>r=>(e(t,n,r),null),sx=(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];Wk(i)&&typeof a=="function"&&(r||(r={}),r[i]=Lfe(a,t,n))}),r};function tR(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 $fe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tR(Object(n),!0).forEach(function(r){Bfe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bfe(e,t,n){return(t=Ufe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ufe(e){var t=qfe(e,"string");return typeof t=="symbol"?t:t+""}function qfe(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=$fe({},e),r=t,i=Object.keys(t),a=i.reduce((l,u)=>(l[u]===void 0&&r[u]!==void 0&&(l[u]=r[u]),l),n);return a}function Ny(){return Ny=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},Ny.apply(null,arguments)}function nR(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 XB(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nR(Object(n),!0).forEach(function(r){Ffe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ffe(e,t,n){return(t=Hfe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hfe(e){var t=Kfe(e,"string");return typeof t=="symbol"?t:t+""}function Kfe(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 Mi=32,Gfe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function Vfe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function Qfe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Mi/2,a=Mi/6,l=Mi/3,u=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:u,strokeDasharray:Vfe(t.payload),x1:0,y1:i,x2:Mi,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(l,`
|
|
255
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
|
|
256
|
+
H`).concat(Mi,"M").concat(2*l,",").concat(i,`
|
|
257
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(d==="rect")return x.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(Mi/8,"h").concat(Mi,"v").concat(Mi*3/4,"h").concat(-Mi,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=XB({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(rC,{fill:u,cx:i,cy:i,size:Mi,sizeType:"diameter",type:d})}function Wfe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:l,labelStyle:u}=e,d={x:0,y:0,width:Mi,height:Mi},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,g)=>{var v=m.formatter||i,j=Ot({"recharts-legend-item":!0,["legend-item-".concat(g)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof u=="object"?XB({},u):{};b.color=m.inactive?a:b.color||m.color;var S=v?v(m.value,m,g):m.value;return x.createElement("li",Ny({className:j,style:f,key:"legend-item-".concat(g)},sx(e,m,g)),x.createElement(Yk,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(Qfe,{data:m,iconType:l,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},S))})}var Yfe=e=>{var t=tr(e,Gfe),{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(Wfe,Ny({},t,{payload:n})))},cj={},uj={},rR;function Zfe(){return rR||(rR=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 l=n[a],u=r(l,a,n);i.has(u)||i.set(u,l)}return Array.from(i.values())}e.uniqBy=t})(uj)),uj}var dj={},iR;function Xfe(){return iR||(iR=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})(dj)),dj}var fj={},aR;function JB(){return aR||(aR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(fj)),fj}var hj={},pj={},mj={},sR;function Jfe(){return sR||(sR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(mj)),mj}var oR;function e6(){return oR||(oR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jfe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(pj)),pj}var gj={},lR;function ehe(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(gj)),gj}var cR;function the(){return cR||(cR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=e6(),n=ehe();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(hj)),hj}var yj={},vj={},uR;function nhe(){return uR||(uR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nC();function n(r){return function(i){return t.get(i,r)}}e.property=n})(vj)),vj}var xj={},bj={},wj={},jj={},dR;function t6(){return dR||(dR=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})(jj)),jj}var Sj={},fR;function n6(){return fR||(fR=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})(Sj)),Sj}var Nj={},hR;function r6(){return hR||(hR=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})(Nj)),Nj}var pR;function rhe(){return pR||(pR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=t6(),n=n6(),r=r6();function i(p,m,g){return typeof g!="function"?i(p,m,()=>{}):a(p,m,function v(j,b,S,k,E,C){const A=g(j,b,S,k,E,C);return A!==void 0?!!A:a(j,b,v,C)},new Map)}function a(p,m,g,v){if(m===p)return!0;switch(typeof m){case"object":return l(p,m,g,v);case"function":return Object.keys(m).length>0?a(p,{...m},g,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function l(p,m,g,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,g,v);if(m instanceof Map)return u(p,m,g,v);if(m instanceof Set)return f(p,m,g,v);const j=Object.keys(m);if(p==null||n.isPrimitive(p))return j.length===0;if(j.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let b=0;b<j.length;b++){const S=j[b];if(!n.isPrimitive(p)&&!(S in p)||m[S]===void 0&&p[S]!==void 0||m[S]===null&&p[S]!==null||!g(p[S],m[S],S,p,m,v))return!1}return!0}finally{v?.delete(m)}}function u(p,m,g,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[j,b]of m.entries()){const S=p.get(j);if(g(S,b,j,p,m,v)===!1)return!1}return!0}function d(p,m,g,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const j=new Set;for(let b=0;b<m.length;b++){const S=m[b];let k=!1;for(let E=0;E<p.length;E++){if(j.has(E))continue;const C=p[E];let A=!1;if(g(C,S,b,p,m,v)&&(A=!0),A){j.add(E),k=!0;break}}if(!k)return!1}return!0}function f(p,m,g,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],g,v):!1}e.isMatchWith=i,e.isSetMatch=f})(wj)),wj}var mR;function i6(){return mR||(mR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rhe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(bj)),bj}var kj={},Cj={},Aj={},gR;function ihe(){return gR||(gR=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})(Aj)),Aj}var Oj={},yR;function aC(){return yR||(yR=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})(Oj)),Oj}var Ej={},vR;function a6(){return vR||(vR=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]",l="[object Symbol]",u="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",g="[object ArrayBuffer]",v="[object Object]",j="[object Error]",b="[object DataView]",S="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",C="[object Uint32Array]",A="[object BigUint64Array]",P="[object Int8Array]",O="[object Int16Array]",_="[object Int32Array]",T="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=p,e.bigInt64ArrayTag=T,e.bigUint64ArrayTag=A,e.booleanTag=i,e.dataViewTag=b,e.dateTag=u,e.errorTag=j,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=O,e.int32ArrayTag=_,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=f,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=E,e.uint32ArrayTag=C,e.uint8ArrayTag=S,e.uint8ClampedArrayTag=k})(Ej)),Ej}var _j={},xR;function ahe(){return xR||(xR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(_j)),_j}var bR;function s6(){return bR||(bR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ihe(),n=aC(),r=a6(),i=n6(),a=ahe();function l(p,m){return u(p,void 0,p,new Map,m)}function u(p,m,g,v=new Map,j=void 0){const b=j?.(p,m,g,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 S=new Array(p.length);v.set(p,S);for(let k=0;k<p.length;k++)S[k]=u(p[k],k,g,v,j);return Object.hasOwn(p,"index")&&(S.index=p.index),Object.hasOwn(p,"input")&&(S.input=p.input),S}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const S=new RegExp(p.source,p.flags);return S.lastIndex=p.lastIndex,S}if(p instanceof Map){const S=new Map;v.set(p,S);for(const[k,E]of p)S.set(k,u(E,k,g,v,j));return S}if(p instanceof Set){const S=new Set;v.set(p,S);for(const k of p)S.add(u(k,void 0,g,v,j));return S}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const S=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,S);for(let k=0;k<p.length;k++)S[k]=u(p[k],k,g,v,j);return S}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const S=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,S),d(S,p,g,v,j),S}if(typeof File<"u"&&p instanceof File){const S=new File([p],p.name,{type:p.type});return v.set(p,S),d(S,p,g,v,j),S}if(typeof Blob<"u"&&p instanceof Blob){const S=new Blob([p],{type:p.type});return v.set(p,S),d(S,p,g,v,j),S}if(p instanceof Error){const S=structuredClone(p);return v.set(p,S),S.message=p.message,S.name=p.name,S.stack=p.stack,S.cause=p.cause,S.constructor=p.constructor,d(S,p,g,v,j),S}if(p instanceof Boolean){const S=new Boolean(p.valueOf());return v.set(p,S),d(S,p,g,v,j),S}if(p instanceof Number){const S=new Number(p.valueOf());return v.set(p,S),d(S,p,g,v,j),S}if(p instanceof String){const S=new String(p.valueOf());return v.set(p,S),d(S,p,g,v,j),S}if(typeof p=="object"&&f(p)){const S=Object.create(Object.getPrototypeOf(p));return v.set(p,S),d(S,p,g,v,j),S}return p}function d(p,m,g=p,v,j){const b=[...Object.keys(m),...t.getSymbols(m)];for(let S=0;S<b.length;S++){const k=b[S],E=Object.getOwnPropertyDescriptor(p,k);(E==null||E.writable)&&(p[k]=u(m[k],k,g,v,j))}}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=l,e.cloneDeepWithImpl=u,e.copyProperties=d})(Cj)),Cj}var wR;function she(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=s6();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(kj)),kj}var jR;function ohe(){return jR||(jR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=i6(),n=she();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(xj)),xj}var zj={},Pj={},Tj={},SR;function lhe(){return SR||(SR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=s6(),n=aC(),r=a6();function i(a,l){return t.cloneDeepWith(a,(u,d,f,p)=>{const m=l?.(u,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return p.set(a,g),t.copyProperties(g,a,f,p),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a?.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(Tj)),Tj}var NR;function che(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lhe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(Pj)),Pj}var Rj={},Dj={},kR;function o6(){return kR||(kR=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})(Dj)),Dj}var Mj={},CR;function uhe(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(Mj)),Mj}var AR;function dhe(){return AR||(AR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VB(),n=o6(),r=uhe(),i=tC();function a(l,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&l?.[u]==null?d=i.toPath(u):d=[u],d.length===0)return!1;let f=l;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})(Rj)),Rj}var OR;function fhe(){return OR||(OR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=i6(),n=eC(),r=che(),i=nC(),a=dhe();function l(u,d){switch(typeof u){case"object":{Object.is(u?.valueOf(),-0)&&(u="-0");break}case"number":{u=n.toKey(u);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,u);return p===void 0?a.has(f,u):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=l})(zj)),zj}var ER;function hhe(){return ER||(ER=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JB(),n=nhe(),r=ohe(),i=fhe();function a(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=a})(yj)),yj}var _R;function phe(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zfe(),n=Xfe(),r=JB(),i=the(),a=hhe();function l(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=l})(cj)),cj}var Ij,zR;function mhe(){return zR||(zR=1,Ij=phe().uniqBy),Ij}var ghe=mhe();const PR=pa(ghe);function l6(e,t,n){return t===!0?PR(e,n):typeof t=="function"?PR(e,t):e}var sC=x.createContext(null),yhe=e=>e,ln=()=>{var e=x.useContext(sC);return e?e.store.dispatch:yhe},qg=()=>{},vhe=()=>qg,xhe=(e,t)=>e===t;function Ue(e){var t=x.useContext(sC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:qg,[t,e]);return w5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:vhe,t?t.store.getState:qg,t?t.store.getState:qg,n,xhe)}function bhe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function whe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function jhe(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 TR=e=>Array.isArray(e)?e:[e];function She(e){const t=Array.isArray(e[0])?e[0]:e;return jhe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Nhe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var khe=class{constructor(e){this.value=e}deref(){return this.value}},Che=typeof WeakRef<"u"?WeakRef:khe,Ahe=0,RR=1;function dg(){return{s:Ahe,v:void 0,o:null,p:null}}function c6(e,t={}){let n=dg();const{resultEqualityCheck:r}=t;let i,a=0;function l(){let u=n;const{length:d}=arguments;for(let m=0,g=d;m<g;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let j=u.o;j===null&&(u.o=j=new WeakMap);const b=j.get(v);b===void 0?(u=dg(),j.set(v,u)):u=b}else{let j=u.p;j===null&&(u.p=j=new Map);const b=j.get(v);b===void 0?(u=dg(),j.set(v,u)):u=b}}const f=u;let p;if(u.s===RR)p=u.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 Che(p):p}return f.s=RR,f.v=p,p}return l.clearCache=()=>{n=dg(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function Ohe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,u,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),bhe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:g=[],argsMemoize:v=c6,argsMemoizeOptions:j=[]}=p,b=TR(g),S=TR(j),k=She(i),E=m(function(){return a++,f.apply(null,arguments)},...b),C=v(function(){l++;const P=Nhe(k,arguments);return u=E.apply(null,P),u},...S);return Object.assign(C,{resultFunc:f,memoizedResultFunc:E,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var re=Ohe(c6),Ehe=Object.assign((e,t=re)=>{whe(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((l,u,d)=>(l[n[d]]=u,l),{}))},{withTypes:()=>Ehe}),Lj={},$j={},Bj={},DR;function _he(){return DR||(DR=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 l=t(r),u=t(i);if(l===u&&l===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-l:l-u}return 0};e.compareValues=n})(Bj)),Bj}var Uj={},qj={},MR;function u6(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(qj)),qj}var IR;function zhe(){return IR||(IR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u6(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,l){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))||l!=null&&Object.hasOwn(l,a)}e.isKey=i})(Uj)),Uj}var LR;function Phe(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_he(),n=zhe(),r=tC();function i(a,l,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const f=(v,j)=>{let b=v;for(let S=0;S<j.length&&b!=null;++S)b=b[j[S]];return b},p=(v,j)=>j==null||v==null?j:typeof v=="object"&&"key"in v?Object.hasOwn(j,v.key)?j[v.key]:f(j,v.path):typeof v=="function"?v(j):Array.isArray(v)?f(j,v):typeof j=="object"?j[v]:j,m=l.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(j=>p(j,v))})).slice().sort((v,j)=>{for(let b=0;b<m.length;b++){const S=t.compareValues(v.criteria[b],j.criteria[b],u[b]);if(S!==0)return S}return 0}).map(v=>v.original)}e.orderBy=i})($j)),$j}var Fj={},$R;function The(){return $R||($R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),l=(u,d)=>{for(let f=0;f<u.length;f++){const p=u[f];Array.isArray(p)&&d<a?l(p,d+1):i.push(p)}};return l(n,0),i}e.flatten=t})(Fj)),Fj}var Hj={},BR;function d6(){return BR||(BR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o6(),n=e6(),r=t6(),i=r6();function a(l,u,d){return r.isObject(d)&&(typeof u=="number"&&n.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.isEqualsSameValueZero(d[u],l):!1}e.isIterateeCall=a})(Hj)),Hj}var UR;function Rhe(){return UR||(UR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Phe(),n=The(),r=d6();function i(a,...l){const u=l.length;return u>1&&r.isIterateeCall(a,l[0],l[1])?l=[]:u>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(a,n.flatten(l),["asc"])}e.sortBy=i})(Lj)),Lj}var Kj,qR;function Dhe(){return qR||(qR=1,Kj=Rhe().sortBy),Kj}var Mhe=Dhe();const ox=pa(Mhe);var f6=e=>e.legend.settings,Ihe=e=>e.legend.size,Lhe=e=>e.legend.payload,$he=re([Lhe,f6],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?ox(r,n):r});function Bhe(){return Ue($he)}var fg=1;function h6(){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(),l={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(l.height-t.height)>fg||Math.abs(l.left-t.left)>fg||Math.abs(l.top-t.top)>fg||Math.abs(l.width-t.width)>fg)&&n({height:l.height,left:l.left,top:l.top,width:l.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 Uhe=typeof Symbol=="function"&&Symbol.observable||"@@observable",FR=Uhe,Gj=()=>Math.random().toString(36).substring(7).split("").join("."),qhe={INIT:`@@redux/INIT${Gj()}`,REPLACE:`@@redux/REPLACE${Gj()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Gj()}`},ky=qhe;function oC(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 p6(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(p6)(e,t)}let r=e,i=t,a=new Map,l=a,u=0,d=!1;function f(){l===a&&(l=new Map,a.forEach((S,k)=>{l.set(k,S)}))}function p(){if(d)throw new Error(dr(3));return i}function m(S){if(typeof S!="function")throw new Error(dr(4));if(d)throw new Error(dr(5));let k=!0;f();const E=u++;return l.set(E,S),function(){if(k){if(d)throw new Error(dr(6));k=!1,f(),l.delete(E),a=null}}}function g(S){if(!oC(S))throw new Error(dr(7));if(typeof S.type>"u")throw new Error(dr(8));if(typeof S.type!="string")throw new Error(dr(17));if(d)throw new Error(dr(9));try{d=!0,i=r(i,S)}finally{d=!1}return(a=l).forEach(E=>{E()}),S}function v(S){if(typeof S!="function")throw new Error(dr(10));r=S,g({type:ky.REPLACE})}function j(){const S=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(dr(11));function E(){const A=k;A.next&&A.next(p())}return E(),{unsubscribe:S(E)}},[FR](){return this}}}return g({type:ky.INIT}),{dispatch:g,subscribe:m,getState:p,replaceReducer:v,[FR]:j}}function Fhe(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:ky.INIT})>"u")throw new Error(dr(12));if(typeof n(void 0,{type:ky.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(dr(13))})}function m6(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{Fhe(n)}catch(a){i=a}return function(l={},u){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],g=n[m],v=l[m],j=g(v,u);if(typeof j>"u")throw u&&u.type,new Error(dr(14));f[m]=j,d=d||j!==v}return d=d||r.length!==Object.keys(l).length,d?f:l}}function Cy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Hhe(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(dr(15))};const l={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},u=e.map(d=>d(l));return a=Cy(...u)(i.dispatch),{...i,dispatch:a}}}function g6(e){return oC(e)&&"type"in e&&typeof e.type=="string"}var y6=Symbol.for("immer-nothing"),HR=Symbol.for("immer-draftable"),Ir=Symbol.for("immer-state");function sa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var pi=Object,rd=pi.getPrototypeOf,Ay="constructor",lx="prototype",T1="configurable",Oy="enumerable",Fg="writable",Oh="value",zs=e=>!!e&&!!e[Ir];function ha(e){return e?v6(e)||ux(e)||!!e[HR]||!!e[Ay]?.[HR]||dx(e)||fx(e):!1}var Khe=pi[lx][Ay].toString(),KR=new WeakMap;function v6(e){if(!e||!lC(e))return!1;const t=rd(e);if(t===null||t===pi[lx])return!0;const n=pi.hasOwnProperty.call(t,Ay)&&t[Ay];if(n===Object)return!0;if(!Cu(n))return!1;let r=KR.get(n);return r===void 0&&(r=Function.toString.call(n),KR.set(n,r)),r===Khe}function cx(e,t,n=!0){tp(e)===0?(n?Reflect.ownKeys(e):pi.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function tp(e){const t=e[Ir];return t?t.type_:ux(e)?1:dx(e)?2:fx(e)?3:0}var GR=(e,t,n=tp(e))=>n===2?e.has(t):pi[lx].hasOwnProperty.call(e,t),R1=(e,t,n=tp(e))=>n===2?e.get(t):e[t],Ey=(e,t,n,r=tp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Ghe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ux=Array.isArray,dx=e=>e instanceof Map,fx=e=>e instanceof Set,lC=e=>typeof e=="object",Cu=e=>typeof e=="function",Vj=e=>typeof e=="boolean";function Vhe(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var bs=e=>e.copy_||e.base_,cC=e=>e.modified_?e.copy_:e.base_;function D1(e,t){if(dx(e))return new Map(e);if(fx(e))return new Set(e);if(ux(e))return Array[lx].slice.call(e);const n=v6(e);if(t===!0||t==="class_only"&&!n){const r=pi.getOwnPropertyDescriptors(e);delete r[Ir];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u[Fg]===!1&&(u[Fg]=!0,u[T1]=!0),(u.get||u.set)&&(r[l]={[T1]:!0,[Fg]:!0,[Oy]:u[Oy],[Oh]:e[l]})}return pi.create(rd(e),r)}else{const r=rd(e);if(r!==null&&n)return{...e};const i=pi.create(r);return pi.assign(i,e)}}function uC(e,t=!1){return hx(e)||zs(e)||!ha(e)||(tp(e)>1&&pi.defineProperties(e,{set:hg,add:hg,clear:hg,delete:hg}),pi.freeze(e),t&&cx(e,(n,r)=>{uC(r,!0)},!1)),e}function Qhe(){sa(2)}var hg={[Oh]:Qhe};function hx(e){return e===null||!lC(e)?!0:pi.isFrozen(e)}var _y="MapSet",M1="Patches",VR="ArrayMethods",x6={};function oc(e){const t=x6[e];return t||sa(0,e),t}var QR=e=>!!x6[e],Eh,b6=()=>Eh,Whe=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:QR(_y)?oc(_y):void 0,arrayMethodsPlugin_:QR(VR)?oc(VR):void 0});function WR(e,t){t&&(e.patchPlugin_=oc(M1),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function I1(e){L1(e),e.drafts_.forEach(Yhe),e.drafts_=null}function L1(e){e===Eh&&(Eh=e.parent_)}var YR=e=>Eh=Whe(Eh,e);function Yhe(e){const t=e[Ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ZR(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ir].modified_&&(I1(t),sa(4)),ha(e)&&(e=XR(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Ir].base_,e,t)}else e=XR(t,n);return Zhe(t,e,!0),I1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==y6?e:void 0}function XR(e,t){if(hx(t))return t;const n=t[Ir];if(!n)return zy(t,e.handledSet_,e);if(!px(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);S6(n,e)}return n.copy_}function Zhe(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&uC(t,n)}function w6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var px=(e,t)=>e.scope_===t,Xhe=[];function j6(e,t,n,r){const i=bs(e),a=e.type_;if(r!==void 0&&R1(i,r,a)===t){Ey(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;cx(i,(d,f)=>{if(zs(f)){const p=u.get(f)||[];p.push(d),u.set(f,p)}})}const l=e.draftLocations_.get(t)??Xhe;for(const u of l)Ey(i,u,n,a)}function Jhe(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!px(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=cC(a);j6(e,a.draft_??a,l,n),S6(a,i)})}function S6(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)}w6(e)}}function epe(e,t,n){const{scope_:r}=e;if(zs(n)){const i=n[Ir];px(i,r)&&i.callbacks_.push(function(){Hg(e);const l=cC(i);j6(e,n,l,t)})}else ha(n)&&e.callbacks_.push(function(){const a=bs(e);e.type_===3?a.has(n)&&zy(n,r.handledSet_,r):R1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&zy(R1(e.copy_,t,e.type_),r.handledSet_,r)})}function zy(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||zs(e)||t.has(e)||!ha(e)||hx(e)||(t.add(e),cx(e,(r,i)=>{if(zs(i)){const a=i[Ir];if(px(a,n)){const l=cC(a);Ey(e,r,l,e.type_),w6(a)}}else ha(i)&&zy(i,t,n)})),e}function tpe(e,t){const n=ux(e),r={type_:n?1:0,scope_:t?t.scope_:b6(),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=Py;n&&(i=[r],a=_h);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,[u,r]}var Py={get(e,t){if(t===Ir)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=bs(e);if(!GR(i,t,e.type_))return npe(e,i,t);const a=i[t];if(e.finalized_||!ha(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Vhe(t))return a;if(a===Qj(e.base_,t)){Hg(e);const l=e.type_===1?+t:t,u=B1(e.scope_,a,e,l);return e.copy_[l]=u}return a},has(e,t){return t in bs(e)},ownKeys(e){return Reflect.ownKeys(bs(e))},set(e,t,n){const r=N6(bs(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Qj(bs(e),t),a=i?.[Ir];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Ghe(n,i)&&(n!==void 0||GR(e.base_,t,e.type_)))return!0;Hg(e),$1(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),epe(e,t,n)),!0},deleteProperty(e,t){return Hg(e),Qj(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),$1(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=bs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Fg]:!0,[T1]:e.type_!==1||t!=="length",[Oy]:r[Oy],[Oh]:n[t]}},defineProperty(){sa(11)},getPrototypeOf(e){return rd(e.base_)},setPrototypeOf(){sa(12)}},_h={};for(let e in Py){let t=Py[e];_h[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}_h.deleteProperty=function(e,t){return _h.set.call(this,e,t,void 0)};_h.set=function(e,t,n){return Py.set.call(this,e[0],t,n,e[0])};function Qj(e,t){const n=e[Ir];return(n?bs(n):e)[t]}function npe(e,t,n){const r=N6(t,n);return r?Oh in r?r[Oh]:r.get?.call(e.draft_):void 0}function N6(e,t){if(!(t in e))return;let n=rd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=rd(n)}}function $1(e){e.modified_||(e.modified_=!0,e.parent_&&$1(e.parent_))}function Hg(e){e.copy_||(e.assigned_=new Map,e.copy_=D1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var rpe=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Cu(n)&&!Cu(r)){const l=r;r=n;const u=this;return function(f=l,...p){return u.produce(f,m=>r.call(this,m,...p))}}Cu(r)||sa(6),i!==void 0&&!Cu(i)&&sa(7);let a;if(ha(n)){const l=YR(this),u=B1(l,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?I1(l):L1(l)}return WR(l,i),ZR(a,l)}else if(!n||!lC(n)){if(a=r(n),a===void 0&&(a=n),a===y6&&(a=void 0),this.autoFreeze_&&uC(a,!0),i){const l=[],u=[];oc(M1).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:u}),i(l,u)}return a}else sa(1,n)},this.produceWithPatches=(n,r)=>{if(Cu(n))return(u,...d)=>this.produceWithPatches(u,f=>n(f,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},Vj(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Vj(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Vj(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){ha(t)||sa(8),zs(t)&&(t=Ui(t));const n=YR(this),r=B1(n,t,void 0);return r[Ir].isManual_=!0,L1(n),r}finishDraft(t,n){const r=t&&t[Ir];(!r||!r.isManual_)&&sa(9);const{scope_:i}=r;return WR(i,n),ZR(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=oc(M1).applyPatches_;return zs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function B1(e,t,n,r){const[i,a]=dx(t)?oc(_y).proxyMap_(t,n):fx(t)?oc(_y).proxySet_(t,n):tpe(t,n);return(n?.scope_??b6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?Jhe(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 Ui(e){return zs(e)||sa(10,e),k6(e)}function k6(e){if(!ha(e)||hx(e))return e;const t=e[Ir];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=D1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=D1(e,!0);return cx(n,(i,a)=>{Ey(n,i,k6(a))},r),t&&(t.finalized_=!1),n}var ipe=new rpe,C6=ipe.produce;function A6(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var ape=A6(),spe=A6,ope=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Cy:Cy.apply(null,arguments)};function yi(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(mi(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=>g6(r)&&r.type===e,n}var O6=class th extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,th.prototype)}static get[Symbol.species](){return th}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new th(...t[0].concat(this)):new th(...t.concat(this))}};function JR(e){return ha(e)?C6(e,()=>{}):e}function pg(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function lpe(e){return typeof e=="boolean"}var cpe=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new O6;return n&&(lpe(n)?l.push(ape):l.push(spe(n.extraArgument))),l},E6="RTK_autoBatch",an=()=>e=>({payload:e,meta:{[E6]:!0}}),eD=e=>t=>{setTimeout(t,e)},_6=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:eD(10):e.type==="callback"?e.queueNotification:eD(e.timeout),f=()=>{l=!1,a&&(a=!1,u.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),g=r.subscribe(m);return u.add(p),()=>{g(),u.delete(p)}},dispatch(p){try{return i=!p?.meta?.[E6],a=!i,a&&(l||(l=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},upe=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new O6(e);return r&&i.push(_6(typeof r=="object"?r:void 0)),i};function dpe(e){const t=cpe(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(oC(n))u=m6(n);else throw new Error(mi(1));let d;typeof r=="function"?d=r(t):d=t();let f=Cy;i&&(f=ope({trace:!1,...typeof i=="object"&&i}));const p=Hhe(...d),m=upe(p);let g=typeof l=="function"?l(m):m();const v=f(...g);return p6(u,a,v)}function z6(e){const t={},n=[];let r;const i={addCase(a,l){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(mi(28));if(u in t)throw new Error(mi(29));return t[u]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function fpe(e){return typeof e=="function"}function hpe(e,t){let[n,r,i]=z6(t),a;if(fpe(e))a=()=>JR(e());else{const u=JR(e);a=()=>u}function l(u=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(zs(p)){const v=m(p,d);return v===void 0?p:v}else{if(ha(p))return C6(p,g=>m(g,d));{const g=m(p,d);if(g===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return p},u)}return l.getInitialState=a,l}var ppe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",mpe=(e=21)=>{let t="",n=e;for(;n--;)t+=ppe[Math.random()*64|0];return t},gpe=Symbol.for("rtk-slice-createasyncthunk");function ype(e,t){return`${e}/${t}`}function vpe({creators:e}={}){const t=e?.asyncThunk?.[gpe];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(mi(11));const l=(typeof r.reducers=="function"?r.reducers(bpe()):r.reducers)||{},u=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(C,A){const P=typeof C=="string"?C:C.type;if(!P)throw new Error(mi(12));if(P in d.sliceCaseReducersByType)throw new Error(mi(13));return d.sliceCaseReducersByType[P]=A,f},addMatcher(C,A){return d.sliceMatchers.push({matcher:C,reducer:A}),f},exposeAction(C,A){return d.actionCreators[C]=A,f},exposeCaseReducer(C,A){return d.sliceCaseReducersByName[C]=A,f}};u.forEach(C=>{const A=l[C],P={reducerName:C,type:ype(i,C),createNotation:typeof r.reducers=="function"};jpe(A)?Npe(P,A,f,t):wpe(P,A,f)});function p(){const[C={},A=[],P=void 0]=typeof r.extraReducers=="function"?z6(r.extraReducers):[r.extraReducers],O={...C,...d.sliceCaseReducersByType};return hpe(r.initialState,_=>{for(let T in O)_.addCase(T,O[T]);for(let T of d.sliceMatchers)_.addMatcher(T.matcher,T.reducer);for(let T of A)_.addMatcher(T.matcher,T.reducer);P&&_.addDefaultCase(P)})}const m=C=>C,g=new Map,v=new WeakMap;let j;function b(C,A){return j||(j=p()),j(C,A)}function S(){return j||(j=p()),j.getInitialState()}function k(C,A=!1){function P(_){let T=_[C];return typeof T>"u"&&A&&(T=pg(v,P,S)),T}function O(_=m){const T=pg(g,A,()=>new WeakMap);return pg(T,_,()=>{const $={};for(const[F,U]of Object.entries(r.selectors??{}))$[F]=xpe(U,_,()=>pg(v,_,S),A);return $})}return{reducerPath:C,getSelectors:O,get selectors(){return O(P)},selectSlice:P}}const E={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:S,...k(a),injectInto(C,{reducerPath:A,...P}={}){const O=A??a;return C.inject({reducerPath:O,reducer:b},P),{...E,...k(O,!0)}}};return E}}function xpe(e,t,n,r){function i(a,...l){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...l)}return i.unwrapped=e,i}var Or=vpe();function bpe(){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 wpe({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!Spe(r))throw new Error(mi(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?yi(e,l):yi(e))}function jpe(e){return e._reducerDefinitionType==="asyncThunk"}function Spe(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Npe({type:e,reducerName:t},n,r,i){if(!i)throw new Error(mi(18));const{payloadCreator:a,fulfilled:l,pending:u,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),l&&r.addCase(m.fulfilled,l),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:l||mg,pending:u||mg,rejected:d||mg,settled:f||mg})}function mg(){}var kpe="task",P6="listener",T6="completed",dC="cancelled",Cpe=`task-${dC}`,Ape=`task-${T6}`,U1=`${P6}-${dC}`,Ope=`${P6}-${T6}`,mx=class{constructor(e){this.code=e,this.message=`${kpe} ${dC} (reason: ${e})`}name="TaskAbortError";message},fC=(e,t)=>{if(typeof e!="function")throw new TypeError(mi(32))},Ty=()=>{},R6=(e,t=Ty)=>(e.catch(t),e),D6=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ql=e=>{if(e.aborted)throw new mx(e.reason)};function M6(e,t){let n=Ty;return new Promise((r,i)=>{const a=()=>i(new mx(e.reason));if(e.aborted){a();return}n=D6(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Ty})}var Epe=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof mx?"cancelled":"rejected",error:n}}finally{t?.()}},Ry=e=>t=>R6(M6(e,t).then(n=>(Ql(e),n))),I6=e=>{const t=Ry(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Fu}=Object,tD={},gx="listenerMiddleware",_pe=(e,t)=>{const n=r=>D6(e,()=>r.abort(e.reason));return(r,i)=>{fC(r);const a=new AbortController;n(a);const l=Epe(async()=>{Ql(e),Ql(a.signal);const u=await r({pause:Ry(a.signal),delay:I6(a.signal),signal:a.signal});return Ql(a.signal),u},()=>a.abort(Ape));return i?.autoJoin&&t.push(l.catch(Ty)),{result:Ry(e)(l),cancel(){a.abort(Cpe)}}}},zpe=(e,t)=>{const n=async(r,i)=>{Ql(t);let a=()=>{};const u=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,g)=>{g.unsubscribe(),d([m,g.getState(),g.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await M6(t,Promise.race(u));return Ql(t),d}finally{a()}};return(r,i)=>R6(n(r,i))},L6=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=yi(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(mi(21));return fC(a),{predicate:i,type:t,effect:a}},$6=Fu(e=>{const{type:t,predicate:n,effect:r}=L6(e);return{id:mpe(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(mi(22))}}},{withTypes:()=>$6}),nD=(e,t)=>{const{type:n,effect:r,predicate:i}=L6(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},q1=e=>{e.pending.forEach(t=>{t.abort(U1)})},Ppe=(e,t)=>()=>{for(const n of t.keys())q1(n);e.clear()},rD=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},B6=Fu(yi(`${gx}/add`),{withTypes:()=>B6}),Tpe=yi(`${gx}/removeAll`),U6=Fu(yi(`${gx}/remove`),{withTypes:()=>U6}),Rpe=(...e)=>{console.error(`${gx}/error`,...e)},np=(e={})=>{const t=new Map,n=new Map,r=v=>{const j=n.get(v)??0;n.set(v,j+1)},i=v=>{const j=n.get(v)??1;j===1?n.delete(v):n.set(v,j-1)},{extra:a,onError:l=Rpe}=e;fC(l);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),j=>{v.unsubscribe(),j?.cancelActive&&q1(v)}),d=v=>{const j=nD(t,v)??$6(v);return u(j)};Fu(d,{withTypes:()=>d});const f=v=>{const j=nD(t,v);return j&&(j.unsubscribe(),v.cancelActive&&q1(j)),!!j};Fu(f,{withTypes:()=>f});const p=async(v,j,b,S)=>{const k=new AbortController,E=zpe(d,k.signal),C=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(j,Fu({},b,{getOriginalState:S,condition:(A,P)=>E(A,P).then(Boolean),take:E,delay:I6(k.signal),pause:Ry(k.signal),extra:a,signal:k.signal,fork:_pe(k.signal,C),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,P,O)=>{A!==k&&(A.abort(U1),O.delete(A))})},cancel:()=>{k.abort(U1),v.pending.delete(k)},throwIfCancelled:()=>{Ql(k.signal)}})))}catch(A){A instanceof mx||rD(l,A,{raisedBy:"effect"})}finally{await Promise.all(C),k.abort(Ope),i(v),v.pending.delete(k)}},m=Ppe(t,n);return{middleware:v=>j=>b=>{if(!g6(b))return j(b);if(B6.match(b))return d(b.payload);if(Tpe.match(b)){m();return}if(U6.match(b))return f(b.payload);let S=v.getState();const k=()=>{if(S===tD)throw new Error(mi(23));return S};let E;try{if(E=j(b),t.size>0){const C=v.getState(),A=Array.from(t.values());for(const P of A){let O=!1;try{O=P.predicate(b,C,S)}catch(_){O=!1,rD(l,_,{raisedBy:"predicate"})}O&&p(P,b,v,k)}}}finally{S=tD}return E},startListening:d,stopListening:f,clearListeners:m}};function mi(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 Dpe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},q6=Or({name:"chartLayout",initialState:Dpe,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:Mpe,setLayout:Ipe,setChartSize:Lpe,setScale:$pe}=q6.actions,Bpe=q6.reducer;function F6(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ht(e){return Number.isFinite(e)}function Ha(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}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 Pu(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){Upe(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 Upe(e,t,n){return(t=qpe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qpe(e){var t=Fpe(e,"string");return typeof t=="symbol"?t:t+""}function Fpe(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 vn(e,t,n){return on(e)||on(t)?n:Fa(t)?nd(e,t,n):typeof t=="function"?t(e):n}var Hpe=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&a!=="center"&&Pe(e[a]))return Pu(Pu({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&l!=="middle"&&Pe(e[l]))return Pu(Pu({},e),{},{[l]:e[l]+(i||0)})}return e},va=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",H6=(e,t,n,r)=>{if(r)return e.map(u=>u.coordinate);var i,a,l=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===n&&(a=!0),u.coordinate));return i||l.push(t),a||l.push(n),l},K6=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:l,realScaleType:u,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:g,axisType:v}=e;if(!l)return null;var j=u==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,b=i==="category"&&l.bandwidth?l.bandwidth()/j:0;if(b=v==="angleAxis"&&a&&a.length>=2?Wr(a[0]-a[1])*2*b:b,m||g){var S=(m||g||[]).map((k,E)=>{var C=r?r.indexOf(k):k,A=l.map(C);return ht(A)?{coordinate:A+b,value:k,offset:b,index:E}:null}).filter(Yr);return S}return d&&f?f.map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):l.ticks&&p!=null?l.ticks(p).map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:k,index:E,offset:b}:null}).filter(Yr):l.domain().map((k,E)=>{var C=l.map(k);return ht(C)?{coordinate:C+b,value:r?r[k]:k,index:E,offset:b}:null}).filter(Yr)},Kpe=(e,t)=>{if(!t||t.length!==2||!Pe(t[0])||!Pe(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(!Pe(e[0])||e[0]<n)&&(i[0]=n),(!Pe(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Gpe=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,l=0,u=0;u<n;++u){var d=e[u],f=d?.[i];if(f!=null){var p=f[1],m=f[0],g=da(p)?m:p;g>=0?(f[0]=a,a+=g,f[1]=a):(f[0]=l,l+=g,f[1]=l)}}}},Vpe=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,l=0;l<n;++l){var u=e[l],d=u?.[i];if(d!=null){var f=da(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},Qpe={sign:Gpe,expand:xfe,none:ac,silhouette:bfe,wiggle:wfe,positive:Vpe},Wpe=(e,t,n)=>{var r,i=(r=Qpe[n])!==null&&r!==void 0?r:ac,a=vfe().keys(t).value((u,d)=>Number(vn(u,d,0))).order(z1).offset(i),l=a(e);return l.forEach((u,d)=>{u.forEach((f,p)=>{var m=vn(e[p],t[d],0);Array.isArray(m)&&m.length===2&&Pe(m[0])&&Pe(m[1])&&(f[0]=m[0],f[1]=m[1])})}),l};function G6(e){return e==null?void 0:String(e)}function Dy(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!on(i[t.dataKey])){var u=WB(n,"value",i[t.dataKey]);if(u)return u.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=vn(i,on(l)?t.dataKey:l),f=t.scale.map(d);return Pe(f)?f:null}var aD=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var u=vn(a,t.dataKey,t.scale.domain()[l]);if(on(u))return null;var d=t.scale.map(u);return Pe(d)?d-i/2+r:null},Ype=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]},Zpe=e=>{var t=e.flat(2).filter(Pe);return[Math.min(...t),Math.max(...t)]},Xpe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Jpe=(e,t,n)=>{if(e!=null)return Xpe(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,u=l.reduce((d,f)=>{var p=F6(f,t,n),m=Zpe(p);return!ht(m[0])||!ht(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},sD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,oD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ko=(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=ox(t,p=>p.coordinate),a=1/0,l=1,u=i.length;l<u;l++){var d=i[l],f=i[l-1];a=Math.min((d?.coordinate||0)-(f?.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0};function lD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Pu(Pu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function kd(e,t){if(e)return String(e);if(typeof t=="string")return t}var eme=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},tme=(e,t)=>t==="centric"?e.angle:e.radius,$s=e=>e.layout.width,Bs=e=>e.layout.height,nme=e=>e.layout.scale,V6=e=>e.layout.margin,yx=re(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),vx=re(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),rme="data-recharts-item-index",ime="data-recharts-item-id",rp=60;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 gg(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){ame(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 ame(e,t,n){return(t=sme(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sme(e){var t=ome(e,"string");return typeof t=="symbol"?t:t+""}function ome(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 lme=e=>e.brush.height;function cme(e){var t=vx(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:rp;return n+i}return n},0)}function ume(e){var t=vx(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:rp;return n+i}return n},0)}function dme(e){var t=yx(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function fme(e){var t=yx(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var nr=re([$s,Bs,V6,lme,cme,ume,dme,fme,f6,Ihe],(e,t,n,r,i,a,l,u,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+l,bottom:(n.bottom||0)+u},g=gg(gg({},m),p),v=g.bottom;g.bottom+=r,g=Hpe(g,d,f);var j=e-g.left-g.right,b=t-g.top-g.bottom;return gg(gg({brushBottom:v},g),{},{width:Math.max(j,0),height:Math.max(b,0)})}),hme=re(nr,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),hC=re($s,Bs,(e,t)=>({x:0,y:0,width:e,height:t})),pme=x.createContext(null),rr=()=>x.useContext(pme)!=null,xx=e=>e.brush,bx=re([xx,nr,V6],(e,t,n)=>({height:e.height,x:Pe(e.x)?e.x:t.left,y:Pe(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:Pe(e.width)?e.width:t.width})),Wj={},Yj={},Zj={},uD;function mme(){return uD||(uD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let l,u=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{u!==null&&(n.apply(l,u),l=void 0,u=null)},m=()=>{f&&p(),b()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,m()},r)},j=()=>{g!==null&&(clearTimeout(g),g=null)},b=()=>{j(),l=void 0,u=null},S=()=>{p()},k=function(...E){if(i?.aborted)return;l=this,u=E;const C=g==null;v(),d&&C&&p()};return k.schedule=v,k.cancel=b,k.flush=S,i?.addEventListener("abort",b,{once:!0}),k}e.debounce=t})(Zj)),Zj}var dD;function gme(){return dD||(dD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mme();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:u=!0,maxWait:d}=a,f=Array(2);l&&(f[0]="leading"),u&&(f[1]="trailing");let p,m=null;const g=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(),g.cancel(),g.schedule(),p):(g.apply(this,b),p)},j=()=>(g.flush(),p);return v.cancel=g.cancel,v.flush=j,v}e.debounce=n})(Yj)),Yj}var fD;function yme(){return fD||(fD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gme();function n(r,i=0,a={}){const{leading:l=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:l,maxWait:i,trailing:u})}e.throttle=n})(Wj)),Wj}var Xj,hD;function vme(){return hD||(hD=1,Xj=yme().throttle),Xj}var xme=vme();const bme=pa(xme);var My=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 l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},Ma={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Q6=(e,t,n)=>{var{width:r=Ma.width,height:i=Ma.height,aspect:a,maxHeight:l}=n,u=sc(r)?e:Number(r),d=sc(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:u,calculatedHeight:d}},wme={width:0,height:0,overflow:"visible"},jme={width:0,overflowX:"visible"},Sme={height:0,overflowY:"visible"},Nme={},kme=e=>{var{width:t,height:n}=e,r=sc(t),i=sc(n);return r&&i?wme:r?jme:i?Sme:Nme};function Cme(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ma.width,a=Ma.height):i===void 0?i=r&&r>0?void 0:Ma.width:a===void 0&&(a=r&&r>0?void 0:Ma.height),{width:i,height:a}}function F1(){return F1=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},F1.apply(null,arguments)}function pD(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?pD(Object(n),!0).forEach(function(r){Ame(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ame(e,t,n){return(t=Ome(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ome(e){var t=Eme(e,"string");return typeof t=="symbol"?t:t+""}function Eme(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 W6=x.createContext(Ma.initialDimension);function _me(e){return Ha(e.width)&&Ha(e.height)}function Y6(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return _me(i)?x.createElement(W6.Provider,{value:i},t):null}var pC=()=>x.useContext(W6),zme=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ma.initialDimension,width:i,height:a,minWidth:l=Ma.minWidth,minHeight:u,maxHeight:d,children:f,debounce:p=Ma.debounce,id:m,className:g,onResize:v,style:j={}}=e,b=x.useRef(null),S=x.useRef();S.current=v,x.useImperativeHandle(t,()=>b.current);var[k,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),C=x.useCallback((T,$)=>{E(F=>{var U=Math.round(T),B=Math.round($);return F.containerWidth===U&&F.containerHeight===B?F:{containerWidth:U,containerHeight:B}})},[]);x.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return Jo;var T=B=>{var V,X=B[0];if(X!=null){var{width:Z,height:H}=X.contentRect;C(Z,H),(V=S.current)===null||V===void 0||V.call(S,Z,H)}};p>0&&(T=bme(T,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(T),{width:F,height:U}=b.current.getBoundingClientRect();return C(F,U),$.observe(b.current),()=>{$.disconnect()}},[C,p]);var{containerWidth:A,containerHeight:P}=k;My(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:O,calculatedHeight:_}=Q6(A,P,{width:i,height:a,aspect:n,maxHeight:d});return My(O!=null&&O>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.`,O,_,i,a,l,u,n),x.createElement("div",{id:m?"".concat(m):void 0,className:Ot("recharts-responsive-container",g),style:mD(mD({},j),{},{width:i,height:a,minWidth:l,minHeight:u,maxHeight:d}),ref:b},x.createElement("div",{style:kme({width:i,height:a})},x.createElement(Y6,{width:O,height:_},f)))}),Ps=x.forwardRef((e,t)=>{var n=pC();if(Ha(n.width)&&Ha(n.height))return e.children;var{width:r,height:i}=Cme({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=Q6(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Pe(a)&&Pe(l)?x.createElement(Y6,{width:a,height:l},e.children):x.createElement(zme,F1({},e,{width:r,height:i,ref:t}))});function mC(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 wx=()=>{var e,t=rr(),n=Ue(hme),r=Ue(bx),i=(e=Ue(xx))===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}},Pme={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Z6=()=>{var e;return(e=Ue(nr))!==null&&e!==void 0?e:Pme},gC=()=>Ue($s),yC=()=>Ue(Bs),Tme=()=>Ue(e=>e.layout.margin),_t=e=>e.layout.layoutType,el=()=>Ue(_t),vC=()=>{var e=el();if(e==="horizontal"||e==="vertical")return e},X6=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Rme=()=>{var e=el();return e!==void 0},ip=e=>{var t=ln(),n=rr(),{width:r,height:i}=e,a=pC(),l=r,u=i;return a&&(l=a.width>0?a.width:r,u=a.height>0?a.height:i),x.useEffect(()=>{!n&&Ha(l)&&Ha(u)&&t(Lpe({width:l,height:u}))},[t,n,l,u]),null},J6=Symbol.for("immer-nothing"),gD=Symbol.for("immer-draftable"),vi=Symbol.for("immer-state");function oa(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zh=Object.getPrototypeOf;function id(e){return!!e&&!!e[vi]}function lc(e){return e?eU(e)||Array.isArray(e)||!!e[gD]||!!e.constructor?.[gD]||ap(e)||Sx(e):!1}var Dme=Object.prototype.constructor.toString(),yD=new WeakMap;function eU(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=yD.get(n);return r===void 0&&(r=Function.toString.call(n),yD.set(n,r)),r===Dme}function Iy(e,t,n=!0){jx(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 jx(e){const t=e[vi];return t?t.type_:Array.isArray(e)?1:ap(e)?2:Sx(e)?3:0}function H1(e,t){return jx(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tU(e,t,n){const r=jx(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Mme(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ap(e){return e instanceof Map}function Sx(e){return e instanceof Set}function Pl(e){return e.copy_||e.base_}function K1(e,t){if(ap(e))return new Map(e);if(Sx(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=eU(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[vi];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(zh(e),r)}else{const r=zh(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function xC(e,t=!1){return Nx(e)||id(e)||!lc(e)||(jx(e)>1&&Object.defineProperties(e,{set:yg,add:yg,clear:yg,delete:yg}),Object.freeze(e),t&&Object.values(e).forEach(n=>xC(n,!0))),e}function Ime(){oa(2)}var yg={value:Ime};function Nx(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Lme={};function cc(e){const t=Lme[e];return t||oa(0,e),t}var Ph;function nU(){return Ph}function $me(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vD(e,t){t&&(cc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function G1(e){V1(e),e.drafts_.forEach(Bme),e.drafts_=null}function V1(e){e===Ph&&(Ph=e.parent_)}function xD(e){return Ph=$me(Ph,e)}function Bme(e){const t=e[vi];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[vi].modified_&&(G1(t),oa(4)),lc(e)&&(e=Ly(t,e),t.parent_||$y(t,e)),t.patches_&&cc("Patches").generateReplacementPatches_(n[vi].base_,e,t.patches_,t.inversePatches_)):e=Ly(t,n,[]),G1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==J6?e:void 0}function Ly(e,t,n){if(Nx(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[vi];if(!i)return Iy(t,(a,l)=>wD(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return $y(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,u=!1;i.type_===3&&(l=new Set(a),a.clear(),u=!0),Iy(l,(d,f)=>wD(e,i,a,d,f,n,u),r),$y(e,a,!1),n&&e.patches_&&cc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function wD(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const u=Nx(i);if(!(u&&!l)){if(id(i)){const d=a&&t&&t.type_!==3&&!H1(t.assigned_,r)?a.concat(r):void 0,f=Ly(e,i,d);if(tU(n,r,f),id(f))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(lc(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Ly(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(ap(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&$y(e,i)}}}function $y(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&xC(t,n)}function Ume(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:nU(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=bC;n&&(i=[r],a=Th);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,u}var bC={get(e,t){if(t===vi)return e;const n=Pl(e);if(!H1(n,t))return qme(e,n,t);const r=n[t];return e.finalized_||!lc(r)?r:r===Jj(e.base_,t)?(eS(e),e.copy_[t]=W1(r,e)):r},has(e,t){return t in Pl(e)},ownKeys(e){return Reflect.ownKeys(Pl(e))},set(e,t,n){const r=rU(Pl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Jj(Pl(e),t),a=i?.[vi];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Mme(n,i)&&(n!==void 0||H1(e.base_,t)))return!0;eS(e),Q1(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 Jj(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,eS(e),Q1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Pl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){oa(11)},getPrototypeOf(e){return zh(e.base_)},setPrototypeOf(){oa(12)}},Th={};Iy(bC,(e,t)=>{Th[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Th.deleteProperty=function(e,t){return Th.set.call(this,e,t,void 0)};Th.set=function(e,t,n){return bC.set.call(this,e[0],t,n,e[0])};function Jj(e,t){const n=e[vi];return(n?Pl(n):e)[t]}function qme(e,t,n){const r=rU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function rU(e,t){if(!(t in e))return;let n=zh(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=zh(n)}}function Q1(e){e.modified_||(e.modified_=!0,e.parent_&&Q1(e.parent_))}function eS(e){e.copy_||(e.copy_=K1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Fme=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 l=this;return function(d=a,...f){return l.produce(d,p=>n.call(this,p,...f))}}typeof n!="function"&&oa(6),r!==void 0&&typeof r!="function"&&oa(7);let i;if(lc(t)){const a=xD(this),l=W1(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?G1(a):V1(a)}return vD(a,r),bD(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===J6&&(i=void 0),this.autoFreeze_&&xC(i,!0),r){const a=[],l=[];cc("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else oa(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,d=>t(d,...u));let r,i;return[this.produce(t,n,(l,u)=>{r=l,i=u}),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){lc(e)||oa(8),id(e)&&(e=Hme(e));const t=xD(this),n=W1(e,void 0);return n[vi].isManual_=!0,V1(t),n}finishDraft(e,t){const n=e&&e[vi];(!n||!n.isManual_)&&oa(9);const{scope_:r}=n;return vD(r,t),bD(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=cc("Patches").applyPatches_;return id(e)?r(e,t):this.produce(e,i=>r(i,t))}};function W1(e,t){const n=ap(e)?cc("MapSet").proxyMap_(e,t):Sx(e)?cc("MapSet").proxySet_(e,t):Ume(e,t);return(t?t.scope_:nU()).drafts_.push(n),n}function Hme(e){return id(e)||oa(10,e),iU(e)}function iU(e){if(!lc(e)||Nx(e))return e;const t=e[vi];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=K1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=K1(e,!0);return Iy(n,(i,a)=>{tU(n,i,iU(a))},r),t&&(t.finalized_=!1),n}var Kme=new Fme;Kme.produce;var Gme={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},aU=Or({name:"legend",initialState:Gme,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=Ui(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:an()},removeLegendPayload:{reducer(e,t){var n=Ui(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:an()}}}),{setLegendSize:jD,setLegendSettings:Vme,addLegendPayload:Qme,replaceLegendPayload:Wme,removeLegendPayload:Yme}=aU.actions,Zme=aU.reducer,tS={exports:{}},nS={};var SD;function Xme(){if(SD)return nS;SD=1;var e=md();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,l=e.useMemo,u=e.useDebugValue;return nS.useSyncExternalStoreWithSelector=function(d,f,p,m,g){var v=i(null);if(v.current===null){var j={hasValue:!1,value:null};v.current=j}else j=v.current;v=l(function(){function S(P){if(!k){if(k=!0,E=P,P=m(P),g!==void 0&&j.hasValue){var O=j.value;if(g(O,P))return C=O}return C=P}if(O=C,n(E,P))return O;var _=m(P);return g!==void 0&&g(O,_)?(E=P,O):(E=P,C=_)}var k=!1,E,C,A=p===void 0?null:p;return[function(){return S(f())},A===null?void 0:function(){return S(A())}]},[f,p,m,g]);var b=r(d,v[0],v[1]);return a(function(){j.hasValue=!0,j.value=b},[b]),u(b),b},nS}var ND;function Jme(){return ND||(ND=1,tS.exports=Xme()),tS.exports}Jme();function ege(e){e()}function tge(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ege(()=>{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 kD={notify(){},get:()=>[]};function nge(e,t){let n,r=kD,i=0,a=!1;function l(b){p();const S=r.subscribe(b);let k=!1;return()=>{k||(k=!0,S(),m())}}function u(){r.notify()}function d(){j.onStateChange&&j.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=tge())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=kD)}function g(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const j={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:f,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return j}var rge=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ige=rge(),age=()=>typeof navigator<"u"&&navigator.product==="ReactNative",sge=age(),oge=()=>ige||sge?x.useLayoutEffect:x.useEffect,lge=oge();function CD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function cge(e,t){if(CD(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])||!CD(e[n[i]],t[n[i]]))return!1;return!0}var uge=Symbol.for("react-redux-context"),dge=typeof globalThis<"u"?globalThis:{};function fge(){if(!x.createContext)return{};const e=dge[uge]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var hge=fge();function pge(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=nge(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);lge(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,l]);const u=n||hge;return x.createElement(u.Provider,{value:a},t)}var mge=pge,gge=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function yge(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Nc(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(gge.has(r)){if(e[r]==null&&t[r]==null)continue;if(!cge(e[r],t[r]))return!1}else if(!yge(e[r],t[r]))return!1;return!0}var vge=["contextPayload"];function Y1(){return Y1=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},Y1.apply(null,arguments)}function AD(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 ad(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AD(Object(n),!0).forEach(function(r){xge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xge(e,t,n){return(t=bge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bge(e){var t=wge(e,"string");return typeof t=="symbol"?t:t+""}function wge(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 jge(e,t){if(e==null)return{};var n,r,i=Sge(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 Sge(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 Nge(e){return e.value}function kge(e){var{contextPayload:t}=e,n=jge(e,vge),r=l6(t,e.payloadUniqBy,Nge),i=ad(ad({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(Yfe,i)}function Cge(e,t,n,r,i,a){var{layout:l,align:u,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(u==="center"&&l==="vertical"?f={left:((r||0)-a.width)/2}:f=u==="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}),ad(ad({},f),p)}function Age(e){var t=ln();return x.useEffect(()=>{t(Vme(e))},[t,e]),null}function Oge(e){var t=ln();return x.useEffect(()=>(t(jD(e)),()=>{t(jD({width:0,height:0}))}),[t,e]),null}function Ege(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var _ge={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function zge(e){var t=tr(e,_ge),n=Bhe(),r=qde(),i=Tme(),{width:a,height:l,wrapperStyle:u,portal:d}=t,[f,p]=h6([n]),m=gC(),g=yC();if(m==null||g==null)return null;var v=m-(i?.left||0)-(i?.right||0),j=Ege(t.layout,l,a,v),b=d?u:ad(ad({position:"absolute",width:j?.width||a||"auto",height:j?.height||l||"auto"},Cge(u,t,i,m,g,f)),u),S=d??r;if(S==null||n==null)return null;var k=x.createElement("div",{className:"recharts-legend-wrapper",style:b,ref:p},x.createElement(Age,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(Oge,{width:f.width,height:f.height}),x.createElement(kge,Y1({},t,j,{margin:i,chartWidth:m,chartHeight:g,contextPayload:n})));return gc.createPortal(k,S)}var sU=x.memo(zge,Nc);sU.displayName="Legend";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 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 Uf(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){Pge(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 Pge(e,t,n){return(t=Tge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tge(e){var t=Rge(e,"string");return typeof t=="symbol"?t:t+""}function Rge(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 Dge(e){return Array.isArray(e)&&Fa(e[0])&&Fa(e[1])?e.join(" ~ "):e}var gu={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 Mge(e,t){return t==null?e:ox(e,t)}var Ige=e=>{var{separator:t=gu.separator,contentStyle:n,itemStyle:r,labelStyle:i=gu.labelStyle,payload:a,formatter:l,itemSorter:u,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:g=gu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var P={padding:0,margin:0},O=Mge(a,u),_=O.map((T,$)=>{if(!T||T.type==="none")return null;var F=T.formatter||l||Dge,{value:U,name:B}=T,V=U,X=B;if(F){var Z=F(U,B,T,$,a);if(Array.isArray(Z))[V,X]=Z;else if(Z!=null)V=Z;else return null}var H=Uf(Uf({},gu.itemStyle),{},{color:T.color||gu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Fa(X)?x.createElement("span",{className:"recharts-tooltip-item-name"},X):null,Fa(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"},T.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:P},_)}return null},j=Uf(Uf({},gu.contentStyle),n),b=Uf({margin:0},i),S=!on(p),k=S?p:"",E=Ot("recharts-default-tooltip",d),C=Ot("recharts-tooltip-label",f);S&&m&&a!==void 0&&a!==null&&(k=m(p,a));var A=g?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",Z1({className:E,style:j},A),x.createElement("p",{className:C,style:b},x.isValidElement(k)?k:"".concat(k)),v())},qf="recharts-tooltip-wrapper",Lge={visibility:"hidden"};function $ge(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ot(qf,{["".concat(qf,"-right")]:Pe(n)&&t&&Pe(t.x)&&n>=t.x,["".concat(qf,"-left")]:Pe(n)&&t&&Pe(t.x)&&n<t.x,["".concat(qf,"-bottom")]:Pe(r)&&t&&Pe(t.y)&&r>=t.y,["".concat(qf,"-top")]:Pe(r)&&t&&Pe(t.y)&&r<t.y})}function ED(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:u,viewBox:d,viewBoxDimension:f}=e;if(a&&Pe(a[r]))return a[r];var p=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return l[r]?p:m;var g=d[r];if(g==null)return 0;if(l[r]){var v=p,j=g;return v<j?Math.max(m,g):Math.max(p,g)}if(f==null)return 0;var b=m+u,S=g+f;return b>S?Math.max(p,g):Math.max(m,g)}function Bge(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 Uge(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:u,useTranslate3d:d,viewBox:f}=e,p,m,g;return u.height>0&&u.width>0&&n?(m=ED({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:u.width,viewBox:f,viewBoxDimension:f.width}),g=ED({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:u.height,viewBox:f,viewBoxDimension:f.height}),p=Bge({translateX:m,translateY:g,useTranslate3d:d})):p=Lge,{cssProperties:p,cssClasses:$ge({translateX:m,translateY:g,coordinate:n})}}var qge=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),sp={isSsr:qge()};function oU(){var[e,t]=x.useState(()=>sp.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 _D(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 yu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_D(Object(n),!0).forEach(function(r){Fge(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_D(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fge(e,t,n){return(t=Hge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hge(e){var t=Kge(e,"string");return typeof t=="symbol"?t:t+""}function Kge(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 Gge(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function Vge(e){var t,n,r,i,a,l,u=oU(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var j=b=>{if(b.key==="Escape"){var S,k,E,C;f({dismissed:!0,dismissedAtCoordinate:{x:(S=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&S!==void 0?S:0,y:(E=(C=e.coordinate)===null||C===void 0?void 0:C.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",j),()=>{document.removeEventListener("keydown",j)}},[(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=(l=e.coordinate)===null||l===void 0?void 0:l.y)!==null&&a!==void 0?a:0)!==d.dismissedAtCoordinate.y)&&f(yu(yu({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=Uge({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}),g=e.hasPortalFromProps?{}:yu(yu({transition:Gge({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=yu(yu({},g),{},{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 Qge=x.memo(Vge),lU=()=>{var e;return(e=Ue(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function X1(){return X1=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},X1.apply(null,arguments)}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 PD(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){Wge(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 Wge(e,t,n){return(t=Yge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yge(e){var t=Zge(e,"string");return typeof t=="symbol"?t:t+""}function Zge(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 TD={curveBasisClosed:ofe,curveBasisOpen:lfe,curveBasis:sfe,curveBumpX:Gde,curveBumpY:Vde,curveLinearClosed:cfe,curveLinear:ix,curveMonotoneX:ufe,curveMonotoneY:dfe,curveNatural:ffe,curveStep:hfe,curveStepAfter:mfe,curveStepBefore:pfe},By=e=>ht(e.x)&&ht(e.y),RD=e=>e.base!=null&&By(e.base)&&By(e),Ff=e=>e.x,Hf=e=>e.y,Xge=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(ep(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=TD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return TD[n]||ix},DD={connectNulls:!1,type:"linear"},Jge=e=>{var{type:t=DD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=DD.connectNulls}=e,l=Xge(t,i),u=a?n.filter(By):n;if(Array.isArray(r)){var d,f=n.map((j,b)=>PD(PD({},j),{},{base:r[b]}));i==="vertical"?d=ug().y(Hf).x1(Ff).x0(j=>j.base.x):d=ug().x(Ff).y1(Hf).y0(j=>j.base.y);var p=d.defined(RD).curve(l),m=a?f.filter(RD):f;return p(m)}var g;i==="vertical"&&Pe(r)?g=ug().y(Hf).x1(Ff).x0(r):Pe(r)?g=ug().x(Ff).y1(Hf).y0(r):g=MB().x(Ff).y(Hf);var v=g.defined(By).curve(l);return v(u)},fh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=el();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?Jge(l):r;return x.createElement("path",X1({},gi(e),iC(e),{className:Ot("recharts-curve",t),d:u===null?void 0:u,ref:i}))},eye=["x","y","top","left","width","height","className"];function J1(){return J1=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},J1.apply(null,arguments)}function MD(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 tye(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MD(Object(n),!0).forEach(function(r){nye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nye(e,t,n){return(t=rye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rye(e){var t=iye(e,"string");return typeof t=="symbol"?t:t+""}function iye(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 aye(e,t){if(e==null)return{};var n,r,i=sye(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 sye(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 oye=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),lye=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:u}=e,d=aye(e,eye),f=tye({x:t,y:n,top:r,left:i,width:a,height:l},d);return!Pe(t)||!Pe(n)||!Pe(a)||!Pe(l)||!Pe(r)||!Pe(i)?null:x.createElement("path",J1({},kr(f),{className:Ot("recharts-cross",u),d:oye(t,n,a,l,r,i)}))};function cye(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 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 LD(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=dye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function dye(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 hye=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),cU=(e,t,n)=>e.map(r=>"".concat(hye(r)," ").concat(t,"ms ").concat(n)).join(","),pye=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Rh=(e,t)=>Object.keys(t).reduce((n,r)=>LD(LD({},n),{},{[r]:e(r,t[r])}),{});function $D(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 Qn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$D(Object(n),!0).forEach(function(r){mye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(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)}var Uy=(e,t,n)=>e+(t-e)*n,eN=e=>{var{from:t,to:n}=e;return t!==n},uU=(e,t,n)=>{var r=Rh((i,a)=>{if(eN(a)){var[l,u]=e(a.from,a.to,a.velocity);return Qn(Qn({},a),{},{from:l,velocity:u})}return a},t);return n<1?Rh((i,a)=>eN(a)&&r[i]!=null?Qn(Qn({},a),{},{velocity:Uy(a.velocity,r[i].velocity,n),from:Uy(a.from,r[i].from,n)}):a,t):uU(e,r,n-1)};function vye(e,t,n,r,i,a){var l,u=r.reduce((g,v)=>Qn(Qn({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>Rh((g,v)=>v.from,u),f=()=>!Object.values(u).filter(eN).length,p=null,m=g=>{l||(l=g);var v=g-l,j=v/n.dt;u=uU(n,u,j),i(Qn(Qn(Qn({},e),t),d())),l=g,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var g;(g=p)===null||g===void 0||g()})}function xye(e,t,n,r,i,a,l){var u=null,d=i.reduce((m,g)=>{var v=e[g],j=t[g];return v==null||j==null?m:Qn(Qn({},m),{},{[g]:[v,j]})},{}),f,p=m=>{f||(f=m);var g=(m-f)/r,v=Rh((b,S)=>Uy(...S,n(g)),d);if(a(Qn(Qn(Qn({},e),t),v)),g<1)u=l.setTimeout(p);else{var j=Rh((b,S)=>Uy(...S,n(1)),d);a(Qn(Qn(Qn({},e),t),j))}};return()=>(u=l.setTimeout(p),()=>{var m;(m=u)===null||m===void 0||m()})}const bye=(e,t,n,r,i,a)=>{var l=pye(e,t);return n==null?()=>(i(Qn(Qn({},e),t)),()=>{}):n.isStepper===!0?vye(e,t,n,l,i,a):xye(e,t,n,r,l,i,a)};var qy=1e-4,dU=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],fU=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),BD=(e,t)=>n=>{var r=dU(e,t);return fU(r,n)},wye=(e,t)=>n=>{var r=dU(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return fU(i,n)},jye=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]]},Sye=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=jye(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Nye=(e,t,n,r)=>{var i=BD(e,n),a=BD(t,r),l=wye(e,n),u=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,g=0;g<8;++g){var v=i(m)-p,j=l(m);if(Math.abs(v-p)<qy||j<qy)return a(m);m=u(m-v/j)}return a(m)};return d.isStepper=!1,d},UD=function(){return Nye(...Sye(...arguments))},kye=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,u,d)=>{var f=-(l-u)*n,p=d*r,m=d+(f-p)*i/1e3,g=d*i/1e3+l;return Math.abs(g-u)<qy&&Math.abs(m)<qy?[u,0]:[g,m]};return a.isStepper=!0,a.dt=i,a},Cye=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return UD(e);case"spring":return kye();default:if(e.split("(")[0]==="cubic-bezier")return UD(e)}return typeof e=="function"?e:null};function Aye(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var u=l,[d,...f]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),a(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class Oye{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function Eye(){return Aye(new Oye)}var _ye=x.createContext(Eye);function zye(e,t){var n=x.useContext(_ye);return x.useMemo(()=>t??n(e),[e,t,n])}var Pye={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},qD={t:0},rS={t:1};function op(e){var t=tr(e,Pye),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:u,onAnimationStart:d,children:f}=t,p=oU(),m=n==="auto"?!sp.isSsr&&!p:n,g=zye(t.animationId,t.animationManager),[v,j]=x.useState(m?qD:rS),b=x.useRef(null);return x.useEffect(()=>{m||j(rS)},[m]),x.useEffect(()=>{if(!m||!r)return Jo;var S=bye(qD,rS,Cye(a),i,j,g.getTimeoutController()),k=()=>{b.current=S()};return g.start([d,l,k,i,u]),()=>{g.stop(),b.current&&b.current(),u()}},[m,r,i,a,l,d,u,g]),f(v.t)}function lp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Ah(t)),r=x.useRef(e);return r.current!==e&&(n.current=Ah(t),r.current=e),n.current}var Tye=["radius"],Rye=["radius"],FD,HD,KD,GD,VD,QD,WD,YD,ZD,XD;function JD(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 eM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JD(Object(n),!0).forEach(function(r){Dye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dye(e,t,n){return(t=Mye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mye(e){var t=Iye(e,"string");return typeof t=="symbol"?t:t+""}function Iye(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 Fy(){return Fy=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},Fy.apply(null,arguments)}function tM(e,t){if(e==null)return{};var n,r,i=Lye(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 Lye(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 Aa(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var nM=(e,t,n,r,i)=>{var a=Ro(n),l=Ro(r),u=Math.min(Math.abs(a)/2,Math.abs(l)/2),d=l>=0?1:-1,f=a>=0?1:-1,p=l>=0&&a>=0||l<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,j=4;v<j;v++){var b,S=(b=i[v])!==null&&b!==void 0?b:0;g[v]=S>u?u:S}m=kn(FD||(FD=Aa(["M",",",""])),e,t+d*g[0]),g[0]>0&&(m+=kn(HD||(HD=Aa(["A ",",",",0,0,",",",",",""])),g[0],g[0],p,e+f*g[0],t)),m+=kn(KD||(KD=Aa(["L ",",",""])),e+n-f*g[1],t),g[1]>0&&(m+=kn(GD||(GD=Aa(["A ",",",",0,0,",`,
|
|
261
|
+
`,",",""])),g[1],g[1],p,e+n,t+d*g[1])),m+=kn(VD||(VD=Aa(["L ",",",""])),e+n,t+r-d*g[2]),g[2]>0&&(m+=kn(QD||(QD=Aa(["A ",",",",0,0,",`,
|
|
262
|
+
`,",",""])),g[2],g[2],p,e+n-f*g[2],t+r)),m+=kn(WD||(WD=Aa(["L ",",",""])),e+f*g[3],t+r),g[3]>0&&(m+=kn(YD||(YD=Aa(["A ",",",",0,0,",`,
|
|
263
|
+
`,",",""])),g[3],g[3],p,e,t+r-d*g[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=kn(ZD||(ZD=Aa(["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=kn(XD||(XD=Aa(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},rM={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hU=e=>{var t=tr(e,rM),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:l,width:u,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:g,animationBegin:v,isAnimationActive:j,isUpdateAnimationActive:b}=t,S=x.useRef(u),k=x.useRef(d),E=x.useRef(a),C=x.useRef(l),A=x.useMemo(()=>({x:a,y:l,width:u,height:d,radius:f}),[a,l,u,d,f]),P=lp(A,"rectangle-");if(a!==+a||l!==+l||u!==+u||d!==+d||u===0||d===0)return null;var O=Ot("recharts-rectangle",p);if(!b){var _=kr(t),{radius:T}=_,$=tM(_,Tye);return x.createElement("path",Fy({},$,{x:Ro(a),y:Ro(l),width:Ro(u),height:Ro(d),radius:typeof f=="number"?f:void 0,className:O,d:nM(a,l,u,d,f)}))}var F=S.current,U=k.current,B=E.current,V=C.current,X="0px ".concat(r===-1?1:r,"px"),Z="".concat(r,"px ").concat(r,"px"),H=cU(["strokeDasharray"],g,typeof m=="string"?m:rM.animationEasing);return x.createElement(op,{animationId:P,key:P,canBegin:r>0,duration:g,easing:m,isActive:b,begin:v},J=>{var oe=Ft(F,u,J),ye=Ft(U,d,J),I=Ft(B,a,J),M=Ft(V,l,J);n.current&&(S.current=oe,k.current=ye,E.current=I,C.current=M);var q;j?J>0?q={transition:H,strokeDasharray:Z}:q={strokeDasharray:X}:q={strokeDasharray:Z};var D=kr(t),{radius:G}=D,se=tM(D,Rye);return x.createElement("path",Fy({},se,{radius:typeof f=="number"?f:void 0,className:O,d:nM(I,M,oe,ye,f),ref:n,style:eM(eM({},q),t.style)}))})};function iM(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 aM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iM(Object(n),!0).forEach(function(r){$ye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $ye(e,t,n){return(t=Bye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bye(e){var t=Uye(e,"string");return typeof t=="symbol"?t:t+""}function Uye(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 Hy=Math.PI/180,qye=e=>e*180/Math.PI,mr=(e,t,n,r)=>({x:e+Math.cos(-Hy*r)*n,y:t+Math.sin(-Hy*r)*n}),Fye=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},Hye=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},Kye=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=Hye({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var u=(n-i)/l,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:l,angle:qye(d),angleInRadian:d}},Gye=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}},Vye=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},Qye=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=Kye({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:d,endAngle:f}=Gye(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?aM(aM({},t),{},{radius:i,angle:Vye(p,t)}):null};function pU(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=mr(t,n,r,i),u=mr(t,n,r,a);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var sM,oM,lM,cM,uM,dM,fM;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 Bl(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Wye=(e,t)=>{var n=Wr(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},vg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:u,cornerIsExternal:d}=e,f=u*(l?1:-1)+r,p=Math.asin(u/f)/Hy,m=d?i:i+a*p,g=mr(t,n,f,m),v=mr(t,n,r,m),j=d?i-a*p:i,b=mr(t,n,f*Math.cos(p*Hy),j);return{center:g,circleTangency:v,lineTangency:b,theta:p}},mU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,u=Wye(a,l),d=a+u,f=mr(t,n,i,a),p=mr(t,n,i,d),m=kn(sM||(sM=Bl(["M ",",",`
|
|
271
|
+
A `,",",`,0,
|
|
272
|
+
`,",",`,
|
|
273
|
+
`,",",`
|
|
274
|
+
`])),f.x,f.y,i,i,+(Math.abs(u)>180),+(a>d),p.x,p.y);if(r>0){var g=mr(t,n,r,a),v=mr(t,n,r,d);m+=kn(oM||(oM=Bl(["L ",",",`
|
|
275
|
+
A `,",",`,0,
|
|
276
|
+
`,",",`,
|
|
277
|
+
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),g.x,g.y)}else m+=kn(lM||(lM=Bl(["L ",","," Z"])),t,n);return m},Yye=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:f}=e,p=Wr(f-d),{circleTangency:m,lineTangency:g,theta:v}=vg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:u}),{circleTangency:j,lineTangency:b,theta:S}=vg({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:u}),k=u?Math.abs(d-f):Math.abs(d-f)-v-S;if(k<0)return l?kn(cM||(cM=Bl(["M ",",",`
|
|
278
|
+
a`,",",",0,0,1,",`,0
|
|
279
|
+
a`,",",",0,0,1,",`,0
|
|
280
|
+
`])),g.x,g.y,a,a,a*2,a,a,-a*2):mU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var E=kn(uM||(uM=Bl(["M ",",",`
|
|
281
|
+
A`,",",",0,0,",",",",",`
|
|
282
|
+
A`,",",",0,",",",",",",",`
|
|
283
|
+
A`,",",",0,0,",",",",",`
|
|
284
|
+
`])),g.x,g.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),j.x,j.y,a,a,+(p<0),b.x,b.y);if(r>0){var{circleTangency:C,lineTangency:A,theta:P}=vg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:O,lineTangency:_,theta:T}=vg({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),$=u?Math.abs(d-f):Math.abs(d-f)-P-T;if($<0&&a===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=kn(dM||(dM=Bl(["L",",",`
|
|
285
|
+
A`,",",",0,0,",",",",",`
|
|
286
|
+
A`,",",",0,",",",",",",",`
|
|
287
|
+
A`,",",",0,0,",",",",","Z"])),_.x,_.y,a,a,+(p<0),O.x,O.y,r,r,+($>180),+(p>0),C.x,C.y,a,a,+(p<0),A.x,A.y)}else E+=kn(fM||(fM=Bl(["L",",","Z"])),t,n);return E},Zye={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},gU=e=>{var t=tr(e,Zye),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var g=Ot("recharts-sector",m),v=a-i,j=fa(l,v,0,!0),b;return j>0&&Math.abs(f-p)<360?b=Yye({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(j,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:f,endAngle:p}):b=mU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",tN({},kr(t),{className:g,d:b}))};function Xye(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(ZB(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:u}=t,d=mr(r,i,a,u),f=mr(r,i,l,u);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return pU(t)}}var iS={},aS={},sS={},hM;function Jye(){return hM||(hM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=u6();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(sS)),sS}var pM;function eve(){return pM||(pM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jye();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})(aS)),aS}var mM;function tve(){return mM||(mM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=d6(),n=eve();function r(i,a,l){l&&typeof l!="number"&&t.isIterateeCall(i,a,l)&&(a=l=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),l=l===void 0?i<a?1:-1:n.toFinite(l);const u=Math.max(Math.ceil((a-i)/(l||1)),0),d=new Array(u);for(let f=0;f<u;f++)d[f]=i,i+=l;return d}e.range=r})(iS)),iS}var oS,gM;function nve(){return gM||(gM=1,oS=tve().range),oS}var rve=nve();const yU=pa(rve);var xa=e=>e.chartData,wC=re([xa],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),cp=(e,t,n,r)=>r?wC(e):xa(e),vU=(e,t,n)=>n?wC(e):xa(e),ive=re([cp],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});re([wC],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var ave=re([xa],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function La(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ht(t)&&ht(n))return!0}return!1}function yM(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function xU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(ht(n))i=n;else if(typeof n=="function")return;if(ht(r))a=r;else if(typeof r=="function")return;var l=[i,a];if(La(l))return l}}function sve(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(La(r))return yM(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,u;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Pe(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&sD.test(i)){var d=sD.exec(i);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[0]-f}}else l=t?.[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Pe(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t?.[1]))}catch{}else if(typeof a=="string"&&oD.test(a)){var p=oD.exec(a);if(p==null||p[1]==null||t==null)u=void 0;else{var m=+p[1];u=t[1]+m}}else u=t?.[1];var g=[l,u];if(La(g))return t==null?g:yM(g,t,n)}}}var Cd=1e9,ove={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},SC,hn=!0,Gi="[DecimalError] ",Wl=Gi+"Invalid argument: ",jC=Gi+"Exponent out of range: ",Ad=Math.floor,Tl=Math.pow,lve=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,fi,Jn=1e7,sn=7,bU=9007199254740991,Ky=Ad(bU/sn),Re={};Re.absoluteValue=Re.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Re.comparedTo=Re.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};Re.decimalPlaces=Re.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};Re.dividedBy=Re.div=function(e){return As(this,new this.constructor(e))};Re.dividedToIntegerBy=Re.idiv=function(e){var t=this,n=t.constructor;return Qt(As(t,new n(e),0,1),n.precision)};Re.equals=Re.eq=function(e){return!this.cmp(e)};Re.exponent=function(){return qn(this)};Re.greaterThan=Re.gt=function(e){return this.cmp(e)>0};Re.greaterThanOrEqualTo=Re.gte=function(e){return this.cmp(e)>=0};Re.isInteger=Re.isint=function(){return this.e>this.d.length-2};Re.isNegative=Re.isneg=function(){return this.s<0};Re.isPositive=Re.ispos=function(){return this.s>0};Re.isZero=function(){return this.s===0};Re.lessThan=Re.lt=function(e){return this.cmp(e)<0};Re.lessThanOrEqualTo=Re.lte=function(e){return this.cmp(e)<1};Re.logarithm=Re.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(fi))throw Error(Gi+"NaN");if(n.s<1)throw Error(Gi+(n.s?"NaN":"-Infinity"));return n.eq(fi)?new r(0):(hn=!1,t=As(Dh(n,a),Dh(e,a),a),hn=!0,Qt(t,i))};Re.minus=Re.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?SU(t,e):wU(t,(e.s=-e.s,e))};Re.modulo=Re.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Gi+"NaN");return n.s?(hn=!1,t=As(n,e,0,1).times(e),hn=!0,n.minus(t)):Qt(new r(n),i)};Re.naturalExponential=Re.exp=function(){return jU(this)};Re.naturalLogarithm=Re.ln=function(){return Dh(this)};Re.negated=Re.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Re.plus=Re.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?wU(t,e):SU(t,(e.s=-e.s,e))};Re.precision=Re.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Wl+e);if(t=qn(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};Re.squareRoot=Re.sqrt=function(){var e,t,n,r,i,a,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Gi+"NaN")}for(e=qn(u),hn=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Ia(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Ad((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=l=n+3;;)if(a=r,r=a.plus(As(u,a,l+2)).times(.5),Ia(a.d).slice(0,l)===(t=Ia(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Qt(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;l+=4}return hn=!0,Qt(r,n)};Re.times=Re.mul=function(e){var t,n,r,i,a,l,u,d,f,p=this,m=p.constructor,g=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=g.length,f=v.length,d<f&&(a=g,g=v,v=a,l=d,d=f,f=l),a=[],l=d+f,r=l;r--;)a.push(0);for(r=f;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*g[i-r-1]+t,a[i--]=u%Jn|0,t=u/Jn|0;a[i]=(a[i]+t)%Jn|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,hn?Qt(e,m.precision):e};Re.toDecimalPlaces=Re.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ka(e,0,Cd),t===void 0?t=r.rounding:Ka(t,0,8),Qt(n,e+qn(n)+1,t))};Re.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=uc(r,!0):(Ka(e,0,Cd),t===void 0?t=i.rounding:Ka(t,0,8),r=Qt(new i(r),e+1,t),n=uc(r,!0,e+1)),n};Re.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?uc(i):(Ka(e,0,Cd),t===void 0?t=a.rounding:Ka(t,0,8),r=Qt(new a(i),e+qn(i)+1,t),n=uc(r.abs(),!1,e+qn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Re.toInteger=Re.toint=function(){var e=this,t=e.constructor;return Qt(new t(e),qn(e)+1,t.rounding)};Re.toNumber=function(){return+this};Re.toPower=Re.pow=function(e){var t,n,r,i,a,l,u=this,d=u.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(fi);if(u=new d(u),!u.s){if(e.s<1)throw Error(Gi+"Infinity");return u}if(u.eq(fi))return u;if(r=d.precision,e.eq(fi))return Qt(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=u.s,l){if((n=p<0?-p:p)<=bU){for(i=new d(fi),t=Math.ceil(r/sn+4),hn=!1;n%2&&(i=i.times(u),xM(i.d,t)),n=Ad(n/2),n!==0;)u=u.times(u),xM(u.d,t);return hn=!0,e.s<0?new d(fi).div(i):Qt(i,r)}}else if(a<0)throw Error(Gi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,hn=!1,i=e.times(Dh(u,r+f)),hn=!0,i=jU(i),i.s=a,i};Re.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=qn(i),r=uc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Ka(e,1,Cd),t===void 0?t=a.rounding:Ka(t,0,8),i=Qt(new a(i),e,t),n=qn(i),r=uc(i,e<=n||n<=a.toExpNeg,e)),r};Re.toSignificantDigits=Re.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ka(e,1,Cd),t===void 0?t=r.rounding:Ka(t,0,8)),Qt(new r(n),e,t)};Re.toString=Re.valueOf=Re.val=Re.toJSON=Re[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=qn(e),n=e.constructor;return uc(e,t<=n.toExpNeg||t>=n.toExpPos)};function wU(e,t){var n,r,i,a,l,u,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,l=e.e,i=t.e,d=d.slice(),a=l-i,a){for(a<0?(r=d,a=-a,u=f.length):(r=f,i=l,u=d.length),l=Math.ceil(m/sn),u=l>u?l+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=d.length,a=f.length,u-a<0&&(a=u,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),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,hn?Qt(t,m):t}function Ka(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Wl+e)}function Ia(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=sn-r.length,n&&(a+=Ao(n)),a+=r;l=e[t],r=l+"",n=sn-r.length,n&&(a+=Ao(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var As=(function(){function e(r,i){var a,l=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+l,r[u]=a%Jn|0,l=a/Jn|0;return l&&r.unshift(l),r}function t(r,i,a,l){var u,d;if(a!=l)d=a>l?1:-1;else for(u=d=0;u<a;u++)if(r[u]!=i[u]){d=r[u]>i[u]?1:-1;break}return d}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*Jn+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var u,d,f,p,m,g,v,j,b,S,k,E,C,A,P,O,_,T,$=r.constructor,F=r.s==i.s?1:-1,U=r.d,B=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(Gi+"Division by zero");for(d=r.e-i.e,_=B.length,P=U.length,v=new $(F),j=v.d=[],f=0;B[f]==(U[f]||0);)++f;if(B[f]>(U[f]||0)&&--d,a==null?E=a=$.precision:l?E=a+(qn(r)-qn(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<P||p)&&E--;f++)C=p*Jn+(U[f]||0),j[f]=C/B|0,p=C%B|0;else{for(p=Jn/(B[0]+1)|0,p>1&&(B=e(B,p),U=e(U,p),_=B.length,P=U.length),A=_,b=U.slice(0,_),S=b.length;S<_;)b[S++]=0;T=B.slice(),T.unshift(0),O=B[0],B[1]>=Jn/2&&++O;do p=0,u=t(B,b,_,S),u<0?(k=b[0],_!=S&&(k=k*Jn+(b[1]||0)),p=k/O|0,p>1?(p>=Jn&&(p=Jn-1),m=e(B,p),g=m.length,S=b.length,u=t(m,b,g,S),u==1&&(p--,n(m,_<g?T:B,g))):(p==0&&(u=p=1),m=B.slice()),g=m.length,g<S&&m.unshift(0),n(b,m,S),u==-1&&(S=b.length,u=t(B,b,_,S),u<1&&(p++,n(b,_<S?T:B,S))),S=b.length):u===0&&(p++,b=[0]),j[f++]=p,u&&b[0]?b[S++]=U[A]||0:(b=[U[A]],S=1);while((A++<P||b[0]!==void 0)&&E--)}return j[0]||j.shift(),v.e=d,Qt(v,l?a+qn(v)+1:a)}})();function jU(e,t){var n,r,i,a,l,u,d=0,f=0,p=e.constructor,m=p.precision;if(qn(e)>16)throw Error(jC+qn(e));if(!e.s)return new p(fi);for(hn=!1,u=m,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Tl(2,f))/Math.LN10*2+5|0,u+=r,n=i=a=new p(fi),p.precision=u;;){if(i=Qt(i.times(e),u),n=n.times(++d),l=a.plus(As(i,n,u)),Ia(l.d).slice(0,u)===Ia(a.d).slice(0,u)){for(;f--;)a=Qt(a.times(a),u);return p.precision=m,t==null?(hn=!0,Qt(a,m)):a}a=l}}function qn(e){for(var t=e.e*sn,n=e.d[0];n>=10;n/=10)t++;return t}function lS(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(Gi+"LN10 precision limit exceeded");return Qt(new e(e.LN10),t)}function Ao(e){for(var t="";e--;)t+="0";return t}function Dh(e,t){var n,r,i,a,l,u,d,f,p,m=1,g=10,v=e,j=v.d,b=v.constructor,S=b.precision;if(v.s<1)throw Error(Gi+(v.s?"NaN":"-Infinity"));if(v.eq(fi))return new b(0);if(t==null?(hn=!1,f=S):f=t,v.eq(10))return t==null&&(hn=!0),lS(b,f);if(f+=g,b.precision=f,n=Ia(j),r=n.charAt(0),a=qn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Ia(v.d),r=n.charAt(0),m++;a=qn(v),r>1?(v=new b("0."+n),a++):v=new b(r+"."+n.slice(1))}else return d=lS(b,f+2,S).times(a+""),v=Dh(new b(r+"."+n.slice(1)),f-g).plus(d),b.precision=S,t==null?(hn=!0,Qt(v,S)):v;for(u=l=v=As(v.minus(fi),v.plus(fi),f),p=Qt(v.times(v),f),i=3;;){if(l=Qt(l.times(p),f),d=u.plus(As(l,new b(i),f)),Ia(d.d).slice(0,f)===Ia(u.d).slice(0,f))return u=u.times(2),a!==0&&(u=u.plus(lS(b,f+2,S).times(a+""))),u=As(u,new b(m),f),b.precision=S,t==null?(hn=!0,Qt(u,S)):u;u=d,i+=2}}function vM(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=Ad(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>Ky||e.e<-Ky))throw Error(jC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Qt(e,t,n){var r,i,a,l,u,d,f,p,m=e.d;for(l=1,a=m[0];a>=10;a/=10)l++;if(r=t-l,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],l=1;a>=10;a/=10)l++;r%=sn,i=r-sn+l}if(n!==void 0&&(a=Tl(10,l-i-1),u=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?i>0?f/Tl(10,l-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=qn(e),m.length=1,t=t-a-1,m[0]=Tl(10,(sn-t%sn)%sn),e.e=Ad(-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=Tl(10,sn-r),m[p]=i>0?(f/Tl(10,l-i)%Tl(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>Ky||e.e<-Ky))throw Error(jC+qn(e));return e}function SU(e,t){var n,r,i,a,l,u,d,f,p,m,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),hn?Qt(t,v):t;if(d=e.d,m=t.d,r=t.e,f=e.e,d=d.slice(),l=f-r,l){for(p=l<0,p?(n=d,l=-l,u=m.length):(n=m,r=f,u=d.length),i=Math.max(Math.ceil(v/sn),u)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=d.length,u=m.length,p=i<u,p&&(u=i),i=0;i<u;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}l=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),u=d.length,i=m.length-u;i>0;--i)d[u++]=0;for(i=m.length;i>l;){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[--u]===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 g(0)}function uc(e,t,n){var r,i=qn(e),a=Ia(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+Ao(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ao(-i-1)+a,n&&(r=n-l)>0&&(a+=Ao(r))):i>=l?(a+=Ao(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+Ao(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=Ao(r))),e.s<0?"-"+a:a}function xM(e,t){if(e.length>t)return e.length=t,!0}function NU(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Wl+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return vM(l,a.toString())}else if(typeof a!="string")throw Error(Wl+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,lve.test(a))vM(l,a);else throw Error(Wl+a)}if(i.prototype=Re,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=NU,i.config=i.set=cve,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 cve(e){if(!e||typeof e!="object")throw Error(Gi+"Object expected");var t,n,r,i=["precision",1,Cd,"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(Ad(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Wl+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Wl+n+": "+r);return this}var SC=NU(ove);fi=new SC(1);const jt=SC;function kU(e){var t;return e===0?t=1:t=Math.floor(new jt(e).abs().log(10).toNumber())+1,t}function CU(e,t,n){for(var r=new jt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var AU=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},NC=(e,t,n)=>{if(e.lte(0))return new jt(0);var r=kU(e.toNumber()),i=new jt(10).pow(r),a=e.div(i),l=r!==1?.05:.1,u=new jt(Math.ceil(a.div(l).toNumber())).add(n).mul(l),d=u.mul(i);return t?new jt(d.toNumber()):new jt(Math.ceil(d.toNumber()))},OU=(e,t,n)=>{var r;if(e.lte(0))return new jt(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new jt(a).abs().log(10).toNumber()),u=new jt(10).pow(l),d=e.div(u).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(u=u.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,u=u.mul(new jt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,g=new jt(m).mul(u);return t?g:new jt(Math.ceil(g.toNumber()))},uve=(e,t,n)=>{var r=new jt(1),i=new jt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new jt(10).pow(kU(e)-1),i=new jt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new jt(Math.floor(e)))}else e===0?i=new jt(Math.floor((t-1)/2)):n||(i=new jt(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new jt(d-l).mul(r)).toNumber());return u},EU=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:NC;if(!Number.isFinite((n-t)/(r-1)))return{step:new jt(0),tickMin:new jt(0),tickMax:new jt(0)};var u=l(new jt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new jt(0):(d=new jt(t).add(n).div(2),d=d.sub(new jt(d).mod(u)));var f=Math.ceil(d.sub(t).div(u).toNumber()),p=Math.ceil(new jt(n).sub(d).div(u).toNumber()),m=f+p+1;return m>r?EU(t,n,r,i,a+1,l):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:u,tickMin:d.sub(new jt(f).mul(u)),tickMax:d.add(new jt(p).mul(u))})},bM=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,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",u=Math.max(i,2),[d,f]=AU([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 uve(d,i,a);var m=l==="snap125"?OU:NC,{step:g,tickMin:v,tickMax:j}=EU(d,f,u,a,0,m),b=CU(v,j.add(new jt(.1).mul(g)),g);return n>r?b.reverse():b},wM=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",[u,d]=AU([r,i]);if(u===-1/0||d===1/0)return[r,i];if(u===d)return[u];var f=l==="snap125"?OU:NC,p=Math.max(n,2),m=f(new jt(d).sub(u).div(p-1),a,0),g=[...CU(new jt(u),new jt(d),m),d];return a===!1&&(g=g.map(v=>Math.round(v))),r>i?g.reverse():g},_U=e=>e.rootProps.maxBarSize,dve=e=>e.rootProps.barGap,zU=e=>e.rootProps.barCategoryGap,fve=e=>e.rootProps.barSize,kx=e=>e.rootProps.stackOffset,PU=e=>e.rootProps.reverseStackOrder,kC=e=>e.options.chartName,CC=e=>e.rootProps.syncId,TU=e=>e.rootProps.syncMethod,AC=e=>e.options.eventEmitter,hve=e=>e.rootProps.baseValue,Wn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},kl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Oa={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Cx=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Ax(e,t,n){if(n!=="auto")return n;if(e!=null)return va(e,t)?"category":"number"}function jM(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 Gy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jM(Object(n),!0).forEach(function(r){pve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pve(e,t,n){return(t=mve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mve(e){var t=gve(e,"string");return typeof t=="symbol"?t:t+""}function gve(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 SM={allowDataOverflow:kl.allowDataOverflow,allowDecimals:kl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:kl.angleAxisId,includeHidden:!1,name:void 0,reversed:kl.reversed,scale:kl.scale,tick:kl.tick,tickCount:void 0,ticks:void 0,type:kl.type,unit:void 0,niceTicks:"auto"},NM={allowDataOverflow:Oa.allowDataOverflow,allowDecimals:Oa.allowDecimals,allowDuplicatedCategory:Oa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Oa.radiusAxisId,includeHidden:Oa.includeHidden,name:void 0,reversed:Oa.reversed,scale:Oa.scale,tick:Oa.tick,tickCount:Oa.tickCount,ticks:void 0,type:Oa.type,unit:void 0,niceTicks:"auto"},yve=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},OC=re([yve,X6],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ax(t,"angleAxis",SM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},SM),{},{type:r})}),vve=(e,t)=>e.polarAxis.radiusAxis[t],EC=re([vve,X6],(e,t)=>{var n;if(e!=null)return e;var r=(n=Ax(t,"radiusAxis",NM.type))!==null&&n!==void 0?n:"category";return Gy(Gy({},NM),{},{type:r})}),Ox=e=>e.polarOptions,_C=re([$s,Bs,nr],Fye),RU=re([Ox,_C],(e,t)=>{if(e!=null)return fa(e.innerRadius,t,0)}),DU=re([Ox,_C],(e,t)=>{if(e!=null)return fa(e.outerRadius,t,t*.8)}),xve=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},MU=re([Ox],xve);re([OC,MU],Cx);var IU=re([_C,RU,DU],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});re([EC,IU],Cx);var LU=re([_t,Ox,RU,DU,$s,Bs],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:u,startAngle:d,endAngle:f}=t;return{cx:fa(l,i,i/2),cy:fa(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),ir=(e,t)=>t,Ex=(e,t,n)=>n;function _x(e){return e?.id}function $U(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=new Map;return e.forEach(u=>{var d,f=(d=u.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=_x(u);f.forEach((m,g)=>{var v=a==null||i?g:String(vn(m,a,null)),j=vn(m,u.dataKey,0),b;l.has(v)?b=l.get(v):b={},Object.assign(b,{[p]:j}),l.set(v,b)})}}),Array.from(l.values())}function zx(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Px=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Tx(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function bve(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 ar=e=>{var t=_t(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Od=e=>e.tooltip.settings.axisId;function zC(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 l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],u=i[1];return l<=u?a>=l&&a<=u:a>=u&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var u=e(a);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}}var wve=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!La(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];ht(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 Bo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function jve(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function PC(e){let t,n,r;e.length!==2?(t=Bo,n=(u,d)=>Bo(e(u),d),r=(u,d)=>e(u)-d):(t=e===Bo||e===jve?e:Sve,n=e,r=e);function i(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(u,d,f=0,p=u.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(u[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function l(u,d,f=0,p=u.length){const m=i(u,d,f,p-1);return m>f&&r(u[m-1],d)>-r(u[m],d)?m-1:m}return{left:i,center:l,right:a}}function Sve(){return 0}function BU(e){return e===null?NaN:+e}function*Nve(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const kve=PC(Bo),up=kve.right;PC(BU).center;class kM extends Map{constructor(t,n=Ove){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(CM(this,t))}has(t){return super.has(CM(this,t))}set(t,n){return super.set(Cve(this,t),n)}delete(t){return super.delete(Ave(this,t))}}function CM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Cve({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Ave({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Ove(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Eve(e=Bo){if(e===Bo)return UU;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 UU(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const _ve=Math.sqrt(50),zve=Math.sqrt(10),Pve=Math.sqrt(2);function Vy(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=_ve?10:a>=zve?5:a>=Pve?2:1;let u,d,f;return i<0?(f=Math.pow(10,-i)/l,u=Math.round(e*f),d=Math.round(t*f),u/f<e&&++u,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*l,u=Math.round(e/f),d=Math.round(t/f),u*f<e&&++u,d*f>t&&--d),d<u&&.5<=n&&n<2?Vy(e,t,n*2):[u,d,f]}function nN(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?Vy(t,e,n):Vy(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(l<0)for(let f=0;f<u;++f)d[f]=(a-f)/-l;else for(let f=0;f<u;++f)d[f]=(a-f)*l;else if(l<0)for(let f=0;f<u;++f)d[f]=(i+f)/-l;else for(let f=0;f<u;++f)d[f]=(i+f)*l;return d}function rN(e,t,n){return t=+t,e=+e,n=+n,Vy(e,t,n)[2]}function iN(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?rN(t,e,n):rN(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function AM(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function OM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function qU(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?UU:Eve(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),g=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+g)),j=Math.min(r,Math.floor(t+(d-f)*m/d+g));qU(e,t,v,j,i)}const a=e[t];let l=n,u=r;for(Kf(e,n,t),i(e[r],a)>0&&Kf(e,n,r);l<u;){for(Kf(e,l,u),++l,--u;i(e[l],a)<0;)++l;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?Kf(e,n,u):(++u,Kf(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Kf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function Tve(e,t,n){if(e=Float64Array.from(Nve(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return OM(e);if(t>=1)return AM(e);var r,i=(r-1)*t,a=Math.floor(i),l=AM(qU(e,a).subarray(0,a+1)),u=OM(e.subarray(a+1));return l+(u-l)*(i-a)}}function Rve(e,t,n=BU){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),l=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return l+(u-l)*(i-a)}}function Dve(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 Yi(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Us(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 aN=Symbol("implicit");function TC(){var e=new kM,t=[],n=[],r=aN;function i(a){let l=e.get(a);if(l===void 0){if(r!==aN)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new kM;for(const l of a)e.has(l)||e.set(l,t.push(l)-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 TC(t,n).unknown(r)},Yi.apply(i,arguments),i}function RC(){var e=TC().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,u=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var g=t().length,v=i<r,j=v?i:r,b=v?r:i;a=(b-j)/Math.max(1,g-d+f*2),u&&(a=Math.floor(a)),j+=(b-j-a*(g-d))*p,l=a*(1-d),u&&(j=Math.round(j),l=Math.round(l));var S=Dve(g).map(function(k){return j+a*k});return n(v?S.reverse():S)}return e.domain=function(g){return arguments.length?(t(g),m()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(g){return arguments.length?(u=!!g,m()):u},e.padding=function(g){return arguments.length?(d=Math.min(1,f=+g),m()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),m()):d},e.paddingOuter=function(g){return arguments.length?(f=+g,m()):f},e.align=function(g){return arguments.length?(p=Math.max(0,Math.min(1,g)),m()):p},e.copy=function(){return RC(t(),[r,i]).round(u).paddingInner(d).paddingOuter(f).align(p)},Yi.apply(m(),arguments)}function FU(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return FU(t())},e}function Mve(){return FU(RC.apply(null,arguments).paddingInner(1))}function DC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function HU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dp(){}var Mh=.7,Qy=1/Mh,Hu="\\s*([+-]?\\d+)\\s*",Ih="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$a="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ive=/^#([0-9a-f]{3,8})$/,Lve=new RegExp(`^rgb\\(${Hu},${Hu},${Hu}\\)$`),$ve=new RegExp(`^rgb\\(${$a},${$a},${$a}\\)$`),Bve=new RegExp(`^rgba\\(${Hu},${Hu},${Hu},${Ih}\\)$`),Uve=new RegExp(`^rgba\\(${$a},${$a},${$a},${Ih}\\)$`),qve=new RegExp(`^hsl\\(${Ih},${$a},${$a}\\)$`),Fve=new RegExp(`^hsla\\(${Ih},${$a},${$a},${Ih}\\)$`),EM={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};DC(dp,Lh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:_M,formatHex:_M,formatHex8:Hve,formatHsl:Kve,formatRgb:zM,toString:zM});function _M(){return this.rgb().formatHex()}function Hve(){return this.rgb().formatHex8()}function Kve(){return KU(this).formatHsl()}function zM(){return this.rgb().formatRgb()}function Lh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ive.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?PM(t):n===3?new Zr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?xg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?xg(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=Lve.exec(e))?new Zr(t[1],t[2],t[3],1):(t=$ve.exec(e))?new Zr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Bve.exec(e))?xg(t[1],t[2],t[3],t[4]):(t=Uve.exec(e))?xg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qve.exec(e))?DM(t[1],t[2]/100,t[3]/100,1):(t=Fve.exec(e))?DM(t[1],t[2]/100,t[3]/100,t[4]):EM.hasOwnProperty(e)?PM(EM[e]):e==="transparent"?new Zr(NaN,NaN,NaN,0):null}function PM(e){return new Zr(e>>16&255,e>>8&255,e&255,1)}function xg(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zr(e,t,n,r)}function Gve(e){return e instanceof dp||(e=Lh(e)),e?(e=e.rgb(),new Zr(e.r,e.g,e.b,e.opacity)):new Zr}function sN(e,t,n,r){return arguments.length===1?Gve(e):new Zr(e,t,n,r??1)}function Zr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}DC(Zr,sN,HU(dp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mh:Math.pow(Mh,e),new Zr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zr(Yl(this.r),Yl(this.g),Yl(this.b),Wy(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:TM,formatHex:TM,formatHex8:Vve,formatRgb:RM,toString:RM}));function TM(){return`#${Ul(this.r)}${Ul(this.g)}${Ul(this.b)}`}function Vve(){return`#${Ul(this.r)}${Ul(this.g)}${Ul(this.b)}${Ul((isNaN(this.opacity)?1:this.opacity)*255)}`}function RM(){const e=Wy(this.opacity);return`${e===1?"rgb(":"rgba("}${Yl(this.r)}, ${Yl(this.g)}, ${Yl(this.b)}${e===1?")":`, ${e})`}`}function Wy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ul(e){return e=Yl(e),(e<16?"0":"")+e.toString(16)}function DM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new la(e,t,n,r)}function KU(e){if(e instanceof la)return new la(e.h,e.s,e.l,e.opacity);if(e instanceof dp||(e=Lh(e)),!e)return new la;if(e instanceof la)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),l=NaN,u=a-i,d=(a+i)/2;return u?(t===a?l=(n-r)/u+(n<r)*6:n===a?l=(r-t)/u+2:l=(t-n)/u+4,u/=d<.5?a+i:2-a-i,l*=60):u=d>0&&d<1?0:l,new la(l,u,d,e.opacity)}function Qve(e,t,n,r){return arguments.length===1?KU(e):new la(e,t,n,r??1)}function la(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}DC(la,Qve,HU(dp,{brighter(e){return e=e==null?Qy:Math.pow(Qy,e),new la(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mh:Math.pow(Mh,e),new la(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 Zr(cS(e>=240?e-240:e+120,i,r),cS(e,i,r),cS(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new la(MM(this.h),bg(this.s),bg(this.l),Wy(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=Wy(this.opacity);return`${e===1?"hsl(":"hsla("}${MM(this.h)}, ${bg(this.s)*100}%, ${bg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function MM(e){return e=(e||0)%360,e<0?e+360:e}function bg(e){return Math.max(0,Math.min(1,e||0))}function cS(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 MC=e=>()=>e;function Wve(e,t){return function(n){return e+n*t}}function Yve(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 Zve(e){return(e=+e)==1?GU:function(t,n){return n-t?Yve(t,n,e):MC(isNaN(t)?n:t)}}function GU(e,t){var n=t-e;return n?Wve(e,n):MC(isNaN(e)?t:e)}const IM=(function e(t){var n=Zve(t);function r(i,a){var l=n((i=sN(i)).r,(a=sN(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),f=GU(i.opacity,a.opacity);return function(p){return i.r=l(p),i.g=u(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function Xve(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 Jve(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function exe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=Ed(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(u){for(l=0;l<r;++l)a[l]=i[l](u);return a}}function txe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Yy(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nxe(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]=Ed(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var oN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uS=new RegExp(oN.source,"g");function rxe(e){return function(){return e}}function ixe(e){return function(t){return e(t)+""}}function axe(e,t){var n=oN.lastIndex=uS.lastIndex=0,r,i,a,l=-1,u=[],d=[];for(e=e+"",t=t+"";(r=oN.exec(e))&&(i=uS.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,d.push({i:l,x:Yy(r,i)})),n=uS.lastIndex;return n<t.length&&(a=t.slice(n),u[l]?u[l]+=a:u[++l]=a),u.length<2?d[0]?ixe(d[0].x):rxe(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)u[(m=d[p]).i]=m.x(f);return u.join("")})}function Ed(e,t){var n=typeof t,r;return t==null||n==="boolean"?MC(t):(n==="number"?Yy:n==="string"?(r=Lh(t))?(t=r,IM):axe:t instanceof Lh?IM:t instanceof Date?txe:Jve(t)?Xve:Array.isArray(t)?exe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?nxe:Yy)(e,t)}function IC(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function sxe(e,t){t===void 0&&(t=e,e=Ed);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(l){var u=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[u](l-u)}}function oxe(e){return function(){return e}}function Zy(e){return+e}var LM=[0,1];function Rr(e){return e}function lN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:oxe(isNaN(t)?NaN:.5)}function lxe(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function cxe(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=lN(i,r),a=n(l,a)):(r=lN(r,i),a=n(a,l)),function(u){return a(r(u))}}function uxe(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=lN(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(u){var d=up(e,u,1,r)-1;return a[d](i[d](u))}}function fp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Rx(){var e=LM,t=LM,n=Ed,r,i,a,l=Rr,u,d,f;function p(){var g=Math.min(e.length,t.length);return l!==Rr&&(l=lxe(e[0],e[g-1])),u=g>2?uxe:cxe,d=f=null,m}function m(g){return g==null||isNaN(g=+g)?a:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return m.invert=function(g){return l(i((f||(f=u(t,e.map(r),Yy)))(g)))},m.domain=function(g){return arguments.length?(e=Array.from(g,Zy),p()):e.slice()},m.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},m.rangeRound=function(g){return t=Array.from(g),n=IC,p()},m.clamp=function(g){return arguments.length?(l=g?!0:Rr,p()):l!==Rr},m.interpolate=function(g){return arguments.length?(n=g,p()):n},m.unknown=function(g){return arguments.length?(a=g,m):a},function(g,v){return r=g,i=v,p()}}function LC(){return Rx()(Rr,Rr)}function dxe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Xy(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 sd(e){return e=Xy(Math.abs(e)),e?e[1]:NaN}function fxe(e,t){return function(n,r){for(var i=n.length,a=[],l=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),a.push(n.substring(i-=u,i+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return a.reverse().join(t)}}function hxe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var pxe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $h(e){if(!(t=pxe.exec(e)))throw new Error("invalid format: "+e);var t;return new $C({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]})}$h.prototype=$C.prototype;function $C(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+""}$C.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 mxe(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 Jy;function gxe(e,t){var n=Xy(e,t);if(!n)return Jy=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(Jy=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Xy(e,Math.max(0,t+a-1))[0]}function $M(e,t){var n=Xy(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 BM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:dxe,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)=>$M(e*100,t),r:$M,s:gxe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function UM(e){return e}var qM=Array.prototype.map,FM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function yxe(e){var t=e.grouping===void 0||e.thousands===void 0?UM:fxe(qM.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?UM:hxe(qM.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,g){m=$h(m);var v=m.fill,j=m.align,b=m.sign,S=m.symbol,k=m.zero,E=m.width,C=m.comma,A=m.precision,P=m.trim,O=m.type;O==="n"?(C=!0,O="g"):BM[O]||(A===void 0&&(A=12),P=!0,O="g"),(k||v==="0"&&j==="=")&&(k=!0,v="0",j="=");var _=(g&&g.prefix!==void 0?g.prefix:"")+(S==="$"?n:S==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),T=(S==="$"?r:/[%p]/.test(O)?l:"")+(g&&g.suffix!==void 0?g.suffix:""),$=BM[O],F=/[defgprs%]/.test(O);A=A===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function U(B){var V=_,X=T,Z,H,J;if(O==="c")X=$(B)+X,B="";else{B=+B;var oe=B<0||1/B<0;if(B=isNaN(B)?d:$(Math.abs(B),A),P&&(B=mxe(B)),oe&&+B==0&&b!=="+"&&(oe=!1),V=(oe?b==="("?b:u:b==="-"||b==="("?"":b)+V,X=(O==="s"&&!isNaN(B)&&Jy!==void 0?FM[8+Jy/3]:"")+X+(oe&&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 ye=V.length+B.length+X.length,I=ye<E?new Array(E-ye+1).join(v):"";switch(C&&k&&(B=t(I+B,I.length?E-X.length:1/0),I=""),j){case"<":B=V+B+X+I;break;case"=":B=V+I+B+X;break;case"^":B=I.slice(0,ye=I.length>>1)+V+B+X+I.slice(ye);break;default:B=I+V+B+X;break}return a(B)}return U.toString=function(){return m+""},U}function p(m,g){var v=Math.max(-8,Math.min(8,Math.floor(sd(g)/3)))*3,j=Math.pow(10,-v),b=f((m=$h(m),m.type="f",m),{suffix:FM[8+v/3]});return function(S){return b(j*S)}}return{format:f,formatPrefix:p}}var wg,BC,VU;vxe({thousands:",",grouping:[3],currency:["$",""]});function vxe(e){return wg=yxe(e),BC=wg.format,VU=wg.formatPrefix,wg}function xxe(e){return Math.max(0,-sd(Math.abs(e)))}function bxe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sd(t)/3)))*3-sd(Math.abs(e)))}function wxe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sd(t)-sd(e))+1}function QU(e,t,n,r){var i=iN(e,t,n),a;switch(r=$h(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=bxe(i,l))&&(r.precision=a),VU(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=wxe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=xxe(i))&&(r.precision=a-(r.type==="%")*2);break}}return BC(r)}function tl(e){var t=e.domain;return e.ticks=function(n){var r=t();return nN(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return QU(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,l=r[i],u=r[a],d,f,p=10;for(u<l&&(f=l,l=u,u=f,f=i,i=a,a=f);p-- >0;){if(f=rN(l,u,n),f===d)return r[i]=l,r[a]=u,t(r);if(f>0)l=Math.floor(l/f)*f,u=Math.ceil(u/f)*f;else if(f<0)l=Math.ceil(l*f)/f,u=Math.floor(u*f)/f;else break;d=f}return e},e}function WU(){var e=LC();return e.copy=function(){return fp(e,WU())},Yi.apply(e,arguments),tl(e)}function YU(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,Zy),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return YU(e).unknown(t)},e=arguments.length?Array.from(e,Zy):[0,1],tl(n)}function ZU(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function HM(e){return Math.log(e)}function KM(e){return Math.exp(e)}function jxe(e){return-Math.log(-e)}function Sxe(e){return-Math.exp(-e)}function Nxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function kxe(e){return e===10?Nxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Cxe(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 GM(e){return(t,n)=>-e(-t,n)}function UC(e){const t=e(HM,KM),n=t.domain;let r=10,i,a;function l(){return i=Cxe(r),a=kxe(r),n()[0]<0?(i=GM(i),a=GM(a),e(jxe,Sxe)):e(HM,KM),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let g=i(f),v=i(p),j,b;const S=u==null?10:+u;let k=[];if(!(r%1)&&v-g<S){if(g=Math.floor(g),v=Math.ceil(v),f>0){for(;g<=v;++g)for(j=1;j<r;++j)if(b=g<0?j/a(-g):j*a(g),!(b<f)){if(b>p)break;k.push(b)}}else for(;g<=v;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/a(-g):j*a(g),!(b<f)){if(b>p)break;k.push(b)}k.length*2<S&&(k=nN(f,p,S))}else k=nN(g,v,Math.min(v-g,S)).map(a);return m?k.reverse():k},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=$h(d)).precision==null&&(d.trim=!0),d=BC(d)),u===1/0)return d;const f=Math.max(1,r*u/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(ZU(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function XU(){const e=UC(Rx()).domain([1,10]);return e.copy=()=>fp(e,XU()).base(e.base()),Yi.apply(e,arguments),e}function VM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function QM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function qC(e){var t=1,n=e(VM(t),QM(t));return n.constant=function(r){return arguments.length?e(VM(t=+r),QM(t)):t},tl(n)}function JU(){var e=qC(Rx());return e.copy=function(){return fp(e,JU()).constant(e.constant())},Yi.apply(e,arguments)}function WM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Axe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Oxe(e){return e<0?-e*e:e*e}function FC(e){var t=e(Rr,Rr),n=1;function r(){return n===1?e(Rr,Rr):n===.5?e(Axe,Oxe):e(WM(n),WM(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},tl(t)}function HC(){var e=FC(Rx());return e.copy=function(){return fp(e,HC()).exponent(e.exponent())},Yi.apply(e,arguments),e}function Exe(){return HC.apply(null,arguments).exponent(.5)}function YM(e){return Math.sign(e)*e*e}function _xe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function eq(){var e=LC(),t=[0,1],n=!1,r;function i(a){var l=_xe(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(YM(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,Zy)).map(YM)),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 eq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Yi.apply(i,arguments),tl(i)}function tq(){var e=[],t=[],n=[],r;function i(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l<u;)n[l-1]=Rve(e,l/u);return a}function a(l){return l==null||isNaN(l=+l)?r:t[up(n,l)]}return a.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(Bo),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return tq().domain(e).range(t).unknown(r)},Yi.apply(a,arguments)}function nq(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(d){return d!=null&&d<=d?i[up(r,d,0,n)]:a}function u(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},l.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},l.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]]},l.unknown=function(d){return arguments.length&&(a=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return nq().domain([e,t]).range(i).unknown(a)},Yi.apply(tl(l),arguments)}function rq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[up(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 l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return rq().domain(e).range(t).unknown(n)},Yi.apply(i,arguments)}const dS=new Date,fS=new Date;function Yn(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 l=i(a),u=i.ceil(a);return a-l<u-a?l:u},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<l)||!(u>0))return d;let f;do d.push(f=new Date(+a)),t(a,u),e(a);while(f<a&&a<l);return d},i.filter=a=>Yn(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!a(l););else for(;--u>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(dS.setTime(+a),fS.setTime(+l),e(dS),e(fS),Math.floor(n(dS,fS))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const ev=Yn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ev.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Yn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ev);ev.range;const Ns=1e3,qi=Ns*60,ks=qi*60,Ts=ks*24,KC=Ts*7,ZM=Ts*30,hS=Ts*365,ql=Yn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getUTCSeconds());ql.range;const GC=Yn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ns)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getMinutes());GC.range;const VC=Yn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getUTCMinutes());VC.range;const QC=Yn(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());QC.range;const WC=Yn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ks)},(e,t)=>(t-e)/ks,e=>e.getUTCHours());WC.range;const hp=Yn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*qi)/Ts,e=>e.getDate()-1);hp.range;const Dx=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ts,e=>e.getUTCDate()-1);Dx.range;const iq=Yn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ts,e=>Math.floor(e/Ts));iq.range;function kc(e){return Yn(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)/KC)}const Mx=kc(0),tv=kc(1),zxe=kc(2),Pxe=kc(3),od=kc(4),Txe=kc(5),Rxe=kc(6);Mx.range;tv.range;zxe.range;Pxe.range;od.range;Txe.range;Rxe.range;function Cc(e){return Yn(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)/KC)}const Ix=Cc(0),nv=Cc(1),Dxe=Cc(2),Mxe=Cc(3),ld=Cc(4),Ixe=Cc(5),Lxe=Cc(6);Ix.range;nv.range;Dxe.range;Mxe.range;ld.range;Ixe.range;Lxe.range;const YC=Yn(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());YC.range;const ZC=Yn(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());ZC.range;const Rs=Yn(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());Rs.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Rs.range;const Ds=Yn(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());Ds.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Yn(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)});Ds.range;function aq(e,t,n,r,i,a){const l=[[ql,1,Ns],[ql,5,5*Ns],[ql,15,15*Ns],[ql,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,Ts],[r,2,2*Ts],[n,1,KC],[t,1,ZM],[t,3,3*ZM],[e,1,hS]];function u(f,p,m){const g=p<f;g&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),j=v?v.range(f,+p+1):[];return g?j.reverse():j}function d(f,p,m){const g=Math.abs(p-f)/m,v=PC(([,,S])=>S).right(l,g);if(v===l.length)return e.every(iN(f/hS,p/hS,m));if(v===0)return ev.every(Math.max(iN(f,p,m),1));const[j,b]=l[g/l[v-1][2]<l[v][2]/g?v-1:v];return j.every(b)}return[u,d]}const[$xe,Bxe]=aq(Ds,ZC,Ix,iq,WC,VC),[Uxe,qxe]=aq(Rs,YC,Mx,hp,QC,GC);function pS(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 mS(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 Gf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Fxe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,f=Vf(i),p=Qf(i),m=Vf(a),g=Qf(a),v=Vf(l),j=Qf(l),b=Vf(u),S=Qf(u),k=Vf(d),E=Qf(d),C={a:J,A:oe,b:ye,B:I,c:null,d:rI,e:rI,f:f0e,g:j0e,G:N0e,H:c0e,I:u0e,j:d0e,L:sq,m:h0e,M:p0e,p:M,q,Q:sI,s:oI,S:m0e,u:g0e,U:y0e,V:v0e,w:x0e,W:b0e,x:null,X:null,y:w0e,Y:S0e,Z:k0e,"%":aI},A={a:D,A:G,b:se,B:ne,c:null,d:iI,e:iI,f:E0e,g:$0e,G:U0e,H:C0e,I:A0e,j:O0e,L:lq,m:_0e,M:z0e,p:Ce,q:Se,Q:sI,s:oI,S:P0e,u:T0e,U:R0e,V:D0e,w:M0e,W:I0e,x:null,X:null,y:L0e,Y:B0e,Z:q0e,"%":aI},P={a:F,A:U,b:B,B:V,c:X,d:tI,e:tI,f:a0e,g:eI,G:JM,H:nI,I:nI,j:t0e,L:i0e,m:e0e,M:n0e,p:$,q:Jxe,Q:o0e,s:l0e,S:r0e,u:Qxe,U:Wxe,V:Yxe,w:Vxe,W:Zxe,x:Z,X:H,y:eI,Y:JM,Z:Xxe,"%":s0e};C.x=O(n,C),C.X=O(r,C),C.c=O(t,C),A.x=O(n,A),A.X=O(r,A),A.c=O(t,A);function O(ee,pe){return function(Ee){var Y=[],He=-1,Te=0,at=ee.length,Ve,Ht,Lt;for(Ee instanceof Date||(Ee=new Date(+Ee));++He<at;)ee.charCodeAt(He)===37&&(Y.push(ee.slice(Te,He)),(Ht=XM[Ve=ee.charAt(++He)])!=null?Ve=ee.charAt(++He):Ht=Ve==="e"?" ":"0",(Lt=pe[Ve])&&(Ve=Lt(Ee,Ht)),Y.push(Ve),Te=He+1);return Y.push(ee.slice(Te,He)),Y.join("")}}function _(ee,pe){return function(Ee){var Y=Gf(1900,void 0,1),He=T(Y,ee,Ee+="",0),Te,at;if(He!=Ee.length)return null;if("Q"in Y)return new Date(Y.Q);if("s"in Y)return new Date(Y.s*1e3+("L"in Y?Y.L:0));if(pe&&!("Z"in Y)&&(Y.Z=0),"p"in Y&&(Y.H=Y.H%12+Y.p*12),Y.m===void 0&&(Y.m="q"in Y?Y.q:0),"V"in Y){if(Y.V<1||Y.V>53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Te=mS(Gf(Y.y,0,1)),at=Te.getUTCDay(),Te=at>4||at===0?nv.ceil(Te):nv(Te),Te=Dx.offset(Te,(Y.V-1)*7),Y.y=Te.getUTCFullYear(),Y.m=Te.getUTCMonth(),Y.d=Te.getUTCDate()+(Y.w+6)%7):(Te=pS(Gf(Y.y,0,1)),at=Te.getDay(),Te=at>4||at===0?tv.ceil(Te):tv(Te),Te=hp.offset(Te,(Y.V-1)*7),Y.y=Te.getFullYear(),Y.m=Te.getMonth(),Y.d=Te.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),at="Z"in Y?mS(Gf(Y.y,0,1)).getUTCDay():pS(Gf(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(at+5)%7:Y.w+Y.U*7-(at+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,mS(Y)):pS(Y)}}function T(ee,pe,Ee,Y){for(var He=0,Te=pe.length,at=Ee.length,Ve,Ht;He<Te;){if(Y>=at)return-1;if(Ve=pe.charCodeAt(He++),Ve===37){if(Ve=pe.charAt(He++),Ht=P[Ve in XM?pe.charAt(He++):Ve],!Ht||(Y=Ht(ee,Ee,Y))<0)return-1}else if(Ve!=Ee.charCodeAt(Y++))return-1}return Y}function $(ee,pe,Ee){var Y=f.exec(pe.slice(Ee));return Y?(ee.p=p.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function F(ee,pe,Ee){var Y=v.exec(pe.slice(Ee));return Y?(ee.w=j.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function U(ee,pe,Ee){var Y=m.exec(pe.slice(Ee));return Y?(ee.w=g.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function B(ee,pe,Ee){var Y=k.exec(pe.slice(Ee));return Y?(ee.m=E.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function V(ee,pe,Ee){var Y=b.exec(pe.slice(Ee));return Y?(ee.m=S.get(Y[0].toLowerCase()),Ee+Y[0].length):-1}function X(ee,pe,Ee){return T(ee,t,pe,Ee)}function Z(ee,pe,Ee){return T(ee,n,pe,Ee)}function H(ee,pe,Ee){return T(ee,r,pe,Ee)}function J(ee){return l[ee.getDay()]}function oe(ee){return a[ee.getDay()]}function ye(ee){return d[ee.getMonth()]}function I(ee){return u[ee.getMonth()]}function M(ee){return i[+(ee.getHours()>=12)]}function q(ee){return 1+~~(ee.getMonth()/3)}function D(ee){return l[ee.getUTCDay()]}function G(ee){return a[ee.getUTCDay()]}function se(ee){return d[ee.getUTCMonth()]}function ne(ee){return u[ee.getUTCMonth()]}function Ce(ee){return i[+(ee.getUTCHours()>=12)]}function Se(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var pe=O(ee+="",C);return pe.toString=function(){return ee},pe},parse:function(ee){var pe=_(ee+="",!1);return pe.toString=function(){return ee},pe},utcFormat:function(ee){var pe=O(ee+="",A);return pe.toString=function(){return ee},pe},utcParse:function(ee){var pe=_(ee+="",!0);return pe.toString=function(){return ee},pe}}}var XM={"-":"",_:" ",0:"0"},sr=/^\s*\d+/,Hxe=/^%/,Kxe=/[\\^$*+?|[\]().{}]/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 Gxe(e){return e.replace(Kxe,"\\$&")}function Vf(e){return new RegExp("^(?:"+e.map(Gxe).join("|")+")","i")}function Qf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function Vxe(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Qxe(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Wxe(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Yxe(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Zxe(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function JM(e,t,n){var r=sr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function eI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Xxe(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 Jxe(e,t,n){var r=sr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function e0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function tI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function t0e(e,t,n){var r=sr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function nI(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function n0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function r0e(e,t,n){var r=sr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function i0e(e,t,n){var r=sr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function a0e(e,t,n){var r=sr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function s0e(e,t,n){var r=Hxe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function o0e(e,t,n){var r=sr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function l0e(e,t,n){var r=sr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function rI(e,t){return Et(e.getDate(),t,2)}function c0e(e,t){return Et(e.getHours(),t,2)}function u0e(e,t){return Et(e.getHours()%12||12,t,2)}function d0e(e,t){return Et(1+hp.count(Rs(e),e),t,3)}function sq(e,t){return Et(e.getMilliseconds(),t,3)}function f0e(e,t){return sq(e,t)+"000"}function h0e(e,t){return Et(e.getMonth()+1,t,2)}function p0e(e,t){return Et(e.getMinutes(),t,2)}function m0e(e,t){return Et(e.getSeconds(),t,2)}function g0e(e){var t=e.getDay();return t===0?7:t}function y0e(e,t){return Et(Mx.count(Rs(e)-1,e),t,2)}function oq(e){var t=e.getDay();return t>=4||t===0?od(e):od.ceil(e)}function v0e(e,t){return e=oq(e),Et(od.count(Rs(e),e)+(Rs(e).getDay()===4),t,2)}function x0e(e){return e.getDay()}function b0e(e,t){return Et(tv.count(Rs(e)-1,e),t,2)}function w0e(e,t){return Et(e.getFullYear()%100,t,2)}function j0e(e,t){return e=oq(e),Et(e.getFullYear()%100,t,2)}function S0e(e,t){return Et(e.getFullYear()%1e4,t,4)}function N0e(e,t){var n=e.getDay();return e=n>=4||n===0?od(e):od.ceil(e),Et(e.getFullYear()%1e4,t,4)}function k0e(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Et(t/60|0,"0",2)+Et(t%60,"0",2)}function iI(e,t){return Et(e.getUTCDate(),t,2)}function C0e(e,t){return Et(e.getUTCHours(),t,2)}function A0e(e,t){return Et(e.getUTCHours()%12||12,t,2)}function O0e(e,t){return Et(1+Dx.count(Ds(e),e),t,3)}function lq(e,t){return Et(e.getUTCMilliseconds(),t,3)}function E0e(e,t){return lq(e,t)+"000"}function _0e(e,t){return Et(e.getUTCMonth()+1,t,2)}function z0e(e,t){return Et(e.getUTCMinutes(),t,2)}function P0e(e,t){return Et(e.getUTCSeconds(),t,2)}function T0e(e){var t=e.getUTCDay();return t===0?7:t}function R0e(e,t){return Et(Ix.count(Ds(e)-1,e),t,2)}function cq(e){var t=e.getUTCDay();return t>=4||t===0?ld(e):ld.ceil(e)}function D0e(e,t){return e=cq(e),Et(ld.count(Ds(e),e)+(Ds(e).getUTCDay()===4),t,2)}function M0e(e){return e.getUTCDay()}function I0e(e,t){return Et(nv.count(Ds(e)-1,e),t,2)}function L0e(e,t){return Et(e.getUTCFullYear()%100,t,2)}function $0e(e,t){return e=cq(e),Et(e.getUTCFullYear()%100,t,2)}function B0e(e,t){return Et(e.getUTCFullYear()%1e4,t,4)}function U0e(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ld(e):ld.ceil(e),Et(e.getUTCFullYear()%1e4,t,4)}function q0e(){return"+0000"}function aI(){return"%"}function sI(e){return+e}function oI(e){return Math.floor(+e/1e3)}var vu,uq,dq;F0e({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 F0e(e){return vu=Fxe(e),uq=vu.format,vu.parse,dq=vu.utcFormat,vu.utcParse,vu}function H0e(e){return new Date(e)}function K0e(e){return e instanceof Date?+e:+new Date(+e)}function XC(e,t,n,r,i,a,l,u,d,f){var p=LC(),m=p.invert,g=p.domain,v=f(".%L"),j=f(":%S"),b=f("%I:%M"),S=f("%I %p"),k=f("%a %d"),E=f("%b %d"),C=f("%B"),A=f("%Y");function P(O){return(d(O)<O?v:u(O)<O?j:l(O)<O?b:a(O)<O?S:r(O)<O?i(O)<O?k:E:n(O)<O?C:A)(O)}return p.invert=function(O){return new Date(m(O))},p.domain=function(O){return arguments.length?g(Array.from(O,K0e)):g().map(H0e)},p.ticks=function(O){var _=g();return e(_[0],_[_.length-1],O??10)},p.tickFormat=function(O,_){return _==null?P:f(_)},p.nice=function(O){var _=g();return(!O||typeof O.range!="function")&&(O=t(_[0],_[_.length-1],O??10)),O?g(ZU(_,O)):p},p.copy=function(){return fp(p,XC(e,t,n,r,i,a,l,u,d,f))},p}function G0e(){return Yi.apply(XC(Uxe,qxe,Rs,YC,Mx,hp,QC,GC,ql,uq).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function V0e(){return Yi.apply(XC($xe,Bxe,Ds,ZC,Ix,Dx,WC,VC,ql,dq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Lx(){var e=0,t=1,n,r,i,a,l=Rr,u=!1,d;function f(m){return m==null||isNaN(m=+m)?d:l(i===0?.5:(m=(a(m)-n)*i,u?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?(u=!!m,f):u},f.interpolator=function(m){return arguments.length?(l=m,f):l};function p(m){return function(g){var v,j;return arguments.length?([v,j]=g,l=m(v,j),f):[l(0),l(1)]}}return f.range=p(Ed),f.rangeRound=p(IC),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 nl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function fq(){var e=tl(Lx()(Rr));return e.copy=function(){return nl(e,fq())},Us.apply(e,arguments)}function hq(){var e=UC(Lx()).domain([1,10]);return e.copy=function(){return nl(e,hq()).base(e.base())},Us.apply(e,arguments)}function pq(){var e=qC(Lx());return e.copy=function(){return nl(e,pq()).constant(e.constant())},Us.apply(e,arguments)}function JC(){var e=FC(Lx());return e.copy=function(){return nl(e,JC()).exponent(e.exponent())},Us.apply(e,arguments)}function Q0e(){return JC.apply(null,arguments).exponent(.5)}function mq(){var e=[],t=Rr;function n(r){if(r!=null&&!isNaN(r=+r))return t((up(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(Bo),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)=>Tve(e,a/r))},n.copy=function(){return mq(t).domain(e)},Us.apply(n,arguments)}function $x(){var e=0,t=.5,n=1,r=1,i,a,l,u,d,f=Rr,p,m=!1,g;function v(b){return isNaN(b=+b)?g:(b=.5+((b=+p(b))-a)*(r*b<r*a?u: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),l=p(n=+n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-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 j(b){return function(S){var k,E,C;return arguments.length?([k,E,C]=S,f=sxe(b,[k,E,C]),v):[f(0),f(.5),f(1)]}}return v.range=j(Ed),v.rangeRound=j(IC),v.unknown=function(b){return arguments.length?(g=b,v):g},function(b){return p=b,i=b(e),a=b(t),l=b(n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v}}function gq(){var e=tl($x()(Rr));return e.copy=function(){return nl(e,gq())},Us.apply(e,arguments)}function yq(){var e=UC($x()).domain([.1,1,10]);return e.copy=function(){return nl(e,yq()).base(e.base())},Us.apply(e,arguments)}function vq(){var e=qC($x());return e.copy=function(){return nl(e,vq()).constant(e.constant())},Us.apply(e,arguments)}function eA(){var e=FC($x());return e.copy=function(){return nl(e,eA()).exponent(e.exponent())},Us.apply(e,arguments)}function W0e(){return eA.apply(null,arguments).exponent(.5)}const xq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:RC,scaleDiverging:gq,scaleDivergingLog:yq,scaleDivergingPow:eA,scaleDivergingSqrt:W0e,scaleDivergingSymlog:vq,scaleIdentity:YU,scaleImplicit:aN,scaleLinear:WU,scaleLog:XU,scaleOrdinal:TC,scalePoint:Mve,scalePow:HC,scaleQuantile:tq,scaleQuantize:nq,scaleRadial:eq,scaleSequential:fq,scaleSequentialLog:hq,scaleSequentialPow:JC,scaleSequentialQuantile:mq,scaleSequentialSqrt:Q0e,scaleSequentialSymlog:pq,scaleSqrt:Exe,scaleSymlog:JU,scaleThreshold:rq,scaleTime:G0e,scaleUtc:V0e,tickFormat:QU},Symbol.toStringTag,{value:"Module"}));function Y0e(e){var t=xq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(ep(e));if(n in t&&typeof t[n]=="function")return t[n]()}function lI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=Y0e(e);if(r!=null)return r.domain(t).range(n),r}}function tA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?lI(e.scale,n,r):lI(t,n,r)}function Z0e(e){return"scale".concat(ep(e))}function X0e(e){return Z0e(e)in xq}var bq=(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 X0e(r)?r:"point"}};function J0e(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 wq(e,t){if(e){var n=t??e.domain(),r=n.map(a=>{var l;return(l=e(a))!==null&&l!==void 0?l:0}),i=e.range();if(!(n.length===0||i.length<2))return a=>{var l,u,d=J0e(r,a);if(d<=0)return n[0];if(d>=n.length)return n[n.length-1];var f=(l=r[d-1])!==null&&l!==void 0?l:0,p=(u=r[d])!==null&&u!==void 0?u:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function ebe(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):wq(e,void 0)}function cI(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 rv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cI(Object(n),!0).forEach(function(r){tbe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tbe(e,t,n){return(t=nbe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nbe(e){var t=rbe(e,"string");return typeof t=="symbol"?t:t+""}function rbe(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 cN=[0,"auto"],Gn={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"},jq=(e,t)=>e.cartesianAxis.xAxis[t],qs=(e,t)=>{var n=jq(e,t);return n??Gn},Vn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:cN,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:rp},Sq=(e,t)=>e.cartesianAxis.yAxis[t],Fs=(e,t)=>{var n=Sq(e,t);return n??Vn},ibe={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:""},nA=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??ibe},Lr=(e,t,n)=>{switch(t){case"xAxis":return qs(e,n);case"yAxis":return Fs(e,n);case"zAxis":return nA(e,n);case"angleAxis":return OC(e,n);case"radiusAxis":return EC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},abe=(e,t,n)=>{switch(t){case"xAxis":return qs(e,n);case"yAxis":return Fs(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},pp=(e,t,n)=>{switch(t){case"xAxis":return qs(e,n);case"yAxis":return Fs(e,n);case"angleAxis":return OC(e,n);case"radiusAxis":return EC(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Nq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function kq(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 mp=e=>e.graphicalItems.cartesianItems,sbe=re([ir,Ex],kq),Cq=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),_d=re([mp,Lr,sbe],Cq,{memoizeOptions:{resultEqualityCheck:Tx}}),Aq=re([_d],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(zx)),Oq=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),obe=re([_d],Oq),Eq=e=>e.map(t=>t.data).filter(Boolean).flat(1),lbe=re([_d],e=>e.some(t=>!t.data)),_q=re([_d],Eq,{memoizeOptions:{resultEqualityCheck:Tx}}),zq=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},rA=re([_q,cp],zq),cbe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:vn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:vn(i,r)}))):e.map(r=>({value:r})),Pq=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:u,dataEndIndex:d}=r,f=cbe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=l.slice(u,d+1),m=p.map(g=>({value:vn(g,t.dataKey)})).filter(g=>g.value!=null);return[...m,...f]}return f},gp=re([rA,Lr,_d,cp,lbe,_q],Pq);function Ku(e){if(Fa(e)||e instanceof Date){var t=Number(e);if(ht(t))return t}}function uI(e){if(Array.isArray(e)){var t=[Ku(e[0]),Ku(e[1])];return La(t)?t:void 0}var n=Ku(e);if(n!=null)return[n,n]}function Ga(e){return e.map(Ku).filter(Yr)}function ube(e,t){var n=Ku(e),r=Ku(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var dbe=re([gp],e=>e?.map(t=>t.value).sort(ube));function Tq(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function fbe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!da(t))r=t;else if(Array.isArray(t)){var i=Ga(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ga(n.flatMap(a=>{var l=vn(e,a.dataKey),u,d;if(Array.isArray(l)?[u,d]=l:u=d=l,!(!ht(u)||!ht(d)))return[r-u,r+d]}))}var Zn=e=>{var t=ar(e),n=Od(e);return pp(e,t,n)},cd=re([Zn],e=>e?.dataKey),hbe=re([Aq,cp,Zn],$U),Rq=(e,t,n,r)=>{var i={},a=t.reduce((l,u)=>{if(u.stackId==null)return l;var d=l[u.stackId];return d==null&&(d=[]),d.push(u),l[u.stackId]=d,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[u,d]=l,f=r?[...d].reverse():d,p=f.map(_x);return[u,{stackedData:Wpe(e,p,n),graphicalItems:f}]}))},iv=re([hbe,Aq,kx,PU],Rq),Dq=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=Jpe(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},pbe=re([Lr],e=>e.allowDataOverflow),iA=e=>{var t;if(e==null||!("domain"in e))return cN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ga(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:cN},Mq=re([Lr],iA),Iq=re([Mq,pbe],xU),mbe=re([iv,xa,ir,Iq],Dq,{memoizeOptions:{resultEqualityCheck:Px}}),aA=e=>e.errorBars,gbe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>Tq(n,r)),av=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(),l=Math.min(...a),u=Math.max(...a);return[l,u]}},Lq=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],u,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:l,g=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>Tq(a,v));m.forEach(v=>{var j,b=vn(v,(j=n.dataKey)!==null&&j!==void 0?j:f.dataKey),S=fbe(v,b,g);if(S.length>=2){var k=Math.min(...S),E=Math.max(...S);(u==null||k<u)&&(u=k),(d==null||E>d)&&(d=E)}var C=uI(b);C!=null&&(u=u==null?C[0]:Math.min(u,C[0]),d=d==null?C[1]:Math.max(d,C[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=uI(vn(f,n.dataKey));p!=null&&(u=u==null?p[0]:Math.min(u,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),ht(u)&&ht(d))return[u,d]},ybe=re([rA,Lr,obe,aA,ir,ive],Lq,{memoizeOptions:{resultEqualityCheck:Px}});function vbe(e){var{value:t}=e;if(Fa(t)||t instanceof Date)return t}var xbe=(e,t,n)=>{var r=e.map(vbe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&QB(r))?yU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},$q=e=>e.referenceElements.dots,zd=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),bbe=re([$q,ir,Ex],zd),Bq=e=>e.referenceElements.areas,wbe=re([Bq,ir,Ex],zd),Uq=e=>e.referenceElements.lines,jbe=re([Uq,ir,Ex],zd),qq=(e,t)=>{if(e!=null){var n=Ga(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Sbe=re(bbe,ir,qq),Fq=(e,t)=>{if(e!=null){var n=Ga(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)]}},Nbe=re([wbe,ir],Fq);function kbe(e){var t;if(e.x!=null)return Ga([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ga(n)}function Cbe(e){var t;if(e.y!=null)return Ga([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ga(n)}var Hq=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?kbe(r):Cbe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Abe=re([jbe,ir],Hq),Obe=re(Sbe,Abe,Nbe,(e,t,n)=>av(e,n,t)),Kq=(e,t,n,r,i,a,l,u)=>{if(n!=null)return n;var d=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",f=d?av(r,a,i):av(a,i);return sve(t,f,e.allowDataOverflow)},Ebe=re([Lr,Mq,Iq,mbe,ybe,Obe,_t,ir],Kq,{memoizeOptions:{resultEqualityCheck:Px}}),_be=[0,1],Gq=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:u,type:d}=e,f=va(t,a);if(f&&u==null){var p;return yU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?xbe(r,e,f):i==="expand"&&!f?_be:l}},sA=re([Lr,_t,rA,gp,kx,ir,Ebe],Gq),Pd=re([Lr,Nq,kC],bq),Vq=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=iA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&La(e)){if(a)return bM(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return wM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&La(e))return bM(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&La(e))return wM(e,t.tickCount,t.allowDecimals,"adaptive")}}},oA=re([sA,pp,Pd],Vq),Qq=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&La(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],u=(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(l,u),Math.max(d,f)]}return t},zbe=re([Lr,sA,oA,ir],Qq),Pbe=re(gp,Lr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ga(e.map(m=>m.value))).sort((m,g)=>m-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var u=0;u<r.length-1;u++){var d=r[u],f=r[u+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/l}}),Wq=re(Pbe,_t,zU,nr,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!ht(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=fa(n,e*a),u=e*a/2;return u-l-(u-l)/a*l}return 0}),Tbe=(e,t,n)=>{var r=qs(e,t);return r==null||typeof r.padding!="string"?0:Wq(e,"xAxis",t,n,r.padding)},Rbe=(e,t,n)=>{var r=Fs(e,t);return r==null||typeof r.padding!="string"?0:Wq(e,"yAxis",t,n,r.padding)},Dbe=re(qs,Tbe,(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}}),Mbe=re(Fs,Rbe,(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}}),Ibe=re([nr,Dbe,bx,xx,(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]}),Lbe=re([nr,_t,Mbe,bx,xx,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:l}=i;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),yp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return Ibe(e,n,r);case"yAxis":return Lbe(e,n,r);case"zAxis":return(i=nA(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return MU(e);case"radiusAxis":return IU(e,n);default:return}},Yq=re([Lr,yp],Cx),$be=re([Pd,zbe],wve),lA=re([Lr,Pd,$be,Yq],tA),Zq=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=va(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},cA=re([_t,gp,pp,ir],Zq),Bx=re([lA],zC);re([lA],ebe);re([lA,dbe],wq);re([_d,aA,ir],gbe);function Xq(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Ux=(e,t)=>t,qx=(e,t,n)=>n,Bbe=re(yx,Ux,qx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Xq)),Ube=re(vx,Ux,qx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Xq)),Jq=(e,t)=>({width:e.width,height:t.height}),qbe=(e,t)=>{var n=typeof t.width=="number"?t.width:rp;return{width:n,height:e.height}},e8=re(nr,qs,Jq),Fbe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},Hbe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},Kbe=re(Bs,nr,Bbe,Ux,qx,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=Jq(t,u);l==null&&(l=Fbe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[u.id]=l-Number(f)*d.height,l+=(f?-1:1)*d.height}),a}),Gbe=re($s,nr,Ube,Ux,qx,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=qbe(t,u);l==null&&(l=Hbe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[u.id]=l-Number(f)*d.width,l+=(f?-1:1)*d.width}),a}),Vbe=(e,t)=>{var n=qs(e,t);if(n!=null)return Kbe(e,n.orientation,n.mirror)},Qbe=re([nr,qs,Vbe,(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}}}),Wbe=(e,t)=>{var n=Fs(e,t);if(n!=null)return Gbe(e,n.orientation,n.mirror)},Ybe=re([nr,Fs,Wbe,(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}}}),t8=re(nr,Fs,(e,t)=>{var n=typeof t.width=="number"?t.width:rp;return{width:n,height:e.height}}),dI=(e,t,n)=>{switch(t){case"xAxis":return e8(e,n).width;case"yAxis":return t8(e,n).height;default:return}},n8=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,u=va(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(l&&u&&a==="category"&&i&&QB(f))return d}},uA=re([_t,gp,Lr,ir],n8),fI=re([_t,abe,Pd,Bx,uA,cA,yp,oA,ir],(e,t,n,r,i,a,l,u,d)=>{if(t!=null){var f=va(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:u,range:l,realScaleType:n,scale:r}}}),Zbe=(e,t,n,r,i,a,l,u,d)=>{if(!(t==null||r==null)){var f=va(e,d),{type:p,ticks:m,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,j=p==="category"&&r.bandwidth?r.bandwidth()/v:0;j=d==="angleAxis"&&a!=null&&a.length>=2?Wr(a[0]-a[1])*2*j:j;var b=m||i;return b?b.map((S,k)=>{var E=l?l.indexOf(S):S,C=r.map(E);return ht(C)?{index:k,coordinate:C+j,value:S,offset:j}:null}).filter(Yr):f&&u?u.map((S,k)=>{var E=r.map(S);return ht(E)?{coordinate:E+j,value:S,index:k,offset:j}:null}).filter(Yr):r.ticks?r.ticks(g).map((S,k)=>{var E=r.map(S);return ht(E)?{coordinate:E+j,value:S,index:k,offset:j}:null}).filter(Yr):r.domain().map((S,k)=>{var E=r.map(S);return ht(E)?{coordinate:E+j,value:l?l[S]:S,index:k,offset:j}:null}).filter(Yr)}},r8=re([_t,pp,Pd,Bx,oA,yp,uA,cA,ir],Zbe),Xbe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=va(e,l),{tickCount:d}=t,f=0;return f=l==="angleAxis"&&r?.length>=2?Wr(r[0]-r[1])*2*f:f,u&&a?a.map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(Yr):n.ticks?n.ticks(d).map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:p,index:m,offset:f}:null}).filter(Yr):n.domain().map((p,m)=>{var g=n.map(p);return ht(g)?{coordinate:g+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(Yr)}},Va=re([_t,pp,Bx,yp,uA,cA,ir],Xbe),Qa=re(Lr,Bx,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})}),Jbe=re([Lr,Pd,sA,Yq],tA),ewe=re([Jbe],zC);re((e,t,n)=>nA(e,n),ewe,(e,t)=>{if(!(e==null||t==null))return rv(rv({},e),{},{scale:t})});var twe=re([_t,yx,vx],(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}}),nwe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};re([nwe],e=>{if(!(!e||e.length===0))return t=>{var n,r=1/0,i=e[0];for(var a of e){var l=Math.abs(a.coordinate-t);l<r&&(r=l,i=a)}return(n=i)===null||n===void 0?void 0:n.value}});var i8=e=>e.options.defaultTooltipEventType,a8=e=>e.options.validateTooltipEventTypes;function s8(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function vp(e,t){var n=i8(e),r=a8(e);return s8(t,n,r)}function rwe(e){return Ue(t=>vp(t,e))}var o8=(e,t)=>{var n,r=Number(t);if(!(da(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},iwe=e=>e.tooltip.settings,_o={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},awe={itemInteraction:{click:_o,hover:_o},axisInteraction:{click:_o,hover:_o},keyboardInteraction:_o,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}},l8=Or({name:"tooltip",initialState:awe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:an()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ui(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:an()},removeTooltipEntrySettings:{reducer(e,t){var n=Ui(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:swe,replaceTooltipEntrySettings:owe,removeTooltipEntrySettings:lwe,setTooltipSettingsState:cwe,setActiveMouseOverItemIndex:c8,mouseLeaveItem:uwe,mouseLeaveChart:u8,setActiveClickItemIndex:dwe,setMouseOverAxisIndex:d8,setMouseClickAxisIndex:fwe,setSyncInteraction:nh,setKeyboardInteraction:sv}=l8.actions,hwe=l8.reducer;function hI(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 jg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hI(Object(n),!0).forEach(function(r){pwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pwe(e,t,n){return(t=mwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mwe(e){var t=gwe(e,"string");return typeof t=="symbol"?t:t+""}function gwe(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 ywe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function vwe(e){return e.index!=null}var f8=(e,t,n,r)=>{if(t==null)return _o;var i=ywe(e,t,n);if(i==null)return _o;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(vwe(i)){if(a)return jg(jg({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return jg(jg({},_o),{},{coordinate:i.coordinate})};function xwe(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 bwe(e,t){var n=xwe(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function wwe(e,t,n){if(n==null||t==null)return!0;var r=vn(e,t);return r==null||!La(n)?!0:bwe(r,n)}var hh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!ht(a))return i;var l=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(l,Math.min(a,u)),f=t[d];return f==null||wwe(f,n,r)?String(d):null},h8=(e,t,n,r,i,a,l)=>{if(a!=null){var u=l[0],d=u?.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}}},p8=(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(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},m8=e=>e.options.tooltipPayloadSearcher,Td=e=>e.tooltip;function pI(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 mI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pI(Object(n),!0).forEach(function(r){jwe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jwe(e,t,n){return(t=Swe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Swe(e){var t=Nwe(e,"string");return typeof t=="symbol"?t:t+""}function Nwe(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 kwe(e){if(typeof e=="string"||typeof e=="number")return e}function Cwe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function Awe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function gI(e){if(typeof e=="string")return e}function Owe(e){if(!(e==null||typeof e!="object")){var t="name"in e?kwe(e.name):void 0,n="unit"in e?Cwe(e.unit):void 0,r="dataKey"in e?Awe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?gI(e.color):void 0,l="fill"in e?gI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function Ewe(e,t){return e??t}var g8=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((g,v)=>{var j,{dataDefinedOnItem:b,settings:S}=v,k=Ewe(b,u),E=Array.isArray(k)?F6(k,f,p):k,C=(j=S?.dataKey)!==null&&j!==void 0?j:r,A=S?.nameKey,P;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?P=WB(E,r,i):P=a(E,t,d,A),Array.isArray(P))P.forEach(_=>{var T,$,F=Owe(_),U=F?.name,B=F?.dataKey,V=F?.payload,X=mI(mI({},S),{},{name:U,unit:F?.unit,color:(T=F?.color)!==null&&T!==void 0?T:S?.color,fill:($=F?.fill)!==null&&$!==void 0?$:S?.fill});g.push(lD({tooltipEntrySettings:X,dataKey:B,payload:V,value:vn(V,B),name:U==null?void 0:String(U)}))});else{var O;g.push(lD({tooltipEntrySettings:S,dataKey:C,payload:P,value:vn(P,C),name:(O=vn(P,A))!==null&&O!==void 0?O:S?.name}))}return g},m)}},dA=re([Zn,Nq,kC],bq),_we=re([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),zwe=re([ar,Od],kq),Ac=re([_we,Zn,zwe],Cq,{memoizeOptions:{resultEqualityCheck:Tx}}),Pwe=re([Ac],e=>e.filter(zx)),y8=re([Ac],Eq,{memoizeOptions:{resultEqualityCheck:Tx}}),Twe=re([Ac],e=>e.some(t=>!t.data)),dc=re([y8,xa],zq),Rwe=re([Pwe,xa,Zn],$U),fA=re([dc,Zn,Ac,xa,Twe,y8],Pq),v8=re([Zn],iA),Dwe=re([Zn],e=>e.allowDataOverflow),x8=re([v8,Dwe],xU),Mwe=re([Ac],e=>e.filter(zx)),Iwe=re([Rwe,Mwe,kx,PU],Rq),Lwe=re([Iwe,xa,ar,x8],Dq),$we=re([Ac],Oq),Bwe=re([dc,Zn,$we,aA,ar,ave],Lq,{memoizeOptions:{resultEqualityCheck:Px}}),Uwe=re([$q,ar,Od],zd),qwe=re([Uwe,ar],qq),Fwe=re([Bq,ar,Od],zd),Hwe=re([Fwe,ar],Fq),Kwe=re([Uq,ar,Od],zd),Gwe=re([Kwe,ar],Hq),Vwe=re([qwe,Gwe,Hwe],av),Qwe=re([Zn,v8,x8,Lwe,Bwe,Vwe,_t,ar],Kq),ud=re([Zn,_t,dc,fA,kx,ar,Qwe],Gq),Wwe=re([ud,Zn,dA],Vq),Ywe=re([Zn,ud,Wwe,ar],Qq),b8=e=>{var t=ar(e),n=Od(e),r=!1;return yp(e,t,n,r)},w8=re([Zn,b8],Cx),Zwe=re([Zn,dA,Ywe,w8],tA),j8=re([Zwe],zC),Xwe=re([_t,fA,Zn,ar],n8),Jwe=re([_t,fA,Zn,ar],Zq),eje=(e,t,n,r,i,a,l,u)=>{if(t){var{type:d}=t,f=va(e,u);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=u==="angleAxis"&&i!=null&&i?.length>=2?Wr(i[0]-i[1])*2*m:m,f&&l?l.map((g,v)=>{var j=r.map(g);return ht(j)?{coordinate:j+m,value:g,index:v,offset:m}:null}).filter(Yr):r.domain().map((g,v)=>{var j=r.map(g);return ht(j)?{coordinate:j+m,value:a?a[g]:g,index:v,offset:m}:null}).filter(Yr)}}},Hs=re([_t,Zn,dA,j8,b8,Xwe,Jwe,ar],eje),hA=re([i8,a8,iwe],(e,t,n)=>s8(n.shared,e,t)),S8=e=>e.tooltip.settings.trigger,pA=e=>e.tooltip.settings.defaultIndex,xp=re([Td,hA,S8,pA],f8),fc=re([xp,dc,cd,ud],hh),N8=re([Hs,fc],o8),k8=re([xp],e=>{if(e)return e.dataKey}),tje=re([xp],e=>{if(e)return e.graphicalItemId}),C8=re([Td,hA,S8,pA],p8),nje=re([$s,Bs,_t,nr,Hs,pA,C8],h8),rje=re([xp,nje],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ije=re([xp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),aje=re([C8,fc,xa,cd,N8,m8,hA],g8),sje=re([aje],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(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 vI(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){oje(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 oje(e,t,n){return(t=lje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lje(e){var t=cje(e,"string");return typeof t=="symbol"?t:t+""}function cje(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 uje=()=>Ue(Zn),dje=()=>{var e=uje(),t=Ue(Hs),n=Ue(j8);return Ko(!e||!n?void 0:vI(vI({},e),{},{scale:n}),t)};function xI(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 xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(n),!0).forEach(function(r){fje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fje(e,t,n){return(t=hje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hje(e){var t=pje(e,"string");return typeof t=="symbol"?t:t+""}function pje(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 mje=(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}},gje=(e,t,n,r)=>{var i=t.find(f=>f&&f.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return xu(xu(xu({},r),mr(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var u=i.coordinate,{angle:d}=r;return xu(xu(xu({},r),mr(r.cx,r.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function yje(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 A8=(e,t,n,r,i)=>{var a,l=(a=t?.length)!==null&&a!==void 0?a:0;if(l<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<l;u++){var d,f,p,m,g,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(f=n[l-1])===null||f===void 0?void 0:f.coordinate,j=(p=n[u])===null||p===void 0?void 0:p.coordinate,b=u>=l-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(g=n[u+1])===null||g===void 0?void 0:g.coordinate,S=void 0;if(!(v==null||j==null||b==null))if(Wr(j-v)!==Wr(b-j)){var k=[];if(Wr(b-j)===Wr(i[1]-i[0])){S=b;var E=j+i[1]-i[0];k[0]=Math.min(E,(E+v)/2),k[1]=Math.max(E,(E+v)/2)}else{S=v;var C=b+i[1]-i[0];k[0]=Math.min(j,(C+j)/2),k[1]=Math.max(j,(C+j)/2)}var A=[Math.min(j,(S+j)/2),Math.max(j,(S+j)/2)];if(e>A[0]&&e<=A[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}else{var O=Math.min(v,b),_=Math.max(v,b);if(e>(O+j)/2&&e<=(_+j)/2){var T;return(T=n[u])===null||T===void 0?void 0:T.index}}}else if(t)for(var $=0;$<l;$++){var F=t[$];if(F!=null){var U=t[$+1],B=t[$-1];if($===0&&U!=null&&e<=(F.coordinate+U.coordinate)/2||$===l-1&&B!=null&&e>(F.coordinate+B.coordinate)/2||$>0&&$<l-1&&B!=null&&U!=null&&e>(F.coordinate+B.coordinate)/2&&e<=(F.coordinate+U.coordinate)/2)return F.index}}return-1},O8=()=>Ue(kC),mA=(e,t)=>t,E8=(e,t,n)=>n,gA=(e,t,n,r)=>r,vje=re(Hs,e=>ox(e,t=>t.coordinate)),yA=re([Td,mA,E8,gA],f8),vA=re([yA,dc,cd,ud],hh),xje=(e,t,n)=>{if(t!=null){var r=Td(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},_8=re([Td,mA,E8,gA],p8),ov=re([$s,Bs,_t,nr,Hs,gA,_8],h8),bje=re([yA,ov],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),z8=re([Hs,vA],o8),wje=re([_8,vA,xa,cd,z8,m8,mA],g8),jje=re([yA,vA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Sje=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&yje(e,l)){var u=eme(e,t),d=A8(u,a,i,n,r),f=mje(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},Nje=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var u=Qye(e,n);if(u){var d=tme(u,t),f=A8(d,l,a,r,i),p=gje(t,a,f,u);return{activeIndex:String(f),activeCoordinate:p}}}},kje=(e,t,n,r,i,a,l,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Sje(e,t,r,i,a,l,u):Nje(e,t,n,r,i,a,l)},Cje=re(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}}),Aje=re(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Wn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:bve}});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 wI(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){Oje(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 Oje(e,t,n){return(t=Eje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eje(e){var t=_je(e,"string");return typeof t=="symbol"?t:t+""}function _je(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 zje={},Pje={zIndexMap:Object.values(Wn).reduce((e,t)=>wI(wI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),zje)},Tje=new Set(Object.values(Wn));function Rje(e){return Tje.has(e)}var P8=Or({name:"zIndex",initialState:Pje,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&&!Rje(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:Dje,unregisterZIndexPortal:gS,registerZIndexPortalElement:Mje,unregisterZIndexPortalElement:Ije}=P8.actions,Lje=P8.reducer;function bi(e){var{zIndex:t,children:n}=e,r=Rme(),i=r&&t!==void 0&&t!==0,a=rr(),l=x.useRef(void 0),u=x.useRef(new Set),d=ln(),f=Ue(m=>Cje(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=u.current;m.forEach(v=>{d(gS({zIndex:v}))}),m.clear(),l.current=void 0;return}if(u.current.has(t)||(d(Dje({zIndex:t})),u.current.add(t)),f){l.current=f;var g=u.current;g.forEach(v=>{v!==t&&(d(gS({zIndex:v})),g.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=u.current;return()=>{m.forEach(g=>{d(gS({zIndex:g}))}),m.clear()}},[d]),!i)return n;var p=f??l.current;return p?gc.createPortal(n,p):null}function uN(){return uN=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},uN.apply(null,arguments)}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 Sg(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){$je(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 $je(e,t,n){return(t=Bje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bje(e){var t=Uje(e,"string");return typeof t=="symbol"?t:t+""}function Uje(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 qje(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function Fje(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:u,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,g=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var j,b,S;if(p==="ScatterChart")j=m,b=lye,S=Wn.cursorLine;else if(p==="BarChart")j=cye(u,m,a,l),b=hU,S=Wn.cursorRectangle;else if(u==="radial"&&ZB(m)){var{cx:k,cy:E,radius:C,startAngle:A,endAngle:P}=pU(m);j={cx:k,cy:E,startAngle:A,endAngle:P,innerRadius:C,outerRadius:C},b=gU,S=Wn.cursorLine}else j={points:Xye(u,m,a)},b=fh,S=Wn.cursorLine;var O=typeof d=="object"&&"className"in d?d.className:void 0,_=Sg(Sg(Sg(Sg({stroke:"#ccc",pointerEvents:"none"},a),j),Jh(d)),{},{payload:g,payloadIndex:v,className:Ot("recharts-tooltip-cursor",O)});return x.createElement(bi,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:S},x.createElement(qje,{cursor:d,cursorComp:b,cursorProps:_}))}function Hje(e){var t=dje(),n=Z6(),r=el(),i=O8();return t==null||n==null||r==null||i==null?null:x.createElement(Fje,uN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var T8=x.createContext(null),Kje=()=>x.useContext(T8),yS={exports:{}},SI;function Gje(){return SI||(SI=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,g){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,g),j=n?n+f:f;return d._events[j]?d._events[j].fn?d._events[j]=[d._events[j],v]:d._events[j].push(v):(d._events[j]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function u(){this._events=new r,this._eventsCount=0}u.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},u.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 g=0,v=m.length,j=new Array(v);g<v;g++)j[g]=m[g].fn;return j},u.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},u.prototype.emit=function(f,p,m,g,v,j){var b=n?n+f:f;if(!this._events[b])return!1;var S=this._events[b],k=arguments.length,E,C;if(S.fn){switch(S.once&&this.removeListener(f,S.fn,void 0,!0),k){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,p),!0;case 3:return S.fn.call(S.context,p,m),!0;case 4:return S.fn.call(S.context,p,m,g),!0;case 5:return S.fn.call(S.context,p,m,g,v),!0;case 6:return S.fn.call(S.context,p,m,g,v,j),!0}for(C=1,E=new Array(k-1);C<k;C++)E[C-1]=arguments[C];S.fn.apply(S.context,E)}else{var A=S.length,P;for(C=0;C<A;C++)switch(S[C].once&&this.removeListener(f,S[C].fn,void 0,!0),k){case 1:S[C].fn.call(S[C].context);break;case 2:S[C].fn.call(S[C].context,p);break;case 3:S[C].fn.call(S[C].context,p,m);break;case 4:S[C].fn.call(S[C].context,p,m,g);break;default:if(!E)for(P=1,E=new Array(k-1);P<k;P++)E[P-1]=arguments[P];S[C].fn.apply(S[C].context,E)}}return!0},u.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},u.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},u.prototype.removeListener=function(f,p,m,g){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return l(this,v),this;var j=this._events[v];if(j.fn)j.fn===p&&(!g||j.once)&&(!m||j.context===m)&&l(this,v);else{for(var b=0,S=[],k=j.length;b<k;b++)(j[b].fn!==p||g&&!j[b].once||m&&j[b].context!==m)&&S.push(j[b]);S.length?this._events[v]=S.length===1?S[0]:S:l(this,v)}return this},u.prototype.removeAllListeners=function(f){var p;return f?(p=n?n+f:f,this._events[p]&&l(this,p)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(yS)),yS.exports}var Vje=Gje();const Qje=pa(Vje);var Bh=new Qje,dN="recharts.syncEvent.tooltip",NI="recharts.syncEvent.brush",xA=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!da(n))return e[n]}},Wje={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},R8=Or({name:"options",initialState:Wje,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Yje=R8.reducer,{createEventEmitter:Zje}=R8.actions;function Xje(e){return e.tooltip.syncInteraction}var Jje={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},D8=Or({name:"chartData",initialState:Jje,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:kI,setDataStartEndIndexes:eSe,setComputedData:sze}=D8.actions,tSe=D8.reducer,nSe=["x","y"];function CI(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 bu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CI(Object(n),!0).forEach(function(r){rSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rSe(e,t,n){return(t=iSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iSe(e){var t=aSe(e,"string");return typeof t=="symbol"?t:t+""}function aSe(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 sSe(e,t){if(e==null)return{};var n,r,i=oSe(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 oSe(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 lSe(){var e=Ue(CC),t=Ue(AC),n=ln(),r=Ue(TU),i=Ue(Hs),a=el(),l=wx(),u=Ue(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return Jo;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(nh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var g;if(l&&p!==null&&p!==void 0&&(g=p.payload)!==null&&g!==void 0&&g.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:j,y:b}=v,S=sSe(v,nSe),{x:k,y:E,width:C,height:A}=p.payload.sourceViewBox,P=bu(bu({},S),{},{x:l.x+(C?(j-k)/C:0)*l.width,y:l.y+(A?(b-E)/A:0)*l.height});n(bu(bu({},p),{},{payload:bu(bu({},p.payload),{},{coordinate:P})}))}else n(p);return}if(i!=null){var O;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},T=r(i,_);O=i[T]}else r==="value"&&(O=i.find(H=>String(H.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||l==null){n(nh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(O==null){n(nh({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:U}=$,B=Math.min(F,l.x+l.width),V=Math.min(U,l.y+l.height),X={x:a==="horizontal"?O.coordinate:B,y:a==="horizontal"?V:O.coordinate},Z=nh({active:p.payload.active,coordinate:X,dataKey:p.payload.dataKey,index:String(O.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Z)}}};return Bh.on(dN,d),()=>{Bh.off(dN,d)}},[u,n,t,e,r,i,a,l])}function cSe(){var e=Ue(CC),t=Ue(AC),n=ln();x.useEffect(()=>{if(e==null)return Jo;var r=(i,a,l)=>{t!==l&&e===i&&n(eSe(a))};return Bh.on(NI,r),()=>{Bh.off(NI,r)}},[n,t,e])}function uSe(){var e=ln();x.useEffect(()=>{e(Zje())},[e]),lSe(),cSe()}function dSe(e,t,n,r,i,a){var l=Ue(j=>xje(j,e,t)),u=Ue(tje),d=Ue(AC),f=Ue(CC),p=Ue(TU),m=Ue(Xje),g=m?.sourceViewBox!=null,v=wx();x.useEffect(()=>{if(!g&&f!=null&&d!=null){var j=nh({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:u});Bh.emit(dN,f,j,d)}},[g,n,l,u,i,r,d,f,p,a,v])}function AI(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 OI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?AI(Object(n),!0).forEach(function(r){fSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fSe(e,t,n){return(t=hSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hSe(e){var t=pSe(e,"string");return typeof t=="symbol"?t:t+""}function pSe(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 mSe(e){return e.dataKey}function gSe(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(Ige,t)}var EI=[],ySe={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 Ms(e){var t,n,r=tr(e,ySe),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:u,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:g,position:v,reverseDirection:j,useTranslate3d:b,wrapperStyle:S,cursor:k,shared:E,trigger:C,defaultIndex:A,portal:P,axisId:O}=r,_=ln(),T=typeof A=="number"?String(A):A;x.useEffect(()=>{_(cwe({shared:E,trigger:C,axisId:O,active:i,defaultIndex:T}))},[_,E,C,O,i,T]);var $=wx(),F=lU(),U=rwe(E),{activeIndex:B,isActive:V}=(t=Ue(Se=>jje(Se,U,C,T)))!==null&&t!==void 0?t:{},X=Ue(Se=>wje(Se,U,C,T)),Z=Ue(Se=>z8(Se,U,C,T)),H=Ue(Se=>bje(Se,U,C,T)),J=X,oe=Kje(),ye=(n=i??V)!==null&&n!==void 0?n:!1,[I,M]=h6([J,ye]),q=U==="axis"?Z:void 0;dSe(U,C,H,q,B,ye);var D=P??oe;if(D==null||$==null||U==null)return null;var G=J??EI;ye||(G=EI),f&&G.length&&(G=l6(G.filter(Se=>Se.value!=null&&(Se.hide!==!0||r.includeHidden)),g,mSe));var se=G.length>0,ne=OI(OI({},r),{},{payload:G,label:q,active:ye,activeIndex:B,coordinate:H,accessibilityLayer:F}),Ce=x.createElement(Qge,{allowEscapeViewBox:a,animationDuration:l,animationEasing:u,isAnimationActive:p,active:ye,coordinate:H,hasPayload:se,offset:m,position:v,reverseDirection:j,useTranslate3d:b,viewBox:$,wrapperStyle:S,lastBoundingBox:I,innerRef:M,hasPortalFromProps:!!P},gSe(d,ne));return x.createElement(x.Fragment,null,gc.createPortal(Ce,D),ye&&x.createElement(Hje,{cursor:k,tooltipEventType:U,coordinate:H,payload:G,index:B}))}var lv=e=>null;lv.displayName="Cell";function vSe(e,t,n){return(t=xSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xSe(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)}class wSe{constructor(t){vSe(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 _I(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 jSe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_I(Object(n),!0).forEach(function(r){SSe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SSe(e,t,n){return(t=NSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NSe(e){var t=kSe(e,"string");return typeof t=="symbol"?t:t+""}function kSe(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 CSe={cacheSize:2e3,enableCache:!0},M8=jSe({},CSe),zI=new wSe(M8.cacheSize),ASe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},PI="recharts_measurement_span";function OSe(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(u)}var TI=(e,t)=>{try{var n=document.getElementById(PI);n||(n=document.createElement("span"),n.setAttribute("id",PI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,ASe,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},ph=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||sp.isSsr)return{width:0,height:0};if(!M8.enableCache)return TI(t,n);var r=OSe(t,n),i=zI.get(r);if(i)return i;var a=TI(t,n);return zI.set(r,a),a},I8;function ESe(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=zSe(e,"string");return typeof t=="symbol"?t:t+""}function zSe(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 RI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,DI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,PSe=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,TSe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,RSe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},DSe=["cm","mm","pt","pc","in","Q","px"];function MSe(e){return DSe.includes(e)}var Tu="NaN";function ISe(e,t){return e*RSe[t]}class fr{static parse(t){var n,[,r,i]=(n=TSe.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,da(t)&&(this.unit=""),n!==""&&!PSe.test(n)&&(this.num=NaN,this.unit=""),MSe(n)&&(this.num=ISe(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 da(this.num)}}I8=fr;ESe(fr,"NaN",new I8(NaN,""));function L8(e){if(e==null||e.includes(Tu))return Tu;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=RI.exec(t))!==null&&n!==void 0?n:[],l=fr.parse(r??""),u=fr.parse(a??""),d=i==="*"?l.multiply(u):l.divide(u);if(d.isNaN())return Tu;t=t.replace(RI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,g]=(f=DI.exec(t))!==null&&f!==void 0?f:[],v=fr.parse(p??""),j=fr.parse(g??""),b=m==="+"?v.add(j):v.subtract(j);if(b.isNaN())return Tu;t=t.replace(DI,b.toString())}return t}var MI=/\(([^()]*)\)/;function LSe(e){for(var t=e,n;(n=MI.exec(t))!=null;){var[,r]=n;t=t.replace(MI,L8(r))}return t}function $Se(e){var t=e.replace(/\s+/g,"");return t=LSe(t),t=L8(t),t}function BSe(e){try{return $Se(e)}catch{return Tu}}function vS(e){var t=BSe(e.slice(5,-1));return t===Tu?"":t}var USe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],qSe=["dx","dy","angle","className","breakAll"];function fN(){return fN=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},fN.apply(null,arguments)}function II(e,t){if(e==null)return{};var n,r,i=FSe(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 FSe(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 $8=/[ \f\n\r\t\v\u2028\u2029]+/,B8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];on(t)||(n?i=t.toString().split(""):i=t.toString().split($8));var a=i.map(u=>({word:u,width:ph(u,r).width})),l=n?0:ph(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function U8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function HSe(e){return on(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var q8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(l),d.width+=u+n;else{var f={words:[l],width:u};i.push(f)}return i},[]),F8=e=>e.reduce((t,n)=>t.width>n.width?t:n),KSe="…",LI=(e,t,n,r,i,a,l,u)=>{var d=e.slice(0,t),f=B8({breakAll:n,style:r,children:d+KSe});if(!f)return[!1,[]];var p=q8(f.wordsWithComputedWidth,a,l,u),m=p.length>i||F8(p).width>Number(a);return[m,p]},GSe=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:u,breakAll:d}=e,f=Pe(a),p=String(l),m=q8(t,r,n,i);if(!f||i)return m;var g=m.length>a||F8(m).width>Number(r);if(!g)return m;for(var v=0,j=p.length-1,b=0,S;v<=j&&b<=p.length-1;){var k=Math.floor((v+j)/2),E=k-1,[C,A]=LI(p,E,d,u,a,r,n,i),[P]=LI(p,k,d,u,a,r,n,i);if(!C&&!P&&(v=k+1),C&&P&&(j=k-1),!C&&P){S=A;break}b++}return S||m},$I=e=>{var t=on(e)?[]:e.toString().split($8);return[{words:t,width:void 0}]},VSe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!sp.isSsr){var u,d,f=B8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;u=p,d=m}else return $I(r);return GSe({breakAll:a,children:r,maxLines:l,style:i},u,d,t,!!n)}return $I(r)},H8="#808080",QSe={angle:0,breakAll:!1,capHeight:"0.71em",fill:H8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},bA=x.forwardRef((e,t)=>{var n=tr(e,QSe),{x:r,y:i,lineHeight:a,capHeight:l,fill:u,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=II(n,USe),g=x.useMemo(()=>VSe({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:j,angle:b,className:S,breakAll:k}=m,E=II(m,qSe);if(!Fa(r)||!Fa(i)||g.length===0)return null;var C=Number(r)+(Pe(v)?v:0),A=Number(i)+(Pe(j)?j:0);if(!ht(C)||!ht(A))return null;var P;switch(p){case"start":P=vS("calc(".concat(l,")"));break;case"middle":P=vS("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:P=vS("calc(".concat(g.length-1," * -").concat(a,")"));break}var O=[],_=g[0];if(d&&_!=null){var T=_.width,{width:$}=m;O.push("scale(".concat(Pe($)&&Pe(T)?$/T:1,")"))}return b&&O.push("rotate(".concat(b,", ").concat(C,", ").concat(A,")")),O.length&&(E.transform=O.join(" ")),x.createElement("text",fN({},kr(E),{ref:t,x:C,y:A,className:Ot("recharts-text",S),textAnchor:f,fill:u.includes("url")?H8:u}),g.map((F,U)=>{var B=F.words.join(k?"":" ");return x.createElement("tspan",{x:C,dy:U===0?P:a,key:"".concat(B,"-").concat(U)},B)}))});bA.displayName="Text";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 Ea(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){WSe(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 WSe(e,t,n){return(t=YSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YSe(e){var t=ZSe(e,"string");return typeof t=="symbol"?t:t+""}function ZSe(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 XSe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:u,upperWidth:d,lowerWidth:f}=mC(t),p=a,m=a+(d-f)/2,g=(p+m)/2,v=(d+f)/2,j=p+d/2,b=u>=0?1:-1,S=b*r,k=b>0?"end":"start",E=b>0?"start":"end",C=d>=0?1:-1,A=C*r,P=C>0?"end":"start",O=C>0?"start":"end",_=i;if(n==="top"){var T={x:p+d/2,y:l-S,horizontalAnchor:"middle",verticalAnchor:k};return _&&(T.height=Math.max(l-_.y,0),T.width=d),T}if(n==="bottom"){var $={x:m+f/2,y:l+u+S,horizontalAnchor:"middle",verticalAnchor:E};return _&&($.height=Math.max(_.y+_.height-(l+u),0),$.width=f),$}if(n==="left"){var F={x:g-A,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return _&&(F.width=Math.max(F.x-_.x,0),F.height=u),F}if(n==="right"){var U={x:g+v+A,y:l+u/2,horizontalAnchor:O,verticalAnchor:"middle"};return _&&(U.width=Math.max(_.x+_.width-U.x,0),U.height=u),U}var B=_?{width:v,height:u}:{};return n==="insideLeft"?Ea({x:g+A,y:l+u/2,horizontalAnchor:O,verticalAnchor:"middle"},B):n==="insideRight"?Ea({x:g+v-A,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"},B):n==="insideTop"?Ea({x:p+d/2,y:l+S,horizontalAnchor:"middle",verticalAnchor:E},B):n==="insideBottom"?Ea({x:m+f/2,y:l+u-S,horizontalAnchor:"middle",verticalAnchor:k},B):n==="insideTopLeft"?Ea({x:p+A,y:l+S,horizontalAnchor:O,verticalAnchor:E},B):n==="insideTopRight"?Ea({x:p+d-A,y:l+S,horizontalAnchor:P,verticalAnchor:E},B):n==="insideBottomLeft"?Ea({x:m+A,y:l+u-S,horizontalAnchor:O,verticalAnchor:k},B):n==="insideBottomRight"?Ea({x:m+f-A,y:l+u-S,horizontalAnchor:P,verticalAnchor:k},B):n&&typeof n=="object"&&(Pe(n.x)||sc(n.x))&&(Pe(n.y)||sc(n.y))?Ea({x:a+fa(n.x,v),y:l+fa(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},B):Ea({x:j,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},B)},JSe=["labelRef"],e1e=["content"];function UI(e,t){if(e==null)return{};var n,r,i=t1e(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 t1e(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 qI(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 rh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qI(Object(n),!0).forEach(function(r){n1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n1e(e,t,n){return(t=r1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r1e(e){var t=i1e(e,"string");return typeof t=="symbol"?t:t+""}function i1e(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 js(){return js=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},js.apply(null,arguments)}var K8=x.createContext(null),a1e=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:u}=e,d=x.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return x.createElement(K8.Provider,{value:d},u)},G8=()=>{var e=x.useContext(K8),t=wx();return e||(t?mC(t):void 0)},s1e=x.createContext(null),o1e=()=>{var e=x.useContext(s1e),t=Ue(LU);return e||t},l1e=e=>{var{value:t,formatter:n}=e,r=on(e.children)?t:e.children;return typeof n=="function"?n(r):r},wA=e=>e!=null&&typeof e=="function",c1e=(e,t)=>{var n=Wr(t-e),r=Math.min(Math.abs(t-e),360);return n*r},u1e=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:u,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:g,clockWise:v}=i,j=(f+p)/2,b=c1e(m,g),S=b>=0?1:-1,k,E;switch(t){case"insideStart":k=m+S*a,E=v;break;case"insideEnd":k=g-S*a,E=!v;break;case"end":k=g+S*a,E=v;break;default:throw new Error("Unsupported position ".concat(t))}E=b<=0?E:!E;var C=mr(u,d,j,k),A=mr(u,d,j,k+(E?1:-1)*359),P="M".concat(C.x,",").concat(C.y,`
|
|
288
|
+
A`).concat(j,",").concat(j,",0,1,").concat(E?0:1,`,
|
|
289
|
+
`).concat(A.x,",").concat(A.y),O=on(e.id)?Ah("recharts-radial-line-"):e.id;return x.createElement("text",js({},r,{dominantBaseline:"central",className:Ot("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:O,d:P})),x.createElement("textPath",{xlinkHref:"#".concat(O)},n))},d1e=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:u,endAngle:d}=e,f=(u+d)/2;if(n==="outside"){var{x:p,y:m}=mr(r,i,l+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 g=(a+l)/2,{x:v,y:j}=mr(r,i,g,f);return{x:v,y:j,textAnchor:"middle",verticalAnchor:"middle"}},Kg=e=>e!=null&&"cx"in e&&Pe(e.cx),f1e={angle:0,offset:5,zIndex:Wn.label,position:"middle",textBreakAll:!1};function h1e(e){if(!Kg(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 Oo(e){var t=tr(e,f1e),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:u,className:d="",textBreakAll:f,labelRef:p}=t,m=o1e(),g=G8(),v=i==="center"?g:m??g,j,b,S;n==null?j=v:Kg(n)?j=n:j=mC(n);var k=h1e(j);if(!j||on(a)&&on(l)&&!x.isValidElement(u)&&typeof u!="function")return null;var E=rh(rh({},t),{},{viewBox:j});if(x.isValidElement(u)){var{labelRef:C}=E,A=UI(E,JSe);return x.cloneElement(u,A)}if(typeof u=="function"){var{content:P}=E,O=UI(E,e1e);if(b=x.createElement(u,O),x.isValidElement(b))return b}else b=l1e(t);var _=kr(t);if(Kg(j)){if(i==="insideStart"||i==="insideEnd"||i==="end")return u1e(t,i,b,_,j);S=d1e(j,t.offset,t.position)}else{if(!k)return null;var T=XSe({viewBox:k,position:i,offset:t.offset,parentViewBox:Kg(r)?void 0:r});S=rh(rh({x:T.x,y:T.y,textAnchor:T.horizontalAnchor,verticalAnchor:T.verticalAnchor},T.width!==void 0?{width:T.width}:{}),T.height!==void 0?{height:T.height}:{})}return x.createElement(bi,{zIndex:t.zIndex},x.createElement(bA,js({ref:p,className:Ot("recharts-label",d)},_,S,{textAnchor:U8(_.textAnchor)?_.textAnchor:S.textAnchor,breakAll:f}),b))}Oo.displayName="Label";var p1e=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(Oo,js({key:"label-implicit"},r)):Fa(e)?x.createElement(Oo,js({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===Oo?x.cloneElement(e,rh({key:"label-implicit"},r)):x.createElement(Oo,js({key:"label-implicit",content:e},r)):wA(e)?x.createElement(Oo,js({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(Oo,js({},e,{key:"label-implicit"},r)):null};function m1e(e){var{label:t,labelRef:n}=e,r=G8();return p1e(t,r,n)||null}var g1e=["valueAccessor"],y1e=["dataKey","clockWise","id","textBreakAll","zIndex"];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 FI(e,t){if(e==null)return{};var n,r,i=v1e(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 v1e(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 x1e=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(HSe(t))return t},V8=x.createContext(void 0),jA=V8.Provider,Q8=x.createContext(void 0);Q8.Provider;function b1e(){return x.useContext(V8)}function w1e(){return x.useContext(Q8)}function Gg(e){var{valueAccessor:t=x1e}=e,n=FI(e,g1e),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:u}=n,d=FI(n,y1e),f=b1e(),p=w1e(),m=f||p;return!m||!m.length?null:x.createElement(bi,{zIndex:u??Wn.label},x.createElement(gr,{className:"recharts-label-list"},m.map((g,v)=>{var j,b=on(r)?t(g,v):vn(g.payload,r),S=on(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(Oo,cv({key:"label-".concat(v)},kr(g),d,S,{fill:(j=n.fill)!==null&&j!==void 0?j:g.fill,parentViewBox:g.parentViewBox,value:b,textBreakAll:l,viewBox:g.viewBox,index:v,zIndex:0}))})))}Gg.displayName="LabelList";function SA(e){var{label:t}=e;return t?t===!0?x.createElement(Gg,{key:"labelList-implicit"}):x.isValidElement(t)||wA(t)?x.createElement(Gg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Gg,cv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function hN(){return hN=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},hN.apply(null,arguments)}var W8=e=>{var{cx:t,cy:n,r,className:i}=e,a=Ot("recharts-dot",i);return Pe(t)&&Pe(n)&&Pe(r)?x.createElement("circle",hN({},gi(e),iC(e),{className:a,cx:t,cy:n,r})):null},j1e={radiusAxis:{},angleAxis:{}},Y8=Or({name:"polarAxis",initialState:j1e,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:oze,removeRadiusAxis:lze,addAngleAxis:cze,removeAngleAxis:uze}=Y8.actions,S1e=Y8.reducer;function N1e(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var xS={exports:{}},qt={};var HI;function k1e(){if(HI)return qt;HI=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"),l=Symbol.for("react.context"),u=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"),g=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function j(b){if(typeof b=="object"&&b!==null){var S=b.$$typeof;switch(S){case e:switch(b=b.type,b){case n:case i:case r:case d:case f:case g:return b;default:switch(b=b&&b.$$typeof,b){case l:case u:case m:case p:return b;case a:return b;default:return S}}case t:return S}}}return qt.ContextConsumer=a,qt.ContextProvider=l,qt.Element=e,qt.ForwardRef=u,qt.Fragment=n,qt.Lazy=m,qt.Memo=p,qt.Portal=t,qt.Profiler=i,qt.StrictMode=r,qt.Suspense=d,qt.SuspenseList=f,qt.isContextConsumer=function(b){return j(b)===a},qt.isContextProvider=function(b){return j(b)===l},qt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},qt.isForwardRef=function(b){return j(b)===u},qt.isFragment=function(b){return j(b)===n},qt.isLazy=function(b){return j(b)===m},qt.isMemo=function(b){return j(b)===p},qt.isPortal=function(b){return j(b)===t},qt.isProfiler=function(b){return j(b)===i},qt.isStrictMode=function(b){return j(b)===r},qt.isSuspense=function(b){return j(b)===d},qt.isSuspenseList=function(b){return j(b)===f},qt.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===l||b.$$typeof===a||b.$$typeof===u||b.$$typeof===v||b.getModuleId!==void 0)},qt.typeOf=j,qt}var KI;function C1e(){return KI||(KI=1,xS.exports=k1e()),xS.exports}var A1e=C1e(),GI=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",VI=null,bS=null,Z8=e=>{if(e===VI&&Array.isArray(bS))return bS;var t=[];return x.Children.forEach(e,n=>{on(n)||(A1e.isFragment(n)?t=t.concat(Z8(n.props.children)):t.push(n))}),bS=t,VI=e,t};function O1e(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>GI(i)):r=[GI(t)],Z8(e).forEach(i=>{var a=nd(i,"type.displayName")||nd(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var NA=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,wS={},QI;function E1e(){return QI||(QI=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})(wS)),wS}var jS,WI;function _1e(){return WI||(WI=1,jS=E1e().isPlainObject),jS}var z1e=_1e();const P1e=pa(z1e);var YI,ZI,XI,JI,eL;function tL(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 nL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tL(Object(n),!0).forEach(function(r){T1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function T1e(e,t,n){return(t=R1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R1e(e){var t=D1e(e,"string");return typeof t=="symbol"?t:t+""}function D1e(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 uv(){return uv=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},uv.apply(null,arguments)}function Wf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var rL=(e,t,n,r,i)=>{var a=n-r,l;return l=kn(YI||(YI=Wf(["M ",",",""])),e,t),l+=kn(ZI||(ZI=Wf(["L ",",",""])),e+n,t),l+=kn(XI||(XI=Wf(["L ",",",""])),e+n-a/2,t+i),l+=kn(JI||(JI=Wf(["L ",",",""])),e+n-a/2-r,t+i),l+=kn(eL||(eL=Wf(["L ",","," Z"])),e,t),l},M1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},I1e=e=>{var t=tr(e,M1e),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:u}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,g=x.useRef(null),[v,j]=x.useState(-1),b=x.useRef(i),S=x.useRef(a),k=x.useRef(l),E=x.useRef(n),C=x.useRef(r),A=lp(e,"trapezoid-");if(x.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var X=g.current.getTotalLength();X&&j(X)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var P=Ot("recharts-trapezoid",u);if(!m)return x.createElement("g",null,x.createElement("path",uv({},kr(t),{className:P,d:rL(n,r,i,a,l)})));var O=b.current,_=S.current,T=k.current,$=E.current,F=C.current,U="0px ".concat(v===-1?1:v,"px"),B="".concat(v,"px ").concat(v,"px"),V=cU(["strokeDasharray"],f,d);return x.createElement(op,{animationId:A,key:A,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},X=>{var Z=Ft(O,i,X),H=Ft(_,a,X),J=Ft(T,l,X),oe=Ft($,n,X),ye=Ft(F,r,X);g.current&&(b.current=Z,S.current=H,k.current=J,E.current=oe,C.current=ye);var I=X>0?{transition:V,strokeDasharray:B}:{strokeDasharray:U};return x.createElement("path",uv({},kr(t),{className:P,d:rL(oe,ye,Z,H,J),ref:g,style:nL(nL({},I),t.style)}))})},L1e=["option","shapeType","activeClassName","inActiveClassName"];function $1e(e,t){if(e==null)return{};var n,r,i=B1e(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 B1e(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 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 dv(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){U1e(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 U1e(e,t,n){return(t=q1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q1e(e){var t=F1e(e,"string");return typeof t=="symbol"?t:t+""}function F1e(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 H1e(e,t){return dv(dv({},t),e)}function K1e(e,t){return e==="symbols"}function aL(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(hU,n);case"trapezoid":return x.createElement(I1e,n);case"sector":return x.createElement(gU,n);case"symbols":if(K1e(t))return x.createElement(rC,n);break;case"curve":return x.createElement(fh,n);default:return null}}function G1e(e){return x.isValidElement(e)?e.props:e}function X8(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=$1e(e,L1e),l;if(x.isValidElement(t))l=x.cloneElement(t,dv(dv({},a),G1e(t)));else if(typeof t=="function")l=t(a,a.index);else if(P1e(t)&&typeof t!="boolean"){var u=H1e(t,a);l=x.createElement(aL,{shapeType:n,elementProps:u})}else{var d=a;l=x.createElement(aL,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(gr,{className:r},l):x.createElement(gr,{className:i},l)}var J8=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(c8({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},eF=e=>{var t=ln();return(n,r)=>i=>{e?.(n,r,i),t(uwe())}},tF=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(dwe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function kA(e){var{tooltipEntrySettings:t}=e,n=ln(),r=rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(swe(t)):i.current!==t&&n(owe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(lwe(i.current)),i.current=null)},[n]),null}function CA(e){var{legendPayload:t}=e,n=ln(),r=rr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(Qme(t)):i.current!==t&&n(Wme({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(Yme(i.current)),i.current=null)},[n]),null}var SS,V1e=()=>{var[e]=x.useState(()=>Ah("uid-"));return e},Q1e=(SS=bv.useId)!==null&&SS!==void 0?SS:V1e;function W1e(e,t){var n=Q1e();return t||(e?"".concat(e,"-").concat(n):n)}var Y1e=x.createContext(void 0),AA=e=>{var{id:t,type:n,children:r}=e,i=W1e("recharts-".concat(n),t);return x.createElement(Y1e.Provider,{value:i},r(i))},Z1e={cartesianItems:[],polarItems:[]},nF=Or({name:"graphicalItems",initialState:Z1e,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:an()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ui(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:an()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ui(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=Ui(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=Ui(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:an()}}}),{addCartesianGraphicalItem:X1e,replaceCartesianGraphicalItem:J1e,removeCartesianGraphicalItem:eNe,addPolarGraphicalItem:dze,removePolarGraphicalItem:fze,replacePolarGraphicalItem:hze}=nF.actions,tNe=nF.reducer,nNe=e=>{var t=ln(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(X1e(e)):n.current!==e&&t(J1e({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(eNe(n.current)),n.current=null)},[t]),null},OA=x.memo(nNe),rNe=["points"];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 NS(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){iNe(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 iNe(e,t,n){return(t=aNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aNe(e){var t=sNe(e,"string");return typeof t=="symbol"?t:t+""}function sNe(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(){return fv=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},fv.apply(null,arguments)}function oNe(e,t){if(e==null)return{};var n,r,i=lNe(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 lNe(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 cNe(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=Ot(r,typeof t!="boolean"?t.className:""),a=n??{},{points:l}=a,u=oNe(a,rNe);return x.createElement(W8,fv({},u,{className:i}))}function uNe(e,t){return e==null?!1:t?!0:e.length===1}function rF(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:u,clipPathId:d,zIndex:f=Wn.scatter}=e;if(!uNe(t,n))return null;var p=NA(n),m=Dde(n),g=t.map((j,b)=>{var S,k,E=NS(NS(NS({r:3},l),m),{},{index:b,cx:(S=j.x)!==null&&S!==void 0?S:void 0,cy:(k=j.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:j.value,payload:j.payload,points:t});return x.createElement(cNe,{key:"dot-".concat(b),option:n,dotProps:E,className:i})}),v={};return u&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(bi,{zIndex:f},x.createElement(gr,fv({className:r},v),g))}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 lL(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){dNe(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 dNe(e,t,n){return(t=fNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fNe(e){var t=hNe(e,"string");return typeof t=="symbol"?t:t+""}function hNe(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 iF=0,pNe={xAxis:{},yAxis:{},zAxis:{}},aF=Or({name:"cartesianAxis",initialState:pNe,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,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((a=l[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...l,r].slice(-3);e.yAxis[n]=lL(lL({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:mNe,replaceXAxis:gNe,removeXAxis:yNe,addYAxis:vNe,replaceYAxis:xNe,removeYAxis:bNe,addZAxis:pze,replaceZAxis:mze,removeZAxis:gze,updateYAxisWidth:wNe}=aF.actions,jNe=aF.reducer,SNe=re([nr],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),NNe=re([SNe,$s,Bs],(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)}}),Fx=()=>Ue(NNe),kNe=()=>Ue(sje);function cL(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 kS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cL(Object(n),!0).forEach(function(r){CNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CNe(e,t,n){return(t=ANe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ANe(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)}var ENe=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:l}=e;if(i===!1||t.x==null||t.y==null)return null;var u={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=kS(kS(kS({},u),Jh(i)),iC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(W8,d),x.createElement(gr,{className:"recharts-active-dot",clipPath:l},f)};function pN(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:l=Wn.activeDot}=e,u=Ue(fc),d=kNe();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return on(f)?null:x.createElement(bi,{zIndex:l},x.createElement(ENe,{point:f,childIndex:Number(u),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var uL=(e,t,n)=>{var r=n??e;if(!on(r))return fa(r,t,0)},_Ne=(e,t,n)=>{var r={},i=e.filter(zx),a=e.filter(f=>f.stackId==null),l=i.reduce((f,p)=>{var m=f[p.stackId];return m==null&&(m=[]),m.push(p),f[p.stackId]=m,f},r),u=Object.entries(l).map(f=>{var p,[m,g]=f,v=g.map(b=>b.dataKey),j=uL(t,n,(p=g[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:j}}),d=a.map(f=>{var p=[f.dataKey].filter(g=>g!=null),m=uL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...u,...d]};function dL(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 Ng(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dL(Object(n),!0).forEach(function(r){zNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zNe(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=TNe(e,"string");return typeof t=="symbol"?t:t+""}function TNe(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 RNe(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var u=fa(e,n,0,!0),d,f=[];if(ht((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/l,g=r.reduce((E,C)=>E+(C.barSize||0),0);g+=(l-1)*u,g>=n&&(g-=(l-1)*u,u=0),g>=n&&m>0&&(p=!0,m*=.9,g=l*m);var v=(n-g)/2>>0,j={offset:v-u,size:0};d=r.reduce((E,C)=>{var A,P={stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:j.offset+j.size+u,size:p?m:(A=C.barSize)!==null&&A!==void 0?A:0}},O=[...E,P];return j=P.position,O},f)}else{var b=fa(t,n,0,!0);n-2*b-(l-1)*u<=0&&(u=0);var S=(n-2*b-(l-1)*u)/l;S>1&&(S>>=0);var k=ht(i)?Math.min(S,i):S;d=r.reduce((E,C,A)=>[...E,{stackId:C.stackId,dataKeys:C.dataKeys,position:{offset:b+(S+u)*A+(S-k)/2,size:k}}],f)}return d}}var DNe=(e,t,n,r,i,a,l)=>{var u=on(l)?t:l,d=RNe(n,r,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(f=>Ng(Ng({},f),{},{position:Ng(Ng({},f.position),{},{offset:f.position.offset-i/2})}))),d},MNe=(e,t)=>{var n=_x(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(l=>l.key===n)}}}},INe=(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 LNe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ht(e.zIndex)?e.zIndex:t}var $Ne=e=>{var{chartData:t}=e,n=ln(),r=rr();return x.useEffect(()=>r?()=>{}:(n(kI(t)),()=>{n(kI(void 0))}),[t,n,r]),null},fL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},sF=Or({name:"brush",initialState:fL,reducers:{setBrushSettings(e,t){return t.payload==null?fL:t.payload}}}),{setBrushSettings:yze}=sF.actions,BNe=sF.reducer;function UNe(e){return(e%180+180)%180}var qNe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=UNe(i),l=a*Math.PI/180,u=Math.atan(r/n),d=l>u&&l<Math.PI-u?r/Math.sin(l):n/Math.cos(l);return Math.abs(d)},FNe={dots:[],areas:[],lines:[]},oF=Or({name:"referenceElements",initialState:FNe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ui(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=Ui(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=Ui(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:vze,removeDot:xze,addArea:bze,removeArea:wze,addLine:jze,removeLine:Sze}=oF.actions,HNe=oF.reducer,KNe=x.createContext(void 0),GNe=e=>{var{children:t}=e,[n]=x.useState("".concat(Ah("recharts"),"-clip")),r=Fx();if(r==null)return null;var{x:i,y:a,width:l,height:u}=r;return x.createElement(KNe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:u,width:l}))),t)};function lF(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 VNe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return qNe(r,n)}function QNe(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:u}=e;return t===1?{start:r?i:a,end:r?i+l:a+u}:{start:r?i+l:a+u,end:r?i:a}}function Uh(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 WNe(e,t){return lF(e,t+1)}function YNe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:u}=t,d=0,f=1,p=l,m=function(){var j=r?.[d];if(j===void 0)return{v:lF(r,f)};var b=d,S,k=()=>(S===void 0&&(S=n(j,b)),S),E=j.coordinate,C=d===0||Uh(e,E,k,p,u);C||(d=0,p=l,f+=1),C&&(p=E+e*(k()/2+i),d+=f)},g;f<=a.length;)if(g=m(),g)return g.v;return[]}function ZNe(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:u,end:d}=t,f=1;f<=l;f++){for(var p=(l-1)%f,m=u,g=!0,v=function(){var A=r[b];if(A==null)return 0;var P=b,O,_=()=>(O===void 0&&(O=n(A,P)),O),T=A.coordinate,$=b===p||Uh(e,T,_,m,d);if(!$)return g=!1,1;$&&(m=T+e*(_()/2+i))},j,b=p;b<l&&(j=v(),!(j!==0&&j===1));b+=f);if(g){for(var S=[],k=p;k<l;k+=f){var E=r[k];E!=null&&S.push(E)}return S}}return[]}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 xr(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){XNe(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 XNe(e,t,n){return(t=JNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JNe(e){var t=eke(e,"string");return typeof t=="symbol"?t:t+""}function eke(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 tke(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:u}=t,{end:d}=t,f=function(g){var v=a[g];if(v==null)return 1;var j=v,b,S=()=>(b===void 0&&(b=n(v,g)),b);if(g===l-1){var k=e*(j.coordinate+e*S()/2-d);a[g]=j=xr(xr({},j),{},{tickCoord:k>0?j.coordinate-k*e:j.coordinate})}else a[g]=j=xr(xr({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var E=Uh(e,j.tickCoord,S,u,d);E&&(d=j.tickCoord-e*(S()/2+i),a[g]=xr(xr({},j),{},{isShow:!0}))}},p=l-1;p>=0;p--)f(p);return a}function nke(e,t,n,r,i,a){var l=(r||[]).slice(),u=l.length,{start:d,end:f}=t;if(a){var p=r[u-1];if(p!=null){var m=n(p,u-1),g=e*(p.coordinate+e*m/2-f);if(l[u-1]=p=xr(xr({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate}),p.tickCoord!=null){var v=Uh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),l[u-1]=xr(xr({},p),{},{isShow:!0}))}}}for(var j=a?u-1:u,b=function(E){var C=l[E];if(C==null)return 1;var A=C,P,O=()=>(P===void 0&&(P=n(C,E)),P);if(E===0){var _=e*(A.coordinate-e*O()/2-d);l[E]=A=xr(xr({},A),{},{tickCoord:_<0?A.coordinate-_*e:A.coordinate})}else l[E]=A=xr(xr({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var T=Uh(e,A.tickCoord,O,d,f);T&&(d=A.tickCoord+e*(O()/2+i),l[E]=xr(xr({},A),{},{isShow:!0}))}},S=0;S<j;S++)b(S);return l}function EA(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:u,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(Pe(d)||sp.isSsr){var g;return(g=WNe(i,Pe(d)?d:0))!==null&&g!==void 0?g:[]}var v=[],j=u==="top"||u==="bottom"?"width":"height",b=p&&j==="width"?ph(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},S=(P,O)=>{var _=typeof f=="function"?f(P.value,O):P.value;return j==="width"?VNe(ph(_,{fontSize:t,letterSpacing:n}),b,m):ph(_,{fontSize:t,letterSpacing:n})[j]},k=i[0],E=i[1],C=i.length>=2&&k!=null&&E!=null?Wr(E.coordinate-k.coordinate):1,A=QNe(a,C,j);return d==="equidistantPreserveStart"?YNe(C,A,S,i,l):d==="equidistantPreserveEnd"?ZNe(C,A,S,i,l):(d==="preserveStart"||d==="preserveStartEnd"?v=nke(C,A,S,i,l,d==="preserveStartEnd"):v=tke(C,A,S,i,l),v.filter(P=>P.isShow))}var rke=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,l=0;if(t){Array.from(t).forEach(p=>{if(p){var m=p.getBoundingClientRect();m.width>l&&(l=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,f=l+d+u+(n?r:0);return Math.round(f)}return 0},ike={xAxis:{},yAxis:{}},cF=Or({name:"renderedTicks",initialState:ike,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:ake,removeRenderedTicks:ske}=cF.actions,oke=cF.reducer,lke=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function cke(e,t){if(e==null)return{};var n,r,i=uke(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 uke(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 hc(){return hc=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},hc.apply(null,arguments)}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 Nn(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){dke(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 dke(e,t,n){return(t=fke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fke(e){var t=hke(e,"string");return typeof t=="symbol"?t:t+""}function hke(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:Wn.axis};function pke(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var f=Nn(Nn(Nn({},d),gi(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!l||a==="bottom"&&l);f=Nn(Nn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!l||a==="right"&&l);f=Nn(Nn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",hc({},f,{className:Ot("recharts-cartesian-axis-line",nd(u,"className"))}))}function mke(e,t,n,r,i,a,l,u,d){var f,p,m,g,v,j,b=u?-1:1,S=e.tickSize||l,k=Pe(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,g=n+ +!u*i,m=g-b*S,j=m-b*d,v=k;break;case"left":m=g=e.coordinate,p=t+ +!u*r,f=p-b*S,v=f-b*d,j=k;break;case"right":m=g=e.coordinate,p=t+ +u*r,f=p+b*S,v=f+b*d,j=k;break;default:f=p=e.coordinate,g=n+ +u*i,m=g+b*S,j=m+b*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:g},tick:{x:v,y:j}}}function gke(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function yke(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function vke(e){var{option:t,tickProps:n,value:r}=e,i,a=Ot(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,Nn(Nn({},n),{},{className:a}));else if(typeof t=="function")i=t(Nn(Nn({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=Ot(l,N1e(t))),i=x.createElement(bA,hc({},n,{className:l}),r)}return i}function xke(e){var{ticks:t,axisType:n,axisId:r}=e,i=ln();return x.useEffect(()=>{if(r==null||n==null)return Jo;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(ake({ticks:a,axisId:r,axisType:n})),()=>{i(ske({axisId:r,axisType:n}))}},[i,t,r,n]),null}var bke=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:u,padding:d,tickTextProps:f,orientation:p,mirror:m,x:g,y:v,width:j,height:b,tickSize:S,tickMargin:k,fontSize:E,letterSpacing:C,getTicksConfig:A,events:P,axisType:O,axisId:_}=e,T=EA(Nn(Nn({},A),{},{ticks:n}),E,C),$=gi(A),F=Jh(r),U=U8($.textAnchor)?$.textAnchor:gke(p,m),B=yke(p,m),V={};typeof i=="object"&&(V=i);var X=Nn(Nn({},$),{},{fill:"none"},V),Z=T.map(oe=>Nn({entry:oe},mke(oe,g,v,j,b,p,S,m,k))),H=Z.map(oe=>{var{entry:ye,line:I}=oe;return x.createElement(gr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(ye.value,"-").concat(ye.coordinate,"-").concat(ye.tickCoord)},i&&x.createElement("line",hc({},X,I,{className:Ot("recharts-cartesian-axis-tick-line",nd(i,"className"))})))}),J=Z.map((oe,ye)=>{var I,M,{entry:q,tick:D}=oe,G=Nn(Nn(Nn(Nn({verticalAnchor:B},$),{},{textAnchor:U,stroke:"none",fill:a},D),{},{index:ye,payload:q,visibleTicksCount:T.length,tickFormatter:l,padding:d},f),{},{angle:(I=(M=f?.angle)!==null&&M!==void 0?M:$.angle)!==null&&I!==void 0?I:0}),se=Nn(Nn({},G),F);return x.createElement(gr,hc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(q.value,"-").concat(q.coordinate,"-").concat(q.tickCoord)},sx(P,q,ye)),r&&x.createElement(vke,{option:r,tickProps:se,value:"".concat(typeof l=="function"?l(q.value,ye):q.value).concat(u||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(O,"-ticks")},x.createElement(xke,{ticks:T,axisId:_,axisType:O}),J.length>0&&x.createElement(bi,{zIndex:Wn.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(O,"-tick-labels"),ref:t},J)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(O,"-tick-lines")},H))}),wke=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:u,axisType:d,axisId:f}=e,p=cke(e,lke),[m,g]=x.useState(""),[v,j]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return rke({ticks:b.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=x.useCallback(k=>{if(k){var E=k.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=E;var C=E[0];if(C){var A=window.getComputedStyle(C),P=A.fontSize,O=A.letterSpacing;(P!==m||O!==v)&&(g(P),j(O))}}},[m,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(bi,{zIndex:e.zIndex},x.createElement(gr,{className:Ot("recharts-cartesian-axis",a)},x.createElement(pke,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:gi(e)}),x.createElement(bke,{ref:S,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:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(a1e,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(m1e,{label:e.label,labelRef:e.labelRef}),e.children)))}),_A=x.forwardRef((e,t)=>{var n=tr(e,Os);return x.createElement(wke,hc({},n,{ref:t}))});_A.displayName="CartesianAxis";var jke=["x1","y1","x2","y2","key"],Ske=["offset"],Nke=["xAxisId","yAxisId"],kke=["xAxisId","yAxisId"];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 Sr(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){Cke(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 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 Fl(){return Fl=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},Fl.apply(null,arguments)}function hv(e,t){if(e==null)return{};var n,r,i=Eke(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 Eke(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 _ke=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:l,ry:u}=e;return x.createElement("rect",{x:r,y:i,ry:u,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function uF(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:l,x2:u,y2:d,key:f}=n,p=hv(n,jke),m=(i=gi(p))!==null&&i!==void 0?i:{},{offset:g}=m,v=hv(m,Ske);r=x.createElement("line",Fl({},v,{x1:a,y1:l,x2:u,y2:d,fill:"none",key:f}))}return r}function zke(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,u=hv(e,Nke),d=i.map((f,p)=>{var m=Sr(Sr({},u),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(uF,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function Pke(e){var{y:t,height:n,vertical:r=!0,verticalPoints:i}=e;if(!r||!i||!i.length)return null;var{xAxisId:a,yAxisId:l}=e,u=hv(e,kke),d=i.map((f,p)=>{var m=Sr(Sr({},u),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(uF,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function Tke(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:l,horizontalPoints:u,horizontal:d=!0}=e;if(!d||!t||!t.length||u==null)return null;var f=u.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],j=v==null,b=j?i+l-m:v-m;if(b<=0)return null;var S=g%t.length;return x.createElement("rect",{key:"react-".concat(g),y:m,x:r,height:b,width:a,stroke:"none",fill:t[S],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Rke(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:l,height:u,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,g)=>m-g);i!==f[0]&&f.unshift(0);var p=f.map((m,g)=>{var v=f[g+1],j=v==null,b=j?i+l-m:v-m;if(b<=0)return null;var S=g%n.length;return x.createElement("rect",{key:"react-".concat(g),x:m,y:a,width:b,height:u,stroke:"none",fill:n[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Dke=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return H6(EA(Sr(Sr(Sr({},Os),n),{},{ticks:K6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},Mke=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return H6(EA(Sr(Sr(Sr({},Os),n),{},{ticks:K6(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},Ike={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Wn.grid};function pc(e){var t=gC(),n=yC(),r=Z6(),i=Sr(Sr({},tr(e,Ike)),{},{x:Pe(e.x)?e.x:r.left,y:Pe(e.y)?e.y:r.top,width:Pe(e.width)?e.width:r.width,height:Pe(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:l,x:u,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:g,verticalValues:v}=i,j=rr(),b=Ue($=>fI($,"xAxis",a,j)),S=Ue($=>fI($,"yAxis",l,j));if(!Ha(f)||!Ha(p)||!Pe(u)||!Pe(d))return null;var k=i.verticalCoordinatesGenerator||Dke,E=i.horizontalCoordinatesGenerator||Mke,{horizontalPoints:C,verticalPoints:A}=i;if((!C||!C.length)&&typeof E=="function"){var P=g&&g.length,O=E({yAxis:S?Sr(Sr({},S),{},{ticks:P?g:S.ticks}):void 0,width:t??f,height:n??p,offset:r},P?!0:m);My(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(C=O)}if((!A||!A.length)&&typeof k=="function"){var _=v&&v.length,T=k({xAxis:b?Sr(Sr({},b),{},{ticks:_?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);My(Array.isArray(T),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof T,"]")),Array.isArray(T)&&(A=T)}return x.createElement(bi,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(_ke,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(Tke,Fl({},i,{horizontalPoints:C})),x.createElement(Rke,Fl({},i,{verticalPoints:A})),x.createElement(zke,Fl({},i,{offset:r,horizontalPoints:C,xAxis:b,yAxis:S})),x.createElement(Pke,Fl({},i,{offset:r,verticalPoints:A,xAxis:b,yAxis:S}))))}pc.displayName="CartesianGrid";var Lke={},dF=Or({name:"errorBars",initialState:Lke,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:Nze,replaceErrorBar:kze,removeErrorBar:Cze}=dF.actions,$ke=dF.reducer,Bke=["children"];function Uke(e,t){if(e==null)return{};var n,r,i=qke(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 qke(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 Fke={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},Hke=x.createContext(Fke);function fF(e){var{children:t}=e,n=Uke(e,Bke);return x.createElement(Hke.Provider,{value:n},t)}function Hx(e,t){var n,r,i=Ue(f=>qs(f,e)),a=Ue(f=>Fs(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Gn.allowDataOverflow,u=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Vn.allowDataOverflow,d=l||u;return{needClip:d,needClipX:l,needClipY:u}}function zA(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=Fx(),{needClipX:a,needClipY:l,needClip:u}=Hx(t,n);if(!u||!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:l?f:f-m/2,width:a?p:p*2,height:l?m:m*2}))}var hF=(e,t,n,r)=>Qa(e,"xAxis",t,r),pF=(e,t,n,r)=>Va(e,"xAxis",t,r),mF=(e,t,n,r)=>Qa(e,"yAxis",n,r),gF=(e,t,n,r)=>Va(e,"yAxis",n,r),Kke=re([_t,hF,mF,pF,gF],(e,t,n,r,i)=>va(e,"xAxis")?Ko(t,r,!1):Ko(n,i,!1)),Gke=(e,t,n,r,i)=>i;function Vke(e){return e.type==="line"}var Qke=re([mp,Gke],(e,t)=>e.filter(Vke).find(n=>n.id===t)),Wke=re([_t,hF,mF,pF,gF,Qke,Kke,cp],(e,t,n,r,i,a,l,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:p}=u;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:m,data:g}=a,v;if(g!=null&&g.length>0?v=g:v=d?.slice(f,p+1),v!=null)return mCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:m,bandSize:l,displayedData:v})}});function yF(e){var t=Jh(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,l=Number(i),u=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(u)||u<0)&&(u=r),{r:l,strokeWidth:u}}return{r:n,strokeWidth:r}}var Yke=["id"],Zke=["type","layout","connectNulls","needClip","shape"],Xke=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function qh(){return qh=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},qh.apply(null,arguments)}function gL(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 Ta(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gL(Object(n),!0).forEach(function(r){Jke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jke(e,t,n){return(t=eCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eCe(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 PA(e,t){if(e==null)return{};var n,r,i=nCe(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 nCe(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 rCe=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:kd(n,t),payload:e}]},iCe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Jo,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:kd(l,t),hide:u,type:f,color:r,unit:d,graphicalItemId:p}};return x.createElement(kA,{tooltipEntrySettings:m})}),vF=(e,t)=>"".concat(t,"px ").concat(e,"px");function aCe(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],i=0;i<t;++i)r.push(...n);return r}var sCe=(e,t,n)=>{var r=n.reduce((g,v)=>g+v,0);if(!r)return vF(t,e);for(var i=Math.floor(e/r),a=e%r,l=[],u=0,d=0;u<n.length;d+=(f=n[u])!==null&&f!==void 0?f:0,++u){var f,p=n[u];if(p!=null&&d+p>a){l=[...n.slice(0,u),a-d];break}}var m=l.length%2===0?[0,t]:[t];return[...aCe(n,i),...l,...m].map(g=>"".concat(g,"px")).join(", ")};function oCe(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:l}=r,{id:u}=r,d=PA(r,Yke),f=gi(d);return x.createElement(rF,{points:n,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:f,needClip:l,clipPathId:t})}function lCe(e){var{showLabels:t,children:n,points:r}=e,i=x.useMemo(()=>r?.map(a=>{var l,u,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ta(Ta({},d),{},{value:a.value,payload:a.payload,viewBox:d,parentViewBox:void 0,fill:void 0})}),[r]);return x.createElement(jA,{value:t?i:void 0},n)}function yL(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:l,layout:u,connectNulls:d,needClip:f,shape:p}=a,m=PA(a,Zke),g=Ta(Ta({},kr(m)),{},{fill:"none",className:"recharts-line-curve",clipPath:f?"url(#clipPath-".concat(t,")"):void 0,points:r,type:l,layout:u,connectNulls:d,strokeDasharray:i??a.strokeDasharray});return x.createElement(x.Fragment,null,r?.length>1&&x.createElement(X8,qh({shapeType:"curve",option:p},g,{pathRef:n})),x.createElement(oCe,{points:r,clipPathId:t,props:a}))}function cCe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function uCe(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:l,strokeDasharray:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,animateNewValues:g,width:v,height:j,onAnimationEnd:b,onAnimationStart:S}=n,k=i.current,E=lp(l,"recharts-line-"),C=x.useRef(E),[A,P]=x.useState(!1),O=!A,_=x.useCallback(()=>{typeof b=="function"&&b(),P(!1)},[b]),T=x.useCallback(()=>{typeof S=="function"&&S(),P(!0)},[S]),$=cCe(r.current),F=x.useRef(0);C.current!==E&&(F.current=a.current,C.current=E);var U=F.current;return x.createElement(lCe,{points:l,showLabels:O},n.children,x.createElement(op,{animationId:E,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:_,onAnimationStart:T,key:E},B=>{var V=Ft(U,$+U,B),X=Math.min(V,$),Z;if(d)if(u){var H="".concat(u).split(/[,\s]+/gim).map(ye=>parseFloat(ye));Z=sCe(X,$,H)}else Z=vF($,X);else Z=u==null?void 0:String(u);if(B>0&&$>0&&(i.current=l,a.current=Math.max(a.current,X)),k){var J=k.length/l.length,oe=B===1?l:l.map((ye,I)=>{var M=Math.floor(I*J);if(k[M]){var q=k[M];return Ta(Ta({},ye),{},{x:Ft(q.x,ye.x,B),y:Ft(q.y,ye.y,B)})}return g?Ta(Ta({},ye),{},{x:Ft(v*2,ye.x,B),y:Ft(j/2,ye.y,B)}):Ta(Ta({},ye),{},{x:ye.x,y:ye.y})});return i.current=oe,x.createElement(yL,{props:n,points:oe,clipPathId:t,pathRef:r,strokeDasharray:Z})}return x.createElement(yL,{props:n,points:l,clipPathId:t,pathRef:r,strokeDasharray:Z})}),x.createElement(SA,{label:n.label}))}function dCe(e){var{clipPathId:t,props:n}=e,r=x.useRef(null),i=x.useRef(0),a=x.useRef(null);return x.createElement(uCe,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var fCe=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:vn(e.payload,t)}};class hCe extends x.Component{render(){var{hide:t,dot:n,points:r,className:i,xAxisId:a,yAxisId:l,top:u,left:d,width:f,height:p,id:m,needClip:g,zIndex:v}=this.props;if(t)return null;var j=Ot("recharts-line",i),b=m,{r:S,strokeWidth:k}=yF(n),E=NA(n),C=S*2+k,A=g?"url(#clipPath-".concat(E?"":"dots-").concat(b,")"):void 0;return x.createElement(bi,{zIndex:v},x.createElement(gr,{className:j},g&&x.createElement("defs",null,x.createElement(zA,{clipPathId:b,xAxisId:a,yAxisId:l}),!E&&x.createElement("clipPath",{id:"clipPath-dots-".concat(b)},x.createElement("rect",{x:d-C/2,y:u-C/2,width:f+C,height:p+C}))),x.createElement(fF,{xAxisId:a,yAxisId:l,data:r,dataPointFormatter:fCe,errorBarOffset:0},x.createElement(dCe,{props:this.props,clipPathId:b}))),x.createElement(pN,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:A}))}}var xF={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Wn.line,type:"linear"};function pCe(e){var t=tr(e,xF),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,connectNulls:u,dot:d,hide:f,isAnimationActive:p,label:m,legendType:g,xAxisId:v,yAxisId:j,id:b}=t,S=PA(t,Xke),{needClip:k}=Hx(v,j),E=Fx(),C=el(),A=rr(),P=Ue(F=>Wke(F,v,j,A,b));if(C!=="horizontal"&&C!=="vertical"||P==null||E==null)return null;var{height:O,width:_,x:T,y:$}=E;return x.createElement(hCe,qh({},S,{id:b,connectNulls:u,dot:d,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:l,isAnimationActive:p,hide:f,label:m,legendType:g,xAxisId:v,yAxisId:j,points:P,layout:C,height:O,width:_,left:T,top:$,needClip:k}))}function mCe(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:l,bandSize:u,displayedData:d}=e;return d.map((f,p)=>{var m=vn(f,l);if(t==="horizontal"){var g=Dy({axis:n,ticks:i,bandSize:u,entry:f,index:p}),v=on(m)?null:r.scale.map(m);return{x:g,y:v??null,value:m,payload:f}}var j=on(m)?null:n.scale.map(m),b=Dy({axis:r,ticks:a,bandSize:u,entry:f,index:p});return j==null||b==null?null:{x:j,y:b,value:m,payload:f}}).filter(Boolean)}function gCe(e){var t=tr(e,xF),n=rr();return x.createElement(AA,{id:t.id,type:"line"},r=>x.createElement(x.Fragment,null,x.createElement(CA,{legendPayload:rCe(t)}),x.createElement(iCe,{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(OA,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),x.createElement(pCe,qh({},t,{id:r}))))}var Kx=x.memo(gCe,Nc);Kx.displayName="Line";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:iF}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:iF}var bF=(e,t,n)=>Qa(e,"xAxis",Za(e,t),n),wF=(e,t,n)=>Va(e,"xAxis",Za(e,t),n),jF=(e,t,n)=>Qa(e,"yAxis",Xa(e,t),n),SF=(e,t,n)=>Va(e,"yAxis",Xa(e,t),n),yCe=re([_t,bF,jF,wF,SF],(e,t,n,r,i)=>va(e,"xAxis")?Ko(t,r,!1):Ko(n,i,!1)),vCe=(e,t)=>t,NF=re([mp,vCe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),kF=e=>{var t=_t(e),n=va(t,"xAxis");return n?"yAxis":"xAxis"},xCe=(e,t)=>{var n=kF(e);return n==="yAxis"?Xa(e,t):Za(e,t)},bCe=(e,t,n)=>iv(e,kF(e),xCe(e,t),n),wCe=re([NF,bCe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=_x(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=a?.find(u=>u.key===i);if(l!=null)return l.map(u=>[u[0],u[1]])}}}),jCe=re([_t,bF,jF,wF,SF,wCe,vU,yCe,NF,hve],(e,t,n,r,i,a,l,u,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:g}=l;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||u==null)){var{data:v}=d,j;if(v&&v.length>0?j=v:j=p?.slice(m,g+1),j!=null)return qCe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:j,chartBaseValue:f,bandSize:u})}}),SCe=["id"],NCe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Zl(){return Zl=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},Zl.apply(null,arguments)}function CF(e,t){if(e==null)return{};var n,r,i=kCe(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 kCe(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 vL(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 Ru(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vL(Object(n),!0).forEach(function(r){CCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CCe(e,t,n){return(t=ACe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ACe(e){var t=OCe(e,"string");return typeof t=="symbol"?t:t+""}function OCe(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 pv(e,t){return e&&e!=="none"?e:t}var ECe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:l}=e;return[{inactive:l,dataKey:t,type:a,color:pv(r,i),value:kd(n,t),payload:e}]},_Ce=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:u,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Jo,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:kd(l,t),hide:u,type:f,color:pv(r,a),unit:d,graphicalItemId:p}};return x.createElement(kA,{tooltipEntrySettings:m})});function zCe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,u=gi(r);return x.createElement(rF,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:u,needClip:i,clipPathId:t})}function PCe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var l,u,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ru(Ru({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(jA,{value:t?i:void 0},n)}function xL(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:l,type:u,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,g=CF(a,SCe),v=gi(g),j=kr(g);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(gr,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(fh,Zl({},j,{id:m,points:t,connectNulls:f,type:u,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(fh,Zl({},v,{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(fh,Zl({},v,{className:"recharts-area-curve",layout:l,type:u,connectNulls:f,fill:"none",points:n}))),x.createElement(zCe,{points:t,props:g,clipPathId:i}))}function TCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,u=(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(!ht(u)||!ht(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.x||0));return Pe(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),Pe(p)?x.createElement("rect",{x:0,y:u<d?u:u-f,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}function RCe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,u=(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(!ht(u)||!ht(d))return null;var f=r*Math.abs(u-d),p=Math.max(...a.map(m=>m.y||0));return Pe(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),Pe(p)?x.createElement("rect",{x:u<d?u:u-f,y:0,width:f,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function DCe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(TCe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(RCe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function MCe(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:l,baseLine:u,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:g,onAnimationEnd:v}=r,j=x.useMemo(()=>({points:l,baseLine:u}),[l,u]),b=lp(j,"recharts-area-"),S=vC(),[k,E]=x.useState(!1),C=!k,A=x.useCallback(()=>{typeof v=="function"&&v(),E(!1)},[v]),P=x.useCallback(()=>{typeof g=="function"&&g(),E(!0)},[g]);if(S==null)return null;var O=i.current,_=a.current;return x.createElement(PCe,{showLabels:C,points:l},r.children,x.createElement(op,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:A,onAnimationStart:P,key:b},T=>{if(O){var $=O.length/l.length,F=T===1?l:l.map((B,V)=>{var X=Math.floor(V*$);if(O[X]){var Z=O[X];return Ru(Ru({},B),{},{x:Ft(Z.x,B.x,T),y:Ft(Z.y,B.y,T)})}return B}),U;return Pe(u)?U=Ft(_,u,T):on(u)||da(u)?U=Ft(_,0,T):U=u.map((B,V)=>{var X=Math.floor(V*$);if(Array.isArray(_)&&_[X]){var Z=_[X];return Ru(Ru({},B),{},{x:Ft(Z.x,B.x,T),y:Ft(Z.y,B.y,T)})}return B}),T>0&&(i.current=F,a.current=U),x.createElement(xL,{points:F,baseLine:U,needClip:t,clipPathId:n,props:r})}return T>0&&(i.current=l,a.current=u),x.createElement(gr,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(DCe,{alpha:T,points:l,baseLine:u,layout:S,strokeWidth:r.strokeWidth}))),x.createElement(gr,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(xL,{points:l,baseLine:u,needClip:t,clipPathId:n,props:r})))}),x.createElement(SA,{label:r.label}))}function ICe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(MCe,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class LCe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:l,needClip:u,xAxisId:d,yAxisId:f,width:p,height:m,id:g,baseLine:v,zIndex:j}=this.props;if(t)return null;var b=Ot("recharts-area",i),S=g,{r:k,strokeWidth:E}=yF(n),C=NA(n),A=k*2+E,P=u?"url(#clipPath-".concat(C?"":"dots-").concat(S,")"):void 0;return x.createElement(bi,{zIndex:j},x.createElement(gr,{className:b},u&&x.createElement("defs",null,x.createElement(zA,{clipPathId:S,xAxisId:d,yAxisId:f}),!C&&x.createElement("clipPath",{id:"clipPath-dots-".concat(S)},x.createElement("rect",{x:l-A/2,y:a-A/2,width:p+A,height:m+A}))),x.createElement(ICe,{needClip:u,clipPathId:S,props:this.props})),x.createElement(pN,{points:r,mainColor:pv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}),this.props.isRange&&Array.isArray(v)&&x.createElement(pN,{points:v,mainColor:pv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:P}))}}var $Ce={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:Wn.area};function BCe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:l,dot:u,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:g,stroke:v,xAxisId:j,yAxisId:b}=e,S=CF(e,NCe),k=el(),E=O8(),{needClip:C}=Hx(j,b),A=rr(),{points:P,isRange:O,baseLine:_}=(t=Ue(V=>jCe(V,e.id,A)))!==null&&t!==void 0?t:{},T=Fx();if(k!=="horizontal"&&k!=="vertical"||T==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:$,width:F,x:U,y:B}=T;return!P||!P.length?null:x.createElement(LCe,Zl({},S,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:_,connectNulls:l,dot:u,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:O,legendType:g,needClip:C,points:P,stroke:v,width:F,left:U,top:B,xAxisId:j,yAxisId:b}))}var UCe=(e,t,n,r,i)=>{var a=n??t;if(Pe(a))return a;var l=e==="horizontal"?i:r,u=l.scale.domain();if(l.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function qCe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:l,xAxis:u,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:g,bandSize:v}=e,j=i&&i.length,b=UCe(a,l,n,u,d),S=a==="horizontal",k=!1,E=f.map((A,P)=>{var O,_,T,$;if(j)$=i[p+P];else{var F=vn(A,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var U=(O=(_=$)===null||_===void 0?void 0:_[1])!==null&&O!==void 0?O:null,B=U==null||j&&!t&&vn(A,r)==null;if(S){var V;return{x:Dy({axis:u,ticks:m,bandSize:v,entry:A,index:P}),y:B?null:(V=d.scale.map(U))!==null&&V!==void 0?V:null,value:$,payload:A}}return{x:B?null:(T=u.scale.map(U))!==null&&T!==void 0?T:null,y:Dy({axis:d,ticks:g,bandSize:v,entry:A,index:P}),value:$,payload:A}}),C;return j||k?C=E.map(A=>{var P,O=Array.isArray(A.value)?A.value[0]:null;if(S){var _;return{x:A.x,y:O!=null&&A.y!=null&&(_=d.scale.map(O))!==null&&_!==void 0?_:null,payload:A.payload}}return{x:O!=null&&(P=u.scale.map(O))!==null&&P!==void 0?P:null,y:A.y,payload:A.payload}}):C=S?d.scale.map(b):u.scale.map(b),{points:E,baseLine:C??0,isRange:k}}function FCe(e){var t=tr(e,$Ce),n=rr();return x.createElement(AA,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(CA,{legendPayload:ECe(t)}),x.createElement(_Ce,{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(OA,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:G6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(BCe,Zl({},t,{id:r}))))}var Du=x.memo(FCe,Nc);Du.displayName="Area";function mN(){return mN=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},mN.apply(null,arguments)}function TA(e){return x.createElement(X8,mN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var HCe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Pe(t))return t;var a=Pe(r)||on(r);return a?t(r,i):(a||_s(!1),n)}},KCe=(e,t,n)=>n,GCe=(e,t)=>t,bp=re([mp,GCe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),VCe=re([bp],e=>e?.maxBarSize),QCe=(e,t,n,r)=>r,WCe=re([_t,mp,Za,Xa,KCe],(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")),YCe=(e,t,n)=>{var r=_t(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null))return r==="horizontal"?iv(e,"yAxis",a,n):iv(e,"xAxis",i,n)},ZCe=(e,t)=>{var n=_t(e),r=Za(e,t),i=Xa(e,t);if(!(r==null||i==null))return n==="horizontal"?dI(e,"xAxis",r):dI(e,"yAxis",i)},XCe=re([WCe,fve,ZCe],_Ne),JCe=(e,t,n)=>{var r,i,a=bp(e,t);if(a==null)return 0;var l=Za(e,t),u=Xa(e,t);if(l==null||u==null)return 0;var d=_t(e),f=_U(e),{maxBarSize:p}=a,m=on(p)?f:p,g,v;return d==="horizontal"?(g=Qa(e,"xAxis",l,n),v=Va(e,"xAxis",l,n)):(g=Qa(e,"yAxis",u,n),v=Va(e,"yAxis",u,n)),(r=(i=Ko(g,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},AF=(e,t,n)=>{var r=_t(e),i=Za(e,t),a=Xa(e,t);if(!(i==null||a==null)){var l,u;return r==="horizontal"?(l=Qa(e,"xAxis",i,n),u=Va(e,"xAxis",i,n)):(l=Qa(e,"yAxis",a,n),u=Va(e,"yAxis",a,n)),Ko(l,u)}},eAe=re([XCe,_U,dve,zU,JCe,AF,VCe],DNe),tAe=(e,t,n)=>{var r=Za(e,t);if(r!=null)return Qa(e,"xAxis",r,n)},nAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Qa(e,"yAxis",r,n)},rAe=(e,t,n)=>{var r=Za(e,t);if(r!=null)return Va(e,"xAxis",r,n)},iAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Va(e,"yAxis",r,n)},aAe=re([eAe,bp],INe),sAe=re([YCe,bp],MNe),oAe=re([nr,hC,tAe,nAe,rAe,iAe,aAe,_t,vU,AF,sAe,bp,QCe],(e,t,n,r,i,a,l,u,d,f,p,m,g)=>{var{chartData:v,dataStartIndex:j,dataEndIndex:b}=d;if(!(m==null||l==null||t==null||u!=="horizontal"&&u!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:S}=m,k;if(S!=null&&S.length>0?k=S:k=v?.slice(j,b+1),k!=null)return DAe({layout:u,barSettings:m,pos:l,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:k,offset:e,cells:g,dataStartIndex:j})}}),lAe=["index"];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 cAe(e,t){if(e==null)return{};var n,r,i=uAe(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 uAe(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 OF=x.createContext(void 0),dAe=e=>{var t=x.useContext(OF);if(t!=null)return t.stackId;if(e!=null)return G6(e)},fAe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),hAe=e=>{var t=x.useContext(OF);if(t!=null){var{stackId:n}=t;return"url(#".concat(fAe(n,e),")")}},EF=e=>{var{index:t}=e,n=cAe(e,lAe),r=hAe(t);return x.createElement(gr,gN({className:"recharts-bar-stack-layer",clipPath:r},n))},pAe=["onMouseEnter","onMouseLeave","onClick"],mAe=["value","background","tooltipPosition"],gAe=["id"],yAe=["onMouseEnter","onClick","onMouseLeave"];function Go(){return Go=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},Go.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 Tr(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=xAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xAe(e){var t=bAe(e,"string");return typeof t=="symbol"?t:t+""}function bAe(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 mv(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}var jAe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:kd(n,t),payload:e}]},SAe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:u,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:Jo,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:kd(a,t),hide:l,type:d,color:i,unit:u,graphicalItemId:f}};return x.createElement(kA,{tooltipEntrySettings:p})});function NAe(e){var t=Ue(fc),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:u,onClick:d}=a,f=mv(a,pAe),p=J8(l,r,a.id),m=eF(u),g=tF(d,r,a.id);if(!i||n==null)return null;var v=Jh(i);return x.createElement(bi,{zIndex:LNe(i,Wn.barBackground)},n.map((j,b)=>{var{value:S,background:k,tooltipPosition:E}=j,C=mv(j,mAe);if(!k)return null;var A=p(j,b),P=m(j,b),O=g(j,b),_=Tr(Tr(Tr(Tr(Tr({option:i,isActive:String(b)===t},C),{},{fill:"#eee"},k),v),sx(f,j,b)),{},{onMouseEnter:A,onMouseLeave:P,onClick:O,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(TA,Go({key:"background-bar-".concat(b)},_))}))}function kAe(e){var{showLabels:t,children:n,rects:r}=e,i=r?.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return Tr(Tr({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return x.createElement(jA,{value:t?i:void 0},n)}function CAe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,u=Ue(fc),d=Ue(k8),f=n&&String(i.originalDataIndex)===u&&(d==null||l===d),[p,m]=x.useState(!1),[g,v]=x.useState(!1);x.useEffect(()=>{var C;return f?(m(!0),C=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(C)}},[f]);var j=x.useCallback(()=>{f||m(!1)},[f]),b=f&&g,S=f||p,k;f?n===!0?k=t:k=n:k=t;var E=x.createElement(TA,Go({},r,{name:String(r.name)},i,{isActive:b,option:k,index:a,dataKey:l,onTransitionEnd:j}));return S?x.createElement(bi,{zIndex:Wn.activeBar},x.createElement(EF,{index:i.originalDataIndex},E)):E}function AAe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(TA,Go({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function OAe(e){var t,{data:n,props:r}=e,i=(t=gi(r))!==null&&t!==void 0?t:{},{id:a}=i,l=mv(i,gAe),{shape:u,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:g}=r,v=mv(r,yAe),j=J8(p,d,a),b=eF(g),S=tF(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,E)=>x.createElement(EF,Go({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(E),className:"recharts-bar-rectangle"},sx(v,k,E),{onMouseEnter:j(k,E),onMouseLeave:b(k,E),onClick:S(k,E)}),f?x.createElement(CAe,{shape:u,activeBar:f,baseProps:l,entry:k,index:E,dataKey:d}):x.createElement(AAe,{shape:u,baseProps:l,entry:k,index:E,dataKey:d})))):null}function EAe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,g=lp(t,"recharts-bar-"),[v,j]=x.useState(!1),b=!v,S=x.useCallback(()=>{typeof f=="function"&&f(),j(!1)},[f]),k=x.useCallback(()=>{typeof p=="function"&&p(),j(!0)},[p]);return x.createElement(kAe,{showLabels:b,rects:r},x.createElement(op,{animationId:g,begin:l,duration:u,isActive:a,easing:d,onAnimationEnd:S,onAnimationStart:k,key:g},E=>{var C=E===1?r:r?.map((A,P)=>{var O=m&&m[P];if(O)return Tr(Tr({},A),{},{x:Ft(O.x,A.x,E),y:Ft(O.y,A.y,E),width:Ft(O.width,A.width,E),height:Ft(O.height,A.height,E)});if(i==="horizontal"){var _=Ft(0,A.height,E),T=Ft(A.stackedBarStart,A.y,E);return Tr(Tr({},A),{},{y:T,height:_})}var $=Ft(0,A.width,E),F=Ft(A.stackedBarStart,A.x,E);return Tr(Tr({},A),{},{width:$,x:F})});return E>0&&(n.current=C??null),C==null?null:x.createElement(gr,null,x.createElement(OAe,{props:t,data:C}))}),x.createElement(SA,{label:t.label}),t.children)}function _Ae(e){var t=x.useRef(null);return x.createElement(EAe,{previousRectanglesRef:t,props:e})}var _F=0,zAe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:vn(e,t)}};class PAe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:u,background:d,id:f}=this.props;if(t||n==null)return null;var p=Ot("recharts-bar",i),m=f;return x.createElement(gr,{className:p,id:f},u&&x.createElement("defs",null,x.createElement(zA,{clipPathId:m,xAxisId:a,yAxisId:l})),x.createElement(gr,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},x.createElement(NAe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(_Ae,this.props)))}}var TAe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:_F,xAxisId:0,yAxisId:0,zIndex:Wn.bar};function RAe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=Hx(t,n),g=el(),v=rr(),j=O1e(e.children,lv),b=Ue(E=>oAe(E,e.id,v,j));if(g!=="vertical"&&g!=="horizontal")return null;var S,k=b?.[0];return k==null||k.height==null||k.width==null?S=0:S=g==="vertical"?k.height/2:k.width/2,x.createElement(fF,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:zAe,errorBarOffset:S},x.createElement(PAe,Go({},e,{layout:g,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function DAe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:l,xAxis:u,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:g,offset:v,cells:j,parentViewBox:b,dataStartIndex:S}=e,k=t==="horizontal"?d:u,E=m?k.scale.domain():null,C=Ype({numericAxis:k}),A=k.scale.map(C);return g.map((P,O)=>{var _,T,$,F,U,B;if(m){var V=m[O+S];if(V==null)return null;_=Kpe(V,E)}else _=vn(P,n),Array.isArray(_)||(_=[C,_]);var X=HCe(r,_F)(_[1],O);if(t==="horizontal"){var Z,H=d.scale.map(_[0]),J=d.scale.map(_[1]);if(H==null||J==null)return null;T=aD({axis:u,ticks:f,bandSize:l,offset:a.offset,entry:P,index:O}),$=(Z=J??H)!==null&&Z!==void 0?Z:void 0,F=a.size;var oe=H-J;if(U=da(oe)?0:oe,B={x:T,y:v.top,width:F,height:v.height},Math.abs(X)>0&&Math.abs(U)<Math.abs(X)){var ye=Wr(U||X)*(Math.abs(X)-Math.abs(U));$-=ye,U+=ye}}else{var I=u.scale.map(_[0]),M=u.scale.map(_[1]);if(I==null||M==null)return null;if(T=I,$=aD({axis:d,ticks:p,bandSize:l,offset:a.offset,entry:P,index:O}),F=M-I,U=a.size,B={x:v.left,y:$,width:v.width,height:U},Math.abs(X)>0&&Math.abs(F)<Math.abs(X)){var q=Wr(F||X)*(Math.abs(X)-Math.abs(F));F+=q}}if(T==null||$==null||F==null||U==null||!i&&(F===0||U===0))return null;var D=Tr(Tr({},P),{},{stackedBarStart:A,x:T,y:$,width:F,height:U,value:m?_:_[1],payload:P,background:B,tooltipPosition:{x:T+F/2,y:$+U/2},parentViewBox:b,originalDataIndex:O},j&&j[O]&&j[O].props);return D}).filter(Boolean)}function MAe(e){var t=tr(e,TAe),n=dAe(t.stackId),r=rr();return x.createElement(AA,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(CA,{legendPayload:jAe(t)}),x.createElement(SAe,{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(OA,{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(bi,{zIndex:t.zIndex},x.createElement(RAe,Go({},t,{id:i})))))}var gv=x.memo(MAe,Nc);gv.displayName="Bar";var IAe=["domain","range"],LAe=["domain","range"];function wL(e,t){if(e==null)return{};var n,r,i=$Ae(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 $Ae(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 jL(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 zF(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=wL(e,IAe),{domain:a,range:l}=t,u=wL(t,LAe);return!jL(n,a)||!jL(r,l)?!1:Nc(i,u)}var BAe=["type"],UAe=["dangerouslySetInnerHTML","ticks","scale"],qAe=["id","scale"];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)}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 NL(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){FAe(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 FAe(e,t,n){return(t=HAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HAe(e){var t=KAe(e,"string");return typeof t=="symbol"?t:t+""}function KAe(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 vN(e,t){if(e==null)return{};var n,r,i=GAe(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 GAe(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 VAe(e){var t=ln(),n=x.useRef(null),r=vC(),{type:i}=e,a=vN(e,BAe),l=Ax(r,"xAxis",i),u=x.useMemo(()=>{if(l!=null)return NL(NL({},a),{},{type:l})},[a,l]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(mNe(u)):n.current!==u&&t(gNe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(yNe(n.current)),n.current=null)},[t]),null}var QAe=e=>{var{xAxisId:t,className:n}=e,r=Ue(hC),i=rr(),a="xAxis",l=Ue(k=>r8(k,a,t,i)),u=Ue(k=>e8(k,t)),d=Ue(k=>Qbe(k,t)),f=Ue(k=>jq(k,t));if(u==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:g}=e,v=vN(e,UAe),{id:j,scale:b}=f,S=vN(f,qAe);return x.createElement(_A,yN({},v,S,{x:d.x,y:d.y,width:u.width,height:u.height,className:Ot("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},WAe={allowDataOverflow:Gn.allowDataOverflow,allowDecimals:Gn.allowDecimals,allowDuplicatedCategory:Gn.allowDuplicatedCategory,angle:Gn.angle,axisLine:Os.axisLine,height:Gn.height,hide:!1,includeHidden:Gn.includeHidden,interval:Gn.interval,label:!1,minTickGap:Gn.minTickGap,mirror:Gn.mirror,orientation:Gn.orientation,padding:Gn.padding,reversed:Gn.reversed,scale:Gn.scale,tick:Gn.tick,tickCount:Gn.tickCount,tickLine:Os.tickLine,tickSize:Os.tickSize,type:Gn.type,niceTicks:Gn.niceTicks,xAxisId:0},YAe=e=>{var t=tr(e,WAe);return x.createElement(x.Fragment,null,x.createElement(VAe,{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(QAe,t))},Wa=x.memo(YAe,zF);Wa.displayName="XAxis";var ZAe=["type"],XAe=["dangerouslySetInnerHTML","ticks","scale"],JAe=["id","scale"];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 kL(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 CL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kL(Object(n),!0).forEach(function(r){eOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eOe(e,t,n){return(t=tOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tOe(e){var t=nOe(e,"string");return typeof t=="symbol"?t:t+""}function nOe(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 bN(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 iOe(e){var t=ln(),n=x.useRef(null),r=vC(),{type:i}=e,a=bN(e,ZAe),l=Ax(r,"yAxis",i),u=x.useMemo(()=>{if(l!=null)return CL(CL({},a),{},{type:l})},[l,a]);return x.useLayoutEffect(()=>{u!=null&&(n.current===null?t(vNe(u)):n.current!==u&&t(xNe({prev:n.current,next:u})),n.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(bNe(n.current)),n.current=null)},[t]),null}function aOe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),l=x.useRef(null),u=Ue(hC),d=rr(),f=ln(),p="yAxis",m=Ue(O=>t8(O,t)),g=Ue(O=>Ybe(O,t)),v=Ue(O=>r8(O,p,t,d)),j=Ue(O=>Sq(O,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||wA(i)||x.isValidElement(i)||j==null)){var O=a.current;if(O){var _=O.getCalculatedWidth();Math.round(m.width)!==Math.round(_)&&f(wNe({id:t,width:_}))}}},[v,m,f,i,t,r,j]),m==null||g==null||j==null)return null;var{dangerouslySetInnerHTML:b,ticks:S,scale:k}=e,E=bN(e,XAe),{id:C,scale:A}=j,P=bN(j,JAe);return x.createElement(_A,xN({},E,P,{ref:a,labelRef:l,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:Ot("recharts-".concat(p," ").concat(p),n),viewBox:u,ticks:v,axisType:p,axisId:t}))}var sOe={allowDataOverflow:Vn.allowDataOverflow,allowDecimals:Vn.allowDecimals,allowDuplicatedCategory:Vn.allowDuplicatedCategory,angle:Vn.angle,axisLine:Os.axisLine,hide:!1,includeHidden:Vn.includeHidden,interval:Vn.interval,label:!1,minTickGap:Vn.minTickGap,mirror:Vn.mirror,orientation:Vn.orientation,padding:Vn.padding,reversed:Vn.reversed,scale:Vn.scale,tick:Vn.tick,tickCount:Vn.tickCount,tickLine:Os.tickLine,tickSize:Os.tickSize,type:Vn.type,niceTicks:Vn.niceTicks,width:Vn.width,yAxisId:0},oOe=e=>{var t=tr(e,sOe);return x.createElement(x.Fragment,null,x.createElement(iOe,{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(aOe,t))},Ya=x.memo(oOe,zF);Ya.displayName="YAxis";var lOe=(e,t)=>t,RA=re([lOe,_t,LU,ar,w8,Hs,vje,nr],kje);function cOe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function DA(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(cOe(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 l=(u,d)=>({relativeX:Math.round((u-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(u=>l(u.clientX,u.clientY)):l(e.clientX,e.clientY)}var PF=yi("mouseClick"),TF=np();TF.startListening({actionCreator:PF,effect:(e,t)=>{var n=e.payload,r=RA(t.getState(),DA(n));r?.activeIndex!=null&&t.dispatch(fwe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var wN=yi("mouseMove"),RF=np(),wu=null,Cl=null,CS=null;RF.startListening({actionCreator:wN,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a?.includes("mousemove");wu!==null&&(cancelAnimationFrame(wu),wu=null),Cl!==null&&(typeof i!="number"||!l)&&(clearTimeout(Cl),Cl=null),CS=DA(n);var u=()=>{var d=t.getState(),f=vp(d,d.tooltip.settings.shared);if(!CS){wu=null,Cl=null;return}if(f==="axis"){var p=RA(d,CS);p?.activeIndex!=null?t.dispatch(d8({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(u8())}wu=null,Cl=null};if(!l){u();return}i==="raf"?wu=requestAnimationFrame(u):typeof i=="number"&&Cl===null&&(Cl=setTimeout(u,i))}});function uOe(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 AL={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},DF=Or({name:"rootProps",initialState:AL,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:AL.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}}}),dOe=DF.reducer,{updateOptions:fOe}=DF.actions,hOe=null,pOe={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)},MF=Or({name:"polarOptions",initialState:hOe,reducers:pOe}),{updatePolarOptions:Aze}=MF.actions,mOe=MF.reducer,IF=yi("keyDown"),LF=yi("focus"),$F=yi("blur"),Gx=np(),ju=null,Al=null,kg=null;Gx.startListening({actionCreator:IF,effect:(e,t)=>{kg=e.payload,ju!==null&&(cancelAnimationFrame(ju),ju=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Al!==null&&(typeof r!="number"||!a)&&(clearTimeout(Al),Al=null);var l=()=>{try{var u=t.getState(),d=u.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=u.tooltip,p=kg;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=hh(f,dc(u),cd(u),ud(u)),g=m==null?-1:Number(m),v=!Number.isFinite(g)||g<0,j=Hs(u),b=dc(u),S=vp(u,u.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=ov(u,S,"hover",String(f.index));t.dispatch(sv({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var E=twe(u),C=E==="left-to-right"?1:-1,A=p==="ArrowRight"?1:-1,P;if(v){var O=cd(u),_=ud(u),T=A*C,$=X=>({active:!1,index:String(X),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(P=-1,T>0){for(var F=0;F<b.length;F++)if(hh($(F),b,O,_)!=null){P=F;break}}else for(var U=b.length-1;U>=0;U--)if(hh($(U),b,O,_)!=null){P=U;break}if(P<0)return}else{P=g+A*C;var B=j?.length||b.length;if(B===0||P>=B||P<0)return}var V=ov(u,S,"hover",String(P));t.dispatch(sv({active:!0,activeIndex:P.toString(),activeCoordinate:V}))}finally{ju=null,Al=null}};if(!a){l();return}r==="raf"?ju=requestAnimationFrame(l):typeof r=="number"&&Al===null&&(l(),kg=null,Al=setTimeout(()=>{kg?l():(Al=null,ju=null)},r))}});Gx.startListening({actionCreator:LF,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",l=vp(n,n.tooltip.settings.shared),u=ov(n,l,"hover",String(a));t.dispatch(sv({active:!0,activeIndex:a,activeCoordinate:u}))}}}});Gx.startListening({actionCreator:$F,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(sv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function BF(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 Di=yi("externalEvent"),UF=np(),Cg=new Map,Yf=new Map,AS=new Map;UF.startListening({actionCreator:Di,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=BF(r);AS.set(i,{handler:n,reactEvent:a});var l=Cg.get(i);l!==void 0&&(cancelAnimationFrame(l),Cg.delete(i));var u=t.getState(),{throttleDelay:d,throttledEvents:f}=u.eventSettings,p=f,m=p==="all"||p?.includes(i),g=Yf.get(i);g!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(g),Yf.delete(i));var v=()=>{var S=AS.get(i);try{if(!S)return;var{handler:k,reactEvent:E}=S,C=t.getState(),A={activeCoordinate:rje(C),activeDataKey:k8(C),activeIndex:fc(C),activeLabel:N8(C),activeTooltipIndex:fc(C),isTooltipActive:ije(C)};k&&k(A,E)}finally{Cg.delete(i),Yf.delete(i),AS.delete(i)}};if(!m){v();return}if(d==="raf"){var j=requestAnimationFrame(v);Cg.set(i,j)}else if(typeof d=="number"){if(!Yf.has(i)){v();var b=setTimeout(v,d);Yf.set(i,b)}}else v()}}});var gOe=re([Td],e=>e.tooltipItemPayloads),yOe=re([gOe,(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)}}}),qF=yi("touchMove"),FF=np(),Ol=null,So=null,OL=null,Zf=null;FF.startListening({actionCreator:qF,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){Zf=BF(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");Ol!==null&&(cancelAnimationFrame(Ol),Ol=null),So!==null&&(typeof i!="number"||!l)&&(clearTimeout(So),So=null),OL=Array.from(n.touches).map(d=>DA({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var u=()=>{if(Zf!=null){var d=t.getState(),f=vp(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=OL)===null||p===void 0?void 0:p[0];if(m==null){Ol=null,So=null;return}var g=RA(d,m);g?.activeIndex!=null&&t.dispatch(d8({activeIndex:g.activeIndex,activeDataKey:void 0,activeCoordinate:g.activeCoordinate}))}else if(f==="item"){var v,j=Zf.touches[0];if(document.elementFromPoint==null||j==null)return;var b=document.elementFromPoint(j.clientX,j.clientY);if(!b||!b.getAttribute)return;var S=b.getAttribute(rme),k=(v=b.getAttribute(ime))!==null&&v!==void 0?v:void 0,E=Ac(d).find(P=>P.id===k);if(S==null||E==null||k==null)return;var{dataKey:C}=E,A=yOe(d,S,k);t.dispatch(c8({activeDataKey:C,activeIndex:S,activeCoordinate:A,activeGraphicalItemId:k}))}Ol=null,So=null}};if(!l){u();return}i==="raf"?Ol=requestAnimationFrame(u):typeof i=="number"&&So===null&&(u(),Zf=null,So=setTimeout(()=>{Zf?u():(So=null,Ol=null)},i))}}});var HF={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},KF=Or({name:"eventSettings",initialState:HF,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:vOe}=KF.actions,xOe=KF.reducer,bOe=m6({brush:BNe,cartesianAxis:jNe,chartData:tSe,errorBars:$ke,eventSettings:xOe,graphicalItems:tNe,layout:Bpe,legend:Zme,options:Yje,polarAxis:S1e,polarOptions:mOe,referenceElements:HNe,renderedTicks:oke,rootProps:dOe,tooltip:hwe,zIndex:Lje}),wOe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return dpe({reducer:bOe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([TF.middleware,RF.middleware,Gx.middleware,UF.middleware,FF.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(_6({type:"raf"}))},devTools:{serialize:{replacer:uOe},name:"recharts-".concat(n)}})};function jOe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=rr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=wOe(t,r));var l=sC;return x.createElement(mge,{context:l,store:a.current},n)}function SOe(e){var{layout:t,margin:n}=e,r=ln(),i=rr();return x.useEffect(()=>{i||(r(Ipe(t)),r(Mpe(n)))},[r,i,t,n]),null}var NOe=x.memo(SOe,Nc);function kOe(e){var t=ln();return x.useEffect(()=>{t(fOe(e))},[t,e]),null}var COe=e=>{var t=ln();return x.useEffect(()=>{t(vOe(e))},[t,e]),null},AOe=x.memo(COe,Nc);function EL(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=ln();return x.useLayoutEffect(()=>(r.current&&i(Mje({zIndex:t,element:r.current,isPanorama:n})),()=>{i(Ije({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function _L(e){var{children:t,isPanorama:n}=e,r=Ue(Aje);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return x.createElement(x.Fragment,null,i.map(l=>x.createElement(EL,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>x.createElement(EL,{key:l,zIndex:l,isPanorama:n})))}var OOe=["children"];function EOe(e,t){if(e==null)return{};var n,r,i=_Oe(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 _Oe(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 yv(){return yv=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},yv.apply(null,arguments)}var zOe={width:"100%",height:"100%",display:"block"},POe=x.forwardRef((e,t)=>{var n=gC(),r=yC(),i=lU();if(!Ha(n)||!Ha(r))return null;var{children:a,otherAttributes:l,title:u,desc:d}=e,f,p;return l!=null&&(typeof l.tabIndex=="number"?f=l.tabIndex:f=i?0:void 0,typeof l.role=="string"?p=l.role:p=i?"application":void 0),x.createElement(Yk,yv({},l,{title:u,desc:d,role:p,tabIndex:f,width:n,height:r,style:zOe,ref:t}),a)}),TOe=e=>{var{children:t}=e,n=Ue(bx);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return x.createElement(Yk,{width:r,height:i,x:l,y:a},t)},zL=x.forwardRef((e,t)=>{var{children:n}=e,r=EOe(e,OOe),i=rr();return i?x.createElement(TOe,null,x.createElement(_L,{isPanorama:!0},n)):x.createElement(POe,yv({ref:t},r),x.createElement(_L,{isPanorama:!1},n))});function ROe(){var e=ln(),[t,n]=x.useState(null),r=Ue(nme);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ht(a)&&a!==r&&e($pe(a))}},[t,e,r]),n}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 DOe(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){MOe(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 MOe(e,t,n){return(t=IOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IOe(e){var t=LOe(e,"string");return typeof t=="symbol"?t:t+""}function LOe(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 Uo(){return Uo=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},Uo.apply(null,arguments)}var $Oe=()=>(uSe(),null);function vv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var BOe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,l]=x.useState({containerWidth:vv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:vv((r=e.style)===null||r===void 0?void 0:r.height)}),u=x.useCallback((f,p)=>{l(m=>{var g=Math.round(f),v=Math.round(p);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,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();u(p,m);var g=j=>{var b=j[0];if(b!=null){var{width:S,height:k}=b.contentRect;u(S,k)}},v=new ResizeObserver(g);v.observe(f),i.current=v}},[t,u]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[u]),x.createElement(x.Fragment,null,x.createElement(ip,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Uo({ref:d},e)))}),UOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:vv(n),containerHeight:vv(r)}),l=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),g=Math.round(f);return p.containerWidth===m&&p.containerHeight===g?p:{containerWidth:m,containerHeight:g}})},[]),u=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();l(f,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(ip,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Uo({ref:u},e)))}),qOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(ip,{width:n,height:r}),x.createElement("div",Uo({ref:t},e)))}),FOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(UOe,Uo({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(qOe,Uo({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(ip,{width:n,height:r}),x.createElement("div",Uo({ref:t},e)))});function HOe(e){return e?BOe:FOe}var KOe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:u,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:g,onTouchEnd:v,onTouchMove:j,onTouchStart:b,style:S,width:k,responsive:E,dispatchTouchEvents:C=!0}=e,A=x.useRef(null),P=ln(),[O,_]=x.useState(null),[T,$]=x.useState(null),F=ROe(),U=pC(),B=U?.width>0?U.width:k,V=U?.height>0?U.height:i,X=x.useCallback(pe=>{F(pe),typeof t=="function"&&t(pe),_(pe),$(pe),pe!=null&&(A.current=pe)},[F,t,_,$]),Z=x.useCallback(pe=>{P(PF(pe)),P(Di({handler:a,reactEvent:pe}))},[P,a]),H=x.useCallback(pe=>{P(wN(pe)),P(Di({handler:f,reactEvent:pe}))},[P,f]),J=x.useCallback(pe=>{P(u8()),P(Di({handler:p,reactEvent:pe}))},[P,p]),oe=x.useCallback(pe=>{P(wN(pe)),P(Di({handler:m,reactEvent:pe}))},[P,m]),ye=x.useCallback(()=>{P(LF())},[P]),I=x.useCallback(()=>{P($F())},[P]),M=x.useCallback(pe=>{P(IF(pe.key))},[P]),q=x.useCallback(pe=>{P(Di({handler:l,reactEvent:pe}))},[P,l]),D=x.useCallback(pe=>{P(Di({handler:u,reactEvent:pe}))},[P,u]),G=x.useCallback(pe=>{P(Di({handler:d,reactEvent:pe}))},[P,d]),se=x.useCallback(pe=>{P(Di({handler:g,reactEvent:pe}))},[P,g]),ne=x.useCallback(pe=>{P(Di({handler:b,reactEvent:pe}))},[P,b]),Ce=x.useCallback(pe=>{C&&P(qF(pe)),P(Di({handler:j,reactEvent:pe}))},[P,C,j]),Se=x.useCallback(pe=>{P(Di({handler:v,reactEvent:pe}))},[P,v]),ee=HOe(E);return x.createElement(T8.Provider,{value:O},x.createElement(_B.Provider,{value:T},x.createElement(ee,{width:B??S?.width,height:V??S?.height,className:Ot("recharts-wrapper",r),style:DOe({position:"relative",cursor:"default",width:B,height:V},S),onClick:Z,onContextMenu:q,onDoubleClick:D,onFocus:ye,onBlur:I,onKeyDown:M,onMouseDown:G,onMouseEnter:H,onMouseLeave:J,onMouseMove:oe,onMouseUp:se,onTouchEnd:Se,onTouchMove:Ce,onTouchStart:ne,ref:X},x.createElement($Oe,null),n)))}),GOe=["width","height","responsive","children","className","style","compact","title","desc"];function VOe(e,t){if(e==null)return{};var n,r,i=QOe(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 QOe(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 WOe=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:u,compact:d,title:f,desc:p}=e,m=VOe(e,GOe),g=gi(m);return d?x.createElement(x.Fragment,null,x.createElement(ip,{width:n,height:r}),x.createElement(zL,{otherAttributes:g,title:f,desc:p},a)):x.createElement(KOe,{className:l,style:u,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(zL,{otherAttributes:g,title:f,desc:p,ref:t},x.createElement(GNe,null,a)))});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 TL(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 YOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TL(Object(n),!0).forEach(function(r){ZOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ZOe(e,t,n){return(t=XOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XOe(e){var t=JOe(e,"string");return typeof t=="symbol"?t:t+""}function JOe(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 eEe={top:5,right:5,bottom:5,left:5},tEe=YOe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:eEe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},HF),MA=x.forwardRef(function(t,n){var r,i=tr(t.categoricalChartProps,tEe),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(jOe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement($Ne,{chartData:f.data}),x.createElement(NOe,{layout:i.layout,margin:i.margin}),x.createElement(AOe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(kOe,{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(WOe,jN({},i,{ref:n})))}),nEe=["axis"],IA=x.forwardRef((e,t)=>x.createElement(MA,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:nEe,tooltipPayloadSearcher:xA,categoricalChartProps:e,ref:t})),rEe=["axis","item"],SN=x.forwardRef((e,t)=>x.createElement(MA,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:rEe,tooltipPayloadSearcher:xA,categoricalChartProps:e,ref:t})),iEe=["axis"],NN=x.forwardRef((e,t)=>x.createElement(MA,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:iEe,tooltipPayloadSearcher:xA,categoricalChartProps:e,ref:t}));const ua={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},er={fill:"#71717a",fontSize:11},dd="#27272a",Nr="#27272a",An=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function GF(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function fd(e){return GF(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function hd(e){const t=GF(e);return`${t.getMonth()+1}/${t.getDate()}`}const aEe=6,pd="__other__",Gu="_socialTotal";function sEe(e,t=aEe){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)),l=Math.max(0,r.length-t),u=new Map;for(const p of e){let m=u.get(p.date);m||(m={date:p.date,[Gu]:0},u.set(p.date,m));const g=a.has(p.source)?p.source:pd;m[g]=(m[g]??0)+p.sessions,m[Gu]=(m[Gu]??0)+p.sessions}const d=[...u.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return l>0&&f.push(pd),{data:d,sources:f,otherCount:l}}function Vu(e){return e.replace(/\+/g," ")}function VF(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const oEe=["7d","30d","90d","all"],Eo=An,kN="#71717a",QF="#52525b",Xf=25;function Ag(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function lEe(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 cEe({projectName:e}){const t=xi(),[n,r]=x.useState(null),[i,a]=x.useState(null),[l,u]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(null),[j,b]=x.useState(null),[S,k]=x.useState("sessions"),[E,C]=x.useState("desc"),[A,P]=x.useState("sessions"),[O,_]=x.useState("desc"),[T,$]=x.useState("sessions"),[F,U]=x.useState("desc"),[B,V]=x.useState("sessions"),[X,Z]=x.useState("desc"),[H,J]=x.useState([]),[oe,ye]=x.useState([]),[I,M]=x.useState([]),[q,D]=x.useState(!1),[G,se]=x.useState("30d");async function ne(de){u(!0),v(null);try{const ze=await t.fetchQuery({queryKey:qe.traffic.status(e),queryFn:()=>eQ(e),staleTime:Tf});if(de.current)return;if(r(ze),!ze.connected){a(null),J([]),ye([]),M([]),u(!1);return}const[fe,Qe,Fn,wi]=await Promise.all([t.fetchQuery({queryKey:qe.traffic.summary(e,G),queryFn:()=>tQ(e,void 0,G),staleTime:Tf}),t.fetchQuery({queryKey:qe.traffic.aiHistory(e,G),queryFn:()=>rQ(e,G).catch(()=>[]),staleTime:Tf}),t.fetchQuery({queryKey:qe.traffic.sessionHistory(e,G),queryFn:()=>aQ(e,G).catch(()=>[]),staleTime:Tf}),t.fetchQuery({queryKey:qe.traffic.socialHistory(e,G),queryFn:()=>iQ(e,G).catch(()=>[]),staleTime:Tf})]);if(de.current)return;a(fe),J(Qe),ye(Fn),M(wi),u(!1)}catch(ze){if(de.current)return;v(ze instanceof Error?ze.message:"Failed to load GA4 data"),u(!1)}}x.useEffect(()=>{const de={current:!1};return ne(de),()=>{de.current=!0}},[e,G,t]);async function Ce(){f(!0),v(null),b(null);try{const de=await M5(e);b(`Synced ${de.rowCount.toLocaleString()} page rows, ${de.aiReferralCount.toLocaleString()} AI and ${de.socialReferralCount.toLocaleString()} social referral rows (${de.days} days)`),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await ne({current:!1})}catch(de){v(de instanceof Error?de.message:"Sync failed")}finally{f(!1)}}async function Se(){m(!0),v(null),b(null);try{await sQ(e),await t.invalidateQueries({queryKey:qe.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(de){v(de instanceof Error?de.message:"Disconnect failed")}finally{m(!1)}}function ee(de){S===de?C(ze=>ze==="desc"?"asc":"desc"):(k(de),C("desc"))}function pe(de){A===de?_(ze=>ze==="desc"?"asc":"desc"):(P(de),_("desc"))}function Ee(de){T===de?U(ze=>ze==="desc"?"asc":"desc"):($(de),U("desc"))}function Y(de){B===de?Z(ze=>ze==="desc"?"asc":"desc"):(V(de),Z("desc"))}const He=x.useMemo(()=>i?.topPages?[...i.topPages].sort((de,ze)=>{const fe=de[S],Qe=ze[S];return typeof fe=="string"&&typeof Qe=="string"?E==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):E==="asc"?fe-Qe:Qe-fe}):[],[i?.topPages,S,E]),Te=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((de,ze)=>{const fe=de[A],Qe=ze[A];return typeof fe=="string"&&typeof Qe=="string"?O==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):O==="asc"?fe-Qe:Qe-fe}):[],[i?.aiReferrals,A,O]),at=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((de,ze)=>{const fe=de[B],Qe=ze[B];return typeof fe=="string"&&typeof Qe=="string"?X==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):X==="asc"?fe-Qe:Qe-fe}):[],[i?.aiReferralLandingPages,B,X]),Ve=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((de,ze)=>{const fe=de[T],Qe=ze[T];return typeof fe=="string"&&typeof Qe=="string"?F==="asc"?fe.localeCompare(Qe):Qe.localeCompare(fe):F==="asc"?fe-Qe:Qe-fe}):[],[i?.socialReferrals,T,F]),{socialChartData:Ht,socialChartSources:Lt,socialOtherCount:cn}=x.useMemo(()=>{const de=sEe(I);return{socialChartData:de.data,socialChartSources:de.sources,socialOtherCount:de.otherCount}},[I]),{chartData:en,chartSources:je,dateRange:Ze}=x.useMemo(()=>{const de=[...new Set(H.map(tn=>tn.source))],ze=new Map;for(const tn of oe)ze.set(tn.date,{_totalSessions:tn.sessions,_organicSessions:tn.organicSessions});const fe=new Map;for(const tn of H){const En=`${tn.date}::${tn.source}`,$r=fe.get(En)??0;fe.set(En,Math.max($r,tn.sessions))}for(const[tn,En]of fe){const[$r,Zi]=tn.split("::");let ba=ze.get($r);ba||(ba={_totalSessions:0,_organicSessions:0},ze.set($r,ba)),ba[Zi]=(ba[Zi]??0)+En}const Qe=[...ze.entries()].sort(([tn],[En])=>tn.localeCompare(En)).map(([tn,En])=>({date:tn,...En})),Fn=Qe.map(tn=>tn.date),wi=Fn.length>0?{start:Fn[0],end:Fn[Fn.length-1]}:null;return{chartData:Qe,chartSources:de,dateRange:wi}},[H,oe]);if(l&&!n)return s.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading traffic data…"});if(!n?.connected)return s.jsx(uEe,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:qe.traffic.project(e)}),await ne({current:!1})))()}});const Rt=i?.organicSharePctDisplay??"0%",mt=i?.totalOrganicSessions??0,Je=i?.aiSessionsDeduped??0,ce=i?.aiSessionsBySession??0,Ne=i?.aiSharePctBySessionDisplay??"0%",Me=i?new Set(i.aiReferrals.map(de=>de.source.toLowerCase())).size:0,Ge=Te[0]??null,pt=i?.totalDirectSessions??0,mn=i?.directSharePctDisplay??"0%",On=i?.socialSessions??0,gn=i?.socialSharePctDisplay??"0%",We=i?new Set(i.socialReferrals.map(de=>de.source.toLowerCase())).size:0,Kt=Ve[0]??null;return s.jsxs(s.Fragment,{children:[g&&s.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:g}),j&&s.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:j}),s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-emerald-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Property ",s.jsx("span",{className:"text-zinc-300",children:n.propertyId}),n.clientEmail&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("span",{className:"text-zinc-500",children:n.clientEmail})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[s.jsx(z2,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),s.jsxs(be,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:Se,children:[s.jsx(AW,{className:"w-3.5 h-3.5 mr-1.5"}),"Disconnect"]})]})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Overview"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Site Traffic",s.jsx(pr,{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.`})]})]}),s.jsx("div",{className:"flex gap-1",children:oEe.map(de=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${G===de?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>se(de),children:de==="all"?"All":de},de))})]}),i?s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx(OS,{value:Ag(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),s.jsx(OS,{value:Ag(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Rt} of total`,tone:"positive"}),s.jsx(OS,{value:Ag(i.totalUsers),label:"Total Users",subtitle:i.totalUsers.toLocaleString(),tone:"neutral"})]}):s.jsxs("div",{className:"surface-card rounded-lg p-6 text-center border border-zinc-800/60",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-3",children:"No traffic data yet."}),s.jsxs(be,{variant:"outline",size:"sm",disabled:d,onClick:Ce,children:[s.jsx(z2,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),"Sync from GA4"]})]})]}),i&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Traffic Attribution"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Traffic by channel",s.jsx(pr,{text:"Decomposes GA4 sessions into four disjoint channels — organic search, social, direct, and known AI referrers. The AI cell is rendered separately so AI-driven traffic never inflates the Direct count. Detected via sessionDefaultChannelGrouping plus AI-source matching on sessionSource/firstUserSource/sessionManualSource (generic search sources excluded)."})]})]}),Ze&&s.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(Ze.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(Ze.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),en.length>0&&s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:je.length>0?"AI vs. total sessions":"All sessions (baseline)"}),je.length===0&&s.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),je.length===0&&s.jsx("p",{className:"text-xs text-zinc-500",children:"No AI referrals detected yet"})]}),s.jsx("div",{className:"h-64",children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(NN,{data:en,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Wa,{dataKey:"date",tick:er,tickLine:!1,axisLine:{stroke:Nr},tickFormatter:hd}),s.jsx(Ya,{tick:er,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(Ms,{...ua,labelFormatter:fd,formatter:(de,ze)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(ze??"");return Qe==="_totalSessions"?[fe,"Total Sessions"]:Qe==="_organicSessions"?[fe,"Organic Sessions"]:[fe,Qe]}}),s.jsx(sU,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:de=>de==="_totalSessions"?"Total Sessions":de==="_organicSessions"?"Organic Sessions":de}),s.jsx(Du,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),je.map((de,ze)=>s.jsx(Du,{type:"monotone",dataKey:de,stackId:"ai",stroke:Eo[ze%Eo.length],fill:Eo[ze%Eo.length],fillOpacity:.4,strokeWidth:1.5},de))]})})})]}),s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Channel breakdown"})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(_a,{label:"Organic",value:Rt,hint:`${mt.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search')."}),s.jsx(_a,{label:"Social",value:gn,hint:`${On.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social')."}),s.jsx(_a,{label:"Direct",value:mn,hint:`${pt.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."}),s.jsx(_a,{label:"Known AI referrers (lower bound)",value:Ne,hint:`${ce.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions whose current sessionSource matched a known AI engine (e.g. chatgpt.com, claude.ai, gemini.google.com). Disjoint from Direct/Organic/Social. 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."})]}),Ge&&s.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: ",s.jsx("span",{className:"font-medium",children:Ge.source})," via ",Ge.medium,", accounting for ",Ge.sessions.toLocaleString()," sessions."]})]}),s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — sources detected"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:i.aiReferrals.length>0?`${Me} unique sources, ${i.aiReferrals.length} rows`:"No source rows"})]}),i.aiReferrals.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Source",sortKey:"source",current:A,dir:O,onSort:pe,align:"left"}),s.jsx(vr,{label:"Medium",sortKey:"medium",current:A,dir:O,onSort:pe,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:A,dir:O,onSort:pe,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(vr,{label:"Users",sortKey:"users",current:A,dir:O,onSort:pe,align:"right"})]})}),s.jsx("tbody",{children:Te.map(de=>s.jsx(fEe,{referral:de,totalSessions:Je},`${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI referrer sessions detected yet"}),s.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."})]})]}),s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Detail"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Known AI referrers — landing pages"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:at.length>0?`${at.length} rows`:"No landing-page rows"})]}),at.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Landing Page",sortKey:"landingPage",current:B,dir:X,onSort:Y,align:"left"}),s.jsx(vr,{label:"Source",sortKey:"source",current:B,dir:X,onSort:Y,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:B,dir:X,onSort:Y,align:"right"}),s.jsx(vr,{label:"Users",sortKey:"users",current:B,dir:X,onSort:Y,align:"right"})]})}),s.jsx("tbody",{children:at.map(de=>s.jsx(hEe,{row:de},`${de.landingPage}:${de.source}:${de.medium}:${de.sourceDimension}`))})]})}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No AI landing pages detected yet"}),s.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&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Social Attribution"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Social Media Traffic",s.jsx(pr,{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."})]})]}),Ht.length>0&&s.jsxs($e,{className:"surface-card p-5 mb-4",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Trend"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social sessions over time"})]}),cn>0&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Lt.length-1," sources · ",cn," more grouped as Other"]})]}),s.jsx("div",{className:"h-64",children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(NN,{data:Ht,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Wa,{dataKey:"date",tick:er,tickLine:!1,axisLine:{stroke:Nr},tickFormatter:hd}),s.jsx(Ya,{tick:er,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(Ms,{...ua,labelFormatter:fd,formatter:(de,ze)=>{const fe=typeof de=="number"?de.toLocaleString():String(de??0),Qe=String(ze??"");if(Qe===Gu)return[fe,"Total Social"];if(Qe===pd){const Fn=`Other (${cn} source${cn===1?"":"s"})`;return[fe,Fn]}return[fe,Vu(Qe)]}}),s.jsx(Du,{type:"monotone",dataKey:Gu,stroke:QF,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Lt.map((de,ze)=>{const Qe=de===pd?kN:Eo[ze%Eo.length];return s.jsx(Du,{type:"monotone",dataKey:de,stackId:"social",stroke:Qe,fill:Qe,fillOpacity:.4,strokeWidth:1.5},de)})]})})}),s.jsx(mEe,{sources:Lt,otherCount:cn})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Summary"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Social media visits"})]}),i.socialReferrals.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(_a,{label:"Social Sessions",value:Ag(On),hint:`${On.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),s.jsx(_a,{label:"Share of Traffic",value:gn,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),s.jsx(_a,{label:"Platforms",value:String(We),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."})]}),Kt&&s.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:[s.jsx("p",{className:"text-xs uppercase tracking-wider text-sky-300/70 mb-1",children:"Top social source"}),s.jsx("p",{className:"font-medium truncate",title:`${Kt.source} via ${Kt.medium}`,children:VF(Vu(Kt.source),64)}),s.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Kt.medium,children:["via ",Vu(Kt.medium)," · ",Kt.sessions.toLocaleString()," sessions"]})]})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(_a,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),s.jsx(_a,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),s.jsx(_a,{label:"Platforms",value:"0",hint:"known platforms",tone:"neutral",tooltip:"Number of distinct social media platforms detected."})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3 text-sm text-zinc-400",children:[s.jsx("p",{className:"mb-1.5 text-zinc-300",children:"Monitoring social media traffic via GA4 channel grouping"}),s.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."})]})]})]}),s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("div",{className:"mb-4 flex items-end justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Breakdown"}),s.jsx("h3",{className:"text-sm font-semibold text-zinc-100",children:"Source / medium"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:i.socialReferrals.length>0?Ve.length>Xf&&!q?`Top ${Xf} of ${Ve.length}`:`${Ve.length} rows`:"No source rows"})]}),i.socialReferrals.length>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm table-fixed",children:[s.jsxs("colgroup",{children:[s.jsx("col",{className:"w-[32%]"}),s.jsx("col",{className:"w-[22%]"}),s.jsx("col",{className:"w-[12%]"}),s.jsx("col",{className:"w-[11%]"}),s.jsx("col",{className:"w-[11%]"}),s.jsx("col",{className:"w-[12%]"})]}),s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Source",sortKey:"source",current:T,dir:F,onSort:Ee,align:"left"}),s.jsx(vr,{label:"Medium",sortKey:"medium",current:T,dir:F,onSort:Ee,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:T,dir:F,onSort:Ee,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(vr,{label:"Users",sortKey:"users",current:T,dir:F,onSort:Ee,align:"right"})]})}),s.jsx("tbody",{children:(q?Ve:Ve.slice(0,Xf)).map(de=>s.jsx(pEe,{referral:de,totalSessions:On},`${de.source}:${de.medium}:${de.channelGroup}`))})]})}),Ve.length>Xf&&s.jsx("div",{className:"mt-3 flex justify-center",children:s.jsx("button",{type:"button",onClick:()=>D(de=>!de),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:q?`Show top ${Xf}`:`Show all ${Ve.length} sources`})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[s.jsx("p",{className:"text-sm text-zinc-400 mb-2",children:"No social media sessions detected yet"}),s.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&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"page-section-divider"}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:"Page Performance"}),s.jsxs("h2",{className:"text-base font-semibold text-zinc-50 flex items-center gap-1.5",children:["Top Landing Pages",s.jsx(pr,{text:"Landing pages ranked by session volume. Click column headers to sort. Organic % shows the share of sessions coming from Google organic search."})]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:[s.jsx(vr,{label:"Landing Page",sortKey:"landingPage",current:S,dir:E,onSort:ee,align:"left"}),s.jsx(vr,{label:"Sessions",sortKey:"sessions",current:S,dir:E,onSort:ee,align:"right"}),s.jsx(vr,{label:"Organic",sortKey:"organicSessions",current:S,dir:E,onSort:ee,align:"right"}),s.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),s.jsx(vr,{label:"Users",sortKey:"users",current:S,dir:E,onSort:ee,align:"right"})]})}),s.jsx("tbody",{children:He.map(de=>s.jsx(dEe,{page:de},de.landingPage))})]})})]})]}),s.jsxs("div",{className:"mt-6 flex items-center justify-between text-xs text-zinc-500",children:[s.jsx("span",{children:i?.lastSyncedAt?`Last synced ${lEe(i.lastSyncedAt)}`:"Never synced"}),s.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function uEe({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[l,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),g=x.useRef(null),v=x.useCallback(b=>{const S=b.target.files?.[0];if(!S)return;m(null),a(S.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)."),u(null);return}u(E)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),u(null)}},k.onerror=()=>{m("Failed to read file."),u(null)},k.readAsText(S)},[]);async function j(){if(m(null),!n.trim()){m("Property ID is required.");return}if(!l){m("Please upload a service account key file.");return}f(!0);try{await nQ(e,{propertyId:n.trim(),keyJson:l});try{await M5(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return s.jsxs($e,{className:"surface-card p-6",children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-50 mb-1",children:"Connect Google Analytics 4"}),s.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&&s.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}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{htmlFor:"ga4-property-id",className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"GA4 Property ID"}),s.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"}),s.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)."})]}),s.jsxs("div",{className:"mb-5",children:[s.jsx("label",{className:"block text-xs font-medium text-zinc-400 mb-1.5",children:"Service Account Key File"}),s.jsx("input",{ref:g,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),s.jsxs("button",{type:"button",onClick:()=>g.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:[s.jsx(EW,{className:"w-4 h-4 shrink-0"}),i?s.jsx("span",{className:"text-zinc-200 truncate",children:i}):s.jsx("span",{children:"Upload .json key file"})]}),s.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 ",s.jsx("span",{className:"text-zinc-400",children:"Viewer"})," access on the GA4 property."]})]}),s.jsx(be,{variant:"default",size:"sm",disabled:d||!n.trim()||!l,onClick:j,children:d?"Connecting & syncing…":"Connect GA4"})]})}function vr({label:e,sortKey:t,current:n,dir:r,onSort:i,align:a}){const l=n===t;return s.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,l&&s.jsx("span",{className:"ml-0.5",children:r==="asc"?"↑":"↓"})]})}const WF={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function OS({value:e,label:t,subtitle:n,tone:r}){return s.jsxs("div",{className:"rounded-lg bg-zinc-900/30 border border-zinc-800/60 px-5 py-4",children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1",children:t}),s.jsx("p",{className:`text-2xl font-bold tabular-nums ${WF[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function _a({value:e,label:t,hint:n,tone:r,tooltip:i}){return s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 flex flex-col",children:[s.jsxs("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-1 flex items-center gap-1",children:[t,i&&s.jsx(pr,{text:i})]}),s.jsx("p",{className:`text-xl font-semibold tabular-nums ${WF[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function dEe({page:e}){const t=e.sessions>0?(e.organicSessions/e.sessions*100).toFixed(1):"0.0";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[400px] truncate",title:e.landingPage,children:e.landingPage}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.sessions.toLocaleString()}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.organicSessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[t,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}const YF={session:"Session",first_user:"First Visit",manual_utm:"UTM"},ZF={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 fEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=YF[e.sourceDimension]??e.sourceDimension,i=ZF[e.sourceDimension]??"";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),s.jsx("td",{className:"py-1.5 text-zinc-500 max-w-[180px] truncate",title:e.medium,children:e.medium}),s.jsx("td",{className:"py-1.5",children:s.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})}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function hEe({row:e}){const t=YF[e.sourceDimension]??e.sourceDimension,n=ZF[e.sourceDimension]??"";return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 text-zinc-300 max-w-[360px] truncate",title:e.landingPage,children:e.landingPage}),s.jsx("td",{className:"py-1.5 text-zinc-200 max-w-[220px] truncate",title:e.source,children:e.source}),s.jsx("td",{className:"py-1.5",children:s.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})}),s.jsx("td",{className:"py-1.5 text-right text-emerald-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function pEe({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=Vu(e.source),a=Vu(e.medium);return s.jsxs("tr",{className:"border-t border-zinc-800/40",children:[s.jsx("td",{className:"py-1.5 pr-3 text-zinc-200 truncate",title:e.source,children:i}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-500 truncate",title:e.medium,children:a}),s.jsx("td",{className:"py-1.5 pr-3",children:s.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})}),s.jsx("td",{className:"py-1.5 text-right text-sky-400 tabular-nums",children:e.sessions.toLocaleString()}),s.jsxs("td",{className:"py-1.5 text-right text-zinc-400 tabular-nums",children:[n,"%"]}),s.jsx("td",{className:"py-1.5 text-right text-zinc-200 tabular-nums",children:e.users.toLocaleString()})]})}function mEe({sources:e,otherCount:t}){const n=[{key:Gu,color:QF,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===pd)n.push({key:pd,color:kN,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=Vu(i);n.push({key:i,color:Eo[r%Eo.length]??kN,label:VF(a,32),tooltip:a})}}return s.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5 text-[11px] text-zinc-400",children:n.map(r=>s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0 max-w-[260px]",title:r.tooltip,children:[s.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm shrink-0",style:{backgroundColor:r.color},"aria-hidden":"true"}),s.jsx("span",{className:"truncate",children:r.label})]},r.key))})}function XF(e){e.invalidateQueries({queryKey:qe.runs.all}),e.invalidateQueries({queryKey:qe.projects.all})}function gEe(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function yEe(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 Vx(e,t){J4({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),vt({title:gEe(e.kind),detail:yEe(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function vEe(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){vt({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)J4({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=Kte({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});vt({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 Qx(e,t){if(e instanceof ei&&e.code==="RUN_IN_PROGRESS"){vt({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}vt({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function JF(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>dV(t,n),onSuccess:(t,n)=>{XF(e),Vx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function xEe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:t=>_V(t),onSuccess:t=>{XF(e),vEe(t)},onError:t=>{vt({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function bEe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>P5(t,n),onSuccess:(t,n)=>{Gv(e,Pt["gsc-sync"],n.projectName),Vx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function wEe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>FV(t),onSuccess:(t,n)=>{Gv(e,t.run.kind,n.projectName),Vx(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function jEe(){const e=xi();return Fh({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>UV(t,n),onSuccess:(t,n)=>{Gv(e,Pt["inspect-sitemap"],n.projectName),Vx(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{Qx(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}const SEe=["7d","30d","90d","all"];function NEe({projectName:e}){const t=xi(),[n,r]=x.useState(!1),[i,a]=x.useState([]),[l,u]=x.useState([]),[d,f]=x.useState([]),[p,m]=x.useState([]),[g,v]=x.useState([]),[j,b]=x.useState(null),[S,k]=x.useState(""),[E,C]=x.useState(""),[A,P]=x.useState("30"),[O,_]=x.useState(!1),[T,$]=x.useState("30d"),[F,U]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[B,V]=x.useState(""),[X,Z]=x.useState(!0),[H,J]=x.useState(!1),[oe,ye]=x.useState(!1),[I,M]=x.useState(!1),[q,D]=x.useState(!1),[G,se]=x.useState(!1),[ne,Ce]=x.useState(!1),[Se,ee]=x.useState(null),[pe,Ee]=x.useState(!1),[Y,He]=x.useState(!1),[Te,at]=x.useState(null),[Ve,Ht]=x.useState(""),[Lt,cn]=x.useState(!1),[en,je]=x.useState(!1),[Ze,Rt]=x.useState("indexed"),[mt,Je]=x.useState(null),ce=x.useMemo(()=>{if(!mt)return d;const{key:Q,dir:ke}=mt;return[...d].sort((tt,St)=>{const _n=Q===To.CTR?Number.isFinite(tt.ctr)?tt.ctr:0:tt[Q],wa=Q===To.CTR?Number.isFinite(St.ctr)?St.ctr:0:St[Q];return ke==="asc"?_n-wa:wa-_n})},[d,mt]),[Ne,Me]=x.useState([]),[Ge,pt]=x.useState(null),[mn,On]=x.useState(!1),[gn,We]=x.useState(null),[Kt,de]=x.useState(null),ze=i.find(Q=>Q.connectionType==="gsc"),fe=d.length>0||p.length>0||g.length>0,Qe=bEe(),Fn=wEe(),wi=jEe();async function tn(Q){if(!Q){u([]),k("");return}ye(!0);try{const{sites:ke}=await t.fetchQuery({queryKey:qe.gsc.properties(e),queryFn:()=>TV(e),staleTime:jr});u(ke),k(Q.propertyId??ke[0]?.siteUrl??"")}catch(ke){u([]),We(ke instanceof Error?ke.message:"Failed to load Search Console properties")}finally{ye(!1)}}async function En(){D(!0);try{const Q={startDate:F.startDate,endDate:F.endDate,query:F.query,page:F.page,limit:F.limit,window:T},ke=await t.fetchQuery({queryKey:qe.gsc.performance(e,Q),queryFn:()=>MV(e,{startDate:F.startDate||void 0,endDate:F.endDate||void 0,query:F.query||void 0,page:F.page||void 0,limit:parseInt(F.limit,10)||20,window:T}),staleTime:jr});f(ke)}catch(Q){f([]),We(Q instanceof Error?Q.message:"Failed to load GSC performance data")}finally{D(!1)}}async function $r(){se(!0);try{const Q=B.trim()||void 0,[ke,tt]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.inspections(e,Q),queryFn:()=>LV(e,{url:Q,limit:20}),staleTime:jr}),t.fetchQuery({queryKey:qe.gsc.deindexed(e),queryFn:()=>$V(e),staleTime:jr})]);m(ke),v(tt)}catch(Q){m([]),v([]),We(Q instanceof Error?Q.message:"Failed to load GSC inspection history")}finally{se(!1)}}async function Zi(){Ee(!0);try{const[Q,ke]=await Promise.all([t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>QN(e),staleTime:jr}),t.fetchQuery({queryKey:qe.gsc.coverageHistory(e),queryFn:()=>BV(e).catch(()=>[]),staleTime:jr})]);ee(Q),Me(ke)}catch(Q){ee(null),Me([]),We(Q instanceof Error?Q.message:"Failed to load coverage data")}finally{Ee(!1)}}async function ba(Q){On(!0),We(null);try{const ke=await k2(e,{urls:Q}),{succeeded:tt,failed:St,total:_n}=ke.summary;vt({title:"Indexing requested",detail:St===0?`${tt} URL${tt!==1?"s":""} submitted for indexing.`:`${tt}/${_n} submitted successfully, ${St} failed.`,tone:St===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(ke){We(ke instanceof Error?ke.message:"Failed to request indexing")}finally{On(!1)}}async function Sp(){On(!0),We(null);try{const Q=await k2(e,{urls:[],allUnindexed:!0}),{succeeded:ke,failed:tt,total:St}=Q.summary;vt({title:"Indexing requested",detail:tt===0?`${ke} unindexed URL${ke!==1?"s":""} submitted for indexing.`:`${ke}/${St} submitted successfully, ${tt} failed.`,tone:tt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(Q){We(Q instanceof Error?Q.message:"Failed to request indexing")}finally{On(!1)}}async function Ks(){if(Ve.trim()){cn(!0),We(null);try{await DV(e,"gsc",Ve.trim()),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,sitemapUrl:Ve.trim()}:ke)),vt({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ht("")}catch(Q){We(Q instanceof Error?Q.message:"Failed to save sitemap URL")}finally{cn(!1)}}}async function Gs(){We(null);try{const Q=await Fn.mutateAsync({projectName:e,projectLabel:e});at(Q.sitemaps),a(ke=>ke.map(tt=>tt.connectionType==="gsc"?{...tt,sitemapUrl:Q.primarySitemapUrl}:tt))}catch{}}async function Wx(){He(!0),We(null);try{const Q=await qV(e);t.setQueryData(qe.gsc.sitemaps(e),Q),at(Q.sitemaps),Q.sitemaps.length===0&&de("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(Q){We(Q instanceof Error?Q.message:"Failed to list sitemaps")}finally{He(!1)}}async function Dd(){Z(!0),We(null);try{const[Q,ke]=await Promise.all([VN().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>z5(e).catch(()=>[]),staleTime:jr})]);r(!!Q?.google?.configured),a(ke);const tt=ke.find(St=>St.connectionType==="gsc");await Promise.all([tn(tt),En(),$r(),Zi()])}finally{Z(!1)}}x.useEffect(()=>{Dd()},[e]),x.useEffect(()=>{En()},[T]);async function Np(){if(!n){We("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}J(!0),We(null),de(null);try{const{authUrl:Q}=await zV(e,"gsc");if(!Q.startsWith("https://accounts.google.com/")){We("Unexpected OAuth redirect URL. Please try again.");return}const ke=window.open(Q,"_blank","width=600,height=700");if(!ke){window.location.assign(Q);return}de("Finish the Google consent flow in the popup, then close it to refresh this project.");const tt=window.setInterval(()=>{ke.closed&&(window.clearInterval(tt),de(null),t.invalidateQueries({queryKey:qe.gsc.project(e)}),Dd())},1e3)}catch(Q){We(Q instanceof Error?Q.message:"Failed to start OAuth flow")}finally{J(!1)}}async function kp(){We(null),de(null);try{await PV(e,"gsc"),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.filter(ke=>ke.connectionType!=="gsc")),u([]),k("")}catch(Q){We(Q instanceof Error?Q.message:"Failed to disconnect")}}async function Md(){if(S){M(!0),We(null);try{await RV(e,"gsc",S),await t.invalidateQueries({queryKey:qe.gsc.project(e)}),a(Q=>Q.map(ke=>ke.connectionType==="gsc"?{...ke,propertyId:S}:ke)),vt({title:"GSC property updated",detail:`${e} is now linked to ${S}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(Q){We(Q instanceof Error?Q.message:"Failed to save GSC property")}finally{M(!1)}}}async function Id(){We(null),de(null);try{await Qe.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(A,10)||void 0,full:O||void 0}}),await t.invalidateQueries({queryKey:qe.gsc.project(e)})}catch{}}async function Ld(){if(E.trim()){Ce(!0),We(null),de(null);try{const Q=await IV(e,E.trim());await t.invalidateQueries({queryKey:qe.gsc.project(e)}),b(Q),C(""),await $r()}catch(Q){We(Q instanceof Error?Q.message:"Failed to inspect URL")}finally{Ce(!1)}}}return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search Console"}),s.jsx("h2",{children:"Google Search Console"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex gap-1",children:SEe.map(Q=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${T===Q?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>$(Q),children:Q==="all"?"All":Q},Q))}),ze&&s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{En()},children:q?"Refreshing…":"Refresh data"})]})]}),gn&&s.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:[gn,s.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>We(null),children:"×"})]}),Kt&&s.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:[Kt,s.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>de(null),children:"×"})]}),X?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsx(Xe,{tone:ze?"positive":n?"caution":"negative",children:ze?"Connected":n?"Ready to connect":"App credentials missing"})]}),ze?s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:ze.domain}),s.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-500 hover:text-rose-400 transition-colors",onClick:kp,children:"Disconnect"})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores OAuth tokens per canonical domain. This project currently maps to ",s.jsx("code",{children:ze.domain}),"."]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected property"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:ze.propertyId??"No property selected yet"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:aa(ze.updatedAt)})]})]})]}):s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-5",children:[s.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."}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[n?s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:H,onClick:Np,children:H?"Opening…":"Connect Google Search Console"}):s.jsx(be,{type:"button",variant:"outline",size:"sm",asChild:!0,children:s.jsx(Yt,{to:"/settings",children:"Open Settings"})}),!n&&s.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),ze&&!ze.sitemapUrl&&s.jsx("div",{className:"rounded-lg border border-amber-800/40 bg-amber-950/20 px-4 py-3",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"mt-0.5 text-amber-400",children:s.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:s.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"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Set your sitemap URL"}),s.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."}),s.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx(be,{type:"button",size:"sm",disabled:Fn.isPending||!ze.propertyId,onClick:Gs,children:Fn.isPending?"Discovering…":"Auto-discover from GSC"}),s.jsx("span",{className:"self-center text-xs text-amber-400/60",children:"or enter manually:"})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.jsx("input",{className:"flex-1 rounded border border-amber-800/40 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-500 focus:border-amber-600 focus:outline-none",type:"url",placeholder:"https://example.com/sitemap.xml",value:Ve,onChange:Q=>Ht(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Ks()}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Lt||!Ve.trim(),onClick:Ks,children:Lt?"Saving…":"Save sitemap URL"})]})]})]})]})}),(ze||fe)&&s.jsxs(s.Fragment,{children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),s.jsx("h3",{children:"Index coverage"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[Se&&Se.notIndexed.length>0&&s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:mn,onClick:()=>{Sp()},children:mn?"Requesting…":`Request indexing (${Se.notIndexed.length})`}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:pe,onClick:()=>{Zi()},children:pe?"Loading…":"Refresh coverage"})]})]}),Se&&Se.summary.total>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const Q=Se.summary.indexed+Se.summary.notIndexed,ke=Q>0?Se.summary.indexed/Q:0,tt=Q>0?Se.summary.notIndexed/Q:0,St=54,_n=2*Math.PI*St,wa=_n*(1-ke),Ja=_n*tt,Vs=_n*ke;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"relative h-48 w-48",children:[s.jsxs("svg",{viewBox:"0 0 128 128",className:"h-full w-full","aria-hidden":"true",children:[s.jsx("circle",{cx:"64",cy:"64",r:St,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),s.jsx("circle",{cx:"64",cy:"64",r:St,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:_n,strokeDashoffset:wa,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),Se.summary.notIndexed>0&&s.jsx("circle",{cx:"64",cy:"64",r:St,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Ja} ${_n-Ja}`,strokeDashoffset:-Vs,transform:"rotate(-90 64 64)",style:{transition:"stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease"}})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsxs("span",{className:"text-3xl font-bold tabular-nums text-zinc-50",children:[(ke*100).toFixed(0),"%"]}),s.jsx("span",{className:"text-xs uppercase tracking-widest text-zinc-500 mt-0.5",children:"Indexed"})]})]}),s.jsxs("div",{className:"mt-4 flex items-center justify-center gap-8",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-emerald-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Se.summary.indexed.toLocaleString()}),s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Indexed"})]})]}),s.jsx("div",{className:"h-8 w-px bg-zinc-800"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-zinc-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Se.summary.notIndexed.toLocaleString()}),s.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(Se.reasonGroups??[]).length>0&&s.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(Se.reasonGroups??[]).length," ",(Se.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),Se.summary.deindexed>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-8 w-px bg-zinc-800"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-rose-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-2xl font-semibold tabular-nums text-zinc-50",children:Se.summary.deindexed.toLocaleString()}),s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Deindexed"})]})]})]})]})]})})()}),s.jsx("div",{className:"mt-3 flex gap-1",children:["indexed","notIndexed","deindexed"].map(Q=>{const ke=Q==="indexed"?Se.indexed.length:Q==="notIndexed"?Se.notIndexed.length:Se.deindexed.length,tt=Q==="indexed"?"Indexed":Q==="notIndexed"?"Not Indexed":"Deindexed";return s.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${Ze===Q?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Rt(Q),pt(null)},children:[tt," (",ke,")"]},Q)})}),s.jsxs("div",{className:"mt-3 overflow-x-auto",children:[Ze==="indexed"&&Se.indexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Verdict"}),s.jsx("th",{className:"text-left",children:"Last Crawl"}),s.jsx("th",{className:"text-left",children:"Mobile"})]})}),s.jsx("tbody",{children:Se.indexed.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.crawlTime?Q.crawlTime.split("T")[0]:"—"}),s.jsx("td",{className:"text-zinc-400",children:Q.isMobileFriendly===!0?"Yes":Q.isMobileFriendly===!1?"No":"—"})]},Q.id))})]}),Ze==="notIndexed"&&!Ge&&(Se.reasonGroups??[]).length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Reason"}),s.jsx("th",{className:"text-right",children:"Pages"})]})}),s.jsx("tbody",{children:(Se.reasonGroups??[]).map(Q=>s.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>pt(Q.reason),children:[s.jsx("td",{className:"text-zinc-200",children:Q.reason}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.count})]},Q.reason))})]}),Ze==="notIndexed"&&!Ge&&(Se.reasonGroups??[]).length===0&&Se.notIndexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Indexing State"}),s.jsx("th",{className:"text-left",children:"Coverage"})]})}),s.jsx("tbody",{children:Se.notIndexed.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"})]},Q.id))})]}),Ze==="notIndexed"&&Ge&&(()=>{const Q=(Se.reasonGroups??[]).find(ke=>ke.reason===Ge);return Q?s.jsxs("div",{children:[s.jsx("div",{className:"flex items-center gap-2 mb-3",children:s.jsxs("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>pt(null),children:["←"," Back to reasons"]})}),s.jsxs("div",{className:"mb-3 flex items-center justify-between rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Q.reason}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[Q.count," affected page",Q.count!==1?"s":""]})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:mn,onClick:()=>{ba(Q.urls.map(ke=>ke.url))},children:mn?"Requesting…":`Request indexing (${Q.count})`})]}),s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Last Crawl"}),s.jsx("th",{className:"w-8"})]})}),s.jsx("tbody",{children:Q.urls.map(ke=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ke.url}),s.jsx("td",{className:"text-zinc-400",children:ke.crawlTime?ke.crawlTime.split("T")[0]:"—"}),s.jsx("td",{children:s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-200 transition-colors",disabled:mn,onClick:()=>{ba([ke.url])},title:"Request indexing",children:"Index"})})]},ke.id))})]})]}):null})(),Ze==="deindexed"&&Se.deindexed.length>0&&s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Previous"}),s.jsx("th",{className:"text-left",children:"Current"}),s.jsx("th",{className:"text-left",children:"Detected"})]})}),s.jsx("tbody",{children:Se.deindexed.map((Q,ke)=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.previousState}),s.jsx("td",{className:"text-zinc-400",children:Q.currentState}),s.jsx("td",{className:"text-zinc-400",children:Q.transitionDate.split("T")[0]})]},`${Q.url}-${ke}`))})]}),(Ze==="indexed"&&Se.indexed.length===0||Ze==="notIndexed"&&!Ge&&Se.notIndexed.length===0||Ze==="deindexed"&&Se.deindexed.length===0)&&s.jsx("p",{className:"text-sm text-zinc-500",children:"No URLs in this category."})]})]}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:pe?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Performance"}),s.jsx("h3",{children:"Search performance"})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:q,onClick:()=>{En()},children:q?"Loading…":"Apply filters"})]}),d.length>0&&(()=>{const Q=new Map;for(const ut of d){const Gt=Q.get(ut.date);Gt?(Gt.clicks+=ut.clicks,Gt.impressions+=ut.impressions):Q.set(ut.date,{clicks:ut.clicks,impressions:ut.impressions})}const ke=[...Q.entries()].sort(([ut],[Gt])=>ut.localeCompare(Gt));if(ke.length===0)return null;const tt=Math.max(...ke.map(([,ut])=>ut.impressions),1),St=ke.reduce((ut,[,Gt])=>ut+Gt.clicks,0),_n=ke.reduce((ut,[,Gt])=>ut+Gt.impressions,0),wa=_n>0?(St/_n*100).toFixed(1):"0.0",Ja=700,Vs=220,Er={top:12,bottom:36,left:48,right:12},rl=Ja-Er.left-Er.right,ja=Vs-Er.top-Er.bottom,ji=rl/ke.length,Xi=Math.max(Math.min(ji*.35,24),4),Qs=Math.max(Xi*.15,1),Ws=ut=>{if(ut<=0)return 1;const Gt=Math.pow(10,Math.floor(Math.log10(ut))),Br=ut/Gt,Ji=Br<=1.5?1.5:Br<=3?3:Br<=5?5:10;return Math.ceil(Ji*Gt)},yn=4,il=Math.ceil(Ws(tt)/yn)*yn,Cp=Array.from({length:yn+1},(ut,Gt)=>il/yn*Gt),es=ut=>ut>=1e3?`${(ut/1e3).toFixed(ut>=1e4?0:1)}k`:String(ut);return s.jsxs("div",{className:"mt-3",children:[s.jsxs("div",{className:"flex items-center gap-5 mb-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-emerald-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Clicks ",s.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:St.toLocaleString()})]})]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm bg-blue-500"}),s.jsxs("span",{className:"text-xs text-zinc-400",children:["Impressions ",s.jsx("span",{className:"text-zinc-200 tabular-nums font-medium",children:_n.toLocaleString()})]})]}),s.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",s.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[wa,"%"]})]})]}),s.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Ja} / ${Vs}`},children:s.jsxs("svg",{viewBox:`0 0 ${Ja} ${Vs}`,className:"h-full w-full",children:[Cp.map((ut,Gt)=>{const Br=Er.top+ja-ut/il*ja;return s.jsxs("g",{children:[s.jsx("line",{x1:Er.left,y1:Br,x2:Ja-Er.right,y2:Br,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),s.jsx("text",{x:Er.left-6,y:Br+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:es(ut)})]},`t-${Gt}`)}),ke.map(([ut,Gt],Br)=>{const Ji=Er.left+ji*Br+ji/2,Oc=Gt.impressions/il*ja,al=Gt.clicks/il*ja;return s.jsxs("g",{children:[s.jsx("title",{children:`${ut}
|
|
290
|
+
Clicks: ${Gt.clicks}
|
|
291
|
+
Impressions: ${Gt.impressions}
|
|
292
|
+
CTR: ${Gt.impressions>0?(Gt.clicks/Gt.impressions*100).toFixed(1):0}%`}),s.jsx("rect",{x:Ji-Xi-Qs/2,y:Er.top+ja-Oc,width:Xi,height:Math.max(Oc,1),rx:2,fill:"#3b82f6",opacity:.85}),s.jsx("rect",{x:Ji+Qs/2,y:Er.top+ja-al,width:Xi,height:Math.max(al,1),rx:2,fill:"#10b981",opacity:.85})]},ut)}),(()=>{const ut=Math.min(ke.length,7);return Array.from({length:ut},(Gt,Br)=>{const Ji=ke.length===1?0:Math.round(Br/(ut-1)*(ke.length-1)),Oc=Er.left+ji*Ji+ji/2;return s.jsx("text",{x:Oc,y:Vs-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:ke[Ji][0].slice(5)},`xl-${Ji}`)})})()]})})]})})(),s.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-5",children:[s.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:Q=>U(ke=>({...ke,startDate:Q.target.value}))}),s.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:Q=>U(ke=>({...ke,endDate:Q.target.value}))}),s.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:Q=>U(ke=>({...ke,query:Q.target.value}))}),s.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:Q=>U(ke=>({...ke,page:Q.target.value}))}),s.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:Q=>U(ke=>({...ke,limit:Q.target.value}))})]}),d.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"Date"}),s.jsx("th",{className:"text-left",children:"Query"}),s.jsx("th",{className:"text-left",children:"Page"}),Object.values(To).map(Q=>s.jsx("th",{className:"text-right","aria-sort":mt?.key===Q?mt.dir==="asc"?"ascending":"descending":"none",children:s.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:()=>Je(ke=>ke?.key===Q?ke.dir==="desc"?{key:Q,dir:"asc"}:null:{key:Q,dir:"desc"}),children:[Ete[Q],mt?.key===Q?mt.dir==="desc"?" ↓":" ↑":""]})},Q))]})}),s.jsx("tbody",{children:ce.map((Q,ke)=>s.jsxs("tr",{children:[s.jsx("td",{className:"text-zinc-400",children:Q.date}),s.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:Q.query}),s.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:Q.page}),s.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:Q.clicks.toLocaleString()}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.impressions.toLocaleString()}),s.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(Q.ctr)?Q.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:Q.position.toFixed(1)})]},`${Q.date}:${Q.query}:${Q.page}:${ke}`))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Inspection"}),s.jsx("h3",{children:"Inspect a URL"})]})}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.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:Q=>C(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&void Ld()}),s.jsx(be,{type:"button",size:"sm",disabled:ne||!ze?.propertyId||!E.trim(),onClick:Ld,children:ne?"Inspecting…":"Inspect URL"})]}),j&&s.jsxs("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Indexing state"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:j.indexingState??"Unknown"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Verdict"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:j.verdict??"Unknown"})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Mobile friendly"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:sP(j.isMobileFriendly)})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last crawl"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:aa(j.crawlTime)})]})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),s.jsx("h3",{children:"Inspection log"})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:G,onClick:()=>{$r()},children:G?"Loading…":"Refresh history"})]}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.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:B,onChange:Q=>V(Q.target.value)}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:G,onClick:()=>{$r()},children:"Apply filter"})]}),p.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Indexing"}),s.jsx("th",{className:"text-left",children:"Verdict"}),s.jsx("th",{className:"text-left",children:"Coverage"}),s.jsx("th",{className:"text-left",children:"Mobile"}),s.jsx("th",{className:"text-left",children:"Inspected"})]})}),s.jsx("tbody",{children:p.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-300",children:Q.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:Q.coverageState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:sP(Q.isMobileFriendly)}),s.jsx("td",{className:"text-zinc-400",children:aa(Q.inspectedAt)})]},Q.id))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Deindexed"}),s.jsx("h3",{children:"Recent indexing losses"})]})}),g.length>0?s.jsx("div",{className:"mt-3 overflow-x-auto",children:s.jsxs("table",{className:"data-table w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left",children:"URL"}),s.jsx("th",{className:"text-left",children:"Previous"}),s.jsx("th",{className:"text-left",children:"Current"}),s.jsx("th",{className:"text-left",children:"Changed at"})]})}),s.jsx("tbody",{children:g.map(Q=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:Q.url}),s.jsx("td",{className:"text-zinc-400",children:Q.previousState??"Unknown"}),s.jsx("td",{className:"text-zinc-300",children:Q.currentState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:aa(Q.transitionDate)})]},`${Q.url}:${Q.transitionDate}`))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),ze&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t border-zinc-800/60 pt-3",children:s.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 text-left",onClick:()=>je(Q=>!Q),children:[s.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 ${en?"rotate-90":""}`,"aria-hidden":"true",children:s.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"})}),s.jsx("span",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Setup & Configuration"})]})}),en&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Property"}),s.jsx("h3",{children:"Pick the Search Console property"})]})}),s.jsxs("div",{className:"mt-3 space-y-2",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-property-${e}`,children:"Property URL"}),s.jsx("select",{id:`gsc-property-${e}`,className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 focus:border-zinc-500 focus:outline-none",value:S,disabled:oe||l.length===0,onChange:Q=>k(Q.target.value),children:l.length===0?s.jsx("option",{value:"",children:oe?"Loading properties…":"No properties available"}):l.map(Q=>s.jsxs("option",{value:Q.siteUrl,children:[Q.siteUrl," · ",Q.permissionLevel]},Q.siteUrl))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:oe,onClick:()=>{tn(ze)},children:oe?"Refreshing…":"Refresh properties"}),s.jsx(be,{type:"button",size:"sm",disabled:!S||I,onClick:Md,children:I?"Saving…":"Save property"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:"The selected property is used for future syncs and URL inspections for this project."})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sync"}),s.jsx("h3",{children:"Import GSC performance data"})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-[160px_1fr]",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`gsc-sync-days-${e}`,children:"Days"}),s.jsx("input",{id:`gsc-sync-days-${e}`,type:"number",min:"1",className:"mt-0.5 w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",value:A,onChange:Q=>P(Q.target.value)})]}),s.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:[s.jsx("input",{type:"checkbox",checked:O,onChange:Q=>_(Q.target.checked)}),"Replace existing imported rows for the requested range"]})]}),s.jsx(be,{type:"button",size:"sm",disabled:Qe.isPending||!ze.propertyId,onClick:Id,children:Qe.isPending?"Queueing…":"Queue sync"}),!ze.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Sitemap"}),s.jsx("h3",{children:"Sitemap configuration"})]})}),s.jsxs("div",{className:"mt-3 space-y-3",children:[ze.sitemapUrl&&s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Current sitemap URL"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200 break-all",children:ze.sitemapUrl})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Y||!ze.propertyId,onClick:()=>{Wx()},children:Y?"Loading…":"Browse sitemaps from GSC"}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:Fn.isPending||!ze.propertyId,onClick:Gs,children:Fn.isPending?"Discovering…":"Auto-discover and queue inspection"})]}),s.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."}),Te&&Te.length>0&&s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3 space-y-2",children:[s.jsxs("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:["Sitemaps (",Te.length,")"]}),Te.map(Q=>{const ke=Q.contents?.[0];return s.jsxs("div",{className:"flex items-start justify-between gap-2 text-xs",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-200 break-all",children:Q.path}),Q.lastSubmitted&&s.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",Q.lastSubmitted.split("T")[0]]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ke&&s.jsxs("div",{className:"text-right",children:[s.jsxs("p",{className:"text-zinc-300",children:[ke.indexed," / ",ke.submitted]}),s.jsx("p",{className:"text-zinc-500",children:"indexed"})]}),s.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 transition-colors",onClick:()=>Ht(Q.path),children:"Use"})]})]},Q.path)})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.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:ze.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ve,onChange:Q=>Ht(Q.target.value),onKeyDown:Q=>Q.key==="Enter"&&Ve.trim()&&void Ks()}),s.jsx(be,{type:"button",size:"sm",disabled:Lt||!Ve.trim(),onClick:Ks,children:Lt?"Saving…":ze.sitemapUrl?"Update":"Save"})]}),s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.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}`}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:wi.isPending||!ze.propertyId,onClick:async()=>{const ke=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||ze.sitemapUrl||void 0;We(null),de(null);try{await wi.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:ke}})}catch{}},children:wi.isPending?"Queueing…":"Inspect sitemap"})]}),!ze.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function ES({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return s.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[s.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:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:s.jsx(F5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&s.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 El=50;function Su(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Og(e){return e.toLocaleString()}function kEe(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function CEe(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 AEe(e){const t=e.filter(n=>n.kind===Pt["backlink-extract"]&&!ck(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function OEe(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 EEe({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,l]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState(null),[m,g]=x.useState(null),[v,j]=x.useState(Date.now()),[b,S]=x.useState(0),[k,E]=x.useState(!0),[C,A]=x.useState(!1),[P,O]=x.useState(null),_=x.useRef(null),T=x.useCallback(async()=>{E(!0),O(null);try{const[oe,ye,I,M,q]=await Promise.all([I5().catch(()=>null),yQ(e,{excludeCrawlers:!0}).catch(()=>null),vQ(e,{limit:El,offset:b,excludeCrawlers:!0}).catch(G=>{if(G instanceof ei&&G.code==="NOT_FOUND")return null;throw G}),xQ(e).catch(()=>[]),aV(e).catch(()=>[])]);d(oe),n(ye),i(I),l(M);const D=AEe(q);p(D),_.current=D?.id??null}catch(oe){O(oe instanceof Error?oe.message:"Failed to load backlinks")}finally{E(!1)}},[e,b]);x.useEffect(()=>{T()},[T]),x.useEffect(()=>{if(!f)return;const oe=f.id;let ye=!1;const I=async()=>{try{const q=await ec(oe);if(ye)return;ck(q.status)?(p(null),g(q),await T()):p(D=>D?.id===q.id?{...D,...q}:D)}catch{}},M=window.setInterval(()=>{I()},3e3);return()=>{ye=!0,window.clearInterval(M)}},[f,T]),x.useEffect(()=>{if(!f)return;const oe=window.setInterval(()=>j(Date.now()),1e3);return()=>window.clearInterval(oe)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const oe=window.setTimeout(()=>g(null),1e4);return()=>window.clearTimeout(oe)},[m]);async function $(){A(!0),O(null);try{const oe=await bQ(e);p(oe),_.current=oe.id}catch(oe){oe instanceof ei&&oe.code==="MISSING_DEPENDENCY"?O("DuckDB is not installed. Visit the Backlinks admin page to install it."):O(oe instanceof Error?oe.message:"Failed to trigger extract")}finally{A(!1)}}const F=x.useMemo(()=>a.slice().sort((oe,ye)=>oe.queriedAt.localeCompare(ye.queriedAt)).map(oe=>({date:oe.queriedAt,linkingDomains:oe.totalLinkingDomains})),[a]),U=r?.rows??[],B=r?.total??0,V=t?.excludedLinkingDomains??0,X=B>El,Z=Math.floor(b/El)+1,H=Math.max(1,Math.ceil(B/El));return x.useEffect(()=>{b>0&&b>=B&&S(0)},[b,B]),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Backlinks"}),s.jsx("h2",{children:"Referring domains"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1 max-w-2xl",children:["Domains linking to "," ",s.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."]})]})}),P&&s.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:P})}),f&&s.jsx($e,{className:"surface-card p-4 mb-4 border-sky-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(K5,{className:"h-5 w-5 text-sky-400 animate-spin shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:"Extract running"}),s.jsx(Xe,{tone:"neutral",children:f.status}),s.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[OEe(f.startedAt,f.createdAt)," elapsed · refreshing every 3s"]}),s.jsxs("span",{className:"sr-only",children:["now=",v]})]}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Re-querying the cached Common Crawl release for"," ",s.jsx("span",{className:"text-zinc-300",children:e}),". No re-download — the ~16 GB dump already lives at"," ",s.jsx("code",{className:"text-zinc-400",children:"~/.canonry/cache/commoncrawl/"}),". Typically takes ~5 minutes."]})]})]})}),m&&!f&&s.jsx($e,{className:`surface-card p-4 mb-4 ${m.status==="failed"?"border-rose-800/60":"border-emerald-800/60"}`,children:s.jsxs("div",{className:"flex items-start gap-3",children:[m.status==="failed"?s.jsx("span",{className:"h-5 w-5 shrink-0 mt-0.5 text-rose-400 text-lg leading-none","aria-hidden":!0,children:"!"}):s.jsx(q5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1",children:[s.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?s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:_te(m.error)}):m.status!=="failed"?s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),J()]});function J(){if(k)return s.jsx($e,{className:"surface-card p-6",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const oe=t!==null&&t.totalLinkingDomains>0,ye=m?.status==="failed",I=t!==null&&t.totalLinkingDomains===0&&!ye,M=u?.status==="ready",q=u?.status==="failed",D=u&&(u.status==="downloading"||u.status==="querying"||u.status==="queued");return oe?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gauge-row",children:[s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Referring domains"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:Og(t.totalLinkingDomains)})}),s.jsxs("p",{className:"metric-card-sub",children:["unique domains linking to ",t.targetDomain]})]}),s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Total linking hosts"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:Og(t.totalHosts)})}),s.jsx("p",{className:"metric-card-sub",children:"aggregate host count across referring domains"})]}),s.jsxs("div",{className:"metric-card",children:[s.jsx("p",{className:"metric-card-eyebrow",children:"Top-10 concentration"}),s.jsx("p",{className:"metric-card-big-value",children:s.jsx("span",{className:"text-zinc-50",children:kEe(t.top10HostsShare)})}),s.jsx("p",{className:"metric-card-sub",children:"share of hosts from the 10 largest linking domains"})]})]}),s.jsxs("p",{className:"text-xs text-zinc-600 mt-2",children:["Release ",s.jsx("code",{className:"text-zinc-400",children:t.release})," · queried ",CEe(t.queriedAt),V>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsxs("span",{className:"text-zinc-500",children:[V," crawler/proxy domain",V===1?"":"s"," hidden"]})]})]}),F.length>=2&&s.jsxs($e,{className:"surface-card p-4 mt-4",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Referring domains over releases"}),s.jsx("div",{className:"h-40 mt-2",children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(NN,{data:F,margin:{top:8,right:12,bottom:0,left:12},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"bl-gradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:An[0],stopOpacity:.4}),s.jsx("stop",{offset:"100%",stopColor:An[0],stopOpacity:0})]})}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr,allowDecimals:!1}),s.jsx(Ms,{contentStyle:ua.contentStyle,labelStyle:ua.labelStyle,itemStyle:ua.itemStyle,labelFormatter:fd}),s.jsx(Du,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:An[0],fill:"url(#bl-gradient)",strokeWidth:2})]})})})]}),s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Top referring domains"}),X&&s.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Z," of ",H," · ",Og(B)," total"]})]}),s.jsx($e,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Domain"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Linking hosts"})]})}),s.jsxs("tbody",{children:[U.map(G=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:G.linkingDomain}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Og(G.numHosts)})]},G.linkingDomain)),U.length===0&&s.jsx("tr",{children:s.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&&s.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>S(G=>Math.max(0,G-El)),children:"Previous"}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:b+El>=B,onClick:()=>S(G=>G+El),children:"Next"})]})]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[s.jsx(Ov,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),s.jsxs(ES,{label:"What does Re-run extract do?",children:[s.jsxs("span",{className:"block",children:["Re-queries the ",s.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," for ",s.jsx("span",{className:"text-zinc-200",children:e}),". Replaces existing backlink rows for this project under the current release."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:[s.jsx("span",{className:"text-zinc-200",children:"No re-download"})," of the ~16 GB dump. Typically ",s.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]}),s.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Open admin"})})]})]}):s.jsx($e,{className:"surface-card p-6",children:s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-zinc-900 text-zinc-400",children:s.jsx(H5,{className:"h-5 w-5","aria-hidden":!0})}),s.jsxs("div",{className:"flex-1",children:[!u&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No release sync yet"}),s.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."}),s.jsx("div",{className:"mt-4",children:s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Set up backlinks"})})})]}),D&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Sync in progress"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["A workspace release sync is running (",u.status,u.phaseDetail?` — ${u.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),s.jsx("div",{className:"mt-4",children:s.jsx(be,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"View sync status"})})})]}),q&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last sync failed"}),s.jsx("p",{className:"text-sm text-zinc-500 mt-1",children:u.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),s.jsx("div",{className:"mt-4",children:s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Go to Backlinks admin"})})})]}),M&&!D&&!I&&!ye&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No backlinks yet for this project"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["Release ",s.jsx("code",{className:"text-zinc-300",children:u.release})," is ready but no backlinks have been extracted for"," ",s.jsx("code",{className:"text-zinc-300",children:e}),". Run an extract to populate data using the cached release."]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsxs(be,{type:"button",size:"sm",disabled:C||f!==null,onClick:$,children:[s.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Run extract"]}),s.jsxs(ES,{label:"What does Run extract do?",children:[s.jsxs("span",{className:"block",children:["Runs a DuckDB query against the ",s.jsx("span",{className:"text-zinc-200",children:"cached release files"})," at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"})," to find referring domains for ",s.jsx("span",{className:"text-zinc-200",children:e}),"."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["No re-download. Typically takes ",s.jsx("span",{className:"text-zinc-200",children:"~5 min"}),"."]})]})]})]}),ye&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"Last extract failed"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["See the error above for details. If the cache files for release"," ",s.jsx("code",{className:"text-zinc-300",children:u?.release})," are missing, re-sync the release from the Backlinks admin to restore the ~16 GB dump, then re-run the extract."]}),s.jsx("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Go to Backlinks admin"})})})]}),I&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"text-base font-semibold text-zinc-100",children:"No referring domains found"}),s.jsxs("p",{className:"text-sm text-zinc-500 mt-1",children:["The last extract against release ",s.jsx("code",{className:"text-zinc-300",children:t.release})," found"," ",s.jsx("span",{className:"text-zinc-300",children:"0 referring domains"})," for"," ",s.jsx("code",{className:"text-zinc-300",children:t.targetDomain}),". This can happen when:"]}),s.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-500 list-disc list-inside",children:[s.jsx("li",{children:"the domain is newer than the release’s crawl window"}),s.jsx("li",{children:"the Common Crawl snapshot didn’t capture pages that link to it"}),s.jsx("li",{children:"the extract ran against a cache that was missing or incomplete"})]}),s.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."}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsx(be,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:Su("/backlinks"),children:"Go to Backlinks admin"})}),s.jsxs(be,{type:"button",variant:"outline",size:"sm",disabled:C||f!==null,onClick:$,children:[s.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":C?"Queuing…":"Re-run extract"]}),s.jsxs(ES,{label:"What does Re-run extract do?",children:[s.jsxs("span",{className:"block",children:["Re-queries the cached release for ",s.jsx("span",{className:"text-zinc-200",children:t.targetDomain}),". Only useful if the cache files were incomplete last time."]}),s.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 _Ee({projectName:e}){const t=ca({queryKey:qe.citationVisibility(e),queryFn:()=>lQ(e),staleTime:$5}),n=t.data??null,r=t.error;if(t.isLoading&&!n)return null;if(r)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),s.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 s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsx("h2",{children:"Citation + answer-mention coverage"})]})}),s.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:l}=n.summary;return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Citation visibility"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Cited by ",i," of ",l," engines",s.jsx(pr,{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)."})]}),s.jsxs("p",{className:"text-base text-zinc-300 flex items-center gap-2",children:["Mentioned in ",a," of ",l," engine answers",s.jsx(pr,{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&&s.jsxs("p",{className:"supporting-copy",children:["Latest run ",new Date(n.summary.latestRunAt).toLocaleString()]})]}),s.jsx(zEe,{data:n}),s.jsx(PEe,{data:n}),n.competitorGaps.length>0&&s.jsx(MEe,{data:n})]})}function zEe({data:e}){const{totalQueries:t,queriesCitedAndMentioned:n,queriesCitedOnly:r,queriesMentionedOnly:i,queriesInvisible:a}=e.summary;return s.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4 mb-4",children:[s.jsx(Eg,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),s.jsx(Eg,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),s.jsx(Eg,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),s.jsx(Eg,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Eg({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 s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:e}),s.jsx("p",{className:`mt-1 text-2xl font-semibold tabular-nums ${i}`,children:t}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:n})]})}function PEe({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?s.jsx("p",{className:"text-sm text-zinc-500",children:"No query coverage rows."}):s.jsxs("div",{children:[s.jsx(TEe,{}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),t.map(n=>s.jsx("th",{className:"text-center",children:s.jsx(nc,{provider:n})},n)),s.jsx("th",{className:"text-right",children:"Cite"}),s.jsx("th",{className:"text-right",children:"Ment"})]})}),s.jsx("tbody",{children:e.byQuery.map(n=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:n.query}),t.map(r=>{const i=n.providers.find(a=>a.provider===r);return s.jsx("td",{className:"text-center",children:i==null?s.jsx(pW,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):s.jsx(REe,{provider:i})},r)}),s.jsx("td",{className:"text-right tabular-nums",children:s.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]})}),s.jsx("td",{className:"text-right tabular-nums",children:s.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 TEe(){return s.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-3 text-[11px] text-zinc-500",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Mu,{active:!0,tone:"cited"}),s.jsx("span",{children:"cited (in sources)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Mu,{active:!0,tone:"mentioned"}),s.jsx("span",{children:"mentioned (in answer)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Mu,{active:!1,tone:"cited"}),s.jsx(Mu,{active:!1,tone:"mentioned"}),s.jsx("span",{children:"neither"})]})]})}function REe({provider:e}){const t=DEe(e);return s.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[s.jsx(Mu,{active:e.cited,tone:"cited"}),s.jsx(Mu,{active:e.mentioned,tone:"mentioned"})]})}function DEe(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 Mu({active:e,tone:t}){if(!e)return s.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 s.jsx("span",{className:n,"aria-hidden":"true"})}function MEe({data:e}){return s.jsxs("div",{className:"mt-4",children:[s.jsxs("h3",{className:"text-sm font-semibold text-zinc-200 mb-2 flex items-center gap-2",children:["Competitor gaps",s.jsx(pr,{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."}),s.jsxs("span",{className:"text-[10px] font-normal uppercase tracking-wide text-zinc-500",children:[e.competitorGaps.length," ",e.competitorGaps.length===1?"gap":"gaps"]})]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Engine"}),s.jsx("th",{children:"Competitors cited"})]})}),s.jsx("tbody",{children:e.competitorGaps.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:t.query}),s.jsx("td",{children:s.jsx(nc,{provider:t.provider})}),s.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const e9=4;function IEe(e){return e.length<e9}const t9={critical:"negative",high:"negative",medium:"caution",low:"neutral"},LEe={positive:"Positive",caution:"Caution",negative:"Negative",neutral:"Neutral"};function ft(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 xv(e,t=1){return Number.isFinite(e)?`${e.toFixed(t)}%`:"—"}function LA(e){return Number.isFinite(e)?`${(e*100).toFixed(1)}%`:"—"}function Es(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 n9(e){switch(e){case"up":return"positive";case"down":return"negative";case"flat":return"neutral";case"unknown":return"neutral"}}function r9(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function $Ee(e){switch(e){case"request-param":case"prompt":return"positive";case"browser-geo":return"caution";case"ignored":return"negative"}}const BEe={"request-param":"Request parameter",prompt:"Prompt-injected","browser-geo":"Browser geo",ignored:"Ignored"};function UEe({cell:e}){if(!e)return s.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[12px] text-zinc-700",children:[s.jsx("span",{children:"—"}),s.jsx("span",{children:"—"})]});const t=e.citationState===Ju.cited,n=e.answerMentioned;return s.jsxs("span",{className:"inline-flex items-center gap-1 font-mono text-[12px]",children:[s.jsx("span",{className:t?"text-emerald-300":"text-zinc-500",title:t?"Cited (your domain in source list)":"Not cited",children:t?"C":"c"}),s.jsx("span",{className:n===!0?"text-emerald-300":n===!1?"text-zinc-500":"text-zinc-700",title:n===!0?"Mentioned (your brand in answer text)":n===!1?"Not mentioned":"No answer text",children:n===!0?"M":n===!1?"m":"–"})]})}function qEe(e){switch(e){case"High":return"negative";case"Moderate":return"caution";case"Low":return"neutral";case"None":return"neutral"}}function FEe({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),[a,l]=x.useState("agency"),u=ca({queryKey:qe.report(e),queryFn:()=>ZV(e)});async function d(){n(!0),i(null);try{await JV(e,a)}catch(p){const m=p instanceof ei||p instanceof Error?p.message:"Download failed";i(m)}finally{n(!1)}}if(u.isLoading)return s.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(u.error){const p=u.error instanceof Error?u.error.message:"Failed to load report";return s.jsx("div",{className:"py-8 text-center",children:s.jsx("p",{className:"text-sm text-rose-400",children:p})})}const f=u.data;return f?s.jsxs("div",{children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("p",{className:"eyebrow",children:"AEO Report"}),s.jsx("h1",{className:"page-title",children:f.meta.project.displayName}),s.jsxs("p",{className:"page-subtitle",children:[f.meta.project.canonicalDomain," · ",f.meta.project.country," / ",f.meta.project.language.toUpperCase(),f.meta.location?` · Location: ${r9(f.meta.location)}`:" · No location set"," · ","Generated ",Es(f.meta.generatedAt)]}),r&&s.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),s.jsxs("div",{className:"page-header-right",children:[s.jsx("div",{className:"inline-flex rounded-lg border border-zinc-800/70 bg-zinc-950/60 p-1",role:"tablist","aria-label":"Report audience",children:["agency","client"].map(p=>s.jsx("button",{type:"button",role:"tab","aria-selected":a===p,onClick:()=>l(p),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${a===p?"bg-zinc-100 text-zinc-950":"text-zinc-400 hover:text-zinc-100"}`,children:p==="agency"?"Agency":"Client"},p))}),s.jsxs(be,{variant:"secondary",size:"sm",onClick:d,disabled:t,children:[s.jsx(Ov,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})]})]}),a==="client"?s.jsxs(s.Fragment,{children:[s.jsx(KEe,{report:f}),s.jsx(IL,{report:f}),s.jsx(RL,{report:f,audience:"client"}),s.jsx(VEe,{report:f})]}):s.jsxs(s.Fragment,{children:[s.jsx(QEe,{report:f}),s.jsx(IL,{report:f}),s.jsx(RL,{report:f,audience:"agency"}),s.jsx(GEe,{report:f}),s.jsx(XEe,{report:f}),s.jsx(JEe,{report:f}),s.jsx(e_e,{report:f}),s.jsx(t_e,{report:f}),s.jsx(r_e,{report:f}),s.jsx(i_e,{report:f}),s.jsx(a_e,{report:f}),s.jsx(s_e,{report:f}),s.jsx(l_e,{report:f}),s.jsx(u_e,{report:f}),s.jsx(d_e,{report:f}),s.jsx(f_e,{report:f}),s.jsx(h_e,{report:f})]})]}):null}function HEe(e,t){return e.audience==="both"||e.audience===t}function KEe({report:e}){const t=e.executiveSummary;return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Client summary",title:"How you're appearing",subtitle:e.clientSummary.overview}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:e.clientSummary.headline}),s.jsx("p",{className:"mt-1 text-sm text-zinc-400",children:e.clientSummary.overview})]}),s.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(fn,{label:"Citation coverage",value:xv(t.citationRate,0),tone:n9(t.trend),subtitle:`${t.citedQueryCount}/${t.totalQueryCount} tracked queries cited`}),s.jsx(fn,{label:"Mention coverage",value:xv(t.mentionRate,0),subtitle:`${t.mentionedQueryCount}/${t.totalQueryCount} tracked queries mentioned`}),s.jsx(fn,{label:"Providers checked",value:ft(t.providerCount),subtitle:`${ft(t.queryCount)} tracked queries`}),t.gsc&&s.jsx(fn,{label:"Search impressions",value:ft(t.gsc.impressions),subtitle:`${ft(t.gsc.clicks)} clicks`})]}),e.clientSummary.confidenceNotes.length>0&&s.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((n,r)=>s.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2 text-xs text-zinc-400",children:n},r))})]})}function RL({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(i=>HEe(i,t)),r=Q4(e,n);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:t==="client"?"Client actions":"Agency actions",title:t==="client"?"What We Recommend Next":"Agency Action Plan",subtitle:t==="client"?"The short list to approve and execute.":"The highest-leverage work, sorted by urgency and evidence strength."}),r.length===0?s.jsx(Cr,{message:"No prioritized actions yet."}):s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:r.map((i,a)=>{const l=i.evidence.length>0?i.evidence:i.why,u=i.why.length>0||i.evidence.length>0;return s.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.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:"Impact rank — 1 is the highest-leverage action",children:a+1}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[s.jsx(Xe,{tone:jte(i),children:F4(i.horizon)}),s.jsx(Xe,{tone:"neutral",children:Ste(i.category)}),s.jsxs(Xe,{tone:"neutral",children:[Nte(i.confidence)," confidence"]})]}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:i.title})]})]}),s.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:i.action}),s.jsx(UA,{items:l,limit:3,className:"mt-3"}),u&&s.jsxs("details",{className:"mt-3 text-xs text-zinc-400",children:[s.jsx("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:"Evidence details"}),i.why.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:"Why"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:i.why.map((d,f)=>s.jsx("li",{children:d},f))})]}),i.evidence.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:"Evidence"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:i.evidence.map((d,f)=>s.jsx("li",{children:d},f))})]})]}),s.jsxs("p",{className:"mt-3 border-t border-zinc-800/60 pt-3 text-xs text-zinc-300",children:[s.jsx("span",{className:"font-medium",children:"Win condition:"})," ",i.successMetric]})]},`${i.priority}-${i.title}`)})})]})}function GEe({report:e}){const t=e.agencyDiagnostics.diagnostics.filter(n=>n.title!=="Location caveat");return t.length===0?null:s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Agency diagnostics",title:"Technical Diagnostics",subtitle:"Fast-read operator flags behind the action plan."}),s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:t.map(n=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx(Xe,{tone:n.severity,children:n.severity}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:n.title})]}),s.jsx("p",{className:"text-sm text-zinc-400",children:n.detail}),s.jsx(UA,{items:n.evidence,limit:3,className:"mt-3"})]},n.title))})]})}function VEe({report:e}){const t=[];e.aiSourceOrigin.topDomains.length>0&&t.push({key:"source-domains",tone:"neutral",title:"Sources AI engines trust",detail:"These domains appeared most often as cited sources outside your owned domain.",items:e.aiSourceOrigin.topDomains.slice(0,5).map(r=>`${r.domain}: ${ft(r.count)} citation${r.count===1?"":"s"}`)}),e.gsc&&t.push({key:"search-demand",tone:"neutral",title:"Search demand",detail:`Search Console shows ${ft(e.gsc.totalImpressions)} impressions and ${ft(e.gsc.totalClicks)} clicks in the report window.`,items:e.gsc.topQueries.slice(0,5).map(r=>`${r.query}: ${ft(r.impressions)} impressions`)}),e.indexingHealth&&t.push({key:"indexing",tone:e.indexingHealth.indexedPct>=90?"positive":e.indexingHealth.indexedPct>=70?"caution":"negative",title:"Indexing readiness",detail:`${e.indexingHealth.indexedPct}% of inspected URLs are indexed.`,items:[`${ft(e.indexingHealth.indexed)} indexed`,`${ft(e.indexingHealth.notIndexed)} not indexed`]});const n=W4(e);return n.length>0&&t.push({key:"content",tone:"caution",title:"Content opportunities",detail:"Canonry found topics where better content could improve AI citations.",items:n.slice(0,5).map(r=>`${r.query}: ${r.action} (${Math.round(r.score)})`)}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Evidence",title:"Why this is the plan",subtitle:"Concise support for the client summary. Switch to Agency for the detailed tables and matrices."}),t.length===0?s.jsx(Cr,{message:"No supporting evidence sections are populated yet."}):s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:t.map(r=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[s.jsx(Xe,{tone:r.tone,children:r.tone}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:r.title})]}),s.jsx("p",{className:"text-sm text-zinc-400",children:r.detail}),r.items.length>0&&s.jsx("ul",{className:"mt-3 list-disc space-y-1 pl-4 text-xs text-zinc-500",children:r.items.map((i,a)=>s.jsx("li",{children:i},a))})]},r.key))})]})}function QEe({report:e}){const t=e.executiveSummary,n=t.trend==="up"?"↑ Up":t.trend==="down"?"↓ Down":t.trend==="flat"?"→ Flat":"—",r=t.totalQueryCount===1?"query":"queries",i=t.totalQueryCount>0?`${t.citedQueryCount}/${t.totalQueryCount} ${r} cited`:"no queries",a=t.totalQueryCount>0?`${t.mentionedQueryCount}/${t.totalQueryCount} ${r} mentioned`:"no queries",l=`${n} · ${i} · ${t.providerCount} provider${t.providerCount===1?"":"s"}`,u=`${t.competitorCount} competitor${t.competitorCount===1?"":"s"} tracked`,d=t.totalQueryCount>0?`${t.citedQueryCount} of ${t.totalQueryCount} tracked ${r} cite ${e.meta.project.displayName}`:"No AI citation data yet",f=t.totalQueryCount>0?`${t.citationRate}% citation coverage and ${t.mentionRate}% mention coverage across ${t.providerCount} provider${t.providerCount===1?"":"s"}.`:"Run a check to populate the first citation and mention baseline.",p=e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan,m=Q4(e,p).length,g=i9(e);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 1",title:"Executive Summary",subtitle:"Citation = source list. Mention = answer text. They are independent signals."}),s.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-[2fr_3fr]",children:[s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:"Latest AI visibility check"}),s.jsx("p",{className:"mt-2 text-lg font-semibold tracking-tight text-zinc-100",children:d}),s.jsx("p",{className:"mt-2 text-sm text-zinc-400",children:f})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:"Citation trend"}),s.jsx("p",{className:`text-xl font-semibold tracking-tight ${t.trend==="up"?"text-emerald-400":t.trend==="down"?"text-rose-400":"text-zinc-100"}`,children:n}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:i})]}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:"Mention coverage"}),s.jsxs("p",{className:"text-xl font-semibold tracking-tight text-zinc-100",children:[t.mentionRate,"%"]}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:a})]}),s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:"Prioritized actions"}),s.jsx("p",{className:"text-xl font-semibold tracking-tight text-zinc-100",children:ft(m)}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Sorted for agency follow-up."})]})]})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(fn,{label:"Citation rate",value:xv(t.citationRate,0),tone:n9(t.trend),subtitle:l}),s.jsx(fn,{label:"Mention rate",value:xv(t.mentionRate,0),subtitle:a}),s.jsx(fn,{label:"Queries tracked",value:ft(t.queryCount),subtitle:u}),t.gsc&&s.jsx(fn,{label:"GSC clicks",value:ft(t.gsc.clicks),subtitle:`${ft(t.gsc.impressions)} imp · ${LA(t.gsc.ctr)} CTR${g?` · ${g}`:""}`}),t.ga&&s.jsx(fn,{label:"GA sessions",value:ft(t.ga.sessions),subtitle:`${ft(t.ga.users)} users · ${Es(t.ga.periodStart)} → ${Es(t.ga.periodEnd)}`})]}),t.findings.length>0&&s.jsx("div",{className:"mt-5 space-y-2",children:t.findings.map((v,j)=>s.jsxs("div",{className:`insight-card rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-4 ${v.tone==="positive"?"insight-card-positive":v.tone==="caution"?"insight-card-caution":v.tone==="negative"?"insight-card-negative":""}`,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{tone:v.tone,children:LEe[v.tone]}),s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:v.title})]}),s.jsx("p",{className:"text-sm text-zinc-400",children:v.detail})]},j))}),s.jsx(ZEe,{report:e})]})}const WEe=14;function $A(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function BA(e){return e==="up"?"↑":e==="down"?"↓":"→"}function _S({label:e,delta:t,unit:n}){if(!t)return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"No prior data"})]});const r=n==="%"?"%":"",i=t.deltaAbs>0?"+":"",a=$A(t.direction),l=a==="positive"?"text-emerald-400":a==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${l}`,children:[t.current,r," ",s.jsx("span",{className:"text-sm font-medium",children:BA(t.direction)})]}),s.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 DL({label:e,delta:t,countLabel:n}){if(!t)return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:"text-2xl font-semibold tracking-tight text-zinc-500",children:"—"}),s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:"Not enough trend data"})]});const r=t.deltaAbs>0?"+":"",i=$A(t.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-100";return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsxs("p",{className:`text-2xl font-semibold tracking-tight ${a}`,children:[ft(t.current)," ",s.jsx("span",{className:"text-sm font-medium",children:BA(t.direction)})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,ft(t.deltaAbs)," ",n," vs prior ",WEe," days"]})]})}function YEe({movements:e}){const t=e.filter(n=>n.direction!=="flat");return t.length===0?null:s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"AI engine movements"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Engine"}),s.jsx("th",{children:"Prior"}),s.jsx("th",{children:"Current"}),s.jsx("th",{children:"Change"})]})}),s.jsx("tbody",{children:t.map(n=>{const r=n.deltaAbs>0?"+":"",i=$A(n.direction),a=i==="positive"?"text-emerald-400":i==="negative"?"text-rose-400":"text-zinc-300";return s.jsxs("tr",{children:[s.jsx("td",{children:n.provider}),s.jsxs("td",{children:[n.prior,"%"]}),s.jsxs("td",{children:[n.current,"%"]}),s.jsxs("td",{className:a,children:[r,n.deltaAbs.toFixed(1),"% ",BA(n.direction)]})]},n.provider)})})]})})]})}function ML({insights:e,heading:t,emptyMessage:n}){return e.length===0?s.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-1",children:t}),s.jsx("p",{className:"text-xs text-zinc-500",children:n})]}):s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:t}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Severity"}),s.jsx("th",{children:"Title"}),s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Provider"})]})}),s.jsx("tbody",{children:e.map(r=>s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(Xe,{tone:t9[r.severity],children:q4(r.severity)}),r.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",r.instanceCount]})]}),s.jsx("td",{className:"evidence-query-cell",children:r.title}),s.jsx("td",{className:"text-xs text-zinc-400",children:r.query}),s.jsx("td",{className:"text-xs text-zinc-400",children:r.provider})]},r.id))})]})})]})}function IL({report:e}){const t=e.whatsChanged;return!t.enoughHistory&&!t.gscClicksDelta&&!t.aiReferralsDelta&&t.wins.length===0&&t.regressions.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 2",title:"What's Changed",subtitle:t.headline}),s.jsx(Cr,{message:"Trends will appear after a few more checks."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 2",title:"What's Changed",subtitle:t.headline}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(_S,{label:"Citation rate",delta:t.citationRate,unit:"%"}),s.jsx(_S,{label:"Mention rate",delta:t.mentionRate,unit:"%"}),s.jsx(_S,{label:"Cited queries",delta:t.citedQueryCount,unit:"count"}),s.jsx(DL,{label:"GSC clicks",delta:t.gscClicksDelta,countLabel:"clicks"}),s.jsx(DL,{label:"AI referral sessions",delta:t.aiReferralsDelta,countLabel:"sessions"})]}),s.jsx(YEe,{movements:t.providerMovements}),s.jsx(ML,{insights:t.wins,heading:"Wins",emptyMessage:"No new gains in the latest check."}),s.jsx(ML,{insights:t.regressions,heading:"Regressions",emptyMessage:"No new regressions in the latest check."})]})}function ZEe({report:e}){const t=e.meta.location,n=e.meta.providerLocationHandling;return!t&&n.length===0?null:s.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Location handling"}),s.jsxs("p",{className:"text-sm text-zinc-300",children:[s.jsx("span",{className:"font-medium",children:"Location for this run: "}),t?r9(t):"none — providers received the queries verbatim with no geographic hint.",t&&t.otherConfiguredLabels.length>0&&s.jsxs("span",{className:"text-zinc-500",children:[" ","— other configured locations (",t.otherConfiguredLabels.join(", "),") need their own check to compare."]})]}),n.length>0&&s.jsx("div",{className:"evidence-table-wrap mt-3",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Treatment"}),s.jsx("th",{children:"How the location reached the model"})]})}),s.jsx("tbody",{children:n.map(r=>s.jsxs("tr",{children:[s.jsx("td",{children:r.provider}),s.jsx("td",{children:s.jsx(Xe,{tone:$Ee(r.treatment),children:BEe[r.treatment]})}),s.jsx("td",{className:"text-zinc-400",children:r.description})]},r.provider))})]})})]})}function fn({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 s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("p",{className:`text-2xl font-semibold tracking-tight ${i}`,children:t}),r&&s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:r})]})}function XEe({report:e}){const t=e.citationScorecard;return t.providers.length===0||t.queries.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 3",title:"Citation Scorecard",subtitle:"Per-engine citation and mention coverage from the latest check."}),s.jsx(Cr,{message:"No completed answer-visibility runs yet."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 3",title:"Citation Scorecard",subtitle:"Per-engine citation and mention coverage from the latest check."}),s.jsxs("div",{className:"mb-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Provider citation rate"}),s.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(SN,{data:t.providerRates,layout:"vertical",margin:{left:20,right:20,top:8,bottom:8},children:[s.jsx(pc,{stroke:dd,horizontal:!1}),s.jsx(Wa,{type:"number",domain:[0,100],tick:er,stroke:Nr}),s.jsx(Ya,{type:"category",dataKey:"provider",tick:er,stroke:Nr,width:90}),s.jsx(Ms,{...ua,formatter:(n,r,i)=>{const a=i?.payload;return a?`${a.citationRate}% (${a.citedCount}/${a.totalCount})`:""}}),s.jsx(gv,{dataKey:"citationRate",fill:An[0],radius:[0,4,4,0]})]})})}),s.jsx("ul",{className:"mt-2 space-y-0.5 text-[11px] text-zinc-500",children:t.providerRates.map(n=>s.jsxs("li",{children:[s.jsx("span",{className:"font-medium text-zinc-300",children:n.provider}),": ",n.citationRate,"% (",n.citedCount,"/",n.totalCount,")"]},n.provider))})]}),s.jsx("p",{className:"eyebrow mb-2",children:"Query × provider"}),s.jsxs("p",{className:"mb-2 text-[11px] text-zinc-500",children:["Each cell shows two flags —"," ",s.jsx("span",{className:"font-mono text-emerald-300",children:"C"}),"/",s.jsx("span",{className:"font-mono text-zinc-500",children:"c"})," = cited / not cited (your domain in the source list),"," ",s.jsx("span",{className:"font-mono text-emerald-300",children:"M"}),"/",s.jsx("span",{className:"font-mono text-zinc-500",children:"m"})," = mentioned / not mentioned (your brand in the answer text),"," ",s.jsx("span",{className:"font-mono text-zinc-700",children:"–"})," = no data."]}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),t.providers.map(n=>s.jsx("th",{children:n},n))]})}),s.jsx("tbody",{children:t.queries.map((n,r)=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:n}),t.providers.map((i,a)=>{const l=t.matrix[r]?.[a]??null;return s.jsx("td",{children:s.jsx(UEe,{cell:l})},i)})]},n))})]})}),s.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Cited = domain in source list · Not cited = absent · Pending = run incomplete · — = no snapshot"})]})}function JEe({report:e}){const t=e.competitorLandscape,n=e.mentionLandscape,r=e.meta.project.canonicalDomain,i=t.competitors.length===0&&t.projectCitationCount===0,a=n.competitors.length===0&&n.projectMentionCount===0;if(i&&a)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 4",title:"Competitor Landscape",subtitle:"Who AI engines cite and mention instead of the client."}),s.jsx(Cr,{message:"No competitor data yet. Add competitors and run a check."})]});const l=[{label:r,count:t.projectCitationCount,isProject:!0},...t.competitors.map(m=>({label:m.domain,count:m.citationCount,isProject:!1}))],u=[{label:r,count:n.projectMentionCount,isProject:!0},...n.competitors.map(m=>({label:m.domain,count:m.mentionCount,isProject:!1}))],d=l.length>1,f=u.length>1,p=new Map(n.competitors.map(m=>[m.domain,m]));return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 4",title:"Competitor Landscape",subtitle:"Who AI engines cite and mention instead of the client."}),s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[d&&s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow mb-2",children:"Citations per domain"}),s.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:l.length*32+32},children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(SN,{data:l,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[s.jsx(pc,{stroke:dd,horizontal:!1}),s.jsx(Wa,{type:"number",tick:er,stroke:Nr}),s.jsx(Ya,{type:"category",dataKey:"label",tick:er,stroke:Nr,width:140}),s.jsx(Ms,{...ua}),s.jsx(gv,{dataKey:"count",radius:[0,4,4,0],children:l.map((m,g)=>s.jsx(lv,{fill:m.isProject?"#3b82f6":An[(g+1)%An.length]},g))})]})})})]}),f&&s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow mb-2",children:"Mentions per domain"}),s.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",style:{height:u.length*32+32},children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(SN,{data:u,layout:"vertical",margin:{left:20,right:32,top:8,bottom:8},children:[s.jsx(pc,{stroke:dd,horizontal:!1}),s.jsx(Wa,{type:"number",tick:er,stroke:Nr}),s.jsx(Ya,{type:"category",dataKey:"label",tick:er,stroke:Nr,width:140}),s.jsx(Ms,{...ua}),s.jsx(gv,{dataKey:"count",radius:[0,4,4,0],children:u.map((m,g)=>s.jsx(lv,{fill:m.isProject?"#3b82f6":An[(g+1)%An.length]},g))})]})})})]})]}),s.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Citations = domain in source list · Mentions = brand or domain in answer text — independent signals."}),t.competitors.length===0?s.jsx(Cr,{message:"No competitors configured."}):s.jsx("div",{className:"competitor-table-wrap mt-4",children:s.jsxs("table",{className:"competitor-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Pressure"}),s.jsx("th",{children:"Citations"}),s.jsx("th",{children:"Mentions"}),s.jsx("th",{children:"SOV"}),s.jsx("th",{children:"Cited queries"})]})}),s.jsx("tbody",{children:t.competitors.map(m=>{const g=p.get(m.domain),v=g?.mentionCount??0,j=g?.totalCount??n.totalAnswerSnapshots;return s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:m.domain}),s.jsx("td",{children:s.jsx(Xe,{tone:qEe(m.pressureLabel),children:m.pressureLabel})}),s.jsxs("td",{children:[m.citationCount," / ",m.totalCount]}),s.jsxs("td",{children:[v," / ",j]}),s.jsxs("td",{children:[m.sharePct,"%"]}),s.jsxs("td",{className:"text-xs text-zinc-400",children:[m.citedQueries.slice(0,5).join(", "),m.citedQueries.length>5?"…":"",m.theirCitedPages.length>0&&s.jsxs("details",{className:"mt-1",children:[s.jsxs("summary",{className:"cursor-pointer text-zinc-500 hover:text-zinc-300",children:[m.theirCitedPages.length," cited URL",m.theirCitedPages.length>1?"s":""]}),s.jsx("ul",{className:"mt-1 space-y-1 pl-3",children:m.theirCitedPages.map((b,S)=>s.jsxs("li",{children:[s.jsx("a",{href:b.url,className:"break-all text-blue-400 hover:underline",target:"_blank",rel:"noreferrer",children:b.url}),s.jsx("span",{className:"ml-2 text-zinc-500",children:b.citedFor.join(", ")})]},S))})]})]})]},m.domain)})})]})})]})}function e_e({report:e}){const t=e.aiSourceOrigin;if(t.categories.length===0&&t.topDomains.length===0)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 5",title:"AI Citation Sources",subtitle:"External domains AI engines cited most in the latest check."}),s.jsx(Cr,{message:"No source data yet. Run a check first."})]});const n=t.categories.reduce((i,a)=>i+a.count,0),r=t.categories.find(i=>i.category==="competitor");return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 5",title:"AI Citation Sources",subtitle:"External domains AI engines cited most in the latest check."}),r&&s.jsxs("p",{className:"mb-3 text-sm text-zinc-300",children:[s.jsxs("span",{className:"font-semibold",children:[r.sharePct,"%"]})," of citations went to tracked competitors (",r.count," of ",n,")."]}),t.topDomains.length>0&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-3",children:"Top sources"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Domain"}),s.jsx("th",{children:"Citations"}),s.jsx("th",{children:"Tag"})]})}),s.jsx("tbody",{children:t.topDomains.map(i=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell text-xs",children:i.domain}),s.jsx("td",{children:i.count}),s.jsx("td",{children:i.isCompetitor?s.jsx(Xe,{tone:"negative",children:"Tracked competitor"}):s.jsx(Xe,{tone:"neutral",children:"External"})})]},i.domain))})]})})]}),t.categories.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"By source type",rows:t.categories.map(i=>{const a=i.category==="competitor"?"#f43f5e":i.category==="directory"||i.category==="forum"?"#f59e0b":"#3b82f6";return{label:i.label,count:i.count,sharePct:i.sharePct,color:a}}),countLabel:"citations"})})]})}function i9(e){const t=e.executiveSummary.gsc,n=e.gsc,r=t?.periodStart||n?.periodStart||n?.trend[0]?.date||"",i=t?.periodEnd||n?.periodEnd||n?.trend.at(-1)?.date||"";return!r&&!i?"":r&&i?`${Es(r)} → ${Es(i)}`:Es(r||i)}function t_e({report:e}){const t=e.gsc;if(!t)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 6",title:"GSC Performance",subtitle:"Search demand signals to compare against AI visibility."}),s.jsx(Cr,{message:"Google Search Console is not connected for this project."})]});const n=i9(e);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 6",title:"GSC Performance",subtitle:`Search demand signals to compare against AI visibility${n?` for ${n}`:""}.`}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(fn,{label:"Clicks",value:ft(t.totalClicks)}),s.jsx(fn,{label:"Impressions",value:ft(t.totalImpressions)}),s.jsx(fn,{label:"CTR",value:LA(t.ctr)}),s.jsx(fn,{label:"Avg position",value:t.avgPosition.toFixed(1)})]}),t.trend.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Clicks over time"}),s.jsx("div",{className:"h-56 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(IA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(pc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr}),s.jsx(Ms,{...ua,labelFormatter:fd}),s.jsx(Kx,{type:"monotone",dataKey:"clicks",stroke:An[0],strokeWidth:2,dot:!0})]})})})]}),t.topQueries.length>0&&s.jsx(n_e,{rows:t.topQueries}),t.categoryBreakdown.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"Search demand by intent",rows:t.categoryBreakdown.map((r,i)=>({label:r.category,count:r.clicks,sharePct:r.sharePct,color:An[i%An.length]})),countLabel:"clicks"})}),(t.trackedButNoGsc.length>0||t.gscButNotTracked.length>0)&&s.jsxs("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:[t.trackedButNoGsc.length>0&&s.jsx(LL,{title:"Tracked but no GSC impressions",tone:"caution",items:t.trackedButNoGsc}),t.gscButNotTracked.length>0&&s.jsx(LL,{title:"GSC queries not yet tracked",tone:"neutral",items:t.gscButNotTracked})]})]})}function n_e({rows:e}){return s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top queries"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Clicks"}),s.jsx("th",{children:"Imp."}),s.jsx("th",{children:"CTR"}),s.jsx("th",{children:"Pos."}),s.jsx("th",{children:"Category"})]})}),s.jsx("tbody",{children:e.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:t.query}),s.jsx("td",{children:ft(t.clicks)}),s.jsx("td",{children:ft(t.impressions)}),s.jsx("td",{children:LA(t.ctr)}),s.jsx("td",{children:t.avgPosition.toFixed(1)}),s.jsx("td",{children:s.jsx(Xe,{tone:"neutral",children:t.category})})]},t.query))})]})})]})}function LL({title:e,items:t,tone:n}){return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"eyebrow",children:e}),s.jsx(Xe,{tone:n,children:t.length})]}),s.jsxs("ul",{className:"mt-2 space-y-1 text-xs text-zinc-400",children:[t.slice(0,8).map(r=>s.jsxs("li",{className:"truncate",children:["· ",r]},r)),t.length>8&&s.jsxs("li",{className:"text-zinc-600",children:["+ ",t.length-8," more"]})]})]})}function r_e({report:e}){const t=e.ga;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 7",title:"GA4 Traffic",subtitle:`Site traffic from ${Es(t.periodStart)} to ${Es(t.periodEnd)}.`}),s.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-3",children:[s.jsx(fn,{label:"Sessions",value:ft(t.totalSessions)}),s.jsx(fn,{label:"Users",value:ft(t.totalUsers)}),s.jsx(fn,{label:"Organic sessions",value:ft(t.totalOrganicSessions)})]}),t.topLandingPages.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top landing pages"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Page"}),s.jsx("th",{children:"Sessions"}),s.jsx("th",{children:"Users"}),s.jsx("th",{children:"Organic"})]})}),s.jsx("tbody",{children:t.topLandingPages.map(n=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),s.jsx("td",{children:ft(n.sessions)}),s.jsx("td",{children:ft(n.users)}),s.jsx("td",{children:ft(n.organicSessions)})]},n.page))})]})})]}),t.channelBreakdown.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"Channel mix",rows:t.channelBreakdown.map((n,r)=>({label:n.channel,count:n.sessions,sharePct:n.sharePct,color:An[r%An.length]})),countLabel:"sessions"})})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 7",title:"GA4 Traffic",subtitle:"Site traffic from the connected Google Analytics 4 property."}),s.jsx(Cr,{message:"Google Analytics 4 is not connected for this project."})]})}function i_e({report:e}){const t=e.socialReferrals;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 8",title:"Social Referrals",subtitle:"Social traffic split by channel and campaign."}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(fn,{label:"Total sessions",value:ft(t.totalSessions)}),s.jsx(fn,{label:"Organic",value:ft(t.organicSessions)}),s.jsx(fn,{label:"Paid",value:ft(t.paidSessions)})]}),t.channels.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"Social channel mix",rows:t.channels.map((n,r)=>({label:n.channelGroup,count:n.sessions,sharePct:n.sharePct,color:An[r%An.length]})),countLabel:"sessions"})}),t.topCampaigns.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top campaigns"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Source"}),s.jsx("th",{children:"Medium"}),s.jsx("th",{children:"Sessions"})]})}),s.jsx("tbody",{children:t.topCampaigns.map((n,r)=>s.jsxs("tr",{children:[s.jsx("td",{children:n.source}),s.jsx("td",{className:"text-xs text-zinc-400",children:n.medium}),s.jsx("td",{children:ft(n.sessions)})]},`${n.source}-${n.medium}-${r}`))})]})})]})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 8",title:"Social Referrals",subtitle:"Social traffic split by channel and campaign."}),s.jsx(Cr,{message:"No social referral data."})]})}function a_e({report:e}){const t=e.aiReferrals;return t?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 9",title:"AI Referral Traffic",subtitle:"Traffic arriving from AI answer engines."}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsx(fn,{label:"Sessions",value:ft(t.totalSessions)}),s.jsx(fn,{label:"Users",value:ft(t.totalUsers)})]}),t.trend.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"AI sessions trend"}),s.jsx("div",{className:"h-48 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(IA,{data:t.trend,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(pc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr}),s.jsx(Ms,{...ua,labelFormatter:fd}),s.jsx(Kx,{type:"monotone",dataKey:"sessions",stroke:An[0],strokeWidth:2,dot:!1})]})})})]}),t.bySource.length>0&&s.jsx("div",{className:"mt-4",children:s.jsx(wp,{heading:"AI sessions by source",rows:t.bySource.map((n,r)=>({label:n.source,count:n.sessions,sharePct:n.sharePct,color:An[(r+2)%An.length]})),countLabel:"sessions"})}),t.topLandingPages.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Top AI landing pages"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Page"}),s.jsx("th",{children:"Sessions"}),s.jsx("th",{children:"Users"})]})}),s.jsx("tbody",{children:t.topLandingPages.map(n=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell text-xs",children:n.page}),s.jsx("td",{children:ft(n.sessions)}),s.jsx("td",{children:ft(n.users)})]},n.page))})]})})]})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 9",title:"AI Referral Traffic",subtitle:"Traffic arriving from AI answer engines."}),s.jsx(Cr,{message:"No AI referral data."})]})}function s_e({report:e}){const t=e.indexingHealth;if(!t||!t.provider)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 10",title:"Indexing Health",subtitle:"Connect Google Search Console or Bing Webmaster Tools to populate this section."}),s.jsx(Cr,{message:"No indexing data — connect Google Search Console or Bing Webmaster Tools."})]});const n=`Pages absent from ${t.provider==="google"?"Google":"Bing"} are harder for AI engines to retrieve.`;return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 10",title:"Indexing Health",subtitle:n}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[s.jsx(fn,{label:"Indexed",value:ft(t.indexed),tone:"positive"}),s.jsx(fn,{label:"Total inspected",value:ft(t.total)}),s.jsx(fn,{label:"Indexed share",value:`${t.indexedPct}%`})]}),s.jsx(o_e,{ih:t})]})}function o_e({ih:e}){const t=[{label:"Indexed",count:e.indexed,color:"#10b981"},{label:"Not indexed",count:e.notIndexed,color:"#f59e0b"},{label:"Deindexed",count:e.deindexed,color:"#f43f5e"},{label:"Unknown",count:e.unknown,color:"#71717a"}].filter(r=>r.count>0),n=t.reduce((r,i)=>r+i.count,0)||1;return t.length===0?null:s.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-3",children:"Coverage breakdown"}),s.jsx("div",{className:"flex h-7 w-full overflow-hidden rounded-md",children:t.map(r=>s.jsx("div",{style:{width:`${r.count/n*100}%`,background:r.color},title:`${r.label}: ${r.count}`},r.label))}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-2 text-xs text-zinc-400",children:t.map(r=>s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:"inline-block size-2.5 rounded-sm",style:{background:r.color}}),s.jsxs("span",{className:"text-zinc-300",children:[r.label,":"]}),s.jsx("span",{className:"tabular-nums text-zinc-100",children:r.count})]},r.label))})]})}function l_e({report:e}){const t=e.citationsTrend;return t.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx(Cr,{message:"Run multiple checks to see a trend."})]}):IEe(t)?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx(Cr,{message:`Building baseline (${t.length} of ${e9} checks completed). Trend will appear once more checks are recorded.`})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 11",title:"Citations Over Time",subtitle:"Citation coverage across recent checks."}),s.jsx("div",{className:"h-64 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3",children:s.jsx(Ps,{width:"100%",height:"100%",children:s.jsxs(IA,{data:t,margin:{left:8,right:12,top:8,bottom:8},children:[s.jsx(pc,{stroke:dd}),s.jsx(Wa,{dataKey:"date",tick:er,stroke:Nr,tickFormatter:hd}),s.jsx(Ya,{tick:er,stroke:Nr,domain:[0,100],tickFormatter:n=>`${n}%`}),s.jsx(Ms,{...ua,labelFormatter:fd,formatter:n=>`${n}%`}),s.jsx(Kx,{type:"monotone",dataKey:"citationRate",stroke:An[0],strokeWidth:2,dot:!0})]})})}),s.jsx(c_e,{trend:t})]})}function c_e({trend:e}){return e.length===0?null:s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"Check-by-check breakdown"}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Check"}),s.jsx("th",{children:"Cited queries"}),s.jsx("th",{children:"Per-engine rates"})]})}),s.jsx("tbody",{children:e.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:Es(t.date)}),s.jsxs("td",{children:[t.citationRate,"% ",s.jsxs("span",{className:"text-zinc-500",children:["(",t.citedQueryCount,"/",t.totalQueryCount,")"]})]}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.providerRates.map(n=>`${n.provider}: ${n.citationRate}%`).join(" · ")})]},t.runId))})]})})]})}function u_e({report:e}){return e.insights.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 12",title:"Insights & Alerts",subtitle:"Regressions, gains, and recurring alerts ordered by severity."}),s.jsx(Cr,{message:"No active insights — everything looks stable."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 12",title:"Insights & Alerts",subtitle:"Regressions, gains, and recurring alerts ordered by severity."}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Severity"}),s.jsx("th",{children:"Title"}),s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Provider"}),s.jsx("th",{children:"Recommendation"})]})}),s.jsx("tbody",{children:e.insights.map(t=>s.jsxs("tr",{children:[s.jsxs("td",{children:[s.jsx(Xe,{tone:t9[t.severity],children:q4(t.severity)}),t.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",t.instanceCount]})]}),s.jsx("td",{className:"evidence-query-cell",children:t.title}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.query}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.provider}),s.jsx("td",{className:"text-xs text-zinc-400",children:t.recommendation??"—"})]},t.id))})]})})]})}function d_e({report:e}){const t=W4(e);if(t.length===0)return null;const n=e.meta.project.canonicalDomain,r=t.slice(0,3);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 13",title:"Content Opportunities",subtitle:"Queries where content work has the clearest path to more AI citations. Opportunity score is 0–100, higher = stronger."}),s.jsx("div",{className:"mb-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map(i=>s.jsxs("article",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsxs("div",{className:"text-2xl font-semibold tracking-tight text-zinc-100",title:"Opportunity score (0–100, higher = stronger)",children:[Math.round(i.score),s.jsx("span",{className:"ml-0.5 text-sm font-normal text-zinc-500",children:"/100"})]}),s.jsx("p",{className:"mt-2 text-sm font-medium text-zinc-100",children:i.query}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[iP(i.action)," · ",aP(i.actionConfidence)," confidence"]}),s.jsx(UA,{items:i.drivers,limit:2,className:"mt-3"})]},i.targetRef))}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Action"}),s.jsx("th",{title:"Opportunity score (0–100)",children:"Score"}),s.jsx("th",{children:"Why"}),s.jsx("th",{children:"Our page"}),s.jsx("th",{children:"Winning competitor"}),s.jsx("th",{children:"Confidence"})]})}),s.jsx("tbody",{children:t.slice(0,10).map(i=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:i.query}),s.jsx("td",{children:s.jsx(Xe,{tone:"neutral",children:iP(i.action)})}),s.jsx("td",{title:"Opportunity score (0–100)",children:Math.round(i.score)}),s.jsx("td",{className:"text-xs text-zinc-400",children:i.drivers.length>0?s.jsx("ul",{className:"list-disc pl-4 space-y-0.5",children:i.drivers.map((a,l)=>s.jsx("li",{children:a},l))}):s.jsx("span",{className:"text-zinc-600",children:"No driver signal yet"})}),s.jsx("td",{className:"text-xs",children:i.ourBestPage?s.jsx("a",{href:yte(i.ourBestPage.url,n),target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline break-all",children:i.ourBestPage.url}):s.jsx("span",{className:"text-zinc-600",children:"No page yet"})}),s.jsx("td",{className:"text-xs",children:i.winningCompetitor?s.jsx("a",{href:i.winningCompetitor.url,target:"_blank",rel:"noreferrer",className:"text-blue-400 hover:underline",children:i.winningCompetitor.domain}):s.jsx("span",{className:"text-zinc-600",children:"—"})}),s.jsx("td",{children:s.jsx(Xe,{tone:"neutral",children:aP(i.actionConfidence)})})]},i.targetRef))})]})})]})}function f_e({report:e}){return e.contentGaps.length===0?null:s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 14",title:"Content Gaps",subtitle:"Tracked queries where competitors are cited and the client is missing."}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Query"}),s.jsx("th",{children:"Competitors cited"}),s.jsx("th",{children:"Domains"}),s.jsx("th",{children:"Miss rate"})]})}),s.jsx("tbody",{children:e.contentGaps.slice(0,10).map(t=>{const n=t.competitorDomains.slice(0,5),r=t.competitorDomains.length-n.length;return s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:t.query}),s.jsx("td",{children:t.competitorCount}),s.jsxs("td",{className:"text-xs text-zinc-400",children:[n.join(", "),r>0?`, +${r} more`:""]}),s.jsxs("td",{children:[Math.round(t.missRate*100),"%"]})]},t.query)})})]})})]})}function h_e({report:e}){return e.recommendedNextSteps.length===0?s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 15",title:"Recommended Next Steps",subtitle:"Action items bucketed by timing."}),s.jsx(Cr,{message:"No prioritized actions yet."})]}):s.jsxs("section",{className:"page-section-divider",children:[s.jsx(At,{eyebrow:"Section 15",title:"Recommended Next Steps",subtitle:"Action items bucketed by timing."}),s.jsx("div",{className:"space-y-2",children:e.recommendedNextSteps.map((t,n)=>s.jsxs("div",{className:"flex items-start gap-3 rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-3 py-2.5",children:[s.jsx("span",{className:"shrink-0 rounded-md border border-zinc-800/60 bg-zinc-950/40 px-2 py-0.5 text-[11px] uppercase tracking-wide text-zinc-400",children:F4(t.horizon)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:t.title}),s.jsx("p",{className:"text-xs text-zinc-500",children:t.rationale})]})]},n))})]})}function At({eyebrow:e,title:t,subtitle:n}){return s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{className:"eyebrow-soft",children:e}),s.jsx("h2",{className:"page-title",children:t}),n&&s.jsx("p",{className:"page-subtitle mt-1",children:n})]})}function UA({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 s.jsxs("div",{className:`flex flex-wrap gap-1.5 ${n??""}`,children:[r.map((a,l)=>s.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},l)),i>0&&s.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 wp({heading:e,rows:t,countLabel:n}){const r=t.filter(i=>i.count>0||i.sharePct>0);return r.length===0?null:s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4",children:[s.jsx("p",{className:"eyebrow mb-3",children:e}),s.jsx("div",{className:"space-y-2",children:r.map((i,a)=>{const l=Math.max(0,Math.min(100,i.sharePct)),u=i.color??An[a%An.length];return s.jsxs("div",{className:"grid grid-cols-[160px_1fr_auto] items-center gap-3",children:[s.jsx("div",{className:"truncate text-xs text-zinc-400",children:i.label}),s.jsx("div",{className:"h-2 rounded-sm bg-zinc-800",children:s.jsx("div",{className:"h-full rounded-sm",style:{width:`${l.toFixed(1)}%`,background:u}})}),s.jsxs("div",{className:"text-right text-xs tabular-nums text-zinc-200",children:[ft(i.count)," ",s.jsxs("span",{className:"text-zinc-500",children:[n," · ",i.sharePct,"%"]})]})]},i.label)})})]})}function Cr({message:e}){return s.jsx("p",{className:"text-sm text-zinc-500 py-4 text-center",children:e})}function p_e({project:e,onUpdateProject:t,onRefresh:n}){const[r,i]=x.useState(!1),[a,l]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,g]=x.useState(e.canonicalDomain),[v,j]=x.useState(e.country),[b,S]=x.useState(e.language),[k,E]=x.useState(e.ownedDomains??[]),[C,A]=x.useState(""),[P,O]=x.useState(null),[_,T]=x.useState(!1),[$,F]=x.useState(!1),[U,B]=x.useState(""),[V,X]=x.useState(""),[Z,H]=x.useState(""),[J,oe]=x.useState(""),[ye,I]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),g(e.canonicalDomain),j(e.country),S(e.language),E(e.ownedDomains??[]))},[e,r]);function M(){i(!1),d(null),p(e.displayName),g(e.canonicalDomain),j(e.country),S(e.language),E(e.ownedDomains??[]),A("")}function q(){const Y=C.trim();Y&&(k.includes(Y)||E([...k,Y]),A(""))}function D(Y){E(k.filter(He=>He!==Y))}async function G(){if(!(!f.trim()||!m.trim()||!v.trim()||!b.trim())){l(!0),d(null);try{await t(e.name,{displayName:f.trim(),canonicalDomain:m.trim(),ownedDomains:k,country:v.trim(),language:b.trim()}),i(!1),vt({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Y){d(Y instanceof Error?Y.message:"Failed to save")}finally{l(!1)}}}async function se(){const Y=U.trim(),He=V.trim(),Te=Z.trim(),at=J.trim();if(!(!Y||!He||!Te||!at)){T(!0),O(null);try{const Ve={label:Y,city:He,region:Te,country:at};ye.trim()&&(Ve.timezone=ye.trim()),await fV(e.name,Ve),n(),B(""),X(""),H(""),oe(""),I(""),F(!1),vt({title:"Location added",detail:`${Y} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Y}`,dedupeMode:"drop"})}catch(Ve){O(Ve instanceof Error?Ve.message:"Failed to add location")}finally{T(!1)}}}async function ne(Y){T(!0),O(null);try{await hV(e.name,Y),n(),vt({title:"Location removed",detail:`${Y} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Y}`,dedupeMode:"drop"})}catch(He){O(He instanceof Error?He.message:"Failed to remove location")}finally{T(!1)}}async function Ce(Y){T(!0),O(null);try{await pV(e.name,Y),n(),vt({title:"Default location updated",detail:`${Y} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(He){O(He instanceof Error?He.message:"Failed to set default location")}finally{T(!1)}}const Se=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",pe="block text-xs font-medium text-zinc-400 mb-1",Ee=U.trim()&&V.trim()&&Z.trim()&&J.trim();return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Configuration"}),s.jsx("h2",{children:"Project settings"})]}),!r&&s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),u&&s.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:[u,s.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>d(null),children:"×"})]}),r?s.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Display name"}),s.jsx("input",{className:ee,type:"text",value:f,onChange:Y=>p(Y.target.value),placeholder:"My Project"})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Canonical domain"}),s.jsx("input",{className:ee,type:"text",value:m,onChange:Y=>g(Y.target.value),placeholder:"example.com"})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Country"}),s.jsx("input",{className:ee,type:"text",value:v,onChange:Y=>j(Y.target.value),placeholder:"US",maxLength:2})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Language"}),s.jsx("input",{className:ee,type:"text",value:b,onChange:Y=>S(Y.target.value),placeholder:"en"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:pe,children:"Owned domains"}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Y=>s.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:[Y,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>D(Y),"aria-label":`Remove ${Y}`,children:"×"})]},Y))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{className:`${ee} flex-1`,type:"text",placeholder:"docs.example.com",value:C,onChange:Y=>A(Y.target.value),onKeyDown:Y=>Y.key==="Enter"&&(Y.preventDefault(),q())}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:!C.trim(),onClick:q,children:"Add"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[s.jsx(be,{type:"button",disabled:a||!Se||!f.trim()||!m.trim(),onClick:G,children:a?"Saving...":"Save changes"}),s.jsx(be,{type:"button",variant:"outline",disabled:a,onClick:M,children:"Cancel"})]})]}):s.jsx("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:s.jsx("table",{className:"w-full text-sm",children:s.jsxs("tbody",{children:[s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium w-40",children:"Display name"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.displayName||"—"})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Canonical domain"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.canonicalDomain})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Owned domains"}),s.jsx("td",{className:"px-4 py-2.5",children:(e.ownedDomains??[]).length>0?s.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.ownedDomains.map(Y=>s.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:Y},Y))}):s.jsx("span",{className:"text-zinc-500",children:"—"})})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Country"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.country})]}),s.jsxs("tr",{className:"border-b border-zinc-800/40",children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium",children:"Language"}),s.jsx("td",{className:"px-4 py-2.5 text-zinc-200",children:e.language})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"px-4 py-2.5 text-zinc-500 font-medium align-top pt-3",children:"Locations"}),s.jsxs("td",{className:"px-4 py-2.5",children:[P&&s.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:[P,s.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>O(null),children:"×"})]}),(e.locations??[]).length>0?s.jsxs("table",{className:"w-full text-xs mb-2",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-zinc-600",children:[s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Label"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"City"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Region"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Country"}),s.jsx("th",{className:"text-left pb-1 font-medium pr-3",children:"Timezone"}),s.jsx("th",{className:"pb-1"})]})}),s.jsx("tbody",{children:e.locations.map(Y=>s.jsxs("tr",{className:"border-t border-zinc-800/30",children:[s.jsx("td",{className:"py-1.5 pr-3",children:s.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium ${Y.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:[Y.label,Y.label===e.defaultLocation?" ★":""]})}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.city}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.region}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Y.country}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Y.timezone??"—"}),s.jsx("td",{className:"py-1.5",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Y.label!==e.defaultLocation&&s.jsx("button",{type:"button",disabled:_,onClick:()=>Ce(Y.label),className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Y.label} as default location`,children:"Set default"}),s.jsx("button",{type:"button",disabled:_,onClick:()=>ne(Y.label),className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Y.label}`,children:"Remove"})]})})]},Y.label))})]}):s.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),$?s.jsxs("div",{className:"mt-2 rounded border border-zinc-800 bg-zinc-900/50 p-3 space-y-2",children:[s.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-zinc-500",children:"Add location"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Label *"}),s.jsx("input",{className:ee,type:"text",value:U,onChange:Y=>B(Y.target.value),placeholder:"nyc"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"City *"}),s.jsx("input",{className:ee,type:"text",value:V,onChange:Y=>X(Y.target.value),placeholder:"New York"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Region *"}),s.jsx("input",{className:ee,type:"text",value:Z,onChange:Y=>H(Y.target.value),placeholder:"NY"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Country *"}),s.jsx("input",{className:ee,type:"text",value:J,onChange:Y=>oe(Y.target.value),placeholder:"US",maxLength:2})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("label",{className:"block text-[10px] text-zinc-500 mb-0.5",children:"Timezone (optional)"}),s.jsx("input",{className:ee,type:"text",value:ye,onChange:Y=>I(Y.target.value),placeholder:"America/New_York"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsx(be,{type:"button",size:"sm",disabled:_||!Ee,onClick:se,children:_?"Adding...":"Add location"}),s.jsx(be,{type:"button",size:"sm",variant:"outline",disabled:_,onClick:()=>{F(!1),O(null)},children:"Cancel"})]})]}):s.jsx(be,{type:"button",size:"sm",variant:"outline",onClick:()=>F(!0),children:"+ Add location"})]})]})]})})})]})}const m_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"}],$L=["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 g_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState("daily"),[u,d]=x.useState(6),[f,p]=x.useState(""),[m,g]=x.useState("UTC"),[v,j]=x.useState(!1),[b,S]=x.useState(""),[k,E]=x.useState(!1),[C,A]=x.useState(!1),[P,O]=x.useState(null);x.useEffect(()=>{jV(e).then(n).catch(()=>n(null))},[e]);const _=()=>{if(t&&t!=="loading"){const U=Tte(t.preset??null,t.cronExpr);l(U.freq),d(U.hour),p(U.customCron);const B=$L.includes(t.timezone);g(B?t.timezone:"Other"),j(!B),S(B?"":t.timezone)}else l("daily"),d(6),p(""),g("UTC"),j(!1),S("");O(null),i(!0)},T=async()=>{E(!0),O(null);try{const B={timezone:v?b.trim()||"UTC":m};a==="custom"?B.cron=f.trim():B.preset=Pte(a,u);const V=await S2(e,B);n(V),i(!1),vt({title:"Schedule saved",detail:Sw(V.preset??null,V.cronExpr,V.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(U){O(U instanceof Error?U.message:"Failed to save schedule")}finally{E(!1)}},$=async()=>{if(!(!t||t==="loading")){E(!0),O(null);try{const U={timezone:t.timezone,enabled:!t.enabled};t.preset?U.preset=t.preset:U.cron=t.cronExpr;const B=await S2(e,U);n(B),vt({title:B.enabled?"Schedule resumed":"Schedule paused",detail:Sw(B.preset??null,B.cronExpr,B.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(U){O(U instanceof Error?U.message:"Failed to update schedule")}finally{E(!1)}}},F=async()=>{A(!0),O(null);try{await SV(e),n(null),i(!1),vt({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(U){O(U instanceof Error?U.message:"Failed to remove schedule")}finally{A(!1)}};return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),s.jsx("h2",{children:"Scheduled runs"})]}),t!=="loading"&&!r&&s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:_,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&s.jsx($e,{className:"surface-card compact-card",children:s.jsx("p",{className:"supporting-copy",children:"No schedule configured. Set one to automatically trigger visibility sweeps."})}),t!=="loading"&&!r&&t!==null&&s.jsxs($e,{className:"surface-card compact-card",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-200",children:Sw(t.preset??null,t.cronExpr,t.timezone)}),s.jsxs("p",{className:"text-xs text-zinc-500",children:["Cron: ",s.jsx("span",{className:"font-mono",children:t.cronExpr})]}),t.nextRunAt&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Next run: ",new Date(t.nextRunAt).toLocaleString()]}),t.lastRunAt&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Last run: ",new Date(t.lastRunAt).toLocaleString()]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx(Xe,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:$,children:t.enabled?"Pause":"Resume"}),s.jsx(be,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:F,children:C?"Removing...":"Remove"})]})]}),P&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:P})]}),r&&s.jsxs("div",{className:"rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Frequency"}),s.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:U=>l(U.target.value),children:m_e.map(U=>s.jsx("option",{value:U.value,children:U.label},U.value))})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Time"}),s.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:u,disabled:a==="twice-daily"||a==="custom",onChange:U=>d(parseInt(U.target.value)),children:Array.from({length:24},(U,B)=>s.jsx("option",{value:B,children:t1(B)},B))})]})]}),a==="custom"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Cron expression"}),s.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:U=>p(U.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Timezone"}),s.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:U=>{U.target.value==="Other"?(j(!0),g("Other")):(j(!1),g(U.target.value))},children:[$L.map(U=>s.jsx("option",{value:U,children:U},U)),s.jsxs("option",{value:"Other",children:["Other (enter manually)","…"]})]}),v&&s.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:U=>S(U.target.value)})]}),P&&s.jsx("p",{className:"text-rose-400 text-sm",children:P}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),O(null)},children:"Cancel"}),s.jsx(be,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:T,children:k?"Saving...":"Save schedule"})]})]})]})}const y_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 v_e({projectName:e}){const[t,n]=x.useState("loading"),[r,i]=x.useState(!1),[a,l]=x.useState(""),[u,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,g]=x.useState(null),[v,j]=x.useState({}),[b,S]=x.useState(new Set);x.useEffect(()=>{NV(e).then(n).catch(()=>n([]))},[e]);const k=P=>{d(O=>O.includes(P)?O.filter(_=>_!==P):[...O,P])},E=async()=>{if(!(!a.trim()||u.length===0)){p(!0),g(null);try{const P=await kV(e,{channel:"webhook",url:a.trim(),events:u});n(O=>O==="loading"?[P]:[...O,P]),l(""),d(["citation.lost","citation.gained"]),i(!1),vt({title:"Webhook added",detail:`Notifications will be sent to ${P.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(P){g(P instanceof Error?P.message:"Failed to add webhook")}finally{p(!1)}}},C=async P=>{if(!b.has(P)){S(O=>new Set(O).add(P));try{await CV(e,P),n(O=>O==="loading"?O:O.filter(_=>_.id!==P)),vt({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${P}`,dedupeMode:"drop"})}catch(O){g(O instanceof Error?O.message:"Failed to remove webhook")}finally{S(O=>{const _=new Set(O);return _.delete(P),_})}}},A=async P=>{j(O=>({...O,[P]:{state:"testing"}}));try{const O=await AV(e,P);j(_=>({..._,[P]:{state:O.ok?"ok":"fail",status:O.status}})),O.ok&&vt({title:"Test notification sent",detail:`Webhook returned status ${O.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${P}`,dedupeMode:"replace"})}catch{j(O=>({...O,[P]:{state:"fail"}}))}};return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Automation"}),s.jsx("h2",{children:"Notifications"})]}),t!=="loading"&&s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),g(null)},children:r?"Cancel":"+ Add webhook"})]}),r&&s.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Webhook URL"}),s.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:P=>l(P.target.value)})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-xs font-medium text-zinc-400",children:"Trigger on"}),s.jsx("div",{className:"flex flex-wrap gap-3",children:y_e.map(P=>s.jsxs("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[s.jsx("input",{type:"checkbox",className:"rounded border-zinc-600 bg-zinc-800",checked:u.includes(P.value),onChange:()=>k(P.value)}),s.jsx("span",{className:"text-sm text-zinc-300",children:P.label})]},P.value))})]}),m&&s.jsx("p",{className:"text-rose-400 text-sm",children:m}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),g(null)},children:"Cancel"}),s.jsx(be,{type:"button",size:"sm",disabled:f||!a.trim()||u.length===0,onClick:E,children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&s.jsx($e,{className:"surface-card compact-card",children:s.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&&s.jsxs("div",{className:"evidence-table-wrap",children:[s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Endpoint"}),s.jsx("th",{children:"Events"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:t.map(P=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:s.jsx("span",{className:"font-mono text-xs text-zinc-300 break-all",title:P.urlHost,children:P.urlDisplay??P.url})}),s.jsx("td",{children:s.jsx("div",{className:"flex flex-wrap gap-1",children:P.events.map(O=>s.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:O.replace("."," ")},O))})}),s.jsx("td",{children:s.jsx(Xe,{tone:P.enabled?"positive":"neutral",children:P.enabled?"Active":"Paused"})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[P.id]&&(()=>{const O=v[P.id],_=O.state==="testing"?"Sending…":O.state==="ok"?`Delivered${O.status?` (${O.status})`:""}`:`Failed${O.status?` (${O.status})`:""}`;return s.jsx(Xe,{tone:O.state==="ok"?"positive":O.state==="fail"?"negative":"neutral",children:_})})(),s.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:v[P.id]?.state==="testing",onClick:()=>A(P.id),children:"Test"}),s.jsx(be,{variant:"ghost",size:"sm",type:"button",disabled:b.has(P.id),onClick:()=>C(P.id),children:b.has(P.id)?"Removing…":"Remove"})]})})]},P.id))})]}),m&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function x_e({projectName:e,refreshNonce:t}){const n=xi(),[r,i]=x.useState(null),[a,l]=x.useState([]),[u,d]=x.useState(null),[f,p]=x.useState([]),[m,g]=x.useState([]),[v,j]=x.useState(null),[b,S]=x.useState(""),[k,E]=x.useState(""),[C,A]=x.useState(""),[P,O]=x.useState(!0),[_,T]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState("coverage");x.useEffect(()=>{V()},[e,t]);async function V(){O(!0),F(null);try{const M=await n.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>T5(e),staleTime:jr});if(i(M),M.connected){const[q,D,G,se]=await Promise.all([n.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>WN(e).catch(()=>null),staleTime:jr}),n.fetchQuery({queryKey:qe.bing.inspections(e),queryFn:()=>R5(e).catch(()=>[]),staleTime:jr}),n.fetchQuery({queryKey:qe.bing.performance(e),queryFn:()=>WV(e).catch(()=>[]),staleTime:jr}),M.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:qe.bing.sites(e),queryFn:()=>VV(e).then(ne=>ne.sites).catch(()=>[]),staleTime:jr})]);d(q),p(D),g(G),l(se)}else d(null),p([]),g([]),l([])}catch(M){F(M instanceof Error?M.message:"Failed to load Bing data")}finally{O(!1)}}async function X(){if(k.trim()){F(null);try{const M=await KV(e,k.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),E(""),M.availableSites.length>0&&l(M.availableSites),await V()}catch(M){F(M instanceof Error?M.message:"Failed to connect")}}}async function Z(){try{await GV(e),await n.invalidateQueries({queryKey:qe.bing.project(e)}),i(null),l([]),d(null),p([]),g([]),j(null),A(""),F(null)}catch(M){F(M instanceof Error?M.message:"Failed to disconnect")}}async function H(){if(C)try{await QV(e,C),await n.invalidateQueries({queryKey:qe.bing.project(e)}),await V()}catch(M){F(M instanceof Error?M.message:"Failed to set site")}}async function J(){if(b.trim())try{const M=await D5(e,b.trim());await n.invalidateQueries({queryKey:qe.bing.project(e)}),j(M),p(q=>[M,...q])}catch(M){F(M instanceof Error?M.message:"Inspection failed")}}async function oe(M){T(!0),F(null);try{const q=await C2(e,{urls:[M]}),{succeeded:D,failed:G,total:se}=q.summary;vt({title:"Bing submission requested",detail:G===0?`${D} URL submitted to Bing.`:`${D}/${se} submitted successfully, ${G} failed.`,tone:G===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}catch(q){const D=q instanceof Error?q.message:"Submission failed";F(D),vt({title:"Bing submission failed",detail:D,tone:"negative",dedupeKey:`bing:indexing:${e}:${M}`,dedupeMode:"replace"})}finally{T(!1)}}async function ye(){T(!0),F(null),vt({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const M=await C2(e,{allUnindexed:!0}),{succeeded:q,failed:D,total:G}=M.summary;vt({title:"Bing submissions requested",detail:D===0?`${q}/${G} URL${G!==1?"s":""} submitted to Bing.`:`${q}/${G} submitted successfully, ${D} failed.`,tone:D===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(M){const q=M instanceof Error?M.message:"Batch submission failed";F(q),vt({title:"Bing submissions failed",detail:q,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{T(!1)}}if(P)return s.jsx($e,{className:"surface-card",children:s.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsx(Xe,{tone:"caution",children:"Not connected"})]}),s.jsx("p",{className:"text-sm text-zinc-300",children:"Connect Bing Webmaster Tools to inspect URLs, monitor index coverage, and submit pages for indexing."}),s.jsxs("div",{className:"mt-3",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[s.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:M=>E(M.target.value),onKeyDown:M=>M.key==="Enter"&&X()}),s.jsx(be,{size:"sm",disabled:!k.trim(),onClick:X,children:"Connect"})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:["Get your API key from"," ",s.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"})]})]}),$&&s.jsx("p",{className:"mt-3 text-xs text-rose-400",children:$})]});if(!r.siteUrl)return s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{tone:"positive",children:"Connected"}),s.jsx(be,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),s.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."})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Registered domain"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.domain})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?aa(r.updatedAt):"—"})]})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Select site"}),a.length>0?s.jsxs("div",{className:"mt-3 flex flex-col gap-2 lg:flex-row",children:[s.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:M=>A(M.target.value),children:[s.jsx("option",{value:"",children:"Select a site..."}),a.map(M=>s.jsxs("option",{value:M.url,children:[M.url,M.verified?" (verified)":""]},M.url))]}),s.jsx(be,{size:"sm",disabled:!C,onClick:H,children:"Set Site"})]}):s.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."})]})]}),$&&s.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 s.jsxs("div",{className:"space-y-3",children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Connection"}),s.jsx("h3",{children:"Domain authorization"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xe,{tone:"positive",children:"Connected"}),s.jsx(be,{size:"sm",variant:"ghost",onClick:Z,children:"Disconnect"})]})]}),$&&s.jsx("p",{className:"mb-3 text-xs text-rose-400",children:$}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-sm text-zinc-200",children:"Authorized for this project domain"}),s.jsx("span",{className:"text-xs text-zinc-500",children:r.domain})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Canonry stores Bing connections per canonical domain. This project is currently mapped to ",s.jsx("code",{children:r.siteUrl}),"."]})]}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Selected site"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.siteUrl})]}),s.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/20 p-3",children:[s.jsx("p",{className:"text-xs uppercase tracking-wide text-zinc-500",children:"Last auth update"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-200",children:r.updatedAt?aa(r.updatedAt):"—"})]})]})]})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Coverage"}),s.jsx("h3",{children:"Index monitoring"})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:u?.lastInspectedAt?`Last inspected ${aa(u.lastInspectedAt)}`:"No inspection history yet"})]}),s.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:I.map(M=>s.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${U===M.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>B(M.key),children:M.label},M.key))}),U==="coverage"&&u&&s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(cg,{label:"Indexed",value:u.summary.indexed,tone:"positive"}),s.jsx(cg,{label:"Not in index",value:u.summary.notIndexed+(u.summary.unknown??0),tone:"negative"}),s.jsx(cg,{label:"Status unknown",value:u.summary.unknown??0,tone:"neutral"}),s.jsx(cg,{label:"Coverage",value:`${u.summary.percentage}%`,tone:"neutral"})]}),u.notIndexed.length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[s.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Not Indexed (",u.notIndexed.length,")"]}),s.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:ye,children:_?"Submitting…":"Submit all to Bing"})]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"HTTP"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),s.jsx("tbody",{children:u.notIndexed.map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),s.jsx("td",{className:"py-1.5 px-3 text-right",children:s.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>oe(M.url),children:"Submit"})})]},M.id))})]})})]}),(u.unknown??[]).length>0&&s.jsxs("div",{children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[s.jsxs("h4",{className:"text-xs font-medium text-zinc-400",children:["Unknown — not yet confirmed (",(u.unknown??[]).length,")"]}),s.jsx(be,{size:"sm",variant:"ghost",disabled:_,onClick:ye,children:_?"Submitting…":"Submit all to Bing"})]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-20",children:"Action"})]})}),s.jsx("tbody",{children:(u.unknown??[]).map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?aa(M.lastCrawledDate):"—"}),s.jsx("td",{className:"py-1.5 px-3 text-right",children:s.jsx("button",{className:"text-[10px] text-zinc-400 hover:text-zinc-200 underline underline-offset-2",disabled:_,onClick:()=>oe(M.url),children:"Submit"})})]},M.id))})]})})]}),u.indexed.length>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",u.indexed.length,")"]}),s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Last Crawled"})]})}),s.jsx("tbody",{children:u.indexed.map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.lastCrawledDate?aa(M.lastCrawledDate):"—"})]},M.id))})]})})]})]}),U==="coverage"&&!u&&s.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),U==="inspections"&&s.jsxs("div",{className:"mt-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-col gap-2 lg:flex-row",children:[s.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:M=>S(M.target.value),onKeyDown:M=>M.key==="Enter"&&J()}),s.jsx(be,{size:"sm",disabled:!b.trim(),onClick:J,children:"Inspect"})]}),v&&s.jsxs("div",{className:"rounded border border-zinc-800 bg-zinc-900/40 p-3 text-xs space-y-1",children:[s.jsx("div",{className:"font-medium text-zinc-200",children:v.url}),s.jsxs("div",{className:"text-zinc-400",children:["In Index: ",s.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&&s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"URL"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-16",children:"Index"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-14",children:"HTTP"}),s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium w-32",children:"Inspected"})]})}),s.jsx("tbody",{children:f.map(M=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.url}),s.jsx("td",{className:"py-1.5 px-3",children:s.jsx(Xe,{tone:M.inIndex?"positive":"negative",children:M.inIndex?"Yes":"No"})}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:M.httpCode??"—"}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:aa(M.inspectedAt)})]},M.id))})]})})]}),U==="performance"&&s.jsx("div",{className:"mt-4",children:m.length===0?s.jsx("p",{className:"text-xs text-zinc-500",children:"No Bing performance data available."}):s.jsx("div",{className:"overflow-x-auto rounded-lg border border-zinc-800/60",children:s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800",children:[s.jsx("th",{className:"text-left py-1.5 px-3 text-zinc-500 font-medium",children:"Query"}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Km[To.Clicks]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Km[To.Impressions]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Km[To.CTR]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Km[To.Position]})]})}),s.jsx("tbody",{children:m.map((M,q)=>s.jsxs("tr",{className:"border-b border-zinc-800/50",children:[s.jsx("td",{className:"py-1.5 px-3 text-zinc-300 truncate max-w-[480px]",children:M.query}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:M.clicks}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.impressions}),s.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(M.ctr)?M.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:M.averagePosition.toFixed(1)})]},q))})]})})})]})]})}function b_e({projectName:e}){const t=xi(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[l,u]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,g]=x.useState(!1),[v,j]=x.useState(null),[b,S]=x.useState(null),[k,E]=x.useState(!1),[C,A]=x.useState(null),[P,O]=x.useState(null),[_,T]=x.useState(0);async function $(q=!1){q||a(!0),f(null);try{const[D,G,se]=await Promise.all([VN().catch(()=>null),t.fetchQuery({queryKey:qe.gsc.connections(e),queryFn:()=>z5(e).catch(()=>[]),staleTime:jr}),t.fetchQuery({queryKey:qe.bing.status(e),queryFn:()=>T5(e).catch(()=>null),staleTime:jr})]),ne=G.find(ee=>ee.connectionType==="gsc")??null;g(!!D?.google?.configured),E(!!D?.bing?.configured),j(ne),A(se);const[Ce,Se]=await Promise.all([ne?t.fetchQuery({queryKey:qe.gsc.coverage(e),queryFn:()=>QN(e).catch(()=>null),staleTime:jr}):Promise.resolve(null),se?.connected?t.fetchQuery({queryKey:qe.bing.coverage(e),queryFn:()=>WN(e).catch(()=>null),staleTime:jr}):Promise.resolve(null)]);S(Ce),O(Se)}catch(D){f(D instanceof Error?D.message:"Failed to load search console overview")}finally{a(!1)}}async function F(){if(l!=="idle")return;p.current?.abort();const q=new AbortController;p.current=q;const D=q.signal;u("syncing"),f(null);const G=[];try{async function se(){if(!v)return;const ee=await P5(e);if(!ee?.id)return;const pe=2e3,Y=Date.now()+12e4;for(;Date.now()<Y;){if(D.aborted||(await new Promise(Te=>setTimeout(Te,pe)),D.aborted))return;const He=await ec(ee.id).catch(()=>null);if(!He)break;if(["completed","failed","cancelled"].includes(He.status)){He.status!=="completed"&&G.push(`Google sync ${He.status}`);break}}}const ne=10;async function Ce(){if(!C?.connected)return;const ee=await R5(e).catch(()=>[]),pe=[...new Set(ee.map(Ee=>Ee.url))];if(pe.length!==0)for(let Ee=0;Ee<pe.length;Ee+=ne){if(D.aborted)return;const Y=pe.slice(Ee,Ee+ne),Te=(await Promise.allSettled(Y.map(at=>D5(e,at)))).filter(at=>at.status==="rejected").length;Te>0&&G.push(`${Te} Bing inspection(s) failed`)}}const Se=await Promise.allSettled([se(),Ce()]);for(const ee of Se)ee.status==="rejected"&&G.push(ee.reason instanceof Error?ee.reason.message:"Sync failed");if(D.aborted)return;u("reloading"),await Promise.all([t.invalidateQueries({queryKey:qe.gsc.project(e)}),t.invalidateQueries({queryKey:qe.bing.project(e)})]),await $(!0),T(ee=>ee+1),G.length>0&&f(`Partial refresh: ${G.join("; ")}`)}catch(se){D.aborted||f(se instanceof Error?se.message:"Refresh failed")}finally{D.aborted||u("idle")}}x.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const U=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",oe=P?`${P.summary.percentage}% indexed`:C?.connected?"Awaiting coverage":"No coverage data",ye=P?P.summary.notIndexed+(P.summary.unknown??0):0,I=P?`${ye} 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",M=P?.lastInspectedAt??C?.updatedAt??null;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search console"}),s.jsx("h2",{children:"Search Engine Intelligence"}),s.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."})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:i||l!=="idle",onClick:()=>{F()},children:i?"Loading…":l==="syncing"?"Refreshing Google & Bing…":l==="reloading"?"Reloading workspaces…":"Refresh all"})]}),d&&s.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}),s.jsxs("div",{className:"grid gap-3 lg:grid-cols-2",children:[s.jsx(UT,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":B,tone:i?"neutral":U,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")}),s.jsx(UT,{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…":oe,note:i?"Loading overview…":I,updatedAt:M,active:n==="bing",onClick:()=>r("bing")})]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-label":"Search engine workspaces",children:[["google","Google"],["bing","Bing"]].map(([q,D])=>s.jsx("button",{type:"button",role:"tab","aria-selected":n===q,className:`project-subnav-link ${n===q?"project-subnav-link-active":""}`,onClick:()=>r(q),children:D},q))}),n==="google"&&s.jsx(NEe,{projectName:e}),n==="bing"&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Search engine"}),s.jsx("h2",{children:"Bing Webmaster Tools"})]})}),s.jsx(x_e,{projectName:e,refreshNonce:_})]})]})}function w_e({insights:e}){const{openEvidence:t}=vd(),[n,r]=x.useState(null);return s.jsx("div",{className:"insight-list",children:e.map(i=>{const a=n===i.id,l=i.affectedPhrases.length>0;return s.jsxs("div",{children:[s.jsxs("div",{className:`insight-row insight-row-${i.tone} ${l?"cursor-pointer":""}`,onClick:l?()=>r(a?null:i.id):void 0,children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l&&s.jsx(Hh,{size:12,className:`shrink-0 text-zinc-500 transition-transform duration-150 ${a?"rotate-90":""}`}),s.jsx(Xe,{tone:i.tone,children:i.actionLabel}),s.jsx("span",{className:"text-sm font-medium text-zinc-100 truncate",children:i.title}),s.jsx("span",{className:"hidden sm:inline text-xs text-zinc-500 truncate",children:i.detail})]}),l&&s.jsxs("span",{className:"text-[11px] text-zinc-600 whitespace-nowrap",children:[i.affectedPhrases.length," phrase",i.affectedPhrases.length>1?"s":""]})]}),a&&s.jsx("div",{className:"divide-y divide-zinc-800/20",children:i.affectedPhrases.map((u,d)=>s.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 py-2 pl-9 bg-zinc-900/40",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(k1,{state:u.citationState}),s.jsx("span",{className:"text-sm text-zinc-200 truncate",children:u.query}),s.jsx("div",{className:"hidden sm:flex gap-1",children:u.provider&&s.jsx(nc,{provider:u.provider})})]}),u.evidenceId&&s.jsx("button",{type:"button",className:"text-xs text-zinc-400 hover:text-zinc-200 whitespace-nowrap transition-colors",onClick:f=>{f.stopPropagation(),t(u.evidenceId)},children:"View →"})]},u.evidenceId||`${i.id}-${d}`))})]},i.id)})})}function jp({tab:e}){const{projectId:t}=kv({from:"/projects/$projectId"}),n=Qo(),{dashboard:r,isLoading:i,refetch:a}=wc();if(!r||i)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-48"}),s.jsx("div",{className:"skeleton-text-sm w-32"})]}),s.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(je=>s.jsxs("div",{className:"page-skeleton-card flex flex-col items-center",children:[s.jsx("div",{className:"skeleton-circle size-20"}),s.jsx("div",{className:"skeleton-text w-16 mt-3"})]},je))}),s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-28"}),s.jsx("div",{className:"space-y-2 mt-2",children:[1,2,3,4].map(je=>s.jsx("div",{className:"skeleton-text-sm w-full"},je))})]})]});const l=qie(r,t),[u,d]=x.useState(!1),[f,p]=x.useState(!1),[m,g]=x.useState(!1),[v,j]=x.useState(""),[b,S]=x.useState(!1),[k,E]=x.useState(!1),[C,A]=x.useState(""),[P,O]=x.useState(!1),[_,T]=x.useState(!1),[$,F]=x.useState(""),[U,B]=x.useState(!1),[V,X]=x.useState(void 0),[Z,H]=x.useState(!1),[J,oe]=x.useState(null),[ye,I]=x.useState(!1),M=l?.visibilityEvidence??[],q=l?.project.name??"",D=l?.project.displayName||l?.project.name||q,G=JF(),se=(l?.recentRuns??[]).some(je=>je.kind===Pt["answer-visibility"]&&(je.status===hr.running||je.status===hr.queued)),ne=x.useMemo(()=>new Set(M.map(je=>je.location??"")),[M]),Ce=ne.has(""),Se=x.useMemo(()=>[...ne].filter(Boolean),[ne]);x.useEffect(()=>{if(V===void 0||V===""||!q){oe(null),I(!1);return}I(!0),E5(q,V).then(je=>{oe(je),I(!1)}).catch(()=>{oe(null),I(!1)})},[V,q]);const ee=x.useMemo(()=>{if(!J)return null;const je=new Map;for(const Ze of J){for(const[Rt,mt]of Object.entries(Ze.providerRuns??{}))je.set(`${Ze.query}::${Rt}`,mt.map(Je=>({runId:Je.runId,citationState:Je.citationState,createdAt:Je.createdAt,answerMentioned:Je.answerMentioned,visibilityState:Je.visibilityState,visibilityTransition:Je.visibilityTransition})));(!Ze.providerRuns||Object.keys(Ze.providerRuns).length===0)&&je.set(`${Ze.query}::`,Ze.runs.map(Rt=>({runId:Rt.runId,citationState:Rt.citationState,createdAt:Rt.createdAt,answerMentioned:Rt.answerMentioned,visibilityState:Rt.visibilityState,visibilityTransition:Rt.visibilityTransition})))}return je},[J]),pe=x.useMemo(()=>{const je=V!==void 0?M.filter(Ze=>V===""?!Ze.location:Ze.location===V):M;return ee?je.map(Ze=>{const Rt=ee.get(`${Ze.query}::${Ze.provider}`)??ee.get(`${Ze.query}::`);return Rt?{...Ze,runHistory:Rt}:Ze}):je},[M,V,ee]);if(!l)return s.jsx("div",{className:"page-container",children:s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h1",{children:"Project not found"}),s.jsxs("p",{children:['Could not find a project with ID "',t,'".']}),s.jsx(be,{asChild:!0,children:s.jsx(Yt,{to:"/",children:"Return to overview"})})]})});async function Ee(){try{await G.mutateAsync({projectName:q,projectLabel:D,sourceAction:"project-run"}),a()}catch{}}async function Y(){p(!0);try{await mV(q),vt({title:"Project deleted",detail:`${D} was removed.`,tone:"positive",dedupeKey:`project:delete:${q}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(je){console.error("Failed to delete project:",je)}finally{p(!1)}}async function He(){try{const je=await gV(q),Ze=typeof je=="string"?je:JSON.stringify(je,null,2),Rt=new Blob([Ze],{type:"text/yaml"}),mt=URL.createObjectURL(Rt),Je=document.createElement("a");Je.href=mt,Je.download=`${q}.yaml`,Je.click()}catch(je){vt({title:"Export failed",detail:je instanceof Error?je.message:"Could not export project YAML.",tone:"negative"})}}async function Te(){const je=v.split(`
|
|
293
|
+
`).map(Ze=>Ze.trim()).filter(Boolean);if(je.length!==0){S(!0);try{await cV(q,je),a(),j(""),g(!1)}finally{S(!1)}}}async function at(){const je=C.trim();if(je){O(!0);try{const Rt=(await O5(q)).map(Je=>Je.domain),mt=[...new Set([...Rt,je])];await _5(q,mt),a(),A(""),E(!1)}finally{O(!1)}}}async function Ve(){const je=$.trim();if(je){B(!0);try{const Ze=l?.project.ownedDomains??[];await j2(q,[...Ze,je]),a(),F(""),T(!1)}finally{B(!1)}}}async function Ht(je){B(!0);try{const Ze=l?.project.ownedDomains??[];await j2(q,Ze.filter(Rt=>Rt!==je)),a()}finally{B(!1)}}async function Lt(je,Ze){await uV(je,Ze),a()}const cn=je=>!Number.isNaN(Number.parseInt(je,10)),en=[{key:"overview",label:"Overview",href:`/projects/${l.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${l.project.id}/search-console`},{key:"traffic",label:"Traffic",href:`/projects/${l.project.id}/traffic`},{key:"report",label:"Report",href:`/projects/${l.project.id}/report`},{key:"inbound",label:"Inbound",href:`/projects/${l.project.id}/inbound`}];return s.jsxs("div",{className:"page-container",children:[u?s.jsxs($e,{className:"surface-card p-6 mb-6 border-rose-800/60",children:[s.jsx("h3",{className:"text-base font-semibold text-rose-400 mb-2",children:"Delete project?"}),s.jsxs("p",{className:"text-sm text-zinc-400 mb-4",children:["This will permanently delete ",s.jsx("strong",{className:"text-zinc-200",children:l.project.displayName||l.project.name})," and all its queries, competitors, runs, and snapshots. This cannot be undone."]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(be,{type:"button",variant:"destructive",disabled:f,onClick:Y,children:f?"Deleting...":"Yes, delete project"}),s.jsx(be,{type:"button",variant:"outline",disabled:f,onClick:()=>d(!1),children:"Cancel"})]})]}):null,s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:l.project.displayName||l.project.name}),s.jsxs("p",{className:"page-subtitle",children:[l.project.canonicalDomain,(l.project.ownedDomains??[]).length===0&&!_&&s.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>T(!0),children:"+ add domain"})," "," · ",l.contextLabel]}),s.jsxs("div",{className:"tag-row",children:[s.jsx("span",{className:"tag",children:l.project.country}),s.jsx("span",{className:"tag",children:l.project.language.toUpperCase()}),l.project.tags.map(je=>s.jsx("span",{className:"tag",children:je},je))]}),((l.project.ownedDomains??[]).length>0||_)&&s.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:"Also tracking"}),(l.project.ownedDomains??[]).map(je=>s.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:[je,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>Ht(je),"aria-label":`Remove ${je}`,children:"×"})]},je)),_?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.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:je=>F(je.target.value),onKeyDown:je=>je.key==="Enter"&&Ve(),autoFocus:!0}),s.jsx(be,{type:"button",size:"sm",disabled:!$.trim()||U,onClick:Ve,children:U?"...":"Add"}),s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{T(!1),F("")},children:"Cancel"})]}):s.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:()=>T(!0),children:"+ domain"})]})]}),s.jsxs("div",{className:"page-header-right",children:[s.jsx("p",{className:"text-sm text-zinc-500",children:l.dateRangeLabel}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:He,"aria-label":"Export project as YAML",children:s.jsx(Ov,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(be,{type:"button",variant:"outline",size:"icon",onClick:()=>d(!0),"aria-label":"Delete project",children:s.jsx(V5,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(be,{type:"button",disabled:G.isPending||se,onClick:Ee,children:G.isPending?"Starting…":se?"Sweep running…":"Run now"})]})]})]}),s.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:en.map(je=>s.jsx(Yt,{to:je.href,className:`project-subnav-link ${je.key===e?"project-subnav-link-active":""}`,"aria-current":je.key===e?"page":void 0,children:je.label},je.key))}),e==="overview"?s.jsxs(s.Fragment,{children:[s.jsxs("section",{className:"gauge-row",children:[s.jsx(Ade,{value:l.visibilitySummary.value,label:l.visibilitySummary.label,delta:l.visibilitySummary.delta,tone:l.visibilitySummary.tone,description:l.visibilitySummary.description,tooltip:l.visibilitySummary.tooltip,isNumeric:cn(l.visibilitySummary.value),progress:l.visibilitySummary.progress,providerCoverage:l.visibilitySummary.providerCoverage}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Gap Queries",s.jsx(pr,{text:"Tracked queries where competitors are cited in the latest completed visibility run but your domain is not."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:l.gapQueries.value}),s.jsxs("span",{className:"text-zinc-600",children:[" / ",l.queryCounts.total]})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.gapQueries.tone}`,style:{width:l.gapQueries.progress!==void 0?`${Math.min(Math.max(l.gapQueries.progress,0),100)}%`:"0%"}})}),s.jsx("p",{className:"metric-card-detail",children:l.gapQueries.delta}),s.jsx("p",{className:"metric-card-sub",children:l.gapQueries.description})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",s.jsx(pr,{text:"Percentage of inspected URLs that are currently indexed. Google Search Console is preferred when available, otherwise Bing Webmaster Tools is used."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:l.indexCoverage.value}),s.jsx("span",{className:"text-zinc-600",children:"%"})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${l.indexCoverage.tone}`,style:{width:`${Number.parseInt(l.indexCoverage.value,10)||0}%`}})}),s.jsx("p",{className:"metric-card-detail",children:l.indexCoverage.delta}),s.jsx("p",{className:"metric-card-sub",children:l.indexCoverage.description})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Since Last Run",s.jsx(pr,{text:"Query-level citation changes compared to the previous completed run."})]}),l.movementSummary.hasPreviousRun?s.jsxs("div",{className:"metric-card-movement",children:[s.jsxs("span",{className:l.movementSummary.gained>0?"text-emerald-400":"text-zinc-500",children:["+",l.movementSummary.gained," gained"]}),s.jsx("span",{className:"text-zinc-600 mx-1.5",children:"·"}),s.jsxs("span",{className:l.movementSummary.lost>0?"text-rose-400":"text-zinc-500",children:["−",l.movementSummary.lost," lost"]})]}):s.jsx("p",{className:"metric-card-movement text-zinc-500",children:"First run — no comparison yet"}),s.jsx("p",{className:"metric-card-sub mt-auto",children:l.movementSummary.gained===0&&l.movementSummary.lost===0&&l.movementSummary.hasPreviousRun?"No changes since last run":l.movementSummary.gained>l.movementSummary.lost?"Visibility improving":l.movementSummary.lost>l.movementSummary.gained?"Visibility declining":""})]})]}),s.jsx(_Ee,{projectName:l.project.name}),l.providerScores.length>1&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Model breakdown"}),s.jsxs("h2",{children:["Visibility by model ",s.jsx(pr,{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."})]})]})}),s.jsx("div",{className:"evidence-table-wrap",children:s.jsxs("table",{className:"evidence-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Model"}),s.jsx("th",{children:"Score"}),s.jsx("th",{children:"Cited queries"})]})}),s.jsx("tbody",{children:l.providerScores.map(je=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[s.jsx(nc,{provider:je.provider}),je.model&&s.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:je.model})]})}),s.jsx("td",{children:s.jsxs("span",{className:`font-semibold ${je.score>=70?"text-emerald-400":je.score>=40?"text-amber-400":"text-rose-400"}`,children:[je.score,"%"]})}),s.jsxs("td",{className:"text-zinc-500",children:[je.cited," of ",je.total]})]},`${je.provider}::${je.model??"unknown"}`))})]})})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"What changed"}),s.jsx("h2",{children:"Citation signals"})]})}),s.jsx(w_e,{insights:l.insights})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Visibility evidence"}),s.jsx("h2",{children:"Query citation tracking"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("p",{className:"supporting-copy",children:[new Set(l.visibilityEvidence.map(je=>je.query)).size," queries tracked"]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>g(!m),children:m?"Cancel":"+ Add queries"})]})]}),m&&s.jsxs("div",{className:"mb-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[s.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:je=>j(je.target.value)}),s.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[s.jsxs("p",{className:"text-xs text-zinc-500",children:[v.split(`
|
|
294
|
+
`).filter(je=>je.trim()).length," queries"]}),s.jsx(be,{type:"button",size:"sm",disabled:!v.trim()||b,onClick:Te,children:b?"Adding...":"Add queries"})]})]}),l.project.locations&&l.project.locations.length>0&&s.jsxs("div",{className:"filter-row mb-3",role:"toolbar","aria-label":"Location filters",children:[s.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"}),l.project.locations.map(je=>ne.has(je.label)&&s.jsx("button",{className:`filter-chip ${V===je.label?"filter-chip-active":""}`,type:"button","aria-pressed":V===je.label,onClick:()=>{X(je.label),H(!1)},children:je.label},je.label)),Ce&&s.jsx("button",{className:`filter-chip ${V===""?"filter-chip-active":""}`,type:"button","aria-pressed":V==="",onClick:()=>{X(""),H(!1)},children:"No location"}),Se.length>1&&V===void 0&&s.jsx("button",{className:`filter-chip filter-chip-compare ${Z?"filter-chip-active":""}`,type:"button","aria-pressed":Z,onClick:()=>H(je=>!je),title:"Side-by-side location comparison",children:"Compare"})]}),s.jsx(_de,{evidence:pe})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Competitors"}),s.jsx("h2",{children:"Competitive landscape"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("p",{className:"supporting-copy",children:[l.competitors.length," tracked"]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!k),children:k?"Cancel":"+ Add competitor"})]})]}),k&&s.jsxs("div",{className:"mb-3 flex gap-2 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3",children:[s.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:je=>A(je.target.value),onKeyDown:je=>je.key==="Enter"&&at()}),s.jsx(be,{type:"button",size:"sm",disabled:!C.trim()||P,onClick:at,children:P?"Adding...":"Add"})]}),s.jsx(zde,{competitors:l.competitors})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Run timeline"}),s.jsx("h2",{children:"Recent execution history"})]})}),s.jsx("div",{className:"run-list",children:l.recentRuns.map(je=>s.jsx(AB,{run:je},je.id))})]}),s.jsx(p_e,{project:{...l.project,displayName:l.project.displayName??l.project.name,defaultLocation:l.project.defaultLocation??null},onUpdateProject:Lt,onRefresh:()=>{a()}}),s.jsx(g_e,{projectName:l.project.name}),s.jsx(v_e,{projectName:l.project.name})]}):e==="report"?s.jsx(FEe,{projectName:l.project.name}):e==="traffic"?s.jsx(cEe,{projectName:l.project.name}):e==="inbound"?s.jsx(EEe,{projectName:l.project.name}):s.jsx(b_e,{projectName:l.project.name})]})}function j_e(){const{dashboard:e,isLoading:t}=wc(),n=xEe();if(!e||t)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-20"}),s.jsx("div",{className:"skeleton-text-sm w-72"})]}),s.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(d=>s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-3 flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1 space-y-1.5",children:[s.jsx("div",{className:"skeleton-text w-40"}),s.jsx("div",{className:"skeleton-text-sm w-56"})]}),s.jsx("div",{className:"skeleton h-5 w-16 rounded-full"})]},d))})]});const r=e.runs,[i,a]=x.useState("all"),l=i==="all"?r:r.filter(d=>d.status===i),u=async()=>{try{await n.mutateAsync(void 0)}catch{}};return s.jsxs("div",{className:"page-container",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Runs"}),s.jsx("p",{className:"page-subtitle",children:"Status, type, project, duration, and the shortest explanation that makes the outcome trustworthy."})]}),s.jsx(be,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{u()},children:n.isPending?"Queueing…":"Run all projects"})]}),s.jsxs("section",{children:[s.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Run filters",children:["all","queued","running","completed","partial","failed","cancelled"].map(d=>s.jsx("button",{className:`filter-chip ${i===d?"filter-chip-active":""}`,type:"button","aria-pressed":i===d,onClick:()=>a(d),children:d==="all"?"All runs":Tv(d)},d))}),s.jsx("div",{className:"run-list",children:l.length>0?l.map(d=>s.jsx(AB,{run:d},d.id)):s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h2",{children:"No runs match this filter"}),s.jsx("p",{children:"Try another status filter or queue a new run from a project command center."})]})})]})]})}function S_e({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,l]=x.useState(""),[u,d]=x.useState(""),[f,p]=x.useState(""),[m,g]=x.useState(""),[v,j]=x.useState(""),[b,S]=x.useState(""),[k,E]=x.useState(!1),[C,A]=x.useState(null),[P,O]=x.useState(!1),_=i?u.trim().length>0:a.trim().length>0;async function T(){if(_){E(!0),A(null),O(!1);try{const F=Z=>{const H=parseInt(Z.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},U={},B=F(m);B!==void 0&&(U.maxConcurrency=B);const V=F(v);V!==void 0&&(U.maxRequestsPerMinute=V);const X=F(b);X!==void 0&&(U.maxRequestsPerDay=X),await bV(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...u.trim()?{baseUrl:u.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(U).length>0?{quota:U}:{}}),l(""),d(""),p(""),g(""),j(""),S(""),O(!0),vt({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){A(F instanceof Error?F.message:"Failed to update provider")}finally{E(!1)}}}const $=n??"Use default model";return s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[i&&s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`base-url-${e}`,children:"Base URL"}),s.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:u,onChange:F=>d(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Any OpenAI-compatible endpoint — Ollama, LM Studio, llama.cpp, vLLM"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("label",{className:"text-xs text-zinc-500",htmlFor:`api-key-${e}`,children:["API Key",i?" (optional)":""]}),t&&s.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 ","↗"]})]}),s.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=>l(F.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:`model-${e}`,children:"Model (optional)"}),s.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)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",children:"Quota (optional)"}),s.jsxs("div",{className:"mt-0.5 grid grid-cols-3 gap-1.5",children:[s.jsxs("div",{children:[s.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=>g(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Max concurrent"})]}),s.jsxs("div",{children:[s.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=>j(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per minute"})]}),s.jsxs("div",{children:[s.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=>S(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),C&&s.jsx("p",{className:"text-xs text-rose-400",children:C}),P&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),s.jsx(be,{type:"button",size:"sm",disabled:!_||k,onClick:T,children:k?"Saving...":"Save"})]})}function N_e({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,l]=x.useState(!1),[u,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function g(){if(m){l(!0),d(null),p(!1);try{await wV({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),vt({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{l(!1)}}}return s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-id",children:"Client ID"}),s.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 ","↗"]})]}),s.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)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"google-client-secret",children:"Client secret"}),s.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)})]}),s.jsxs("p",{className:"text-[11px] text-zinc-500",children:["These credentials are stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Search Console connections are created separately per canonical domain."]}),u&&s.jsx("p",{className:"text-xs text-rose-400",children:u}),f&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),s.jsx(be,{type:"button",size:"sm",disabled:!m||a,onClick:g,children:a?"Saving...":"Save Google OAuth app"})]})}function k_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[l,u]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{N2().then(t).catch(g=>{const v=g instanceof Error?g.message:String(g);v.includes("501")||r(v)})},[]),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Browser provider"}),s.jsx("h2",{children:"ChatGPT (CDP)"})]}),s.jsx(Xe,{tone:e?.connected?"positive":"caution",children:e?.connected?"Connected":"Not connected"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[e?.endpoint&&s.jsxs("div",{children:[s.jsx("dt",{children:"Endpoint"}),s.jsx("dd",{className:"font-mono text-xs",children:e.endpoint})]}),e?.browserVersion&&s.jsxs("div",{children:[s.jsx("dt",{children:"Browser"}),s.jsx("dd",{className:"text-xs",children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&s.jsxs("div",{children:[s.jsx("dt",{children:"Tabs"}),s.jsx("dd",{children:e.targets.map(g=>s.jsxs("span",{className:"mr-2",children:[g.name,": ",g.alive?"● alive":"○ idle"]},g.name))})]})]}),s.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"}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>a(!i),children:i?"Cancel":e?.connected?"Update endpoint":"Configure"})}),i&&s.jsxs("form",{className:"mt-3 flex flex-col gap-2",onSubmit:async g=>{g.preventDefault(),m(!0);try{await HV(l,parseInt(d,10)||9222);const v=await N2().catch(()=>null);v&&t(v),a(!1),vt({title:"CDP endpoint saved",detail:`${l}:${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:[s.jsxs("div",{className:"flex gap-2",children:[s.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:l,onChange:g=>u(g.target.value),"aria-label":"CDP host"}),s.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:g=>f(g.target.value),"aria-label":"CDP port"})]}),s.jsx("div",{children:s.jsx(be,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const C_e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function A_e(){const e=Gh(),{dashboard:t}=wc(),n=t?.settings??e?.dashboard?.settings,a=Uv(!e,e?.health).data??e?.health??C_e,[l,u]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[g,v]=x.useState(""),[j,b]=x.useState(!1),[S,k]=x.useState(null),[E,C]=x.useState(!1);return n?s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Settings"}),s.jsx("p",{className:"page-subtitle",children:"Provider state, Google OAuth, Bing WMT setup, and service health."})]})}),s.jsxs("section",{className:"settings-grid",children:[n.providerStatuses.map(A=>s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Provider"}),s.jsx("h2",{children:A.displayName??A.name})]}),s.jsx(Xe,{tone:A.state==="ready"?"positive":"caution",children:A.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Model"}),s.jsx("dd",{className:"font-mono text-xs",children:A.model})]}),A.quota&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Concurrency"}),s.jsx("dd",{children:A.quota.maxConcurrency})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Rate limit"}),s.jsxs("dd",{children:[A.quota.maxRequestsPerMinute,"/min · ",A.quota.maxRequestsPerDay,"/day"]})]})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:A.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>u(l===A.name?null:A.name),children:l===A.name?"Cancel":A.state==="ready"?A.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===A.name&&s.jsx(S_e,{providerName:A.name,keyUrl:A.keyUrl,modelHint:A.modelHint,onSaved:()=>{u(null)}})]},A.name)),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Google"}),s.jsx("h2",{children:"Search Console OAuth"})]}),s.jsx(Xe,{tone:n.google.state==="ready"?"positive":"caution",children:n.google.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Auth model"}),s.jsx("dd",{children:"One app credential set, then one OAuth connection per project domain"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Storage"}),s.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.google.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>f(!d),children:d?"Cancel":n.google.state==="ready"?"Update OAuth app":"Configure Google OAuth"})}),d&&s.jsx(N_e,{onSaved:()=>{f(!1)}})]}),s.jsxs($e,{className:"surface-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Bing"}),s.jsx("h2",{children:"Webmaster Tools"})]}),s.jsx(Xe,{tone:n.bing.state==="ready"?"positive":"caution",children:n.bing.state==="ready"?"Ready":"Needs config"})]}),s.jsxs("dl",{className:"definition-list mt-3",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Auth model"}),s.jsx("dd",{children:"API key authentication — no OAuth needed"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Storage"}),s.jsx("dd",{className:"font-mono text-xs",children:"~/.canonry/config.yaml"})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:n.bing.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(be,{type:"button",variant:"outline",size:"sm",onClick:()=>m(!p),children:p?"Cancel":n.bing.state==="ready"?"Update API key":"Configure Bing"})}),p&&s.jsxs("div",{className:"mt-3 rounded-lg border border-zinc-800 bg-zinc-900/40 p-3 space-y-2",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-xs text-zinc-500",htmlFor:"bing-api-key",children:"API Key"}),s.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"})]}),s.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:g,onChange:A=>v(A.target.value)})]}),s.jsxs("p",{className:"text-[11px] text-zinc-500",children:["This key is stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"}),". Project-level Bing connections are created separately per canonical domain."]}),S&&s.jsx("p",{className:"text-xs text-rose-400",children:S}),E&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),s.jsx(be,{type:"button",size:"sm",disabled:!g.trim()||j,onClick:async()=>{if(g.trim()){b(!0),k(null),C(!1);try{await YV(g.trim()),v(""),C(!0),m(!1),vt({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(A){k(A instanceof Error?A.message:"Failed to update Bing API key")}finally{b(!1)}}},children:j?"Saving...":"Save Bing API key"})]})]}),s.jsx(k_e,{}),s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Service health"}),s.jsx("h2",{children:"API and worker"})]})}),s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"health-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:"API"}),s.jsx("p",{className:"supporting-copy",children:a.apiStatus.detail})]}),s.jsx(Xe,{tone:dy(a.apiStatus),title:Ho(a.apiStatus),children:a.apiStatus.state==="ok"?"Healthy":"Attention"})]}),s.jsxs("div",{className:"health-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:"Worker"}),s.jsx("p",{className:"supporting-copy",children:a.workerStatus.detail})]}),s.jsx(Xe,{tone:dy(a.workerStatus),title:Ho(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),s.jsx("section",{className:"page-section",children:s.jsxs($e,{className:"surface-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Self-host notes"}),s.jsx("h2",{children:"Operational guidance"})]})}),s.jsx("ul",{className:"detail-list",children:n.selfHostNotes.map(A=>s.jsx("li",{children:A},A))}),s.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const O_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_e({current:e,labels:t}){return s.jsx("div",{className:"setup-steps",role:"list","aria-label":"Setup progress",children:t.map((n,r)=>{const i=r<e,a=r===e;return s.jsxs("div",{className:`setup-step ${i?"setup-step-done":""} ${a?"setup-step-active":""}`,role:"listitem","aria-current":a?"step":void 0,children:[s.jsx("span",{className:"setup-step-number",children:i?"✓":r+1}),s.jsx("span",{className:"setup-step-label",children:n.label})]},n.label)})})}function __e(){const e=Gh(),{dashboard:t,isLoading:n,refetch:r}=wc(),i=t??e?.dashboard;if(!i||n)return s.jsxs("div",{className:"page-skeleton",children:[s.jsxs("div",{className:"page-skeleton-header",children:[s.jsx("div",{className:"skeleton-text h-6 w-24"}),s.jsx("div",{className:"skeleton-text-sm w-80"})]}),s.jsxs("div",{className:"page-skeleton-card",children:[s.jsx("div",{className:"skeleton-text w-32"}),s.jsx("div",{className:"space-y-3 mt-3",children:[1,2,3].map(fe=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-1 flex-1",children:[s.jsx("div",{className:"skeleton-text w-24"}),s.jsx("div",{className:"skeleton-text-sm w-48"})]}),s.jsx("div",{className:"skeleton h-6 w-16 rounded-full"})]},fe))})]})]});const a=i.settings,d=Uv(!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=$te(i.setup,d,a),p=Qo(),[m,g]=x.useState(0),[v,j]=x.useState(""),[b,S]=x.useState(""),[k,E]=x.useState(""),[C,A]=x.useState("US"),[P,O]=x.useState("en"),[_,T]=x.useState(!1),[$,F]=x.useState(null),[U,B]=x.useState(null),[V,X]=x.useState(null),[Z,H]=x.useState(!1),[J,oe]=x.useState(""),[ye,I]=x.useState(!1),[M,q]=x.useState(null),[D,G]=x.useState(!1),se=a.providerStatuses.filter(fe=>fe.state==="ready"),[ne,Ce]=x.useState(se[0]?.name??""),[Se,ee]=x.useState(5),[pe,Ee]=x.useState(!1),[Y,He]=x.useState(null),[Te,at]=x.useState(""),[Ve,Ht]=x.useState(!1),[Lt,cn]=x.useState(null),[en,je]=x.useState(!1),[Ze,Rt]=x.useState(!1),[mt,Je]=x.useState(!1),ce=JF(),Ne=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),Me=J.split(`
|
|
295
|
+
`).map(fe=>fe.trim()).filter(Boolean),Ge=Te.split(`
|
|
296
|
+
`).map(fe=>fe.trim()).filter(Boolean),pt=f.healthChecks.some(fe=>fe.id==="api"&&fe.state==="ready"),mn=async()=>{if(!(!Ne||!k)){H(!0),X(null);try{const fe=await Av(Ne,{displayName:b||v,canonicalDomain:k,country:C,language:P,autoExtractBacklinks:_});F(Ne),B(fe.id),vt({title:"Project created",detail:`${fe.displayName||fe.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${fe.name}`,dedupeMode:"drop"}),r(),g(2)}catch(fe){X(fe instanceof Error?fe.message:"Failed to create project")}finally{H(!1)}}},On=async()=>{if(!$)return;const fe=Me;if(fe.length!==0){G(!0),q(null);try{await lV($,fe),I(!0),r(),g(3)}catch(Qe){q(Qe instanceof Error?Qe.message:"Failed to save queries")}finally{G(!1)}}},gn=async()=>{if(!(!$||!ne)){Ee(!0),He(null);try{const fe=await OV($,ne,Se);if(fe.queries.length>0){const Qe=J?J.trimEnd()+`
|
|
297
|
+
`+fe.queries.join(`
|
|
298
|
+
`):fe.queries.join(`
|
|
299
|
+
`);oe(Qe)}}catch(fe){He(fe instanceof Error?fe.message:"Failed to generate queries")}finally{Ee(!1)}}},We=async()=>{if(!$)return;const fe=Ge;if(fe.length!==0){je(!0),cn(null);try{await _5($,fe),Ht(!0),r(),g(4)}catch(Qe){cn(Qe instanceof Error?Qe.message:"Failed to save competitors")}finally{je(!1)}}},Kt=async()=>{if($){Je(!0);try{await ce.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"}),Rt(!0),r()}catch{}finally{Je(!1)}}},de=()=>g(fe=>Math.max(0,fe-1)),ze=(()=>{switch(m){case 0:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsx("div",{className:"section-head",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),s.jsx("h2",{children:"System ready"})]})}),s.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),s.jsx("div",{className:"compact-stack",children:f.healthChecks.map(fe=>s.jsxs("div",{className:"health-check-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:fe.label}),s.jsx("p",{className:"supporting-copy",children:fe.detail}),fe.id==="provider"&&fe.state!=="ready"&&s.jsx(Yt,{to:"/settings",className:"text-emerald-400 hover:text-emerald-300 text-sm mt-1 underline underline-offset-2 cursor-pointer",children:"Configure providers"})]}),s.jsx(Xe,{tone:fe.state==="ready"?"positive":"caution",title:fe.id==="api"?Ho(d.apiStatus):fe.id==="worker"?Ho(d.workerStatus):fe.detail,children:fe.state==="ready"?"Ready":"Attention"})]},fe.id))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(be,{type:"button",disabled:!pt,onClick:()=>g(1),children:"Continue"})]})]});case 1:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),s.jsx("h2",{children:"Create project"})]}),$?s.jsx(Xe,{tone:"positive",children:"Created"}):null]}),$?s.jsxs("div",{className:"compact-stack",children:[s.jsxs("p",{className:"text-zinc-300",children:["Project ",s.jsx("span",{className:"text-zinc-100 font-medium",children:$})," created successfully."]}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",onClick:()=>g(2),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),s.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:v,onChange:fe=>j(fe.target.value)}),Ne&&Ne!==v?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",Ne]}):null]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),s.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:b,onChange:fe=>S(fe.target.value)})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),s.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:k,onChange:fe=>E(fe.target.value)})]}),s.jsxs("div",{className:"setup-field-row",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),s.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:C,onChange:fe=>A(fe.target.value.toUpperCase())})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),s.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:P,onChange:fe=>O(fe.target.value.toLowerCase())})]})]}),s.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:[s.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:_,onChange:fe=>T(fe.target.checked)}),s.jsxs("span",{className:"flex-1",children:[s.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),s.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."," ",s.jsx(Yt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),V?s.jsx("p",{className:"text-rose-400 text-sm",children:V}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",disabled:!Ne||!k||Z,onClick:mn,children:Z?"Creating...":"Create project"})]})]})]});case 2:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),s.jsx("h2",{children:"Add queries"})]}),ye?s.jsxs(Xe,{tone:"positive",children:[Me.length," saved"]}):s.jsxs(Xe,{tone:"neutral",children:[Me.length," quer",Me.length!==1?"ies":"y"]})]}),s.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),ye?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:Me.map(fe=>s.jsx("li",{children:fe},fe))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",onClick:()=>g(3),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[se.length>0?s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[s.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",s.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"setup-field flex-1",children:[s.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),s.jsx("select",{id:"gen-provider",className:"setup-input",value:ne,onChange:fe=>Ce(fe.target.value),children:se.map(fe=>s.jsxs("option",{value:fe.name,children:[fe.displayName??fe.name,fe.model?` (${fe.model})`:""]},fe.name))})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),s.jsx("select",{id:"gen-count",className:"setup-input",value:Se,onChange:fe=>ee(Number(fe.target.value)),children:[3,5,10,15,20].map(fe=>s.jsx("option",{value:fe,children:fe},fe))})]}),s.jsx(be,{type:"button",variant:"outline",disabled:pe||!ne,onClick:gn,children:pe?"Analyzing site...":"Generate"})]}),Y?s.jsx("p",{className:"text-rose-400 text-sm",children:Y}):null]}):null,s.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[s.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",s.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),s.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:fe=>oe(fe.target.value)})]}),M?s.jsx("p",{className:"text-rose-400 text-sm",children:M}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",disabled:Me.length===0||D,onClick:On,children:D?"Saving...":`Save ${Me.length} quer${Me.length!==1?"ies":"y"}`})]})]})]});case 3:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),s.jsx("h2",{children:"Add competitors"})]}),Ve?s.jsx(Xe,{tone:"positive",children:"Saved"}):null]}),s.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ve?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:Ge.map(fe=>s.jsx("li",{children:fe},fe))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",onClick:()=>g(4),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("div",{className:"setup-field",children:[s.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),s.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
302
|
+
competitor2.com`,value:Te,onChange:fe=>at(fe.target.value)})]}),Lt?s.jsx("p",{className:"text-rose-400 text-sm",children:Lt}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(be,{type:"button",variant:"outline",onClick:()=>g(4),children:"Skip"}),s.jsx(be,{type:"button",disabled:Ge.length===0||en,onClick:We,children:en?"Saving...":`Save ${Ge.length} competitor${Ge.length!==1?"s":""}`})]})]})]})]});case 4:return s.jsxs($e,{className:"surface-card step-card",children:[s.jsxs("div",{className:"section-head",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),s.jsx("h2",{children:"Launch first run"})]}),Ze?s.jsx(Xe,{tone:"positive",children:"Queued"}):null]}),Ze?s.jsxs("div",{className:"compact-stack",children:[s.jsx("p",{className:"text-zinc-300",children:"Visibility sweep has been queued. View progress on the project page."}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(be,{type:"button",onClick:()=>p({to:U?`/projects/${U}`:"/"}),children:"Open project"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",s.jsx("span",{className:"text-zinc-100 font-medium",children:$}),"."]}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(be,{type:"button",variant:"outline",onClick:de,children:"Back"}),s.jsx(be,{type:"button",disabled:mt,onClick:Kt,children:mt?"Launching...":"Launch visibility sweep"})]})]})]});default:return null}})();return s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Setup"}),s.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),s.jsx(E_e,{current:m,labels:O_e}),s.jsx("section",{className:"setup-wizard",children:ze})]})}function Nu({children:e,label:t="More info",placement:n="top",className:r}){const i=x.useId(),[a,l]=x.useState(!1);return s.jsxs("span",{className:`relative inline-flex ${r??""}`,children:[s.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:()=>l(!0),onMouseLeave:()=>l(!1),onFocus:()=>l(!0),onBlur:()=>l(!1),children:s.jsx(F5,{className:"h-3.5 w-3.5","aria-hidden":!0})}),a&&s.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 z_e="https://commoncrawl.org/web-graphs";function zS(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 _g(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 PS(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([]),[l,u]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[g,v]=x.useState(!1),[j,b]=x.useState(!1),[S,k]=x.useState(""),[E,C]=x.useState(!1),[A,P]=x.useState(null),[O,_]=x.useState(null),T=x.useCallback(async()=>{m(!0),P(null);try{const[V,X,Z,H,J]=await Promise.all([uQ(),I5().catch(()=>null),fQ().catch(()=>[]),pQ().catch(()=>[]),mQ().catch(()=>null)]);t(V),r(X),a(Z),u(H),f(J)}catch(V){P(V instanceof Error?V.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{T()},[T]);async function $(){v(!0),P(null),_(null);try{const V=await dQ();_(V.alreadyPresent?`DuckDB already installed (${V.version}).`:`Installed DuckDB ${V.version}.`),await T()}catch(V){P(V instanceof Error?V.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const V=S.trim()||void 0;b(!0),P(null),_(null);try{const X=await hQ(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 T()}catch(X){X instanceof ei&&X.code==="MISSING_DEPENDENCY"?P("DuckDB is not installed. Install it first."):P(X instanceof Error?X.message:"Failed to trigger sync")}finally{b(!1)}}async function U(V){P(null),_(null);try{await gQ(V),_(`Pruned cached release ${V}.`),await T()}catch(X){P(X instanceof Error?X.message:"Failed to prune release")}}const B=n?.status==="ready"&&l.every(V=>V.release!==n.release);return s.jsxs("div",{className:"page-container",children:[s.jsx("div",{className:"page-header",children:s.jsxs("div",{className:"page-header-left",children:[s.jsx("h1",{className:"page-title",children:"Backlinks"}),s.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."})]})}),s.jsx($e,{className:"surface-card p-4 mb-6 border-amber-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(iy,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"text-sm text-zinc-300 leading-relaxed",children:[s.jsx("p",{className:"font-medium text-amber-200",children:"Heads up — a release sync is a large download."}),s.jsxs("ul",{className:"mt-1.5 space-y-1 text-zinc-400",children:[s.jsxs("li",{children:[s.jsx("span",{className:"text-zinc-200",children:"~16 GB"})," of gzipped vertex + edge files per release, stored at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),"."]}),s.jsxs("li",{children:[s.jsx("span",{className:"text-zinc-200",children:"10–20 min on a fast connection"})," for the download, then ~5 min for the DuckDB query."]}),s.jsx("li",{children:"One sync covers every project in this workspace. Releases are immutable, so the download only happens once per release."})]})]})]})}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"About"}),s.jsx("h2",{children:"How it works"})]})}),s.jsxs($e,{className:"surface-card p-5",children:[s.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"," ",s.jsx("span",{className:"text-zinc-200",children:"release"})," at a time and extracts backlinks for every project in this workspace in a single pass."]}),s.jsxs("ol",{className:"space-y-3 text-sm text-zinc-400 max-w-3xl",children:[s.jsxs("li",{className:"flex gap-3",children:[s.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"}),s.jsxs("span",{children:[s.jsx("span",{className:"text-zinc-200 font-medium",children:"Download (one-time, ~16 GB)"})," — vertex + edge files cached to"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/"}),". Runs once per release; subsequent operations reuse the cache."]})]}),s.jsxs("li",{className:"flex gap-3",children:[s.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"}),s.jsxs("span",{children:[s.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 ",s.jsx("span",{className:"text-zinc-200",children:"read"})," these dumps; it doesn’t store any canonry state."]})]}),s.jsxs("li",{className:"flex gap-3",children:[s.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"}),s.jsxs("span",{children:[s.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."]})]})]})]})]}),A&&s.jsx($e,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:A})}),O&&s.jsx($e,{className:"surface-card p-4 mb-4 border-emerald-800/60",children:s.jsx("p",{className:"text-sm text-emerald-300",children:O})}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dependency"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["DuckDB install status",s.jsxs(Nu,{label:"Why DuckDB?",children:[s.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."}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["It does ",s.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."]}),s.jsxs("span",{className:"mt-2 block text-zinc-500",children:["Installed on demand (not bundled) into ",s.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?s.jsx(Xe,{tone:"positive",children:"Installed"}):s.jsx(Xe,{tone:"caution",children:"Not installed"})]}),s.jsx($e,{className:"surface-card p-5",children:p?s.jsx("p",{className:"text-sm text-zinc-500",children:"Checking…"}):e?.duckdbInstalled?s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(q5,{className:"h-5 w-5 text-emerald-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm text-zinc-200",children:["Version ",e.duckdbVersion??"unknown"," installed at"," ",s.jsx("code",{className:"text-zinc-300",children:e.pluginDir})]}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Required spec: ",e.duckdbSpec]})]})]}):s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(FQ,{className:"h-5 w-5 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"flex-1",children:[s.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."}),s.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&&s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Will be installed into ",s.jsx("code",{className:"text-zinc-300",children:e.pluginDir})," (~40 MB)."]}),s.jsx("div",{className:"mt-3",children:s.jsxs(be,{type:"button",size:"sm",disabled:g,onClick:$,children:[s.jsx(Ov,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),g?"Installing…":"Install DuckDB"]})})]})]})})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Latest sync"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Release sync",s.jsx(Nu,{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&&s.jsx(Xe,{tone:PS(n.status),children:n.status})]}),s.jsxs($e,{className:"surface-card p-5",children:[s.jsxs("p",{className:"text-xs text-zinc-500 max-w-3xl mb-4",children:["A release is one Common Crawl dump (e.g. ",s.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?s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{className:"text-zinc-200",children:["Release ",s.jsx("code",{className:"text-zinc-300",children:n.release})]}),n.phaseDetail&&s.jsx("p",{className:"text-zinc-500",children:n.phaseDetail}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-xs text-zinc-500 pt-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Projects"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.projectsProcessed??"—"})]}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-zinc-600 uppercase tracking-wide flex items-center gap-1",children:["Rows",s.jsx(Nu,{label:"What are rows?",children:"Total number of (project, referring domain) pairs persisted in SQLite from this sync, across every project in the workspace."})]}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:n.domainsDiscovered??"—"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Started"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:_g(n.downloadStartedAt??n.createdAt)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zinc-600 uppercase tracking-wide",children:"Finished"}),s.jsx("p",{className:"text-zinc-300 mt-0.5",children:_g(n.queryFinishedAt)})]})]}),n.error&&s.jsx("p",{className:"text-sm text-rose-400 pt-2",children:n.error})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No release sync has run in this workspace yet."}),B&&s.jsx("div",{className:"mt-4 rounded border border-amber-800/60 bg-amber-950/20 p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(iy,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5","aria-hidden":!0}),s.jsxs("div",{className:"text-xs text-zinc-300 leading-relaxed",children:[s.jsx("p",{className:"font-medium text-amber-200",children:"Cached files for this release are missing."}),s.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"," ",s.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."]})]})]})}),s.jsxs("div",{className:"mt-4 rounded border border-zinc-800 bg-zinc-900/40 p-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3 mb-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Auto-detected release"}),d?s.jsxs("p",{className:"text-sm text-zinc-200 mt-0.5",children:[s.jsx("code",{className:"text-zinc-100",children:d.release}),s.jsxs("span",{className:"ml-2 text-xs text-zinc-500",children:["— vertex ",zS(d.vertexBytes),", edges ",zS(d.edgesBytes)]})]}):s.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."}),s.jsxs("a",{href:z_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",s.jsx(YQ,{className:"h-3 w-3","aria-hidden":!0})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(be,{type:"button",size:"sm",disabled:j||!e?.duckdbInstalled||!d&&!S.trim(),onClick:F,children:[s.jsx(ry,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),j?"Queuing…":"Run sync"]}),s.jsxs(Nu,{label:"What does Run sync do?",children:[s.jsxs("span",{className:"block",children:["Downloads the auto-detected (or chosen) Common Crawl release (~16 GB) to"," ",s.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."]}),s.jsxs("span",{className:"mt-2 block text-zinc-400",children:["First time for a release: ",s.jsx("span",{className:"text-zinc-200",children:"~10–20 min download + ~5 min query"}),". Re-running the same release later: ",s.jsx("span",{className:"text-zinc-200",children:"skips download, just re-queries"})," (~5 min)."]})]})]})]}),E?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.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:S,onChange:V=>k(V.target.value),disabled:j,autoFocus:!0}),s.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:j,children:"Cancel"})]}):s.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:j,children:"Use a different release →"})]}),!e?.duckdbInstalled&&s.jsx("p",{className:"text-xs text-zinc-600 mt-2",children:"Install DuckDB first to enable sync."})]})]}),s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Cached releases"}),s.jsxs("h2",{className:"flex items-center gap-2",children:["Local disk cache",s.jsxs(Nu,{label:"What is this?",children:[s.jsxs("span",{className:"block",children:["Raw Common Crawl dumps stored at"," ",s.jsx("code",{className:"text-zinc-300",children:"~/.canonry/cache/commoncrawl/<release>/"}),". Each release takes ~16 GB."]}),s.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 ",s.jsx("span",{className:"text-zinc-200",children:"does not delete your backlink data"})," — that lives in SQLite."]})]})]})]})}),s.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."}),s.jsx($e,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Sync status"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Size"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Last used"}),s.jsx("th",{className:"px-4 py-2 font-medium sr-only",children:"Actions"})]})}),s.jsxs("tbody",{children:[l.map(V=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:s.jsx("code",{children:V.release})}),s.jsx("td",{className:"px-4 py-2",children:V.syncStatus?s.jsx(Xe,{tone:PS(V.syncStatus),children:V.syncStatus}):s.jsx("span",{className:"text-zinc-600",children:"—"})}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:zS(V.bytes)}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:_g(V.lastUsedAt)}),s.jsx("td",{className:"px-4 py-2 text-right",children:s.jsxs("div",{className:"inline-flex items-center gap-1",children:[s.jsxs(be,{type:"button",variant:"outline",size:"sm",onClick:()=>U(V.release),children:[s.jsx(V5,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),s.jsx(Nu,{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)),l.length===0&&s.jsx("tr",{children:s.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&&s.jsxs("section",{className:"page-section-divider",children:[s.jsx("div",{className:"section-head section-head-inline",children:s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"History"}),s.jsx("h2",{children:"Past release syncs"})]})}),s.jsx($e,{className:"surface-card overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zinc-800 text-left text-xs uppercase tracking-wide text-zinc-600",children:[s.jsx("th",{className:"px-4 py-2 font-medium",children:"Release"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Status"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Projects"}),s.jsx("th",{className:"px-4 py-2 text-right font-medium",children:"Rows"}),s.jsx("th",{className:"px-4 py-2 font-medium",children:"Finished"})]})}),s.jsx("tbody",{children:i.map(V=>s.jsxs("tr",{className:"border-b border-zinc-900 last:border-0",children:[s.jsx("td",{className:"px-4 py-2 text-zinc-200",children:s.jsx("code",{children:V.release})}),s.jsx("td",{className:"px-4 py-2",children:s.jsx(Xe,{tone:PS(V.status),children:V.status})}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.projectsProcessed??"—"}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:V.domainsDiscovered??"—"}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:_g(V.queryFinishedAt??V.updatedAt)})]},V.id))})]})})]})]})}function T_e(){return s.jsx("div",{className:"page-container",children:s.jsx("section",{className:"page-section",children:s.jsxs($e,{className:"surface-card empty-card",children:[s.jsx("h1",{children:"Route not found"}),s.jsx("p",{children:"The current path does not map to a dashboard view."}),s.jsx(be,{asChild:!0,children:s.jsx(Yt,{to:"/",children:"Return to overview"})})]})})})}function R_e(){return s.jsx(due,{children:s.jsx(uue,{})})}const Hi=BG()({component:R_e,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),D_e=ti({getParentRoute:()=>Hi,path:"/",component:pue,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length===0)throw MN({to:"/setup"})}}),M_e=ti({getParentRoute:()=>Hi,path:"/projects",component:Cde}),Rd=ti({getParentRoute:()=>Hi,path:"/projects/$projectId",component:()=>s.jsx(KN,{})}),I_e=ti({getParentRoute:()=>Rd,path:"/",component:()=>s.jsx(jp,{tab:"overview"})}),L_e=ti({getParentRoute:()=>Rd,path:"/search-console",component:()=>s.jsx(jp,{tab:"search-console"})}),$_e=ti({getParentRoute:()=>Rd,path:"/report",component:()=>s.jsx(jp,{tab:"report"})}),B_e=ti({getParentRoute:()=>Rd,path:"/traffic",component:()=>s.jsx(jp,{tab:"traffic"})}),U_e=ti({getParentRoute:()=>Rd,path:"/inbound",component:()=>s.jsx(jp,{tab:"inbound"})}),q_e=ti({getParentRoute:()=>Hi,path:"/runs",component:j_e}),F_e=ti({getParentRoute:()=>Hi,path:"/settings",component:A_e,beforeLoad:({context:e})=>{}}),H_e=ti({getParentRoute:()=>Hi,path:"/setup",component:__e,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(qe.projects.all);if(t&&t.length>0)throw MN({to:"/"})}}),K_e=ti({getParentRoute:()=>Hi,path:"/backlinks",component:P_e}),G_e=ti({getParentRoute:()=>Hi,path:"*",component:T_e}),V_e=Hi.addChildren([D_e,M_e,Rd.addChildren([I_e,L_e,$_e,B_e,U_e]),q_e,F_e,H_e,K_e,G_e]);function Q_e(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const BL=Q_e(),W_e=BL==="/"?"":BL.replace(/\/$/,"");function Y_e(e,t){return YG({routeTree:V_e,basepath:W_e||"/",context:{queryClient:e},...t?.initialEntries})}const a9=OQ(),Z_e=Y_e(a9),s9=document.getElementById("root");if(!s9)throw new Error("Expected #root element for web app bootstrap.");function X_e(){const[e,t]=x.useState(w2()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[l,u]=x.useState(null),[d,f]=x.useState(!1);x.useEffect(()=>{if(w2())return;let g=!1;return yV().then(v=>{g||(v.authenticated?t("ready"):t(v.setupRequired?"setup":"login"))}).catch(v=>{g||(u(v instanceof Error?v.message:"Failed to reach the Canonry API"),t("login"))}),()=>{g=!0}},[]);const p=async g=>{if(g.preventDefault(),!n.trim()||n.trim().length<8){u("Password must be at least 8 characters");return}if(n!==i){u("Passwords do not match");return}f(!0),u(null);try{if(!(await vV(n.trim())).authenticated){u("Setup failed");return}r(""),a(""),t("ready")}catch(v){u(v instanceof ei||v instanceof Error?v.message:"Setup failed")}finally{f(!1)}},m=async g=>{if(g.preventDefault(),!!n.trim()){f(!0),u(null);try{if(!(await xV(n.trim())).authenticated){u("Incorrect password");return}r(""),t("ready")}catch(v){u(v instanceof ei||v instanceof Error?v.message:"Authentication failed")}finally{f(!1)}}};return e==="ready"?s.jsx(QK,{client:a9,children:s.jsx(JG,{router:Z_e})}):s.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:s.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:s.jsx($e,{className:"surface-card w-full",children:e==="checking"?s.jsx(Lg,{className:"py-8",children:s.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?s.jsxs(s.Fragment,{children:[s.jsxs(g1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),s.jsx(y1,{children:"Create a dashboard password"}),s.jsx(v1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),s.jsx(Lg,{children:s.jsxs("form",{className:"space-y-4",onSubmit:p,children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),s.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:g=>r(g.target.value),placeholder:"At least 8 characters"})]}),s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),s.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:g=>a(g.target.value),placeholder:"Re-enter password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(be,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):s.jsxs(s.Fragment,{children:[s.jsxs(g1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),s.jsx(y1,{children:"Sign in to Canonry"}),s.jsx(v1,{children:"Enter your dashboard password to continue."})]}),s.jsx(Lg,{children:s.jsxs("form",{className:"space-y-4",onSubmit:m,children:[s.jsxs("label",{className:"block space-y-1.5",children:[s.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),s.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:g=>r(g.target.value),placeholder:"Dashboard password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(be,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})})]})})})})}SK.createRoot(s9).render(s.jsx(x.StrictMode,{children:s.jsx(X_e,{})}));
|