@ainyc/canonry 4.46.0 → 4.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agent-workspace/skills/aero/SKILL.md +5 -3
- package/assets/agent-workspace/skills/canonry/SKILL.md +55 -12
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +48 -12
- package/assets/agent-workspace/skills/canonry/references/server-side-traffic.md +32 -0
- package/assets/assets/{index-BVHV03Fk.css → index-BDMNXVHa.css} +1 -1
- package/assets/assets/index-CPUAzk7n.js +302 -0
- package/assets/index.html +2 -2
- package/dist/{chunk-Q7XFJO2V.js → chunk-4WXY57ET.js} +49 -3
- package/dist/{chunk-TBADB57G.js → chunk-M7MSNUNQ.js} +11 -7
- package/dist/{chunk-GRFMZ7PD.js → chunk-ON545FBK.js} +6 -2
- package/dist/{chunk-G2HQOLPK.js → chunk-WYBKCDUH.js} +132 -104
- package/dist/cli.js +35 -29
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-YFBVWCK2.js → intelligence-service-ADZRFCGO.js} +2 -2
- package/dist/mcp.js +8 -7
- package/package.json +8 -8
- package/assets/assets/index-CFKPcvOe.js +0 -302
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
function BK(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 Sa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hw={exports:{}},_f={};var H_;function UK(){if(H_)return _f;H_=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 c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:a}}return _f.Fragment=t,_f.jsx=n,_f.jsxs=n,_f}var K_;function qK(){return K_||(K_=1,hw.exports=UK()),hw.exports}var s=qK(),pw={exports:{}},ct={};var G_;function FK(){if(G_)return ct;G_=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"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function v(q){return q===null||typeof q!="object"?null:(q=y&&q[y]||q["@@iterator"],typeof q=="function"?q:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,j={};function k(q,I,D){this.props=q,this.context=I,this.refs=j,this.updater=D||w}k.prototype.isReactComponent={},k.prototype.setState=function(q,I){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,I,"setState")},k.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function E(){}E.prototype=k.prototype;function A(q,I,D){this.props=q,this.context=I,this.refs=j,this.updater=D||w}var C=A.prototype=new E;C.constructor=A,b(C,k.prototype),C.isPureReactComponent=!0;var _=Array.isArray;function O(){}var z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function $(q,I,D){var V=D.ref;return{$$typeof:e,type:q,key:I,ref:V!==void 0?V:null,props:D}}function F(q,I){return $(q.type,I,q.props)}function M(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function U(q){var I={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(D){return I[D]})}var K=/\/+/g;function Z(q,I){return typeof q=="object"&&q!==null&&q.key!=null?U(""+q.key):I.toString(36)}function Y(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(O,O):(q.status="pending",q.then(function(I){q.status==="pending"&&(q.status="fulfilled",q.value=I)},function(I){q.status==="pending"&&(q.status="rejected",q.reason=I)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function H(q,I,D,V,re){var ee=typeof q;(ee==="undefined"||ee==="boolean")&&(q=null);var Ee=!1;if(q===null)Ee=!0;else switch(ee){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(q.$$typeof){case e:case t:Ee=!0;break;case p:return Ee=q._init,H(Ee(q._payload),I,D,V,re)}}if(Ee)return re=re(q),Ee=V===""?"."+Z(q,0):V,_(re)?(D="",Ee!=null&&(D=Ee.replace(K,"$&/")+"/"),H(re,I,D,"",function(he){return he})):re!=null&&(M(re)&&(re=F(re,D+(re.key==null||q&&q.key===re.key?"":(""+re.key).replace(K,"$&/")+"/")+Ee)),I.push(re)),1;Ee=0;var Te=V===""?".":V+":";if(_(q))for(var ne=0;ne<q.length;ne++)V=q[ne],ee=Te+Z(V,ne),Ee+=H(V,I,D,ee,re);else if(ne=v(q),typeof ne=="function")for(q=ne.call(q),ne=0;!(V=q.next()).done;)V=V.value,ee=Te+Z(V,ne++),Ee+=H(V,I,D,ee,re);else if(ee==="object"){if(typeof q.then=="function")return H(Y(q),I,D,V,re);throw I=String(q),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function X(q,I,D){if(q==null)return q;var V=[],re=0;return H(q,V,"","",function(ee){return I.call(D,ee,re++)}),V}function ue(q){if(q._status===-1){var I=q._result;I=I(),I.then(function(D){(q._status===0||q._status===-1)&&(q._status=1,q._result=D)},function(D){(q._status===0||q._status===-1)&&(q._status=2,q._result=D)}),q._status===-1&&(q._status=0,q._result=I)}if(q._status===1)return q._result.default;throw q._result}var xe=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},L={map:X,forEach:function(q,I,D){X(q,function(){I.apply(this,arguments)},D)},count:function(q){var I=0;return X(q,function(){I++}),I},toArray:function(q){return X(q,function(I){return I})||[]},only:function(q){if(!M(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return ct.Activity=m,ct.Children=L,ct.Component=k,ct.Fragment=n,ct.Profiler=i,ct.PureComponent=A,ct.StrictMode=r,ct.Suspense=d,ct.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,ct.__COMPILER_RUNTIME={__proto__:null,c:function(q){return z.H.useMemoCache(q)}},ct.cache=function(q){return function(){return q.apply(null,arguments)}},ct.cacheSignal=function(){return null},ct.cloneElement=function(q,I,D){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var V=b({},q.props),re=q.key;if(I!=null)for(ee in I.key!==void 0&&(re=""+I.key),I)!R.call(I,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&I.ref===void 0||(V[ee]=I[ee]);var ee=arguments.length-2;if(ee===1)V.children=D;else if(1<ee){for(var Ee=Array(ee),Te=0;Te<ee;Te++)Ee[Te]=arguments[Te+2];V.children=Ee}return $(q.type,re,V)},ct.createContext=function(q){return q={$$typeof:l,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:a,_context:q},q},ct.createElement=function(q,I,D){var V,re={},ee=null;if(I!=null)for(V in I.key!==void 0&&(ee=""+I.key),I)R.call(I,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(re[V]=I[V]);var Ee=arguments.length-2;if(Ee===1)re.children=D;else if(1<Ee){for(var Te=Array(Ee),ne=0;ne<Ee;ne++)Te[ne]=arguments[ne+2];re.children=Te}if(q&&q.defaultProps)for(V in Ee=q.defaultProps,Ee)re[V]===void 0&&(re[V]=Ee[V]);return $(q,ee,re)},ct.createRef=function(){return{current:null}},ct.forwardRef=function(q){return{$$typeof:c,render:q}},ct.isValidElement=M,ct.lazy=function(q){return{$$typeof:p,_payload:{_status:-1,_result:q},_init:ue}},ct.memo=function(q,I){return{$$typeof:f,type:q,compare:I===void 0?null:I}},ct.startTransition=function(q){var I=z.T,D={};z.T=D;try{var V=q(),re=z.S;re!==null&&re(D,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(O,xe)}catch(ee){xe(ee)}finally{I!==null&&D.types!==null&&(I.types=D.types),z.T=I}},ct.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},ct.use=function(q){return z.H.use(q)},ct.useActionState=function(q,I,D){return z.H.useActionState(q,I,D)},ct.useCallback=function(q,I){return z.H.useCallback(q,I)},ct.useContext=function(q){return z.H.useContext(q)},ct.useDebugValue=function(){},ct.useDeferredValue=function(q,I){return z.H.useDeferredValue(q,I)},ct.useEffect=function(q,I){return z.H.useEffect(q,I)},ct.useEffectEvent=function(q){return z.H.useEffectEvent(q)},ct.useId=function(){return z.H.useId()},ct.useImperativeHandle=function(q,I,D){return z.H.useImperativeHandle(q,I,D)},ct.useInsertionEffect=function(q,I){return z.H.useInsertionEffect(q,I)},ct.useLayoutEffect=function(q,I){return z.H.useLayoutEffect(q,I)},ct.useMemo=function(q,I){return z.H.useMemo(q,I)},ct.useOptimistic=function(q,I){return z.H.useOptimistic(q,I)},ct.useReducer=function(q,I,D){return z.H.useReducer(q,I,D)},ct.useRef=function(q){return z.H.useRef(q)},ct.useState=function(q){return z.H.useState(q)},ct.useSyncExternalStore=function(q,I,D){return z.H.useSyncExternalStore(q,I,D)},ct.useTransition=function(){return z.H.useTransition()},ct.version="19.2.4",ct}var V_;function wd(){return V_||(V_=1,pw.exports=FK()),pw.exports}var x=wd();const Fi=Sa(x),kv=BK({__proto__:null,default:Fi},[x]);var mw={exports:{}},Tf={},gw={exports:{}},yw={};var Q_;function HK(){return Q_||(Q_=1,(function(e){function t(H,X){var ue=H.length;H.push(X);e:for(;0<ue;){var xe=ue-1>>>1,L=H[xe];if(0<i(L,X))H[xe]=X,H[ue]=L,ue=xe;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var X=H[0],ue=H.pop();if(ue!==X){H[0]=ue;e:for(var xe=0,L=H.length,q=L>>>1;xe<q;){var I=2*(xe+1)-1,D=H[I],V=I+1,re=H[V];if(0>i(D,ue))V<L&&0>i(re,D)?(H[xe]=re,H[V]=ue,xe=V):(H[xe]=D,H[I]=ue,xe=I);else if(V<L&&0>i(re,ue))H[xe]=re,H[V]=ue,xe=V;else break e}}return X}function i(H,X){var ue=H.sortIndex-X.sortIndex;return ue!==0?ue:H.id-X.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,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],f=[],p=1,m=null,y=3,v=!1,w=!1,b=!1,j=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function C(H){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=H)r(f),X.sortIndex=X.expirationTime,t(d,X);else break;X=n(f)}}function _(H){if(b=!1,C(H),!w)if(n(d)!==null)w=!0,O||(O=!0,U());else{var X=n(f);X!==null&&Y(_,X.startTime-H)}}var O=!1,z=-1,R=5,$=-1;function F(){return j?!0:!(e.unstable_now()-$<R)}function M(){if(j=!1,O){var H=e.unstable_now();$=H;var X=!0;try{e:{w=!1,b&&(b=!1,E(z),z=-1),v=!0;var ue=y;try{t:{for(C(H),m=n(d);m!==null&&!(m.expirationTime>H&&F());){var xe=m.callback;if(typeof xe=="function"){m.callback=null,y=m.priorityLevel;var L=xe(m.expirationTime<=H);if(H=e.unstable_now(),typeof L=="function"){m.callback=L,C(H),X=!0;break t}m===n(d)&&r(d),C(H)}else r(d);m=n(d)}if(m!==null)X=!0;else{var q=n(f);q!==null&&Y(_,q.startTime-H),X=!1}}break e}finally{m=null,y=ue,v=!1}X=void 0}}finally{X?U():O=!1}}}var U;if(typeof A=="function")U=function(){A(M)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,Z=K.port2;K.port1.onmessage=M,U=function(){Z.postMessage(null)}}else U=function(){k(M,0)};function Y(H,X){z=k(function(){H(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(H){switch(y){case 1:case 2:case 3:var X=3;break;default:X=y}var ue=y;y=X;try{return H()}finally{y=ue}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(H,X){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ue=y;y=H;try{return X()}finally{y=ue}},e.unstable_scheduleCallback=function(H,X,ue){var xe=e.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?xe+ue:xe):ue=xe,H){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=ue+L,H={id:p++,callback:X,priorityLevel:H,startTime:ue,expirationTime:L,sortIndex:-1},ue>xe?(H.sortIndex=ue,t(f,H),n(d)===null&&H===n(f)&&(b?(E(z),z=-1):b=!0,Y(_,ue-xe))):(H.sortIndex=L,t(d,H),w||v||(w=!0,O||(O=!0,U()))),H},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(H){var X=y;return function(){var ue=y;y=X;try{return H.apply(this,arguments)}finally{y=ue}}}})(yw)),yw}var Y_;function KK(){return Y_||(Y_=1,gw.exports=HK()),gw.exports}var vw={exports:{}},jr={};var W_;function GK(){if(W_)return jr;W_=1;var e=wd();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 c(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return jr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,jr.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)},jr.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()}},jr.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))},jr.prefetchDNS=function(d){typeof d=="string"&&r.d.D(d)},jr.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:v}):p==="script"&&r.d.X(d,{crossOrigin:m,integrity:y,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},jr.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=c(f.as,f.crossOrigin);r.d.M(d,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(d)},jr.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,m=c(p,f.crossOrigin);r.d.L(d,p,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},jr.preloadModule=function(d,f){if(typeof d=="string")if(f){var p=c(f.as,f.crossOrigin);r.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(d)},jr.requestFormReset=function(d){r.d.r(d)},jr.unstable_batchedUpdates=function(d,f){return d(f)},jr.useFormState=function(d,f,p){return l.H.useFormState(d,f,p)},jr.useFormStatus=function(){return l.H.useHostTransitionStatus()},jr.version="19.2.4",jr}var Z_;function d5(){if(Z_)return vw.exports;Z_=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(),vw.exports=GK(),vw.exports}var X_;function VK(){if(X_)return Tf;X_=1;var e=KK(),t=wd(),n=d5();function r(o){var u="https://react.dev/errors/"+o;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+o+"; visit "+u+" 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 u=o,h=o;if(o.alternate)for(;u.return;)u=u.return;else{o=u;do u=o,(u.flags&4098)!==0&&(h=u.return),o=u.return;while(o)}return u.tag===3?h:null}function l(o){if(o.tag===13){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function c(o){if(o.tag===31){var u=o.memoizedState;if(u===null&&(o=o.alternate,o!==null&&(u=o.memoizedState)),u!==null)return u.dehydrated}return null}function d(o){if(a(o)!==o)throw Error(r(188))}function f(o){var u=o.alternate;if(!u){if(u=a(o),u===null)throw Error(r(188));return u!==o?null:o}for(var h=o,g=u;;){var S=h.return;if(S===null)break;var N=S.alternate;if(N===null){if(g=S.return,g!==null){h=g;continue}break}if(S.child===N.child){for(N=S.child;N;){if(N===h)return d(S),o;if(N===g)return d(S),u;N=N.sibling}throw Error(r(188))}if(h.return!==g.return)h=S,g=N;else{for(var T=!1,B=S.child;B;){if(B===h){T=!0,h=S,g=N;break}if(B===g){T=!0,g=S,h=N;break}B=B.sibling}if(!T){for(B=N.child;B;){if(B===h){T=!0,h=N,g=S;break}if(B===g){T=!0,g=N,h=S;break}B=B.sibling}if(!T)throw Error(r(189))}}if(h.alternate!==g)throw Error(r(190))}if(h.tag!==3)throw Error(r(188));return h.stateNode.current===h?o:u}function p(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o;for(o=o.child;o!==null;){if(u=p(o),u!==null)return u;o=o.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function U(o){return o===null||typeof o!="object"?null:(o=M&&o[M]||o["@@iterator"],typeof o=="function"?o:null)}var K=Symbol.for("react.client.reference");function Z(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===K?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case b:return"Fragment";case k:return"Profiler";case j:return"StrictMode";case _:return"Suspense";case O:return"SuspenseList";case $:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case w:return"Portal";case A:return o.displayName||"Context";case E:return(o._context.displayName||"Context")+".Consumer";case C:var u=o.render;return o=o.displayName,o||(o=u.displayName||u.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case z:return u=o.displayName||null,u!==null?u:Z(o.type)||"Memo";case R:u=o._payload,o=o._init;try{return Z(o(u))}catch{}}return null}var Y=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},xe=[],L=-1;function q(o){return{current:o}}function I(o){0>L||(o.current=xe[L],xe[L]=null,L--)}function D(o,u){L++,xe[L]=o.current,o.current=u}var V=q(null),re=q(null),ee=q(null),Ee=q(null);function Te(o,u){switch(D(ee,u),D(re,o),D(V,null),u.nodeType){case 9:case 11:o=(o=u.documentElement)&&(o=o.namespaceURI)?h_(o):0;break;default:if(o=u.tagName,u=u.namespaceURI)u=h_(u),o=p_(u,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}I(V),D(V,o)}function ne(){I(V),I(re),I(ee)}function he(o){o.memoizedState!==null&&D(Ee,o);var u=V.current,h=p_(u,o.type);u!==h&&(D(re,o),D(V,h))}function je(o){re.current===o&&(I(V),I(re)),Ee.current===o&&(I(Ee),Af._currentValue=ue)}var me,tt;function Ie(o){if(me===void 0)try{throw Error()}catch(h){var u=h.stack.trim().match(/\n( *(at )?)/);me=u&&u[1]||"",tt=-1<h.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<h.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+me+o+tt}var Ze=!1;function nt(o,u){if(!o||Ze)return"";Ze=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(u){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(fe){var ce=fe}Reflect.construct(o,[],we)}else{try{we.call()}catch(fe){ce=fe}o.call(we.prototype)}}else{try{throw Error()}catch(fe){ce=fe}(we=o())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(fe){if(fe&&ce&&typeof fe.stack=="string")return[fe.stack,ce.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=g.DetermineComponentFrameRoot(),T=N[0],B=N[1];if(T&&B){var Q=T.split(`
|
|
4
|
+
`),oe=B.split(`
|
|
5
|
+
`);for(S=g=0;g<Q.length&&!Q[g].includes("DetermineComponentFrameRoot");)g++;for(;S<oe.length&&!oe[S].includes("DetermineComponentFrameRoot");)S++;if(g===Q.length||S===oe.length)for(g=Q.length-1,S=oe.length-1;1<=g&&0<=S&&Q[g]!==oe[S];)S--;for(;1<=g&&0<=S;g--,S--)if(Q[g]!==oe[S]){if(g!==1||S!==1)do if(g--,S--,0>S||Q[g]!==oe[S]){var ge=`
|
|
6
|
+
`+Q[g].replace(" at new "," at ");return o.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",o.displayName)),ge}while(1<=g&&0<=S);break}}}finally{Ze=!1,Error.prepareStackTrace=h}return(h=o?o.displayName||o.name:"")?Ie(h):""}function Wt(o,u){switch(o.tag){case 26:case 27:case 5:return Ie(o.type);case 16:return Ie("Lazy");case 13:return o.child!==u&&u!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return nt(o.type,!1);case 11:return nt(o.type.render,!1);case 1:return nt(o.type,!0);case 31:return Ie("Activity");default:return""}}function Se(o){try{var u="",h=null;do u+=Wt(o,h),h=o,o=o.return;while(o);return u}catch(g){return`
|
|
7
|
+
Error generating stack: `+g.message+`
|
|
8
|
+
`+g.stack}}var Re=Object.prototype.hasOwnProperty,Bt=e.unstable_scheduleCallback,cn=e.unstable_cancelCallback,un=e.unstable_shouldYield,Rr=e.unstable_requestPaint,Kt=e.unstable_now,vt=e.unstable_getCurrentPriorityLevel,de=e.unstable_ImmediatePriority,Ne=e.unstable_UserBlockingPriority,Ue=e.unstable_NormalPriority,it=e.unstable_LowPriority,lt=e.unstable_IdlePriority,mn=e.log,Kn=e.unstable_setDisableYieldValue,ae=null,Fe=null;function Qe(o){if(typeof mn=="function"&&Kn(o),Fe&&typeof Fe.setStrictMode=="function")try{Fe.setStrictMode(ae,o)}catch{}}var rt=Math.clz32?Math.clz32:ll,pt=Math.log,wn=Math.LN2;function ll(o){return o>>>=0,o===0?32:31-(pt(o)/wn|0)|0}var es=256,ia=262144,Rn=4194304;function Ce(o){var u=o&42;if(u!==0)return u;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 at(o,u,h){var g=o.pendingLanes;if(g===0)return 0;var S=0,N=o.suspendedLanes,T=o.pingedLanes;o=o.warmLanes;var B=g&134217727;return B!==0?(g=B&~N,g!==0?S=Ce(g):(T&=B,T!==0?S=Ce(T):h||(h=B&~o,h!==0&&(S=Ce(h))))):(B=g&~N,B!==0?S=Ce(B):T!==0?S=Ce(T):h||(h=g&~o,h!==0&&(S=Ce(h)))),S===0?0:u!==0&&u!==S&&(u&N)===0&&(N=S&-S,h=u&-u,N>=h||N===32&&(h&4194048)!==0)?u:S}function Je(o,u){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&u)===0}function Xe(o,u){switch(o){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mt(){var o=Rn;return Rn<<=1,(Rn&62914560)===0&&(Rn=4194304),o}function ke(o){for(var u=[],h=0;31>h;h++)u.push(o);return u}function Ye(o,u){o.pendingLanes|=u,u!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function Nt(o,u,h,g,S,N){var T=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 B=o.entanglements,Q=o.expirationTimes,oe=o.hiddenUpdates;for(h=T&~h;0<h;){var ge=31-rt(h),we=1<<ge;B[ge]=0,Q[ge]=-1;var ce=oe[ge];if(ce!==null)for(oe[ge]=null,ge=0;ge<ce.length;ge++){var fe=ce[ge];fe!==null&&(fe.lane&=-536870913)}h&=~we}g!==0&&aa(o,g,0),N!==0&&S===0&&o.tag!==0&&(o.suspendedLanes|=N&~(T&~u))}function aa(o,u,h){o.pendingLanes|=u,o.suspendedLanes&=~u;var g=31-rt(u);o.entangledLanes|=u,o.entanglements[g]=o.entanglements[g]|1073741824|h&261930}function sa(o,u){var h=o.entangledLanes|=u;for(o=o.entanglements;h;){var g=31-rt(h),S=1<<g;S&u|o[g]&u&&(o[g]|=u),h&=~S}}function cr(o,u){var h=u&-u;return h=(h&42)!==0?1:ts(h),(h&(o.suspendedLanes|u))!==0?0:h}function ts(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 Yr(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function ns(){var o=X.p;return o!==0?o:(o=window.event,o===void 0?32:I_(o.type))}function Dc(o,u){var h=X.p;try{return X.p=o,u()}finally{X.p=h}}var hi=Math.random().toString(36).slice(2),Dn="__reactFiber$"+hi,ur="__reactProps$"+hi,Gs="__reactContainer$"+hi,Vs="__reactEvents$"+hi,Ap="__reactListeners$"+hi,sx="__reactHandles$"+hi,Bd="__reactResources$"+hi,Qs="__reactMarker$"+hi;function Ud(o){delete o[Dn],delete o[ur],delete o[Vs],delete o[Ap],delete o[sx]}function Ys(o){var u=o[Dn];if(u)return u;for(var h=o.parentNode;h;){if(u=h[Gs]||h[Dn]){if(h=u.alternate,u.child!==null||h!==null&&h.child!==null)for(o=w_(o);o!==null;){if(h=o[Dn])return h;o=w_(o)}return u}o=h,h=o.parentNode}return null}function Ws(o){if(o=o[Dn]||o[Gs]){var u=o.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return o}return null}function cl(o){var u=o.tag;if(u===5||u===26||u===27||u===6)return o.stateNode;throw Error(r(33))}function rs(o){var u=o[Bd];return u||(u=o[Bd]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function G(o){o[Qs]=!0}var ze=new Set,bt={};function _t(o,u){Sn(o,u),Sn(o+"Capture",u)}function Sn(o,u){for(bt[o]=u,o=0;o<u.length;o++)ze.add(u[o])}var Aa=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]*$"),Dr={},is={};function Wr(o){return Re.call(is,o)?!0:Re.call(Dr,o)?!1:Aa.test(o)?is[o]=!0:(Dr[o]=!0,!1)}function Mc(o,u,h){if(Wr(u))if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":o.removeAttribute(u);return;case"boolean":var g=u.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){o.removeAttribute(u);return}}o.setAttribute(u,""+h)}}function oa(o,u,h){if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttribute(u,""+h)}}function Mr(o,u,h,g){if(g===null)o.removeAttribute(h);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(h);return}o.setAttributeNS(u,h,""+g)}}function dr(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function qd(o){var u=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function ox(o,u,h){var g=Object.getOwnPropertyDescriptor(o.constructor.prototype,u);if(!o.hasOwnProperty(u)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,N=g.set;return Object.defineProperty(o,u,{configurable:!0,get:function(){return S.call(this)},set:function(T){h=""+T,N.call(this,T)}}),Object.defineProperty(o,u,{enumerable:g.enumerable}),{getValue:function(){return h},setValue:function(T){h=""+T},stopTracking:function(){o._valueTracker=null,delete o[u]}}}}function Zs(o){if(!o._valueTracker){var u=qd(o)?"checked":"value";o._valueTracker=ox(o,u,""+o[u])}}function ul(o){if(!o)return!1;var u=o._valueTracker;if(!u)return!0;var h=u.getValue(),g="";return o&&(g=qd(o)?o.checked?"true":"false":o.value),o=g,o!==h?(u.setValue(o),!0):!1}function Ic(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 lx=/[\n"\\]/g;function kt(o){return o.replace(lx,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function pi(o,u,h,g,S,N,T,B){o.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?o.type=T:o.removeAttribute("type"),u!=null?T==="number"?(u===0&&o.value===""||o.value!=u)&&(o.value=""+dr(u)):o.value!==""+dr(u)&&(o.value=""+dr(u)):T!=="submit"&&T!=="reset"||o.removeAttribute("value"),u!=null?Oi(o,T,dr(u)):h!=null?Oi(o,T,dr(h)):g!=null&&o.removeAttribute("value"),S==null&&N!=null&&(o.defaultChecked=!!N),S!=null&&(o.checked=S&&typeof S!="function"&&typeof S!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?o.name=""+dr(B):o.removeAttribute("name")}function Ir(o,u,h,g,S,N,T,B){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(o.type=N),u!=null||h!=null){if(!(N!=="submit"&&N!=="reset"||u!=null)){Zs(o);return}h=h!=null?""+dr(h):"",u=u!=null?""+dr(u):h,B||u===o.value||(o.value=u),o.defaultValue=u}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,o.checked=B?o.checked:!!g,o.defaultChecked=!!g,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(o.name=T),Zs(o)}function Oi(o,u,h){u==="number"&&Ic(o.ownerDocument)===o||o.defaultValue===""+h||(o.defaultValue=""+h)}function la(o,u,h,g){if(o=o.options,u){u={};for(var S=0;S<h.length;S++)u["$"+h[S]]=!0;for(h=0;h<o.length;h++)S=u.hasOwnProperty("$"+o[h].value),o[h].selected!==S&&(o[h].selected=S),S&&g&&(o[h].defaultSelected=!0)}else{for(h=""+dr(h),u=null,S=0;S<o.length;S++){if(o[S].value===h){o[S].selected=!0,g&&(o[S].defaultSelected=!0);return}u!==null||o[S].disabled||(u=o[S])}u!==null&&(u.selected=!0)}}function lE(o,u,h){if(u!=null&&(u=""+dr(u),u!==o.value&&(o.value=u),h==null)){o.defaultValue!==u&&(o.defaultValue=u);return}o.defaultValue=h!=null?""+dr(h):""}function cE(o,u,h,g){if(u==null){if(g!=null){if(h!=null)throw Error(r(92));if(Y(g)){if(1<g.length)throw Error(r(93));g=g[0]}h=g}h==null&&(h=""),u=h}h=dr(u),o.defaultValue=h,g=o.textContent,g===h&&g!==""&&g!==null&&(o.value=g),Zs(o)}function Lc(o,u){if(u){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=u;return}}o.textContent=u}var D9=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 uE(o,u,h){var g=u.indexOf("--")===0;h==null||typeof h=="boolean"||h===""?g?o.setProperty(u,""):u==="float"?o.cssFloat="":o[u]="":g?o.setProperty(u,h):typeof h!="number"||h===0||D9.has(u)?u==="float"?o.cssFloat=h:o[u]=(""+h).trim():o[u]=h+"px"}function dE(o,u,h){if(u!=null&&typeof u!="object")throw Error(r(62));if(o=o.style,h!=null){for(var g in h)!h.hasOwnProperty(g)||u!=null&&u.hasOwnProperty(g)||(g.indexOf("--")===0?o.setProperty(g,""):g==="float"?o.cssFloat="":o[g]="");for(var S in u)g=u[S],u.hasOwnProperty(S)&&h[S]!==g&&uE(o,S,g)}else for(var N in u)u.hasOwnProperty(N)&&uE(o,N,u[N])}function cx(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 M9=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"]]),I9=/^[\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 I9.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}function as(){}var ux=null;function dx(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var $c=null,Bc=null;function fE(o){var u=Ws(o);if(u&&(o=u.stateNode)){var h=o[ur]||null;e:switch(o=u.stateNode,u.type){case"input":if(pi(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name),u=h.name,h.type==="radio"&&u!=null){for(h=o;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll('input[name="'+kt(""+u)+'"][type="radio"]'),u=0;u<h.length;u++){var g=h[u];if(g!==o&&g.form===o.form){var S=g[ur]||null;if(!S)throw Error(r(90));pi(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(u=0;u<h.length;u++)g=h[u],g.form===o.form&&ul(g)}break e;case"textarea":lE(o,h.value,h.defaultValue);break e;case"select":u=h.value,u!=null&&la(o,!!h.multiple,u,!1)}}}var fx=!1;function hE(o,u,h){if(fx)return o(u,h);fx=!0;try{var g=o(u);return g}finally{if(fx=!1,($c!==null||Bc!==null)&&(mm(),$c&&(u=$c,o=Bc,Bc=$c=null,fE(u),o)))for(u=0;u<o.length;u++)fE(o[u])}}function Fd(o,u){var h=o.stateNode;if(h===null)return null;var g=h[ur]||null;if(g===null)return null;h=g[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(o=o.type,g=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!g;break e;default:o=!1}if(o)return null;if(h&&typeof h!="function")throw Error(r(231,u,typeof h));return h}var ss=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hx=!1;if(ss)try{var Hd={};Object.defineProperty(Hd,"passive",{get:function(){hx=!0}}),window.addEventListener("test",Hd,Hd),window.removeEventListener("test",Hd,Hd)}catch{hx=!1}var Xs=null,px=null,Op=null;function pE(){if(Op)return Op;var o,u=px,h=u.length,g,S="value"in Xs?Xs.value:Xs.textContent,N=S.length;for(o=0;o<h&&u[o]===S[o];o++);var T=h-o;for(g=1;g<=T&&u[h-g]===S[N-g];g++);return Op=S.slice(o,1<g?1-g:void 0)}function zp(o){var u=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&u===13&&(o=13)):o=u,o===10&&(o=13),32<=o||o===13?o:0}function _p(){return!0}function mE(){return!1}function Zr(o){function u(h,g,S,N,T){this._reactName=h,this._targetInst=S,this.type=g,this.nativeEvent=N,this.target=T,this.currentTarget=null;for(var B in o)o.hasOwnProperty(B)&&(h=o[B],this[B]=h?h(N):N[B]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?_p:mE,this.isPropagationStopped=mE,this}return m(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=_p)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=_p)},persist:function(){},isPersistent:_p}),u}var dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tp=Zr(dl),Kd=m({},dl,{view:0,detail:0}),L9=Zr(Kd),mx,gx,Gd,Pp=m({},Kd,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vx,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!==Gd&&(Gd&&o.type==="mousemove"?(mx=o.screenX-Gd.screenX,gx=o.screenY-Gd.screenY):gx=mx=0,Gd=o),mx)},movementY:function(o){return"movementY"in o?o.movementY:gx}}),gE=Zr(Pp),$9=m({},Pp,{dataTransfer:0}),B9=Zr($9),U9=m({},Kd,{relatedTarget:0}),yx=Zr(U9),q9=m({},dl,{animationName:0,elapsedTime:0,pseudoElement:0}),F9=Zr(q9),H9=m({},dl,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),K9=Zr(H9),G9=m({},dl,{data:0}),yE=Zr(G9),V9={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q9={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"},Y9={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function W9(o){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(o):(o=Y9[o])?!!u[o]:!1}function vx(){return W9}var Z9=m({},Kd,{key:function(o){if(o.key){var u=V9[o.key]||o.key;if(u!=="Unidentified")return u}return o.type==="keypress"?(o=zp(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?Q9[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vx,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}}),X9=Zr(Z9),J9=m({},Pp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vE=Zr(J9),eH=m({},Kd,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vx}),tH=Zr(eH),nH=m({},dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),rH=Zr(nH),iH=m({},Pp,{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}),aH=Zr(iH),sH=m({},dl,{newState:0,oldState:0}),oH=Zr(sH),lH=[9,13,27,32],xx=ss&&"CompositionEvent"in window,Vd=null;ss&&"documentMode"in document&&(Vd=document.documentMode);var cH=ss&&"TextEvent"in window&&!Vd,xE=ss&&(!xx||Vd&&8<Vd&&11>=Vd),bE=" ",wE=!1;function SE(o,u){switch(o){case"keyup":return lH.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jE(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Uc=!1;function uH(o,u){switch(o){case"compositionend":return jE(u);case"keypress":return u.which!==32?null:(wE=!0,bE);case"textInput":return o=u.data,o===bE&&wE?null:o;default:return null}}function dH(o,u){if(Uc)return o==="compositionend"||!xx&&SE(o,u)?(o=pE(),Op=px=Xs=null,Uc=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return xE&&u.locale!=="ko"?null:u.data;default:return null}}var fH={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 NE(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u==="input"?!!fH[o.type]:u==="textarea"}function kE(o,u,h,g){$c?Bc?Bc.push(g):Bc=[g]:$c=g,u=Sm(u,"onChange"),0<u.length&&(h=new Tp("onChange","change",null,h,g),o.push({event:h,listeners:u}))}var Qd=null,Yd=null;function hH(o){o_(o,0)}function Rp(o){var u=cl(o);if(ul(u))return o}function CE(o,u){if(o==="change")return u}var AE=!1;if(ss){var bx;if(ss){var wx="oninput"in document;if(!wx){var EE=document.createElement("div");EE.setAttribute("oninput","return;"),wx=typeof EE.oninput=="function"}bx=wx}else bx=!1;AE=bx&&(!document.documentMode||9<document.documentMode)}function OE(){Qd&&(Qd.detachEvent("onpropertychange",zE),Yd=Qd=null)}function zE(o){if(o.propertyName==="value"&&Rp(Yd)){var u=[];kE(u,Yd,o,dx(o)),hE(hH,u)}}function pH(o,u,h){o==="focusin"?(OE(),Qd=u,Yd=h,Qd.attachEvent("onpropertychange",zE)):o==="focusout"&&OE()}function mH(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Rp(Yd)}function gH(o,u){if(o==="click")return Rp(u)}function yH(o,u){if(o==="input"||o==="change")return Rp(u)}function vH(o,u){return o===u&&(o!==0||1/o===1/u)||o!==o&&u!==u}var mi=typeof Object.is=="function"?Object.is:vH;function Wd(o,u){if(mi(o,u))return!0;if(typeof o!="object"||o===null||typeof u!="object"||u===null)return!1;var h=Object.keys(o),g=Object.keys(u);if(h.length!==g.length)return!1;for(g=0;g<h.length;g++){var S=h[g];if(!Re.call(u,S)||!mi(o[S],u[S]))return!1}return!0}function _E(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function TE(o,u){var h=_E(o);o=0;for(var g;h;){if(h.nodeType===3){if(g=o+h.textContent.length,o<=u&&g>=u)return{node:h,offset:u-o};o=g}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=_E(h)}}function PE(o,u){return o&&u?o===u?!0:o&&o.nodeType===3?!1:u&&u.nodeType===3?PE(o,u.parentNode):"contains"in o?o.contains(u):o.compareDocumentPosition?!!(o.compareDocumentPosition(u)&16):!1:!1}function RE(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var u=Ic(o.document);u instanceof o.HTMLIFrameElement;){try{var h=typeof u.contentWindow.location.href=="string"}catch{h=!1}if(h)o=u.contentWindow;else break;u=Ic(o.document)}return u}function Sx(o){var u=o&&o.nodeName&&o.nodeName.toLowerCase();return u&&(u==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||u==="textarea"||o.contentEditable==="true")}var xH=ss&&"documentMode"in document&&11>=document.documentMode,qc=null,jx=null,Zd=null,Nx=!1;function DE(o,u,h){var g=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Nx||qc==null||qc!==Ic(g)||(g=qc,"selectionStart"in g&&Sx(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Zd&&Wd(Zd,g)||(Zd=g,g=Sm(jx,"onSelect"),0<g.length&&(u=new Tp("onSelect","select",null,u,h),o.push({event:u,listeners:g}),u.target=qc)))}function fl(o,u){var h={};return h[o.toLowerCase()]=u.toLowerCase(),h["Webkit"+o]="webkit"+u,h["Moz"+o]="moz"+u,h}var Fc={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionrun:fl("Transition","TransitionRun"),transitionstart:fl("Transition","TransitionStart"),transitioncancel:fl("Transition","TransitionCancel"),transitionend:fl("Transition","TransitionEnd")},kx={},ME={};ss&&(ME=document.createElement("div").style,"AnimationEvent"in window||(delete Fc.animationend.animation,delete Fc.animationiteration.animation,delete Fc.animationstart.animation),"TransitionEvent"in window||delete Fc.transitionend.transition);function hl(o){if(kx[o])return kx[o];if(!Fc[o])return o;var u=Fc[o],h;for(h in u)if(u.hasOwnProperty(h)&&h in ME)return kx[o]=u[h];return o}var IE=hl("animationend"),LE=hl("animationiteration"),$E=hl("animationstart"),bH=hl("transitionrun"),wH=hl("transitionstart"),SH=hl("transitioncancel"),BE=hl("transitionend"),UE=new Map,Cx="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(" ");Cx.push("scrollEnd");function ca(o,u){UE.set(o,u),_t(u,[o])}var Dp=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=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(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},zi=[],Hc=0,Ax=0;function Mp(){for(var o=Hc,u=Ax=Hc=0;u<o;){var h=zi[u];zi[u++]=null;var g=zi[u];zi[u++]=null;var S=zi[u];zi[u++]=null;var N=zi[u];if(zi[u++]=null,g!==null&&S!==null){var T=g.pending;T===null?S.next=S:(S.next=T.next,T.next=S),g.pending=S}N!==0&&qE(h,S,N)}}function Ip(o,u,h,g){zi[Hc++]=o,zi[Hc++]=u,zi[Hc++]=h,zi[Hc++]=g,Ax|=g,o.lanes|=g,o=o.alternate,o!==null&&(o.lanes|=g)}function Ex(o,u,h,g){return Ip(o,u,h,g),Lp(o)}function pl(o,u){return Ip(o,null,null,u),Lp(o)}function qE(o,u,h){o.lanes|=h;var g=o.alternate;g!==null&&(g.lanes|=h);for(var S=!1,N=o.return;N!==null;)N.childLanes|=h,g=N.alternate,g!==null&&(g.childLanes|=h),N.tag===22&&(o=N.stateNode,o===null||o._visibility&1||(S=!0)),o=N,N=N.return;return o.tag===3?(N=o.stateNode,S&&u!==null&&(S=31-rt(h),o=N.hiddenUpdates,g=o[S],g===null?o[S]=[u]:g.push(u),u.lane=h|536870912),N):null}function Lp(o){if(50<bf)throw bf=0,Ib=null,Error(r(185));for(var u=o.return;u!==null;)o=u,u=o.return;return o.tag===3?o.stateNode:null}var Kc={};function jH(o,u,h,g){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=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gi(o,u,h,g){return new jH(o,u,h,g)}function Ox(o){return o=o.prototype,!(!o||!o.isReactComponent)}function os(o,u){var h=o.alternate;return h===null?(h=gi(o.tag,u,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=u,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,u=o.dependencies,h.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h.refCleanup=o.refCleanup,h}function FE(o,u){o.flags&=65011714;var h=o.alternate;return h===null?(o.childLanes=0,o.lanes=u,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,u=h.dependencies,o.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),o}function $p(o,u,h,g,S,N){var T=0;if(g=o,typeof o=="function")Ox(o)&&(T=1);else if(typeof o=="string")T=EK(o,h,V.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case $:return o=gi(31,h,u,S),o.elementType=$,o.lanes=N,o;case b:return ml(h.children,S,N,u);case j:T=8,S|=24;break;case k:return o=gi(12,h,u,S|2),o.elementType=k,o.lanes=N,o;case _:return o=gi(13,h,u,S),o.elementType=_,o.lanes=N,o;case O:return o=gi(19,h,u,S),o.elementType=O,o.lanes=N,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case A:T=10;break e;case E:T=9;break e;case C:T=11;break e;case z:T=14;break e;case R:T=16,g=null;break e}T=29,h=Error(r(130,o===null?"null":typeof o,"")),g=null}return u=gi(T,h,u,S),u.elementType=o,u.type=g,u.lanes=N,u}function ml(o,u,h,g){return o=gi(7,o,g,u),o.lanes=h,o}function zx(o,u,h){return o=gi(6,o,null,u),o.lanes=h,o}function HE(o){var u=gi(18,null,null,0);return u.stateNode=o,u}function _x(o,u,h){return u=gi(4,o.children!==null?o.children:[],o.key,u),u.lanes=h,u.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},u}var KE=new WeakMap;function _i(o,u){if(typeof o=="object"&&o!==null){var h=KE.get(o);return h!==void 0?h:(u={value:o,source:u,stack:Se(u)},KE.set(o,u),u)}return{value:o,source:u,stack:Se(u)}}var Gc=[],Vc=0,Bp=null,Xd=0,Ti=[],Pi=0,Js=null,Ea=1,Oa="";function ls(o,u){Gc[Vc++]=Xd,Gc[Vc++]=Bp,Bp=o,Xd=u}function GE(o,u,h){Ti[Pi++]=Ea,Ti[Pi++]=Oa,Ti[Pi++]=Js,Js=o;var g=Ea;o=Oa;var S=32-rt(g)-1;g&=~(1<<S),h+=1;var N=32-rt(u)+S;if(30<N){var T=S-S%5;N=(g&(1<<T)-1).toString(32),g>>=T,S-=T,Ea=1<<32-rt(u)+S|h<<S|g,Oa=N+o}else Ea=1<<N|h<<S|g,Oa=o}function Tx(o){o.return!==null&&(ls(o,1),GE(o,1,0))}function Px(o){for(;o===Bp;)Bp=Gc[--Vc],Gc[Vc]=null,Xd=Gc[--Vc],Gc[Vc]=null;for(;o===Js;)Js=Ti[--Pi],Ti[Pi]=null,Oa=Ti[--Pi],Ti[Pi]=null,Ea=Ti[--Pi],Ti[Pi]=null}function VE(o,u){Ti[Pi++]=Ea,Ti[Pi++]=Oa,Ti[Pi++]=Js,Ea=u.id,Oa=u.overflow,Js=o}var fr=null,rn=null,Tt=!1,eo=null,Ri=!1,Rx=Error(r(519));function to(o){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Jd(_i(u,o)),Rx}function QE(o){var u=o.stateNode,h=o.type,g=o.memoizedProps;switch(u[Dn]=o,u[ur]=g,h){case"dialog":At("cancel",u),At("close",u);break;case"iframe":case"object":case"embed":At("load",u);break;case"video":case"audio":for(h=0;h<Sf.length;h++)At(Sf[h],u);break;case"source":At("error",u);break;case"img":case"image":case"link":At("error",u),At("load",u);break;case"details":At("toggle",u);break;case"input":At("invalid",u),Ir(u,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":At("invalid",u);break;case"textarea":At("invalid",u),cE(u,g.value,g.defaultValue,g.children)}h=g.children,typeof h!="string"&&typeof h!="number"&&typeof h!="bigint"||u.textContent===""+h||g.suppressHydrationWarning===!0||d_(u.textContent,h)?(g.popover!=null&&(At("beforetoggle",u),At("toggle",u)),g.onScroll!=null&&At("scroll",u),g.onScrollEnd!=null&&At("scrollend",u),g.onClick!=null&&(u.onclick=as),u=!0):u=!1,u||to(o,!0)}function YE(o){for(fr=o.return;fr;)switch(fr.tag){case 5:case 31:case 13:Ri=!1;return;case 27:case 3:Ri=!0;return;default:fr=fr.return}}function Qc(o){if(o!==fr)return!1;if(!Tt)return YE(o),Tt=!0,!1;var u=o.tag,h;if((h=u!==3&&u!==27)&&((h=u===5)&&(h=o.type,h=!(h!=="form"&&h!=="button")||Xb(o.type,o.memoizedProps)),h=!h),h&&rn&&to(o),YE(o),u===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));rn=b_(o)}else if(u===31){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));rn=b_(o)}else u===27?(u=rn,go(o.type)?(o=rw,rw=null,rn=o):rn=u):rn=fr?Mi(o.stateNode.nextSibling):null;return!0}function gl(){rn=fr=null,Tt=!1}function Dx(){var o=eo;return o!==null&&(ti===null?ti=o:ti.push.apply(ti,o),eo=null),o}function Jd(o){eo===null?eo=[o]:eo.push(o)}var Mx=q(null),yl=null,cs=null;function no(o,u,h){D(Mx,u._currentValue),u._currentValue=h}function us(o){o._currentValue=Mx.current,I(Mx)}function Ix(o,u,h){for(;o!==null;){var g=o.alternate;if((o.childLanes&u)!==u?(o.childLanes|=u,g!==null&&(g.childLanes|=u)):g!==null&&(g.childLanes&u)!==u&&(g.childLanes|=u),o===h)break;o=o.return}}function Lx(o,u,h,g){var S=o.child;for(S!==null&&(S.return=o);S!==null;){var N=S.dependencies;if(N!==null){var T=S.child;N=N.firstContext;e:for(;N!==null;){var B=N;N=S;for(var Q=0;Q<u.length;Q++)if(B.context===u[Q]){N.lanes|=h,B=N.alternate,B!==null&&(B.lanes|=h),Ix(N.return,h,o),g||(T=null);break e}N=B.next}}else if(S.tag===18){if(T=S.return,T===null)throw Error(r(341));T.lanes|=h,N=T.alternate,N!==null&&(N.lanes|=h),Ix(T,h,o),T=null}else T=S.child;if(T!==null)T.return=S;else for(T=S;T!==null;){if(T===o){T=null;break}if(S=T.sibling,S!==null){S.return=T.return,T=S;break}T=T.return}S=T}}function Yc(o,u,h,g){o=null;for(var S=u,N=!1;S!==null;){if(!N){if((S.flags&524288)!==0)N=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var T=S.alternate;if(T===null)throw Error(r(387));if(T=T.memoizedProps,T!==null){var B=S.type;mi(S.pendingProps.value,T.value)||(o!==null?o.push(B):o=[B])}}else if(S===Ee.current){if(T=S.alternate,T===null)throw Error(r(387));T.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(o!==null?o.push(Af):o=[Af])}S=S.return}o!==null&&Lx(u,o,h,g),u.flags|=262144}function Up(o){for(o=o.firstContext;o!==null;){if(!mi(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function vl(o){yl=o,cs=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function hr(o){return WE(yl,o)}function qp(o,u){return yl===null&&vl(o),WE(o,u)}function WE(o,u){var h=u._currentValue;if(u={context:u,memoizedValue:h,next:null},cs===null){if(o===null)throw Error(r(308));cs=u,o.dependencies={lanes:0,firstContext:u},o.flags|=524288}else cs=cs.next=u;return h}var NH=typeof AbortController<"u"?AbortController:function(){var o=[],u=this.signal={aborted:!1,addEventListener:function(h,g){o.push(g)}};this.abort=function(){u.aborted=!0,o.forEach(function(h){return h()})}},kH=e.unstable_scheduleCallback,CH=e.unstable_NormalPriority,Mn={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function $x(){return{controller:new NH,data:new Map,refCount:0}}function ef(o){o.refCount--,o.refCount===0&&kH(CH,function(){o.controller.abort()})}var tf=null,Bx=0,Wc=0,Zc=null;function AH(o,u){if(tf===null){var h=tf=[];Bx=0,Wc=Fb(),Zc={status:"pending",value:void 0,then:function(g){h.push(g)}}}return Bx++,u.then(ZE,ZE),u}function ZE(){if(--Bx===0&&tf!==null){Zc!==null&&(Zc.status="fulfilled");var o=tf;tf=null,Wc=0,Zc=null;for(var u=0;u<o.length;u++)(0,o[u])()}}function EH(o,u){var h=[],g={status:"pending",value:null,reason:null,then:function(S){h.push(S)}};return o.then(function(){g.status="fulfilled",g.value=u;for(var S=0;S<h.length;S++)(0,h[S])(u)},function(S){for(g.status="rejected",g.reason=S,S=0;S<h.length;S++)(0,h[S])(void 0)}),g}var XE=H.S;H.S=function(o,u){Dz=Kt(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&AH(o,u),XE!==null&&XE(o,u)};var xl=q(null);function Ux(){var o=xl.current;return o!==null?o:Zt.pooledCache}function Fp(o,u){u===null?D(xl,xl.current):D(xl,u.pool)}function JE(){var o=Ux();return o===null?null:{parent:Mn._currentValue,pool:o}}var Xc=Error(r(460)),qx=Error(r(474)),Hp=Error(r(542)),Kp={then:function(){}};function eO(o){return o=o.status,o==="fulfilled"||o==="rejected"}function tO(o,u,h){switch(h=o[h],h===void 0?o.push(u):h!==u&&(u.then(as,as),u=h),u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,rO(o),o;default:if(typeof u.status=="string")u.then(as,as);else{if(o=Zt,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=u,o.status="pending",o.then(function(g){if(u.status==="pending"){var S=u;S.status="fulfilled",S.value=g}},function(g){if(u.status==="pending"){var S=u;S.status="rejected",S.reason=g}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw o=u.reason,rO(o),o}throw wl=u,Xc}}function bl(o){try{var u=o._init;return u(o._payload)}catch(h){throw h!==null&&typeof h=="object"&&typeof h.then=="function"?(wl=h,Xc):h}}var wl=null;function nO(){if(wl===null)throw Error(r(459));var o=wl;return wl=null,o}function rO(o){if(o===Xc||o===Hp)throw Error(r(483))}var Jc=null,nf=0;function Gp(o){var u=nf;return nf+=1,Jc===null&&(Jc=[]),tO(Jc,o,u)}function rf(o,u){u=u.props.ref,o.ref=u!==void 0?u:null}function Vp(o,u){throw u.$$typeof===y?Error(r(525)):(o=Object.prototype.toString.call(u),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":o)))}function iO(o){function u(J,W){if(o){var se=J.deletions;se===null?(J.deletions=[W],J.flags|=16):se.push(W)}}function h(J,W){if(!o)return null;for(;W!==null;)u(J,W),W=W.sibling;return null}function g(J){for(var W=new Map;J!==null;)J.key!==null?W.set(J.key,J):W.set(J.index,J),J=J.sibling;return W}function S(J,W){return J=os(J,W),J.index=0,J.sibling=null,J}function N(J,W,se){return J.index=se,o?(se=J.alternate,se!==null?(se=se.index,se<W?(J.flags|=67108866,W):se):(J.flags|=67108866,W)):(J.flags|=1048576,W)}function T(J){return o&&J.alternate===null&&(J.flags|=67108866),J}function B(J,W,se,ve){return W===null||W.tag!==6?(W=zx(se,J.mode,ve),W.return=J,W):(W=S(W,se),W.return=J,W)}function Q(J,W,se,ve){var We=se.type;return We===b?ge(J,W,se.props.children,ve,se.key):W!==null&&(W.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===R&&bl(We)===W.type)?(W=S(W,se.props),rf(W,se),W.return=J,W):(W=$p(se.type,se.key,se.props,null,J.mode,ve),rf(W,se),W.return=J,W)}function oe(J,W,se,ve){return W===null||W.tag!==4||W.stateNode.containerInfo!==se.containerInfo||W.stateNode.implementation!==se.implementation?(W=_x(se,J.mode,ve),W.return=J,W):(W=S(W,se.children||[]),W.return=J,W)}function ge(J,W,se,ve,We){return W===null||W.tag!==7?(W=ml(se,J.mode,ve,We),W.return=J,W):(W=S(W,se),W.return=J,W)}function we(J,W,se){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=zx(""+W,J.mode,se),W.return=J,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case v:return se=$p(W.type,W.key,W.props,null,J.mode,se),rf(se,W),se.return=J,se;case w:return W=_x(W,J.mode,se),W.return=J,W;case R:return W=bl(W),we(J,W,se)}if(Y(W)||U(W))return W=ml(W,J.mode,se,null),W.return=J,W;if(typeof W.then=="function")return we(J,Gp(W),se);if(W.$$typeof===A)return we(J,qp(J,W),se);Vp(J,W)}return null}function ce(J,W,se,ve){var We=W!==null?W.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return We!==null?null:B(J,W,""+se,ve);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case v:return se.key===We?Q(J,W,se,ve):null;case w:return se.key===We?oe(J,W,se,ve):null;case R:return se=bl(se),ce(J,W,se,ve)}if(Y(se)||U(se))return We!==null?null:ge(J,W,se,ve,null);if(typeof se.then=="function")return ce(J,W,Gp(se),ve);if(se.$$typeof===A)return ce(J,W,qp(J,se),ve);Vp(J,se)}return null}function fe(J,W,se,ve,We){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return J=J.get(se)||null,B(W,J,""+ve,We);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return J=J.get(ve.key===null?se:ve.key)||null,Q(W,J,ve,We);case w:return J=J.get(ve.key===null?se:ve.key)||null,oe(W,J,ve,We);case R:return ve=bl(ve),fe(J,W,se,ve,We)}if(Y(ve)||U(ve))return J=J.get(se)||null,ge(W,J,ve,We,null);if(typeof ve.then=="function")return fe(J,W,se,Gp(ve),We);if(ve.$$typeof===A)return fe(J,W,se,qp(W,ve),We);Vp(W,ve)}return null}function Le(J,W,se,ve){for(var We=null,Rt=null,qe=W,gt=W=0,Ot=null;qe!==null&><se.length;gt++){qe.index>gt?(Ot=qe,qe=null):Ot=qe.sibling;var Dt=ce(J,qe,se[gt],ve);if(Dt===null){qe===null&&(qe=Ot);break}o&&qe&&Dt.alternate===null&&u(J,qe),W=N(Dt,W,gt),Rt===null?We=Dt:Rt.sibling=Dt,Rt=Dt,qe=Ot}if(gt===se.length)return h(J,qe),Tt&&ls(J,gt),We;if(qe===null){for(;gt<se.length;gt++)qe=we(J,se[gt],ve),qe!==null&&(W=N(qe,W,gt),Rt===null?We=qe:Rt.sibling=qe,Rt=qe);return Tt&&ls(J,gt),We}for(qe=g(qe);gt<se.length;gt++)Ot=fe(qe,J,gt,se[gt],ve),Ot!==null&&(o&&Ot.alternate!==null&&qe.delete(Ot.key===null?gt:Ot.key),W=N(Ot,W,gt),Rt===null?We=Ot:Rt.sibling=Ot,Rt=Ot);return o&&qe.forEach(function(wo){return u(J,wo)}),Tt&&ls(J,gt),We}function et(J,W,se,ve){if(se==null)throw Error(r(151));for(var We=null,Rt=null,qe=W,gt=W=0,Ot=null,Dt=se.next();qe!==null&&!Dt.done;gt++,Dt=se.next()){qe.index>gt?(Ot=qe,qe=null):Ot=qe.sibling;var wo=ce(J,qe,Dt.value,ve);if(wo===null){qe===null&&(qe=Ot);break}o&&qe&&wo.alternate===null&&u(J,qe),W=N(wo,W,gt),Rt===null?We=wo:Rt.sibling=wo,Rt=wo,qe=Ot}if(Dt.done)return h(J,qe),Tt&&ls(J,gt),We;if(qe===null){for(;!Dt.done;gt++,Dt=se.next())Dt=we(J,Dt.value,ve),Dt!==null&&(W=N(Dt,W,gt),Rt===null?We=Dt:Rt.sibling=Dt,Rt=Dt);return Tt&&ls(J,gt),We}for(qe=g(qe);!Dt.done;gt++,Dt=se.next())Dt=fe(qe,J,gt,Dt.value,ve),Dt!==null&&(o&&Dt.alternate!==null&&qe.delete(Dt.key===null?gt:Dt.key),W=N(Dt,W,gt),Rt===null?We=Dt:Rt.sibling=Dt,Rt=Dt);return o&&qe.forEach(function($K){return u(J,$K)}),Tt&&ls(J,gt),We}function Qt(J,W,se,ve){if(typeof se=="object"&&se!==null&&se.type===b&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case v:e:{for(var We=se.key;W!==null;){if(W.key===We){if(We=se.type,We===b){if(W.tag===7){h(J,W.sibling),ve=S(W,se.props.children),ve.return=J,J=ve;break e}}else if(W.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===R&&bl(We)===W.type){h(J,W.sibling),ve=S(W,se.props),rf(ve,se),ve.return=J,J=ve;break e}h(J,W);break}else u(J,W);W=W.sibling}se.type===b?(ve=ml(se.props.children,J.mode,ve,se.key),ve.return=J,J=ve):(ve=$p(se.type,se.key,se.props,null,J.mode,ve),rf(ve,se),ve.return=J,J=ve)}return T(J);case w:e:{for(We=se.key;W!==null;){if(W.key===We)if(W.tag===4&&W.stateNode.containerInfo===se.containerInfo&&W.stateNode.implementation===se.implementation){h(J,W.sibling),ve=S(W,se.children||[]),ve.return=J,J=ve;break e}else{h(J,W);break}else u(J,W);W=W.sibling}ve=_x(se,J.mode,ve),ve.return=J,J=ve}return T(J);case R:return se=bl(se),Qt(J,W,se,ve)}if(Y(se))return Le(J,W,se,ve);if(U(se)){if(We=U(se),typeof We!="function")throw Error(r(150));return se=We.call(se),et(J,W,se,ve)}if(typeof se.then=="function")return Qt(J,W,Gp(se),ve);if(se.$$typeof===A)return Qt(J,W,qp(J,se),ve);Vp(J,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,W!==null&&W.tag===6?(h(J,W.sibling),ve=S(W,se),ve.return=J,J=ve):(h(J,W),ve=zx(se,J.mode,ve),ve.return=J,J=ve),T(J)):h(J,W)}return function(J,W,se,ve){try{nf=0;var We=Qt(J,W,se,ve);return Jc=null,We}catch(qe){if(qe===Xc||qe===Hp)throw qe;var Rt=gi(29,qe,null,J.mode);return Rt.lanes=ve,Rt.return=J,Rt}}}var Sl=iO(!0),aO=iO(!1),ro=!1;function Fx(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hx(o,u){o=o.updateQueue,u.updateQueue===o&&(u.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function io(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function ao(o,u,h){var g=o.updateQueue;if(g===null)return null;if(g=g.shared,(It&2)!==0){var S=g.pending;return S===null?u.next=u:(u.next=S.next,S.next=u),g.pending=u,u=Lp(o),qE(o,null,h),u}return Ip(o,g,u,h),Lp(o)}function af(o,u,h){if(u=u.updateQueue,u!==null&&(u=u.shared,(h&4194048)!==0)){var g=u.lanes;g&=o.pendingLanes,h|=g,u.lanes=h,sa(o,h)}}function Kx(o,u){var h=o.updateQueue,g=o.alternate;if(g!==null&&(g=g.updateQueue,h===g)){var S=null,N=null;if(h=h.firstBaseUpdate,h!==null){do{var T={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};N===null?S=N=T:N=N.next=T,h=h.next}while(h!==null);N===null?S=N=u:N=N.next=u}else S=N=u;h={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:N,shared:g.shared,callbacks:g.callbacks},o.updateQueue=h;return}o=h.lastBaseUpdate,o===null?h.firstBaseUpdate=u:o.next=u,h.lastBaseUpdate=u}var Gx=!1;function sf(){if(Gx){var o=Zc;if(o!==null)throw o}}function of(o,u,h,g){Gx=!1;var S=o.updateQueue;ro=!1;var N=S.firstBaseUpdate,T=S.lastBaseUpdate,B=S.shared.pending;if(B!==null){S.shared.pending=null;var Q=B,oe=Q.next;Q.next=null,T===null?N=oe:T.next=oe,T=Q;var ge=o.alternate;ge!==null&&(ge=ge.updateQueue,B=ge.lastBaseUpdate,B!==T&&(B===null?ge.firstBaseUpdate=oe:B.next=oe,ge.lastBaseUpdate=Q))}if(N!==null){var we=S.baseState;T=0,ge=oe=Q=null,B=N;do{var ce=B.lane&-536870913,fe=ce!==B.lane;if(fe?(Et&ce)===ce:(g&ce)===ce){ce!==0&&ce===Wc&&(Gx=!0),ge!==null&&(ge=ge.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var Le=o,et=B;ce=u;var Qt=h;switch(et.tag){case 1:if(Le=et.payload,typeof Le=="function"){we=Le.call(Qt,we,ce);break e}we=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=et.payload,ce=typeof Le=="function"?Le.call(Qt,we,ce):Le,ce==null)break e;we=m({},we,ce);break e;case 2:ro=!0}}ce=B.callback,ce!==null&&(o.flags|=64,fe&&(o.flags|=8192),fe=S.callbacks,fe===null?S.callbacks=[ce]:fe.push(ce))}else fe={lane:ce,tag:B.tag,payload:B.payload,callback:B.callback,next:null},ge===null?(oe=ge=fe,Q=we):ge=ge.next=fe,T|=ce;if(B=B.next,B===null){if(B=S.shared.pending,B===null)break;fe=B,B=fe.next,fe.next=null,S.lastBaseUpdate=fe,S.shared.pending=null}}while(!0);ge===null&&(Q=we),S.baseState=Q,S.firstBaseUpdate=oe,S.lastBaseUpdate=ge,N===null&&(S.shared.lanes=0),uo|=T,o.lanes=T,o.memoizedState=we}}function sO(o,u){if(typeof o!="function")throw Error(r(191,o));o.call(u)}function oO(o,u){var h=o.callbacks;if(h!==null)for(o.callbacks=null,o=0;o<h.length;o++)sO(h[o],u)}var eu=q(null),Qp=q(0);function lO(o,u){o=xs,D(Qp,o),D(eu,u),xs=o|u.baseLanes}function Vx(){D(Qp,xs),D(eu,eu.current)}function Qx(){xs=Qp.current,I(eu),I(Qp)}var yi=q(null),Di=null;function so(o){var u=o.alternate;D(En,En.current&1),D(yi,o),Di===null&&(u===null||eu.current!==null||u.memoizedState!==null)&&(Di=o)}function Yx(o){D(En,En.current),D(yi,o),Di===null&&(Di=o)}function cO(o){o.tag===22?(D(En,En.current),D(yi,o),Di===null&&(Di=o)):oo()}function oo(){D(En,En.current),D(yi,yi.current)}function vi(o){I(yi),Di===o&&(Di=null),I(En)}var En=q(0);function Yp(o){for(var u=o;u!==null;){if(u.tag===13){var h=u.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||tw(h)||nw(h)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ds=0,ft=null,Gt=null,In=null,Wp=!1,tu=!1,jl=!1,Zp=0,lf=0,nu=null,OH=0;function jn(){throw Error(r(321))}function Wx(o,u){if(u===null)return!1;for(var h=0;h<u.length&&h<o.length;h++)if(!mi(o[h],u[h]))return!1;return!0}function Zx(o,u,h,g,S,N){return ds=N,ft=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,H.H=o===null||o.memoizedState===null?GO:fb,jl=!1,N=h(g,S),jl=!1,tu&&(N=dO(u,h,g,S)),uO(o),N}function uO(o){H.H=df;var u=Gt!==null&&Gt.next!==null;if(ds=0,In=Gt=ft=null,Wp=!1,lf=0,nu=null,u)throw Error(r(300));o===null||Ln||(o=o.dependencies,o!==null&&Up(o)&&(Ln=!0))}function dO(o,u,h,g){ft=o;var S=0;do{if(tu&&(nu=null),lf=0,tu=!1,25<=S)throw Error(r(301));if(S+=1,In=Gt=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=VO,N=u(h,g)}while(tu);return N}function zH(){var o=H.H,u=o.useState()[0];return u=typeof u.then=="function"?cf(u):u,o=o.useState()[0],(Gt!==null?Gt.memoizedState:null)!==o&&(ft.flags|=1024),u}function Xx(){var o=Zp!==0;return Zp=0,o}function Jx(o,u,h){u.updateQueue=o.updateQueue,u.flags&=-2053,o.lanes&=~h}function eb(o){if(Wp){for(o=o.memoizedState;o!==null;){var u=o.queue;u!==null&&(u.pending=null),o=o.next}Wp=!1}ds=0,In=Gt=ft=null,tu=!1,lf=Zp=0,nu=null}function Lr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return In===null?ft.memoizedState=In=o:In=In.next=o,In}function On(){if(Gt===null){var o=ft.alternate;o=o!==null?o.memoizedState:null}else o=Gt.next;var u=In===null?ft.memoizedState:In.next;if(u!==null)In=u,Gt=o;else{if(o===null)throw ft.alternate===null?Error(r(467)):Error(r(310));Gt=o,o={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},In===null?ft.memoizedState=In=o:In=In.next=o}return In}function Xp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cf(o){var u=lf;return lf+=1,nu===null&&(nu=[]),o=tO(nu,o,u),u=ft,(In===null?u.memoizedState:In.next)===null&&(u=u.alternate,H.H=u===null||u.memoizedState===null?GO:fb),o}function Jp(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return cf(o);if(o.$$typeof===A)return hr(o)}throw Error(r(438,String(o)))}function tb(o){var u=null,h=ft.updateQueue;if(h!==null&&(u=h.memoCache),u==null){var g=ft.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(u={data:g.data.map(function(S){return S.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),h===null&&(h=Xp(),ft.updateQueue=h),h.memoCache=u,h=u.data[u.index],h===void 0)for(h=u.data[u.index]=Array(o),g=0;g<o;g++)h[g]=F;return u.index++,h}function fs(o,u){return typeof u=="function"?u(o):u}function em(o){var u=On();return nb(u,Gt,o)}function nb(o,u,h){var g=o.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=h;var S=o.baseQueue,N=g.pending;if(N!==null){if(S!==null){var T=S.next;S.next=N.next,N.next=T}u.baseQueue=S=N,g.pending=null}if(N=o.baseState,S===null)o.memoizedState=N;else{u=S.next;var B=T=null,Q=null,oe=u,ge=!1;do{var we=oe.lane&-536870913;if(we!==oe.lane?(Et&we)===we:(ds&we)===we){var ce=oe.revertLane;if(ce===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),we===Wc&&(ge=!0);else if((ds&ce)===ce){oe=oe.next,ce===Wc&&(ge=!0);continue}else we={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Q===null?(B=Q=we,T=N):Q=Q.next=we,ft.lanes|=ce,uo|=ce;we=oe.action,jl&&h(N,we),N=oe.hasEagerState?oe.eagerState:h(N,we)}else ce={lane:we,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Q===null?(B=Q=ce,T=N):Q=Q.next=ce,ft.lanes|=we,uo|=we;oe=oe.next}while(oe!==null&&oe!==u);if(Q===null?T=N:Q.next=B,!mi(N,o.memoizedState)&&(Ln=!0,ge&&(h=Zc,h!==null)))throw h;o.memoizedState=N,o.baseState=T,o.baseQueue=Q,g.lastRenderedState=N}return S===null&&(g.lanes=0),[o.memoizedState,g.dispatch]}function rb(o){var u=On(),h=u.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=o;var g=h.dispatch,S=h.pending,N=u.memoizedState;if(S!==null){h.pending=null;var T=S=S.next;do N=o(N,T.action),T=T.next;while(T!==S);mi(N,u.memoizedState)||(Ln=!0),u.memoizedState=N,u.baseQueue===null&&(u.baseState=N),h.lastRenderedState=N}return[N,g]}function fO(o,u,h){var g=ft,S=On(),N=Tt;if(N){if(h===void 0)throw Error(r(407));h=h()}else h=u();var T=!mi((Gt||S).memoizedState,h);if(T&&(S.memoizedState=h,Ln=!0),S=S.queue,sb(mO.bind(null,g,S,o),[o]),S.getSnapshot!==u||T||In!==null&&In.memoizedState.tag&1){if(g.flags|=2048,ru(9,{destroy:void 0},pO.bind(null,g,S,h,u),null),Zt===null)throw Error(r(349));N||(ds&127)!==0||hO(g,u,h)}return h}function hO(o,u,h){o.flags|=16384,o={getSnapshot:u,value:h},u=ft.updateQueue,u===null?(u=Xp(),ft.updateQueue=u,u.stores=[o]):(h=u.stores,h===null?u.stores=[o]:h.push(o))}function pO(o,u,h,g){u.value=h,u.getSnapshot=g,gO(u)&&yO(o)}function mO(o,u,h){return h(function(){gO(u)&&yO(o)})}function gO(o){var u=o.getSnapshot;o=o.value;try{var h=u();return!mi(o,h)}catch{return!0}}function yO(o){var u=pl(o,2);u!==null&&ni(u,o,2)}function ib(o){var u=Lr();if(typeof o=="function"){var h=o;if(o=h(),jl){Qe(!0);try{h()}finally{Qe(!1)}}}return u.memoizedState=u.baseState=o,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:o},u}function vO(o,u,h,g){return o.baseState=h,nb(o,Gt,typeof g=="function"?g:fs)}function _H(o,u,h,g,S){if(rm(o))throw Error(r(485));if(o=u.action,o!==null){var N={payload:S,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){N.listeners.push(T)}};H.T!==null?h(!0):N.isTransition=!1,g(N),h=u.pending,h===null?(N.next=u.pending=N,xO(u,N)):(N.next=h.next,u.pending=h.next=N)}}function xO(o,u){var h=u.action,g=u.payload,S=o.state;if(u.isTransition){var N=H.T,T={};H.T=T;try{var B=h(S,g),Q=H.S;Q!==null&&Q(T,B),bO(o,u,B)}catch(oe){ab(o,u,oe)}finally{N!==null&&T.types!==null&&(N.types=T.types),H.T=N}}else try{N=h(S,g),bO(o,u,N)}catch(oe){ab(o,u,oe)}}function bO(o,u,h){h!==null&&typeof h=="object"&&typeof h.then=="function"?h.then(function(g){wO(o,u,g)},function(g){return ab(o,u,g)}):wO(o,u,h)}function wO(o,u,h){u.status="fulfilled",u.value=h,SO(u),o.state=h,u=o.pending,u!==null&&(h=u.next,h===u?o.pending=null:(h=h.next,u.next=h,xO(o,h)))}function ab(o,u,h){var g=o.pending;if(o.pending=null,g!==null){g=g.next;do u.status="rejected",u.reason=h,SO(u),u=u.next;while(u!==g)}o.action=null}function SO(o){o=o.listeners;for(var u=0;u<o.length;u++)(0,o[u])()}function jO(o,u){return u}function NO(o,u){if(Tt){var h=Zt.formState;if(h!==null){e:{var g=ft;if(Tt){if(rn){t:{for(var S=rn,N=Ri;S.nodeType!==8;){if(!N){S=null;break t}if(S=Mi(S.nextSibling),S===null){S=null;break t}}N=S.data,S=N==="F!"||N==="F"?S:null}if(S){rn=Mi(S.nextSibling),g=S.data==="F!";break e}}to(g)}g=!1}g&&(u=h[0])}}return h=Lr(),h.memoizedState=h.baseState=u,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jO,lastRenderedState:u},h.queue=g,h=FO.bind(null,ft,g),g.dispatch=h,g=ib(!1),N=db.bind(null,ft,!1,g.queue),g=Lr(),S={state:u,dispatch:null,action:o,pending:null},g.queue=S,h=_H.bind(null,ft,S,N,h),S.dispatch=h,g.memoizedState=o,[u,h,!1]}function kO(o){var u=On();return CO(u,Gt,o)}function CO(o,u,h){if(u=nb(o,u,jO)[0],o=em(fs)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var g=cf(u)}catch(T){throw T===Xc?Hp:T}else g=u;u=On();var S=u.queue,N=S.dispatch;return h!==u.memoizedState&&(ft.flags|=2048,ru(9,{destroy:void 0},TH.bind(null,S,h),null)),[g,N,o]}function TH(o,u){o.action=u}function AO(o){var u=On(),h=Gt;if(h!==null)return CO(u,h,o);On(),u=u.memoizedState,h=On();var g=h.queue.dispatch;return h.memoizedState=o,[u,g,!1]}function ru(o,u,h,g){return o={tag:o,create:h,deps:g,inst:u,next:null},u=ft.updateQueue,u===null&&(u=Xp(),ft.updateQueue=u),h=u.lastEffect,h===null?u.lastEffect=o.next=o:(g=h.next,h.next=o,o.next=g,u.lastEffect=o),o}function EO(){return On().memoizedState}function tm(o,u,h,g){var S=Lr();ft.flags|=o,S.memoizedState=ru(1|u,{destroy:void 0},h,g===void 0?null:g)}function nm(o,u,h,g){var S=On();g=g===void 0?null:g;var N=S.memoizedState.inst;Gt!==null&&g!==null&&Wx(g,Gt.memoizedState.deps)?S.memoizedState=ru(u,N,h,g):(ft.flags|=o,S.memoizedState=ru(1|u,N,h,g))}function OO(o,u){tm(8390656,8,o,u)}function sb(o,u){nm(2048,8,o,u)}function PH(o){ft.flags|=4;var u=ft.updateQueue;if(u===null)u=Xp(),ft.updateQueue=u,u.events=[o];else{var h=u.events;h===null?u.events=[o]:h.push(o)}}function zO(o){var u=On().memoizedState;return PH({ref:u,nextImpl:o}),function(){if((It&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function _O(o,u){return nm(4,2,o,u)}function TO(o,u){return nm(4,4,o,u)}function PO(o,u){if(typeof u=="function"){o=o();var h=u(o);return function(){typeof h=="function"?h():u(null)}}if(u!=null)return o=o(),u.current=o,function(){u.current=null}}function RO(o,u,h){h=h!=null?h.concat([o]):null,nm(4,4,PO.bind(null,u,o),h)}function ob(){}function DO(o,u){var h=On();u=u===void 0?null:u;var g=h.memoizedState;return u!==null&&Wx(u,g[1])?g[0]:(h.memoizedState=[o,u],o)}function MO(o,u){var h=On();u=u===void 0?null:u;var g=h.memoizedState;if(u!==null&&Wx(u,g[1]))return g[0];if(g=o(),jl){Qe(!0);try{o()}finally{Qe(!1)}}return h.memoizedState=[g,u],g}function lb(o,u,h){return h===void 0||(ds&1073741824)!==0&&(Et&261930)===0?o.memoizedState=u:(o.memoizedState=h,o=Iz(),ft.lanes|=o,uo|=o,h)}function IO(o,u,h,g){return mi(h,u)?h:eu.current!==null?(o=lb(o,h,g),mi(o,u)||(Ln=!0),o):(ds&42)===0||(ds&1073741824)!==0&&(Et&261930)===0?(Ln=!0,o.memoizedState=h):(o=Iz(),ft.lanes|=o,uo|=o,u)}function LO(o,u,h,g,S){var N=X.p;X.p=N!==0&&8>N?N:8;var T=H.T,B={};H.T=B,db(o,!1,u,h);try{var Q=S(),oe=H.S;if(oe!==null&&oe(B,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ge=EH(Q,g);uf(o,u,ge,wi(o))}else uf(o,u,g,wi(o))}catch(we){uf(o,u,{then:function(){},status:"rejected",reason:we},wi())}finally{X.p=N,T!==null&&B.types!==null&&(T.types=B.types),H.T=T}}function RH(){}function cb(o,u,h,g){if(o.tag!==5)throw Error(r(476));var S=$O(o).queue;LO(o,S,u,ue,h===null?RH:function(){return BO(o),h(g)})}function $O(o){var u=o.memoizedState;if(u!==null)return u;u={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:ue},next:null};var h={};return u.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:h},next:null},o.memoizedState=u,o=o.alternate,o!==null&&(o.memoizedState=u),u}function BO(o){var u=$O(o);u.next===null&&(u=o.alternate.memoizedState),uf(o,u.next.queue,{},wi())}function ub(){return hr(Af)}function UO(){return On().memoizedState}function qO(){return On().memoizedState}function DH(o){for(var u=o.return;u!==null;){switch(u.tag){case 24:case 3:var h=wi();o=io(h);var g=ao(u,o,h);g!==null&&(ni(g,u,h),af(g,u,h)),u={cache:$x()},o.payload=u;return}u=u.return}}function MH(o,u,h){var g=wi();h={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},rm(o)?HO(u,h):(h=Ex(o,u,h,g),h!==null&&(ni(h,o,g),KO(h,u,g)))}function FO(o,u,h){var g=wi();uf(o,u,h,g)}function uf(o,u,h,g){var S={lane:g,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(rm(o))HO(u,S);else{var N=o.alternate;if(o.lanes===0&&(N===null||N.lanes===0)&&(N=u.lastRenderedReducer,N!==null))try{var T=u.lastRenderedState,B=N(T,h);if(S.hasEagerState=!0,S.eagerState=B,mi(B,T))return Ip(o,u,S,0),Zt===null&&Mp(),!1}catch{}if(h=Ex(o,u,S,g),h!==null)return ni(h,o,g),KO(h,u,g),!0}return!1}function db(o,u,h,g){if(g={lane:2,revertLane:Fb(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},rm(o)){if(u)throw Error(r(479))}else u=Ex(o,h,g,2),u!==null&&ni(u,o,2)}function rm(o){var u=o.alternate;return o===ft||u!==null&&u===ft}function HO(o,u){tu=Wp=!0;var h=o.pending;h===null?u.next=u:(u.next=h.next,h.next=u),o.pending=u}function KO(o,u,h){if((h&4194048)!==0){var g=u.lanes;g&=o.pendingLanes,h|=g,u.lanes=h,sa(o,h)}}var df={readContext:hr,use:Jp,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};df.useEffectEvent=jn;var GO={readContext:hr,use:Jp,useCallback:function(o,u){return Lr().memoizedState=[o,u===void 0?null:u],o},useContext:hr,useEffect:OO,useImperativeHandle:function(o,u,h){h=h!=null?h.concat([o]):null,tm(4194308,4,PO.bind(null,u,o),h)},useLayoutEffect:function(o,u){return tm(4194308,4,o,u)},useInsertionEffect:function(o,u){tm(4,2,o,u)},useMemo:function(o,u){var h=Lr();u=u===void 0?null:u;var g=o();if(jl){Qe(!0);try{o()}finally{Qe(!1)}}return h.memoizedState=[g,u],g},useReducer:function(o,u,h){var g=Lr();if(h!==void 0){var S=h(u);if(jl){Qe(!0);try{h(u)}finally{Qe(!1)}}}else S=u;return g.memoizedState=g.baseState=S,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:S},g.queue=o,o=o.dispatch=MH.bind(null,ft,o),[g.memoizedState,o]},useRef:function(o){var u=Lr();return o={current:o},u.memoizedState=o},useState:function(o){o=ib(o);var u=o.queue,h=FO.bind(null,ft,u);return u.dispatch=h,[o.memoizedState,h]},useDebugValue:ob,useDeferredValue:function(o,u){var h=Lr();return lb(h,o,u)},useTransition:function(){var o=ib(!1);return o=LO.bind(null,ft,o.queue,!0,!1),Lr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,u,h){var g=ft,S=Lr();if(Tt){if(h===void 0)throw Error(r(407));h=h()}else{if(h=u(),Zt===null)throw Error(r(349));(Et&127)!==0||hO(g,u,h)}S.memoizedState=h;var N={value:h,getSnapshot:u};return S.queue=N,OO(mO.bind(null,g,N,o),[o]),g.flags|=2048,ru(9,{destroy:void 0},pO.bind(null,g,N,h,u),null),h},useId:function(){var o=Lr(),u=Zt.identifierPrefix;if(Tt){var h=Oa,g=Ea;h=(g&~(1<<32-rt(g)-1)).toString(32)+h,u="_"+u+"R_"+h,h=Zp++,0<h&&(u+="H"+h.toString(32)),u+="_"}else h=OH++,u="_"+u+"r_"+h.toString(32)+"_";return o.memoizedState=u},useHostTransitionStatus:ub,useFormState:NO,useActionState:NO,useOptimistic:function(o){var u=Lr();u.memoizedState=u.baseState=o;var h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=h,u=db.bind(null,ft,!0,h),h.dispatch=u,[o,u]},useMemoCache:tb,useCacheRefresh:function(){return Lr().memoizedState=DH.bind(null,ft)},useEffectEvent:function(o){var u=Lr(),h={impl:o};return u.memoizedState=h,function(){if((It&2)!==0)throw Error(r(440));return h.impl.apply(void 0,arguments)}}},fb={readContext:hr,use:Jp,useCallback:DO,useContext:hr,useEffect:sb,useImperativeHandle:RO,useInsertionEffect:_O,useLayoutEffect:TO,useMemo:MO,useReducer:em,useRef:EO,useState:function(){return em(fs)},useDebugValue:ob,useDeferredValue:function(o,u){var h=On();return IO(h,Gt.memoizedState,o,u)},useTransition:function(){var o=em(fs)[0],u=On().memoizedState;return[typeof o=="boolean"?o:cf(o),u]},useSyncExternalStore:fO,useId:UO,useHostTransitionStatus:ub,useFormState:kO,useActionState:kO,useOptimistic:function(o,u){var h=On();return vO(h,Gt,o,u)},useMemoCache:tb,useCacheRefresh:qO};fb.useEffectEvent=zO;var VO={readContext:hr,use:Jp,useCallback:DO,useContext:hr,useEffect:sb,useImperativeHandle:RO,useInsertionEffect:_O,useLayoutEffect:TO,useMemo:MO,useReducer:rb,useRef:EO,useState:function(){return rb(fs)},useDebugValue:ob,useDeferredValue:function(o,u){var h=On();return Gt===null?lb(h,o,u):IO(h,Gt.memoizedState,o,u)},useTransition:function(){var o=rb(fs)[0],u=On().memoizedState;return[typeof o=="boolean"?o:cf(o),u]},useSyncExternalStore:fO,useId:UO,useHostTransitionStatus:ub,useFormState:AO,useActionState:AO,useOptimistic:function(o,u){var h=On();return Gt!==null?vO(h,Gt,o,u):(h.baseState=o,[o,h.queue.dispatch])},useMemoCache:tb,useCacheRefresh:qO};VO.useEffectEvent=zO;function hb(o,u,h,g){u=o.memoizedState,h=h(g,u),h=h==null?u:m({},u,h),o.memoizedState=h,o.lanes===0&&(o.updateQueue.baseState=h)}var pb={enqueueSetState:function(o,u,h){o=o._reactInternals;var g=wi(),S=io(g);S.payload=u,h!=null&&(S.callback=h),u=ao(o,S,g),u!==null&&(ni(u,o,g),af(u,o,g))},enqueueReplaceState:function(o,u,h){o=o._reactInternals;var g=wi(),S=io(g);S.tag=1,S.payload=u,h!=null&&(S.callback=h),u=ao(o,S,g),u!==null&&(ni(u,o,g),af(u,o,g))},enqueueForceUpdate:function(o,u){o=o._reactInternals;var h=wi(),g=io(h);g.tag=2,u!=null&&(g.callback=u),u=ao(o,g,h),u!==null&&(ni(u,o,h),af(u,o,h))}};function QO(o,u,h,g,S,N,T){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(g,N,T):u.prototype&&u.prototype.isPureReactComponent?!Wd(h,g)||!Wd(S,N):!0}function YO(o,u,h,g){o=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(h,g),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(h,g),u.state!==o&&pb.enqueueReplaceState(u,u.state,null)}function Nl(o,u){var h=u;if("ref"in u){h={};for(var g in u)g!=="ref"&&(h[g]=u[g])}if(o=o.defaultProps){h===u&&(h=m({},h));for(var S in o)h[S]===void 0&&(h[S]=o[S])}return h}function WO(o){Dp(o)}function ZO(o){console.error(o)}function XO(o){Dp(o)}function im(o,u){try{var h=o.onUncaughtError;h(u.value,{componentStack:u.stack})}catch(g){setTimeout(function(){throw g})}}function JO(o,u,h){try{var g=o.onCaughtError;g(h.value,{componentStack:h.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function mb(o,u,h){return h=io(h),h.tag=3,h.payload={element:null},h.callback=function(){im(o,u)},h}function ez(o){return o=io(o),o.tag=3,o}function tz(o,u,h,g){var S=h.type.getDerivedStateFromError;if(typeof S=="function"){var N=g.value;o.payload=function(){return S(N)},o.callback=function(){JO(u,h,g)}}var T=h.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(o.callback=function(){JO(u,h,g),typeof S!="function"&&(fo===null?fo=new Set([this]):fo.add(this));var B=g.stack;this.componentDidCatch(g.value,{componentStack:B!==null?B:""})})}function IH(o,u,h,g,S){if(h.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(u=h.alternate,u!==null&&Yc(u,h,S,!0),h=yi.current,h!==null){switch(h.tag){case 31:case 13:return Di===null?gm():h.alternate===null&&Nn===0&&(Nn=3),h.flags&=-257,h.flags|=65536,h.lanes=S,g===Kp?h.flags|=16384:(u=h.updateQueue,u===null?h.updateQueue=new Set([g]):u.add(g),Bb(o,g,S)),!1;case 22:return h.flags|=65536,g===Kp?h.flags|=16384:(u=h.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([g])},h.updateQueue=u):(h=u.retryQueue,h===null?u.retryQueue=new Set([g]):h.add(g)),Bb(o,g,S)),!1}throw Error(r(435,h.tag))}return Bb(o,g,S),gm(),!1}if(Tt)return u=yi.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=S,g!==Rx&&(o=Error(r(422),{cause:g}),Jd(_i(o,h)))):(g!==Rx&&(u=Error(r(423),{cause:g}),Jd(_i(u,h))),o=o.current.alternate,o.flags|=65536,S&=-S,o.lanes|=S,g=_i(g,h),S=mb(o.stateNode,g,S),Kx(o,S),Nn!==4&&(Nn=2)),!1;var N=Error(r(520),{cause:g});if(N=_i(N,h),xf===null?xf=[N]:xf.push(N),Nn!==4&&(Nn=2),u===null)return!0;g=_i(g,h),h=u;do{switch(h.tag){case 3:return h.flags|=65536,o=S&-S,h.lanes|=o,o=mb(h.stateNode,g,o),Kx(h,o),!1;case 1:if(u=h.type,N=h.stateNode,(h.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(fo===null||!fo.has(N))))return h.flags|=65536,S&=-S,h.lanes|=S,S=ez(S),tz(S,o,h,g),Kx(h,S),!1}h=h.return}while(h!==null);return!1}var gb=Error(r(461)),Ln=!1;function pr(o,u,h,g){u.child=o===null?aO(u,null,h,g):Sl(u,o.child,h,g)}function nz(o,u,h,g,S){h=h.render;var N=u.ref;if("ref"in g){var T={};for(var B in g)B!=="ref"&&(T[B]=g[B])}else T=g;return vl(u),g=Zx(o,u,h,T,N,S),B=Xx(),o!==null&&!Ln?(Jx(o,u,S),hs(o,u,S)):(Tt&&B&&Tx(u),u.flags|=1,pr(o,u,g,S),u.child)}function rz(o,u,h,g,S){if(o===null){var N=h.type;return typeof N=="function"&&!Ox(N)&&N.defaultProps===void 0&&h.compare===null?(u.tag=15,u.type=N,iz(o,u,N,g,S)):(o=$p(h.type,null,g,u,u.mode,S),o.ref=u.ref,o.return=u,u.child=o)}if(N=o.child,!Nb(o,S)){var T=N.memoizedProps;if(h=h.compare,h=h!==null?h:Wd,h(T,g)&&o.ref===u.ref)return hs(o,u,S)}return u.flags|=1,o=os(N,g),o.ref=u.ref,o.return=u,u.child=o}function iz(o,u,h,g,S){if(o!==null){var N=o.memoizedProps;if(Wd(N,g)&&o.ref===u.ref)if(Ln=!1,u.pendingProps=g=N,Nb(o,S))(o.flags&131072)!==0&&(Ln=!0);else return u.lanes=o.lanes,hs(o,u,S)}return yb(o,u,h,g,S)}function az(o,u,h,g){var S=g.children,N=o!==null?o.memoizedState:null;if(o===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((u.flags&128)!==0){if(N=N!==null?N.baseLanes|h:h,o!==null){for(g=u.child=o.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~N}else g=0,u.child=null;return sz(o,u,N,h,g)}if((h&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},o!==null&&Fp(u,N!==null?N.cachePool:null),N!==null?lO(u,N):Vx(),cO(u);else return g=u.lanes=536870912,sz(o,u,N!==null?N.baseLanes|h:h,h,g)}else N!==null?(Fp(u,N.cachePool),lO(u,N),oo(),u.memoizedState=null):(o!==null&&Fp(u,null),Vx(),oo());return pr(o,u,S,h),u.child}function ff(o,u){return o!==null&&o.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function sz(o,u,h,g,S){var N=Ux();return N=N===null?null:{parent:Mn._currentValue,pool:N},u.memoizedState={baseLanes:h,cachePool:N},o!==null&&Fp(u,null),Vx(),cO(u),o!==null&&Yc(o,u,g,!0),u.childLanes=S,null}function am(o,u){return u=om({mode:u.mode,children:u.children},o.mode),u.ref=o.ref,o.child=u,u.return=o,u}function oz(o,u,h){return Sl(u,o.child,null,h),o=am(u,u.pendingProps),o.flags|=2,vi(u),u.memoizedState=null,o}function LH(o,u,h){var g=u.pendingProps,S=(u.flags&128)!==0;if(u.flags&=-129,o===null){if(Tt){if(g.mode==="hidden")return o=am(u,g),u.lanes=536870912,ff(null,o);if(Yx(u),(o=rn)?(o=x_(o,Ri),o=o!==null&&o.data==="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:Js!==null?{id:Ea,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},h=HE(o),h.return=u,u.child=h,fr=u,rn=null)):o=null,o===null)throw to(u);return u.lanes=536870912,null}return am(u,g)}var N=o.memoizedState;if(N!==null){var T=N.dehydrated;if(Yx(u),S)if(u.flags&256)u.flags&=-257,u=oz(o,u,h);else if(u.memoizedState!==null)u.child=o.child,u.flags|=128,u=null;else throw Error(r(558));else if(Ln||Yc(o,u,h,!1),S=(h&o.childLanes)!==0,Ln||S){if(g=Zt,g!==null&&(T=cr(g,h),T!==0&&T!==N.retryLane))throw N.retryLane=T,pl(o,T),ni(g,o,T),gb;gm(),u=oz(o,u,h)}else o=N.treeContext,rn=Mi(T.nextSibling),fr=u,Tt=!0,eo=null,Ri=!1,o!==null&&VE(u,o),u=am(u,g),u.flags|=4096;return u}return o=os(o.child,{mode:g.mode,children:g.children}),o.ref=u.ref,u.child=o,o.return=u,o}function sm(o,u){var h=u.ref;if(h===null)o!==null&&o.ref!==null&&(u.flags|=4194816);else{if(typeof h!="function"&&typeof h!="object")throw Error(r(284));(o===null||o.ref!==h)&&(u.flags|=4194816)}}function yb(o,u,h,g,S){return vl(u),h=Zx(o,u,h,g,void 0,S),g=Xx(),o!==null&&!Ln?(Jx(o,u,S),hs(o,u,S)):(Tt&&g&&Tx(u),u.flags|=1,pr(o,u,h,S),u.child)}function lz(o,u,h,g,S,N){return vl(u),u.updateQueue=null,h=dO(u,g,h,S),uO(o),g=Xx(),o!==null&&!Ln?(Jx(o,u,N),hs(o,u,N)):(Tt&&g&&Tx(u),u.flags|=1,pr(o,u,h,N),u.child)}function cz(o,u,h,g,S){if(vl(u),u.stateNode===null){var N=Kc,T=h.contextType;typeof T=="object"&&T!==null&&(N=hr(T)),N=new h(g,N),u.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=pb,u.stateNode=N,N._reactInternals=u,N=u.stateNode,N.props=g,N.state=u.memoizedState,N.refs={},Fx(u),T=h.contextType,N.context=typeof T=="object"&&T!==null?hr(T):Kc,N.state=u.memoizedState,T=h.getDerivedStateFromProps,typeof T=="function"&&(hb(u,h,T,g),N.state=u.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(T=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),T!==N.state&&pb.enqueueReplaceState(N,N.state,null),of(u,g,N,S),sf(),N.state=u.memoizedState),typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!0}else if(o===null){N=u.stateNode;var B=u.memoizedProps,Q=Nl(h,B);N.props=Q;var oe=N.context,ge=h.contextType;T=Kc,typeof ge=="object"&&ge!==null&&(T=hr(ge));var we=h.getDerivedStateFromProps;ge=typeof we=="function"||typeof N.getSnapshotBeforeUpdate=="function",B=u.pendingProps!==B,ge||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B||oe!==T)&&YO(u,N,g,T),ro=!1;var ce=u.memoizedState;N.state=ce,of(u,g,N,S),sf(),oe=u.memoizedState,B||ce!==oe||ro?(typeof we=="function"&&(hb(u,h,we,g),oe=u.memoizedState),(Q=ro||QO(u,h,Q,g,ce,oe,T))?(ge||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(u.flags|=4194308)):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=g,u.memoizedState=oe),N.props=g,N.state=oe,N.context=T,g=Q):(typeof N.componentDidMount=="function"&&(u.flags|=4194308),g=!1)}else{N=u.stateNode,Hx(o,u),T=u.memoizedProps,ge=Nl(h,T),N.props=ge,we=u.pendingProps,ce=N.context,oe=h.contextType,Q=Kc,typeof oe=="object"&&oe!==null&&(Q=hr(oe)),B=h.getDerivedStateFromProps,(oe=typeof B=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(T!==we||ce!==Q)&&YO(u,N,g,Q),ro=!1,ce=u.memoizedState,N.state=ce,of(u,g,N,S),sf();var fe=u.memoizedState;T!==we||ce!==fe||ro||o!==null&&o.dependencies!==null&&Up(o.dependencies)?(typeof B=="function"&&(hb(u,h,B,g),fe=u.memoizedState),(ge=ro||QO(u,h,ge,g,ce,fe,Q)||o!==null&&o.dependencies!==null&&Up(o.dependencies))?(oe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(g,fe,Q),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(g,fe,Q)),typeof N.componentDidUpdate=="function"&&(u.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof N.componentDidUpdate!="function"||T===o.memoizedProps&&ce===o.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===o.memoizedProps&&ce===o.memoizedState||(u.flags|=1024),u.memoizedProps=g,u.memoizedState=fe),N.props=g,N.state=fe,N.context=Q,g=ge):(typeof N.componentDidUpdate!="function"||T===o.memoizedProps&&ce===o.memoizedState||(u.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||T===o.memoizedProps&&ce===o.memoizedState||(u.flags|=1024),g=!1)}return N=g,sm(o,u),g=(u.flags&128)!==0,N||g?(N=u.stateNode,h=g&&typeof h.getDerivedStateFromError!="function"?null:N.render(),u.flags|=1,o!==null&&g?(u.child=Sl(u,o.child,null,S),u.child=Sl(u,null,h,S)):pr(o,u,h,S),u.memoizedState=N.state,o=u.child):o=hs(o,u,S),o}function uz(o,u,h,g){return gl(),u.flags|=256,pr(o,u,h,g),u.child}var vb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xb(o){return{baseLanes:o,cachePool:JE()}}function bb(o,u,h){return o=o!==null?o.childLanes&~h:0,u&&(o|=bi),o}function dz(o,u,h){var g=u.pendingProps,S=!1,N=(u.flags&128)!==0,T;if((T=N)||(T=o!==null&&o.memoizedState===null?!1:(En.current&2)!==0),T&&(S=!0,u.flags&=-129),T=(u.flags&32)!==0,u.flags&=-33,o===null){if(Tt){if(S?so(u):oo(),(o=rn)?(o=x_(o,Ri),o=o!==null&&o.data!=="&"?o:null,o!==null&&(u.memoizedState={dehydrated:o,treeContext:Js!==null?{id:Ea,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},h=HE(o),h.return=u,u.child=h,fr=u,rn=null)):o=null,o===null)throw to(u);return nw(o)?u.lanes=32:u.lanes=536870912,null}var B=g.children;return g=g.fallback,S?(oo(),S=u.mode,B=om({mode:"hidden",children:B},S),g=ml(g,S,h,null),B.return=u,g.return=u,B.sibling=g,u.child=B,g=u.child,g.memoizedState=xb(h),g.childLanes=bb(o,T,h),u.memoizedState=vb,ff(null,g)):(so(u),wb(u,B))}var Q=o.memoizedState;if(Q!==null&&(B=Q.dehydrated,B!==null)){if(N)u.flags&256?(so(u),u.flags&=-257,u=Sb(o,u,h)):u.memoizedState!==null?(oo(),u.child=o.child,u.flags|=128,u=null):(oo(),B=g.fallback,S=u.mode,g=om({mode:"visible",children:g.children},S),B=ml(B,S,h,null),B.flags|=2,g.return=u,B.return=u,g.sibling=B,u.child=g,Sl(u,o.child,null,h),g=u.child,g.memoizedState=xb(h),g.childLanes=bb(o,T,h),u.memoizedState=vb,u=ff(null,g));else if(so(u),nw(B)){if(T=B.nextSibling&&B.nextSibling.dataset,T)var oe=T.dgst;T=oe,g=Error(r(419)),g.stack="",g.digest=T,Jd({value:g,source:null,stack:null}),u=Sb(o,u,h)}else if(Ln||Yc(o,u,h,!1),T=(h&o.childLanes)!==0,Ln||T){if(T=Zt,T!==null&&(g=cr(T,h),g!==0&&g!==Q.retryLane))throw Q.retryLane=g,pl(o,g),ni(T,o,g),gb;tw(B)||gm(),u=Sb(o,u,h)}else tw(B)?(u.flags|=192,u.child=o.child,u=null):(o=Q.treeContext,rn=Mi(B.nextSibling),fr=u,Tt=!0,eo=null,Ri=!1,o!==null&&VE(u,o),u=wb(u,g.children),u.flags|=4096);return u}return S?(oo(),B=g.fallback,S=u.mode,Q=o.child,oe=Q.sibling,g=os(Q,{mode:"hidden",children:g.children}),g.subtreeFlags=Q.subtreeFlags&65011712,oe!==null?B=os(oe,B):(B=ml(B,S,h,null),B.flags|=2),B.return=u,g.return=u,g.sibling=B,u.child=g,ff(null,g),g=u.child,B=o.child.memoizedState,B===null?B=xb(h):(S=B.cachePool,S!==null?(Q=Mn._currentValue,S=S.parent!==Q?{parent:Q,pool:Q}:S):S=JE(),B={baseLanes:B.baseLanes|h,cachePool:S}),g.memoizedState=B,g.childLanes=bb(o,T,h),u.memoizedState=vb,ff(o.child,g)):(so(u),h=o.child,o=h.sibling,h=os(h,{mode:"visible",children:g.children}),h.return=u,h.sibling=null,o!==null&&(T=u.deletions,T===null?(u.deletions=[o],u.flags|=16):T.push(o)),u.child=h,u.memoizedState=null,h)}function wb(o,u){return u=om({mode:"visible",children:u},o.mode),u.return=o,o.child=u}function om(o,u){return o=gi(22,o,null,u),o.lanes=0,o}function Sb(o,u,h){return Sl(u,o.child,null,h),o=wb(u,u.pendingProps.children),o.flags|=2,u.memoizedState=null,o}function fz(o,u,h){o.lanes|=u;var g=o.alternate;g!==null&&(g.lanes|=u),Ix(o.return,u,h)}function jb(o,u,h,g,S,N){var T=o.memoizedState;T===null?o.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:g,tail:h,tailMode:S,treeForkCount:N}:(T.isBackwards=u,T.rendering=null,T.renderingStartTime=0,T.last=g,T.tail=h,T.tailMode=S,T.treeForkCount=N)}function hz(o,u,h){var g=u.pendingProps,S=g.revealOrder,N=g.tail;g=g.children;var T=En.current,B=(T&2)!==0;if(B?(T=T&1|2,u.flags|=128):T&=1,D(En,T),pr(o,u,g,h),g=Tt?Xd:0,!B&&o!==null&&(o.flags&128)!==0)e:for(o=u.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&fz(o,h,u);else if(o.tag===19)fz(o,h,u);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===u)break e;for(;o.sibling===null;){if(o.return===null||o.return===u)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}switch(S){case"forwards":for(h=u.child,S=null;h!==null;)o=h.alternate,o!==null&&Yp(o)===null&&(S=h),h=h.sibling;h=S,h===null?(S=u.child,u.child=null):(S=h.sibling,h.sibling=null),jb(u,!1,S,h,N,g);break;case"backwards":case"unstable_legacy-backwards":for(h=null,S=u.child,u.child=null;S!==null;){if(o=S.alternate,o!==null&&Yp(o)===null){u.child=S;break}o=S.sibling,S.sibling=h,h=S,S=o}jb(u,!0,h,null,N,g);break;case"together":jb(u,!1,null,null,void 0,g);break;default:u.memoizedState=null}return u.child}function hs(o,u,h){if(o!==null&&(u.dependencies=o.dependencies),uo|=u.lanes,(h&u.childLanes)===0)if(o!==null){if(Yc(o,u,h,!1),(h&u.childLanes)===0)return null}else return null;if(o!==null&&u.child!==o.child)throw Error(r(153));if(u.child!==null){for(o=u.child,h=os(o,o.pendingProps),u.child=h,h.return=u;o.sibling!==null;)o=o.sibling,h=h.sibling=os(o,o.pendingProps),h.return=u;h.sibling=null}return u.child}function Nb(o,u){return(o.lanes&u)!==0?!0:(o=o.dependencies,!!(o!==null&&Up(o)))}function $H(o,u,h){switch(u.tag){case 3:Te(u,u.stateNode.containerInfo),no(u,Mn,o.memoizedState.cache),gl();break;case 27:case 5:he(u);break;case 4:Te(u,u.stateNode.containerInfo);break;case 10:no(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Yx(u),null;break;case 13:var g=u.memoizedState;if(g!==null)return g.dehydrated!==null?(so(u),u.flags|=128,null):(h&u.child.childLanes)!==0?dz(o,u,h):(so(u),o=hs(o,u,h),o!==null?o.sibling:null);so(u);break;case 19:var S=(o.flags&128)!==0;if(g=(h&u.childLanes)!==0,g||(Yc(o,u,h,!1),g=(h&u.childLanes)!==0),S){if(g)return hz(o,u,h);u.flags|=128}if(S=u.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),D(En,En.current),g)break;return null;case 22:return u.lanes=0,az(o,u,h,u.pendingProps);case 24:no(u,Mn,o.memoizedState.cache)}return hs(o,u,h)}function pz(o,u,h){if(o!==null)if(o.memoizedProps!==u.pendingProps)Ln=!0;else{if(!Nb(o,h)&&(u.flags&128)===0)return Ln=!1,$H(o,u,h);Ln=(o.flags&131072)!==0}else Ln=!1,Tt&&(u.flags&1048576)!==0&&GE(u,Xd,u.index);switch(u.lanes=0,u.tag){case 16:e:{var g=u.pendingProps;if(o=bl(u.elementType),u.type=o,typeof o=="function")Ox(o)?(g=Nl(o,g),u.tag=1,u=cz(null,u,o,g,h)):(u.tag=0,u=yb(null,u,o,g,h));else{if(o!=null){var S=o.$$typeof;if(S===C){u.tag=11,u=nz(null,u,o,g,h);break e}else if(S===z){u.tag=14,u=rz(null,u,o,g,h);break e}}throw u=Z(o)||o,Error(r(306,u,""))}}return u;case 0:return yb(o,u,u.type,u.pendingProps,h);case 1:return g=u.type,S=Nl(g,u.pendingProps),cz(o,u,g,S,h);case 3:e:{if(Te(u,u.stateNode.containerInfo),o===null)throw Error(r(387));g=u.pendingProps;var N=u.memoizedState;S=N.element,Hx(o,u),of(u,g,null,h);var T=u.memoizedState;if(g=T.cache,no(u,Mn,g),g!==N.cache&&Lx(u,[Mn],h,!0),sf(),g=T.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:T.cache},u.updateQueue.baseState=N,u.memoizedState=N,u.flags&256){u=uz(o,u,g,h);break e}else if(g!==S){S=_i(Error(r(424)),u),Jd(S),u=uz(o,u,g,h);break e}else for(o=u.stateNode.containerInfo,o.nodeType===9?o=o.body:o=o.nodeName==="HTML"?o.ownerDocument.body:o,rn=Mi(o.firstChild),fr=u,Tt=!0,eo=null,Ri=!0,h=aO(u,null,g,h),u.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(gl(),g===S){u=hs(o,u,h);break e}pr(o,u,g,h)}u=u.child}return u;case 26:return sm(o,u),o===null?(h=k_(u.type,null,u.pendingProps,null))?u.memoizedState=h:Tt||(h=u.type,o=u.pendingProps,g=jm(ee.current).createElement(h),g[Dn]=u,g[ur]=o,mr(g,h,o),G(g),u.stateNode=g):u.memoizedState=k_(u.type,o.memoizedProps,u.pendingProps,o.memoizedState),null;case 27:return he(u),o===null&&Tt&&(g=u.stateNode=S_(u.type,u.pendingProps,ee.current),fr=u,Ri=!0,S=rn,go(u.type)?(rw=S,rn=Mi(g.firstChild)):rn=S),pr(o,u,u.pendingProps.children,h),sm(o,u),o===null&&(u.flags|=4194304),u.child;case 5:return o===null&&Tt&&((S=g=rn)&&(g=mK(g,u.type,u.pendingProps,Ri),g!==null?(u.stateNode=g,fr=u,rn=Mi(g.firstChild),Ri=!1,S=!0):S=!1),S||to(u)),he(u),S=u.type,N=u.pendingProps,T=o!==null?o.memoizedProps:null,g=N.children,Xb(S,N)?g=null:T!==null&&Xb(S,T)&&(u.flags|=32),u.memoizedState!==null&&(S=Zx(o,u,zH,null,null,h),Af._currentValue=S),sm(o,u),pr(o,u,g,h),u.child;case 6:return o===null&&Tt&&((o=h=rn)&&(h=gK(h,u.pendingProps,Ri),h!==null?(u.stateNode=h,fr=u,rn=null,o=!0):o=!1),o||to(u)),null;case 13:return dz(o,u,h);case 4:return Te(u,u.stateNode.containerInfo),g=u.pendingProps,o===null?u.child=Sl(u,null,g,h):pr(o,u,g,h),u.child;case 11:return nz(o,u,u.type,u.pendingProps,h);case 7:return pr(o,u,u.pendingProps,h),u.child;case 8:return pr(o,u,u.pendingProps.children,h),u.child;case 12:return pr(o,u,u.pendingProps.children,h),u.child;case 10:return g=u.pendingProps,no(u,u.type,g.value),pr(o,u,g.children,h),u.child;case 9:return S=u.type._context,g=u.pendingProps.children,vl(u),S=hr(S),g=g(S),u.flags|=1,pr(o,u,g,h),u.child;case 14:return rz(o,u,u.type,u.pendingProps,h);case 15:return iz(o,u,u.type,u.pendingProps,h);case 19:return hz(o,u,h);case 31:return LH(o,u,h);case 22:return az(o,u,h,u.pendingProps);case 24:return vl(u),g=hr(Mn),o===null?(S=Ux(),S===null&&(S=Zt,N=$x(),S.pooledCache=N,N.refCount++,N!==null&&(S.pooledCacheLanes|=h),S=N),u.memoizedState={parent:g,cache:S},Fx(u),no(u,Mn,S)):((o.lanes&h)!==0&&(Hx(o,u),of(u,null,null,h),sf()),S=o.memoizedState,N=u.memoizedState,S.parent!==g?(S={parent:g,cache:g},u.memoizedState=S,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=S),no(u,Mn,g)):(g=N.cache,no(u,Mn,g),g!==S.cache&&Lx(u,[Mn],h,!0))),pr(o,u,u.pendingProps.children,h),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function ps(o){o.flags|=4}function kb(o,u,h,g,S){if((u=(o.mode&32)!==0)&&(u=!1),u){if(o.flags|=16777216,(S&335544128)===S)if(o.stateNode.complete)o.flags|=8192;else if(Uz())o.flags|=8192;else throw wl=Kp,qx}else o.flags&=-16777217}function mz(o,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!z_(u))if(Uz())o.flags|=8192;else throw wl=Kp,qx}function lm(o,u){u!==null&&(o.flags|=4),o.flags&16384&&(u=o.tag!==22?mt():536870912,o.lanes|=u,ou|=u)}function hf(o,u){if(!Tt)switch(o.tailMode){case"hidden":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?o.tail=null:h.sibling=null;break;case"collapsed":h=o.tail;for(var g=null;h!==null;)h.alternate!==null&&(g=h),h=h.sibling;g===null?u||o.tail===null?o.tail=null:o.tail.sibling=null:g.sibling=null}}function an(o){var u=o.alternate!==null&&o.alternate.child===o.child,h=0,g=0;if(u)for(var S=o.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=o,S=S.sibling;else for(S=o.child;S!==null;)h|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=o,S=S.sibling;return o.subtreeFlags|=g,o.childLanes=h,u}function BH(o,u,h){var g=u.pendingProps;switch(Px(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(u),null;case 1:return an(u),null;case 3:return h=u.stateNode,g=null,o!==null&&(g=o.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),us(Mn),ne(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(o===null||o.child===null)&&(Qc(u)?ps(u):o===null||o.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,Dx())),an(u),null;case 26:var S=u.type,N=u.memoizedState;return o===null?(ps(u),N!==null?(an(u),mz(u,N)):(an(u),kb(u,S,null,g,h))):N?N!==o.memoizedState?(ps(u),an(u),mz(u,N)):(an(u),u.flags&=-16777217):(o=o.memoizedProps,o!==g&&ps(u),an(u),kb(u,S,o,g,h)),null;case 27:if(je(u),h=ee.current,S=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==g&&ps(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return an(u),null}o=V.current,Qc(u)?QE(u):(o=S_(S,g,h),u.stateNode=o,ps(u))}return an(u),null;case 5:if(je(u),S=u.type,o!==null&&u.stateNode!=null)o.memoizedProps!==g&&ps(u);else{if(!g){if(u.stateNode===null)throw Error(r(166));return an(u),null}if(N=V.current,Qc(u))QE(u);else{var T=jm(ee.current);switch(N){case 1:N=T.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:N=T.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":N=T.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":N=T.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":N=T.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof g.is=="string"?T.createElement("select",{is:g.is}):T.createElement("select"),g.multiple?N.multiple=!0:g.size&&(N.size=g.size);break;default:N=typeof g.is=="string"?T.createElement(S,{is:g.is}):T.createElement(S)}}N[Dn]=u,N[ur]=g;e:for(T=u.child;T!==null;){if(T.tag===5||T.tag===6)N.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===u)break e;for(;T.sibling===null;){if(T.return===null||T.return===u)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}u.stateNode=N;e:switch(mr(N,S,g),S){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ps(u)}}return an(u),kb(u,u.type,o===null?null:o.memoizedProps,u.pendingProps,h),null;case 6:if(o&&u.stateNode!=null)o.memoizedProps!==g&&ps(u);else{if(typeof g!="string"&&u.stateNode===null)throw Error(r(166));if(o=ee.current,Qc(u)){if(o=u.stateNode,h=u.memoizedProps,g=null,S=fr,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}o[Dn]=u,o=!!(o.nodeValue===h||g!==null&&g.suppressHydrationWarning===!0||d_(o.nodeValue,h)),o||to(u,!0)}else o=jm(o).createTextNode(g),o[Dn]=u,u.stateNode=o}return an(u),null;case 31:if(h=u.memoizedState,o===null||o.memoizedState!==null){if(g=Qc(u),h!==null){if(o===null){if(!g)throw Error(r(318));if(o=u.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(557));o[Dn]=u}else gl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;an(u),o=!1}else h=Dx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=h),o=!0;if(!o)return u.flags&256?(vi(u),u):(vi(u),null);if((u.flags&128)!==0)throw Error(r(558))}return an(u),null;case 13:if(g=u.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(S=Qc(u),g!==null&&g.dehydrated!==null){if(o===null){if(!S)throw Error(r(318));if(S=u.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(r(317));S[Dn]=u}else gl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;an(u),S=!1}else S=Dx(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=S),S=!0;if(!S)return u.flags&256?(vi(u),u):(vi(u),null)}return vi(u),(u.flags&128)!==0?(u.lanes=h,u):(h=g!==null,o=o!==null&&o.memoizedState!==null,h&&(g=u.child,S=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(S=g.alternate.memoizedState.cachePool.pool),N=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(N=g.memoizedState.cachePool.pool),N!==S&&(g.flags|=2048)),h!==o&&h&&(u.child.flags|=8192),lm(u,u.updateQueue),an(u),null);case 4:return ne(),o===null&&Vb(u.stateNode.containerInfo),an(u),null;case 10:return us(u.type),an(u),null;case 19:if(I(En),g=u.memoizedState,g===null)return an(u),null;if(S=(u.flags&128)!==0,N=g.rendering,N===null)if(S)hf(g,!1);else{if(Nn!==0||o!==null&&(o.flags&128)!==0)for(o=u.child;o!==null;){if(N=Yp(o),N!==null){for(u.flags|=128,hf(g,!1),o=N.updateQueue,u.updateQueue=o,lm(u,o),u.subtreeFlags=0,o=h,h=u.child;h!==null;)FE(h,o),h=h.sibling;return D(En,En.current&1|2),Tt&&ls(u,g.treeForkCount),u.child}o=o.sibling}g.tail!==null&&Kt()>hm&&(u.flags|=128,S=!0,hf(g,!1),u.lanes=4194304)}else{if(!S)if(o=Yp(N),o!==null){if(u.flags|=128,S=!0,o=o.updateQueue,u.updateQueue=o,lm(u,o),hf(g,!0),g.tail===null&&g.tailMode==="hidden"&&!N.alternate&&!Tt)return an(u),null}else 2*Kt()-g.renderingStartTime>hm&&h!==536870912&&(u.flags|=128,S=!0,hf(g,!1),u.lanes=4194304);g.isBackwards?(N.sibling=u.child,u.child=N):(o=g.last,o!==null?o.sibling=N:u.child=N,g.last=N)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=Kt(),o.sibling=null,h=En.current,D(En,S?h&1|2:h&1),Tt&&ls(u,g.treeForkCount),o):(an(u),null);case 22:case 23:return vi(u),Qx(),g=u.memoizedState!==null,o!==null?o.memoizedState!==null!==g&&(u.flags|=8192):g&&(u.flags|=8192),g?(h&536870912)!==0&&(u.flags&128)===0&&(an(u),u.subtreeFlags&6&&(u.flags|=8192)):an(u),h=u.updateQueue,h!==null&&lm(u,h.retryQueue),h=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==h&&(u.flags|=2048),o!==null&&I(xl),null;case 24:return h=null,o!==null&&(h=o.memoizedState.cache),u.memoizedState.cache!==h&&(u.flags|=2048),us(Mn),an(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function UH(o,u){switch(Px(u),u.tag){case 1:return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 3:return us(Mn),ne(),o=u.flags,(o&65536)!==0&&(o&128)===0?(u.flags=o&-65537|128,u):null;case 26:case 27:case 5:return je(u),null;case 31:if(u.memoizedState!==null){if(vi(u),u.alternate===null)throw Error(r(340));gl()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 13:if(vi(u),o=u.memoizedState,o!==null&&o.dehydrated!==null){if(u.alternate===null)throw Error(r(340));gl()}return o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 19:return I(En),null;case 4:return ne(),null;case 10:return us(u.type),null;case 22:case 23:return vi(u),Qx(),o!==null&&I(xl),o=u.flags,o&65536?(u.flags=o&-65537|128,u):null;case 24:return us(Mn),null;case 25:return null;default:return null}}function gz(o,u){switch(Px(u),u.tag){case 3:us(Mn),ne();break;case 26:case 27:case 5:je(u);break;case 4:ne();break;case 31:u.memoizedState!==null&&vi(u);break;case 13:vi(u);break;case 19:I(En);break;case 10:us(u.type);break;case 22:case 23:vi(u),Qx(),o!==null&&I(xl);break;case 24:us(Mn)}}function pf(o,u){try{var h=u.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var S=g.next;h=S;do{if((h.tag&o)===o){g=void 0;var N=h.create,T=h.inst;g=N(),T.destroy=g}h=h.next}while(h!==S)}}catch(B){Ht(u,u.return,B)}}function lo(o,u,h){try{var g=u.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var N=S.next;g=N;do{if((g.tag&o)===o){var T=g.inst,B=T.destroy;if(B!==void 0){T.destroy=void 0,S=u;var Q=h,oe=B;try{oe()}catch(ge){Ht(S,Q,ge)}}}g=g.next}while(g!==N)}}catch(ge){Ht(u,u.return,ge)}}function yz(o){var u=o.updateQueue;if(u!==null){var h=o.stateNode;try{oO(u,h)}catch(g){Ht(o,o.return,g)}}}function vz(o,u,h){h.props=Nl(o.type,o.memoizedProps),h.state=o.memoizedState;try{h.componentWillUnmount()}catch(g){Ht(o,u,g)}}function mf(o,u){try{var h=o.ref;if(h!==null){switch(o.tag){case 26:case 27:case 5:var g=o.stateNode;break;case 30:g=o.stateNode;break;default:g=o.stateNode}typeof h=="function"?o.refCleanup=h(g):h.current=g}}catch(S){Ht(o,u,S)}}function za(o,u){var h=o.ref,g=o.refCleanup;if(h!==null)if(typeof g=="function")try{g()}catch(S){Ht(o,u,S)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(S){Ht(o,u,S)}else h.current=null}function xz(o){var u=o.type,h=o.memoizedProps,g=o.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":h.autoFocus&&g.focus();break e;case"img":h.src?g.src=h.src:h.srcSet&&(g.srcset=h.srcSet)}}catch(S){Ht(o,o.return,S)}}function Cb(o,u,h){try{var g=o.stateNode;cK(g,o.type,h,u),g[ur]=u}catch(S){Ht(o,o.return,S)}}function bz(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&go(o.type)||o.tag===4}function Ab(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||bz(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&&go(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 Eb(o,u,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,u?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(o,u):(u=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,u.appendChild(o),h=h._reactRootContainer,h!=null||u.onclick!==null||(u.onclick=as));else if(g!==4&&(g===27&&go(o.type)&&(h=o.stateNode,u=null),o=o.child,o!==null))for(Eb(o,u,h),o=o.sibling;o!==null;)Eb(o,u,h),o=o.sibling}function cm(o,u,h){var g=o.tag;if(g===5||g===6)o=o.stateNode,u?h.insertBefore(o,u):h.appendChild(o);else if(g!==4&&(g===27&&go(o.type)&&(h=o.stateNode),o=o.child,o!==null))for(cm(o,u,h),o=o.sibling;o!==null;)cm(o,u,h),o=o.sibling}function wz(o){var u=o.stateNode,h=o.memoizedProps;try{for(var g=o.type,S=u.attributes;S.length;)u.removeAttributeNode(S[0]);mr(u,g,h),u[Dn]=o,u[ur]=h}catch(N){Ht(o,o.return,N)}}var ms=!1,$n=!1,Ob=!1,Sz=typeof WeakSet=="function"?WeakSet:Set,er=null;function qH(o,u){if(o=o.containerInfo,Wb=zm,o=RE(o),Sx(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var g=h.getSelection&&h.getSelection();if(g&&g.rangeCount!==0){h=g.anchorNode;var S=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{h.nodeType,N.nodeType}catch{h=null;break e}var T=0,B=-1,Q=-1,oe=0,ge=0,we=o,ce=null;t:for(;;){for(var fe;we!==h||S!==0&&we.nodeType!==3||(B=T+S),we!==N||g!==0&&we.nodeType!==3||(Q=T+g),we.nodeType===3&&(T+=we.nodeValue.length),(fe=we.firstChild)!==null;)ce=we,we=fe;for(;;){if(we===o)break t;if(ce===h&&++oe===S&&(B=T),ce===N&&++ge===g&&(Q=T),(fe=we.nextSibling)!==null)break;we=ce,ce=we.parentNode}we=fe}h=B===-1||Q===-1?null:{start:B,end:Q}}else h=null}h=h||{start:0,end:0}}else h=null;for(Zb={focusedElem:o,selectionRange:h},zm=!1,er=u;er!==null;)if(u=er,o=u.child,(u.subtreeFlags&1028)!==0&&o!==null)o.return=u,er=o;else for(;er!==null;){switch(u=er,N=u.alternate,o=u.flags,u.tag){case 0:if((o&4)!==0&&(o=u.updateQueue,o=o!==null?o.events:null,o!==null))for(h=0;h<o.length;h++)S=o[h],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((o&1024)!==0&&N!==null){o=void 0,h=u,S=N.memoizedProps,N=N.memoizedState,g=h.stateNode;try{var Le=Nl(h.type,S);o=g.getSnapshotBeforeUpdate(Le,N),g.__reactInternalSnapshotBeforeUpdate=o}catch(et){Ht(h,h.return,et)}}break;case 3:if((o&1024)!==0){if(o=u.stateNode.containerInfo,h=o.nodeType,h===9)ew(o);else if(h===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":ew(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=u.sibling,o!==null){o.return=u.return,er=o;break}er=u.return}}function jz(o,u,h){var g=h.flags;switch(h.tag){case 0:case 11:case 15:ys(o,h),g&4&&pf(5,h);break;case 1:if(ys(o,h),g&4)if(o=h.stateNode,u===null)try{o.componentDidMount()}catch(T){Ht(h,h.return,T)}else{var S=Nl(h.type,u.memoizedProps);u=u.memoizedState;try{o.componentDidUpdate(S,u,o.__reactInternalSnapshotBeforeUpdate)}catch(T){Ht(h,h.return,T)}}g&64&&yz(h),g&512&&mf(h,h.return);break;case 3:if(ys(o,h),g&64&&(o=h.updateQueue,o!==null)){if(u=null,h.child!==null)switch(h.child.tag){case 27:case 5:u=h.child.stateNode;break;case 1:u=h.child.stateNode}try{oO(o,u)}catch(T){Ht(h,h.return,T)}}break;case 27:u===null&&g&4&&wz(h);case 26:case 5:ys(o,h),u===null&&g&4&&xz(h),g&512&&mf(h,h.return);break;case 12:ys(o,h);break;case 31:ys(o,h),g&4&&Cz(o,h);break;case 13:ys(o,h),g&4&&Az(o,h),g&64&&(o=h.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(h=ZH.bind(null,h),yK(o,h))));break;case 22:if(g=h.memoizedState!==null||ms,!g){u=u!==null&&u.memoizedState!==null||$n,S=ms;var N=$n;ms=g,($n=u)&&!N?vs(o,h,(h.subtreeFlags&8772)!==0):ys(o,h),ms=S,$n=N}break;case 30:break;default:ys(o,h)}}function Nz(o){var u=o.alternate;u!==null&&(o.alternate=null,Nz(u)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(u=o.stateNode,u!==null&&Ud(u)),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 dn=null,Xr=!1;function gs(o,u,h){for(h=h.child;h!==null;)kz(o,u,h),h=h.sibling}function kz(o,u,h){if(Fe&&typeof Fe.onCommitFiberUnmount=="function")try{Fe.onCommitFiberUnmount(ae,h)}catch{}switch(h.tag){case 26:$n||za(h,u),gs(o,u,h),h.memoizedState?h.memoizedState.count--:h.stateNode&&(h=h.stateNode,h.parentNode.removeChild(h));break;case 27:$n||za(h,u);var g=dn,S=Xr;go(h.type)&&(dn=h.stateNode,Xr=!1),gs(o,u,h),Nf(h.stateNode),dn=g,Xr=S;break;case 5:$n||za(h,u);case 6:if(g=dn,S=Xr,dn=null,gs(o,u,h),dn=g,Xr=S,dn!==null)if(Xr)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(h.stateNode)}catch(N){Ht(h,u,N)}else try{dn.removeChild(h.stateNode)}catch(N){Ht(h,u,N)}break;case 18:dn!==null&&(Xr?(o=dn,y_(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,h.stateNode),mu(o)):y_(dn,h.stateNode));break;case 4:g=dn,S=Xr,dn=h.stateNode.containerInfo,Xr=!0,gs(o,u,h),dn=g,Xr=S;break;case 0:case 11:case 14:case 15:lo(2,h,u),$n||lo(4,h,u),gs(o,u,h);break;case 1:$n||(za(h,u),g=h.stateNode,typeof g.componentWillUnmount=="function"&&vz(h,u,g)),gs(o,u,h);break;case 21:gs(o,u,h);break;case 22:$n=(g=$n)||h.memoizedState!==null,gs(o,u,h),$n=g;break;default:gs(o,u,h)}}function Cz(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null))){o=o.dehydrated;try{mu(o)}catch(h){Ht(u,u.return,h)}}}function Az(o,u){if(u.memoizedState===null&&(o=u.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{mu(o)}catch(h){Ht(u,u.return,h)}}function FH(o){switch(o.tag){case 31:case 13:case 19:var u=o.stateNode;return u===null&&(u=o.stateNode=new Sz),u;case 22:return o=o.stateNode,u=o._retryCache,u===null&&(u=o._retryCache=new Sz),u;default:throw Error(r(435,o.tag))}}function um(o,u){var h=FH(o);u.forEach(function(g){if(!h.has(g)){h.add(g);var S=XH.bind(null,o,g);g.then(S,S)}})}function Jr(o,u){var h=u.deletions;if(h!==null)for(var g=0;g<h.length;g++){var S=h[g],N=o,T=u,B=T;e:for(;B!==null;){switch(B.tag){case 27:if(go(B.type)){dn=B.stateNode,Xr=!1;break e}break;case 5:dn=B.stateNode,Xr=!1;break e;case 3:case 4:dn=B.stateNode.containerInfo,Xr=!0;break e}B=B.return}if(dn===null)throw Error(r(160));kz(N,T,S),dn=null,Xr=!1,N=S.alternate,N!==null&&(N.return=null),S.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)Ez(u,o),u=u.sibling}var ua=null;function Ez(o,u){var h=o.alternate,g=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:Jr(u,o),ei(o),g&4&&(lo(3,o,o.return),pf(3,o),lo(5,o,o.return));break;case 1:Jr(u,o),ei(o),g&512&&($n||h===null||za(h,h.return)),g&64&&ms&&(o=o.updateQueue,o!==null&&(g=o.callbacks,g!==null&&(h=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=h===null?g:h.concat(g))));break;case 26:var S=ua;if(Jr(u,o),ei(o),g&512&&($n||h===null||za(h,h.return)),g&4){var N=h!==null?h.memoizedState:null;if(g=o.memoizedState,h===null)if(g===null)if(o.stateNode===null){e:{g=o.type,h=o.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":N=S.getElementsByTagName("title")[0],(!N||N[Qs]||N[Dn]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=S.createElement(g),S.head.insertBefore(N,S.querySelector("head > title"))),mr(N,g,h),N[Dn]=o,G(N),g=N;break e;case"link":var T=E_("link","href",S).get(g+(h.href||""));if(T){for(var B=0;B<T.length;B++)if(N=T[B],N.getAttribute("href")===(h.href==null||h.href===""?null:h.href)&&N.getAttribute("rel")===(h.rel==null?null:h.rel)&&N.getAttribute("title")===(h.title==null?null:h.title)&&N.getAttribute("crossorigin")===(h.crossOrigin==null?null:h.crossOrigin)){T.splice(B,1);break t}}N=S.createElement(g),mr(N,g,h),S.head.appendChild(N);break;case"meta":if(T=E_("meta","content",S).get(g+(h.content||""))){for(B=0;B<T.length;B++)if(N=T[B],N.getAttribute("content")===(h.content==null?null:""+h.content)&&N.getAttribute("name")===(h.name==null?null:h.name)&&N.getAttribute("property")===(h.property==null?null:h.property)&&N.getAttribute("http-equiv")===(h.httpEquiv==null?null:h.httpEquiv)&&N.getAttribute("charset")===(h.charSet==null?null:h.charSet)){T.splice(B,1);break t}}N=S.createElement(g),mr(N,g,h),S.head.appendChild(N);break;default:throw Error(r(468,g))}N[Dn]=o,G(N),g=N}o.stateNode=g}else O_(S,o.type,o.stateNode);else o.stateNode=A_(S,g,o.memoizedProps);else N!==g?(N===null?h.stateNode!==null&&(h=h.stateNode,h.parentNode.removeChild(h)):N.count--,g===null?O_(S,o.type,o.stateNode):A_(S,g,o.memoizedProps)):g===null&&o.stateNode!==null&&Cb(o,o.memoizedProps,h.memoizedProps)}break;case 27:Jr(u,o),ei(o),g&512&&($n||h===null||za(h,h.return)),h!==null&&g&4&&Cb(o,o.memoizedProps,h.memoizedProps);break;case 5:if(Jr(u,o),ei(o),g&512&&($n||h===null||za(h,h.return)),o.flags&32){S=o.stateNode;try{Lc(S,"")}catch(Le){Ht(o,o.return,Le)}}g&4&&o.stateNode!=null&&(S=o.memoizedProps,Cb(o,S,h!==null?h.memoizedProps:S)),g&1024&&(Ob=!0);break;case 6:if(Jr(u,o),ei(o),g&4){if(o.stateNode===null)throw Error(r(162));g=o.memoizedProps,h=o.stateNode;try{h.nodeValue=g}catch(Le){Ht(o,o.return,Le)}}break;case 3:if(Cm=null,S=ua,ua=Nm(u.containerInfo),Jr(u,o),ua=S,ei(o),g&4&&h!==null&&h.memoizedState.isDehydrated)try{mu(u.containerInfo)}catch(Le){Ht(o,o.return,Le)}Ob&&(Ob=!1,Oz(o));break;case 4:g=ua,ua=Nm(o.stateNode.containerInfo),Jr(u,o),ei(o),ua=g;break;case 12:Jr(u,o),ei(o);break;case 31:Jr(u,o),ei(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,um(o,g)));break;case 13:Jr(u,o),ei(o),o.child.flags&8192&&o.memoizedState!==null!=(h!==null&&h.memoizedState!==null)&&(fm=Kt()),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,um(o,g)));break;case 22:S=o.memoizedState!==null;var Q=h!==null&&h.memoizedState!==null,oe=ms,ge=$n;if(ms=oe||S,$n=ge||Q,Jr(u,o),$n=ge,ms=oe,ei(o),g&8192)e:for(u=o.stateNode,u._visibility=S?u._visibility&-2:u._visibility|1,S&&(h===null||Q||ms||$n||kl(o)),h=null,u=o;;){if(u.tag===5||u.tag===26){if(h===null){Q=h=u;try{if(N=Q.stateNode,S)T=N.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{B=Q.stateNode;var we=Q.memoizedProps.style,ce=we!=null&&we.hasOwnProperty("display")?we.display:null;B.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Le){Ht(Q,Q.return,Le)}}}else if(u.tag===6){if(h===null){Q=u;try{Q.stateNode.nodeValue=S?"":Q.memoizedProps}catch(Le){Ht(Q,Q.return,Le)}}}else if(u.tag===18){if(h===null){Q=u;try{var fe=Q.stateNode;S?v_(fe,!0):v_(Q.stateNode,!1)}catch(Le){Ht(Q,Q.return,Le)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===o)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===o)break e;for(;u.sibling===null;){if(u.return===null||u.return===o)break e;h===u&&(h=null),u=u.return}h===u&&(h=null),u.sibling.return=u.return,u=u.sibling}g&4&&(g=o.updateQueue,g!==null&&(h=g.retryQueue,h!==null&&(g.retryQueue=null,um(o,h))));break;case 19:Jr(u,o),ei(o),g&4&&(g=o.updateQueue,g!==null&&(o.updateQueue=null,um(o,g)));break;case 30:break;case 21:break;default:Jr(u,o),ei(o)}}function ei(o){var u=o.flags;if(u&2){try{for(var h,g=o.return;g!==null;){if(bz(g)){h=g;break}g=g.return}if(h==null)throw Error(r(160));switch(h.tag){case 27:var S=h.stateNode,N=Ab(o);cm(o,N,S);break;case 5:var T=h.stateNode;h.flags&32&&(Lc(T,""),h.flags&=-33);var B=Ab(o);cm(o,B,T);break;case 3:case 4:var Q=h.stateNode.containerInfo,oe=Ab(o);Eb(o,oe,Q);break;default:throw Error(r(161))}}catch(ge){Ht(o,o.return,ge)}o.flags&=-3}u&4096&&(o.flags&=-4097)}function Oz(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var u=o;Oz(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),o=o.sibling}}function ys(o,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)jz(o,u.alternate,u),u=u.sibling}function kl(o){for(o=o.child;o!==null;){var u=o;switch(u.tag){case 0:case 11:case 14:case 15:lo(4,u,u.return),kl(u);break;case 1:za(u,u.return);var h=u.stateNode;typeof h.componentWillUnmount=="function"&&vz(u,u.return,h),kl(u);break;case 27:Nf(u.stateNode);case 26:case 5:za(u,u.return),kl(u);break;case 22:u.memoizedState===null&&kl(u);break;case 30:kl(u);break;default:kl(u)}o=o.sibling}}function vs(o,u,h){for(h=h&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var g=u.alternate,S=o,N=u,T=N.flags;switch(N.tag){case 0:case 11:case 15:vs(S,N,h),pf(4,N);break;case 1:if(vs(S,N,h),g=N,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(oe){Ht(g,g.return,oe)}if(g=N,S=g.updateQueue,S!==null){var B=g.stateNode;try{var Q=S.shared.hiddenCallbacks;if(Q!==null)for(S.shared.hiddenCallbacks=null,S=0;S<Q.length;S++)sO(Q[S],B)}catch(oe){Ht(g,g.return,oe)}}h&&T&64&&yz(N),mf(N,N.return);break;case 27:wz(N);case 26:case 5:vs(S,N,h),h&&g===null&&T&4&&xz(N),mf(N,N.return);break;case 12:vs(S,N,h);break;case 31:vs(S,N,h),h&&T&4&&Cz(S,N);break;case 13:vs(S,N,h),h&&T&4&&Az(S,N);break;case 22:N.memoizedState===null&&vs(S,N,h),mf(N,N.return);break;case 30:break;default:vs(S,N,h)}u=u.sibling}}function zb(o,u){var h=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),o=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(o=u.memoizedState.cachePool.pool),o!==h&&(o!=null&&o.refCount++,h!=null&&ef(h))}function _b(o,u){o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&ef(o))}function da(o,u,h,g){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)zz(o,u,h,g),u=u.sibling}function zz(o,u,h,g){var S=u.flags;switch(u.tag){case 0:case 11:case 15:da(o,u,h,g),S&2048&&pf(9,u);break;case 1:da(o,u,h,g);break;case 3:da(o,u,h,g),S&2048&&(o=null,u.alternate!==null&&(o=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==o&&(u.refCount++,o!=null&&ef(o)));break;case 12:if(S&2048){da(o,u,h,g),o=u.stateNode;try{var N=u.memoizedProps,T=N.id,B=N.onPostCommit;typeof B=="function"&&B(T,u.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(Q){Ht(u,u.return,Q)}}else da(o,u,h,g);break;case 31:da(o,u,h,g);break;case 13:da(o,u,h,g);break;case 23:break;case 22:N=u.stateNode,T=u.alternate,u.memoizedState!==null?N._visibility&2?da(o,u,h,g):gf(o,u):N._visibility&2?da(o,u,h,g):(N._visibility|=2,iu(o,u,h,g,(u.subtreeFlags&10256)!==0||!1)),S&2048&&zb(T,u);break;case 24:da(o,u,h,g),S&2048&&_b(u.alternate,u);break;default:da(o,u,h,g)}}function iu(o,u,h,g,S){for(S=S&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var N=o,T=u,B=h,Q=g,oe=T.flags;switch(T.tag){case 0:case 11:case 15:iu(N,T,B,Q,S),pf(8,T);break;case 23:break;case 22:var ge=T.stateNode;T.memoizedState!==null?ge._visibility&2?iu(N,T,B,Q,S):gf(N,T):(ge._visibility|=2,iu(N,T,B,Q,S)),S&&oe&2048&&zb(T.alternate,T);break;case 24:iu(N,T,B,Q,S),S&&oe&2048&&_b(T.alternate,T);break;default:iu(N,T,B,Q,S)}u=u.sibling}}function gf(o,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var h=o,g=u,S=g.flags;switch(g.tag){case 22:gf(h,g),S&2048&&zb(g.alternate,g);break;case 24:gf(h,g),S&2048&&_b(g.alternate,g);break;default:gf(h,g)}u=u.sibling}}var yf=8192;function au(o,u,h){if(o.subtreeFlags&yf)for(o=o.child;o!==null;)_z(o,u,h),o=o.sibling}function _z(o,u,h){switch(o.tag){case 26:au(o,u,h),o.flags&yf&&o.memoizedState!==null&&OK(h,ua,o.memoizedState,o.memoizedProps);break;case 5:au(o,u,h);break;case 3:case 4:var g=ua;ua=Nm(o.stateNode.containerInfo),au(o,u,h),ua=g;break;case 22:o.memoizedState===null&&(g=o.alternate,g!==null&&g.memoizedState!==null?(g=yf,yf=16777216,au(o,u,h),yf=g):au(o,u,h));break;default:au(o,u,h)}}function Tz(o){var u=o.alternate;if(u!==null&&(o=u.child,o!==null)){u.child=null;do u=o.sibling,o.sibling=null,o=u;while(o!==null)}}function vf(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];er=g,Rz(g,o)}Tz(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Pz(o),o=o.sibling}function Pz(o){switch(o.tag){case 0:case 11:case 15:vf(o),o.flags&2048&&lo(9,o,o.return);break;case 3:vf(o);break;case 12:vf(o);break;case 22:var u=o.stateNode;o.memoizedState!==null&&u._visibility&2&&(o.return===null||o.return.tag!==13)?(u._visibility&=-3,dm(o)):vf(o);break;default:vf(o)}}function dm(o){var u=o.deletions;if((o.flags&16)!==0){if(u!==null)for(var h=0;h<u.length;h++){var g=u[h];er=g,Rz(g,o)}Tz(o)}for(o=o.child;o!==null;){switch(u=o,u.tag){case 0:case 11:case 15:lo(8,u,u.return),dm(u);break;case 22:h=u.stateNode,h._visibility&2&&(h._visibility&=-3,dm(u));break;default:dm(u)}o=o.sibling}}function Rz(o,u){for(;er!==null;){var h=er;switch(h.tag){case 0:case 11:case 15:lo(8,h,u);break;case 23:case 22:if(h.memoizedState!==null&&h.memoizedState.cachePool!==null){var g=h.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:ef(h.memoizedState.cache)}if(g=h.child,g!==null)g.return=h,er=g;else e:for(h=o;er!==null;){g=er;var S=g.sibling,N=g.return;if(Nz(g),g===h){er=null;break e}if(S!==null){S.return=N,er=S;break e}er=N}}}var HH={getCacheForType:function(o){var u=hr(Mn),h=u.data.get(o);return h===void 0&&(h=o(),u.data.set(o,h)),h},cacheSignal:function(){return hr(Mn).controller.signal}},KH=typeof WeakMap=="function"?WeakMap:Map,It=0,Zt=null,Ct=null,Et=0,Ft=0,xi=null,co=!1,su=!1,Tb=!1,xs=0,Nn=0,uo=0,Cl=0,Pb=0,bi=0,ou=0,xf=null,ti=null,Rb=!1,fm=0,Dz=0,hm=1/0,pm=null,fo=null,Gn=0,ho=null,lu=null,bs=0,Db=0,Mb=null,Mz=null,bf=0,Ib=null;function wi(){return(It&2)!==0&&Et!==0?Et&-Et:H.T!==null?Fb():ns()}function Iz(){if(bi===0)if((Et&536870912)===0||Tt){var o=ia;ia<<=1,(ia&3932160)===0&&(ia=262144),bi=o}else bi=536870912;return o=yi.current,o!==null&&(o.flags|=32),bi}function ni(o,u,h){(o===Zt&&(Ft===2||Ft===9)||o.cancelPendingCommit!==null)&&(cu(o,0),po(o,Et,bi,!1)),Ye(o,h),((It&2)===0||o!==Zt)&&(o===Zt&&((It&2)===0&&(Cl|=h),Nn===4&&po(o,Et,bi,!1)),_a(o))}function Lz(o,u,h){if((It&6)!==0)throw Error(r(327));var g=!h&&(u&127)===0&&(u&o.expiredLanes)===0||Je(o,u),S=g?QH(o,u):$b(o,u,!0),N=g;do{if(S===0){su&&!g&&po(o,u,0,!1);break}else{if(h=o.current.alternate,N&&!GH(h)){S=$b(o,u,!1),N=!1;continue}if(S===2){if(N=u,o.errorRecoveryDisabledLanes&N)var T=0;else T=o.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){u=T;e:{var B=o;S=xf;var Q=B.current.memoizedState.isDehydrated;if(Q&&(cu(B,T).flags|=256),T=$b(B,T,!1),T!==2){if(Tb&&!Q){B.errorRecoveryDisabledLanes|=N,Cl|=N,S=4;break e}N=ti,ti=S,N!==null&&(ti===null?ti=N:ti.push.apply(ti,N))}S=T}if(N=!1,S!==2)continue}}if(S===1){cu(o,0),po(o,u,0,!0);break}e:{switch(g=o,N=S,N){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:po(g,u,bi,!co);break e;case 2:ti=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(S=fm+300-Kt(),10<S)){if(po(g,u,bi,!co),at(g,0,!0)!==0)break e;bs=u,g.timeoutHandle=m_($z.bind(null,g,h,ti,pm,Rb,u,bi,Cl,ou,co,N,"Throttled",-0,0),S);break e}$z(g,h,ti,pm,Rb,u,bi,Cl,ou,co,N,null,-0,0)}}break}while(!0);_a(o)}function $z(o,u,h,g,S,N,T,B,Q,oe,ge,we,ce,fe){if(o.timeoutHandle=-1,we=u.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:as},_z(u,N,we);var Le=(N&62914560)===N?fm-Kt():(N&4194048)===N?Dz-Kt():0;if(Le=zK(we,Le),Le!==null){bs=N,o.cancelPendingCommit=Le(Vz.bind(null,o,u,N,h,g,S,T,B,Q,ge,we,null,ce,fe)),po(o,N,T,!oe);return}}Vz(o,u,N,h,g,S,T,B,Q)}function GH(o){for(var u=o;;){var h=u.tag;if((h===0||h===11||h===15)&&u.flags&16384&&(h=u.updateQueue,h!==null&&(h=h.stores,h!==null)))for(var g=0;g<h.length;g++){var S=h[g],N=S.getSnapshot;S=S.value;try{if(!mi(N(),S))return!1}catch{return!1}}if(h=u.child,u.subtreeFlags&16384&&h!==null)h.return=u,u=h;else{if(u===o)break;for(;u.sibling===null;){if(u.return===null||u.return===o)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function po(o,u,h,g){u&=~Pb,u&=~Cl,o.suspendedLanes|=u,o.pingedLanes&=~u,g&&(o.warmLanes|=u),g=o.expirationTimes;for(var S=u;0<S;){var N=31-rt(S),T=1<<N;g[N]=-1,S&=~T}h!==0&&aa(o,h,u)}function mm(){return(It&6)===0?(wf(0),!1):!0}function Lb(){if(Ct!==null){if(Ft===0)var o=Ct.return;else o=Ct,cs=yl=null,eb(o),Jc=null,nf=0,o=Ct;for(;o!==null;)gz(o.alternate,o),o=o.return;Ct=null}}function cu(o,u){var h=o.timeoutHandle;h!==-1&&(o.timeoutHandle=-1,fK(h)),h=o.cancelPendingCommit,h!==null&&(o.cancelPendingCommit=null,h()),bs=0,Lb(),Zt=o,Ct=h=os(o.current,null),Et=u,Ft=0,xi=null,co=!1,su=Je(o,u),Tb=!1,ou=bi=Pb=Cl=uo=Nn=0,ti=xf=null,Rb=!1,(u&8)!==0&&(u|=u&32);var g=o.entangledLanes;if(g!==0)for(o=o.entanglements,g&=u;0<g;){var S=31-rt(g),N=1<<S;u|=o[S],g&=~N}return xs=u,Mp(),h}function Bz(o,u){ft=null,H.H=df,u===Xc||u===Hp?(u=nO(),Ft=3):u===qx?(u=nO(),Ft=4):Ft=u===gb?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,xi=u,Ct===null&&(Nn=1,im(o,_i(u,o.current)))}function Uz(){var o=yi.current;return o===null?!0:(Et&4194048)===Et?Di===null:(Et&62914560)===Et||(Et&536870912)!==0?o===Di:!1}function qz(){var o=H.H;return H.H=df,o===null?df:o}function Fz(){var o=H.A;return H.A=HH,o}function gm(){Nn=4,co||(Et&4194048)!==Et&&yi.current!==null||(su=!0),(uo&134217727)===0&&(Cl&134217727)===0||Zt===null||po(Zt,Et,bi,!1)}function $b(o,u,h){var g=It;It|=2;var S=qz(),N=Fz();(Zt!==o||Et!==u)&&(pm=null,cu(o,u)),u=!1;var T=Nn;e:do try{if(Ft!==0&&Ct!==null){var B=Ct,Q=xi;switch(Ft){case 8:Lb(),T=6;break e;case 3:case 2:case 9:case 6:yi.current===null&&(u=!0);var oe=Ft;if(Ft=0,xi=null,uu(o,B,Q,oe),h&&su){T=0;break e}break;default:oe=Ft,Ft=0,xi=null,uu(o,B,Q,oe)}}VH(),T=Nn;break}catch(ge){Bz(o,ge)}while(!0);return u&&o.shellSuspendCounter++,cs=yl=null,It=g,H.H=S,H.A=N,Ct===null&&(Zt=null,Et=0,Mp()),T}function VH(){for(;Ct!==null;)Hz(Ct)}function QH(o,u){var h=It;It|=2;var g=qz(),S=Fz();Zt!==o||Et!==u?(pm=null,hm=Kt()+500,cu(o,u)):su=Je(o,u);e:do try{if(Ft!==0&&Ct!==null){u=Ct;var N=xi;t:switch(Ft){case 1:Ft=0,xi=null,uu(o,u,N,1);break;case 2:case 9:if(eO(N)){Ft=0,xi=null,Kz(u);break}u=function(){Ft!==2&&Ft!==9||Zt!==o||(Ft=7),_a(o)},N.then(u,u);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:eO(N)?(Ft=0,xi=null,Kz(u)):(Ft=0,xi=null,uu(o,u,N,7));break;case 5:var T=null;switch(Ct.tag){case 26:T=Ct.memoizedState;case 5:case 27:var B=Ct;if(T?z_(T):B.stateNode.complete){Ft=0,xi=null;var Q=B.sibling;if(Q!==null)Ct=Q;else{var oe=B.return;oe!==null?(Ct=oe,ym(oe)):Ct=null}break t}}Ft=0,xi=null,uu(o,u,N,5);break;case 6:Ft=0,xi=null,uu(o,u,N,6);break;case 8:Lb(),Nn=6;break e;default:throw Error(r(462))}}YH();break}catch(ge){Bz(o,ge)}while(!0);return cs=yl=null,H.H=g,H.A=S,It=h,Ct!==null?0:(Zt=null,Et=0,Mp(),Nn)}function YH(){for(;Ct!==null&&!un();)Hz(Ct)}function Hz(o){var u=pz(o.alternate,o,xs);o.memoizedProps=o.pendingProps,u===null?ym(o):Ct=u}function Kz(o){var u=o,h=u.alternate;switch(u.tag){case 15:case 0:u=lz(h,u,u.pendingProps,u.type,void 0,Et);break;case 11:u=lz(h,u,u.pendingProps,u.type.render,u.ref,Et);break;case 5:eb(u);default:gz(h,u),u=Ct=FE(u,xs),u=pz(h,u,xs)}o.memoizedProps=o.pendingProps,u===null?ym(o):Ct=u}function uu(o,u,h,g){cs=yl=null,eb(u),Jc=null,nf=0;var S=u.return;try{if(IH(o,S,u,h,Et)){Nn=1,im(o,_i(h,o.current)),Ct=null;return}}catch(N){if(S!==null)throw Ct=S,N;Nn=1,im(o,_i(h,o.current)),Ct=null;return}u.flags&32768?(Tt||g===1?o=!0:su||(Et&536870912)!==0?o=!1:(co=o=!0,(g===2||g===9||g===3||g===6)&&(g=yi.current,g!==null&&g.tag===13&&(g.flags|=16384))),Gz(u,o)):ym(u)}function ym(o){var u=o;do{if((u.flags&32768)!==0){Gz(u,co);return}o=u.return;var h=BH(u.alternate,u,xs);if(h!==null){Ct=h;return}if(u=u.sibling,u!==null){Ct=u;return}Ct=u=o}while(u!==null);Nn===0&&(Nn=5)}function Gz(o,u){do{var h=UH(o.alternate,o);if(h!==null){h.flags&=32767,Ct=h;return}if(h=o.return,h!==null&&(h.flags|=32768,h.subtreeFlags=0,h.deletions=null),!u&&(o=o.sibling,o!==null)){Ct=o;return}Ct=o=h}while(o!==null);Nn=6,Ct=null}function Vz(o,u,h,g,S,N,T,B,Q){o.cancelPendingCommit=null;do vm();while(Gn!==0);if((It&6)!==0)throw Error(r(327));if(u!==null){if(u===o.current)throw Error(r(177));if(N=u.lanes|u.childLanes,N|=Ax,Nt(o,h,N,T,B,Q),o===Zt&&(Ct=Zt=null,Et=0),lu=u,ho=o,bs=h,Db=N,Mb=S,Mz=g,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,JH(Ue,function(){return Xz(),null})):(o.callbackNode=null,o.callbackPriority=0),g=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||g){g=H.T,H.T=null,S=X.p,X.p=2,T=It,It|=4;try{qH(o,u,h)}finally{It=T,X.p=S,H.T=g}}Gn=1,Qz(),Yz(),Wz()}}function Qz(){if(Gn===1){Gn=0;var o=ho,u=lu,h=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||h){h=H.T,H.T=null;var g=X.p;X.p=2;var S=It;It|=4;try{Ez(u,o);var N=Zb,T=RE(o.containerInfo),B=N.focusedElem,Q=N.selectionRange;if(T!==B&&B&&B.ownerDocument&&PE(B.ownerDocument.documentElement,B)){if(Q!==null&&Sx(B)){var oe=Q.start,ge=Q.end;if(ge===void 0&&(ge=oe),"selectionStart"in B)B.selectionStart=oe,B.selectionEnd=Math.min(ge,B.value.length);else{var we=B.ownerDocument||document,ce=we&&we.defaultView||window;if(ce.getSelection){var fe=ce.getSelection(),Le=B.textContent.length,et=Math.min(Q.start,Le),Qt=Q.end===void 0?et:Math.min(Q.end,Le);!fe.extend&&et>Qt&&(T=Qt,Qt=et,et=T);var J=TE(B,et),W=TE(B,Qt);if(J&&W&&(fe.rangeCount!==1||fe.anchorNode!==J.node||fe.anchorOffset!==J.offset||fe.focusNode!==W.node||fe.focusOffset!==W.offset)){var se=we.createRange();se.setStart(J.node,J.offset),fe.removeAllRanges(),et>Qt?(fe.addRange(se),fe.extend(W.node,W.offset)):(se.setEnd(W.node,W.offset),fe.addRange(se))}}}}for(we=[],fe=B;fe=fe.parentNode;)fe.nodeType===1&&we.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<we.length;B++){var ve=we[B];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}zm=!!Wb,Zb=Wb=null}finally{It=S,X.p=g,H.T=h}}o.current=u,Gn=2}}function Yz(){if(Gn===2){Gn=0;var o=ho,u=lu,h=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||h){h=H.T,H.T=null;var g=X.p;X.p=2;var S=It;It|=4;try{jz(o,u.alternate,u)}finally{It=S,X.p=g,H.T=h}}Gn=3}}function Wz(){if(Gn===4||Gn===3){Gn=0,Rr();var o=ho,u=lu,h=bs,g=Mz;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Gn=5:(Gn=0,lu=ho=null,Zz(o,o.pendingLanes));var S=o.pendingLanes;if(S===0&&(fo=null),Yr(h),u=u.stateNode,Fe&&typeof Fe.onCommitFiberRoot=="function")try{Fe.onCommitFiberRoot(ae,u,void 0,(u.current.flags&128)===128)}catch{}if(g!==null){u=H.T,S=X.p,X.p=2,H.T=null;try{for(var N=o.onRecoverableError,T=0;T<g.length;T++){var B=g[T];N(B.value,{componentStack:B.stack})}}finally{H.T=u,X.p=S}}(bs&3)!==0&&vm(),_a(o),S=o.pendingLanes,(h&261930)!==0&&(S&42)!==0?o===Ib?bf++:(bf=0,Ib=o):bf=0,wf(0)}}function Zz(o,u){(o.pooledCacheLanes&=u)===0&&(u=o.pooledCache,u!=null&&(o.pooledCache=null,ef(u)))}function vm(){return Qz(),Yz(),Wz(),Xz()}function Xz(){if(Gn!==5)return!1;var o=ho,u=Db;Db=0;var h=Yr(bs),g=H.T,S=X.p;try{X.p=32>h?32:h,H.T=null,h=Mb,Mb=null;var N=ho,T=bs;if(Gn=0,lu=ho=null,bs=0,(It&6)!==0)throw Error(r(331));var B=It;if(It|=4,Pz(N.current),zz(N,N.current,T,h),It=B,wf(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot=="function")try{Fe.onPostCommitFiberRoot(ae,N)}catch{}return!0}finally{X.p=S,H.T=g,Zz(o,u)}}function Jz(o,u,h){u=_i(h,u),u=mb(o.stateNode,u,2),o=ao(o,u,2),o!==null&&(Ye(o,2),_a(o))}function Ht(o,u,h){if(o.tag===3)Jz(o,o,h);else for(;u!==null;){if(u.tag===3){Jz(u,o,h);break}else if(u.tag===1){var g=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(fo===null||!fo.has(g))){o=_i(h,o),h=ez(2),g=ao(u,h,2),g!==null&&(tz(h,g,u,o),Ye(g,2),_a(g));break}}u=u.return}}function Bb(o,u,h){var g=o.pingCache;if(g===null){g=o.pingCache=new KH;var S=new Set;g.set(u,S)}else S=g.get(u),S===void 0&&(S=new Set,g.set(u,S));S.has(h)||(Tb=!0,S.add(h),o=WH.bind(null,o,u,h),u.then(o,o))}function WH(o,u,h){var g=o.pingCache;g!==null&&g.delete(u),o.pingedLanes|=o.suspendedLanes&h,o.warmLanes&=~h,Zt===o&&(Et&h)===h&&(Nn===4||Nn===3&&(Et&62914560)===Et&&300>Kt()-fm?(It&2)===0&&cu(o,0):Pb|=h,ou===Et&&(ou=0)),_a(o)}function e_(o,u){u===0&&(u=mt()),o=pl(o,u),o!==null&&(Ye(o,u),_a(o))}function ZH(o){var u=o.memoizedState,h=0;u!==null&&(h=u.retryLane),e_(o,h)}function XH(o,u){var h=0;switch(o.tag){case 31:case 13:var g=o.stateNode,S=o.memoizedState;S!==null&&(h=S.retryLane);break;case 19:g=o.stateNode;break;case 22:g=o.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(u),e_(o,h)}function JH(o,u){return Bt(o,u)}var xm=null,du=null,Ub=!1,bm=!1,qb=!1,mo=0;function _a(o){o!==du&&o.next===null&&(du===null?xm=du=o:du=du.next=o),bm=!0,Ub||(Ub=!0,tK())}function wf(o,u){if(!qb&&bm){qb=!0;do for(var h=!1,g=xm;g!==null;){if(o!==0){var S=g.pendingLanes;if(S===0)var N=0;else{var T=g.suspendedLanes,B=g.pingedLanes;N=(1<<31-rt(42|o)+1)-1,N&=S&~(T&~B),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(h=!0,i_(g,N))}else N=Et,N=at(g,g===Zt?N:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(N&3)===0||Je(g,N)||(h=!0,i_(g,N));g=g.next}while(h);qb=!1}}function eK(){t_()}function t_(){bm=Ub=!1;var o=0;mo!==0&&dK()&&(o=mo);for(var u=Kt(),h=null,g=xm;g!==null;){var S=g.next,N=n_(g,u);N===0?(g.next=null,h===null?xm=S:h.next=S,S===null&&(du=h)):(h=g,(o!==0||(N&3)!==0)&&(bm=!0)),g=S}Gn!==0&&Gn!==5||wf(o),mo!==0&&(mo=0)}function n_(o,u){for(var h=o.suspendedLanes,g=o.pingedLanes,S=o.expirationTimes,N=o.pendingLanes&-62914561;0<N;){var T=31-rt(N),B=1<<T,Q=S[T];Q===-1?((B&h)===0||(B&g)!==0)&&(S[T]=Xe(B,u)):Q<=u&&(o.expiredLanes|=B),N&=~B}if(u=Zt,h=Et,h=at(o,o===u?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g=o.callbackNode,h===0||o===u&&(Ft===2||Ft===9)||o.cancelPendingCommit!==null)return g!==null&&g!==null&&cn(g),o.callbackNode=null,o.callbackPriority=0;if((h&3)===0||Je(o,h)){if(u=h&-h,u===o.callbackPriority)return u;switch(g!==null&&cn(g),Yr(h)){case 2:case 8:h=Ne;break;case 32:h=Ue;break;case 268435456:h=lt;break;default:h=Ue}return g=r_.bind(null,o),h=Bt(h,g),o.callbackPriority=u,o.callbackNode=h,u}return g!==null&&g!==null&&cn(g),o.callbackPriority=2,o.callbackNode=null,2}function r_(o,u){if(Gn!==0&&Gn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var h=o.callbackNode;if(vm()&&o.callbackNode!==h)return null;var g=Et;return g=at(o,o===Zt?g:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),g===0?null:(Lz(o,g,u),n_(o,Kt()),o.callbackNode!=null&&o.callbackNode===h?r_.bind(null,o):null)}function i_(o,u){if(vm())return null;Lz(o,u,!0)}function tK(){hK(function(){(It&6)!==0?Bt(de,eK):t_()})}function Fb(){if(mo===0){var o=Wc;o===0&&(o=es,es<<=1,(es&261888)===0&&(es=256)),mo=o}return mo}function a_(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Ep(""+o)}function s_(o,u){var h=u.ownerDocument.createElement("input");return h.name=u.name,h.value=u.value,o.id&&h.setAttribute("form",o.id),u.parentNode.insertBefore(h,u),o=new FormData(o),h.parentNode.removeChild(h),o}function nK(o,u,h,g,S){if(u==="submit"&&h&&h.stateNode===S){var N=a_((S[ur]||null).action),T=g.submitter;T&&(u=(u=T[ur]||null)?a_(u.formAction):T.getAttribute("formAction"),u!==null&&(N=u,T=null));var B=new Tp("action","action",null,g,S);o.push({event:B,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(mo!==0){var Q=T?s_(S,T):new FormData(S);cb(h,{pending:!0,data:Q,method:S.method,action:N},null,Q)}}else typeof N=="function"&&(B.preventDefault(),Q=T?s_(S,T):new FormData(S),cb(h,{pending:!0,data:Q,method:S.method,action:N},N,Q))},currentTarget:S}]})}}for(var Hb=0;Hb<Cx.length;Hb++){var Kb=Cx[Hb],rK=Kb.toLowerCase(),iK=Kb[0].toUpperCase()+Kb.slice(1);ca(rK,"on"+iK)}ca(IE,"onAnimationEnd"),ca(LE,"onAnimationIteration"),ca($E,"onAnimationStart"),ca("dblclick","onDoubleClick"),ca("focusin","onFocus"),ca("focusout","onBlur"),ca(bH,"onTransitionRun"),ca(wH,"onTransitionStart"),ca(SH,"onTransitionCancel"),ca(BE,"onTransitionEnd"),Sn("onMouseEnter",["mouseout","mouseover"]),Sn("onMouseLeave",["mouseout","mouseover"]),Sn("onPointerEnter",["pointerout","pointerover"]),Sn("onPointerLeave",["pointerout","pointerover"]),_t("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_t("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_t("onBeforeInput",["compositionend","keypress","textInput","paste"]),_t("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_t("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_t("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sf="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(" "),aK=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sf));function o_(o,u){u=(u&4)!==0;for(var h=0;h<o.length;h++){var g=o[h],S=g.event;g=g.listeners;e:{var N=void 0;if(u)for(var T=g.length-1;0<=T;T--){var B=g[T],Q=B.instance,oe=B.currentTarget;if(B=B.listener,Q!==N&&S.isPropagationStopped())break e;N=B,S.currentTarget=oe;try{N(S)}catch(ge){Dp(ge)}S.currentTarget=null,N=Q}else for(T=0;T<g.length;T++){if(B=g[T],Q=B.instance,oe=B.currentTarget,B=B.listener,Q!==N&&S.isPropagationStopped())break e;N=B,S.currentTarget=oe;try{N(S)}catch(ge){Dp(ge)}S.currentTarget=null,N=Q}}}}function At(o,u){var h=u[Vs];h===void 0&&(h=u[Vs]=new Set);var g=o+"__bubble";h.has(g)||(l_(u,o,2,!1),h.add(g))}function Gb(o,u,h){var g=0;u&&(g|=4),l_(h,o,g,u)}var wm="_reactListening"+Math.random().toString(36).slice(2);function Vb(o){if(!o[wm]){o[wm]=!0,ze.forEach(function(h){h!=="selectionchange"&&(aK.has(h)||Gb(h,!1,o),Gb(h,!0,o))});var u=o.nodeType===9?o:o.ownerDocument;u===null||u[wm]||(u[wm]=!0,Gb("selectionchange",!1,u))}}function l_(o,u,h,g){switch(I_(u)){case 2:var S=PK;break;case 8:S=RK;break;default:S=lw}h=S.bind(null,u,h,o),S=void 0,!hx||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(S=!0),g?S!==void 0?o.addEventListener(u,h,{capture:!0,passive:S}):o.addEventListener(u,h,!0):S!==void 0?o.addEventListener(u,h,{passive:S}):o.addEventListener(u,h,!1)}function Qb(o,u,h,g,S){var N=g;if((u&1)===0&&(u&2)===0&&g!==null)e:for(;;){if(g===null)return;var T=g.tag;if(T===3||T===4){var B=g.stateNode.containerInfo;if(B===S)break;if(T===4)for(T=g.return;T!==null;){var Q=T.tag;if((Q===3||Q===4)&&T.stateNode.containerInfo===S)return;T=T.return}for(;B!==null;){if(T=Ys(B),T===null)return;if(Q=T.tag,Q===5||Q===6||Q===26||Q===27){g=N=T;continue e}B=B.parentNode}}g=g.return}hE(function(){var oe=N,ge=dx(h),we=[];e:{var ce=UE.get(o);if(ce!==void 0){var fe=Tp,Le=o;switch(o){case"keypress":if(zp(h)===0)break e;case"keydown":case"keyup":fe=X9;break;case"focusin":Le="focus",fe=yx;break;case"focusout":Le="blur",fe=yx;break;case"beforeblur":case"afterblur":fe=yx;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=gE;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=B9;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=tH;break;case IE:case LE:case $E:fe=F9;break;case BE:fe=rH;break;case"scroll":case"scrollend":fe=L9;break;case"wheel":fe=aH;break;case"copy":case"cut":case"paste":fe=K9;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=vE;break;case"toggle":case"beforetoggle":fe=oH}var et=(u&4)!==0,Qt=!et&&(o==="scroll"||o==="scrollend"),J=et?ce!==null?ce+"Capture":null:ce;et=[];for(var W=oe,se;W!==null;){var ve=W;if(se=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||se===null||J===null||(ve=Fd(W,J),ve!=null&&et.push(jf(W,ve,se))),Qt)break;W=W.return}0<et.length&&(ce=new fe(ce,Le,null,h,ge),we.push({event:ce,listeners:et}))}}if((u&7)===0){e:{if(ce=o==="mouseover"||o==="pointerover",fe=o==="mouseout"||o==="pointerout",ce&&h!==ux&&(Le=h.relatedTarget||h.fromElement)&&(Ys(Le)||Le[Gs]))break e;if((fe||ce)&&(ce=ge.window===ge?ge:(ce=ge.ownerDocument)?ce.defaultView||ce.parentWindow:window,fe?(Le=h.relatedTarget||h.toElement,fe=oe,Le=Le?Ys(Le):null,Le!==null&&(Qt=a(Le),et=Le.tag,Le!==Qt||et!==5&&et!==27&&et!==6)&&(Le=null)):(fe=null,Le=oe),fe!==Le)){if(et=gE,ve="onMouseLeave",J="onMouseEnter",W="mouse",(o==="pointerout"||o==="pointerover")&&(et=vE,ve="onPointerLeave",J="onPointerEnter",W="pointer"),Qt=fe==null?ce:cl(fe),se=Le==null?ce:cl(Le),ce=new et(ve,W+"leave",fe,h,ge),ce.target=Qt,ce.relatedTarget=se,ve=null,Ys(ge)===oe&&(et=new et(J,W+"enter",Le,h,ge),et.target=se,et.relatedTarget=Qt,ve=et),Qt=ve,fe&&Le)t:{for(et=sK,J=fe,W=Le,se=0,ve=J;ve;ve=et(ve))se++;ve=0;for(var We=W;We;We=et(We))ve++;for(;0<se-ve;)J=et(J),se--;for(;0<ve-se;)W=et(W),ve--;for(;se--;){if(J===W||W!==null&&J===W.alternate){et=J;break t}J=et(J),W=et(W)}et=null}else et=null;fe!==null&&c_(we,ce,fe,et,!1),Le!==null&&Qt!==null&&c_(we,Qt,Le,et,!0)}}e:{if(ce=oe?cl(oe):window,fe=ce.nodeName&&ce.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ce.type==="file")var Rt=CE;else if(NE(ce))if(AE)Rt=yH;else{Rt=mH;var qe=pH}else fe=ce.nodeName,!fe||fe.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&cx(oe.elementType)&&(Rt=CE):Rt=gH;if(Rt&&(Rt=Rt(o,oe))){kE(we,Rt,h,ge);break e}qe&&qe(o,ce,oe),o==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&Oi(ce,"number",ce.value)}switch(qe=oe?cl(oe):window,o){case"focusin":(NE(qe)||qe.contentEditable==="true")&&(qc=qe,jx=oe,Zd=null);break;case"focusout":Zd=jx=qc=null;break;case"mousedown":Nx=!0;break;case"contextmenu":case"mouseup":case"dragend":Nx=!1,DE(we,h,ge);break;case"selectionchange":if(xH)break;case"keydown":case"keyup":DE(we,h,ge)}var gt;if(xx)e:{switch(o){case"compositionstart":var Ot="onCompositionStart";break e;case"compositionend":Ot="onCompositionEnd";break e;case"compositionupdate":Ot="onCompositionUpdate";break e}Ot=void 0}else Uc?SE(o,h)&&(Ot="onCompositionEnd"):o==="keydown"&&h.keyCode===229&&(Ot="onCompositionStart");Ot&&(xE&&h.locale!=="ko"&&(Uc||Ot!=="onCompositionStart"?Ot==="onCompositionEnd"&&Uc&&(gt=pE()):(Xs=ge,px="value"in Xs?Xs.value:Xs.textContent,Uc=!0)),qe=Sm(oe,Ot),0<qe.length&&(Ot=new yE(Ot,o,null,h,ge),we.push({event:Ot,listeners:qe}),gt?Ot.data=gt:(gt=jE(h),gt!==null&&(Ot.data=gt)))),(gt=cH?uH(o,h):dH(o,h))&&(Ot=Sm(oe,"onBeforeInput"),0<Ot.length&&(qe=new yE("onBeforeInput","beforeinput",null,h,ge),we.push({event:qe,listeners:Ot}),qe.data=gt)),nK(we,o,oe,h,ge)}o_(we,u)})}function jf(o,u,h){return{instance:o,listener:u,currentTarget:h}}function Sm(o,u){for(var h=u+"Capture",g=[];o!==null;){var S=o,N=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||N===null||(S=Fd(o,h),S!=null&&g.unshift(jf(o,S,N)),S=Fd(o,u),S!=null&&g.push(jf(o,S,N))),o.tag===3)return g;o=o.return}return[]}function sK(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function c_(o,u,h,g,S){for(var N=u._reactName,T=[];h!==null&&h!==g;){var B=h,Q=B.alternate,oe=B.stateNode;if(B=B.tag,Q!==null&&Q===g)break;B!==5&&B!==26&&B!==27||oe===null||(Q=oe,S?(oe=Fd(h,N),oe!=null&&T.unshift(jf(h,oe,Q))):S||(oe=Fd(h,N),oe!=null&&T.push(jf(h,oe,Q)))),h=h.return}T.length!==0&&o.push({event:u,listeners:T})}var oK=/\r\n?/g,lK=/\u0000|\uFFFD/g;function u_(o){return(typeof o=="string"?o:""+o).replace(oK,`
|
|
9
|
+
`).replace(lK,"")}function d_(o,u){return u=u_(u),u_(o)===u}function Vt(o,u,h,g,S,N){switch(h){case"children":typeof g=="string"?u==="body"||u==="textarea"&&g===""||Lc(o,g):(typeof g=="number"||typeof g=="bigint")&&u!=="body"&&Lc(o,""+g);break;case"className":oa(o,"class",g);break;case"tabIndex":oa(o,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":oa(o,h,g);break;case"style":dE(o,g,N);break;case"data":if(u!=="object"){oa(o,"data",g);break}case"src":case"href":if(g===""&&(u!=="a"||h!=="href")){o.removeAttribute(h);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=Ep(""+g),o.setAttribute(h,g);break;case"action":case"formAction":if(typeof g=="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"?(u!=="input"&&Vt(o,u,"name",S.name,S,null),Vt(o,u,"formEncType",S.formEncType,S,null),Vt(o,u,"formMethod",S.formMethod,S,null),Vt(o,u,"formTarget",S.formTarget,S,null)):(Vt(o,u,"encType",S.encType,S,null),Vt(o,u,"method",S.method,S,null),Vt(o,u,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){o.removeAttribute(h);break}g=Ep(""+g),o.setAttribute(h,g);break;case"onClick":g!=null&&(o.onclick=as);break;case"onScroll":g!=null&&At("scroll",o);break;case"onScrollEnd":g!=null&&At("scrollend",o);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(S.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"multiple":o.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":o.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){o.removeAttribute("xlink:href");break}h=Ep(""+g),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":g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,""+g):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":g&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,""):o.removeAttribute(h);break;case"capture":case"download":g===!0?o.setAttribute(h,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?o.setAttribute(h,g):o.removeAttribute(h);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?o.setAttribute(h,g):o.removeAttribute(h);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?o.removeAttribute(h):o.setAttribute(h,g);break;case"popover":At("beforetoggle",o),At("toggle",o),Mc(o,"popover",g);break;case"xlinkActuate":Mr(o,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Mr(o,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Mr(o,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Mr(o,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Mr(o,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Mr(o,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Mr(o,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Mr(o,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Mr(o,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Mc(o,"is",g);break;case"innerText":case"textContent":break;default:(!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(h=M9.get(h)||h,Mc(o,h,g))}}function Yb(o,u,h,g,S,N){switch(h){case"style":dE(o,g,N);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(h=g.__html,h!=null){if(S.children!=null)throw Error(r(60));o.innerHTML=h}}break;case"children":typeof g=="string"?Lc(o,g):(typeof g=="number"||typeof g=="bigint")&&Lc(o,""+g);break;case"onScroll":g!=null&&At("scroll",o);break;case"onScrollEnd":g!=null&&At("scrollend",o);break;case"onClick":g!=null&&(o.onclick=as);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bt.hasOwnProperty(h))e:{if(h[0]==="o"&&h[1]==="n"&&(S=h.endsWith("Capture"),u=h.slice(2,S?h.length-7:void 0),N=o[ur]||null,N=N!=null?N[h]:null,typeof N=="function"&&o.removeEventListener(u,N,S),typeof g=="function")){typeof N!="function"&&N!==null&&(h in o?o[h]=null:o.hasAttribute(h)&&o.removeAttribute(h)),o.addEventListener(u,g,S);break e}h in o?o[h]=g:g===!0?o.setAttribute(h,""):Mc(o,h,g)}}}function mr(o,u,h){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":At("error",o),At("load",o);var g=!1,S=!1,N;for(N in h)if(h.hasOwnProperty(N)){var T=h[N];if(T!=null)switch(N){case"src":g=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Vt(o,u,N,T,h,null)}}S&&Vt(o,u,"srcSet",h.srcSet,h,null),g&&Vt(o,u,"src",h.src,h,null);return;case"input":At("invalid",o);var B=N=T=S=null,Q=null,oe=null;for(g in h)if(h.hasOwnProperty(g)){var ge=h[g];if(ge!=null)switch(g){case"name":S=ge;break;case"type":T=ge;break;case"checked":Q=ge;break;case"defaultChecked":oe=ge;break;case"value":N=ge;break;case"defaultValue":B=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,u));break;default:Vt(o,u,g,ge,h,null)}}Ir(o,N,B,Q,oe,T,S,!1);return;case"select":At("invalid",o),g=T=N=null;for(S in h)if(h.hasOwnProperty(S)&&(B=h[S],B!=null))switch(S){case"value":N=B;break;case"defaultValue":T=B;break;case"multiple":g=B;default:Vt(o,u,S,B,h,null)}u=N,h=T,o.multiple=!!g,u!=null?la(o,!!g,u,!1):h!=null&&la(o,!!g,h,!0);return;case"textarea":At("invalid",o),N=S=g=null;for(T in h)if(h.hasOwnProperty(T)&&(B=h[T],B!=null))switch(T){case"value":g=B;break;case"defaultValue":S=B;break;case"children":N=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(91));break;default:Vt(o,u,T,B,h,null)}cE(o,g,S,N);return;case"option":for(Q in h)h.hasOwnProperty(Q)&&(g=h[Q],g!=null)&&(Q==="selected"?o.selected=g&&typeof g!="function"&&typeof g!="symbol":Vt(o,u,Q,g,h,null));return;case"dialog":At("beforetoggle",o),At("toggle",o),At("cancel",o),At("close",o);break;case"iframe":case"object":At("load",o);break;case"video":case"audio":for(g=0;g<Sf.length;g++)At(Sf[g],o);break;case"image":At("error",o),At("load",o);break;case"details":At("toggle",o);break;case"embed":case"source":case"link":At("error",o),At("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(oe in h)if(h.hasOwnProperty(oe)&&(g=h[oe],g!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:Vt(o,u,oe,g,h,null)}return;default:if(cx(u)){for(ge in h)h.hasOwnProperty(ge)&&(g=h[ge],g!==void 0&&Yb(o,u,ge,g,h,void 0));return}}for(B in h)h.hasOwnProperty(B)&&(g=h[B],g!=null&&Vt(o,u,B,g,h,null))}function cK(o,u,h,g){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,N=null,T=null,B=null,Q=null,oe=null,ge=null;for(fe in h){var we=h[fe];if(h.hasOwnProperty(fe)&&we!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Q=we;default:g.hasOwnProperty(fe)||Vt(o,u,fe,null,g,we)}}for(var ce in g){var fe=g[ce];if(we=h[ce],g.hasOwnProperty(ce)&&(fe!=null||we!=null))switch(ce){case"type":N=fe;break;case"name":S=fe;break;case"checked":oe=fe;break;case"defaultChecked":ge=fe;break;case"value":T=fe;break;case"defaultValue":B=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,u));break;default:fe!==we&&Vt(o,u,ce,fe,g,we)}}pi(o,T,B,Q,oe,ge,N,S);return;case"select":fe=T=B=ce=null;for(N in h)if(Q=h[N],h.hasOwnProperty(N)&&Q!=null)switch(N){case"value":break;case"multiple":fe=Q;default:g.hasOwnProperty(N)||Vt(o,u,N,null,g,Q)}for(S in g)if(N=g[S],Q=h[S],g.hasOwnProperty(S)&&(N!=null||Q!=null))switch(S){case"value":ce=N;break;case"defaultValue":B=N;break;case"multiple":T=N;default:N!==Q&&Vt(o,u,S,N,g,Q)}u=B,h=T,g=fe,ce!=null?la(o,!!h,ce,!1):!!g!=!!h&&(u!=null?la(o,!!h,u,!0):la(o,!!h,h?[]:"",!1));return;case"textarea":fe=ce=null;for(B in h)if(S=h[B],h.hasOwnProperty(B)&&S!=null&&!g.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:Vt(o,u,B,null,g,S)}for(T in g)if(S=g[T],N=h[T],g.hasOwnProperty(T)&&(S!=null||N!=null))switch(T){case"value":ce=S;break;case"defaultValue":fe=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(r(91));break;default:S!==N&&Vt(o,u,T,S,g,N)}lE(o,ce,fe);return;case"option":for(var Le in h)ce=h[Le],h.hasOwnProperty(Le)&&ce!=null&&!g.hasOwnProperty(Le)&&(Le==="selected"?o.selected=!1:Vt(o,u,Le,null,g,ce));for(Q in g)ce=g[Q],fe=h[Q],g.hasOwnProperty(Q)&&ce!==fe&&(ce!=null||fe!=null)&&(Q==="selected"?o.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":Vt(o,u,Q,ce,g,fe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var et in h)ce=h[et],h.hasOwnProperty(et)&&ce!=null&&!g.hasOwnProperty(et)&&Vt(o,u,et,null,g,ce);for(oe in g)if(ce=g[oe],fe=h[oe],g.hasOwnProperty(oe)&&ce!==fe&&(ce!=null||fe!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,u));break;default:Vt(o,u,oe,ce,g,fe)}return;default:if(cx(u)){for(var Qt in h)ce=h[Qt],h.hasOwnProperty(Qt)&&ce!==void 0&&!g.hasOwnProperty(Qt)&&Yb(o,u,Qt,void 0,g,ce);for(ge in g)ce=g[ge],fe=h[ge],!g.hasOwnProperty(ge)||ce===fe||ce===void 0&&fe===void 0||Yb(o,u,ge,ce,g,fe);return}}for(var J in h)ce=h[J],h.hasOwnProperty(J)&&ce!=null&&!g.hasOwnProperty(J)&&Vt(o,u,J,null,g,ce);for(we in g)ce=g[we],fe=h[we],!g.hasOwnProperty(we)||ce===fe||ce==null&&fe==null||Vt(o,u,we,ce,g,fe)}function f_(o){switch(o){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function uK(){if(typeof performance.getEntriesByType=="function"){for(var o=0,u=0,h=performance.getEntriesByType("resource"),g=0;g<h.length;g++){var S=h[g],N=S.transferSize,T=S.initiatorType,B=S.duration;if(N&&B&&f_(T)){for(T=0,B=S.responseEnd,g+=1;g<h.length;g++){var Q=h[g],oe=Q.startTime;if(oe>B)break;var ge=Q.transferSize,we=Q.initiatorType;ge&&f_(we)&&(Q=Q.responseEnd,T+=ge*(Q<B?1:(B-oe)/(Q-oe)))}if(--g,u+=8*(N+T)/(S.duration/1e3),o++,10<o)break}}if(0<o)return u/o/1e6}return navigator.connection&&(o=navigator.connection.downlink,typeof o=="number")?o:5}var Wb=null,Zb=null;function jm(o){return o.nodeType===9?o:o.ownerDocument}function h_(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 p_(o,u){if(o===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&u==="foreignObject"?0:o}function Xb(o,u){return o==="textarea"||o==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Jb=null;function dK(){var o=window.event;return o&&o.type==="popstate"?o===Jb?!1:(Jb=o,!0):(Jb=null,!1)}var m_=typeof setTimeout=="function"?setTimeout:void 0,fK=typeof clearTimeout=="function"?clearTimeout:void 0,g_=typeof Promise=="function"?Promise:void 0,hK=typeof queueMicrotask=="function"?queueMicrotask:typeof g_<"u"?function(o){return g_.resolve(null).then(o).catch(pK)}:m_;function pK(o){setTimeout(function(){throw o})}function go(o){return o==="head"}function y_(o,u){var h=u,g=0;do{var S=h.nextSibling;if(o.removeChild(h),S&&S.nodeType===8)if(h=S.data,h==="/$"||h==="/&"){if(g===0){o.removeChild(S),mu(u);return}g--}else if(h==="$"||h==="$?"||h==="$~"||h==="$!"||h==="&")g++;else if(h==="html")Nf(o.ownerDocument.documentElement);else if(h==="head"){h=o.ownerDocument.head,Nf(h);for(var N=h.firstChild;N;){var T=N.nextSibling,B=N.nodeName;N[Qs]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&N.rel.toLowerCase()==="stylesheet"||h.removeChild(N),N=T}}else h==="body"&&Nf(o.ownerDocument.body);h=S}while(h);mu(u)}function v_(o,u){var h=o;o=0;do{var g=h.nextSibling;if(h.nodeType===1?u?(h._stashedDisplay=h.style.display,h.style.display="none"):(h.style.display=h._stashedDisplay||"",h.getAttribute("style")===""&&h.removeAttribute("style")):h.nodeType===3&&(u?(h._stashedText=h.nodeValue,h.nodeValue=""):h.nodeValue=h._stashedText||""),g&&g.nodeType===8)if(h=g.data,h==="/$"){if(o===0)break;o--}else h!=="$"&&h!=="$?"&&h!=="$~"&&h!=="$!"||o++;h=g}while(h)}function ew(o){var u=o.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var h=u;switch(u=u.nextSibling,h.nodeName){case"HTML":case"HEAD":case"BODY":ew(h),Ud(h);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(h.rel.toLowerCase()==="stylesheet")continue}o.removeChild(h)}}function mK(o,u,h,g){for(;o.nodeType===1;){var S=h;if(o.nodeName.toLowerCase()!==u.toLowerCase()){if(!g&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(g){if(!o[Qs])switch(u){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!==S.rel||o.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||o.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||o.getAttribute("title")!==(S.title==null?null:S.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(N=o.getAttribute("src"),(N!==(S.src==null?null:S.src)||o.getAttribute("type")!==(S.type==null?null:S.type)||o.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&N&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(u==="input"&&o.type==="hidden"){var N=S.name==null?null:""+S.name;if(S.type==="hidden"&&o.getAttribute("name")===N)return o}else return o;if(o=Mi(o.nextSibling),o===null)break}return null}function gK(o,u,h){if(u==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!h||(o=Mi(o.nextSibling),o===null))return null;return o}function x_(o,u){for(;o.nodeType!==8;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=Mi(o.nextSibling),o===null))return null;return o}function tw(o){return o.data==="$?"||o.data==="$~"}function nw(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState!=="loading"}function yK(o,u){var h=o.ownerDocument;if(o.data==="$~")o._reactRetry=u;else if(o.data!=="$?"||h.readyState!=="loading")u();else{var g=function(){u(),h.removeEventListener("DOMContentLoaded",g)};h.addEventListener("DOMContentLoaded",g),o._reactRetry=g}}function Mi(o){for(;o!=null;o=o.nextSibling){var u=o.nodeType;if(u===1||u===3)break;if(u===8){if(u=o.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return o}var rw=null;function b_(o){o=o.nextSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="/$"||h==="/&"){if(u===0)return Mi(o.nextSibling);u--}else h!=="$"&&h!=="$!"&&h!=="$?"&&h!=="$~"&&h!=="&"||u++}o=o.nextSibling}return null}function w_(o){o=o.previousSibling;for(var u=0;o;){if(o.nodeType===8){var h=o.data;if(h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"){if(u===0)return o;u--}else h!=="/$"&&h!=="/&"||u++}o=o.previousSibling}return null}function S_(o,u,h){switch(u=jm(h),o){case"html":if(o=u.documentElement,!o)throw Error(r(452));return o;case"head":if(o=u.head,!o)throw Error(r(453));return o;case"body":if(o=u.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function Nf(o){for(var u=o.attributes;u.length;)o.removeAttributeNode(u[0]);Ud(o)}var Ii=new Map,j_=new Set;function Nm(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var ws=X.d;X.d={f:vK,r:xK,D:bK,C:wK,L:SK,m:jK,X:kK,S:NK,M:CK};function vK(){var o=ws.f(),u=mm();return o||u}function xK(o){var u=Ws(o);u!==null&&u.tag===5&&u.type==="form"?BO(u):ws.r(o)}var fu=typeof document>"u"?null:document;function N_(o,u,h){var g=fu;if(g&&typeof u=="string"&&u){var S=kt(u);S='link[rel="'+o+'"][href="'+S+'"]',typeof h=="string"&&(S+='[crossorigin="'+h+'"]'),j_.has(S)||(j_.add(S),o={rel:o,crossOrigin:h,href:u},g.querySelector(S)===null&&(u=g.createElement("link"),mr(u,"link",o),G(u),g.head.appendChild(u)))}}function bK(o){ws.D(o),N_("dns-prefetch",o,null)}function wK(o,u){ws.C(o,u),N_("preconnect",o,u)}function SK(o,u,h){ws.L(o,u,h);var g=fu;if(g&&o&&u){var S='link[rel="preload"][as="'+kt(u)+'"]';u==="image"&&h&&h.imageSrcSet?(S+='[imagesrcset="'+kt(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(S+='[imagesizes="'+kt(h.imageSizes)+'"]')):S+='[href="'+kt(o)+'"]';var N=S;switch(u){case"style":N=hu(o);break;case"script":N=pu(o)}Ii.has(N)||(o=m({rel:"preload",href:u==="image"&&h&&h.imageSrcSet?void 0:o,as:u},h),Ii.set(N,o),g.querySelector(S)!==null||u==="style"&&g.querySelector(kf(N))||u==="script"&&g.querySelector(Cf(N))||(u=g.createElement("link"),mr(u,"link",o),G(u),g.head.appendChild(u)))}}function jK(o,u){ws.m(o,u);var h=fu;if(h&&o){var g=u&&typeof u.as=="string"?u.as:"script",S='link[rel="modulepreload"][as="'+kt(g)+'"][href="'+kt(o)+'"]',N=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=pu(o)}if(!Ii.has(N)&&(o=m({rel:"modulepreload",href:o},u),Ii.set(N,o),h.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(Cf(N)))return}g=h.createElement("link"),mr(g,"link",o),G(g),h.head.appendChild(g)}}}function NK(o,u,h){ws.S(o,u,h);var g=fu;if(g&&o){var S=rs(g).hoistableStyles,N=hu(o);u=u||"default";var T=S.get(N);if(!T){var B={loading:0,preload:null};if(T=g.querySelector(kf(N)))B.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":u},h),(h=Ii.get(N))&&iw(o,h);var Q=T=g.createElement("link");G(Q),mr(Q,"link",o),Q._p=new Promise(function(oe,ge){Q.onload=oe,Q.onerror=ge}),Q.addEventListener("load",function(){B.loading|=1}),Q.addEventListener("error",function(){B.loading|=2}),B.loading|=4,km(T,u,g)}T={type:"stylesheet",instance:T,count:1,state:B},S.set(N,T)}}}function kK(o,u){ws.X(o,u);var h=fu;if(h&&o){var g=rs(h).hoistableScripts,S=pu(o),N=g.get(S);N||(N=h.querySelector(Cf(S)),N||(o=m({src:o,async:!0},u),(u=Ii.get(S))&&aw(o,u),N=h.createElement("script"),G(N),mr(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(S,N))}}function CK(o,u){ws.M(o,u);var h=fu;if(h&&o){var g=rs(h).hoistableScripts,S=pu(o),N=g.get(S);N||(N=h.querySelector(Cf(S)),N||(o=m({src:o,async:!0,type:"module"},u),(u=Ii.get(S))&&aw(o,u),N=h.createElement("script"),G(N),mr(N,"link",o),h.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},g.set(S,N))}}function k_(o,u,h,g){var S=(S=ee.current)?Nm(S):null;if(!S)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(u=hu(h.href),h=rs(S).hoistableStyles,g=h.get(u),g||(g={type:"style",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){o=hu(h.href);var N=rs(S).hoistableStyles,T=N.get(o);if(T||(S=S.ownerDocument||S,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(o,T),(N=S.querySelector(kf(o)))&&!N._p&&(T.instance=N,T.state.loading=5),Ii.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},Ii.set(o,h),N||AK(S,o,h,T.state))),u&&g===null)throw Error(r(528,""));return T}if(u&&g!==null)throw Error(r(529,""));return null;case"script":return u=h.async,h=h.src,typeof h=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=pu(h),h=rs(S).hoistableScripts,g=h.get(u),g||(g={type:"script",instance:null,count:0,state:null},h.set(u,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function hu(o){return'href="'+kt(o)+'"'}function kf(o){return'link[rel="stylesheet"]['+o+"]"}function C_(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function AK(o,u,h,g){o.querySelector('link[rel="preload"][as="style"]['+u+"]")?g.loading=1:(u=o.createElement("link"),g.preload=u,u.addEventListener("load",function(){return g.loading|=1}),u.addEventListener("error",function(){return g.loading|=2}),mr(u,"link",h),G(u),o.head.appendChild(u))}function pu(o){return'[src="'+kt(o)+'"]'}function Cf(o){return"script[async]"+o}function A_(o,u,h){if(u.count++,u.instance===null)switch(u.type){case"style":var g=o.querySelector('style[data-href~="'+kt(h.href)+'"]');if(g)return u.instance=g,G(g),g;var S=m({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return g=(o.ownerDocument||o).createElement("style"),G(g),mr(g,"style",S),km(g,h.precedence,o),u.instance=g;case"stylesheet":S=hu(h.href);var N=o.querySelector(kf(S));if(N)return u.state.loading|=4,u.instance=N,G(N),N;g=C_(h),(S=Ii.get(S))&&iw(g,S),N=(o.ownerDocument||o).createElement("link"),G(N);var T=N;return T._p=new Promise(function(B,Q){T.onload=B,T.onerror=Q}),mr(N,"link",g),u.state.loading|=4,km(N,h.precedence,o),u.instance=N;case"script":return N=pu(h.src),(S=o.querySelector(Cf(N)))?(u.instance=S,G(S),S):(g=h,(S=Ii.get(N))&&(g=m({},h),aw(g,S)),o=o.ownerDocument||o,S=o.createElement("script"),G(S),mr(S,"link",g),o.head.appendChild(S),u.instance=S);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(g=u.instance,u.state.loading|=4,km(g,h.precedence,o));return u.instance}function km(o,u,h){for(var g=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=g.length?g[g.length-1]:null,N=S,T=0;T<g.length;T++){var B=g[T];if(B.dataset.precedence===u)N=B;else if(N!==S)break}N?N.parentNode.insertBefore(o,N.nextSibling):(u=h.nodeType===9?h.head:h,u.insertBefore(o,u.firstChild))}function iw(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.title==null&&(o.title=u.title)}function aw(o,u){o.crossOrigin==null&&(o.crossOrigin=u.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=u.referrerPolicy),o.integrity==null&&(o.integrity=u.integrity)}var Cm=null;function E_(o,u,h){if(Cm===null){var g=new Map,S=Cm=new Map;S.set(h,g)}else S=Cm,g=S.get(h),g||(g=new Map,S.set(h,g));if(g.has(o))return g;for(g.set(o,null),h=h.getElementsByTagName(o),S=0;S<h.length;S++){var N=h[S];if(!(N[Qs]||N[Dn]||o==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var T=N.getAttribute(u)||"";T=o+T;var B=g.get(T);B?B.push(N):g.set(T,[N])}}return g}function O_(o,u,h){o=o.ownerDocument||o,o.head.insertBefore(h,u==="title"?o.querySelector("head > title"):null)}function EK(o,u,h){if(h===1||u.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;return u.rel==="stylesheet"?(o=u.disabled,typeof u.precedence=="string"&&o==null):!0;case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function z_(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}function OK(o,u,h,g){if(h.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var S=hu(g.href),N=u.querySelector(kf(S));if(N){u=N._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(o.count++,o=Am.bind(o),u.then(o,o)),h.state.loading|=4,h.instance=N,G(N);return}N=u.ownerDocument||u,g=C_(g),(S=Ii.get(S))&&iw(g,S),N=N.createElement("link"),G(N);var T=N;T._p=new Promise(function(B,Q){T.onload=B,T.onerror=Q}),mr(N,"link",g),h.instance=N}o.stylesheets===null&&(o.stylesheets=new Map),o.stylesheets.set(h,u),(u=h.state.preload)&&(h.state.loading&3)===0&&(o.count++,h=Am.bind(o),u.addEventListener("load",h),u.addEventListener("error",h))}}var sw=0;function zK(o,u){return o.stylesheets&&o.count===0&&Om(o,o.stylesheets),0<o.count||0<o.imgCount?function(h){var g=setTimeout(function(){if(o.stylesheets&&Om(o,o.stylesheets),o.unsuspend){var N=o.unsuspend;o.unsuspend=null,N()}},6e4+u);0<o.imgBytes&&sw===0&&(sw=62500*uK());var S=setTimeout(function(){if(o.waitingForImages=!1,o.count===0&&(o.stylesheets&&Om(o,o.stylesheets),o.unsuspend)){var N=o.unsuspend;o.unsuspend=null,N()}},(o.imgBytes>sw?50:800)+u);return o.unsuspend=h,function(){o.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function Am(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Om(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var Em=null;function Om(o,u){o.stylesheets=null,o.unsuspend!==null&&(o.count++,Em=new Map,u.forEach(_K,o),Em=null,Am.call(o))}function _K(o,u){if(!(u.state.loading&4)){var h=Em.get(o);if(h)var g=h.get(null);else{h=new Map,Em.set(o,h);for(var S=o.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<S.length;N++){var T=S[N];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(h.set(T.dataset.precedence,T),g=T)}g&&h.set(null,g)}S=u.instance,T=S.getAttribute("data-precedence"),N=h.get(T)||g,N===g&&h.set(null,S),h.set(T,S),this.count++,g=Am.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),N?N.parentNode.insertBefore(S,N.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(S,o.firstChild)),u.state.loading|=4}}var Af={$$typeof:A,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function TK(o,u,h,g,S,N,T,B,Q){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=ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ke(0),this.hiddenUpdates=ke(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=N,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.incompleteTransitions=new Map}function __(o,u,h,g,S,N,T,B,Q,oe,ge,we){return o=new TK(o,u,h,T,Q,oe,ge,we,B),u=1,N===!0&&(u|=24),N=gi(3,null,null,u),o.current=N,N.stateNode=o,u=$x(),u.refCount++,o.pooledCache=u,u.refCount++,N.memoizedState={element:g,isDehydrated:h,cache:u},Fx(N),o}function T_(o){return o?(o=Kc,o):Kc}function P_(o,u,h,g,S,N){S=T_(S),g.context===null?g.context=S:g.pendingContext=S,g=io(u),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=ao(o,g,u),h!==null&&(ni(h,o,u),af(h,o,u))}function R_(o,u){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var h=o.retryLane;o.retryLane=h!==0&&h<u?h:u}}function ow(o,u){R_(o,u),(o=o.alternate)&&R_(o,u)}function D_(o){if(o.tag===13||o.tag===31){var u=pl(o,67108864);u!==null&&ni(u,o,67108864),ow(o,67108864)}}function M_(o){if(o.tag===13||o.tag===31){var u=wi();u=ts(u);var h=pl(o,u);h!==null&&ni(h,o,u),ow(o,u)}}var zm=!0;function PK(o,u,h,g){var S=H.T;H.T=null;var N=X.p;try{X.p=2,lw(o,u,h,g)}finally{X.p=N,H.T=S}}function RK(o,u,h,g){var S=H.T;H.T=null;var N=X.p;try{X.p=8,lw(o,u,h,g)}finally{X.p=N,H.T=S}}function lw(o,u,h,g){if(zm){var S=cw(g);if(S===null)Qb(o,u,g,_m,h),L_(o,g);else if(MK(S,o,u,h,g))g.stopPropagation();else if(L_(o,g),u&4&&-1<DK.indexOf(o)){for(;S!==null;){var N=Ws(S);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var T=Ce(N.pendingLanes);if(T!==0){var B=N;for(B.pendingLanes|=2,B.entangledLanes|=2;T;){var Q=1<<31-rt(T);B.entanglements[1]|=Q,T&=~Q}_a(N),(It&6)===0&&(hm=Kt()+500,wf(0))}}break;case 31:case 13:B=pl(N,2),B!==null&&ni(B,N,2),mm(),ow(N,2)}if(N=cw(g),N===null&&Qb(o,u,g,_m,h),N===S)break;S=N}S!==null&&g.stopPropagation()}else Qb(o,u,g,null,h)}}function cw(o){return o=dx(o),uw(o)}var _m=null;function uw(o){if(_m=null,o=Ys(o),o!==null){var u=a(o);if(u===null)o=null;else{var h=u.tag;if(h===13){if(o=l(u),o!==null)return o;o=null}else if(h===31){if(o=c(u),o!==null)return o;o=null}else if(h===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;o=null}else u!==o&&(o=null)}}return _m=o,null}function I_(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(vt()){case de:return 2;case Ne:return 8;case Ue:case it:return 32;case lt:return 268435456;default:return 32}default:return 32}}var dw=!1,yo=null,vo=null,xo=null,Ef=new Map,Of=new Map,bo=[],DK="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 L_(o,u){switch(o){case"focusin":case"focusout":yo=null;break;case"dragenter":case"dragleave":vo=null;break;case"mouseover":case"mouseout":xo=null;break;case"pointerover":case"pointerout":Ef.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Of.delete(u.pointerId)}}function zf(o,u,h,g,S,N){return o===null||o.nativeEvent!==N?(o={blockedOn:u,domEventName:h,eventSystemFlags:g,nativeEvent:N,targetContainers:[S]},u!==null&&(u=Ws(u),u!==null&&D_(u)),o):(o.eventSystemFlags|=g,u=o.targetContainers,S!==null&&u.indexOf(S)===-1&&u.push(S),o)}function MK(o,u,h,g,S){switch(u){case"focusin":return yo=zf(yo,o,u,h,g,S),!0;case"dragenter":return vo=zf(vo,o,u,h,g,S),!0;case"mouseover":return xo=zf(xo,o,u,h,g,S),!0;case"pointerover":var N=S.pointerId;return Ef.set(N,zf(Ef.get(N)||null,o,u,h,g,S)),!0;case"gotpointercapture":return N=S.pointerId,Of.set(N,zf(Of.get(N)||null,o,u,h,g,S)),!0}return!1}function $_(o){var u=Ys(o.target);if(u!==null){var h=a(u);if(h!==null){if(u=h.tag,u===13){if(u=l(h),u!==null){o.blockedOn=u,Dc(o.priority,function(){M_(h)});return}}else if(u===31){if(u=c(h),u!==null){o.blockedOn=u,Dc(o.priority,function(){M_(h)});return}}else if(u===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 u=o.targetContainers;0<u.length;){var h=cw(o.nativeEvent);if(h===null){h=o.nativeEvent;var g=new h.constructor(h.type,h);ux=g,h.target.dispatchEvent(g),ux=null}else return u=Ws(h),u!==null&&D_(u),o.blockedOn=h,!1;u.shift()}return!0}function B_(o,u,h){Tm(o)&&h.delete(u)}function IK(){dw=!1,yo!==null&&Tm(yo)&&(yo=null),vo!==null&&Tm(vo)&&(vo=null),xo!==null&&Tm(xo)&&(xo=null),Ef.forEach(B_),Of.forEach(B_)}function Pm(o,u){o.blockedOn===u&&(o.blockedOn=null,dw||(dw=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,IK)))}var Rm=null;function U_(o){Rm!==o&&(Rm=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Rm===o&&(Rm=null);for(var u=0;u<o.length;u+=3){var h=o[u],g=o[u+1],S=o[u+2];if(typeof g!="function"){if(uw(g||h)===null)continue;break}var N=Ws(h);N!==null&&(o.splice(u,3),u-=3,cb(N,{pending:!0,data:S,method:h.method,action:g},g,S))}}))}function mu(o){function u(Q){return Pm(Q,o)}yo!==null&&Pm(yo,o),vo!==null&&Pm(vo,o),xo!==null&&Pm(xo,o),Ef.forEach(u),Of.forEach(u);for(var h=0;h<bo.length;h++){var g=bo[h];g.blockedOn===o&&(g.blockedOn=null)}for(;0<bo.length&&(h=bo[0],h.blockedOn===null);)$_(h),h.blockedOn===null&&bo.shift();if(h=(o.ownerDocument||o).$$reactFormReplay,h!=null)for(g=0;g<h.length;g+=3){var S=h[g],N=h[g+1],T=S[ur]||null;if(typeof N=="function")T||U_(h);else if(T){var B=null;if(N&&N.hasAttribute("formAction")){if(S=N,T=N[ur]||null)B=T.formAction;else if(uw(S)!==null)continue}else B=T.action;typeof B=="function"?h[g+1]=B:(h.splice(g,3),g-=3),U_(h)}}}function q_(){function o(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(T){return S=T})},focusReset:"manual",scroll:"manual"})}function u(){S!==null&&(S(),S=null),g||setTimeout(h,20)}function h(){if(!g&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,S=null;return navigation.addEventListener("navigate",o),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(h,100),function(){g=!0,navigation.removeEventListener("navigate",o),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),S!==null&&(S(),S=null)}}}function fw(o){this._internalRoot=o}Dm.prototype.render=fw.prototype.render=function(o){var u=this._internalRoot;if(u===null)throw Error(r(409));var h=u.current,g=wi();P_(h,g,o,u,null,null)},Dm.prototype.unmount=fw.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var u=o.containerInfo;P_(o.current,2,null,o,null,null),mm(),u[Gs]=null}};function Dm(o){this._internalRoot=o}Dm.prototype.unstable_scheduleHydration=function(o){if(o){var u=ns();o={blockedOn:null,target:o,priority:u};for(var h=0;h<bo.length&&u!==0&&u<bo[h].priority;h++);bo.splice(h,0,o),h===0&&$_(o)}};var F_=t.version;if(F_!=="19.2.4")throw Error(r(527,F_,"19.2.4"));X.findDOMNode=function(o){var u=o._reactInternals;if(u===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(u),o=o!==null?p(o):null,o=o===null?null:o.stateNode,o};var LK={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Mm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mm.isDisabled&&Mm.supportsFiber)try{ae=Mm.inject(LK),Fe=Mm}catch{}}return Tf.createRoot=function(o,u){if(!i(o))throw Error(r(299));var h=!1,g="",S=WO,N=ZO,T=XO;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(T=u.onRecoverableError)),u=__(o,1,!1,null,null,h,g,null,S,N,T,q_),o[Gs]=u.current,Vb(o),new fw(u)},Tf.hydrateRoot=function(o,u,h){if(!i(o))throw Error(r(299));var g=!1,S="",N=WO,T=ZO,B=XO,Q=null;return h!=null&&(h.unstable_strictMode===!0&&(g=!0),h.identifierPrefix!==void 0&&(S=h.identifierPrefix),h.onUncaughtError!==void 0&&(N=h.onUncaughtError),h.onCaughtError!==void 0&&(T=h.onCaughtError),h.onRecoverableError!==void 0&&(B=h.onRecoverableError),h.formState!==void 0&&(Q=h.formState)),u=__(o,1,!0,u,h??null,g,S,Q,N,T,B,q_),u.context=T_(null),h=u.current,g=wi(),g=ts(g),S=io(g),S.callback=null,ao(h,S,g),h=g,u.current.lanes=h,Ye(u,h),_a(u),o[Gs]=u.current,Vb(o),new Dm(u)},Tf.version="19.2.4",Tf}var J_;function QK(){if(J_)return mw.exports;J_=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(),mw.exports=VK(),mw.exports}var YK=QK(),bc=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(){}},WK={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ZK=class{#t=WK;#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)}},$l=new ZK;function XK(e){setTimeout(e,0)}var rc=typeof window>"u"||"Deno"in globalThis;function Cr(){}function JK(e,t){return typeof e=="function"?e(t):e}function Yj(e){return typeof e=="number"&&e>=0&&e!==1/0}function f5(e,t){return Math.max(e+(t||0)-Date.now(),0)}function $o(e,t){return typeof e=="function"?e(t):e}function qi(e,t){return typeof e=="function"?e(t):e}function e2(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==GN(l,t.options))return!1}else if(!bh(t.queryKey,l))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||i&&i!==t.state.fetchStatus||a&&!a(t))}function t2(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ic(t.options.mutationKey)!==ic(a))return!1}else if(!bh(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function GN(e,t){return(t?.queryKeyHashFn||ic)(e)}function ic(e){return JSON.stringify(e,(t,n)=>Wj(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function bh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>bh(e[n],t[n])):!1}var e7=Object.prototype.hasOwnProperty;function VN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=n2(e)&&n2(t);if(!r&&!(Wj(e)&&Wj(t)))return t;const a=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const m=r?p:l[p],y=e[m],v=t[m];if(y===v){d[m]=y,(r?p<a:e7.call(e,m))&&f++;continue}if(y===null||v===null||typeof y!="object"||typeof v!="object"){d[m]=v;continue}const w=VN(y,v,n+1);d[m]=w,w===y&&f++}return a===c&&f===a?e:d}function wh(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 n2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Wj(e){if(!r2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!r2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function r2(e){return Object.prototype.toString.call(e)==="[object Object]"}function t7(e){return new Promise(t=>{$l.setTimeout(t,e)})}function Zj(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?VN(e,t):t}function n7(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function r7(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var QN=Symbol();function h5(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===QN?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function YN(e,t){return typeof e=="function"?e(...t):!!e}function i7(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 a7=class extends bc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!rc&&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"}},WN=new a7;function Xj(){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 s7=XK;function o7(){let e=[],t=0,n=c=>{c()},r=c=>{c()},i=s7;const a=c=>{t?e.push(c):i(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&i(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||l()}return d},batchCalls:c=>(...d)=>{a(()=>{c(...d)})},schedule:a,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{i=c}}}var An=o7(),l7=class extends bc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!rc&&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}},Wg=new l7;function c7(e){return Math.min(1e3*2**e,3e4)}function p5(e){return(e??"online")==="online"?Wg.isOnline():!0}var Jj=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function m5(e){let t=!1,n=0,r;const i=Xj(),a=()=>i.status!=="pending",l=b=>{if(!a()){const j=new Jj(b);y(j),e.onCancel?.(j)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>WN.isFocused()&&(e.networkMode==="always"||Wg.isOnline())&&e.canRun(),p=()=>p5(e.networkMode)&&e.canRun(),m=b=>{a()||(r?.(),i.resolve(b))},y=b=>{a()||(r?.(),i.reject(b))},v=()=>new Promise(b=>{r=j=>{(a()||f())&&b(j)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),w=()=>{if(a())return;let b;const j=n===0?e.initialPromise:void 0;try{b=j??e.fn()}catch(k){b=Promise.reject(k)}Promise.resolve(b).then(m).catch(k=>{if(a())return;const E=e.retry??(rc?0:3),A=e.retryDelay??c7,C=typeof A=="function"?A(n,k):A,_=E===!0||typeof E=="number"&&n<E||typeof E=="function"&&E(n,k);if(t||!_){y(k);return}n++,e.onFail?.(n,k),t7(C).then(()=>f()?void 0:v()).then(()=>{t?y(k):w()})})};return{promise:i,status:()=>i.status,cancel:l,continue:()=>(r?.(),i),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?w():v().then(w),i)}}var g5=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yj(this.gcTime)&&(this.#t=$l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rc?1/0:300*1e3))}clearGcTimeout(){this.#t&&($l.clearTimeout(this.#t),this.#t=void 0)}},u7=class extends g5{#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=a2(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=a2(this.options);t.data!==void 0&&(this.setState(i2(t.data,t.dataUpdatedAt)),this.#t=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Zj(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(Cr).catch(Cr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>qi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===QN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>$o(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:!f5(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const c=h5(this.options,t),f=(()=>{const p={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(p),p})();return this.#o=!1,this.options.persister?this.options.persister(c,f,this):c(f)},l=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(c),c})();this.options.behavior?.onFetch(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=m5({initialPromise:t?.initialPromise,fn:l.fetchFn,onCancel:c=>{c instanceof Jj&&c.revert&&this.setState({...this.#e,fetchStatus:"idle"}),n.abort()},onFail:(c,d)=>{this.#s({type:"failed",failureCount:c,error:d})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0});try{const c=await this.#r.start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Jj){if(c.silent)return this.#r.promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw this.#s({type:"error",error:c}),this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...y5(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...i2(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),An.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function y5(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:p5(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function i2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function a2(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 bc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#o=Xj(),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),s2(this.#e,this.options)?this.#m():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return e1(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return e1(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 qi(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#e.setOptions(this.options),t._defaulted&&!wh(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const r=this.hasListeners();r&&o2(this.#e,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#e!==n||qi(this.options.enabled,this.#e)!==qi(t.enabled,this.#e)||$o(this.options.staleTime,this.#e)!==$o(t.staleTime,this.#e))&&this.#g();const i=this.#y();r&&(this.#e!==n||qi(this.options.enabled,this.#e)!==qi(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 f7(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#e.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#m(e){this.#S();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Cr)),t}#g(){this.#b();const e=$o(this.options.staleTime,this.#e);if(rc||this.#i.isStale||!Yj(e))return;const n=f5(this.#i.dataUpdatedAt,e)+1;this.#c=$l.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,!(rc||qi(this.options.enabled,this.#e)===!1||!Yj(this.#l)||this.#l===0)&&(this.#u=$l.setInterval(()=>{(this.options.refetchIntervalInBackground||WN.isFocused())&&this.#m()},this.#l))}#x(){this.#g(),this.#v(this.#y())}#b(){this.#c&&($l.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&($l.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,y;if(t._optimisticResults){const R=this.hasListeners(),$=!R&&s2(e,t),F=R&&o2(e,n,t,r);($||F)&&(p={...p,...y5(f.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:b}=p;y=p.data;let j=!1;if(t.placeholderData!==void 0&&y===void 0&&b==="pending"){let R;i?.isPlaceholderData&&t.placeholderData===l?.placeholderData?(R=i.data,j=!0):R=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,R!==void 0&&(b="success",y=Zj(i?.data,R,t),m=!0)}if(t.select&&y!==void 0&&!j)if(i&&y===a?.data&&t.select===this.#p)y=this.#d;else try{this.#p=t.select,y=t.select(y),y=Zj(i?.data,y,t),this.#d=y,this.#s=null}catch(R){this.#s=R}this.#s&&(v=this.#s,y=this.#d,w=Date.now(),b="error");const k=p.fetchStatus==="fetching",E=b==="pending",A=b==="error",C=E&&k,_=y!==void 0,z={status:b,fetchStatus:p.fetchStatus,isPending:E,isSuccess:b==="success",isError:A,isInitialLoading:C,isLoading:C,data:y,dataUpdatedAt:p.dataUpdatedAt,error:v,errorUpdatedAt:w,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:A&&!_,isPaused:p.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:A&&_,isStale:XN(e,t),refetch:this.refetch,promise:this.#o,isEnabled:qi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=z.data!==void 0,$=z.status==="error"&&!R,F=K=>{$?K.reject(z.error):R&&K.resolve(z.data)},M=()=>{const K=this.#o=z.promise=Xj();F(K)},U=this.#o;switch(U.status){case"pending":e.queryHash===n.queryHash&&F(U);break;case"fulfilled":($||z.data!==U.value)&&M();break;case"rejected":(!$||z.error!==U.reason)&&M();break}}return z}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),wh(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 c=l;return this.#i[c]!==e[c]&&a.has(c)})};this.#j({listeners:n()})}#S(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#j(e){An.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function d7(e,t){return qi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function s2(e,t){return d7(e,t)||e.state.data!==void 0&&e1(e,t,t.refetchOnMount)}function e1(e,t,n){if(qi(t.enabled,e)!==!1&&$o(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&XN(e,t)}return!1}function o2(e,t,n,r){return(e!==t||qi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&XN(e,n)}function XN(e,t){return qi(t.enabled,e)!==!1&&e.isStaleByTime($o(t.staleTime,e))}function f7(e,t){return!wh(e.getCurrentResult(),t)}function l2(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 c={pages:[],pageParams:[]},d=0;const f=async()=>{let p=!1;const m=w=>{i7(w,()=>t.signal,()=>p=!0)},y=h5(t.options,t.fetchOptions),v=async(w,b,j)=>{if(p)return Promise.reject();if(b==null&&w.pages.length)return Promise.resolve(w);const E=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:b,direction:j?"backward":"forward",meta:t.options.meta};return m(O),O})(),A=await y(E),{maxPages:C}=t.options,_=j?r7:n7;return{pages:_(w.pages,A,C),pageParams:_(w.pageParams,b,C)}};if(i&&a.length){const w=i==="backward",b=w?h7:c2,j={pages:a,pageParams:l},k=b(r,j);c=await v(j,k,w)}else{const w=e??a.length;do{const b=d===0?l[0]??r.initialPageParam:c2(r,c);if(d>0&&b==null)break;c=await v(c,b),d++}while(d<w)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=f}}}function c2(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 h7(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var p7=class extends g5{#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||v5(),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=m5({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),An.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function v5(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var x5=class extends bc{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 p7({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=Im(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=Im(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=Im(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=Im(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){An.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=>t2(t,n))}findAll(e={}){return this.getAll().filter(t=>t2(e,t))}notify(e){An.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return An.batch(()=>Promise.all(e.map(t=>t.continue().catch(Cr))))}};function Im(e){return e.options.scope?.id}var m7=class extends bc{#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),wh(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&ic(n.mutationKey)!==ic(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??v5();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){An.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 u2(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function g7(e,t,n){const r=e.slice(0);return r[t]=n,r}var y7=class extends bc{#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,An.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,c=i.some((p,m)=>p!==n[m]),d=l||c,f=d?!0:a.some((p,m)=>{const y=this.#e[m];return!y||!wh(p,y)});!d&&!f||(d&&(this.#d=r,this.#r=i),this.#e=a,this.hasListeners()&&(d&&(u2(n,i).forEach(p=>{p.destroy()}),u2(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=VN(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=g7(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&&An.batch(()=>{this.listeners.forEach(r=>{r(this.#e)})})}}},v7=class extends bc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??GN(r,t);let a=this.get(i);return a||(a=new u7({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(){An.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=>e2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>e2(e,n)):t}notify(e){An.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){An.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},x7=class{#t;#e;#n;#i;#r;#a;#o;#s;constructor(e={}){this.#t=e.queryCache||new v7,this.#e=e.mutationCache||new x5,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=WN.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Wg.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($o(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=JK(t,a);if(l!==void 0)return this.#t.build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return An.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;An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return An.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=An.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Cr).catch(Cr)}invalidateQueries(e,t={}){return An.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=An.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(Cr)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(r).then(Cr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime($o(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cr).catch(Cr)}fetchInfiniteQuery(e){return e.behavior=l2(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cr).catch(Cr)}ensureInfiniteQueryData(e){return e.behavior=l2(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Wg.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(ic(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{bh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(ic(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{bh(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=GN(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===QN&&(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()}},b5=x.createContext(void 0),Hn=e=>{const t=x.useContext(b5);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},b7=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(b5.Provider,{value:e,children:t})),w5=x.createContext(!1),S5=()=>x.useContext(w5);w5.Provider;function w7(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var S7=x.createContext(w7()),j5=()=>x.useContext(S7),N5=(e,t,n)=>{const r=n?.state.error&&typeof e.throwOnError=="function"?YN(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},k5=e=>{x.useEffect(()=>{e.clearReset()},[e])},C5=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||YN(n,[e.error,r])),A5=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},j7=(e,t)=>e.isLoading&&e.isFetching&&!t,t1=(e,t)=>e?.suspense&&t.isPending,n1=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function E5({queries:e,...t},n){const r=Hn(),i=S5(),a=j5(),l=x.useMemo(()=>e.map(b=>{const j=r.defaultQueryOptions(b);return j._optimisticResults=i?"isRestoring":"optimistic",j}),[e,r,i]);l.forEach(b=>{A5(b);const j=r.getQueryCache().get(b.queryHash);N5(b,a,j)}),k5(a);const[c]=x.useState(()=>new y7(r,l,t)),[d,f,p]=c.getOptimisticResult(l,t.combine),m=!i&&t.subscribed!==!1;x.useSyncExternalStore(x.useCallback(b=>m?c.subscribe(An.batchCalls(b)):Cr,[c,m]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setQueries(l,t)},[l,t,c]);const v=d.some((b,j)=>t1(l[j],b))?d.flatMap((b,j)=>{const k=l[j];if(k&&t1(k,b)){const E=new ZN(r,k);return n1(k,E,a)}return[]}):[];if(v.length>0)throw Promise.all(v);const w=d.find((b,j)=>{const k=l[j];return k&&C5({result:b,errorResetBoundary:a,throwOnError:k.throwOnError,query:r.getQueryCache().get(k.queryHash),suspense:k.suspense})});if(w?.error)throw w.error;return f(p())}function N7(e,t,n){const r=S5(),i=j5(),a=Hn(),l=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(l);const c=a.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",A5(l),N5(l,i,c),k5(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(y=>{const v=m?f.subscribe(An.batchCalls(y)):Cr;return f.updateResult(),v},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),x.useEffect(()=>{f.setOptions(l)},[l,f]),t1(l,p))throw n1(l,f,i);if(C5({result:p,errorResetBoundary:i,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw p.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(l,p),l.experimental_prefetchInRender&&!rc&&j7(p,r)&&(d?n1(l,f,i):c?.promise)?.catch(Cr).finally(()=>{f.updateResult()}),l.notifyOnChangeProps?p:f.trackResult(p)}function Un(e,t){return N7(e,ZN)}function Yi(e,t){const n=Hn(),[r]=x.useState(()=>new m7(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);const i=x.useSyncExternalStore(x.useCallback(l=>r.subscribe(An.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((l,c)=>{r.mutate(l,c).catch(Cr)},[r]);if(i.error&&YN(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Lm=typeof window<"u"?x.useLayoutEffect:x.useEffect;function xw(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 k7(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 C7(e){const t=x.useRef(null);return x.useImperativeHandle(e,()=>t.current,[]),t}var A7=!1;function Sh(e){return e[e.length-1]}function E7(e){return typeof e=="function"}function Ro(e,t){return E7(e)?e(t):e}var O7=Object.prototype.hasOwnProperty,d2=Object.prototype.propertyIsEnumerable,z7=()=>Object.create(null),Al=(e,t)=>Bl(e,t,z7);function Bl(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;const i=t,a=p2(e)&&p2(i);if(!a&&!(Zg(e)&&Zg(i)))return i;const l=a?e:f2(e);if(!l)return i;const c=a?i:f2(i);if(!c)return i;const d=l.length,f=c.length,p=a?new Array(f):n();let m=0;for(let y=0;y<f;y++){const v=a?y:c[y],w=e[v],b=i[v];if(w===b){p[v]=w,(a?y<d:O7.call(e,v))&&m++;continue}if(w===null||b===null||typeof w!="object"||typeof b!="object"){p[v]=b;continue}const j=Bl(w,b,n,r+1);p[v]=j,j===w&&m++}return d===f&&m===d?e:p}function f2(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!d2.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(!d2.call(e,i))return!1;r.push(i)}return r}function Zg(e){if(!h2(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!h2(n)||!n.hasOwnProperty("isPrototypeOf"))}function h2(e){return Object.prototype.toString.call(e)==="[object Object]"}function p2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Yl(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(!Yl(e[r],t[r],n))return!1;return!0}if(Zg(e)&&Zg(t)){const r=n?.ignoreUndefined??!0;if(n?.partial){for(const l in t)if((!r||t[l]!==void 0)&&!Yl(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||!Yl(e[l],t[l],n)))return!1;return i===a}return!1}function id(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 jh(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function _7(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function m2(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 _7(t)}var T7=["http:","https:","mailto:","tel:"];function Xg(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Pf(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+=m2(e.slice(n,i.index))+i[0],n=t.lastIndex;r=r+m2(n?e.slice(n):e);let a=!1;return r.startsWith("//")&&(a=!0,r="/"+r.replace(/^\/+/,"")),{path:r,handledProtocolRelativeURL:a}}function P7(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Jg(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 c=t.get(a);if(c)c.value=l,i(c);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 R7="Invariant failed";function Ps(e,t){if(!e)throw new Error(R7)}var Ul=4,O5=5;function D7(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 JN(e,t,n=new Uint16Array(6)){const r=e.indexOf("/",t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const c=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=c,n[4]=c,n[5]=c,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=D7(a);if(l){const[c,d]=l,f=a.charCodeAt(c+1);if(f===45){if(c+2<a.length&&a.charCodeAt(c+2)===36){const p=c+3,m=d;if(p<m)return n[0]=3,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=i,n}}else if(f===36){const p=c+1,m=c+2;return m===d?(n[0]=2,n[1]=t+c,n[2]=t+p,n[3]=t+m,n[4]=t+d+1,n[5]=e.length,n):(n[0]=1,n[1]=t+c,n[2]=t+m,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Cv(e,t,n,r,i,a,l){l?.(n);let c=r;{const d=n.fullPath??n.from,f=d.length,p=n.options?.caseSensitive??e,m=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;c<f;){const v=JN(d,c,t);let w;const b=c,j=v[5];switch(c=j+1,a++,v[0]){case 0:{const k=d.substring(v[2],v[3]);if(p){const E=i.static?.get(k);if(E)w=E;else{i.static??=new Map;const A=ql(n.fullPath??n.from);A.parent=i,A.depth=a,w=A,i.static.set(k,A)}}else{const E=k.toLowerCase(),A=i.staticInsensitive?.get(E);if(A)w=A;else{i.staticInsensitive??=new Map;const C=ql(n.fullPath??n.from);C.parent=i,C.depth=a,w=C,i.staticInsensitive.set(E,C)}}break}case 1:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),A=p&&!!(k||E),C=k?A?k:k.toLowerCase():void 0,_=E?A?E:E.toLowerCase():void 0,O=!m&&i.dynamic?.find(z=>!z.skipOnParamError&&z.caseSensitive===A&&z.prefix===C&&z.suffix===_);if(O)w=O;else{const z=ww(1,n.fullPath??n.from,A,C,_);w=z,z.depth=a,z.parent=i,i.dynamic??=[],i.dynamic.push(z)}break}case 3:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),A=p&&!!(k||E),C=k?A?k:k.toLowerCase():void 0,_=E?A?E:E.toLowerCase():void 0,O=!m&&i.optional?.find(z=>!z.skipOnParamError&&z.caseSensitive===A&&z.prefix===C&&z.suffix===_);if(O)w=O;else{const z=ww(3,n.fullPath??n.from,A,C,_);w=z,z.parent=i,z.depth=a,i.optional??=[],i.optional.push(z)}break}case 2:{const k=d.substring(b,v[1]),E=d.substring(v[4],j),A=p&&!!(k||E),C=k?A?k:k.toLowerCase():void 0,_=E?A?E:E.toLowerCase():void 0,O=ww(2,n.fullPath??n.from,A,C,_);w=O,O.parent=i,O.depth=a,i.wildcard??=[],i.wildcard.push(O)}}i=w}if(m&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const v=ql(n.fullPath??n.from);v.kind=O5,v.parent=i,a++,v.depth=a,i.pathless??=[],i.pathless.push(v),i=v}const y=(n.path||!n.children)&&!n.isRoot;if(y&&d.endsWith("/")){const v=ql(n.fullPath??n.from);v.kind=Ul,v.parent=i,a++,v.depth=a,i.index=v,i=v}i.parse=n.options?.params?.parse??null,i.skipOnParamError=m,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,y&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)Cv(e,t,d,c,i,a,l)}function bw(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 Eo(e){if(e.pathless)for(const t of e.pathless)Eo(t);if(e.static)for(const t of e.static.values())Eo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())Eo(t);if(e.dynamic?.length){e.dynamic.sort(bw);for(const t of e.dynamic)Eo(t)}if(e.optional?.length){e.optional.sort(bw);for(const t of e.optional)Eo(t)}if(e.wildcard?.length){e.wildcard.sort(bw);for(const t of e.wildcard)Eo(t)}}function ql(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 ww(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 M7(e,t){const n=ql("/"),r=new Uint16Array(6);for(const i of e)Cv(!1,r,i,1,n,0);Eo(n),t.masksTree=n,t.flatCache=Jg(1e3)}function I7(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const r=ek(e,t.masksTree);return t.flatCache.set(e,r),r}function L7(e,t,n,r,i){e||="/",r||="/";const a=t?`case\0${e}`:e;let l=i.singleCache.get(a);return l||(l=ql("/"),Cv(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(a,l)),ek(r,l,n)}function $7(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=ek(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)a=null;else throw l}return a&&(a.branch=q7(a.route)),t.matchCache.set(r,a),a}function B7(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function U7(e,t=!1,n){const r=ql(e.fullPath),i=new Uint16Array(6),a={},l={};let c=0;return Cv(t,i,e,1,r,0,d=>{if(n?.(d,c),Ps(!(d.id in a),`Duplicate routes found with id: ${String(d.id)}`),a[d.id]=d,c!==0&&d.path){const f=B7(d.fullPath);(!l[f]||d.fullPath.endsWith("/"))&&(l[f]=d)}c++}),Eo(r),{processedTree:{segmentTree:r,singleCache:Jg(1e3),matchCache:Jg(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:l}}function ek(e,t,n=!1){const r=e.split("/"),i=H7(e,r,t,n);if(!i)return null;const[a]=z5(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function z5(e,t,n){const r=F7(n.node);let i=null;const a=Object.create(null);let l=n.extract?.part??0,c=n.extract?.node??0,d=n.extract?.path??0,f=n.extract?.segment??0;for(;c<r.length;l++,c++,d++,f++){const p=r[c];if(p.kind===Ul)break;if(p.kind===O5){f--,l--,d--;continue}const m=t[l],y=d;if(m&&(d+=m.length),p.kind===1){i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0;if(v.charCodeAt(w)===123){const b=p.suffix?.length??0,j=v.substring(w+2,v.length-b-1),k=m.substring(w,m.length-b);a[j]=decodeURIComponent(k)}else{const b=v.substring(1);a[b]=decodeURIComponent(m)}}else if(p.kind===3){if(n.skipped&1<<c){l--,d=y-1;continue}i??=n.node.fullPath.split("/");const v=i[f],w=p.prefix?.length??0,b=p.suffix?.length??0,j=v.substring(w+3,v.length-b-1),k=p.suffix||p.prefix?m.substring(w,m.length-b):m;k&&(a[j]=decodeURIComponent(k))}else if(p.kind===2){const v=p,w=e.substring(y+(v.prefix?.length??0),e.length-(v.suffix?.length??0)),b=decodeURIComponent(w);a["*"]=b,a._splat=b;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:l,node:c,path:d,segment:f}]}function q7(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function F7(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function H7(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Sh(t),a=i&&e!=="/",l=t.length-(i?1:0),c=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,f=null,p=null;for(;c.length;){const m=c.pop(),{node:y,index:v,skipped:w,depth:b,statics:j,dynamics:k,optionals:E}=m;let{extract:A,rawParams:C,parsedParams:_}=m;if(y.skipOnParamError){if(!Sw(e,t,m))continue;C=m.rawParams,A=m.extract,_=m.parsedParams}r&&y.route&&y.kind!==Ul&&Rf(f,m)&&(f=m);const O=v===l;if(O&&(y.route&&!a&&Rf(p,m)&&(p=m),!y.optional&&!y.wildcard&&!y.index&&!y.pathless))continue;const z=O?void 0:t[v];let R;if(O&&y.index){const $={node:y.index,index:v,skipped:w,depth:b+1,statics:j,dynamics:k,optionals:E,extract:A,rawParams:C,parsedParams:_};let F=!0;if(y.index.skipOnParamError&&(Sw(e,t,$)||(F=!1)),F){if(j===l&&!k&&!E&&!w)return $;Rf(p,$)&&(p=$)}}if(y.wildcard&&Rf(d,m))for(const $ of y.wildcard){const{prefix:F,suffix:M}=$;if(F&&(O||!($.caseSensitive?z:R??=z.toLowerCase()).startsWith(F)))continue;if(M){if(O)continue;const K=t.slice(v).join("/").slice(-M.length);if(($.caseSensitive?K:K.toLowerCase())!==M)continue}const U={node:$,index:l,skipped:w,depth:b,statics:j,dynamics:k,optionals:E,extract:A,rawParams:C,parsedParams:_};if(!($.skipOnParamError&&!Sw(e,t,U))){d=U;break}}if(y.optional){const $=w|1<<b,F=b+1;for(let M=y.optional.length-1;M>=0;M--){const U=y.optional[M];c.push({node:U,index:v,skipped:$,depth:F,statics:j,dynamics:k,optionals:E,extract:A,rawParams:C,parsedParams:_})}if(!O)for(let M=y.optional.length-1;M>=0;M--){const U=y.optional[M],{prefix:K,suffix:Z}=U;if(K||Z){const Y=U.caseSensitive?z:R??=z.toLowerCase();if(K&&!Y.startsWith(K)||Z&&!Y.endsWith(Z))continue}c.push({node:U,index:v+1,skipped:w,depth:F,statics:j,dynamics:k,optionals:E+1,extract:A,rawParams:C,parsedParams:_})}}if(!O&&y.dynamic&&z)for(let $=y.dynamic.length-1;$>=0;$--){const F=y.dynamic[$],{prefix:M,suffix:U}=F;if(M||U){const K=F.caseSensitive?z:R??=z.toLowerCase();if(M&&!K.startsWith(M)||U&&!K.endsWith(U))continue}c.push({node:F,index:v+1,skipped:w,depth:b+1,statics:j,dynamics:k+1,optionals:E,extract:A,rawParams:C,parsedParams:_})}if(!O&&y.staticInsensitive){const $=y.staticInsensitive.get(R??=z.toLowerCase());$&&c.push({node:$,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:A,rawParams:C,parsedParams:_})}if(!O&&y.static){const $=y.static.get(z);$&&c.push({node:$,index:v+1,skipped:w,depth:b+1,statics:j+1,dynamics:k,optionals:E,extract:A,rawParams:C,parsedParams:_})}if(y.pathless){const $=b+1;for(let F=y.pathless.length-1;F>=0;F--){const M=y.pathless[F];c.push({node:M,index:v,skipped:w,depth:$,statics:j,dynamics:k,optionals:E,extract:A,rawParams:C,parsedParams:_})}}}if(p&&d)return Rf(d,p)?p:d;if(p)return p;if(d)return d;if(r&&f){let m=f.index;for(let v=0;v<f.index;v++)m+=t[v].length;const y=m===e.length?"/":e.slice(m);return f.rawParams??=Object.create(null),f.rawParams["**"]=decodeURIComponent(y),f}return null}function Sw(e,t,n){try{const[r,i]=z5(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 Rf(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===Ul)>(e.node.kind===Ul)||t.node.kind===Ul==(e.node.kind===Ul)&&t.depth>e.depth))):!0}function Pg(e){return tk(e.filter(t=>t!==void 0).join("/"))}function tk(e){return e.replace(/\/{2,}/g,"/")}function _5(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Bo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function T5(e){return Bo(_5(e))}function ey(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function K7(e,t,n){return ey(e,n)===ey(t,n)}function G7({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 c;if(a)c=e.split("/");else if(i)c=t.split("/");else{for(c=e.split("/");c.length>1&&Sh(c)==="";)c.pop();const m=t.split("/");for(let y=0,v=m.length;y<v;y++){const w=m[y];w===""?y?y===v-1&&c.push(w):c=[w]:w===".."?c.pop():w==="."||c.push(w)}}c.length>1&&(Sh(c)===""?n==="never"&&c.pop():n==="always"&&c.push(""));let d,f="";for(let m=0;m<c.length;m++){m>0&&(f+="/");const y=c[m];if(!y)continue;d=JN(y,0,d);const v=d[0];if(v===0){f+=y;continue}const w=d[5],b=y.substring(0,d[1]),j=y.substring(d[4],w),k=y.substring(d[2],d[3]);v===1?f+=b||j?`${b}{$${k}}${j}`:`$${k}`:v===2?f+=b||j?`${b}{$}${j}`:"$":f+=`${b}{-$${k}}${j}`}f=tk(f);const p=f||"/";return l&&r&&r.set(l,p),p}function V7(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 jw(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=>y2(i,n)).join("/"):y2(r,n)}function g2({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 c=0,d,f="";for(;c<l;){const p=c;d=JN(e,p,d);const m=d[5];if(c=m+1,p===m)continue;const y=d[0];if(y===0){f+="/"+e.substring(p,m);continue}if(y===2){const v=t._splat;a._splat=v,a["*"]=v;const w=e.substring(p,d[1]),b=e.substring(d[4],m);if(!v){i=!0,(w||b)&&(f+="/"+w+b);continue}const j=jw("_splat",t,n);f+="/"+w+j+b;continue}if(y===1){const v=e.substring(d[2],d[3]);!i&&!(v in t)&&(i=!0),a[v]=t[v];const w=e.substring(p,d[1]),b=e.substring(d[4],m),j=jw(v,t,n)??"undefined";f+="/"+w+j+b;continue}if(y===3){const v=e.substring(d[2],d[3]),w=t[v];if(w==null)continue;a[v]=w;const b=e.substring(p,d[1]),j=e.substring(d[4],m),k=jw(v,t,n)??"";f+="/"+b+k+j;continue}}return e.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:i}}function y2(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Fr(e){return!!e?.isNotFound}function Q7(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}var r1="tsr-scroll-restoration-v1_3",Y7=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function W7(){const e=Q7();if(!e)return null;const t=e.getItem(r1);let n=t?JSON.parse(t):{};return{state:n,set:r=>{n=Ro(r,n)||n;try{e.setItem(r1,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}var $m=W7(),Z7=e=>e.state.__TSR_key||e.href;function X7(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 ty=!1;function J7({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 c=t||window.history.state?.__TSR_key,d=l[c];ty=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const m in d){const y=d[m];if(m==="window")window.scrollTo({top:y.scrollY,left:y.scrollX,behavior:n});else if(m){const v=document.querySelector(m);v&&(v.scrollLeft=y.scrollX,v.scrollTop=y.scrollY)}}break e}const f=(a??window.location).hash.split("#",2)[1];if(f){const m=window.history.state?.__hashScrollIntoViewOptions??!0;if(m){const y=document.getElementById(f);y&&y.scrollIntoView(m)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),i)for(const m of i){if(m==="window")continue;const y=typeof m=="function"?m():document.querySelector(m);y&&y.scrollTo(p)}}ty=!1}function eG(e,t){if(!$m||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!$m))return;e.isScrollRestorationSetup=!0,ty=!1;const n=e.options.getScrollRestorationKey||Z7;window.history.scrollRestoration="manual";const r=i=>{if(ty||!e.isScrollRestoring)return;let a="";if(i.target===document||i.target===window)a="window";else{const c=i.target.getAttribute("data-scroll-restoration-id");c?a=`[data-scroll-restoration-id="${c}"]`:a=X7(i.target)}const l=n(e.state.location);$m.set(c=>{const d=c[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 c})};typeof document<"u"&&document.addEventListener("scroll",Y7(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})||(J7({storageKey:r1,key:a,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&$m.set(l=>(l[a]||={},l)))})}function tG(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 nG(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 Nw(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function rG(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]=Nw(i):Array.isArray(a)?a.push(Nw(i)):n[r]=[a,Nw(i)]}return n}var iG=sG(JSON.parse),aG=oG(JSON.stringify,JSON.parse);function sG(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=rG(t);for(const r in n){const i=n[r];if(typeof i=="string")try{n[r]=e(i)}catch{}}return n}}function oG(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=nG(i,r);return a?`?${a}`:""}}var Wl="__root__";function nk(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 ii(e){return e instanceof Response&&!!e.options}function lG(e){return{input:({url:t})=>{for(const n of e)t=i1(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=P5(e[n],t);return t}}}function cG(e){const t=T5(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const c=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return c===i?l.pathname="/":c.startsWith(a)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=Pg(["/",t,l.pathname]),l)}}function i1(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 P5(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}var fn=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(fn||{});function R5({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:l,shallowPropagate:c};function r(f,p,m){const y=p.depsTail;if(y!==void 0&&y.dep===f)return;const v=y!==void 0?y.nextDep:p.deps;if(v!==void 0&&v.dep===f){v.version=m,p.depsTail=v;return}const w=f.subsTail;if(w!==void 0&&w.version===m&&w.sub===p)return;const b=p.depsTail=f.subsTail={version:m,dep:f,sub:p,prevDep:y,nextDep:v,prevSub:w,nextSub:void 0};v!==void 0&&(v.prevDep=b),y!==void 0?y.nextDep=b:p.deps=b,w!==void 0?w.nextSub=b:f.subs=b}function i(f,p=f.sub){const m=f.dep,y=f.prevDep,v=f.nextDep,w=f.nextSub,b=f.prevSub;return v!==void 0?v.prevDep=y:p.depsTail=y,y!==void 0?y.nextDep=v:p.deps=v,w!==void 0?w.prevSub=b:m.subsTail=b,b!==void 0?b.nextSub=w:(m.subs=w)===void 0&&n(m),v}function a(f){let p=f.nextSub,m;e:do{const y=f.sub;let v=y.flags;if(v&60?v&12?v&4?!(v&48)&&d(f,y)?(y.flags=v|40,v&=1):v=0:y.flags=v&-9|32:v=0:y.flags=v|32,v&2&&t(y),v&1){const w=y.subs;if(w!==void 0){const b=(f=w).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,y=0,v=!1;e:do{const w=f.dep,b=w.flags;if(p.flags&16)v=!0;else if((b&17)===17){if(e(w)){const j=w.subs;j.nextSub!==void 0&&c(j),v=!0}}else if((b&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(m={value:f,prev:m}),f=w.deps,p=w,++y;continue}if(!v){const j=f.nextDep;if(j!==void 0){f=j;continue}}for(;y--;){const j=p.subs,k=j.nextSub!==void 0;if(k?(f=m.value,m=m.prev):f=j,v){if(e(p)){k&&c(j),p=f.sub;continue}v=!1}else p.flags&=-33;p=f.sub;const E=f.nextDep;if(E!==void 0){f=E;continue e}}return v}while(!0)}function c(f){do{const p=f.sub,m=p.flags;(m&48)===32&&(p.flags=m|16,(m&6)===2&&t(p))}while((f=f.nextSub)!==void 0)}function d(f,p){let m=p.depsTail;for(;m!==void 0;){if(m===f)return!0;m=m.prevDep}return!1}}let rk=0,El=0,ch=0;const Ns=[],{link:k2e,unlink:D5,propagate:C2e,checkDirty:uG,shallowPropagate:A2e}=R5({update(e){return e.depsTail!==void 0?pG(e):mG(e)},notify(e){let t=ch,n=t;do if(Ns[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(ch=t;n<--t;){const r=Ns[n];Ns[n++]=Ns[t],Ns[t]=r}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,Av(e)):vG.call(e)}});function dG(){return rk}function fG(){++rk}function hG(){--rk||yG()}function pG(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,Av(e)}}function mG(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function gG(e){const t=e.flags;if(t&16||t&32&&uG(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,Av(e)}}else e.flags=2}function yG(){try{for(;El<ch;){const e=Ns[El];Ns[El++]=void 0,gG(e)}}finally{for(;El<ch;){const e=Ns[El];Ns[El++]=void 0,e.flags|=10}El=0,ch=0}}function vG(){this.depsTail=void 0,this.flags=0,Av(this);const e=this.subs;e!==void 0&&D5(e)}function Av(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=D5(n,e)}function ik(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 a1=[];let Rg=0;const{link:v2,unlink:xG,propagate:bG,checkDirty:M5,shallowPropagate:x2}=R5({update(e){return e._update()},notify(e){a1[s1++]=e,e.flags&=~fn.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=fn.Mutable|fn.Dirty,ny(e))}});let Bm=0,s1=0,Ma;function ny(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=xG(n,e)}function I5(){if(!(dG()>0)){for(;Bm<s1;){const e=a1[Bm];a1[Bm++]=void 0,e.notify()}Bm=0,s1=0}}function L5(e,t){const n=typeof e=="function",r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?fn.None:fn.Mutable,get(){return Ma!==void 0&&v2(i,Ma,Rg),i._snapshot},subscribe(a){const l=ik(a),c={current:!1},d=wG(()=>{i.get(),c.current?l.next?.(i._snapshot):c.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const l=Ma,c=Object.is;if(n)Ma=i,++Rg,i.depsTail=void 0;else if(a===void 0)return!1;n&&(i.flags=fn.Mutable|fn.RecursedCheck);try{const d=i._snapshot,f=typeof a=="function"?a(d):a===void 0&&n?r(d):a;return d===void 0||!c(d,f)?(i._snapshot=f,!0):!1}finally{Ma=l,n&&(i.flags&=~fn.RecursedCheck),ny(i)}}};return n?(i.flags=fn.Mutable|fn.Dirty,i.get=function(){const a=i.flags;if(a&fn.Dirty||a&fn.Pending&&M5(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&x2(l)}}else a&fn.Pending&&(i.flags=a&~fn.Pending);return Ma!==void 0&&v2(i,Ma,Rg),i._snapshot}):i.set=function(a){if(i._update(a)){const l=i.subs;l!==void 0&&(bG(l),x2(l),I5())}},i}function wG(e){const t=()=>{const r=Ma;Ma=n,++Rg,n.depsTail=void 0,n.flags=fn.Watching|fn.RecursedCheck;try{return e()}finally{Ma=r,n.flags&=~fn.RecursedCheck,ny(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:fn.Watching|fn.RecursedCheck,notify(){const r=this.flags;r&fn.Dirty||r&fn.Pending&&M5(this.deps,this)?t():this.flags=fn.Watching},stop(){this.flags=fn.None,this.depsTail=void 0,ny(this)}};return t(),n}class SG{constructor(t){this.atom=L5(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ik(t))}}class jG{constructor(t){this.atom=L5(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(ik(t))}}function NG(e){return typeof e=="function"?new jG(e):new SG(e)}function kG(e){try{fG(),e()}finally{hG(),I5()}}function uh(e){let t;return kG(()=>{t=e()}),t}var o1=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ev=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Zl=(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 c=e.router.getMatch(l.id);c&&Object.assign(r,c.__routeContext,c.__beforeLoadContext)}return r},b2=(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 c=e.matches[l];if(e.router.looseRoutesById[c.routeId].options.notFoundComponent)return l}return n?a:i},Do=(e,t,n)=>{if(!(!ii(n)&&!Fr(n)))throw ii(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:ii(n)?"redirected":r.status==="pending"?"success":r.status,context:Zl(e,t.index),isFetching:!1,error:n})),Fr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),ii(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},$5=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},w2=(e,t,n)=>{const r=Zl(e,n);e.updateMatch(t,i=>({...i,context:r}))},Df=(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,Do(e,e.router.getMatch(i),n);try{l.options.onError?.(n)}catch(c){n=c,Do(e,e.router.getMatch(i),n)}e.updateMatch(i,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!ii(n)&&!Fr(n)&&(e.serialError??=n)},B5=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ev(e,t)&&(n.options.loader||n.options.beforeLoad||q5(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){const a=setTimeout(()=>{o1(e)},i);r._nonReactive.pendingTimeout=a}},CG=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;B5(e,t,n,r);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&Do(e,a,a.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},AG=(e,t,n,r)=>{const i=e.router.getMatch(t);let a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=id(()=>{a?.resolve(),a=void 0});const{paramsError:l,searchError:c}=i;l&&Df(e,n,l,"PARSE_PARAMS"),c&&Df(e,n,c,"VALIDATE_SEARCH"),B5(e,t,r,i);const d=new AbortController;let f=!1;const p=()=>{f||(f=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:d})))},m=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,C=>({...C,isFetching:!1}))};if(!r.options.beforeLoad){uh(()=>{p(),m()});return}i._nonReactive.beforeLoadPromise=id();const y={...Zl(e,n,!1),...i.__routeContext},{search:v,params:w,cause:b}=i,j=Ev(e,t),k={search:v,abortController:d,params:w,preload:j,context:y,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:j?"preload":b,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},E=C=>{if(C===void 0){uh(()=>{p(),m()});return}(ii(C)||Fr(C))&&(p(),Df(e,n,C,"BEFORE_LOAD")),uh(()=>{p(),e.updateMatch(t,_=>({..._,__beforeLoadContext:C})),m()})};let A;try{if(A=r.options.beforeLoad(k),jh(A))return p(),A.catch(C=>{Df(e,n,C,"BEFORE_LOAD")}).then(E)}catch(C){p(),Df(e,n,C,"BEFORE_LOAD")}E(A)},EG=(e,t)=>{const{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>c(),l=()=>AG(e,n,t,i),c=()=>{if($5(e,n))return;const d=CG(e,n,i);return jh(d)?d.then(l):l()};return a()},OG=(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,c])=>({meta:a?.meta,links:a?.links,headScripts:a?.scripts,headers:c,scripts:l,styles:a?.styles}))},U5=(e,t,n,r,i)=>{const a=t[r-1],{params:l,loaderDeps:c,abortController:d,cause:f}=e.router.getMatch(n),p=Zl(e,r),m=Ev(e,n);return{params:l,deps:c,preload:!!m,parentMatchPromise:a,abortController:d,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:m?"preload":f,route:i,...e.router.options.additionalContext}},S2=async(e,t,n,r,i)=>{try{const a=e.router.getMatch(n);try{(!(A7??e.router.isServer)||a.ssr===!0)&&Nh(i);const l=i.options.loader,c=typeof l=="function"?l:l?.handler,d=c?.(U5(e,t,n,r,i)),f=!!c&&jh(d);if((f||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,m=>({...m,isFetching:"loader"})),c){const m=f?await d:d;Do(e,e.router.getMatch(n),m),m!==void 0&&e.updateMatch(n,y=>({...y,loaderData:m}))}i._lazyPromise&&await i._lazyPromise;const p=a._nonReactive.minPendingPromise;p&&await p,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,m=>({...m,error:void 0,context:Zl(e,r),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let c=l;if(c?.name==="AbortError"){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:Zl(e,r)}));return}const d=a._nonReactive.minPendingPromise;d&&await d,Fr(l)&&await i.options.notFoundComponent?.preload?.(),Do(e,e.router.getMatch(n),l);try{i.options.onError?.(l)}catch(f){c=f,Do(e,e.router.getMatch(n),f)}!ii(c)&&!Fr(c)&&await Nh(i,["errorComponent"]),e.updateMatch(n,f=>({...f,error:c,context:Zl(e,r),status:"error",isFetching:!1}))}}catch(a){const l=e.router.getMatch(n);l&&(l._nonReactive.loaderPromise=void 0),Do(e,l,a)}},zG=async(e,t,n)=>{async function r(v,w,b,j,k){const E=Date.now()-w.updatedAt,A=v?k.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:k.options.staleTime??e.router.options.defaultStaleTime??0,C=k.options.shouldReload,_=typeof C=="function"?C(U5(e,t,i,n,k)):C,{status:O,invalid:z}=j,R=E>A&&(!!e.forceStaleReload||j.cause==="enter"||b!==void 0&&b!==j.id);l=O==="success"&&(z||(_??R)),v&&k.options.preload===!1||(l&&!e.sync&&p?(c=!0,(async()=>{try{await S2(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($){ii($)&&await e.router.navigate($.options)}})()):O!=="success"||l?await S2(e,t,i,n,k):w2(e,i,n))}const{id:i,routeId:a}=e.matches[n];let l=!1,c=!1;const d=e.router.looseRoutesById[a],f=d.options.loader,p=((typeof f=="function"?void 0:f?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if($5(e,i)){if(!e.router.getMatch(i))return e.matches[n];w2(e,i,n)}else{const v=e.router.getMatch(i),w=e.router.state.matches[n]?.routeId===a?e.router.state.matches[n].id:e.router.state.matches.find(j=>j.routeId===a)?.id,b=Ev(e,i);if(v._nonReactive.loaderPromise){if(v.status==="success"&&!e.sync&&!v.preload&&p)return v;await v._nonReactive.loaderPromise;const j=e.router.getMatch(i),k=j._nonReactive.error||j.error;k&&Do(e,j,k),j.status==="pending"&&await r(b,v,w,j,d)}else{const j=b&&!e.router.state.matches.some(E=>E.id===i),k=e.router.getMatch(i);k._nonReactive.loaderPromise=id(),j!==k.preload&&e.updateMatch(i,E=>({...E,preload:j})),await r(b,v,w,k,d)}}const m=e.router.getMatch(i);c||(m._nonReactive.loaderPromise?.resolve(),m._nonReactive.loadPromise?.resolve(),m._nonReactive.loadPromise=void 0),clearTimeout(m._nonReactive.pendingTimeout),m._nonReactive.pendingTimeout=void 0,c||(m._nonReactive.loaderPromise=void 0),m._nonReactive.dehydrated=void 0;const y=c?m.isFetching:!1;return y!==m.isFetching||m.invalid!==!1?(e.updateMatch(i,v=>({...v,isFetching:y,invalid:!1})),e.router.getMatch(i)):m};async function j2(e){const t=e,n=[];t.router.state.matches.some(y=>y._forcePending)&&o1(t);let r;for(let y=0;y<t.matches.length;y++){try{const v=EG(t,y);jh(v)&&await v}catch(v){if(ii(v))throw v;if(Fr(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?b2(t,r):void 0,l=r&&t.preload?0:a!==void 0?Math.min(a+1,i):i;let c,d;for(let y=0;y<l;y++)n.push(zG(t,n,y));try{await Promise.all(n)}catch{const y=await Promise.allSettled(n);for(const v of y){if(v.status!=="rejected")continue;const w=v.reason;if(ii(w))throw w;Fr(w)?c??=w:d??=w}if(d!==void 0)throw d}const f=c??(r&&!t.preload?r:void 0);let p=t.serialError?t.firstBadMatchIndex??0:t.matches.length-1;if(!f&&r&&t.preload)return t.matches;if(f){const y=b2(t,f);Ps(y!==void 0);const v=t.matches[y],w=t.router.looseRoutesById[v.routeId],b=t.router.options?.defaultNotFoundComponent;!w.options.notFoundComponent&&b&&(w.options.notFoundComponent=b),f.routeId=v.routeId;const j=v.routeId===t.router.routeTree.id;t.updateMatch(v.id,k=>({...k,...j?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:f},isFetching:!1})),p=y,await Nh(w,["notFoundComponent"])}else if(!t.preload){const y=t.matches[0];y.globalNotFound||t.router.getMatch(y.id)?.globalNotFound&&t.updateMatch(y.id,v=>({...v,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const y=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Nh(y,["errorComponent"])}for(let y=0;y<=p;y++){const{id:v,routeId:w}=t.matches[y],b=t.router.looseRoutesById[w];try{const j=OG(t,v,b);if(j){const k=await j;t.updateMatch(v,E=>({...E,...k}))}}catch(j){console.error(`Error executing head for route ${w}:`,j)}}const m=o1(t);if(jh(m)&&await m,f)throw f;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function N2(e,t){const n=t.map(r=>e.options[r]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Nh(e,t=Dg){!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===Dg?(()=>{if(e._componentsPromise===void 0){const r=N2(e,Dg);r?e._componentsPromise=r.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():N2(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function q5(e){for(const t of Dg)if(e.options[t]?.preload)return!0;return!1}var Dg=["component","errorComponent","pendingComponent","notFoundComponent"],Uo="__TSR_index",k2="popstate",C2="beforeunload";function _G(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},a=async({task:l,navigateOpts:c,...d})=>{if(c?.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 y=ry(d.path,d.state);if(await m.blockerFn({currentLocation:t,nextLocation:y,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,c,d)=>{const f=t.state[Uo];c=A2(f+1,c),a({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:c})},replace:(l,c,d)=>{const f=t.state[Uo];c=A2(f,c),a({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:c})},go:(l,c)=>{a({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:c,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[Uo]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const c=e.getBlockers?.()??[];return e.setBlockers([...c,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(f=>f!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function A2(e,t){t||(t={});const n=ak();return{...t,key:n,__TSR_key:n,[Uo]:e}}function TG(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let i=[];const a=()=>i,l=R=>i=R,c=(R=>R),d=(()=>ry(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const R=ak();t.history.replaceState({[Uo]:0,key:R,__TSR_key:R},"")}let f=d(),p,m=!1,y=!1,v=!1,w=!1;const b=()=>f;let j,k;const E=()=>{j&&(z._ignoreSubscribers=!0,(j.isPush?t.history.pushState:t.history.replaceState)(j.state,"",j.href),z._ignoreSubscribers=!1,j=void 0,k=void 0,p=void 0)},A=(R,$,F)=>{const M=c($);k||(p=f),f=ry($,F),j={href:M,state:F,isPush:j?.isPush||R==="push"},k||(k=Promise.resolve().then(()=>E()))},C=R=>{f=d(),z.notify({type:R})},_=async()=>{if(y){y=!1;return}const R=d(),$=R.state[Uo]-f.state[Uo],F=$===1,M=$===-1,U=!F&&!M||m;m=!1;const K=U?"GO":M?"BACK":"FORWARD",Z=U?{type:"GO",index:$}:{type:M?"BACK":"FORWARD"};if(v)v=!1;else{const Y=a();if(typeof document<"u"&&Y.length){for(const H of Y)if(await H.blockerFn({currentLocation:f,nextLocation:R,action:K})){y=!0,t.history.go(1),z.notify(Z);return}}}f=d(),z.notify(Z)},O=R=>{if(w){w=!1;return}let $=!1;const F=a();if(typeof document<"u"&&F.length)for(const M of F){const U=M.enableBeforeUnload??!0;if(U===!0){$=!0;break}if(typeof U=="function"&&U()===!0){$=!0;break}}if($)return R.preventDefault(),R.returnValue=""},z=_G({getLocation:b,getLength:()=>t.history.length,pushState:(R,$)=>A("push",R,$),replaceState:(R,$)=>A("replace",R,$),back:R=>(R&&(v=!0),w=!0,t.history.back()),forward:R=>{R&&(v=!0),w=!0,t.history.forward()},go:R=>{m=!0,t.history.go(R)},createHref:R=>c(R),flush:E,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(C2,O,{capture:!0}),t.removeEventListener(k2,_)},onBlocked:()=>{p&&f!==p&&(f=p)},getBlockers:a,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(C2,O,{capture:!0}),t.addEventListener(k2,_),t.history.pushState=function(...R){const $=n.apply(t.history,R);return z._ignoreSubscribers||C("PUSH"),$},t.history.replaceState=function(...R){const $=r.apply(t.history,R);return z._ignoreSubscribers||C("REPLACE"),$},z}function PG(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function ry(e,t){const n=PG(e),r=n.indexOf("#"),i=n.indexOf("?"),a=ak();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||{[Uo]:0,key:a,__TSR_key:a}}}function ak(){return(Math.random()+1).toString(36).substring(7)}function Xl(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 RG(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}var DG=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=V7(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=TG()),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=Jg(1e3),f=this.buildRouteTree(),this.setRoutes(f)}!this.__store&&this.latestLocation&&(this.__store=NG(IG(this.latestLocation)),eG(this));let l=!1;const c=this.options.basepath??"/",d=this.options.rewrite;if(i||r!==c||a!==d){this.basepath=c;const f=[],p=T5(c);p&&p!=="/"&&f.push(cG({basepath:c})),d&&f.push(d),this.rewrite=f.length===0?void 0:f.length===1?f[0]:lG(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=U7(this.routeTree,this.options.caseSensitive,(n,r)=>{n.init({originalIndex:r})});return this.options.routeMasks&&M7(this.options.routeMasks,t.processedTree),t},this.subscribe=(t,n)=>{const r={eventType:t,fn:n};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=t=>{this.subscribers.forEach(n=>{n.eventType===t.type&&n.fn(t)})},this.parseLocation=(t,n)=>{const r=({pathname:c,search:d,hash:f,href:p,state:m})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(c)){const j=this.options.parseSearch(d),k=this.options.stringifySearch(j);return{href:c+k+f,publicHref:p,pathname:Pf(c).path,external:!1,searchStr:k,search:Al(n?.search,j),hash:Pf(f.slice(1)).path,state:Bl(n?.state,m)}}const y=new URL(p,this.origin),v=i1(this.rewrite,y),w=this.options.parseSearch(v.search),b=this.options.stringifySearch(w);return v.search=b,{href:v.href.replace(v.origin,""),publicHref:p,pathname:Pf(v.pathname).path,external:!!this.rewrite&&v.origin!==this.origin,searchStr:b,search:Al(n?.search,w),hash:Pf(v.hash.slice(1)).path,state:Bl(n?.state,m)}},i=r(t),{__tempLocation:a,__tempKey:l}=i.state;if(a&&(!l||l===this.tempLocationKey)){const c=r(a);return c.state.key=i.state.key,c.state.__TSR_key=i.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:i}}return i},this.resolvePathWithBase=(t,n)=>G7({base:t,to:tk(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=>LG({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 c=i.unsafeRelative==="path"?a.pathname:i.from??l.fullPath,d=this.resolvePathWithBase(c,"."),f=l.search,p=Object.assign(Object.create(null),l.params),m=i.to?this.resolvePathWithBase(d,`${i.to}`):this.resolvePathWithBase(d,"."),y=i.params===!1||i.params===null?Object.create(null):(i.params??!0)===!0?p:Object.assign(p,Ro(i.params,p)),v=this.getMatchedRoutes(m);let w=v.matchedRoutes;if((!v.foundRoute||v.foundRoute.path!=="/"&&v.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(y).length>0)for(const $ of w){const F=$.options.params?.stringify??$.options.stringifyParams;if(F)try{Object.assign(y,F(y))}catch{}}const b=t.leaveParams?m:Pf(g2({path:m,params:y,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let j=f;if(t._includeValidateSearch&&this.options.search?.strict){const $={};w.forEach(F=>{if(F.options.validateSearch)try{Object.assign($,Mg(F.options.validateSearch,{...$,...j}))}catch{}}),j=$}j=$G({search:j,dest:i,destRoutes:w,_includeValidateSearch:t._includeValidateSearch}),j=Al(f,j);const k=this.options.stringifySearch(j),E=i.hash===!0?a.hash:i.hash?Ro(i.hash,a.hash):void 0,A=E?`#${E}`:"";let C=i.state===!0?a.state:i.state?Ro(i.state,a.state):{};C=Bl(a.state,C);const _=`${b}${k}${A}`;let O,z,R=!1;if(this.rewrite){const $=new URL(_,this.origin),F=P5(this.rewrite,$);O=$.href.replace($.origin,""),F.origin!==this.origin?(z=F.href,R=!0):z=F.pathname+F.search+F.hash}else O=P7(_),z=O;return{publicHref:z,href:O,pathname:b,search:j,searchStr:k,state:C,hash:E??"",external:R,unmaskOnReload:i.unmaskOnReload}},r=(i={},a)=>{const l=n(i);let c=a?n(a):void 0;if(!c){const d=Object.create(null);if(this.options.routeMasks){const f=I7(l.pathname,this.processedTree);if(f){Object.assign(d,f.rawParams);const{from:p,params:m,...y}=f.route,v=m===!1||m===null?Object.create(null):(m??!0)===!0?d:Object.assign(d,Ro(m,d));a={from:t.from,...y,params:v},c=n(a)}}}return c&&(l.maskedLocation=c),l};return t.mask?r(t,{from:t.from,...t.mask}):r(t)},this.commitLocation=async({viewTransition:t,ignoreBlocker:n,...r})=>{const i=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(f=>{r.state[f]=this.latestLocation.state[f]});const d=Yl(r.state,this.latestLocation.state);return c.forEach(f=>{delete r.state[f]}),d},a=Bo(this.latestLocation.href)===Bo(r.href);let l=this.commitLocationPromise;if(this.commitLocationPromise=id(()=>{l?.resolve(),l=void 0}),a&&i())this.load();else{let{maskedLocation:c,hashScrollIntoView:d,...f}=r;c&&(f={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...f,search:f.searchStr,state:{...f.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(f.unmaskOnReload??this.options.unmaskOnReload??!1)&&(f.state.__tempKey=this.tempLocationKey)),f.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=t,this.history[r.replace?"replace":"push"](f.publicHref,f.state,{ignoreBlocker:n})}return this.resetNextScroll=r.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:t,resetScroll:n,hashScrollIntoView:r,viewTransition:i,ignoreBlocker:a,href:l,...c}={})=>{if(l){const p=this.history.location.state.__TSR_index,m=ry(l,{__TSR_index:t?p:p+1}),y=new URL(m.pathname,this.origin);c.to=i1(this.rewrite,y).pathname,c.search=this.options.parseSearch(m.search),c.hash=m.hash.slice(1)}const d=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const f=this.commitLocation({...d,viewTransition:i,replace:t,resetScroll:n,hashScrollIntoView:r,ignoreBlocker:a});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),f},this.navigate=async({to:t,reloadDocument:n,href:r,publicHref:i,...a})=>{let 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 c=!l&&i?i:r;if(Xg(c,this.protocolAllowlist))return Promise.resolve();if(!a.ignoreBlocker){const d=this.history.getBlockers?.()??[];for(const f of d)if(f?.blockerFn&&await f.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return a.replace?window.location.replace(c):window.location.href=c,Promise.resolve()}return this.buildAndCommitLocation({...a,href:r,to:t,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const t=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:t,cachedMatches:n.cachedMatches.filter(r=>!t.some(i=>i.id===r.id))}))},this.load=async t=>{let n,r,i;const a=this.state.resolvedLocation??this.state.location;for(i=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,f=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Xl({resolvedLocation:f,location:d})}),this.emit({type:"onBeforeLoad",...Xl({resolvedLocation:f,location:d})}),await j2({router:this,sync:t?.sync,forceStaleReload:a.href===d.href,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],m=[],y=[],v=[];uh(()=>{this.__store.setState(w=>{const b=w.matches,j=w.pendingMatches||w.matches;return p=b.filter(k=>!j.some(E=>E.id===k.id)),m=b.filter(k=>!j.some(E=>E.routeId===k.routeId)),y=j.filter(k=>!b.some(E=>E.routeId===k.routeId)),v=j.filter(k=>b.some(E=>E.routeId===k.routeId)),{...w,isLoading:!1,loadedAt:Date.now(),matches:j,pendingMatches:void 0,cachedMatches:[...w.cachedMatches,...p.filter(k=>k.status!=="error"&&k.status!=="notFound"&&k.status!=="redirected")]}}),this.clearExpiredCache()}),[[m,"onLeave"],[y,"onEnter"],[v,"onStay"]].forEach(([w,b])=>{w.forEach(j=>{this.looseRoutesById[j.routeId].options[b]?.(j)})})})})}})}catch(d){ii(d)?(n=d,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Fr(d)&&(r=d),this.__store.setState(f=>({...f,statusCode:n?n.status:r?404:f.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(c=>c.status==="error")&&(l=500),l!==void 0&&this.__store.setState(c=>({...c,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(Xl({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:RG(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&&Xg(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=Nh,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)]);uh(()=>{r.forEach(l=>{a.has(l.id)||this.__store.setState(c=>({...c,cachedMatches:[...c.cachedMatches,l]}))})});try{return r=await j2({router:this,matches:r,location:n,preload:!0,updateMatch:(l,c)=>{i.has(l)?r=r.map(d=>d.id===l?c(d):d):this.updateMatch(l,c)}}),r}catch(l){if(ii(l))return l.options.reloadDocument?void 0:await this.preloadRoute({...l.options,_fromLocation:n});Fr(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=L7(i.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,a.pathname,this.processedTree);return!l||t.params&&!Yl(l.rawParams,t.params,{partial:!0})?!1:n?.includeSearch??!0?Yl(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??aG,parseSearch:e.parseSearch??iG,protocolAllowlist:e.protocolAllowlist??T7}),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,c=!1;(r?r.path!=="/"&&i["**"]:Bo(e.pathname))&&(this.options.notFoundRoute?l=[...l,this.options.notFoundRoute]:c=!0);const d=c?UG(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 y=l[m],v=f[m-1];let w,b,j;{const K=v?.search??e.search,Z=v?._strictSearch??void 0;try{const Y=Mg(y.options.validateSearch,{...K})??void 0;w={...K,...Y},b={...Z,...Y},j=void 0}catch(Y){let H=Y;if(Y instanceof iy||(H=new iy(Y.message,{cause:Y})),t?.throwOnError)throw H;w=K,b={},j=H}}const k=y.options.loaderDeps?.({search:w})??"",E=k?JSON.stringify(k):"",{interpolatedPath:A,usedParams:C}=g2({path:y.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=y.id+A+E,O=this.getMatch(_),z=p.get(y.id),R=O?._strictParams??C;let $;if(!O)try{E2(y,C,a,R)}catch(K){if(Fr(K)||ii(K)?$=K:$=new MG(K.message,{cause:K}),t?.throwOnError)throw $}Object.assign(i,R);const F=z?"stay":"enter";let M;if(O)M={...O,cause:F,params:z?.params??i,_strictParams:R,search:Al(z?z.search:O.search,w),_strictSearch:b};else{const K=y.options.loader||y.options.beforeLoad||y.lazyFn||q5(y)?"pending":"success";M={id:_,ssr:y.options.ssr,index:m,routeId:y.id,params:z?.params??i,_strictParams:R,pathname:A,updatedAt:Date.now(),search:z?Al(z.search,w):w,_strictSearch:b,searchError:void 0,status:K,isFetching:!1,error:void 0,paramsError:$,__routeContext:void 0,_nonReactive:{loadPromise:id()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:z?Bl(z.loaderDeps,k):k,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:y.options.staticData||{},fullPath:y.fullPath}}t?.preload||(M.globalNotFound=d===y.id),M.searchError=j;const U=this.getParentContext(v);M.context={...U,...M.__routeContext,...M.__beforeLoadContext},f[m]=M}for(let m=0;m<f.length;m++){const y=f[m],v=this.looseRoutesById[y.routeId],w=this.getMatch(y.id),b=p.get(y.routeId);if(y.params=b?Al(b.params,i):i,!w){const j=f[m-1],k=this.getParentContext(j);if(v.options.context){const E={deps:y.loaderDeps,params:y.params,context:k??{},location:e,navigate:A=>this.navigate({...A,_fromLocation:e}),buildLocation:this.buildLocation,cause:y.cause,abortController:y.abortController,preload:!!y.preload,matches:f,routeId:v.id};y.__routeContext=v.options.context(E)??void 0}y.context={...k,...y.__routeContext,...y.__beforeLoadContext}}}return f}matchRoutesLightweight(e){const{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Sh(t),a={...e.search};for(const f of t)try{Object.assign(a,Mg(f.options.validateSearch,a))}catch{}const l=Sh(this.state.matches),c=l&&l.routeId===i.id&&e.pathname===this.state.location.pathname;let d;if(c)d=l.params;else{const f=Object.assign(Object.create(null),n);for(const p of t)try{E2(p,n,r??{},f)}catch{}d=f}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:d}}},iy=class extends Error{},MG=class extends Error{};function IG(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Mg(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new iy("Async validation not supported");if(n.issues)throw new iy(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 LG({pathname:e,routesById:t,processedTree:n}){const r=Object.create(null),i=Bo(e);let a,l;const c=$7(i,n,!0);return c&&(a=c.route,Object.assign(r,c.rawParams),l=Object.assign(Object.create(null),c.parsedParams)),{matchedRoutes:c?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:l}}function $G({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return BG(n)(e,t,r??!1)}function BG(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:c})=>{let d=l;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((p,m)=>m(p),l));const f=c(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((p,m)=>m(p),f):f};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:l,next:c})=>{const d=c(l);if(!t._includeValidateSearch)return d;try{return{...d,...Mg(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:Ro(a.search,i):{}};t.middlewares.push(n);const r=(i,a,l)=>{if(i>=l.length)return a;const c=l[i];return c({search:a,next:f=>r(i+1,f,l)})};return function(a,l,c){return t.dest=l,t._includeValidateSearch=c,r(0,a,t.middlewares)}}function UG(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 Wl}function E2(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 qG="Error preloading route! ☝️",F5=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=Wl:this.parentRoute||Ps(!1);let i=r?Wl:n?.path;i&&i!=="/"&&(i=_5(i));const a=n?.id||i;let l=r?Wl:Pg([this.parentRoute.id==="__root__"?"":this.parentRoute.id,a]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=Pg(["/",l]));const c=l==="__root__"?"/":Pg([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=c,this._to=Bo(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>nk({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.")}},FG=class extends F5{constructor(e){super(e)}};function sk(e){const t=e.errorComponent??ok;return s.jsx(HG,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?x.createElement(t,{error:n,reset:r}):e.children})}var HG=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 ok({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 KG({children:e,fallback:t=null}){return H5()?s.jsx(Fi.Fragment,{children:e}):s.jsx(Fi.Fragment,{children:t})}function H5(){return Fi.useSyncExternalStore(GG,()=>!0,()=>!1)}function GG(){return()=>{}}var K5=x.createContext(null);function Ji(e){const t=x.useContext(K5);return e?.warn,t}var kw={exports:{}},Cw={},Aw={exports:{}},Ew={};var O2;function VG(){if(O2)return Ew;O2=1;var e=wd();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(m,y){var v=y(),w=r({inst:{value:v,getSnapshot:y}}),b=w[0].inst,j=w[1];return a(function(){b.value=v,b.getSnapshot=y,d(b)&&j({inst:b})},[m,v,y]),i(function(){return d(b)&&j({inst:b}),m(function(){d(b)&&j({inst:b})})},[m]),l(v),v}function d(m){var y=m.getSnapshot;m=m.value;try{var v=y();return!n(m,v)}catch{return!0}}function f(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return Ew.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ew}var z2;function QG(){return z2||(z2=1,Aw.exports=VG()),Aw.exports}var _2;function YG(){if(_2)return Cw;_2=1;var e=wd(),t=QG();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,c=e.useMemo,d=e.useDebugValue;return Cw.useSyncExternalStoreWithSelector=function(f,p,m,y,v){var w=a(null);if(w.current===null){var b={hasValue:!1,value:null};w.current=b}else b=w.current;w=c(function(){function k(O){if(!E){if(E=!0,A=O,O=y(O),v!==void 0&&b.hasValue){var z=b.value;if(v(z,O))return C=z}return C=O}if(z=C,r(A,O))return z;var R=y(O);return v!==void 0&&v(z,R)?(A=O,z):(A=O,C=R)}var E=!1,A,C,_=m===void 0?null:m;return[function(){return k(p())},_===null?void 0:function(){return k(_())}]},[p,m,y,v]);var j=i(f,w[0],w[1]);return l(function(){b.hasValue=!0,b.value=j},[j]),d(j),j},Cw}var T2;function WG(){return T2||(T2=1,kw.exports=YG()),kw.exports}var G5=WG();function ZG(e,t){return e===t}function XG(e,t,n=ZG){const r=x.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:c}=e.subscribe(l);return c},[e]),i=x.useCallback(()=>e?.get(),[e]);return G5.useSyncExternalStoreWithSelector(r,i,i,t,n)}function li(e){const t=Ji({warn:e?.router===void 0}),n=e?.router||t,r=x.useRef(void 0);return XG(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=Bl(r.current,e.select(i));return r.current=a,a}return e.select(i)}return i})}var Ov=x.createContext(void 0),JG=x.createContext(void 0);function Jo(e){const t=x.useContext(e.from?JG:Ov);return li({select:n=>{const r=n.matches.find(i=>e.from?e.from===i.routeId:i.id===t);if(Ps(!((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 lk(e){return Jo({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ck(e){const{select:t,...n}=e;return Jo({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function Jh(e){return Jo({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 zv(e){return Jo({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function el(e){const t=Ji();return x.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function uk(e){return Jo({...e,select:t=>e.select?e.select(t.context):t.context})}var wc=d5();const eV=Sa(wc);function tV(e,t){const n=Ji(),r=C7(t),{activeProps:i,inactiveProps:a,activeOptions:l,to:c,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:y,resetScroll:v,viewTransition:w,children:b,target:j,disabled:k,style:E,className:A,onClick:C,onBlur:_,onFocus:O,onMouseEnter:z,onMouseLeave:R,onTouchStart:$,ignoreBlocker:F,params:M,search:U,hash:K,state:Z,mask:Y,reloadDocument:H,unsafeRelative:X,from:ue,_fromLocation:xe,...L}=e,q=H5(),I=li({select:vt=>{const de=vt.matches[vt.matches.length-1];return{search:de?.search,hash:vt.location.hash,path:de?.pathname}},structuralSharing:!0}),D=e.from,V=x.useMemo(()=>({...e,from:D}),[n,I,D,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),re=x.useMemo(()=>n.buildLocation({...V}),[n,V]),ee=re.maskedLocation?re.maskedLocation.publicHref:re.publicHref,Ee=re.maskedLocation?re.maskedLocation.external:re.external,Te=x.useMemo(()=>oV(ee,Ee,n.history,k),[k,Ee,ee,n.history]),ne=x.useMemo(()=>{if(Te?.external)return Xg(Te.href,n.protocolAllowlist)?void 0:Te.href;if(!lV(c)&&!(typeof c!="string"||c.indexOf(":")===-1))try{return new URL(c),Xg(c,n.protocolAllowlist)?void 0:c}catch{}},[c,Te,n.protocolAllowlist]),he=li({select:vt=>{if(ne)return!1;if(l?.exact){if(!K7(vt.location.pathname,re.pathname,n.basepath))return!1}else{const de=ey(vt.location.pathname,n.basepath),Ne=ey(re.pathname,n.basepath);if(!(de.startsWith(Ne)&&(de.length===Ne.length||de[Ne.length]==="/")))return!1}return(l?.includeSearch??!0)&&!Yl(vt.location.search,re.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?q&&vt.location.hash===re.hash:!0}}),je=he?Ro(i,{})??nV:Ow,me=he?Ow:Ro(a,{})??Ow,tt=[A,je.className,me.className].filter(Boolean).join(" "),Ie=(E||je.style||me.style)&&{...E,...je.style,...me.style},[Ze,nt]=x.useState(!1),Wt=x.useRef(!1),Se=e.reloadDocument||ne?!1:d??n.options.defaultPreload,Re=f??n.options.defaultPreloadDelay??0,Bt=x.useCallback(()=>{n.preloadRoute({...V,_builtLocation:re}).catch(vt=>{console.warn(vt),console.warn(qG)})},[n,V,re]);k7(r,x.useCallback(vt=>{vt?.isIntersecting&&Bt()},[Bt]),sV,{disabled:!!k||Se!=="viewport"}),x.useEffect(()=>{Wt.current||!k&&Se==="render"&&(Bt(),Wt.current=!0)},[k,Bt,Se]);const cn=vt=>{const de=vt.currentTarget.getAttribute("target"),Ne=j!==void 0?j:de;if(!k&&!cV(vt)&&!vt.defaultPrevented&&(!Ne||Ne==="_self")&&vt.button===0){vt.preventDefault(),wc.flushSync(()=>{nt(!0)});const Ue=n.subscribe("onResolved",()=>{Ue(),nt(!1)});n.navigate({...V,replace:m,resetScroll:v,hashScrollIntoView:p,startTransition:y,viewTransition:w,ignoreBlocker:F})}};if(ne)return{...L,ref:r,href:ne,...b&&{children:b},...j&&{target:j},...k&&{disabled:k},...E&&{style:E},...A&&{className:A},...C&&{onClick:C},..._&&{onBlur:_},...O&&{onFocus:O},...z&&{onMouseEnter:z},...R&&{onMouseLeave:R},...$&&{onTouchStart:$}};const un=vt=>{if(k||Se!=="intent")return;if(!Re){Bt();return}const de=vt.currentTarget;if(Mf.has(de))return;const Ne=setTimeout(()=>{Mf.delete(de),Bt()},Re);Mf.set(de,Ne)},Rr=vt=>{k||Se!=="intent"||Bt()},Kt=vt=>{if(k||!Se||!Re)return;const de=vt.currentTarget,Ne=Mf.get(de);Ne&&(clearTimeout(Ne),Mf.delete(de))};return{...L,...je,...me,href:Te?.href,ref:r,onClick:gu([C,cn]),onBlur:gu([_,Kt]),onFocus:gu([O,un]),onMouseEnter:gu([z,un]),onMouseLeave:gu([R,Kt]),onTouchStart:gu([$,Rr]),disabled:!!k,target:j,...Ie&&{style:Ie},...tt&&{className:tt},...k&&rV,...he&&iV,...q&&Ze&&aV}}var Ow={},nV={className:"active"},rV={role:"link","aria-disabled":!0},iV={"data-status":"active","aria-current":"page"},aV={"data-transitioning":"transitioning"},Mf=new WeakMap,sV={rootMargin:"100px"},gu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function oV(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function lV(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var zt=x.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:i,...a}=tV(r,t),l=typeof r.children=="function"?r.children({isActive:a["data-status"]==="active"}):r.children;if(!n){const{disabled:c,...d}=a;return x.createElement("a",d,l)}return x.createElement(n,a,l)});function cV(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var uV=class extends F5{constructor(e){super(e),this.useMatch=t=>Jo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>uk({...t,from:this.id}),this.useSearch=t=>zv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Jh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ck({...t,from:this.id}),this.useLoaderData=t=>lk({...t,from:this.id}),this.useNavigate=()=>el({from:this.fullPath}),this.Link=Fi.forwardRef((t,n)=>s.jsx(zt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function ir(e){return new uV(e)}function dV(){return e=>hV(e)}var fV=class extends FG{constructor(e){super(e),this.useMatch=t=>Jo({select:t?.select,from:this.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>uk({...t,from:this.id}),this.useSearch=t=>zv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useParams=t=>Jh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.id}),this.useLoaderDeps=t=>ck({...t,from:this.id}),this.useLoaderData=t=>lk({...t,from:this.id}),this.useNavigate=()=>el({from:this.fullPath}),this.Link=Fi.forwardRef((t,n)=>s.jsx(zt,{ref:n,from:this.fullPath,...t})),this.$$typeof=Symbol.for("react.memo")}};function hV(e){return new fV(e)}function P2(e){return typeof e=="object"?new R2(e,{silent:!0}).createRoute(e):new R2(e,{silent:!0}).createRoute}var R2=class{constructor(e,t){this.path=e,this.createRoute=n=>{const r=ir(n);return r.isRoot=!1,r},this.silent=t?.silent}},D2=class{constructor(e){this.useMatch=t=>Jo({select:t?.select,from:this.options.id,structuralSharing:t?.structuralSharing}),this.useRouteContext=t=>uk({...t,from:this.options.id}),this.useSearch=t=>zv({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useParams=t=>Jh({select:t?.select,structuralSharing:t?.structuralSharing,from:this.options.id}),this.useLoaderDeps=t=>ck({...t,from:this.options.id}),this.useLoaderData=t=>lk({...t,from:this.options.id}),this.useNavigate=()=>el({from:Ji().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for("react.memo")}};function M2(e){return typeof e=="object"?new D2(e):t=>new D2({id:e,...t})}function pV(e){const t=li({select:n=>`not-found-${n.location.pathname}-${n.status}`});return s.jsx(sk,{getResetKey:()=>t,onCatch:(n,r)=>{if(Fr(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(Fr(n))return e.fallback?.(n);throw n},children:e.children})}function mV(){return s.jsx("p",{children:"Not Found"})}function Pu(e){return s.jsx(s.Fragment,{children:e.children})}function V5(e,t,n){return t.options.notFoundComponent?s.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?s.jsx(e.options.defaultNotFoundComponent,{...n}):s.jsx(mV,{})}function gV(){return Ji().isScrollRestoring,null}var Q5=x.memo(function({matchId:t}){const n=Ji(),r=li({select:w=>{const b=w.matches.findIndex(k=>k.id===t),j=w.matches[b];return Ps(j),{routeId:j.routeId,ssr:j.ssr,_displayPending:j._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[b-1]?.routeId}},structuralSharing:!0}),i=n.routesById[r.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,l=a?s.jsx(a,{}):null,c=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,f=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",m=(!i.isRoot||i.options.wrapInSuspense||p)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||p))?x.Suspense:Pu,y=c?sk:Pu,v=f?pV:Pu;return s.jsxs(i.isRoot?i.options.shellComponent??Pu:Pu,{children:[s.jsx(Ov.Provider,{value:t,children:s.jsx(m,{fallback:l,children:s.jsx(y,{getResetKey:()=>r.resetKey,errorComponent:c||ok,onCatch:(w,b)=>{if(Fr(w))throw w;d?.(w,b)},children:s.jsx(v,{fallback:w=>{if(!f||w.routeId&&w.routeId!==r.routeId||!w.routeId&&!i.isRoot)throw w;return x.createElement(f,w)},children:p||r._displayPending?s.jsx(KG,{fallback:l,children:s.jsx(I2,{matchId:t})}):s.jsx(I2,{matchId:t})})})})}),r.parentRouteId===Wl&&n.options.scrollRestoration?s.jsxs(s.Fragment,{children:[s.jsx(yV,{}),s.jsx(gV,{})]}):null]})});function yV(){const e=Ji(),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",...Xl(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var I2=x.memo(function({matchId:t}){const n=Ji(),{match:r,key:i,routeId:a}=li({select:d=>{const f=d.matches.find(y=>y.id===t),p=f.routeId,m=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:f.loaderDeps,params:f._strictParams,search:f._strictSearch});return{key:m?JSON.stringify(m):void 0,routeId:p,match:{id:f.id,status:f.status,error:f.error,_forcePending:f._forcePending,_displayPending:f._displayPending}}},structuralSharing:!0}),l=n.routesById[a],c=x.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?s.jsx(d,{},i):s.jsx(dk,{})},[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=id();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 Ps(Fr(r.error)),V5(n,l,r.error);if(r.status==="redirected")throw Ps(ii(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error")throw r.error;return c}),dk=x.memo(function(){const t=Ji(),n=x.useContext(Ov),r=li({select:f=>f.matches.find(p=>p.id===n)?.routeId}),i=t.routesById[r],a=li({select:f=>{const p=f.matches.find(m=>m.id===n);return Ps(p),p.globalNotFound}}),l=li({select:f=>{const p=f.matches;return p[p.findIndex(m=>m.id===n)+1]?.id}}),c=t.options.defaultPendingComponent?s.jsx(t.options.defaultPendingComponent,{}):null;if(a)return V5(t,i,void 0);if(!l)return null;const d=s.jsx(Q5,{matchId:l});return r===Wl?s.jsx(x.Suspense,{fallback:c,children:d}):d});function vV(){const e=Ji(),t=x.useRef({router:e,mounted:!1}),[n,r]=x.useState(!1),{hasPendingMatches:i,isLoading:a}=li({select:m=>({isLoading:m.isLoading,hasPendingMatches:m.matches.some(y=>y.status==="pending")}),structuralSharing:!0}),l=xw(a),c=a||n||i,d=xw(c),f=a||i,p=xw(f);return e.startTransition=m=>{r(!0),x.startTransition(()=>{m(),r(!1)})},x.useEffect(()=>{const m=e.history.subscribe(e.load),y=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Bo(e.latestLocation.publicHref)!==Bo(y.publicHref)&&e.commitLocation({...y,replace:!0}),()=>{m()}},[e,e.history]),Lm(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(y){console.error(y)}})()},[e]),Lm(()=>{l&&!a&&e.emit({type:"onLoad",...Xl(e.state)})},[l,e,a]),Lm(()=>{p&&!f&&e.emit({type:"onBeforeRouteMount",...Xl(e.state)})},[f,p,e]),Lm(()=>{if(d&&!c){const m=Xl(e.state);e.emit({type:"onResolved",...m}),e.__store.setState(y=>({...y,status:"idle",resolvedLocation:y.location})),m.hrefChanged&&tG(e)}},[c,d,e]),null}function xV(){const e=Ji(),t=e.routesById[Wl].options.pendingComponent??e.options.defaultPendingComponent,n=t?s.jsx(t,{}):null,r=s.jsxs(typeof document<"u"&&e.ssr?Pu:x.Suspense,{fallback:n,children:[s.jsx(vV,{}),s.jsx(bV,{})]});return e.options.InnerWrap?s.jsx(e.options.InnerWrap,{children:r}):r}function bV(){const e=Ji(),t=li({select:i=>i.matches[0]?.id}),n=li({select:i=>i.loadedAt}),r=t?s.jsx(Q5,{matchId:t}):null;return s.jsx(Ov.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:s.jsx(sk,{getResetKey:()=>n,errorComponent:ok,onCatch:void 0,children:r})})}var wV=e=>new SV(e),SV=class extends DG{constructor(e){super(e)}};typeof globalThis<"u"?(globalThis.createFileRoute=P2,globalThis.createLazyFileRoute=M2):typeof window<"u"&&(window.createFileRoute=P2,window.createLazyFileRoute=M2);function jV({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(K5.Provider,{value:e,children:t});return e.options.Wrap?s.jsx(e.options.Wrap,{children:r}):r}function NV({router:e,...t}){return s.jsx(jV,{router:e,...t,children:s.jsx(xV,{})})}function Y5(e){return li({select:t=>t.location})}class rr extends Error{code;statusCode;constructor(t,n,r){super(t),this.name="ApiError",this.code=r??"UNKNOWN",this.statusCode=n}}function kV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const W5=kV();function CV(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,""):""}function AV(e){return`${CV()}${e}`}function EV(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 OV(){return""}function zw(){return!!OV()}let Z5=null;function L2(e){Z5=e}function X5(){Z5?.()}async function Ae(e,t){const n=t?.body!=null,r=await fetch(`${W5}${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 c=JSON.parse(i);typeof c.error=="string"?a=c.error:c.error?.message?(a=c.error.message,l=c.error.code):c.message&&(a=c.message)}catch{a=i}throw(r.status===401||r.status===403)&&!e.startsWith("/session")&&X5(),new rr(a,r.status,l)}if(r.status!==204)return r.json()}function _v(){return Ae("/projects")}function fk(e){return Ae(`/projects/${encodeURIComponent(e)}`)}function J5(){return Ae("/runs")}function zV(e){return Ae(`/projects/${encodeURIComponent(e)}/runs`)}function Go(e){return Ae(`/runs/${encodeURIComponent(e)}`)}function _V(e){return Ae(`/projects/${encodeURIComponent(e)}/queries`)}function e4(e){return Ae(`/projects/${encodeURIComponent(e)}/competitors`)}function t4(e,t){const n=new URLSearchParams;t!==void 0&&n.set("location",t);const r=n.toString();return Ae(`/projects/${encodeURIComponent(e)}/timeline${r?`?${r}`:""}`)}function TV(e,t){const r=new URLSearchParams().toString();return Ae(`/projects/${encodeURIComponent(e)}/overview${r?`?${r}`:""}`)}function ep(e,t){return Ae(`/projects/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function PV(e,t){return Ae(`/projects/${encodeURIComponent(e)}/queries`,{method:"PUT",body:JSON.stringify({queries:t})})}function n4(e,t){return Ae(`/projects/${encodeURIComponent(e)}/queries`,{method:"POST",body:JSON.stringify({queries:t})})}function r4(e,t){return Ae(`/projects/${encodeURIComponent(e)}/competitors`,{method:"PUT",body:JSON.stringify({competitors:t})})}async function $2(e,t){const n=await fk(e);return ep(e,{displayName:n.displayName,canonicalDomain:n.canonicalDomain,ownedDomains:t,aliases:n.aliases,country:n.country,language:n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:n.locations,defaultLocation:n.defaultLocation})}async function B2(e,t){const n=await fk(e);return ep(e,{displayName:n.displayName,canonicalDomain:n.canonicalDomain,ownedDomains:n.ownedDomains,aliases:t,country:n.country,language:n.language,tags:n.tags,labels:n.labels,providers:n.providers,locations:n.locations,defaultLocation:n.defaultLocation})}async function RV(e,t){const n=await fk(e);return ep(e,{displayName:t.displayName??n.displayName,canonicalDomain:t.canonicalDomain??n.canonicalDomain,ownedDomains:t.ownedDomains??n.ownedDomains,aliases:t.aliases??n.aliases,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),Ae(`/projects/${encodeURIComponent(e)}/runs`,{method:"POST",body:JSON.stringify(n)})}function MV(e,t){return Ae(`/projects/${encodeURIComponent(e)}/locations`,{method:"POST",body:JSON.stringify(t)})}async function IV(e,t){await Ae(`/projects/${encodeURIComponent(e)}/locations/${encodeURIComponent(t)}`,{method:"DELETE"})}function LV(e,t){return Ae(`/projects/${encodeURIComponent(e)}/locations/default`,{method:"PUT",body:JSON.stringify({label:t})})}async function $V(e){await Ae(`/projects/${encodeURIComponent(e)}`,{method:"DELETE",body:"{}"})}function BV(e){return Ae(`/projects/${encodeURIComponent(e)}/export`)}function hk(){return Ae("/settings")}function U2(){return Ae("/session")}function UV(e){return Ae("/session/setup",{method:"POST",body:JSON.stringify({password:e})})}function qV(e){return Ae("/session",{method:"POST",body:JSON.stringify({password:e})})}function i4(e,t){return Ae(`/settings/providers/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}function FV(e){return Ae("/settings/google",{method:"PUT",body:JSON.stringify(e)})}async function HV(e){try{return await Ae(`/projects/${encodeURIComponent(e)}/schedule`)}catch(t){if(t instanceof rr&&t.statusCode===404)return null;throw t}}function q2(e,t){return Ae(`/projects/${encodeURIComponent(e)}/schedule`,{method:"PUT",body:JSON.stringify(t)})}async function KV(e){await Ae(`/projects/${encodeURIComponent(e)}/schedule`,{method:"DELETE",body:"{}"})}function GV(e){return Ae(`/projects/${encodeURIComponent(e)}/notifications`)}function VV(e,t){return Ae(`/projects/${encodeURIComponent(e)}/notifications`,{method:"POST",body:JSON.stringify(t)})}async function QV(e,t){await Ae(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function YV(e,t){return Ae(`/projects/${encodeURIComponent(e)}/notifications/${encodeURIComponent(t)}/test`,{method:"POST",body:"{}"})}function WV(e,t,n){return Ae(`/projects/${encodeURIComponent(e)}/queries/generate`,{method:"POST",body:JSON.stringify({provider:t,count:n})})}function ZV(e){return Ae("/apply",{method:"POST",body:JSON.stringify(e)})}function XV(e){return Ae("/runs",{method:"POST",body:JSON.stringify(e??{})})}function a4(e){return Ae(`/projects/${encodeURIComponent(e)}/google/connections`)}function JV(e,t){return Ae(`/projects/${encodeURIComponent(e)}/google/connect`,{method:"POST",body:JSON.stringify({type:t})})}function eQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}`,{method:"DELETE",body:"{}"})}function tQ(e){return Ae(`/projects/${encodeURIComponent(e)}/google/properties`)}function nQ(e,t,n){return Ae(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/property`,{method:"PUT",body:JSON.stringify({propertyId:n})})}function rQ(e,t,n){return Ae(`/projects/${encodeURIComponent(e)}/google/connections/${encodeURIComponent(t)}/sitemap`,{method:"PUT",body:JSON.stringify({sitemapUrl:n})})}function s4(e,t){return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/sync`,{method:"POST",body:JSON.stringify(t??{})})}function iQ(e,t){const n=new URLSearchParams;t?.startDate&&n.set("startDate",t.startDate),t?.endDate&&n.set("endDate",t.endDate),t?.window&&t.window!=="all"&&!t.startDate&&n.set("window",t.window),t?.query&&n.set("query",t.query),t?.page&&n.set("page",t.page),t?.limit!==void 0&&n.set("limit",String(t.limit)),t?.offset!==void 0&&t.offset>0&&n.set("offset",String(t.offset));const r=n.toString()?`?${n.toString()}`:"";return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/performance${r}`)}function aQ(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);const r=n.toString()?`?${n.toString()}`:"";return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/performance/daily${r}`)}function sQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/inspect`,{method:"POST",body:JSON.stringify({url:t})})}function oQ(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 Ae(`/projects/${encodeURIComponent(e)}/google/gsc/inspections${r}`)}function lQ(e){return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/deindexed`)}function pk(e){return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/coverage`)}function cQ(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/coverage/history${r}`)}function uQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/inspect-sitemap`,{method:"POST",body:JSON.stringify(t??{})})}function dQ(e){return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/sitemaps`)}function fQ(e){return Ae(`/projects/${encodeURIComponent(e)}/google/gsc/discover-sitemaps`,{method:"POST",body:"{}"})}function hQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/discover/run`,{method:"POST",body:JSON.stringify(t??{})})}function pQ(e,t){const n=new URLSearchParams;n.set("limit",String(t.limit));const r=n.toString()?`?${n.toString()}`:"";return Ae(`/projects/${encodeURIComponent(e)}/discover/sessions${r}`)}function mQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/discover/sessions/${encodeURIComponent(t)}`)}function gQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/discover/sessions/${encodeURIComponent(t)}/promote`)}function yQ(e,t,n){return Ae(`/projects/${encodeURIComponent(e)}/discover/sessions/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify(n??{})})}function F2(){return Ae("/cdp/status")}function vQ(e,t){return Ae("/settings/cdp",{method:"PUT",body:JSON.stringify({host:e,port:t})})}function H2(e,t){return Ae(`/projects/${encodeURIComponent(e)}/google/indexing/request`,{method:"POST",body:JSON.stringify(t)})}function o4(e){return Ae(`/projects/${encodeURIComponent(e)}/bing/status`)}function xQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/bing/connect`,{method:"POST",body:JSON.stringify({apiKey:t})})}function bQ(e){return Ae(`/projects/${encodeURIComponent(e)}/bing/disconnect`,{method:"DELETE",body:"{}"})}function wQ(e){return Ae(`/projects/${encodeURIComponent(e)}/bing/sites`)}function SQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/bing/set-site`,{method:"POST",body:JSON.stringify({siteUrl:t})})}function mk(e){return Ae(`/projects/${encodeURIComponent(e)}/bing/coverage`)}function l4(e,t){const n=new URLSearchParams,r=n.toString()?`?${n.toString()}`:"";return Ae(`/projects/${encodeURIComponent(e)}/bing/inspections${r}`)}function c4(e,t){return Ae(`/projects/${encodeURIComponent(e)}/bing/inspect-url`,{method:"POST",body:JSON.stringify({url:t})})}function jQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/bing/inspect-sitemap`,{method:"POST",body:void 0})}function K2(e,t){return Ae(`/projects/${encodeURIComponent(e)}/bing/request-indexing`,{method:"POST",body:JSON.stringify(t)})}function NQ(e){return Ae(`/projects/${encodeURIComponent(e)}/bing/performance`)}function kQ(e){return Ae("/settings/bing",{method:"PUT",body:JSON.stringify({apiKey:e})})}function CQ(e){return Ae(`/projects/${encodeURIComponent(e)}/report`)}function AQ(e){return e?/filename\s*=\s*"?([^";]+)"?/i.exec(e)?.[1]??null:null}async function EQ(e,t="agency"){const n=new URLSearchParams({audience:t}),r=await fetch(`${W5}/projects/${encodeURIComponent(e)}/report.html?${n.toString()}`,{credentials:"same-origin",headers:{}});if(!r.ok)throw new rr(`Failed to download report: ${r.status}`,r.status);const i=await r.blob(),a=URL.createObjectURL(i),l=AQ(r.headers.get("Content-Disposition"))??`canonry-report-${e}.html`,c=document.createElement("a");c.href=a,c.download=l,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(a)}function OQ(e){return Ae(`/projects/${encodeURIComponent(e)}/ga/status`)}function zQ(e,t,n){const r=new URLSearchParams;n&&n!=="all"&&r.set("window",n);const i=r.toString()?`?${r}`:"";return Ae(`/projects/${encodeURIComponent(e)}/ga/traffic${i}`)}function u4(e,t){return Ae(`/projects/${encodeURIComponent(e)}/ga/sync`,{method:"POST",body:JSON.stringify({})})}function _Q(e,t){return Ae(`/projects/${encodeURIComponent(e)}/ga/connect`,{method:"POST",body:JSON.stringify(t)})}function TQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ae(`/projects/${encodeURIComponent(e)}/ga/ai-referral-history${n}`)}function PQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ae(`/projects/${encodeURIComponent(e)}/ga/social-referral-history${n}`)}function RQ(e,t){const n=t&&t!=="all"?`?window=${t}`:"";return Ae(`/projects/${encodeURIComponent(e)}/ga/session-history${n}`)}function DQ(e){return Ae(`/projects/${encodeURIComponent(e)}/ga/disconnect`,{method:"DELETE",body:"{}"})}function MQ(e){return Ae(`/projects/${encodeURIComponent(e)}/traffic/sources`)}function IQ(e){return Ae(`/projects/${encodeURIComponent(e)}/traffic/status`)}function d4(e,t){return Ae(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}`)}function LQ(e,t){const n={};t?.since&&(n.since=t.since),t?.until&&(n.until=t.until),t?.kind&&(n.kind=t.kind),t?.sourceId&&(n.sourceId=t.sourceId),t?.limit!==void 0&&(n.limit=String(t.limit));const r=Object.keys(n).length?"?"+new URLSearchParams(n).toString():"";return Ae(`/projects/${encodeURIComponent(e)}/traffic/events${r}`)}function $Q(e,t){return Ae(`/projects/${encodeURIComponent(e)}/traffic/connect/cloud-run`,{method:"POST",body:JSON.stringify(t)})}function BQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/traffic/connect/wordpress`,{method:"POST",body:JSON.stringify(t)})}function UQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/traffic/connect/vercel`,{method:"POST",body:JSON.stringify(t)})}function qQ(e,t,n){return Ae(`/projects/${encodeURIComponent(e)}/traffic/sources/${encodeURIComponent(t)}/sync`,{method:"POST",body:JSON.stringify(n??{})})}function FQ(e,t){return Ae(`/projects/${encodeURIComponent(e)}/insights`)}function HQ(e){return Ae(`/projects/${encodeURIComponent(e)}/citations/visibility`)}function KQ(e){if(!e||typeof e!="object")return;const t=e;if(!(typeof t.current!="string"||typeof t.latest!="string"||typeof t.url!="string"||typeof t.upgradeCommand!="string"))return{current:t.current,latest:t.latest,url:t.url,upgradeCommand:t.upgradeCommand}}async function GQ(e,t){const n=AV(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:EV(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,c=typeof i.lastHeartbeatAt=="string"?i.lastHeartbeatAt:void 0,d=KQ(i.updateAvailable),f=[a,l===!1?"database not configured":"database configured",c?`heartbeat ${c}`:void 0].filter(Boolean).join(" · ");return{label:t,state:"ok",detail:f,version:a,databaseConfigured:l,lastHeartbeatAt:c,...d?{updateAvailable:d}:{}}}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 VQ(){return Ae("/backlinks/status")}function QQ(){return Ae("/backlinks/install",{method:"POST"})}function f4(){return Ae("/backlinks/syncs/latest")}function YQ(){return Ae("/backlinks/syncs")}function WQ(e){return Ae("/backlinks/syncs",{method:"POST",body:JSON.stringify(e?{release:e}:{})})}function ZQ(){return Ae("/backlinks/releases")}function XQ(){return Ae("/backlinks/latest-release")}function JQ(e){return Ae(`/backlinks/cache/${encodeURIComponent(e)}`,{method:"DELETE"})}function eY(e,t={}){const n=new URLSearchParams;t.release&&n.set("release",t.release),t.excludeCrawlers&&n.set("excludeCrawlers","1");const r=n.toString();return Ae(`/projects/${encodeURIComponent(e)}/backlinks/summary${r?`?${r}`:""}`)}function tY(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 Ae(`/projects/${encodeURIComponent(e)}/backlinks/domains${r?`?${r}`:""}`)}function nY(e){return Ae(`/projects/${encodeURIComponent(e)}/backlinks/history`)}function rY(e,t){return Ae(`/projects/${encodeURIComponent(e)}/backlinks/extract`,{method:"POST",body:JSON.stringify({release:void 0})})}function Ke(e){return(...t)=>{e(...t)}}const iY=6e3,aY=5,sY=180;let Ar=[],oY=0;const l1=new Set,c1=new Map,u1=new Map;function ay(){const e=[...Ar];for(const t of l1)t(e)}function gk(e){const t=c1.get(e);t&&(clearTimeout(t),c1.delete(e));const n=u1.get(e);n&&(clearTimeout(n),u1.delete(e))}function h4(e){gk(e);const t=Ar.length;Ar=Ar.filter(n=>n.id!==e),Ar.length!==t&&ay()}function G2(e){gk(e.id),c1.set(e.id,setTimeout(()=>{d1(e.id)},e.durationMs))}function lY(e,t,n){return typeof e=="string"?{title:e,tone:t,durationMs:n}:e}function ut(e,t="negative",n=iY){const r=lY(e,t,n),i={id:String(++oY),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=Ar.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 Ar=Ar.map(c=>c.id===a.id?l:c),ay(),G2(l),a.id}}return Ar.length>=aY&&h4(Ar[0].id),Ar=[...Ar,i],ay(),G2(i),i.id}function d1(e){const t=Ar.find(n=>n.id===e);!t||t.state==="closing"||(gk(e),Ar=Ar.map(n=>n.id===e?{...n,state:"closing"}:n),ay(),u1.set(e,setTimeout(()=>{h4(e)},sY)))}function cY(e){return l1.add(e),()=>{l1.delete(e)}}function V2(){return Ar}const uY=5*6e4,p4=30*6e4,ks=3e4,vr=6e4,f1=3e4;function dY(){return new x7({defaultOptions:{queries:{staleTime:uY,retry:1,refetchOnWindowFocus:!1}},mutationCache:new x5({onError:(e,t,n,r)=>{r.meta?.skipGlobalErrorToast||ut({title:e instanceof Error?e.message:"An unexpected error occurred",tone:"negative"})}})})}const fY=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hY=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Q2=e=>{const t=hY(e);return t.charAt(0).toUpperCase()+t.slice(1)},m4=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),pY=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var mY={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 gY=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...c},d)=>x.createElement("svg",{ref:d,...mY,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:m4("lucide",i),...!a&&!pY(c)&&{"aria-hidden":"true"},...c},[...l.map(([f,p])=>x.createElement(f,p)),...Array.isArray(a)?a:[a]]));const jt=(e,t)=>{const n=x.forwardRef(({className:r,...i},a)=>x.createElement(gY,{ref:a,iconNode:t,className:m4(`lucide-${fY(Q2(e))}`,`lucide-${e}`,r),...i}));return n.displayName=Q2(e),n};const yY=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],h1=jt("arrow-left",yY);const vY=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],xY=jt("arrow-right",vY);const bY=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],wY=jt("arrow-up",bY);const SY=[["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"}]],jY=jt("book-open",SY);const NY=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],g4=jt("check",NY);const kY=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],CY=jt("chevron-down",kY);const AY=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],tp=jt("chevron-right",AY);const EY=[["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"}]],OY=jt("circle-alert",EY);const zY=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],yk=jt("circle-check",zY);const _Y=[["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"}]],y4=jt("circle-question-mark",_Y);const TY=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],PY=jt("cloud",TY);const RY=[["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"}]],DY=jt("copy",RY);const MY=[["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"}]],Tv=jt("download",MY);const IY=[["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"}]],LY=jt("external-link",IY);const $Y=[["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"}]],BY=jt("file-text",$Y);const UY=[["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"}]],qY=jt("github",UY);const FY=[["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"}]],v4=jt("globe",FY);const HY=[["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"}]],KY=jt("layout-dashboard",HY);const GY=[["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"}]],x4=jt("link-2",GY);const VY=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],b4=jt("loader-circle",VY);const QY=[["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"}]],YY=jt("maximize-2",QY);const WY=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],ZY=jt("menu",WY);const XY=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],JY=jt("minimize-2",XY);const eW=[["path",{d:"M5 12h14",key:"1ays0h"}]],tW=jt("minus",eW);const nW=[["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"}]],kh=jt("play",nW);const rW=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],sy=jt("plus",rW);const iW=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],aW=jt("radar",iW);const sW=[["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"}]],Ch=jt("refresh-cw",sW);const oW=[["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"}]],lW=jt("rocket",oW);const cW=[["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"}]],w4=jt("rotate-ccw",cW);const uW=[["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"}]],dW=jt("settings",uW);const fW=[["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"}]],Y2=jt("sparkles",fW);const hW=[["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"}]],S4=jt("trash-2",hW);const pW=[["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"}]],oy=jt("triangle-alert",pW);const mW=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],gW=jt("triangle",mW);const yW=[["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"}]],vW=jt("unplug",yW);const xW=[["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"}]],bW=jt("upload",xW);const wW=[["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"}]],SW=jt("wrench",wW);const jW=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sc=jt("x",jW);function ye(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:l,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);const f=l.prototype,p=Object.keys(f);for(let m=0;m<p.length;m++){const y=p[m];y in c||(c[y]=f[y].bind(c))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function l(c){var d;const f=n?.Parent?new a:this;r(f,c),(d=f._zod).deferred??(d.deferred=[]);for(const p of f._zod.deferred)p();return f}return Object.defineProperty(l,"init",{value:r}),Object.defineProperty(l,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(l,"name",{value:e}),l}class Ku extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class j4 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const N4={};function Vo(e){return N4}function k4(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 p1(e,t){return typeof t=="bigint"?t.toString():t}function Pv(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function vk(e){return e==null}function xk(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function NW(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(".","")),c=Number.parseInt(t.toFixed(a).replace(".",""));return l%c/10**a}const W2=Symbol("evaluating");function Ut(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==W2)return r===void 0&&(r=W2,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function jc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function tl(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Z2(e){return JSON.stringify(e)}function kW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const C4="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ah(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const CW=Pv(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ad(e){if(Ah(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Ah(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function A4(e){return ad(e)?{...e}:Array.isArray(e)?[...e]:e}const AW=new Set(["string","number","symbol"]);function sd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nl(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Ve(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 EW(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const OW={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 zW(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=tl(e._zod.def,{get shape(){const l={};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(l[c]=n.shape[c])}return jc(this,"shape",l),l},checks:[]});return nl(e,a)}function _W(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=tl(e._zod.def,{get shape(){const l={...e._zod.def.shape};for(const c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete l[c]}return jc(this,"shape",l),l},checks:[]});return nl(e,a)}function TW(e,t){if(!ad(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=tl(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return jc(this,"shape",a),a}});return nl(e,i)}function PW(e,t){if(!ad(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=tl(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return jc(this,"shape",r),r}});return nl(e,n)}function RW(e,t){const n=tl(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return jc(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return nl(e,n)}function DW(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=tl(t._zod.def,{get shape(){const c=t._zod.def.shape,d={...c};if(n)for(const f in n){if(!(f in c))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(d[f]=e?new e({type:"optional",innerType:c[f]}):c[f])}else for(const f in c)d[f]=e?new e({type:"optional",innerType:c[f]}):c[f];return jc(this,"shape",d),d},checks:[]});return nl(t,l)}function MW(e,t,n){const r=tl(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 jc(this,"shape",a),a}});return nl(t,r)}function Du(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 Mu(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Um(e){return typeof e=="string"?e:e?.message}function Qo(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=Um(e.inst?._zod.def?.error?.(e))??Um(t?.error?.(e))??Um(n.customError?.(e))??Um(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function bk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Eh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const E4=(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,p1,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},O4=ye("$ZodError",E4),z4=ye("$ZodError",E4,{Parent:Error});function IW(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 LW(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,c=0;for(;c<a.path.length;){const d=a.path[c];c===a.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(a))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}};return r(e),n}const wk=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 Ku;if(l.issues.length){const c=new(i?.Err??e)(l.issues.map(d=>Qo(d,a,Vo())));throw C4(c,i?.callee),c}return l.value},Sk=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 c=new(i?.Err??e)(l.issues.map(d=>Qo(d,a,Vo())));throw C4(c,i?.callee),c}return l.value},Rv=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 Ku;return a.issues.length?{success:!1,error:new(e??O4)(a.issues.map(l=>Qo(l,i,Vo())))}:{success:!0,data:a.value}},$W=Rv(z4),Dv=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=>Qo(l,i,Vo())))}:{success:!0,data:a.value}},BW=Dv(z4),UW=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return wk(e)(t,n,i)},qW=e=>(t,n,r)=>wk(e)(t,n,r),FW=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Sk(e)(t,n,i)},HW=e=>async(t,n,r)=>Sk(e)(t,n,r),KW=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rv(e)(t,n,i)},GW=e=>(t,n,r)=>Rv(e)(t,n,r),VW=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dv(e)(t,n,i)},QW=e=>async(t,n,r)=>Dv(e)(t,n,r),YW=/^[cC][^\s-]{8,}$/,WW=/^[0-9a-z]+$/,ZW=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,XW=/^[0-9a-vA-V]{20}$/,JW=/^[A-Za-z0-9]{27}$/,eZ=/^[a-zA-Z0-9_-]{21}$/,tZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nZ=/^([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})$/,X2=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)$/,rZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iZ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function aZ(){return new RegExp(iZ,"u")}const sZ=/^(?:(?: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])$/,oZ=/^(([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}|:))$/,lZ=/^((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])$/,cZ=/^(([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])$/,uZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_4=/^[A-Za-z0-9_-]*$/,dZ=/^\+[1-9]\d{6,14}$/,T4="(?:(?:\\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])))",fZ=new RegExp(`^${T4}$`);function P4(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 hZ(e){return new RegExp(`^${P4(e)}$`)}function pZ(e){const t=P4({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(`^${T4}T(?:${r})$`)}const mZ=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},gZ=/^-?\d+$/,R4=/^-?\d+(?:\.\d+)?$/,yZ=/^(?:true|false)$/i,vZ=/^[^A-Z]*$/,xZ=/^[^a-z]*$/,di=ye("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),D4={number:"number",bigint:"bigint",object:"date"},M4=ye("$ZodCheckLessThan",(e,t)=>{di.init(e,t);const n=D4[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})}}),I4=ye("$ZodCheckGreaterThan",(e,t)=>{di.init(e,t);const n=D4[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})}}),bZ=ye("$ZodCheckMultipleOf",(e,t)=>{di.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):NW(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})}}),wZ=ye("$ZodCheckNumberFormat",(e,t)=>{di.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=OW[t.format];e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=a,n&&(c.pattern=gZ)}),e._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>a&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),SZ=ye("$ZodCheckMaxLength",(e,t)=>{var n;di.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!vk(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=bk(i);r.issues.push({origin:l,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),jZ=ye("$ZodCheckMinLength",(e,t)=>{var n;di.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!vk(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=bk(i);r.issues.push({origin:l,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),NZ=ye("$ZodCheckLengthEquals",(e,t)=>{var n;di.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!vk(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=bk(i),c=a>t.length;r.issues.push({origin:l,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Mv=ye("$ZodCheckStringFormat",(e,t)=>{var n,r;di.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=()=>{})}),kZ=ye("$ZodCheckRegex",(e,t)=>{Mv.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})}}),CZ=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=vZ),Mv.init(e,t)}),AZ=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xZ),Mv.init(e,t)}),EZ=ye("$ZodCheckIncludes",(e,t)=>{di.init(e,t);const n=sd(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})}}),OZ=ye("$ZodCheckStartsWith",(e,t)=>{di.init(e,t);const n=new RegExp(`^${sd(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})}}),zZ=ye("$ZodCheckEndsWith",(e,t)=>{di.init(e,t);const n=new RegExp(`.*${sd(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})}}),_Z=ye("$ZodCheckOverwrite",(e,t)=>{di.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class TZ{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 PZ={major:4,minor:3,patch:6},vn=ye("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=PZ;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,c,d)=>{let f=Du(l),p;for(const m of c){if(m._zod.def.when){if(!m._zod.def.when(l))continue}else if(f)continue;const y=l.issues.length,v=m._zod.check(l);if(v instanceof Promise&&d?.async===!1)throw new Ku;if(p||v instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await v,l.issues.length!==y&&(f||(f=Du(l,y)))});else{if(l.issues.length===y)continue;f||(f=Du(l,y))}}return p?p.then(()=>l):l},a=(l,c,d)=>{if(Du(l))return l.aborted=!0,l;const f=i(c,r,d);if(f instanceof Promise){if(d.async===!1)throw new Ku;return f.then(p=>e._zod.parse(p,d))}return e._zod.parse(f,d)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const f=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,l,c)):a(f,l,c)}const d=e._zod.parse(l,c);if(d instanceof Promise){if(c.async===!1)throw new Ku;return d.then(f=>i(f,r,c))}return i(d,r,c)}}Ut(e,"~standard",()=>({validate:i=>{try{const a=$W(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return BW(e,i).then(l=>l.success?{value:l.data}:{issues:l.error?.issues})}},vendor:"zod",version:1}))}),jk=ye("$ZodString",(e,t)=>{vn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??mZ(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),pn=ye("$ZodStringFormat",(e,t)=>{Mv.init(e,t),jk.init(e,t)}),RZ=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=nZ),pn.init(e,t)}),DZ=ye("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=X2(r))}else t.pattern??(t.pattern=X2());pn.init(e,t)}),MZ=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rZ),pn.init(e,t)}),IZ=ye("$ZodURL",(e,t)=>{pn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),LZ=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=aZ()),pn.init(e,t)}),$Z=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=eZ),pn.init(e,t)}),BZ=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=YW),pn.init(e,t)}),UZ=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=WW),pn.init(e,t)}),qZ=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ZW),pn.init(e,t)}),FZ=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=XW),pn.init(e,t)}),HZ=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=JW),pn.init(e,t)}),KZ=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=pZ(t)),pn.init(e,t)}),GZ=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fZ),pn.init(e,t)}),VZ=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=hZ(t)),pn.init(e,t)}),QZ=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tZ),pn.init(e,t)}),YZ=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=sZ),pn.init(e,t),e._zod.bag.format="ipv4"}),WZ=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=oZ),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})}}}),ZZ=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=lZ),pn.init(e,t)}),XZ=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=cZ),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 L4(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const JZ=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=uZ),pn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{L4(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function eX(e){if(!_4.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return L4(n)}const tX=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_4),pn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{eX(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),nX=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=dZ),pn.init(e,t)});function rX(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 iX=ye("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{rX(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),$4=ye("$ZodNumber",(e,t)=>{vn.init(e,t),e._zod.pattern=e._zod.bag.pattern??R4,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}}),aX=ye("$ZodNumberFormat",(e,t)=>{wZ.init(e,t),$4.init(e,t)}),sX=ye("$ZodBoolean",(e,t)=>{vn.init(e,t),e._zod.pattern=yZ,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}}),oX=ye("$ZodUnknown",(e,t)=>{vn.init(e,t),e._zod.parse=n=>n}),lX=ye("$ZodNever",(e,t)=>{vn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function J2(e,t,n){e.issues.length&&t.issues.push(...Mu(n,e.issues)),t.value[n]=e.value}const cX=ye("$ZodArray",(e,t)=>{vn.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 c=i[l],d=t.element._zod.run({value:c,issues:[]},r);d instanceof Promise?a.push(d.then(f=>J2(f,n,l))):J2(d,n,l)}return a.length?Promise.all(a).then(()=>n):n}});function ly(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...Mu(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function B4(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=EW(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function U4(e,t,n,r,i,a){const l=[],c=i.keySet,d=i.catchall._zod,f=d.def.type,p=d.optout==="optional";for(const m in t){if(c.has(m))continue;if(f==="never"){l.push(m);continue}const y=d.run({value:t[m],issues:[]},r);y instanceof Promise?e.push(y.then(v=>ly(v,n,m,t,p))):ly(y,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 uX=ye("$ZodObject",(e,t)=>{if(vn.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const c=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...c};return Object.defineProperty(t,"shape",{value:d}),d}})}const r=Pv(()=>B4(t));Ut(e._zod,"propValues",()=>{const c=t.shape,d={};for(const f in c){const p=c[f]._zod;if(p.values){d[f]??(d[f]=new Set);for(const m of p.values)d[f].add(m)}}return d});const i=Ah,a=t.catchall;let l;e._zod.parse=(c,d)=>{l??(l=r.value);const f=c.value;if(!i(f))return c.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),c;c.value={};const p=[],m=l.shape;for(const y of l.keys){const v=m[y],w=v._zod.optout==="optional",b=v._zod.run({value:f[y],issues:[]},d);b instanceof Promise?p.push(b.then(j=>ly(j,c,y,f,w))):ly(b,c,y,f,w)}return a?U4(p,f,c,d,r.value,e):p.length?Promise.all(p).then(()=>c):c}}),dX=ye("$ZodObjectJIT",(e,t)=>{uX.init(e,t);const n=e._zod.parse,r=Pv(()=>B4(t)),i=y=>{const v=new TZ(["shape","payload","ctx"]),w=r.value,b=A=>{const C=Z2(A);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};v.write("const input = payload.value;");const j=Object.create(null);let k=0;for(const A of w.keys)j[A]=`key_${k++}`;v.write("const newResult = {};");for(const A of w.keys){const C=j[A],_=Z2(A),z=y[A]?._zod?.optout==="optional";v.write(`const ${C} = ${b(A)};`),z?v.write(`
|
|
12
|
+
if (${C}.issues.length) {
|
|
13
|
+
if (${_} in input) {
|
|
14
|
+
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
15
|
+
...iss,
|
|
16
|
+
path: iss.path ? [${_}, ...iss.path] : [${_}]
|
|
17
|
+
})));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (${C}.value === undefined) {
|
|
22
|
+
if (${_} in input) {
|
|
23
|
+
newResult[${_}] = undefined;
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
newResult[${_}] = ${C}.value;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`):v.write(`
|
|
30
|
+
if (${C}.issues.length) {
|
|
31
|
+
payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
|
|
32
|
+
...iss,
|
|
33
|
+
path: iss.path ? [${_}, ...iss.path] : [${_}]
|
|
34
|
+
})));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (${C}.value === undefined) {
|
|
38
|
+
if (${_} in input) {
|
|
39
|
+
newResult[${_}] = undefined;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
newResult[${_}] = ${C}.value;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const E=v.compile();return(A,C)=>E(y,A,C)};let a;const l=Ah,c=!N4.jitless,f=c&&CW.value,p=t.catchall;let m;e._zod.parse=(y,v)=>{m??(m=r.value);const w=y.value;return l(w)?c&&f&&v?.async===!1&&v.jitless!==!0?(a||(a=i(t.shape)),y=a(y,v),p?U4([],w,y,v,m,e):y):n(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:w,inst:e}),y)}});function eT(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=>!Du(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=>Qo(l,r,Vo())))}),t)}const q4=ye("$ZodUnion",(e,t)=>{vn.init(e,t),Ut(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ut(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ut(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ut(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=>xk(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 c=[];for(const d of t.options){const f=d._zod.run({value:i.value,issues:[]},a);if(f instanceof Promise)c.push(f),l=!0;else{if(f.issues.length===0)return f;c.push(f)}}return l?Promise.all(c).then(d=>eT(d,i,e,a)):eT(c,i,e,a)}}),fX=ye("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,q4.init(e,t);const n=e._zod.parse;Ut(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[c,d]of Object.entries(l)){i[c]||(i[c]=new Set);for(const f of d)i[c].add(f)}}return i});const r=Pv(()=>{const i=t.options,a=new Map;for(const l of i){const c=l._zod.propValues?.[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of c){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(!Ah(l))return i.issues.push({code:"invalid_type",expected:"object",input:l,inst:e}),i;const c=r.value.get(l?.[t.discriminator]);return c?c._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:l,path:[t.discriminator],inst:e}),i)}}),hX=ye("$ZodIntersection",(e,t)=>{vn.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])=>tT(n,d,f)):tT(n,a,l)}});function m1(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(ad(e)&&ad(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=m1(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=m1(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 tT(e,t,n){const r=new Map;let i;for(const c of t.issues)if(c.code==="unrecognized_keys"){i??(i=c);for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).l=!0}else e.issues.push(c);for(const c of n.issues)if(c.code==="unrecognized_keys")for(const d of c.keys)r.has(d)||r.set(d,{}),r.get(d).r=!0;else e.issues.push(c);const a=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length&&i&&e.issues.push({...i,keys:a}),Du(e))return e;const l=m1(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 pX=ye("$ZodRecord",(e,t)=>{vn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!ad(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 c=new Set;for(const f of l)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){c.add(typeof f=="number"?f.toString():f);const p=t.valueType._zod.run({value:i[f],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Mu(f,m.issues)),n.value[f]=m.value})):(p.issues.length&&n.issues.push(...Mu(f,p.issues)),n.value[f]=p.value)}let d;for(const f in i)c.has(f)||(d=d??[],d.push(f));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const c of Reflect.ownKeys(i)){if(c==="__proto__")continue;let d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&R4.test(c)&&d.issues.length){const m=t.keyType._zod.run({value:Number(c),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?n.value[c]=i[c]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Qo(m,r,Vo())),input:c,path:[c],inst:e});continue}const p=t.valueType._zod.run({value:i[c],issues:[]},r);p instanceof Promise?a.push(p.then(m=>{m.issues.length&&n.issues.push(...Mu(c,m.issues)),n.value[d.value]=m.value})):(p.issues.length&&n.issues.push(...Mu(c,p.issues)),n.value[d.value]=p.value)}}return a.length?Promise.all(a).then(()=>n):n}}),mX=ye("$ZodEnum",(e,t)=>{vn.init(e,t);const n=k4(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>AW.has(typeof i)).map(i=>typeof i=="string"?sd(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}}),gX=ye("$ZodLiteral",(e,t)=>{if(vn.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"?sd(r):r?sd(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}}),yX=ye("$ZodTransform",(e,t)=>{vn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new j4(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 Ku;return n.value=i,n}});function nT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const F4=ye("$ZodOptional",(e,t)=>{vn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ut(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ut(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xk(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=>nT(a,n.value)):nT(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),vX=ye("$ZodExactOptional",(e,t)=>{F4.init(e,t),Ut(e._zod,"values",()=>t.innerType._zod.values),Ut(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),xX=ye("$ZodNullable",(e,t)=>{vn.init(e,t),Ut(e._zod,"optin",()=>t.innerType._zod.optin),Ut(e._zod,"optout",()=>t.innerType._zod.optout),Ut(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${xk(n.source)}|null)$`):void 0}),Ut(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)}),bX=ye("$ZodDefault",(e,t)=>{vn.init(e,t),e._zod.optin="optional",Ut(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=>rT(a,t)):rT(i,t)}});function rT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const wX=ye("$ZodPrefault",(e,t)=>{vn.init(e,t),e._zod.optin="optional",Ut(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))}),SX=ye("$ZodNonOptional",(e,t)=>{vn.init(e,t),Ut(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=>iT(a,e)):iT(i,e)}});function iT(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 jX=ye("$ZodCatch",(e,t)=>{vn.init(e,t),Ut(e._zod,"optin",()=>t.innerType._zod.optin),Ut(e._zod,"optout",()=>t.innerType._zod.optout),Ut(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=>Qo(l,r,Vo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Qo(a,r,Vo()))},input:n.value}),n.issues=[]),n)}}),NX=ye("$ZodPipe",(e,t)=>{vn.init(e,t),Ut(e._zod,"values",()=>t.in._zod.values),Ut(e._zod,"optin",()=>t.in._zod.optin),Ut(e._zod,"optout",()=>t.out._zod.optout),Ut(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=>qm(l,t.in,r)):qm(a,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(a=>qm(a,t.out,r)):qm(i,t.out,r)}});function qm(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const kX=ye("$ZodReadonly",(e,t)=>{vn.init(e,t),Ut(e._zod,"propValues",()=>t.innerType._zod.propValues),Ut(e._zod,"values",()=>t.innerType._zod.values),Ut(e._zod,"optin",()=>t.innerType?._zod?.optin),Ut(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(aT):aT(i)}});function aT(e){return e.value=Object.freeze(e.value),e}const CX=ye("$ZodCustom",(e,t)=>{di.init(e,t),vn.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=>sT(a,n,r,e));sT(i,n,r,e)}});function sT(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(Eh(i))}}var oT;class AX{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 EX(){return new AX}(oT=globalThis).__zod_globalRegistry??(oT.__zod_globalRegistry=EX());const rh=globalThis.__zod_globalRegistry;function OX(e,t){return new e({type:"string",...Ve(t)})}function zX(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ve(t)})}function lT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ve(t)})}function _X(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ve(t)})}function TX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ve(t)})}function PX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ve(t)})}function RX(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ve(t)})}function DX(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ve(t)})}function MX(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ve(t)})}function IX(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ve(t)})}function LX(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ve(t)})}function $X(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ve(t)})}function BX(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ve(t)})}function UX(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ve(t)})}function qX(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ve(t)})}function FX(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ve(t)})}function HX(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ve(t)})}function KX(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ve(t)})}function GX(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ve(t)})}function VX(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ve(t)})}function QX(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ve(t)})}function YX(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ve(t)})}function WX(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ve(t)})}function ZX(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ve(t)})}function XX(e,t){return new e({type:"string",format:"date",check:"string_format",...Ve(t)})}function JX(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ve(t)})}function eJ(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ve(t)})}function tJ(e,t){return new e({type:"number",checks:[],...Ve(t)})}function nJ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ve(t)})}function rJ(e,t){return new e({type:"boolean",...Ve(t)})}function iJ(e){return new e({type:"unknown"})}function aJ(e,t){return new e({type:"never",...Ve(t)})}function cT(e,t){return new M4({check:"less_than",...Ve(t),value:e,inclusive:!1})}function _w(e,t){return new M4({check:"less_than",...Ve(t),value:e,inclusive:!0})}function uT(e,t){return new I4({check:"greater_than",...Ve(t),value:e,inclusive:!1})}function Tw(e,t){return new I4({check:"greater_than",...Ve(t),value:e,inclusive:!0})}function dT(e,t){return new bZ({check:"multiple_of",...Ve(t),value:e})}function H4(e,t){return new SZ({check:"max_length",...Ve(t),maximum:e})}function cy(e,t){return new jZ({check:"min_length",...Ve(t),minimum:e})}function K4(e,t){return new NZ({check:"length_equals",...Ve(t),length:e})}function sJ(e,t){return new kZ({check:"string_format",format:"regex",...Ve(t),pattern:e})}function oJ(e){return new CZ({check:"string_format",format:"lowercase",...Ve(e)})}function lJ(e){return new AZ({check:"string_format",format:"uppercase",...Ve(e)})}function cJ(e,t){return new EZ({check:"string_format",format:"includes",...Ve(t),includes:e})}function uJ(e,t){return new OZ({check:"string_format",format:"starts_with",...Ve(t),prefix:e})}function dJ(e,t){return new zZ({check:"string_format",format:"ends_with",...Ve(t),suffix:e})}function Sd(e){return new _Z({check:"overwrite",tx:e})}function fJ(e){return Sd(t=>t.normalize(e))}function hJ(){return Sd(e=>e.trim())}function pJ(){return Sd(e=>e.toLowerCase())}function mJ(){return Sd(e=>e.toUpperCase())}function gJ(){return Sd(e=>kW(e))}function yJ(e,t,n){return new e({type:"array",element:t,...Ve(n)})}function vJ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ve(n)})}function xJ(e){const t=bJ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Eh(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(Eh(i))}},e(n.value,n)));return t}function bJ(e,t){const n=new di({check:"custom",...Ve(t)});return n._zod.check=e,n}function G4(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??rh,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 qn(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 c=e._zod.toJSONSchema?.();if(c)l.schema=c;else{const p={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,l.schema,p);else{const y=l.schema,v=t.processors[i.type];if(!v)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);v(e,t,y,p)}const m=e._zod.parent;m&&(l.ref||(l.ref=m),qn(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"&&$r(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 c=e.metadataRegistry.get(l[0])?.id;if(c){const d=r.get(c);if(d&&d!==l[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,l[0])}}const i=l=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(l[0])?.id,y=e.external.uri??(w=>w);if(m)return{ref:y(m)};const v=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=v,{defId:v,ref:`${y("__shared")}#/${c}/${v}`}}if(l[1]===n)return{ref:"#"};const f=`#/${c}/`,p=l[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},a=l=>{if(l[1].schema.$ref)return;const c=l[1],{ref:d,defId:f}=i(l);c.def={...c.schema},f&&(c.defId=f);const p=c.schema;for(const m in p)delete p[m];p.$ref=d};if(e.cycles==="throw")for(const l of e.seen.entries()){const c=l[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
46
|
+
|
|
47
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const c=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(c.cycle){a(l);continue}if(c.count>1&&e.reused==="ref"){a(l);continue}}}function Q4(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 c=e.seen.get(l);if(c.ref===null)return;const d=c.def??c.schema,f={...d},p=c.ref;if(c.ref=null,p){r(p);const y=e.seen.get(p),v=y.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(v)):Object.assign(d,v),Object.assign(d,f),l._zod.parent===p)for(const b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(v.$ref&&y.def)for(const b in d)b==="$ref"||b==="allOf"||b in y.def&&JSON.stringify(d[b])===JSON.stringify(y.def[b])&&delete d[b]}const m=l._zod.parent;if(m&&m!==p){r(m);const y=e.seen.get(m);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(const v in d)v==="$ref"||v==="allOf"||v in y.def&&JSON.stringify(d[v])===JSON.stringify(y.def[v])&&delete d[v]}e.override({zodSchema:l,jsonSchema:d,path:c.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 c=l[1];c.def&&c.defId&&(a[c.defId]=c.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:uy(t,"input",e.processors),output:uy(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function $r(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 $r(r.element,n);if(r.type==="set")return $r(r.valueType,n);if(r.type==="lazy")return $r(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 $r(r.innerType,n);if(r.type==="intersection")return $r(r.left,n)||$r(r.right,n);if(r.type==="record"||r.type==="map")return $r(r.keyType,n)||$r(r.valueType,n);if(r.type==="pipe")return $r(r.in,n)||$r(r.out,n);if(r.type==="object"){for(const i in r.shape)if($r(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if($r(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if($r(i,n))return!0;return!!(r.rest&&$r(r.rest,n))}return!1}const wJ=(e,t={})=>n=>{const r=G4({...n,processors:t});return qn(e,r),V4(r,e),Q4(r,e)},uy=(e,t,n={})=>r=>{const{libraryOptions:i,target:a}=r??{},l=G4({...i??{},target:a,io:t,processors:n});return qn(e,l),V4(l,e),Q4(l,e)},SJ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},jJ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:a,maximum:l,format:c,patterns:d,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof l=="number"&&(i.maxLength=l),c&&(i.format=SJ[c]??c,i.format===""&&delete i.format,c==="time"&&delete i.format),f&&(i.contentEncoding=f),d&&d.size>0){const p=[...d];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},NJ=(e,t,n,r)=>{const i=n,{minimum:a,maximum:l,format:c,multipleOf:d,exclusiveMaximum:f,exclusiveMinimum:p}=e._zod.bag;typeof c=="string"&&c.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof a=="number"&&(i.minimum=a,typeof p=="number"&&t.target!=="draft-04"&&(p>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=f,i.exclusiveMaximum=!0):i.exclusiveMaximum=f),typeof 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)},kJ=(e,t,n,r)=>{n.type="boolean"},CJ=(e,t,n,r)=>{n.not={}},AJ=(e,t,n,r)=>{},EJ=(e,t,n,r)=>{const i=e._zod.def,a=k4(i.entries);a.every(l=>typeof l=="number")&&(n.type="number"),a.every(l=>typeof l=="string")&&(n.type="string"),n.enum=a},OJ=(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},zJ=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_J=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},TJ=(e,t,n,r)=>{const i=n,a=e._zod.def,{minimum:l,maximum:c}=e._zod.bag;typeof l=="number"&&(i.minItems=l),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=qn(a.element,t,{...r,path:[...r.path,"items"]})},PJ=(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]=qn(l[f],t,{...r,path:[...r.path,"properties",f]});const c=new Set(Object.keys(l)),d=new Set([...c].filter(f=>{const p=a.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=qn(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},RJ=(e,t,n,r)=>{const i=e._zod.def,a=i.inclusive===!1,l=i.options.map((c,d)=>qn(c,t,{...r,path:[...r.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=l:n.anyOf=l},DJ=(e,t,n,r)=>{const i=e._zod.def,a=qn(i.left,t,{...r,path:[...r.path,"allOf",0]}),l=qn(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=f=>"allOf"in f&&Object.keys(f).length===1,d=[...c(a)?a.allOf:[a],...c(l)?l.allOf:[l]];n.allOf=d},MJ=(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=qn(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=qn(a.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=qn(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)}},IJ=(e,t,n,r)=>{const i=e._zod.def,a=qn(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"}]},LJ=(e,t,n,r)=>{const i=e._zod.def;qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},$J=(e,t,n,r)=>{const i=e._zod.def;qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},BJ=(e,t,n,r)=>{const i=e._zod.def;qn(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)))},UJ=(e,t,n,r)=>{const i=e._zod.def;qn(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},qJ=(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;qn(a,t,r);const l=t.seen.get(e);l.ref=a},FJ=(e,t,n,r)=>{const i=e._zod.def;qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Y4=(e,t,n,r)=>{const i=e._zod.def;qn(i.innerType,t,r);const a=t.seen.get(e);a.ref=i.innerType},HJ=ye("ZodISODateTime",(e,t)=>{KZ.init(e,t),bn.init(e,t)});function KJ(e){return ZX(HJ,e)}const GJ=ye("ZodISODate",(e,t)=>{GZ.init(e,t),bn.init(e,t)});function VJ(e){return XX(GJ,e)}const QJ=ye("ZodISOTime",(e,t)=>{VZ.init(e,t),bn.init(e,t)});function YJ(e){return JX(QJ,e)}const WJ=ye("ZodISODuration",(e,t)=>{QZ.init(e,t),bn.init(e,t)});function ZJ(e){return eJ(WJ,e)}const XJ=(e,t)=>{O4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>LW(e,n)},flatten:{value:n=>IW(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,p1,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,p1,2)}},isEmpty:{get(){return e.issues.length===0}}})},ea=ye("ZodError",XJ,{Parent:Error}),JJ=wk(ea),eee=Sk(ea),tee=Rv(ea),nee=Dv(ea),ree=UW(ea),iee=qW(ea),aee=FW(ea),see=HW(ea),oee=KW(ea),lee=GW(ea),cee=VW(ea),uee=QW(ea),xn=ye("ZodType",(e,t)=>(vn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:uy(e,"input"),output:uy(e,"output")}}),e.toJSONSchema=wJ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(tl(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)=>nl(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>JJ(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>tee(e,n,r),e.parseAsync=async(n,r)=>eee(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>nee(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>ree(e,n,r),e.decode=(n,r)=>iee(e,n,r),e.encodeAsync=async(n,r)=>aee(e,n,r),e.decodeAsync=async(n,r)=>see(e,n,r),e.safeEncode=(n,r)=>oee(e,n,r),e.safeDecode=(n,r)=>lee(e,n,r),e.safeEncodeAsync=async(n,r)=>cee(e,n,r),e.safeDecodeAsync=async(n,r)=>uee(e,n,r),e.refine=(n,r)=>e.check(rte(n,r)),e.superRefine=n=>e.check(ite(n)),e.overwrite=n=>e.check(Sd(n)),e.optional=()=>pT(e),e.exactOptional=()=>Hee(e),e.nullable=()=>mT(e),e.nullish=()=>pT(mT(e)),e.nonoptional=n=>Wee(e,n),e.array=()=>be(e),e.or=n=>J4([e,n]),e.and=n=>Lee(e,n),e.transform=n=>gT(e,qee(n)),e.default=n=>Vee(e,n),e.prefault=n=>Yee(e,n),e.catch=n=>Xee(e,n),e.pipe=n=>gT(e,n),e.readonly=()=>tte(e),e.describe=n=>{const r=e.clone();return rh.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return rh.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return rh.get(e);const r=e.clone();return rh.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=ye("_ZodString",(e,t)=>{jk.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>jJ(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(sJ(...r)),e.includes=(...r)=>e.check(cJ(...r)),e.startsWith=(...r)=>e.check(uJ(...r)),e.endsWith=(...r)=>e.check(dJ(...r)),e.min=(...r)=>e.check(cy(...r)),e.max=(...r)=>e.check(H4(...r)),e.length=(...r)=>e.check(K4(...r)),e.nonempty=(...r)=>e.check(cy(1,...r)),e.lowercase=r=>e.check(oJ(r)),e.uppercase=r=>e.check(lJ(r)),e.trim=()=>e.check(hJ()),e.normalize=(...r)=>e.check(fJ(...r)),e.toLowerCase=()=>e.check(pJ()),e.toUpperCase=()=>e.check(mJ()),e.slugify=()=>e.check(gJ())}),dee=ye("ZodString",(e,t)=>{jk.init(e,t),W4.init(e,t),e.email=n=>e.check(zX(fee,n)),e.url=n=>e.check(DX(hee,n)),e.jwt=n=>e.check(WX(Eee,n)),e.emoji=n=>e.check(MX(pee,n)),e.guid=n=>e.check(lT(fT,n)),e.uuid=n=>e.check(_X(Fm,n)),e.uuidv4=n=>e.check(TX(Fm,n)),e.uuidv6=n=>e.check(PX(Fm,n)),e.uuidv7=n=>e.check(RX(Fm,n)),e.nanoid=n=>e.check(IX(mee,n)),e.guid=n=>e.check(lT(fT,n)),e.cuid=n=>e.check(LX(gee,n)),e.cuid2=n=>e.check($X(yee,n)),e.ulid=n=>e.check(BX(vee,n)),e.base64=n=>e.check(VX(kee,n)),e.base64url=n=>e.check(QX(Cee,n)),e.xid=n=>e.check(UX(xee,n)),e.ksuid=n=>e.check(qX(bee,n)),e.ipv4=n=>e.check(FX(wee,n)),e.ipv6=n=>e.check(HX(See,n)),e.cidrv4=n=>e.check(KX(jee,n)),e.cidrv6=n=>e.check(GX(Nee,n)),e.e164=n=>e.check(YX(Aee,n)),e.datetime=n=>e.check(KJ(n)),e.date=n=>e.check(VJ(n)),e.time=n=>e.check(YJ(n)),e.duration=n=>e.check(ZJ(n))});function P(e){return OX(dee,e)}const bn=ye("ZodStringFormat",(e,t)=>{pn.init(e,t),W4.init(e,t)}),fee=ye("ZodEmail",(e,t)=>{MZ.init(e,t),bn.init(e,t)}),fT=ye("ZodGUID",(e,t)=>{RZ.init(e,t),bn.init(e,t)}),Fm=ye("ZodUUID",(e,t)=>{DZ.init(e,t),bn.init(e,t)}),hee=ye("ZodURL",(e,t)=>{IZ.init(e,t),bn.init(e,t)}),pee=ye("ZodEmoji",(e,t)=>{LZ.init(e,t),bn.init(e,t)}),mee=ye("ZodNanoID",(e,t)=>{$Z.init(e,t),bn.init(e,t)}),gee=ye("ZodCUID",(e,t)=>{BZ.init(e,t),bn.init(e,t)}),yee=ye("ZodCUID2",(e,t)=>{UZ.init(e,t),bn.init(e,t)}),vee=ye("ZodULID",(e,t)=>{qZ.init(e,t),bn.init(e,t)}),xee=ye("ZodXID",(e,t)=>{FZ.init(e,t),bn.init(e,t)}),bee=ye("ZodKSUID",(e,t)=>{HZ.init(e,t),bn.init(e,t)}),wee=ye("ZodIPv4",(e,t)=>{YZ.init(e,t),bn.init(e,t)}),See=ye("ZodIPv6",(e,t)=>{WZ.init(e,t),bn.init(e,t)}),jee=ye("ZodCIDRv4",(e,t)=>{ZZ.init(e,t),bn.init(e,t)}),Nee=ye("ZodCIDRv6",(e,t)=>{XZ.init(e,t),bn.init(e,t)}),kee=ye("ZodBase64",(e,t)=>{JZ.init(e,t),bn.init(e,t)}),Cee=ye("ZodBase64URL",(e,t)=>{tX.init(e,t),bn.init(e,t)}),Aee=ye("ZodE164",(e,t)=>{nX.init(e,t),bn.init(e,t)}),Eee=ye("ZodJWT",(e,t)=>{iX.init(e,t),bn.init(e,t)}),Z4=ye("ZodNumber",(e,t)=>{$4.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>NJ(e,r,i),e.gt=(r,i)=>e.check(uT(r,i)),e.gte=(r,i)=>e.check(Tw(r,i)),e.min=(r,i)=>e.check(Tw(r,i)),e.lt=(r,i)=>e.check(cT(r,i)),e.lte=(r,i)=>e.check(_w(r,i)),e.max=(r,i)=>e.check(_w(r,i)),e.int=r=>e.check(hT(r)),e.safe=r=>e.check(hT(r)),e.positive=r=>e.check(uT(0,r)),e.nonnegative=r=>e.check(Tw(0,r)),e.negative=r=>e.check(cT(0,r)),e.nonpositive=r=>e.check(_w(0,r)),e.multipleOf=(r,i)=>e.check(dT(r,i)),e.step=(r,i)=>e.check(dT(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 te(e){return tJ(Z4,e)}const Oee=ye("ZodNumberFormat",(e,t)=>{aX.init(e,t),Z4.init(e,t)});function hT(e){return nJ(Oee,e)}const zee=ye("ZodBoolean",(e,t)=>{sX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>kJ(e,n,r)});function ht(e){return rJ(zee,e)}const _ee=ye("ZodUnknown",(e,t)=>{oX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>AJ()});function ac(){return iJ(_ee)}const Tee=ye("ZodNever",(e,t)=>{lX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>CJ(e,n,r)});function Pee(e){return aJ(Tee,e)}const Ree=ye("ZodArray",(e,t)=>{cX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>TJ(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(cy(n,r)),e.nonempty=n=>e.check(cy(1,n)),e.max=(n,r)=>e.check(H4(n,r)),e.length=(n,r)=>e.check(K4(n,r)),e.unwrap=()=>e.element});function be(e,t){return yJ(Ree,e,t)}const Dee=ye("ZodObject",(e,t)=>{dX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>PJ(e,n,r,i),Ut(e,"shape",()=>t.shape),e.keyof=()=>He(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ac()}),e.loose=()=>e.clone({...e._zod.def,catchall:ac()}),e.strict=()=>e.clone({...e._zod.def,catchall:Pee()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>TW(e,n),e.safeExtend=n=>PW(e,n),e.merge=n=>RW(e,n),e.pick=n=>zW(e,n),e.omit=n=>_W(e,n),e.partial=(...n)=>DW(t3,e,n[0]),e.required=(...n)=>MW(n3,e,n[0])});function ie(e,t){const n={type:"object",shape:e??{},...Ve(t)};return new Dee(n)}const X4=ye("ZodUnion",(e,t)=>{q4.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>RJ(e,n,r,i),e.options=t.options});function J4(e,t){return new X4({type:"union",options:e,...Ve(t)})}const Mee=ye("ZodDiscriminatedUnion",(e,t)=>{X4.init(e,t),fX.init(e,t)});function e3(e,t,n){return new Mee({type:"union",options:t,discriminator:e,...Ve(n)})}const Iee=ye("ZodIntersection",(e,t)=>{hX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>DJ(e,n,r,i)});function Lee(e,t){return new Iee({type:"intersection",left:e,right:t})}const $ee=ye("ZodRecord",(e,t)=>{pX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>MJ(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Wa(e,t,n){return new $ee({type:"record",keyType:e,valueType:t,...Ve(n)})}const g1=ye("ZodEnum",(e,t)=>{mX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(r,i,a)=>EJ(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 g1({...t,checks:[],...Ve(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 g1({...t,checks:[],...Ve(i),entries:a})}});function He(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new g1({type:"enum",entries:n,...Ve(t)})}const Bee=ye("ZodLiteral",(e,t)=>{gX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>OJ(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 Kr(e,t){return new Bee({type:"literal",values:Array.isArray(e)?e:[e],...Ve(t)})}const Uee=ye("ZodTransform",(e,t)=>{yX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_J(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new j4(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(Eh(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(Eh(l))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function qee(e){return new Uee({type:"transform",transform:e})}const t3=ye("ZodOptional",(e,t)=>{F4.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Y4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function pT(e){return new t3({type:"optional",innerType:e})}const Fee=ye("ZodExactOptional",(e,t)=>{vX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Y4(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Hee(e){return new Fee({type:"optional",innerType:e})}const Kee=ye("ZodNullable",(e,t)=>{xX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>IJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function mT(e){return new Kee({type:"nullable",innerType:e})}const Gee=ye("ZodDefault",(e,t)=>{bX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$J(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Vee(e,t){return new Gee({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():A4(t)}})}const Qee=ye("ZodPrefault",(e,t)=>{wX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>BJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Yee(e,t){return new Qee({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():A4(t)}})}const n3=ye("ZodNonOptional",(e,t)=>{SX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>LJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Wee(e,t){return new n3({type:"nonoptional",innerType:e,...Ve(t)})}const Zee=ye("ZodCatch",(e,t)=>{jX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>UJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Xee(e,t){return new Zee({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Jee=ye("ZodPipe",(e,t)=>{NX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qJ(e,n,r,i),e.in=t.in,e.out=t.out});function gT(e,t){return new Jee({type:"pipe",in:e,out:t})}const ete=ye("ZodReadonly",(e,t)=>{kX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>FJ(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function tte(e){return new ete({type:"readonly",innerType:e})}const nte=ye("ZodCustom",(e,t)=>{CX.init(e,t),xn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>zJ(e,n)});function rte(e,t={}){return vJ(nte,e,t)}function ite(e){return xJ(e)}ie({maxConcurrency:te().int().positive(),maxRequestsPerMinute:te().int().positive(),maxRequestsPerDay:te().int().positive()});const Ls=P().min(1);P().min(1);const Nk=ie({label:P().min(1),city:P().min(1),region:P().min(1),country:P().length(2),timezone:P().optional()}),kk=He(["citation.lost","citation.gained","run.completed","run.failed","insight.critical","insight.high"]);ie({id:P(),projectId:P(),channel:Kr("webhook"),url:P().url(),urlDisplay:P(),urlHost:P(),events:be(kk),enabled:ht().default(!0),source:P().optional(),webhookSecret:P().optional(),createdAt:P(),updatedAt:P()});ie({channel:Kr("webhook"),url:P().url(),events:be(kk).min(1),source:P().optional()});const r3=He(["cli","api","config-file"]);function ate(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 ste(e,t){return t?e.some(n=>n.label===t):!0}ie({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:be(P().min(1)).optional(),aliases:be(P()).optional(),country:P().length(2),language:P().min(2),tags:be(P()).optional(),labels:Wa(P(),P()).optional(),providers:be(Ls).optional(),locations:be(Nk).optional(),defaultLocation:P().nullable().optional(),autoExtractBacklinks:ht().optional(),configSource:r3.optional()});ie({id:P(),name:P(),displayName:P().optional(),canonicalDomain:P(),ownedDomains:be(P()).default([]),aliases:be(P()).default([]),country:P().length(2),language:P().min(2),tags:be(P()).default([]),labels:Wa(P(),P()).default({}),locations:be(Nk).default([]),defaultLocation:P().nullable().optional(),autoExtractBacklinks:ht().default(!1),configSource:r3.default("cli"),configRevision:te().int().positive().default(1),createdAt:P().optional(),updatedAt:P().optional()});ie({id:P(),query:P(),createdAt:P()});ie({id:P(),keyword:P(),createdAt:P()});ie({queries:be(P().trim().min(1)).min(1)});ie({keywords:be(P().trim().min(1)).min(1)});ie({provider:Ls,count:te().int().min(1).max(20).optional()});ie({id:P(),domain:P(),createdAt:P()});ie({competitors:be(P().trim().min(1)).min(1)});function dy(e){let t=e.trim().toLowerCase();try{t.includes("://")&&(t=new URL(t).hostname.toLowerCase())}catch{}return t.replace(/^www\./,"")}const ote=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 lte(e){const t=dy(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 ote.has(i)?r.length>=3?r.slice(-3).join("."):"":r.slice(-2).join(".")}function i3(e){const t=lte(e);return t?t.split(".")[0]??"":""}function cte(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=dy(a);n.has(l)||(n.add(l),r.push(a))}return r}const ute=ie({name:P().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/,{message:"Name must be a lowercase slug (letters, numbers, hyphens)"}),labels:Wa(P(),P()).optional().default({})}),dte=ie({preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),providers:be(Ls).optional().default([])}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'}).optional(),fte=ie({channel:Kr("webhook"),url:P().url(),events:be(kk).min(1)}),hte=ie({gsc:ie({propertyUrl:P()}).optional(),syncSchedule:ie({preset:P().optional(),cron:P().optional()}).optional()}).optional(),yT=be(P().min(1)),pte=ie({displayName:P().min(1),canonicalDomain:P().min(1),ownedDomains:be(P().min(1)).optional().default([]),aliases:be(P().min(1)).optional().default([]),country:P().length(2),language:P().min(2),queries:yT.optional(),keywords:yT.optional(),competitors:be(P().min(1)).optional().default([]),providers:be(Ls).optional().default([]),locations:be(Nk).optional().default([]),defaultLocation:P().optional(),schedule:dte,notifications:be(fte).optional().default([]),google:hte,autoExtractBacklinks:ht().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=ate(e.locations);n.length>0&&t.addIssue({code:"custom",message:`Duplicate location labels are not allowed: ${n.join(", ")}`,path:["locations"]}),ste(e.locations,e.defaultLocation)||t.addIssue({code:"custom",message:`defaultLocation "${e.defaultLocation}" must match a configured location label`,path:["defaultLocation"]})});ie({apiVersion:Kr("canonry/v1"),kind:Kr("Project"),metadata:ute,spec:pte});const mte=He(["gsc","ga4"]);ie({id:P(),domain:P(),connectionType:mte,propertyId:P().nullable().optional(),sitemapUrl:P().nullable().optional(),scopes:be(P()).default([]),createdAt:P(),updatedAt:P()});ie({date:P(),query:P(),page:P(),country:P().nullable().optional(),device:P().nullable().optional(),clicks:te(),impressions:te(),ctr:te(),position:te()});const gte=ie({date:P(),clicks:te(),impressions:te(),ctr:te()});ie({totals:ie({clicks:te(),impressions:te(),ctr:te(),days:te()}),daily:be(gte)});const y1=ie({id:P(),url:P(),indexingState:P().nullable().optional(),verdict:P().nullable().optional(),coverageState:P().nullable().optional(),pageFetchState:P().nullable().optional(),robotsTxtState:P().nullable().optional(),crawlTime:P().nullable().optional(),lastCrawlResult:P().nullable().optional(),isMobileFriendly:ht().nullable().optional(),richResults:be(P()).default([]),inspectedAt:P()});He(["stable","reindexed","deindexed","still-missing","new"]);const yte=ie({url:P(),previousState:P().nullable(),currentState:P().nullable(),transitionDate:P()}),vte=ie({reason:P(),count:te(),urls:be(y1).default([])});ie({summary:ie({total:te(),indexed:te(),notIndexed:te(),deindexed:te(),percentage:te()}),lastInspectedAt:P().nullable(),lastSyncedAt:P().nullable(),indexed:be(y1).default([]),notIndexed:be(y1).default([]),deindexed:be(yte).default([]),reasonGroups:be(vte).default([])});ie({url:P(),type:He(["URL_UPDATED","URL_DELETED"]),notifiedAt:P()});ie({url:P(),type:He(["URL_UPDATED","URL_DELETED"]),notifiedAt:P(),status:He(["success","error"]),error:P().optional()});ie({date:P(),indexed:te(),notIndexed:te(),reasonBreakdown:Wa(P(),te()).default({})});ie({id:P(),domain:P(),siteUrl:P().nullable().optional(),createdAt:P(),updatedAt:P()});const Pw=ie({id:P(),url:P(),httpCode:te().nullable().optional(),inIndex:ht().nullable().optional(),lastCrawledDate:P().nullable().optional(),inIndexDate:P().nullable().optional(),inspectedAt:P(),documentSize:te().nullable().optional(),anchorCount:te().nullable().optional(),discoveryDate:P().nullable().optional()});ie({summary:ie({total:te(),indexed:te(),notIndexed:te(),unknown:te().optional(),percentage:te()}),lastInspectedAt:P().nullable(),indexed:be(Pw).default([]),notIndexed:be(Pw).default([]),unknown:be(Pw).default([]).optional()});ie({query:P(),impressions:te(),clicks:te(),ctr:te(),averagePosition:te()});ie({date:P(),indexed:te(),notIndexed:te(),unknown:te()});ie({url:P(),status:He(["success","error"]),submittedAt:P(),error:P().optional()});const jd=He(["live","staging"]);ie({projectName:P(),url:P(),stagingUrl:P().optional(),username:P(),defaultEnv:jd,createdAt:P(),updatedAt:P()});const vT=ie({url:P(),reachable:ht(),pageCount:te().nullable().optional(),version:P().nullable().optional(),error:P().nullable().optional(),plugins:be(P()).optional(),authenticatedUser:ie({id:te(),slug:P()}).nullable().optional()});ie({connected:ht(),projectName:P(),defaultEnv:jd,live:vT.nullable(),staging:vT.nullable(),adminUrl:P().nullable().optional()});const xte=ie({id:te(),slug:P(),title:P(),status:P(),modifiedAt:P().nullable().optional(),link:P().nullable().optional()}),a3=ie({title:P().nullable(),description:P().nullable(),noindex:ht().nullable(),writable:ht().default(!1),writeTargets:be(P()).default([])}),bte=ie({type:P(),json:Wa(P(),ac())}),wte=xte.extend({env:jd,content:P(),seo:a3,schemaBlocks:be(bte).default([])}),xT=wte.extend({contentHash:P(),contentSnippet:P()}),s3=ie({manualRequired:Kr(!0),targetUrl:P(),adminUrl:P().nullable().optional(),content:P(),nextSteps:be(P()).default([])}),Ste=ie({slug:P(),severity:He(["high","medium","low"]),code:He(["noindex","missing-seo-title","missing-meta-description","missing-schema","thin-content"]),message:P()});ie({slug:P(),title:P(),status:P(),wordCount:te(),seo:a3,schemaPresent:ht(),issues:be(Ste).default([])});const jte=ie({slug:P(),status:He(["applied","skipped","manual"]),error:P().optional(),manualAssist:s3.optional()});ie({env:jd,strategy:He(["plugin","manual"]),results:be(jte)});const Nte=ie({slug:P(),status:He(["deployed","stripped","skipped","failed"]),schemasInjected:be(P()).optional(),manualAssist:s3.optional(),error:P().optional()});ie({env:jd,results:be(Nte)});const kte=ie({slug:P(),title:P(),canonrySchemas:be(P()),thirdPartySchemas:be(P()),hasCanonrySchema:ht()});ie({env:jd,pages:be(kte)});const Cte=ie({name:P(),status:He(["completed","skipped","failed"]),summary:P().optional(),error:P().optional()});ie({projectName:P(),steps:be(Cte)});ie({slug:P(),live:xT,staging:xT,hasDifferences:ht(),differences:ie({title:ht(),slug:ht(),content:ht(),seoTitle:ht(),seoDescription:ht(),noindex:ht(),schema:ht()})});const Iv=He(["queued","running","completed","partial","failed","cancelled"]),br=Iv.enum,o3=He(["answer-visibility","site-audit","gsc-sync","inspect-sitemap","ga-sync","bing-inspect","bing-inspect-sitemap","backlink-extract","traffic-sync","aeo-discover-seed","aeo-discover-probe"]),xt=o3.enum,l3=He(["manual","scheduled","config-apply","backfill"]),dh=l3.enum,sc=He(["cited","not-cited"]),Oh=sc.enum,fy=He(["visible","not-visible"]);fy.enum;const hy=He(["mentioned","not-mentioned"]);hy.enum;const c3=He(["new","cited","lost","emerging","not-cited"]);c3.enum;const Ate=He(["new","mentioned","lost","emerging","not-mentioned"]);Ate.enum;ie({kind:Kr(xt["answer-visibility"]).optional(),trigger:Kr(dh.manual).optional(),providers:be(Ls).optional(),queries:be(P().min(1)).min(1).optional(),location:P().min(1).optional(),allLocations:ht().optional(),noLocation:ht().optional()}).refine(e=>+!!e.location+ +!!e.allLocations+ +!!e.noLocation<=1,{message:'Only one of "location", "allLocations", or "noLocation" may be provided'});const Ete=ie({message:P(),raw:ac().optional()}),Ote=ie({message:P().optional(),providers:Wa(P(),Ete).optional()}),zte=ie({id:P(),projectId:P(),kind:o3,status:Iv,trigger:l3.default("manual"),location:P().nullable().optional(),queries:be(P()).nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),error:Ote.nullable().optional(),createdAt:P()});function Ck(e){if(e.providers){const t=Object.entries(e.providers);if(t.length===1){const[n,r]=t[0];return`${n}: ${r.message}`}if(t.length>1)return t.map(([n,r])=>`${n}: ${r.message}`).join(" • ")}return e.message??"Run failed."}const u3=ie({uri:P(),title:P()}),d3=ie({id:P(),runId:P(),queryId:P(),query:P().optional(),provider:Ls,citationState:sc,answerMentioned:ht().optional(),visibilityState:fy.optional(),mentionState:hy.optional(),transition:c3.optional(),answerText:P().nullable().optional(),citedDomains:be(P()).default([]),competitorOverlap:be(P()).default([]),recommendedCompetitors:be(P()).default([]),matchedTerms:be(P()).default([]),groundingSources:be(u3).default([]),searchQueries:be(P()).default([]),model:P().nullable().optional(),location:P().nullable().optional(),createdAt:P()});ie({snapshots:be(d3),total:te().int().nonnegative()});const _te=ie({queryId:P().nullable(),query:P().nullable(),run1State:sc.nullable(),run2State:sc.nullable(),run1AnswerMentioned:ht().nullable(),run2AnswerMentioned:ht().nullable(),run1VisibilityState:fy.nullable(),run2VisibilityState:fy.nullable(),run1MentionState:hy.nullable().optional(),run2MentionState:hy.nullable().optional(),changed:ht(),visibilityChanged:ht()});ie({run1:P(),run2:P(),diff:be(_te)});const Tte=zte.extend({snapshots:be(d3).optional()});ie({totalRuns:te().int().nonnegative(),run:Tte.nullable()});ie({id:P(),projectId:P().nullable().optional(),actor:P(),action:P(),entityType:P(),entityId:P().nullable().optional(),diff:ac().optional(),createdAt:P()});const Pte=He(["yes","no","unknown","not-mentioned"]),bT=be(P().min(1));ie({companyName:P().min(1),domain:P().min(1),queries:bT.optional(),phrases:bT.optional(),competitors:be(P().min(1)).optional().default([])}).superRefine((e,t)=>{e.queries!==void 0&&e.phrases!==void 0&&t.addIssue({code:"custom",message:"Use queries; phrases is accepted only as a legacy alias when queries is omitted",path:["phrases"]})});const Rte=ie({name:P(),count:te().int().nonnegative()}),Dte=ie({id:P(),name:P(),weight:te(),score:te(),grade:P(),status:He(["pass","partial","fail"]),findings:be(ie({type:P(),message:P()})).default([]),recommendations:be(P()).default([])}),Mte=ie({url:P(),finalUrl:P(),auditedAt:P(),overallScore:te(),overallGrade:P(),summary:P(),factors:be(Dte).default([])}),Ite=ie({industry:P(),summary:P(),services:be(P()).default([]),categoryTerms:be(P()).default([])}),Lte=ie({provider:P(),displayName:P(),model:P().nullable().optional(),mentioned:ht(),cited:ht(),describedAccurately:Pte,accuracyNotes:P().nullable().optional(),incorrectClaims:be(P()).default([]),recommendedCompetitors:be(P()).default([]),citedDomains:be(P()).default([]),groundingSources:be(u3).default([]),searchQueries:be(P()).default([]),answerText:P(),error:P().nullable().optional()}),$te=ie({query:P(),providerResults:be(Lte).default([])}),Bte=ie({totalQueries:te().int().nonnegative(),totalProviders:te().int().nonnegative(),totalComparisons:te().int().nonnegative(),mentionCount:te().int().nonnegative(),citationCount:te().int().nonnegative(),topCompetitors:be(Rte).default([]),visibilityGap:P(),whatThisMeans:be(P()).default([]),recommendedActions:be(P()).default([])});ie({companyName:P(),domain:P(),homepageUrl:P(),generatedAt:P(),queries:be(P()).default([]),competitors:be(P()).default([]),profile:Ite,audit:Mte,queryResults:be($te).default([]),summary:Bte});const Ak=He(["answer-visibility","traffic-sync"]);Ak.enum;ie({id:P(),projectId:P(),kind:Ak,cronExpr:P(),preset:P().nullable().optional(),timezone:P().default("UTC"),enabled:ht().default(!0),providers:be(Ls).default([]),sourceId:P().nullable().optional(),lastRunAt:P().nullable().optional(),nextRunAt:P().nullable().optional(),createdAt:P(),updatedAt:P()});ie({kind:Ak.optional(),preset:P().optional(),cron:P().optional(),timezone:P().optional().default("UTC"),enabled:ht().optional().default(!0),providers:be(Ls).optional().default([]),sourceId:P().optional()}).refine(e=>e.preset&&!e.cron||!e.preset&&e.cron,{message:'Exactly one of "preset" or "cron" must be provided'});const Ute=He(["mentioned","cited"]);Ute.enum;ie({id:P(),projectId:P(),propertyId:P(),clientEmail:P(),connected:ht(),createdAt:P(),updatedAt:P()});ie({date:P(),landingPage:P(),sessions:te(),organicSessions:te(),users:te()});const Ek=He(["session","first_user","manual_utm"]),qte=ie({source:P(),medium:P(),sessions:te(),users:te(),sourceDimension:Ek}),Fte=ie({source:P(),medium:P(),sourceDimension:Ek,landingPage:P(),sessions:te(),users:te()}),Hte=ie({source:P(),medium:P(),sessions:te(),users:te(),channelGroup:P()}),If=ie({sessions:te(),sharePct:te(),sharePctDisplay:P()}),Kte=ie({organic:If,social:If,direct:If,ai:If,other:If});ie({totalSessions:te(),totalOrganicSessions:te(),totalDirectSessions:te(),totalUsers:te(),topPages:be(ie({landingPage:P(),sessions:te(),organicSessions:te(),directSessions:te(),users:te()})),aiReferrals:be(qte),aiReferralLandingPages:be(Fte),aiSessionsDeduped:te(),aiUsersDeduped:te(),aiSessionsBySession:te(),aiUsersBySession:te(),socialReferrals:be(Hte),socialSessions:te(),socialUsers:te(),channelBreakdown:Kte,organicSharePct:te(),aiSharePct:te(),aiSharePctBySession:te(),directSharePct:te(),socialSharePct:te(),organicSharePctDisplay:P(),aiSharePctDisplay:P(),aiSharePctBySessionDisplay:P(),directSharePctDisplay:P(),socialSharePctDisplay:P(),otherSessions:te(),otherSharePct:te(),otherSharePctDisplay:P(),lastSyncedAt:P().nullable()});ie({date:P(),source:P(),medium:P(),landingPage:P(),sessions:te(),users:te(),sourceDimension:Ek});ie({date:P(),source:P(),medium:P(),sessions:te(),users:te(),channelGroup:P()});ie({date:P(),sessions:te(),organicSessions:te(),users:te()});function py(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}const Gte=He(["aero","user","compaction"]);Gte.enum;const f3=128;ie({key:P().min(1).max(f3),value:P().min(1)});ie({key:P().min(1).max(f3)});const Ok=He(["queued","downloading","querying","ready","failed"]);Ok.enum;ie({id:P(),release:P(),status:Ok,phaseDetail:P().nullable().optional(),vertexPath:P().nullable().optional(),edgesPath:P().nullable().optional(),vertexSha256:P().nullable().optional(),edgesSha256:P().nullable().optional(),vertexBytes:te().int().nullable().optional(),edgesBytes:te().int().nullable().optional(),projectsProcessed:te().int().nullable().optional(),domainsDiscovered:te().int().nullable().optional(),downloadStartedAt:P().nullable().optional(),downloadFinishedAt:P().nullable().optional(),queryStartedAt:P().nullable().optional(),queryFinishedAt:P().nullable().optional(),error:P().nullable().optional(),createdAt:P(),updatedAt:P()});const Vte=ie({linkingDomain:P(),numHosts:te().int()}),Qte=ie({projectId:P(),release:P(),targetDomain:P(),totalLinkingDomains:te().int(),totalHosts:te().int(),top10HostsShare:P(),queriedAt:P(),excludedLinkingDomains:te().int().optional(),excludedHosts:te().int().optional()});ie({summary:Qte.nullable(),total:te().int(),rows:be(Vte)});ie({release:P(),totalLinkingDomains:te().int(),totalHosts:te().int(),top10HostsShare:P(),queriedAt:P()});ie({duckdbInstalled:ht(),duckdbVersion:P().nullable().optional(),duckdbSpec:P(),pluginDir:P()});ie({installed:ht(),version:P(),path:P(),alreadyPresent:ht()});ie({release:P(),vertexUrl:P(),edgesUrl:P(),vertexBytes:te().int().nullable(),edgesBytes:te().int().nullable(),lastModified:P().nullable()});ie({release:P(),syncStatus:Ok.nullable(),bytes:te().int(),lastUsedAt:P().nullable()});He(["snapshot","insight"]);const Yte=ie({kind:Kr("snapshot"),id:P(),runId:P(),query:P(),provider:P(),model:P().nullable(),citationState:sc,matchedField:He(["answerText","citedDomains","searchQueries","query"]),snippet:P(),createdAt:P()}),Wte=ie({kind:Kr("insight"),id:P(),runId:P().nullable(),type:He(["regression","gain","opportunity","first-citation","provider-pickup","persistent-gap","competitor-gained","competitor-lost"]),severity:He(["critical","high","medium","low"]),title:P(),query:P(),provider:P(),matchedField:He(["title","query","recommendation","cause"]),snippet:P(),dismissed:ht(),createdAt:P()}),Zte=e3("kind",[Yte,Wte]);ie({query:P(),totalHits:te().int().nonnegative(),truncated:ht(),hits:be(Zte)});const h3=He(["create","expand","refresh","add-schema"]);h3.enum;function Xte(e){switch(e){case"create":return"Create";case"expand":return"Expand";case"refresh":return"Refresh";case"add-schema":return"Add schema"}}const p3=He(["gsc","competitor-evidence","both"]);p3.enum;const m3=He(["high","medium","low"]);m3.enum;const Jte=He(["blog-post","comparison","listicle","how-to","guide","glossary"]);Jte.enum;const g3=He(["proposed","briefed","payload-generated","draft-created","published","validated","dismissed"]);g3.enum;const ene=ie({url:P(),gscImpressions:te().nonnegative(),gscClicks:te().nonnegative(),gscAvgPosition:te().nonnegative().nullable(),organicSessions:te().nonnegative()}),tne=ie({domain:P(),url:P(),title:P(),citationCount:te().int().nonnegative()}),nne=ie({demand:te(),competitor:te(),absence:te(),gapSeverity:te()}),rne=ie({actionId:P(),state:g3,lastUpdated:P()}),ine=ie({targetRef:P(),query:P(),action:h3,ourBestPage:ene.nullable(),winningCompetitor:tne.nullable(),score:te(),scoreBreakdown:nne,drivers:be(P()),demandSource:p3,actionConfidence:m3,existingAction:rne.nullable()});ie({targets:be(ine),contextMetrics:ie({totalAiReferralSessions:te().int().nonnegative(),latestRunId:P(),runTimestamp:P()})});const ane=ie({uri:P(),title:P(),domain:P(),isOurDomain:ht(),isCompetitor:ht(),citationCount:te().int().nonnegative(),providers:be(Ls)}),sne=ie({query:P(),groundingSources:be(ane)});ie({sources:be(sne),latestRunId:P()});const one=ie({query:P(),competitorDomains:be(P()),competitorCount:te().int().nonnegative(),missRate:te().min(0).max(1),lastSeenInRunId:P()});ie({gaps:be(one),latestRunId:P()});const y3=He(["ok","warn","fail","skipped"]);y3.enum;const zk=He(["global","project"]);zk.enum;const v3=He(["auth","config","providers","integrations","database","schedules","agent"]);v3.enum;const lne=ie({id:P(),category:v3,scope:zk,title:P(),status:y3,code:P().describe('Stable machine-readable code (e.g. "google.token.refresh-failed"). Use this for filtering and remediation logic.'),summary:P(),remediation:P().nullable().optional().describe('Operator-facing next step. Null when status is "ok" or no specific remediation applies.'),details:Wa(P(),ac()).optional().describe("Structured context — principal email, redirect URI, missing scopes, etc. Stable per check id."),durationMs:te().int().nonnegative().describe("How long the check took to execute.")});ie({scope:zk,project:P().nullable().describe('Project name when scope is "project", null otherwise.'),generatedAt:P().describe("ISO-8601 timestamp when this doctor run started."),durationMs:te().int().nonnegative(),summary:ie({total:te().int().nonnegative(),ok:te().int().nonnegative(),warn:te().int().nonnegative(),fail:te().int().nonnegative(),skipped:te().int().nonnegative()}),checks:be(lne)});const cne=ie({provider:P(),citationState:sc,cited:ht(),mentioned:ht(),runId:P(),runCreatedAt:P()}),une=ie({queryId:P(),query:P(),providers:be(cne),citedCount:te().int().nonnegative(),mentionedCount:te().int().nonnegative(),totalProviders:te().int().nonnegative()}),dne=ie({queryId:P(),query:P(),provider:P(),citingCompetitors:be(P()),runId:P(),runCreatedAt:P()}),fne=ie({providersConfigured:te().int().nonnegative(),providersCiting:te().int().nonnegative(),providersMentioning:te().int().nonnegative(),totalQueries:te().int().nonnegative(),queriesCitedAndMentioned:te().int().nonnegative(),queriesCitedOnly:te().int().nonnegative(),queriesMentionedOnly:te().int().nonnegative(),queriesInvisible:te().int().nonnegative(),latestRunId:P().nullable(),latestRunAt:P().nullable()});ie({summary:fne,byQuery:be(une),competitorGaps:be(dne),status:He(["ready","no-data"]),reason:He(["no-runs-yet","no-queries"]).optional()});function hne(e){return e.horizon==="immediate"?"negative":e.confidence==="high"?"caution":e.confidence==="low"?"neutral":"caution"}function pne(e){switch(e){case"critical":return"Critical";case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}function mne(e){switch(e){case"immediate":return"Immediate";case"short-term":return"Short term";case"medium-term":return"Medium term"}}function gne(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 yne(e){switch(e){case"high":return"High";case"medium":return"Medium";case"low":return"Low"}}const vne=new Set(["a","an","and","for","from","in","near","of","on","or","the","to"]);function x3(e){return e.toLowerCase().match(/[a-z0-9]+/g)??[]}function b3(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 w3(e){const t=e.meta.location;return t?new Set([t.label,t.city,t.region,t.country].flatMap(x3).map(b3).filter(Boolean)):new Set}function S3(e,t){const n=x3(e).map(b3).filter(Boolean).filter(r=>!vne.has(r)).filter(r=>!t.has(r));return[...new Set(n)].sort().join(" ")}function xne(e){return e.title.match(/"([^"]+)"/)?.[1]??e.successMetric.match(/"([^"]+)"/)?.[1]??e.title}function bne(e,t){const n=w3(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=S3(xne(a),n);!l||r.has(l)||(r.add(l),i.push(a))}return i}function wne(e){const t=w3(e),n=e.contentOpportunities;if(n.length<=1||t.size===0)return n;const r=new Set;return n.filter(i=>{const a=S3(i.query,t);return!a||r.has(a)?!1:(r.add(a),!0)})}const Sne=He(["claude","codex"]);Sne.enum;const jne=He(["claude","codex","all"]);jne.enum;const _k=He(["cloud-run","wordpress","cloudflare","vercel","generic-log"]);_k.enum;const Nne=He(["raw-request-events","aggregate-request-metrics","request-url","status-code","user-agent","remote-ip","referer","cursor-pull"]);Nne.enum;const kne=He(["raw-request","aggregate-bucket"]),Cne=kne.enum,Ane=He(["observed","provider-aggregated","inferred"]),Ene=Ane.enum,One=ie({type:P().nullable(),labels:Wa(P(),P())}),zne=ie({sourceType:_k,evidenceKind:Kr(Cne["raw-request"]),confidence:Kr(Ene.observed),eventId:P().min(1),observedAt:P().min(1),method:P().nullable(),requestUrl:P().nullable(),host:P().nullable(),path:P().min(1),queryString:P().nullable(),status:te().int().nullable(),userAgent:P().nullable(),remoteIp:P().nullable(),referer:P().nullable(),latencyMs:te().nullable(),requestSizeBytes:te().int().nullable(),responseSizeBytes:te().int().nullable(),providerResource:One,providerLabels:Wa(P(),P())});ie({events:be(zne),rawEntryCount:te().int().nonnegative(),skippedEntryCount:te().int().nonnegative(),nextPageToken:P().optional(),filter:P()});const j3=He(["connected","paused","error","archived"]),ih=j3.enum,N3=He(["oauth","service-account"]);N3.enum;const _ne=He(["verified","claimed_unverified","unknown_ai_like"]);_ne.enum;ie({gcpProjectId:P().min(1),serviceName:P().nullable().optional(),location:P().nullable().optional(),authMode:N3});ie({baseUrl:P().url(),username:P().min(1)});const Tk=He(["production","preview"]);Tk.enum;ie({projectId:P().min(1),teamId:P().min(1),environment:Tk});const k3=ie({id:P(),projectId:P(),sourceType:_k,displayName:P(),status:j3,lastSyncedAt:P().nullable(),lastCursor:P().nullable(),lastError:P().nullable(),archivedAt:P().nullable(),config:Wa(P(),ac()),createdAt:P(),updatedAt:P()});ie({gcpProjectId:P().min(1),serviceName:P().min(1).optional(),location:P().min(1).optional(),displayName:P().min(1).optional(),keyJson:P().optional()});ie({baseUrl:P().url(),username:P().min(1),applicationPassword:P().min(1),displayName:P().min(1).optional()});ie({projectId:P().min(1),teamId:P().min(1),token:P().min(1),environment:Tk.optional(),displayName:P().min(1).optional()});ie({sourceId:P(),runId:P(),syncedAt:P(),pulledEvents:te().int().nonnegative(),crawlerHits:te().int().nonnegative(),aiReferralHits:te().int().nonnegative(),unknownHits:te().int().nonnegative(),crawlerBucketRows:te().int().nonnegative(),aiReferralBucketRows:te().int().nonnegative(),sampleRows:te().int().nonnegative(),windowStart:P(),windowEnd:P()});ie({days:te().int().positive().optional()});ie({sourceId:P(),runId:P(),status:Iv,windowStart:P(),windowEnd:P(),daysRequested:te().int().positive(),daysApplied:te().int().positive()});const Tne=ie({crawlerHits:te().int().nonnegative(),aiReferralHits:te().int().nonnegative(),sampleCount:te().int().nonnegative()});ie({sources:be(k3)});const Pne=k3.extend({totals24h:Tne,latestRun:ie({runId:P(),status:Iv,startedAt:P().nullable(),finishedAt:P().nullable(),error:P().nullable()}).nullable()});ie({sources:be(Pne)});const Rne=He(["crawler","ai-referral"]),$a=Rne.enum,Dne=ie({kind:Kr($a.crawler),sourceId:P(),tsHour:P(),botId:P(),operator:P(),verificationStatus:P(),pathNormalized:P(),status:te().int(),hits:te().int().nonnegative()}),Mne=ie({kind:Kr($a["ai-referral"]),sourceId:P(),tsHour:P(),product:P(),operator:P(),sourceDomain:P(),evidenceType:P(),landingPathNormalized:P(),status:te().int(),hits:te().int().nonnegative()}),Ine=e3("kind",[Dne,Mne]);ie({windowStart:P(),windowEnd:P(),totals:ie({crawlerHits:te().int().nonnegative(),aiReferralHits:te().int().nonnegative()}),events:be(Ine)});const Pk=He(["cited","aspirational","wasted-surface"]),wT=Pk.enum;wT.cited,wT.aspirational;const Rk=He(["direct-competitor","ota-aggregator","editorial-media","other","unknown"]),Lne=Rk.enum;Lne["direct-competitor"];const Dk=He(["queued","seeding","probing","completed","failed"]);Dk.enum;const C3=ie({domain:P().min(1),hits:te().int().positive(),competitorType:Rk.default("unknown")}),$ne=ie({id:P(),sessionId:P(),projectId:P(),query:P(),bucket:Pk.nullable().default(null),citationState:sc,citedDomains:be(P()).default([]),createdAt:P()}),Bne=ie({id:P(),projectId:P(),status:Dk,icpDescription:P().nullable().optional(),seedProvider:P().nullable().optional(),seedCountRaw:te().int().nullable().optional(),seedCount:te().int().nullable().optional(),dedupThreshold:te().nullable().optional(),probeCount:te().int().nullable().optional(),citedCount:te().int().nullable().default(null),aspirationalCount:te().int().nullable().default(null),wastedCount:te().int().nullable().default(null),competitorMap:be(C3).default([]),error:P().nullable().optional(),startedAt:P().nullable().optional(),finishedAt:P().nullable().optional(),createdAt:P()});Bne.extend({probes:be($ne).default([])});const Une=500;ie({icpDescription:P().min(1).optional(),dedupThreshold:te().min(0).max(1).optional(),maxProbes:te().int().positive().max(Une).optional(),locations:be(P().min(1)).optional()});ie({buckets:be(Pk).min(1).optional(),includeCompetitors:ht().optional(),competitorTypes:be(Rk).min(1).optional()});ie({sessionId:P(),projectId:P(),status:Dk,queriesByBucket:ie({cited:be(P()),aspirational:be(P()),"wasted-surface":be(P())}),suggestedCompetitors:be(C3)});ie({sessionId:P(),projectId:P(),promoted:ie({queries:be(P()),competitors:be(P())}),skipped:ie({queries:be(P()),competitors:be(P())})});J4([Kr("cli"),P().regex(/^discovery:.+$/)]);function Rw(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 qne(e,t){return t<=0?null:Math.round((e-t)/t*100)}function ST(e,t,n="vs prior 7 days"){return e.deltaPct===null?e.prior===0?"First baseline week":"":e.deltaPct>0?`Up ${e.deltaPct}% ${n} (${Rw(e.prior)} ${t})`:e.deltaPct<0?`Down ${Math.abs(e.deltaPct)}% ${n} (${Rw(e.prior)} ${t})`:`Flat ${n} (${Rw(e.prior)} ${t})`}var Mo=(e=>(e.Clicks="clicks",e.Impressions="impressions",e.CTR="ctr",e.Position="position",e))(Mo||{});const Fne={clicks:"Clicks",impressions:"Impressions",ctr:"CTR",position:"Position"},Hm={clicks:"Clicks",impressions:"Impr",ctr:"CTR",position:"Pos"},Hne=Ck;function Kne(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 Lv(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ma(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function jT(e){return e===null?"Unknown":e?"Pass":"Fail"}function v1(e){return e===0?"12:00 AM":e<12?`${e}:00 AM`:e===12?"12:00 PM":`${e-12}:00 PM`}function Gne(e,t){return e==="twice-daily"?"twice-daily":e.startsWith("weekly@")?`${e}@${t}`:`daily@${t}`}function Vne(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 Dw(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 ${v1(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"},c=a[2]?parseInt(a[2]):6;return`Every ${l[a[1]]} at ${v1(c)} · ${r}`}return`${e} · ${r}`}function my(e){return e.state==="ok"?"positive":e.state==="checking"?"neutral":"negative"}function A3(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 Qne(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 Yne(e){return e==="High"?"negative":e==="Moderate"?"caution":"neutral"}function Wne(e){return e.displayName??e.name.charAt(0).toUpperCase()+e.name.slice(1)}function Yo(e){const t=[e.detail,e.hint].filter(Boolean);return t.length>0?t.join(`
|
|
52
|
+
`):void 0}function Zne(e,t,n){return e.map(r=>{if(r.id==="api")return{...r,tone:my(t.apiStatus),detail:t.apiStatus.state==="ok"?"Healthy":"Needs attention",meta:t.apiStatus.detail};if(r.id==="worker")return{...r,tone:my(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,c=n.providerStatuses.filter(d=>d.state==="ready").map(d=>Wne(d)).join(" · ");return{...r,label:"Providers",tone:l?"positive":"caution",detail:`${i} of ${a} configured`,meta:c||"None configured"}})}function Xne(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 Jne(e,t,n){const r=Xne(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(c=>c.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 E3="canonry.run-tracker",x1=new Set;let NT=!1,ere=0,$v={runs:{},batches:{}};function tre(){const e=oc();for(const t of x1)t(e)}function nre(e){if(!e)return{runs:{},batches:{}};try{const t=JSON.parse(e);return{runs:t.runs??{},batches:t.batches??{}}}catch{return{runs:{},batches:{}}}}function rre(){typeof window>"u"||window.sessionStorage.setItem(E3,JSON.stringify($v))}function O3(){NT||(NT=!0,!(typeof window>"u")&&($v=nre(window.sessionStorage.getItem(E3))))}function Bv(e){$v=e,rre(),tre()}function oc(){return O3(),$v}function ire(e){return O3(),x1.add(e),()=>{x1.delete(e)}}function z3(e){const t=oc();Bv({...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 kT(e){const t=oc();if(!t.runs[e])return;const{[e]:n,...r}=t.runs;Bv({...t,runs:r})}function are(e){const t=oc(),n=`batch_${Date.now()}_${++ere}`;return Bv({...t,batches:{...t.batches,[n]:{batchId:n,runIds:e.runIds,queuedCount:e.queuedCount,skippedCount:e.skippedCount}}}),n}function sre(e){const t=oc();if(!t.batches[e])return;const{[e]:n,...r}=t.batches;Bv({...t,batches:r})}function Mk(e){return e==="completed"||e==="partial"||e==="failed"||e==="cancelled"}function ore(e,t){let n=0,r=0,i=0,a=0,l=0;for(const c of e){const d=t[c]?.status;d==="completed"?n+=1:d==="partial"?r+=1:d==="failed"?i+=1:d==="cancelled"?a+=1:l+=1}return{completed:n,partial:r,failed:i,cancelled:a,pending:l,finished:l===0}}function CT(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ik(...e){return t=>{let n=!1;const r=e.map(i=>{const a=CT(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():CT(e[i],null)}}}}function Nc(...e){return x.useCallback(Ik(...e),e)}var lre=Symbol.for("react.lazy"),gy=kv[" use ".trim().toString()];function cre(e){return typeof e=="object"&&e!==null&&"then"in e}function _3(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===lre&&"_payload"in e&&cre(e._payload)}function ure(e){const t=fre(e),n=x.forwardRef((r,i)=>{let{children:a,...l}=r;_3(a)&&typeof gy=="function"&&(a=gy(a._payload));const c=x.Children.toArray(a),d=c.find(pre);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return 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 dre=ure("Slot");function fre(e){const t=x.forwardRef((n,r)=>{let{children:i,...a}=n;if(_3(i)&&typeof gy=="function"&&(i=gy(i._payload)),x.isValidElement(i)){const l=gre(i),c=mre(a,i.props);return i.type!==x.Fragment&&(c.ref=r?Ik(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hre=Symbol("radix.slottable");function pre(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hre}function mre(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function gre(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 T3(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=T3(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $t(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=T3(e))&&(r&&(r+=" "),r+=t);return r}const AT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ET=$t,P3=(e,t)=>n=>{var r;if(t?.variants==null)return ET(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 y=AT(p)||AT(m);return i[f][y]}),c=n&&Object.entries(n).reduce((f,p)=>{let[m,y]=p;return y===void 0||(f[m]=y),f},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:m,className:y,...v}=p;return Object.entries(v).every(w=>{let[b,j]=w;return Array.isArray(j)?j.includes({...a,...c}[b]):{...a,...c}[b]===j})?[...f,m,y]:f},[]);return ET(e,l,d,n?.class,n?.className)},yre=(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},vre=(e,t)=>({classGroupId:e,validator:t}),R3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),yy="-",OT=[],xre="arbitrary..",bre=e=>{const t=Sre(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return wre(l);const c=l.split(yy),d=c[0]===""&&c.length>1?1:0;return D3(c,d,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const d=r[l],f=n[l];return d?f?yre(f,d):d:f||OT}return n[l]||OT}}},D3=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const f=D3(e,t+1,a);if(f)return f}const l=n.validators;if(l===null)return;const c=t===0?e.join(yy):e.slice(t).join(yy),d=l.length;for(let f=0;f<d;f++){const p=l[f];if(p.validator(c))return p.classGroupId}},wre=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?xre+r:void 0})(),Sre=e=>{const{theme:t,classGroups:n}=e;return jre(n,t)},jre=(e,t)=>{const n=R3();for(const r in e){const i=e[r];Lk(i,n,r,t)}return n},Lk=(e,t,n,r)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];Nre(l,t,n,r)}},Nre=(e,t,n,r)=>{if(typeof e=="string"){kre(e,t,n);return}if(typeof e=="function"){Cre(e,t,n,r);return}Are(e,t,n,r)},kre=(e,t,n)=>{const r=e===""?t:M3(t,e);r.classGroupId=n},Cre=(e,t,n,r)=>{if(Ere(e)){Lk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(vre(n,e))},Are=(e,t,n,r)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[c,d]=i[l];Lk(d,M3(t,c),n,r)}},M3=(e,t)=>{let n=e;const r=t.split(yy),i=r.length;for(let a=0;a<i;a++){const l=r[a];let c=n.nextPart.get(l);c||(c=R3(),n.nextPart.set(l,c)),n=c}return n},Ere=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ore=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)}}},b1="!",zT=":",zre=[],_T=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),_re=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const a=[];let l=0,c=0,d=0,f;const p=i.length;for(let b=0;b<p;b++){const j=i[b];if(l===0&&c===0){if(j===zT){a.push(i.slice(d,b)),d=b+1;continue}if(j==="/"){f=b;continue}}j==="["?l++:j==="]"?l--:j==="("?c++:j===")"&&c--}const m=a.length===0?i:i.slice(d);let y=m,v=!1;m.endsWith(b1)?(y=m.slice(0,-1),v=!0):m.startsWith(b1)&&(y=m.slice(1),v=!0);const w=f&&f>d?f-d:void 0;return _T(a,v,y,w)};if(t){const i=t+zT,a=r;r=l=>l.startsWith(i)?a(l.slice(i.length)):_T(zre,!1,l,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Tre=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],c=l[0]==="[",d=t.has(l);c||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}},Pre=e=>({cache:Ore(e.cacheSize),parseClassName:_re(e),sortModifiers:Tre(e),...bre(e)}),Rre=/\s+/,Dre=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],c=e.trim().split(Rre);let d="";for(let f=c.length-1;f>=0;f-=1){const p=c[f],{isExternal:m,modifiers:y,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:b}=n(p);if(m){d=p+(d.length>0?" "+d:d);continue}let j=!!b,k=r(j?w.substring(0,b):w);if(!k){if(!j){d=p+(d.length>0?" "+d:d);continue}if(k=r(w),!k){d=p+(d.length>0?" "+d:d);continue}j=!1}const E=y.length===0?"":y.length===1?y[0]:a(y).join(":"),A=v?E+b1:E,C=A+k;if(l.indexOf(C)>-1)continue;l.push(C);const _=i(k,j);for(let O=0;O<_.length;++O){const z=_[O];l.push(A+z)}d=p+(d.length>0?" "+d:d)}return d},Mre=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=I3(n))&&(i&&(i+=" "),i+=r);return i},I3=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=I3(e[r]))&&(n&&(n+=" "),n+=t);return n},Ire=(e,...t)=>{let n,r,i,a;const l=d=>{const f=t.reduce((p,m)=>m(p),e());return n=Pre(f),r=n.cache.get,i=n.cache.set,a=c,c(d)},c=d=>{const f=r(d);if(f)return f;const p=Dre(d,n);return i(d,p),p};return a=l,(...d)=>a(Mre(...d))},Lre=[],Vn=e=>{const t=n=>n[e]||Lre;return t.isThemeGetter=!0,t},L3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$re=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Bre=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ure=/\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$/,qre=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Fre=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hre=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,So=e=>$re.test(e),wt=e=>!!e&&!Number.isNaN(Number(e)),jo=e=>!!e&&Number.isInteger(Number(e)),Mw=e=>e.endsWith("%")&&wt(e.slice(0,-1)),Ss=e=>Bre.test(e),B3=()=>!0,Kre=e=>Ure.test(e)&&!qre.test(e),$k=()=>!1,Gre=e=>Fre.test(e),Vre=e=>Hre.test(e),Qre=e=>!$e(e)&&!Be(e),Yre=e=>rl(e,F3,$k),$e=e=>L3.test(e),Ol=e=>rl(e,H3,Kre),TT=e=>rl(e,rie,wt),Wre=e=>rl(e,G3,B3),Zre=e=>rl(e,K3,$k),PT=e=>rl(e,U3,$k),Xre=e=>rl(e,q3,Vre),Km=e=>rl(e,V3,Gre),Be=e=>$3.test(e),Lf=e=>kc(e,H3),Jre=e=>kc(e,K3),RT=e=>kc(e,U3),eie=e=>kc(e,F3),tie=e=>kc(e,q3),Gm=e=>kc(e,V3,!0),nie=e=>kc(e,G3,!0),rl=(e,t,n)=>{const r=L3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kc=(e,t,n=!1)=>{const r=$3.exec(e);return r?r[1]?t(r[1]):n:!1},U3=e=>e==="position"||e==="percentage",q3=e=>e==="image"||e==="url",F3=e=>e==="length"||e==="size"||e==="bg-size",H3=e=>e==="length",rie=e=>e==="number",K3=e=>e==="family-name",G3=e=>e==="number"||e==="weight",V3=e=>e==="shadow",iie=()=>{const e=Vn("color"),t=Vn("font"),n=Vn("text"),r=Vn("font-weight"),i=Vn("tracking"),a=Vn("leading"),l=Vn("breakpoint"),c=Vn("container"),d=Vn("spacing"),f=Vn("radius"),p=Vn("shadow"),m=Vn("inset-shadow"),y=Vn("text-shadow"),v=Vn("drop-shadow"),w=Vn("blur"),b=Vn("perspective"),j=Vn("aspect"),k=Vn("ease"),E=Vn("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...C(),Be,$e],O=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],R=()=>[Be,$e,d],$=()=>[So,"full","auto",...R()],F=()=>[jo,"none","subgrid",Be,$e],M=()=>["auto",{span:["full",jo,Be,$e]},jo,Be,$e],U=()=>[jo,"auto",Be,$e],K=()=>["auto","min","max","fr",Be,$e],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],X=()=>[So,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],ue=()=>[So,"screen","full","dvw","lvw","svw","min","max","fit",...R()],xe=()=>[So,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],L=()=>[e,Be,$e],q=()=>[...C(),RT,PT,{position:[Be,$e]}],I=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",eie,Yre,{size:[Be,$e]}],V=()=>[Mw,Lf,Ol],re=()=>["","none","full",f,Be,$e],ee=()=>["",wt,Lf,Ol],Ee=()=>["solid","dashed","dotted","double"],Te=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[wt,Mw,RT,PT],he=()=>["","none",w,Be,$e],je=()=>["none",wt,Be,$e],me=()=>["none",wt,Be,$e],tt=()=>[wt,Be,$e],Ie=()=>[So,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ss],breakpoint:[Ss],color:[B3],container:[Ss],"drop-shadow":[Ss],ease:["in","out","in-out"],font:[Qre],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ss],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ss],shadow:[Ss],spacing:["px",wt],text:[Ss],"text-shadow":[Ss],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",So,$e,Be,j]}],container:["container"],columns:[{columns:[wt,$e,Be,c]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],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:[jo,"auto",Be,$e]}],basis:[{basis:[So,"full","auto",c,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[wt,So,"auto","initial","none",$e]}],grow:[{grow:["",wt,Be,$e]}],shrink:[{shrink:["",wt,Be,$e]}],order:[{order:[jo,"first","last","none",Be,$e]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mbs:[{mbs:H()}],mbe:[{mbe:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...ue()]}],"min-inline-size":[{"min-inline":["auto",...ue()]}],"max-inline-size":[{"max-inline":["none",...ue()]}],"block-size":[{block:["auto",...xe()]}],"min-block-size":[{"min-block":["auto",...xe()]}],"max-block-size":[{"max-block":["none",...xe()]}],w:[{w:[c,"screen",...X()]}],"min-w":[{"min-w":[c,"screen","none",...X()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",n,Lf,Ol]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,nie,Wre]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Mw,$e]}],"font-family":[{font:[Jre,Zre,t]}],"font-features":[{"font-features":[$e]}],"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,Be,$e]}],"line-clamp":[{"line-clamp":[wt,"none",Be,TT]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",Be,$e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,$e]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ee(),"wavy"]}],"text-decoration-thickness":[{decoration:[wt,"from-font","auto",Be,Ol]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[wt,"auto",Be,$e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:I()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},jo,Be,$e],radial:["",Be,$e],conic:[jo,Be,$e]},tie,Xre]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ee(),"hidden","none"]}],"divide-style":[{divide:[...Ee(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Ee(),"none","hidden"]}],"outline-offset":[{"outline-offset":[wt,Be,$e]}],"outline-w":[{outline:["",wt,Lf,Ol]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,Gm,Km]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",m,Gm,Km]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[wt,Ol]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",y,Gm,Km]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[wt,Be,$e]}],"mix-blend":[{"mix-blend":[...Te(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Te()}],"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":[wt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[Be,$e]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[wt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:I()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,$e]}],filter:[{filter:["","none",Be,$e]}],blur:[{blur:he()}],brightness:[{brightness:[wt,Be,$e]}],contrast:[{contrast:[wt,Be,$e]}],"drop-shadow":[{"drop-shadow":["","none",v,Gm,Km]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",wt,Be,$e]}],"hue-rotate":[{"hue-rotate":[wt,Be,$e]}],invert:[{invert:["",wt,Be,$e]}],saturate:[{saturate:[wt,Be,$e]}],sepia:[{sepia:["",wt,Be,$e]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,$e]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[wt,Be,$e]}],"backdrop-contrast":[{"backdrop-contrast":[wt,Be,$e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",wt,Be,$e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[wt,Be,$e]}],"backdrop-invert":[{"backdrop-invert":["",wt,Be,$e]}],"backdrop-opacity":[{"backdrop-opacity":[wt,Be,$e]}],"backdrop-saturate":[{"backdrop-saturate":[wt,Be,$e]}],"backdrop-sepia":[{"backdrop-sepia":["",wt,Be,$e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,$e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[wt,"initial",Be,$e]}],ease:[{ease:["linear","initial",k,Be,$e]}],delay:[{delay:[wt,Be,$e]}],animate:[{animate:["none",E,Be,$e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Be,$e]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":["scale-3d"],skew:[{skew:tt()}],"skew-x":[{"skew-x":tt()}],"skew-y":[{"skew-y":tt()}],transform:[{transform:[Be,$e,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ie()}],"translate-x":[{"translate-x":Ie()}],"translate-y":[{"translate-y":Ie()}],"translate-z":[{"translate-z":Ie()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,$e]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,$e]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[wt,Lf,Ol,TT]}],stroke:[{stroke:["none",...L()]}],"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"]}},aie=Ire(iie);function ta(...e){return aie($t(e))}const sie=P3("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"}}),pe=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>{const l=r?dre:"button";return s.jsx(l,{ref:a,className:ta(sie({variant:t,size:n,className:e})),...i})});pe.displayName="Button";const oie=P3("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 Q3({className:e,variant:t,...n}){return s.jsx("div",{className:ta(oie({variant:t}),e),...n})}const lie=220;function DT({compact:e=!1,version:t,updateAvailable:n,onDismissUpdate:r}){const i=!e&&t&&t!=="unknown",[a,l]=x.useState(!1),c=!e&&n&&r,d=()=>{l(!0),window.setTimeout(()=>{r?.(),l(!1)},lie)};return e?s.jsxs(zt,{to:"/",className:"brand-lockup brand-lockup-compact","aria-label":"Canonry home",children:[s.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"}),s.jsx("span",{className:"brand-copy",children:s.jsx("span",{className:"brand-mark",children:"Canonry"})})]}):s.jsxs("div",{className:"brand-lockup brand-lockup-wrapper",children:[s.jsx(zt,{to:"/",className:"brand-icon-link","aria-label":"Canonry home",tabIndex:-1,children:s.jsx("img",{className:"brand-icon",src:"./favicon.svg",alt:"","aria-hidden":"true"})}),s.jsxs("div",{className:"brand-copy",children:[s.jsx(zt,{to:"/",className:"brand-mark",children:"Canonry"}),c?s.jsxs("span",{className:`brand-update-bubble ${a?"brand-update-bubble-closing":""}`,role:"status","aria-live":"polite",children:[s.jsxs("a",{className:"brand-update-bubble-link",href:n.url,target:"_blank",rel:"noopener noreferrer",title:`Open release: ${n.upgradeCommand}`,"aria-label":`New version v${n.latest} available — open release page`,children:[s.jsxs("span",{className:"brand-update-bubble-from",children:["v",n.current]}),s.jsx(xY,{className:"brand-update-bubble-arrow size-3","aria-hidden":"true"}),s.jsxs("span",{className:"brand-update-bubble-to",children:["v",n.latest]})]}),s.jsx("button",{type:"button",className:"brand-update-bubble-dismiss",onClick:d,"aria-label":`Dismiss update notification for v${n.latest}`,children:s.jsx(Sc,{className:"size-3","aria-hidden":"true"})})]}):i?s.jsxs("span",{className:"brand-version",children:["v",t]}):null]})]})}function lc({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 ot({tone:e,children:t,...n}){const r=e==="positive"?"success":e==="caution"?"warning":e==="negative"?"destructive":"neutral";return s.jsx(Q3,{variant:r,...n,children:t})}function Uv({status:e}){return s.jsx(ot,{tone:A3(e),children:Lv(e)})}function qo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function cie(e,t){const n=x.createContext(t),r=a=>{const{children:l,...c}=a,d=x.useMemo(()=>c,Object.values(c));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 uie(e,t=[]){let n=[];function r(a,l){const c=x.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:y,children:v,...w}=m,b=y?.[e]?.[d]||c,j=x.useMemo(()=>w,Object.values(w));return s.jsx(b.Provider,{value:j,children:v})};f.displayName=a+"Provider";function p(m,y){const v=y?.[e]?.[d]||c,w=x.useContext(v);if(w)return w;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(c){const d=c?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...c,[e]:d}}),[c,d])}};return i.scopeName=e,[r,die(i,...t)]}function die(...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((c,{useScope:d,scopeName:f})=>{const m=d(a)[`__scope${f}`];return{...c,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var zh=globalThis?.document?x.useLayoutEffect:()=>{},fie=kv[" useId ".trim().toString()]||(()=>{}),hie=0;function Iw(e){const[t,n]=x.useState(fie());return zh(()=>{n(r=>r??String(hie++))},[e]),e||(t?`radix-${t}`:"")}var pie=kv[" useInsertionEffect ".trim().toString()]||zh;function mie({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,a,l]=gie({defaultProp:t,onChange:n}),c=e!==void 0,d=c?e:i;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==c&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=c},[c,r])}const f=x.useCallback(p=>{if(c){const m=yie(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[c,e,a,l]);return[d,f]}function gie({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),i=x.useRef(n),a=x.useRef(t);return pie(()=>{a.current=t},[t]),x.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function yie(e){return typeof e=="function"}function Y3(e){const t=vie(e),n=x.forwardRef((r,i)=>{const{children:a,...l}=r,c=x.Children.toArray(a),d=c.find(bie);if(d){const f=d.props.children,p=c.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return 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 vie(e){const t=x.forwardRef((n,r)=>{const{children:i,...a}=n;if(x.isValidElement(i)){const l=Sie(i),c=wie(a,i.props);return i.type!==x.Fragment&&(c.ref=r?Ik(r,l):l),x.cloneElement(i,c)}return x.Children.count(i)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xie=Symbol("radix.slottable");function bie(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xie}function wie(e,t){const n={...t};for(const r in t){const i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...c)=>{const d=a(...c);return i(...c),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...a}:r==="className"&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function Sie(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 jie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$s=jie.reduce((e,t)=>{const n=Y3(`Primitive.${t}`),r=x.forwardRef((i,a)=>{const{asChild:l,...c}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...c,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Nie(e,t){e&&wc.flushSync(()=>e.dispatchEvent(t))}function _h(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function kie(e,t=globalThis?.document){const n=_h(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 Cie="DismissableLayer",w1="dismissableLayer.update",Aie="dismissableLayer.pointerDownOutside",Eie="dismissableLayer.focusOutside",MT,W3=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Z3=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...d}=e,f=x.useContext(W3),[p,m]=x.useState(null),y=p?.ownerDocument??globalThis?.document,[,v]=x.useState({}),w=Nc(t,z=>m(z)),b=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),k=b.indexOf(j),E=p?b.indexOf(p):-1,A=f.layersWithOutsidePointerEventsDisabled.size>0,C=E>=k,_=_ie(z=>{const R=z.target,$=[...f.branches].some(F=>F.contains(R));!C||$||(i?.(z),l?.(z),z.defaultPrevented||c?.())},y),O=Tie(z=>{const R=z.target;[...f.branches].some(F=>F.contains(R))||(a?.(z),l?.(z),z.defaultPrevented||c?.())},y);return kie(z=>{E===f.layers.size-1&&(r?.(z),!z.defaultPrevented&&c&&(z.preventDefault(),c()))},y),x.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(MT=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),IT(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=MT)}},[p,y,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),IT())},[p,f]),x.useEffect(()=>{const z=()=>v({});return document.addEventListener(w1,z),()=>document.removeEventListener(w1,z)},[]),s.jsx($s.div,{...d,ref:w,style:{pointerEvents:A?C?"auto":"none":void 0,...e.style},onFocusCapture:qo(e.onFocusCapture,O.onFocusCapture),onBlurCapture:qo(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:qo(e.onPointerDownCapture,_.onPointerDownCapture)})});Z3.displayName=Cie;var Oie="DismissableLayerBranch",zie=x.forwardRef((e,t)=>{const n=x.useContext(W3),r=x.useRef(null),i=Nc(t,r);return x.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),s.jsx($s.div,{...e,ref:i})});zie.displayName=Oie;function _ie(e,t=globalThis?.document){const n=_h(e),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const a=c=>{if(c.target&&!r.current){let d=function(){X3(Aie,n,f,{discrete:!0})};const f={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},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 Tie(e,t=globalThis?.document){const n=_h(e),r=x.useRef(!1);return x.useEffect(()=>{const i=a=>{a.target&&!r.current&&X3(Eie,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 IT(){const e=new CustomEvent(w1);document.dispatchEvent(e)}function X3(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?Nie(i,a):i.dispatchEvent(a)}var Lw="focusScope.autoFocusOnMount",$w="focusScope.autoFocusOnUnmount",LT={bubbles:!1,cancelable:!0},Pie="FocusScope",J3=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...l}=e,[c,d]=x.useState(null),f=_h(i),p=_h(a),m=x.useRef(null),y=Nc(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(A){if(v.paused||!c)return;const C=A.target;c.contains(C)?m.current=C:Ao(m.current,{select:!0})},j=function(A){if(v.paused||!c)return;const C=A.relatedTarget;C!==null&&(c.contains(C)||Ao(m.current,{select:!0}))},k=function(A){if(document.activeElement===document.body)for(const _ of A)_.removedNodes.length>0&&Ao(c)};document.addEventListener("focusin",b),document.addEventListener("focusout",j);const E=new MutationObserver(k);return c&&E.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",j),E.disconnect()}}},[r,c,v.paused]),x.useEffect(()=>{if(c){BT.add(v);const b=document.activeElement;if(!c.contains(b)){const k=new CustomEvent(Lw,LT);c.addEventListener(Lw,f),c.dispatchEvent(k),k.defaultPrevented||(Rie($ie(e$(c)),{select:!0}),document.activeElement===b&&Ao(c))}return()=>{c.removeEventListener(Lw,f),setTimeout(()=>{const k=new CustomEvent($w,LT);c.addEventListener($w,p),c.dispatchEvent(k),k.defaultPrevented||Ao(b??document.body,{select:!0}),c.removeEventListener($w,p),BT.remove(v)},0)}}},[c,f,p,v]);const w=x.useCallback(b=>{if(!n&&!r||v.paused)return;const j=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,k=document.activeElement;if(j&&k){const E=b.currentTarget,[A,C]=Die(E);A&&C?!b.shiftKey&&k===C?(b.preventDefault(),n&&Ao(A,{select:!0})):b.shiftKey&&k===A&&(b.preventDefault(),n&&Ao(C,{select:!0})):k===E&&b.preventDefault()}},[n,r,v.paused]);return s.jsx($s.div,{tabIndex:-1,...l,ref:y,onKeyDown:w})});J3.displayName=Pie;function Rie(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ao(r,{select:t}),document.activeElement!==n)return}function Die(e){const t=e$(e),n=$T(t,e),r=$T(t.reverse(),e);return[n,r]}function e$(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 $T(e,t){for(const n of e)if(!Mie(n,{upTo:t}))return n}function Mie(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 Iie(e){return e instanceof HTMLInputElement&&"select"in e}function Ao(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Iie(e)&&t&&e.select()}}var BT=Lie();function Lie(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=UT(e,t),e.unshift(t)},remove(t){e=UT(e,t),e[0]?.resume()}}}function UT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function $ie(e){return e.filter(t=>t.tagName!=="A")}var Bie="Portal",t$=x.forwardRef((e,t)=>{const{container:n,...r}=e,[i,a]=x.useState(!1);zh(()=>a(!0),[]);const l=n||i&&globalThis?.document?.body;return l?eV.createPortal(s.jsx($s.div,{...r,ref:t}),l):null});t$.displayName=Bie;function Uie(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var qv=e=>{const{present:t,children:n}=e,r=qie(t),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),a=Nc(r.ref,Fie(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:a}):null};qv.displayName="Presence";function qie(e){const[t,n]=x.useState(),r=x.useRef(null),i=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[c,d]=Uie(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=Vm(r.current);a.current=c==="mounted"?f:"none"},[c]),zh(()=>{const f=r.current,p=i.current;if(p!==e){const y=a.current,v=Vm(f);e?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(p&&y!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),zh(()=>{if(t){let f;const p=t.ownerDocument.defaultView??window,m=v=>{const b=Vm(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&b&&(d("ANIMATION_END"),!i.current)){const j=t.style.animationFillMode;t.style.animationFillMode="forwards",f=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=j)})}},y=v=>{v.target===t&&(a.current=Vm(r.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(f),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function Vm(e){return e?.animationName||"none"}function Fie(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 Bw=0;function Hie(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??qT()),document.body.insertAdjacentElement("beforeend",e[1]??qT()),Bw++,()=>{Bw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Bw--}},[])}function qT(){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 Ia=function(){return Ia=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},Ia.apply(this,arguments)};function n$(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 Kie(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 Ig="right-scroll-bar-position",Lg="width-before-scroll-bar",Gie="with-scroll-bars-hidden",Vie="--removed-body-scroll-bar-size";function Uw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Qie(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 Yie=typeof window<"u"?x.useLayoutEffect:x.useEffect,FT=new WeakMap;function Wie(e,t){var n=Qie(null,function(r){return e.forEach(function(i){return Uw(i,r)})});return Yie(function(){var r=FT.get(n);if(r){var i=new Set(r),a=new Set(e),l=n.current;i.forEach(function(c){a.has(c)||Uw(c,null)}),a.forEach(function(c){i.has(c)||Uw(c,l)})}FT.set(n,e)},[e]),n}function Zie(e){return e}function Xie(e,t){t===void 0&&(t=Zie);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(c){return c!==l})}},assignSyncMedium:function(a){for(r=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){r=!0;var l=[];if(n.length){var c=n;n=[],c.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 Jie(e){e===void 0&&(e={});var t=Xie(null);return t.options=Ia({async:!0,ssr:!1},e),t}var r$=function(e){var t=e.sideCar,n=n$(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,Ia({},n))};r$.isSideCarExport=!0;function eae(e,t){return e.useMedium(t),r$}var i$=Jie(),qw=function(){},Fv=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:qw,onWheelCapture:qw,onTouchMoveCapture:qw}),i=r[0],a=r[1],l=e.forwardProps,c=e.children,d=e.className,f=e.removeScrollBar,p=e.enabled,m=e.shards,y=e.sideCar,v=e.noRelative,w=e.noIsolation,b=e.inert,j=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,A=e.gapMode,C=n$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=y,O=Wie([n,t]),z=Ia(Ia({},C),i);return x.createElement(x.Fragment,null,p&&x.createElement(_,{sideCar:i$,removeScrollBar:f,shards:m,noRelative:v,noIsolation:w,inert:b,setCallbacks:a,allowPinchZoom:!!j,lockRef:n,gapMode:A}),l?x.cloneElement(x.Children.only(c),Ia(Ia({},z),{ref:O})):x.createElement(E,Ia({},z,{className:d,ref:O}),c))});Fv.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fv.classNames={fullWidth:Lg,zeroRight:Ig};var tae=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nae(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tae();return t&&e.setAttribute("nonce",t),e}function rae(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iae(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var aae=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nae())&&(rae(t,n),iae(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},sae=function(){var e=aae();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},a$=function(){var e=sae(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},oae={left:0,top:0,right:0,gap:0},Fw=function(e){return parseInt(e||"",10)||0},lae=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[Fw(n),Fw(r),Fw(i)]},cae=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return oae;var t=lae(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])}},uae=a$(),Gu="data-scroll-locked",dae=function(e,t,n,r){var i=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
53
|
+
.`.concat(Gie,` {
|
|
54
|
+
overflow: hidden `).concat(r,`;
|
|
55
|
+
padding-right: `).concat(c,"px ").concat(r,`;
|
|
56
|
+
}
|
|
57
|
+
body[`).concat(Gu,`] {
|
|
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(c,"px ").concat(r,`;
|
|
67
|
+
`),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.`).concat(Ig,` {
|
|
71
|
+
right: `).concat(c,"px ").concat(r,`;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.`).concat(Lg,` {
|
|
75
|
+
margin-right: `).concat(c,"px ").concat(r,`;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.`).concat(Ig," .").concat(Ig,` {
|
|
79
|
+
right: 0 `).concat(r,`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.`).concat(Lg," .").concat(Lg,` {
|
|
83
|
+
margin-right: 0 `).concat(r,`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
body[`).concat(Gu,`] {
|
|
87
|
+
`).concat(Vie,": ").concat(c,`px;
|
|
88
|
+
}
|
|
89
|
+
`)},HT=function(){var e=parseInt(document.body.getAttribute(Gu)||"0",10);return isFinite(e)?e:0},fae=function(){x.useEffect(function(){return document.body.setAttribute(Gu,(HT()+1).toString()),function(){var e=HT()-1;e<=0?document.body.removeAttribute(Gu):document.body.setAttribute(Gu,e.toString())}},[])},hae=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;fae();var a=x.useMemo(function(){return cae(i)},[i]);return x.createElement(uae,{styles:dae(a,!t,i,n?"":"!important")})},S1=!1;if(typeof window<"u")try{var Qm=Object.defineProperty({},"passive",{get:function(){return S1=!0,!0}});window.addEventListener("test",Qm,Qm),window.removeEventListener("test",Qm,Qm)}catch{S1=!1}var yu=S1?{passive:!1}:!1,pae=function(e){return e.tagName==="TEXTAREA"},s$=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pae(e)&&n[t]==="visible")},mae=function(e){return s$(e,"overflowY")},gae=function(e){return s$(e,"overflowX")},KT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=o$(e,r);if(i){var a=l$(e,r),l=a[1],c=a[2];if(l>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yae=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vae=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},o$=function(e,t){return e==="v"?mae(t):gae(t)},l$=function(e,t){return e==="v"?yae(t):vae(t)},xae=function(e,t){return e==="h"&&t==="rtl"?-1:1},bae=function(e,t,n,r,i){var a=xae(e,window.getComputedStyle(t).direction),l=a*r,c=n.target,d=t.contains(c),f=!1,p=l>0,m=0,y=0;do{if(!c)break;var v=l$(e,c),w=v[0],b=v[1],j=v[2],k=b-j-a*w;(w||k)&&o$(e,c)&&(m+=k,y+=w);var E=c.parentNode;c=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!d&&c!==document.body||d&&(t.contains(c)||t===c));return(p&&Math.abs(m)<1||!p&&Math.abs(y)<1)&&(f=!0),f},Ym=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},GT=function(e){return[e.deltaX,e.deltaY]},VT=function(e){return e&&"current"in e?e.current:e},wae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sae=function(e){return`
|
|
90
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
91
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
92
|
+
`)},jae=0,vu=[];function Nae(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(jae++)[0],a=x.useState(a$)[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=Kie([e.lockRef.current],(e.shards||[]).map(VT),!0).filter(Boolean);return b.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),b.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var c=x.useCallback(function(b,j){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var k=Ym(b),E=n.current,A="deltaX"in b?b.deltaX:E[0]-k[0],C="deltaY"in b?b.deltaY:E[1]-k[1],_,O=b.target,z=Math.abs(A)>Math.abs(C)?"h":"v";if("touches"in b&&z==="h"&&O.type==="range")return!1;var R=window.getSelection(),$=R&&R.anchorNode,F=$?$===O||$.contains(O):!1;if(F)return!1;var M=KT(z,O);if(!M)return!0;if(M?_=z:(_=z==="v"?"h":"v",M=KT(z,O)),!M)return!1;if(!r.current&&"changedTouches"in b&&(A||C)&&(r.current=_),!_)return!0;var U=r.current||_;return bae(U,j,b,U==="h"?A:C)},[]),d=x.useCallback(function(b){var j=b;if(!(!vu.length||vu[vu.length-1]!==a)){var k="deltaY"in j?GT(j):Ym(j),E=t.current.filter(function(_){return _.name===j.type&&(_.target===j.target||j.target===_.shadowParent)&&wae(_.delta,k)})[0];if(E&&E.should){j.cancelable&&j.preventDefault();return}if(!E){var A=(l.current.shards||[]).map(VT).filter(Boolean).filter(function(_){return _.contains(j.target)}),C=A.length>0?c(j,A[0]):!l.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),f=x.useCallback(function(b,j,k,E){var A={name:b,delta:j,target:k,should:E,shadowParent:kae(k)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(C){return C!==A})},1)},[]),p=x.useCallback(function(b){n.current=Ym(b),r.current=void 0},[]),m=x.useCallback(function(b){f(b.type,GT(b),b.target,c(b,e.lockRef.current))},[]),y=x.useCallback(function(b){f(b.type,Ym(b),b.target,c(b,e.lockRef.current))},[]);x.useEffect(function(){return vu.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:y}),document.addEventListener("wheel",d,yu),document.addEventListener("touchmove",d,yu),document.addEventListener("touchstart",p,yu),function(){vu=vu.filter(function(b){return b!==a}),document.removeEventListener("wheel",d,yu),document.removeEventListener("touchmove",d,yu),document.removeEventListener("touchstart",p,yu)}},[]);var v=e.removeScrollBar,w=e.inert;return x.createElement(x.Fragment,null,w?x.createElement(a,{styles:Sae(i)}):null,v?x.createElement(hae,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cae=eae(i$,Nae);var c$=x.forwardRef(function(e,t){return x.createElement(Fv,Ia({},e,{ref:t,sideCar:Cae}))});c$.classNames=Fv.classNames;var Aae=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xu=new WeakMap,Wm=new WeakMap,Zm={},Hw=0,u$=function(e){return e&&(e.host||u$(e.parentNode))},Eae=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=u$(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})},Oae=function(e,t,n,r){var i=Eae(t,Array.isArray(e)?e:[e]);Zm[n]||(Zm[n]=new WeakMap);var a=Zm[n],l=[],c=new Set,d=new Set(i),f=function(m){!m||c.has(m)||(c.add(m),f(m.parentNode))};i.forEach(f);var p=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(y){if(c.has(y))p(y);else try{var v=y.getAttribute(r),w=v!==null&&v!=="false",b=(xu.get(y)||0)+1,j=(a.get(y)||0)+1;xu.set(y,b),a.set(y,j),l.push(y),b===1&&w&&Wm.set(y,!0),j===1&&y.setAttribute(n,"true"),w||y.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",y,k)}})};return p(t),c.clear(),Hw++,function(){l.forEach(function(m){var y=xu.get(m)-1,v=a.get(m)-1;xu.set(m,y),a.set(m,v),y||(Wm.has(m)||m.removeAttribute(r),Wm.delete(m)),v||m.removeAttribute(n)}),Hw--,Hw||(xu=new WeakMap,xu=new WeakMap,Wm=new WeakMap,Zm={})}},zae=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Aae(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),Oae(r,i,n,"aria-hidden")):function(){return null}},Hv="Dialog",[d$]=uie(Hv),[_ae,ja]=d$(Hv),f$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:l=!0}=e,c=x.useRef(null),d=x.useRef(null),[f,p]=mie({prop:r,defaultProp:i??!1,onChange:a,caller:Hv});return s.jsx(_ae,{scope:t,triggerRef:c,contentRef:d,contentId:Iw(),titleId:Iw(),descriptionId:Iw(),open:f,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};f$.displayName=Hv;var h$="DialogTrigger",Tae=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ja(h$,n),a=Nc(t,i.triggerRef);return s.jsx($s.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":qk(i.open),...r,ref:a,onClick:qo(e.onClick,i.onOpenToggle)})});Tae.displayName=h$;var Bk="DialogPortal",[Pae,p$]=d$(Bk,{forceMount:void 0}),m$=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ja(Bk,t);return s.jsx(Pae,{scope:t,forceMount:n,children:x.Children.map(r,l=>s.jsx(qv,{present:n||a.open,children:s.jsx(t$,{asChild:!0,container:i,children:l})}))})};m$.displayName=Bk;var vy="DialogOverlay",g$=x.forwardRef((e,t)=>{const n=p$(vy,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ja(vy,e.__scopeDialog);return a.modal?s.jsx(qv,{present:r||a.open,children:s.jsx(Dae,{...i,ref:t})}):null});g$.displayName=vy;var Rae=Y3("DialogOverlay.RemoveScroll"),Dae=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ja(vy,n);return s.jsx(c$,{as:Rae,allowPinchZoom:!0,shards:[i.contentRef],children:s.jsx($s.div,{"data-state":qk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cc="DialogContent",y$=x.forwardRef((e,t)=>{const n=p$(cc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ja(cc,e.__scopeDialog);return s.jsx(qv,{present:r||a.open,children:a.modal?s.jsx(Mae,{...i,ref:t}):s.jsx(Iae,{...i,ref:t})})});y$.displayName=cc;var Mae=x.forwardRef((e,t)=>{const n=ja(cc,e.__scopeDialog),r=x.useRef(null),i=Nc(t,n.contentRef,r);return x.useEffect(()=>{const a=r.current;if(a)return zae(a)},[]),s.jsx(v$,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qo(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:qo(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&a.preventDefault()}),onFocusOutside:qo(e.onFocusOutside,a=>a.preventDefault())})}),Iae=x.forwardRef((e,t)=>{const n=ja(cc,e.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return s.jsx(v$,{...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()}})}),v$=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...l}=e,c=ja(cc,n),d=x.useRef(null),f=Nc(t,d);return Hie(),s.jsxs(s.Fragment,{children:[s.jsx(J3,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:s.jsx(Z3,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":qk(c.open),...l,ref:f,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Lae,{titleId:c.titleId}),s.jsx(Bae,{contentRef:d,descriptionId:c.descriptionId})]})]})}),Uk="DialogTitle",x$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ja(Uk,n);return s.jsx($s.h2,{id:i.titleId,...r,ref:t})});x$.displayName=Uk;var b$="DialogDescription",w$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ja(b$,n);return s.jsx($s.p,{id:i.descriptionId,...r,ref:t})});w$.displayName=b$;var S$="DialogClose",j$=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=ja(S$,n);return s.jsx($s.button,{type:"button",...r,ref:t,onClick:qo(e.onClick,()=>i.onOpenChange(!1))})});j$.displayName=S$;function qk(e){return e?"open":"closed"}var N$="DialogTitleWarning",[E2e,k$]=cie(N$,{contentName:cc,titleName:Uk,docsSlug:"dialog"}),Lae=({titleId:e})=>{const t=k$(N$),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},$ae="DialogDescriptionWarning",Bae=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${k$($ae).contentName}}.`;return x.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},C$=f$,A$=m$,Fk=g$,Hk=y$,Kk=x$,E$=w$,O$=j$;const z$=C$,Uae=A$,_$=x.forwardRef(({className:e,...t},n)=>s.jsx(Fk,{ref:n,className:ta("fixed inset-0 z-50 bg-black/70 backdrop-blur-sm",e),...t}));_$.displayName=Fk.displayName;const qae=400,Fae=1200,Hae=720,Gk=x.forwardRef(({className:e,children:t,...n},r)=>{const[i,a]=x.useState(Hae),l=x.useRef(!1),c=x.useRef(0),d=x.useRef(0),f=x.useCallback(y=>{l.current=!0,c.current=y.clientX,d.current=i,y.target.setPointerCapture(y.pointerId),y.preventDefault()},[i]),p=x.useCallback(y=>{if(!l.current)return;const v=c.current-y.clientX,w=Math.min(Fae,Math.max(qae,d.current+v));a(w)},[]),m=x.useCallback(()=>{l.current=!1},[]);return s.jsxs(Uae,{children:[s.jsx(_$,{}),s.jsxs(Hk,{ref:r,className:ta("fixed z-50 flex flex-col bg-zinc-950 px-5 py-4 shadow-2xl overflow-hidden","max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88vh] max-md:rounded-t-2xl max-md:border-t","md:inset-y-0 md:right-0 md:h-full md:border-l","border-zinc-800",e),style:{width:`min(${i}px, 100vw)`},...n,children:[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(O$,{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(Sc,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Gk.displayName=Hk.displayName;const Vk=({className:e,...t})=>s.jsx("div",{className:ta("flex flex-col gap-1.5 pr-10",e),...t}),Kv=x.forwardRef(({className:e,...t},n)=>s.jsx(Kk,{ref:n,className:ta("text-lg font-medium text-zinc-50",e),...t}));Kv.displayName=Kk.displayName;const Gv=x.forwardRef(({className:e,...t},n)=>s.jsx(E$,{ref:n,className:ta("text-sm text-zinc-500",e),...t}));Gv.displayName=E$.displayName;function Kae({title:e,subtitle:t,children:n,open:r,onClose:i}){return s.jsx(z$,{open:r,onOpenChange:a=>a?void 0:i(),children:s.jsxs(Gk,{children:[s.jsxs(Vk,{className:"drawer-head",children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:t}),s.jsx(Kv,{id:"drawer-title",children:e}),s.jsx(Gv,{className:"sr-only",children:t})]}),s.jsx("div",{className:"drawer-body",children:n})]})})}function Zn({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&&wc.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 Gae=/[\s\-_]+/;function Vae(e){const t=e.split(Gae).filter(Boolean);return t.length===0?null:t.map(n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("[\\s\\-_]*")}function j1(e,t){const n=Qae(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"?Fi.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(Vae).filter(f=>!!f);if(l.length===0)return r.map((f,p)=>f.type==="bold"?Fi.createElement("strong",{key:`b-${p}`,className:"text-zinc-200 font-semibold"},f.value):f.value).filter(Boolean);const c=new RegExp(`(${l.join("|")})`,"gi"),d=new Map;for(const f of n)for(const p of f.terms){const m=py(p);m&&!d.has(m)&&d.set(m,f.className)}return r.flatMap((f,p)=>f.value.split(c).map((y,v)=>{if(!y)return null;if(v%2===1){const b=d.get(py(y))??"answer-highlight";return f.type==="bold"?Fi.createElement("mark",{key:`hl-${p}-${v}`,className:b},Fi.createElement("strong",{className:"text-zinc-200 font-semibold"},y)):Fi.createElement("mark",{key:`hl-${p}-${v}`,className:b},y)}return f.type==="bold"?Fi.createElement("strong",{key:`b-${p}-${v}`,className:"text-zinc-200 font-semibold"},y):y})).filter(Boolean)}function Qae(e){return e.length===0?[]:typeof e[0]=="string"?[{terms:e,className:"answer-highlight"}]:e}function Kw(e,t){switch(e){case"new":return"First observation";case"emerging":return"First mention";case"lost":return"Lost since last run";default:return t==="mentioned"||t==="visible"?"Mentioned in latest run":t==="pending"?"Awaiting first run":"Not mentioned in latest run"}}function Yae({evidence:e,project:t,onClose:n}){const[r,i]=x.useState(!1),[a,l]=x.useState("mentions"),[c,d]=x.useState(-1),[f,p]=x.useState(null),[m,y]=x.useState(!1),[v,w]=x.useState({}),b=cte(t.project),j=new Set(b.map(dy)),k=e.runHistory,E=k.length>1,[A,C]=x.useState(null),_=x.useRef(!1);x.useEffect(()=>{if(_.current||e.answerSnippet&&(e.visibilityState!=null||e.answerMentioned!=null))return;const V=k.at(-1);V&&(_.current=!0,Go(V.runId).then(re=>{const ee=re.snapshots.find(Ee=>Ee.query===e.query&&Ee.provider===e.provider);ee&&C({citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:V.visibilityTransition,provider:ee.provider,model:ee.model??e.model,answerSnippet:ee.answerText??e.answerSnippet,citedDomains:ee.citedDomains??e.citedDomains,competitorDomains:ee.competitorOverlap??e.competitorDomains,recommendedCompetitors:ee.recommendedCompetitors??e.recommendedCompetitors??[],matchedTerms:ee.matchedTerms??e.matchedTerms??[],groundingSources:ee.groundingSources??e.groundingSources,evidenceUrls:[],changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary})}).catch(()=>{}))},[e,k]);const O=c>=0&&f!==null,z=O?f:A||{citationState:e.citationState,answerMentioned:e.answerMentioned,visibilityState:e.visibilityState,visibilityTransition:k.at(-1)?.visibilityTransition,provider:e.provider,model:e.model,answerSnippet:e.answerSnippet,citedDomains:e.citedDomains,competitorDomains:e.competitorDomains,recommendedCompetitors:e.recommendedCompetitors??[],matchedTerms:e.matchedTerms??[],groundingSources:e.groundingSources,evidenceUrls:e.evidenceUrls,changeLabel:e.visibilityChangeLabel??e.changeLabel,summary:e.summary},R=z.visibilityState==="pending"||z.citationState==="pending",$=R?!1:z.visibilityState!=null?z.visibilityState==="visible":z.answerMentioned!=null?z.answerMentioned:z.citationState===Oh.cited||z.citationState==="emerging",F=z.answerMentioned!=null||z.visibilityState!=null||z.recommendedCompetitors.length>0,M=z.citedDomains.length>0||z.groundingSources.length>0||z.evidenceUrls.length>0,U=t.project.displayName||t.project.name,K=[...b.map(dy),U,U.split(" ").slice(0,2).join(" "),...z.matchedTerms].filter(V=>V.trim().length>2),Z=[...z.competitorDomains.flatMap(V=>{const re=i3(V);return re.length>=4?[re]:[]}),...z.recommendedCompetitors].filter(V=>V.trim().length>2),Y=[{terms:K,className:"answer-highlight-brand"},...Z.length>0?[{terms:Z,className:"answer-highlight-competitor"}]:[]],H=R?"pending":z.visibilityTransition==="lost"?"lost":$?"mentioned":"not-mentioned",X=x.useRef(0),ue=x.useCallback(async V=>{const re=++X.current;if(V===-1||V===k.length-1){d(-1),p(null),i(!1);return}d(V),i(!1);const ee=k[V],Ee=`${ee.runId}::${e.query}::${e.provider}`;if(v[Ee]){p(v[Ee]);return}y(!0);try{const Te=await Go(ee.runId);if(re!==X.current)return;const ne=Te.snapshots.find(je=>je.query===e.query&&je.provider===e.provider)??Te.snapshots.find(je=>je.query===e.query),he=ne?{citationState:ne.citationState,answerMentioned:ne.answerMentioned,visibilityState:ne.visibilityState,visibilityTransition:ee.visibilityTransition,provider:ne.provider,model:ne.model??null,answerSnippet:ne.answerText??"",citedDomains:ne.citedDomains,competitorDomains:ne.competitorOverlap,recommendedCompetitors:ne.recommendedCompetitors??[],matchedTerms:ne.matchedTerms??[],groundingSources:ne.groundingSources,evidenceUrls:[],changeLabel:Kw(ee.mentionTransition??ee.visibilityTransition,ee.mentionState??ee.visibilityState),summary:""}:{citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ee.visibilityTransition,provider:e.provider,model:ee.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Kw(ee.mentionTransition??ee.visibilityTransition,ee.mentionState??ee.visibilityState),summary:"Snapshot data not available for this run."};w(je=>({...je,[Ee]:he})),p(he)}catch{if(re!==X.current)return;p({citationState:ee.citationState,answerMentioned:ee.answerMentioned,visibilityState:ee.visibilityState,visibilityTransition:ee.visibilityTransition,provider:e.provider,model:ee.model??null,answerSnippet:"",citedDomains:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],groundingSources:[],evidenceUrls:[],changeLabel:Kw(ee.mentionTransition??ee.visibilityTransition,ee.mentionState??ee.visibilityState),summary:"Failed to load historical run data."})}finally{re===X.current&&y(!1)}},[k,e.query,e.provider,v]),L=(O||e.historyScope!=="provider")&&z.model?`${z.provider} (${z.model}) · ${z.changeLabel.toLowerCase()}`:`${z.provider} · ${z.changeLabel.toLowerCase()}`,q=!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(" · "):"",I=$?{label:"Mentioned in answer",title:"Your brand or domain is mentioned in this answer",meta:L}:z.visibilityTransition==="lost"?{label:"Mention lost",title:"Your brand no longer appears in this answer",meta:L}:R?{label:"Pending",title:"Awaiting first run",meta:"No provider data yet"}:{label:"Not mentioned in answer",title:"Your brand or domain was not mentioned in this answer",meta:L},D=()=>{if(!z.answerSnippet)return null;const V=z.answerSnippet.split(`
|
|
97
|
+
`),re=[];let ee=[],Ee=0;const Te=()=>{if(ee.length===0)return;const ne=ee.join(" ").trim();ne&&re.push(s.jsx("p",{className:re.length>0?"mt-2.5":"",children:j1(ne,Y)},Ee++)),ee=[]};for(const ne of V){const he=ne.trim();if(/^[-\u2013\u2014]{3,}$/.test(he)){Te(),re.push(s.jsx("hr",{className:"border-zinc-800/60 my-3"},Ee++));continue}const je=he.match(/^(#{1,3})\s+(\S.*)$/);if(je){Te();const me=je[1].length,tt=je[2].replace(/^[\p{Emoji}\p{Emoji_Component}\s]+/u,"").trim()||je[2],Ie=me===1?"text-[13px] font-semibold text-zinc-100 mt-4 mb-1":me===2?"text-xs font-semibold text-zinc-200 mt-3 mb-0.5":"text-xs font-medium text-zinc-300 mt-2";re.push(s.jsx("p",{className:Ie,children:j1(tt,Y)},Ee++));continue}if(he===""){Te();continue}ee.push(he)}return Te(),re};return s.jsx(C$,{open:!0,onOpenChange:V=>{V||n()},children:s.jsxs(A$,{children:[s.jsx(Fk,{className:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm"}),s.jsxs(Hk,{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," ","·"," ",z.provider||"All providers"]}),s.jsx(Kk,{className:"text-lg font-semibold text-zinc-50 truncate",children:e.query})]}),s.jsxs(O$,{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(Sc,{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((V,re)=>{const ee=c===-1&&re===k.length-1||c===re,Ee=V.visibilityState??(V.answerMentioned?"visible":"not-visible"),Te=V.visibilityTransition??Ee,ne=Ee==="visible"?"bg-emerald-400":Te==="emerging"?"bg-amber-400":Te==="lost"?"bg-rose-400":"bg-zinc-600",je=new Date(V.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"}),me=!!(V.model&&re>0&&k[re-1]?.model&&k[re-1].model!==V.model);return s.jsxs("button",{type:"button",className:`evidence-run-dot ${ee?"evidence-run-dot--selected":""}`,onClick:()=>{ue(re===k.length-1?-1:re)},"aria-label":[`Run ${je}: ${Ee}`,V.model?`model ${V.model}`:null,me?"model changed":null].filter(Boolean).join(" — "),"aria-pressed":ee,children:[s.jsx("span",{className:`size-2 rounded-full ${ne} ${me?"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:je})]},re)})}),c>=0&&c<k.length&&s.jsxs("p",{className:"text-[11px] text-zinc-500 mt-1",children:["Viewing run from ",new Date(k[c].createdAt).toLocaleString()," ","—"," ",s.jsx("span",{className:"capitalize",children:k[c].visibilityState??(k[c].answerMentioned?"visible":"not-visible")}),s.jsxs("button",{type:"button",className:"text-zinc-400 hover:text-zinc-200 ml-2",onClick:()=>{ue(-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(V=>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:`${V.fromModel??"unknown"} -> ${V.toModel??"unknown"} on ${new Date(V.createdAt).toLocaleDateString()}`},`${V.runId}:${V.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:I.label}),s.jsx("p",{className:`evidence-position-title evidence-position-title--${H}`,children:I.title}),s.jsx("p",{className:"evidence-position-meta",children:I.meta}),q&&s.jsx("p",{className:"mt-1 text-[11px] text-zinc-500",children:q})]}),z.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()}),z.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"})]}),!z.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((V,re)=>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:V})]},re))})]}),z.summary&&s.jsx("p",{className:"text-xs text-zinc-600 border-t border-zinc-800/40 pt-3 mt-1",children:z.summary})]}),s.jsxs("div",{className:"evidence-modal-sidebar",children:[(F||M)&&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:"Mention in answer"}),s.jsx(Zn,{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--${$?"mentioned":"not-mentioned"}`,children:[s.jsx("span",{className:"mention-status-icon",children:R?"…":$?"✓":"—"}),s.jsx("span",{className:"mention-status-label",children:R?"Pending":$?"Mentioned":"Not mentioned"})]}),z.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:z.matchedTerms.map(V=>s.jsx("span",{className:"mention-chip mention-chip--brand",children:V},V))})]}),!R&&!$&&z.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:K.map(V=>s.jsx("span",{className:"mention-chip mention-chip--muted",children:V},V))}),s.jsx("p",{className:"text-[11px] text-zinc-600 mt-1.5",children:"None of these appear in the answer text."})]})]}),(z.recommendedCompetitors.length>0||z.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(Zn,{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 V=z.competitorDomains.map(Ee=>Ee.replace(/^www\./,"")),re=new Set(V.map(Ee=>py(Ee.replace(/\.[^.]+$/,""))));return[...z.recommendedCompetitors.filter(Ee=>!re.has(py(Ee))),...V].map(Ee=>s.jsx("span",{className:"mention-chip mention-chip--competitor",children:Ee},Ee))})()})]})]}),a==="sources"&&s.jsxs(s.Fragment,{children:[z.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(Zn,{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:z.citedDomains.map((V,re)=>{const ee=V.toLowerCase().replace(/^www\./,""),Ee=j.has(ee),Te=!Ee&&z.competitorDomains.some(he=>he.toLowerCase().replace(/^www\./,"")===ee),ne=Ee?"you":Te?"competitor":"other";return s.jsxs("div",{className:`citation-leaderboard-item citation-leaderboard-item--${ne}`,children:[s.jsxs("span",{className:"citation-leaderboard-rank",children:["#",re+1]}),s.jsx("span",{className:"citation-leaderboard-domain",children:V}),Ee&&s.jsx("span",{className:"citation-leaderboard-tag",children:"You"}),Te&&s.jsx("span",{className:"citation-leaderboard-tag",children:"Competitor"})]},V)})})]}),z.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 (",z.groundingSources.length,")"]}),s.jsx(Zn,{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:z.groundingSources.map((V,re)=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:V.uri,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V.title||V.uri})},re))})]}),z.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:z.evidenceUrls.map(V=>s.jsx("li",{className:"truncate text-sm",children:s.jsx("a",{href:V,target:"_blank",rel:"noopener noreferrer",className:"text-zinc-400 hover:text-zinc-200 transition-colors",children:V})},V))})]}),z.citedDomains.length===0&&z.groundingSources.length===0&&z.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&&!M&&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 pa(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 Gw=[{id:"project_citypoint",name:"Citypoint Dental NYC",canonicalDomain:"citypointdental.com",ownedDomains:[],aliases:[],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:[],aliases:[],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:[],aliases:[],country:"US",language:"en",tags:["multi-location"],labels:{},locations:[],defaultLocation:null,autoExtractBacklinks:!1,configSource:"cli",configRevision:1}];function Vv(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 Wae=Vv({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"}),Zae=Vv({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"}),Xae=Vv({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"}),Jae=Vv({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"}),ese=[{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:pa(["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:pa(["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:pa(["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:pa(["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:pa(["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:pa(["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:pa(["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:pa(["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:pa(["not-cited","not-cited","not-cited","not-cited","not-cited","cited"])}];Gw[0],Gw[1],pa(["cited","cited","cited","cited","cited"]),Gw[2],2/7,3/7,pa(["not-cited","not-cited","not-cited","cited"]);function tse(e,t){return e.projects.find(n=>n.project.id===t)}function nse(e,t){return e.runs.find(n=>n.id===t)}function rse(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 ise={regression:"negative",gain:"positive",opportunity:"caution","first-citation":"positive","provider-pickup":"positive","persistent-gap":"caution","competitor-gained":"negative","competitor-lost":"neutral"},ase={opportunity:"write","persistent-gap":"write","competitor-gained":"write","competitor-lost":"write",regression:"investigate",gain:"monitor","first-citation":"monitor","provider-pickup":"monitor"},sse={regression:"lost",gain:"emerging",opportunity:"not-cited","first-citation":"emerging","provider-pickup":"emerging","persistent-gap":"not-cited","competitor-gained":"cited","competitor-lost":"not-cited"},ose={regression:"Regression",gain:"Gain",opportunity:"Opportunity","first-citation":"First citation","provider-pickup":"Pickup","persistent-gap":"Gap","competitor-gained":"Competitor","competitor-lost":"Competitor"};function lse(e){return{id:e.id,tone:ise[e.type],title:e.title,detail:e.cause?.details??e.cause?.cause??"",actionLabel:e.recommendation?.action??ose[e.type],actionGroup:ase[e.type],affectedPhrases:[{query:e.query,evidenceId:"",provider:e.provider,citationState:sse[e.type]}]}}function cse(e){return e.filter(t=>!t.dismissed).map(lse)}function T$(e){return{id:e.id,name:e.name,displayName:e.displayName,canonicalDomain:e.canonicalDomain,ownedDomains:e.ownedDomains??[],aliases:e.aliases??[],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 QT(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return e}}function use(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 P$(e){switch(e){case xt["answer-visibility"]:return"Answer visibility sweep";case xt["gsc-sync"]:return"GSC sync";case xt["inspect-sitemap"]:return"Sitemap inspection";case xt["ga-sync"]:return"GA sync";case xt["traffic-sync"]:return"Traffic sync";case xt["bing-inspect"]:return"Bing URL inspection";case xt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case xt["site-audit"]:return"Site audit";case xt["backlink-extract"]:return"Backlink extract";case xt["aeo-discover-seed"]:return"Discovery (seed phase)";case xt["aeo-discover-probe"]:return"Discovery (probe phase)"}}function dse(e){return e===dh.manual?"Manual":e===dh.scheduled?"Scheduled":e===dh["config-apply"]?"Config apply":e}function Qk(e,t){return{id:e.id,projectId:e.projectId,projectName:t,kind:e.kind,kindLabel:P$(e.kind),status:e.status,trigger:e.trigger??"manual",location:e.location??null,createdAt:e.createdAt,startedAt:e.startedAt?QT(e.startedAt):QT(e.createdAt),duration:use(e.startedAt,e.finishedAt),statusDetail:e.error?R$(e.error):fse(e),summary:hse(e),triggerLabel:dse(e.trigger)}}function R$(e){const t=Ck(e);return t.length>200?t.slice(0,200)+"…":t}function fse(e){switch(e.status){case br.queued:return"Waiting for execution slot.";case br.running:return"Provider queries in progress.";case br.completed:return"All queries checked.";case br.partial:return"Run completed with some queries skipped.";case br.failed:return e.error?R$(e.error):"Run failed.";case br.cancelled:return"Run was cancelled.";default:return""}}function hse(e){const t=P$(e.kind);switch(e.status){case br.queued:return`${t} queued`;case br.running:return`${t} in progress`;case br.completed:return`${t} completed`;case br.partial:return`${t} partially completed`;case br.failed:return`${t} failed`;case br.cancelled:return`${t} cancelled`;default:return e.status}}function pse(e,t,n,r){const i=[];let a=0;const l=new Set;if(n.length>0){const c=n.flatMap(w=>w.snapshots),d=new Map;for(const w of c)if(w.query){const b=`${w.query}::${w.provider}::${w.location??""}`;d.set(b,w)}const f=new Set(c.map(w=>w.location??null));f.size===0&&f.add(null);const p=new Set(c.map(w=>w.provider)),m=new Set(t.flatMap(w=>Object.keys(w.providerRuns??{}))),y=[...new Set([...p,...m])].sort(),v=y.length>0?y:["gemini"];for(const w of t){if(w.runs.length===0)continue;l.add(w.query);const b=w.runs.at(-1),j=b?.transition??"not-cited";for(const k of v){const E=[...f].filter(_=>d.has(`${w.query}::${k}::${_??""}`)),A=(w.providerRuns?.[k]?.length??0)>0,C=E.length>0?E:A?[null]:[];for(const _ of C){const O=_??"",z=d.get(`${w.query}::${k}::${O}`),R=z?.model??null,$=R?`${k}:${R}`:null,F=w.providerRuns?.[k],M=$?w.modelRuns?.[$]:void 0,U=he=>he?.filter(je=>(je.location??null)===_),K=E.length>0?U(F):F,Z=E.length>0?U(M):M,Y=(K?.length?K:null)??(Z?.length?Z:null),H=K?.length?"provider":Z?.length?"model":"query",X=Y?Y.at(-1).transition:j,ue=Y?Y.at(-1).visibilityTransition??(Y.at(-1).visibilityState==="visible"?"visible":"not-visible"):b?.visibilityTransition??(b?.visibilityState==="visible"?"visible":"not-visible"),xe=Y?.at(-1)?.citationState,L=Y?.at(-1)?.visibilityState,q=z?X==="lost"?"lost":X==="emerging"?"emerging":z.citationState===Oh.cited?"cited":"not-cited":xe===Oh.cited?"cited":"not-cited",I=z?.visibilityState??(L==="visible"?"visible":L==="pending"?"pending":"not-visible"),D=YT(Y||w.runs),V=WT(Y||w.runs),re=mse(w,k),ee=(Y??w.runs).map(he=>({runId:he.runId,citationState:he.citationState,createdAt:he.createdAt,model:re.get(he.runId)??null,answerMentioned:he.answerMentioned,visibilityState:he.visibilityState,visibilityTransition:he.visibilityTransition,mentionState:he.mentionState,mentionTransition:he.mentionTransition})),Ee=gse(ee),Te=H==="provider"&&Ee.length<=1?"model":H,ne=yse(ee);i.push({id:`evidence_${e}_${a++}`,query:w.query,provider:z?.provider??k,model:z?.model??null,location:z?.location??_,citationState:q,answerMentioned:z?.answerMentioned,visibilityState:I,visibilityChangeLabel:ZT(ue,V,{positive:"visible",negative:"not visible",first:"first visibility"}),changeLabel:ZT(X,D),answerSnippet:z?.answerText??"",citedDomains:z?.citedDomains??[],evidenceUrls:[],competitorDomains:z?.competitorOverlap??[],recommendedCompetitors:z?.recommendedCompetitors??[],matchedTerms:z?.matchedTerms??[],relatedTechnicalSignals:[],groundingSources:z?.groundingSources??[],summary:vse(I,ue,w.query),runHistory:ee,historyScope:Te,modelsSeen:Ee,modelTransitions:ne})}}}}for(const c of r)l.has(c.query)||i.push({id:`evidence_${e}_${a++}`,query:c.query,provider:"",model:null,location:null,citationState:"pending",visibilityState:"pending",visibilityChangeLabel:"Awaiting first run",changeLabel:"Awaiting first run",answerSnippet:"",citedDomains:[],evidenceUrls:[],competitorDomains:[],recommendedCompetitors:[],matchedTerms:[],relatedTechnicalSignals:[],groundingSources:[],summary:`"${c.query}" has been added but no visibility run has been triggered yet.`,runHistory:[],historyScope:"query",modelsSeen:[],modelTransitions:[]});return i}function mse(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),c=l==="unknown"?null:l;for(const d of a)n.set(d.runId,c)}return n}function gse(e){const t=new Set;for(const n of e)n.model&&t.add(n.model);return[...t]}function yse(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 YT(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 WT(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 ZT(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?`${$f(r.positive)} in latest run`:`${$f(r.positive)} for ${t} runs`;case"lost":return"Lost since last run";case"emerging":return $f(r.first);case"not-cited":case"not-visible":return t<=1?`${$f(r.negative)} in latest run`:`${$f(r.negative)} across ${t} runs`;default:return e}}function $f(e){return e.charAt(0).toUpperCase()+e.slice(1)}function vse(e,t,n){switch(t){case"lost":return`Mention 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 mentioned in AI answers for "${n}".`;case"pending":return`"${n}" has been added but no run has been triggered yet.`;default:return`Your brand or domain was not mentioned in AI answers for "${n}".`}}function xse(e){const t=T$(e.project),n=pse(t.name,e.timeline,e.latestRunDetails,e.queries),i=[...e.runs].sort((a,l)=>l.createdAt.localeCompare(a.createdAt)).map(a=>Qk(a,e.project.displayName||e.project.name));return e.overview?bse(t,e.overview,n,i):wse(t,n,i)}function bse(e,t,n,r){const i=cse(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,actionGroup:"investigate",affectedPhrases:[]});return{project:e,dateRangeLabel:t.dateRangeLabel,contextLabel:t.contextLabel,mentionSummary:t.scores.mention,visibilitySummary:t.scores.visibility,mentionShareSummary:t.scores.mentionShare,queryCounts:{cited:t.queryCounts.citedQueries,total:t.queryCounts.totalQueries},gapQueries:t.scores.gapQueries,mentionGaps:t.scores.mentionGaps,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),suggestedQueries:t.suggestedQueries}}function wse(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()}`,mentionSummary:{...r,label:"Mention Coverage"},visibilitySummary:{...r,label:"Citation Coverage"},mentionShareSummary:{...r,label:"Mention Share",breakdown:{projectMentionSnapshots:0,competitorMentionSnapshots:0,perCompetitor:[],snapshotsWithAnswerText:0,snapshotsTotal:0}},queryCounts:{cited:0,total:0},gapQueries:{...r,label:"Citation Gaps"},mentionGaps:{...r,label:"Mention Gaps"},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),suggestedQueries:{rows:[],totalCandidates:0,skippedAlreadyTracked:0}}}function Sse(e){const t=T$(e.project),n=[...e.runs].sort((y,v)=>v.createdAt.localeCompare(y.createdAt)),r=n.find(y=>y.kind===xt["answer-visibility"])??n[0],i=e.project.displayName||e.project.name,a=r?Qk(r,i):jse(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 c=l.scores.visibility,d=c.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:c.tone,providerCoverage:c.providerCoverage,lastRun:a,insight:p>0?`${f} of ${p} queries mentioned across ${m} provider${m===1?"":"s"}.`:"No runs completed yet.",trend:[],competitorPressureLabel:l.scores.competitorPressure.value}}function jse(e,t){return{id:"none",projectId:e,projectName:t,kind:xt["answer-visibility"],kindLabel:"No runs yet",status:br.queued,trigger:dh.manual,createdAt:"",startedAt:"",duration:"",statusDetail:"",summary:"No runs yet",triggerLabel:""}}function Nse(e,t){const n=[],r=[],i=[];for(const l of e){r.push(xse(l)),i.push(Sse(l));const c=[...l.runs].sort((d,f)=>f.createdAt.localeCompare(d.createdAt));for(const d of c)n.push(Qk(d,l.project.displayName||l.project.name))}n.sort((l,c)=>c.createdAt.localeCompare(l.createdAt));const a=e.length>0;return{portfolioOverview:{projects:i,attentionItems:a?kse(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 kse(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===br.running||a.status===br.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 _e={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],performanceDaily:(e,t)=>["gsc",e,"performance-daily",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"]},discovery:{project:e=>["discovery",e],sessions:e=>["discovery",e,"sessions"],session:(e,t)=>["discovery",e,"sessions",t],promotePreview:(e,t)=>["discovery",e,"sessions",t,"promote-preview"]},citationVisibility:e=>["citation-visibility",e],report:e=>["report",e],traffic:{project:e=>["traffic",e],status:e=>["traffic",e,"status"],summary:(e,t)=>["traffic",e,"summary",t],aiHistory:(e,t)=>["traffic",e,"ai-history",t],sessionHistory:(e,t)=>["traffic",e,"session-history",t],socialHistory:(e,t)=>["traffic",e,"social-history",t]},serverTraffic:{all:["server-traffic"],project:e=>["server-traffic",e],sources:e=>["server-traffic",e,"sources"],status:e=>["server-traffic",e,"status"],sourceDetail:(e,t)=>["server-traffic",e,"sources",t],events:(e,t)=>["server-traffic",e,"events",t]}},D$=x.createContext(null);D$.Provider;function np(){return x.useContext(D$)}function Cc(e){const n=np()?.dashboard??null,r=Un({queryKey:_e.projects.all,queryFn:_v,enabled:!n}),i=Un({queryKey:_e.runs.all,queryFn:J5,enabled:!n,staleTime:f1,refetchInterval:w=>w.state.data?.some(k=>k.status==="running"||k.status==="queued")?3e3:f1}),a=Un({queryKey:_e.settings,queryFn:()=>hk().catch(()=>null),enabled:!n}),l=r.data??[],c=i.data??[],d=E5({queries:l.map(w=>{const b=c.filter(O=>O.projectId===w.id),j=b.filter(O=>(O.status==="completed"||O.status==="partial")&&O.kind==="answer-visibility").sort((O,z)=>z.createdAt.localeCompare(O.createdAt)),k=j[0]?.createdAt??null,E=k?j.filter(O=>O.createdAt===k).map(O=>O.id):[],A=j.find(O=>O.createdAt!==k)?.createdAt??null,C=A?j.filter(O=>O.createdAt===A).map(O=>O.id):[],_=[...E].sort().join(",");return{queryKey:_e.projects.detail(w.id,_||void 0),queryFn:async()=>{const[O,z,R,$,F,M,U,K,Z]=await Promise.all([_V(w.name).catch(()=>[]),e4(w.name).catch(()=>[]),t4(w.name).catch(()=>[]),E.length?Promise.all(E.map(Y=>Go(Y).catch(()=>null))).then(Y=>Y.filter(H=>H!=null)):Promise.resolve([]),C.length?Promise.all(C.map(Y=>Go(Y).catch(()=>null))).then(Y=>Y.filter(H=>H!=null)):Promise.resolve([]),pk(w.name).catch(()=>null),mk(w.name).catch(()=>null),FQ(w.name).catch(()=>null),TV(w.name).catch(()=>null)]);return{project:w,runs:b,queries:O,competitors:z,timeline:R,latestRunDetails:$,previousRunDetails:F,gscCoverage:M,bingCoverage:U,dbInsights:K,overview:Z}},enabled:!n&&r.isSuccess&&i.isSuccess,staleTime:p4}})}),f=d.every(w=>w.isSuccess),p=x.useMemo(()=>{if(n)return n;if(!r.data||!i.data||l.length>0&&!f)return null;const w=d.map(b=>b.data?{...b.data,runs:c.filter(j=>j.projectId===b.data.project.id)}:null).filter(b=>b!=null);return Nse(w,a.data??null)},[n,r.data,i.data,a.data,f,d,l.length,c]),m=!n&&(r.isError||i.isError),y=!n&&!p&&!m,v=x.useCallback(async()=>{await Promise.all([r.refetch(),i.refetch(),a.refetch()])},[r.refetch,i.refetch,a.refetch]);return{dashboard:p,isLoading:y,isError:m,refetch:v}}async function Cse(){const e=await GQ("/health","API"),t=e.state==="ok"?{label:"Worker",state:"ok",detail:"In-process job runner"}:{label:"Worker",state:e.state,detail:`Depends on API health check · ${e.detail}`,statusCode:e.statusCode,hint:e.hint?`Worker status is inferred from API health in this deployment mode. ${e.hint}`:"Worker status is inferred from API health in this deployment mode."};return{apiStatus:e,workerStatus:t}}function Qv(e,t){return Un({queryKey:_e.health,queryFn:Cse,enabled:e,refetchInterval:15e3,initialData:t})}function Ase(e){return Un({queryKey:_e.runs.detail(e??""),queryFn:()=>Go(e),enabled:!!e,refetchInterval:t=>{const n=t.state.data?.status;return n==="running"||n==="queued"?3e3:!1}})}function Nd(){const e=el(),t=zv({strict:!1}),n=li({select:d=>d.location.pathname}),r=t.runId??null,i=t.evidenceId??null;return{runId:r,evidenceId:i,openRun:d=>{e({to:n,from:ui.to,search:f=>({...f,runId:d,evidenceId:void 0})})},openEvidence:d=>{e({to:n,from:ui.to,search:f=>({...f,evidenceId:d,runId:void 0})})},closeDrawer:()=>{e({to:n,from:ui.to,search:d=>({...d,runId:void 0,evidenceId:void 0})})}}}const Ese={negative:"toast-card-negative",caution:"toast-card-caution",positive:"toast-card-positive",neutral:"toast-card-neutral"};function Ose(e){if(e.cta)return`${e.cta.label}: ${e.title}`}function zse(){const e=x.useSyncExternalStore(cY,V2,V2),t=el(),{openRun:n}=Nd(),r=x.useCallback(a=>{d1(a)},[]),i=x.useCallback(a=>{a.cta&&(a.cta.intent==="open-run-drawer"?n(a.cta.runId):t({to:"/runs"}),d1(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 ${Ese[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":Ose(a),children:a.cta.label}):null]}),s.jsx("button",{type:"button",onClick:()=>r(a.id),className:"toast-dismiss","aria-label":"Dismiss",children:s.jsx(Sc,{className:"size-3.5"})})]},a.id))})}function _se(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Tse=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Pse=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Rse={};function XT(e,t){return(Rse.jsx?Pse:Tse).test(e)}const Dse=/[ \t\n\f\r]/g;function Mse(e){return typeof e=="object"?e.type==="text"?JT(e.value):!1:JT(e)}function JT(e){return e.replace(Dse,"")===""}let rp=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};rp.prototype.normal={};rp.prototype.property={};rp.prototype.space=void 0;function M$(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new rp(n,r,t)}function N1(e){return e.toLowerCase()}class fi{constructor(t,n){this.attribute=n,this.property=t}}fi.prototype.attribute="";fi.prototype.booleanish=!1;fi.prototype.boolean=!1;fi.prototype.commaOrSpaceSeparated=!1;fi.prototype.commaSeparated=!1;fi.prototype.defined=!1;fi.prototype.mustUseProperty=!1;fi.prototype.number=!1;fi.prototype.overloadedBoolean=!1;fi.prototype.property="";fi.prototype.spaceSeparated=!1;fi.prototype.space=void 0;let Ise=0;const yt=Ac(),Bn=Ac(),k1=Ac(),Oe=Ac(),Jt=Ac(),Vu=Ac(),Si=Ac();function Ac(){return 2**++Ise}const C1=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Bn,commaOrSpaceSeparated:Si,commaSeparated:Vu,number:Oe,overloadedBoolean:k1,spaceSeparated:Jt},Symbol.toStringTag,{value:"Module"})),Vw=Object.keys(C1);class Yk extends fi{constructor(t,n,r,i){let a=-1;if(super(t,n),eP(this,"space",i),typeof r=="number")for(;++a<Vw.length;){const l=Vw[a];eP(this,Vw[a],(r&C1[l])===C1[l])}}}Yk.prototype.defined=!0;function eP(e,t,n){n&&(e[t]=n)}function kd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new Yk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[N1(r)]=r,n[N1(a.attribute)]=r}return new rp(t,n,e.space)}const I$=kd({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Jt,ariaCurrent:null,ariaDescribedBy:Jt,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:Jt,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:Jt,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Jt,ariaLevel:Oe,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:Jt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:Jt,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 L$(e,t){return t in e?e[t]:t}function $$(e,t){return L$(e,t.toLowerCase())}const Lse=kd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vu,acceptCharset:Jt,accessKey:Jt,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:Jt,autoFocus:yt,autoPlay:yt,blocking:Jt,capture:null,charSet:null,checked:yt,cite:null,className:Jt,cols:Oe,colSpan:null,content:null,contentEditable:Bn,controls:yt,controlsList:Jt,coords:Oe|Vu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:k1,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:Jt,height:Oe,hidden:k1,high:Oe,href:null,hrefLang:null,htmlFor:Jt,httpEquiv:Jt,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:Jt,itemRef:Jt,itemScope:yt,itemType:Jt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,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:yt,optimum:Oe,pattern:null,ping:Jt,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:Jt,required:yt,reversed:yt,rows:Oe,rowSpan:Oe,sandbox:Jt,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootDelegatesFocus:yt,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:yt,useMap:null,value:Bn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Jt,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:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,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:yt,disableRemotePlayback:yt,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:$$}),$se=kd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Si,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Jt,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:yt,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:Vu,g2:Vu,glyphName:Vu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:Si,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Oe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Jt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Si,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Si,rev:Si,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Si,requiredFeatures:Si,requiredFonts:Si,requiredFormats:Si,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:Si,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Si,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Si,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:L$}),B$=kd({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()}}),U$=kd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$$}),q$=kd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bse={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"},Use=/[A-Z]/g,tP=/-[a-z]/g,qse=/^data[-\w.:]+$/i;function Fse(e,t){const n=N1(t);let r=t,i=fi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&qse.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(tP,Kse);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!tP.test(a)){let l=a.replace(Use,Hse);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Yk}return new i(r,t)}function Hse(e){return"-"+e.toLowerCase()}function Kse(e){return e.charAt(1).toUpperCase()}const Gse=M$([I$,Lse,B$,U$,q$],"html"),Wk=M$([I$,$se,B$,U$,q$],"svg");function Vse(e){return e.join(" ").trim()}var bu={},Qw,nP;function Qse(){if(nP)return Qw;nP=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
98
|
+
`,f="/",p="*",m="",y="comment",v="declaration";function w(j,k){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];k=k||{};var E=1,A=1;function C(Z){var Y=Z.match(t);Y&&(E+=Y.length);var H=Z.lastIndexOf(d);A=~H?Z.length-H:A+Z.length}function _(){var Z={line:E,column:A};return function(Y){return Y.position=new O(Z),$(),Y}}function O(Z){this.start=Z,this.end={line:E,column:A},this.source=k.source}O.prototype.content=j;function z(Z){var Y=new Error(k.source+":"+E+":"+A+": "+Z);if(Y.reason=Z,Y.filename=k.source,Y.line=E,Y.column=A,Y.source=j,!k.silent)throw Y}function R(Z){var Y=Z.exec(j);if(Y){var H=Y[0];return C(H),j=j.slice(H.length),Y}}function $(){R(n)}function F(Z){var Y;for(Z=Z||[];Y=M();)Y!==!1&&Z.push(Y);return Z}function M(){var Z=_();if(!(f!=j.charAt(0)||p!=j.charAt(1))){for(var Y=2;m!=j.charAt(Y)&&(p!=j.charAt(Y)||f!=j.charAt(Y+1));)++Y;if(Y+=2,m===j.charAt(Y-1))return z("End of comment missing");var H=j.slice(2,Y-2);return A+=2,C(H),j=j.slice(Y),A+=2,Z({type:y,comment:H})}}function U(){var Z=_(),Y=R(r);if(Y){if(M(),!R(i))return z("property missing ':'");var H=R(a),X=Z({type:v,property:b(Y[0].replace(e,m)),value:H?b(H[0].replace(e,m)):m});return R(l),X}}function K(){var Z=[];F(Z);for(var Y;Y=U();)Y!==!1&&(Z.push(Y),F(Z));return Z}return $(),K()}function b(j){return j?j.replace(c,m):m}return Qw=w,Qw}var rP;function Yse(){if(rP)return bu;rP=1;var e=bu&&bu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(bu,"__esModule",{value:!0}),bu.default=n;const t=e(Qse());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const l=(0,t.default)(r),c=typeof i=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?i(f,p,d):p&&(a=a||{},a[f]=p)}),a}return bu}var Bf={},iP;function Wse(){if(iP)return Bf;iP=1,Object.defineProperty(Bf,"__esModule",{value:!0}),Bf.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()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(i,c):f=f.replace(r,c),f.replace(t,l))};return Bf.camelCase=d,Bf}var Uf,aP;function Zse(){if(aP)return Uf;aP=1;var e=Uf&&Uf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Yse()),n=Wse();function r(i,a){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(c,d){c&&d&&(l[(0,n.camelCase)(c,a)]=d)}),l}return r.default=r,Uf=r,Uf}var Xse=Zse();const Jse=Sa(Xse),F$=H$("end"),Zk=H$("start");function H$(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 eoe(e){const t=Zk(e),n=F$(e);if(t&&n)return{start:t,end:n}}function fh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sP(e.position):"start"in e||"end"in e?sP(e):"line"in e||"column"in e?A1(e):""}function A1(e){return oP(e&&e.line)+":"+oP(e&&e.column)}function sP(e){return A1(e&&e.start)+"-"+A1(e&&e.end)}function oP(e){return e&&typeof e=="number"?e:1}class zr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},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 c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=c?c.line:void 0,this.name=fh(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}}zr.prototype.file="";zr.prototype.name="";zr.prototype.reason="";zr.prototype.message="";zr.prototype.stack="";zr.prototype.column=void 0;zr.prototype.line=void 0;zr.prototype.ancestors=void 0;zr.prototype.cause=void 0;zr.prototype.fatal=void 0;zr.prototype.place=void 0;zr.prototype.ruleId=void 0;zr.prototype.source=void 0;const Xk={}.hasOwnProperty,toe=new Map,noe=/[A-Z]/g,roe=new Set(["table","tbody","thead","tfoot","tr"]),ioe=new Set(["td","th"]),K$="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function aoe(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=hoe(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=foe(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:Gse,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=G$(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function G$(e,t,n){if(t.type==="element")return soe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ooe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return coe(e,t,n);if(t.type==="mdxjsEsm")return loe(e,t);if(t.type==="root")return uoe(e,t,n);if(t.type==="text")return doe(e,t)}function soe(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=Q$(e,t.tagName,!1),l=poe(e,t);let c=eC(e,t);return roe.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!Mse(d):!0})),V$(e,l,a,t),Jk(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function ooe(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)}Th(e,t.position)}function loe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Th(e,t.position)}function coe(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:Q$(e,t.name,!0),l=moe(e,t),c=eC(e,t);return V$(e,l,a,t),Jk(l,c),e.ancestors.pop(),e.schema=r,e.create(t,a,l,n)}function uoe(e,t,n){const r={};return Jk(r,eC(e,t)),e.create(t,e.Fragment,r,n)}function doe(e,t){return t.value}function V$(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Jk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function foe(e,t,n){return r;function r(i,a,l,c){const f=Array.isArray(l.children)?n:t;return c?f(a,l,c):f(a,l)}}function hoe(e,t){return n;function n(r,i,a,l){const c=Array.isArray(a.children),d=Zk(r);return t(i,a,l,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function poe(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Xk.call(t.properties,i)){const a=goe(e,i,t.properties[i]);if(a){const[l,c]=a;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&ioe.has(t.tagName)?r=c:n[l]=c}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function moe(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 c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Th(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else Th(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function eC(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:toe;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 c=G$(e,a,l);c!==void 0&&n.push(c)}return n}function goe(e,t,n){const r=Fse(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_se(n):Vse(n)),r.property==="style"){let i=typeof n=="object"?n:yoe(e,String(n));return e.stylePropertyNameCase==="css"&&(i=voe(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Bse[r.property]||r.property:r.attribute,n]}}function yoe(e,t){try{return Jse(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new zr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=K$+"#cannot-parse-style-attribute",i}}function Q$(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 c=XT(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}r=l}else r=XT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Xk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Th(e)}function Th(e,t){const n=new zr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=K$+"#cannot-handle-mdx-estrees-without-createevaluater",n}function voe(e){const t={};let n;for(n in e)Xk.call(e,n)&&(t[xoe(n)]=e[n]);return t}function xoe(e){let t=e.replace(noe,boe);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function boe(e){return"-"+e.toLowerCase()}const Yw={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"]},woe={};function Soe(e,t){const n=woe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Y$(e,r,i)}function Y$(e,t,n){if(joe(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 lP(e.children,t,n)}return Array.isArray(e)?lP(e,t,n):""}function lP(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Y$(e[i],t,n);return r.join("")}function joe(e){return!!(e&&typeof e=="object")}const cP=document.createElement("i");function tC(e){const t="&"+e+";";cP.innerHTML=t;const n=cP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ha(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 Hi(e,t){return e.length>0?(Ha(e,e.length,0,t),e):t}const uP={}.hasOwnProperty;function Noe(e){const t={};let n=-1;for(;++n<e.length;)koe(t,e[n]);return t}function koe(e,t){let n;for(n in t){const i=(uP.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let l;if(a)for(l in a){uP.call(i,l)||(i[l]=[]);const c=a[l];Coe(i[l],Array.isArray(c)?c:c?[c]:[])}}}function Coe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ha(e,0,0,r)}function W$(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 Qu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const La=il(/[A-Za-z]/),Ni=il(/[\dA-Za-z]/),Aoe=il(/[#-'*+\--9=?A-Z^-~]/);function E1(e){return e!==null&&(e<32||e===127)}const O1=il(/\d/),Eoe=il(/[\dA-Fa-f]/),Ooe=il(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function ci(e){return e!==null&&(e<0||e===32)}function Lt(e){return e===-2||e===-1||e===32}const zoe=il(new RegExp("\\p{P}|\\p{S}","u")),_oe=il(/\s/);function il(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Cd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let l="";if(a===37&&Ni(e.charCodeAt(n+1))&&Ni(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(l=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(n+1);a<56320&&c>56319&&c<57344?(l=String.fromCharCode(a,c),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 tn(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return l;function l(d){return Lt(d)?(e.enter(n),c(d)):t(d)}function c(d){return Lt(d)&&a++<i?(e.consume(d),c):(e.exit(n),t(d))}}const Toe={tokenize:Poe};function Poe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),tn(e,t,"linePrefix")}function i(c){return e.enter("paragraph"),a(c)}function a(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return st(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),l)}}const Roe={tokenize:Doe},dP={tokenize:Moe};function Doe(e){const t=this,n=[];let r=0,i,a,l;return c;function c(A){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,d,f)(A)}return f(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const C=t.events.length;let _=C,O;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){O=t.events[_][1].end;break}k(r);let z=C;for(;z<t.events.length;)t.events[z][1].end={...O},z++;return Ha(t.events,_+1,0,t.events.slice(C)),t.events.length=z,f(A)}return c(A)}function f(A){if(r===n.length){if(!i)return y(A);if(i.currentConstruct&&i.currentConstruct.concrete)return w(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dP,p,m)(A)}function p(A){return i&&E(),k(r),y(A)}function m(A){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(A)}function y(A){return t.containerState={},e.attempt(dP,v,w)(A)}function v(A){return r++,n.push([t.currentConstruct,t.containerState]),y(A)}function w(A){if(A===null){i&&E(),k(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),b(A)}function b(A){if(A===null){j(e.exit("chunkFlow"),!0),k(0),e.consume(A);return}return st(A)?(e.consume(A),j(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(A),b)}function j(A,C){const _=t.sliceStream(A);if(C&&_.push(null),A.previous=a,a&&(a.next=A),a=A,i.defineSkip(A.start),i.write(_),t.parser.lazy[A.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 z=t.events.length;let R=z,$,F;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if($){F=t.events[R][1].end;break}$=!0}for(k(r),O=z;O<t.events.length;)t.events[O][1].end={...F},O++;Ha(t.events,R+1,0,t.events.slice(z)),t.events.length=O}}function k(A){let C=n.length;for(;C-- >A;){const _=n[C];t.containerState=_[1],_[0].exit.call(t,e)}n.length=A}function E(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Moe(e,t,n){return tn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function fP(e){if(e===null||ci(e)||_oe(e))return 1;if(zoe(e))return 2}function nC(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 z1={name:"attention",resolveAll:Ioe,tokenize:Loe};function Ioe(e,t){let n=-1,r,i,a,l,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};hP(m,-d),hP(y,d),l={type:d>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},a={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:d>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Hi(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Hi(f,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",a,t]]),f=Hi(f,nC(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Hi(f,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Hi(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Ha(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 Loe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=fP(r);let a;return l;function l(d){return a=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===a)return e.consume(d),c;const f=e.exit("attentionSequence"),p=fP(d),m=!p||p===2&&i||n.includes(d),y=!i||i===2&&p||n.includes(r);return f._open=!!(a===42?m:m&&(i||!y)),f._close=!!(a===42?y:y&&(p||!m)),t(d)}}function hP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const $oe={name:"autolink",tokenize:Boe};function Boe(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 La(v)?(e.consume(v),l):v===64?n(v):f(v)}function l(v){return v===43||v===45||v===46||Ni(v)?(r=1,c(v)):f(v)}function c(v){return v===58?(e.consume(v),r=0,d):(v===43||v===45||v===46||Ni(v))&&r++<32?(e.consume(v),c):(r=0,f(v))}function d(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||E1(v)?n(v):(e.consume(v),d)}function f(v){return v===64?(e.consume(v),p):Aoe(v)?(e.consume(v),f):n(v)}function p(v){return Ni(v)?m(v):n(v)}function m(v){return v===46?(e.consume(v),r=0,p):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):y(v)}function y(v){if((v===45||Ni(v))&&r++<63){const w=v===45?y:m;return e.consume(v),w}return n(v)}}const Yv={partial:!0,tokenize:Uoe};function Uoe(e,t,n){return r;function r(a){return Lt(a)?tn(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||st(a)?t(a):n(a)}}const Z$={continuation:{tokenize:Foe},exit:Hoe,name:"blockQuote",tokenize:qoe};function qoe(e,t,n){const r=this;return i;function i(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),a}return n(l)}function a(l){return Lt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function Foe(e,t,n){const r=this;return i;function i(l){return Lt(l)?tn(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):a(l)}function a(l){return e.attempt(Z$,t,n)(l)}}function Hoe(e){e.exit("blockQuote")}const X$={name:"characterEscape",tokenize:Koe};function Koe(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 Ooe(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const J$={name:"characterReference",tokenize:Goe};function Goe(e,t,n){const r=this;let i=0,a,l;return c;function c(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),d}function d(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),a=31,l=Ni,p(m))}function f(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,l=Eoe,p):(e.enter("characterReferenceValue"),a=7,l=O1,p(m))}function p(m){if(m===59&&i){const y=e.exit("characterReferenceValue");return l===Ni&&!tC(r.sliceSerialize(y))?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 pP={partial:!0,tokenize:Qoe},mP={concrete:!0,name:"codeFenced",tokenize:Voe};function Voe(e,t,n){const r=this,i={partial:!0,tokenize:_};let a=0,l=0,c;return d;function d(O){return f(O)}function f(O){const z=r.events[r.events.length-1];return a=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,c=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(O)}function p(O){return O===c?(l++,e.consume(O),p):l<3?n(O):(e.exit("codeFencedFenceSequence"),Lt(O)?tn(e,m,"whitespace")(O):m(O))}function m(O){return O===null||st(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(pP,b,C)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(O))}function y(O){return O===null||st(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(O)):Lt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),tn(e,v,"whitespace")(O)):O===96&&O===c?n(O):(e.consume(O),y)}function v(O){return O===null||st(O)?m(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(O))}function w(O){return O===null||st(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(O)):O===96&&O===c?n(O):(e.consume(O),w)}function b(O){return e.attempt(i,C,j)(O)}function j(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),k}function k(O){return a>0&&Lt(O)?tn(e,E,"linePrefix",a+1)(O):E(O)}function E(O){return O===null||st(O)?e.check(pP,b,C)(O):(e.enter("codeFlowValue"),A(O))}function A(O){return O===null||st(O)?(e.exit("codeFlowValue"),E(O)):(e.consume(O),A)}function C(O){return e.exit("codeFenced"),t(O)}function _(O,z,R){let $=0;return F;function F(Y){return O.enter("lineEnding"),O.consume(Y),O.exit("lineEnding"),M}function M(Y){return O.enter("codeFencedFence"),Lt(Y)?tn(O,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):U(Y)}function U(Y){return Y===c?(O.enter("codeFencedFenceSequence"),K(Y)):R(Y)}function K(Y){return Y===c?($++,O.consume(Y),K):$>=l?(O.exit("codeFencedFenceSequence"),Lt(Y)?tn(O,Z,"whitespace")(Y):Z(Y)):R(Y)}function Z(Y){return Y===null||st(Y)?(O.exit("codeFencedFence"),z(Y)):R(Y)}}}function Qoe(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 Ww={name:"codeIndented",tokenize:Woe},Yoe={partial:!0,tokenize:Zoe};function Woe(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),tn(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):st(f)?e.attempt(Yoe,l,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||st(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function Zoe(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):st(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):tn(e,a,"linePrefix",5)(l)}function a(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):st(l)?i(l):n(l)}}const Xoe={name:"codeText",previous:ele,resolve:Joe,tokenize:tle};function Joe(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 ele(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tle(e,t,n){let r=0,i,a;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),c(m)}function c(m){return m===96?(e.consume(m),r++,c):(e.exit("codeTextSequence"),d(m))}function d(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),d):m===96?(a=e.enter("codeTextSequence"),i=0,p(m)):st(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||st(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 nle{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&&qf(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),qf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),qf(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);qf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);qf(this.left,n.reverse())}}}function qf(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 eB(e){const t={};let n=-1,r,i,a,l,c,d,f;const p=new nle(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,rle(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},c=p.slice(i,n),c.unshift(r),p.splice(i,n-i+1,c))}}return Ha(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function rle(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 c=l.events,d=[],f={};let p,m,y=-1,v=n,w=0,b=0;const j=[b];for(;v;){for(;e.get(++i)[1]!==v;);a.push(i),v._tokenizer||(p=r.sliceStream(v),v.next||p.push(null),m&&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;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(b=y+1,j.push(b),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(l.events=[],v?(v._tokenizer=void 0,v.previous=void 0):j.pop(),y=j.length;y--;){const k=c.slice(j[y],j[y+1]),E=a.pop();d.push([E,E+k.length-1]),e.splice(E,2,k)}for(d.reverse(),y=-1;++y<d.length;)f[w+d[y][0]]=w+d[y][1],w+=d[y][1]-d[y][0]-1;return f}const ile={resolve:sle,tokenize:ole},ale={partial:!0,tokenize:lle};function sle(e){return eB(e),e}function ole(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(c)}function i(c){return c===null?a(c):st(c)?e.check(ale,l,a)(c):(e.consume(c),i)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function lle(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),tn(e,a,"linePrefix")}function a(l){if(l===null||st(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function tB(e,t,n,r,i,a,l,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return m;function m(k){return k===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(k),e.exit(a),y):k===null||k===32||k===41||E1(k)?n(k):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),b(k))}function y(k){return k===62?(e.enter(a),e.consume(k),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===62?(e.exit("chunkString"),e.exit(c),y(k)):k===null||k===60||st(k)?n(k):(e.consume(k),k===92?w:v)}function w(k){return k===60||k===62||k===92?(e.consume(k),v):v(k)}function b(k){return!p&&(k===null||k===41||ci(k))?(e.exit("chunkString"),e.exit(c),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||E1(k)?n(k):(e.consume(k),k===92?j:b)}function j(k){return k===40||k===41||k===92?(e.consume(k),b):b(k)}}function nB(e,t,n,r,i,a){const l=this;let c=0,d;return f;function f(v){return e.enter(r),e.enter(i),e.consume(v),e.exit(i),e.enter(a),p}function p(v){return c>999||v===null||v===91||v===93&&!d||v===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(v):v===93?(e.exit(a),e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):st(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||st(v)||c++>999?(e.exit("chunkString"),p(v)):(e.consume(v),d||(d=!Lt(v)),v===92?y:m)}function y(v){return v===91||v===92||v===93?(e.consume(v),c++,m):m(v)}}function rB(e,t,n,r,i,a){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),l=y===40?41:y,d):n(y)}function d(y){return y===l?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(a),f(y))}function f(y){return y===l?(e.exit(a),d(l)):y===null?n(y):st(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),tn(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===l||y===null||st(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?m:p)}function m(y){return y===l||y===92?(e.consume(y),p):p(y)}}function hh(e,t){let n;return r;function r(i){return st(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Lt(i)?tn(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const cle={name:"definition",tokenize:dle},ule={partial:!0,tokenize:fle};function dle(e,t,n){const r=this;let i;return a;function a(v){return e.enter("definition"),l(v)}function l(v){return nB.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function c(v){return i=Qu(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 ci(v)?hh(e,f)(v):f(v)}function f(v){return tB(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function p(v){return e.attempt(ule,m,m)(v)}function m(v){return Lt(v)?tn(e,y,"whitespace")(v):y(v)}function y(v){return v===null||st(v)?(e.exit("definition"),r.parser.defined.push(i),t(v)):n(v)}}function fle(e,t,n){return r;function r(c){return ci(c)?hh(e,i)(c):n(c)}function i(c){return rB(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Lt(c)?tn(e,l,"whitespace")(c):l(c)}function l(c){return c===null||st(c)?t(c):n(c)}}const hle={name:"hardBreakEscape",tokenize:ple};function ple(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return st(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const mle={name:"headingAtx",resolve:gle,tokenize:yle};function gle(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"},Ha(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function yle(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||ci(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||st(p)?(e.exit("atxHeading"),t(p)):Lt(p)?tn(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||ci(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const vle=["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"],gP=["pre","script","style","textarea"],xle={concrete:!0,name:"htmlFlow",resolveTo:Sle,tokenize:jle},ble={partial:!0,tokenize:kle},wle={partial:!0,tokenize:Nle};function Sle(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 jle(e,t,n){const r=this;let i,a,l,c,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),y):D===47?(e.consume(D),a=!0,b):D===63?(e.consume(D),i=3,r.interrupt?t:L):La(D)?(e.consume(D),l=String.fromCharCode(D),j):n(D)}function y(D){return D===45?(e.consume(D),i=2,v):D===91?(e.consume(D),i=5,c=0,w):La(D)?(e.consume(D),i=4,r.interrupt?t:L):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:L):n(D)}function w(D){const V="CDATA[";return D===V.charCodeAt(c++)?(e.consume(D),c===V.length?r.interrupt?t:U:w):n(D)}function b(D){return La(D)?(e.consume(D),l=String.fromCharCode(D),j):n(D)}function j(D){if(D===null||D===47||D===62||ci(D)){const V=D===47,re=l.toLowerCase();return!V&&!a&&gP.includes(re)?(i=1,r.interrupt?t(D):U(D)):vle.includes(l.toLowerCase())?(i=6,V?(e.consume(D),k):r.interrupt?t(D):U(D)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):a?E(D):A(D))}return D===45||Ni(D)?(e.consume(D),l+=String.fromCharCode(D),j):n(D)}function k(D){return D===62?(e.consume(D),r.interrupt?t:U):n(D)}function E(D){return Lt(D)?(e.consume(D),E):F(D)}function A(D){return D===47?(e.consume(D),F):D===58||D===95||La(D)?(e.consume(D),C):Lt(D)?(e.consume(D),A):F(D)}function C(D){return D===45||D===46||D===58||D===95||Ni(D)?(e.consume(D),C):_(D)}function _(D){return D===61?(e.consume(D),O):Lt(D)?(e.consume(D),_):A(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,z):Lt(D)?(e.consume(D),O):R(D)}function z(D){return D===d?(e.consume(D),d=null,$):D===null||st(D)?n(D):(e.consume(D),z)}function R(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||ci(D)?_(D):(e.consume(D),R)}function $(D){return D===47||D===62||Lt(D)?A(D):n(D)}function F(D){return D===62?(e.consume(D),M):n(D)}function M(D){return D===null||st(D)?U(D):Lt(D)?(e.consume(D),M):n(D)}function U(D){return D===45&&i===2?(e.consume(D),H):D===60&&i===1?(e.consume(D),X):D===62&&i===4?(e.consume(D),q):D===63&&i===3?(e.consume(D),L):D===93&&i===5?(e.consume(D),xe):st(D)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ble,I,K)(D)):D===null||st(D)?(e.exit("htmlFlowData"),K(D)):(e.consume(D),U)}function K(D){return e.check(wle,Z,I)(D)}function Z(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Y}function Y(D){return D===null||st(D)?K(D):(e.enter("htmlFlowData"),U(D))}function H(D){return D===45?(e.consume(D),L):U(D)}function X(D){return D===47?(e.consume(D),l="",ue):U(D)}function ue(D){if(D===62){const V=l.toLowerCase();return gP.includes(V)?(e.consume(D),q):U(D)}return La(D)&&l.length<8?(e.consume(D),l+=String.fromCharCode(D),ue):U(D)}function xe(D){return D===93?(e.consume(D),L):U(D)}function L(D){return D===62?(e.consume(D),q):D===45&&i===2?(e.consume(D),L):U(D)}function q(D){return D===null||st(D)?(e.exit("htmlFlowData"),I(D)):(e.consume(D),q)}function I(D){return e.exit("htmlFlow"),t(D)}}function Nle(e,t,n){const r=this;return i;function i(l){return st(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 kle(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Yv,t,n)}}const Cle={name:"htmlText",tokenize:Ale};function Ale(e,t,n){const r=this;let i,a,l;return c;function c(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),f):L===47?(e.consume(L),_):L===63?(e.consume(L),A):La(L)?(e.consume(L),R):n(L)}function f(L){return L===45?(e.consume(L),p):L===91?(e.consume(L),a=0,w):La(L)?(e.consume(L),E):n(L)}function p(L){return L===45?(e.consume(L),v):n(L)}function m(L){return L===null?n(L):L===45?(e.consume(L),y):st(L)?(l=m,X(L)):(e.consume(L),m)}function y(L){return L===45?(e.consume(L),v):m(L)}function v(L){return L===62?H(L):L===45?y(L):m(L)}function w(L){const q="CDATA[";return L===q.charCodeAt(a++)?(e.consume(L),a===q.length?b:w):n(L)}function b(L){return L===null?n(L):L===93?(e.consume(L),j):st(L)?(l=b,X(L)):(e.consume(L),b)}function j(L){return L===93?(e.consume(L),k):b(L)}function k(L){return L===62?H(L):L===93?(e.consume(L),k):b(L)}function E(L){return L===null||L===62?H(L):st(L)?(l=E,X(L)):(e.consume(L),E)}function A(L){return L===null?n(L):L===63?(e.consume(L),C):st(L)?(l=A,X(L)):(e.consume(L),A)}function C(L){return L===62?H(L):A(L)}function _(L){return La(L)?(e.consume(L),O):n(L)}function O(L){return L===45||Ni(L)?(e.consume(L),O):z(L)}function z(L){return st(L)?(l=z,X(L)):Lt(L)?(e.consume(L),z):H(L)}function R(L){return L===45||Ni(L)?(e.consume(L),R):L===47||L===62||ci(L)?$(L):n(L)}function $(L){return L===47?(e.consume(L),H):L===58||L===95||La(L)?(e.consume(L),F):st(L)?(l=$,X(L)):Lt(L)?(e.consume(L),$):H(L)}function F(L){return L===45||L===46||L===58||L===95||Ni(L)?(e.consume(L),F):M(L)}function M(L){return L===61?(e.consume(L),U):st(L)?(l=M,X(L)):Lt(L)?(e.consume(L),M):$(L)}function U(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),i=L,K):st(L)?(l=U,X(L)):Lt(L)?(e.consume(L),U):(e.consume(L),Z)}function K(L){return L===i?(e.consume(L),i=void 0,Y):L===null?n(L):st(L)?(l=K,X(L)):(e.consume(L),K)}function Z(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||ci(L)?$(L):(e.consume(L),Z)}function Y(L){return L===47||L===62||ci(L)?$(L):n(L)}function H(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function X(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),ue}function ue(L){return Lt(L)?tn(e,xe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):xe(L)}function xe(L){return e.enter("htmlTextData"),l(L)}}const rC={name:"labelEnd",resolveAll:_le,resolveTo:Tle,tokenize:Ple},Ele={tokenize:Rle},Ole={tokenize:Dle},zle={tokenize:Mle};function _le(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&&Ha(e,0,e.length,n),e}function Tle(e,t){let n=e.length,r=0,i,a,l,c;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(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 c=[["enter",d,t],["enter",f,t]],c=Hi(c,e.slice(a+1,a+r+3)),c=Hi(c,[["enter",p,t]]),c=Hi(c,nC(t.parser.constructs.insideSpan.null,e.slice(a+r+4,l-3),t)),c=Hi(c,[["exit",p,t],e[l-2],e[l-1],["exit",f,t]]),c=Hi(c,e.slice(l+1)),c=Hi(c,[["exit",d,t]]),Ha(e,a,e.length,c),e}function Ple(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 c;function c(y){return a?a._inactive?m(y):(l=r.parser.defined.includes(Qu(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(Ele,p,l?p:m)(y):y===91?e.attempt(Ole,p,l?f:m)(y):l?p(y):m(y)}function f(y){return e.attempt(zle,p,m)(y)}function p(y){return t(y)}function m(y){return a._balanced=!0,n(y)}}function Rle(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 ci(m)?hh(e,a)(m):a(m)}function a(m){return m===41?p(m):tB(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return ci(m)?hh(e,d)(m):p(m)}function c(m){return n(m)}function d(m){return m===34||m===39||m===40?rB(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):p(m)}function f(m){return ci(m)?hh(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 Dle(e,t,n){const r=this;return i;function i(c){return nB.call(r,e,a,l,"reference","referenceMarker","referenceString")(c)}function a(c){return r.parser.defined.includes(Qu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function Mle(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 Ile={name:"labelStartImage",resolveAll:rC.resolveAll,tokenize:Lle};function Lle(e,t,n){const r=this;return i;function i(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const $le={name:"labelStartLink",resolveAll:rC.resolveAll,tokenize:Ble};function Ble(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 Zw={name:"lineEnding",tokenize:Ule};function Ule(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),tn(e,t,"linePrefix")}}const $g={name:"thematicBreak",tokenize:qle};function qle(e,t,n){let r=0,i;return a;function a(f){return e.enter("thematicBreak"),l(f)}function l(f){return i=f,c(f)}function c(f){return f===i?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||st(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Lt(f)?tn(e,c,"whitespace")(f):c(f))}}const ri={continuation:{tokenize:Gle},exit:Qle,name:"list",tokenize:Kle},Fle={partial:!0,tokenize:Yle},Hle={partial:!0,tokenize:Vle};function Kle(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 c;function c(v){const w=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:O1(v)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check($g,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 O1(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(Yv,r.interrupt?n:p,e.attempt(Fle,y,m))}function p(v){return r.containerState.initialBlankLine=!0,a++,y(v)}function m(v){return Lt(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),y):n(v)}function y(v){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function Gle(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Yv,i,a);function i(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,tn(e,t,"listItemIndent",r.containerState.size+1)(c)}function a(c){return r.containerState.furtherBlankLines||!Lt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Hle,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,tn(e,e.attempt(ri,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function Vle(e,t,n){const r=this;return tn(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 Qle(e){e.exit(this.containerState.type)}function Yle(e,t,n){const r=this;return tn(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!Lt(a)&&l&&l[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const yP={name:"setextUnderline",resolveTo:Wle,tokenize:Zle};function Wle(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 Zle(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"),c(f)}function c(f){return f===i?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Lt(f)?tn(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||st(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const Xle={tokenize:Jle};function Jle(e){const t=this,n=e.attempt(Yv,r,e.attempt(this.parser.constructs.flowInitial,i,tn(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ile,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 ece={resolveAll:aB()},tce=iB("string"),nce=iB("text");function iB(e){return{resolveAll:aB(e==="text"?rce:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,l,c);return l;function l(p){return f(p)?a(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const m=i[p];let y=-1;if(m)for(;++y<m.length;){const v=m[y];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function aB(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 rce(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,c=0,d;for(;a--;){const f=i[a];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(f===-2)d=!0,c++;else if(f!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?l:r.start._bufferIndex+l,_index:r.start._index+a,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const ice={42:ri,43:ri,45:ri,48:ri,49:ri,50:ri,51:ri,52:ri,53:ri,54:ri,55:ri,56:ri,57:ri,62:Z$},ace={91:cle},sce={[-2]:Ww,[-1]:Ww,32:Ww},oce={35:mle,42:$g,45:[yP,$g],60:xle,61:yP,95:$g,96:mP,126:mP},lce={38:J$,92:X$},cce={[-5]:Zw,[-4]:Zw,[-3]:Zw,33:Ile,38:J$,42:z1,60:[$oe,Cle],91:$le,92:[hle,X$],93:rC,95:z1,96:Xoe},uce={null:[z1,ece]},dce={null:[42,95]},fce={null:[]},hce=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dce,contentInitial:ace,disable:fce,document:ice,flow:oce,flowInitial:sce,insideSpan:uce,string:lce,text:cce},Symbol.toStringTag,{value:"Module"}));function pce(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=[],c=[];const d={attempt:z(_),check:z(O),consume:E,enter:A,exit:C,interrupt:z(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:b,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:v,write:m};let p=t.tokenize.call(f,d);return t.resolveAll&&a.push(t),f;function m(M){return l=Hi(l,M),j(),l[l.length-1]!==null?[]:(R(t,0),f.events=nC(a,f.events,f),f.events)}function y(M,U){return gce(v(M),U)}function v(M){return mce(l,M)}function w(){const{_bufferIndex:M,_index:U,line:K,column:Z,offset:Y}=r;return{_bufferIndex:M,_index:U,line:K,column:Z,offset:Y}}function b(M){i[M.line]=M.column,F()}function j(){let M;for(;r._index<l.length;){const U=l[r._index];if(typeof U=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<U.length;)k(U.charCodeAt(r._bufferIndex));else k(U)}}function k(M){p=p(M)}function E(M){st(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,F()):M!==-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=M}function A(M,U){const K=U||{};return K.type=M,K.start=w(),f.events.push(["enter",K,f]),c.push(K),K}function C(M){const U=c.pop();return U.end=w(),f.events.push(["exit",U,f]),U}function _(M,U){R(M,U.from)}function O(M,U){U.restore()}function z(M,U){return K;function K(Z,Y,H){let X,ue,xe,L;return Array.isArray(Z)?I(Z):"tokenize"in Z?I([Z]):q(Z);function q(ee){return Ee;function Ee(Te){const ne=Te!==null&&ee[Te],he=Te!==null&&ee.null,je=[...Array.isArray(ne)?ne:ne?[ne]:[],...Array.isArray(he)?he:he?[he]:[]];return I(je)(Te)}}function I(ee){return X=ee,ue=0,ee.length===0?H:D(ee[ue])}function D(ee){return Ee;function Ee(Te){return L=$(),xe=ee,ee.partial||(f.currentConstruct=ee),ee.name&&f.parser.constructs.disable.null.includes(ee.name)?re():ee.tokenize.call(U?Object.assign(Object.create(f),U):f,d,V,re)(Te)}}function V(ee){return M(xe,L),Y}function re(ee){return L.restore(),++ue<X.length?D(X[ue]):H}}}function R(M,U){M.resolveAll&&!a.includes(M)&&a.push(M),M.resolve&&Ha(f.events,U,f.events.length-U,M.resolve(f.events.slice(U),f)),M.resolveTo&&(f.events=M.resolveTo(f.events,f))}function $(){const M=w(),U=f.previous,K=f.currentConstruct,Z=f.events.length,Y=Array.from(c);return{from:Z,restore:H};function H(){r=M,f.previous=U,f.currentConstruct=K,f.events.length=Z,c=Y,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function mce(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 c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}a>0&&l.push(e[i].slice(0,a))}return l}function gce(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 yce(e){const r={constructs:Noe([hce,...(e||{}).extensions||[]]),content:i(Toe),defined:[],document:i(Roe),flow:i(Xle),lazy:{},string:i(tce),text:i(nce)};return r;function i(a){return l;function l(c){return pce(r,a,c)}}}function vce(e){for(;!eB(e););return e}const vP=/[\0\t\n\r]/g;function xce(){let e=1,t="",n=!0,r;return i;function i(a,l,c){const d=[];let f,p,m,y,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(vP.lastIndex=m,f=vP.exec(a),y=f&&f.index!==void 0?f.index:a.length,v=a.charCodeAt(y),!f){t=a.slice(m);break}if(v===10&&m===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),m<y&&(d.push(a.slice(m,y)),e+=y-m),v){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const bce=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function wce(e){return e.replace(bce,Sce)}function Sce(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return W$(n.slice(a?2:1),a?16:10)}return tC(n)||e}const sB={}.hasOwnProperty;function jce(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Nce(n)(vce(yce(n).document().write(xce()(e,t,!0))))}function Nce(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Re),autolinkProtocol:$,autolinkEmail:$,atxHeading:a(Ze),blockQuote:a(he),characterEscape:$,characterReference:$,codeFenced:a(je),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:a(je,l),codeText:a(me,l),codeTextData:$,data:$,codeFlowValue:$,definition:a(tt),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:a(Ie),hardBreakEscape:a(nt),hardBreakTrailing:a(nt),htmlFlow:a(Wt,l),htmlFlowData:$,htmlText:a(Wt,l),htmlTextData:$,image:a(Se),label:l,link:a(Re),listItem:a(cn),listItemValue:y,listOrdered:a(Bt,m),listUnordered:a(Bt),paragraph:a(un),reference:D,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:a(Ze),strong:a(Rr),thematicBreak:a(vt)},exit:{atxHeading:d(),atxHeadingSequence:_,autolink:d(),autolinkEmail:ne,autolinkProtocol:Te,blockQuote:d(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:ee,characterReference:Ee,codeFenced:d(j),codeFencedFence:b,codeFencedFenceInfo:v,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:d(k),codeText:d(Y),codeTextData:F,data:F,definition:d(),definitionDestinationString:C,definitionLabelString:E,definitionTitleString:A,emphasis:d(),hardBreakEscape:d(U),hardBreakTrailing:d(U),htmlFlow:d(K),htmlFlowData:F,htmlText:d(Z),htmlTextData:F,image:d(X),label:xe,labelText:ue,lineEnding:M,link:d(H),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:V,resourceDestinationString:L,resourceTitleString:q,resource:I,setextHeading:d(R),setextHeadingLineSequence:z,setextHeadingText:O,strong:d(),thematicBreak:d()}};oB(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(de){let Ne={type:"root",children:[]};const Ue={stack:[Ne],tokenStack:[],config:t,enter:c,exit:f,buffer:l,resume:p,data:n},it=[];let lt=-1;for(;++lt<de.length;)if(de[lt][1].type==="listOrdered"||de[lt][1].type==="listUnordered")if(de[lt][0]==="enter")it.push(lt);else{const mn=it.pop();lt=i(de,mn,lt)}for(lt=-1;++lt<de.length;){const mn=t[de[lt][0]];sB.call(mn,de[lt][1].type)&&mn[de[lt][1].type].call(Object.assign({sliceSerialize:de[lt][2].sliceSerialize},Ue),de[lt][1])}if(Ue.tokenStack.length>0){const mn=Ue.tokenStack[Ue.tokenStack.length-1];(mn[1]||xP).call(Ue,void 0,mn[0])}for(Ne.position={start:No(de.length>0?de[0][1].start:{line:1,column:1,offset:0}),end:No(de.length>0?de[de.length-2][1].end:{line:1,column:1,offset:0})},lt=-1;++lt<t.transforms.length;)Ne=t.transforms[lt](Ne)||Ne;return Ne}function i(de,Ne,Ue){let it=Ne-1,lt=-1,mn=!1,Kn,ae,Fe,Qe;for(;++it<=Ue;){const rt=de[it];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?lt++:lt--,Qe=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(Kn&&!Qe&&!lt&&!Fe&&(Fe=it),Qe=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qe=void 0}if(!lt&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||lt===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(Kn){let pt=it;for(ae=void 0;pt--;){const wn=de[pt];if(wn[1].type==="lineEnding"||wn[1].type==="lineEndingBlank"){if(wn[0]==="exit")continue;ae&&(de[ae][1].type="lineEndingBlank",mn=!0),wn[1].type="lineEnding",ae=pt}else if(!(wn[1].type==="linePrefix"||wn[1].type==="blockQuotePrefix"||wn[1].type==="blockQuotePrefixWhitespace"||wn[1].type==="blockQuoteMarker"||wn[1].type==="listItemIndent"))break}Fe&&(!ae||Fe<ae)&&(Kn._spread=!0),Kn.end=Object.assign({},ae?de[ae][1].start:rt[1].end),de.splice(ae||it,0,["exit",Kn,rt[2]]),it++,Ue++}if(rt[1].type==="listItemPrefix"){const pt={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};Kn=pt,de.splice(it,0,["enter",pt,rt[2]]),it++,Ue++,Fe=void 0,Qe=!0}}}return de[Ne][1]._spread=mn,Ue}function a(de,Ne){return Ue;function Ue(it){c.call(this,de(it),it),Ne&&Ne.call(this,it)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(de,Ne,Ue){this.stack[this.stack.length-1].children.push(de),this.stack.push(de),this.tokenStack.push([Ne,Ue||void 0]),de.position={start:No(Ne.start),end:void 0}}function d(de){return Ne;function Ne(Ue){de&&de.call(this,Ue),f.call(this,Ue)}}function f(de,Ne){const Ue=this.stack.pop(),it=this.tokenStack.pop();if(it)it[0].type!==de.type&&(Ne?Ne.call(this,de,it[0]):(it[1]||xP).call(this,de,it[0]));else throw new Error("Cannot close `"+de.type+"` ("+fh({start:de.start,end:de.end})+"): it’s not open");Ue.position.end=No(de.end)}function p(){return Soe(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(de){if(this.data.expectingFirstListItemValue){const Ne=this.stack[this.stack.length-2];Ne.start=Number.parseInt(this.sliceSerialize(de),10),this.data.expectingFirstListItemValue=void 0}}function v(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.lang=de}function w(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.meta=de}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=de.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=de.replace(/(\r?\n|\r)$/g,"")}function E(de){const Ne=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=Ne,Ue.identifier=Qu(this.sliceSerialize(de)).toLowerCase()}function A(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=de}function C(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=de}function _(de){const Ne=this.stack[this.stack.length-1];if(!Ne.depth){const Ue=this.sliceSerialize(de).length;Ne.depth=Ue}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function z(de){const Ne=this.stack[this.stack.length-1];Ne.depth=this.sliceSerialize(de).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function $(de){const Ue=this.stack[this.stack.length-1].children;let it=Ue[Ue.length-1];(!it||it.type!=="text")&&(it=Kt(),it.position={start:No(de.start),end:void 0},Ue.push(it)),this.stack.push(it)}function F(de){const Ne=this.stack.pop();Ne.value+=this.sliceSerialize(de),Ne.position.end=No(de.end)}function M(de){const Ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=Ne.children[Ne.children.length-1];Ue.position.end=No(de.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ne.type)&&($.call(this,de),F.call(this,de))}function U(){this.data.atHardBreak=!0}function K(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=de}function Z(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=de}function Y(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.value=de}function H(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ne,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function X(){const de=this.stack[this.stack.length-1];if(this.data.inReference){const Ne=this.data.referenceType||"shortcut";de.type+="Reference",de.referenceType=Ne,delete de.url,delete de.title}else delete de.identifier,delete de.label;this.data.referenceType=void 0}function ue(de){const Ne=this.sliceSerialize(de),Ue=this.stack[this.stack.length-2];Ue.label=wce(Ne),Ue.identifier=Qu(Ne).toLowerCase()}function xe(){const de=this.stack[this.stack.length-1],Ne=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const it=de.children;Ue.children=it}else Ue.alt=Ne}function L(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.url=de}function q(){const de=this.resume(),Ne=this.stack[this.stack.length-1];Ne.title=de}function I(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function V(de){const Ne=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=Ne,Ue.identifier=Qu(this.sliceSerialize(de)).toLowerCase(),this.data.referenceType="full"}function re(de){this.data.characterReferenceType=de.type}function ee(de){const Ne=this.sliceSerialize(de),Ue=this.data.characterReferenceType;let it;Ue?(it=W$(Ne,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):it=tC(Ne);const lt=this.stack[this.stack.length-1];lt.value+=it}function Ee(de){const Ne=this.stack.pop();Ne.position.end=No(de.end)}function Te(de){F.call(this,de);const Ne=this.stack[this.stack.length-1];Ne.url=this.sliceSerialize(de)}function ne(de){F.call(this,de);const Ne=this.stack[this.stack.length-1];Ne.url="mailto:"+this.sliceSerialize(de)}function he(){return{type:"blockquote",children:[]}}function je(){return{type:"code",lang:null,meta:null,value:""}}function me(){return{type:"inlineCode",value:""}}function tt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function Ze(){return{type:"heading",depth:0,children:[]}}function nt(){return{type:"break"}}function Wt(){return{type:"html",value:""}}function Se(){return{type:"image",title:null,url:"",alt:null}}function Re(){return{type:"link",title:null,url:"",children:[]}}function Bt(de){return{type:"list",ordered:de.type==="listOrdered",start:null,spread:de._spread,children:[]}}function cn(de){return{type:"listItem",spread:de._spread,checked:null,children:[]}}function un(){return{type:"paragraph",children:[]}}function Rr(){return{type:"strong",children:[]}}function Kt(){return{type:"text",value:""}}function vt(){return{type:"thematicBreak"}}}function No(e){return{line:e.line,column:e.column,offset:e.offset}}function oB(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?oB(e,r):kce(e,r)}}function kce(e,t){let n;for(n in t)if(sB.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 xP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+fh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+fh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+fh({start:t.start,end:t.end})+") is still open")}function Cce(e){const t=this;t.parser=n;function n(r){return jce(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Ace(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 Ece(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
101
|
+
`}]}function Oce(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 zce(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function _ce(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tce(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Cd(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=a+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Pce(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 Rce(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function lB(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 Dce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lB(e,t);const i={src:Cd(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 Mce(e,t){const n={src:Cd(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 Ice(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 Lce(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return lB(e,t);const i={href:Cd(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 $ce(e,t){const n={href:Cd(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 Bce(e,t,n){const r=e.all(t),i=n?Uce(n):cB(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 c=-1;for(;++c<r.length;){const p=r[c];(i||c!==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 Uce(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=cB(n[r])}return t}function cB(e){const t=e.spread;return t??e.children.length>1}function qce(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 Fce(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hce(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Kce(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Gce(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)},c=Zk(t.children[1]),d=F$(t.children[t.children.length-1]);c&&d&&(l.position={start:c,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 Vce(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,c=l?l.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const m=t.children[d],y={},v=l?l[d]:void 0;v&&(y.align=v);let w={type:"element",tagName:a,properties:y,children:[]};m&&(w.children=e.all(m),e.patch(m,w),w=e.applyData(m,w)),f.push(w)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function Qce(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const bP=9,wP=32;function Yce(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(SP(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(SP(t.slice(i),i>0,!1)),a.join("")}function SP(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===bP||a===wP;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===bP||a===wP;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Wce(e,t){const n={type:"text",value:Yce(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Zce(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Xce={blockquote:Ace,break:Ece,code:Oce,delete:zce,emphasis:_ce,footnoteReference:Tce,heading:Pce,html:Rce,imageReference:Dce,image:Mce,inlineCode:Ice,linkReference:Lce,link:$ce,listItem:Bce,list:qce,paragraph:Fce,root:Hce,strong:Kce,table:Gce,tableCell:Qce,tableRow:Vce,text:Wce,thematicBreak:Zce,toml:Xm,yaml:Xm,definition:Xm,footnoteDefinition:Xm};function Xm(){}const uB=-1,Wv=0,ph=1,xy=2,iC=3,aC=4,sC=5,oC=6,dB=7,fB=8,jP=typeof self=="object"?self:globalThis,Jce=(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 Wv:case uB:return n(l,i);case ph:{const c=n([],i);for(const d of l)c.push(r(d));return c}case xy:{const c=n({},i);for(const[d,f]of l)c[r(d)]=r(f);return c}case iC:return n(new Date(l),i);case aC:{const{source:c,flags:d}=l;return n(new RegExp(c,d),i)}case sC:{const c=n(new Map,i);for(const[d,f]of l)c.set(r(d),r(f));return c}case oC:{const c=n(new Set,i);for(const d of l)c.add(r(d));return c}case dB:{const{name:c,message:d}=l;return n(new jP[c](d),i)}case fB: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:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(new jP[a](l),i)};return r},NP=e=>Jce(new Map,e)(0),wu="",{toString:eue}={},{keys:tue}=Object,Ff=e=>{const t=typeof e;if(t!=="object"||!e)return[Wv,t];const n=eue.call(e).slice(8,-1);switch(n){case"Array":return[ph,wu];case"Object":return[xy,wu];case"Date":return[iC,wu];case"RegExp":return[aC,wu];case"Map":return[sC,wu];case"Set":return[oC,wu];case"DataView":return[ph,n]}return n.includes("Array")?[ph,n]:n.includes("Error")?[dB,n]:[xy,n]},Jm=([e,t])=>e===Wv&&(t==="function"||t==="symbol"),nue=(e,t,n,r)=>{const i=(l,c)=>{const d=r.push(l)-1;return n.set(c,d),d},a=l=>{if(n.has(l))return n.get(l);let[c,d]=Ff(l);switch(c){case Wv:{let p=l;switch(d){case"bigint":c=fB,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return i([uB],l)}return i([c,p],l)}case ph:{if(d){let y=l;return d==="DataView"?y=new Uint8Array(l.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(l)),i([d,[...y]],l)}const p=[],m=i([c,p],l);for(const y of l)p.push(a(y));return m}case xy:{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([c,p],l);for(const y of tue(l))(e||!Jm(Ff(l[y])))&&p.push([a(y),a(l[y])]);return m}case iC:return i([c,l.toISOString()],l);case aC:{const{source:p,flags:m}=l;return i([c,{source:p,flags:m}],l)}case sC:{const p=[],m=i([c,p],l);for(const[y,v]of l)(e||!(Jm(Ff(y))||Jm(Ff(v))))&&p.push([a(y),a(v)]);return m}case oC:{const p=[],m=i([c,p],l);for(const y of l)(e||!Jm(Ff(y)))&&p.push(a(y));return m}}const{message:f}=l;return i([c,{name:d,message:f}],l)};return a},kP=(e,{json:t,lossy:n}={})=>{const r=[];return nue(!(t||n),!!t,new Map,r)(e),r},by=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?NP(kP(e,t)):structuredClone(e):(e,t)=>NP(kP(e,t));function rue(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 iue(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aue(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rue,r=e.options.footnoteBackLabel||iue,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),m=String(f.identifier).toUpperCase(),y=Cd(m.toLowerCase());let v=0;const w=[],b=e.footnoteCounts.get(m);for(;b!==void 0&&++v<=b;){w.length>0&&w.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,v);typeof E=="string"&&(E={type:"text",value:E}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const j=p[p.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const E=j.children[j.children.length-1];E&&E.type==="text"?E.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...w)}else p.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...by(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
105
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
106
|
+
`}]}}const hB=(function(e){if(e==null)return cue;if(typeof e=="function")return Zv(e);if(typeof e=="object")return Array.isArray(e)?sue(e):oue(e);if(typeof e=="string")return lue(e);throw new Error("Expected function, string, or object as test")});function sue(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=hB(e[n]);return Zv(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function oue(e){const t=e;return Zv(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function lue(e){return Zv(t);function t(n){return n&&n.type===e}}function Zv(e){return t;function t(n,r,i){return!!(uue(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function cue(){return!0}function uue(e){return e!==null&&typeof e=="object"&&"type"in e}const pB=[],due=!0,CP=!1,fue="skip";function hue(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=hB(i),l=r?-1:1;c(e,void 0,[])();function c(d,f,p){const m=d&&typeof d=="object"?d:{};if(typeof m.type=="string"){const v=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(v?"<"+v+">":""))+")"})}return y;function y(){let v=pB,w,b,j;if((!t||a(d,f,p[p.length-1]||void 0))&&(v=pue(n(d,p)),v[0]===CP))return v;if("children"in d&&d.children){const k=d;if(k.children&&v[0]!==fue)for(b=(r?k.children.length:-1)+l,j=p.concat(k);b>-1&&b<k.children.length;){const E=k.children[b];if(w=c(E,b,j)(),w[0]===CP)return w;b=typeof w[1]=="number"?w[1]:b+l}}return v}}}function pue(e){return Array.isArray(e)?e:typeof e=="number"?[due,e]:e==null?pB:[e]}function mB(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),hue(e,a,c,i);function c(d,f){const p=f[f.length-1],m=p?p.children.indexOf(d):void 0;return l(d,m,p)}}const _1={}.hasOwnProperty,mue={};function gue(e,t){const n=t||mue,r=new Map,i=new Map,a=new Map,l={...Xce,...n.handlers},c={all:f,applyData:vue,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:l,one:d,options:n,patch:yue,wrap:bue};return mB(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const m=p.type==="definition"?r:i,y=String(p.identifier).toUpperCase();m.has(y)||m.set(y,p)}}),c;function d(p,m){const y=p.type,v=c.handlers[y];if(_1.call(c.handlers,y)&&v)return v(c,p,m);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:b,...j}=p,k=by(j);return k.children=c.all(p),k}return by(p)}return(c.options.unknownHandler||xue)(c,p,m)}function f(p){const m=[];if("children"in p){const y=p.children;let v=-1;for(;++v<y.length;){const w=c.one(y[v],p);if(w){if(v&&y[v-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=AP(w.value)),!Array.isArray(w)&&w.type==="element")){const b=w.children[0];b&&b.type==="text"&&(b.value=AP(b.value))}Array.isArray(w)?m.push(...w):m.push(w)}}}return m}}function yue(e,t){e.position&&(t.position=eoe(e))}function vue(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,by(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function xue(e,t){const n=t.data||{},r="value"in t&&!(_1.call(n,"hProperties")||_1.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 bue(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 AP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function EP(e,t){const n=gue(e,t),r=n.one(e,void 0),i=aue(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 wue(e,t){return e&&"run"in e?async function(n,r){const i=EP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return EP(n,{file:r,...e||t})}}function OP(e){if(e)throw e}var Xw,zP;function Sue(){if(zP)return Xw;zP=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},a=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),m=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!m)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},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},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Xw=function d(){var f,p,m,y,v,w,b=arguments[0],j=1,k=arguments.length,E=!1;for(typeof b=="boolean"&&(E=b,b=arguments[1]||{},j=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});j<k;++j)if(f=arguments[j],f!=null)for(p in f)m=c(b,p),y=c(f,p),b!==y&&(E&&y&&(a(y)||(v=i(y)))?(v?(v=!1,w=m&&i(m)?m:[]):w=m&&a(m)?m:{},l(b,{name:p,newValue:d(E,w,y)})):typeof y<"u"&&l(b,{name:p,newValue:y}));return b},Xw}var jue=Sue();const Jw=Sa(jue);function T1(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 Nue(){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);c(null,...i);function c(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?kue(p,c)(...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 kue(e,t){let n;return r;function r(...l){const c=e.length>l.length;let d;c&&l.push(i);try{d=e.apply(this,l)}catch(f){const p=f;if(c&&n)throw p;return i(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(a,i):d instanceof Error?i(d):a(d))}function i(l,...c){n||(n=!0,t(l,...c))}function a(l){i(null,l)}}const Da={basename:Cue,dirname:Aue,extname:Eue,join:Oue,sep:"/"};function Cue(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ip(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,c=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else l<0&&(a=!0,l=i+1),c>-1&&(e.codePointAt(i)===t.codePointAt(c--)?c<0&&(r=i):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Aue(e){if(ip(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 Eue(e){ip(e);let t=e.length,n=-1,r=0,i=-1,a=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Oue(...e){let t=-1,n;for(;++t<e.length;)ip(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":zue(n)}function zue(e){ip(e);const t=e.codePointAt(0)===47;let n=_ue(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function _ue(e,t){let n="",r=0,i=-1,a=0,l=-1,c,d;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===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 c===46&&a>-1?a++:a=-1}return n}function ip(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Tue={cwd:Pue};function Pue(){return"/"}function P1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Rue(e){if(typeof e=="string")e=new URL(e);else if(!P1(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 Due(e)}function Due(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 eS=["history","path","basename","stem","extname","dirname"];class gB{constructor(t){let n;t?P1(t)?n={path:t}:typeof t=="string"||Mue(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Tue.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<eS.length;){const a=eS[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)eS.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Da.basename(this.path):void 0}set basename(t){nS(t,"basename"),tS(t,"basename"),this.path=Da.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Da.dirname(this.path):void 0}set dirname(t){_P(this.basename,"dirname"),this.path=Da.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Da.extname(this.path):void 0}set extname(t){if(tS(t,"extname"),_P(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=Da.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){P1(t)&&(t=Rue(t)),nS(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Da.basename(this.path,this.extname):void 0}set stem(t){nS(t,"stem"),tS(t,"stem"),this.path=Da.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new zr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function tS(e,t){if(e&&e.includes(Da.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Da.sep+"`")}function nS(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _P(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Mue(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Iue=(function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),Lue={}.hasOwnProperty;class lC extends Iue{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=Nue()}copy(){const t=new lC;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Jw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(aS("data",this.frozen),this.namespace[t]=n,this):Lue.call(this.namespace,t)&&this.namespace[t]||void 0:t?(aS("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=eg(t),r=this.parser||this.Parser;return rS("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),rS("process",this.parser||this.Parser),iS("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,l){const c=eg(t),d=r.parse(c);r.run(d,c,function(p,m,y){if(p||!m||!y)return f(p);const v=m,w=r.stringify(v,y);Uue(w)?y.value=w:y.result=w,f(p,y)});function f(p,m){p||!m?l(p):a?a(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),rS("processSync",this.parser||this.Parser),iS("processSync",this.compiler||this.Compiler),this.process(t,i),PP("processSync","process",n),r;function i(a,l){n=!0,OP(a),r=l}}run(t,n,r){TP(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,c){const d=eg(n);i.run(t,d,f);function f(p,m,y){const v=m||t;p?c(p):l?l(v):r(void 0,v,y)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),PP("runSync","run",r),i;function a(l,c){OP(l),i=c,r=!0}}stringify(t,n){this.freeze();const r=eg(n),i=this.compiler||this.Compiler;return iS("stringify",i),TP(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(aS("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(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");c(f.plugins),f.settings&&(i.settings=Jw(!0,i.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const m=f[p];a(m)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===f){y=m;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[v,...w]=p;const b=r[y][1];T1(b)&&T1(v)&&(v=Jw(!0,b,v)),r[y]=[f,v,...w]}}}}const $ue=new lC().freeze();function rS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function iS(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function aS(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 TP(e){if(!T1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function PP(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function eg(e){return Bue(e)?e:new gB(e)}function Bue(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Uue(e){return typeof e=="string"||que(e)}function que(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Fue="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",RP=[],DP={allowDangerousHtml:!0},Hue=/^(https?|ircs?|mailto|xmpp)$/i,Kue=[{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 Gue(e){const t=Vue(e),n=Que(e);return Yue(t.runSync(t.parse(n),n),e)}function Vue(e){const t=e.rehypePlugins||RP,n=e.remarkPlugins||RP,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...DP}:DP;return $ue().use(Cce).use(n).use(wue,r).use(t)}function Que(e){const t=e.children||"",n=new gB;return typeof t=="string"&&(n.value=t),n}function Yue(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||Wue;for(const p of Kue)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Fue+p.id,void 0);return mB(e,f),aoe(e,{Fragment:s.Fragment,components:i,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function f(p,m,y){if(p.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:p.value},m;if(p.type==="element"){let v;for(v in Yw)if(Object.hasOwn(Yw,v)&&Object.hasOwn(p.properties,v)){const w=p.properties[v],b=Yw[v];(b===null||b.includes(p.tagName))&&(p.properties[v]=d(String(w||""),v,p))}}if(p.type==="element"){let v=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!v&&r&&typeof m=="number"&&(v=!r(p,m,y)),v&&y&&typeof m=="number")return c&&p.children?y.children.splice(m,1,...p.children):y.children.splice(m,1),m}}}function Wue(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||Hue.test(e.slice(0,t))?e:""}async function Xv(e){try{return await e.json()}catch{return{}}}function Zue(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath.replace(/\/$/,"")+"/api/v1":"/api/v1"}const Jv=Zue();function e0(e){(e===401||e===403)&&X5()}async function MP(e){const t=await fetch(`${Jv}/projects/${encodeURIComponent(e)}/agent/transcript`,{credentials:"include"});if(!t.ok){e0(t.status);const n=await Xv(t);throw new rr(n.error?.message??`transcript fetch failed: ${t.status}`,t.status,n.error?.code)}return await t.json()}async function Xue(e){const t=await fetch(`${Jv}/projects/${encodeURIComponent(e)}/agent/providers`,{credentials:"include"});if(!t.ok){e0(t.status);const n=await Xv(t);throw new rr(n.error?.message??`providers fetch failed: ${t.status}`,t.status,n.error?.code)}return await t.json()}async function Jue(e){const t=await fetch(`${Jv}/projects/${encodeURIComponent(e)}/agent/transcript`,{method:"DELETE",credentials:"include"});if(!t.ok){e0(t.status);const n=await Xv(t);throw new rr(n.error?.message??`reset failed: ${t.status}`,t.status,n.error?.code)}}async function ede({project:e,prompt:t,provider:n,modelId:r,scope:i,signal:a,onEvent:l}){const c={prompt:t};n&&(c.provider=n),r&&(c.modelId=r),i&&(c.scope=i);const d=await fetch(`${Jv}/projects/${encodeURIComponent(e)}/agent/prompt`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c),signal:a});if(!d.ok||!d.body){e0(d.status);const v=await Xv(d);throw new rr(v.error?.message??`prompt failed: ${d.status}`,d.status,v.error?.code)}const f=d.body.getReader(),p=new TextDecoder;let m="";const y=()=>{f.cancel().catch(()=>{})};a?.addEventListener("abort",y,{once:!0});try{for(;;){const{value:v,done:w}=await f.read();if(w)break;m+=p.decode(v,{stream:!0});let b=m.indexOf(`
|
|
111
|
+
|
|
112
|
+
`);for(;b!==-1;){const j=m.slice(0,b);m=m.slice(b+2);for(const k of j.split(`
|
|
113
|
+
`)){if(!k.startsWith("data:"))continue;const E=k.slice(5).trim();if(E)try{l(JSON.parse(E))}catch{}}b=m.indexOf(`
|
|
114
|
+
|
|
115
|
+
`)}}}finally{a?.removeEventListener("abort",y);try{f.releaseLock()}catch{}}}function yB(e){return!e||e.role!=="assistant"?"":e.content.filter(t=>t.type==="text").map(t=>t.text).join("")}const tde=[{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?"}],nde=[{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"}],tg=e=>`canonry:aero:provider:${e}`,IP=e=>`canonry:aero:scope:${e}`;function rde({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(!1),[a,l]=x.useState([]),[c,d]=x.useState(""),[f,p]=x.useState(!1),[m,y]=x.useState([]),[v,w]=x.useState(""),[b,j]=x.useState(null),[k,E]=x.useState(()=>typeof window>"u"?null:window.localStorage.getItem(tg(e))??null),[A,C]=x.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(IP(e))==="all"?"all":"read-only"),_=x.useRef(null),O=x.useRef(null),z=x.useRef(null),[R,$]=x.useState(0),F=x.useMemo(()=>{const I=c.trimStart();if(!I.startsWith("/"))return[];if(/\s/.test(I))return[];const D=I.toLowerCase();return nde.filter(V=>V.command.startsWith(D)||V.label.toLowerCase().includes(D.slice(1)))},[c]);x.useEffect(()=>{$(I=>F.length===0?0:Math.min(I,F.length-1))},[F.length]);const M=Un({queryKey:_e.agent.providers(e),queryFn:()=>Xue(e),enabled:t,staleTime:6e4}),U=x.useMemo(()=>{const I=M.data?.providers??[];if(k){const V=I.find(re=>re.id===k&&re.configured);if(V)return V}const D=M.data?.defaultProvider;return D?I.find(V=>V.id===D)??null:null},[k,M.data]);x.useEffect(()=>{if(!M.data||!k)return;M.data.providers.find(D=>D.id===k&&D.configured)||(E(null),window.localStorage.removeItem(tg(e)))},[M.data,k,e]);const K=x.useCallback(I=>{E(I),!(typeof window>"u")&&(I?window.localStorage.setItem(tg(e),I):window.localStorage.removeItem(tg(e)))},[e]),Z=x.useCallback(()=>{C(I=>{const D=I==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(IP(e),D),D})},[e]);x.useEffect(()=>{if(!t)return;const I=D=>{D.key==="Escape"&&(r?i(!1):n(!1))};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[t,r]),x.useEffect(()=>{if(!t)return;let I=!1;j(null);const D=()=>{I||f||MP(e).then(ee=>{I||l(ee.messages)}).catch(ee=>{I||j(ee instanceof Error?ee.message:"Failed to load transcript")})};D();const re=window.setInterval(D,15e3);return()=>{I=!0,window.clearInterval(re)}},[t,e,f]),x.useEffect(()=>()=>{_.current?.abort()},[e]),x.useEffect(()=>{const I=O.current;I&&(I.scrollTop=I.scrollHeight)},[a,v,m]);async function Y(I){const D=I.trim();if(!D||f)return;j(null),d(""),p(!0),w(""),y([]);const V={role:"user",content:D,timestamp:Date.now()};l(ee=>[...ee,V]);const re=new AbortController;_.current=re;try{await ede({project:e,prompt:D,provider:k??void 0,scope:A,signal:re.signal,onEvent:H});const ee=await MP(e);l(ee.messages)}catch(ee){ee.name!=="AbortError"&&j(ee instanceof Error?ee.message:"Prompt failed")}finally{p(!1),w(""),_.current=null}}function H(I){switch(I.type){case"message_update":w(yB(I.message));break;case"message_end":I.message.role==="assistant"&&w("");break;case"tool_execution_start":y(D=>[...D,{id:I.toolCallId,name:I.toolName,args:I.args,startedAt:Date.now()}]);break;case"tool_execution_end":y(D=>D.map(V=>V.id===I.toolCallId?{...V,endedAt:Date.now(),isError:I.isError,result:I.result}:V));break;case"error":j(I.message);break}}async function X(){_.current?.abort();try{await Jue(e),l([]),j(null)}catch(I){j(I instanceof Error?I.message:"Reset failed")}}const ue=a.length===0,xe=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",L=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",q=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:xe,onClick:I=>{r&&I.target===I.currentTarget&&i(!1)},children:s.jsx("div",{className:L,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(Y2,{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(ide,{providers:M.data?.providers??[],active:U,override:k,onPick:K,disabled:f}),s.jsx("button",{type:"button",onClick:Ke(X),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(w4,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),s.jsx("button",{type:"button",onClick:()=>i(I=>!I),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(JY,{className:"h-3.5 w-3.5","aria-hidden":"true"}):s.jsx(YY,{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(Sc,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),s.jsxs("div",{ref:O,className:q,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}),ue&&!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:tde.map(I=>s.jsx("button",{type:"button",onClick:()=>{Y(I.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:I.label},I.label))})]}),cde(a,e,k,A),m.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:m.map(I=>s.jsx(vB,{trail:I},I.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(xB,{content:v})]}),f&&!v&&m.every(I=>I.endedAt!==void 0)&&s.jsx(hde,{})]}),s.jsx(ade,{projectName:e,activeProvider:U,scope:A,onToggleScope:Z,disabled:f}),s.jsxs("div",{className:"relative",children:[F.length>0&&s.jsx(sde,{matches:F,selectedIndex:R,onHover:$,onPick:I=>{d(""),z.current?.focus(),I.action==="clear"?X():Y(I.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:I=>{if(I.preventDefault(),F.length>0){const D=F[R];d(""),D.action==="clear"?X():Y(D.prompt);return}Y(c)},children:[s.jsx("textarea",{ref:z,value:c,onChange:I=>d(I.target.value),onKeyDown:I=>{if(F.length>0){if(I.key==="ArrowDown"){I.preventDefault(),$(D=>(D+1)%F.length);return}if(I.key==="ArrowUp"){I.preventDefault(),$(D=>(D-1+F.length)%F.length);return}if(I.key==="Tab"){I.preventDefault();const D=F[R];d(`${D.command} `);return}if(I.key==="Escape"){I.preventDefault(),d("");return}}if(I.key==="Enter"&&!I.shiftKey)if(I.preventDefault(),F.length>0){const D=F[R];d(""),D.action==="clear"?X():Y(D.prompt)}else Y(c)},placeholder:"Ask Aero, or / for commands…",disabled:f,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),s.jsx("button",{type:"submit",disabled:f||!c.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:s.jsx(wY,{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(Y2,{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 ide({providers:e,active:t,override:n,onPick:r,disabled:i}){const[a,l]=x.useState(!1),c=x.useRef(null);if(x.useEffect(()=>{if(!a)return;const p=y=>{c.current?.contains(y.target)||l(!1)},m=y=>{y.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:c,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(CY,{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,y=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(y?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(g4,{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}),y&&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:ode(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 ade({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 sde({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 ode(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 lde(e,t){const n=e.timestamp??0;return`${e.role}:${n}:${t}`}function cde(e,t,n,r){const i=[];for(let a=0;a<e.length;a++){const l=e[a],c=lde(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(ude,{text:d,projectName:t,providerOverride:n,scope:r},c));continue}if(l.role==="assistant"){const d=new Map;let f=a+1;for(;f<e.length&&e[f].role==="toolResult";){const y=e[f];d.set(y.toolCallId,y),f++}const p=fde(l,d,l.timestamp??0),m=yB(l);i.push(s.jsxs(x.Fragment,{children:[p.length>0&&s.jsx("div",{className:"mt-3 space-y-1.5",children:p.map(y=>s.jsx(vB,{trail:y},y.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(xB,{content:m})]})]},c)),a=f-1;continue}}return i}function ude({text:e,projectName:t,providerOverride:n,scope:r}){const[i,a]=x.useState(!1),l=x.useMemo(()=>dde(t,e,n,r),[t,e,n,r]);async function c(){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:Ke(c),className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:l,children:i?s.jsxs(s.Fragment,{children:[s.jsx(g4,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):s.jsxs(s.Fragment,{children:[s.jsx(DY,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),s.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function dde(e,t,n,r){const i=["canonry","agent","ask",LP(e),LP(t)];return n&&i.push("--provider",n),r==="read-only"&&i.push("--scope","read-only"),i.join(" ")}function LP(e){return`'${e.replace(/'/g,"'\\''")}'`}function fde(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 vB({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`,c=i?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",d=i?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return s.jsxs("div",{className:`rounded-md border ${c} ${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(b4,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):i?s.jsx(oy,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):s.jsx(SW,{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(tp,{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:$P(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:$P(e.result)})]})]})]})}function $P(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 xB({content:e}){return s.jsx("div",{className:"aero-markdown text-zinc-100",children:s.jsx(Gue,{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 hde(){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 pde(){const e=Y5(),t=/^\/projects\/([^/]+)/.exec(e.pathname),n=t?decodeURIComponent(t[1]):null,r=Un({queryKey:_e.projects.all,queryFn:_v,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(rde,{projectName:a.name},a.name):null}function t0(e,t,n){switch(e.invalidateQueries({queryKey:_e.runs.all}),e.invalidateQueries({queryKey:_e.projects.all}),t){case xt["answer-visibility"]:case xt["site-audit"]:case xt["backlink-extract"]:return;case xt["gsc-sync"]:case xt["inspect-sitemap"]:e.invalidateQueries({queryKey:_e.gsc.project(n)});return;case xt["ga-sync"]:e.invalidateQueries({queryKey:_e.traffic.project(n)});return;case xt["traffic-sync"]:e.invalidateQueries({queryKey:_e.traffic.project(n)}),e.invalidateQueries({queryKey:_e.serverTraffic.project(n)});return;case xt["bing-inspect"]:case xt["bing-inspect-sitemap"]:e.invalidateQueries({queryKey:_e.bing.project(n)});return;case xt["aeo-discover-seed"]:case xt["aeo-discover-probe"]:return;default:return t}}const BP=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:qY},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:jY},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:BY}],UP=e=>({label:e,state:"checking",detail:"Checking service health"}),mde={apiStatus:UP("API"),workerStatus:UP("Worker")};function gde(e){switch(e){case xt["answer-visibility"]:return"Visibility sweep";case xt["gsc-sync"]:return"GSC sync";case xt["inspect-sitemap"]:return"Sitemap inspection";case xt["ga-sync"]:return"GA sync";case xt["traffic-sync"]:return"Traffic sync";case xt["bing-inspect"]:return"Bing URL inspection";case xt["bing-inspect-sitemap"]:return"Bing sitemap inspection";case xt["site-audit"]:return"Site audit";case xt["backlink-extract"]:return"Backlink extract";case xt["aeo-discover-seed"]:return"Discovery (seed phase)";case xt["aeo-discover-probe"]:return"Discovery (probe phase)"}}function yde(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function vde(e){const t=gde(e.kind);return e.status==="completed"?`${t} completed`:e.status==="partial"?`${t} completed with partial results`:e.status==="cancelled"?`${t} cancelled`:`${t} failed`}function xde(e,t){return e.error?`${t}: ${Ck(e.error)}`:e.location?`${t} · ${e.location}`:t}function bde(e,t,n){if(t)return t;const r=n.find(i=>i.id===e);return r?.displayName||r?.name||e}function wde(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 Sde(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function jde(){const e=Hn(),t=x.useSyncExternalStore(ire,oc,oc),n=Object.keys(t.runs).length>0||Object.keys(t.batches).length>0,r=Un({queryKey:_e.runs.all,queryFn:J5,enabled:n,staleTime:f1,refetchInterval:3e3}),i=Un({queryKey:_e.projects.all,queryFn:_v,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 c=()=>{document.visibilityState==="visible"&&l()};return window.addEventListener("focus",l),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("focus",l),document.removeEventListener("visibilitychange",c)}},[n,l]),x.useEffect(()=>{const c=r.data??[],d=i.data??[],f=Object.fromEntries(c.map(m=>[m.id,m])),p=Object.fromEntries(c.map(m=>[m.id,m.status]));for(const m of Object.values(t.runs)){const y=f[m.runId];if(!y||!Mk(y.status)||(a.current[y.id]??m.lastAnnouncedStatus)===y.status)continue;const w=d.find(j=>j.id===y.projectId);if(w&&t0(e,y.kind,w.name),m.sourceAction==="run-all"){kT(y.id);continue}const b=bde(y.projectId,m.projectLabel,d);ut({title:vde(y),detail:xde(y,b),tone:yde(y.status),dedupeKey:`run:${y.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:y.id}}),kT(y.id)}for(const m of Object.values(t.batches)){const y=ore(m.runIds,f);y.finished&&(ut({title:"Run-all batch finished",detail:wde(y,m.skippedCount),tone:Sde(y),dedupeKey:`batch:${m.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),sre(m.batchId))}a.current=p},[i.data,r.data,t,e]),null}function Nde(){const e=np(),{dashboard:t,isLoading:n,refetch:r}=Cc(),l=Qv(!e,e?.health).data??e?.health??mde,c=Y5(),{runId:d,evidenceId:f,closeDrawer:p}=Nd(),[m,y]=x.useState(!1),[v,w]=x.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[b]=x.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),j=b?{current:l.apiStatus.version??"0.0.0",latest:b,url:"https://www.npmjs.com/package/@ainyc/canonry",upgradeCommand:"npm install -g @ainyc/canonry"}:l.apiStatus.updateAvailable,k=j&&j.latest!==v,E=()=>{if(j){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",j.latest)}catch{}w(j.latest)}},A=Ase(d),C=A.data??null,_=A.isLoading;x.useEffect(()=>{C&&C.status!=="running"&&C.status!=="queued"&&r()},[C?.status,r]),x.useEffect(()=>{y(!1)},[c.pathname]),x.useEffect(()=>{if(typeof window>"u"||!d&&!f)return;const M=U=>{U.key==="Escape"&&p()};return window.addEventListener("keydown",M),()=>{window.removeEventListener("keydown",M)}},[d,f,p]);const O=t??e?.dashboard??null,z=c.pathname==="/setup"&&O!==null&&O.portfolioOverview.projects.length===0,R=d&&O?nse(O,d):void 0,$=f&&O?rse(O,f):void 0,F=(()=>{const M=c.pathname;if(M==="/")return"Portfolio";if(M==="/projects")return"Projects";if(M==="/runs")return"Runs";if(M==="/settings")return"Settings";if(M==="/setup")return"Setup";if(M==="/backlinks")return"Backlinks";if(M==="/traffic"||M.startsWith("/traffic/"))return"Server traffic";if(M.startsWith("/projects/")){const K=M.split("/").filter(Boolean)[1];if(K&&O){const Z=O.projects.find(Y=>Y.project.id===K);if(Z)return Z.project.name}return"Project"}return"Not found"})();return s.jsxs("div",{className:`app-shell ${z?"app-shell-focus":""}`,children:[s.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!z&&s.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[s.jsx("div",{className:"sidebar-brand",children:s.jsx(DT,{version:l.apiStatus.version,updateAvailable:k?j:null,onDismissUpdate:E})}),s.jsxs("nav",{className:"sidebar-nav",children:[s.jsxs(zt,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(KY,{className:"sidebar-icon"}),s.jsx("span",{children:"Overview"})]}),s.jsxs(zt,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[s.jsx(v4,{className:"sidebar-icon"}),s.jsx("span",{children:"Projects"})]}),s.jsxs(zt,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(kh,{className:"sidebar-icon"}),s.jsx("span",{children:"Runs"})]}),s.jsxs(zt,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[s.jsx(aW,{className:"sidebar-icon"}),s.jsx("span",{children:"Server traffic"})]}),s.jsxs(zt,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(x4,{className:"sidebar-icon"}),s.jsx("span",{children:"Backlinks"})]}),s.jsxs(zt,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(dW,{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(M=>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+M*15}%`}})]},M))]}):O&&O.projects.length>0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Projects"}),O.projects.map(M=>{const U=M.visibilitySummary.tone;return s.jsxs(zt,{to:"/projects/$projectId",params:{projectId:M.project.id},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[s.jsx("span",{className:`sidebar-dot sidebar-dot-${U}`}),s.jsx("span",{children:M.project.displayName||M.project.name})]},M.project.id)})]}):n?null:s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"sidebar-section-title",children:"Resources"}),s.jsxs(zt,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[s.jsx(lW,{className:"sidebar-icon"}),s.jsx("span",{children:"Setup"})]})]})]}),s.jsx("div",{className:"sidebar-footer",children:BP.map(({label:M,href:U,Icon:K})=>s.jsx("a",{className:"sidebar-footer-icon",href:U,target:"_blank",rel:"noopener noreferrer",title:M,"aria-label":M,children:s.jsx(K,{className:"size-4"})},U))})]}),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(DT,{compact:!0})}),s.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[s.jsx(zt,{to:"/",children:"Home"}),s.jsx(tp,{className:"breadcrumb-sep size-3"}),s.jsx("span",{className:"breadcrumb-current",children:F})]})]}),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:Yo(l.apiStatus),children:["API ",l.apiStatus.state==="ok"?"ok":l.apiStatus.state]}),s.jsxs("span",{className:`health-pill health-pill-${l.workerStatus.state}`,title:Yo(l.workerStatus),children:["Worker ",l.workerStatus.state==="ok"?"ok":l.workerStatus.state]})]}),s.jsxs(pe,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":m,"aria-controls":"mobile-nav",onClick:()=>y(M=>!M),children:[s.jsx(ZY,{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(pe,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>y(!1),children:[s.jsx(Sc,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Close navigation"})]}),s.jsx(zt,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),s.jsx(zt,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),s.jsx(zt,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),s.jsx(zt,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),s.jsx(zt,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),O&&O.projects.length>0?s.jsxs("div",{className:"mobile-nav-section",children:[s.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),O.projects.map(M=>s.jsx(zt,{to:"/projects/$projectId",params:{projectId:M.project.id},className:"mobile-nav-link",children:M.project.name},M.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(M=>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"})]},M))}),s.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(M=>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(U=>s.jsx("div",{className:"skeleton-text-sm w-full"},U))})]},M))})]}):s.jsx(dk,{})}),s.jsxs("footer",{className:"footer",children:[s.jsxs("span",{className:"footer-brand",children:[s.jsx("span",{children:s.jsx("a",{href:"https://canonry.ai",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:BP.map(({label:M,href:U,Icon:K})=>s.jsx("a",{href:U,target:"_blank",rel:"noopener noreferrer",title:M,"aria-label":M,className:"footer-icon",children:s.jsx(K,{className:"size-3.5"})},U))})]})]}),R?s.jsxs(Kae,{open:!0,title:R.summary,subtitle:`${R.projectName} · ${R.kindLabel}`,onClose:p,children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[s.jsx(Uv,{status:R.status}),s.jsx("span",{className:"text-zinc-400",children:R.startedAt}),s.jsx("span",{className:"text-zinc-500",children:R.duration}),s.jsx("span",{className:"text-zinc-600",children:R.triggerLabel})]}),R.status==="failed"&&R.statusDetail&&s.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:R.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"}),_?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):C&&C.snapshots.length>0?s.jsxs("div",{className:"space-y-2",children:[C.snapshots.map(M=>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:M.query??"Unknown query"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(lc,{provider:M.provider}),s.jsx(Q3,{variant:M.citationState===Oh.cited?"success":"neutral",children:M.citationState})]})]}),M.model&&s.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:M.model}),M.citedDomains.length>0&&s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[s.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",M.citedDomains.join(", ")]}),M.competitorOverlap.length>0&&s.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",M.competitorOverlap.join(", ")]}),M.groundingSources&&M.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:[M.groundingSources.length," grounding source",M.groundingSources.length!==1?"s":""]}),s.jsx("ul",{className:"mt-1 space-y-0.5",children:M.groundingSources.map((U,K)=>s.jsx("li",{className:"text-xs text-zinc-500 truncate",children:s.jsx("a",{href:U.uri,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:U.title||U.uri})},K))})]}),M.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:M.answerText})]})]},M.id)),C.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..."]})]}):C&&C.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..."]}):C&&C.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..."]}):C&&C.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:Kne(C.error)})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,$?s.jsx(Yae,{evidence:$.evidence,project:$.project,onClose:p}):null,s.jsx(jde,{}),s.jsx(zse,{}),s.jsx(pde,{})]})}class kde 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(oy,{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(pe,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[s.jsx(w4,{className:"size-3.5 mr-1.5"}),"Try again"]}),s.jsx(pe,{variant:"secondary",size:"sm",onClick:()=>{const t=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=t||"/"},children:"Go home"})]})]})}):this.props.children}}const Pe=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ta("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)] backdrop-blur",e),...t}));Pe.displayName="Card";const R1=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ta("flex flex-col gap-1.5 p-5",e),...t}));R1.displayName="CardHeader";const D1=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:ta("font-medium tracking-tight text-zinc-50",e),...t}));D1.displayName="CardTitle";const M1=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:ta("text-sm text-zinc-500",e),...t}));M1.displayName="CardDescription";const Bg=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:ta("p-5 pt-0",e),...t}));Bg.displayName="CardContent";function Cde({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((y,v)=>{const w=a+v/Math.max(e.length-1,1)*f,b=a+(1-(y-l)/d)*p;return`${w},${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 Ade({project:e}){return s.jsxs(zt,{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," · ",Lv(e.lastRun.status)]})]})}),s.jsx("div",{className:"project-row-chart",children:s.jsx(Cde,{points:e.trend,tone:A3(e.lastRun.status)})}),s.jsx("span",{className:"project-row-link",children:s.jsx(tp,{className:"h-4 w-4 text-zinc-500"})})]})}function Ede(){const e=np(),{dashboard:t,isLoading:n}=Cc(),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,c=Qv(!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=Zne(i.systemHealth,c,r.settings),{openRun:f}=Nd();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(Ade,{project:p},p.project.id))}):s.jsxs(Pe,{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(pe,{size:"sm",asChild:!0,children:s.jsx(zt,{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(zt,{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(Uv,{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(Pe,{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(ot,{tone:p.tone,title:p.id==="api"?Yo(c.apiStatus):p.id==="worker"?Yo(c.workerStatus):void 0,children:p.label})]}),s.jsx("p",{className:"supporting-copy",children:p.meta})]},p.id))})]})]})}const cC=Symbol.for("yaml.alias"),I1=Symbol.for("yaml.document"),Fo=Symbol.for("yaml.map"),bB=Symbol.for("yaml.pair"),Ka=Symbol.for("yaml.scalar"),Ad=Symbol.for("yaml.seq"),Wi=Symbol.for("yaml.node.type"),Ec=e=>!!e&&typeof e=="object"&&e[Wi]===cC,n0=e=>!!e&&typeof e=="object"&&e[Wi]===I1,ap=e=>!!e&&typeof e=="object"&&e[Wi]===Fo,Pn=e=>!!e&&typeof e=="object"&&e[Wi]===bB,nn=e=>!!e&&typeof e=="object"&&e[Wi]===Ka,sp=e=>!!e&&typeof e=="object"&&e[Wi]===Ad;function zn(e){if(e&&typeof e=="object")switch(e[Wi]){case Fo:case Ad:return!0}return!1}function _n(e){if(e&&typeof e=="object")switch(e[Wi]){case cC:case Fo:case Ka:case Ad:return!0}return!1}const wB=e=>(nn(e)||zn(e))&&!!e.anchor,Dl=Symbol("break visit"),Ode=Symbol("skip children"),mh=Symbol("remove node");function Ed(e,t){const n=zde(t);n0(e)?Iu(null,e.contents,n,Object.freeze([e]))===mh&&(e.contents=null):Iu(null,e,n,Object.freeze([]))}Ed.BREAK=Dl;Ed.SKIP=Ode;Ed.REMOVE=mh;function Iu(e,t,n,r){const i=_de(e,t,n,r);if(_n(i)||Pn(i))return Tde(e,r,i),Iu(e,i,n,r);if(typeof i!="symbol"){if(zn(t)){r=Object.freeze(r.concat(t));for(let a=0;a<t.items.length;++a){const l=Iu(a,t.items[a],n,r);if(typeof l=="number")a=l-1;else{if(l===Dl)return Dl;l===mh&&(t.items.splice(a,1),a-=1)}}}else if(Pn(t)){r=Object.freeze(r.concat(t));const a=Iu("key",t.key,n,r);if(a===Dl)return Dl;a===mh&&(t.key=null);const l=Iu("value",t.value,n,r);if(l===Dl)return Dl;l===mh&&(t.value=null)}}return i}function zde(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 _de(e,t,n,r){if(typeof n=="function")return n(e,t,r);if(ap(t))return n.Map?.(e,t,r);if(sp(t))return n.Seq?.(e,t,r);if(Pn(t))return n.Pair?.(e,t,r);if(nn(t))return n.Scalar?.(e,t,r);if(Ec(t))return n.Alias?.(e,t,r)}function Tde(e,t,n){const r=t[t.length-1];if(zn(r))r.items[e]=n;else if(Pn(r))e==="key"?r.key=n:r.value=n;else if(n0(r))r.contents=n;else{const i=Ec(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const Pde={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Rde=e=>e.replace(/[!,[\]{}]/g,t=>Pde[t]);class Br{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Br.defaultYaml,t),this.tags=Object.assign({},Br.defaultTags,n)}clone(){const t=new Br(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Br(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Br.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Br.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Br.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Br.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+Rde(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&&_n(t.contents)){const a={};Ed(t.contents,(l,c)=>{_n(c)&&c.tag&&(a[c.tag]=!0)}),i=Object.keys(a)}else i=[];for(const[a,l]of r)a==="!!"&&l==="tag:yaml.org,2002:"||(!t||i.some(c=>c.startsWith(l)))&&n.push(`%TAG ${a} ${l}`);return n.join(`
|
|
117
|
+
`)}}Br.defaultYaml={explicit:!1,version:"1.2"};Br.defaultTags={"!!":"tag:yaml.org,2002:"};function SB(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 jB(e){const t=new Set;return Ed(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function NB(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function Dde(e,t){const n=[],r=new Map;let i=null;return{onAnchor:a=>{n.push(a),i??(i=jB(e));const l=NB(t,i);return i.add(l),l},setAnchors:()=>{for(const a of n){const l=r.get(a);if(typeof l=="object"&&l.anchor&&(nn(l.node)||zn(l.node)))l.node.anchor=l.anchor;else{const c=new Error("Failed to resolve repeated object (this should not happen)");throw c.source=a,c}}},sourceObjects:r}}function Lu(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],c=Lu(e,r,String(i),l);c===void 0?delete r[i]:c!==l&&(r[i]=c)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const a=r.get(i),l=Lu(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=Lu(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=Lu(e,r,i,a);l===void 0?delete r[i]:l!==a&&(r[i]=l)}return e.call(t,n,r)}function Qi(e,t,n){if(Array.isArray(e))return e.map((r,i)=>Qi(r,String(i),n));if(e&&typeof e.toJSON=="function"){if(!n||!wB(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 uC{constructor(t){Object.defineProperty(this,Wi,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){if(!n0(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},c=Qi(this,"",l);if(typeof i=="function")for(const{count:d,res:f}of l.anchors.values())i(f,d);return typeof a=="function"?Lu(a,{"":c},"",c):c}}class dC extends uC{constructor(t){super(cC),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=[],Ed(t,{Node:(a,l)=>{(Ec(l)||wB(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 c=r.get(l);if(c||(Qi(l,null,n),c=r.get(l)),c?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(a>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=Ug(i,l,r)),c.count*c.aliasCount>a)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return c.res}toString(t,n,r){const i=`*${this.source}`;if(t){if(SB(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 Ug(e,t,n){if(Ec(t)){const r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(zn(t)){let r=0;for(const i of t.items){const a=Ug(e,i,n);a>r&&(r=a)}return r}else if(Pn(t)){const r=Ug(e,t.key,n),i=Ug(e,t.value,n);return Math.max(r,i)}return 1}const kB=e=>!e||typeof e!="function"&&typeof e!="object";class dt extends uC{constructor(t){super(Ka),this.value=t}toJSON(t,n){return n?.keep?this.value:Qi(this.value,t,n)}toString(){return String(this.value)}}dt.BLOCK_FOLDED="BLOCK_FOLDED";dt.BLOCK_LITERAL="BLOCK_LITERAL";dt.PLAIN="PLAIN";dt.QUOTE_DOUBLE="QUOTE_DOUBLE";dt.QUOTE_SINGLE="QUOTE_SINGLE";const Mde="tag:yaml.org,2002:";function Ide(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 Ph(e,t,n){if(n0(e)&&(e=e.contents),_n(e))return e;if(Pn(e)){const m=n.schema[Fo].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:c}=n;let d;if(r&&e&&typeof e=="object"){if(d=c.get(e),d)return d.anchor??(d.anchor=i(e)),new dC(d.anchor);d={anchor:null,node:null},c.set(e,d)}t?.startsWith("!!")&&(t=Mde+t.slice(2));let f=Ide(e,t,l.tags);if(!f){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const m=new dt(e);return d&&(d.node=m),m}f=e instanceof Map?l[Fo]:Symbol.iterator in Object(e)?l[Ad]:l[Fo]}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 dt(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function wy(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 Ph(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 ah=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class CB extends uC{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=>_n(r)||Pn(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(ah(t))this.add(n);else{const[r,...i]=t,a=this.get(r,!0);if(zn(a))a.addIn(i,n);else if(a===void 0&&this.schema)this.set(r,wy(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(zn(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&&nn(a)?a.value:a:zn(a)?a.getIn(i,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!Pn(n))return!1;const r=n.value;return r==null||t&&nn(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 zn(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(zn(a))a.setIn(i,n);else if(a===void 0&&this.schema)this.set(r,wy(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const Lde=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function As(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Fl=(e,t,n)=>e.endsWith(`
|
|
118
|
+
`)?As(n,t):n.includes(`
|
|
119
|
+
`)?`
|
|
120
|
+
`+As(n,t):(e.endsWith(" ")?"":" ")+n,AB="flow",L1="block",qg="quoted";function r0(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:l,onOverflow:c}={}){if(!i||i<0)return e;i<a&&(a=0);const d=Math.max(1+a,1+i-t.length);if(e.length<=d)return e;const f=[],p={};let m=i-t.length;typeof r=="number"&&(r>i-Math.max(2,a)?f.push(0):m=i-r);let y,v,w=!1,b=-1,j=-1,k=-1;n===L1&&(b=qP(e,b,t.length),b!==-1&&(m=b+d));for(let A;A=e[b+=1];){if(n===qg&&A==="\\"){switch(j=b,e[b+1]){case"x":b+=3;break;case"u":b+=5;break;case"U":b+=9;break;default:b+=1}k=b}if(A===`
|
|
121
|
+
`)n===L1&&(b=qP(e,b,t.length)),m=b+t.length+d,y=void 0;else{if(A===" "&&v&&v!==" "&&v!==`
|
|
122
|
+
`&&v!==" "){const C=e[b+1];C&&C!==" "&&C!==`
|
|
123
|
+
`&&C!==" "&&(y=b)}if(b>=m)if(y)f.push(y),m=y+d,y=void 0;else if(n===qg){for(;v===" "||v===" ";)v=A,A=e[b+=1],w=!0;const C=b>k+1?b-2:j-1;if(p[C])return e;f.push(C),p[C]=!0,m=C+d,y=void 0}else w=!0}v=A}if(w&&c&&c(),f.length===0)return e;l&&l();let E=e.slice(0,f[0]);for(let A=0;A<f.length;++A){const C=f[A],_=f[A+1]||e.length;C===0?E=`
|
|
124
|
+
${t}${e.slice(0,_)}`:(n===qg&&p[C]&&(E+=`${e[C]}\\`),E+=`
|
|
125
|
+
${t}${e.slice(C+1,_)}`)}return E}function qP(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 i0=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),a0=e=>/^(%|---|\.\.\.)/m.test(e);function $de(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 gh(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(a0(e)?" ":"");let l="",c=0;for(let d=0,f=n[d];f;f=n[++d])if(f===" "&&n[d+1]==="\\"&&n[d+2]==="n"&&(l+=n.slice(c,d)+"\\ ",d+=1,c=d,f="\\"),f==="\\")switch(n[d+1]){case"u":{l+=n.slice(c,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,c=d+1}break;case"n":if(r||n[d+2]==='"'||n.length<i)d+=1;else{for(l+=n.slice(c,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,c=d+1}break;default:d+=1}return l=c?l+n.slice(c):n,r?l:r0(l,a,qg,i0(t,!1))}function $1(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
131
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return gh(e,t);const n=t.indent||(a0(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
132
|
+
${n}`)+"'";return t.implicitKey?r:r0(r,n,AB,i0(t,!1))}function $u(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=gh;else{const i=e.includes('"'),a=e.includes("'");i&&!a?r=$1:a&&!i?r=gh:r=n?$1:gh}return r(e,t)}let B1;try{B1=new RegExp(`(^|(?<!
|
|
133
|
+
))
|
|
134
|
+
+(?!
|
|
135
|
+
|$)`,"g")}catch{B1=/\n+(?!\n|$)/g}function Fg({comment:e,type:t,value:n},r,i,a){const{blockQuote:l,commentString:c,lineWidth:d}=r.options;if(!l||/\n[\t ]+$/.test(n))return $u(n,r);const f=r.indent||(r.forceBlockIndent||a0(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===dt.BLOCK_FOLDED?!1:t===dt.BLOCK_LITERAL?!0:!$de(n,d,f.length);if(!n)return p?`|
|
|
136
|
+
`:`>
|
|
137
|
+
`;let m,y;for(y=n.length;y>0;--y){const _=n[y-1];if(_!==`
|
|
138
|
+
`&&_!==" "&&_!==" ")break}let v=n.substring(y);const w=v.indexOf(`
|
|
139
|
+
`);w===-1?m="-":n===v||w!==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(B1,`$&${f}`));let b=!1,j,k=-1;for(j=0;j<n.length;++j){const _=n[j];if(_===" ")b=!0;else if(_===`
|
|
141
|
+
`)k=j;else break}let E=n.substring(0,k<j?k+1:j);E&&(n=n.substring(E.length),E=E.replace(/\n+/g,`$&${f}`));let C=(b?f?"2":"1":"")+m;if(e&&(C+=" "+c(e.replace(/ ?[\r\n]+/g," ")),i&&i()),!p){const _=n.replace(/\n+/g,`
|
|
142
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let O=!1;const z=i0(r,!0);l!=="folded"&&t!==dt.BLOCK_FOLDED&&(z.onOverflow=()=>{O=!0});const R=r0(`${E}${_}${v}`,f,L1,z);if(!O)return`>${C}
|
|
143
|
+
${f}${R}`}return n=n.replace(/\n+/g,`$&${f}`),`|${C}
|
|
144
|
+
${f}${E}${n}${v}`}function Bde(e,t,n,r){const{type:i,value:a}=e,{actualString:l,implicitKey:c,indent:d,indentStep:f,inFlow:p}=t;if(c&&a.includes(`
|
|
145
|
+
`)||p&&/[[\]{},]/.test(a))return $u(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return c||p||!a.includes(`
|
|
146
|
+
`)?$u(a,t):Fg(e,t,n,r);if(!c&&!p&&i!==dt.PLAIN&&a.includes(`
|
|
147
|
+
`))return Fg(e,t,n,r);if(a0(a)){if(d==="")return t.forceBlockIndent=!0,Fg(e,t,n,r);if(c&&d===f)return $u(a,t)}const m=a.replace(/\n+/g,`$&
|
|
148
|
+
${d}`);if(l){const y=b=>b.default&&b.tag!=="tag:yaml.org,2002:str"&&b.test?.test(m),{compat:v,tags:w}=t.doc.schema;if(w.some(y)||v?.some(y))return $u(a,t)}return c?m:r0(m,d,AB,i0(t,!1))}function fC(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:c}=e;c!==dt.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(c=dt.QUOTE_DOUBLE);const d=p=>{switch(p){case dt.BLOCK_FOLDED:case dt.BLOCK_LITERAL:return i||a?$u(l.value,t):Fg(l,t,n,r);case dt.QUOTE_DOUBLE:return gh(l.value,t);case dt.QUOTE_SINGLE:return $1(l.value,t);case dt.PLAIN:return Bde(l,t,n,r);default:return null}};let f=d(c);if(f===null){const{defaultKeyType:p,defaultStringType:m}=t.options,y=i&&p||m;if(f=d(y),f===null)throw new Error(`Unsupported default string type ${y}`)}return f}function EB(e,t){const n=Object.assign({blockQuote:!0,commentString:Lde,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 Ude(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(nn(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 qde(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const i=[],a=(nn(e)||zn(e))&&e.anchor;a&&SB(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 od(e,t,n,r){if(Pn(e))return e.toString(t,n,r);if(Ec(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=_n(e)?e:t.doc.createNode(e,{onTagObj:d=>i=d});i??(i=Ude(t.doc.schema.tags,a));const l=qde(a,i,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const c=typeof i.stringify=="function"?i.stringify(a,t,n,r):nn(a)?fC(a,t,n,r):a.toString(t,n,r);return l?nn(a)||c[0]==="{"||c[0]==="["?`${l} ${c}`:`${l}
|
|
149
|
+
${t.indent}${c}`:c}function Fde({key:e,value:t},n,r,i){const{allNullValues:a,doc:l,indent:c,indentStep:d,options:{commentString:f,indentSeq:p,simpleKeys:m}}=n;let y=_n(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(zn(e)||!_n(e)&&typeof e=="object"){const z="With simple keys, collection cannot be used as a key value";throw new Error(z)}}let v=!m&&(!e||y&&t==null&&!n.inFlow||zn(e)||(nn(e)?e.type===dt.BLOCK_FOLDED||e.type===dt.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!v&&(m||!a),indent:c+d});let w=!1,b=!1,j=od(e,n,()=>w=!0,()=>b=!0);if(!v&&!n.inFlow&&j.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");v=!0}if(n.inFlow){if(a||t==null)return w&&r&&r(),j===""?"?":v?`? ${j}`:j}else if(a&&!m||t==null&&v)return j=`? ${j}`,y&&!w?j+=Fl(j,n.indent,f(y)):b&&i&&i(),j;w&&(y=null),v?(y&&(j+=Fl(j,n.indent,f(y))),j=`? ${j}
|
|
150
|
+
${c}:`):(j=`${j}:`,y&&(j+=Fl(j,n.indent,f(y))));let k,E,A;_n(t)?(k=!!t.spaceBefore,E=t.commentBefore,A=t.comment):(k=!1,E=null,A=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!v&&!y&&nn(t)&&(n.indentAtStart=j.length+1),b=!1,!p&&d.length>=2&&!n.inFlow&&!v&&sp(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let C=!1;const _=od(t,n,()=>C=!0,()=>b=!0);let O=" ";if(y||k||E){if(O=k?`
|
|
151
|
+
`:"",E){const z=f(E);O+=`
|
|
152
|
+
${As(z,n.indent)}`}_===""&&!n.inFlow?O===`
|
|
153
|
+
`&&A&&(O=`
|
|
154
|
+
|
|
155
|
+
`):O+=`
|
|
156
|
+
${n.indent}`}else if(!v&&zn(t)){const z=_[0],R=_.indexOf(`
|
|
157
|
+
`),$=R!==-1,F=n.inFlow??t.flow??t.items.length===0;if($||!F){let M=!1;if($&&(z==="&"||z==="!")){let U=_.indexOf(" ");z==="&"&&U!==-1&&U<R&&_[U+1]==="!"&&(U=_.indexOf(" ",U+1)),(U===-1||R<U)&&(M=!0)}M||(O=`
|
|
158
|
+
${n.indent}`)}}else(_===""||_[0]===`
|
|
159
|
+
`)&&(O="");return j+=O+_,n.inFlow?C&&r&&r():A&&!C?j+=Fl(j,n.indent,f(A)):b&&i&&i(),j}function Hde(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const ng="<<",zs={identify:e=>e===ng||typeof e=="symbol"&&e.description===ng,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new dt(Symbol(ng)),{addToJSMap:OB}),stringify:()=>ng},Kde=(e,t)=>(zs.identify(t)||nn(t)&&(!t.type||t.type===dt.PLAIN)&&zs.identify(t.value))&&e?.doc.schema.tags.some(n=>n.tag===zs.tag&&n.default);function OB(e,t,n){if(n=e&&Ec(n)?n.resolve(e.doc):n,sp(n))for(const r of n.items)sS(e,t,r);else if(Array.isArray(n))for(const r of n)sS(e,t,r);else sS(e,t,n)}function sS(e,t,n){const r=e&&Ec(n)?n.resolve(e.doc):n;if(!ap(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 zB(e,t,{key:n,value:r}){if(_n(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Kde(e,n))OB(e,t,r);else{const i=Qi(n,"",e);if(t instanceof Map)t.set(i,Qi(r,i,e));else if(t instanceof Set)t.add(i);else{const a=Gde(n,i,e),l=Qi(r,a,e);a in t?Object.defineProperty(t,a,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[a]=l}}return t}function Gde(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(_n(e)&&n?.doc){const r=EB(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)+'..."'),Hde(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 hC(e,t,n){const r=Ph(e,void 0,n),i=Ph(t,void 0,n);return new Hr(r,i)}class Hr{constructor(t,n=null){Object.defineProperty(this,Wi,{value:bB}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return _n(n)&&(n=n.clone(t)),_n(r)&&(r=r.clone(t)),new Hr(n,r)}toJSON(t,n){const r=n?.mapAsMap?new Map:{};return zB(n,r,this)}toString(t,n,r){return t?.doc?Fde(this,t,n,r):JSON.stringify(this)}}function _B(e,t,n){return(t.inFlow??e.flow?Qde:Vde)(e,t,n)}function Vde({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:l,onComment:c}){const{indent:d,options:{commentString:f}}=n,p=Object.assign({},n,{indent:a,type:null});let m=!1;const y=[];for(let w=0;w<t.length;++w){const b=t[w];let j=null;if(_n(b))!m&&b.spaceBefore&&y.push(""),Sy(n,y,b.commentBefore,m),b.comment&&(j=b.comment);else if(Pn(b)){const E=_n(b.key)?b.key:null;E&&(!m&&E.spaceBefore&&y.push(""),Sy(n,y,E.commentBefore,m))}m=!1;let k=od(b,p,()=>j=null,()=>m=!0);j&&(k+=Fl(k,a,f(j))),m&&j&&(m=!1),y.push(r+k)}let v;if(y.length===0)v=i.start+i.end;else{v=y[0];for(let w=1;w<y.length;++w){const b=y[w];v+=b?`
|
|
160
|
+
${d}${b}`:`
|
|
161
|
+
`}}return e?(v+=`
|
|
162
|
+
`+As(f(e),d),c&&c()):m&&l&&l(),v}function Qde({items:e},t,{flowChars:n,itemIndent:r}){const{indent:i,indentStep:a,flowCollectionPadding:l,options:{commentString:c}}=t;r+=a;const d=Object.assign({},t,{indent:r,inFlow:!0,type:null});let f=!1,p=0;const m=[];for(let w=0;w<e.length;++w){const b=e[w];let j=null;if(_n(b))b.spaceBefore&&m.push(""),Sy(t,m,b.commentBefore,!1),b.comment&&(j=b.comment);else if(Pn(b)){const E=_n(b.key)?b.key:null;E&&(E.spaceBefore&&m.push(""),Sy(t,m,E.commentBefore,!1),E.comment&&(f=!0));const A=_n(b.value)?b.value:null;A?(A.comment&&(j=A.comment),A.commentBefore&&(f=!0)):b.value==null&&E?.comment&&(j=E.comment)}j&&(f=!0);let k=od(b,d,()=>j=null);w<e.length-1&&(k+=","),j&&(k+=Fl(k,r,c(j))),!f&&(m.length>p||k.includes(`
|
|
163
|
+
`))&&(f=!0),m.push(k),p=m.length}const{start:y,end:v}=n;if(m.length===0)return y+v;if(!f){const w=m.reduce((b,j)=>b+j.length+2,2);f=t.options.lineWidth>0&&w>t.options.lineWidth}if(f){let w=y;for(const b of m)w+=b?`
|
|
164
|
+
${a}${i}${b}`:`
|
|
165
|
+
`;return`${w}
|
|
166
|
+
${i}${v}`}else return`${y}${l}${m.join(" ")}${l}${v}`}function Sy({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const a=As(t(r),e);n.push(a.trimStart())}}function Hl(e,t){const n=nn(t)?t.value:t;for(const r of e)if(Pn(r)&&(r.key===t||r.key===n||nn(r.key)&&r.key.value===n))return r}class Ki extends CB{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Fo,t),this.items=[]}static from(t,n,r){const{keepUndefined:i,replacer:a}=r,l=new this(t),c=(d,f)=>{if(typeof a=="function")f=a.call(n,d,f);else if(Array.isArray(a)&&!a.includes(d))return;(f!==void 0||i)&&l.items.push(hC(d,f,r))};if(n instanceof Map)for(const[d,f]of n)c(d,f);else if(n&&typeof n=="object")for(const d of Object.keys(n))c(d,n[d]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){let r;Pn(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Hr(t,t?.value):r=new Hr(t.key,t.value);const i=Hl(this.items,r.key),a=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);nn(i.value)&&kB(r.value)?i.value.value=r.value:i.value=r.value}else if(a){const l=this.items.findIndex(c=>a(r,c)<0);l===-1?this.items.push(r):this.items.splice(l,0,r)}else this.items.push(r)}delete(t){const n=Hl(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const i=Hl(this.items,t)?.value;return(!n&&nn(i)?i.value:i)??void 0}has(t){return!!Hl(this.items,t)}set(t,n){this.add(new Hr(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)zB(n,i,a);return i}toString(t,n,r){if(!t)return JSON.stringify(this);for(const i of this.items)if(!Pn(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})),_B(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const Od={collection:"map",default:!0,nodeClass:Ki,tag:"tag:yaml.org,2002:map",resolve(e,t){return ap(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ki.from(e,t,n)};class uc extends CB{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Ad,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=rg(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=rg(t);if(typeof r!="number")return;const i=this.items[r];return!n&&nn(i)?i.value:i}has(t){const n=rg(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=rg(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const i=this.items[r];nn(i)&&kB(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(Qi(a,String(i++),n));return r}toString(t,n,r){return t?_B(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 c of n){if(typeof i=="function"){const d=n instanceof Set?c:String(l++);c=i.call(n,d,c)}a.items.push(Ph(c,void 0,r))}}return a}}function rg(e){let t=nn(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const zd={collection:"seq",default:!0,nodeClass:uc,tag:"tag:yaml.org,2002:seq",resolve(e,t){return sp(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>uc.from(e,t,n)},s0={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),fC(e,t,n,r)}},o0={identify:e=>e==null,createNode:()=>new dt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new dt(null),stringify:({source:e},t)=>typeof e=="string"&&o0.test.test(e)?e:t.options.nullStr},pC={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new dt(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&pC.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 Na({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 c=t-(a.length-l-1);for(;c-- >0;)a+="0"}return a}const TB={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:Na},PB={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():Na(e)}},RB={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 dt(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:Na},l0=e=>typeof e=="bigint"||Number.isInteger(e),mC=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function DB(e,t,n){const{value:r}=e;return l0(r)&&r>=0?n+r.toString(t):Na(e)}const MB={identify:e=>l0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>mC(e,2,8,n),stringify:e=>DB(e,8,"0o")},IB={identify:l0,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>mC(e,0,10,n),stringify:Na},LB={identify:e=>l0(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>mC(e,2,16,n),stringify:e=>DB(e,16,"0x")},Yde=[Od,zd,s0,o0,pC,MB,IB,LB,TB,PB,RB];function FP(e){return typeof e=="bigint"||Number.isInteger(e)}const ig=({value:e})=>JSON.stringify(e),Wde=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:ig},{identify:e=>e==null,createNode:()=>new dt(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ig},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:ig},{identify:FP,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})=>FP(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:ig}],Zde={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Xde=[Od,zd].concat(Wde,Zde),gC={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 c;if(typeof btoa=="function"){let d="";for(let f=0;f<l.length;++f)d+=String.fromCharCode(l[f]);c=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=dt.BLOCK_LITERAL),t!==dt.QUOTE_DOUBLE){const d=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),f=Math.ceil(c.length/d),p=new Array(f);for(let m=0,y=0;m<f;++m,y+=d)p[m]=c.substr(y,d);c=p.join(t===dt.BLOCK_LITERAL?`
|
|
167
|
+
`:" ")}return fC({comment:e,type:t,value:c},r,i,a)}};function $B(e,t){if(sp(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Pn(r)){if(ap(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const i=r.items[0]||new Hr(new dt(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]=Pn(r)?r:new Hr(r)}}else t("Expected a sequence for this tag");return e}function BB(e,t,n){const{replacer:r}=n,i=new uc(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 c,d;if(Array.isArray(l))if(l.length===2)c=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)c=f[0],d=l[c];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else c=l;i.items.push(hC(c,d,n))}return i}const yC={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:$B,createNode:BB};class Yu extends uc{constructor(){super(),this.add=Ki.prototype.add.bind(this),this.delete=Ki.prototype.delete.bind(this),this.get=Ki.prototype.get.bind(this),this.has=Ki.prototype.has.bind(this),this.set=Ki.prototype.set.bind(this),this.tag=Yu.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(Pn(i)?(a=Qi(i.key,"",n),l=Qi(i.value,a,n)):a=Qi(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=BB(t,n,r),a=new this;return a.items=i.items,a}}Yu.tag="tag:yaml.org,2002:omap";const vC={collection:"seq",identify:e=>e instanceof Map,nodeClass:Yu,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=$B(e,t),r=[];for(const{key:i}of n.items)nn(i)&&(r.includes(i.value)?t(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Yu,n)},createNode:(e,t,n)=>Yu.from(e,t,n)};function UB({value:e,source:t},n){return t&&(e?qB:FB).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const qB={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 dt(!0),stringify:UB},FB={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 dt(!1),stringify:UB},Jde={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:Na},efe={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():Na(e)}},tfe={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 dt(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:Na},op=e=>typeof e=="bigint"||Number.isInteger(e);function c0(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 xC(e,t,n){const{value:r}=e;if(op(r)){const i=r.toString(t);return r<0?"-"+n+i.substr(1):n+i}return Na(e)}const nfe={identify:op,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>c0(e,2,2,n),stringify:e=>xC(e,2,"0b")},rfe={identify:op,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>c0(e,1,8,n),stringify:e=>xC(e,8,"0")},ife={identify:op,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>c0(e,0,10,n),stringify:Na},afe={identify:op,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>c0(e,2,16,n),stringify:e=>xC(e,16,"0x")};class Wu extends Ki{constructor(t){super(t),this.tag=Wu.tag}add(t){let n;Pn(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Hr(t.key,null):n=new Hr(t,null),Hl(this.items,n.key)||this.items.push(n)}get(t,n){const r=Hl(this.items,t);return!n&&Pn(r)?nn(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=Hl(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Hr(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(hC(l,null,r));return a}}Wu.tag="tag:yaml.org,2002:set";const bC={collection:"map",identify:e=>e instanceof Set,nodeClass:Wu,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Wu.from(e,t,n),resolve(e,t){if(ap(e)){if(e.hasAllNullValues(!0))return Object.assign(new Wu,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function wC(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,c)=>l*i(60)+i(c),i(0));return n==="-"?i(-1)*a:a}function HB(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return Na(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 KB={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})=>wC(e,n),stringify:HB},GB={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=>wC(e,!1),stringify:HB},u0={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(u0.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,i,a,l,c]=t.map(Number),d=t[7]?Number((t[7]+"00").substr(1,3)):0;let f=Date.UTC(n,r-1,i,a||0,l||0,c||0,d);const p=t[8];if(p&&p!=="Z"){let m=wC(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$/,"")??""},HP=[Od,zd,s0,o0,qB,FB,nfe,rfe,ife,afe,Jde,efe,tfe,gC,zs,vC,yC,bC,KB,GB,u0],KP=new Map([["core",Yde],["failsafe",[Od,zd,s0]],["json",Xde],["yaml11",HP],["yaml-1.1",HP]]),GP={binary:gC,bool:pC,float:RB,floatExp:PB,floatNaN:TB,floatTime:GB,int:IB,intHex:LB,intOct:MB,intTime:KB,map:Od,merge:zs,null:o0,omap:vC,pairs:yC,seq:zd,set:bC,timestamp:u0},sfe={"tag:yaml.org,2002:binary":gC,"tag:yaml.org,2002:merge":zs,"tag:yaml.org,2002:omap":vC,"tag:yaml.org,2002:pairs":yC,"tag:yaml.org,2002:set":bC,"tag:yaml.org,2002:timestamp":u0};function oS(e,t,n){const r=KP.get(t);if(r&&!e)return n&&!r.includes(zs)?r.concat(zs):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{const a=Array.from(KP.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(zs)),i.reduce((a,l)=>{const c=typeof l=="string"?GP[l]:l;if(!c){const d=JSON.stringify(l),f=Object.keys(GP).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${f}`)}return a.includes(c)||a.push(c),a},[])}const ofe=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class SC{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:i,schema:a,sortMapEntries:l,toStringDefaults:c}){this.compat=Array.isArray(t)?oS(t,"compat"):t?oS(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=i?sfe:{},this.tags=oS(n,this.name,r),this.toStringOptions=c??null,Object.defineProperty(this,Fo,{value:Od}),Object.defineProperty(this,Ka,{value:s0}),Object.defineProperty(this,Ad,{value:zd}),this.sortMapEntries=typeof l=="function"?l:l===!0?ofe:null}clone(){const t=Object.create(SC.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function lfe(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=EB(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift("");const d=a(e.commentBefore);n.unshift(As(d,""))}let l=!1,c=null;if(e.contents){if(_n(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const p=a(e.contents.commentBefore);n.push(As(p,""))}i.forceBlockIndent=!!e.comment,c=e.contents.comment}const d=c?void 0:()=>l=!0;let f=od(e.contents,i,()=>c=null,d);c&&(f+=Fl(f,"",a(c))),(f[0]==="|"||f[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${f}`:n.push(f)}else n.push(od(e.contents,i));if(e.directives?.docEnd)if(e.comment){const d=a(e.comment);d.includes(`
|
|
170
|
+
`)?(n.push("..."),n.push(As(d,""))):n.push(`... ${d}`)}else n.push("...");else{let d=e.comment;d&&l&&(d=d.replace(/^\n+/,"")),d&&((!l||c)&&n[n.length-1]!==""&&n.push(""),n.push(As(a(d),"")))}return n.join(`
|
|
171
|
+
`)+`
|
|
172
|
+
`}class d0{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Wi,{value:I1});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 Br({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,i,r)}clone(){const t=Object.create(d0.prototype,{[Wi]:{value:I1}});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=_n(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Su(this.contents)&&this.contents.add(t)}addIn(t,n){Su(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=jB(this);t.anchor=!n||r.has(n)?NB(n||"a",r):n}return new dC(t.anchor)}createNode(t,n,r){let i;if(typeof n=="function")t=n.call({"":t},"",t),i=n;else if(Array.isArray(n)){const j=E=>typeof E=="number"||E instanceof String||E instanceof Number,k=n.filter(j).map(String);k.length>0&&(n=n.concat(k)),i=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:l,flow:c,keepUndefined:d,onTagObj:f,tag:p}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:v}=Dde(this,l||"a"),w={aliasDuplicateObjects:a??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:v},b=Ph(t,p,w);return c&&zn(b)&&(b.flow=!0),y(),b}createPair(t,n,r={}){const i=this.createNode(t,null,r),a=this.createNode(n,null,r);return new Hr(i,a)}delete(t){return Su(this.contents)?this.contents.delete(t):!1}deleteIn(t){return ah(t)?this.contents==null?!1:(this.contents=null,!0):Su(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return zn(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return ah(t)?!n&&nn(this.contents)?this.contents.value:this.contents:zn(this.contents)?this.contents.getIn(t,n):void 0}has(t){return zn(this.contents)?this.contents.has(t):!1}hasIn(t){return ah(t)?this.contents!==void 0:zn(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=wy(this.schema,[t],n):Su(this.contents)&&this.contents.set(t,n)}setIn(t,n){ah(t)?this.contents=n:this.contents==null?this.contents=wy(this.schema,Array.from(t),n):Su(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 Br({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 Br({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 SC(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 c={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},d=Qi(this.contents,n??"",c);if(typeof a=="function")for(const{count:f,res:p}of c.anchors.values())a(p,f);return typeof l=="function"?Lu(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 lfe(this,t)}}function Su(e){if(zn(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 ag extends VB{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class cfe extends VB{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const VP=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(c=>t.linePos(c));const{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(a>=60&&l.length>80){const c=Math.min(a-39,l.length-79);l="…"+l.substring(c),a-=c-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,a))){let c=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);c.length>80&&(c=c.substring(0,79)+`…
|
|
173
|
+
`),l=c+l}if(/[^ ]/.test(l)){let c=1;const d=n.linePos[1];d?.line===r&&d.col>i&&(c=Math.max(1,Math.min(d.col-i,80-a)));const f=" ".repeat(a)+"^".repeat(c);n.message+=`:
|
|
174
|
+
|
|
175
|
+
${l}
|
|
176
|
+
${f}
|
|
177
|
+
`}};function ld(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:l,startOnNewline:c}){let d=!1,f=c,p=c,m="",y="",v=!1,w=!1,b=null,j=null,k=null,E=null,A=null,C=null,_=null;for(const R of e)switch(w&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&a(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),b&&(f&&R.type!=="comment"&&R.type!=="newline"&&a(b,"TAB_AS_INDENT","Tabs are not allowed as indentation"),b=null),R.type){case"space":!t&&(n!=="doc-start"||r?.type!=="flow-collection")&&R.source.includes(" ")&&(b=R),p=!0;break;case"comment":{p||a(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=R.source.substring(1)||" ";m?m+=y+$:m=$,y="",f=!1;break}case"newline":f?m?m+=R.source:(!C||n!=="seq-item-ind")&&(d=!0):y+=R.source,f=!0,v=!0,(j||k)&&(E=R),p=!0;break;case"anchor":j&&a(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&a(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=R,_??(_=R.offset),f=!1,p=!1,w=!0;break;case"tag":{k&&a(R,"MULTIPLE_TAGS","A node can have at most one tag"),k=R,_??(_=R.offset),f=!1,p=!1,w=!0;break}case n:(j||k)&&a(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),C&&a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),C=R,f=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){A&&a(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),A=R,f=!1,p=!1;break}default:a(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),f=!1,p=!1}const O=e[e.length-1],z=O?O.offset+O.source.length:i;return w&&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:A,found:C,spaceBefore:d,comment:m,hasNewline:v,anchor:j,tag:k,newlineAfterProp:E,end:z,start:_??z}}function Rh(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(Rh(t.key)||Rh(t.value))return!0}return!1;default:return!0}}function U1(e,t,n){if(t?.type==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Rh(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function QB(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const i=typeof r=="function"?r:(a,l)=>a===l||nn(a)&&nn(l)&&a.value===l.value;return t.some(a=>i(a.key,n))}const QP="All mapping items must start at the same column";function ufe({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??Ki,c=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:y,sep:v,value:w}=p,b=ld(m,{indicator:"explicit-key-ind",next:y??v?.[0],offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0}),j=!b.found;if(j){if(y&&(y.type==="block-seq"?i(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==r.indent&&i(d,"BAD_INDENT",QP)),!b.anchor&&!b.tag&&!v){f=b.end,b.comment&&(c.comment?c.comment+=`
|
|
179
|
+
`+b.comment:c.comment=b.comment);continue}(b.newlineAfterProp||Rh(y))&&i(y??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else b.found?.indent!==r.indent&&i(d,"BAD_INDENT",QP);n.atKey=!0;const k=b.end,E=y?e(n,y,b,i):t(n,k,m,null,b,i);n.schema.compat&&U1(r.indent,y,i),n.atKey=!1,QB(n,c.items,E)&&i(k,"DUPLICATE_KEY","Map keys must be unique");const A=ld(v??[],{indicator:"map-value-ind",next:w,offset:E.range[2],onError:i,parentIndent:r.indent,startOnNewline:!y||y.type==="block-scalar"});if(d=A.end,A.found){j&&(w?.type==="block-map"&&!A.hasNewline&&i(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&b.start<A.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 C=w?e(n,w,A,i):t(n,d,v,null,A,i);n.schema.compat&&U1(r.indent,w,i),d=C.range[2];const _=new Hr(E,C);n.options.keepSourceTokens&&(_.srcToken=p),c.items.push(_)}else{j&&i(E.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(E.comment?E.comment+=`
|
|
180
|
+
`+A.comment:E.comment=A.comment);const C=new Hr(E);n.options.keepSourceTokens&&(C.srcToken=p),c.items.push(C)}}return f&&f<d&&i(f,"IMPOSSIBLE","Map comment with trailing content"),c.range=[r.offset,d,f??d],c}function dfe({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=a?.nodeClass??uc,c=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 y=ld(p,{indicator:"seq-item-ind",next:m,offset:d,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)m?.type==="block-seq"?i(y.end,"BAD_INDENT","All sequence items must start at the same column"):i(d,"MISSING_CHAR","Sequence item without - indicator");else{f=y.end,y.comment&&(c.comment=y.comment);continue}const v=m?e(n,m,y,i):t(n,y.end,p,null,y,i);n.schema.compat&&U1(r.indent,m,i),d=v.range[2],c.items.push(v)}return c.range=[r.offset,d,f??d],c}function lp(e,t,n,r){let i="";if(e){let a=!1,l="";for(const c of e){const{source:d,type:f}=c;switch(f){case"space":a=!0;break;case"comment":{n&&!a&&r(c,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=d.substring(1)||" ";i?i+=l+p:i=p,l="";break}case"newline":i&&(l+=d),a=!0;break;default:r(c,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}t+=d.length}}return{comment:i,offset:t}}const lS="Block collections are not allowed within flow collections",cS=e=>e&&(e.type==="block-map"||e.type==="block-seq");function ffe({composeNode:e,composeEmptyNode:t},n,r,i,a){const l=r.start.source==="{",c=l?"flow map":"flow sequence",d=a?.nodeClass??(l?Ki:uc),f=new d(n.schema);f.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let j=0;j<r.items.length;++j){const k=r.items[j],{start:E,key:A,sep:C,value:_}=k,O=ld(E,{flow:c,indicator:"explicit-key-ind",next:A??C?.[0],offset:m,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!C&&!_){j===0&&O.comma?i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`):j<r.items.length-1&&i(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${c}`),O.comment&&(f.comment?f.comment+=`
|
|
181
|
+
`+O.comment:f.comment=O.comment),m=O.end;continue}!l&&n.options.strict&&Rh(A)&&i(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(j===0)O.comma&&i(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${c}`);else if(O.comma||i(O.start,"MISSING_CHAR",`Missing , between ${c} items`),O.comment){let z="";e:for(const R of E)switch(R.type){case"comma":case"space":break;case"comment":z=R.source.substring(1);break e;default:break e}if(z){let R=f.items[f.items.length-1];Pn(R)&&(R=R.value??R.key),R.comment?R.comment+=`
|
|
182
|
+
`+z:R.comment=z,O.comment=O.comment.substring(z.length+1)}}if(!l&&!C&&!O.found){const z=_?e(n,_,O,i):t(n,O.end,C,null,O,i);f.items.push(z),m=z.range[2],cS(_)&&i(z.range,"BLOCK_IN_FLOW",lS)}else{n.atKey=!0;const z=O.end,R=A?e(n,A,O,i):t(n,z,E,null,O,i);cS(A)&&i(R.range,"BLOCK_IN_FLOW",lS),n.atKey=!1;const $=ld(C??[],{flow:c,indicator:"map-value-ind",next:_,offset:R.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if($.found){if(!l&&!O.found&&n.options.strict){if(C)for(const U of C){if(U===$.found)break;if(U.type==="newline"){i(U,"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 _&&("source"in _&&_.source?.[0]===":"?i(_,"MISSING_CHAR",`Missing space after : in ${c}`):i($.start,"MISSING_CHAR",`Missing , or : between ${c} items`));const F=_?e(n,_,$,i):$.found?t(n,$.end,C,null,$,i):null;F?cS(_)&&i(F.range,"BLOCK_IN_FLOW",lS):$.comment&&(R.comment?R.comment+=`
|
|
183
|
+
`+$.comment:R.comment=$.comment);const M=new Hr(R,F);if(n.options.keepSourceTokens&&(M.srcToken=k),l){const U=f;QB(n,U.items,R)&&i(z,"DUPLICATE_KEY","Map keys must be unique"),U.items.push(M)}else{const U=new Ki(n.schema);U.flow=!0,U.items.push(M);const K=(F??R).range;U.range=[R.range[0],K[1],K[2]],f.items.push(U)}m=F?F.range[2]:$.end}}const y=l?"}":"]",[v,...w]=r.end;let b=m;if(v?.source===y)b=v.offset+v.source.length;else{const j=c[0].toUpperCase()+c.substring(1),k=p?`${j} must end with a ${y}`:`${j} in block collection must be sufficiently indented and end with a ${y}`;i(m,p?"MISSING_CHAR":"BAD_INDENT",k),v&&v.source.length!==1&&w.unshift(v)}if(w.length>0){const j=lp(w,b,n.options.strict,i);j.comment&&(f.comment?f.comment+=`
|
|
184
|
+
`+j.comment:f.comment=j.comment),f.range=[r.offset,b,j.offset]}else f.range=[r.offset,b,b];return f}function uS(e,t,n,r,i,a){const l=n.type==="block-map"?ufe(e,t,n,r,a):n.type==="block-seq"?dfe(e,t,n,r,a):ffe(e,t,n,r,a),c=l.constructor;return i==="!"||i===c.tagName?(l.tag=c.tagName,l):(i&&(l.tag=i),l)}function hfe(e,t,n,r,i){const a=r.tag,l=a?t.directives.tagName(a.source,y=>i(a,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:v}=r,w=y&&a?y.offset>a.offset?y:a:y??a;w&&(!v||v.offset<w.offset)&&i(w,"MISSING_CHAR","Missing newline after block sequence props")}const c=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!l||l==="!"||l===Ki.tagName&&c==="map"||l===uc.tagName&&c==="seq")return uS(e,t,n,i,l);let d=t.schema.tags.find(y=>y.tag===l&&y.collection===c);if(!d){const y=t.schema.knownTags[l];if(y?.collection===c)t.schema.tags.push(Object.assign({},y,{default:!1})),d=y;else return y?i(a,"BAD_COLLECTION_TYPE",`${y.tag} used for ${c} collection, but expects ${y.collection??"scalar"}`,!0):i(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),uS(e,t,n,i,l)}const f=uS(e,t,n,i,l,d),p=d.resolve?.(f,y=>i(a,"TAG_RESOLVE_FAILED",y),t.options)??f,m=_n(p)?p:new dt(p);return m.range=f.range,m.tag=l,d?.format&&(m.format=d.format),m}function pfe(e,t,n){const r=t.offset,i=mfe(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const a=i.mode===">"?dt.BLOCK_FOLDED:dt.BLOCK_LITERAL,l=t.source?gfe(t.source):[];let c=l.length;for(let b=l.length-1;b>=0;--b){const j=l[b][1];if(j===""||j==="\r")c=b;else break}if(c===0){const b=i.chomp==="+"&&l.length>0?`
|
|
185
|
+
`.repeat(Math.max(1,l.length-1)):"";let j=r+i.length;return t.source&&(j+=t.source.length),{value:b,type:a,comment:i.comment,range:[r,j,j]}}let d=t.indent+i.indent,f=t.offset+i.length,p=0;for(let b=0;b<c;++b){const[j,k]=l[b];if(k===""||k==="\r")i.indent===0&&j.length>d&&(d=j.length);else{j.length<d&&n(f+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(d=j.length),p=b,d===0&&!e.atRoot&&n(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=j.length+k.length+1}for(let b=l.length-1;b>=c;--b)l[b][0].length>d&&(c=b+1);let m="",y="",v=!1;for(let b=0;b<p;++b)m+=l[b][0].slice(d)+`
|
|
186
|
+
`;for(let b=p;b<c;++b){let[j,k]=l[b];f+=j.length+k.length+1;const E=k[k.length-1]==="\r";if(E&&(k=k.slice(0,-1)),k&&j.length<d){const C=`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",C),j=""}a===dt.BLOCK_LITERAL?(m+=y+j.slice(d)+k,y=`
|
|
187
|
+
`):j.length>d||k[0]===" "?(y===" "?y=`
|
|
188
|
+
`:!v&&y===`
|
|
189
|
+
`&&(y=`
|
|
190
|
+
|
|
191
|
+
`),m+=y+j.slice(d)+k,y=`
|
|
192
|
+
`,v=!0):k===""?y===`
|
|
193
|
+
`?m+=`
|
|
194
|
+
`:y=`
|
|
195
|
+
`:(m+=y+k,y=" ",v=!1)}switch(i.chomp){case"-":break;case"+":for(let b=c;b<l.length;++b)m+=`
|
|
196
|
+
`+l[b][0].slice(d);m[m.length-1]!==`
|
|
197
|
+
`&&(m+=`
|
|
198
|
+
`);break;default:m+=`
|
|
199
|
+
`}const w=r+i.length+t.source.length;return{value:m,type:a,comment:i.comment,range:[r,w,w]}}function mfe({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,c="",d=-1;for(let y=1;y<i.length;++y){const v=i[y];if(!c&&(v==="-"||v==="+"))c=v;else{const w=Number(v);!l&&w?l=w:d===-1&&(d=e+y)}}d!==-1&&r(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,p="",m=i.length;for(let y=1;y<t.length;++y){const v=t[y];switch(v.type){case"space":f=!0;case"newline":m+=v.source.length;break;case"comment":n&&!f&&r(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=v.source.length,p=v.source.substring(1);break;case"error":r(v,"UNEXPECTED_TOKEN",v.message),m+=v.source.length;break;default:{const w=`Unexpected token in block scalar header: ${v.type}`;r(v,"UNEXPECTED_TOKEN",w);const b=v.source;b&&typeof b=="string"&&(m+=b.length)}}}return{mode:a,indent:l,chomp:c,comment:p,length:m}}function gfe(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 yfe(e,t,n){const{offset:r,type:i,source:a,end:l}=e;let c,d;const f=(y,v,w)=>n(r+y,v,w);switch(i){case"scalar":c=dt.PLAIN,d=vfe(a,f);break;case"single-quoted-scalar":c=dt.QUOTE_SINGLE,d=xfe(a,f);break;case"double-quoted-scalar":c=dt.QUOTE_DOUBLE,d=bfe(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=lp(l,p,t,n);return{value:d,type:c,comment:m.comment,range:[r,p,m.offset]}}function vfe(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}`),YB(e)}function xfe(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),YB(e.slice(1,-1)).replace(/''/g,"'")}function YB(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 c=/[ \t]*(.*)/sy;return c.lastIndex=l,r=c.exec(e),i+a+(r?.[1]??"")}function bfe(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}=wfe(e,r);n+=a,r=l}else if(i==="\\"){let a=e[++r];const l=Sfe[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 c={x:2,u:4,U:8}[a];n+=jfe(e,r+1,c,t),r+=c}else{const c=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),n+=c}}else if(i===" "||i===" "){const a=r;let 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 wfe(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 Sfe={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
214
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function jfe(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 c=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${c}`),c}return String.fromCodePoint(l)}function WB(e,t,n,r){const{value:i,type:a,comment:l,range:c}=t.type==="block-scalar"?pfe(e,t,r):yfe(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[Ka]:d?f=Nfe(e.schema,i,d,n,r):t.type==="scalar"?f=kfe(e,i,t,r):f=e.schema[Ka];let p;try{const m=f.resolve(i,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);p=nn(m)?m:new dt(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),p=new dt(i)}return p.range=c,p.source=i,a&&(p.type=a),d&&(p.tag=d),f.format&&(p.format=f.format),l&&(p.comment=l),p}function Nfe(e,t,n,r,i){if(n==="!")return e[Ka];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if(c.test?.test(t))return c;const 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[Ka])}function kfe({atKey:e,directives:t,schema:n},r,i,a){const l=n.tags.find(c=>(c.default===!0||e&&c.default==="key")&&c.test?.test(r))||n[Ka];if(n.compat){const c=n.compat.find(d=>d.default&&d.test?.test(r))??n[Ka];if(l.tag!==c.tag){const d=t.tagString(l.tag),f=t.tagString(c.tag),p=`Value may be parsed as either ${d} or ${f}`;a(i,"TAG_RESOLVE_FAILED",p,!0)}}return l}function Cfe(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 Afe={composeNode:ZB,composeEmptyNode:jC};function ZB(e,t,n,r){const i=e.atKey,{spaceBefore:a,comment:l,anchor:c,tag:d}=n;let f,p=!0;switch(t.type){case"alias":f=Efe(e,t,r),(c||d)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=WB(e,t,d,r),c&&(f.anchor=c.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=hfe(Afe,e,t,n,r),c&&(f.anchor=c.source.substring(1));break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),f=jC(e,t.offset,void 0,null,n,r),p=!1}}return c&&f.anchor===""&&r(c,"BAD_ALIAS","Anchor cannot be an empty string"),i&&e.options.stringKeys&&(!nn(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 jC(e,t,n,r,{spaceBefore:i,comment:a,anchor:l,tag:c,end:d},f){const p={type:"scalar",offset:Cfe(t,n,r),indent:-1,source:""},m=WB(e,p,c,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 Efe({options:e},{offset:t,source:n,end:r},i){const a=new dC(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,c=lp(r,l,e.strict,i);return a.range=[t,l,c.offset],c.comment&&(a.comment=c.comment),a}function Ofe(e,t,{offset:n,start:r,value:i,end:a},l){const c=Object.assign({_directives:t},e),d=new d0(void 0,c),f={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},p=ld(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?ZB(f,i,p,l):jC(f,p.end,r,null,p,l);const m=d.contents.range[2],y=lp(a,m,!1,l);return y.comment&&(d.comment=y.comment),d.range=[n,m,y.offset],d}function Hf(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 YP(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 zfe{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,a)=>{const l=Hf(n);a?this.warnings.push(new cfe(l,r,i)):this.errors.push(new ag(l,r,i))},this.directives=new Br({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:i}=YP(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(zn(a)&&!a.flow&&a.items.length>0){let l=a.items[0];Pn(l)&&(l=l.key);const c=l.commentBefore;l.commentBefore=c?`${r}
|
|
219
|
+
${c}`: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:YP(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=Hf(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",r,i)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=Ofe(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 ag(Hf(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 ag(Hf(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=lp(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 ag(Hf(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 d0(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 XB="\uFEFF",JB="",e6="",q1="";function _fe(e){switch(e){case XB:return"byte-order-mark";case JB:return"doc-mode";case e6:return"flow-error-end";case q1: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 fa(e){switch(e){case void 0:case" ":case`
|
|
224
|
+
`:case"\r":case" ":return!0;default:return!1}}const WP=new Set("0123456789ABCDEFabcdef"),Tfe=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),sg=new Set(",[]{}"),Pfe=new Set(` ,[]{}
|
|
225
|
+
\r `),dS=e=>!e||Pfe.has(e);class Rfe{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==="...")&&fa(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]===XB&&(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 JB,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==="...")&&fa(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&&!fa(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===":")&&fa(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(dS),"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("..."))&&fa(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield e6,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(dS),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||fa(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=>fa(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 c=a;for(;l===" ";)l=this.buffer[--a];if(l===`
|
|
237
|
+
`&&a>=this.pos&&a+1+n>c)t=a;else break}while(!0);return yield q1,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(fa(a)||t&&sg.has(a))break;n=r}else if(fa(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&&sg.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&&sg.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield q1,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(dS))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(fa(n)||t&&sg.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(;!fa(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(Tfe.has(n))n=this.buffer[++t];else if(n==="%"&&WP.has(this.buffer[t+1])&&WP.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 Dfe{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 Oo(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function ZP(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 t6(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 og(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 ju(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 XP(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Oo(t.start,"explicit-key-ind")&&!Oo(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,t6(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 Mfe{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 Rfe,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=_fe(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"&&XP(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&&ZP(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":{ZP(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=og(this.peek(2)),r=ju(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 c=0;c<n.sep.length;++c){const d=n.sep[c];switch(d.type){case"newline":l.push(c);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(Oo(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(t6(n.key)&&!Oo(n.sep,"newline")){const l=ju(n.start),c=n.key,d=n.sep;d.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:d}]})}else a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(Oo(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=ju(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]}):Oo(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&&!Oo(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||Oo(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=og(r),a=ju(i);XP(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const c={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]=c}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
245
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
246
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=og(t),r=ju(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=og(t),r=ju(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 Ife(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Dfe||null,prettyErrors:t}}function Lfe(e,t={}){const{lineCounter:n,prettyErrors:r}=Ife(t),i=new Mfe(n?.addNewLine),a=new zfe(t),l=Array.from(a.compose(i.parse(e)));if(r&&n)for(const c of l)c.errors.forEach(VP(e,n)),c.warnings.forEach(VP(e,n));return l.length>0?l:Object.assign([],{empty:!0},a.streamInfo())}function $fe({onApplied:e}){const[t,n]=x.useState(""),[r,i]=x.useState(!1),[a,l]=x.useState([]),[c,d]=x.useState([]),f=async()=>{if(!t.trim())return;i(!0),l([]),d([]);const p=Lfe(t),m=[],y=[];for(let v=0;v<p.length;v++){const w=p[v];if(w.errors.length>0){m.push(`Document ${v+1}: ${w.errors[0]?.message}`);continue}const b=w.toJSON();if(!(!b||typeof b!="object"))try{const j=await ZV(b);y.push(`Applied "${j.displayName||j.name}" (revision ${j.configRevision})`)}catch(j){m.push(`Document ${v+1}: ${j instanceof Error?j.message:String(j)}`)}}l(y),d(m),i(!1),y.length>0&&(ut({title:"YAML applied",detail:`Applied ${y.length} document${y.length===1?"":"s"} successfully.`,tone:m.length>0?"caution":"positive",dedupeKey:"yaml:apply",dedupeMode:"replace"}),e())};return 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))}),c.length>0&&s.jsx("ul",{className:"mt-2 space-y-1",children:c.map((p,m)=>s.jsx("li",{className:"text-rose-400 text-sm",children:p},m))}),s.jsx("div",{className:"mt-3",children:s.jsx(pe,{type:"button",disabled:!t.trim()||r,onClick:Ke(f),children:r?"Applying...":"Apply"})})]})}function Bfe(){const{dashboard:e,isLoading:t,refetch:n}=Cc();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","Mentions","Last run","Country"].map(z=>s.jsx("div",{className:"skeleton-text-sm w-16"},z))}),[1,2,3].map(z=>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"})]},z))]})]});const r=e.projects,i=el(),[a,l]=x.useState(!1),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState("US"),[b,j]=x.useState("en"),[k,E]=x.useState(!1),[A,C]=x.useState(null),_=c.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),O=async()=>{if(!(!_||!m)){E(!0),C(null);try{const z=await ep(_,{displayName:f||c,canonicalDomain:m,country:v,language:b});ut({title:"Project created",detail:`${z.displayName||z.name} is ready to configure.`,tone:"positive",dedupeKey:`project:create:${z.name}`,dedupeMode:"drop"}),n(),d(""),p(""),y(""),w("US"),j("en"),l(!1),i({to:"/projects/$projectId",params:{projectId:z.id}})}catch(z){C(z instanceof Error?z.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(pe,{type:"button",onClick:()=>l(z=>!z),children:[s.jsx(sy,{className:"size-4 mr-1.5"}),"Add project"]})})]}),a?s.jsxs(Pe,{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:c,onChange:z=>d(z.target.value)}),_&&_!==c?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",_]}):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:z=>p(z.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:z=>y(z.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:z=>w(z.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:z=>j(z.target.value.toLowerCase())})]})]})]}),A?s.jsx("p",{className:"text-rose-400 text-sm mt-3",children:A}):null,s.jsxs("div",{className:"flex items-center gap-3 mt-4",children:[s.jsx(pe,{type:"button",disabled:!_||!m||k,onClick:Ke(O),children:k?"Creating...":"Create project"}),s.jsx(pe,{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:"Mentions"}),s.jsx("th",{children:"Last run"}),s.jsx("th",{className:"text-right",children:"Country"})]})}),s.jsx("tbody",{children:r.map(z=>{const R=z.recentRuns[0];return s.jsxs("tr",{className:"cursor-pointer",onClick:()=>{i({to:"/projects/$projectId",params:{projectId:z.project.id}})},children:[s.jsxs("td",{children:[s.jsx(zt,{to:"/projects/$projectId",params:{projectId:z.project.id},className:"text-zinc-100 font-medium hover:underline",onClick:$=>$.stopPropagation(),children:z.project.displayName||z.project.name}),s.jsx("p",{className:"text-[11px] text-zinc-500",children:z.project.name})]}),s.jsx("td",{className:"text-zinc-400",children:z.project.canonicalDomain}),s.jsx("td",{children:s.jsx(ot,{tone:z.mentionSummary.tone,children:z.mentionSummary.value})}),s.jsx("td",{className:"text-zinc-500 text-sm",children:R?s.jsx(Uv,{status:R.status}):s.jsx("span",{className:"text-zinc-600",children:"No runs"})}),s.jsx("td",{className:"text-right text-zinc-500",children:z.project.country})]},z.project.id)})})]})}):a?null:s.jsxs(Pe,{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(pe,{type:"button",onClick:()=>l(!0),children:[s.jsx(sy,{className:"size-4 mr-1.5"}),"Add project"]})]}),s.jsx($fe,{onApplied:()=>{n()}})]})}function F1({state:e,label:t}){return s.jsx(ot,{tone:Qne(e),children:t??Lv(e)})}function n6({run:e}){const{openRun:t}=Nd();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(Uv,{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(pe,{variant:"outline",size:"sm",type:"button",onClick:()=>t(e.id),children:"View run"})]})}function JP({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,c)=>s.jsx("div",{className:`h-2.5 w-2.5 rounded-sm ${r[l.citationState]??"bg-zinc-700"} ${l.model&&c>0&&n[c-1]?.model&&n[c-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&&c>0&&n[c-1]?.model&&n[c-1].model!==l.model?"model changed":null].filter(Boolean).join(" — ")},c))}),s.jsx("span",{className:"text-[9px] text-zinc-600 shrink-0",children:a})]})}function Ufe(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"}))}const qfe=320;function eR(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 tR(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 nR(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 c=e.length-1;c>=0&&e[c].citationState===i;c--)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 Ffe(e,t){return t==="citations"?e:e.map(n=>({...n,citationState:eR(n,t),runHistory:n.runHistory.map(r=>({...r,citationState:eR(r,t)}))}))}function Hfe({evidence:e,compareLocations:t=!1,defaultDensity:n="detailed"}){const{openEvidence:r}=Nd(),[i,a]=x.useState(new Set),[l,c]=x.useState("mentions"),[d,f]=x.useState(n),p=x.useMemo(()=>{const b=Ffe(e,l),j=new Map;for(const k of b){const E=k.query,A=t?k.location??null:null,C=t?JSON.stringify([E,A]):E,_=j.get(C)??{key:C,phrase:E,location:A,items:[]};_.items.push(k),j.set(C,_)}return[...j.values()]},[e,l,t]),m=b=>{a(j=>{const k=new Set(j);return k.has(b)?k.delete(b):k.add(b),k})},y=l==="mentions"?"mentioned":"cited",v=l==="mentions"?"Mention History":"Citation History",w=l==="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":l==="mentions",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${l==="mentions"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>c("mentions"),children:"Mentions"}),s.jsx("button",{type:"button",role:"tab","aria-selected":l==="citations",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${l==="citations"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>c("citations"),children:"Citations"})]}),s.jsx("span",{className:"text-[11px] text-zinc-500",children:l==="mentions"?"Brand or domain in answer text":"Brand or domain in source links"}),s.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[s.jsx("button",{type:"button",className:"text-[11px] text-zinc-400 hover:text-zinc-200",onClick:()=>{a(b=>b.size===p.length?new Set:new Set(p.map(j=>j.key)))},children:i.size===p.length&&p.length>0?"Collapse all":"Expand all"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Density"}),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":"Evidence row density",children:[s.jsx("button",{type:"button",role:"tab","aria-selected":d==="compact",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${d==="compact"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>f("compact"),children:"Compact"}),s.jsx("button",{type:"button",role:"tab","aria-selected":d==="detailed",className:`px-2.5 py-1 text-xs font-medium rounded transition-colors ${d==="detailed"?"bg-zinc-800 text-zinc-100":"text-zinc-400 hover:text-zinc-200"}`,onClick:()=>f("detailed"),children:"Detailed"})]})]})]})]}),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:v}),s.jsx("th",{children:"Change"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:p.map(({key:b,phrase:j,location:k,items:E})=>{const A=i.has(b),C=E.map($=>$.citationState),_=C.includes("cited")?"cited":C.includes("emerging")?"emerging":C.includes("lost")?"lost":C.every($=>$==="pending")?"pending":"not-cited",O=Ufe(E),z=E.filter($=>$.citationState===Oh.cited||$.citationState==="emerging").length,R=nR(O,l);return s.jsxs(x.Fragment,{children:[s.jsxs("tr",{className:"evidence-phrase-row cursor-pointer hover:bg-zinc-800/40",onClick:()=>m(b),"aria-expanded":A,children:[s.jsx("td",{children:s.jsx(tp,{size:14,className:`transition-transform duration-150 text-zinc-500 ${A?"rotate-90":""}`})}),s.jsx("td",{className:"evidence-query-cell",children:s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-zinc-100",children:j}),t&&s.jsx("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-500",children:k??"No location"}),s.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:E.map($=>s.jsx(lc,{provider:$.provider},$.id))})]})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(F1,{state:_,label:tR(_,l)}),s.jsxs("span",{className:"text-[11px] text-zinc-500",title:`${z} of ${E.length} engines ${w}`,children:[z,"/",E.length]})]})}),s.jsx("td",{children:s.jsx(JP,{history:O})}),s.jsx("td",{className:"evidence-change-cell",children:R}),s.jsx("td",{})]}),A&&E.map($=>s.jsxs(x.Fragment,{children:[s.jsxs("tr",{className:"bg-zinc-900/30",children:[s.jsx("td",{}),s.jsx("td",{className:"evidence-query-cell pl-5",children:s.jsx(lc,{provider:$.provider})}),s.jsx("td",{children:s.jsx(F1,{state:$.citationState,label:tR($.citationState,l)})}),s.jsx("td",{children:s.jsx(JP,{history:$.runHistory})}),s.jsx("td",{className:"evidence-change-cell",children:nR($.runHistory,l)}),s.jsx("td",{children:s.jsx(pe,{variant:"ghost",size:"sm",type:"button",onClick:F=>{F.stopPropagation(),r($.id)},children:"View"})})]}),d==="detailed"&&s.jsxs("tr",{className:"bg-zinc-900/20",children:[s.jsx("td",{}),s.jsx("td",{colSpan:5,className:"px-5 pb-4",children:s.jsx(Vfe,{item:$,onViewFull:()=>r($.id)})})]})]},$.id))]},b)})})]})}),s.jsxs("p",{className:"sr-only","aria-live":"polite",children:["Showing ",y==="cited"?"citations (sources)":"mentions (answer text)","."]})]})}function Kfe(e){const t=(e.matchedTerms??[]).filter(i=>i.trim().length>2),n=[...e.competitorDomains.flatMap(i=>{const a=i3(i);return a.length>=4?[a]:[]}),...e.recommendedCompetitors??[]].filter(i=>i.trim().length>2),r=[];return t.length>0&&r.push({terms:t,className:"answer-highlight-brand"}),n.length>0&&r.push({terms:n,className:"answer-highlight-competitor"}),r}function Gfe(e,t){if(e.length<=t)return{body:e,truncated:!1};const n=e.lastIndexOf(" ",t);return{body:`${e.slice(0,n>t-40?n:t).trimEnd()}…`,truncated:!0}}function Vfe({item:e,onViewFull:t}){if(!(e.answerSnippet.trim().length>0))return s.jsx("p",{className:"text-[11px] text-zinc-500 italic",children:"No answer text captured for this run."});const{body:r,truncated:i}=Gfe(e.answerSnippet,qfe),a=Kfe(e);return s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Answer text"}),s.jsx("p",{className:"text-sm leading-relaxed text-zinc-300",children:j1(r,a)}),(e.citedDomains.length>0||e.competitorDomains.length>0)&&s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.citedDomains.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited:"}),e.citedDomains.slice(0,6).map(l=>s.jsx("span",{className:"rounded-full border border-zinc-700/60 bg-zinc-900/60 px-2 py-0.5 text-[11px] text-zinc-300",children:l},`c-${l}`)),e.citedDomains.length>6&&s.jsxs("span",{className:"text-[10px] text-zinc-500",children:["+",e.citedDomains.length-6," more"]})]}),e.competitorDomains.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ml-2 text-[10px] uppercase tracking-wide text-rose-500/80",children:"Competitors:"}),e.competitorDomains.slice(0,4).map(l=>s.jsx("span",{className:"rounded-full border border-rose-900/40 bg-rose-950/30 px-2 py-0.5 text-[11px] text-rose-300",children:l},`co-${l}`)),e.competitorDomains.length>4&&s.jsxs("span",{className:"text-[10px] text-zinc-500",children:["+",e.competitorDomains.length-4," more"]})]})]}),i&&s.jsx("button",{type:"button",className:"text-[11px] font-medium text-emerald-400 hover:text-emerald-300",onClick:l=>{l.stopPropagation(),t()},children:"View full answer →"})]})}function Qfe({competitors:e,onSelectCompetitor:t,activeFilter:n}){if(e.length===0)return s.jsx("p",{className:"text-sm text-zinc-500",children:"No competitors configured. Add competitors to track overlap."});const r=t!=null;return 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(i=>{const a=n!=null&&n.toLowerCase()===i.domain.toLowerCase(),l=[r?"cursor-pointer hover:bg-zinc-800/30 transition-colors":"",a?"bg-rose-950/20":""].filter(Boolean).join(" ");return s.jsxs("tr",{className:l,onClick:r?()=>t(i.domain):void 0,title:r?`Filter answers to queries where ${i.domain} surfaced`:void 0,children:[s.jsx("td",{className:"font-medium text-zinc-100",children:i.domain}),s.jsx("td",{children:s.jsx(ot,{tone:Yne(i.pressureLabel),children:i.pressureLabel})}),s.jsx("td",{className:"text-zinc-300 tabular-nums",children:i.totalQueries>0?`${i.citationCount} / ${i.totalQueries}`:"—"}),s.jsx("td",{className:"text-zinc-500 text-xs",children:i.citedQueries.length>0?i.citedQueries.join(", "):"Not cited"})]},i.id)})})]})})}function rR({eyebrow:e,title:t,status:n,tone:r,targetLabel:i,targetValue:a,coverageValue:l,note:c,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(ot,{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:c}),s.jsx("span",{children:d?`Updated ${ma(d)}`:"No recent sync yet"})]})]})}function lg({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 Yfe=["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 NC(e){if(typeof e!="string")return!1;var t=Yfe;return t.includes(e)}var Wfe=["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"],Zfe=new Set(Wfe);function r6(e){return typeof e!="string"?!1:Zfe.has(e)}function i6(e){return typeof e=="string"&&e.startsWith("data-")}function Zi(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r6(n)||i6(n))&&(t[n]=e[n]);return t}function cp(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Zi(t)}return typeof e=="object"&&!Array.isArray(e)?Zi(e):null}function Gr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r6(n)||i6(n)||NC(n))&&(t[n]=e[n]);return t}function Xfe(e){return e==null?null:x.isValidElement(e)?Gr(e.props):typeof e=="object"&&!Array.isArray(e)?Gr(e):null}var Jfe=["children","width","height","viewBox","className","style","title","desc"];function H1(){return H1=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},H1.apply(null,arguments)}function ehe(e,t){if(e==null)return{};var n,r,i=the(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 the(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 kC=x.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:c,title:d,desc:f}=e,p=ehe(e,Jfe),m=a||{width:r,height:i,x:0,y:0},y=$t("recharts-surface",l);return x.createElement("svg",H1({},Gr(p),{className:y,width:r,height:i,style:c,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),x.createElement("title",null,d),x.createElement("desc",null,f),n)}),nhe=["children","className"];function K1(){return K1=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},K1.apply(null,arguments)}function rhe(e,t){if(e==null)return{};var n,r,i=ihe(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 ihe(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 Or=x.forwardRef((e,t)=>{var{children:n,className:r}=e,i=rhe(e,nhe),a=$t("recharts-layer",r);return x.createElement("g",K1({className:a},Gr(i),{ref:t}),n)}),a6=x.createContext(null),ahe=()=>x.useContext(a6);function en(e){return function(){return e}}const s6=Math.cos,jy=Math.sin,ka=Math.sqrt,Ny=Math.PI,f0=2*Ny,G1=Math.PI,V1=2*G1,Ml=1e-6,she=V1-Ml;function o6(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function ohe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return o6;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 lhe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?o6:ohe(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,c=this._y1,d=r-t,f=i-n,p=l-t,m=c-n,y=p*p+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(y>Ml)if(!(Math.abs(m*d-f*p)>Ml)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-l,w=i-c,b=d*d+f*f,j=v*v+w*w,k=Math.sqrt(b),E=Math.sqrt(y),A=a*Math.tan((G1-Math.acos((b+y-j)/(2*k*E)))/2),C=A/E,_=A/k;Math.abs(C-1)>Ml&&this._append`L${t+C*p},${n+C*m}`,this._append`A${a},${a},0,0,${+(m*v>p*w)},${this._x1=t+_*d},${this._y1=n+_*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 c=r*Math.cos(i),d=r*Math.sin(i),f=t+c,p=n+d,m=1^l,y=l?i-a:a-i;this._x1===null?this._append`M${f},${p}`:(Math.abs(this._x1-f)>Ml||Math.abs(this._y1-p)>Ml)&&this._append`L${f},${p}`,r&&(y<0&&(y=y%V1+V1),y>she?this._append`A${r},${r},0,1,${m},${t-c},${n-d}A${r},${r},0,1,${m},${this._x1=f},${this._y1=p}`:y>Ml&&this._append`A${r},${r},0,${+(y>=G1)},${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 CC(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 lhe(t)}function AC(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function l6(e){this._context=e}l6.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 h0(e){return new l6(e)}function c6(e){return e[0]}function u6(e){return e[1]}function d6(e,t){var n=en(!0),r=null,i=h0,a=null,l=CC(c);e=typeof e=="function"?e:e===void 0?c6:en(e),t=typeof t=="function"?t:t===void 0?u6:en(t);function c(d){var f,p=(d=AC(d)).length,m,y=!1,v;for(r==null&&(a=i(v=l())),f=0;f<=p;++f)!(f<p&&n(m=d[f],f,d))===y&&((y=!y)?a.lineStart():a.lineEnd()),y&&a.point(+e(m,f,d),+t(m,f,d));if(v)return a=null,v+""||null}return c.x=function(d){return arguments.length?(e=typeof d=="function"?d:en(+d),c):e},c.y=function(d){return arguments.length?(t=typeof d=="function"?d:en(+d),c):t},c.defined=function(d){return arguments.length?(n=typeof d=="function"?d:en(!!d),c):n},c.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),c):i},c.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),c):r},c}function cg(e,t,n){var r=null,i=en(!0),a=null,l=h0,c=null,d=CC(f);e=typeof e=="function"?e:e===void 0?c6:en(+e),t=typeof t=="function"?t:en(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?u6:en(+n);function f(m){var y,v,w,b=(m=AC(m)).length,j,k=!1,E,A=new Array(b),C=new Array(b);for(a==null&&(c=l(E=d())),y=0;y<=b;++y){if(!(y<b&&i(j=m[y],y,m))===k)if(k=!k)v=y,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),w=y-1;w>=v;--w)c.point(A[w],C[w]);c.lineEnd(),c.areaEnd()}k&&(A[y]=+e(j,y,m),C[y]=+t(j,y,m),c.point(r?+r(j,y,m):A[y],n?+n(j,y,m):C[y]))}if(E)return c=null,E+""||null}function p(){return d6().defined(i).curve(l).context(a)}return f.x=function(m){return arguments.length?(e=typeof m=="function"?m:en(+m),r=null,f):e},f.x0=function(m){return arguments.length?(e=typeof m=="function"?m:en(+m),f):e},f.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:en(+m),f):r},f.y=function(m){return arguments.length?(t=typeof m=="function"?m:en(+m),n=null,f):t},f.y0=function(m){return arguments.length?(t=typeof m=="function"?m:en(+m),f):t},f.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:en(+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:en(!!m),f):i},f.curve=function(m){return arguments.length?(l=m,a!=null&&(c=l(a)),f):l},f.context=function(m){return arguments.length?(m==null?a=c=null:c=l(a=m),f):a},f}class f6{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 che(e){return new f6(e,!0)}function uhe(e){return new f6(e,!1)}const EC={draw(e,t){const n=ka(t/Ny);e.moveTo(n,0),e.arc(0,0,n,0,f0)}},dhe={draw(e,t){const n=ka(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()}},h6=ka(1/3),fhe=h6*2,hhe={draw(e,t){const n=ka(t/fhe),r=n*h6;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},phe={draw(e,t){const n=ka(t),r=-n/2;e.rect(r,r,n,n)}},mhe=.8908130915292852,p6=jy(Ny/10)/jy(7*Ny/10),ghe=jy(f0/10)*p6,yhe=-s6(f0/10)*p6,vhe={draw(e,t){const n=ka(t*mhe),r=ghe*n,i=yhe*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=f0*a/5,c=s6(l),d=jy(l);e.lineTo(d*n,-c*n),e.lineTo(c*r-d*i,d*r+c*i)}e.closePath()}},fS=ka(3),xhe={draw(e,t){const n=-ka(t/(fS*3));e.moveTo(0,n*2),e.lineTo(-fS*n,-n),e.lineTo(fS*n,-n),e.closePath()}},Li=-.5,$i=ka(3)/2,Q1=1/ka(12),bhe=(Q1/2+1)*3,whe={draw(e,t){const n=ka(t/bhe),r=n/2,i=n*Q1,a=r,l=n*Q1+n,c=-a,d=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(c,d),e.lineTo(Li*r-$i*i,$i*r+Li*i),e.lineTo(Li*a-$i*l,$i*a+Li*l),e.lineTo(Li*c-$i*d,$i*c+Li*d),e.lineTo(Li*r+$i*i,Li*i-$i*r),e.lineTo(Li*a+$i*l,Li*l-$i*a),e.lineTo(Li*c+$i*d,Li*d-$i*c),e.closePath()}};function She(e,t){let n=null,r=CC(i);e=typeof e=="function"?e:en(e||EC),t=typeof t=="function"?t:en(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:en(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:en(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function ky(){}function Cy(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 m6(e){this._context=e}m6.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:Cy(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:Cy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jhe(e){return new m6(e)}function g6(e){this._context=e}g6.prototype={areaStart:ky,areaEnd:ky,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:Cy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Nhe(e){return new g6(e)}function y6(e){this._context=e}y6.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:Cy(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function khe(e){return new y6(e)}function v6(e){this._context=e}v6.prototype={areaStart:ky,areaEnd:ky,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 Che(e){return new v6(e)}function iR(e){return e<0?-1:1}function aR(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),c=(a*i+l*r)/(r+i);return(iR(a)+iR(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(c))||0}function sR(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function hS(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,c=(a-r)/3;e._context.bezierCurveTo(r+c,i+c*t,a-c,l-c*n,a,l)}function Ay(e){this._context=e}Ay.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:hS(this,this._t0,sR(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,hS(this,sR(this,n=aR(this,e,t)),n);break;default:hS(this,this._t0,n=aR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function x6(e){this._context=new b6(e)}(x6.prototype=Object.create(Ay.prototype)).point=function(e,t){Ay.prototype.point.call(this,t,e)};function b6(e){this._context=e}b6.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 Ahe(e){return new Ay(e)}function Ehe(e){return new x6(e)}function w6(e){this._context=e}w6.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=oR(e),i=oR(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 oR(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 Ohe(e){return new w6(e)}function p0(e,t){this._context=e,this._t=t}p0.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 zhe(e){return new p0(e,.5)}function _he(e){return new p0(e,0)}function The(e){return new p0(e,1)}function dc(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,c=a.length;n<l;++n)for(i=a,a=e[t[n]],r=0;r<c;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Y1(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Phe(e,t){return e[t]}function Rhe(e){const t=[];return t.key=e,t}function Dhe(){var e=en([]),t=Y1,n=dc,r=Phe;function i(a){var l=Array.from(e.apply(this,arguments),Rhe),c,d=l.length,f=-1,p;for(const m of a)for(c=0,++f;c<d;++c)(l[c][f]=[0,+r(m,l[c].key,f,a)]).data=m;for(c=0,p=AC(t(l));c<d;++c)l[p[c]].index=c;return n(l,p),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:en(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:en(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Y1:typeof a=="function"?a:en(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??dc,i):n},i}function Mhe(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}dc(e,t)}}function Ihe(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,c=0;l<i;++l)c+=e[l][n][1]||0;r[n][1]+=r[n][0]=-c/2}dc(e,t)}}function Lhe(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 c=0,d=0,f=0;c<l;++c){for(var p=e[t[c]],m=p[r][1]||0,y=p[r-1][1]||0,v=(m-y)/2,w=0;w<c;++w){var b=e[t[w]],j=b[r][1]||0,k=b[r-1][1]||0;v+=j-k}d+=m,f+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=f/d)}i[r-1][1]+=i[r-1][0]=n,dc(e,t)}}var pS={},mS={},lR;function $he(){return lR||(lR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(mS)),mS}var gS={},cR;function S6(){return cR||(cR=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})(gS)),gS}var yS={},uR;function OC(){return uR||(uR=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})(yS)),yS}var vS={},xS={},dR;function Bhe(){return dR||(dR=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})(xS)),xS}var fR;function zC(){return fR||(fR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bhe(),n=OC();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 c=0,d="",f="",p=!1;for(i.charCodeAt(0)===46&&(a.push(""),c++);c<l;){const m=i[c];f?m==="\\"&&c+1<l?(c++,d+=i[c]):m===f?f="":d+=m:p?m==='"'||m==="'"?f=m:m==="]"?(p=!1,a.push(d),d=""):d+=m:m==="["?(p=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,c++}return d&&a.push(d),a}e.toPath=r})(vS)),vS}var hR;function _C(){return hR||(hR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$he(),n=S6(),r=OC(),i=zC();function a(c,d,f){if(c==null)return f;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?n.isDeepKey(d)?a(c,i.toPath(d),f):f:p}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const p=c[d];return p===void 0?f:p}default:{if(Array.isArray(d))return l(c,d,f);if(Object.is(d?.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return f;const p=c[d];return p===void 0?f:p}}}function l(c,d,f){if(d.length===0)return f;let p=c;for(let m=0;m<d.length;m++){if(p==null||t.isUnsafeProperty(d[m]))return f;p=p[d[m]]}return p===void 0?f:p}e.get=a})(pS)),pS}var bS,pR;function Uhe(){return pR||(pR=1,bS=_C().get),bS}var qhe=Uhe();const cd=Sa(qhe);var Fhe=4;function Io(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fhe,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Cn(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 c=n[l-1];return typeof c=="string"?i+c+a:c!==void 0?i+Io(c)+a:i+a},"")}var ai=e=>e===0?0:e>0?1:-1,xa=e=>typeof e=="number"&&e!=+e,fc=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,De=e=>(typeof e=="number"||e instanceof Number)&&!xa(e),Ga=e=>De(e)||typeof e=="string",Hhe=0,Dh=e=>{var t=++Hhe;return"".concat(e||"").concat(t)},ba=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(!De(t)&&typeof t!="string")return r;var a;if(fc(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return xa(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},j6=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 gn(e,t,n){return De(e)&&De(t)?Io(e+n*(t-e)):t}function N6(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):cd(r,t))===n)}var yn=e=>e===null||typeof e>"u",up=e=>yn(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function si(e){return e!=null}function Oc(){}var Khe=["type","size","sizeType"];function W1(){return W1=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},W1.apply(null,arguments)}function mR(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 gR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mR(Object(n),!0).forEach(function(r){Ghe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ghe(e,t,n){return(t=Vhe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vhe(e){var t=Qhe(e,"string");return typeof t=="symbol"?t:t+""}function Qhe(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 Yhe(e,t){if(e==null)return{};var n,r,i=Whe(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 Whe(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 k6={symbolCircle:EC,symbolCross:dhe,symbolDiamond:hhe,symbolSquare:phe,symbolStar:vhe,symbolTriangle:xhe,symbolWye:whe},Zhe=Math.PI/180,Xhe=e=>{var t="symbol".concat(up(e));return k6[t]||EC},Jhe=(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*Zhe;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}},epe=(e,t)=>{k6["symbol".concat(up(e))]=t},TC=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=Yhe(e,Khe),a=gR(gR({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var c=()=>{var y=Xhe(l),v=She().type(y).size(Jhe(n,r,l)),w=v();if(w!==null)return w},{className:d,cx:f,cy:p}=a,m=Gr(a);return De(f)&&De(p)&&De(n)?x.createElement("path",W1({},m,{className:$t("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(p,")"),d:c()})):null};TC.registerSymbol=epe;var C6=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,PC=(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=>{NC(i)&&typeof n[i]=="function"&&(r[i]=(a=>n[i](n,a)))}),r},tpe=(e,t,n)=>r=>(e(t,n,r),null),m0=(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];NC(i)&&typeof a=="function"&&(r||(r={}),r[i]=tpe(a,t,n))}),r};function yR(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 npe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yR(Object(n),!0).forEach(function(r){rpe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rpe(e,t,n){return(t=ipe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ipe(e){var t=ape(e,"string");return typeof t=="symbol"?t:t+""}function ape(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 _r(e,t){var n=npe({},e),r=t,i=Object.keys(t),a=i.reduce((l,c)=>(l[c]===void 0&&r[c]!==void 0&&(l[c]=r[c]),l),n);return a}function Ey(){return Ey=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},Ey.apply(null,arguments)}function vR(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 A6(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vR(Object(n),!0).forEach(function(r){spe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function spe(e,t,n){return(t=ope(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ope(e){var t=lpe(e,"string");return typeof t=="symbol"?t:t+""}function lpe(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 Ui=32,cpe={align:"center",iconSize:14,inactiveColor:"#ccc",layout:"horizontal",verticalAlign:"middle",labelStyle:{}};function upe(e){if(typeof e=="object"&&e!==null&&"strokeDasharray"in e)return String(e.strokeDasharray)}function dpe(e){var{data:t,iconType:n,inactiveColor:r}=e,i=Ui/2,a=Ui/6,l=Ui/3,c=t.inactive?r:t.color,d=n??t.type;if(d==="none")return null;if(d==="plainline")return x.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:upe(t.payload),x1:0,y1:i,x2:Ui,y2:i,className:"recharts-legend-icon"});if(d==="line")return x.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
|
|
255
|
+
A`).concat(a,",").concat(a,",0,1,1,").concat(2*l,",").concat(i,`
|
|
256
|
+
H`).concat(Ui,"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:c,d:"M0,".concat(Ui/8,"h").concat(Ui,"v").concat(Ui*3/4,"h").concat(-Ui,"z"),className:"recharts-legend-icon"});if(x.isValidElement(t.legendIcon)){var f=A6({},t);return delete f.legendIcon,x.cloneElement(t.legendIcon,f)}return x.createElement(TC,{fill:c,cx:i,cy:i,size:Ui,sizeType:"diameter",type:d})}function fpe(e){var{payload:t,iconSize:n,layout:r,formatter:i,inactiveColor:a,iconType:l,labelStyle:c}=e,d={x:0,y:0,width:Ui,height:Ui},f={display:r==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return t.map((m,y)=>{var v=m.formatter||i,w=$t({"recharts-legend-item":!0,["legend-item-".concat(y)]:!0,inactive:m.inactive});if(m.type==="none")return null;var b=typeof c=="object"?A6({},c):{};b.color=m.inactive?a:b.color||m.color;var j=v?v(m.value,m,y):m.value;return x.createElement("li",Ey({className:w,style:f,key:"legend-item-".concat(y)},m0(e,m,y)),x.createElement(kC,{width:n,height:n,viewBox:d,style:p,"aria-label":"".concat(m.value," legend icon")},x.createElement(dpe,{data:m,iconType:l,inactiveColor:a})),x.createElement("span",{className:"recharts-legend-item-text",style:b},j))})}var hpe=e=>{var t=_r(e,cpe),{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(fpe,Ey({},t,{payload:n})))},wS={},SS={},xR;function ppe(){return xR||(xR=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],c=r(l,a,n);i.has(c)||i.set(c,l)}return Array.from(i.values())}e.uniqBy=t})(SS)),SS}var jS={},bR;function mpe(){return bR||(bR=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})(jS)),jS}var NS={},wR;function E6(){return wR||(wR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(NS)),NS}var kS={},CS={},AS={},SR;function gpe(){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})(AS)),AS}var jR;function O6(){return jR||(jR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gpe();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(CS)),CS}var ES={},NR;function ype(){return NR||(NR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(ES)),ES}var kR;function vpe(){return kR||(kR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=O6(),n=ype();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(kS)),kS}var OS={},zS={},CR;function xpe(){return CR||(CR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_C();function n(r){return function(i){return t.get(i,r)}}e.property=n})(zS)),zS}var _S={},TS={},PS={},RS={},AR;function z6(){return AR||(AR=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})(RS)),RS}var DS={},ER;function _6(){return ER||(ER=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})(DS)),DS}var MS={},OR;function T6(){return OR||(OR=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})(MS)),MS}var zR;function bpe(){return zR||(zR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=z6(),n=_6(),r=T6();function i(p,m,y){return typeof y!="function"?i(p,m,()=>{}):a(p,m,function v(w,b,j,k,E,A){const C=y(w,b,j,k,E,A);return C!==void 0?!!C:a(w,b,v,A)},new Map)}function a(p,m,y,v){if(m===p)return!0;switch(typeof m){case"object":return l(p,m,y,v);case"function":return Object.keys(m).length>0?a(p,{...m},y,v):r.isEqualsSameValueZero(p,m);default:return t.isObject(p)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(p,m)}}function l(p,m,y,v){if(m==null)return!0;if(Array.isArray(m))return d(p,m,y,v);if(m instanceof Map)return c(p,m,y,v);if(m instanceof Set)return f(p,m,y,v);const w=Object.keys(m);if(p==null||n.isPrimitive(p))return w.length===0;if(w.length===0)return!0;if(v?.has(m))return v.get(m)===p;v?.set(m,p);try{for(let b=0;b<w.length;b++){const j=w[b];if(!n.isPrimitive(p)&&!(j in p)||m[j]===void 0&&p[j]!==void 0||m[j]===null&&p[j]!==null||!y(p[j],m[j],j,p,m,v))return!1}return!0}finally{v?.delete(m)}}function c(p,m,y,v){if(m.size===0)return!0;if(!(p instanceof Map))return!1;for(const[w,b]of m.entries()){const j=p.get(w);if(y(j,b,w,p,m,v)===!1)return!1}return!0}function d(p,m,y,v){if(m.length===0)return!0;if(!Array.isArray(p))return!1;const w=new Set;for(let b=0;b<m.length;b++){const j=m[b];let k=!1;for(let E=0;E<p.length;E++){if(w.has(E))continue;const A=p[E];let C=!1;if(y(A,j,b,p,m,v)&&(C=!0),C){w.add(E),k=!0;break}}if(!k)return!1}return!0}function f(p,m,y,v){return m.size===0?!0:p instanceof Set?d([...p],[...m],y,v):!1}e.isMatchWith=i,e.isSetMatch=f})(PS)),PS}var _R;function P6(){return _R||(_R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=bpe();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(TS)),TS}var IS={},LS={},$S={},TR;function wpe(){return TR||(TR=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})($S)),$S}var BS={},PR;function RC(){return PR||(PR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(BS)),BS}var US={},RR;function R6(){return RR||(RR=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]",c="[object Date]",d="[object Map]",f="[object Set]",p="[object Array]",m="[object Function]",y="[object ArrayBuffer]",v="[object Object]",w="[object Error]",b="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",E="[object Uint16Array]",A="[object Uint32Array]",C="[object BigUint64Array]",_="[object Int8Array]",O="[object Int16Array]",z="[object Int32Array]",R="[object BigInt64Array]",$="[object Float32Array]",F="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=y,e.arrayTag=p,e.bigInt64ArrayTag=R,e.bigUint64ArrayTag=C,e.booleanTag=i,e.dataViewTag=b,e.dateTag=c,e.errorTag=w,e.float32ArrayTag=$,e.float64ArrayTag=F,e.functionTag=m,e.int16ArrayTag=O,e.int32ArrayTag=z,e.int8ArrayTag=_,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=A,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(US)),US}var qS={},DR;function Spe(){return DR||(DR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(qS)),qS}var MR;function D6(){return MR||(MR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wpe(),n=RC(),r=R6(),i=_6(),a=Spe();function l(p,m){return c(p,void 0,p,new Map,m)}function c(p,m,y,v=new Map,w=void 0){const b=w?.(p,m,y,v);if(b!==void 0)return b;if(i.isPrimitive(p))return p;if(v.has(p))return v.get(p);if(Array.isArray(p)){const j=new Array(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=c(p[k],k,y,v,w);return Object.hasOwn(p,"index")&&(j.index=p.index),Object.hasOwn(p,"input")&&(j.input=p.input),j}if(p instanceof Date)return new Date(p.getTime());if(p instanceof RegExp){const j=new RegExp(p.source,p.flags);return j.lastIndex=p.lastIndex,j}if(p instanceof Map){const j=new Map;v.set(p,j);for(const[k,E]of p)j.set(k,c(E,k,y,v,w));return j}if(p instanceof Set){const j=new Set;v.set(p,j);for(const k of p)j.add(c(k,void 0,y,v,w));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(p))return p.subarray();if(a.isTypedArray(p)){const j=new(Object.getPrototypeOf(p)).constructor(p.length);v.set(p,j);for(let k=0;k<p.length;k++)j[k]=c(p[k],k,y,v,w);return j}if(p instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&p instanceof SharedArrayBuffer)return p.slice(0);if(p instanceof DataView){const j=new DataView(p.buffer.slice(0),p.byteOffset,p.byteLength);return v.set(p,j),d(j,p,y,v,w),j}if(typeof File<"u"&&p instanceof File){const j=new File([p],p.name,{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(typeof Blob<"u"&&p instanceof Blob){const j=new Blob([p],{type:p.type});return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Error){const j=structuredClone(p);return v.set(p,j),j.message=p.message,j.name=p.name,j.stack=p.stack,j.cause=p.cause,j.constructor=p.constructor,d(j,p,y,v,w),j}if(p instanceof Boolean){const j=new Boolean(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof Number){const j=new Number(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(p instanceof String){const j=new String(p.valueOf());return v.set(p,j),d(j,p,y,v,w),j}if(typeof p=="object"&&f(p)){const j=Object.create(Object.getPrototypeOf(p));return v.set(p,j),d(j,p,y,v,w),j}return p}function d(p,m,y=p,v,w){const b=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<b.length;j++){const k=b[j],E=Object.getOwnPropertyDescriptor(p,k);(E==null||E.writable)&&(p[k]=c(m[k],k,y,v,w))}}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=c,e.copyProperties=d})(LS)),LS}var IR;function jpe(){return IR||(IR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=D6();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(IS)),IS}var LR;function Npe(){return LR||(LR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P6(),n=jpe();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(_S)),_S}var FS={},HS={},KS={},$R;function kpe(){return $R||($R=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=D6(),n=RC(),r=R6();function i(a,l){return t.cloneDeepWith(a,(c,d,f,p)=>{const m=l?.(c,d,f,p);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const y={};return p.set(a,y),t.copyProperties(y,a,f,p),y}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const y=new a.constructor(a?.valueOf());return t.copyProperties(y,a),y}case r.argumentsTag:{const y={};return t.copyProperties(y,a),y.length=a.length,y[Symbol.iterator]=a[Symbol.iterator],y}default:return}}})}e.cloneDeepWith=i})(KS)),KS}var BR;function Cpe(){return BR||(BR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kpe();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(HS)),HS}var GS={},VS={},UR;function M6(){return UR||(UR=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})(VS)),VS}var QS={},qR;function Ape(){return qR||(qR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RC();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(QS)),QS}var FR;function Epe(){return FR||(FR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=S6(),n=M6(),r=Ape(),i=zC();function a(l,c){let d;if(Array.isArray(c)?d=c:typeof c=="string"&&t.isDeepKey(c)&&l?.[c]==null?d=i.toPath(c):d=[c],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})(GS)),GS}var HR;function Ope(){return HR||(HR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=P6(),n=OC(),r=Cpe(),i=_C(),a=Epe();function l(c,d){switch(typeof c){case"object":{Object.is(c?.valueOf(),-0)&&(c="-0");break}case"number":{c=n.toKey(c);break}}return d=r.cloneDeep(d),function(f){const p=i.get(f,c);return p===void 0?a.has(f,c):d===void 0?p===void 0:t.isMatch(p,d)}}e.matchesProperty=l})(FS)),FS}var KR;function zpe(){return KR||(KR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=E6(),n=xpe(),r=Npe(),i=Ope();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})(OS)),OS}var GR;function _pe(){return GR||(GR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ppe(),n=mpe(),r=E6(),i=vpe(),a=zpe();function l(c,d=r.identity){return i.isArrayLikeObject(c)?t.uniqBy(Array.from(c),n.ary(a.iteratee(d),1)):[]}e.uniqBy=l})(wS)),wS}var YS,VR;function Tpe(){return VR||(VR=1,YS=_pe().uniqBy),YS}var Ppe=Tpe();const QR=Sa(Ppe);function I6(e,t,n){return t===!0?QR(e,n):typeof t=="function"?QR(e,t):e}var DC=x.createContext(null),Rpe=e=>e,ln=()=>{var e=x.useContext(DC);return e?e.store.dispatch:Rpe},Hg=()=>{},Dpe=()=>Hg,Mpe=(e,t)=>e===t;function Ge(e){var t=x.useContext(DC),n=x.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Hg,[t,e]);return G5.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:Dpe,t?t.store.getState:Hg,t?t.store.getState:Hg,n,Mpe)}function Ipe(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Lpe(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $pe(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 YR=e=>Array.isArray(e)?e:[e];function Bpe(e){const t=Array.isArray(e[0])?e[0]:e;return $pe(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Upe(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var qpe=class{constructor(e){this.value=e}deref(){return this.value}},Fpe=typeof WeakRef<"u"?WeakRef:qpe,Hpe=0,WR=1;function ug(){return{s:Hpe,v:void 0,o:null,p:null}}function L6(e,t={}){let n=ug();const{resultEqualityCheck:r}=t;let i,a=0;function l(){let c=n;const{length:d}=arguments;for(let m=0,y=d;m<y;m++){const v=arguments[m];if(typeof v=="function"||typeof v=="object"&&v!==null){let w=c.o;w===null&&(c.o=w=new WeakMap);const b=w.get(v);b===void 0?(c=ug(),w.set(v,c)):c=b}else{let w=c.p;w===null&&(c.p=w=new Map);const b=w.get(v);b===void 0?(c=ug(),w.set(v,c)):c=b}}const f=c;let p;if(c.s===WR)p=c.v;else if(p=e.apply(null,arguments),a++,r){const m=i?.deref?.()??i;m!=null&&r(m,p)&&(p=m,a!==0&&a--),i=typeof p=="object"&&p!==null||typeof p=="function"?new Fpe(p):p}return f.s=WR,f.v=p,p}return l.clearCache=()=>{n=ug(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function Kpe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,c,d={},f=i.pop();typeof f=="object"&&(d=f,f=i.pop()),Ipe(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const p={...n,...d},{memoize:m,memoizeOptions:y=[],argsMemoize:v=L6,argsMemoizeOptions:w=[]}=p,b=YR(y),j=YR(w),k=Bpe(i),E=m(function(){return a++,f.apply(null,arguments)},...b),A=v(function(){l++;const _=Upe(k,arguments);return c=E.apply(null,_),c},...j);return Object.assign(A,{resultFunc:f,memoizedResultFunc:E,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var le=Kpe(L6),Gpe=Object.assign((e,t=le)=>{Lpe(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,c,d)=>(l[n[d]]=c,l),{}))},{withTypes:()=>Gpe}),WS={},ZS={},XS={},ZR;function Vpe(){return ZR||(ZR=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),c=t(i);if(l===c&&l===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?c-l:l-c}return 0};e.compareValues=n})(XS)),XS}var JS={},ej={},XR;function $6(){return XR||(XR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(ej)),ej}var JR;function Qpe(){return JR||(JR=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$6(),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})(JS)),JS}var eD;function Ype(){return eD||(eD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Vpe(),n=Qpe(),r=zC();function i(a,l,c,d){if(a==null)return[];c=d?void 0:c,Array.isArray(a)||(a=Object.values(a)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(c)||(c=c==null?[]:[c]),c=c.map(v=>String(v));const f=(v,w)=>{let b=v;for(let j=0;j<w.length&&b!=null;++j)b=b[w[j]];return b},p=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:f(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?f(w,v):typeof w=="object"?w[v]:w,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(w=>p(w,v))})).slice().sort((v,w)=>{for(let b=0;b<m.length;b++){const j=t.compareValues(v.criteria[b],w.criteria[b],c[b]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(ZS)),ZS}var tj={},tD;function Wpe(){return tD||(tD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),l=(c,d)=>{for(let f=0;f<c.length;f++){const p=c[f];Array.isArray(p)&&d<a?l(p,d+1):i.push(p)}};return l(n,0),i}e.flatten=t})(tj)),tj}var nj={},nD;function B6(){return nD||(nD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M6(),n=O6(),r=z6(),i=T6();function a(l,c,d){return r.isObject(d)&&(typeof c=="number"&&n.isArrayLike(d)&&t.isIndex(c)&&c<d.length||typeof c=="string"&&c in d)?i.isEqualsSameValueZero(d[c],l):!1}e.isIterateeCall=a})(nj)),nj}var rD;function Zpe(){return rD||(rD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ype(),n=Wpe(),r=B6();function i(a,...l){const c=l.length;return c>1&&r.isIterateeCall(a,l[0],l[1])?l=[]:c>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(a,n.flatten(l),["asc"])}e.sortBy=i})(WS)),WS}var rj,iD;function Xpe(){return iD||(iD=1,rj=Zpe().sortBy),rj}var Jpe=Xpe();const g0=Sa(Jpe);var U6=e=>e.legend.settings,eme=e=>e.legend.size,tme=e=>e.legend.payload,nme=le([tme,U6],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?g0(r,n):r});function rme(){return Ge(nme)}var dg=1;function q6(){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)>dg||Math.abs(l.left-t.left)>dg||Math.abs(l.top-t.top)>dg||Math.abs(l.width-t.width)>dg)&&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 gr(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 ime=typeof Symbol=="function"&&Symbol.observable||"@@observable",aD=ime,ij=()=>Math.random().toString(36).substring(7).split("").join("."),ame={INIT:`@@redux/INIT${ij()}`,REPLACE:`@@redux/REPLACE${ij()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ij()}`},Oy=ame;function MC(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 F6(e,t,n){if(typeof e!="function")throw new Error(gr(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(gr(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(gr(1));return n(F6)(e,t)}let r=e,i=t,a=new Map,l=a,c=0,d=!1;function f(){l===a&&(l=new Map,a.forEach((j,k)=>{l.set(k,j)}))}function p(){if(d)throw new Error(gr(3));return i}function m(j){if(typeof j!="function")throw new Error(gr(4));if(d)throw new Error(gr(5));let k=!0;f();const E=c++;return l.set(E,j),function(){if(k){if(d)throw new Error(gr(6));k=!1,f(),l.delete(E),a=null}}}function y(j){if(!MC(j))throw new Error(gr(7));if(typeof j.type>"u")throw new Error(gr(8));if(typeof j.type!="string")throw new Error(gr(17));if(d)throw new Error(gr(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=l).forEach(E=>{E()}),j}function v(j){if(typeof j!="function")throw new Error(gr(10));r=j,y({type:Oy.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(gr(11));function E(){const C=k;C.next&&C.next(p())}return E(),{unsubscribe:j(E)}},[aD](){return this}}}return y({type:Oy.INIT}),{dispatch:y,subscribe:m,getState:p,replaceReducer:v,[aD]:w}}function sme(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Oy.INIT})>"u")throw new Error(gr(12));if(typeof n(void 0,{type:Oy.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(gr(13))})}function H6(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{sme(n)}catch(a){i=a}return function(l={},c){if(i)throw i;let d=!1;const f={};for(let p=0;p<r.length;p++){const m=r[p],y=n[m],v=l[m],w=y(v,c);if(typeof w>"u")throw c&&c.type,new Error(gr(14));f[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(l).length,d?f:l}}function zy(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function ome(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(gr(15))};const l={getState:i.getState,dispatch:(d,...f)=>a(d,...f)},c=e.map(d=>d(l));return a=zy(...c)(i.dispatch),{...i,dispatch:a}}}function K6(e){return MC(e)&&"type"in e&&typeof e.type=="string"}var G6=Symbol.for("immer-nothing"),sD=Symbol.for("immer-draftable"),Vr=Symbol.for("immer-state");function ga(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ki=Object,ud=ki.getPrototypeOf,_y="constructor",y0="prototype",Z1="configurable",Ty="enumerable",Kg="writable",Mh="value",Rs=e=>!!e&&!!e[Vr];function wa(e){return e?V6(e)||x0(e)||!!e[sD]||!!e[_y]?.[sD]||b0(e)||w0(e):!1}var lme=ki[y0][_y].toString(),oD=new WeakMap;function V6(e){if(!e||!IC(e))return!1;const t=ud(e);if(t===null||t===ki[y0])return!0;const n=ki.hasOwnProperty.call(t,_y)&&t[_y];if(n===Object)return!0;if(!Ru(n))return!1;let r=oD.get(n);return r===void 0&&(r=Function.toString.call(n),oD.set(n,r)),r===lme}function v0(e,t,n=!0){dp(e)===0?(n?Reflect.ownKeys(e):ki.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function dp(e){const t=e[Vr];return t?t.type_:x0(e)?1:b0(e)?2:w0(e)?3:0}var lD=(e,t,n=dp(e))=>n===2?e.has(t):ki[y0].hasOwnProperty.call(e,t),X1=(e,t,n=dp(e))=>n===2?e.get(t):e[t],Py=(e,t,n,r=dp(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function cme(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var x0=Array.isArray,b0=e=>e instanceof Map,w0=e=>e instanceof Set,IC=e=>typeof e=="object",Ru=e=>typeof e=="function",aj=e=>typeof e=="boolean";function ume(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var js=e=>e.copy_||e.base_,LC=e=>e.modified_?e.copy_:e.base_;function J1(e,t){if(b0(e))return new Map(e);if(w0(e))return new Set(e);if(x0(e))return Array[y0].slice.call(e);const n=V6(e);if(t===!0||t==="class_only"&&!n){const r=ki.getOwnPropertyDescriptors(e);delete r[Vr];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],c=r[l];c[Kg]===!1&&(c[Kg]=!0,c[Z1]=!0),(c.get||c.set)&&(r[l]={[Z1]:!0,[Kg]:!0,[Ty]:c[Ty],[Mh]:e[l]})}return ki.create(ud(e),r)}else{const r=ud(e);if(r!==null&&n)return{...e};const i=ki.create(r);return ki.assign(i,e)}}function $C(e,t=!1){return S0(e)||Rs(e)||!wa(e)||(dp(e)>1&&ki.defineProperties(e,{set:fg,add:fg,clear:fg,delete:fg}),ki.freeze(e),t&&v0(e,(n,r)=>{$C(r,!0)},!1)),e}function dme(){ga(2)}var fg={[Mh]:dme};function S0(e){return e===null||!IC(e)?!0:ki.isFrozen(e)}var Ry="MapSet",eN="Patches",cD="ArrayMethods",Q6={};function hc(e){const t=Q6[e];return t||ga(0,e),t}var uD=e=>!!Q6[e],Ih,Y6=()=>Ih,fme=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:uD(Ry)?hc(Ry):void 0,arrayMethodsPlugin_:uD(cD)?hc(cD):void 0});function dD(e,t){t&&(e.patchPlugin_=hc(eN),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function tN(e){nN(e),e.drafts_.forEach(hme),e.drafts_=null}function nN(e){e===Ih&&(Ih=e.parent_)}var fD=e=>Ih=fme(Ih,e);function hme(e){const t=e[Vr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hD(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Vr].modified_&&(tN(t),ga(4)),wa(e)&&(e=pD(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Vr].base_,e,t)}else e=pD(t,n);return pme(t,e,!0),tN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==G6?e:void 0}function pD(e,t){if(S0(t))return t;const n=t[Vr];if(!n)return Dy(t,e.handledSet_,e);if(!j0(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);X6(n,e)}return n.copy_}function pme(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&$C(t,n)}function W6(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var j0=(e,t)=>e.scope_===t,mme=[];function Z6(e,t,n,r){const i=js(e),a=e.type_;if(r!==void 0&&X1(i,r,a)===t){Py(i,r,n,a);return}if(!e.draftLocations_){const c=e.draftLocations_=new Map;v0(i,(d,f)=>{if(Rs(f)){const p=c.get(f)||[];p.push(d),c.set(f,p)}})}const l=e.draftLocations_.get(t)??mme;for(const c of l)Py(i,c,n,a)}function gme(e,t,n){e.callbacks_.push(function(i){const a=t;if(!a||!j0(a,i))return;i.mapSetPlugin_?.fixSetContents(a);const l=LC(a);Z6(e,a.draft_??a,l,n),X6(a,i)})}function X6(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 yme(e,t,n){const{scope_:r}=e;if(Rs(n)){const i=n[Vr];j0(i,r)&&i.callbacks_.push(function(){Gg(e);const l=LC(i);Z6(e,n,l,t)})}else wa(n)&&e.callbacks_.push(function(){const a=js(e);e.type_===3?a.has(n)&&Dy(n,r.handledSet_,r):X1(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Dy(X1(e.copy_,t,e.type_),r.handledSet_,r)})}function Dy(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Rs(e)||t.has(e)||!wa(e)||S0(e)||(t.add(e),v0(e,(r,i)=>{if(Rs(i)){const a=i[Vr];if(j0(a,n)){const l=LC(a);Py(e,r,l,e.type_),W6(a)}}else wa(i)&&Dy(i,t,n)})),e}function vme(e,t){const n=x0(e),r={type_:n?1:0,scope_:t?t.scope_:Y6(),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=My;n&&(i=[r],a=Lh);const{revoke:l,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=l,[c,r]}var My={get(e,t){if(t===Vr)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=js(e);if(!lD(i,t,e.type_))return xme(e,i,t);const a=i[t];if(e.finalized_||!wa(a)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&ume(t))return a;if(a===sj(e.base_,t)){Gg(e);const l=e.type_===1?+t:t,c=iN(e.scope_,a,e,l);return e.copy_[l]=c}return a},has(e,t){return t in js(e)},ownKeys(e){return Reflect.ownKeys(js(e))},set(e,t,n){const r=J6(js(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=sj(js(e),t),a=i?.[Vr];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(cme(n,i)&&(n!==void 0||lD(e.base_,t,e.type_)))return!0;Gg(e),rN(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),yme(e,t,n)),!0},deleteProperty(e,t){return Gg(e),sj(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),rN(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=js(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Kg]:!0,[Z1]:e.type_!==1||t!=="length",[Ty]:r[Ty],[Mh]:n[t]}},defineProperty(){ga(11)},getPrototypeOf(e){return ud(e.base_)},setPrototypeOf(){ga(12)}},Lh={};for(let e in My){let t=My[e];Lh[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Lh.deleteProperty=function(e,t){return Lh.set.call(this,e,t,void 0)};Lh.set=function(e,t,n){return My.set.call(this,e[0],t,n,e[0])};function sj(e,t){const n=e[Vr];return(n?js(n):e)[t]}function xme(e,t,n){const r=J6(t,n);return r?Mh in r?r[Mh]:r.get?.call(e.draft_):void 0}function J6(e,t){if(!(t in e))return;let n=ud(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ud(n)}}function rN(e){e.modified_||(e.modified_=!0,e.parent_&&rN(e.parent_))}function Gg(e){e.copy_||(e.assigned_=new Map,e.copy_=J1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var bme=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Ru(n)&&!Ru(r)){const l=r;r=n;const c=this;return function(f=l,...p){return c.produce(f,m=>r.call(this,m,...p))}}Ru(r)||ga(6),i!==void 0&&!Ru(i)&&ga(7);let a;if(wa(n)){const l=fD(this),c=iN(l,n,void 0);let d=!0;try{a=r(c),d=!1}finally{d?tN(l):nN(l)}return dD(l,i),hD(a,l)}else if(!n||!IC(n)){if(a=r(n),a===void 0&&(a=n),a===G6&&(a=void 0),this.autoFreeze_&&$C(a,!0),i){const l=[],c=[];hc(eN).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:c}),i(l,c)}return a}else ga(1,n)},this.produceWithPatches=(n,r)=>{if(Ru(n))return(c,...d)=>this.produceWithPatches(c,f=>n(f,...d));let i,a;return[this.produce(n,r,(c,d)=>{i=c,a=d}),i,a]},aj(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),aj(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),aj(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){wa(t)||ga(8),Rs(t)&&(t=Gi(t));const n=fD(this),r=iN(n,t,void 0);return r[Vr].isManual_=!0,nN(n),r}finishDraft(t,n){const r=t&&t[Vr];(!r||!r.isManual_)&&ga(9);const{scope_:i}=r;return dD(i,n),hD(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=hc(eN).applyPatches_;return Rs(t)?i(t,n):this.produce(t,a=>i(a,n))}};function iN(e,t,n,r){const[i,a]=b0(t)?hc(Ry).proxyMap_(t,n):w0(t)?hc(Ry).proxySet_(t,n):vme(t,n);return(n?.scope_??Y6()).drafts_.push(i),a.callbacks_=n?.callbacks_??[],a.key_=r,n&&r!==void 0?gme(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 Gi(e){return Rs(e)||ga(10,e),eU(e)}function eU(e){if(!wa(e)||S0(e))return e;const t=e[Vr];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=J1(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=J1(e,!0);return v0(n,(i,a)=>{Py(n,i,eU(a))},r),t&&(t.finalized_=!1),n}var wme=new bme,tU=wme.produce;function nU(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var Sme=nU(),jme=nU,Nme=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?zy:zy.apply(null,arguments)};function Ai(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Ci(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>K6(r)&&r.type===e,n}var rU=class sh extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,sh.prototype)}static get[Symbol.species](){return sh}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new sh(...t[0].concat(this)):new sh(...t.concat(this))}};function mD(e){return wa(e)?tU(e,()=>{}):e}function hg(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function kme(e){return typeof e=="boolean"}var Cme=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new rU;return n&&(kme(n)?l.push(Sme):l.push(jme(n.extraArgument))),l},iU="RTK_autoBatch",sn=()=>e=>({payload:e,meta:{[iU]:!0}}),gD=e=>t=>{setTimeout(t,e)},aU=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const c=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:gD(10):e.type==="callback"?e.queueNotification:gD(e.timeout),f=()=>{l=!1,a&&(a=!1,c.forEach(p=>p()))};return Object.assign({},r,{subscribe(p){const m=()=>i&&p(),y=r.subscribe(m);return c.add(p),()=>{y(),c.delete(p)}},dispatch(p){try{return i=!p?.meta?.[iU],a=!i,a&&(l||(l=!0,d(f))),r.dispatch(p)}finally{i=!0}}})},Ame=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new rU(e);return r&&i.push(aU(typeof r=="object"?r:void 0)),i};function Eme(e){const t=Cme(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let c;if(typeof n=="function")c=n;else if(MC(n))c=H6(n);else throw new Error(Ci(1));let d;typeof r=="function"?d=r(t):d=t();let f=zy;i&&(f=Nme({trace:!1,...typeof i=="object"&&i}));const p=ome(...d),m=Ame(p);let y=typeof l=="function"?l(m):m();const v=f(...y);return F6(c,a,v)}function sU(e){const t={},n=[];let r;const i={addCase(a,l){const c=typeof a=="string"?a:a.type;if(!c)throw new Error(Ci(28));if(c in t)throw new Error(Ci(29));return t[c]=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 Ome(e){return typeof e=="function"}function zme(e,t){let[n,r,i]=sU(t),a;if(Ome(e))a=()=>mD(e());else{const c=mD(e);a=()=>c}function l(c=a(),d){let f=[n[d.type],...r.filter(({matcher:p})=>p(d)).map(({reducer:p})=>p)];return f.filter(p=>!!p).length===0&&(f=[i]),f.reduce((p,m)=>{if(m)if(Rs(p)){const v=m(p,d);return v===void 0?p:v}else{if(wa(p))return tU(p,y=>m(y,d));{const y=m(p,d);if(y===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return y}}return p},c)}return l.getInitialState=a,l}var _me="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Tme=(e=21)=>{let t="",n=e;for(;n--;)t+=_me[Math.random()*64|0];return t},Pme=Symbol.for("rtk-slice-createasyncthunk");function Rme(e,t){return`${e}/${t}`}function Dme({creators:e}={}){const t=e?.asyncThunk?.[Pme];return function(r){const{name:i,reducerPath:a=i}=r;if(!i)throw new Error(Ci(11));const l=(typeof r.reducers=="function"?r.reducers(Ime()):r.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase(A,C){const _=typeof A=="string"?A:A.type;if(!_)throw new Error(Ci(12));if(_ in d.sliceCaseReducersByType)throw new Error(Ci(13));return d.sliceCaseReducersByType[_]=C,f},addMatcher(A,C){return d.sliceMatchers.push({matcher:A,reducer:C}),f},exposeAction(A,C){return d.actionCreators[A]=C,f},exposeCaseReducer(A,C){return d.sliceCaseReducersByName[A]=C,f}};c.forEach(A=>{const C=l[A],_={reducerName:A,type:Rme(i,A),createNotation:typeof r.reducers=="function"};$me(C)?Ume(_,C,f,t):Lme(_,C,f)});function p(){const[A={},C=[],_=void 0]=typeof r.extraReducers=="function"?sU(r.extraReducers):[r.extraReducers],O={...A,...d.sliceCaseReducersByType};return zme(r.initialState,z=>{for(let R in O)z.addCase(R,O[R]);for(let R of d.sliceMatchers)z.addMatcher(R.matcher,R.reducer);for(let R of C)z.addMatcher(R.matcher,R.reducer);_&&z.addDefaultCase(_)})}const m=A=>A,y=new Map,v=new WeakMap;let w;function b(A,C){return w||(w=p()),w(A,C)}function j(){return w||(w=p()),w.getInitialState()}function k(A,C=!1){function _(z){let R=z[A];return typeof R>"u"&&C&&(R=hg(v,_,j)),R}function O(z=m){const R=hg(y,C,()=>new WeakMap);return hg(R,z,()=>{const $={};for(const[F,M]of Object.entries(r.selectors??{}))$[F]=Mme(M,z,()=>hg(v,z,j),C);return $})}return{reducerPath:A,getSelectors:O,get selectors(){return O(_)},selectSlice:_}}const E={name:i,reducer:b,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:j,...k(a),injectInto(A,{reducerPath:C,..._}={}){const O=C??a;return A.inject({reducerPath:O,reducer:b},_),{...E,...k(O,!0)}}};return E}}function Mme(e,t,n,r){function i(a,...l){let c=t(a);return typeof c>"u"&&r&&(c=n()),e(c,...l)}return i.unwrapped=e,i}var Tr=Dme();function Ime(){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 Lme({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!Bme(r))throw new Error(Ci(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?Ai(e,l):Ai(e))}function $me(e){return e._reducerDefinitionType==="asyncThunk"}function Bme(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Ume({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Ci(18));const{payloadCreator:a,fulfilled:l,pending:c,rejected:d,settled:f,options:p}=n,m=i(e,a,p);r.exposeAction(t,m),l&&r.addCase(m.fulfilled,l),c&&r.addCase(m.pending,c),d&&r.addCase(m.rejected,d),f&&r.addMatcher(m.settled,f),r.exposeCaseReducer(t,{fulfilled:l||pg,pending:c||pg,rejected:d||pg,settled:f||pg})}function pg(){}var qme="task",oU="listener",lU="completed",BC="cancelled",Fme=`task-${BC}`,Hme=`task-${lU}`,aN=`${oU}-${BC}`,Kme=`${oU}-${lU}`,N0=class{constructor(e){this.code=e,this.message=`${qme} ${BC} (reason: ${e})`}name="TaskAbortError";message},UC=(e,t)=>{if(typeof e!="function")throw new TypeError(Ci(32))},Iy=()=>{},cU=(e,t=Iy)=>(e.catch(t),e),uU=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Jl=e=>{if(e.aborted)throw new N0(e.reason)};function dU(e,t){let n=Iy;return new Promise((r,i)=>{const a=()=>i(new N0(e.reason));if(e.aborted){a();return}n=uU(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Iy})}var Gme=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof N0?"cancelled":"rejected",error:n}}finally{t?.()}},Ly=e=>t=>cU(dU(e,t).then(n=>(Jl(e),n))),fU=e=>{const t=Ly(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Zu}=Object,yD={},k0="listenerMiddleware",Vme=(e,t)=>{const n=r=>uU(e,()=>r.abort(e.reason));return(r,i)=>{UC(r);const a=new AbortController;n(a);const l=Gme(async()=>{Jl(e),Jl(a.signal);const c=await r({pause:Ly(a.signal),delay:fU(a.signal),signal:a.signal});return Jl(a.signal),c},()=>a.abort(Hme));return i?.autoJoin&&t.push(l.catch(Iy)),{result:Ly(e)(l),cancel(){a.abort(Fme)}}}},Qme=(e,t)=>{const n=async(r,i)=>{Jl(t);let a=()=>{};const c=[new Promise((d,f)=>{let p=e({predicate:r,effect:(m,y)=>{y.unsubscribe(),d([m,y.getState(),y.getOriginalState()])}});a=()=>{p(),f()}})];i!=null&&c.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await dU(t,Promise.race(c));return Jl(t),d}finally{a()}};return(r,i)=>cU(n(r,i))},hU=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=Ai(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Ci(21));return UC(a),{predicate:i,type:t,effect:a}},pU=Zu(e=>{const{type:t,predicate:n,effect:r}=hU(e);return{id:Tme(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Ci(22))}}},{withTypes:()=>pU}),vD=(e,t)=>{const{type:n,effect:r,predicate:i}=hU(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},sN=e=>{e.pending.forEach(t=>{t.abort(aN)})},Yme=(e,t)=>()=>{for(const n of t.keys())sN(n);e.clear()},xD=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},mU=Zu(Ai(`${k0}/add`),{withTypes:()=>mU}),Wme=Ai(`${k0}/removeAll`),gU=Zu(Ai(`${k0}/remove`),{withTypes:()=>gU}),Zme=(...e)=>{console.error(`${k0}/error`,...e)},fp=(e={})=>{const t=new Map,n=new Map,r=v=>{const w=n.get(v)??0;n.set(v,w+1)},i=v=>{const w=n.get(v)??1;w===1?n.delete(v):n.set(v,w-1)},{extra:a,onError:l=Zme}=e;UC(l);const c=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w?.cancelActive&&sN(v)}),d=v=>{const w=vD(t,v)??pU(v);return c(w)};Zu(d,{withTypes:()=>d});const f=v=>{const w=vD(t,v);return w&&(w.unsubscribe(),v.cancelActive&&sN(w)),!!w};Zu(f,{withTypes:()=>f});const p=async(v,w,b,j)=>{const k=new AbortController,E=Qme(d,k.signal),A=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(w,Zu({},b,{getOriginalState:j,condition:(C,_)=>E(C,_).then(Boolean),take:E,delay:fU(k.signal),pause:Ly(k.signal),extra:a,signal:k.signal,fork:Vme(k.signal,A),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((C,_,O)=>{C!==k&&(C.abort(aN),O.delete(C))})},cancel:()=>{k.abort(aN),v.pending.delete(k)},throwIfCancelled:()=>{Jl(k.signal)}})))}catch(C){C instanceof N0||xD(l,C,{raisedBy:"effect"})}finally{await Promise.all(A),k.abort(Kme),i(v),v.pending.delete(k)}},m=Yme(t,n);return{middleware:v=>w=>b=>{if(!K6(b))return w(b);if(mU.match(b))return d(b.payload);if(Wme.match(b)){m();return}if(gU.match(b))return f(b.payload);let j=v.getState();const k=()=>{if(j===yD)throw new Error(Ci(23));return j};let E;try{if(E=w(b),t.size>0){const A=v.getState(),C=Array.from(t.values());for(const _ of C){let O=!1;try{O=_.predicate(b,A,j)}catch(z){O=!1,xD(l,z,{raisedBy:"predicate"})}O&&p(_,b,v,k)}}}finally{j=yD}return E},startListening:d,stopListening:f,clearListeners:m}};function Ci(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Xme={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},yU=Tr({name:"chartLayout",initialState:Xme,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:Jme,setLayout:ege,setChartSize:tge,setScale:nge}=yU.actions,rge=yU.reducer;function vU(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function St(e){return Number.isFinite(e)}function Va(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function bD(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?bD(Object(n),!0).forEach(function(r){ige(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ige(e,t,n){return(t=age(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function age(e){var t=sge(e,"string");return typeof t=="symbol"?t:t+""}function sge(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 Tn(e,t,n){return yn(e)||yn(t)?n:Ga(t)?cd(e,t,n):typeof t=="function"?t(e):n}var oge=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:c}=t;if((c==="vertical"||c==="horizontal"&&l==="middle")&&a!=="center"&&De(e[a]))return Bu(Bu({},e),{},{[a]:e[a]+(r||0)});if((c==="horizontal"||c==="vertical"&&a==="center")&&l!=="middle"&&De(e[l]))return Bu(Bu({},e),{},{[l]:e[l]+(i||0)})}return e},Za=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",xU=(e,t,n,r)=>{if(r)return e.map(c=>c.coordinate);var i,a,l=e.map(c=>(c.coordinate===t&&(i=!0),c.coordinate===n&&(a=!0),c.coordinate));return i||l.push(t),a||l.push(n),l},bU=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:i,range:a,scale:l,realScaleType:c,isCategorical:d,categoricalDomain:f,tickCount:p,ticks:m,niceTicks:y,axisType:v}=e;if(!l)return null;var w=c==="scaleBand"&&l.bandwidth?l.bandwidth()/2:2,b=i==="category"&&l.bandwidth?l.bandwidth()/w:0;if(b=v==="angleAxis"&&a&&a.length>=2?ai(a[0]-a[1])*2*b:b,m||y){var j=(m||y||[]).map((k,E)=>{var A=r?r.indexOf(k):k,C=l.map(A);return St(C)?{coordinate:C+b,value:k,offset:b,index:E}:null}).filter(si);return j}return d&&f?f.map((k,E)=>{var A=l.map(k);return St(A)?{coordinate:A+b,value:k,index:E,offset:b}:null}).filter(si):l.ticks&&p!=null?l.ticks(p).map((k,E)=>{var A=l.map(k);return St(A)?{coordinate:A+b,value:k,index:E,offset:b}:null}).filter(si):l.domain().map((k,E)=>{var A=l.map(k);return St(A)?{coordinate:A+b,value:r?r[k]:k,index:E,offset:b}:null}).filter(si)},lge=(e,t)=>{if(!t||t.length!==2||!De(t[0])||!De(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(!De(e[0])||e[0]<n)&&(i[0]=n),(!De(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},cge=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,c=0;c<n;++c){var d=e[c],f=d?.[i];if(f!=null){var p=f[1],m=f[0],y=xa(p)?m:p;y>=0?(f[0]=a,a+=y,f[1]=a):(f[0]=l,l+=y,f[1]=l)}}}},uge=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 c=e[l],d=c?.[i];if(d!=null){var f=xa(d[1])?d[0]:d[1];f>=0?(d[0]=a,a+=f,d[1]=a):(d[0]=0,d[1]=0)}}}},dge={sign:cge,expand:Mhe,none:dc,silhouette:Ihe,wiggle:Lhe,positive:uge},fge=(e,t,n)=>{var r,i=(r=dge[n])!==null&&r!==void 0?r:dc,a=Dhe().keys(t).value((c,d)=>Number(Tn(c,d,0))).order(Y1).offset(i),l=a(e);return l.forEach((c,d)=>{c.forEach((f,p)=>{var m=Tn(e[p],t[d],0);Array.isArray(m)&&m.length===2&&De(m[0])&&De(m[1])&&(f[0]=m[0],f[1]=m[1])})}),l};function wU(e){return e==null?void 0:String(e)}function wD(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:l}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!yn(i[t.dataKey])){var c=N6(n,"value",i[t.dataKey]);if(c)return c.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var d=Tn(i,yn(l)?t.dataKey:l),f=t.scale.map(d);return De(f)?f:null}var SD=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 c=Tn(a,t.dataKey,t.scale.domain()[l]);if(yn(c))return null;var d=t.scale.map(c);return De(d)?d-i/2+r:null},hge=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]},pge=e=>{var t=e.flat(2).filter(De);return[Math.min(...t),Math.max(...t)]},mge=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],gge=(e,t,n)=>{if(e!=null)return mge(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,c=l.reduce((d,f)=>{var p=vU(f,t,n),m=pge(p);return!St(m[0])||!St(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(c[0],r[0]),Math.max(c[1],r[1])]},[1/0,-1/0]))},jD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ND=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dd=(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=g0(t,p=>p.coordinate),a=1/0,l=1,c=i.length;l<c;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 kD(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Bu(Bu({},t),{},{dataKey:n,payload:r,value:i,name:a})}function C0(e,t){if(e)return String(e);if(typeof t=="string")return t}var yge=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},vge=(e,t)=>t==="centric"?e.angle:e.radius,Bs=e=>e.layout.width,Us=e=>e.layout.height,xge=e=>e.layout.scale,SU=e=>e.layout.margin,A0=le(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),E0=le(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),bge="data-recharts-item-index",wge="data-recharts-item-id",hp=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 mg(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){Sge(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 Sge(e,t,n){return(t=jge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jge(e){var t=Nge(e,"string");return typeof t=="symbol"?t:t+""}function Nge(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 kge=e=>e.brush.height;function Cge(e){var t=E0(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:hp;return n+i}return n},0)}function Age(e){var t=E0(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:hp;return n+i}return n},0)}function Ege(e){var t=A0(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function Oge(e){var t=A0(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var ar=le([Bs,Us,SU,kge,Cge,Age,Ege,Oge,U6,eme],(e,t,n,r,i,a,l,c,d,f)=>{var p={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+l,bottom:(n.bottom||0)+c},y=mg(mg({},m),p),v=y.bottom;y.bottom+=r,y=oge(y,d,f);var w=e-y.left-y.right,b=t-y.top-y.bottom;return mg(mg({brushBottom:v},y),{},{width:Math.max(w,0),height:Math.max(b,0)})}),zge=le(ar,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),qC=le(Bs,Us,(e,t)=>({x:0,y:0,width:e,height:t})),_ge=x.createContext(null),Pr=()=>x.useContext(_ge)!=null,O0=e=>e.brush,z0=le([O0,ar,SU],(e,t,n)=>({height:e.height,x:De(e.x)?e.x:t.left,y:De(e.y)?e.y:t.top+t.height+t.brushBottom-(n?.bottom||0),width:De(e.width)?e.width:t.width})),oj={},lj={},cj={},AD;function Tge(){return AD||(AD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let l,c=null;const d=a!=null&&a.includes("leading"),f=a==null||a.includes("trailing"),p=()=>{c!==null&&(n.apply(l,c),l=void 0,c=null)},m=()=>{f&&p(),b()};let y=null;const v=()=>{y!=null&&clearTimeout(y),y=setTimeout(()=>{y=null,m()},r)},w=()=>{y!==null&&(clearTimeout(y),y=null)},b=()=>{w(),l=void 0,c=null},j=()=>{p()},k=function(...E){if(i?.aborted)return;l=this,c=E;const A=y==null;v(),d&&A&&p()};return k.schedule=v,k.cancel=b,k.flush=j,i?.addEventListener("abort",b,{once:!0}),k}e.debounce=t})(cj)),cj}var ED;function Pge(){return ED||(ED=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tge();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:c=!0,maxWait:d}=a,f=Array(2);l&&(f[0]="leading"),c&&(f[1]="trailing");let p,m=null;const y=t.debounce(function(...b){p=r.apply(this,b),m=null},i,{edges:f}),v=function(...b){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(p=r.apply(this,b),m=Date.now(),y.cancel(),y.schedule(),p):(y.apply(this,b),p)},w=()=>(y.flush(),p);return v.cancel=y.cancel,v.flush=w,v}e.debounce=n})(lj)),lj}var OD;function Rge(){return OD||(OD=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Pge();function n(r,i=0,a={}){const{leading:l=!0,trailing:c=!0}=a;return t.debounce(r,i,{leading:l,maxWait:i,trailing:c})}e.throttle=n})(oj)),oj}var uj,zD;function Dge(){return zD||(zD=1,uj=Rge().throttle),uj}var Mge=Dge();const Ige=Sa(Mge);var $y=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++]))}},Ba={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},jU=(e,t,n)=>{var{width:r=Ba.width,height:i=Ba.height,aspect:a,maxHeight:l}=n,c=fc(r)?e:Number(r),d=fc(i)?t:Number(i);return a&&a>0&&(c?d=c/a:d&&(c=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:c,calculatedHeight:d}},Lge={width:0,height:0,overflow:"visible"},$ge={width:0,overflowX:"visible"},Bge={height:0,overflowY:"visible"},Uge={},qge=e=>{var{width:t,height:n}=e,r=fc(t),i=fc(n);return r&&i?Lge:r?$ge:i?Bge:Uge};function Fge(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ba.width,a=Ba.height):i===void 0?i=r&&r>0?void 0:Ba.width:a===void 0&&(a=r&&r>0?void 0:Ba.height),{width:i,height:a}}function oN(){return oN=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},oN.apply(null,arguments)}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 TD(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){Hge(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 Hge(e,t,n){return(t=Kge(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kge(e){var t=Gge(e,"string");return typeof t=="symbol"?t:t+""}function Gge(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 NU=x.createContext(Ba.initialDimension);function Vge(e){return Va(e.width)&&Va(e.height)}function kU(e){var{children:t,width:n,height:r}=e,i=x.useMemo(()=>({width:n,height:r}),[n,r]);return Vge(i)?x.createElement(NU.Provider,{value:i},t):null}var FC=()=>x.useContext(NU),Qge=x.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ba.initialDimension,width:i,height:a,minWidth:l=Ba.minWidth,minHeight:c,maxHeight:d,children:f,debounce:p=Ba.debounce,id:m,className:y,onResize:v,style:w={}}=e,b=x.useRef(null),j=x.useRef();j.current=v,x.useImperativeHandle(t,()=>b.current);var[k,E]=x.useState({containerWidth:r.width,containerHeight:r.height}),A=x.useCallback((R,$)=>{E(F=>{var M=Math.round(R),U=Math.round($);return F.containerWidth===M&&F.containerHeight===U?F:{containerWidth:M,containerHeight:U}})},[]);x.useEffect(()=>{if(b.current==null||typeof ResizeObserver>"u")return Oc;var R=U=>{var K,Z=U[0];if(Z!=null){var{width:Y,height:H}=Z.contentRect;A(Y,H),(K=j.current)===null||K===void 0||K.call(j,Y,H)}};p>0&&(R=Ige(R,p,{trailing:!0,leading:!1}));var $=new ResizeObserver(R),{width:F,height:M}=b.current.getBoundingClientRect();return A(F,M),$.observe(b.current),()=>{$.disconnect()}},[A,p]);var{containerWidth:C,containerHeight:_}=k;$y(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:O,calculatedHeight:z}=jU(C,_,{width:i,height:a,aspect:n,maxHeight:d});return $y(O!=null&&O>0||z!=null&&z>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,z,i,a,l,c,n),x.createElement("div",{id:m?"".concat(m):void 0,className:$t("recharts-responsive-container",y),style:TD(TD({},w),{},{width:i,height:a,minWidth:l,minHeight:c,maxHeight:d}),ref:b},x.createElement("div",{style:qge({width:i,height:a})},x.createElement(kU,{width:O,height:z},f)))}),By=x.forwardRef((e,t)=>{var n=FC();if(Va(n.width)&&Va(n.height))return e.children;var{width:r,height:i}=Fge({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=jU(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return De(a)&&De(l)?x.createElement(kU,{width:a,height:l},e.children):x.createElement(Qge,oN({},e,{width:r,height:i,ref:t}))});function HC(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 _0=()=>{var e,t=Pr(),n=Ge(zge),r=Ge(z0),i=(e=Ge(O0))===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}},Yge={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},CU=()=>{var e;return(e=Ge(ar))!==null&&e!==void 0?e:Yge},KC=()=>Ge(Bs),GC=()=>Ge(Us),Wge=()=>Ge(e=>e.layout.margin),qt=e=>e.layout.layoutType,zc=()=>Ge(qt),VC=()=>{var e=zc();if(e==="horizontal"||e==="vertical")return e},AU=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Zge=()=>{var e=zc();return e!==void 0},pp=e=>{var t=ln(),n=Pr(),{width:r,height:i}=e,a=FC(),l=r,c=i;return a&&(l=a.width>0?a.width:r,c=a.height>0?a.height:i),x.useEffect(()=>{!n&&Va(l)&&Va(c)&&t(tge({width:l,height:c}))},[t,n,l,c]),null},EU=Symbol.for("immer-nothing"),PD=Symbol.for("immer-draftable"),Ei=Symbol.for("immer-state");function ya(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var $h=Object.getPrototypeOf;function fd(e){return!!e&&!!e[Ei]}function pc(e){return e?OU(e)||Array.isArray(e)||!!e[PD]||!!e.constructor?.[PD]||mp(e)||P0(e):!1}var Xge=Object.prototype.constructor.toString(),RD=new WeakMap;function OU(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=RD.get(n);return r===void 0&&(r=Function.toString.call(n),RD.set(n,r)),r===Xge}function Uy(e,t,n=!0){T0(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 T0(e){const t=e[Ei];return t?t.type_:Array.isArray(e)?1:mp(e)?2:P0(e)?3:0}function lN(e,t){return T0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zU(e,t,n){const r=T0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function Jge(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mp(e){return e instanceof Map}function P0(e){return e instanceof Set}function Il(e){return e.copy_||e.base_}function cN(e,t){if(mp(e))return new Map(e);if(P0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=OU(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ei];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],c=r[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create($h(e),r)}else{const r=$h(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function QC(e,t=!1){return R0(e)||fd(e)||!pc(e)||(T0(e)>1&&Object.defineProperties(e,{set:gg,add:gg,clear:gg,delete:gg}),Object.freeze(e),t&&Object.values(e).forEach(n=>QC(n,!0))),e}function eye(){ya(2)}var gg={value:eye};function R0(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var tye={};function mc(e){const t=tye[e];return t||ya(0,e),t}var Bh;function _U(){return Bh}function nye(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function DD(e,t){t&&(mc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function uN(e){dN(e),e.drafts_.forEach(rye),e.drafts_=null}function dN(e){e===Bh&&(Bh=e.parent_)}function MD(e){return Bh=nye(Bh,e)}function rye(e){const t=e[Ei];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ID(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ei].modified_&&(uN(t),ya(4)),pc(e)&&(e=qy(t,e),t.parent_||Fy(t,e)),t.patches_&&mc("Patches").generateReplacementPatches_(n[Ei].base_,e,t.patches_,t.inversePatches_)):e=qy(t,n,[]),uN(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==EU?e:void 0}function qy(e,t,n){if(R0(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Ei];if(!i)return Uy(t,(a,l)=>LD(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Fy(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,c=!1;i.type_===3&&(l=new Set(a),a.clear(),c=!0),Uy(l,(d,f)=>LD(e,i,a,d,f,n,c),r),Fy(e,a,!1),n&&e.patches_&&mc("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function LD(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const c=R0(i);if(!(c&&!l)){if(fd(i)){const d=a&&t&&t.type_!==3&&!lN(t.assigned_,r)?a.concat(r):void 0,f=qy(e,i,d);if(zU(n,r,f),fd(f))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(pc(i)&&!c){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&c)return;qy(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(mp(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Fy(e,i)}}}function Fy(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&QC(t,n)}function iye(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:_U(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=YC;n&&(i=[r],a=Uh);const{revoke:l,proxy:c}=Proxy.revocable(i,a);return r.draft_=c,r.revoke_=l,c}var YC={get(e,t){if(t===Ei)return e;const n=Il(e);if(!lN(n,t))return aye(e,n,t);const r=n[t];return e.finalized_||!pc(r)?r:r===dj(e.base_,t)?(fj(e),e.copy_[t]=hN(r,e)):r},has(e,t){return t in Il(e)},ownKeys(e){return Reflect.ownKeys(Il(e))},set(e,t,n){const r=TU(Il(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=dj(Il(e),t),a=i?.[Ei];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Jge(n,i)&&(n!==void 0||lN(e.base_,t)))return!0;fj(e),fN(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 dj(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,fj(e),fN(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Il(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){ya(11)},getPrototypeOf(e){return $h(e.base_)},setPrototypeOf(){ya(12)}},Uh={};Uy(YC,(e,t)=>{Uh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Uh.deleteProperty=function(e,t){return Uh.set.call(this,e,t,void 0)};Uh.set=function(e,t,n){return YC.set.call(this,e[0],t,n,e[0])};function dj(e,t){const n=e[Ei];return(n?Il(n):e)[t]}function aye(e,t,n){const r=TU(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}function TU(e,t){if(!(t in e))return;let n=$h(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=$h(n)}}function fN(e){e.modified_||(e.modified_=!0,e.parent_&&fN(e.parent_))}function fj(e){e.copy_||(e.copy_=cN(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var sye=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"&&ya(6),r!==void 0&&typeof r!="function"&&ya(7);let i;if(pc(t)){const a=MD(this),l=hN(t,void 0);let c=!0;try{i=n(l),c=!1}finally{c?uN(a):dN(a)}return DD(a,r),ID(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===EU&&(i=void 0),this.autoFreeze_&&QC(i,!0),r){const a=[],l=[];mc("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else ya(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...c)=>this.produceWithPatches(l,d=>t(d,...c));let r,i;return[this.produce(t,n,(l,c)=>{r=l,i=c}),r,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof e?.useStrictIteration=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){pc(e)||ya(8),fd(e)&&(e=oye(e));const t=MD(this),n=hN(e,void 0);return n[Ei].isManual_=!0,dN(t),n}finishDraft(e,t){const n=e&&e[Ei];(!n||!n.isManual_)&&ya(9);const{scope_:r}=n;return DD(r,t),ID(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=mc("Patches").applyPatches_;return fd(e)?r(e,t):this.produce(e,i=>r(i,t))}};function hN(e,t){const n=mp(e)?mc("MapSet").proxyMap_(e,t):P0(e)?mc("MapSet").proxySet_(e,t):iye(e,t);return(t?t.scope_:_U()).drafts_.push(n),n}function oye(e){return fd(e)||ya(10,e),PU(e)}function PU(e){if(!pc(e)||R0(e))return e;const t=e[Ei];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cN(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=cN(e,!0);return Uy(n,(i,a)=>{zU(n,i,PU(a))},r),t&&(t.finalized_=!1),n}var lye=new sye;lye.produce;var cye={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},RU=Tr({name:"legend",initialState:cye,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:sn()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Gi(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:sn()},removeLegendPayload:{reducer(e,t){var n=Gi(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:sn()}}}),{setLegendSize:$D,setLegendSettings:uye,addLegendPayload:dye,replaceLegendPayload:fye,removeLegendPayload:hye}=RU.actions,pye=RU.reducer,hj={exports:{}},pj={};var BD;function mye(){if(BD)return pj;BD=1;var e=wd();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,c=e.useDebugValue;return pj.useSyncExternalStoreWithSelector=function(d,f,p,m,y){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=l(function(){function j(_){if(!k){if(k=!0,E=_,_=m(_),y!==void 0&&w.hasValue){var O=w.value;if(y(O,_))return A=O}return A=_}if(O=A,n(E,_))return O;var z=m(_);return y!==void 0&&y(O,z)?(E=_,O):(E=_,A=z)}var k=!1,E,A,C=p===void 0?null:p;return[function(){return j(f())},C===null?void 0:function(){return j(C())}]},[f,p,m,y]);var b=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=b},[b]),c(b),b},pj}var UD;function gye(){return UD||(UD=1,hj.exports=mye()),hj.exports}gye();function yye(e){e()}function vye(){let e=null,t=null;return{clear(){e=null,t=null},notify(){yye(()=>{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 qD={notify(){},get:()=>[]};function xye(e,t){let n,r=qD,i=0,a=!1;function l(b){p();const j=r.subscribe(b);let k=!1;return()=>{k||(k=!0,j(),m())}}function c(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function f(){return a}function p(){i++,n||(n=e.subscribe(d),r=vye())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=qD)}function y(){a||(a=!0,p())}function v(){a&&(a=!1,m())}const w={addNestedSub:l,notifyNestedSubs:c,handleChangeWrapper:d,isSubscribed:f,trySubscribe:y,tryUnsubscribe:v,getListeners:()=>r};return w}var bye=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wye=bye(),Sye=()=>typeof navigator<"u"&&navigator.product==="ReactNative",jye=Sye(),Nye=()=>wye||jye?x.useLayoutEffect:x.useEffect,kye=Nye();function FD(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Cye(e,t){if(FD(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])||!FD(e[n[i]],t[n[i]]))return!1;return!0}var Aye=Symbol.for("react-redux-context"),Eye=typeof globalThis<"u"?globalThis:{};function Oye(){if(!x.createContext)return{};const e=Eye[Aye]??=new Map;let t=e.get(x.createContext);return t||(t=x.createContext(null),e.set(x.createContext,t)),t}var zye=Oye();function _ye(e){const{children:t,context:n,serverState:r,store:i}=e,a=x.useMemo(()=>{const d=xye(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=x.useMemo(()=>i.getState(),[i]);kye(()=>{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 c=n||zye;return x.createElement(c.Provider,{value:a},t)}var Tye=_ye,Pye=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Rye(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function _d(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(Pye.has(r)){if(e[r]==null&&t[r]==null)continue;if(!Cye(e[r],t[r]))return!1}else if(!Rye(e[r],t[r]))return!1;return!0}var Dye=["contextPayload"];function pN(){return pN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pN.apply(null,arguments)}function HD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function hd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HD(Object(n),!0).forEach(function(r){Mye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mye(e,t,n){return(t=Iye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Iye(e){var t=Lye(e,"string");return typeof t=="symbol"?t:t+""}function Lye(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $ye(e,t){if(e==null)return{};var n,r,i=Bye(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 Bye(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 Uye(e){return e.value}function qye(e){var{contextPayload:t}=e,n=$ye(e,Dye),r=I6(t,e.payloadUniqBy,Uye),i=hd(hd({},n),{},{payload:r});return x.isValidElement(e.content)?x.cloneElement(e.content,i):typeof e.content=="function"?x.createElement(e.content,i):x.createElement(hpe,i)}function Fye(e,t,n,r,i,a){var{layout:l,align:c,verticalAlign:d}=t,f,p;return(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))&&(c==="center"&&l==="vertical"?f={left:((r||0)-a.width)/2}:f=c==="right"?{right:n&&n.right||0}:{left:n&&n.left||0}),(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))&&(d==="middle"?p={top:((i||0)-a.height)/2}:p=d==="bottom"?{bottom:n&&n.bottom||0}:{top:n&&n.top||0}),hd(hd({},f),p)}function Hye(e){var t=ln();return x.useEffect(()=>{t(uye(e))},[t,e]),null}function Kye(e){var t=ln();return x.useEffect(()=>(t($D(e)),()=>{t($D({width:0,height:0}))}),[t,e]),null}function Gye(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Vye={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function Qye(e){var t=_r(e,Vye),n=rme(),r=ahe(),i=Wge(),{width:a,height:l,wrapperStyle:c,portal:d}=t,[f,p]=q6([n]),m=KC(),y=GC();if(m==null||y==null)return null;var v=m-(i?.left||0)-(i?.right||0),w=Gye(t.layout,l,a,v),b=d?c:hd(hd({position:"absolute",width:w?.width||a||"auto",height:w?.height||l||"auto"},Fye(c,t,i,m,y,f)),c),j=d??r;if(j==null||n==null)return null;var k=x.createElement("div",{className:"recharts-legend-wrapper",style:b,ref:p},x.createElement(Hye,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!d&&x.createElement(Kye,{width:f.width,height:f.height}),x.createElement(qye,pN({},t,w,{margin:i,chartWidth:m,chartHeight:y,contextPayload:n})));return wc.createPortal(k,j)}var DU=x.memo(Qye,_d);DU.displayName="Legend";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 KD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Kf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KD(Object(n),!0).forEach(function(r){Yye(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yye(e,t,n){return(t=Wye(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wye(e){var t=Zye(e,"string");return typeof t=="symbol"?t:t+""}function Zye(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 Xye(e){return Array.isArray(e)&&Ga(e[0])&&Ga(e[1])?e.join(" ~ "):e}var Nu={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 Jye(e,t){return t==null?e:g0(e,t)}var eve=e=>{var{separator:t=Nu.separator,contentStyle:n,itemStyle:r,labelStyle:i=Nu.labelStyle,payload:a,formatter:l,itemSorter:c,wrapperClassName:d,labelClassName:f,label:p,labelFormatter:m,accessibilityLayer:y=Nu.accessibilityLayer}=e,v=()=>{if(a&&a.length){var _={padding:0,margin:0},O=Jye(a,c),z=O.map((R,$)=>{if(!R||R.type==="none")return null;var F=R.formatter||l||Xye,{value:M,name:U}=R,K=M,Z=U;if(F){var Y=F(M,U,R,$,a);if(Array.isArray(Y))[K,Z]=Y;else if(Y!=null)K=Y;else return null}var H=Kf(Kf({},Nu.itemStyle),{},{color:R.color||Nu.itemStyle.color},r);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat($),style:H},Ga(Z)?x.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Ga(Z)?x.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,x.createElement("span",{className:"recharts-tooltip-item-value"},K),x.createElement("span",{className:"recharts-tooltip-item-unit"},R.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:_},z)}return null},w=Kf(Kf({},Nu.contentStyle),n),b=Kf({margin:0},i),j=!yn(p),k=j?p:"",E=$t("recharts-default-tooltip",d),A=$t("recharts-tooltip-label",f);j&&m&&a!==void 0&&a!==null&&(k=m(p,a));var C=y?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",mN({className:E,style:w},C),x.createElement("p",{className:A,style:b},x.isValidElement(k)?k:"".concat(k)),v())},Gf="recharts-tooltip-wrapper",tve={visibility:"hidden"};function nve(e){var{coordinate:t,translateX:n,translateY:r}=e;return $t(Gf,{["".concat(Gf,"-right")]:De(n)&&t&&De(t.x)&&n>=t.x,["".concat(Gf,"-left")]:De(n)&&t&&De(t.x)&&n<t.x,["".concat(Gf,"-bottom")]:De(r)&&t&&De(t.y)&&r>=t.y,["".concat(Gf,"-top")]:De(r)&&t&&De(t.y)&&r<t.y})}function GD(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:c,viewBox:d,viewBoxDimension:f}=e;if(a&&De(a[r]))return a[r];var p=n[r]-c-(i>0?i:0),m=n[r]+i;if(t[r])return l[r]?p:m;var y=d[r];if(y==null)return 0;if(l[r]){var v=p,w=y;return v<w?Math.max(m,y):Math.max(p,y)}if(f==null)return 0;var b=m+c,j=y+f;return b>j?Math.max(p,y):Math.max(m,y)}function rve(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 ive(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:c,useTranslate3d:d,viewBox:f}=e,p,m,y;return c.height>0&&c.width>0&&n?(m=GD({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:c.width,viewBox:f,viewBoxDimension:f.width}),y=GD({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:c.height,viewBox:f,viewBoxDimension:f.height}),p=rve({translateX:m,translateY:y,useTranslate3d:d})):p=tve,{cssProperties:p,cssClasses:nve({translateX:m,translateY:y,coordinate:n})}}var ave=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),gp={isSsr:ave()};function MU(){var[e,t]=x.useState(()=>gp.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 VD(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 ku(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VD(Object(n),!0).forEach(function(r){sve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sve(e,t,n){return(t=ove(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ove(e){var t=lve(e,"string");return typeof t=="symbol"?t:t+""}function lve(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 cve(e){if(!(e.prefersReducedMotion&&e.isAnimationActive==="auto")&&e.isAnimationActive&&e.active)return"transform ".concat(e.animationDuration,"ms ").concat(e.animationEasing)}function uve(e){var t,n,r,i,a,l,c=MU(),[d,f]=x.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}));x.useEffect(()=>{var w=b=>{if(b.key==="Escape"){var j,k,E,A;f({dismissed:!0,dismissedAtCoordinate:{x:(j=(k=e.coordinate)===null||k===void 0?void 0:k.x)!==null&&j!==void 0?j:0,y:(E=(A=e.coordinate)===null||A===void 0?void 0:A.y)!==null&&E!==void 0?E:0}})}};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[(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(ku(ku({},d),{},{dismissed:!1}));var{cssClasses:p,cssProperties:m}=ive({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),y=e.hasPortalFromProps?{}:ku(ku({transition:cve({prefersReducedMotion:c,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},m),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),v=ku(ku({},y),{},{visibility:!d.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:p,style:v,ref:e.innerRef},e.children)}var dve=x.memo(uve),IU=()=>{var e;return(e=Ge(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};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 QD(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 YD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QD(Object(n),!0).forEach(function(r){fve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fve(e,t,n){return(t=hve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hve(e){var t=pve(e,"string");return typeof t=="symbol"?t:t+""}function pve(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 WD={curveBasisClosed:Nhe,curveBasisOpen:khe,curveBasis:jhe,curveBumpX:che,curveBumpY:uhe,curveLinearClosed:Che,curveLinear:h0,curveMonotoneX:Ahe,curveMonotoneY:Ehe,curveNatural:Ohe,curveStep:zhe,curveStepAfter:The,curveStepBefore:_he},Hy=e=>St(e.x)&&St(e.y),ZD=e=>e.base!=null&&Hy(e.base)&&Hy(e),Vf=e=>e.x,Qf=e=>e.y,mve=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(up(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=WD["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return WD[n]||h0},XD={connectNulls:!1,type:"linear"},gve=e=>{var{type:t=XD.type,points:n=[],baseLine:r,layout:i,connectNulls:a=XD.connectNulls}=e,l=mve(t,i),c=a?n.filter(Hy):n;if(Array.isArray(r)){var d,f=n.map((w,b)=>YD(YD({},w),{},{base:r[b]}));i==="vertical"?d=cg().y(Qf).x1(Vf).x0(w=>w.base.x):d=cg().x(Vf).y1(Qf).y0(w=>w.base.y);var p=d.defined(ZD).curve(l),m=a?f.filter(ZD):f;return p(m)}var y;i==="vertical"&&De(r)?y=cg().y(Qf).x1(Vf).x0(r):De(r)?y=cg().x(Vf).y1(Qf).y0(r):y=d6().x(Vf).y(Qf);var v=y.defined(Hy).curve(l);return v(c)},yh=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=zc();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},c=n&&n.length?gve(l):r;return x.createElement("path",gN({},Zi(e),PC(e),{className:$t("recharts-curve",t),d:c===null?void 0:c,ref:i}))},yve=["x","y","top","left","width","height","className"];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 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 vve(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){xve(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 xve(e,t,n){return(t=bve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bve(e){var t=wve(e,"string");return typeof t=="symbol"?t:t+""}function wve(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 Sve(e,t){if(e==null)return{};var n,r,i=jve(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 jve(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 Nve=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),kve=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:c}=e,d=Sve(e,yve),f=vve({x:t,y:n,top:r,left:i,width:a,height:l},d);return!De(t)||!De(n)||!De(a)||!De(l)||!De(r)||!De(i)?null:x.createElement("path",yN({},Gr(f),{className:$t("recharts-cross",c),d:Nve(t,n,a,l,r,i)}))};function Cve(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 eM(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 tM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eM(Object(n),!0).forEach(function(r){Ave(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ave(e,t,n){return(t=Eve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eve(e){var t=Ove(e,"string");return typeof t=="symbol"?t:t+""}function Ove(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 zve=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),LU=(e,t,n)=>e.map(r=>"".concat(zve(r)," ").concat(t,"ms ").concat(n)).join(","),_ve=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),qh=(e,t)=>Object.keys(t).reduce((n,r)=>tM(tM({},n),{},{[r]:e(r,t[r])}),{});function nM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nM(Object(n),!0).forEach(function(r){Tve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tve(e,t,n){return(t=Pve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pve(e){var t=Rve(e,"string");return typeof t=="symbol"?t:t+""}function Rve(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 Ky=(e,t,n)=>e+(t-e)*n,vN=e=>{var{from:t,to:n}=e;return t!==n},$U=(e,t,n)=>{var r=qh((i,a)=>{if(vN(a)){var[l,c]=e(a.from,a.to,a.velocity);return Wn(Wn({},a),{},{from:l,velocity:c})}return a},t);return n<1?qh((i,a)=>vN(a)&&r[i]!=null?Wn(Wn({},a),{},{velocity:Ky(a.velocity,r[i].velocity,n),from:Ky(a.from,r[i].from,n)}):a,t):$U(e,r,n-1)};function Dve(e,t,n,r,i,a){var l,c=r.reduce((y,v)=>Wn(Wn({},y),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>qh((y,v)=>v.from,c),f=()=>!Object.values(c).filter(vN).length,p=null,m=y=>{l||(l=y);var v=y-l,w=v/n.dt;c=$U(n,c,w),i(Wn(Wn(Wn({},e),t),d())),l=y,f()||(p=a.setTimeout(m))};return()=>(p=a.setTimeout(m),()=>{var y;(y=p)===null||y===void 0||y()})}function Mve(e,t,n,r,i,a,l){var c=null,d=i.reduce((m,y)=>{var v=e[y],w=t[y];return v==null||w==null?m:Wn(Wn({},m),{},{[y]:[v,w]})},{}),f,p=m=>{f||(f=m);var y=(m-f)/r,v=qh((b,j)=>Ky(...j,n(y)),d);if(a(Wn(Wn(Wn({},e),t),v)),y<1)c=l.setTimeout(p);else{var w=qh((b,j)=>Ky(...j,n(1)),d);a(Wn(Wn(Wn({},e),t),w))}};return()=>(c=l.setTimeout(p),()=>{var m;(m=c)===null||m===void 0||m()})}const Ive=(e,t,n,r,i,a)=>{var l=_ve(e,t);return n==null?()=>(i(Wn(Wn({},e),t)),()=>{}):n.isStepper===!0?Dve(e,t,n,l,i,a):Mve(e,t,n,r,l,i,a)};var Gy=1e-4,BU=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],UU=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),rM=(e,t)=>n=>{var r=BU(e,t);return UU(r,n)},Lve=(e,t)=>n=>{var r=BU(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return UU(i,n)},$ve=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]]},Bve=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=$ve(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},Uve=(e,t,n,r)=>{var i=rM(e,n),a=rM(t,r),l=Lve(e,n),c=f=>f>1?1:f<0?0:f,d=f=>{for(var p=f>1?1:f,m=p,y=0;y<8;++y){var v=i(m)-p,w=l(m);if(Math.abs(v-p)<Gy||w<Gy)return a(m);m=c(m-v/w)}return a(m)};return d.isStepper=!1,d},iM=function(){return Uve(...Bve(...arguments))},qve=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,c,d)=>{var f=-(l-c)*n,p=d*r,m=d+(f-p)*i/1e3,y=d*i/1e3+l;return Math.abs(y-c)<Gy&&Math.abs(m)<Gy?[c,0]:[y,m]};return a.isStepper=!0,a.dt=i,a},Fve=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return iM(e);case"spring":return qve();default:if(e.split("(")[0]==="cubic-bezier")return iM(e)}return typeof e=="function"?e:null};function Hve(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var c=l,[d,...f]=c;if(typeof d=="number"){i=e.setTimeout(a.bind(null,f),d);return}a(d),i=e.setTimeout(a.bind(null,f));return}typeof 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 Kve{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 Gve(){return Hve(new Kve)}var Vve=x.createContext(Gve);function Qve(e,t){var n=x.useContext(Vve);return x.useMemo(()=>t??n(e),[e,t,n])}var Yve={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},aM={t:0},mj={t:1};function D0(e){var t=_r(e,Yve),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:c,onAnimationStart:d,children:f}=t,p=MU(),m=n==="auto"?!gp.isSsr&&!p:n,y=Qve(t.animationId,t.animationManager),[v,w]=x.useState(m?aM:mj),b=x.useRef(null);return x.useEffect(()=>{m||w(mj)},[m]),x.useEffect(()=>{if(!m||!r)return Oc;var j=Ive(aM,mj,Fve(a),i,w,y.getTimeoutController()),k=()=>{b.current=j()};return y.start([d,l,k,i,c]),()=>{y.stop(),b.current&&b.current(),c()}},[m,r,i,a,l,d,c,y]),f(v.t)}function M0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=x.useRef(Dh(t)),r=x.useRef(e);return r.current!==e&&(n.current=Dh(t),r.current=e),n.current}var Wve=["radius"],Zve=["radius"],sM,oM,lM,cM,uM,dM,fM,hM,pM,mM;function gM(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 yM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gM(Object(n),!0).forEach(function(r){Xve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xve(e,t,n){return(t=Jve(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jve(e){var t=e0e(e,"string");return typeof t=="symbol"?t:t+""}function e0e(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 Vy(){return Vy=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},Vy.apply(null,arguments)}function vM(e,t){if(e==null)return{};var n,r,i=t0e(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 t0e(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 Ta(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var xM=(e,t,n,r,i)=>{var a=Io(n),l=Io(r),c=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(c>0&&Array.isArray(i)){for(var y=[0,0,0,0],v=0,w=4;v<w;v++){var b,j=(b=i[v])!==null&&b!==void 0?b:0;y[v]=j>c?c:j}m=Cn(sM||(sM=Ta(["M",",",""])),e,t+d*y[0]),y[0]>0&&(m+=Cn(oM||(oM=Ta(["A ",",",",0,0,",",",",",""])),y[0],y[0],p,e+f*y[0],t)),m+=Cn(lM||(lM=Ta(["L ",",",""])),e+n-f*y[1],t),y[1]>0&&(m+=Cn(cM||(cM=Ta(["A ",",",",0,0,",`,
|
|
261
|
+
`,",",""])),y[1],y[1],p,e+n,t+d*y[1])),m+=Cn(uM||(uM=Ta(["L ",",",""])),e+n,t+r-d*y[2]),y[2]>0&&(m+=Cn(dM||(dM=Ta(["A ",",",",0,0,",`,
|
|
262
|
+
`,",",""])),y[2],y[2],p,e+n-f*y[2],t+r)),m+=Cn(fM||(fM=Ta(["L ",",",""])),e+f*y[3],t+r),y[3]>0&&(m+=Cn(hM||(hM=Ta(["A ",",",",0,0,",`,
|
|
263
|
+
`,",",""])),y[3],y[3],p,e,t+r-d*y[3])),m+="Z"}else if(c>0&&i===+i&&i>0){var k=Math.min(c,i);m=Cn(pM||(pM=Ta(["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=Cn(mM||(mM=Ta(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},bM={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qU=e=>{var t=_r(e,bM),n=x.useRef(null),[r,i]=x.useState(-1);x.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var X=n.current.getTotalLength();X&&i(X)}catch{}},[]);var{x:a,y:l,width:c,height:d,radius:f,className:p}=t,{animationEasing:m,animationDuration:y,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:b}=t,j=x.useRef(c),k=x.useRef(d),E=x.useRef(a),A=x.useRef(l),C=x.useMemo(()=>({x:a,y:l,width:c,height:d,radius:f}),[a,l,c,d,f]),_=M0(C,"rectangle-");if(a!==+a||l!==+l||c!==+c||d!==+d||c===0||d===0)return null;var O=$t("recharts-rectangle",p);if(!b){var z=Gr(t),{radius:R}=z,$=vM(z,Wve);return x.createElement("path",Vy({},$,{x:Io(a),y:Io(l),width:Io(c),height:Io(d),radius:typeof f=="number"?f:void 0,className:O,d:xM(a,l,c,d,f)}))}var F=j.current,M=k.current,U=E.current,K=A.current,Z="0px ".concat(r===-1?1:r,"px"),Y="".concat(r,"px ").concat(r,"px"),H=LU(["strokeDasharray"],y,typeof m=="string"?m:bM.animationEasing);return x.createElement(D0,{animationId:_,key:_,canBegin:r>0,duration:y,easing:m,isActive:b,begin:v},X=>{var ue=gn(F,c,X),xe=gn(M,d,X),L=gn(U,a,X),q=gn(K,l,X);n.current&&(j.current=ue,k.current=xe,E.current=L,A.current=q);var I;w?X>0?I={transition:H,strokeDasharray:Y}:I={strokeDasharray:Z}:I={strokeDasharray:Y};var D=Gr(t),{radius:V}=D,re=vM(D,Zve);return x.createElement("path",Vy({},re,{radius:typeof f=="number"?f:void 0,className:O,d:xM(L,q,ue,xe,f),ref:n,style:yM(yM({},I),t.style)}))})};function wM(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 SM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wM(Object(n),!0).forEach(function(r){n0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wM(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n0e(e,t,n){return(t=r0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r0e(e){var t=i0e(e,"string");return typeof t=="symbol"?t:t+""}function i0e(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 Qy=Math.PI/180,a0e=e=>e*180/Math.PI,Sr=(e,t,n,r)=>({x:e+Math.cos(-Qy*r)*n,y:t+Math.sin(-Qy*r)*n}),s0e=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},o0e=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},l0e=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=o0e({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var c=(n-i)/l,d=Math.acos(c);return r>a&&(d=2*Math.PI-d),{radius:l,angle:a0e(d),angleInRadian:d}},c0e=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}},u0e=(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},d0e=(e,t)=>{var{relativeX:n,relativeY:r}=e,{radius:i,angle:a}=l0e({x:n,y:r},t),{innerRadius:l,outerRadius:c}=t;if(i<l||i>c||i===0)return null;var{startAngle:d,endAngle:f}=c0e(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?SM(SM({},t),{},{radius:i,angle:u0e(p,t)}):null};function FU(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=Sr(t,n,r,i),c=Sr(t,n,r,a);return{points:[l,c],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var jM,NM,kM,CM,AM,EM,OM;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){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var f0e=(e,t)=>{var n=ai(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},yg=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:c,cornerIsExternal:d}=e,f=c*(l?1:-1)+r,p=Math.asin(c/f)/Qy,m=d?i:i+a*p,y=Sr(t,n,f,m),v=Sr(t,n,r,m),w=d?i-a*p:i,b=Sr(t,n,f*Math.cos(p*Qy),w);return{center:y,circleTangency:v,lineTangency:b,theta:p}},HU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,c=f0e(a,l),d=a+c,f=Sr(t,n,i,a),p=Sr(t,n,i,d),m=Cn(jM||(jM=Kl(["M ",",",`
|
|
271
|
+
A `,",",`,0,
|
|
272
|
+
`,",",`,
|
|
273
|
+
`,",",`
|
|
274
|
+
`])),f.x,f.y,i,i,+(Math.abs(c)>180),+(a>d),p.x,p.y);if(r>0){var y=Sr(t,n,r,a),v=Sr(t,n,r,d);m+=Cn(NM||(NM=Kl(["L ",",",`
|
|
275
|
+
A `,",",`,0,
|
|
276
|
+
`,",",`,
|
|
277
|
+
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(c)>180),+(a<=d),y.x,y.y)}else m+=Cn(kM||(kM=Kl(["L ",","," Z"])),t,n);return m},h0e=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:f}=e,p=ai(f-d),{circleTangency:m,lineTangency:y,theta:v}=yg({cx:t,cy:n,radius:i,angle:d,sign:p,cornerRadius:a,cornerIsExternal:c}),{circleTangency:w,lineTangency:b,theta:j}=yg({cx:t,cy:n,radius:i,angle:f,sign:-p,cornerRadius:a,cornerIsExternal:c}),k=c?Math.abs(d-f):Math.abs(d-f)-v-j;if(k<0)return l?Cn(CM||(CM=Kl(["M ",",",`
|
|
278
|
+
a`,",",",0,0,1,",`,0
|
|
279
|
+
a`,",",",0,0,1,",`,0
|
|
280
|
+
`])),y.x,y.y,a,a,a*2,a,a,-a*2):HU({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:f});var E=Cn(AM||(AM=Kl(["M ",",",`
|
|
281
|
+
A`,",",",0,0,",",",",",`
|
|
282
|
+
A`,",",",0,",",",",",",",`
|
|
283
|
+
A`,",",",0,0,",",",",",`
|
|
284
|
+
`])),y.x,y.y,a,a,+(p<0),m.x,m.y,i,i,+(k>180),+(p<0),w.x,w.y,a,a,+(p<0),b.x,b.y);if(r>0){var{circleTangency:A,lineTangency:C,theta:_}=yg({cx:t,cy:n,radius:r,angle:d,sign:p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),{circleTangency:O,lineTangency:z,theta:R}=yg({cx:t,cy:n,radius:r,angle:f,sign:-p,isExternal:!0,cornerRadius:a,cornerIsExternal:c}),$=c?Math.abs(d-f):Math.abs(d-f)-_-R;if($<0&&a===0)return"".concat(E,"L").concat(t,",").concat(n,"Z");E+=Cn(EM||(EM=Kl(["L",",",`
|
|
285
|
+
A`,",",",0,0,",",",",",`
|
|
286
|
+
A`,",",",0,",",",",",",",`
|
|
287
|
+
A`,",",",0,0,",",",",","Z"])),z.x,z.y,a,a,+(p<0),O.x,O.y,r,r,+($>180),+(p>0),A.x,A.y,a,a,+(p<0),C.x,C.y)}else E+=Cn(OM||(OM=Kl(["L",",","Z"])),t,n);return E},p0e={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},KU=e=>{var t=_r(e,p0e),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p,className:m}=t;if(a<i||f===p)return null;var y=$t("recharts-sector",m),v=a-i,w=ba(l,v,0,!0),b;return w>0&&Math.abs(f-p)<360?b=h0e({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:c,cornerIsExternal:d,startAngle:f,endAngle:p}):b=HU({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:f,endAngle:p}),x.createElement("path",xN({},Gr(t),{className:y,d:b}))};function m0e(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(C6(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:c}=t,d=Sr(r,i,a,c),f=Sr(r,i,l,c);return[{x:d.x,y:d.y},{x:f.x,y:f.y}]}return FU(t)}}var gj={},yj={},vj={},zM;function g0e(){return zM||(zM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$6();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(vj)),vj}var _M;function y0e(){return _M||(_M=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=g0e();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})(yj)),yj}var TM;function v0e(){return TM||(TM=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=B6(),n=y0e();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 c=Math.max(Math.ceil((a-i)/(l||1)),0),d=new Array(c);for(let f=0;f<c;f++)d[f]=i,i+=l;return d}e.range=r})(gj)),gj}var xj,PM;function x0e(){return PM||(PM=1,xj=v0e().range),xj}var b0e=x0e();const GU=Sa(b0e);var Ca=e=>e.chartData,WC=le([Ca],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),I0=(e,t,n,r)=>r?WC(e):Ca(e),VU=(e,t,n)=>n?WC(e):Ca(e),w0e=le([I0],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});le([WC],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});var S0e=le([Ca],e=>{var{chartData:t,dataStartIndex:n,dataEndIndex:r}=e;return t!=null?t.slice(n,r+1):[]});function qa(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(St(t)&&St(n))return!0}return!1}function RM(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function QU(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(St(n))i=n;else if(typeof n=="function")return;if(St(r))a=r;else if(typeof r=="function")return;var l=[i,a];if(qa(l))return l}}function j0e(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(qa(r))return RM(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,c;if(i==="auto")t!=null&&(l=Math.min(...t));else if(De(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t?.[0]))}catch{}else if(typeof i=="string"&&jD.test(i)){var d=jD.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&&(c=Math.max(...t));else if(De(a))c=a;else if(typeof a=="function")try{t!=null&&(c=a(t?.[1]))}catch{}else if(typeof a=="string"&&ND.test(a)){var p=ND.exec(a);if(p==null||p[1]==null||t==null)c=void 0;else{var m=+p[1];c=t[1]+m}}else c=t?.[1];var y=[l,c];if(qa(y))return t==null?y:RM(y,t,n)}}}var Td=1e9,N0e={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},XC,hn=!0,Xi="[DecimalError] ",ec=Xi+"Invalid argument: ",ZC=Xi+"Exponent out of range: ",Pd=Math.floor,Ll=Math.pow,k0e=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ji,tr=1e7,on=7,YU=9007199254740991,Yy=Pd(YU/on),Me={};Me.absoluteValue=Me.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Me.comparedTo=Me.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};Me.decimalPlaces=Me.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*on;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Me.dividedBy=Me.div=function(e){return _s(this,new this.constructor(e))};Me.dividedToIntegerBy=Me.idiv=function(e){var t=this,n=t.constructor;return Xt(_s(t,new n(e),0,1),n.precision)};Me.equals=Me.eq=function(e){return!this.cmp(e)};Me.exponent=function(){return Fn(this)};Me.greaterThan=Me.gt=function(e){return this.cmp(e)>0};Me.greaterThanOrEqualTo=Me.gte=function(e){return this.cmp(e)>=0};Me.isInteger=Me.isint=function(){return this.e>this.d.length-2};Me.isNegative=Me.isneg=function(){return this.s<0};Me.isPositive=Me.ispos=function(){return this.s>0};Me.isZero=function(){return this.s===0};Me.lessThan=Me.lt=function(e){return this.cmp(e)<0};Me.lessThanOrEqualTo=Me.lte=function(e){return this.cmp(e)<1};Me.logarithm=Me.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ji))throw Error(Xi+"NaN");if(n.s<1)throw Error(Xi+(n.s?"NaN":"-Infinity"));return n.eq(ji)?new r(0):(hn=!1,t=_s(Fh(n,a),Fh(e,a),a),hn=!0,Xt(t,i))};Me.minus=Me.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?XU(t,e):WU(t,(e.s=-e.s,e))};Me.modulo=Me.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Xi+"NaN");return n.s?(hn=!1,t=_s(n,e,0,1).times(e),hn=!0,n.minus(t)):Xt(new r(n),i)};Me.naturalExponential=Me.exp=function(){return ZU(this)};Me.naturalLogarithm=Me.ln=function(){return Fh(this)};Me.negated=Me.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Me.plus=Me.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?WU(t,e):XU(t,(e.s=-e.s,e))};Me.precision=Me.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ec+e);if(t=Fn(i)+1,r=i.d.length-1,n=r*on+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Me.squareRoot=Me.sqrt=function(){var e,t,n,r,i,a,l,c=this,d=c.constructor;if(c.s<1){if(!c.s)return new d(0);throw Error(Xi+"NaN")}for(e=Fn(c),hn=!1,i=Math.sqrt(+c),i==0||i==1/0?(t=Ua(c.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Pd((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(_s(c,a,l+2)).times(.5),Ua(a.d).slice(0,l)===(t=Ua(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(Xt(a,n+1,0),a.times(a).eq(c)){r=a;break}}else if(t!="9999")break;l+=4}return hn=!0,Xt(r,n)};Me.times=Me.mul=function(e){var t,n,r,i,a,l,c,d,f,p=this,m=p.constructor,y=p.d,v=(e=new m(e)).d;if(!p.s||!e.s)return new m(0);for(e.s*=p.s,n=p.e+e.e,d=y.length,f=v.length,d<f&&(a=y,y=v,v=a,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;)c=a[i]+v[r]*y[i-r-1]+t,a[i--]=c%tr|0,t=c/tr|0;a[i]=(a[i]+t)%tr|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,hn?Xt(e,m.precision):e};Me.toDecimalPlaces=Me.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Qa(e,0,Td),t===void 0?t=r.rounding:Qa(t,0,8),Xt(n,e+Fn(n)+1,t))};Me.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=gc(r,!0):(Qa(e,0,Td),t===void 0?t=i.rounding:Qa(t,0,8),r=Xt(new i(r),e+1,t),n=gc(r,!0,e+1)),n};Me.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?gc(i):(Qa(e,0,Td),t===void 0?t=a.rounding:Qa(t,0,8),r=Xt(new a(i),e+Fn(i)+1,t),n=gc(r.abs(),!1,e+Fn(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};Me.toInteger=Me.toint=function(){var e=this,t=e.constructor;return Xt(new t(e),Fn(e)+1,t.rounding)};Me.toNumber=function(){return+this};Me.toPower=Me.pow=function(e){var t,n,r,i,a,l,c=this,d=c.constructor,f=12,p=+(e=new d(e));if(!e.s)return new d(ji);if(c=new d(c),!c.s){if(e.s<1)throw Error(Xi+"Infinity");return c}if(c.eq(ji))return c;if(r=d.precision,e.eq(ji))return Xt(c,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=c.s,l){if((n=p<0?-p:p)<=YU){for(i=new d(ji),t=Math.ceil(r/on+4),hn=!1;n%2&&(i=i.times(c),MM(i.d,t)),n=Pd(n/2),n!==0;)c=c.times(c),MM(c.d,t);return hn=!0,e.s<0?new d(ji).div(i):Xt(i,r)}}else if(a<0)throw Error(Xi+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,c.s=1,hn=!1,i=e.times(Fh(c,r+f)),hn=!0,i=ZU(i),i.s=a,i};Me.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Fn(i),r=gc(i,n<=a.toExpNeg||n>=a.toExpPos)):(Qa(e,1,Td),t===void 0?t=a.rounding:Qa(t,0,8),i=Xt(new a(i),e,t),n=Fn(i),r=gc(i,e<=n||n<=a.toExpNeg,e)),r};Me.toSignificantDigits=Me.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Qa(e,1,Td),t===void 0?t=r.rounding:Qa(t,0,8)),Xt(new r(n),e,t)};Me.toString=Me.valueOf=Me.val=Me.toJSON=Me[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Fn(e),n=e.constructor;return gc(e,t<=n.toExpNeg||t>=n.toExpPos)};function WU(e,t){var n,r,i,a,l,c,d,f,p=e.constructor,m=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),hn?Xt(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,c=f.length):(r=f,i=l,c=d.length),l=Math.ceil(m/on),c=l>c?l+1:c+1,a>c&&(a=c,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(c=d.length,a=f.length,c-a<0&&(a=c,r=f,f=d,d=r),n=0;a;)n=(d[--a]=d[a]+f[a]+n)/tr|0,d[a]%=tr;for(n&&(d.unshift(n),++i),c=d.length;d[--c]==0;)d.pop();return t.d=d,t.e=i,hn?Xt(t,m):t}function Qa(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ec+e)}function Ua(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=on-r.length,n&&(a+=zo(n)),a+=r;l=e[t],r=l+"",n=on-r.length,n&&(a+=zo(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var _s=(function(){function e(r,i){var a,l=0,c=r.length;for(r=r.slice();c--;)a=r[c]*i+l,r[c]=a%tr|0,l=a/tr|0;return l&&r.unshift(l),r}function t(r,i,a,l){var c,d;if(a!=l)d=a>l?1:-1;else for(c=d=0;c<a;c++)if(r[c]!=i[c]){d=r[c]>i[c]?1:-1;break}return d}function n(r,i,a){for(var l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*tr+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var c,d,f,p,m,y,v,w,b,j,k,E,A,C,_,O,z,R,$=r.constructor,F=r.s==i.s?1:-1,M=r.d,U=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(Xi+"Division by zero");for(d=r.e-i.e,z=U.length,_=M.length,v=new $(F),w=v.d=[],f=0;U[f]==(M[f]||0);)++f;if(U[f]>(M[f]||0)&&--d,a==null?E=a=$.precision:l?E=a+(Fn(r)-Fn(i))+1:E=a,E<0)return new $(0);if(E=E/on+2|0,f=0,z==1)for(p=0,U=U[0],E++;(f<_||p)&&E--;f++)A=p*tr+(M[f]||0),w[f]=A/U|0,p=A%U|0;else{for(p=tr/(U[0]+1)|0,p>1&&(U=e(U,p),M=e(M,p),z=U.length,_=M.length),C=z,b=M.slice(0,z),j=b.length;j<z;)b[j++]=0;R=U.slice(),R.unshift(0),O=U[0],U[1]>=tr/2&&++O;do p=0,c=t(U,b,z,j),c<0?(k=b[0],z!=j&&(k=k*tr+(b[1]||0)),p=k/O|0,p>1?(p>=tr&&(p=tr-1),m=e(U,p),y=m.length,j=b.length,c=t(m,b,y,j),c==1&&(p--,n(m,z<y?R:U,y))):(p==0&&(c=p=1),m=U.slice()),y=m.length,y<j&&m.unshift(0),n(b,m,j),c==-1&&(j=b.length,c=t(U,b,z,j),c<1&&(p++,n(b,z<j?R:U,j))),j=b.length):c===0&&(p++,b=[0]),w[f++]=p,c&&b[0]?b[j++]=M[C]||0:(b=[M[C]],j=1);while((C++<_||b[0]!==void 0)&&E--)}return w[0]||w.shift(),v.e=d,Xt(v,l?a+Fn(v)+1:a)}})();function ZU(e,t){var n,r,i,a,l,c,d=0,f=0,p=e.constructor,m=p.precision;if(Fn(e)>16)throw Error(ZC+Fn(e));if(!e.s)return new p(ji);for(hn=!1,c=m,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),f+=5;for(r=Math.log(Ll(2,f))/Math.LN10*2+5|0,c+=r,n=i=a=new p(ji),p.precision=c;;){if(i=Xt(i.times(e),c),n=n.times(++d),l=a.plus(_s(i,n,c)),Ua(l.d).slice(0,c)===Ua(a.d).slice(0,c)){for(;f--;)a=Xt(a.times(a),c);return p.precision=m,t==null?(hn=!0,Xt(a,m)):a}a=l}}function Fn(e){for(var t=e.e*on,n=e.d[0];n>=10;n/=10)t++;return t}function bj(e,t,n){if(t>e.LN10.sd())throw hn=!0,n&&(e.precision=n),Error(Xi+"LN10 precision limit exceeded");return Xt(new e(e.LN10),t)}function zo(e){for(var t="";e--;)t+="0";return t}function Fh(e,t){var n,r,i,a,l,c,d,f,p,m=1,y=10,v=e,w=v.d,b=v.constructor,j=b.precision;if(v.s<1)throw Error(Xi+(v.s?"NaN":"-Infinity"));if(v.eq(ji))return new b(0);if(t==null?(hn=!1,f=j):f=t,v.eq(10))return t==null&&(hn=!0),bj(b,f);if(f+=y,b.precision=f,n=Ua(w),r=n.charAt(0),a=Fn(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Ua(v.d),r=n.charAt(0),m++;a=Fn(v),r>1?(v=new b("0."+n),a++):v=new b(r+"."+n.slice(1))}else return d=bj(b,f+2,j).times(a+""),v=Fh(new b(r+"."+n.slice(1)),f-y).plus(d),b.precision=j,t==null?(hn=!0,Xt(v,j)):v;for(c=l=v=_s(v.minus(ji),v.plus(ji),f),p=Xt(v.times(v),f),i=3;;){if(l=Xt(l.times(p),f),d=c.plus(_s(l,new b(i),f)),Ua(d.d).slice(0,f)===Ua(c.d).slice(0,f))return c=c.times(2),a!==0&&(c=c.plus(bj(b,f+2,j).times(a+""))),c=_s(c,new b(m),f),b.precision=j,t==null?(hn=!0,Xt(c,j)):c;c=d,i+=2}}function DM(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=Pd(n/on),e.d=[],r=(n+1)%on,n<0&&(r+=on),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=on;r<i;)e.d.push(+t.slice(r,r+=on));t=t.slice(r),r=on-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),hn&&(e.e>Yy||e.e<-Yy))throw Error(ZC+n)}else e.s=0,e.e=0,e.d=[0];return e}function Xt(e,t,n){var r,i,a,l,c,d,f,p,m=e.d;for(l=1,a=m[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=on,i=t,f=m[p=0];else{if(p=Math.ceil((r+1)/on),a=m.length,p>=a)return e;for(f=a=m[p],l=1;a>=10;a/=10)l++;r%=on,i=r-on+l}if(n!==void 0&&(a=Ll(10,l-i-1),c=f/a%10|0,d=t<0||m[p+1]!==void 0||f%a,d=n<4?(c||d)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||d||n==6&&(r>0?i>0?f/Ll(10,l-i):0:m[p-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=Fn(e),m.length=1,t=t-a-1,m[0]=Ll(10,(on-t%on)%on),e.e=Pd(-t/on)||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=Ll(10,on-r),m[p]=i>0?(f/Ll(10,l-i)%Ll(10,i)|0)*a:0),d)for(;;)if(p==0){(m[0]+=a)==tr&&(m[0]=1,++e.e);break}else{if(m[p]+=a,m[p]!=tr)break;m[p--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(hn&&(e.e>Yy||e.e<-Yy))throw Error(ZC+Fn(e));return e}function XU(e,t){var n,r,i,a,l,c,d,f,p,m,y=e.constructor,v=y.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new y(e),hn?Xt(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,c=m.length):(n=m,r=f,c=d.length),i=Math.max(Math.ceil(v/on),c)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;i--;)n.push(0);n.reverse()}else{for(i=d.length,c=m.length,p=i<c,p&&(c=i),i=0;i<c;i++)if(d[i]!=m[i]){p=d[i]<m[i];break}l=0}for(p&&(n=d,d=m,m=n,t.s=-t.s),c=d.length,i=m.length-c;i>0;--i)d[c++]=0;for(i=m.length;i>l;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=tr-1;--d[a],d[i]+=tr}d[i]-=m[i]}for(;d[--c]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,hn?Xt(t,v):t):new y(0)}function gc(e,t,n){var r,i=Fn(e),a=Ua(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+zo(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+zo(-i-1)+a,n&&(r=n-l)>0&&(a+=zo(r))):i>=l?(a+=zo(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+zo(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=zo(r))),e.s<0?"-"+a:a}function MM(e,t){if(e.length>t)return e.length=t,!0}function JU(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(ec+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 DM(l,a.toString())}else if(typeof a!="string")throw Error(ec+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,k0e.test(a))DM(l,a);else throw Error(ec+a)}if(i.prototype=Me,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=JU,i.config=i.set=C0e,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 C0e(e){if(!e||typeof e!="object")throw Error(Xi+"Object expected");var t,n,r,i=["precision",1,Td,"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(Pd(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ec+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ec+n+": "+r);return this}var XC=JU(N0e);ji=new XC(1);const Pt=XC;function eq(e){var t;return e===0?t=1:t=Math.floor(new Pt(e).abs().log(10).toNumber())+1,t}function tq(e,t,n){for(var r=new Pt(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var nq=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},JC=(e,t,n)=>{if(e.lte(0))return new Pt(0);var r=eq(e.toNumber()),i=new Pt(10).pow(r),a=e.div(i),l=r!==1?.05:.1,c=new Pt(Math.ceil(a.div(l).toNumber())).add(n).mul(l),d=c.mul(i);return t?new Pt(d.toNumber()):new Pt(Math.ceil(d.toNumber()))},rq=(e,t,n)=>{var r;if(e.lte(0))return new Pt(0);var i=[1,2,2.5,5],a=e.toNumber(),l=Math.floor(new Pt(a).abs().log(10).toNumber()),c=new Pt(10).pow(l),d=e.div(c).toNumber(),f=i.findIndex(v=>v>=d-1e-10);if(f===-1&&(c=c.mul(10),f=0),f+=n,f>=i.length){var p=Math.floor(f/i.length);f%=i.length,c=c.mul(new Pt(10).pow(p))}var m=(r=i[f])!==null&&r!==void 0?r:1,y=new Pt(m).mul(c);return t?y:new Pt(Math.ceil(y.toNumber()))},A0e=(e,t,n)=>{var r=new Pt(1),i=new Pt(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Pt(10).pow(eq(e)-1),i=new Pt(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Pt(Math.floor(e)))}else e===0?i=new Pt(Math.floor((t-1)/2)):n||(i=new Pt(Math.floor(e)));for(var l=Math.floor((t-1)/2),c=[],d=0;d<t;d++)c.push(i.add(new Pt(d-l).mul(r)).toNumber());return c},iq=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]:JC;if(!Number.isFinite((n-t)/(r-1)))return{step:new Pt(0),tickMin:new Pt(0),tickMax:new Pt(0)};var c=l(new Pt(n).sub(t).div(r-1),i,a),d;t<=0&&n>=0?d=new Pt(0):(d=new Pt(t).add(n).div(2),d=d.sub(new Pt(d).mod(c)));var f=Math.ceil(d.sub(t).div(c).toNumber()),p=Math.ceil(new Pt(n).sub(d).div(c).toNumber()),m=f+p+1;return m>r?iq(t,n,r,i,a+1,l):(m<r&&(p=n>0?p+(r-m):p,f=n>0?f:f+(r-m)),{step:c,tickMin:d.sub(new Pt(f).mul(c)),tickMax:d.add(new Pt(p).mul(c))})},IM=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",c=Math.max(i,2),[d,f]=nq([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 A0e(d,i,a);var m=l==="snap125"?rq:JC,{step:y,tickMin:v,tickMax:w}=iq(d,f,c,a,0,m),b=tq(v,w.add(new Pt(.1).mul(y)),y);return n>r?b.reverse():b},LM=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",[c,d]=nq([r,i]);if(c===-1/0||d===1/0)return[r,i];if(c===d)return[c];var f=l==="snap125"?rq:JC,p=Math.max(n,2),m=f(new Pt(d).sub(c).div(p-1),a,0),y=[...tq(new Pt(c),new Pt(d),m),d];return a===!1&&(y=y.map(v=>Math.round(v))),r>i?y.reverse():y},aq=e=>e.rootProps.maxBarSize,E0e=e=>e.rootProps.barGap,sq=e=>e.rootProps.barCategoryGap,O0e=e=>e.rootProps.barSize,L0=e=>e.rootProps.stackOffset,oq=e=>e.rootProps.reverseStackOrder,eA=e=>e.options.chartName,tA=e=>e.rootProps.syncId,lq=e=>e.rootProps.syncMethod,nA=e=>e.options.eventEmitter,z0e=e=>e.rootProps.baseValue,nr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},zl={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Pa={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},$0=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function B0(e,t,n){if(n!=="auto")return n;if(e!=null)return Za(e,t)?"category":"number"}function $M(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 Wy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$M(Object(n),!0).forEach(function(r){_0e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$M(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _0e(e,t,n){return(t=T0e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T0e(e){var t=P0e(e,"string");return typeof t=="symbol"?t:t+""}function P0e(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 BM={allowDataOverflow:zl.allowDataOverflow,allowDecimals:zl.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:zl.angleAxisId,includeHidden:!1,name:void 0,reversed:zl.reversed,scale:zl.scale,tick:zl.tick,tickCount:void 0,ticks:void 0,type:zl.type,unit:void 0,niceTicks:"auto"},UM={allowDataOverflow:Pa.allowDataOverflow,allowDecimals:Pa.allowDecimals,allowDuplicatedCategory:Pa.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Pa.radiusAxisId,includeHidden:Pa.includeHidden,name:void 0,reversed:Pa.reversed,scale:Pa.scale,tick:Pa.tick,tickCount:Pa.tickCount,ticks:void 0,type:Pa.type,unit:void 0,niceTicks:"auto"},R0e=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},rA=le([R0e,AU],(e,t)=>{var n;if(e!=null)return e;var r=(n=B0(t,"angleAxis",BM.type))!==null&&n!==void 0?n:"category";return Wy(Wy({},BM),{},{type:r})}),D0e=(e,t)=>e.polarAxis.radiusAxis[t],iA=le([D0e,AU],(e,t)=>{var n;if(e!=null)return e;var r=(n=B0(t,"radiusAxis",UM.type))!==null&&n!==void 0?n:"category";return Wy(Wy({},UM),{},{type:r})}),U0=e=>e.polarOptions,aA=le([Bs,Us,ar],s0e),cq=le([U0,aA],(e,t)=>{if(e!=null)return ba(e.innerRadius,t,0)}),uq=le([U0,aA],(e,t)=>{if(e!=null)return ba(e.outerRadius,t,t*.8)}),M0e=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},dq=le([U0],M0e);le([rA,dq],$0);var fq=le([aA,cq,uq],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});le([iA,fq],$0);var hq=le([qt,U0,cq,uq,Bs,Us],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:c,startAngle:d,endAngle:f}=t;return{cx:ba(l,i,i/2),cy:ba(c,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:f,clockWise:!1}}}),sr=(e,t)=>t,q0=(e,t,n)=>n;function F0(e){return e?.id}function pq(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=new Map;return e.forEach(c=>{var d,f=(d=c.data)!==null&&d!==void 0?d:r;if(!(f==null||f.length===0)){var p=F0(c);f.forEach((m,y)=>{var v=a==null||i?y:String(Tn(m,a,null)),w=Tn(m,c.dataKey,0),b;l.has(v)?b=l.get(v):b={},Object.assign(b,{[p]:w}),l.set(v,b)})}}),Array.from(l.values())}function H0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var K0=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function G0(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function I0e(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 or=e=>{var t=qt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Rd=e=>e.tooltip.settings.axisId;function sA(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],c=i[1];return l<=c?a>=l&&a<=c:a>=c&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var c=e(a);if(c!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":c+=d/2;break;case"end":c+=d;break}}return c}}}}}var L0e=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!qa(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];St(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 Ho(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $0e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function oA(e){let t,n,r;e.length!==2?(t=Ho,n=(c,d)=>Ho(e(c),d),r=(c,d)=>e(c)-d):(t=e===Ho||e===$0e?e:B0e,n=e,r=e);function i(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<0?f=m+1:p=m}while(f<p)}return f}function a(c,d,f=0,p=c.length){if(f<p){if(t(d,d)!==0)return p;do{const m=f+p>>>1;n(c[m],d)<=0?f=m+1:p=m}while(f<p)}return f}function l(c,d,f=0,p=c.length){const m=i(c,d,f,p-1);return m>f&&r(c[m-1],d)>-r(c[m],d)?m-1:m}return{left:i,center:l,right:a}}function B0e(){return 0}function mq(e){return e===null?NaN:+e}function*U0e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const q0e=oA(Ho),yp=q0e.right;oA(mq).center;class qM extends Map{constructor(t,n=K0e){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(FM(this,t))}has(t){return super.has(FM(this,t))}set(t,n){return super.set(F0e(this,t),n)}delete(t){return super.delete(H0e(this,t))}}function FM({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function F0e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function H0e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function K0e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function G0e(e=Ho){if(e===Ho)return gq;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 gq(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const V0e=Math.sqrt(50),Q0e=Math.sqrt(10),Y0e=Math.sqrt(2);function Zy(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>=V0e?10:a>=Q0e?5:a>=Y0e?2:1;let c,d,f;return i<0?(f=Math.pow(10,-i)/l,c=Math.round(e*f),d=Math.round(t*f),c/f<e&&++c,d/f>t&&--d,f=-f):(f=Math.pow(10,i)*l,c=Math.round(e/f),d=Math.round(t/f),c*f<e&&++c,d*f>t&&--d),d<c&&.5<=n&&n<2?Zy(e,t,n*2):[c,d,f]}function bN(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?Zy(t,e,n):Zy(e,t,n);if(!(a>=i))return[];const c=a-i+1,d=new Array(c);if(r)if(l<0)for(let f=0;f<c;++f)d[f]=(a-f)/-l;else for(let f=0;f<c;++f)d[f]=(a-f)*l;else if(l<0)for(let f=0;f<c;++f)d[f]=(i+f)/-l;else for(let f=0;f<c;++f)d[f]=(i+f)*l;return d}function wN(e,t,n){return t=+t,e=+e,n=+n,Zy(e,t,n)[2]}function SN(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?wN(t,e,n):wN(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function HM(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function KM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function yq(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?gq:G0e(i);r>n;){if(r-n>600){const d=r-n+1,f=t-n+1,p=Math.log(d),m=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*m*(d-m)/d)*(f-d/2<0?-1:1),v=Math.max(n,Math.floor(t-f*m/d+y)),w=Math.min(r,Math.floor(t+(d-f)*m/d+y));yq(e,t,v,w,i)}const a=e[t];let l=n,c=r;for(Yf(e,n,t),i(e[r],a)>0&&Yf(e,n,r);l<c;){for(Yf(e,l,c),++l,--c;i(e[l],a)<0;)++l;for(;i(e[c],a)>0;)--c}i(e[n],a)===0?Yf(e,n,c):(++c,Yf(e,c,r)),c<=t&&(n=c+1),t<=c&&(r=c-1)}return e}function Yf(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function W0e(e,t,n){if(e=Float64Array.from(U0e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return KM(e);if(t>=1)return HM(e);var r,i=(r-1)*t,a=Math.floor(i),l=HM(yq(e,a).subarray(0,a+1)),c=KM(e.subarray(a+1));return l+(c-l)*(i-a)}}function Z0e(e,t,n=mq){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),c=+n(e[a+1],a+1,e);return l+(c-l)*(i-a)}}function X0e(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function na(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function qs(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 jN=Symbol("implicit");function lA(){var e=new qM,t=[],n=[],r=jN;function i(a){let l=e.get(a);if(l===void 0){if(r!==jN)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 qM;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 lA(t,n).unknown(r)},na.apply(i,arguments),i}function cA(){var e=lA().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,c=!1,d=0,f=0,p=.5;delete e.unknown;function m(){var y=t().length,v=i<r,w=v?i:r,b=v?r:i;a=(b-w)/Math.max(1,y-d+f*2),c&&(a=Math.floor(a)),w+=(b-w-a*(y-d))*p,l=a*(1-d),c&&(w=Math.round(w),l=Math.round(l));var j=X0e(y).map(function(k){return w+a*k});return n(v?j.reverse():j)}return e.domain=function(y){return arguments.length?(t(y),m()):t()},e.range=function(y){return arguments.length?([r,i]=y,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(y){return[r,i]=y,r=+r,i=+i,c=!0,m()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(y){return arguments.length?(c=!!y,m()):c},e.padding=function(y){return arguments.length?(d=Math.min(1,f=+y),m()):d},e.paddingInner=function(y){return arguments.length?(d=Math.min(1,y),m()):d},e.paddingOuter=function(y){return arguments.length?(f=+y,m()):f},e.align=function(y){return arguments.length?(p=Math.max(0,Math.min(1,y)),m()):p},e.copy=function(){return cA(t(),[r,i]).round(c).paddingInner(d).paddingOuter(f).align(p)},na.apply(m(),arguments)}function vq(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return vq(t())},e}function J0e(){return vq(cA.apply(null,arguments).paddingInner(1))}function uA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function vp(){}var Hh=.7,Xy=1/Hh,Xu="\\s*([+-]?\\d+)\\s*",Kh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",exe=/^#([0-9a-f]{3,8})$/,txe=new RegExp(`^rgb\\(${Xu},${Xu},${Xu}\\)$`),nxe=new RegExp(`^rgb\\(${Fa},${Fa},${Fa}\\)$`),rxe=new RegExp(`^rgba\\(${Xu},${Xu},${Xu},${Kh}\\)$`),ixe=new RegExp(`^rgba\\(${Fa},${Fa},${Fa},${Kh}\\)$`),axe=new RegExp(`^hsl\\(${Kh},${Fa},${Fa}\\)$`),sxe=new RegExp(`^hsla\\(${Kh},${Fa},${Fa},${Kh}\\)$`),GM={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};uA(vp,Gh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:VM,formatHex:VM,formatHex8:oxe,formatHsl:lxe,formatRgb:QM,toString:QM});function VM(){return this.rgb().formatHex()}function oxe(){return this.rgb().formatHex8()}function lxe(){return bq(this).formatHsl()}function QM(){return this.rgb().formatRgb()}function Gh(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=exe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?YM(t):n===3?new oi(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?vg(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?vg(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=txe.exec(e))?new oi(t[1],t[2],t[3],1):(t=nxe.exec(e))?new oi(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rxe.exec(e))?vg(t[1],t[2],t[3],t[4]):(t=ixe.exec(e))?vg(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=axe.exec(e))?XM(t[1],t[2]/100,t[3]/100,1):(t=sxe.exec(e))?XM(t[1],t[2]/100,t[3]/100,t[4]):GM.hasOwnProperty(e)?YM(GM[e]):e==="transparent"?new oi(NaN,NaN,NaN,0):null}function YM(e){return new oi(e>>16&255,e>>8&255,e&255,1)}function vg(e,t,n,r){return r<=0&&(e=t=n=NaN),new oi(e,t,n,r)}function cxe(e){return e instanceof vp||(e=Gh(e)),e?(e=e.rgb(),new oi(e.r,e.g,e.b,e.opacity)):new oi}function NN(e,t,n,r){return arguments.length===1?cxe(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}uA(oi,NN,xq(vp,{brighter(e){return e=e==null?Xy:Math.pow(Xy,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hh:Math.pow(Hh,e),new oi(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new oi(tc(this.r),tc(this.g),tc(this.b),Jy(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:WM,formatHex:WM,formatHex8:uxe,formatRgb:ZM,toString:ZM}));function WM(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}`}function uxe(){return`#${Gl(this.r)}${Gl(this.g)}${Gl(this.b)}${Gl((isNaN(this.opacity)?1:this.opacity)*255)}`}function ZM(){const e=Jy(this.opacity);return`${e===1?"rgb(":"rgba("}${tc(this.r)}, ${tc(this.g)}, ${tc(this.b)}${e===1?")":`, ${e})`}`}function Jy(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gl(e){return e=tc(e),(e<16?"0":"")+e.toString(16)}function XM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new va(e,t,n,r)}function bq(e){if(e instanceof va)return new va(e.h,e.s,e.l,e.opacity);if(e instanceof vp||(e=Gh(e)),!e)return new va;if(e instanceof va)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,c=a-i,d=(a+i)/2;return c?(t===a?l=(n-r)/c+(n<r)*6:n===a?l=(r-t)/c+2:l=(t-n)/c+4,c/=d<.5?a+i:2-a-i,l*=60):c=d>0&&d<1?0:l,new va(l,c,d,e.opacity)}function dxe(e,t,n,r){return arguments.length===1?bq(e):new va(e,t,n,r??1)}function va(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}uA(va,dxe,xq(vp,{brighter(e){return e=e==null?Xy:Math.pow(Xy,e),new va(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hh:Math.pow(Hh,e),new va(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 oi(wj(e>=240?e-240:e+120,i,r),wj(e,i,r),wj(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new va(JM(this.h),xg(this.s),xg(this.l),Jy(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=Jy(this.opacity);return`${e===1?"hsl(":"hsla("}${JM(this.h)}, ${xg(this.s)*100}%, ${xg(this.l)*100}%${e===1?")":`, ${e})`}`}}));function JM(e){return e=(e||0)%360,e<0?e+360:e}function xg(e){return Math.max(0,Math.min(1,e||0))}function wj(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 dA=e=>()=>e;function fxe(e,t){return function(n){return e+n*t}}function hxe(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 pxe(e){return(e=+e)==1?wq:function(t,n){return n-t?hxe(t,n,e):dA(isNaN(t)?n:t)}}function wq(e,t){var n=t-e;return n?fxe(e,n):dA(isNaN(e)?t:e)}const eI=(function e(t){var n=pxe(t);function r(i,a){var l=n((i=NN(i)).r,(a=NN(a)).r),c=n(i.g,a.g),d=n(i.b,a.b),f=wq(i.opacity,a.opacity);return function(p){return i.r=l(p),i.g=c(p),i.b=d(p),i.opacity=f(p),i+""}}return r.gamma=e,r})(1);function mxe(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 gxe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yxe(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]=Dd(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(c){for(l=0;l<r;++l)a[l]=i[l](c);return a}}function vxe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ev(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xxe(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]=Dd(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var kN=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sj=new RegExp(kN.source,"g");function bxe(e){return function(){return e}}function wxe(e){return function(t){return e(t)+""}}function Sxe(e,t){var n=kN.lastIndex=Sj.lastIndex=0,r,i,a,l=-1,c=[],d=[];for(e=e+"",t=t+"";(r=kN.exec(e))&&(i=Sj.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),c[l]?c[l]+=a:c[++l]=a),(r=r[0])===(i=i[0])?c[l]?c[l]+=i:c[++l]=i:(c[++l]=null,d.push({i:l,x:ev(r,i)})),n=Sj.lastIndex;return n<t.length&&(a=t.slice(n),c[l]?c[l]+=a:c[++l]=a),c.length<2?d[0]?wxe(d[0].x):bxe(t):(t=d.length,function(f){for(var p=0,m;p<t;++p)c[(m=d[p]).i]=m.x(f);return c.join("")})}function Dd(e,t){var n=typeof t,r;return t==null||n==="boolean"?dA(t):(n==="number"?ev:n==="string"?(r=Gh(t))?(t=r,eI):Sxe:t instanceof Gh?eI:t instanceof Date?vxe:gxe(t)?mxe:Array.isArray(t)?yxe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?xxe:ev)(e,t)}function fA(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jxe(e,t){t===void 0&&(t=e,e=Dd);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 c=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[c](l-c)}}function Nxe(e){return function(){return e}}function tv(e){return+e}var tI=[0,1];function qr(e){return e}function CN(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Nxe(isNaN(t)?NaN:.5)}function kxe(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=CN(i,r),a=n(l,a)):(r=CN(r,i),a=n(a,l)),function(c){return a(r(c))}}function Axe(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]=CN(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(c){var d=yp(e,c,1,r)-1;return a[d](i[d](c))}}function xp(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function V0(){var e=tI,t=tI,n=Dd,r,i,a,l=qr,c,d,f;function p(){var y=Math.min(e.length,t.length);return l!==qr&&(l=kxe(e[0],e[y-1])),c=y>2?Axe:Cxe,d=f=null,m}function m(y){return y==null||isNaN(y=+y)?a:(d||(d=c(e.map(r),t,n)))(r(l(y)))}return m.invert=function(y){return l(i((f||(f=c(t,e.map(r),ev)))(y)))},m.domain=function(y){return arguments.length?(e=Array.from(y,tv),p()):e.slice()},m.range=function(y){return arguments.length?(t=Array.from(y),p()):t.slice()},m.rangeRound=function(y){return t=Array.from(y),n=fA,p()},m.clamp=function(y){return arguments.length?(l=y?!0:qr,p()):l!==qr},m.interpolate=function(y){return arguments.length?(n=y,p()):n},m.unknown=function(y){return arguments.length?(a=y,m):a},function(y,v){return r=y,i=v,p()}}function hA(){return V0()(qr,qr)}function Exe(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function nv(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 pd(e){return e=nv(Math.abs(e)),e?e[1]:NaN}function Oxe(e,t){return function(n,r){for(var i=n.length,a=[],l=0,c=e[0],d=0;i>0&&c>0&&(d+c+1>r&&(c=Math.max(1,r-d)),a.push(n.substring(i-=c,i+c)),!((d+=c+1)>r));)c=e[l=(l+1)%e.length];return a.reverse().join(t)}}function zxe(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var _xe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vh(e){if(!(t=_xe.exec(e)))throw new Error("invalid format: "+e);var t;return new pA({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]})}Vh.prototype=pA.prototype;function pA(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+""}pA.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 Txe(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 rv;function Pxe(e,t){var n=nv(e,t);if(!n)return rv=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(rv=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")+nv(e,Math.max(0,t+a-1))[0]}function nI(e,t){var n=nv(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 rI={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Exe,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)=>nI(e*100,t),r:nI,s:Pxe,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function iI(e){return e}var aI=Array.prototype.map,sI=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Rxe(e){var t=e.grouping===void 0||e.thousands===void 0?iI:Oxe(aI.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?iI:zxe(aI.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function f(m,y){m=Vh(m);var v=m.fill,w=m.align,b=m.sign,j=m.symbol,k=m.zero,E=m.width,A=m.comma,C=m.precision,_=m.trim,O=m.type;O==="n"?(A=!0,O="g"):rI[O]||(C===void 0&&(C=12),_=!0,O="g"),(k||v==="0"&&w==="=")&&(k=!0,v="0",w="=");var z=(y&&y.prefix!==void 0?y.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),R=(j==="$"?r:/[%p]/.test(O)?l:"")+(y&&y.suffix!==void 0?y.suffix:""),$=rI[O],F=/[defgprs%]/.test(O);C=C===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function M(U){var K=z,Z=R,Y,H,X;if(O==="c")Z=$(U)+Z,U="";else{U=+U;var ue=U<0||1/U<0;if(U=isNaN(U)?d:$(Math.abs(U),C),_&&(U=Txe(U)),ue&&+U==0&&b!=="+"&&(ue=!1),K=(ue?b==="("?b:c:b==="-"||b==="("?"":b)+K,Z=(O==="s"&&!isNaN(U)&&rv!==void 0?sI[8+rv/3]:"")+Z+(ue&&b==="("?")":""),F){for(Y=-1,H=U.length;++Y<H;)if(X=U.charCodeAt(Y),48>X||X>57){Z=(X===46?i+U.slice(Y+1):U.slice(Y))+Z,U=U.slice(0,Y);break}}}A&&!k&&(U=t(U,1/0));var xe=K.length+U.length+Z.length,L=xe<E?new Array(E-xe+1).join(v):"";switch(A&&k&&(U=t(L+U,L.length?E-Z.length:1/0),L=""),w){case"<":U=K+U+Z+L;break;case"=":U=K+L+U+Z;break;case"^":U=L.slice(0,xe=L.length>>1)+K+U+Z+L.slice(xe);break;default:U=L+K+U+Z;break}return a(U)}return M.toString=function(){return m+""},M}function p(m,y){var v=Math.max(-8,Math.min(8,Math.floor(pd(y)/3)))*3,w=Math.pow(10,-v),b=f((m=Vh(m),m.type="f",m),{suffix:sI[8+v/3]});return function(j){return b(w*j)}}return{format:f,formatPrefix:p}}var bg,mA,Sq;Dxe({thousands:",",grouping:[3],currency:["$",""]});function Dxe(e){return bg=Rxe(e),mA=bg.format,Sq=bg.formatPrefix,bg}function Mxe(e){return Math.max(0,-pd(Math.abs(e)))}function Ixe(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(pd(t)/3)))*3-pd(Math.abs(e)))}function Lxe(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,pd(t)-pd(e))+1}function jq(e,t,n,r){var i=SN(e,t,n),a;switch(r=Vh(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Ixe(i,l))&&(r.precision=a),Sq(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=Lxe(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Mxe(i))&&(r.precision=a-(r.type==="%")*2);break}}return mA(r)}function al(e){var t=e.domain;return e.ticks=function(n){var r=t();return bN(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return jq(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],c=r[a],d,f,p=10;for(c<l&&(f=l,l=c,c=f,f=i,i=a,a=f);p-- >0;){if(f=wN(l,c,n),f===d)return r[i]=l,r[a]=c,t(r);if(f>0)l=Math.floor(l/f)*f,c=Math.ceil(c/f)*f;else if(f<0)l=Math.ceil(l*f)/f,c=Math.floor(c*f)/f;else break;d=f}return e},e}function Nq(){var e=hA();return e.copy=function(){return xp(e,Nq())},na.apply(e,arguments),al(e)}function kq(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,tv),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return kq(e).unknown(t)},e=arguments.length?Array.from(e,tv):[0,1],al(n)}function Cq(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 oI(e){return Math.log(e)}function lI(e){return Math.exp(e)}function $xe(e){return-Math.log(-e)}function Bxe(e){return-Math.exp(-e)}function Uxe(e){return isFinite(e)?+("1e"+e):e<0?0:e}function qxe(e){return e===10?Uxe:e===Math.E?Math.exp:t=>Math.pow(e,t)}function Fxe(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 cI(e){return(t,n)=>-e(-t,n)}function gA(e){const t=e(oI,lI),n=t.domain;let r=10,i,a;function l(){return i=Fxe(r),a=qxe(r),n()[0]<0?(i=cI(i),a=cI(a),e($xe,Bxe)):e(oI,lI),t}return t.base=function(c){return arguments.length?(r=+c,l()):r},t.domain=function(c){return arguments.length?(n(c),l()):n()},t.ticks=c=>{const d=n();let f=d[0],p=d[d.length-1];const m=p<f;m&&([f,p]=[p,f]);let y=i(f),v=i(p),w,b;const j=c==null?10:+c;let k=[];if(!(r%1)&&v-y<j){if(y=Math.floor(y),v=Math.ceil(v),f>0){for(;y<=v;++y)for(w=1;w<r;++w)if(b=y<0?w/a(-y):w*a(y),!(b<f)){if(b>p)break;k.push(b)}}else for(;y<=v;++y)for(w=r-1;w>=1;--w)if(b=y>0?w/a(-y):w*a(y),!(b<f)){if(b>p)break;k.push(b)}k.length*2<j&&(k=bN(f,p,j))}else k=bN(y,v,Math.min(v-y,j)).map(a);return m?k.reverse():k},t.tickFormat=(c,d)=>{if(c==null&&(c=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Vh(d)).precision==null&&(d.trim=!0),d=mA(d)),c===1/0)return d;const f=Math.max(1,r*c/t.ticks().length);return p=>{let m=p/a(Math.round(i(p)));return m*r<r-.5&&(m*=r),m<=f?d(p):""}},t.nice=()=>n(Cq(n(),{floor:c=>a(Math.floor(i(c))),ceil:c=>a(Math.ceil(i(c)))})),t}function Aq(){const e=gA(V0()).domain([1,10]);return e.copy=()=>xp(e,Aq()).base(e.base()),na.apply(e,arguments),e}function uI(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function dI(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function yA(e){var t=1,n=e(uI(t),dI(t));return n.constant=function(r){return arguments.length?e(uI(t=+r),dI(t)):t},al(n)}function Eq(){var e=yA(V0());return e.copy=function(){return xp(e,Eq()).constant(e.constant())},na.apply(e,arguments)}function fI(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Hxe(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Kxe(e){return e<0?-e*e:e*e}function vA(e){var t=e(qr,qr),n=1;function r(){return n===1?e(qr,qr):n===.5?e(Hxe,Kxe):e(fI(n),fI(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},al(t)}function xA(){var e=vA(V0());return e.copy=function(){return xp(e,xA()).exponent(e.exponent())},na.apply(e,arguments),e}function Gxe(){return xA.apply(null,arguments).exponent(.5)}function hI(e){return Math.sign(e)*e*e}function Vxe(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Oq(){var e=hA(),t=[0,1],n=!1,r;function i(a){var l=Vxe(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(hI(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,tv)).map(hI)),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 Oq(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},na.apply(i,arguments),al(i)}function zq(){var e=[],t=[],n=[],r;function i(){var l=0,c=Math.max(1,t.length);for(n=new Array(c-1);++l<c;)n[l-1]=Z0e(e,l/c);return a}function a(l){return l==null||isNaN(l=+l)?r:t[yp(n,l)]}return a.invertExtent=function(l){var c=t.indexOf(l);return c<0?[NaN,NaN]:[c>0?n[c-1]:e[0],c<n.length?n[c]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let c of l)c!=null&&!isNaN(c=+c)&&e.push(c);return e.sort(Ho),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 zq().domain(e).range(t).unknown(r)},na.apply(a,arguments)}function _q(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(d){return d!=null&&d<=d?i[yp(r,d,0,n)]:a}function c(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,c()):[e,t]},l.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,c()):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 _q().domain([e,t]).range(i).unknown(a)},na.apply(al(l),arguments)}function Tq(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[yp(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 Tq().domain(e).range(t).unknown(n)},na.apply(i,arguments)}const jj=new Date,Nj=new Date;function Xn(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),c=i.ceil(a);return a-l<c-a?l:c},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,c)=>{const d=[];if(a=i.ceil(a),c=c==null?1:Math.floor(c),!(a<l)||!(c>0))return d;let f;do d.push(f=new Date(+a)),t(a,c),e(a);while(f<a&&a<l);return d},i.filter=a=>Xn(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!a(l););else for(;--c>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(jj.setTime(+a),Nj.setTime(+l),e(jj),e(Nj),Math.floor(n(jj,Nj))),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 iv=Xn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);iv.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Xn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):iv);iv.range;const Es=1e3,Vi=Es*60,Os=Vi*60,Ds=Os*24,bA=Ds*7,pI=Ds*30,kj=Ds*365,Vl=Xn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Es)},(e,t)=>(t-e)/Es,e=>e.getUTCSeconds());Vl.range;const wA=Xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Es)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getMinutes());wA.range;const SA=Xn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Vi)},(e,t)=>(t-e)/Vi,e=>e.getUTCMinutes());SA.range;const jA=Xn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Es-e.getMinutes()*Vi)},(e,t)=>{e.setTime(+e+t*Os)},(e,t)=>(t-e)/Os,e=>e.getHours());jA.range;const NA=Xn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Os)},(e,t)=>(t-e)/Os,e=>e.getUTCHours());NA.range;const bp=Xn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Vi)/Ds,e=>e.getDate()-1);bp.range;const Q0=Xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ds,e=>e.getUTCDate()-1);Q0.range;const Pq=Xn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ds,e=>Math.floor(e/Ds));Pq.range;function _c(e){return Xn(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())*Vi)/bA)}const Y0=_c(0),av=_c(1),Qxe=_c(2),Yxe=_c(3),md=_c(4),Wxe=_c(5),Zxe=_c(6);Y0.range;av.range;Qxe.range;Yxe.range;md.range;Wxe.range;Zxe.range;function Tc(e){return Xn(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)/bA)}const W0=Tc(0),sv=Tc(1),Xxe=Tc(2),Jxe=Tc(3),gd=Tc(4),ebe=Tc(5),tbe=Tc(6);W0.range;sv.range;Xxe.range;Jxe.range;gd.range;ebe.range;tbe.range;const kA=Xn(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());kA.range;const CA=Xn(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());CA.range;const Ms=Xn(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());Ms.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xn(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)});Ms.range;const Is=Xn(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());Is.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Xn(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)});Is.range;function Rq(e,t,n,r,i,a){const l=[[Vl,1,Es],[Vl,5,5*Es],[Vl,15,15*Es],[Vl,30,30*Es],[a,1,Vi],[a,5,5*Vi],[a,15,15*Vi],[a,30,30*Vi],[i,1,Os],[i,3,3*Os],[i,6,6*Os],[i,12,12*Os],[r,1,Ds],[r,2,2*Ds],[n,1,bA],[t,1,pI],[t,3,3*pI],[e,1,kj]];function c(f,p,m){const y=p<f;y&&([f,p]=[p,f]);const v=m&&typeof m.range=="function"?m:d(f,p,m),w=v?v.range(f,+p+1):[];return y?w.reverse():w}function d(f,p,m){const y=Math.abs(p-f)/m,v=oA(([,,j])=>j).right(l,y);if(v===l.length)return e.every(SN(f/kj,p/kj,m));if(v===0)return iv.every(Math.max(SN(f,p,m),1));const[w,b]=l[y/l[v-1][2]<l[v][2]/y?v-1:v];return w.every(b)}return[c,d]}const[nbe,rbe]=Rq(Is,CA,W0,Pq,NA,SA),[ibe,abe]=Rq(Ms,kA,Y0,bp,jA,wA);function Cj(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 Aj(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 Wf(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function sbe(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,c=e.months,d=e.shortMonths,f=Zf(i),p=Xf(i),m=Zf(a),y=Xf(a),v=Zf(l),w=Xf(l),b=Zf(c),j=Xf(c),k=Zf(d),E=Xf(d),A={a:X,A:ue,b:xe,B:L,c:null,d:bI,e:bI,f:Obe,g:$be,G:Ube,H:Cbe,I:Abe,j:Ebe,L:Dq,m:zbe,M:_be,p:q,q:I,Q:jI,s:NI,S:Tbe,u:Pbe,U:Rbe,V:Dbe,w:Mbe,W:Ibe,x:null,X:null,y:Lbe,Y:Bbe,Z:qbe,"%":SI},C={a:D,A:V,b:re,B:ee,c:null,d:wI,e:wI,f:Gbe,g:nwe,G:iwe,H:Fbe,I:Hbe,j:Kbe,L:Iq,m:Vbe,M:Qbe,p:Ee,q:Te,Q:jI,s:NI,S:Ybe,u:Wbe,U:Zbe,V:Xbe,w:Jbe,W:ewe,x:null,X:null,y:twe,Y:rwe,Z:awe,"%":SI},_={a:F,A:M,b:U,B:K,c:Z,d:vI,e:vI,f:Sbe,g:yI,G:gI,H:xI,I:xI,j:vbe,L:wbe,m:ybe,M:xbe,p:$,q:gbe,Q:Nbe,s:kbe,S:bbe,u:dbe,U:fbe,V:hbe,w:ube,W:pbe,x:Y,X:H,y:yI,Y:gI,Z:mbe,"%":jbe};A.x=O(n,A),A.X=O(r,A),A.c=O(t,A),C.x=O(n,C),C.X=O(r,C),C.c=O(t,C);function O(ne,he){return function(je){var me=[],tt=-1,Ie=0,Ze=ne.length,nt,Wt,Se;for(je instanceof Date||(je=new Date(+je));++tt<Ze;)ne.charCodeAt(tt)===37&&(me.push(ne.slice(Ie,tt)),(Wt=mI[nt=ne.charAt(++tt)])!=null?nt=ne.charAt(++tt):Wt=nt==="e"?" ":"0",(Se=he[nt])&&(nt=Se(je,Wt)),me.push(nt),Ie=tt+1);return me.push(ne.slice(Ie,tt)),me.join("")}}function z(ne,he){return function(je){var me=Wf(1900,void 0,1),tt=R(me,ne,je+="",0),Ie,Ze;if(tt!=je.length)return null;if("Q"in me)return new Date(me.Q);if("s"in me)return new Date(me.s*1e3+("L"in me?me.L:0));if(he&&!("Z"in me)&&(me.Z=0),"p"in me&&(me.H=me.H%12+me.p*12),me.m===void 0&&(me.m="q"in me?me.q:0),"V"in me){if(me.V<1||me.V>53)return null;"w"in me||(me.w=1),"Z"in me?(Ie=Aj(Wf(me.y,0,1)),Ze=Ie.getUTCDay(),Ie=Ze>4||Ze===0?sv.ceil(Ie):sv(Ie),Ie=Q0.offset(Ie,(me.V-1)*7),me.y=Ie.getUTCFullYear(),me.m=Ie.getUTCMonth(),me.d=Ie.getUTCDate()+(me.w+6)%7):(Ie=Cj(Wf(me.y,0,1)),Ze=Ie.getDay(),Ie=Ze>4||Ze===0?av.ceil(Ie):av(Ie),Ie=bp.offset(Ie,(me.V-1)*7),me.y=Ie.getFullYear(),me.m=Ie.getMonth(),me.d=Ie.getDate()+(me.w+6)%7)}else("W"in me||"U"in me)&&("w"in me||(me.w="u"in me?me.u%7:"W"in me?1:0),Ze="Z"in me?Aj(Wf(me.y,0,1)).getUTCDay():Cj(Wf(me.y,0,1)).getDay(),me.m=0,me.d="W"in me?(me.w+6)%7+me.W*7-(Ze+5)%7:me.w+me.U*7-(Ze+6)%7);return"Z"in me?(me.H+=me.Z/100|0,me.M+=me.Z%100,Aj(me)):Cj(me)}}function R(ne,he,je,me){for(var tt=0,Ie=he.length,Ze=je.length,nt,Wt;tt<Ie;){if(me>=Ze)return-1;if(nt=he.charCodeAt(tt++),nt===37){if(nt=he.charAt(tt++),Wt=_[nt in mI?he.charAt(tt++):nt],!Wt||(me=Wt(ne,je,me))<0)return-1}else if(nt!=je.charCodeAt(me++))return-1}return me}function $(ne,he,je){var me=f.exec(he.slice(je));return me?(ne.p=p.get(me[0].toLowerCase()),je+me[0].length):-1}function F(ne,he,je){var me=v.exec(he.slice(je));return me?(ne.w=w.get(me[0].toLowerCase()),je+me[0].length):-1}function M(ne,he,je){var me=m.exec(he.slice(je));return me?(ne.w=y.get(me[0].toLowerCase()),je+me[0].length):-1}function U(ne,he,je){var me=k.exec(he.slice(je));return me?(ne.m=E.get(me[0].toLowerCase()),je+me[0].length):-1}function K(ne,he,je){var me=b.exec(he.slice(je));return me?(ne.m=j.get(me[0].toLowerCase()),je+me[0].length):-1}function Z(ne,he,je){return R(ne,t,he,je)}function Y(ne,he,je){return R(ne,n,he,je)}function H(ne,he,je){return R(ne,r,he,je)}function X(ne){return l[ne.getDay()]}function ue(ne){return a[ne.getDay()]}function xe(ne){return d[ne.getMonth()]}function L(ne){return c[ne.getMonth()]}function q(ne){return i[+(ne.getHours()>=12)]}function I(ne){return 1+~~(ne.getMonth()/3)}function D(ne){return l[ne.getUTCDay()]}function V(ne){return a[ne.getUTCDay()]}function re(ne){return d[ne.getUTCMonth()]}function ee(ne){return c[ne.getUTCMonth()]}function Ee(ne){return i[+(ne.getUTCHours()>=12)]}function Te(ne){return 1+~~(ne.getUTCMonth()/3)}return{format:function(ne){var he=O(ne+="",A);return he.toString=function(){return ne},he},parse:function(ne){var he=z(ne+="",!1);return he.toString=function(){return ne},he},utcFormat:function(ne){var he=O(ne+="",C);return he.toString=function(){return ne},he},utcParse:function(ne){var he=z(ne+="",!0);return he.toString=function(){return ne},he}}}var mI={"-":"",_:" ",0:"0"},lr=/^\s*\d+/,obe=/^%/,lbe=/[\\^$*+?|[\]().{}]/g;function Mt(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 cbe(e){return e.replace(lbe,"\\$&")}function Zf(e){return new RegExp("^(?:"+e.map(cbe).join("|")+")","i")}function Xf(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function ube(e,t,n){var r=lr.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function dbe(e,t,n){var r=lr.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function fbe(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function hbe(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function pbe(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function gI(e,t,n){var r=lr.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function yI(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function mbe(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 gbe(e,t,n){var r=lr.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function ybe(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function vI(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function vbe(e,t,n){var r=lr.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function xI(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function xbe(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function bbe(e,t,n){var r=lr.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function wbe(e,t,n){var r=lr.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Sbe(e,t,n){var r=lr.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function jbe(e,t,n){var r=obe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Nbe(e,t,n){var r=lr.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function kbe(e,t,n){var r=lr.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function bI(e,t){return Mt(e.getDate(),t,2)}function Cbe(e,t){return Mt(e.getHours(),t,2)}function Abe(e,t){return Mt(e.getHours()%12||12,t,2)}function Ebe(e,t){return Mt(1+bp.count(Ms(e),e),t,3)}function Dq(e,t){return Mt(e.getMilliseconds(),t,3)}function Obe(e,t){return Dq(e,t)+"000"}function zbe(e,t){return Mt(e.getMonth()+1,t,2)}function _be(e,t){return Mt(e.getMinutes(),t,2)}function Tbe(e,t){return Mt(e.getSeconds(),t,2)}function Pbe(e){var t=e.getDay();return t===0?7:t}function Rbe(e,t){return Mt(Y0.count(Ms(e)-1,e),t,2)}function Mq(e){var t=e.getDay();return t>=4||t===0?md(e):md.ceil(e)}function Dbe(e,t){return e=Mq(e),Mt(md.count(Ms(e),e)+(Ms(e).getDay()===4),t,2)}function Mbe(e){return e.getDay()}function Ibe(e,t){return Mt(av.count(Ms(e)-1,e),t,2)}function Lbe(e,t){return Mt(e.getFullYear()%100,t,2)}function $be(e,t){return e=Mq(e),Mt(e.getFullYear()%100,t,2)}function Bbe(e,t){return Mt(e.getFullYear()%1e4,t,4)}function Ube(e,t){var n=e.getDay();return e=n>=4||n===0?md(e):md.ceil(e),Mt(e.getFullYear()%1e4,t,4)}function qbe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Mt(t/60|0,"0",2)+Mt(t%60,"0",2)}function wI(e,t){return Mt(e.getUTCDate(),t,2)}function Fbe(e,t){return Mt(e.getUTCHours(),t,2)}function Hbe(e,t){return Mt(e.getUTCHours()%12||12,t,2)}function Kbe(e,t){return Mt(1+Q0.count(Is(e),e),t,3)}function Iq(e,t){return Mt(e.getUTCMilliseconds(),t,3)}function Gbe(e,t){return Iq(e,t)+"000"}function Vbe(e,t){return Mt(e.getUTCMonth()+1,t,2)}function Qbe(e,t){return Mt(e.getUTCMinutes(),t,2)}function Ybe(e,t){return Mt(e.getUTCSeconds(),t,2)}function Wbe(e){var t=e.getUTCDay();return t===0?7:t}function Zbe(e,t){return Mt(W0.count(Is(e)-1,e),t,2)}function Lq(e){var t=e.getUTCDay();return t>=4||t===0?gd(e):gd.ceil(e)}function Xbe(e,t){return e=Lq(e),Mt(gd.count(Is(e),e)+(Is(e).getUTCDay()===4),t,2)}function Jbe(e){return e.getUTCDay()}function ewe(e,t){return Mt(sv.count(Is(e)-1,e),t,2)}function twe(e,t){return Mt(e.getUTCFullYear()%100,t,2)}function nwe(e,t){return e=Lq(e),Mt(e.getUTCFullYear()%100,t,2)}function rwe(e,t){return Mt(e.getUTCFullYear()%1e4,t,4)}function iwe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?gd(e):gd.ceil(e),Mt(e.getUTCFullYear()%1e4,t,4)}function awe(){return"+0000"}function SI(){return"%"}function jI(e){return+e}function NI(e){return Math.floor(+e/1e3)}var Cu,$q,Bq;swe({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 swe(e){return Cu=sbe(e),$q=Cu.format,Cu.parse,Bq=Cu.utcFormat,Cu.utcParse,Cu}function owe(e){return new Date(e)}function lwe(e){return e instanceof Date?+e:+new Date(+e)}function AA(e,t,n,r,i,a,l,c,d,f){var p=hA(),m=p.invert,y=p.domain,v=f(".%L"),w=f(":%S"),b=f("%I:%M"),j=f("%I %p"),k=f("%a %d"),E=f("%b %d"),A=f("%B"),C=f("%Y");function _(O){return(d(O)<O?v:c(O)<O?w:l(O)<O?b:a(O)<O?j:r(O)<O?i(O)<O?k:E:n(O)<O?A:C)(O)}return p.invert=function(O){return new Date(m(O))},p.domain=function(O){return arguments.length?y(Array.from(O,lwe)):y().map(owe)},p.ticks=function(O){var z=y();return e(z[0],z[z.length-1],O??10)},p.tickFormat=function(O,z){return z==null?_:f(z)},p.nice=function(O){var z=y();return(!O||typeof O.range!="function")&&(O=t(z[0],z[z.length-1],O??10)),O?y(Cq(z,O)):p},p.copy=function(){return xp(p,AA(e,t,n,r,i,a,l,c,d,f))},p}function cwe(){return na.apply(AA(ibe,abe,Ms,kA,Y0,bp,jA,wA,Vl,$q).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function uwe(){return na.apply(AA(nbe,rbe,Is,CA,W0,Q0,NA,SA,Vl,Bq).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Z0(){var e=0,t=1,n,r,i,a,l=qr,c=!1,d;function f(m){return m==null||isNaN(m=+m)?d:l(i===0?.5:(m=(a(m)-n)*i,c?Math.max(0,Math.min(1,m)):m))}f.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),f):[e,t]},f.clamp=function(m){return arguments.length?(c=!!m,f):c},f.interpolator=function(m){return arguments.length?(l=m,f):l};function p(m){return function(y){var v,w;return arguments.length?([v,w]=y,l=m(v,w),f):[l(0),l(1)]}}return f.range=p(Dd),f.rangeRound=p(fA),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 sl(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Uq(){var e=al(Z0()(qr));return e.copy=function(){return sl(e,Uq())},qs.apply(e,arguments)}function qq(){var e=gA(Z0()).domain([1,10]);return e.copy=function(){return sl(e,qq()).base(e.base())},qs.apply(e,arguments)}function Fq(){var e=yA(Z0());return e.copy=function(){return sl(e,Fq()).constant(e.constant())},qs.apply(e,arguments)}function EA(){var e=vA(Z0());return e.copy=function(){return sl(e,EA()).exponent(e.exponent())},qs.apply(e,arguments)}function dwe(){return EA.apply(null,arguments).exponent(.5)}function Hq(){var e=[],t=qr;function n(r){if(r!=null&&!isNaN(r=+r))return t((yp(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(Ho),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)=>W0e(e,a/r))},n.copy=function(){return Hq(t).domain(e)},qs.apply(n,arguments)}function X0(){var e=0,t=.5,n=1,r=1,i,a,l,c,d,f=qr,p,m=!1,y;function v(b){return isNaN(b=+b)?y:(b=.5+((b=+p(b))-a)*(r*b<r*a?c:d),f(m?Math.max(0,Math.min(1,b)):b))}v.domain=function(b){return arguments.length?([e,t,n]=b,i=p(e=+e),a=p(t=+t),l=p(n=+n),c=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 w(b){return function(j){var k,E,A;return arguments.length?([k,E,A]=j,f=jxe(b,[k,E,A]),v):[f(0),f(.5),f(1)]}}return v.range=w(Dd),v.rangeRound=w(fA),v.unknown=function(b){return arguments.length?(y=b,v):y},function(b){return p=b,i=b(e),a=b(t),l=b(n),c=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,v}}function Kq(){var e=al(X0()(qr));return e.copy=function(){return sl(e,Kq())},qs.apply(e,arguments)}function Gq(){var e=gA(X0()).domain([.1,1,10]);return e.copy=function(){return sl(e,Gq()).base(e.base())},qs.apply(e,arguments)}function Vq(){var e=yA(X0());return e.copy=function(){return sl(e,Vq()).constant(e.constant())},qs.apply(e,arguments)}function OA(){var e=vA(X0());return e.copy=function(){return sl(e,OA()).exponent(e.exponent())},qs.apply(e,arguments)}function fwe(){return OA.apply(null,arguments).exponent(.5)}const Qq=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:cA,scaleDiverging:Kq,scaleDivergingLog:Gq,scaleDivergingPow:OA,scaleDivergingSqrt:fwe,scaleDivergingSymlog:Vq,scaleIdentity:kq,scaleImplicit:jN,scaleLinear:Nq,scaleLog:Aq,scaleOrdinal:lA,scalePoint:J0e,scalePow:xA,scaleQuantile:zq,scaleQuantize:_q,scaleRadial:Oq,scaleSequential:Uq,scaleSequentialLog:qq,scaleSequentialPow:EA,scaleSequentialQuantile:Hq,scaleSequentialSqrt:dwe,scaleSequentialSymlog:Fq,scaleSqrt:Gxe,scaleSymlog:Eq,scaleThreshold:Tq,scaleTime:cwe,scaleUtc:uwe,tickFormat:jq},Symbol.toStringTag,{value:"Module"}));function hwe(e){var t=Qq;if(e in t&&typeof t[e]=="function")return t[e]();var n="scale".concat(up(e));if(n in t&&typeof t[n]=="function")return t[n]()}function kI(e,t,n){if(typeof e=="function")return e.copy().domain(t).range(n);if(e!=null){var r=hwe(e);if(r!=null)return r.domain(t).range(n),r}}function zA(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?kI(e.scale,n,r):kI(t,n,r)}function pwe(e){return"scale".concat(up(e))}function mwe(e){return pwe(e)in Qq}var Yq=(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 mwe(r)?r:"point"}};function gwe(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,c,d=gwe(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=(c=r[d])!==null&&c!==void 0?c:0;return Math.abs(a-f)<=Math.abs(a-p)?n[d-1]:n[d]}}}function ywe(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 ov(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){vwe(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 vwe(e,t,n){return(t=xwe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xwe(e){var t=bwe(e,"string");return typeof t=="symbol"?t:t+""}function bwe(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 AN=[0,"auto"],Qn={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"},Zq=(e,t)=>e.cartesianAxis.xAxis[t],Fs=(e,t)=>{var n=Zq(e,t);return n??Qn},Yn={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:AN,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:hp},Xq=(e,t)=>e.cartesianAxis.yAxis[t],Hs=(e,t)=>{var n=Xq(e,t);return n??Yn},wwe={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:""},_A=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??wwe},Qr=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Hs(e,n);case"zAxis":return _A(e,n);case"angleAxis":return rA(e,n);case"radiusAxis":return iA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Swe=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Hs(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},wp=(e,t,n)=>{switch(t){case"xAxis":return Fs(e,n);case"yAxis":return Hs(e,n);case"angleAxis":return rA(e,n);case"radiusAxis":return iA(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Jq=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function eF(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 J0=e=>e.graphicalItems.cartesianItems,jwe=le([sr,q0],eF),tF=(e,t,n)=>e.filter(n).filter(r=>t?.includeHidden===!0?!0:!r.hide),Md=le([J0,Qr,jwe],tF,{memoizeOptions:{resultEqualityCheck:G0}}),nF=le([Md],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(H0)),rF=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),Nwe=le([Md],rF),iF=e=>e.map(t=>t.data).filter(Boolean).flat(1),kwe=le([Md],e=>e.some(t=>!t.data)),aF=le([Md],iF,{memoizeOptions:{resultEqualityCheck:G0}}),sF=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},TA=le([aF,I0],sF),Cwe=(e,t,n)=>t?.dataKey!=null?e.map(r=>({value:Tn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Tn(i,r)}))):e.map(r=>({value:r})),oF=(e,t,n,r,i,a)=>{var{chartData:l=[],dataStartIndex:c,dataEndIndex:d}=r,f=Cwe(e,t,n);if(i&&t?.dataKey!=null&&a.length>0){var p=l.slice(c,d+1),m=p.map(y=>({value:Tn(y,t.dataKey)})).filter(y=>y.value!=null);return[...m,...f]}return f},Sp=le([TA,Qr,Md,I0,kwe,aF],oF);function Ju(e){if(Ga(e)||e instanceof Date){var t=Number(e);if(St(t))return t}}function AI(e){if(Array.isArray(e)){var t=[Ju(e[0]),Ju(e[1])];return qa(t)?t:void 0}var n=Ju(e);if(n!=null)return[n,n]}function Ya(e){return e.map(Ju).filter(si)}function Awe(e,t){var n=Ju(e),r=Ju(t);return n==null&&r==null?0:n==null?-1:r==null?1:n-r}var Ewe=le([Sp],e=>e?.map(t=>t.value).sort(Awe));function lF(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Owe(e,t,n){if(!n)return[];if(!n.length)return[];var r;if(typeof t=="number"&&!xa(t))r=t;else if(Array.isArray(t)){var i=Ya(t);i.length>0&&(r=Math.max(...i))}return r==null?[]:Ya(n.flatMap(a=>{var l=Tn(e,a.dataKey),c,d;if(Array.isArray(l)?[c,d]=l:c=d=l,!(!St(c)||!St(d)))return[r-c,r+d]}))}var Jn=e=>{var t=or(e),n=Rd(e);return wp(e,t,n)},yd=le([Jn],e=>e?.dataKey),zwe=le([nF,I0,Jn],pq),cF=(e,t,n,r)=>{var i={},a=t.reduce((l,c)=>{if(c.stackId==null)return l;var d=l[c.stackId];return d==null&&(d=[]),d.push(c),l[c.stackId]=d,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[c,d]=l,f=r?[...d].reverse():d,p=f.map(F0);return[c,{stackedData:fge(e,p,n),graphicalItems:f}]}))},lv=le([zwe,nF,L0,oq],cF),uF=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=gge(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},_we=le([Qr],e=>e.allowDataOverflow),PA=e=>{var t;if(e==null||!("domain"in e))return AN;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ya(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:AN},dF=le([Qr],PA),fF=le([dF,_we],QU),Twe=le([lv,Ca,sr,fF],uF,{memoizeOptions:{resultEqualityCheck:K0}}),RA=e=>e.errorBars,Pwe=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>lF(n,r)),cv=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),c=Math.max(...a);return[l,c]}},hF=function(t,n,r,i,a){var l=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],c,d;if(r.length>0&&r.forEach(f=>{var p,m=f.data!=null?[...f.data]:l,y=(p=i[f.id])===null||p===void 0?void 0:p.filter(v=>lF(a,v));m.forEach(v=>{var w,b=Tn(v,(w=n.dataKey)!==null&&w!==void 0?w:f.dataKey),j=Owe(v,b,y);if(j.length>=2){var k=Math.min(...j),E=Math.max(...j);(c==null||k<c)&&(c=k),(d==null||E>d)&&(d=E)}var A=AI(b);A!=null&&(c=c==null?A[0]:Math.min(c,A[0]),d=d==null?A[1]:Math.max(d,A[1]))})}),n?.dataKey!=null&&r.length===0&&t.forEach(f=>{var p=AI(Tn(f,n.dataKey));p!=null&&(c=c==null?p[0]:Math.min(c,p[0]),d=d==null?p[1]:Math.max(d,p[1]))}),St(c)&&St(d))return[c,d]},Rwe=le([TA,Qr,Nwe,RA,sr,w0e],hF,{memoizeOptions:{resultEqualityCheck:K0}});function Dwe(e){var{value:t}=e;if(Ga(t)||t instanceof Date)return t}var Mwe=(e,t,n)=>{var r=e.map(Dwe).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&j6(r))?GU(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},pF=e=>e.referenceElements.dots,Id=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),Iwe=le([pF,sr,q0],Id),mF=e=>e.referenceElements.areas,Lwe=le([mF,sr,q0],Id),gF=e=>e.referenceElements.lines,$we=le([gF,sr,q0],Id),yF=(e,t)=>{if(e!=null){var n=Ya(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Bwe=le(Iwe,sr,yF),vF=(e,t)=>{if(e!=null){var n=Ya(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)]}},Uwe=le([Lwe,sr],vF);function qwe(e){var t;if(e.x!=null)return Ya([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ya(n)}function Fwe(e){var t;if(e.y!=null)return Ya([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ya(n)}var xF=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?qwe(r):Fwe(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},Hwe=le([$we,sr],xF),Kwe=le(Bwe,Hwe,Uwe,(e,t,n)=>cv(e,n,t)),bF=(e,t,n,r,i,a,l,c)=>{if(n!=null)return n;var d=l==="vertical"&&c==="xAxis"||l==="horizontal"&&c==="yAxis",f=d?cv(r,a,i):cv(a,i);return j0e(t,f,e.allowDataOverflow)},Gwe=le([Qr,dF,fF,Twe,Rwe,Kwe,qt,sr],bF,{memoizeOptions:{resultEqualityCheck:K0}}),Vwe=[0,1],wF=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:c,type:d}=e,f=Za(t,a);if(f&&c==null){var p;return GU(0,(p=n?.length)!==null&&p!==void 0?p:0)}return d==="category"?Mwe(r,e,f):i==="expand"&&!f?Vwe:l}},DA=le([Qr,qt,TA,Sp,L0,sr,Gwe],wF),Ld=le([Qr,Jq,eA],Yq),SF=(e,t,n)=>{var{niceTicks:r}=t;if(r!=="none"){var i=PA(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((r==="snap125"||r==="adaptive")&&t!=null&&t.tickCount&&qa(e)){if(a)return IM(e,t.tickCount,t.allowDecimals,r);if(t.type==="number")return LM(e,t.tickCount,t.allowDecimals,r)}if(r==="auto"&&n==="linear"&&t!=null&&t.tickCount){if(a&&qa(e))return IM(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&qa(e))return LM(e,t.tickCount,t.allowDecimals,"adaptive")}}},MA=le([DA,wp,Ld],SF),jF=(e,t,n,r)=>{if(r!=="angleAxis"&&e?.type==="number"&&qa(t)&&Array.isArray(n)&&n.length>0){var i,a,l=t[0],c=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],f=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(l,c),Math.max(d,f)]}return t},Qwe=le([Qr,DA,MA,sr],jF),Ywe=le(Sp,Qr,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ya(e.map(m=>m.value))).sort((m,y)=>m-y),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===0)return 1/0;for(var c=0;c<r.length-1;c++){var d=r[c],f=r[c+1];if(!(d==null||f==null)){var p=f-d;n=Math.min(n,p)}}return n/l}}),NF=le(Ywe,qt,sq,ar,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!St(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=ba(n,e*a),c=e*a/2;return c-l-(c-l)/a*l}return 0}),Wwe=(e,t,n)=>{var r=Fs(e,t);return r==null||typeof r.padding!="string"?0:NF(e,"xAxis",t,n,r.padding)},Zwe=(e,t,n)=>{var r=Hs(e,t);return r==null||typeof r.padding!="string"?0:NF(e,"yAxis",t,n,r.padding)},Xwe=le(Fs,Wwe,(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}}),Jwe=le(Hs,Zwe,(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}}),eSe=le([ar,Xwe,z0,O0,(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]}),tSe=le([ar,qt,Jwe,z0,O0,(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]}),jp=(e,t,n,r)=>{var i;switch(t){case"xAxis":return eSe(e,n,r);case"yAxis":return tSe(e,n,r);case"zAxis":return(i=_A(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return dq(e);case"radiusAxis":return fq(e,n);default:return}},kF=le([Qr,jp],$0),nSe=le([Ld,Qwe],L0e),IA=le([Qr,Ld,nSe,kF],zA),CF=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=Za(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(c=>c.value)}},LA=le([qt,Sp,wp,sr],CF),ex=le([IA],sA);le([IA],ywe);le([IA,Ewe],Wq);le([Md,RA,sr],Pwe);function AF(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var tx=(e,t)=>t,nx=(e,t,n)=>n,rSe=le(A0,tx,nx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(AF)),iSe=le(E0,tx,nx,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(AF)),EF=(e,t)=>({width:e.width,height:t.height}),aSe=(e,t)=>{var n=typeof t.width=="number"?t.width:hp;return{width:n,height:e.height}},OF=le(ar,Fs,EF),sSe=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},oSe=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},lSe=le(Us,ar,rSe,tx,nx,(e,t,n,r,i)=>{var a={},l;return n.forEach(c=>{var d=EF(t,c);l==null&&(l=sSe(t,r,e));var f=r==="top"&&!i||r==="bottom"&&i;a[c.id]=l-Number(f)*d.height,l+=(f?-1:1)*d.height}),a}),cSe=le(Bs,ar,iSe,tx,nx,(e,t,n,r,i)=>{var a={},l;return n.forEach(c=>{var d=aSe(t,c);l==null&&(l=oSe(t,r,e));var f=r==="left"&&!i||r==="right"&&i;a[c.id]=l-Number(f)*d.width,l+=(f?-1:1)*d.width}),a}),uSe=(e,t)=>{var n=Fs(e,t);if(n!=null)return lSe(e,n.orientation,n.mirror)},dSe=le([ar,Fs,uSe,(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}}}),fSe=(e,t)=>{var n=Hs(e,t);if(n!=null)return cSe(e,n.orientation,n.mirror)},hSe=le([ar,Hs,fSe,(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}}}),zF=le(ar,Hs,(e,t)=>{var n=typeof t.width=="number"?t.width:hp;return{width:n,height:e.height}}),EI=(e,t,n)=>{switch(t){case"xAxis":return OF(e,n).width;case"yAxis":return zF(e,n).height;default:return}},_F=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,c=Za(e,r),d=t.map(p=>p.value),f=d.filter(p=>p!=null);if(l&&c&&a==="category"&&i&&j6(f))return d}},$A=le([qt,Sp,Qr,sr],_F),OI=le([qt,Swe,Ld,ex,$A,LA,jp,MA,sr],(e,t,n,r,i,a,l,c,d)=>{if(t!=null){var f=Za(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:f,niceTicks:c,range:l,realScaleType:n,scale:r}}}),pSe=(e,t,n,r,i,a,l,c,d)=>{if(!(t==null||r==null)){var f=Za(e,d),{type:p,ticks:m,tickCount:y}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=p==="category"&&r.bandwidth?r.bandwidth()/v:0;w=d==="angleAxis"&&a!=null&&a.length>=2?ai(a[0]-a[1])*2*w:w;var b=m||i;return b?b.map((j,k)=>{var E=l?l.indexOf(j):j,A=r.map(E);return St(A)?{index:k,coordinate:A+w,value:j,offset:w}:null}).filter(si):f&&c?c.map((j,k)=>{var E=r.map(j);return St(E)?{coordinate:E+w,value:j,index:k,offset:w}:null}).filter(si):r.ticks?r.ticks(y).map((j,k)=>{var E=r.map(j);return St(E)?{coordinate:E+w,value:j,index:k,offset:w}:null}).filter(si):r.domain().map((j,k)=>{var E=r.map(j);return St(E)?{coordinate:E+w,value:l?l[j]:j,index:k,offset:w}:null}).filter(si)}},TF=le([qt,wp,Ld,ex,MA,jp,$A,LA,sr],pSe),mSe=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var c=Za(e,l),{tickCount:d}=t,f=0;return f=l==="angleAxis"&&r?.length>=2?ai(r[0]-r[1])*2*f:f,c&&a?a.map((p,m)=>{var y=n.map(p);return St(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(si):n.ticks?n.ticks(d).map((p,m)=>{var y=n.map(p);return St(y)?{coordinate:y+f,value:p,index:m,offset:f}:null}).filter(si):n.domain().map((p,m)=>{var y=n.map(p);return St(y)?{coordinate:y+f,value:i?i[p]:p,index:m,offset:f}:null}).filter(si)}},Wo=le([qt,wp,ex,jp,$A,LA,sr],mSe),Zo=le(Qr,ex,(e,t)=>{if(!(e==null||t==null))return ov(ov({},e),{},{scale:t})}),gSe=le([Qr,Ld,DA,kF],zA),ySe=le([gSe],sA);le((e,t,n)=>_A(e,n),ySe,(e,t)=>{if(!(e==null||t==null))return ov(ov({},e),{},{scale:t})});var vSe=le([qt,A0,E0],(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}}),xSe=(e,t,n)=>{var r;return(r=e.renderedTicks[t])===null||r===void 0?void 0:r[n]};le([xSe],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 PF=e=>e.options.defaultTooltipEventType,RF=e=>e.options.validateTooltipEventTypes;function DF(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Np(e,t){var n=PF(e),r=RF(e);return DF(t,n,r)}function bSe(e){return Ge(t=>Np(t,e))}var MF=(e,t)=>{var n,r=Number(t);if(!(xa(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},wSe=e=>e.tooltip.settings,Po={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},SSe={itemInteraction:{click:Po,hover:Po},axisInteraction:{click:Po,hover:Po},keyboardInteraction:Po,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}},IF=Tr({name:"tooltip",initialState:SSe,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:sn()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Gi(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:sn()},removeTooltipEntrySettings:{reducer(e,t){var n=Gi(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:sn()},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:jSe,replaceTooltipEntrySettings:NSe,removeTooltipEntrySettings:kSe,setTooltipSettingsState:CSe,setActiveMouseOverItemIndex:LF,mouseLeaveItem:ASe,mouseLeaveChart:$F,setActiveClickItemIndex:ESe,setMouseOverAxisIndex:BF,setMouseClickAxisIndex:OSe,setSyncInteraction:oh,setKeyboardInteraction:uv}=IF.actions,zSe=IF.reducer;function zI(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 wg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zI(Object(n),!0).forEach(function(r){_Se(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Se(e,t,n){return(t=TSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TSe(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 RSe(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function DSe(e){return e.index!=null}var UF=(e,t,n,r)=>{if(t==null)return Po;var i=RSe(e,t,n);if(i==null)return Po;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(DSe(i)){if(a)return wg(wg({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return wg(wg({},Po),{},{coordinate:i.coordinate})};function MSe(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 ISe(e,t){var n=MSe(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 LSe(e,t,n){if(n==null||t==null)return!0;var r=Tn(e,t);return r==null||!qa(n)?!0:ISe(r,n)}var vh=(e,t,n,r)=>{var i=e?.index;if(i==null)return null;var a=Number(i);if(!St(a))return i;var l=0,c=1/0;t.length>0&&(c=t.length-1);var d=Math.max(l,Math.min(a,c)),f=t[d];return f==null||LSe(f,n,r)?String(d):null},qF=(e,t,n,r,i,a,l)=>{if(a!=null){var c=l[0],d=c?.getPosition(a);if(d!=null)return d;var f=i?.[Number(a)];if(f)return n==="horizontal"?{x:f.coordinate,y:(r.top+t)/2}:{x:(r.left+e)/2,y:f.coordinate}}},FF=(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 c;return((c=l.settings)===null||c===void 0?void 0:c.graphicalItemId)===i})},HF=e=>e.options.tooltipPayloadSearcher,$d=e=>e.tooltip;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 TI(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){$Se(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 $Se(e,t,n){return(t=BSe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BSe(e){var t=USe(e,"string");return typeof t=="symbol"?t:t+""}function USe(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 qSe(e){if(typeof e=="string"||typeof e=="number")return e}function FSe(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e}function HSe(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e=="function")return t=>e(t)}function PI(e){if(typeof e=="string")return e}function KSe(e){if(!(e==null||typeof e!="object")){var t="name"in e?qSe(e.name):void 0,n="unit"in e?FSe(e.unit):void 0,r="dataKey"in e?HSe(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?PI(e.color):void 0,l="fill"in e?PI(e.fill):void 0;return{name:t,unit:n,dataKey:r,payload:i,color:a,fill:l}}}function GSe(e,t){return e??t}var KF=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:c,computedData:d,dataStartIndex:f,dataEndIndex:p}=n,m=[];return e.reduce((y,v)=>{var w,{dataDefinedOnItem:b,settings:j}=v,k=GSe(b,c),E=Array.isArray(k)?vU(k,f,p):k,A=(w=j?.dataKey)!==null&&w!==void 0?w:r,C=j?.nameKey,_;if(r&&Array.isArray(E)&&!Array.isArray(E[0])&&l==="axis"?_=N6(E,r,i):_=a(E,t,d,C),Array.isArray(_))_.forEach(z=>{var R,$,F=KSe(z),M=F?.name,U=F?.dataKey,K=F?.payload,Z=TI(TI({},j),{},{name:M,unit:F?.unit,color:(R=F?.color)!==null&&R!==void 0?R:j?.color,fill:($=F?.fill)!==null&&$!==void 0?$:j?.fill});y.push(kD({tooltipEntrySettings:Z,dataKey:U,payload:K,value:Tn(K,U),name:M==null?void 0:String(M)}))});else{var O;y.push(kD({tooltipEntrySettings:j,dataKey:A,payload:_,value:Tn(_,A),name:(O=Tn(_,C))!==null&&O!==void 0?O:j?.name}))}return y},m)}},BA=le([Jn,Jq,eA],Yq),VSe=le([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),QSe=le([or,Rd],eF),Pc=le([VSe,Jn,QSe],tF,{memoizeOptions:{resultEqualityCheck:G0}}),YSe=le([Pc],e=>e.filter(H0)),GF=le([Pc],iF,{memoizeOptions:{resultEqualityCheck:G0}}),WSe=le([Pc],e=>e.some(t=>!t.data)),yc=le([GF,Ca],sF),ZSe=le([YSe,Ca,Jn],pq),UA=le([yc,Jn,Pc,Ca,WSe,GF],oF),VF=le([Jn],PA),XSe=le([Jn],e=>e.allowDataOverflow),QF=le([VF,XSe],QU),JSe=le([Pc],e=>e.filter(H0)),eje=le([ZSe,JSe,L0,oq],cF),tje=le([eje,Ca,or,QF],uF),nje=le([Pc],rF),rje=le([yc,Jn,nje,RA,or,S0e],hF,{memoizeOptions:{resultEqualityCheck:K0}}),ije=le([pF,or,Rd],Id),aje=le([ije,or],yF),sje=le([mF,or,Rd],Id),oje=le([sje,or],vF),lje=le([gF,or,Rd],Id),cje=le([lje,or],xF),uje=le([aje,cje,oje],cv),dje=le([Jn,VF,QF,tje,rje,uje,qt,or],bF),vd=le([Jn,qt,yc,UA,L0,or,dje],wF),fje=le([vd,Jn,BA],SF),hje=le([Jn,vd,fje,or],jF),YF=e=>{var t=or(e),n=Rd(e),r=!1;return jp(e,t,n,r)},WF=le([Jn,YF],$0),pje=le([Jn,BA,hje,WF],zA),ZF=le([pje],sA),mje=le([qt,UA,Jn,or],_F),gje=le([qt,UA,Jn,or],CF),yje=(e,t,n,r,i,a,l,c)=>{if(t){var{type:d}=t,f=Za(e,c);if(r){var p=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/p:0;return m=c==="angleAxis"&&i!=null&&i?.length>=2?ai(i[0]-i[1])*2*m:m,f&&l?l.map((y,v)=>{var w=r.map(y);return St(w)?{coordinate:w+m,value:y,index:v,offset:m}:null}).filter(si):r.domain().map((y,v)=>{var w=r.map(y);return St(w)?{coordinate:w+m,value:a?a[y]:y,index:v,offset:m}:null}).filter(si)}}},Ks=le([qt,Jn,BA,ZF,YF,mje,gje,or],yje),qA=le([PF,RF,wSe],(e,t,n)=>DF(n.shared,e,t)),XF=e=>e.tooltip.settings.trigger,FA=e=>e.tooltip.settings.defaultIndex,kp=le([$d,qA,XF,FA],UF),vc=le([kp,yc,yd,vd],vh),JF=le([Ks,vc],MF),e8=le([kp],e=>{if(e)return e.dataKey}),vje=le([kp],e=>{if(e)return e.graphicalItemId}),t8=le([$d,qA,XF,FA],FF),xje=le([Bs,Us,qt,ar,Ks,FA,t8],qF),bje=le([kp,xje],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),wje=le([kp],e=>{var t;return(t=e?.active)!==null&&t!==void 0?t:!1}),Sje=le([t8,vc,Ca,yd,JF,HF,qA],KF),jje=le([Sje],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function RI(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 DI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RI(Object(n),!0).forEach(function(r){Nje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nje(e,t,n){return(t=kje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kje(e){var t=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 Aje=()=>Ge(Jn),Eje=()=>{var e=Aje(),t=Ge(Ks),n=Ge(ZF);return dd(!e||!n?void 0:DI(DI({},e),{},{scale:n}),t)};function MI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MI(Object(n),!0).forEach(function(r){Oje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Oje(e,t,n){return(t=zje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zje(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 Tje=(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}},Pje=(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 Au(Au(Au({},r),Sr(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var c=i.coordinate,{angle:d}=r;return Au(Au(Au({},r),Sr(r.cx,r.cy,c,d)),{},{angle:d,radius:c})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function Rje(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 n8=(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 c=0;c<l;c++){var d,f,p,m,y,v=c>0?(d=n[c-1])===null||d===void 0?void 0:d.coordinate:(f=n[l-1])===null||f===void 0?void 0:f.coordinate,w=(p=n[c])===null||p===void 0?void 0:p.coordinate,b=c>=l-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(y=n[c+1])===null||y===void 0?void 0:y.coordinate,j=void 0;if(!(v==null||w==null||b==null))if(ai(w-v)!==ai(b-w)){var k=[];if(ai(b-w)===ai(i[1]-i[0])){j=b;var E=w+i[1]-i[0];k[0]=Math.min(E,(E+v)/2),k[1]=Math.max(E,(E+v)/2)}else{j=v;var A=b+i[1]-i[0];k[0]=Math.min(w,(A+w)/2),k[1]=Math.max(w,(A+w)/2)}var C=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>C[0]&&e<=C[1]||e>=k[0]&&e<=k[1]){var _;return(_=n[c])===null||_===void 0?void 0:_.index}}else{var O=Math.min(v,b),z=Math.max(v,b);if(e>(O+w)/2&&e<=(z+w)/2){var R;return(R=n[c])===null||R===void 0?void 0:R.index}}}else if(t)for(var $=0;$<l;$++){var F=t[$];if(F!=null){var M=t[$+1],U=t[$-1];if($===0&&M!=null&&e<=(F.coordinate+M.coordinate)/2||$===l-1&&U!=null&&e>(F.coordinate+U.coordinate)/2||$>0&&$<l-1&&U!=null&&M!=null&&e>(F.coordinate+U.coordinate)/2&&e<=(F.coordinate+M.coordinate)/2)return F.index}}return-1},r8=()=>Ge(eA),HA=(e,t)=>t,i8=(e,t,n)=>n,KA=(e,t,n,r)=>r,Dje=le(Ks,e=>g0(e,t=>t.coordinate)),GA=le([$d,HA,i8,KA],UF),VA=le([GA,yc,yd,vd],vh),Mje=(e,t,n)=>{if(t!=null){var r=$d(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},a8=le([$d,HA,i8,KA],FF),dv=le([Bs,Us,qt,ar,Ks,KA,a8],qF),Ije=le([GA,dv],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),s8=le([Ks,VA],MF),Lje=le([a8,VA,Ca,yd,s8,HF,HA],KF),$je=le([GA,VA],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Bje=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&Rje(e,l)){var c=yge(e,t),d=n8(c,a,i,n,r),f=Tje(t,i,d,e);return{activeIndex:String(d),activeCoordinate:f}}},Uje=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var c=d0e(e,n);if(c){var d=vge(c,t),f=n8(d,l,a,r,i),p=Pje(t,a,f,c);return{activeIndex:String(f),activeCoordinate:p}}}},qje=(e,t,n,r,i,a,l,c)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?Bje(e,t,r,i,a,l,c):Uje(e,t,n,r,i,a,l)},Fje=le(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}}),Hje=le(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(nr)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:I0e}});function II(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 LI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?II(Object(n),!0).forEach(function(r){Kje(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):II(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kje(e,t,n){return(t=Gje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gje(e){var t=Vje(e,"string");return typeof t=="symbol"?t:t+""}function Vje(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 Qje={},Yje={zIndexMap:Object.values(nr).reduce((e,t)=>LI(LI({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Qje)},Wje=new Set(Object.values(nr));function Zje(e){return Wje.has(e)}var o8=Tr({name:"zIndex",initialState:Yje,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:sn()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Zje(n)&&delete e.zIndexMap[n])},prepare:sn()},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:sn()},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:sn()}}}),{registerZIndexPortal:Xje,unregisterZIndexPortal:Ej,registerZIndexPortalElement:Jje,unregisterZIndexPortalElement:e1e}=o8.actions,t1e=o8.reducer;function ra(e){var{zIndex:t,children:n}=e,r=Zge(),i=r&&t!==void 0&&t!==0,a=Pr(),l=x.useRef(void 0),c=x.useRef(new Set),d=ln(),f=Ge(m=>Fje(m,t,a));if(x.useLayoutEffect(()=>{if(!i){var m=c.current;m.forEach(v=>{d(Ej({zIndex:v}))}),m.clear(),l.current=void 0;return}if(c.current.has(t)||(d(Xje({zIndex:t})),c.current.add(t)),f){l.current=f;var y=c.current;y.forEach(v=>{v!==t&&(d(Ej({zIndex:v})),y.delete(v))})}},[d,t,i,f]),x.useLayoutEffect(()=>{var m=c.current;return()=>{m.forEach(y=>{d(Ej({zIndex:y}))}),m.clear()}},[d]),!i)return n;var p=f??l.current;return p?wc.createPortal(n,p):null}function EN(){return EN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EN.apply(null,arguments)}function $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 Sg(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){n1e(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 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 a1e(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return x.isValidElement(t)?x.cloneElement(t,r):x.createElement(n,r)}function s1e(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:c,cursor:d,tooltipEventType:f,chartName:p}=e,m=n,y=r,v=i;if(!d||!m||p!=="ScatterChart"&&f!=="axis")return null;var w,b,j;if(p==="ScatterChart")w=m,b=kve,j=nr.cursorLine;else if(p==="BarChart")w=Cve(c,m,a,l),b=qU,j=nr.cursorRectangle;else if(c==="radial"&&C6(m)){var{cx:k,cy:E,radius:A,startAngle:C,endAngle:_}=FU(m);w={cx:k,cy:E,startAngle:C,endAngle:_,innerRadius:A,outerRadius:A},b=KU,j=nr.cursorLine}else w={points:m0e(c,m,a)},b=yh,j=nr.cursorLine;var O=typeof d=="object"&&"className"in d?d.className:void 0,z=Sg(Sg(Sg(Sg({stroke:"#ccc",pointerEvents:"none"},a),w),cp(d)),{},{payload:y,payloadIndex:v,className:$t("recharts-tooltip-cursor",O)});return x.createElement(ra,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},x.createElement(a1e,{cursor:d,cursorComp:b,cursorProps:z}))}function o1e(e){var t=Eje(),n=CU(),r=zc(),i=r8();return t==null||n==null||r==null||i==null?null:x.createElement(s1e,EN({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var l8=x.createContext(null),l1e=()=>x.useContext(l8),Oj={exports:{}},BI;function c1e(){return BI||(BI=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,f,p){this.fn=d,this.context=f,this.once=p||!1}function a(d,f,p,m,y){if(typeof p!="function")throw new TypeError("The listener must be a function");var v=new i(p,m||d,y),w=n?n+f:f;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function l(d,f){--d._eventsCount===0?d._events=new r:delete d._events[f]}function c(){this._events=new r,this._eventsCount=0}c.prototype.eventNames=function(){var f=[],p,m;if(this._eventsCount===0)return f;for(m in p=this._events)t.call(p,m)&&f.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(p)):f},c.prototype.listeners=function(f){var p=n?n+f:f,m=this._events[p];if(!m)return[];if(m.fn)return[m.fn];for(var y=0,v=m.length,w=new Array(v);y<v;y++)w[y]=m[y].fn;return w},c.prototype.listenerCount=function(f){var p=n?n+f:f,m=this._events[p];return m?m.fn?1:m.length:0},c.prototype.emit=function(f,p,m,y,v,w){var b=n?n+f:f;if(!this._events[b])return!1;var j=this._events[b],k=arguments.length,E,A;if(j.fn){switch(j.once&&this.removeListener(f,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,p),!0;case 3:return j.fn.call(j.context,p,m),!0;case 4:return j.fn.call(j.context,p,m,y),!0;case 5:return j.fn.call(j.context,p,m,y,v),!0;case 6:return j.fn.call(j.context,p,m,y,v,w),!0}for(A=1,E=new Array(k-1);A<k;A++)E[A-1]=arguments[A];j.fn.apply(j.context,E)}else{var C=j.length,_;for(A=0;A<C;A++)switch(j[A].once&&this.removeListener(f,j[A].fn,void 0,!0),k){case 1:j[A].fn.call(j[A].context);break;case 2:j[A].fn.call(j[A].context,p);break;case 3:j[A].fn.call(j[A].context,p,m);break;case 4:j[A].fn.call(j[A].context,p,m,y);break;default:if(!E)for(_=1,E=new Array(k-1);_<k;_++)E[_-1]=arguments[_];j[A].fn.apply(j[A].context,E)}}return!0},c.prototype.on=function(f,p,m){return a(this,f,p,m,!1)},c.prototype.once=function(f,p,m){return a(this,f,p,m,!0)},c.prototype.removeListener=function(f,p,m,y){var v=n?n+f:f;if(!this._events[v])return this;if(!p)return l(this,v),this;var w=this._events[v];if(w.fn)w.fn===p&&(!y||w.once)&&(!m||w.context===m)&&l(this,v);else{for(var b=0,j=[],k=w.length;b<k;b++)(w[b].fn!==p||y&&!w[b].once||m&&w[b].context!==m)&&j.push(w[b]);j.length?this._events[v]=j.length===1?j[0]:j:l(this,v)}return this},c.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},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Oj)),Oj.exports}var u1e=c1e();const d1e=Sa(u1e);var Qh=new d1e,ON="recharts.syncEvent.tooltip",UI="recharts.syncEvent.brush",c8=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!xa(n))return e[n]}},f1e={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},u8=Tr({name:"options",initialState:f1e,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),h1e=u8.reducer,{createEventEmitter:p1e}=u8.actions;function m1e(e){return e.tooltip.syncInteraction}var g1e={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},d8=Tr({name:"chartData",initialState:g1e,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:qI,setDataStartEndIndexes:y1e,setComputedData:_2e}=d8.actions,v1e=d8.reducer,x1e=["x","y"];function FI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Eu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FI(Object(n),!0).forEach(function(r){b1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b1e(e,t,n){return(t=w1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function w1e(e){var t=S1e(e,"string");return typeof t=="symbol"?t:t+""}function S1e(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 j1e(e,t){if(e==null)return{};var n,r,i=N1e(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 N1e(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 k1e(){var e=Ge(tA),t=Ge(nA),n=ln(),r=Ge(lq),i=Ge(Ks),a=zc(),l=_0(),c=Ge(d=>d.rootProps.className);x.useEffect(()=>{if(e==null)return Oc;var d=(f,p,m)=>{if(t!==m&&e===f){if(p.payload.active===!1){n(oh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var y;if(l&&p!==null&&p!==void 0&&(y=p.payload)!==null&&y!==void 0&&y.coordinate&&p.payload.sourceViewBox){var v=p.payload.coordinate,{x:w,y:b}=v,j=j1e(v,x1e),{x:k,y:E,width:A,height:C}=p.payload.sourceViewBox,_=Eu(Eu({},j),{},{x:l.x+(A?(w-k)/A:0)*l.width,y:l.y+(C?(b-E)/C:0)*l.height});n(Eu(Eu({},p),{},{payload:Eu(Eu({},p.payload),{},{coordinate:_})}))}else n(p);return}if(i!=null){var O;if(typeof r=="function"){var z={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},R=r(i,z);O=i[R]}else r==="value"&&(O=i.find(H=>String(H.value)===p.payload.label));var{coordinate:$}=p.payload;if($==null||l==null){n(oh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(O==null){n(oh({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:M}=$,U=Math.min(F,l.x+l.width),K=Math.min(M,l.y+l.height),Z={x:a==="horizontal"?O.coordinate:U,y:a==="horizontal"?K:O.coordinate},Y=oh({active:p.payload.active,coordinate:Z,dataKey:p.payload.dataKey,index:String(O.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});n(Y)}}};return Qh.on(ON,d),()=>{Qh.off(ON,d)}},[c,n,t,e,r,i,a,l])}function C1e(){var e=Ge(tA),t=Ge(nA),n=ln();x.useEffect(()=>{if(e==null)return Oc;var r=(i,a,l)=>{t!==l&&e===i&&n(y1e(a))};return Qh.on(UI,r),()=>{Qh.off(UI,r)}},[n,t,e])}function A1e(){var e=ln();x.useEffect(()=>{e(p1e())},[e]),k1e(),C1e()}function E1e(e,t,n,r,i,a){var l=Ge(w=>Mje(w,e,t)),c=Ge(vje),d=Ge(nA),f=Ge(tA),p=Ge(lq),m=Ge(m1e),y=m?.sourceViewBox!=null,v=_0();x.useEffect(()=>{if(!y&&f!=null&&d!=null){var w=oh({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:c});Qh.emit(ON,f,w,d)}},[y,n,l,c,i,r,d,f,p,a,v])}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 KI(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){O1e(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 O1e(e,t,n){return(t=z1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z1e(e){var t=_1e(e,"string");return typeof t=="symbol"?t:t+""}function _1e(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function T1e(e){return e.dataKey}function P1e(e,t){return x.isValidElement(e)?x.cloneElement(e,t):typeof e=="function"?x.createElement(e,t):x.createElement(eve,t)}var GI=[],R1e={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 fv(e){var t,n,r=_r(e,R1e),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:c,content:d,filterNull:f,isAnimationActive:p,offset:m,payloadUniqBy:y,position:v,reverseDirection:w,useTranslate3d:b,wrapperStyle:j,cursor:k,shared:E,trigger:A,defaultIndex:C,portal:_,axisId:O}=r,z=ln(),R=typeof C=="number"?String(C):C;x.useEffect(()=>{z(CSe({shared:E,trigger:A,axisId:O,active:i,defaultIndex:R}))},[z,E,A,O,i,R]);var $=_0(),F=IU(),M=bSe(E),{activeIndex:U,isActive:K}=(t=Ge(Te=>$je(Te,M,A,R)))!==null&&t!==void 0?t:{},Z=Ge(Te=>Lje(Te,M,A,R)),Y=Ge(Te=>s8(Te,M,A,R)),H=Ge(Te=>Ije(Te,M,A,R)),X=Z,ue=l1e(),xe=(n=i??K)!==null&&n!==void 0?n:!1,[L,q]=q6([X,xe]),I=M==="axis"?Y:void 0;E1e(M,A,H,I,U,xe);var D=_??ue;if(D==null||$==null||M==null)return null;var V=X??GI;xe||(V=GI),f&&V.length&&(V=I6(V.filter(Te=>Te.value!=null&&(Te.hide!==!0||r.includeHidden)),y,T1e));var re=V.length>0,ee=KI(KI({},r),{},{payload:V,label:I,active:xe,activeIndex:U,coordinate:H,accessibilityLayer:F}),Ee=x.createElement(dve,{allowEscapeViewBox:a,animationDuration:l,animationEasing:c,isAnimationActive:p,active:xe,coordinate:H,hasPayload:re,offset:m,position:v,reverseDirection:w,useTranslate3d:b,viewBox:$,wrapperStyle:j,lastBoundingBox:L,innerRef:q,hasPortalFromProps:!!_},P1e(d,ee));return x.createElement(x.Fragment,null,wc.createPortal(Ee,D),xe&&x.createElement(o1e,{cursor:k,tooltipEventType:M,coordinate:H,payload:V,index:U}))}var hv=e=>null;hv.displayName="Cell";function D1e(e,t,n){return(t=M1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M1e(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)}class L1e{constructor(t){D1e(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 VI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(r){B1e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B1e(e,t,n){return(t=U1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U1e(e){var t=q1e(e,"string");return typeof t=="symbol"?t:t+""}function q1e(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 F1e={cacheSize:2e3,enableCache:!0},f8=$1e({},F1e),QI=new L1e(f8.cacheSize),H1e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},YI="recharts_measurement_span";function K1e(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",c=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(c)}var WI=(e,t)=>{try{var n=document.getElementById(YI);n||(n=document.createElement("span"),n.setAttribute("id",YI),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,H1e,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},xh=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||gp.isSsr)return{width:0,height:0};if(!f8.enableCache)return WI(t,n);var r=K1e(t,n),i=QI.get(r);if(i)return i;var a=WI(t,n);return QI.set(r,a),a},h8;function G1e(e,t,n){return(t=V1e(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V1e(e){var t=Q1e(e,"string");return typeof t=="symbol"?t:t+""}function Q1e(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 ZI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,XI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Y1e=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,W1e=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Z1e={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},X1e=["cm","mm","pt","pc","in","Q","px"];function J1e(e){return X1e.includes(e)}var Uu="NaN";function eNe(e,t){return e*Z1e[t]}class yr{static parse(t){var n,[,r,i]=(n=W1e.exec(t))!==null&&n!==void 0?n:[];return r==null?yr.NaN:new yr(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,xa(t)&&(this.unit=""),n!==""&&!Y1e.test(n)&&(this.num=NaN,this.unit=""),J1e(n)&&(this.num=eNe(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new yr(NaN,""):new yr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new yr(NaN,""):new yr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new yr(NaN,""):new yr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new yr(NaN,""):new yr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return xa(this.num)}}h8=yr;G1e(yr,"NaN",new h8(NaN,""));function p8(e){if(e==null||e.includes(Uu))return Uu;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=ZI.exec(t))!==null&&n!==void 0?n:[],l=yr.parse(r??""),c=yr.parse(a??""),d=i==="*"?l.multiply(c):l.divide(c);if(d.isNaN())return Uu;t=t.replace(ZI,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,[,p,m,y]=(f=XI.exec(t))!==null&&f!==void 0?f:[],v=yr.parse(p??""),w=yr.parse(y??""),b=m==="+"?v.add(w):v.subtract(w);if(b.isNaN())return Uu;t=t.replace(XI,b.toString())}return t}var JI=/\(([^()]*)\)/;function tNe(e){for(var t=e,n;(n=JI.exec(t))!=null;){var[,r]=n;t=t.replace(JI,p8(r))}return t}function nNe(e){var t=e.replace(/\s+/g,"");return t=tNe(t),t=p8(t),t}function rNe(e){try{return nNe(e)}catch{return Uu}}function zj(e){var t=rNe(e.slice(5,-1));return t===Uu?"":t}var iNe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],aNe=["dx","dy","angle","className","breakAll"];function zN(){return zN=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},zN.apply(null,arguments)}function eL(e,t){if(e==null)return{};var n,r,i=sNe(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 sNe(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 m8=/[ \f\n\r\t\v\u2028\u2029]+/,g8=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];yn(t)||(n?i=t.toString().split(""):i=t.toString().split(m8));var a=i.map(c=>({word:c,width:xh(c,r).width})),l=n?0:xh(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function y8(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function oNe(e){return yn(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var v8=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:c}=a,d=i[i.length-1];if(d&&c!=null&&(t==null||r||d.width+c+n<Number(t)))d.words.push(l),d.width+=c+n;else{var f={words:[l],width:c};i.push(f)}return i},[]),x8=e=>e.reduce((t,n)=>t.width>n.width?t:n),lNe="…",tL=(e,t,n,r,i,a,l,c)=>{var d=e.slice(0,t),f=g8({breakAll:n,style:r,children:d+lNe});if(!f)return[!1,[]];var p=v8(f.wordsWithComputedWidth,a,l,c),m=p.length>i||x8(p).width>Number(a);return[m,p]},cNe=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:c,breakAll:d}=e,f=De(a),p=String(l),m=v8(t,r,n,i);if(!f||i)return m;var y=m.length>a||x8(m).width>Number(r);if(!y)return m;for(var v=0,w=p.length-1,b=0,j;v<=w&&b<=p.length-1;){var k=Math.floor((v+w)/2),E=k-1,[A,C]=tL(p,E,d,c,a,r,n,i),[_]=tL(p,k,d,c,a,r,n,i);if(!A&&!_&&(v=k+1),A&&_&&(w=k-1),!A&&_){j=C;break}b++}return j||m},nL=e=>{var t=yn(e)?[]:e.toString().split(m8);return[{words:t,width:void 0}]},uNe=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!gp.isSsr){var c,d,f=g8({breakAll:a,children:r,style:i});if(f){var{wordsWithComputedWidth:p,spaceWidth:m}=f;c=p,d=m}else return nL(r);return cNe({breakAll:a,children:r,maxLines:l,style:i},c,d,t,!!n)}return nL(r)},b8="#808080",dNe={angle:0,breakAll:!1,capHeight:"0.71em",fill:b8,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},QA=x.forwardRef((e,t)=>{var n=_r(e,dNe),{x:r,y:i,lineHeight:a,capHeight:l,fill:c,scaleToFit:d,textAnchor:f,verticalAnchor:p}=n,m=eL(n,iNe),y=x.useMemo(()=>uNe({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:w,angle:b,className:j,breakAll:k}=m,E=eL(m,aNe);if(!Ga(r)||!Ga(i)||y.length===0)return null;var A=Number(r)+(De(v)?v:0),C=Number(i)+(De(w)?w:0);if(!St(A)||!St(C))return null;var _;switch(p){case"start":_=zj("calc(".concat(l,")"));break;case"middle":_=zj("calc(".concat((y.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:_=zj("calc(".concat(y.length-1," * -").concat(a,")"));break}var O=[],z=y[0];if(d&&z!=null){var R=z.width,{width:$}=m;O.push("scale(".concat(De($)&&De(R)?$/R:1,")"))}return b&&O.push("rotate(".concat(b,", ").concat(A,", ").concat(C,")")),O.length&&(E.transform=O.join(" ")),x.createElement("text",zN({},Gr(E),{ref:t,x:A,y:C,className:$t("recharts-text",j),textAnchor:f,fill:c.includes("url")?b8:c}),y.map((F,M)=>{var U=F.words.join(k?"":" ");return x.createElement("tspan",{x:A,dy:M===0?_:a,key:"".concat(U,"-").concat(M)},U)}))});QA.displayName="Text";function rL(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 Ra(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rL(Object(n),!0).forEach(function(r){fNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fNe(e,t,n){return(t=hNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hNe(e){var t=pNe(e,"string");return typeof t=="symbol"?t:t+""}function pNe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mNe=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:c,upperWidth:d,lowerWidth:f}=HC(t),p=a,m=a+(d-f)/2,y=(p+m)/2,v=(d+f)/2,w=p+d/2,b=c>=0?1:-1,j=b*r,k=b>0?"end":"start",E=b>0?"start":"end",A=d>=0?1:-1,C=A*r,_=A>0?"end":"start",O=A>0?"start":"end",z=i;if(n==="top"){var R={x:p+d/2,y:l-j,horizontalAnchor:"middle",verticalAnchor:k};return z&&(R.height=Math.max(l-z.y,0),R.width=d),R}if(n==="bottom"){var $={x:m+f/2,y:l+c+j,horizontalAnchor:"middle",verticalAnchor:E};return z&&($.height=Math.max(z.y+z.height-(l+c),0),$.width=f),$}if(n==="left"){var F={x:y-C,y:l+c/2,horizontalAnchor:_,verticalAnchor:"middle"};return z&&(F.width=Math.max(F.x-z.x,0),F.height=c),F}if(n==="right"){var M={x:y+v+C,y:l+c/2,horizontalAnchor:O,verticalAnchor:"middle"};return z&&(M.width=Math.max(z.x+z.width-M.x,0),M.height=c),M}var U=z?{width:v,height:c}:{};return n==="insideLeft"?Ra({x:y+C,y:l+c/2,horizontalAnchor:O,verticalAnchor:"middle"},U):n==="insideRight"?Ra({x:y+v-C,y:l+c/2,horizontalAnchor:_,verticalAnchor:"middle"},U):n==="insideTop"?Ra({x:p+d/2,y:l+j,horizontalAnchor:"middle",verticalAnchor:E},U):n==="insideBottom"?Ra({x:m+f/2,y:l+c-j,horizontalAnchor:"middle",verticalAnchor:k},U):n==="insideTopLeft"?Ra({x:p+C,y:l+j,horizontalAnchor:O,verticalAnchor:E},U):n==="insideTopRight"?Ra({x:p+d-C,y:l+j,horizontalAnchor:_,verticalAnchor:E},U):n==="insideBottomLeft"?Ra({x:m+C,y:l+c-j,horizontalAnchor:O,verticalAnchor:k},U):n==="insideBottomRight"?Ra({x:m+f-C,y:l+c-j,horizontalAnchor:_,verticalAnchor:k},U):n&&typeof n=="object"&&(De(n.x)||fc(n.x))&&(De(n.y)||fc(n.y))?Ra({x:a+ba(n.x,v),y:l+ba(n.y,c),horizontalAnchor:"end",verticalAnchor:"end"},U):Ra({x:w,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},U)},gNe=["labelRef"],yNe=["content"];function iL(e,t){if(e==null)return{};var n,r,i=vNe(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 vNe(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 aL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aL(Object(n),!0).forEach(function(r){xNe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xNe(e,t,n){return(t=bNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bNe(e){var t=wNe(e,"string");return typeof t=="symbol"?t:t+""}function wNe(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 Cs(){return Cs=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},Cs.apply(null,arguments)}var w8=x.createContext(null),SNe=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:c}=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(w8.Provider,{value:d},c)},S8=()=>{var e=x.useContext(w8),t=_0();return e||(t?HC(t):void 0)},jNe=x.createContext(null),NNe=()=>{var e=x.useContext(jNe),t=Ge(hq);return e||t},kNe=e=>{var{value:t,formatter:n}=e,r=yn(e.children)?t:e.children;return typeof n=="function"?n(r):r},YA=e=>e!=null&&typeof e=="function",CNe=(e,t)=>{var n=ai(t-e),r=Math.min(Math.abs(t-e),360);return n*r},ANe=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:c,cy:d,innerRadius:f,outerRadius:p,startAngle:m,endAngle:y,clockWise:v}=i,w=(f+p)/2,b=CNe(m,y),j=b>=0?1:-1,k,E;switch(t){case"insideStart":k=m+j*a,E=v;break;case"insideEnd":k=y-j*a,E=!v;break;case"end":k=y+j*a,E=v;break;default:throw new Error("Unsupported position ".concat(t))}E=b<=0?E:!E;var A=Sr(c,d,w,k),C=Sr(c,d,w,k+(E?1:-1)*359),_="M".concat(A.x,",").concat(A.y,`
|
|
288
|
+
A`).concat(w,",").concat(w,",0,1,").concat(E?0:1,`,
|
|
289
|
+
`).concat(C.x,",").concat(C.y),O=yn(e.id)?Dh("recharts-radial-line-"):e.id;return x.createElement("text",Cs({},r,{dominantBaseline:"central",className:$t("recharts-radial-bar-label",l)}),x.createElement("defs",null,x.createElement("path",{id:O,d:_})),x.createElement("textPath",{xlinkHref:"#".concat(O)},n))},ENe=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:c,endAngle:d}=e,f=(c+d)/2;if(n==="outside"){var{x:p,y:m}=Sr(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 y=(a+l)/2,{x:v,y:w}=Sr(r,i,y,f);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Vg=e=>e!=null&&"cx"in e&&De(e.cx),ONe={angle:0,offset:5,zIndex:nr.label,position:"middle",textBreakAll:!1};function zNe(e){if(!Vg(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 _o(e){var t=_r(e,ONe),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:c,className:d="",textBreakAll:f,labelRef:p}=t,m=NNe(),y=S8(),v=i==="center"?y:m??y,w,b,j;n==null?w=v:Vg(n)?w=n:w=HC(n);var k=zNe(w);if(!w||yn(a)&&yn(l)&&!x.isValidElement(c)&&typeof c!="function")return null;var E=lh(lh({},t),{},{viewBox:w});if(x.isValidElement(c)){var{labelRef:A}=E,C=iL(E,gNe);return x.cloneElement(c,C)}if(typeof c=="function"){var{content:_}=E,O=iL(E,yNe);if(b=x.createElement(c,O),x.isValidElement(b))return b}else b=kNe(t);var z=Gr(t);if(Vg(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return ANe(t,i,b,z,w);j=ENe(w,t.offset,t.position)}else{if(!k)return null;var R=mNe({viewBox:k,position:i,offset:t.offset,parentViewBox:Vg(r)?void 0:r});j=lh(lh({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}return x.createElement(ra,{zIndex:t.zIndex},x.createElement(QA,Cs({ref:p,className:$t("recharts-label",d)},z,j,{textAnchor:y8(z.textAnchor)?z.textAnchor:j.textAnchor,breakAll:f}),b))}_o.displayName="Label";var _Ne=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?x.createElement(_o,Cs({key:"label-implicit"},r)):Ga(e)?x.createElement(_o,Cs({key:"label-implicit",value:e},r)):x.isValidElement(e)?e.type===_o?x.cloneElement(e,lh({key:"label-implicit"},r)):x.createElement(_o,Cs({key:"label-implicit",content:e},r)):YA(e)?x.createElement(_o,Cs({key:"label-implicit",content:e},r)):e&&typeof e=="object"?x.createElement(_o,Cs({},e,{key:"label-implicit"},r)):null};function TNe(e){var{label:t,labelRef:n}=e,r=S8();return _Ne(t,r,n)||null}var PNe=["valueAccessor"],RNe=["dataKey","clockWise","id","textBreakAll","zIndex"];function pv(){return pv=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},pv.apply(null,arguments)}function sL(e,t){if(e==null)return{};var n,r,i=DNe(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DNe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var MNe=e=>{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(oNe(t))return t},j8=x.createContext(void 0),N8=j8.Provider,k8=x.createContext(void 0);k8.Provider;function INe(){return x.useContext(j8)}function LNe(){return x.useContext(k8)}function Qg(e){var{valueAccessor:t=MNe}=e,n=sL(e,PNe),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:c}=n,d=sL(n,RNe),f=INe(),p=LNe(),m=f||p;return!m||!m.length?null:x.createElement(ra,{zIndex:c??nr.label},x.createElement(Or,{className:"recharts-label-list"},m.map((y,v)=>{var w,b=yn(r)?t(y,v):Tn(y.payload,r),j=yn(a)?{}:{id:"".concat(a,"-").concat(v)};return x.createElement(_o,pv({key:"label-".concat(v)},Gr(y),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:y.fill,parentViewBox:y.parentViewBox,value:b,textBreakAll:l,viewBox:y.viewBox,index:v,zIndex:0}))})))}Qg.displayName="LabelList";function C8(e){var{label:t}=e;return t?t===!0?x.createElement(Qg,{key:"labelList-implicit"}):x.isValidElement(t)||YA(t)?x.createElement(Qg,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(Qg,pv({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function _N(){return _N=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},_N.apply(null,arguments)}var A8=e=>{var{cx:t,cy:n,r,className:i}=e,a=$t("recharts-dot",i);return De(t)&&De(n)&&De(r)?x.createElement("circle",_N({},Zi(e),PC(e),{className:a,cx:t,cy:n,r})):null},$Ne={radiusAxis:{},angleAxis:{}},E8=Tr({name:"polarAxis",initialState:$Ne,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:T2e,removeRadiusAxis:P2e,addAngleAxis:R2e,removeAngleAxis:D2e}=E8.actions,BNe=E8.reducer;function UNe(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var _j={exports:{}},Yt={};var oL;function qNe(){if(oL)return Yt;oL=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"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function w(b){if(typeof b=="object"&&b!==null){var j=b.$$typeof;switch(j){case e:switch(b=b.type,b){case n:case i:case r:case d:case f:case y:return b;default:switch(b=b&&b.$$typeof,b){case l:case c:case m:case p:return b;case a:return b;default:return j}}case t:return j}}}return Yt.ContextConsumer=a,Yt.ContextProvider=l,Yt.Element=e,Yt.ForwardRef=c,Yt.Fragment=n,Yt.Lazy=m,Yt.Memo=p,Yt.Portal=t,Yt.Profiler=i,Yt.StrictMode=r,Yt.Suspense=d,Yt.SuspenseList=f,Yt.isContextConsumer=function(b){return w(b)===a},Yt.isContextProvider=function(b){return w(b)===l},Yt.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Yt.isForwardRef=function(b){return w(b)===c},Yt.isFragment=function(b){return w(b)===n},Yt.isLazy=function(b){return w(b)===m},Yt.isMemo=function(b){return w(b)===p},Yt.isPortal=function(b){return w(b)===t},Yt.isProfiler=function(b){return w(b)===i},Yt.isStrictMode=function(b){return w(b)===r},Yt.isSuspense=function(b){return w(b)===d},Yt.isSuspenseList=function(b){return w(b)===f},Yt.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===c||b.$$typeof===v||b.getModuleId!==void 0)},Yt.typeOf=w,Yt}var lL;function FNe(){return lL||(lL=1,_j.exports=qNe()),_j.exports}var HNe=FNe(),cL=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",uL=null,Tj=null,O8=e=>{if(e===uL&&Array.isArray(Tj))return Tj;var t=[];return x.Children.forEach(e,n=>{yn(n)||(HNe.isFragment(n)?t=t.concat(O8(n.props.children)):t.push(n))}),Tj=t,uL=e,t};function KNe(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>cL(i)):r=[cL(t)],O8(e).forEach(i=>{var a=cd(i,"type.displayName")||cd(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var z8=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,Pj={},dL;function GNe(){return dL||(dL=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})(Pj)),Pj}var Rj,fL;function VNe(){return fL||(fL=1,Rj=GNe().isPlainObject),Rj}var QNe=VNe();const YNe=Sa(QNe);var hL,pL,mL,gL,yL;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 xL(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){WNe(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 WNe(e,t,n){return(t=ZNe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZNe(e){var t=XNe(e,"string");return typeof t=="symbol"?t:t+""}function XNe(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(){return mv=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},mv.apply(null,arguments)}function Jf(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var bL=(e,t,n,r,i)=>{var a=n-r,l;return l=Cn(hL||(hL=Jf(["M ",",",""])),e,t),l+=Cn(pL||(pL=Jf(["L ",",",""])),e+n,t),l+=Cn(mL||(mL=Jf(["L ",",",""])),e+n-a/2,t+i),l+=Cn(gL||(gL=Jf(["L ",",",""])),e+n-a/2-r,t+i),l+=Cn(yL||(yL=Jf(["L ",","," Z"])),e,t),l},JNe={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},eke=e=>{var t=_r(e,JNe),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:c}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isUpdateAnimationActive:m}=t,y=x.useRef(null),[v,w]=x.useState(-1),b=x.useRef(i),j=x.useRef(a),k=x.useRef(l),E=x.useRef(n),A=x.useRef(r),C=M0(e,"trapezoid-");if(x.useEffect(()=>{if(y.current&&y.current.getTotalLength)try{var Z=y.current.getTotalLength();Z&&w(Z)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var _=$t("recharts-trapezoid",c);if(!m)return x.createElement("g",null,x.createElement("path",mv({},Gr(t),{className:_,d:bL(n,r,i,a,l)})));var O=b.current,z=j.current,R=k.current,$=E.current,F=A.current,M="0px ".concat(v===-1?1:v,"px"),U="".concat(v,"px ").concat(v,"px"),K=LU(["strokeDasharray"],f,d);return x.createElement(D0,{animationId:C,key:C,canBegin:v>0,duration:f,easing:d,isActive:m,begin:p},Z=>{var Y=gn(O,i,Z),H=gn(z,a,Z),X=gn(R,l,Z),ue=gn($,n,Z),xe=gn(F,r,Z);y.current&&(b.current=Y,j.current=H,k.current=X,E.current=ue,A.current=xe);var L=Z>0?{transition:K,strokeDasharray:U}:{strokeDasharray:M};return x.createElement("path",mv({},Gr(t),{className:_,d:bL(ue,xe,Y,H,X),ref:y,style:xL(xL({},L),t.style)}))})},tke=["option","shapeType","activeClassName","inActiveClassName"];function nke(e,t){if(e==null)return{};var n,r,i=rke(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 rke(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 wL(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 gv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wL(Object(n),!0).forEach(function(r){ike(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ike(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=ske(e,"string");return typeof t=="symbol"?t:t+""}function ske(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 oke(e,t){return gv(gv({},t),e)}function lke(e,t){return e==="symbols"}function SL(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return x.createElement(qU,n);case"trapezoid":return x.createElement(eke,n);case"sector":return x.createElement(KU,n);case"symbols":if(lke(t))return x.createElement(TC,n);break;case"curve":return x.createElement(yh,n);default:return null}}function cke(e){return x.isValidElement(e)?e.props:e}function uke(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape",inActiveClassName:i="recharts-shape"}=e,a=nke(e,tke),l;if(x.isValidElement(t))l=x.cloneElement(t,gv(gv({},a),cke(t)));else if(typeof t=="function")l=t(a,a.index);else if(YNe(t)&&typeof t!="boolean"){var c=oke(t,a);l=x.createElement(SL,{shapeType:n,elementProps:c})}else{var d=a;l=x.createElement(SL,{shapeType:n,elementProps:d})}return a.isActive?x.createElement(Or,{className:r},l):x.createElement(Or,{className:i},l)}var _8=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(LF({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},T8=e=>{var t=ln();return(n,r)=>i=>{e?.(n,r,i),t(ASe())}},P8=(e,t,n)=>{var r=ln();return(i,a)=>l=>{e?.(i,a,l),r(ESe({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function R8(e){var{tooltipEntrySettings:t}=e,n=ln(),r=Pr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(jSe(t)):i.current!==t&&n(NSe({prev:i.current,next:t})),i.current=t)},[t,n,r]),x.useLayoutEffect(()=>()=>{i.current&&(n(kSe(i.current)),i.current=null)},[n]),null}function D8(e){var{legendPayload:t}=e,n=ln(),r=Pr(),i=x.useRef(null);return x.useLayoutEffect(()=>{r||(i.current===null?n(dye(t)):i.current!==t&&n(fye({prev:i.current,next:t})),i.current=t)},[n,r,t]),x.useLayoutEffect(()=>()=>{i.current&&(n(hye(i.current)),i.current=null)},[n]),null}var Dj,dke=()=>{var[e]=x.useState(()=>Dh("uid-"));return e},fke=(Dj=kv.useId)!==null&&Dj!==void 0?Dj:dke;function hke(e,t){var n=fke();return t||(e?"".concat(e,"-").concat(n):n)}var pke=x.createContext(void 0),M8=e=>{var{id:t,type:n,children:r}=e,i=hke("recharts-".concat(n),t);return x.createElement(pke.Provider,{value:i},r(i))},mke={cartesianItems:[],polarItems:[]},I8=Tr({name:"graphicalItems",initialState:mke,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:sn()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Gi(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:sn()},removeCartesianGraphicalItem:{reducer(e,t){var n=Gi(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:sn()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:sn()},removePolarGraphicalItem:{reducer(e,t){var n=Gi(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:sn()},replacePolarGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Gi(e).polarItems.indexOf(n);i>-1&&(e.polarItems[i]=r)},prepare:sn()}}}),{addCartesianGraphicalItem:gke,replaceCartesianGraphicalItem:yke,removeCartesianGraphicalItem:vke,addPolarGraphicalItem:M2e,removePolarGraphicalItem:I2e,replacePolarGraphicalItem:L2e}=I8.actions,xke=I8.reducer,bke=e=>{var t=ln(),n=x.useRef(null);return x.useLayoutEffect(()=>{n.current===null?t(gke(e)):n.current!==e&&t(yke({prev:n.current,next:e})),n.current=e},[t,e]),x.useLayoutEffect(()=>()=>{n.current&&(t(vke(n.current)),n.current=null)},[t]),null},L8=x.memo(bke),wke=["points"];function jL(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 Mj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jL(Object(n),!0).forEach(function(r){Ske(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ske(e,t,n){return(t=jke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jke(e){var t=Nke(e,"string");return typeof t=="symbol"?t:t+""}function Nke(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}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)}function kke(e,t){if(e==null)return{};var n,r,i=Cke(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 Cke(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 Ake(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=$t(r,typeof t!="boolean"?t.className:""),a=n??{},{points:l}=a,c=kke(a,wke);return x.createElement(A8,yv({},c,{className:i}))}function Eke(e,t){return e==null?!1:t?!0:e.length===1}function Oke(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:l,needClip:c,clipPathId:d,zIndex:f=nr.scatter}=e;if(!Eke(t,n))return null;var p=z8(n),m=Xfe(n),y=t.map((w,b)=>{var j,k,E=Mj(Mj(Mj({r:3},l),m),{},{index:b,cx:(j=w.x)!==null&&j!==void 0?j:void 0,cy:(k=w.y)!==null&&k!==void 0?k:void 0,dataKey:a,value:w.value,payload:w.payload,points:t});return x.createElement(Ake,{key:"dot-".concat(b),option:n,dotProps:E,className:i})}),v={};return c&&d!=null&&(v.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(d,")")),x.createElement(ra,{zIndex:f},x.createElement(Or,yv({className:r},v),y))}function NL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NL(Object(n),!0).forEach(function(r){zke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zke(e,t,n){return(t=_ke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ke(e){var t=Tke(e,"string");return typeof t=="symbol"?t:t+""}function Tke(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 $8=0,Pke={xAxis:{},yAxis:{},zAxis:{}},B8=Tr({name:"cartesianAxis",initialState:Pke,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:sn()},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:sn()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:sn()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:sn()},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:sn()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:sn()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:sn()},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:sn()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:sn()},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 c=[...l,r].slice(-3);e.yAxis[n]=kL(kL({},i),{},{width:r,widthHistory:c})}}}}),{addXAxis:Rke,replaceXAxis:Dke,removeXAxis:Mke,addYAxis:Ike,replaceYAxis:Lke,removeYAxis:$ke,addZAxis:$2e,replaceZAxis:B2e,removeZAxis:U2e,updateYAxisWidth:Bke}=B8.actions,Uke=B8.reducer,qke=le([ar],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Fke=le([qke,Bs,Us],(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)}}),WA=()=>Ge(Fke),Hke=()=>Ge(jje);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 Ij(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){Kke(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 Kke(e,t,n){return(t=Gke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gke(e){var t=Vke(e,"string");return typeof t=="symbol"?t:t+""}function Vke(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 Qke=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 c={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},d=Ij(Ij(Ij({},c),cp(i)),PC(i)),f;return x.isValidElement(i)?f=x.cloneElement(i,d):typeof i=="function"?f=i(d):f=x.createElement(A8,d),x.createElement(Or,{className:"recharts-active-dot",clipPath:l},f)};function AL(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:l=nr.activeDot}=e,c=Ge(vc),d=Hke();if(t==null||d==null)return null;var f=t.find(p=>d.includes(p.payload));return yn(f)?null:x.createElement(ra,{zIndex:l},x.createElement(Qke,{point:f,childIndex:Number(c),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var EL=(e,t,n)=>{var r=n??e;if(!yn(r))return ba(r,t,0)},Yke=(e,t,n)=>{var r={},i=e.filter(H0),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),c=Object.entries(l).map(f=>{var p,[m,y]=f,v=y.map(b=>b.dataKey),w=EL(t,n,(p=y[0])===null||p===void 0?void 0:p.barSize);return{stackId:m,dataKeys:v,barSize:w}}),d=a.map(f=>{var p=[f.dataKey].filter(y=>y!=null),m=EL(t,n,f.barSize);return{stackId:void 0,dataKeys:p,barSize:m}});return[...c,...d]};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 jg(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){Wke(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 Wke(e,t,n){return(t=Zke(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zke(e){var t=Xke(e,"string");return typeof t=="symbol"?t:t+""}function Xke(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 Jke(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var c=ba(e,n,0,!0),d,f=[];if(St((a=r[0])===null||a===void 0?void 0:a.barSize)){var p=!1,m=n/l,y=r.reduce((E,A)=>E+(A.barSize||0),0);y+=(l-1)*c,y>=n&&(y-=(l-1)*c,c=0),y>=n&&m>0&&(p=!0,m*=.9,y=l*m);var v=(n-y)/2>>0,w={offset:v-c,size:0};d=r.reduce((E,A)=>{var C,_={stackId:A.stackId,dataKeys:A.dataKeys,position:{offset:w.offset+w.size+c,size:p?m:(C=A.barSize)!==null&&C!==void 0?C:0}},O=[...E,_];return w=_.position,O},f)}else{var b=ba(t,n,0,!0);n-2*b-(l-1)*c<=0&&(c=0);var j=(n-2*b-(l-1)*c)/l;j>1&&(j>>=0);var k=St(i)?Math.min(j,i):j;d=r.reduce((E,A,C)=>[...E,{stackId:A.stackId,dataKeys:A.dataKeys,position:{offset:b+(j+c)*C+(j-k)/2,size:k}}],f)}return d}}var eCe=(e,t,n,r,i,a,l)=>{var c=yn(l)?t:l,d=Jke(n,r,i!==a?i:a,e,c);return i!==a&&d!=null&&(d=d.map(f=>jg(jg({},f),{},{position:jg(jg({},f.position),{},{offset:f.position.offset-i/2})}))),d},tCe=(e,t)=>{var n=F0(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)}}}},nCe=(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 rCe(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&St(e.zIndex)?e.zIndex:t}var iCe=e=>{var{chartData:t}=e,n=ln(),r=Pr();return x.useEffect(()=>r?()=>{}:(n(qI(t)),()=>{n(qI(void 0))}),[t,n,r]),null},zL={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},U8=Tr({name:"brush",initialState:zL,reducers:{setBrushSettings(e,t){return t.payload==null?zL:t.payload}}}),{setBrushSettings:q2e}=U8.actions,aCe=U8.reducer;function sCe(e){return(e%180+180)%180}var oCe=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=sCe(i),l=a*Math.PI/180,c=Math.atan(r/n),d=l>c&&l<Math.PI-c?r/Math.sin(l):n/Math.cos(l);return Math.abs(d)},lCe={dots:[],areas:[],lines:[]},q8=Tr({name:"referenceElements",initialState:lCe,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Gi(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=Gi(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=Gi(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:F2e,removeDot:H2e,addArea:K2e,removeArea:G2e,addLine:V2e,removeLine:Q2e}=q8.actions,cCe=q8.reducer,uCe=x.createContext(void 0),dCe=e=>{var{children:t}=e,[n]=x.useState("".concat(Dh("recharts"),"-clip")),r=WA();if(r==null)return null;var{x:i,y:a,width:l,height:c}=r;return x.createElement(uCe.Provider,{value:n},x.createElement("defs",null,x.createElement("clipPath",{id:n},x.createElement("rect",{x:i,y:a,height:c,width:l}))),t)};function F8(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 fCe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return oCe(r,n)}function hCe(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:c}=e;return t===1?{start:r?i:a,end:r?i+l:a+c}:{start:r?i+l:a+c,end:r?i:a}}function Yh(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 pCe(e,t){return F8(e,t+1)}function mCe(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:c}=t,d=0,f=1,p=l,m=function(){var w=r?.[d];if(w===void 0)return{v:F8(r,f)};var b=d,j,k=()=>(j===void 0&&(j=n(w,b)),j),E=w.coordinate,A=d===0||Yh(e,E,k,p,c);A||(d=0,p=l,f+=1),A&&(p=E+e*(k()/2+i),d+=f)},y;f<=a.length;)if(y=m(),y)return y.v;return[]}function gCe(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:c,end:d}=t,f=1;f<=l;f++){for(var p=(l-1)%f,m=c,y=!0,v=function(){var C=r[b];if(C==null)return 0;var _=b,O,z=()=>(O===void 0&&(O=n(C,_)),O),R=C.coordinate,$=b===p||Yh(e,R,z,m,d);if(!$)return y=!1,1;$&&(m=R+e*(z()/2+i))},w,b=p;b<l&&(w=v(),!(w!==0&&w===1));b+=f);if(y){for(var j=[],k=p;k<l;k+=f){var E=r[k];E!=null&&j.push(E)}return j}}return[]}function _L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_L(Object(n),!0).forEach(function(r){yCe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_L(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yCe(e,t,n){return(t=vCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vCe(e){var t=xCe(e,"string");return typeof t=="symbol"?t:t+""}function xCe(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 bCe(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:c}=t,{end:d}=t,f=function(y){var v=a[y];if(v==null)return 1;var w=v,b,j=()=>(b===void 0&&(b=n(v,y)),b);if(y===l-1){var k=e*(w.coordinate+e*j()/2-d);a[y]=w=kr(kr({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[y]=w=kr(kr({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var E=Yh(e,w.tickCoord,j,c,d);E&&(d=w.tickCoord-e*(j()/2+i),a[y]=kr(kr({},w),{},{isShow:!0}))}},p=l-1;p>=0;p--)f(p);return a}function wCe(e,t,n,r,i,a){var l=(r||[]).slice(),c=l.length,{start:d,end:f}=t;if(a){var p=r[c-1];if(p!=null){var m=n(p,c-1),y=e*(p.coordinate+e*m/2-f);if(l[c-1]=p=kr(kr({},p),{},{tickCoord:y>0?p.coordinate-y*e:p.coordinate}),p.tickCoord!=null){var v=Yh(e,p.tickCoord,()=>m,d,f);v&&(f=p.tickCoord-e*(m/2+i),l[c-1]=kr(kr({},p),{},{isShow:!0}))}}}for(var w=a?c-1:c,b=function(E){var A=l[E];if(A==null)return 1;var C=A,_,O=()=>(_===void 0&&(_=n(A,E)),_);if(E===0){var z=e*(C.coordinate-e*O()/2-d);l[E]=C=kr(kr({},C),{},{tickCoord:z<0?C.coordinate-z*e:C.coordinate})}else l[E]=C=kr(kr({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var R=Yh(e,C.tickCoord,O,d,f);R&&(d=C.tickCoord+e*(O()/2+i),l[E]=kr(kr({},C),{},{isShow:!0}))}},j=0;j<w;j++)b(j);return l}function ZA(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:c,interval:d,tickFormatter:f,unit:p,angle:m}=e;if(!i||!i.length||!r)return[];if(De(d)||gp.isSsr){var y;return(y=pCe(i,De(d)?d:0))!==null&&y!==void 0?y:[]}var v=[],w=c==="top"||c==="bottom"?"width":"height",b=p&&w==="width"?xh(p,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(_,O)=>{var z=typeof f=="function"?f(_.value,O):_.value;return w==="width"?fCe(xh(z,{fontSize:t,letterSpacing:n}),b,m):xh(z,{fontSize:t,letterSpacing:n})[w]},k=i[0],E=i[1],A=i.length>=2&&k!=null&&E!=null?ai(E.coordinate-k.coordinate):1,C=hCe(a,A,w);return d==="equidistantPreserveStart"?mCe(A,C,j,i,l):d==="equidistantPreserveEnd"?gCe(A,C,j,i,l):(d==="preserveStart"||d==="preserveStartEnd"?v=wCe(A,C,j,i,l,d==="preserveStartEnd"):v=bCe(A,C,j,i,l),v.filter(_=>_.isShow))}var SCe=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 c=n?n.getBoundingClientRect().width:0,d=i+a,f=l+d+c+(n?r:0);return Math.round(f)}return 0},jCe={xAxis:{},yAxis:{}},H8=Tr({name:"renderedTicks",initialState:jCe,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:NCe,removeRenderedTicks:kCe}=H8.actions,CCe=H8.reducer,ACe=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function ECe(e,t){if(e==null)return{};var n,r,i=OCe(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 OCe(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 xc(){return xc=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},xc.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 kn(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){zCe(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 zCe(e,t,n){return(t=_Ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Ce(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)}var Ts={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:nr.axis};function PCe(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:c,otherSvgProps:d}=e;if(!c)return null;var f=kn(kn(kn({},d),Zi(c)),{},{fill:"none"});if(a==="top"||a==="bottom"){var p=+(a==="top"&&!l||a==="bottom"&&l);f=kn(kn({},f),{},{x1:t,y1:n+p*i,x2:t+r,y2:n+p*i})}else{var m=+(a==="left"&&!l||a==="right"&&l);f=kn(kn({},f),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return x.createElement("line",xc({},f,{className:$t("recharts-cartesian-axis-line",cd(c,"className"))}))}function RCe(e,t,n,r,i,a,l,c,d){var f,p,m,y,v,w,b=c?-1:1,j=e.tickSize||l,k=De(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":f=p=e.coordinate,y=n+ +!c*i,m=y-b*j,w=m-b*d,v=k;break;case"left":m=y=e.coordinate,p=t+ +!c*r,f=p-b*j,v=f-b*d,w=k;break;case"right":m=y=e.coordinate,p=t+ +c*r,f=p+b*j,v=f+b*d,w=k;break;default:f=p=e.coordinate,y=n+ +c*i,m=y+b*j,w=m+b*d,v=k;break}return{line:{x1:f,y1:m,x2:p,y2:y},tick:{x:v,y:w}}}function DCe(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function MCe(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function ICe(e){var{option:t,tickProps:n,value:r}=e,i,a=$t(n.className,"recharts-cartesian-axis-tick-value");if(x.isValidElement(t))i=x.cloneElement(t,kn(kn({},n),{},{className:a}));else if(typeof t=="function")i=t(kn(kn({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=$t(l,UNe(t))),i=x.createElement(QA,xc({},n,{className:l}),r)}return i}function LCe(e){var{ticks:t,axisType:n,axisId:r}=e,i=ln();return x.useEffect(()=>{if(r==null||n==null)return Oc;var a=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index}));return i(NCe({ticks:a,axisId:r,axisType:n})),()=>{i(kCe({axisId:r,axisType:n}))}},[i,t,r,n]),null}var $Ce=x.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:c,padding:d,tickTextProps:f,orientation:p,mirror:m,x:y,y:v,width:w,height:b,tickSize:j,tickMargin:k,fontSize:E,letterSpacing:A,getTicksConfig:C,events:_,axisType:O,axisId:z}=e,R=ZA(kn(kn({},C),{},{ticks:n}),E,A),$=Zi(C),F=cp(r),M=y8($.textAnchor)?$.textAnchor:DCe(p,m),U=MCe(p,m),K={};typeof i=="object"&&(K=i);var Z=kn(kn({},$),{},{fill:"none"},K),Y=R.map(ue=>kn({entry:ue},RCe(ue,y,v,w,b,p,j,m,k))),H=Y.map(ue=>{var{entry:xe,line:L}=ue;return x.createElement(Or,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(xe.value,"-").concat(xe.coordinate,"-").concat(xe.tickCoord)},i&&x.createElement("line",xc({},Z,L,{className:$t("recharts-cartesian-axis-tick-line",cd(i,"className"))})))}),X=Y.map((ue,xe)=>{var L,q,{entry:I,tick:D}=ue,V=kn(kn(kn(kn({verticalAnchor:U},$),{},{textAnchor:M,stroke:"none",fill:a},D),{},{index:xe,payload:I,visibleTicksCount:R.length,tickFormatter:l,padding:d},f),{},{angle:(L=(q=f?.angle)!==null&&q!==void 0?q:$.angle)!==null&&L!==void 0?L:0}),re=kn(kn({},V),F);return x.createElement(Or,xc({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(I.value,"-").concat(I.coordinate,"-").concat(I.tickCoord)},m0(_,I,xe)),r&&x.createElement(ICe,{option:r,tickProps:re,value:"".concat(typeof l=="function"?l(I.value,xe):I.value).concat(c||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(O,"-ticks")},x.createElement(LCe,{ticks:R,axisId:z,axisType:O}),X.length>0&&x.createElement(ra,{zIndex:nr.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(O,"-tick-labels"),ref:t},X)),H.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(O,"-tick-lines")},H))}),BCe=x.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:c,axisType:d,axisId:f}=e,p=ECe(e,ACe),[m,y]=x.useState(""),[v,w]=x.useState(""),b=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var k;return SCe({ticks:b.current,label:(k=e.labelRef)===null||k===void 0?void 0:k.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var j=x.useCallback(k=>{if(k){var E=k.getElementsByClassName("recharts-cartesian-axis-tick-value");b.current=E;var A=E[0];if(A){var C=window.getComputedStyle(A),_=C.fontSize,O=C.letterSpacing;(_!==m||O!==v)&&(y(_),w(O))}}},[m,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:x.createElement(ra,{zIndex:e.zIndex},x.createElement(Or,{className:$t("recharts-cartesian-axis",a)},x.createElement(PCe,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:Zi(e)}),x.createElement($Ce,{ref:j,axisType:d,events:p,fontSize:m,getTicksConfig:e,height:e.height,letterSpacing:v,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:c,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:f}),x.createElement(SNe,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(TNe,{label:e.label,labelRef:e.labelRef}),e.children)))}),XA=x.forwardRef((e,t)=>{var n=_r(e,Ts);return x.createElement(BCe,xc({},n,{ref:t}))});XA.displayName="CartesianAxis";var UCe=["x1","y1","x2","y2","key"],qCe=["offset"],FCe=["xAxisId","yAxisId"],HCe=["xAxisId","yAxisId"];function PL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Er(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){KCe(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 KCe(e,t,n){return(t=GCe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GCe(e){var t=VCe(e,"string");return typeof t=="symbol"?t:t+""}function VCe(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 Ql(){return Ql=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ql.apply(null,arguments)}function vv(e,t){if(e==null)return{};var n,r,i=QCe(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 QCe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var YCe=e=>{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:i,width:a,height:l,ry:c}=e;return x.createElement("rect",{x:r,y:i,ry:c,width:a,height:l,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function K8(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:c,y2:d,key:f}=n,p=vv(n,UCe),m=(i=Zi(p))!==null&&i!==void 0?i:{},{offset:y}=m,v=vv(m,qCe);r=x.createElement("line",Ql({},v,{x1:a,y1:l,x2:c,y2:d,fill:"none",key:f}))}return r}function WCe(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,c=vv(e,FCe),d=i.map((f,p)=>{var m=Er(Er({},c),{},{x1:t,y1:f,x2:t+n,y2:f,key:"line-".concat(p),index:p});return x.createElement(K8,{key:"line-".concat(p),option:r,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},d)}function ZCe(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,c=vv(e,HCe),d=i.map((f,p)=>{var m=Er(Er({},c),{},{x1:f,y1:t,x2:f,y2:t+n,key:"line-".concat(p),index:p});return x.createElement(K8,{option:r,lineItemProps:m,key:"line-".concat(p)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},d)}function XCe(e){var{horizontalFill:t,fillOpacity:n,x:r,y:i,width:a,height:l,horizontalPoints:c,horizontal:d=!0}=e;if(!d||!t||!t.length||c==null)return null;var f=c.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,b=w?i+l-m:v-m;if(b<=0)return null;var j=y%t.length;return x.createElement("rect",{key:"react-".concat(y),y:m,x:r,height:b,width:a,stroke:"none",fill:t[j],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function JCe(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:i,y:a,width:l,height:c,verticalPoints:d}=e;if(!t||!n||!n.length)return null;var f=d.map(m=>Math.round(m+i-i)).sort((m,y)=>m-y);i!==f[0]&&f.unshift(0);var p=f.map((m,y)=>{var v=f[y+1],w=v==null,b=w?i+l-m:v-m;if(b<=0)return null;var j=y%n.length;return x.createElement("rect",{key:"react-".concat(y),x:m,y:a,width:b,height:c,stroke:"none",fill:n[j],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var eAe=(e,t)=>{var{xAxis:n,width:r,height:i,offset:a}=e;return xU(ZA(Er(Er(Er({},Ts),n),{},{ticks:bU(n),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},tAe=(e,t)=>{var{yAxis:n,width:r,height:i,offset:a}=e;return xU(ZA(Er(Er(Er({},Ts),n),{},{ticks:bU(n),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},nAe={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:nr.grid};function G8(e){var t=KC(),n=GC(),r=CU(),i=Er(Er({},_r(e,nAe)),{},{x:De(e.x)?e.x:r.left,y:De(e.y)?e.y:r.top,width:De(e.width)?e.width:r.width,height:De(e.height)?e.height:r.height}),{xAxisId:a,yAxisId:l,x:c,y:d,width:f,height:p,syncWithTicks:m,horizontalValues:y,verticalValues:v}=i,w=Pr(),b=Ge($=>OI($,"xAxis",a,w)),j=Ge($=>OI($,"yAxis",l,w));if(!Va(f)||!Va(p)||!De(c)||!De(d))return null;var k=i.verticalCoordinatesGenerator||eAe,E=i.horizontalCoordinatesGenerator||tAe,{horizontalPoints:A,verticalPoints:C}=i;if((!A||!A.length)&&typeof E=="function"){var _=y&&y.length,O=E({yAxis:j?Er(Er({},j),{},{ticks:_?y:j.ticks}):void 0,width:t??f,height:n??p,offset:r},_?!0:m);$y(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(A=O)}if((!C||!C.length)&&typeof k=="function"){var z=v&&v.length,R=k({xAxis:b?Er(Er({},b),{},{ticks:z?v:b.ticks}):void 0,width:t??f,height:n??p,offset:r},z?!0:m);$y(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof R,"]")),Array.isArray(R)&&(C=R)}return x.createElement(ra,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(YCe,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(XCe,Ql({},i,{horizontalPoints:A})),x.createElement(JCe,Ql({},i,{verticalPoints:C})),x.createElement(WCe,Ql({},i,{offset:r,horizontalPoints:A,xAxis:b,yAxis:j})),x.createElement(ZCe,Ql({},i,{offset:r,verticalPoints:C,xAxis:b,yAxis:j}))))}G8.displayName="CartesianGrid";var rAe={},V8=Tr({name:"errorBars",initialState:rAe,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:Y2e,replaceErrorBar:W2e,removeErrorBar:Z2e}=V8.actions,iAe=V8.reducer,aAe=["children"];function sAe(e,t){if(e==null)return{};var n,r,i=oAe(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 oAe(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 lAe={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},cAe=x.createContext(lAe);function uAe(e){var{children:t}=e,n=sAe(e,aAe);return x.createElement(cAe.Provider,{value:n},t)}function JA(e,t){var n,r,i=Ge(f=>Fs(f,e)),a=Ge(f=>Hs(f,t)),l=(n=i?.allowDataOverflow)!==null&&n!==void 0?n:Qn.allowDataOverflow,c=(r=a?.allowDataOverflow)!==null&&r!==void 0?r:Yn.allowDataOverflow,d=l||c;return{needClip:d,needClipX:l,needClipY:c}}function Q8(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=WA(),{needClipX:a,needClipY:l,needClip:c}=JA(t,n);if(!c||!i)return null;var{x:d,y:f,width:p,height:m}=i;return x.createElement("clipPath",{id:"clipPath-".concat(r)},x.createElement("rect",{x:a?d:d-p/2,y:l?f:f-m/2,width:a?p:p*2,height:l?m:m*2}))}function dAe(e){var t=cp(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,l=Number(i),c=Number(a);return(Number.isNaN(l)||l<0)&&(l=n),(Number.isNaN(c)||c<0)&&(c=r),{r:l,strokeWidth:c}}return{r:n,strokeWidth:r}}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.xAxisId)!==null&&n!==void 0?n:$8}function Ja(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:$8}var Y8=(e,t,n)=>Zo(e,"xAxis",Xa(e,t),n),W8=(e,t,n)=>Wo(e,"xAxis",Xa(e,t),n),Z8=(e,t,n)=>Zo(e,"yAxis",Ja(e,t),n),X8=(e,t,n)=>Wo(e,"yAxis",Ja(e,t),n),fAe=le([qt,Y8,Z8,W8,X8],(e,t,n,r,i)=>Za(e,"xAxis")?dd(t,r,!1):dd(n,i,!1)),hAe=(e,t)=>t,J8=le([J0,hAe],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),e9=e=>{var t=qt(e),n=Za(t,"xAxis");return n?"yAxis":"xAxis"},pAe=(e,t)=>{var n=e9(e);return n==="yAxis"?Ja(e,t):Xa(e,t)},mAe=(e,t,n)=>lv(e,e9(e),pAe(e,t),n),gAe=le([J8,mAe],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=F0(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,l=a?.find(c=>c.key===i);if(l!=null)return l.map(c=>[c[0],c[1]])}}}),yAe=le([qt,Y8,Z8,W8,X8,gAe,VU,fAe,J8,z0e],(e,t,n,r,i,a,l,c,d,f)=>{var{chartData:p,dataStartIndex:m,dataEndIndex:y}=l;if(!(d==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||c==null)){var{data:v}=d,w;if(v&&v.length>0?w=v:w=p?.slice(m,y+1),w!=null)return IAe({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:m,areaSettings:d,stackedData:a,displayedData:w,chartBaseValue:f,bandSize:c})}}),vAe=["id"],xAe=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function nc(){return nc=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},nc.apply(null,arguments)}function t9(e,t){if(e==null)return{};var n,r,i=bAe(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 bAe(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 RL(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 qu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RL(Object(n),!0).forEach(function(r){wAe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wAe(e,t,n){return(t=SAe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SAe(e){var t=jAe(e,"string");return typeof t=="symbol"?t:t+""}function jAe(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 xv(e,t){return e&&e!=="none"?e:t}var NAe=e=>{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:l}=e;return[{inactive:l,dataKey:t,type:a,color:xv(r,i),value:C0(n,t),payload:e}]},kAe=x.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:l,hide:c,unit:d,tooltipType:f,id:p}=e,m={dataDefinedOnItem:n,getPosition:Oc,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:C0(l,t),hide:c,type:f,color:xv(r,a),unit:d,graphicalItemId:p}};return x.createElement(R8,{tooltipEntrySettings:m})});function CAe(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:l}=r,c=Zi(r);return x.createElement(Oke,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:l,baseProps:c,needClip:i,clipPathId:t})}function AAe(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var l,c,d={x:(l=a.x)!==null&&l!==void 0?l:0,y:(c=a.y)!==null&&c!==void 0?c:0,width:0,lowerWidth:0,upperWidth:0,height:0};return qu(qu({},d),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:d,fill:void 0})});return x.createElement(N8,{value:t?i:void 0},n)}function DL(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:l,type:c,stroke:d,connectNulls:f,isRange:p}=a,{id:m}=a,y=t9(a,vAe),v=Zi(y),w=Gr(y);return x.createElement(x.Fragment,null,t?.length>1&&x.createElement(Or,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},x.createElement(yh,nc({},w,{id:m,points:t,connectNulls:f,type:c,baseLine:n,layout:l,stroke:"none",className:"recharts-area-area"})),d!=="none"&&x.createElement(yh,nc({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:f,fill:"none",points:t})),d!=="none"&&p&&Array.isArray(n)&&x.createElement(yh,nc({},v,{className:"recharts-area-curve",layout:l,type:c,connectNulls:f,fill:"none",points:n}))),x.createElement(CAe,{points:t,props:y,clipPathId:i}))}function EAe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,c=(t=a[0])===null||t===void 0?void 0:t.y,d=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!St(c)||!St(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.x||0));return De(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.x||0),p)),De(p)?x.createElement("rect",{x:0,y:c<d?c:c-f,width:p+(l?parseInt("".concat(l),10):1),height:Math.floor(f)}):null}function OAe(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:l}=e,c=(t=a[0])===null||t===void 0?void 0:t.x,d=(n=a[a.length-1])===null||n===void 0?void 0:n.x;if(!St(c)||!St(d))return null;var f=r*Math.abs(c-d),p=Math.max(...a.map(m=>m.y||0));return De(i)?p=Math.max(i,p):i&&Array.isArray(i)&&i.length&&(p=Math.max(...i.map(m=>m.y||0),p)),De(p)?x.createElement("rect",{x:c<d?c:c-f,y:0,width:f,height:Math.floor(p+(l?parseInt("".concat(l),10):1))}):null}function zAe(e){var{alpha:t,layout:n,points:r,baseLine:i,strokeWidth:a}=e;return n==="vertical"?x.createElement(EAe,{alpha:t,points:r,baseLine:i,strokeWidth:a}):x.createElement(OAe,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function _Ae(e){var{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a}=e,{points:l,baseLine:c,isAnimationActive:d,animationBegin:f,animationDuration:p,animationEasing:m,onAnimationStart:y,onAnimationEnd:v}=r,w=x.useMemo(()=>({points:l,baseLine:c}),[l,c]),b=M0(w,"recharts-area-"),j=VC(),[k,E]=x.useState(!1),A=!k,C=x.useCallback(()=>{typeof v=="function"&&v(),E(!1)},[v]),_=x.useCallback(()=>{typeof y=="function"&&y(),E(!0)},[y]);if(j==null)return null;var O=i.current,z=a.current;return x.createElement(AAe,{showLabels:A,points:l},r.children,x.createElement(D0,{animationId:b,begin:f,duration:p,isActive:d,easing:m,onAnimationEnd:C,onAnimationStart:_,key:b},R=>{if(O){var $=O.length/l.length,F=R===1?l:l.map((U,K)=>{var Z=Math.floor(K*$);if(O[Z]){var Y=O[Z];return qu(qu({},U),{},{x:gn(Y.x,U.x,R),y:gn(Y.y,U.y,R)})}return U}),M;return De(c)?M=gn(z,c,R):yn(c)||xa(c)?M=gn(z,0,R):M=c.map((U,K)=>{var Z=Math.floor(K*$);if(Array.isArray(z)&&z[Z]){var Y=z[Z];return qu(qu({},U),{},{x:gn(Y.x,U.x,R),y:gn(Y.y,U.y,R)})}return U}),R>0&&(i.current=F,a.current=M),x.createElement(DL,{points:F,baseLine:M,needClip:t,clipPathId:n,props:r})}return R>0&&(i.current=l,a.current=c),x.createElement(Or,null,d&&x.createElement("defs",null,x.createElement("clipPath",{id:"animationClipPath-".concat(n)},x.createElement(zAe,{alpha:R,points:l,baseLine:c,layout:j,strokeWidth:r.strokeWidth}))),x.createElement(Or,{clipPath:"url(#animationClipPath-".concat(n,")")},x.createElement(DL,{points:l,baseLine:c,needClip:t,clipPathId:n,props:r})))}),x.createElement(C8,{label:r.label}))}function TAe(e){var{needClip:t,clipPathId:n,props:r}=e,i=x.useRef(null),a=x.useRef();return x.createElement(_Ae,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class PAe extends x.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:l,needClip:c,xAxisId:d,yAxisId:f,width:p,height:m,id:y,baseLine:v,zIndex:w}=this.props;if(t)return null;var b=$t("recharts-area",i),j=y,{r:k,strokeWidth:E}=dAe(n),A=z8(n),C=k*2+E,_=c?"url(#clipPath-".concat(A?"":"dots-").concat(j,")"):void 0;return x.createElement(ra,{zIndex:w},x.createElement(Or,{className:b},c&&x.createElement("defs",null,x.createElement(Q8,{clipPathId:j,xAxisId:d,yAxisId:f}),!A&&x.createElement("clipPath",{id:"clipPath-dots-".concat(j)},x.createElement("rect",{x:l-C/2,y:a-C/2,width:p+C,height:m+C}))),x.createElement(TAe,{needClip:c,clipPathId:j,props:this.props})),x.createElement(AL,{points:r,mainColor:xv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}),this.props.isRange&&Array.isArray(v)&&x.createElement(AL,{points:v,mainColor:xv(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:_}))}}var RAe={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:nr.area};function DAe(e){var t,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,connectNulls:l,dot:c,fill:d,fillOpacity:f,hide:p,isAnimationActive:m,legendType:y,stroke:v,xAxisId:w,yAxisId:b}=e,j=t9(e,xAe),k=zc(),E=r8(),{needClip:A}=JA(w,b),C=Pr(),{points:_,isRange:O,baseLine:z}=(t=Ge(K=>yAe(K,e.id,C)))!==null&&t!==void 0?t:{},R=WA();if(k!=="horizontal"&&k!=="vertical"||R==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var{height:$,width:F,x:M,y:U}=R;return!_||!_.length?null:x.createElement(PAe,nc({},j,{activeDot:n,animationBegin:r,animationDuration:i,animationEasing:a,baseLine:z,connectNulls:l,dot:c,fill:d,fillOpacity:f,height:$,hide:p,layout:k,isAnimationActive:m,isRange:O,legendType:y,needClip:A,points:_,stroke:v,width:F,left:M,top:U,xAxisId:w,yAxisId:b}))}var MAe=(e,t,n,r,i)=>{var a=n??t;if(De(a))return a;var l=e==="horizontal"?i:r,c=l.scale.domain();if(l.type==="number"){var d=Math.max(c[0],c[1]),f=Math.min(c[0],c[1]);return a==="dataMin"?f:a==="dataMax"||d<0?d:Math.max(Math.min(c[0],c[1]),0)}return a==="dataMin"?c[0]:a==="dataMax"?c[1]:c[0]};function IAe(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:l,xAxis:c,yAxis:d,displayedData:f,dataStartIndex:p,xAxisTicks:m,yAxisTicks:y,bandSize:v}=e,w=i&&i.length,b=MAe(a,l,n,c,d),j=a==="horizontal",k=!1,E=f.map((C,_)=>{var O,z,R,$;if(w)$=i[p+_];else{var F=Tn(C,r);Array.isArray(F)?($=F,k=!0):$=[b,F]}var M=(O=(z=$)===null||z===void 0?void 0:z[1])!==null&&O!==void 0?O:null,U=M==null||w&&!t&&Tn(C,r)==null;if(j){var K;return{x:wD({axis:c,ticks:m,bandSize:v,entry:C,index:_}),y:U?null:(K=d.scale.map(M))!==null&&K!==void 0?K:null,value:$,payload:C}}return{x:U?null:(R=c.scale.map(M))!==null&&R!==void 0?R:null,y:wD({axis:d,ticks:y,bandSize:v,entry:C,index:_}),value:$,payload:C}}),A;return w||k?A=E.map(C=>{var _,O=Array.isArray(C.value)?C.value[0]:null;if(j){var z;return{x:C.x,y:O!=null&&C.y!=null&&(z=d.scale.map(O))!==null&&z!==void 0?z:null,payload:C.payload}}return{x:O!=null&&(_=c.scale.map(O))!==null&&_!==void 0?_:null,y:C.y,payload:C.payload}}):A=j?d.scale.map(b):c.scale.map(b),{points:E,baseLine:A??0,isRange:k}}function LAe(e){var t=_r(e,RAe),n=Pr();return x.createElement(M8,{id:t.id,type:"area"},r=>x.createElement(x.Fragment,null,x.createElement(D8,{legendPayload:NAe(t)}),x.createElement(kAe,{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(L8,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:wU(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),x.createElement(DAe,nc({},t,{id:r}))))}var Fu=x.memo(LAe,_d);Fu.displayName="Area";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 eE(e){return x.createElement(uke,TN({shapeType:"rectangle",activeClassName:"recharts-active-bar",inActiveClassName:"recharts-inactive-bar"},e))}var $Ae=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(De(t))return t;var a=De(r)||yn(r);return a?t(r,i):(a||Ps(!1),n)}},BAe=(e,t,n)=>n,UAe=(e,t)=>t,Cp=le([J0,UAe],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),qAe=le([Cp],e=>e?.maxBarSize),FAe=(e,t,n,r)=>r,HAe=le([qt,J0,Xa,Ja,BAe],(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")),KAe=(e,t,n)=>{var r=qt(e),i=Xa(e,t),a=Ja(e,t);if(!(i==null||a==null))return r==="horizontal"?lv(e,"yAxis",a,n):lv(e,"xAxis",i,n)},GAe=(e,t)=>{var n=qt(e),r=Xa(e,t),i=Ja(e,t);if(!(r==null||i==null))return n==="horizontal"?EI(e,"xAxis",r):EI(e,"yAxis",i)},VAe=le([HAe,O0e,GAe],Yke),QAe=(e,t,n)=>{var r,i,a=Cp(e,t);if(a==null)return 0;var l=Xa(e,t),c=Ja(e,t);if(l==null||c==null)return 0;var d=qt(e),f=aq(e),{maxBarSize:p}=a,m=yn(p)?f:p,y,v;return d==="horizontal"?(y=Zo(e,"xAxis",l,n),v=Wo(e,"xAxis",l,n)):(y=Zo(e,"yAxis",c,n),v=Wo(e,"yAxis",c,n)),(r=(i=dd(y,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},n9=(e,t,n)=>{var r=qt(e),i=Xa(e,t),a=Ja(e,t);if(!(i==null||a==null)){var l,c;return r==="horizontal"?(l=Zo(e,"xAxis",i,n),c=Wo(e,"xAxis",i,n)):(l=Zo(e,"yAxis",a,n),c=Wo(e,"yAxis",a,n)),dd(l,c)}},YAe=le([VAe,aq,E0e,sq,QAe,n9,qAe],eCe),WAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Zo(e,"xAxis",r,n)},ZAe=(e,t,n)=>{var r=Ja(e,t);if(r!=null)return Zo(e,"yAxis",r,n)},XAe=(e,t,n)=>{var r=Xa(e,t);if(r!=null)return Wo(e,"xAxis",r,n)},JAe=(e,t,n)=>{var r=Ja(e,t);if(r!=null)return Wo(e,"yAxis",r,n)},eEe=le([YAe,Cp],nCe),tEe=le([KAe,Cp],tCe),nEe=le([ar,qC,WAe,ZAe,XAe,JAe,eEe,qt,VU,n9,tEe,Cp,FAe],(e,t,n,r,i,a,l,c,d,f,p,m,y)=>{var{chartData:v,dataStartIndex:w,dataEndIndex:b}=d;if(!(m==null||l==null||t==null||c!=="horizontal"&&c!=="vertical"||n==null||r==null||i==null||a==null||f==null)){var{data:j}=m,k;if(j!=null&&j.length>0?k=j:k=v?.slice(w,b+1),k!=null)return zEe({layout:c,barSettings:m,pos:l,parentViewBox:t,bandSize:f,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:p,displayedData:k,offset:e,cells:y,dataStartIndex:w})}}),rEe=["index"];function PN(){return PN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},PN.apply(null,arguments)}function iEe(e,t){if(e==null)return{};var n,r,i=aEe(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 aEe(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 r9=x.createContext(void 0),sEe=e=>{var t=x.useContext(r9);if(t!=null)return t.stackId;if(e!=null)return wU(e)},oEe=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),lEe=e=>{var t=x.useContext(r9);if(t!=null){var{stackId:n}=t;return"url(#".concat(oEe(n,e),")")}},i9=e=>{var{index:t}=e,n=iEe(e,rEe),r=lEe(t);return x.createElement(Or,PN({className:"recharts-bar-stack-layer",clipPath:r},n))},cEe=["onMouseEnter","onMouseLeave","onClick"],uEe=["value","background","tooltipPosition"],dEe=["id"],fEe=["onMouseEnter","onClick","onMouseLeave"];function Xo(){return Xo=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},Xo.apply(null,arguments)}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 Ur(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){hEe(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 hEe(e,t,n){return(t=pEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pEe(e){var t=mEe(e,"string");return typeof t=="symbol"?t:t+""}function mEe(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 bv(e,t){if(e==null)return{};var n,r,i=gEe(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 gEe(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 yEe=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:C0(n,t),payload:e}]},vEe=x.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:c,tooltipType:d,id:f}=e,p={dataDefinedOnItem:void 0,getPosition:Oc,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:C0(a,t),hide:l,type:d,color:i,unit:c,graphicalItemId:f}};return x.createElement(R8,{tooltipEntrySettings:p})});function xEe(e){var t=Ge(vc),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:c,onClick:d}=a,f=bv(a,cEe),p=_8(l,r,a.id),m=T8(c),y=P8(d,r,a.id);if(!i||n==null)return null;var v=cp(i);return x.createElement(ra,{zIndex:rCe(i,nr.barBackground)},n.map((w,b)=>{var{value:j,background:k,tooltipPosition:E}=w,A=bv(w,uEe);if(!k)return null;var C=p(w,b),_=m(w,b),O=y(w,b),z=Ur(Ur(Ur(Ur(Ur({option:i,isActive:String(b)===t},A),{},{fill:"#eee"},k),v),m0(f,w,b)),{},{onMouseEnter:C,onMouseLeave:_,onClick:O,dataKey:r,index:b,className:"recharts-bar-background-rectangle"});return x.createElement(eE,Xo({key:"background-bar-".concat(b)},z))}))}function bEe(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 Ur(Ur({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return x.createElement(N8,{value:t?i:void 0},n)}function wEe(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,c=Ge(vc),d=Ge(e8),f=n&&String(i.originalDataIndex)===c&&(d==null||l===d),[p,m]=x.useState(!1),[y,v]=x.useState(!1);x.useEffect(()=>{var A;return f?(m(!0),A=requestAnimationFrame(()=>{v(!0)})):v(!1),()=>{cancelAnimationFrame(A)}},[f]);var w=x.useCallback(()=>{f||m(!1)},[f]),b=f&&y,j=f||p,k;f?n===!0?k=t:k=n:k=t;var E=x.createElement(eE,Xo({},r,{name:String(r.name)},i,{isActive:b,option:k,index:a,dataKey:l,onTransitionEnd:w}));return j?x.createElement(ra,{zIndex:nr.activeBar},x.createElement(i9,{index:i.originalDataIndex},E)):E}function SEe(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return x.createElement(eE,Xo({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function jEe(e){var t,{data:n,props:r}=e,i=(t=Zi(r))!==null&&t!==void 0?t:{},{id:a}=i,l=bv(i,dEe),{shape:c,dataKey:d,activeBar:f}=r,{onMouseEnter:p,onClick:m,onMouseLeave:y}=r,v=bv(r,fEe),w=_8(p,d,a),b=T8(y),j=P8(m,d,a);return n?x.createElement(x.Fragment,null,n.map((k,E)=>x.createElement(i9,Xo({index:k.originalDataIndex,key:"rectangle-".concat(k?.x,"-").concat(k?.y,"-").concat(k?.value,"-").concat(E),className:"recharts-bar-rectangle"},m0(v,k,E),{onMouseEnter:w(k,E),onMouseLeave:b(k,E),onClick:j(k,E)}),f?x.createElement(wEe,{shape:c,activeBar:f,baseProps:l,entry:k,index:E,dataKey:d}):x.createElement(SEe,{shape:c,baseProps:l,entry:k,index:E,dataKey:d})))):null}function NEe(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:c,animationEasing:d,onAnimationEnd:f,onAnimationStart:p}=t,m=n.current,y=M0(t,"recharts-bar-"),[v,w]=x.useState(!1),b=!v,j=x.useCallback(()=>{typeof f=="function"&&f(),w(!1)},[f]),k=x.useCallback(()=>{typeof p=="function"&&p(),w(!0)},[p]);return x.createElement(bEe,{showLabels:b,rects:r},x.createElement(D0,{animationId:y,begin:l,duration:c,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:y},E=>{var A=E===1?r:r?.map((C,_)=>{var O=m&&m[_];if(O)return Ur(Ur({},C),{},{x:gn(O.x,C.x,E),y:gn(O.y,C.y,E),width:gn(O.width,C.width,E),height:gn(O.height,C.height,E)});if(i==="horizontal"){var z=gn(0,C.height,E),R=gn(C.stackedBarStart,C.y,E);return Ur(Ur({},C),{},{y:R,height:z})}var $=gn(0,C.width,E),F=gn(C.stackedBarStart,C.x,E);return Ur(Ur({},C),{},{width:$,x:F})});return E>0&&(n.current=A??null),A==null?null:x.createElement(Or,null,x.createElement(jEe,{props:t,data:A}))}),x.createElement(C8,{label:t.label}),t.children)}function kEe(e){var t=x.useRef(null);return x.createElement(NEe,{previousRectanglesRef:t,props:e})}var a9=0,CEe=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:Tn(e,t)}};class AEe extends x.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:c,background:d,id:f}=this.props;if(t||n==null)return null;var p=$t("recharts-bar",i),m=f;return x.createElement(Or,{className:p,id:f},c&&x.createElement("defs",null,x.createElement(Q8,{clipPathId:m,xAxisId:a,yAxisId:l})),x.createElement(Or,{className:"recharts-bar-rectangles",clipPath:c?"url(#clipPath-".concat(m,")"):void 0},x.createElement(xEe,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),x.createElement(kEe,this.props)))}}var EEe={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:a9,xAxisId:0,yAxisId:0,zIndex:nr.bar};function OEe(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p}=e,{needClip:m}=JA(t,n),y=zc(),v=Pr(),w=KNe(e.children,hv),b=Ge(E=>nEe(E,e.id,v,w));if(y!=="vertical"&&y!=="horizontal")return null;var j,k=b?.[0];return k==null||k.height==null||k.width==null?j=0:j=y==="vertical"?k.height/2:k.width/2,x.createElement(uAe,{xAxisId:t,yAxisId:n,data:b,dataPointFormatter:CEe,errorBarOffset:j},x.createElement(AEe,Xo({},e,{layout:y,needClip:m,data:b,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:c,animationDuration:d,animationEasing:f,isAnimationActive:p})))}function zEe(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r,hasCustomShape:i},pos:a,bandSize:l,xAxis:c,yAxis:d,xAxisTicks:f,yAxisTicks:p,stackedData:m,displayedData:y,offset:v,cells:w,parentViewBox:b,dataStartIndex:j}=e,k=t==="horizontal"?d:c,E=m?k.scale.domain():null,A=hge({numericAxis:k}),C=k.scale.map(A);return y.map((_,O)=>{var z,R,$,F,M,U;if(m){var K=m[O+j];if(K==null)return null;z=lge(K,E)}else z=Tn(_,n),Array.isArray(z)||(z=[A,z]);var Z=$Ae(r,a9)(z[1],O);if(t==="horizontal"){var Y,H=d.scale.map(z[0]),X=d.scale.map(z[1]);if(H==null||X==null)return null;R=SD({axis:c,ticks:f,bandSize:l,offset:a.offset,entry:_,index:O}),$=(Y=X??H)!==null&&Y!==void 0?Y:void 0,F=a.size;var ue=H-X;if(M=xa(ue)?0:ue,U={x:R,y:v.top,width:F,height:v.height},Math.abs(Z)>0&&Math.abs(M)<Math.abs(Z)){var xe=ai(M||Z)*(Math.abs(Z)-Math.abs(M));$-=xe,M+=xe}}else{var L=c.scale.map(z[0]),q=c.scale.map(z[1]);if(L==null||q==null)return null;if(R=L,$=SD({axis:d,ticks:p,bandSize:l,offset:a.offset,entry:_,index:O}),F=q-L,M=a.size,U={x:v.left,y:$,width:v.width,height:M},Math.abs(Z)>0&&Math.abs(F)<Math.abs(Z)){var I=ai(F||Z)*(Math.abs(Z)-Math.abs(F));F+=I}}if(R==null||$==null||F==null||M==null||!i&&(F===0||M===0))return null;var D=Ur(Ur({},_),{},{stackedBarStart:C,x:R,y:$,width:F,height:M,value:m?z:z[1],payload:_,background:U,tooltipPosition:{x:R+F/2,y:$+M/2},parentViewBox:b,originalDataIndex:O},w&&w[O]&&w[O].props);return D}).filter(Boolean)}function _Ee(e){var t=_r(e,EEe),n=sEe(t.stackId),r=Pr();return x.createElement(M8,{id:t.id,type:"bar"},i=>x.createElement(x.Fragment,null,x.createElement(D8,{legendPayload:yEe(t)}),x.createElement(vEe,{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(L8,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r,hasCustomShape:t.shape!=null}),x.createElement(ra,{zIndex:t.zIndex},x.createElement(OEe,Xo({},t,{id:i})))))}var RN=x.memo(_Ee,_d);RN.displayName="Bar";var TEe=["domain","range"],PEe=["domain","range"];function IL(e,t){if(e==null)return{};var n,r,i=REe(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 REe(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 LL(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 s9(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=IL(e,TEe),{domain:a,range:l}=t,c=IL(t,PEe);return!LL(n,a)||!LL(r,l)?!1:_d(i,c)}var DEe=["type"],MEe=["dangerouslySetInnerHTML","ticks","scale"],IEe=["id","scale"];function DN(){return DN=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},DN.apply(null,arguments)}function $L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function BL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$L(Object(n),!0).forEach(function(r){LEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$L(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LEe(e,t,n){return(t=$Ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Ee(e){var t=BEe(e,"string");return typeof t=="symbol"?t:t+""}function BEe(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 MN(e,t){if(e==null)return{};var n,r,i=UEe(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 UEe(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 qEe(e){var t=ln(),n=x.useRef(null),r=VC(),{type:i}=e,a=MN(e,DEe),l=B0(r,"xAxis",i),c=x.useMemo(()=>{if(l!=null)return BL(BL({},a),{},{type:l})},[a,l]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Rke(c)):n.current!==c&&t(Dke({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t(Mke(n.current)),n.current=null)},[t]),null}var FEe=e=>{var{xAxisId:t,className:n}=e,r=Ge(qC),i=Pr(),a="xAxis",l=Ge(k=>TF(k,a,t,i)),c=Ge(k=>OF(k,t)),d=Ge(k=>dSe(k,t)),f=Ge(k=>Zq(k,t));if(c==null||d==null||f==null)return null;var{dangerouslySetInnerHTML:p,ticks:m,scale:y}=e,v=MN(e,MEe),{id:w,scale:b}=f,j=MN(f,IEe);return x.createElement(XA,DN({},v,j,{x:d.x,y:d.y,width:c.width,height:c.height,className:$t("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a,axisId:t}))},HEe={allowDataOverflow:Qn.allowDataOverflow,allowDecimals:Qn.allowDecimals,allowDuplicatedCategory:Qn.allowDuplicatedCategory,angle:Qn.angle,axisLine:Ts.axisLine,height:Qn.height,hide:!1,includeHidden:Qn.includeHidden,interval:Qn.interval,label:!1,minTickGap:Qn.minTickGap,mirror:Qn.mirror,orientation:Qn.orientation,padding:Qn.padding,reversed:Qn.reversed,scale:Qn.scale,tick:Qn.tick,tickCount:Qn.tickCount,tickLine:Ts.tickLine,tickSize:Ts.tickSize,type:Qn.type,niceTicks:Qn.niceTicks,xAxisId:0},KEe=e=>{var t=_r(e,HEe);return x.createElement(x.Fragment,null,x.createElement(qEe,{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(FEe,t))},Wh=x.memo(KEe,s9);Wh.displayName="XAxis";var GEe=["type"],VEe=["dangerouslySetInnerHTML","ticks","scale"],QEe=["id","scale"];function IN(){return IN=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},IN.apply(null,arguments)}function UL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function qL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UL(Object(n),!0).forEach(function(r){YEe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YEe(e,t,n){return(t=WEe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WEe(e){var t=ZEe(e,"string");return typeof t=="symbol"?t:t+""}function ZEe(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 LN(e,t){if(e==null)return{};var n,r,i=XEe(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 XEe(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 JEe(e){var t=ln(),n=x.useRef(null),r=VC(),{type:i}=e,a=LN(e,GEe),l=B0(r,"yAxis",i),c=x.useMemo(()=>{if(l!=null)return qL(qL({},a),{},{type:l})},[l,a]);return x.useLayoutEffect(()=>{c!=null&&(n.current===null?t(Ike(c)):n.current!==c&&t(Lke({prev:n.current,next:c})),n.current=c)},[c,t]),x.useLayoutEffect(()=>()=>{n.current&&(t($ke(n.current)),n.current=null)},[t]),null}function eOe(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=x.useRef(null),l=x.useRef(null),c=Ge(qC),d=Pr(),f=ln(),p="yAxis",m=Ge(O=>zF(O,t)),y=Ge(O=>hSe(O,t)),v=Ge(O=>TF(O,p,t,d)),w=Ge(O=>Xq(O,t));if(x.useLayoutEffect(()=>{if(!(r!=="auto"||!m||YA(i)||x.isValidElement(i)||w==null)){var O=a.current;if(O){var z=O.getCalculatedWidth();Math.round(m.width)!==Math.round(z)&&f(Bke({id:t,width:z}))}}},[v,m,f,i,t,r,w]),m==null||y==null||w==null)return null;var{dangerouslySetInnerHTML:b,ticks:j,scale:k}=e,E=LN(e,VEe),{id:A,scale:C}=w,_=LN(w,QEe);return x.createElement(XA,IN({},E,_,{ref:a,labelRef:l,x:y.x,y:y.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:$t("recharts-".concat(p," ").concat(p),n),viewBox:c,ticks:v,axisType:p,axisId:t}))}var tOe={allowDataOverflow:Yn.allowDataOverflow,allowDecimals:Yn.allowDecimals,allowDuplicatedCategory:Yn.allowDuplicatedCategory,angle:Yn.angle,axisLine:Ts.axisLine,hide:!1,includeHidden:Yn.includeHidden,interval:Yn.interval,label:!1,minTickGap:Yn.minTickGap,mirror:Yn.mirror,orientation:Yn.orientation,padding:Yn.padding,reversed:Yn.reversed,scale:Yn.scale,tick:Yn.tick,tickCount:Yn.tickCount,tickLine:Ts.tickLine,tickSize:Ts.tickSize,type:Yn.type,niceTicks:Yn.niceTicks,width:Yn.width,yAxisId:0},nOe=e=>{var t=_r(e,tOe);return x.createElement(x.Fragment,null,x.createElement(JEe,{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(eOe,t))},Zh=x.memo(nOe,s9);Zh.displayName="YAxis";var rOe=(e,t)=>t,tE=le([rOe,qt,hq,or,WF,Ks,Dje,ar],qje);function iOe(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function nE(e){var t=e.currentTarget.getBoundingClientRect(),n,r;if(iOe(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=(c,d)=>({relativeX:Math.round((c-t.left)/n),relativeY:Math.round((d-t.top)/r)});return"touches"in e?Array.from(e.touches).map(c=>l(c.clientX,c.clientY)):l(e.clientX,e.clientY)}var o9=Ai("mouseClick"),l9=fp();l9.startListening({actionCreator:o9,effect:(e,t)=>{var n=e.payload,r=tE(t.getState(),nE(n));r?.activeIndex!=null&&t.dispatch(OSe({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var $N=Ai("mouseMove"),c9=fp(),Ou=null,_l=null,Lj=null;c9.startListening({actionCreator:$N,effect:(e,t)=>{var n=e.payload,r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a?.includes("mousemove");Ou!==null&&(cancelAnimationFrame(Ou),Ou=null),_l!==null&&(typeof i!="number"||!l)&&(clearTimeout(_l),_l=null),Lj=nE(n);var c=()=>{var d=t.getState(),f=Np(d,d.tooltip.settings.shared);if(!Lj){Ou=null,_l=null;return}if(f==="axis"){var p=tE(d,Lj);p?.activeIndex!=null?t.dispatch(BF({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch($F())}Ou=null,_l=null};if(!l){c();return}i==="raf"?Ou=requestAnimationFrame(c):typeof i=="number"&&_l===null&&(_l=setTimeout(c,i))}});function aOe(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 FL={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},u9=Tr({name:"rootProps",initialState:FL,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:FL.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}}}),sOe=u9.reducer,{updateOptions:oOe}=u9.actions,lOe=null,cOe={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)},d9=Tr({name:"polarOptions",initialState:lOe,reducers:cOe}),{updatePolarOptions:X2e}=d9.actions,uOe=d9.reducer,f9=Ai("keyDown"),h9=Ai("focus"),p9=Ai("blur"),rx=fp(),zu=null,Tl=null,Ng=null;rx.startListening({actionCreator:f9,effect:(e,t)=>{Ng=e.payload,zu!==null&&(cancelAnimationFrame(zu),zu=null);var n=t.getState(),{throttleDelay:r,throttledEvents:i}=n.eventSettings,a=i==="all"||i.includes("keydown");Tl!==null&&(typeof r!="number"||!a)&&(clearTimeout(Tl),Tl=null);var l=()=>{try{var c=t.getState(),d=c.rootProps.accessibilityLayer!==!1;if(!d)return;var{keyboardInteraction:f}=c.tooltip,p=Ng;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var m=vh(f,yc(c),yd(c),vd(c)),y=m==null?-1:Number(m),v=!Number.isFinite(y)||y<0,w=Ks(c),b=yc(c),j=Np(c,c.tooltip.settings.shared);if(p==="Enter"){if(v)return;var k=dv(c,j,"hover",String(f.index));t.dispatch(uv({active:!f.active,activeIndex:f.index,activeCoordinate:k}));return}var E=vSe(c),A=E==="left-to-right"?1:-1,C=p==="ArrowRight"?1:-1,_;if(v){var O=yd(c),z=vd(c),R=C*A,$=Z=>({active:!1,index:String(Z),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(_=-1,R>0){for(var F=0;F<b.length;F++)if(vh($(F),b,O,z)!=null){_=F;break}}else for(var M=b.length-1;M>=0;M--)if(vh($(M),b,O,z)!=null){_=M;break}if(_<0)return}else{_=y+C*A;var U=w?.length||b.length;if(U===0||_>=U||_<0)return}var K=dv(c,j,"hover",String(_));t.dispatch(uv({active:!0,activeIndex:_.toString(),activeCoordinate:K}))}finally{zu=null,Tl=null}};if(!a){l();return}r==="raf"?zu=requestAnimationFrame(l):typeof r=="number"&&Tl===null&&(l(),Ng=null,Tl=setTimeout(()=>{Ng?l():(Tl=null,zu=null)},r))}});rx.startListening({actionCreator:h9,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=Np(n,n.tooltip.settings.shared),c=dv(n,l,"hover",String(a));t.dispatch(uv({active:!0,activeIndex:a,activeCoordinate:c}))}}}});rx.startListening({actionCreator:p9,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;i.active&&t.dispatch(uv({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function m9(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 Bi=Ai("externalEvent"),g9=fp(),kg=new Map,eh=new Map,$j=new Map;g9.startListening({actionCreator:Bi,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){var i=r.type,a=m9(r);$j.set(i,{handler:n,reactEvent:a});var l=kg.get(i);l!==void 0&&(cancelAnimationFrame(l),kg.delete(i));var c=t.getState(),{throttleDelay:d,throttledEvents:f}=c.eventSettings,p=f,m=p==="all"||p?.includes(i),y=eh.get(i);y!==void 0&&(typeof d!="number"||!m)&&(clearTimeout(y),eh.delete(i));var v=()=>{var j=$j.get(i);try{if(!j)return;var{handler:k,reactEvent:E}=j,A=t.getState(),C={activeCoordinate:bje(A),activeDataKey:e8(A),activeIndex:vc(A),activeLabel:JF(A),activeTooltipIndex:vc(A),isTooltipActive:wje(A)};k&&k(C,E)}finally{kg.delete(i),eh.delete(i),$j.delete(i)}};if(!m){v();return}if(d==="raf"){var w=requestAnimationFrame(v);kg.set(i,w)}else if(typeof d=="number"){if(!eh.has(i)){v();var b=setTimeout(v,d);eh.set(i,b)}}else v()}}});var dOe=le([$d],e=>e.tooltipItemPayloads),fOe=le([dOe,(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)}}}),y9=Ai("touchMove"),v9=fp(),Pl=null,ko=null,HL=null,th=null;v9.startListening({actionCreator:y9,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){th=m9(n);var r=t.getState(),{throttleDelay:i,throttledEvents:a}=r.eventSettings,l=a==="all"||a.includes("touchmove");Pl!==null&&(cancelAnimationFrame(Pl),Pl=null),ko!==null&&(typeof i!="number"||!l)&&(clearTimeout(ko),ko=null),HL=Array.from(n.touches).map(d=>nE({clientX:d.clientX,clientY:d.clientY,currentTarget:n.currentTarget}));var c=()=>{if(th!=null){var d=t.getState(),f=Np(d,d.tooltip.settings.shared);if(f==="axis"){var p,m=(p=HL)===null||p===void 0?void 0:p[0];if(m==null){Pl=null,ko=null;return}var y=tE(d,m);y?.activeIndex!=null&&t.dispatch(BF({activeIndex:y.activeIndex,activeDataKey:void 0,activeCoordinate:y.activeCoordinate}))}else if(f==="item"){var v,w=th.touches[0];if(document.elementFromPoint==null||w==null)return;var b=document.elementFromPoint(w.clientX,w.clientY);if(!b||!b.getAttribute)return;var j=b.getAttribute(bge),k=(v=b.getAttribute(wge))!==null&&v!==void 0?v:void 0,E=Pc(d).find(_=>_.id===k);if(j==null||E==null||k==null)return;var{dataKey:A}=E,C=fOe(d,j,k);t.dispatch(LF({activeDataKey:A,activeIndex:j,activeCoordinate:C,activeGraphicalItemId:k}))}Pl=null,ko=null}};if(!l){c();return}i==="raf"?Pl=requestAnimationFrame(c):typeof i=="number"&&ko===null&&(c(),th=null,ko=setTimeout(()=>{th?c():(ko=null,Pl=null)},i))}}});var x9={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},b9=Tr({name:"eventSettings",initialState:x9,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),{setEventSettings:hOe}=b9.actions,pOe=b9.reducer,mOe=H6({brush:aCe,cartesianAxis:Uke,chartData:v1e,errorBars:iAe,eventSettings:pOe,graphicalItems:xke,layout:rge,legend:pye,options:h1e,polarAxis:BNe,polarOptions:uOe,referenceElements:cCe,renderedTicks:CCe,rootProps:sOe,tooltip:zSe,zIndex:t1e}),gOe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Eme({reducer:mOe,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([l9.middleware,c9.middleware,rx.middleware,g9.middleware,v9.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(aU({type:"raf"}))},devTools:{serialize:{replacer:aOe},name:"recharts-".concat(n)}})};function yOe(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Pr(),a=x.useRef(null);if(i)return n;a.current==null&&(a.current=gOe(t,r));var l=DC;return x.createElement(Tye,{context:l,store:a.current},n)}function vOe(e){var{layout:t,margin:n}=e,r=ln(),i=Pr();return x.useEffect(()=>{i||(r(ege(t)),r(Jme(n)))},[r,i,t,n]),null}var xOe=x.memo(vOe,_d);function bOe(e){var t=ln();return x.useEffect(()=>{t(oOe(e))},[t,e]),null}var wOe=e=>{var t=ln();return x.useEffect(()=>{t(hOe(e))},[t,e]),null},SOe=x.memo(wOe,_d);function KL(e){var{zIndex:t,isPanorama:n}=e,r=x.useRef(null),i=ln();return x.useLayoutEffect(()=>(r.current&&i(Jje({zIndex:t,element:r.current,isPanorama:n})),()=>{i(e1e({zIndex:t,isPanorama:n}))}),[i,t,n]),x.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(t)})}function GL(e){var{children:t,isPanorama:n}=e,r=Ge(Hje);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(KL,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>x.createElement(KL,{key:l,zIndex:l,isPanorama:n})))}var jOe=["children"];function NOe(e,t){if(e==null)return{};var n,r,i=kOe(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 kOe(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 wv(){return wv=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},wv.apply(null,arguments)}var COe={width:"100%",height:"100%",display:"block"},AOe=x.forwardRef((e,t)=>{var n=KC(),r=GC(),i=IU();if(!Va(n)||!Va(r))return null;var{children:a,otherAttributes:l,title:c,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(kC,wv({},l,{title:c,desc:d,role:p,tabIndex:f,width:n,height:r,style:COe,ref:t}),a)}),EOe=e=>{var{children:t}=e,n=Ge(z0);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return x.createElement(kC,{width:r,height:i,x:l,y:a},t)},VL=x.forwardRef((e,t)=>{var{children:n}=e,r=NOe(e,jOe),i=Pr();return i?x.createElement(EOe,null,x.createElement(GL,{isPanorama:!0},n)):x.createElement(AOe,wv({ref:t},r),x.createElement(GL,{isPanorama:!1},n))});function OOe(){var e=ln(),[t,n]=x.useState(null),r=Ge(xge);return x.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;St(a)&&a!==r&&e(nge(a))}},[t,e,r]),n}function QL(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 zOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QL(Object(n),!0).forEach(function(r){_Oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _Oe(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=POe(e,"string");return typeof t=="symbol"?t:t+""}function POe(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 Ko(){return Ko=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},Ko.apply(null,arguments)}var ROe=()=>(A1e(),null);function Sv(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var DOe=x.forwardRef((e,t)=>{var n,r,i=x.useRef(null),[a,l]=x.useState({containerWidth:Sv((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Sv((r=e.style)===null||r===void 0?void 0:r.height)}),c=x.useCallback((f,p)=>{l(m=>{var y=Math.round(f),v=Math.round(p);return m.containerWidth===y&&m.containerHeight===v?m:{containerWidth:y,containerHeight:v}})},[]),d=x.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var{width:p,height:m}=f.getBoundingClientRect();c(p,m);var y=w=>{var b=w[0];if(b!=null){var{width:j,height:k}=b.contentRect;c(j,k)}},v=new ResizeObserver(y);v.observe(f),i.current=v}},[t,c]);return x.useEffect(()=>()=>{var f=i.current;f?.disconnect()},[c]),x.createElement(x.Fragment,null,x.createElement(pp,{width:a.containerWidth,height:a.containerHeight}),x.createElement("div",Ko({ref:d},e)))}),MOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=x.useState({containerWidth:Sv(n),containerHeight:Sv(r)}),l=x.useCallback((d,f)=>{a(p=>{var m=Math.round(d),y=Math.round(f);return p.containerWidth===m&&p.containerHeight===y?p:{containerWidth:m,containerHeight:y}})},[]),c=x.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:f,height:p}=d.getBoundingClientRect();l(f,p)}},[t,l]);return x.createElement(x.Fragment,null,x.createElement(pp,{width:i.containerWidth,height:i.containerHeight}),x.createElement("div",Ko({ref:c},e)))}),IOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return x.createElement(x.Fragment,null,x.createElement(pp,{width:n,height:r}),x.createElement("div",Ko({ref:t},e)))}),LOe=x.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?x.createElement(MOe,Ko({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?x.createElement(IOe,Ko({},e,{width:n,height:r,ref:t})):x.createElement(x.Fragment,null,x.createElement(pp,{width:n,height:r}),x.createElement("div",Ko({ref:t},e)))});function $Oe(e){return e?DOe:LOe}var BOe=x.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:c,onMouseDown:d,onMouseEnter:f,onMouseLeave:p,onMouseMove:m,onMouseUp:y,onTouchEnd:v,onTouchMove:w,onTouchStart:b,style:j,width:k,responsive:E,dispatchTouchEvents:A=!0}=e,C=x.useRef(null),_=ln(),[O,z]=x.useState(null),[R,$]=x.useState(null),F=OOe(),M=FC(),U=M?.width>0?M.width:k,K=M?.height>0?M.height:i,Z=x.useCallback(he=>{F(he),typeof t=="function"&&t(he),z(he),$(he),he!=null&&(C.current=he)},[F,t,z,$]),Y=x.useCallback(he=>{_(o9(he)),_(Bi({handler:a,reactEvent:he}))},[_,a]),H=x.useCallback(he=>{_($N(he)),_(Bi({handler:f,reactEvent:he}))},[_,f]),X=x.useCallback(he=>{_($F()),_(Bi({handler:p,reactEvent:he}))},[_,p]),ue=x.useCallback(he=>{_($N(he)),_(Bi({handler:m,reactEvent:he}))},[_,m]),xe=x.useCallback(()=>{_(h9())},[_]),L=x.useCallback(()=>{_(p9())},[_]),q=x.useCallback(he=>{_(f9(he.key))},[_]),I=x.useCallback(he=>{_(Bi({handler:l,reactEvent:he}))},[_,l]),D=x.useCallback(he=>{_(Bi({handler:c,reactEvent:he}))},[_,c]),V=x.useCallback(he=>{_(Bi({handler:d,reactEvent:he}))},[_,d]),re=x.useCallback(he=>{_(Bi({handler:y,reactEvent:he}))},[_,y]),ee=x.useCallback(he=>{_(Bi({handler:b,reactEvent:he}))},[_,b]),Ee=x.useCallback(he=>{A&&_(y9(he)),_(Bi({handler:w,reactEvent:he}))},[_,A,w]),Te=x.useCallback(he=>{_(Bi({handler:v,reactEvent:he}))},[_,v]),ne=$Oe(E);return x.createElement(l8.Provider,{value:O},x.createElement(a6.Provider,{value:R},x.createElement(ne,{width:U??j?.width,height:K??j?.height,className:$t("recharts-wrapper",r),style:zOe({position:"relative",cursor:"default",width:U,height:K},j),onClick:Y,onContextMenu:I,onDoubleClick:D,onFocus:xe,onBlur:L,onKeyDown:q,onMouseDown:V,onMouseEnter:H,onMouseLeave:X,onMouseMove:ue,onMouseUp:re,onTouchEnd:Te,onTouchMove:Ee,onTouchStart:ee,ref:Z},x.createElement(ROe,null),n)))}),UOe=["width","height","responsive","children","className","style","compact","title","desc"];function qOe(e,t){if(e==null)return{};var n,r,i=FOe(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 FOe(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 HOe=x.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:c,compact:d,title:f,desc:p}=e,m=qOe(e,UOe),y=Zi(m);return d?x.createElement(x.Fragment,null,x.createElement(pp,{width:n,height:r}),x.createElement(VL,{otherAttributes:y,title:f,desc:p},a)):x.createElement(BOe,{className:l,style:c,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(VL,{otherAttributes:y,title:f,desc:p,ref:t},x.createElement(dCe,null,a)))});function BN(){return BN=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},BN.apply(null,arguments)}function YL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function KOe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YL(Object(n),!0).forEach(function(r){GOe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function GOe(e,t,n){return(t=VOe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VOe(e){var t=QOe(e,"string");return typeof t=="symbol"?t:t+""}function QOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var YOe={top:5,right:5,bottom:5,left:5},WOe=KOe({accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:YOe,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},x9),w9=x.forwardRef(function(t,n){var r,i=_r(t.categoricalChartProps,WOe),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,categoricalChartProps:f}=t,p={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:c,tooltipPayloadSearcher:d,eventEmitter:void 0};return x.createElement(yOe,{preloadedState:{options:p},reduxStoreName:(r=f.id)!==null&&r!==void 0?r:a},x.createElement(iCe,{chartData:f.data}),x.createElement(xOe,{layout:i.layout,margin:i.margin}),x.createElement(SOe,{throttleDelay:i.throttleDelay,throttledEvents:i.throttledEvents}),x.createElement(bOe,{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(HOe,BN({},i,{ref:n})))}),ZOe=["axis","item"],XOe=x.forwardRef((e,t)=>x.createElement(w9,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ZOe,tooltipPayloadSearcher:c8,categoricalChartProps:e,ref:t})),JOe=["axis"],UN=x.forwardRef((e,t)=>x.createElement(w9,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:JOe,tooltipPayloadSearcher:c8,categoricalChartProps:e,ref:t}));const ed={contentStyle:{backgroundColor:"#18181b",border:"1px solid #3f3f46",borderRadius:8,fontSize:12},labelStyle:{color:"#e4e4e7"},itemStyle:{color:"#a1a1aa"}},Lo={fill:"#71717a",fontSize:11},eze="#27272a",xd="#27272a",td=["#34d399","#60a5fa","#f472b6","#facc15","#a78bfa","#fb923c","#22d3ee","#f87171"];function S9(e){const t=String(e);return t.includes("T")?new Date(t):new Date(t+"T00:00:00")}function qN(e){return S9(String(e)).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function FN(e){const t=S9(e);return`${t.getMonth()+1}/${t.getDate()}`}function rE(e){switch(e){case ih.connected:return"positive";case ih.paused:return"caution";case ih.error:return"negative";case ih.archived:return"neutral"}}function tze(e){const t={};return e.kind&&e.kind!=="all"&&(t.kind=e.kind),e.sourceId&&(t.sourceId=e.sourceId),e.sinceMinutes!==void 0&&(t.since=new Date(Date.now()-e.sinceMinutes*6e4).toISOString()),e.limit!==void 0&&(t.limit=e.limit),t}function nze(e){return Un({queryKey:e?_e.serverTraffic.sources(e):["server-traffic","disabled"],queryFn:()=>MQ(e),enabled:!!e,staleTime:ks})}function rze(e){return Un({queryKey:e?_e.serverTraffic.status(e):["server-traffic","status-disabled"],queryFn:()=>IQ(e),enabled:!!e,staleTime:ks})}function ize(e,t){return Un({queryKey:e&&t?_e.serverTraffic.sourceDetail(e,t):["server-traffic","detail-disabled"],queryFn:()=>d4(e,t),enabled:!!(e&&t),staleTime:ks})}function aze(e,t){return Un({queryKey:e?_e.serverTraffic.events(e,t):["server-traffic","events-disabled"],queryFn:()=>LQ(e,tze(t)),enabled:!!e,staleTime:ks})}function sze(e){const t=Hn();return Yi({mutationFn:n=>{if(!e)throw new Error("Project is required to connect a Cloud Run source");return $Q(e,n)},onSuccess:()=>{e&&t.invalidateQueries({queryKey:_e.serverTraffic.project(e)})}})}function oze(e){const t=Hn();return Yi({mutationFn:n=>{if(!e)throw new Error("Project is required to connect a WordPress source");return BQ(e,n)},onSuccess:()=>{e&&t.invalidateQueries({queryKey:_e.serverTraffic.project(e)})}})}function lze(e){const t=Hn();return Yi({mutationFn:n=>{if(!e)throw new Error("Project is required to connect a Vercel source");return UQ(e,n)},onSuccess:()=>{e&&t.invalidateQueries({queryKey:_e.serverTraffic.project(e)})}})}function cze(e,t){const n=Hn();return Yi({mutationFn:r=>{if(!e||!t)throw new Error("Project and sourceId are required to sync");return qQ(e,t,r??void 0)},onSuccess:()=>{e&&(n.invalidateQueries({queryKey:_e.serverTraffic.project(e)}),n.invalidateQueries({queryKey:_e.runs.all}))}})}const uze=6,bd="__other__",nd="_socialTotal";function dze(e,t=uze){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),c=new Map;for(const p of e){let m=c.get(p.date);m||(m={date:p.date,[nd]:0},c.set(p.date,m));const y=a.has(p.source)?p.source:bd;m[y]=(m[y]??0)+p.sessions,m[nd]=(m[nd]??0)+p.sessions}const d=[...c.values()].sort((p,m)=>String(p.date).localeCompare(String(m.date))),f=i.map(([p])=>p);return l>0&&f.push(bd),{data:d,sources:f,otherCount:l}}function rd(e){return e.replace(/\+/g," ")}function j9(e,t=30){return e.length<=t?e:e.slice(0,Math.max(1,t-1))+"…"}const fze=["7d","30d","90d","all"],To=td,HN="#71717a",N9="#52525b",nh=25;function Cg(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function k9(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 hze({projectName:e}){const{data:t,isLoading:n,isError:r}=rze(e);if(n)return s.jsx(Pe,{className:"p-5",children:s.jsx("div",{className:"text-sm text-zinc-500",children:"Loading server activity…"})});if(r)return s.jsx(Pe,{className:"p-5",children:s.jsx("div",{className:"text-sm text-rose-400",children:"Failed to load server activity."})});const i=t?.sources??[];return s.jsxs("section",{children:[s.jsx("div",{className:"flex items-baseline justify-between mb-3",children:s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"Server activity (last 24h)"}),s.jsx("h2",{className:"text-lg font-semibold text-zinc-50",children:"Engine crawler hits & AI-referral sessions"}),s.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:["Server-side log evidence of bots crawling the site and AI-referral sessions — orthogonal to GA4 click-through traffic below. "," ",s.jsx(zt,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Manage sources →"})]})]})}),i.length===0?s.jsx(Pe,{className:"p-5",children:s.jsxs("div",{className:"text-sm text-zinc-400",children:["No server traffic source connected yet."," ",s.jsx(zt,{to:"/traffic",className:"text-blue-400 hover:underline",children:"Connect a traffic source"})," ","to surface bot crawls and AI referrals straight from server logs."]})}):s.jsx(Pe,{className:"overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-zinc-900/50 text-[10px] uppercase tracking-wide text-zinc-500",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Source"}),s.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Status"}),s.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Crawler hits 24h"}),s.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"AI sessions 24h"}),s.jsx("th",{className:"text-right px-4 py-2 font-medium",children:"Last sync"}),s.jsx("th",{className:"text-left px-4 py-2 font-medium","aria-label":"open"})]})}),s.jsx("tbody",{children:i.map(a=>s.jsxs("tr",{className:"border-t border-zinc-800/60",children:[s.jsx("td",{className:"px-4 py-3 text-zinc-100",children:a.displayName}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(ot,{tone:rE(a.status),children:a.status})}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.crawlerHits.toLocaleString("en-US")}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:a.totals24h.aiReferralHits.toLocaleString("en-US")}),s.jsx("td",{className:"px-4 py-3 text-right text-zinc-400 text-xs",children:a.lastSyncedAt?k9(a.lastSyncedAt):"never"}),s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsx(zt,{to:"/traffic/$projectName/$sourceId",params:{projectName:e,sourceId:a.id},className:"text-blue-400 hover:underline text-xs",children:"Detail →"})})]},a.id))})]})})]})}function pze({projectName:e}){return s.jsxs("div",{className:"space-y-10",children:[s.jsx(hze,{projectName:e}),s.jsx(mze,{projectName:e})]})}function mze({projectName:e}){const t=Hn(),[n,r]=x.useState(null),[i,a]=x.useState(null),[l,c]=x.useState(!0),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(null),[w,b]=x.useState(null),[j,k]=x.useState("sessions"),[E,A]=x.useState("desc"),[C,_]=x.useState("sessions"),[O,z]=x.useState("desc"),[R,$]=x.useState("sessions"),[F,M]=x.useState("desc"),[U,K]=x.useState("sessions"),[Z,Y]=x.useState("desc"),[H,X]=x.useState([]),[ue,xe]=x.useState([]),[L,q]=x.useState([]),[I,D]=x.useState(!1),[V,re]=x.useState("30d");async function ee(Ce){c(!0),v(null);try{const at=await t.fetchQuery({queryKey:_e.traffic.status(e),queryFn:()=>OQ(e),staleTime:ks});if(Ce.current)return;if(r(at),!at.connected){a(null),X([]),xe([]),q([]),c(!1);return}const[Je,Xe,mt,ke]=await Promise.all([t.fetchQuery({queryKey:_e.traffic.summary(e,V),queryFn:()=>zQ(e,void 0,V),staleTime:ks}),t.fetchQuery({queryKey:_e.traffic.aiHistory(e,V),queryFn:()=>TQ(e,V).catch(()=>[]),staleTime:ks}),t.fetchQuery({queryKey:_e.traffic.sessionHistory(e,V),queryFn:()=>RQ(e,V).catch(()=>[]),staleTime:ks}),t.fetchQuery({queryKey:_e.traffic.socialHistory(e,V),queryFn:()=>PQ(e,V).catch(()=>[]),staleTime:ks})]);if(Ce.current)return;a(Je),X(Xe),xe(mt),q(ke),c(!1)}catch(at){if(Ce.current)return;v(at instanceof Error?at.message:"Failed to load GA4 data"),c(!1)}}x.useEffect(()=>{const Ce={current:!1};return ee(Ce),()=>{Ce.current=!0}},[e,V,t]);async function Ee(){f(!0),v(null),b(null);try{const Ce=await u4(e);b(`Synced ${Ce.rowCount.toLocaleString()} page rows, ${Ce.aiReferralCount.toLocaleString()} AI and ${Ce.socialReferralCount.toLocaleString()} social referral rows (${Ce.days} days)`),await t.invalidateQueries({queryKey:_e.traffic.project(e)}),await ee({current:!1})}catch(Ce){v(Ce instanceof Error?Ce.message:"Sync failed")}finally{f(!1)}}async function Te(){m(!0),v(null),b(null);try{await DQ(e),await t.invalidateQueries({queryKey:_e.traffic.project(e)}),r({connected:!1,propertyId:null,clientEmail:null,lastSyncedAt:null,createdAt:null,updatedAt:null}),a(null),b("GA4 disconnected")}catch(Ce){v(Ce instanceof Error?Ce.message:"Disconnect failed")}finally{m(!1)}}function ne(Ce){j===Ce?A(at=>at==="desc"?"asc":"desc"):(k(Ce),A("desc"))}function he(Ce){C===Ce?z(at=>at==="desc"?"asc":"desc"):(_(Ce),z("desc"))}function je(Ce){R===Ce?M(at=>at==="desc"?"asc":"desc"):($(Ce),M("desc"))}function me(Ce){U===Ce?Y(at=>at==="desc"?"asc":"desc"):(K(Ce),Y("desc"))}const tt=x.useMemo(()=>i?.topPages?[...i.topPages].sort((Ce,at)=>{const Je=Ce[j],Xe=at[j];return typeof Je=="string"&&typeof Xe=="string"?E==="asc"?Je.localeCompare(Xe):Xe.localeCompare(Je):E==="asc"?Je-Xe:Xe-Je}):[],[i?.topPages,j,E]),Ie=x.useMemo(()=>i?.aiReferrals?[...i.aiReferrals].sort((Ce,at)=>{const Je=Ce[C],Xe=at[C];return typeof Je=="string"&&typeof Xe=="string"?O==="asc"?Je.localeCompare(Xe):Xe.localeCompare(Je):O==="asc"?Je-Xe:Xe-Je}):[],[i?.aiReferrals,C,O]),Ze=x.useMemo(()=>i?.aiReferralLandingPages?[...i.aiReferralLandingPages].sort((Ce,at)=>{const Je=Ce[U],Xe=at[U];return typeof Je=="string"&&typeof Xe=="string"?Z==="asc"?Je.localeCompare(Xe):Xe.localeCompare(Je):Z==="asc"?Je-Xe:Xe-Je}):[],[i?.aiReferralLandingPages,U,Z]),nt=x.useMemo(()=>i?.socialReferrals?[...i.socialReferrals].sort((Ce,at)=>{const Je=Ce[R],Xe=at[R];return typeof Je=="string"&&typeof Xe=="string"?F==="asc"?Je.localeCompare(Xe):Xe.localeCompare(Je):F==="asc"?Je-Xe:Xe-Je}):[],[i?.socialReferrals,R,F]),{socialChartData:Wt,socialChartSources:Se,socialOtherCount:Re}=x.useMemo(()=>{const Ce=dze(L);return{socialChartData:Ce.data,socialChartSources:Ce.sources,socialOtherCount:Ce.otherCount}},[L]),{chartData:Bt,chartSources:cn,dateRange:un}=x.useMemo(()=>{const Ce=[...new Set(H.map(Ye=>Ye.source))],at=new Map;for(const Ye of ue)at.set(Ye.date,{_totalSessions:Ye.sessions,_organicSessions:Ye.organicSessions});const Je=new Map;for(const Ye of H){const Nt=`${Ye.date}::${Ye.source}`,aa=Je.get(Nt)??0;Je.set(Nt,Math.max(aa,Ye.sessions))}for(const[Ye,Nt]of Je){const[aa,sa]=Ye.split("::");let cr=at.get(aa);cr||(cr={_totalSessions:0,_organicSessions:0},at.set(aa,cr)),cr[sa]=(cr[sa]??0)+Nt}const Xe=[...at.entries()].sort(([Ye],[Nt])=>Ye.localeCompare(Nt)).map(([Ye,Nt])=>({date:Ye,...Nt})),mt=Xe.map(Ye=>Ye.date),ke=mt.length>0?{start:mt[0],end:mt[mt.length-1]}:null;return{chartData:Xe,chartSources:Ce,dateRange:ke}},[H,ue]);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(gze,{projectName:e,onConnected:()=>{(async()=>(await t.invalidateQueries({queryKey:_e.traffic.project(e)}),await ee({current:!1})))()}});const Rr=i?.organicSharePctDisplay??"0%",Kt=i?.channelBreakdown?.organic.sharePctDisplay??Rr,vt=i?.channelBreakdown?.organic.sessions??i?.totalOrganicSessions??0,de=i?.aiSessionsDeduped??0,Ne=i?.channelBreakdown?.ai.sessions??i?.aiSessionsBySession??0,Ue=i?.channelBreakdown?.ai.sharePctDisplay??i?.aiSharePctBySessionDisplay??"0%",it=i?new Set(i.aiReferrals.map(Ce=>Ce.source.toLowerCase())).size:0,lt=Ie[0]??null,mn=i?.totalDirectSessions??0,Kn=i?.directSharePctDisplay??"0%",ae=i?.channelBreakdown?.direct.sessions??mn,Fe=i?.channelBreakdown?.direct.sharePctDisplay??Kn,Qe=i?.channelBreakdown?.other.sessions??i?.otherSessions??0,rt=i?.channelBreakdown?.other.sharePctDisplay??i?.otherSharePctDisplay??"0%",pt=i?.socialSessions??0,wn=i?.socialSharePctDisplay??"0%",ll=i?.channelBreakdown?.social.sessions??pt,es=i?.channelBreakdown?.social.sharePctDisplay??wn,ia=i?new Set(i.socialReferrals.map(Ce=>Ce.source.toLowerCase())).size:0,Rn=nt[0]??null;return s.jsxs(s.Fragment,{children:[y&&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:y}),w&&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:w}),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(pe,{variant:"outline",size:"sm",disabled:d,onClick:Ke(Ee),children:[s.jsx(Ch,{className:`w-3.5 h-3.5 mr-1.5 ${d?"animate-spin":""}`}),d?"Syncing…":"Sync"]}),s.jsxs(pe,{variant:"ghost",size:"sm",className:"text-rose-400 hover:text-rose-300",disabled:p,onClick:Ke(Te),children:[s.jsx(vW,{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(Zn,{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:fze.map(Ce=>s.jsx("button",{type:"button",className:`px-3 py-1 text-xs rounded-full border transition-colors ${V===Ce?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>re(Ce),children:Ce==="all"?"All":Ce},Ce))})]}),i?s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsx(Bj,{value:Cg(i.totalSessions),label:"Total Sessions",subtitle:i.totalSessions.toLocaleString(),tone:"neutral"}),s.jsx(Bj,{value:Cg(i.totalOrganicSessions),label:"Organic Sessions",subtitle:`${Rr} of total`,tone:"positive"}),s.jsx(Bj,{value:Cg(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(pe,{variant:"outline",size:"sm",disabled:d,onClick:Ke(Ee),children:[s.jsx(Ch,{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(Zn,{text:"Decomposes GA4 sessions into five disjoint channels — known AI referrers first, then organic search, social, direct, and other channels. Known AI referrers are removed from their native GA4 channel before the residual Other bucket is computed. Other channels are the remaining GA4 session default channel groups, such as Referral, Email, Paid Search, Display, Cross-network, Shopping, Video, Affiliates, SMS, and Paid Other."})]})]}),un&&s.jsxs("p",{className:"text-xs text-zinc-500",children:[new Date(un.start+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})," – ",new Date(un.end+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})]})]}),Bt.length>0&&s.jsxs(Pe,{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:cn.length>0?"AI vs. total sessions":"All sessions (baseline)"}),cn.length===0&&s.jsx("p",{className:"text-xs text-zinc-500 mt-0.5",children:"AI referral sessions will be overlaid here once detected"})]}),cn.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(By,{width:"100%",height:"100%",children:s.jsxs(UN,{data:Bt,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Wh,{dataKey:"date",tick:Lo,tickLine:!1,axisLine:{stroke:xd},tickFormatter:FN}),s.jsx(Zh,{tick:Lo,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(fv,{...ed,labelFormatter:qN,formatter:(Ce,at)=>{const Je=typeof Ce=="number"?Ce.toLocaleString():String(Ce??0),Xe=String(at??"");return Xe==="_totalSessions"?[Je,"Total Sessions"]:Xe==="_organicSessions"?[Je,"Organic Sessions"]:[Je,Xe]}}),s.jsx(DU,{wrapperStyle:{fontSize:11,color:"#a1a1aa"},formatter:Ce=>Ce==="_totalSessions"?"Total Sessions":Ce==="_organicSessions"?"Organic Sessions":Ce}),s.jsx(Fu,{type:"monotone",dataKey:"_totalSessions",stroke:"#52525b",fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),cn.map((Ce,at)=>s.jsx(Fu,{type:"monotone",dataKey:Ce,stackId:"ai",stroke:To[at%To.length],fill:To[at%To.length],fillOpacity:.4,strokeWidth:1.5},Ce))]})})})]}),s.jsxs(Pe,{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-5",children:[s.jsx(ha,{label:"Organic",value:Kt,hint:`${vt.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions from Google organic search (sessionDefaultChannelGrouping = 'Organic Search'), after known AI referrers are removed for a disjoint channel breakdown."}),s.jsx(ha,{label:"Social",value:es,hint:`${ll.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions from social platforms (sessionDefaultChannelGrouping = 'Organic Social' or 'Paid Social'), after known AI referrers are removed for a disjoint channel breakdown."}),s.jsx(ha,{label:"Direct",value:Fe,hint:`${ae.toLocaleString()} sessions`,tone:"neutral",tooltip:"Sessions with no source — bookmarks, typed URLs, untagged email, in-app browsers, and AI-driven traffic whose referrer header was stripped. Known AI referrers are removed if GA4 classified them as Direct."}),s.jsx(ha,{label:"Known AI referrers (lower bound)",value:Ue,hint:`${Ne.toLocaleString()} sessions`,tone:"positive",tooltip:"Sessions whose current sessionSource matched a known AI engine (e.g. chatgpt.com, claude.ai, gemini.google.com). These sessions are removed from their native GA4 channel in this card grid so the five buckets stay disjoint. This is a strict lower bound: most AI traffic strips the referrer and falls into Direct, so the true AI share is typically higher than what's shown here. The detail table below also surfaces firstUserSource and UTM-tagged AI signals."}),s.jsx(ha,{label:"Other channels",value:rt,hint:`${Qe.toLocaleString()} sessions`,tone:"neutral",tooltip:"Remaining GA4 session default channel groups after Known AI, Organic Search, Organic/Paid Social, and Direct are accounted for. This is a residual bucket, not a single source. It can include Referral, Email, Paid Search, Display, Cross-network, Shopping, Video, Affiliates, SMS, Mobile Push Notifications, Paid Other, and unclassified traffic."})]}),lt&&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:lt.source})," via ",lt.medium,", accounting for ",lt.sessions.toLocaleString()," sessions."]})]}),s.jsxs(Pe,{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?`${it} 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(Nr,{label:"Source",sortKey:"source",current:C,dir:O,onSort:he,align:"left"}),s.jsx(Nr,{label:"Medium",sortKey:"medium",current:C,dir:O,onSort:he,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(Nr,{label:"Sessions",sortKey:"sessions",current:C,dir:O,onSort:he,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(Nr,{label:"Users",sortKey:"users",current:C,dir:O,onSort:he,align:"right"})]})}),s.jsx("tbody",{children:Ie.map(Ce=>s.jsx(vze,{referral:Ce,totalSessions:de},`${Ce.source}:${Ce.medium}:${Ce.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(Pe,{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:Ze.length>0?`${Ze.length} rows`:"No landing-page rows"})]}),Ze.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(Nr,{label:"Landing Page",sortKey:"landingPage",current:U,dir:Z,onSort:me,align:"left"}),s.jsx(Nr,{label:"Source",sortKey:"source",current:U,dir:Z,onSort:me,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Attribution"}),s.jsx(Nr,{label:"Sessions",sortKey:"sessions",current:U,dir:Z,onSort:me,align:"right"}),s.jsx(Nr,{label:"Users",sortKey:"users",current:U,dir:Z,onSort:me,align:"right"})]})}),s.jsx("tbody",{children:Ze.map(Ce=>s.jsx(xze,{row:Ce},`${Ce.landingPage}:${Ce.source}:${Ce.medium}:${Ce.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(Zn,{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."})]})]}),Wt.length>0&&s.jsxs(Pe,{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"})]}),Re>0&&s.jsxs("p",{className:"text-xs text-zinc-500",children:["Showing top ",Se.length-1," sources · ",Re," more grouped as Other"]})]}),s.jsx("div",{className:"h-64",children:s.jsx(By,{width:"100%",height:"100%",children:s.jsxs(UN,{data:Wt,margin:{top:4,right:4,bottom:0,left:0},children:[s.jsx(Wh,{dataKey:"date",tick:Lo,tickLine:!1,axisLine:{stroke:xd},tickFormatter:FN}),s.jsx(Zh,{tick:Lo,tickLine:!1,axisLine:!1,allowDecimals:!1,width:36}),s.jsx(fv,{...ed,labelFormatter:qN,formatter:(Ce,at)=>{const Je=typeof Ce=="number"?Ce.toLocaleString():String(Ce??0),Xe=String(at??"");if(Xe===nd)return[Je,"Total Social"];if(Xe===bd){const mt=`Other (${Re} source${Re===1?"":"s"})`;return[Je,mt]}return[Je,rd(Xe)]}}),s.jsx(Fu,{type:"monotone",dataKey:nd,stroke:N9,fill:"#27272a",fillOpacity:.4,strokeWidth:1.5,dot:!1}),Se.map((Ce,at)=>{const Xe=Ce===bd?HN:To[at%To.length];return s.jsx(Fu,{type:"monotone",dataKey:Ce,stackId:"social",stroke:Xe,fill:Xe,fillOpacity:.4,strokeWidth:1.5},Ce)})]})})}),s.jsx(wze,{sources:Se,otherCount:Re})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[minmax(0,0.9fr)_minmax(0,1.5fr)]",children:[s.jsxs(Pe,{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(ha,{label:"Social Sessions",value:Cg(pt),hint:`${pt.toLocaleString()} sessions`,tone:"positive",tooltip:"Total sessions classified as Organic Social or Paid Social by GA4's default channel grouping."}),s.jsx(ha,{label:"Share of Traffic",value:wn,hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions that originated from social media platforms."}),s.jsx(ha,{label:"Platforms",value:String(ia),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."})]}),Rn&&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:`${Rn.source} via ${Rn.medium}`,children:j9(rd(Rn.source),64)}),s.jsxs("p",{className:"text-xs text-sky-200/70 mt-0.5 truncate",title:Rn.medium,children:["via ",rd(Rn.medium)," · ",Rn.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(ha,{label:"Social Sessions",value:"0",hint:"0 sessions",tone:"neutral",tooltip:"Total sessions attributed to social media platforms."}),s.jsx(ha,{label:"Share of Traffic",value:"0%",hint:"of total sessions",tone:"neutral",tooltip:"Percentage of your total site sessions from social media."}),s.jsx(ha,{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(Pe,{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?nt.length>nh&&!I?`Top ${nh} of ${nt.length}`:`${nt.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(Nr,{label:"Source",sortKey:"source",current:R,dir:F,onSort:je,align:"left"}),s.jsx(Nr,{label:"Medium",sortKey:"medium",current:R,dir:F,onSort:je,align:"left"}),s.jsx("th",{className:"py-1 font-medium text-left",children:"Channel"}),s.jsx(Nr,{label:"Sessions",sortKey:"sessions",current:R,dir:F,onSort:je,align:"right"}),s.jsx("th",{className:"py-1 font-medium text-right",children:"Share"}),s.jsx(Nr,{label:"Users",sortKey:"users",current:R,dir:F,onSort:je,align:"right"})]})}),s.jsx("tbody",{children:(I?nt:nt.slice(0,nh)).map(Ce=>s.jsx(bze,{referral:Ce,totalSessions:pt},`${Ce.source}:${Ce.medium}:${Ce.channelGroup}`))})]})}),nt.length>nh&&s.jsx("div",{className:"mt-3 flex justify-center",children:s.jsx("button",{type:"button",onClick:()=>D(Ce=>!Ce),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:I?`Show top ${nh}`:`Show all ${nt.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(Zn,{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(Nr,{label:"Landing Page",sortKey:"landingPage",current:j,dir:E,onSort:ne,align:"left"}),s.jsx(Nr,{label:"Sessions",sortKey:"sessions",current:j,dir:E,onSort:ne,align:"right"}),s.jsx(Nr,{label:"Organic",sortKey:"organicSessions",current:j,dir:E,onSort:ne,align:"right"}),s.jsx("th",{className:"text-right py-1 font-medium",children:"Organic %"}),s.jsx(Nr,{label:"Users",sortKey:"users",current:j,dir:E,onSort:ne,align:"right"})]})}),s.jsx("tbody",{children:tt.map(Ce=>s.jsx(yze,{page:Ce},Ce.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 ${k9(i.lastSyncedAt)}`:"Never synced"}),s.jsx("span",{children:i?`${i.topPages.length} pages · ${i.aiReferrals.length} AI rows · ${i.socialReferrals.length} social rows`:""})]})]})}function gze({projectName:e,onConnected:t}){const[n,r]=x.useState(""),[i,a]=x.useState(null),[l,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(null),y=x.useRef(null),v=x.useCallback(b=>{const j=b.target.files?.[0];if(!j)return;m(null),a(j.name);const k=new FileReader;k.onload=()=>{const E=k.result;try{const A=JSON.parse(E);if(!A.client_email||!A.private_key){m("JSON file is missing required fields: client_email and private_key. Make sure you downloaded a service account key (not an OAuth client)."),c(null);return}c(E)}catch{m("File is not valid JSON. Please upload a service account key file (.json) downloaded from Google Cloud Console."),c(null)}},k.onerror=()=>{m("Failed to read file."),c(null)},k.readAsText(j)},[]);async function w(){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 _Q(e,{propertyId:n.trim(),keyJson:l});try{await u4(e)}catch{}t()}catch(b){m(b instanceof Error?b.message:"Failed to connect GA4")}finally{f(!1)}}return s.jsxs(Pe,{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:y,type:"file",accept:".json,application/json",onChange:v,className:"hidden"}),s.jsxs("button",{type:"button",onClick:()=>y.current?.click(),className:"flex items-center gap-2 w-full rounded-lg bg-zinc-900/60 border border-zinc-800/60 border-dashed px-4 py-3 text-sm text-zinc-400 hover:border-zinc-600 hover:text-zinc-300 transition-colors cursor-pointer",children:[s.jsx(bW,{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(pe,{variant:"default",size:"sm",disabled:d||!n.trim()||!l,onClick:Ke(w),children:d?"Connecting & syncing…":"Connect GA4"})]})}function Nr({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 C9={positive:"text-emerald-400",caution:"text-amber-400",negative:"text-rose-400",neutral:"text-zinc-50"};function Bj({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 ${C9[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function ha({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(Zn,{text:i})]}),s.jsx("p",{className:`text-xl font-semibold tabular-nums ${C9[r]}`,children:e}),s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:n})]})}function yze({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 A9={session:"Session",first_user:"First Visit",manual_utm:"UTM"},E9={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 vze({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=A9[e.sourceDimension]??e.sourceDimension,i=E9[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 xze({row:e}){const t=A9[e.sourceDimension]??e.sourceDimension,n=E9[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 bze({referral:e,totalSessions:t}){const n=t>0?(e.sessions/t*100).toFixed(1):"0.0",r=e.channelGroup==="Paid Social"?"Paid":"Organic",i=rd(e.source),a=rd(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 wze({sources:e,otherCount:t}){const n=[{key:nd,color:N9,label:"Total",tooltip:"All social sessions across every source."}];for(let r=0;r<e.length;r++){const i=e[r];if(i===bd)n.push({key:bd,color:HN,label:`Other (${t})`,tooltip:`${t} smaller source${t===1?"":"s"} grouped together`});else{const a=rd(i);n.push({key:i,color:To[r%To.length]??HN,label:j9(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 O9(e){e.invalidateQueries({queryKey:_e.runs.all}),e.invalidateQueries({queryKey:_e.projects.all})}function Sze(e){return e==="gsc-sync"?"GSC sync queued":e==="inspect-sitemap"?"Sitemap inspection queued":"Visibility sweep queued"}function jze(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 ix(e,t){z3({id:e.id,projectId:e.projectId,kind:e.kind,projectLabel:t.projectLabel,sourceAction:t.sourceAction,lastAnnouncedStatus:"queued"}),ut({title:Sze(e.kind),detail:jze(t.projectLabel,e.kind),tone:"neutral",dedupeKey:`run:${e.id}`,dedupeMode:"replace"})}function Nze(e){const t=e.filter(i=>i.status!=="conflict"),n=e.filter(i=>i.status==="conflict");if(t.length===0){ut({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)z3({id:i.id,projectId:i.projectId,kind:i.kind,projectLabel:i.projectName,sourceAction:"run-all",lastAnnouncedStatus:"queued"});const r=are({runIds:t.map(i=>i.id),queuedCount:t.length,skippedCount:n.length});ut({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 ax(e,t){if(e instanceof rr&&e.code==="RUN_IN_PROGRESS"){ut({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}ut({title:e instanceof Error?e.message:"Failed to queue run",tone:"negative"})}function z9(){const e=Hn();return Yi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>DV(t,n),onSuccess:(t,n)=>{O9(e),ix(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:n.sourceAction})}})}function kze(){const e=Hn();return Yi({meta:{skipGlobalErrorToast:!0},mutationFn:t=>XV(t),onSuccess:t=>{O9(e),Nze(t)},onError:t=>{ut({title:t instanceof Error?t.message:"Failed to queue runs",tone:"negative"})}})}function Cze(){const e=Hn();return Yi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>s4(t,n),onSuccess:(t,n)=>{t0(e,xt["gsc-sync"],n.projectName),ix(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"gsc-sync"})}})}function Aze(){const e=Hn();return Yi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t})=>fQ(t),onSuccess:(t,n)=>{t0(e,t.run.kind,n.projectName),ix(t.run,{projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"discover-sitemaps"})}})}function Eze(){const e=Hn();return Yi({meta:{skipGlobalErrorToast:!0},mutationFn:({projectName:t,opts:n})=>uQ(t,n),onSuccess:(t,n)=>{t0(e,xt["inspect-sitemap"],n.projectName),ix(t,{projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})},onError:(t,n)=>{ax(t,{projectKey:n.projectName,projectLabel:n.projectLabel??n.projectName,sourceAction:"inspect-sitemap"})}})}function Oze(){const e=Hn();return Yi({mutationFn:({projectName:t,queries:n})=>n4(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:_e.projects.all})}})}const zze=["7d","30d","90d","all"],Ag=500;function _ze({projectName:e,refreshNonce:t}){const n=Hn(),[r,i]=x.useState(!1),[a,l]=x.useState([]),[c,d]=x.useState([]),[f,p]=x.useState([]),[m,y]=x.useState(null),[v,w]=x.useState([]),[b,j]=x.useState([]),[k,E]=x.useState(null),[A,C]=x.useState(""),[_,O]=x.useState(""),[z,R]=x.useState("30"),[$,F]=x.useState(!1),[M,U]=x.useState("30d"),[K,Z]=x.useState({startDate:"",endDate:"",query:"",page:"",limit:"20"}),[Y,H]=x.useState(0),[X,ue]=x.useState(!1),[xe,L]=x.useState(0),[q,I]=x.useState(!1),[D,V]=x.useState(""),[re,ee]=x.useState(!0),[Ee,Te]=x.useState(!1),[ne,he]=x.useState(!1),[je,me]=x.useState(!1),[tt,Ie]=x.useState(!1),[Ze,nt]=x.useState(!1),[Wt,Se]=x.useState(!1),[Re,Bt]=x.useState(null),[cn,un]=x.useState(!1),[Rr,Kt]=x.useState(!1),[vt,de]=x.useState(null),[Ne,Ue]=x.useState(""),[it,lt]=x.useState(!1),[mn,Kn]=x.useState(!1),[ae,Fe]=x.useState("indexed"),[Qe,rt]=x.useState(null),pt=!!(K.query.trim()||K.page.trim()||Qe),wn=Qe!==null,ll=x.useMemo(()=>{if(!Qe)return f;const{key:G,dir:ze}=Qe;return[...f].sort((bt,_t)=>{const Sn=G===Mo.CTR?Number.isFinite(bt.ctr)?bt.ctr:0:bt[G],Aa=G===Mo.CTR?Number.isFinite(_t.ctr)?_t.ctr:0:_t[G];return ze==="asc"?Sn-Aa:Aa-Sn})},[f,Qe]),[es,ia]=x.useState([]),[Rn,Ce]=x.useState(null),[at,Je]=x.useState(!1),[Xe,mt]=x.useState(null),[ke,Ye]=x.useState(null),Nt=a.find(G=>G.connectionType==="gsc"),aa=f.length>0||v.length>0||b.length>0,sa=Cze(),cr=Aze(),ts=Eze();async function Yr(G){if(!G){d([]),C("");return}he(!0);try{const{sites:ze}=await n.fetchQuery({queryKey:_e.gsc.properties(e),queryFn:()=>tQ(e),staleTime:vr});d(ze),C(G.propertyId??ze[0]?.siteUrl??"")}catch(ze){d([]),mt(ze instanceof Error?ze.message:"Failed to load Search Console properties")}finally{he(!1)}}async function ns(G){Ie(!0);const ze=G??Y;try{const bt=parseInt(K.limit,10)||20,_t=pt?Ag:bt+1,Sn=pt?0:ze,Aa={startDate:K.startDate,endDate:K.endDate,query:K.query,page:K.page,limit:String(_t),offset:String(Sn),window:M},Dr=await n.fetchQuery({queryKey:_e.gsc.performance(e,Aa),queryFn:()=>iQ(e,{startDate:K.startDate||void 0,endDate:K.endDate||void 0,query:K.query||void 0,page:K.page||void 0,limit:_t,offset:Sn,window:M}),staleTime:vr});pt?(ue(!1),p(Dr),L(Dr.length),I(!0)):(ue(Dr.length>bt),p(Dr.slice(0,bt)),L(0),I(!1))}catch(bt){p([]),ue(!1),L(0),mt(bt instanceof Error?bt.message:"Failed to load GSC performance data")}finally{Ie(!1)}}async function Dc(){try{const G={startDate:K.startDate,endDate:K.endDate,window:M},ze=await n.fetchQuery({queryKey:_e.gsc.performanceDaily(e,G),queryFn:()=>aQ(e,{startDate:K.startDate||void 0,endDate:K.endDate||void 0,window:M}),staleTime:vr});y(ze)}catch{y(null)}}async function hi(){nt(!0);try{const G=D.trim()||void 0,[ze,bt]=await Promise.all([n.fetchQuery({queryKey:_e.gsc.inspections(e,G),queryFn:()=>oQ(e,{url:G,limit:20}),staleTime:vr}),n.fetchQuery({queryKey:_e.gsc.deindexed(e),queryFn:()=>lQ(e),staleTime:vr})]);w(ze),j(bt)}catch(G){w([]),j([]),mt(G instanceof Error?G.message:"Failed to load GSC inspection history")}finally{nt(!1)}}async function Dn(){un(!0);try{const[G,ze]=await Promise.all([n.fetchQuery({queryKey:_e.gsc.coverage(e),queryFn:()=>pk(e),staleTime:vr}),n.fetchQuery({queryKey:_e.gsc.coverageHistory(e),queryFn:()=>cQ(e).catch(()=>[]),staleTime:vr})]);Bt(G),ia(ze)}catch(G){Bt(null),ia([]),mt(G instanceof Error?G.message:"Failed to load coverage data")}finally{un(!1)}}async function ur(G){Je(!0),mt(null);try{const ze=await H2(e,{urls:G}),{succeeded:bt,failed:_t,total:Sn}=ze.summary;ut({title:"Indexing requested",detail:_t===0?`${bt} URL${bt!==1?"s":""} submitted for indexing.`:`${bt}/${Sn} submitted successfully, ${_t} failed.`,tone:_t===0?"positive":"caution",dedupeKey:`gsc:indexing:${e}`,dedupeMode:"replace"})}catch(ze){mt(ze instanceof Error?ze.message:"Failed to request indexing")}finally{Je(!1)}}async function Gs(){Je(!0),mt(null);try{const G=await H2(e,{urls:[],allUnindexed:!0}),{succeeded:ze,failed:bt,total:_t}=G.summary;ut({title:"Indexing requested",detail:bt===0?`${ze} unindexed URL${ze!==1?"s":""} submitted for indexing.`:`${ze}/${_t} submitted successfully, ${bt} failed.`,tone:bt===0?"positive":"caution",dedupeKey:`gsc:indexing-all:${e}`,dedupeMode:"replace"})}catch(G){mt(G instanceof Error?G.message:"Failed to request indexing")}finally{Je(!1)}}async function Vs(){if(Ne.trim()){lt(!0),mt(null);try{await rQ(e,"gsc",Ne.trim()),await n.invalidateQueries({queryKey:_e.gsc.project(e)}),l(G=>G.map(ze=>ze.connectionType==="gsc"?{...ze,sitemapUrl:Ne.trim()}:ze)),ut({title:"Sitemap URL saved",detail:`${e} will use the updated sitemap URL.`,tone:"positive",dedupeKey:`gsc:sitemap:${e}`,dedupeMode:"drop"}),Ue("")}catch(G){mt(G instanceof Error?G.message:"Failed to save sitemap URL")}finally{lt(!1)}}}async function Ap(){mt(null);try{const G=await cr.mutateAsync({projectName:e,projectLabel:e});de(G.sitemaps),l(ze=>ze.map(bt=>bt.connectionType==="gsc"?{...bt,sitemapUrl:G.primarySitemapUrl}:bt))}catch{}}async function sx(){Kt(!0),mt(null);try{const G=await dQ(e);n.setQueryData(_e.gsc.sitemaps(e),G),de(G.sitemaps),G.sitemaps.length===0&&Ye("No sitemaps found in this GSC property. Submit a sitemap in Google Search Console first.")}catch(G){mt(G instanceof Error?G.message:"Failed to list sitemaps")}finally{Kt(!1)}}async function Bd(){ee(!0),mt(null);try{const[G,ze]=await Promise.all([hk().catch(()=>null),n.fetchQuery({queryKey:_e.gsc.connections(e),queryFn:()=>a4(e).catch(()=>[]),staleTime:vr})]);i(!!G?.google?.configured),l(ze);const bt=ze.find(_t=>_t.connectionType==="gsc");await Promise.all([Yr(bt),ns(),Dc(),hi(),Dn()])}finally{ee(!1)}}x.useEffect(()=>{Bd()},[e,t]),x.useEffect(()=>{H(0),ns(0),Dc()},[M]);const Qs=x.useRef(!1);x.useEffect(()=>{if(!Qs.current){Qs.current=!0;return}H(0),ns(0)},[wn]);async function Ud(){if(!r){mt("Google OAuth app credentials are not configured yet. Set them on the Settings page first.");return}Te(!0),mt(null),Ye(null);try{const{authUrl:G}=await JV(e,"gsc");if(!G.startsWith("https://accounts.google.com/")){mt("Unexpected OAuth redirect URL. Please try again.");return}const ze=window.open(G,"_blank","width=600,height=700");if(!ze){window.location.assign(G);return}Ye("Finish the Google consent flow in the popup, then close it to refresh this project.");const bt=window.setInterval(()=>{ze.closed&&(window.clearInterval(bt),Ye(null),n.invalidateQueries({queryKey:_e.gsc.project(e)}),Bd())},1e3)}catch(G){mt(G instanceof Error?G.message:"Failed to start OAuth flow")}finally{Te(!1)}}async function Ys(){mt(null),Ye(null);try{await eQ(e,"gsc"),await n.invalidateQueries({queryKey:_e.gsc.project(e)}),l(G=>G.filter(ze=>ze.connectionType!=="gsc")),d([]),C("")}catch(G){mt(G instanceof Error?G.message:"Failed to disconnect")}}async function Ws(){if(A){me(!0),mt(null);try{await nQ(e,"gsc",A),await n.invalidateQueries({queryKey:_e.gsc.project(e)}),l(G=>G.map(ze=>ze.connectionType==="gsc"?{...ze,propertyId:A}:ze)),ut({title:"GSC property updated",detail:`${e} is now linked to ${A}.`,tone:"positive",dedupeKey:`gsc:property:${e}`,dedupeMode:"drop"})}catch(G){mt(G instanceof Error?G.message:"Failed to save GSC property")}finally{me(!1)}}}async function cl(){mt(null),Ye(null);try{await sa.mutateAsync({projectName:e,projectLabel:e,opts:{days:parseInt(z,10)||void 0,full:$||void 0}}),await n.invalidateQueries({queryKey:_e.gsc.project(e)})}catch{}}async function rs(){if(_.trim()){Se(!0),mt(null),Ye(null);try{const G=await sQ(e,_.trim());await n.invalidateQueries({queryKey:_e.gsc.project(e)}),E(G),O(""),await hi()}catch(G){mt(G instanceof Error?G.message:"Failed to inspect URL")}finally{Se(!1)}}}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:"Search Console"}),s.jsx("h2",{children:"Google Search Console"})]})}),Xe&&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:[Xe,s.jsx("button",{type:"button",className:"ml-2 text-rose-400 hover:text-rose-200",onClick:()=>mt(null),children:"×"})]}),ke&&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:[ke,s.jsx("button",{type:"button",className:"ml-2 text-emerald-400 hover:text-emerald-200",onClick:()=>Ye(null),children:"×"})]}),re?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading…"}):s.jsxs("div",{className:"space-y-3",children:[Nt?s.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-1 text-xs text-zinc-500",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500"}),s.jsx("span",{className:"text-zinc-300",children:"Authorized"})]}),s.jsx("span",{className:"text-zinc-700",children:"·"}),s.jsx("code",{className:"text-zinc-400",children:Nt.domain}),s.jsx("span",{className:"text-zinc-700",children:"·"}),s.jsxs("span",{children:["Last updated ",ma(Nt.updatedAt)]}),s.jsx("button",{type:"button",className:"ml-auto text-zinc-500 transition-colors hover:text-rose-400",onClick:Ke(Ys),children:"Disconnect"})]}):s.jsxs(Pe,{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(ot,{tone:r?"caution":"negative",children:r?"Ready to connect":"App credentials missing"})]}),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:r?"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:[r?s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:Ee,onClick:Ke(Ud),children:Ee?"Opening…":"Connect Google Search Console"}):s.jsx(pe,{type:"button",variant:"outline",size:"sm",asChild:!0,children:s.jsx(zt,{to:"/settings",children:"Open Settings"})}),!r&&s.jsx("p",{className:"text-xs text-zinc-500",children:"The same Google OAuth app credentials are shared across all projects."})]})]})]}),Nt&&!Nt.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(pe,{type:"button",size:"sm",disabled:cr.isPending||!Nt.propertyId,onClick:Ke(Ap),children:cr.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:Ne,onChange:G=>Ue(G.target.value),onKeyDown:G=>G.key==="Enter"&&void Vs()}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:it||!Ne.trim(),onClick:Ke(Vs),children:it?"Saving…":"Save sitemap URL"})]})]})]})]})}),(Nt||aa)&&s.jsxs(s.Fragment,{children:[s.jsxs(Pe,{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:[Re&&Re.notIndexed.length>0&&s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:at,onClick:()=>{Gs()},children:at?"Requesting…":`Request indexing (${Re.notIndexed.length})`}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:cn,onClick:()=>{Dn()},children:cn?"Loading…":"Refresh coverage"})]})]}),Re&&Re.summary.total>0?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mt-6 flex flex-col items-center",children:(()=>{const G=Re.summary.indexed+Re.summary.notIndexed,ze=G>0?Re.summary.indexed/G:0,bt=G>0?Re.summary.notIndexed/G:0,_t=54,Sn=2*Math.PI*_t,Aa=Sn*(1-ze),Dr=Sn*bt,is=Sn*ze;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:_t,fill:"none",stroke:"rgba(255,255,255,0.04)",strokeWidth:"14"}),s.jsx("circle",{cx:"64",cy:"64",r:_t,fill:"none",stroke:"#10b981",strokeWidth:"14",strokeDasharray:Sn,strokeDashoffset:Aa,strokeLinecap:"round",transform:"rotate(-90 64 64)",style:{transition:"stroke-dashoffset 0.6s ease"}}),Re.summary.notIndexed>0&&s.jsx("circle",{cx:"64",cy:"64",r:_t,fill:"none",stroke:"#52525b",strokeWidth:"14",strokeDasharray:`${Dr} ${Sn-Dr}`,strokeDashoffset:-is,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:[(ze*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:Re.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:Re.summary.notIndexed.toLocaleString()}),s.jsxs("p",{className:"text-[11px] uppercase tracking-wide text-zinc-500",children:["Not indexed",(Re.reasonGroups??[]).length>0&&s.jsxs("span",{className:"ml-1 text-zinc-600",children:["· ",(Re.reasonGroups??[]).length," ",(Re.reasonGroups??[]).length===1?"reason":"reasons"]})]})]})]}),Re.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:Re.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(G=>{const ze=G==="indexed"?Re.indexed.length:G==="notIndexed"?Re.notIndexed.length:Re.deindexed.length,bt=G==="indexed"?"Indexed":G==="notIndexed"?"Not Indexed":"Deindexed";return s.jsxs("button",{type:"button",className:`rounded-full px-3 py-1 text-xs font-medium transition-colors ${ae===G?"bg-zinc-700 text-zinc-100":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"}`,onClick:()=>{Fe(G),Ce(null)},children:[bt," (",ze,")"]},G)})}),s.jsxs("div",{className:"mt-3 overflow-x-auto",children:[ae==="indexed"&&Re.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:Re.indexed.map(G=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),s.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:G.crawlTime?G.crawlTime.split("T")[0]:"—"}),s.jsx("td",{className:"text-zinc-400",children:G.isMobileFriendly===!0?"Yes":G.isMobileFriendly===!1?"No":"—"})]},G.id))})]}),ae==="notIndexed"&&!Rn&&(Re.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:(Re.reasonGroups??[]).map(G=>s.jsxs("tr",{className:"cursor-pointer hover:bg-zinc-800/40",onClick:()=>Ce(G.reason),children:[s.jsx("td",{className:"text-zinc-200",children:G.reason}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.count})]},G.reason))})]}),ae==="notIndexed"&&!Rn&&(Re.reasonGroups??[]).length===0&&Re.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:Re.notIndexed.map(G=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),s.jsx("td",{className:"text-zinc-400",children:G.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"})]},G.id))})]}),ae==="notIndexed"&&Rn&&(()=>{const G=(Re.reasonGroups??[]).find(ze=>ze.reason===Rn);return G?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:()=>Ce(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:G.reason}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[G.count," affected page",G.count!==1?"s":""]})]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:at,onClick:()=>{ur(G.urls.map(ze=>ze.url))},children:at?"Requesting…":`Request indexing (${G.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:G.urls.map(ze=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:ze.url}),s.jsx("td",{className:"text-zinc-400",children:ze.crawlTime?ze.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:at,onClick:()=>{ur([ze.url])},title:"Request indexing",children:"Index"})})]},ze.id))})]})]}):null})(),ae==="deindexed"&&Re.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:Re.deindexed.map((G,ze)=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),s.jsx("td",{className:"text-zinc-400",children:G.previousState}),s.jsx("td",{className:"text-zinc-400",children:G.currentState}),s.jsx("td",{className:"text-zinc-400",children:G.transitionDate.split("T")[0]})]},`${G.url}-${ze}`))})]}),(ae==="indexed"&&Re.indexed.length===0||ae==="notIndexed"&&!Rn&&Re.notIndexed.length===0||ae==="deindexed"&&Re.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:cn?"Loading coverage data…":"No coverage data yet. Inspect your sitemap to populate this view."})]}),s.jsxs(Pe,{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.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex gap-1",role:"tablist","aria-label":"Performance window",children:zze.map(G=>s.jsx("button",{type:"button",role:"tab","aria-selected":M===G,className:`px-2.5 py-1 text-xs rounded-full border transition-colors ${M===G?"bg-zinc-700 border-zinc-600 text-zinc-50":"border-zinc-800 text-zinc-400 hover:border-zinc-700 hover:text-zinc-300"}`,onClick:()=>U(G),children:G==="all"?"All":G},G))}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:tt,onClick:()=>{H(0),ns(0),Dc()},children:tt?"Loading…":"Apply filters"})]})]}),m&&m.daily.length>0&&(()=>{const G=m.daily,ze=Math.max(...G.map(kt=>kt.impressions),1),{clicks:bt,impressions:_t,ctr:Sn}=m.totals,Aa=(Sn*100).toFixed(1),Dr=700,is=220,Wr={top:12,bottom:36,left:48,right:12},Mc=Dr-Wr.left-Wr.right,oa=is-Wr.top-Wr.bottom,Mr=Mc/G.length,dr=Math.max(Math.min(Mr*.35,24),4),qd=Math.max(dr*.15,1),ox=kt=>{if(kt<=0)return 1;const pi=Math.pow(10,Math.floor(Math.log10(kt))),Ir=kt/pi,Oi=Ir<=1.5?1.5:Ir<=3?3:Ir<=5?5:10;return Math.ceil(Oi*pi)},Zs=4,ul=Math.ceil(ox(ze)/Zs)*Zs,Ic=Array.from({length:Zs+1},(kt,pi)=>ul/Zs*pi),lx=kt=>kt>=1e3?`${(kt/1e3).toFixed(kt>=1e4?0:1)}k`:String(kt);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:bt.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:_t.toLocaleString()})]})]}),s.jsxs("span",{className:"text-xs text-zinc-500",children:["CTR ",s.jsxs("span",{className:"text-amber-400 tabular-nums font-medium",children:[Aa,"%"]})]})]}),s.jsx("div",{className:"relative w-full",style:{aspectRatio:`${Dr} / ${is}`},children:s.jsxs("svg",{viewBox:`0 0 ${Dr} ${is}`,className:"h-full w-full",children:[Ic.map((kt,pi)=>{const Ir=Wr.top+oa-kt/ul*oa;return s.jsxs("g",{children:[s.jsx("line",{x1:Wr.left,y1:Ir,x2:Dr-Wr.right,y2:Ir,stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),s.jsx("text",{x:Wr.left-6,y:Ir+3.5,textAnchor:"end",fill:"#a1a1aa",fontSize:"10",fontFamily:"inherit",children:lx(kt)})]},`t-${pi}`)}),G.map((kt,pi)=>{const Ir=Wr.left+Mr*pi+Mr/2,Oi=kt.impressions/ul*oa,la=kt.clicks/ul*oa;return s.jsxs("g",{children:[s.jsx("title",{children:`${kt.date}
|
|
290
|
+
Clicks: ${kt.clicks}
|
|
291
|
+
Impressions: ${kt.impressions}
|
|
292
|
+
CTR: ${(kt.ctr*100).toFixed(1)}%`}),s.jsx("rect",{x:Ir-dr-qd/2,y:Wr.top+oa-Oi,width:dr,height:Math.max(Oi,1),rx:2,fill:"#3b82f6",opacity:.85}),s.jsx("rect",{x:Ir+qd/2,y:Wr.top+oa-la,width:dr,height:Math.max(la,1),rx:2,fill:"#10b981",opacity:.85})]},kt.date)}),(()=>{const kt=Math.min(G.length,7);return Array.from({length:kt},(pi,Ir)=>{const Oi=G.length===1?0:Math.round(Ir/(kt-1)*(G.length-1)),la=Wr.left+Mr*Oi+Mr/2;return s.jsx("text",{x:la,y:is-8,textAnchor:"middle",fill:"#71717a",fontSize:"10",fontFamily:"inherit",children:G[Oi].date.slice(5)},`xl-${Oi}`)})})()]})})]})})(),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","aria-label":"Start date",title:"Start date (inclusive). Leave blank to use the window above.",value:K.startDate,onChange:G=>Z(ze=>({...ze,startDate:G.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","aria-label":"End date",title:"End date (inclusive).",value:K.endDate,onChange:G=>Z(ze=>({...ze,endDate:G.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:"Contains query…","aria-label":"Filter query (substring match)",title:"Case-insensitive substring match on the query column.",value:K.query,onChange:G=>Z(ze=>({...ze,query:G.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:"Contains page URL…","aria-label":"Filter page (substring match)",title:"Case-insensitive substring match on the page URL.",value:K.page,onChange:G=>Z(ze=>({...ze,page:G.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:"Rows per page (20)","aria-label":"Rows per page",title:"Rows per page. Ignored while a filter or column sort is active — then up to 500 matches are loaded.",value:K.limit,onChange:G=>Z(ze=>({...ze,limit:G.target.value}))})]}),s.jsxs("p",{className:"mt-2 text-xs text-zinc-500",children:["Query and page filters match case-insensitive substrings. Click Apply filters to run. When a filter or column sort is active, up to ",Ag.toLocaleString()," matching rows load so sorting covers the full set."]}),f.length>0?s.jsxs(s.Fragment,{children:[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(Mo).map(G=>s.jsx("th",{className:"text-right","aria-sort":Qe?.key===G?Qe.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:()=>rt(ze=>ze?.key===G?ze.dir==="desc"?{key:G,dir:"asc"}:null:{key:G,dir:"desc"}),children:[Fne[G],Qe?.key===G?Qe.dir==="desc"?" ↓":" ↑":""]})},G))]})}),s.jsx("tbody",{children:ll.map((G,ze)=>s.jsxs("tr",{children:[s.jsx("td",{className:"text-zinc-400",children:G.date}),s.jsx("td",{className:"max-w-xs truncate text-zinc-200",children:G.query}),s.jsx("td",{className:"max-w-xs truncate text-zinc-400",children:G.page}),s.jsx("td",{className:"text-right tabular-nums text-zinc-300",children:G.clicks.toLocaleString()}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.impressions.toLocaleString()}),s.jsxs("td",{className:"text-right tabular-nums text-zinc-400",children:[(Number.isFinite(G.ctr)?G.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"text-right tabular-nums text-zinc-400",children:G.position.toFixed(1)})]},`${G.date}:${G.query}:${G.page}:${ze}`))})]})}),q?s.jsx("div",{className:"mt-3 text-xs text-zinc-500",children:s.jsxs("span",{className:"tabular-nums",children:["Showing ",xe.toLocaleString()," matching row",xe===1?"":"s",xe>=Ag?` (capped at ${Ag.toLocaleString()} — narrow the filter to see more)`:""]})}):(Y>0||X)&&(()=>{const G=parseInt(K.limit,10)||20,ze=Y+1,bt=Y+f.length;return s.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-zinc-500",children:[s.jsxs("span",{className:"tabular-nums",children:["Showing ",ze.toLocaleString()," – ",bt.toLocaleString(),X?"+":""]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:tt||Y===0,onClick:()=>{const _t=Math.max(0,Y-G);H(_t),ns(_t)},children:"Previous"}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:tt||!X,onClick:()=>{const _t=Y+G;H(_t),ns(_t)},children:"Next"})]})]})})()]}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No performance rows match the current filters yet."})]}),s.jsxs(Pe,{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:_,onChange:G=>O(G.target.value),onKeyDown:G=>G.key==="Enter"&&void rs()}),s.jsx(pe,{type:"button",size:"sm",disabled:Wt||!Nt?.propertyId||!_.trim(),onClick:Ke(rs),children:Wt?"Inspecting…":"Inspect URL"})]}),k&&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:k.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:k.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:jT(k.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:ma(k.crawlTime)})]})]})]}),s.jsxs(Pe,{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(pe,{type:"button",variant:"outline",size:"sm",disabled:Ze,onClick:()=>{hi()},children:Ze?"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:D,onChange:G=>V(G.target.value)}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:Ze,onClick:()=>{hi()},children:"Apply filter"})]}),v.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:v.map(G=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),s.jsx("td",{className:"text-zinc-300",children:G.indexingState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:G.verdict??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:G.coverageState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:jT(G.isMobileFriendly)}),s.jsx("td",{className:"text-zinc-400",children:ma(G.inspectedAt)})]},G.id))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No inspection history yet."})]}),s.jsxs(Pe,{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"})]})}),b.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:b.map(G=>s.jsxs("tr",{children:[s.jsx("td",{className:"max-w-sm truncate text-zinc-200",children:G.url}),s.jsx("td",{className:"text-zinc-400",children:G.previousState??"Unknown"}),s.jsx("td",{className:"text-zinc-300",children:G.currentState??"Unknown"}),s.jsx("td",{className:"text-zinc-400",children:ma(G.transitionDate)})]},`${G.url}:${G.transitionDate}`))})]})}):s.jsx("p",{className:"mt-3 text-sm text-zinc-500",children:"No deindexed transitions recorded."})]})]}),Nt&&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:()=>Kn(G=>!G),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 ${mn?"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"})]})}),mn&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-3 xl:grid-cols-2",children:[s.jsxs(Pe,{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:A,disabled:ne||c.length===0,onChange:G=>C(G.target.value),children:c.length===0?s.jsx("option",{value:"",children:ne?"Loading properties…":"No properties available"}):c.map(G=>s.jsxs("option",{value:G.siteUrl,children:[G.siteUrl," · ",G.permissionLevel]},G.siteUrl))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:ne,onClick:()=>{Yr(Nt)},children:ne?"Refreshing…":"Refresh properties"}),s.jsx(pe,{type:"button",size:"sm",disabled:!A||je,onClick:Ke(Ws),children:je?"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(Pe,{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:z,onChange:G=>R(G.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:$,onChange:G=>F(G.target.checked)}),"Replace existing imported rows for the requested range"]})]}),s.jsx(pe,{type:"button",size:"sm",disabled:sa.isPending||!Nt.propertyId,onClick:Ke(cl),children:sa.isPending?"Queueing…":"Queue sync"}),!Nt.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property before queueing a sync."})]})]})]}),s.jsxs(Pe,{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:[Nt.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:Nt.sitemapUrl})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:Rr||!Nt.propertyId,onClick:()=>{sx()},children:Rr?"Loading…":"Browse sitemaps from GSC"}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:cr.isPending||!Nt.propertyId,onClick:Ke(Ap),children:cr.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."}),vt&&vt.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 (",vt.length,")"]}),vt.map(G=>{const ze=G.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:G.path}),G.lastSubmitted&&s.jsxs("p",{className:"text-zinc-500",children:["Submitted: ",G.lastSubmitted.split("T")[0]]})]}),s.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[ze&&s.jsxs("div",{className:"text-right",children:[s.jsxs("p",{className:"text-zinc-300",children:[ze.indexed," / ",ze.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:()=>Ue(G.path),children:"Use"})]})]},G.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:Nt.sitemapUrl?"Update sitemap URL…":"https://example.com/sitemap.xml",value:Ne,onChange:G=>Ue(G.target.value),onKeyDown:G=>G.key==="Enter"&&Ne.trim()&&void Vs()}),s.jsx(pe,{type:"button",size:"sm",disabled:it||!Ne.trim(),onClick:Ke(Vs),children:it?"Saving…":Nt.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(pe,{type:"button",size:"sm",variant:"outline",disabled:ts.isPending||!Nt.propertyId,onClick:Ke(async()=>{const ze=document.getElementById(`gsc-sitemap-inspect-${e}`)?.value?.trim()||Nt.sitemapUrl||void 0;mt(null),Ye(null);try{await ts.mutateAsync({projectName:e,projectLabel:e,opts:{sitemapUrl:ze}})}catch{}}),children:ts.isPending?"Queueing…":"Inspect sitemap"})]}),!Nt.propertyId&&s.jsx("p",{className:"text-xs text-amber-400",children:"Select a Search Console property first."})]})]})]})]})]})]})}function Uj({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(y4,{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 Rl=50;function _u(e){return typeof window>"u"?e:`${window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??""}${e}`}function Eg(e){return e.toLocaleString()}function Tze(e){const t=Number(e);return Number.isFinite(t)?`${(t*100).toFixed(1)}%`:"—"}function Pze(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 Rze(e){const t=e.filter(n=>n.kind===xt["backlink-extract"]&&!Mk(n.status));return t.length===0?null:t.reduce((n,r)=>n.createdAt>r.createdAt?n:r)}function Dze(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 Mze({projectName:e}){const[t,n]=x.useState(null),[r,i]=x.useState(null),[a,l]=x.useState([]),[c,d]=x.useState(null),[f,p]=x.useState(null),[m,y]=x.useState(null),[v,w]=x.useState(Date.now()),[b,j]=x.useState(0),[k,E]=x.useState(!0),[A,C]=x.useState(!1),[_,O]=x.useState(null),z=x.useRef(null),R=x.useCallback(async()=>{E(!0),O(null);try{const[ue,xe,L,q,I]=await Promise.all([f4().catch(()=>null),eY(e,{excludeCrawlers:!0}).catch(()=>null),tY(e,{limit:Rl,offset:b,excludeCrawlers:!0}).catch(V=>{if(V instanceof rr&&V.code==="NOT_FOUND")return null;throw V}),nY(e).catch(()=>[]),zV(e).catch(()=>[])]);d(ue),n(xe),i(L),l(q);const D=Rze(I);p(D),z.current=D?.id??null}catch(ue){O(ue instanceof Error?ue.message:"Failed to load backlinks")}finally{E(!1)}},[e,b]);x.useEffect(()=>{R()},[R]),x.useEffect(()=>{if(!f)return;const ue=f.id;let xe=!1;const L=async()=>{try{const I=await Go(ue);if(xe)return;Mk(I.status)?(p(null),y(I),await R()):p(D=>D?.id===I.id?{...D,...I}:D)}catch{}},q=window.setInterval(()=>{L()},3e3);return()=>{xe=!0,window.clearInterval(q)}},[f,R]),x.useEffect(()=>{if(!f)return;const ue=window.setInterval(()=>w(Date.now()),1e3);return()=>window.clearInterval(ue)},[f]),x.useEffect(()=>{if(!m||m.status==="failed")return;const ue=window.setTimeout(()=>y(null),1e4);return()=>window.clearTimeout(ue)},[m]);async function $(){C(!0),O(null);try{const ue=await rY(e);p(ue),z.current=ue.id}catch(ue){ue instanceof rr&&ue.code==="MISSING_DEPENDENCY"?O("DuckDB is not installed. Visit the Backlinks admin page to install it."):O(ue instanceof Error?ue.message:"Failed to trigger extract")}finally{C(!1)}}const F=x.useMemo(()=>a.slice().sort((ue,xe)=>ue.queriedAt.localeCompare(xe.queriedAt)).map(ue=>({date:ue.queriedAt,linkingDomains:ue.totalLinkingDomains})),[a]),M=r?.rows??[],U=r?.total??0,K=t?.excludedLinkingDomains??0,Z=U>Rl,Y=Math.floor(b/Rl)+1,H=Math.max(1,Math.ceil(U/Rl));return x.useEffect(()=>{b>0&&b>=U&&j(0)},[b,U]),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."]})]})}),_&&s.jsx(Pe,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:_})}),f&&s.jsx(Pe,{className:"surface-card p-4 mb-4 border-sky-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(b4,{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(ot,{tone:"neutral",children:f.status}),s.jsxs("span",{className:"text-xs text-zinc-500 tabular-nums",children:[Dze(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(Pe,{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(yk,{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:Hne(m.error)}):m.status!=="failed"?s.jsx("p",{className:"text-xs text-zinc-500 mt-1",children:"Backlinks refreshed from the cached release."}):null]})]})}),X()]});function X(){if(k)return s.jsx(Pe,{className:"surface-card p-6",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading backlinks…"})});const ue=t!==null&&t.totalLinkingDomains>0,xe=m?.status==="failed",L=t!==null&&t.totalLinkingDomains===0&&!xe,q=c?.status==="ready",I=c?.status==="failed",D=c&&(c.status==="downloading"||c.status==="querying"||c.status==="queued");return ue?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:Eg(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:Eg(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:Tze(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 ",Pze(t.queriedAt),K>0&&s.jsxs(s.Fragment,{children:[" · ",s.jsxs("span",{className:"text-zinc-500",children:[K," crawler/proxy domain",K===1?"":"s"," hidden"]})]})]}),F.length>=2&&s.jsxs(Pe,{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(By,{width:"100%",height:"100%",children:s.jsxs(UN,{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:td[0],stopOpacity:.4}),s.jsx("stop",{offset:"100%",stopColor:td[0],stopOpacity:0})]})}),s.jsx(Wh,{dataKey:"date",tick:Lo,stroke:xd,tickFormatter:FN}),s.jsx(Zh,{tick:Lo,stroke:xd,allowDecimals:!1}),s.jsx(fv,{contentStyle:ed.contentStyle,labelStyle:ed.labelStyle,itemStyle:ed.itemStyle,labelFormatter:qN}),s.jsx(Fu,{type:"monotone",dataKey:"linkingDomains",name:"Referring domains",stroke:td[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"}),Z&&s.jsxs("p",{className:"text-xs text-zinc-600",children:["Page ",Y," of ",H," · ",Eg(U)," total"]})]}),s.jsx(Pe,{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:[M.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:V.linkingDomain}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:Eg(V.numHosts)})]},V.linkingDomain)),M.length===0&&s.jsx("tr",{children:s.jsx("td",{className:"px-4 py-4 text-sm text-zinc-500",colSpan:2,children:K>0&&U===0?`Every referring domain in this release was a crawler/proxy host (${K} hidden).`:"No referring domains in this release."})})]})]})}),Z&&s.jsxs("div",{className:"flex items-center justify-end gap-2 mt-2",children:[s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:b===0,onClick:()=>j(V=>Math.max(0,V-Rl)),children:"Previous"}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:b+Rl>=U,onClick:()=>j(V=>V+Rl),children:"Next"})]})]}),s.jsxs("div",{className:"mt-4 flex items-center gap-3 flex-wrap",children:[s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:A||f!==null,onClick:Ke($),children:[s.jsx(Tv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":A?"Queuing…":"Re-run extract"]}),s.jsxs(Uj,{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(pe,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:_u("/backlinks"),children:"Open admin"})})]})]}):s.jsx(Pe,{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(x4,{className:"h-5 w-5","aria-hidden":!0})}),s.jsxs("div",{className:"flex-1",children:[!c&&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(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:_u("/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 (",c.status,c.phaseDetail?` — ${c.phaseDetail}`:"","). Backlinks will appear here once it finishes."]}),s.jsx("div",{className:"mt-4",children:s.jsx(pe,{asChild:!0,type:"button",variant:"outline",size:"sm",children:s.jsx("a",{href:_u("/backlinks"),children:"View sync status"})})})]}),I&&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:c.error??"The workspace release sync failed. Retry from the Backlinks admin page."}),s.jsx("div",{className:"mt-4",children:s.jsx(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:_u("/backlinks"),children:"Go to Backlinks admin"})})})]}),q&&!D&&!L&&!xe&&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:c.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(pe,{type:"button",size:"sm",disabled:A||f!==null,onClick:Ke($),children:[s.jsx(kh,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":A?"Queuing…":"Run extract"]}),s.jsxs(Uj,{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"}),"."]})]})]})]}),xe&&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:c?.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(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:_u("/backlinks"),children:"Go to Backlinks admin"})})})]}),L&&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(pe,{asChild:!0,type:"button",size:"sm",children:s.jsx("a",{href:_u("/backlinks"),children:"Go to Backlinks admin"})}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:A||f!==null,onClick:Ke($),children:[s.jsx(kh,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),f?"Extract running…":A?"Queuing…":"Re-run extract"]}),s.jsxs(Uj,{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 Ize({projectName:e}){const t=Un({queryKey:_e.citationVisibility(e),queryFn:()=>HQ(e),staleTime:p4}),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(Zn,{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(Zn,{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(Lze,{data:n}),s.jsx($ze,{data:n}),n.competitorGaps.length>0&&s.jsx(Fze,{data:n})]})}function Lze({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(Og,{label:"Cited + mentioned",value:`${n} / ${t}`,helper:"In sources AND named in answer",tone:n>0?"positive":"neutral"}),s.jsx(Og,{label:"Cited only",value:`${r} / ${t}`,helper:"In sources, not named in answer",tone:r>0?"positive-dim":"neutral"}),s.jsx(Og,{label:"Mentioned only",value:`${i} / ${t}`,helper:"Named in answer, no source link",tone:i>0?"caution":"neutral"}),s.jsx(Og,{label:"Invisible",value:`${a} / ${t}`,helper:"No engine cites or mentions",tone:a>0?"negative":"neutral"})]})}function Og({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 $ze({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(Bze,{}),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(lc,{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(tW,{className:"inline h-3.5 w-3.5 text-zinc-700","aria-label":"no data"}):s.jsx(Uze,{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 Bze(){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(Hu,{active:!0,tone:"cited"}),s.jsx("span",{children:"cited (in sources)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Hu,{active:!0,tone:"mentioned"}),s.jsx("span",{children:"mentioned (in answer)"})]}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx(Hu,{active:!1,tone:"cited"}),s.jsx(Hu,{active:!1,tone:"mentioned"}),s.jsx("span",{children:"neither"})]})]})}function Uze({provider:e}){const t=qze(e);return s.jsxs("span",{className:"inline-flex items-center justify-center gap-1",title:t,children:[s.jsx(Hu,{active:e.cited,tone:"cited"}),s.jsx(Hu,{active:e.mentioned,tone:"mentioned"})]})}function qze(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 Hu({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 Fze({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(Zn,{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(lc,{provider:t.provider})}),s.jsx("td",{className:"text-zinc-300",children:t.citingCompetitors.join(", ")})]},`${t.queryId}::${t.provider}`))})]})})]})}const KN=new Set(["queued","seeding","probing"]);function Hze({projectName:e}){const t=Hn(),[n,r]=x.useState(null),[i,a]=x.useState(""),[l,c]=x.useState("100"),d=Un({queryKey:_e.discovery.sessions(e),queryFn:()=>pQ(e,{limit:10}),refetchInterval:C=>C.state.data?.some(O=>KN.has(O.status))?3e3:!1}),f=d.data??[];x.useEffect(()=>{!n&&f[0]&&r(f[0].id)},[n,f]);const p=f.find(C=>C.id===n)??null,m=Un({queryKey:n?_e.discovery.session(e,n):_e.discovery.session(e,"none"),queryFn:()=>mQ(e,n??""),enabled:!!n,refetchInterval:p&&KN.has(p.status)?3e3:!1}),y=m.data??null,v=Un({queryKey:n?_e.discovery.promotePreview(e,n):_e.discovery.promotePreview(e,"none"),queryFn:()=>gQ(e,n??""),enabled:!!(n&&p?.status==="completed")}),w=Yi({mutationFn:()=>{const C={},_=i.trim();_&&(C.icpDescription=_);const O=Number.parseInt(l,10);return Number.isFinite(O)&&O>0&&(C.maxProbes=O),hQ(e,C)},onSuccess:async C=>{r(C.sessionId),a(""),await ZL(t,e,C.sessionId),ut({title:"Discovery started",detail:`Run ${qj(C.sessionId)} is testing questions your customers might ask.`,tone:"neutral",dedupeKey:`discovery:start:${C.sessionId}`,dedupeMode:"replace"})},onError:C=>{ut({title:"Discovery failed to start",detail:C instanceof Error?C.message:"Could not start discovery.",tone:"negative"})}}),b=Yi({mutationFn:C=>{if(!n)throw new Error("Select a completed discovery session first.");return yQ(e,n,C)},onSuccess:async C=>{await ZL(t,e,C.sessionId),t.invalidateQueries({queryKey:_e.projects.all}),ut({title:"Queries added",detail:Qze(C),tone:"positive",dedupeKey:`discovery:promote:${C.sessionId}`,dedupeMode:"replace"})},onError:C=>{ut({title:"Could not add queries",detail:C instanceof Error?C.message:"Could not add queries from this run.",tone:"negative"})}}),j=y??p,k=v.data??null,E=(k?.queriesByBucket.cited.length??0)+(k?.queriesByBucket.aspirational.length??0),A=x.useMemo(()=>(y?.probes??[]).slice(0,30),[y?.probes]);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:"Discovery"}),s.jsx("h2",{children:"Find new queries to track"}),s.jsx("p",{className:"mt-1 max-w-3xl text-sm leading-6 text-zinc-500",children:"Describe your ideal customer and Canonry generates the questions they would ask an AI engine, checks which ones already cite your site, then lets you add the promising ones to your tracked queries."})]}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:d.isFetching,onClick:()=>{d.refetch()},children:[s.jsx(Ch,{size:14}),"Refresh"]})]}),s.jsxs("div",{className:"grid gap-4 xl:grid-cols-[360px_minmax(0,1fr)]",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Pe,{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:"Step 1"}),s.jsx("h3",{children:"Describe your customer"})]}),s.jsx(ot,{tone:"neutral",children:"Runs on Gemini"})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-xs text-zinc-500",children:"Who is your ideal customer?"}),s.jsx("textarea",{className:"mt-1 min-h-24 w-full rounded border border-zinc-700 bg-transparent px-3 py-2 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:"e.g. Small e-commerce stores that want AI-powered customer support. Leave blank to use the customer profile saved on this project.",value:i,onChange:C=>a(C.target.value)})]}),s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-xs text-zinc-500",children:"How many questions to test"}),s.jsx("input",{className:"mt-1 w-full rounded border border-zinc-700 bg-transparent px-3 py-2 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",inputMode:"numeric",value:l,onChange:C=>c(C.target.value)}),s.jsx("span",{className:"mt-1 block text-[11px] text-zinc-600",children:"More questions means broader coverage but a longer run. 100 is a good default."})]}),s.jsxs(pe,{type:"button",size:"sm",disabled:w.isPending,onClick:()=>w.mutate(),children:[s.jsx(kh,{size:14}),w.isPending?"Starting…":"Find queries"]})]})]}),s.jsxs(Pe,{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:"Recent runs"})]}),d.isFetching&&s.jsx(ot,{tone:"neutral",children:"Loading"})]}),f.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"No discovery runs yet. Describe your customer above to start your first one."}):s.jsx("div",{className:"space-y-2",children:f.map(C=>s.jsxs("button",{type:"button",className:`w-full rounded-md border px-3 py-2 text-left transition-colors ${n===C.id?"border-zinc-600 bg-zinc-900/70":"border-zinc-800/60 bg-zinc-950/40 hover:border-zinc-700 hover:bg-zinc-900/40"}`,onClick:()=>r(C.id),children:[s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:qj(C.id)}),s.jsx(ot,{tone:WL(C.status),children:C.status})]}),s.jsxs("div",{className:"mt-2 grid grid-cols-3 gap-2 text-[11px] text-zinc-500",children:[s.jsxs("span",{children:["Cited ",C.citedCount??0]}),s.jsxs("span",{children:["Opportunity ",C.aspirationalCount??0]}),s.jsxs("span",{children:["Low value ",C.wastedCount??0]})]})]},C.id))})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Pe,{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:"Run detail"}),s.jsx("h3",{children:j?qj(j.id):"No run selected"})]}),j&&s.jsx(ot,{tone:WL(j.status),children:j.status})]}),j?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(Co,{label:"Questions tested",value:j.probeCount??0}),s.jsx(Co,{label:"Already cited",value:j.citedCount??0,tone:"positive"}),s.jsx(Co,{label:"Opportunities",value:j.aspirationalCount??0,tone:"caution"}),s.jsx(Co,{label:"Low value",value:j.wastedCount??0,tone:"negative"})]}),j.error&&s.jsx("div",{className:"rounded-md border border-rose-800/40 bg-rose-950/20 px-3 py-2 text-sm text-rose-300",children:j.error}),j.icpDescription&&s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 px-3 py-2",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Customer profile"}),s.jsx("p",{className:"mt-1 text-sm text-zinc-300",children:j.icpDescription})]}),j.competitorMap.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-xs font-medium text-zinc-400",children:"Sites that keep getting cited"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:j.competitorMap.slice(0,8).map(C=>s.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-950 px-2 py-1 text-xs text-zinc-300",children:[C.domain," ",s.jsx("span",{className:"text-zinc-500",children:C.hits})]},C.domain))})]})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"Start a run above, or pick one from Recent runs to see its progress."})]}),j?.status==="completed"&&s.jsxs(Pe,{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:"Step 2"}),s.jsx("h3",{children:"Add queries to your project"})]}),s.jsxs(pe,{type:"button",size:"sm",disabled:b.isPending||E===0,onClick:()=>b.mutate(void 0),children:[s.jsx(yk,{size:14}),b.isPending?"Adding…":"Add recommended queries"]})]}),v.isLoading?s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading recommendations…"}):k?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(Co,{label:"Queries to add",value:E,tone:"positive"}),s.jsx(Co,{label:"Already cited",value:k.queriesByBucket.cited.length,tone:"positive"}),s.jsx(Co,{label:"Opportunities",value:k.queriesByBucket.aspirational.length,tone:"caution"}),s.jsx(Co,{label:"Low value (skipped)",value:k.queriesByBucket["wasted-surface"].length,tone:"negative"})]}),s.jsx("p",{className:"text-xs leading-5 text-zinc-500",children:"Adding queries starts tracking the “already cited” and “opportunity” questions, plus any competitor sites that kept showing up. “Low value” questions are listed below for reference only and are not added."}),k.suggestedCompetitors.length>0&&s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-xs font-medium text-zinc-400",children:"Competitor sites that will be added"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:k.suggestedCompetitors.map(C=>s.jsxs("span",{className:"rounded-md border border-zinc-800/60 bg-zinc-950 px-2 py-1 text-xs text-zinc-300",children:[C.domain," ",s.jsx("span",{className:"text-zinc-500",children:C.hits})]},C.domain))})]})]}):s.jsx("p",{className:"text-sm text-zinc-500",children:"No recommendations available for this run."})]}),s.jsxs(Pe,{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:"All results"}),s.jsx("h3",{children:"Every question we tested"})]}),m.isFetching&&s.jsx(ot,{tone:"neutral",children:"Loading"})]}),A.length===0?s.jsx("p",{className:"text-sm text-zinc-500",children:"Results show up here once the run starts testing questions."}):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:"Question"}),s.jsx("th",{children:"Result"}),s.jsx("th",{children:"Sites cited"})]})}),s.jsx("tbody",{children:A.map(C=>s.jsxs("tr",{children:[s.jsx("td",{className:"font-medium text-zinc-100",children:C.query}),s.jsx("td",{children:s.jsx(ot,{tone:Kze(C.bucket),children:Vze(C.bucket)})}),s.jsx("td",{className:"text-zinc-400",children:C.citedDomains.length>0?C.citedDomains.slice(0,3).join(", "):"-"})]},C.id))})]})})]})]})]})]})}function Co({label:e,value:t,tone:n="neutral"}){const r=n==="positive"?"text-emerald-300":n==="caution"?"text-amber-300":n==="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 ${r}`,children:t})]})}function WL(e){return e==="completed"?"positive":e==="failed"?"negative":KN.has(e)?"caution":"neutral"}function Kze(e){return e==="cited"?"positive":e==="aspirational"?"caution":e==="wasted-surface"?"negative":"neutral"}const Gze={cited:"Already cited",aspirational:"Opportunity","wasted-surface":"Low value"};function Vze(e){return e?Gze[e]:"Not classified"}function qj(e){return e.length>8?e.slice(0,8):e}function Qze(e){const t=e.promoted.queries.length,n=e.promoted.competitors.length,r=e.skipped.queries.length+e.skipped.competitors.length;return`${t} quer${t===1?"y":"ies"} and ${n} competitor${n===1?"":"s"} added${r>0?`; ${r} already tracked`:""}.`}async function ZL(e,t,n){await Promise.all([e.invalidateQueries({queryKey:_e.discovery.project(t)}),e.invalidateQueries({queryKey:_e.discovery.sessions(t)}),e.invalidateQueries({queryKey:_e.discovery.session(t,n)}),e.invalidateQueries({queryKey:_e.discovery.promotePreview(t,n)}),e.invalidateQueries({queryKey:_e.runs.all})])}const Yze={critical:"negative",high:"negative",medium:"caution",low:"neutral"};function xr(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 Wze(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 Zze(e){const t=[e.city,e.region,e.country].filter(Boolean).join(", ");return t?`${e.label} (${t})`:e.label}function Xze({projectName:e}){const[t,n]=x.useState(!1),[r,i]=x.useState(null),a=Un({queryKey:_e.report(e),queryFn:()=>CQ(e)});async function l(){n(!0),i(null);try{await EQ(e,"client")}catch(d){const f=d instanceof rr||d instanceof Error?d.message:"Download failed";i(f)}finally{n(!1)}}if(a.isLoading)return s.jsx("p",{className:"text-sm text-zinc-500 py-8 text-center",children:"Loading report…"});if(a.error){const d=a.error instanceof Error?a.error.message:"Failed to load report";return s.jsx("div",{className:"py-8 text-center",children:s.jsx("p",{className:"text-sm text-rose-400",children:d})})}const c=a.data;return c?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:"AI Visibility Report"}),s.jsx("h1",{className:"page-title",children:c.meta.project.displayName}),s.jsxs("p",{className:"page-subtitle",children:[c.meta.project.canonicalDomain," · ",c.meta.project.country," / ",c.meta.project.language.toUpperCase(),c.meta.location?` · Location: ${Zze(c.meta.location)}`:" · No location set"," · ","Generated ",Wze(c.meta.generatedAt)]}),r&&s.jsx("p",{className:"mt-2 text-xs text-rose-400",children:r})]}),s.jsx("div",{className:"page-header-right",children:s.jsxs(pe,{variant:"secondary",size:"sm",onClick:Ke(l),disabled:t,children:[s.jsx(Tv,{className:"size-4"}),t?"Preparing…":"Download report HTML"]})})]}),s.jsx(a_e,{report:c}),s.jsx(f_e,{report:c,audience:"client"}),s.jsx(t_e,{report:c}),s.jsx(l_e,{report:c,audience:"client"}),s.jsx(c_e,{report:c})]}):null}const XL="AI Visibility — Server-Side",JL="AI engine attention",Jze="What AI engines actually do in your server logs over the last 7 days — the other half of citations.",e_e="Live telemetry from your server logs.";function t_e({report:e}){const t=e.serverActivity;if(!t)return null;if(!t.hasData)return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Xh,{eyebrow:JL,title:XL,subtitle:e_e}),s.jsx("p",{className:"text-sm text-zinc-500",children:"Your server-side traffic source is connected. Numbers will appear after the next sync."})]});const n={current:t.verifiedCrawlerHits.current+t.unverifiedCrawlerHits.current,prior:t.verifiedCrawlerHits.prior+t.unverifiedCrawlerHits.prior,deltaPct:qne(t.verifiedCrawlerHits.current+t.unverifiedCrawlerHits.current,t.verifiedCrawlerHits.prior+t.unverifiedCrawlerHits.prior)},r=ST(n,"requests"),i=`${xr(t.verifiedCrawlerHits.current)} verified · ${xr(t.unverifiedCrawlerHits.current)} unverified${r?` · ${r}`:""}`,a=ST(t.referralArrivals,"sessions"),l=t.byOperator.filter(c=>c.verifiedHits>0||c.unverifiedHits>0||c.referralArrivals>0).slice(0,5);return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Xh,{eyebrow:JL,title:XL,subtitle:Jze}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsx(r5,{label:"AI bot requests observed",value:xr(n.current),subtitle:i}),s.jsx(r5,{label:"AI referral sessions",value:xr(t.referralArrivals.current),subtitle:a})]}),l.length>0&&s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:"By AI tool"}),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:"AI tool"}),s.jsx("th",{children:"Bot requests (7d)"}),s.jsx("th",{children:"Referral sessions"})]})}),s.jsx("tbody",{children:l.map(c=>s.jsxs("tr",{children:[s.jsx("td",{className:"evidence-query-cell",children:c.operator}),s.jsx("td",{children:xr(c.verifiedHits+c.unverifiedHits)}),s.jsx("td",{children:xr(c.referralArrivals)})]},c.operator))})]})}),s.jsx("p",{className:"mt-2 text-[11px] text-zinc-500",children:"Verified requests are reverse-DNS confirmed. Unverified requests are user-agent claims shown separately in agency diagnostics."})]})]})}function n_e(e,t){return e.audience==="both"||e.audience===t}const r_e={gemini:"Gemini",openai:"ChatGPT",claude:"Claude",perplexity:"Perplexity",local:"Local model","cdp:chatgpt":"ChatGPT (browser)"};function jv(e){return r_e[e]??e.charAt(0).toUpperCase()+e.slice(1)}function i_e(e){if(!e)return null;const t=e.window??1,n=t>=2?`vs prior ${t} checks (avg ${e.prior}%)`:`since last check (was ${e.prior}%)`;return e.direction==="up"?{text:`Up ${e.deltaAbs.toFixed(1)} points ${n}`,tone:"positive",arrow:"↑"}:e.direction==="down"?{text:`Down ${Math.abs(e.deltaAbs).toFixed(1)} points ${n}`,tone:"negative",arrow:"↓"}:{text:`Holding steady ${t>=2?`vs prior ${t} checks (avg ${e.prior}%)`:`since last check (was ${e.prior}%)`}`,tone:"neutral",arrow:"→"}}function a_e({report:e}){const t=e.executiveSummary,n=e.citationScorecard,r=t.totalQueryCount,i=r>0?`${t.citationRate}%`:"—",a=r>0?`When customers asked AI ${r} ${r===1?"question":"questions"} about your industry, AI linked to your website in ${t.citedQueryCount} of ${r===1?"them":"those answers"}.`:"No AI check has been run yet. Run a check to see how AI tools answer customer questions about your business.",l=i_e(e.whatsChanged.citationRate),c=n.providers.length>0?n.providers.map(jv).join(", "):`${xr(t.queryCount)} ${t.queryCount===1?"question":"questions"} tested`;return s.jsxs("section",{className:"page-section-divider",children:[s.jsxs("div",{className:"rounded-2xl border border-zinc-800/60 bg-zinc-900/40 p-6 sm:p-8",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:"Overview"}),s.jsx("p",{className:"mt-3 text-6xl font-bold tracking-tight text-zinc-50 sm:text-7xl",children:i}),s.jsx("p",{className:"mt-3 max-w-2xl text-base text-zinc-300 sm:text-lg",children:a}),l&&s.jsxs("p",{className:`mt-3 text-sm font-medium ${l.tone==="positive"?"text-emerald-400":l.tone==="negative"?"text-rose-400":"text-zinc-400"}`,children:[s.jsx("span",{className:"mr-1",children:l.arrow}),l.text]})]}),s.jsxs("div",{className:"mt-5 grid gap-4 sm:grid-cols-3",children:[s.jsx(Fj,{label:"AI mentions your name",value:`${t.mentionRate}%`,subtitle:r>0?`Says your name in ${t.mentionedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),s.jsx(Fj,{label:"AI links to your website",value:`${t.citationRate}%`,subtitle:r>0?`Cites your site as a source in ${t.citedQueryCount} of ${r} ${r===1?"answer":"answers"}`:"No data yet"}),s.jsx(Fj,{label:"AI tools tested",value:xr(t.providerCount),subtitle:c})]}),s.jsxs("div",{className:"mt-4 rounded-xl border border-zinc-800/60 bg-zinc-950/40 px-4 py-3 text-xs text-zinc-400",children:[s.jsx("span",{className:"font-semibold text-zinc-200",children:"Mentions and links are different."})," ","A ",s.jsx("span",{className:"font-medium text-zinc-200",children:"mention"})," is when AI says your name out loud in its answer. A ",s.jsx("span",{className:"font-medium text-zinc-200",children:"link"})," is when AI lists your website as a source it used. AI can do either, both, or neither — that's why we track both."]}),n.queries.length>0&&s.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Customer questions we tested"}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["These are the ",n.queries.length," ",n.queries.length===1?"question we asked":"questions we asked"," every AI tool. The numbers above measure how often you came up."]}),s.jsx("ol",{className:"mt-4 grid gap-2 sm:grid-cols-2",children:n.queries.map((d,f)=>s.jsxs("li",{className:"flex items-start gap-3 rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2 text-sm text-zinc-200",children:[s.jsx("span",{className:"shrink-0 text-xs font-semibold tabular-nums text-zinc-500",children:String(f+1).padStart(2,"0")}),s.jsxs("span",{children:['"',d,'"']})]},f))})]}),n.providerRates.length>0&&s.jsxs("div",{className:"mt-5 rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"How often each AI tool links to your website"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Higher is better. Each bar shows the share of customer questions where the AI cited your site."}),s.jsx("div",{className:"mt-4 space-y-3",children:n.providerRates.map(d=>s.jsxs("div",{className:"grid grid-cols-[120px_1fr_120px] items-center gap-3",children:[s.jsx("span",{className:"text-sm text-zinc-300",children:jv(d.provider)}),s.jsx("div",{className:"h-3 overflow-hidden rounded-full bg-zinc-800/80",children:s.jsx("div",{className:"h-full rounded-full bg-emerald-500/70",style:{width:`${Math.max(d.citationRate,1.5)}%`}})}),s.jsxs("span",{className:"text-right text-sm font-semibold text-zinc-100",children:[d.citationRate,"% ",s.jsxs("span",{className:"font-normal text-zinc-500",children:["(",d.citedCount,"/",d.totalCount,")"]})]})]},d.provider))})]}),e.clientSummary.confidenceNotes.length>0&&s.jsx("div",{className:"mt-4 grid gap-2",children:e.clientSummary.confidenceNotes.map((d,f)=>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:d},f))})]})}function Fj({label:e,value:t,subtitle:n}){return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-zinc-500",children:e}),s.jsx("p",{className:"mt-3 text-4xl font-bold tracking-tight text-zinc-50 sm:text-5xl",children:t}),s.jsx("p",{className:"mt-2 text-xs text-zinc-500",children:n})]})}function s_e(e){switch(e){case"immediate":return"Do now";case"short-term":return"This month";case"medium-term":return"Next quarter"}}function o_e(e){switch(e){case"high":return"Strong evidence";case"medium":return"Some evidence";case"low":return"Worth trying"}}function l_e({report:e,audience:t}){const n=t==="client"?e.clientSummary.actionItems:e.agencyDiagnostics.priorities.length>0?e.agencyDiagnostics.priorities:e.actionPlan.filter(a=>n_e(a,t)),r=bne(e,n),i=t==="client";return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Xh,{eyebrow:i?"Action plan":"Agency actions",title:i?"What to do next":"Agency Action Plan",subtitle:i?"Approve these in order. They are sorted by what will move the needle fastest.":"The highest-leverage work, sorted by urgency and evidence strength."}),r.length===0?s.jsx(sE,{message:"No recommendations yet — run an AI check to populate this."}):s.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:r.map((a,l)=>{const c=a.evidence.length>0?a.evidence:a.why,d=a.why.length>0||a.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:"Priority — 1 will move the needle fastest",children:l+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(ot,{tone:hne(a),children:i?s_e(a.horizon):mne(a.horizon)}),!i&&s.jsx(ot,{tone:"neutral",children:gne(a.category)}),s.jsx(ot,{tone:"neutral",children:i?o_e(a.confidence):`${yne(a.confidence)} confidence`})]}),s.jsx("p",{className:"text-sm font-medium text-zinc-100",children:a.title})]})]}),s.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:a.action}),s.jsx(h_e,{items:c,limit:3,className:"mt-3"}),d&&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:i?"See the data behind this":"Evidence details"}),a.why.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:i?"Why this matters":"Why"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.why.map((f,p)=>s.jsx("li",{children:f},p))})]}),a.evidence.length>0&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"eyebrow-soft mb-1",children:i?"What we saw":"Evidence"}),s.jsx("ul",{className:"list-disc space-y-1 pl-4",children:a.evidence.map((f,p)=>s.jsx("li",{children:f},p))})]})]}),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:i?"What success looks like:":"Win condition:"})," ",a.successMetric]})]},`${a.priority}-${a.title}`)})})]})}function e5({label:e,value:t,displayValue:n,max:r,barClass:i}){const a=r>0?Math.max(t/r*100,1.5):0;return s.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-3 text-sm",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"truncate text-zinc-300",title:e,children:e}),s.jsx("div",{className:"mt-1 h-2 overflow-hidden rounded-full bg-zinc-800/80",children:s.jsx("div",{className:`h-full rounded-full ${i}`,style:{width:`${a}%`}})})]}),s.jsx("span",{className:"whitespace-nowrap text-sm font-semibold text-zinc-100",children:n})]})}function c_e({report:e}){const t=e.aiSourceOrigin.topDomains.slice(0,5),n=e.gsc,r=e.indexingHealth,i=wne(e).slice(0,5),a=t.length>0?Math.max(...t.map(d=>d.count)):0,l=n?Math.max(...n.topQueries.slice(0,5).map(d=>d.impressions),1):0,c=t.length>0||n!==null||r!==null||i.length>0;return s.jsxs("section",{className:"page-section-divider",children:[s.jsx(Xh,{eyebrow:"What we based this on",title:"The signals behind this plan",subtitle:"The data behind the recommendations above. Switch to Agency for the full breakdowns."}),c?s.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[t.length>0&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Where AI gets its answers"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"The websites AI tools cited most often when answering customer questions about your industry."}),s.jsx("div",{className:"mt-4 space-y-3",children:t.map(d=>s.jsx(e5,{label:d.domain+(d.isCompetitor?" (competitor)":""),value:d.count,displayValue:`${xr(d.count)}×`,max:a,barClass:"bg-zinc-400/70"},d.domain))})]}),r&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Pages Google can find on your site"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Google indexing your site increases the chances of it appearing in AI search (especially Gemini)."}),s.jsxs("p",{className:`mt-4 text-5xl font-bold tracking-tight ${r.indexedPct>=90?"text-emerald-400":r.indexedPct>=70?"text-amber-400":"text-rose-400"}`,children:[r.indexedPct,"%"]}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:[xr(r.indexed)," of ",xr(r.total)," pages indexed"]}),s.jsx("div",{className:"mt-3 h-3 overflow-hidden rounded-full bg-zinc-800/80",children:s.jsx("div",{className:`h-full rounded-full ${r.indexedPct>=90?"bg-emerald-500/70":r.indexedPct>=70?"bg-amber-500/70":"bg-rose-500/70"}`,style:{width:`${Math.max(r.indexedPct,1.5)}%`}})}),s.jsxs("p",{className:"mt-3 text-xs text-zinc-400",children:[s.jsx("span",{className:"font-medium text-zinc-200",children:xr(r.notIndexed)})," ",r.notIndexed===1?"page is":"pages are"," not indexed yet."]})]}),n&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"What people search Google for"}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["You appeared in ",s.jsx("span",{className:"font-semibold text-zinc-200",children:xr(n.totalImpressions)})," Google searches and got ",s.jsx("span",{className:"font-semibold text-zinc-200",children:xr(n.totalClicks)})," ",n.totalClicks===1?"click":"clicks"," this period."]}),n.topQueries.length>0&&s.jsx("div",{className:"mt-4 space-y-3",children:n.topQueries.slice(0,5).map(d=>s.jsx(e5,{label:d.query,value:d.impressions,displayValue:`${xr(d.impressions)} ${d.impressions===1?"search":"searches"}`,max:l,barClass:"bg-sky-500/70"},d.query))})]}),i.length>0&&s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-5",children:[s.jsx("p",{className:"text-sm font-semibold text-zinc-100",children:"Topics where you could improve"}),s.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Customer questions where better content on your site would help AI cite you."}),s.jsx("ul",{className:"mt-4 space-y-2 text-sm text-zinc-300",children:i.map((d,f)=>s.jsxs("li",{className:"rounded-lg border border-zinc-800/60 bg-zinc-950/40 px-3 py-2",children:[s.jsx("p",{className:"font-medium text-zinc-100",children:d.query}),s.jsx("p",{className:"mt-0.5 text-xs text-zinc-400",children:Xte(d.action)})]},f))})]})]}):s.jsx(sE,{message:"No supporting evidence yet — this fills in after the first AI check."})]})}const u_e=14;function iE(e){return e==="up"?"positive":e==="down"?"negative":"neutral"}function aE(e){return e==="up"?"↑":e==="down"?"↓":"→"}function Hj({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=iE(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:aE(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 t5({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=iE(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:[xr(t.current)," ",s.jsx("span",{className:"text-sm font-medium",children:aE(t.direction)})]}),s.jsxs("p",{className:"mt-1 text-[11px] text-zinc-500",children:[r,xr(t.deltaAbs)," ",n," vs prior ",u_e," days"]})]})}function d_e({movements:e,audience:t}){const n=e.filter(i=>i.direction!=="flat");if(n.length===0)return null;const r=t==="client";return s.jsxs("div",{className:"mt-4",children:[s.jsx("p",{className:"eyebrow mb-2",children:r?"How each AI tool changed":"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:r?"AI tool":"Engine"}),s.jsx("th",{children:r?"Was":"Prior"}),s.jsx("th",{children:r?"Now":"Current"}),s.jsx("th",{children:"Change"})]})}),s.jsx("tbody",{children:n.map(i=>{const a=i.deltaAbs>0?"+":"",l=iE(i.direction),c=l==="positive"?"text-emerald-400":l==="negative"?"text-rose-400":"text-zinc-300";return s.jsxs("tr",{children:[s.jsx("td",{children:r?jv(i.provider):i.provider}),s.jsxs("td",{children:[i.prior,"%"]}),s.jsxs("td",{children:[i.current,"%"]}),s.jsxs("td",{className:c,children:[a,i.deltaAbs.toFixed(1),"% ",aE(i.direction)]})]},i.provider)})})]})})]})}function n5({insights:e,heading:t,emptyMessage:n,audience:r}){if(e.length===0)return 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})]});const i=r==="client";return 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:[!i&&s.jsx("th",{children:"Severity"}),s.jsx("th",{children:i?"What changed":"Title"}),s.jsx("th",{children:i?"Customer question":"Query"}),s.jsx("th",{children:i?"AI tool":"Provider"})]})}),s.jsx("tbody",{children:e.map(a=>s.jsxs("tr",{children:[!i&&s.jsxs("td",{children:[s.jsx(ot,{tone:Yze[a.severity],children:pne(a.severity)}),a.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),s.jsxs("td",{className:"evidence-query-cell",children:[a.title,i&&a.instanceCount>1&&s.jsxs("span",{className:"ml-2 text-[11px] text-zinc-500",children:["×",a.instanceCount]})]}),s.jsx("td",{className:"text-xs text-zinc-400",children:a.query}),s.jsx("td",{className:"text-xs text-zinc-400",children:i?jv(a.provider):a.provider})]},a.id))})]})})]})}function f_e({report:e,audience:t}){const n=e.whatsChanged,r=t==="client",i=!n.enoughHistory&&!n.gscClicksDelta&&!n.aiReferralsDelta&&n.wins.length===0&&n.regressions.length===0,a=s.jsx(Xh,{eyebrow:r?"Since last check":"Section 2",title:r?"What's different since last check":"What's Changed",subtitle:r?void 0:n.headline});return i?s.jsxs("section",{className:"page-section-divider",children:[a,s.jsx(sE,{message:r?"No comparison yet — trends will appear after a few more checks.":"Trends will appear after a few more checks."})]}):s.jsxs("section",{className:"page-section-divider",children:[a,s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-5",children:[s.jsx(Hj,{label:r?"AI links to your website":"Citation rate",delta:n.citationRate,unit:"%"}),s.jsx(Hj,{label:r?"AI mentions your name":"Mention rate",delta:n.mentionRate,unit:"%"}),s.jsx(Hj,{label:r?"Questions AI answered with you":"Cited queries",delta:n.citedQueryCount,unit:"count"}),s.jsx(t5,{label:r?"Visitors from Google":"GSC clicks",delta:n.gscClicksDelta,countLabel:r?"visits":"clicks"}),s.jsx(t5,{label:r?"Visitors from AI tools":"AI referral sessions",delta:n.aiReferralsDelta,countLabel:r?"visits":"sessions"})]}),s.jsx(d_e,{movements:n.providerMovements,audience:t}),s.jsx(n5,{insights:n.wins,heading:r?"What got better":"Wins",emptyMessage:r?"No new wins this period.":"No new gains in the latest check.",audience:t}),s.jsx(n5,{insights:n.regressions,heading:r?"What got worse":"Regressions",emptyMessage:r?"Nothing got worse this period.":"No new regressions in the latest check.",audience:t})]})}function r5({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 Xh({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 h_e({items:e,limit:t=3,className:n}){if(e.length===0)return null;const r=e.slice(0,t),i=e.length-r.length;return 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 sE({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),[c,d]=x.useState(null),[f,p]=x.useState(e.displayName),[m,y]=x.useState(e.canonicalDomain),[v,w]=x.useState(e.country),[b,j]=x.useState(e.language),[k,E]=x.useState(e.ownedDomains??[]),[A,C]=x.useState(""),[_,O]=x.useState(e.aliases??[]),[z,R]=x.useState(""),[$,F]=x.useState(null),[M,U]=x.useState(!1),[K,Z]=x.useState(!1),[Y,H]=x.useState(""),[X,ue]=x.useState(""),[xe,L]=x.useState(""),[q,I]=x.useState(""),[D,V]=x.useState("");x.useEffect(()=>{r||(p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),E(e.ownedDomains??[]),O(e.aliases??[]))},[e,r]);function re(){i(!1),d(null),p(e.displayName),y(e.canonicalDomain),w(e.country),j(e.language),E(e.ownedDomains??[]),O(e.aliases??[]),C(""),R("")}function ee(){const Se=A.trim();Se&&(k.includes(Se)||E([...k,Se]),C(""))}function Ee(Se){E(k.filter(Re=>Re!==Se))}function Te(){const Se=z.trim();if(!Se)return;const Re=Se.toLowerCase();_.some(Bt=>Bt.toLowerCase()===Re)||O([..._,Se]),R("")}function ne(Se){O(_.filter(Re=>Re!==Se))}async function he(){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,aliases:_,country:v.trim(),language:b.trim()}),i(!1),ut({title:"Project settings saved",detail:`${f.trim()} was updated.`,tone:"positive",dedupeKey:`project:update:${e.name}`,dedupeMode:"replace"})}catch(Se){d(Se instanceof Error?Se.message:"Failed to save")}finally{l(!1)}}}async function je(){const Se=Y.trim(),Re=X.trim(),Bt=xe.trim(),cn=q.trim();if(!(!Se||!Re||!Bt||!cn)){U(!0),F(null);try{const un={label:Se,city:Re,region:Bt,country:cn};D.trim()&&(un.timezone=D.trim()),await MV(e.name,un),n(),H(""),ue(""),L(""),I(""),V(""),Z(!1),ut({title:"Location added",detail:`${Se} is now available for ${e.name}.`,tone:"positive",dedupeKey:`project:location:add:${e.name}:${Se}`,dedupeMode:"drop"})}catch(un){F(un instanceof Error?un.message:"Failed to add location")}finally{U(!1)}}}async function me(Se){U(!0),F(null);try{await IV(e.name,Se),n(),ut({title:"Location removed",detail:`${Se} was removed from ${e.name}.`,tone:"positive",dedupeKey:`project:location:remove:${e.name}:${Se}`,dedupeMode:"drop"})}catch(Re){F(Re instanceof Error?Re.message:"Failed to remove location")}finally{U(!1)}}async function tt(Se){U(!0),F(null);try{await LV(e.name,Se),n(),ut({title:"Default location updated",detail:`${Se} is now the default for ${e.name}.`,tone:"positive",dedupeKey:`project:location:default:${e.name}`,dedupeMode:"replace"})}catch(Re){F(Re instanceof Error?Re.message:"Failed to set default location")}finally{U(!1)}}const Ie=f!==e.displayName||m!==e.canonicalDomain||v!==e.country||b!==e.language||JSON.stringify(k)!==JSON.stringify(e.ownedDomains??[])||JSON.stringify(_)!==JSON.stringify(e.aliases??[]),Ze="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",nt="block text-xs font-medium text-zinc-400 mb-1",Wt=Y.trim()&&X.trim()&&xe.trim()&&q.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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>i(!0),children:"Edit settings"})]}),c&&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:[c,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:nt,children:"Display name"}),s.jsx("input",{className:Ze,type:"text",value:f,onChange:Se=>p(Se.target.value),placeholder:"My Project"})]}),s.jsxs("div",{children:[s.jsx("label",{className:nt,children:"Canonical domain"}),s.jsx("input",{className:Ze,type:"text",value:m,onChange:Se=>y(Se.target.value),placeholder:"example.com"})]}),s.jsxs("div",{children:[s.jsx("label",{className:nt,children:"Country"}),s.jsx("input",{className:Ze,type:"text",value:v,onChange:Se=>w(Se.target.value),placeholder:"US",maxLength:2})]}),s.jsxs("div",{children:[s.jsx("label",{className:nt,children:"Language"}),s.jsx("input",{className:Ze,type:"text",value:b,onChange:Se=>j(Se.target.value),placeholder:"en"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:nt,children:"Owned domains"}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:k.map(Se=>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:[Se,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>Ee(Se),"aria-label":`Remove ${Se}`,children:"×"})]},Se))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{className:`${Ze} flex-1`,type:"text",placeholder:"docs.example.com",value:A,onChange:Se=>C(Se.target.value),onKeyDown:Se=>Se.key==="Enter"&&(Se.preventDefault(),ee())}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:!A.trim(),onClick:ee,children:"Add"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:nt,children:"Aliases"}),s.jsx("p",{className:"text-[11px] text-zinc-500 mb-1.5",children:'Additional brand names checked against LLM answer text. Use for product names, prior names, or DBAs (e.g. add "Meta" as an alias to facebook.com).'}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:_.map(Se=>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:[Se,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",onClick:()=>ne(Se),"aria-label":`Remove ${Se}`,children:"×"})]},Se))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{className:`${Ze} flex-1`,type:"text",placeholder:"Facebook",value:z,onChange:Se=>R(Se.target.value),onKeyDown:Se=>Se.key==="Enter"&&(Se.preventDefault(),Te())}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:!z.trim(),onClick:Te,children:"Add"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2 border-t border-zinc-800/60",children:[s.jsx(pe,{type:"button",disabled:a||!Ie||!f.trim()||!m.trim(),onClick:Ke(he),children:a?"Saving...":"Save changes"}),s.jsx(pe,{type:"button",variant:"outline",disabled:a,onClick:re,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(Se=>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:Se},Se))}):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:"Aliases"}),s.jsx("td",{className:"px-4 py-2.5",children:(e.aliases??[]).length>0?s.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.aliases.map(Se=>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:Se},Se))}):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:[$&&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:[$,s.jsx("button",{type:"button",className:"ml-1 text-rose-400 hover:text-rose-200",onClick:()=>F(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(Se=>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 ${Se.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:[Se.label,Se.label===e.defaultLocation?" ★":""]})}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Se.city}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Se.region}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-300",children:Se.country}),s.jsx("td",{className:"py-1.5 pr-3 text-zinc-500",children:Se.timezone??"—"}),s.jsx("td",{className:"py-1.5",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[Se.label!==e.defaultLocation&&s.jsx("button",{type:"button",disabled:M,onClick:()=>{tt(Se.label)},className:"text-[10px] text-zinc-500 hover:text-emerald-400 transition-colors disabled:opacity-40","aria-label":`Set ${Se.label} as default location`,children:"Set default"}),s.jsx("button",{type:"button",disabled:M,onClick:()=>{me(Se.label)},className:"text-[10px] text-zinc-500 hover:text-rose-400 transition-colors disabled:opacity-40","aria-label":`Remove location ${Se.label}`,children:"Remove"})]})})]},Se.label))})]}):s.jsx("p",{className:"text-zinc-500 text-xs mb-2",children:"No locations configured"}),K?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:Ze,type:"text",value:Y,onChange:Se=>H(Se.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:Ze,type:"text",value:X,onChange:Se=>ue(Se.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:Ze,type:"text",value:xe,onChange:Se=>L(Se.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:Ze,type:"text",value:q,onChange:Se=>I(Se.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:Ze,type:"text",value:D,onChange:Se=>V(Se.target.value),placeholder:"America/New_York"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[s.jsx(pe,{type:"button",size:"sm",disabled:M||!Wt,onClick:Ke(je),children:M?"Adding...":"Add location"}),s.jsx(pe,{type:"button",size:"sm",variant:"outline",disabled:M,onClick:()=>{Z(!1),F(null)},children:"Cancel"})]})]}):s.jsx(pe,{type:"button",size:"sm",variant:"outline",onClick:()=>Z(!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"}],i5=["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"),[c,d]=x.useState(6),[f,p]=x.useState(""),[m,y]=x.useState("UTC"),[v,w]=x.useState(!1),[b,j]=x.useState(""),[k,E]=x.useState(!1),[A,C]=x.useState(!1),[_,O]=x.useState(null);x.useEffect(()=>{HV(e).then(n).catch(()=>n(null))},[e]);const z=()=>{if(t&&t!=="loading"){const M=Vne(t.preset??null,t.cronExpr);l(M.freq),d(M.hour),p(M.customCron);const U=i5.includes(t.timezone);y(U?t.timezone:"Other"),w(!U),j(U?"":t.timezone)}else l("daily"),d(6),p(""),y("UTC"),w(!1),j("");O(null),i(!0)},R=async()=>{E(!0),O(null);try{const U={timezone:v?b.trim()||"UTC":m};a==="custom"?U.cron=f.trim():U.preset=Gne(a,c);const K=await q2(e,U);n(K),i(!1),ut({title:"Schedule saved",detail:Dw(K.preset??null,K.cronExpr,K.timezone),tone:"positive",dedupeKey:`schedule:${e}`,dedupeMode:"replace"})}catch(M){O(M instanceof Error?M.message:"Failed to save schedule")}finally{E(!1)}},$=async()=>{if(!(!t||t==="loading")){E(!0),O(null);try{const M={timezone:t.timezone,enabled:!t.enabled};t.preset?M.preset=t.preset:M.cron=t.cronExpr;const U=await q2(e,M);n(U),ut({title:U.enabled?"Schedule resumed":"Schedule paused",detail:Dw(U.preset??null,U.cronExpr,U.timezone),tone:"positive",dedupeKey:`schedule:toggle:${e}`,dedupeMode:"replace"})}catch(M){O(M instanceof Error?M.message:"Failed to update schedule")}finally{E(!1)}}},F=async()=>{C(!0),O(null);try{await KV(e),n(null),i(!1),ut({title:"Schedule removed",detail:`${e} will no longer run automatically.`,tone:"positive",dedupeKey:`schedule:remove:${e}`,dedupeMode:"drop"})}catch(M){O(M instanceof Error?M.message:"Failed to remove schedule")}finally{C(!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(pe,{type:"button",variant:"outline",size:"sm",onClick:z,children:t?"Edit schedule":"+ Set schedule"})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&!r&&t===null&&s.jsx(Pe,{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(Pe,{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:Dw(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(ot,{tone:t.enabled?"positive":"neutral",children:t.enabled?"Active":"Paused"}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",disabled:k,onClick:Ke($),children:t.enabled?"Pause":"Resume"}),s.jsx(pe,{type:"button",variant:"ghost",size:"sm",disabled:A,onClick:Ke(F),children:A?"Removing...":"Remove"})]})]}),_&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:_})]}),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:M=>l(M.target.value),children:m_e.map(M=>s.jsx("option",{value:M.value,children:M.label},M.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:c,disabled:a==="twice-daily"||a==="custom",onChange:M=>d(parseInt(M.target.value)),children:Array.from({length:24},(M,U)=>s.jsx("option",{value:U,children:v1(U)},U))})]})]}),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:M=>p(M.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:M=>{M.target.value==="Other"?(w(!0),y("Other")):(w(!1),y(M.target.value))},children:[i5.map(M=>s.jsx("option",{value:M,children:M},M)),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:M=>j(M.target.value)})]}),_&&s.jsx("p",{className:"text-rose-400 text-sm",children:_}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),O(null)},children:"Cancel"}),s.jsx(pe,{type:"button",size:"sm",disabled:k||a==="custom"&&!f.trim(),onClick:Ke(R),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(""),[c,d]=x.useState(["citation.lost","citation.gained"]),[f,p]=x.useState(!1),[m,y]=x.useState(null),[v,w]=x.useState({}),[b,j]=x.useState(new Set);x.useEffect(()=>{GV(e).then(n).catch(()=>n([]))},[e]);const k=_=>{d(O=>O.includes(_)?O.filter(z=>z!==_):[...O,_])},E=async()=>{if(!(!a.trim()||c.length===0)){p(!0),y(null);try{const _=await VV(e,{channel:"webhook",url:a.trim(),events:c});n(O=>O==="loading"?[_]:[...O,_]),l(""),d(["citation.lost","citation.gained"]),i(!1),ut({title:"Webhook added",detail:`Notifications will be sent to ${_.url}.`,tone:"positive",dedupeKey:`notification:add:${e}`,dedupeMode:"drop"})}catch(_){y(_ instanceof Error?_.message:"Failed to add webhook")}finally{p(!1)}}},A=async _=>{if(!b.has(_)){j(O=>new Set(O).add(_));try{await QV(e,_),n(O=>O==="loading"?O:O.filter(z=>z.id!==_)),ut({title:"Webhook removed",detail:`${e} no longer sends notifications to this endpoint.`,tone:"positive",dedupeKey:`notification:remove:${e}:${_}`,dedupeMode:"drop"})}catch(O){y(O instanceof Error?O.message:"Failed to remove webhook")}finally{j(O=>{const z=new Set(O);return z.delete(_),z})}}},C=async _=>{w(O=>({...O,[_]:{state:"testing"}}));try{const O=await YV(e,_);w(z=>({...z,[_]:{state:O.ok?"ok":"fail",status:O.status}})),O.ok&&ut({title:"Test notification sent",detail:`Webhook returned status ${O.status}.`,tone:"positive",dedupeKey:`notification:test:${e}:${_}`,dedupeMode:"replace"})}catch{w(O=>({...O,[_]:{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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!r),y(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:_=>l(_.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(_=>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:c.includes(_.value),onChange:()=>k(_.value)}),s.jsx("span",{className:"text-sm text-zinc-300",children:_.label})]},_.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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{i(!1),y(null)},children:"Cancel"}),s.jsx(pe,{type:"button",size:"sm",disabled:f||!a.trim()||c.length===0,onClick:Ke(E),children:f?"Adding...":"Add webhook"})]})]}),t==="loading"&&s.jsx("p",{className:"supporting-copy",children:"Loading..."}),t!=="loading"&&t.length===0&&!r&&s.jsx(Pe,{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(_=>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:_.urlHost,children:_.urlDisplay??_.url})}),s.jsx("td",{children:s.jsx("div",{className:"flex flex-wrap gap-1",children:_.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(ot,{tone:_.enabled?"positive":"neutral",children:_.enabled?"Active":"Paused"})}),s.jsx("td",{children:s.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[v[_.id]&&(()=>{const O=v[_.id],z=O.state==="testing"?"Sending…":O.state==="ok"?`Delivered${O.status?` (${O.status})`:""}`:`Failed${O.status?` (${O.status})`:""}`;return s.jsx(ot,{tone:O.state==="ok"?"positive":O.state==="fail"?"negative":"neutral",children:z})})(),s.jsx(pe,{variant:"ghost",size:"sm",type:"button",disabled:v[_.id]?.state==="testing",onClick:()=>{C(_.id)},children:"Test"}),s.jsx(pe,{variant:"ghost",size:"sm",type:"button",disabled:b.has(_.id),onClick:()=>{A(_.id)},children:b.has(_.id)?"Removing…":"Remove"})]})})]},_.id))})]}),m&&s.jsx("p",{className:"text-rose-400 text-sm mt-2",children:m})]})]})}function x_e({projectName:e,refreshNonce:t}){const n=Hn(),[r,i]=x.useState(null),[a,l]=x.useState([]),[c,d]=x.useState(null),[f,p]=x.useState([]),[m,y]=x.useState([]),[v,w]=x.useState(null),[b,j]=x.useState(""),[k,E]=x.useState(""),[A,C]=x.useState(""),[_,O]=x.useState(!0),[z,R]=x.useState(!1),[$,F]=x.useState(null),[M,U]=x.useState("performance");x.useEffect(()=>{K()},[e,t]);async function K(){O(!0),F(null);try{const I=await n.fetchQuery({queryKey:_e.bing.status(e),queryFn:()=>o4(e),staleTime:vr});if(i(I),I.connected){const[D,V,re,ee]=await Promise.all([n.fetchQuery({queryKey:_e.bing.coverage(e),queryFn:()=>mk(e).catch(()=>null),staleTime:vr}),n.fetchQuery({queryKey:_e.bing.inspections(e),queryFn:()=>l4(e).catch(()=>[]),staleTime:vr}),n.fetchQuery({queryKey:_e.bing.performance(e),queryFn:()=>NQ(e).catch(()=>[]),staleTime:vr}),I.siteUrl?Promise.resolve([]):n.fetchQuery({queryKey:_e.bing.sites(e),queryFn:()=>wQ(e).then(Ee=>Ee.sites).catch(()=>[]),staleTime:vr})]);d(D),p(V),y(re),l(ee)}else d(null),p([]),y([]),l([])}catch(I){F(I instanceof Error?I.message:"Failed to load Bing data")}finally{O(!1)}}async function Z(){if(k.trim()){F(null);try{const I=await xQ(e,k.trim());await n.invalidateQueries({queryKey:_e.bing.project(e)}),E(""),I.availableSites.length>0&&l(I.availableSites),await K()}catch(I){F(I instanceof Error?I.message:"Failed to connect")}}}async function Y(){try{await bQ(e),await n.invalidateQueries({queryKey:_e.bing.project(e)}),i(null),l([]),d(null),p([]),y([]),w(null),C(""),F(null)}catch(I){F(I instanceof Error?I.message:"Failed to disconnect")}}async function H(){if(A)try{await SQ(e,A),await n.invalidateQueries({queryKey:_e.bing.project(e)}),await K()}catch(I){F(I instanceof Error?I.message:"Failed to set site")}}async function X(){if(b.trim())try{const I=await c4(e,b.trim());await n.invalidateQueries({queryKey:_e.bing.project(e)}),w(I),p(D=>[I,...D])}catch(I){F(I instanceof Error?I.message:"Inspection failed")}}async function ue(I){R(!0),F(null);try{const D=await K2(e,{urls:[I]}),{succeeded:V,failed:re,total:ee}=D.summary;ut({title:"Bing submission requested",detail:re===0?`${V} URL submitted to Bing.`:`${V}/${ee} submitted successfully, ${re} failed.`,tone:re===0?"positive":"caution",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}catch(D){const V=D instanceof Error?D.message:"Submission failed";F(V),ut({title:"Bing submission failed",detail:V,tone:"negative",dedupeKey:`bing:indexing:${e}:${I}`,dedupeMode:"replace"})}finally{R(!1)}}async function xe(){R(!0),F(null),ut({title:"Submitting URLs to Bing",detail:"Requesting indexing for all currently unindexed URLs.",tone:"neutral",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"});try{const I=await K2(e,{allUnindexed:!0}),{succeeded:D,failed:V,total:re}=I.summary;ut({title:"Bing submissions requested",detail:V===0?`${D}/${re} URL${re!==1?"s":""} submitted to Bing.`:`${D}/${re} submitted successfully, ${V} failed.`,tone:V===0?"positive":"caution",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}catch(I){const D=I instanceof Error?I.message:"Batch submission failed";F(D),ut({title:"Bing submissions failed",detail:D,tone:"negative",dedupeKey:`bing:indexing-all:${e}`,dedupeMode:"replace"})}finally{R(!1)}}if(_)return s.jsx(Pe,{className:"surface-card",children:s.jsx("div",{className:"text-sm text-zinc-400",children:"Loading Bing data..."})});if(!r?.connected)return s.jsxs(Pe,{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(ot,{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:I=>E(I.target.value),onKeyDown:I=>{I.key==="Enter"&&Z()}}),s.jsx(pe,{size:"sm",disabled:!k.trim(),onClick:Ke(Z),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(Pe,{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(ot,{tone:"positive",children:"Connected"}),s.jsx(pe,{size:"sm",variant:"ghost",onClick:Ke(Y),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?ma(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:A,onChange:I=>C(I.target.value),children:[s.jsx("option",{value:"",children:"Select a site..."}),a.map(I=>s.jsxs("option",{value:I.url,children:[I.url,I.verified?" (verified)":""]},I.url))]}),s.jsx(pe,{size:"sm",disabled:!A,onClick:Ke(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 L=[{key:"performance",label:"Performance",eyebrow:"Performance",title:"Search performance"},{key:"coverage",label:"Coverage",eyebrow:"Coverage",title:"Index monitoring"},{key:"inspections",label:"Inspections",eyebrow:"Inspection",title:"URL inspection history"}],q=L.find(I=>I.key===M)??L[0];return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(Pe,{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(ot,{tone:"positive",children:"Connected"}),s.jsx(pe,{size:"sm",variant:"ghost",onClick:Ke(Y),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?ma(r.updatedAt):"—"})]})]})]})]}),s.jsxs(Pe,{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:q.eyebrow}),s.jsx("h3",{children:q.title})]}),s.jsx("p",{className:"text-xs text-zinc-500",children:c?.lastInspectedAt?`Last inspected ${ma(c.lastInspectedAt)}`:"No inspection history yet"})]}),s.jsx("div",{className:"flex gap-1 border-b border-zinc-800",children:L.map(I=>s.jsx("button",{className:`px-3 py-1.5 text-xs font-medium border-b-2 transition-colors ${M===I.key?"border-zinc-200 text-zinc-200":"border-transparent text-zinc-500 hover:text-zinc-300"}`,onClick:()=>U(I.key),children:I.label},I.key))}),M==="coverage"&&c&&s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"grid gap-3 sm:grid-cols-4",children:[s.jsx(lg,{label:"Indexed",value:c.summary.indexed,tone:"positive"}),s.jsx(lg,{label:"Not in index",value:c.summary.notIndexed+(c.summary.unknown??0),tone:"negative"}),s.jsx(lg,{label:"Status unknown",value:c.summary.unknown??0,tone:"neutral"}),s.jsx(lg,{label:"Coverage",value:`${c.summary.percentage}%`,tone:"neutral"})]}),c.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 (",c.notIndexed.length,")"]}),s.jsx(pe,{size:"sm",variant:"ghost",disabled:z,onClick:Ke(xe),children:z?"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:c.notIndexed.map(I=>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:I.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.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:z,onClick:()=>{ue(I.url)},children:"Submit"})})]},I.id))})]})})]}),(c.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 (",(c.unknown??[]).length,")"]}),s.jsx(pe,{size:"sm",variant:"ghost",disabled:z,onClick:Ke(xe),children:z?"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:(c.unknown??[]).map(I=>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:I.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.lastCrawledDate?ma(I.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:z,onClick:()=>{ue(I.url)},children:"Submit"})})]},I.id))})]})})]}),c.indexed.length>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"mb-2 text-xs font-medium text-zinc-400",children:["Indexed (",c.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:c.indexed.map(I=>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:I.url}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.lastCrawledDate?ma(I.lastCrawledDate):"—"})]},I.id))})]})})]})]}),M==="coverage"&&!c&&s.jsx("p",{className:"mt-4 text-xs text-zinc-500",children:"No coverage data yet. Inspect URLs to build coverage data."}),M==="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:I=>j(I.target.value),onKeyDown:I=>{I.key==="Enter"&&X()}}),s.jsx(pe,{size:"sm",disabled:!b.trim(),onClick:Ke(X),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(I=>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:I.url}),s.jsx("td",{className:"py-1.5 px-3",children:s.jsx(ot,{tone:I.inIndex?"positive":"negative",children:I.inIndex?"Yes":"No"})}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:I.httpCode??"—"}),s.jsx("td",{className:"py-1.5 px-3 text-zinc-400",children:ma(I.inspectedAt)})]},I.id))})]})})]}),M==="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:Hm[Mo.Clicks]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-16",children:Hm[Mo.Impressions]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Hm[Mo.CTR]}),s.jsx("th",{className:"text-right py-1.5 px-3 text-zinc-500 font-medium w-14",children:Hm[Mo.Position]})]})}),s.jsx("tbody",{children:m.map((I,D)=>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:I.query}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-200",children:I.clicks}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:I.impressions}),s.jsxs("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:[(Number.isFinite(I.ctr)?I.ctr*100:0).toFixed(1),"%"]}),s.jsx("td",{className:"py-1.5 px-3 text-right text-zinc-400",children:I.averagePosition.toFixed(1)})]},D))})]})})})]})]})}function b_e({projectName:e}){const t=Hn(),[n,r]=x.useState("google"),[i,a]=x.useState(!0),[l,c]=x.useState("idle"),[d,f]=x.useState(null),p=x.useRef(null),[m,y]=x.useState(!1),[v,w]=x.useState(null),[b,j]=x.useState(null),[k,E]=x.useState(!1),[A,C]=x.useState(null),[_,O]=x.useState(null),[z,R]=x.useState(0);async function $(I=!1){I||a(!0),f(null);try{const[D,V,re]=await Promise.all([hk().catch(()=>null),t.fetchQuery({queryKey:_e.gsc.connections(e),queryFn:()=>a4(e).catch(()=>[]),staleTime:vr}),t.fetchQuery({queryKey:_e.bing.status(e),queryFn:()=>o4(e).catch(()=>null),staleTime:vr})]),ee=V.find(ne=>ne.connectionType==="gsc")??null;y(!!D?.google?.configured),E(!!D?.bing?.configured),w(ee),C(re);const[Ee,Te]=await Promise.all([ee?t.fetchQuery({queryKey:_e.gsc.coverage(e),queryFn:()=>pk(e).catch(()=>null),staleTime:vr}):Promise.resolve(null),re?.connected?t.fetchQuery({queryKey:_e.bing.coverage(e),queryFn:()=>mk(e).catch(()=>null),staleTime:vr}):Promise.resolve(null)]);j(Ee),O(Te)}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 I=new AbortController;p.current=I;const D=I.signal;c("syncing"),f(null);const V=[];try{async function re(){if(!v)return;const ne=await s4(e);if(!ne?.id)return;const he=2e3,me=Date.now()+12e4;for(;Date.now()<me;){if(D.aborted||(await new Promise(Ie=>setTimeout(Ie,he)),D.aborted))return;const tt=await Go(ne.id).catch(()=>null);if(!tt)break;if(["completed","failed","cancelled"].includes(tt.status)){tt.status!=="completed"&&V.push(`Google sync ${tt.status}`);break}}}const ee=10;async function Ee(){if(!A?.connected)return;const ne=await l4(e).catch(()=>[]),he=[...new Set(ne.map(je=>je.url))];if(he.length===0){await jQ(e).catch(()=>null);return}for(let je=0;je<he.length;je+=ee){if(D.aborted)return;const me=he.slice(je,je+ee),Ie=(await Promise.allSettled(me.map(Ze=>c4(e,Ze)))).filter(Ze=>Ze.status==="rejected").length;Ie>0&&V.push(`${Ie} Bing inspection(s) failed`)}}const Te=await Promise.allSettled([re(),Ee()]);for(const ne of Te)ne.status==="rejected"&&V.push(ne.reason instanceof Error?ne.reason.message:"Sync failed");if(D.aborted)return;c("reloading"),await Promise.all([t.invalidateQueries({queryKey:_e.gsc.project(e)}),t.invalidateQueries({queryKey:_e.bing.project(e)})]),await $(!0),R(ne=>ne+1),V.length>0&&f(`Partial refresh: ${V.join("; ")}`)}catch(re){D.aborted||f(re instanceof Error?re.message:"Refresh failed")}finally{D.aborted||c("idle")}}x.useEffect(()=>($(),()=>{p.current?.abort()}),[e]);const M=v?"positive":m?"caution":"negative",U=v?"Connected":m?"Ready to connect":"Needs setup",K=b?`${b.summary.percentage}% indexed`:v?"Awaiting coverage":"No coverage data",Z=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",Y=b?.lastSyncedAt??b?.lastInspectedAt??v?.updatedAt??null,H=A?.connected?"positive":k?"caution":"negative",X=A?.connected?"Connected":k?"Ready to connect":"Needs setup",ue=_?`${_.summary.percentage}% indexed`:A?.connected?"Awaiting coverage":"No coverage data",xe=_?_.summary.notIndexed+(_.summary.unknown??0):0,L=_?`${xe} not in index`:A?.connected?"Inspect URLs to populate coverage":k?"Connect Bing Webmaster Tools for this domain":"Add a Bing API key in Settings",q=_?.lastInspectedAt??A?.updatedAt??null;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Pe,{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(pe,{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(rR,{eyebrow:"Google",title:"Google Search Console",status:i?"Loading…":U,tone:i?"neutral":M,targetLabel:"Selected property",targetValue:v?.propertyId??"No property selected",coverageValue:i?"Loading…":K,note:i?"Loading overview…":Z,updatedAt:Y,active:n==="google",onClick:()=>r("google")}),s.jsx(rR,{eyebrow:"Bing",title:"Bing Webmaster Tools",status:i?"Loading…":X,tone:i?"neutral":H,targetLabel:"Selected site",targetValue:A?.siteUrl??"No site selected",coverageValue:i?"Loading…":ue,note:i?"Loading overview…":L,updatedAt:q,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(([I,D])=>s.jsx("button",{type:"button",role:"tab","aria-selected":n===I,className:`project-subnav-link ${n===I?"project-subnav-link-active":""}`,onClick:()=>r(I),children:D},I))}),n==="google"&&s.jsx(_ze,{projectName:e,refreshNonce:z}),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:z})]})]})}function w_e({summary:e,onJumpToEvidence:t}){if(!e.hasPreviousRun)return s.jsxs("section",{className:"movement-banner",children:[s.jsx("span",{className:"movement-banner-label",children:"Since last run"}),s.jsx("span",{className:"text-zinc-500",children:"First run — no comparison yet"})]});const n=e.gained,r=e.lost,i=n===0&&r===0?"· no changes":n>r?"· improving":r>n?"· declining":"";return s.jsxs("section",{className:"movement-banner",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"movement-banner-label",children:"Since last run"}),n>0?s.jsxs("button",{type:"button",className:"movement-banner-chip text-emerald-400 font-medium",onClick:t,title:"Jump to the queries that gained citations",children:["+",n," gained"]}):s.jsx("span",{className:"text-zinc-500",children:"+0 gained"}),s.jsx("span",{className:"text-zinc-700 mx-1",children:"·"}),r>0?s.jsxs("button",{type:"button",className:"movement-banner-chip text-rose-400 font-medium",onClick:t,title:"Jump to the queries that lost citations",children:["−",r," lost"]}):s.jsx("span",{className:"text-zinc-500",children:"−0 lost"}),s.jsx("span",{className:"text-zinc-600 ml-2",children:i})]}),e.gainedQueries?.length||e.lostQueries?.length?s.jsxs("div",{className:"movement-banner-detail",children:[e.gainedQueries&&e.gainedQueries.length>0&&s.jsxs("p",{children:[s.jsx("span",{className:"text-emerald-500/90",children:"Gained:"})," ",s.jsx("span",{className:"text-zinc-300",children:a5(e.gainedQueries)})]}),e.lostQueries&&e.lostQueries.length>0&&s.jsxs("p",{children:[s.jsx("span",{className:"text-rose-500/90",children:"Lost:"})," ",s.jsx("span",{className:"text-zinc-300",children:a5(e.lostQueries)})]})]}):null]})}function a5(e,t=4){return e.length<=t?e.map(r=>`"${r}"`).join(", "):`${e.slice(0,t).map(r=>`"${r}"`).join(", ")}, and ${e.length-t} more`}function S_e({summary:e,projectLabel:t}){const n=e.breakdown;if(n.perCompetitor.length===0)return null;const r=n.projectMentionSnapshots+n.competitorMentionSnapshots;if(r===0)return null;const i=[{label:`${t} (you)`,mentions:n.projectMentionSnapshots,isYou:!0},...n.perCompetitor.map(l=>({label:l.domain,mentions:l.mentionSnapshots,isYou:!1}))].sort((l,c)=>c.mentions-l.mentions),a=i[0]?.mentions??1;return s.jsxs("div",{className:"mention-share-breakdown",children:[s.jsx("p",{className:"mention-share-breakdown-title",children:"Mention share breakdown"}),s.jsx("ul",{className:"mention-share-breakdown-rows",children:i.map(l=>{const c=l.mentions/r*100;return s.jsxs("li",{className:"mention-share-breakdown-row",children:[s.jsx("span",{className:`mention-share-breakdown-label ${l.isYou?"text-zinc-100 font-medium":"text-zinc-400"}`,children:l.label}),s.jsx("div",{className:"mention-share-breakdown-bar",children:s.jsx("div",{className:`mention-share-breakdown-bar-fill ${l.isYou?"bg-emerald-500/70":"bg-zinc-500/60"}`,style:{width:`${Math.max(l.mentions/a*100,2)}%`}})}),s.jsx("span",{className:"mention-share-breakdown-count",children:l.mentions}),s.jsxs("span",{className:"mention-share-breakdown-share",children:[c.toFixed(1),"%"]})]},l.label)})})]})}function j_e({trend:e,currentScore:t}){if(!e||e.length<2)return s.jsx("span",{className:"text-[11px] text-zinc-600",children:"—"});const n=96,r=24,i=100,a=e.length>1?n/(e.length-1):0,l=e.map((p,m)=>`${(m*a).toFixed(2)},${(r-p/i*r).toFixed(2)}`).join(" "),c=t>=70?"rgb(52 211 153)":t>=40?"rgb(251 191 36)":"rgb(251 113 133)",d=(e.length-1)*a,f=r-e[e.length-1]/i*r;return s.jsxs("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,className:"overflow-visible","aria-label":`Trend ${e.join(", ")}`,role:"img",children:[s.jsx("polyline",{points:l,fill:"none",stroke:c,strokeWidth:1.5,strokeLinejoin:"round",strokeLinecap:"round"}),s.jsx("circle",{cx:d,cy:f,r:2.5,fill:c})]})}const N_e={write:{title:"Write or update content",subtitle:"Queries with no answer, persistent gaps, or competitors winning the spot"},investigate:{title:"Investigate what changed",subtitle:"Citations or mentions you lost since the previous run"},monitor:{title:"Keep monitoring",subtitle:"Gains, new providers picking you up, holding ground"}};function k_e({insights:e,suggestedQueries:t,projectName:n}){const{openEvidence:r}=Nd(),[i,a]=x.useState(null),l=t.rows.length>0;if(e.length===0&&!l)return s.jsx("p",{className:"text-sm text-zinc-500",children:"No outstanding opportunities. Trigger a sweep to surface fresh signals."});const c=["write","investigate","monitor"],d=new Map;for(const f of e){const p=d.get(f.actionGroup)??[];p.push(f),d.set(f.actionGroup,p)}return s.jsxs("div",{className:"opportunities-grid",children:[c.map(f=>{const p=d.get(f);if(!p||p.length===0)return null;const m=N_e[f];return s.jsxs("div",{className:`opportunity-card opportunity-card-${f}`,children:[s.jsxs("div",{className:"opportunity-card-head",children:[s.jsx("p",{className:"opportunity-card-title",children:m.title}),s.jsx("span",{className:"opportunity-card-count",children:p.length})]}),s.jsx("p",{className:"opportunity-card-subtitle",children:m.subtitle}),s.jsx("div",{className:"opportunity-card-list",children:p.map(y=>{const v=i===y.id,w=y.affectedPhrases.length>0;return s.jsxs("div",{children:[s.jsx("div",{className:`opportunity-item opportunity-item-${y.tone} ${w?"cursor-pointer":""}`,onClick:w?()=>a(v?null:y.id):void 0,children:s.jsxs("div",{className:"flex items-start gap-1.5 min-w-0",children:[w&&s.jsx(tp,{size:12,className:`mt-1 shrink-0 text-zinc-500 transition-transform duration-150 ${v?"rotate-90":""}`}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100 leading-snug",children:y.title}),y.detail&&s.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5 leading-snug",children:y.detail})]})]})}),v&&s.jsx("div",{className:"opportunity-item-detail",children:y.affectedPhrases.map((b,j)=>s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[s.jsx(F1,{state:b.citationState}),s.jsx("span",{className:"text-xs text-zinc-300 truncate",children:b.query}),b.provider&&s.jsx(lc,{provider:b.provider})]}),b.evidenceId&&s.jsx("button",{type:"button",className:"text-[11px] text-zinc-400 hover:text-zinc-200 whitespace-nowrap",onClick:k=>{k.stopPropagation(),r(b.evidenceId)},children:"View →"})]},b.evidenceId||`${y.id}-${j}`))})]},y.id)})})]},f)}),l&&s.jsx(C_e,{suggestedQueries:t,projectName:n})]})}function C_e({suggestedQueries:e,projectName:t}){const n=Oze(),[r,i]=x.useState(new Set),a=p=>{i(m=>new Set(m).add(p)),n.mutate({projectName:t,queries:[p]},{onSuccess:()=>{ut({tone:"positive",title:`Tracking "${p}"`})},onError:m=>{ut({tone:"negative",title:`Couldn't add "${p}"`,detail:String(m)}),i(y=>{const v=new Set(y);return v.delete(p),v})}})},{rows:l,totalCandidates:c,skippedAlreadyTracked:d}=e,f=d>0?`GSC queries you're getting impressions for · ${d} already tracked`:"GSC queries you're getting impressions for but aren't tracking yet";return s.jsxs("div",{className:"opportunity-card opportunity-card-track",children:[s.jsxs("div",{className:"opportunity-card-head",children:[s.jsx("p",{className:"opportunity-card-title",children:"Track new queries"}),s.jsx("span",{className:"opportunity-card-count",children:c>l.length?`${l.length} of ${c}`:l.length})]}),s.jsx("p",{className:"opportunity-card-subtitle",children:f}),s.jsx("div",{className:"opportunity-card-list",children:l.map(p=>{const m=r.has(p.query);return s.jsxs("div",{className:"opportunity-item opportunity-item-neutral flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"text-sm font-medium text-zinc-100 leading-snug truncate",title:p.query,children:p.query}),s.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5 leading-snug",children:p.reason})]}),s.jsx("button",{type:"button",className:"suggested-query-add",disabled:m,onClick:()=>a(p.query),children:m?"Adding…":"+ Track"})]},p.query)})})]})}function Rc({tab:e}){const{projectId:t}=Jh({from:"/projects/$projectId"}),n=el(),{dashboard:r,isLoading:i,refetch:a}=Cc(),l=Hn();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(ae=>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"})]},ae))}),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(ae=>s.jsx("div",{className:"skeleton-text-sm w-full"},ae))})]})]});const c=tse(r,t),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(!1),[w,b]=x.useState(""),[j,k]=x.useState(!1),[E,A]=x.useState(!1),[C,_]=x.useState(""),[O,z]=x.useState(!1),[R,$]=x.useState(!1),[F,M]=x.useState(""),[U,K]=x.useState(!1),[Z,Y]=x.useState(!1),[H,X]=x.useState(""),[ue,xe]=x.useState(!1),[L,q]=x.useState(void 0),[I,D]=x.useState(!1),[V,re]=x.useState(null),[ee,Ee]=x.useState(null),[Te,ne]=x.useState(!1),he=c?.visibilityEvidence??[],je=c?.project.name??"",me=c?.project.displayName||c?.project.name||je,tt=z9(),Ie=(c?.recentRuns??[]).some(ae=>ae.kind===xt["answer-visibility"]&&(ae.status===br.running||ae.status===br.queued)),Ze=x.useMemo(()=>(c?.project.locations??[]).map(ae=>ae.label),[c?.project.locations]),nt=x.useMemo(()=>new Set(he.map(ae=>ae.location??"")),[he]),Wt=nt.has(""),Se=x.useMemo(()=>{const ae=[...nt].filter(Boolean);return ae.length>1?ae:Ze},[nt,Ze]);x.useEffect(()=>{if(L===void 0||L===""||!je){Ee(null),ne(!1);return}ne(!0),t4(je,L).then(ae=>{Ee(ae),ne(!1)}).catch(()=>{Ee(null),ne(!1)})},[L,je]);const Re=x.useMemo(()=>{if(!ee)return null;const ae=new Map;for(const Fe of ee){for(const[Qe,rt]of Object.entries(Fe.providerRuns??{}))ae.set(`${Fe.query}::${Qe}`,rt.map(pt=>({runId:pt.runId,citationState:pt.citationState,createdAt:pt.createdAt,answerMentioned:pt.answerMentioned,visibilityState:pt.visibilityState,visibilityTransition:pt.visibilityTransition,mentionState:pt.mentionState,mentionTransition:pt.mentionTransition})));(!Fe.providerRuns||Object.keys(Fe.providerRuns).length===0)&&ae.set(`${Fe.query}::`,Fe.runs.map(Qe=>({runId:Qe.runId,citationState:Qe.citationState,createdAt:Qe.createdAt,answerMentioned:Qe.answerMentioned,visibilityState:Qe.visibilityState,visibilityTransition:Qe.visibilityTransition,mentionState:Qe.mentionState,mentionTransition:Qe.mentionTransition})))}return ae},[ee]),Bt=x.useMemo(()=>{let ae=L!==void 0?he.filter(Fe=>L===""?!Fe.location:Fe.location===L):he;if(V){const Fe=V.toLowerCase();ae=ae.filter(Qe=>Qe.competitorDomains.some(rt=>rt.toLowerCase()===Fe))}return Re?ae.map(Fe=>{const Qe=Re.get(`${Fe.query}::${Fe.provider}`)??Re.get(`${Fe.query}::`);return Qe?{...Fe,runHistory:Qe}:Fe}):ae},[he,L,V,Re]);if(!c)return s.jsx("div",{className:"page-container",children:s.jsxs(Pe,{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(pe,{asChild:!0,children:s.jsx(zt,{to:"/",children:"Return to overview"})})]})});async function cn(){try{await tt.mutateAsync({projectName:je,projectLabel:me,sourceAction:"project-run"}),a()}catch{}}async function un(){m(!0);try{await $V(je),ut({title:"Project deleted",detail:`${me} was removed.`,tone:"positive",dedupeKey:`project:delete:${je}`,dedupeMode:"drop"}),n({to:"/"}),a()}catch(ae){console.error("Failed to delete project:",ae)}finally{m(!1)}}async function Rr(){try{const ae=await BV(je),Fe=typeof ae=="string"?ae:JSON.stringify(ae,null,2),Qe=new Blob([Fe],{type:"text/yaml"}),rt=URL.createObjectURL(Qe),pt=document.createElement("a");pt.href=rt,pt.download=`${je}.yaml`,pt.click()}catch(ae){ut({title:"Export failed",detail:ae instanceof Error?ae.message:"Could not export project YAML.",tone:"negative"})}}async function Kt(){const ae=w.split(`
|
|
293
|
+
`).map(Fe=>Fe.trim()).filter(Boolean);if(ae.length!==0){k(!0);try{await n4(je,ae),a(),b(""),v(!1)}finally{k(!1)}}}async function vt(){const ae=C.trim();if(ae){z(!0);try{const Qe=(await e4(je)).map(pt=>pt.domain),rt=[...new Set([...Qe,ae])];await r4(je,rt),a(),_(""),A(!1)}finally{z(!1)}}}async function de(){const ae=F.trim();if(ae){K(!0);try{const Fe=c?.project.ownedDomains??[];await $2(je,[...Fe,ae]),a(),M(""),$(!1)}finally{K(!1)}}}async function Ne(ae){K(!0);try{const Fe=c?.project.ownedDomains??[];await $2(je,Fe.filter(Qe=>Qe!==ae)),a()}finally{K(!1)}}async function Ue(){const ae=H.trim();if(ae){xe(!0);try{const Fe=c?.project.aliases??[],Qe=ae.toLowerCase();if(Fe.some(rt=>rt.toLowerCase()===Qe)){X(""),Y(!1);return}await B2(je,[...Fe,ae]),a(),X(""),Y(!1)}finally{xe(!1)}}}async function it(ae){xe(!0);try{const Fe=c?.project.aliases??[];await B2(je,Fe.filter(Qe=>Qe!==ae)),a()}finally{xe(!1)}}async function lt(ae,Fe){await RV(ae,Fe),await l.invalidateQueries({queryKey:_e.projects.all})}const mn=ae=>!Number.isNaN(Number.parseInt(ae,10)),Kn=[{key:"overview",label:"Overview",href:`/projects/${c.project.id}`},{key:"search-console",label:"Search Engine Intelligence",href:`/projects/${c.project.id}/search-console`},{key:"activity",label:"Activity",href:`/projects/${c.project.id}/activity`},{key:"report",label:"Report",href:`/projects/${c.project.id}/report`},{key:"backlinks",label:"Backlinks",href:`/projects/${c.project.id}/backlinks`},{key:"discovery",label:"Discovery",href:`/projects/${c.project.id}/discovery`},{key:"settings",label:"Settings",href:`/projects/${c.project.id}/settings`}];return s.jsxs("div",{className:"page-container",children:[d?s.jsxs(Pe,{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:c.project.displayName||c.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(pe,{type:"button",variant:"destructive",disabled:p,onClick:Ke(un),children:p?"Deleting...":"Yes, delete project"}),s.jsx(pe,{type:"button",variant:"outline",disabled:p,onClick:()=>f(!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:c.project.displayName||c.project.name}),s.jsxs("p",{className:"page-subtitle",children:[c.project.canonicalDomain,(c.project.ownedDomains??[]).length===0&&!R&&s.jsx("button",{type:"button",className:"ml-2 text-[10px] uppercase tracking-wide text-zinc-600 hover:text-zinc-400 transition-colors",onClick:()=>$(!0),children:"+ add domain"})," "," · ",c.contextLabel]}),s.jsxs("div",{className:"tag-row",children:[s.jsx("span",{className:"tag",children:c.project.country}),s.jsx("span",{className:"tag",children:c.project.language.toUpperCase()}),c.project.tags.map(ae=>s.jsx("span",{className:"tag",children:ae},ae))]}),((c.project.ownedDomains??[]).length>0||R)&&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"}),(c.project.ownedDomains??[]).map(ae=>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:[ae,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:U,onClick:()=>{Ne(ae)},"aria-label":`Remove ${ae}`,children:"×"})]},ae)),R?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:F,onChange:ae=>M(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&de()},autoFocus:!0}),s.jsx(pe,{type:"button",size:"sm",disabled:!F.trim()||U,onClick:Ke(de),children:U?"...":"Add"}),s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{$(!1),M("")},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:()=>$(!0),children:"+ domain"})]}),s.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[s.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] uppercase tracking-wide text-zinc-500 mr-1",children:["Also known as",s.jsx(Zn,{text:"Extra brand names checked against LLM answer text alongside the project name. Use for product names, prior names, or DBAs (e.g. add Meta as an alias to facebook.com). Changing these recomputes mentions on historical runs."})]}),(c.project.aliases??[]).map(ae=>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:[ae,s.jsx("button",{type:"button",className:"ml-0.5 text-zinc-500 hover:text-zinc-200 transition-colors",disabled:ue,onClick:()=>{it(ae)},"aria-label":`Remove ${ae}`,children:"×"})]},ae)),Z?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:"LlamaParse",value:H,onChange:ae=>X(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&Ue()},autoFocus:!0}),s.jsx(pe,{type:"button",size:"sm",disabled:!H.trim()||ue,onClick:Ke(Ue),children:ue?"...":"Add"}),s.jsx("button",{type:"button",className:"text-xs text-zinc-500 hover:text-zinc-300",onClick:()=>{Y(!1),X("")},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:()=>Y(!0),children:"+ alias"})]})]}),s.jsxs("div",{className:"page-header-right",children:[s.jsx("p",{className:"text-sm text-zinc-500",children:c.dateRangeLabel}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(pe,{type:"button",variant:"outline",size:"icon",onClick:Ke(Rr),"aria-label":"Export project as YAML",children:s.jsx(Tv,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(pe,{type:"button",variant:"outline",size:"icon",onClick:()=>f(!0),"aria-label":"Delete project",children:s.jsx(S4,{className:"h-4 w-4 text-zinc-400"})}),s.jsx(pe,{type:"button",disabled:tt.isPending||Ie,onClick:Ke(cn),children:tt.isPending?"Starting…":Ie?"Sweep running…":"Run now"})]})]})]}),s.jsx("nav",{className:"project-subnav","aria-label":"Project sections",children:Kn.map(ae=>s.jsx(zt,{to:ae.href,className:`project-subnav-link ${ae.key===e?"project-subnav-link-active":""}`,"aria-current":ae.key===e?"page":void 0,children:ae.label},ae.key))}),e==="overview"?s.jsxs(s.Fragment,{children:[s.jsxs("section",{className:"aeo-hero",children:[s.jsx("p",{className:"aeo-hero-title",children:"AEO performance"}),s.jsx("div",{className:"aeo-hero-rows",children:[{key:"mention",label:"Mentioned",tooltip:"Your domain or company name was in the answer returned by the LLM.",summary:c.mentionSummary},{key:"citation",label:"Cited",tooltip:"An LLM used a page on your domain as a source for its answer.",summary:c.visibilitySummary},{key:"mention-share",label:"Mention share",tooltip:"Of all brand mentions in answer text across your tracked queries (you + tracked competitors), the % that were you. Head-to-head AI prominence, not market share.",summary:c.mentionShareSummary}].map(ae=>s.jsxs("div",{className:"aeo-hero-row",children:[s.jsxs("div",{className:"aeo-hero-row-label",children:[s.jsx("span",{children:ae.label}),s.jsx(Zn,{text:ae.tooltip})]}),s.jsxs("div",{className:"aeo-hero-row-value",children:[s.jsx("span",{className:"text-zinc-50",children:ae.summary.value}),mn(ae.summary.value)?s.jsx("span",{className:"text-zinc-600",children:"%"}):null]}),s.jsx("div",{className:"aeo-hero-row-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${ae.summary.tone}`,style:{width:ae.summary.progress!==void 0?`${Math.min(Math.max(ae.summary.progress,0),100)}%`:"0%"}})}),s.jsx("div",{className:"aeo-hero-row-detail",children:ae.summary.delta})]},ae.key))}),s.jsx(S_e,{summary:c.mentionShareSummary,projectLabel:c.project.displayName||c.project.name}),c.providerScores.length>0&&s.jsxs("p",{className:"aeo-hero-context",children:["Across ",c.providerScores.length," ",c.providerScores.length===1?"provider":"providers","."]})]}),s.jsx(w_e,{summary:c.movementSummary,onJumpToEvidence:()=>document.getElementById("evidence-section")?.scrollIntoView({behavior:"smooth",block:"start"})}),s.jsxs("section",{className:"metric-grid",children:[s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Mention Gaps",s.jsx(Zn,{text:"Queries where a competitor was mentioned in the answer but your brand wasn't."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:c.mentionGaps.value}),s.jsxs("span",{className:"text-zinc-600",children:[" / ",c.queryCounts.total]})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${c.mentionGaps.tone}`,style:{width:c.mentionGaps.progress!==void 0?`${Math.min(Math.max(c.mentionGaps.progress,0),100)}%`:"0%"}})}),s.jsx("p",{className:"metric-card-detail",children:c.mentionGaps.delta})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Citation Gaps",s.jsx(Zn,{text:"Queries where a competitor was cited as a source but you weren't."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:c.gapQueries.value}),s.jsxs("span",{className:"text-zinc-600",children:[" / ",c.queryCounts.total]})]}),s.jsx("div",{className:"metric-card-bar",children:s.jsx("div",{className:`metric-card-bar-fill progress-fill-${c.gapQueries.tone}`,style:{width:c.gapQueries.progress!==void 0?`${Math.min(Math.max(c.gapQueries.progress,0),100)}%`:"0%"}})}),s.jsx("p",{className:"metric-card-detail",children:c.gapQueries.delta})]}),s.jsxs("div",{className:"metric-card",children:[s.jsxs("p",{className:"metric-card-eyebrow",children:["Index Coverage",s.jsx(Zn,{text:"Percentage of your tracked URLs that Google or Bing has indexed."})]}),s.jsxs("p",{className:"metric-card-big-value",children:[s.jsx("span",{className:"text-zinc-50",children:c.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-${c.indexCoverage.tone}`,style:{width:`${Number.parseInt(c.indexCoverage.value,10)||0}%`}})}),s.jsx("p",{className:"metric-card-detail",children:c.indexCoverage.delta})]})]}),s.jsxs("section",{id:"evidence-section",className:"page-section-divider scroll-mt-24",children:[s.jsxs("div",{className:"section-head section-head-inline",children:[s.jsxs("div",{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Answer evidence"}),s.jsx("h2",{children:"What the LLMs said"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("p",{className:"supporting-copy",children:[new Set(c.visibilityEvidence.map(ae=>ae.query)).size," queries tracked"]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>v(!y),children:y?"Cancel":"+ Add queries"})]})]}),y&&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:w,onChange:ae=>b(ae.target.value)}),s.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[s.jsxs("p",{className:"text-xs text-zinc-500",children:[w.split(`
|
|
294
|
+
`).filter(ae=>ae.trim()).length," queries"]}),s.jsx(pe,{type:"button",size:"sm",disabled:!w.trim()||j,onClick:Ke(Kt),children:j?"Adding...":"Add queries"})]})]}),c.project.locations&&c.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 ${L===void 0?"filter-chip-active":""}`,type:"button","aria-pressed":L===void 0,onClick:()=>{q(void 0)},children:"All locations"}),c.project.locations.map(ae=>s.jsx("button",{className:`filter-chip ${L===ae.label?"filter-chip-active":""}`,type:"button","aria-pressed":L===ae.label,onClick:()=>{q(ae.label),D(!1)},children:ae.label},ae.label)),Wt&&s.jsx("button",{className:`filter-chip ${L===""?"filter-chip-active":""}`,type:"button","aria-pressed":L==="",onClick:()=>{q(""),D(!1)},children:"No location"}),Se.length>1&&L===void 0&&s.jsx("button",{className:`filter-chip filter-chip-compare ${I?"filter-chip-active":""}`,type:"button","aria-pressed":I,onClick:()=>D(ae=>!ae),title:"Side-by-side location comparison",children:"Compare"})]}),V&&s.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-md border border-rose-900/40 bg-rose-950/20 px-3 py-2",children:[s.jsx("span",{className:"text-[11px] uppercase tracking-wide text-rose-400",children:"Competitor filter"}),s.jsxs("span",{className:"text-sm text-zinc-200",children:["Showing queries where ",s.jsx("span",{className:"font-semibold",children:V})," surfaced"]}),s.jsx("button",{type:"button",className:"ml-auto text-xs text-zinc-400 hover:text-zinc-200",onClick:()=>re(null),children:"Clear filter ×"})]}),s.jsx(Hfe,{evidence:Bt,compareLocations:I})]}),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:"Opportunities"}),s.jsx("h2",{children:"What to act on next"})]})}),s.jsx(k_e,{insights:c.insights,suggestedQueries:c.suggestedQueries,projectName:je})]}),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:[c.competitors.length," tracked"]}),s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>A(!E),children:E?"Cancel":"+ Add competitor"})]})]}),E&&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:ae=>_(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&vt()}}),s.jsx(pe,{type:"button",size:"sm",disabled:!C.trim()||O,onClick:Ke(vt),children:O?"Adding...":"Add"})]}),s.jsx(Qfe,{competitors:c.competitors,onSelectCompetitor:ae=>{re(ae),document.getElementById("evidence-section")?.scrollIntoView({behavior:"smooth",block:"start"})},activeFilter:V})]}),s.jsx(Ize,{projectName:c.project.name}),c.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(Zn,{text:"Per-model citation rate today plus a sparkline of the recent run history. Same query set, different LLMs — gaps between providers point at content / source issues, not the metric."})]})]})}),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:"Trend"}),s.jsx("th",{children:"Cited queries"})]})}),s.jsx("tbody",{children:c.providerScores.map(ae=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsxs("div",{className:"flex flex-col items-start gap-0.5",children:[s.jsx(lc,{provider:ae.provider}),ae.model&&s.jsx("span",{className:"text-[11px] font-mono text-zinc-500",children:ae.model})]})}),s.jsx("td",{children:s.jsxs("span",{className:`font-semibold ${ae.score>=70?"text-emerald-400":ae.score>=40?"text-amber-400":"text-rose-400"}`,children:[ae.score,"%"]})}),s.jsx("td",{children:s.jsx(j_e,{trend:ae.trend,currentScore:ae.score})}),s.jsxs("td",{className:"text-zinc-500",children:[ae.cited," of ",ae.total]})]},`${ae.provider}::${ae.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:"Run timeline"}),s.jsx("h2",{children:"Recent execution history"})]})}),s.jsx("div",{className:"run-list",children:c.recentRuns.map(ae=>s.jsx(n6,{run:ae},ae.id))})]})]}):e==="settings"?s.jsxs(s.Fragment,{children:[s.jsx(p_e,{project:{...c.project,displayName:c.project.displayName??c.project.name,defaultLocation:c.project.defaultLocation??null},onUpdateProject:lt,onRefresh:()=>{a()}}),s.jsx(g_e,{projectName:c.project.name}),s.jsx(v_e,{projectName:c.project.name})]}):e==="report"?s.jsx(Xze,{projectName:c.project.name}):e==="discovery"?s.jsx(Hze,{projectName:je}):e==="activity"?s.jsx(pze,{projectName:c.project.name}):e==="backlinks"?s.jsx(Mze,{projectName:c.project.name}):s.jsx(b_e,{projectName:c.project.name})]})}function A_e(){const{dashboard:e,isLoading:t}=Cc(),n=kze();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),c=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(pe,{type:"button",variant:"outline",size:"sm",disabled:n.isPending,onClick:()=>{c()},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":Lv(d)},d))}),s.jsx("div",{className:"run-list",children:l.length>0?l.map(d=>s.jsx(n6,{run:d},d.id)):s.jsxs(Pe,{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 E_e({providerName:e,keyUrl:t,modelHint:n,onSaved:r}){const i=e.toLowerCase()==="local",[a,l]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(!1),[A,C]=x.useState(null),[_,O]=x.useState(!1),z=i?c.trim().length>0:a.trim().length>0;async function R(){if(z){E(!0),C(null),O(!1);try{const F=Y=>{const H=parseInt(Y.trim(),10);return Number.isFinite(H)&&H>0?H:void 0},M={},U=F(m);U!==void 0&&(M.maxConcurrency=U);const K=F(v);K!==void 0&&(M.maxRequestsPerMinute=K);const Z=F(b);Z!==void 0&&(M.maxRequestsPerDay=Z),await i4(e.toLowerCase(),{...a.trim()?{apiKey:a.trim()}:{},...c.trim()?{baseUrl:c.trim()}:{},...f.trim()?{model:f.trim()}:{},...Object.keys(M).length>0?{quota:M}:{}}),l(""),d(""),p(""),y(""),w(""),j(""),O(!0),ut({title:"Provider updated",detail:`${e} configuration saved.`,tone:"positive",dedupeKey:`settings:provider:${e}`,dedupeMode:"replace"}),r()}catch(F){C(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:c,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=>y(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=>w(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=>j(F.target.value)}),s.jsx("p",{className:"mt-0.5 text-[10px] text-zinc-600",children:"Per day"})]})]})]}),A&&s.jsx("p",{className:"text-xs text-rose-400",children:A}),_&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Provider updated."}),s.jsx(pe,{type:"button",size:"sm",disabled:!z||k,onClick:Ke(R),children:k?"Saving...":"Save"})]})}function O_e({onSaved:e}){const[t,n]=x.useState(""),[r,i]=x.useState(""),[a,l]=x.useState(!1),[c,d]=x.useState(null),[f,p]=x.useState(!1),m=t.trim().length>0&&r.trim().length>0;async function y(){if(m){l(!0),d(null),p(!1);try{await FV({clientId:t.trim(),clientSecret:r.trim()}),n(""),i(""),p(!0),ut({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."]}),c&&s.jsx("p",{className:"text-xs text-rose-400",children:c}),f&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Google OAuth credentials updated."}),s.jsx(pe,{type:"button",size:"sm",disabled:!m||a,onClick:Ke(y),children:a?"Saving...":"Save Google OAuth app"})]})}function z_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState(!1),[l,c]=x.useState("localhost"),[d,f]=x.useState("9222"),[p,m]=x.useState(!1);return x.useEffect(()=>{F2().then(t).catch(y=>{const v=y instanceof Error?y.message:String(y);v.includes("501")||r(v)})},[]),s.jsxs(Pe,{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(ot,{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(y=>s.jsxs("span",{className:"mr-2",children:[y.name,": ",y.alive?"● alive":"○ idle"]},y.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(pe,{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:Ke(async y=>{y.preventDefault(),m(!0);try{await vQ(l,parseInt(d,10)||9222);const v=await F2().catch(()=>null);v&&t(v),a(!1),ut({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:y=>c(y.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:y=>f(y.target.value),"aria-label":"CDP port"})]}),s.jsx("div",{children:s.jsx(pe,{type:"submit",size:"sm",disabled:p,children:p?"Saving…":"Save endpoint"})})]})]})}const __e={apiStatus:{state:"checking",detail:"Checking service health"},workerStatus:{state:"checking",detail:"Checking service health"}};function T_e(){const e=np(),{dashboard:t}=Cc(),n=t?.settings??e?.dashboard?.settings,a=Qv(!e,e?.health).data??e?.health??__e,[l,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),[y,v]=x.useState(""),[w,b]=x.useState(!1),[j,k]=x.useState(null),[E,A]=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(C=>s.jsxs(Pe,{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:C.displayName??C.name})]}),s.jsx(ot,{tone:C.state==="ready"?"positive":"caution",children:C.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:C.model})]}),C.quota&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Concurrency"}),s.jsx("dd",{children:C.quota.maxConcurrency})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Rate limit"}),s.jsxs("dd",{children:[C.quota.maxRequestsPerMinute,"/min · ",C.quota.maxRequestsPerDay,"/day"]})]})]})]}),s.jsx("p",{className:"mt-2 text-sm text-zinc-500",children:C.detail}),s.jsx("div",{className:"mt-2",children:s.jsx(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>c(l===C.name?null:C.name),children:l===C.name?"Cancel":C.state==="ready"?C.name.toLowerCase()==="local"?"Update config":"Update key":"Configure"})}),l===C.name&&s.jsx(E_e,{providerName:C.name,keyUrl:C.keyUrl,modelHint:C.modelHint,onSaved:()=>{c(null)}})]},C.name)),s.jsxs(Pe,{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(ot,{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(pe,{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(O_e,{onSaved:()=>{f(!1)}})]}),s.jsxs(Pe,{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(ot,{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(pe,{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:y,onChange:C=>v(C.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."]}),j&&s.jsx("p",{className:"text-xs text-rose-400",children:j}),E&&s.jsx("p",{className:"text-xs text-emerald-400",children:"Bing API key updated."}),s.jsx(pe,{type:"button",size:"sm",disabled:!y.trim()||w,onClick:Ke(async()=>{if(y.trim()){b(!0),k(null),A(!1);try{await kQ(y.trim()),v(""),A(!0),m(!1),ut({title:"Bing API key updated",detail:"Dashboard Bing credentials were saved.",tone:"positive",dedupeKey:"settings:bing",dedupeMode:"replace"})}catch(C){k(C instanceof Error?C.message:"Failed to update Bing API key")}finally{b(!1)}}}),children:w?"Saving...":"Save Bing API key"})]})]}),s.jsx(z_e,{}),s.jsxs(Pe,{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(ot,{tone:my(a.apiStatus),title:Yo(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(ot,{tone:my(a.workerStatus),title:Yo(a.workerStatus),children:a.workerStatus.state==="ok"?"Healthy":"Attention"})]})]})]})]}),s.jsx("section",{className:"page-section",children:s.jsxs(Pe,{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(C=>s.jsx("li",{children:C},C))}),s.jsx("p",{className:"supporting-copy",children:n.bootstrapNote})]})})]}):null}const P_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 R_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 D_e(){const e=np(),{dashboard:t,isLoading:n,refetch:r}=Cc(),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(ke=>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"})]},ke))})]})]});const a=i.settings,d=Qv(!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=Jne(i.setup,d,a),p=el(),[m,y]=x.useState(0),[v,w]=x.useState(""),[b,j]=x.useState(""),[k,E]=x.useState(""),[A,C]=x.useState("US"),[_,O]=x.useState("en"),[z,R]=x.useState(!1),[$,F]=x.useState(null),[M,U]=x.useState(null),[K,Z]=x.useState(null),[Y,H]=x.useState(!1),[X,ue]=x.useState(""),[xe,L]=x.useState(!1),[q,I]=x.useState(null),[D,V]=x.useState(!1),re=a.providerStatuses.filter(ke=>ke.state==="ready"),[ee,Ee]=x.useState(re[0]?.name??""),[Te,ne]=x.useState(5),[he,je]=x.useState(!1),[me,tt]=x.useState(null),[Ie,Ze]=x.useState(""),[nt,Wt]=x.useState(!1),[Se,Re]=x.useState(null),[Bt,cn]=x.useState(!1),[un,Rr]=x.useState(!1),[Kt,vt]=x.useState(!1),[de,Ne]=x.useState(null),Ue=z9(),it=Un({queryKey:["setup","launched-run",de],queryFn:()=>Go(de),enabled:!!de,refetchInterval:({state:ke})=>{const Ye=ke.data?.status;return Ye==="completed"||Ye==="partial"||Ye==="failed"||Ye==="cancelled"?!1:2e3},refetchIntervalInBackground:!0}),[lt,mn]=x.useState(""),[Kn,ae]=x.useState(!1),[Fe,Qe]=x.useState(null),rt=v.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),pt=X.split(`
|
|
295
|
+
`).map(ke=>ke.trim()).filter(Boolean),wn=Ie.split(`
|
|
296
|
+
`).map(ke=>ke.trim()).filter(Boolean),ll=f.healthChecks.some(ke=>ke.id==="api"&&ke.state==="ready"),es=async()=>{if(!(!rt||!k)){H(!0),Z(null);try{const ke=await ep(rt,{displayName:b||v,canonicalDomain:k,country:A,language:_,autoExtractBacklinks:z});F(rt),U(ke.id),ut({title:"Project created",detail:`${ke.displayName||ke.name} is ready for setup.`,tone:"positive",dedupeKey:`project:create:${ke.name}`,dedupeMode:"drop"}),await r(),y(2)}catch(ke){Z(ke instanceof Error?ke.message:"Failed to create project")}finally{H(!1)}}},ia=async()=>{if(!$)return;const ke=pt;if(ke.length!==0){V(!0),I(null);try{await PV($,ke),L(!0),await r(),y(3)}catch(Ye){I(Ye instanceof Error?Ye.message:"Failed to save queries")}finally{V(!1)}}},Rn=async()=>{if(!(!$||!ee)){je(!0),tt(null);try{const ke=await WV($,ee,Te);if(ke.queries.length>0){const Ye=X?X.trimEnd()+`
|
|
297
|
+
`+ke.queries.join(`
|
|
298
|
+
`):ke.queries.join(`
|
|
299
|
+
`);ue(Ye)}}catch(ke){tt(ke instanceof Error?ke.message:"Failed to generate queries")}finally{je(!1)}}},Ce=async()=>{if(!$)return;const ke=wn;if(ke.length!==0){cn(!0),Re(null);try{await r4($,ke),Wt(!0),await r(),y(4)}catch(Ye){Re(Ye instanceof Error?Ye.message:"Failed to save competitors")}finally{cn(!1)}}},at=async()=>{const ke=lt.trim();if(ke){ae(!0),Qe(null);try{await i4("gemini",{apiKey:ke}),ut({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),mn(""),await r()}catch(Ye){Qe(Ye instanceof Error?Ye.message:"Failed to save Gemini key")}finally{ae(!1)}}},Je=async()=>{if($){vt(!0);try{const ke=await Ue.mutateAsync({projectName:$,projectLabel:b||v||$,sourceAction:"setup-launch"});Ne(ke.id),Rr(!0),await r()}catch{}finally{vt(!1)}}},Xe=()=>y(ke=>Math.max(0,ke-1)),mt=(()=>{switch(m){case 0:return s.jsxs(Pe,{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(ke=>s.jsxs("div",{className:"health-check-row",children:[s.jsxs("div",{children:[s.jsx("p",{className:"run-row-title",children:ke.label}),s.jsx("p",{className:"supporting-copy",children:ke.detail}),ke.id==="provider"&&ke.state!=="ready"&&s.jsxs("div",{className:"mt-3 rounded-md border border-zinc-800/60 bg-zinc-900/40 p-3 space-y-2",children:[s.jsxs("p",{className:"text-xs text-zinc-400",children:["Paste a Gemini key to enable visibility checks (free at"," ",s.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"aistudio.google.com"}),")."]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"password",value:lt,onChange:Ye=>mn(Ye.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-600 focus:outline-none font-mono",disabled:Kn}),s.jsx(pe,{type:"button",size:"sm",disabled:Kn||!lt.trim(),onClick:Ke(at),children:Kn?"Saving...":"Save"})]}),Fe&&s.jsx("p",{className:"text-xs text-rose-400",children:Fe}),s.jsxs("p",{className:"text-[11px] text-zinc-600",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",s.jsx(zt,{to:"/settings",className:"text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"/settings"}),"."]})]})]}),s.jsx(ot,{tone:ke.state==="ready"?"positive":"caution",title:ke.id==="api"?Yo(d.apiStatus):ke.id==="worker"?Yo(d.workerStatus):ke.detail,children:ke.state==="ready"?"Ready":"Attention"})]},ke.id))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(pe,{type:"button",disabled:!ll,onClick:()=>y(1),children:"Continue"})]})]});case 1:return s.jsxs(Pe,{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(ot,{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(pe,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),s.jsx(pe,{type:"button",onClick:()=>y(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:ke=>w(ke.target.value)}),rt&&rt!==v?s.jsxs("p",{className:"supporting-copy",children:["Slug: ",rt]}):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:ke=>j(ke.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:ke=>E(ke.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:A,onChange:ke=>C(ke.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:_,onChange:ke=>O(ke.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:z,onChange:ke=>R(ke.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(zt,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),K?s.jsx("p",{className:"text-rose-400 text-sm",children:K}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),s.jsx(pe,{type:"button",disabled:!rt||!k||Y,onClick:Ke(es),children:Y?"Creating...":"Create project"})]})]})]});case 2:return s.jsxs(Pe,{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"})]}),xe?s.jsxs(ot,{tone:"positive",children:[pt.length," saved"]}):s.jsxs(ot,{tone:"neutral",children:[pt.length," quer",pt.length!==1?"ies":"y"]})]}),s.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),xe?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:pt.map(ke=>s.jsx("li",{children:ke},ke))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),s.jsx(pe,{type:"button",onClick:()=>y(3),children:"Continue"})]})]}):s.jsxs("div",{className:"compact-stack",children:[re.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:ee,onChange:ke=>Ee(ke.target.value),children:re.map(ke=>s.jsxs("option",{value:ke.name,children:[ke.displayName??ke.name,ke.model?` (${ke.model})`:""]},ke.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:Te,onChange:ke=>ne(Number(ke.target.value)),children:[3,5,10,15,20].map(ke=>s.jsx("option",{value:ke,children:ke},ke))})]}),s.jsx(pe,{type:"button",variant:"outline",disabled:he||!ee,onClick:Ke(Rn),children:he?"Analyzing site...":"Generate"})]}),me?s.jsx("p",{className:"text-rose-400 text-sm",children:me}):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:X,onChange:ke=>ue(ke.target.value)})]}),q?s.jsx("p",{className:"text-rose-400 text-sm",children:q}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),s.jsx(pe,{type:"button",disabled:pt.length===0||D,onClick:Ke(ia),children:D?"Saving...":`Save ${pt.length} quer${pt.length!==1?"ies":"y"}`})]})]})]});case 3:return s.jsxs(Pe,{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"})]}),nt?s.jsx(ot,{tone:"positive",children:"Saved"}):null]}),s.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),nt?s.jsxs("div",{className:"compact-stack",children:[s.jsx("ul",{className:"detail-list",children:wn.map(ke=>s.jsx("li",{children:ke},ke))}),s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),s.jsx(pe,{type:"button",onClick:()=>y(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:Ie,onChange:ke=>Ze(ke.target.value)})]}),Se?s.jsx("p",{className:"text-rose-400 text-sm",children:Se}):null,s.jsxs("div",{className:"setup-nav",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(pe,{type:"button",variant:"outline",onClick:()=>y(4),children:"Skip"}),s.jsx(pe,{type:"button",disabled:wn.length===0||Bt,onClick:Ke(Ce),children:Bt?"Saving...":`Save ${wn.length} competitor${wn.length!==1?"s":""}`})]})]})]})]});case 4:{const ke=it.data,Ye=ke?.status==="completed"||ke?.status==="partial"||ke?.status==="failed"||ke?.status==="cancelled",Nt=ke?.snapshots??[],aa=Nt.filter(Yr=>Yr.citationState==="cited").length,sa=Nt.filter(Yr=>Yr.answerMentioned===!0).length,cr=new Set(Nt.map(Yr=>Yr.query).filter(Yr=>!!Yr)).size,ts=un?Ye&&(ke?.status==="completed"||ke?.status==="partial")?s.jsx(ot,{tone:"positive",children:"Complete"}):Ye?s.jsx(ot,{tone:"negative",children:"Failed"}):s.jsx(ot,{tone:"caution",children:"Running"}):null;return s.jsxs(Pe,{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"})]}),ts]}),un?Ye?ke?.status==="failed"?s.jsxs("div",{className:"compact-stack",children:[s.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(pe,{type:"button",onClick:()=>{p({to:M?`/projects/${M}`:"/"})},children:"Open project"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",s.jsx("span",{className:"text-zinc-100 font-medium",children:$}),":"]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),s.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[sa,s.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",cr]})]}),s.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),s.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[aa,s.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",cr]})]}),s.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),s.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[s.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),s.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:Nt.length}),s.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),s.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(pe,{type:"button",onClick:()=>{p({to:M?`/projects/${M}`:"/"})},children:"Open project dashboard →"})]})]}):s.jsxs("div",{className:"compact-stack",children:[s.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),s.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:s.jsxs("p",{children:["Status: ",s.jsx("span",{className:"text-zinc-300",children:ke?.status??"queued"})]})}),s.jsxs("div",{className:"setup-nav",children:[s.jsx("span",{}),s.jsx(pe,{type:"button",variant:"outline",onClick:()=>{p({to:M?`/projects/${M}`:"/"})},children:"Watch on project page"})]})]}):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(pe,{type:"button",variant:"outline",onClick:Xe,children:"Back"}),s.jsx(pe,{type:"button",disabled:Kt,onClick:Ke(Je),children:Kt?"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(R_e,{current:m,labels:P_e}),s.jsx("section",{className:"setup-wizard",children:mt})]})}function Tu({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(y4,{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 M_e="https://commoncrawl.org/web-graphs";function Kj(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 zg(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 Gj(e){switch(e){case"ready":return"positive";case"failed":return"negative";case"downloading":case"querying":case"queued":return"caution"}}function I_e(){const[e,t]=x.useState(null),[n,r]=x.useState(null),[i,a]=x.useState([]),[l,c]=x.useState([]),[d,f]=x.useState(null),[p,m]=x.useState(!0),[y,v]=x.useState(!1),[w,b]=x.useState(!1),[j,k]=x.useState(""),[E,A]=x.useState(!1),[C,_]=x.useState(null),[O,z]=x.useState(null),R=x.useCallback(async()=>{m(!0),_(null);try{const[K,Z,Y,H,X]=await Promise.all([VQ(),f4().catch(()=>null),YQ().catch(()=>[]),ZQ().catch(()=>[]),XQ().catch(()=>null)]);t(K),r(Z),a(Y),c(H),f(X)}catch(K){_(K instanceof Error?K.message:"Failed to load backlinks status")}finally{m(!1)}},[]);x.useEffect(()=>{R()},[R]);async function $(){v(!0),_(null),z(null);try{const K=await QQ();z(K.alreadyPresent?`DuckDB already installed (${K.version}).`:`Installed DuckDB ${K.version}.`),await R()}catch(K){_(K instanceof Error?K.message:"Failed to install DuckDB")}finally{v(!1)}}async function F(){const K=j.trim()||void 0;b(!0),_(null),z(null);try{const Z=await WQ(K);z(K?`Queued sync for ${Z.release}. Download + query runs in the background.`:`Queued sync for auto-discovered release ${Z.release}. Download + query runs in the background.`),k(""),A(!1),await R()}catch(Z){Z instanceof rr&&Z.code==="MISSING_DEPENDENCY"?_("DuckDB is not installed. Install it first."):_(Z instanceof Error?Z.message:"Failed to trigger sync")}finally{b(!1)}}async function M(K){_(null),z(null);try{await JQ(K),z(`Pruned cached release ${K}.`),await R()}catch(Z){_(Z instanceof Error?Z.message:"Failed to prune release")}}const U=n?.status==="ready"&&l.every(K=>K.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(Pe,{className:"surface-card p-4 mb-6 border-amber-800/60",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(oy,{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(Pe,{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."]})]})]})]})]}),C&&s.jsx(Pe,{className:"surface-card p-4 mb-4 border-rose-800/60",children:s.jsx("p",{className:"text-sm text-rose-300",children:C})}),O&&s.jsx(Pe,{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(Tu,{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(ot,{tone:"positive",children:"Installed"}):s.jsx(ot,{tone:"caution",children:"Not installed"})]}),s.jsx(Pe,{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(yk,{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(OY,{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(pe,{type:"button",size:"sm",disabled:y,onClick:Ke($),children:[s.jsx(Tv,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),y?"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(Tu,{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(ot,{tone:Gj(n.status),children:n.status})]}),s.jsxs(Pe,{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(Tu,{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:zg(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:zg(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."}),U&&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(oy,{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 ",Kj(d.vertexBytes),", edges ",Kj(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:M_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(LY,{className:"h-3 w-3","aria-hidden":!0})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsxs(pe,{type:"button",size:"sm",disabled:w||!e?.duckdbInstalled||!d&&!j.trim(),onClick:Ke(F),children:[s.jsx(kh,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),w?"Queuing…":"Run sync"]}),s.jsxs(Tu,{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:j,onChange:K=>k(K.target.value),disabled:w,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(""),A(!1)},disabled:w,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:()=>A(!0),disabled:w,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(Tu,{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(Pe,{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(K=>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:K.release})}),s.jsx("td",{className:"px-4 py-2",children:K.syncStatus?s.jsx(ot,{tone:Gj(K.syncStatus),children:K.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:Kj(K.bytes)}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:zg(K.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(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>{M(K.release)},children:[s.jsx(S4,{className:"h-4 w-4 mr-1.5","aria-hidden":!0}),"Prune"]}),s.jsx(Tu,{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)."})]})})]},K.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(Pe,{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(K=>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:K.release})}),s.jsx("td",{className:"px-4 py-2",children:s.jsx(ot,{tone:Gj(K.status),children:K.status})}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:K.projectsProcessed??"—"}),s.jsx("td",{className:"px-4 py-2 text-right text-zinc-400 tabular-nums",children:K.domainsDiscovered??"—"}),s.jsx("td",{className:"px-4 py-2 text-zinc-400",children:zg(K.queryFinishedAt??K.updatedAt)})]},K.id))})]})})]})]})}function L_e({open:e,onOpenChange:t,projectName:n}){const[r,i]=x.useState("pick");x.useEffect(()=>{e&&i("pick")},[e]);const a=()=>{t(!1),i("pick")};return s.jsx(z$,{open:e,onOpenChange:l=>{l?t(!0):a()},children:s.jsx(Gk,{children:r==="pick"?s.jsx(B_e,{onPick:i}):r==="wordpress"?s.jsx(U_e,{projectName:n,onBack:()=>i("pick"),onClose:a}):r==="vercel"?s.jsx(F_e,{projectName:n,onBack:()=>i("pick"),onClose:a}):s.jsx(q_e,{projectName:n,onBack:()=>i("pick"),onClose:a})})})}const $_e=[{type:"wordpress",name:"WordPress site",tagline:"Easiest if you run WordPress",description:"Install the Canonry Traffic Logger plugin and connect with an Application Password. No cloud account needed.",icon:v4},{type:"cloud-run",name:"Google Cloud Run",tagline:"For apps hosted on Cloud Run",description:"Connect a Google Cloud service account so Canonry can read your Cloud Run request logs.",icon:PY},{type:"vercel",name:"Vercel project",tagline:"For sites hosted on Vercel",description:"Connect a Vercel API token so Canonry can pull request logs straight from Vercel — no in-app instrumentation needed.",icon:gW}];function B_e({onPick:e}){return s.jsxs(s.Fragment,{children:[s.jsxs(Vk,{children:[s.jsx(Kv,{children:"Connect a traffic source"}),s.jsx(Gv,{children:"Canonry reads your server logs to see when AI crawlers and AI-referred visitors hit your site. Pick where your site is hosted to get started."})]}),s.jsx("div",{className:"mt-6 flex flex-col gap-3",children:$_e.map(({type:t,name:n,tagline:r,description:i,icon:a})=>s.jsxs("button",{type:"button",onClick:()=>e(t),className:"group flex items-start gap-4 rounded-lg border border-zinc-800 bg-zinc-900/30 p-4 text-left transition-colors hover:border-zinc-600 hover:bg-zinc-900/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[s.jsx("span",{className:"mt-0.5 inline-flex size-9 shrink-0 items-center justify-center rounded-md border border-zinc-800 bg-zinc-950 text-zinc-300 group-hover:text-zinc-100",children:s.jsx(a,{className:"size-4"})}),s.jsxs("span",{className:"flex flex-col gap-0.5",children:[s.jsxs("span",{className:"flex flex-wrap items-baseline gap-x-2",children:[s.jsx("span",{className:"text-sm font-medium text-zinc-100",children:n}),s.jsx("span",{className:"text-[11px] text-zinc-500",children:r})]}),s.jsx("span",{className:"text-xs leading-5 text-zinc-500",children:i})]})]},t))})]})}function oE({title:e,description:t,onBack:n}){return s.jsxs(Vk,{children:[s.jsxs("button",{type:"button",onClick:n,className:"mb-1 inline-flex w-fit items-center gap-1 rounded text-xs text-zinc-500 transition-colors hover:text-zinc-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-zinc-400",children:[s.jsx(h1,{className:"size-3"}),"Choose a different source"]}),s.jsx(Kv,{children:e}),s.jsx(Gv,{children:t})]})}function U_e({projectName:e,onBack:t,onClose:n}){const[r,i]=x.useState(""),[a,l]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(null),[v,w]=x.useState(null),b=oze(e||null),j=async k=>{if(k.preventDefault(),y(null),w(null),!r.trim()){y("WordPress site URL is required.");return}if(!a.trim()){y("Username is required.");return}if(!c.trim()){y("Application Password is required.");return}try{const E=await b.mutateAsync({baseUrl:r.trim(),username:a.trim(),applicationPassword:c.trim(),displayName:f.trim()||void 0});d(""),w(`Connected ${E.displayName}.`)}catch(E){const A=E instanceof rr||E instanceof Error?E.message:String(E);y(A)}};return s.jsxs(s.Fragment,{children:[s.jsx(oE,{title:"Connect a WordPress site",description:s.jsxs(s.Fragment,{children:["Pulls request events from the Canonry Traffic Logger plugin. The Application Password is stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"})," on the server and never echoed back to the dashboard."]}),onBack:t}),s.jsxs("form",{onSubmit:Ke(j),className:"mt-6 flex flex-col gap-5 overflow-y-auto pr-1",children:[s.jsx(wr,{label:"Project",description:"Canonry project this source attaches to.",children:s.jsx("input",{type:"text",value:e,disabled:!0,className:"w-full rounded border border-zinc-700 bg-zinc-900/50 px-2 py-1.5 text-sm text-zinc-300"})}),s.jsx(wr,{label:"WordPress site URL",description:"Base URL of the site running the Canonry Traffic Logger plugin.",required:!0,children:s.jsx("input",{type:"url",value:r,onChange:k=>i(k.target.value),required:!0,autoComplete:"url",placeholder:"https://example.com",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"})}),s.jsx(wr,{label:"Username",description:"WordPress user that owns the Application Password.",required:!0,children:s.jsx("input",{type:"text",value:a,onChange:k=>l(k.target.value),required:!0,autoComplete:"username",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"})}),s.jsx(wr,{label:"Application Password",description:"Create one in wp-admin under Users -> Profile -> Application Passwords.",required:!0,children:s.jsx("input",{type:"password",value:c,onChange:k=>d(k.target.value),required:!0,autoComplete:"new-password",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"})}),s.jsx(wr,{label:"Display name (optional)",description:"Friendly label shown in the dashboard. Defaults to the WordPress host.",children:s.jsx("input",{type:"text",value:f,onChange:k=>p(k.target.value),autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none"})}),m?s.jsx("p",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:m}):null,v?s.jsx("p",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:v}):null,s.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-zinc-800/60 pt-4",children:[s.jsx(pe,{type:"button",variant:"ghost",size:"sm",onClick:n,children:"Close"}),s.jsx(pe,{type:"submit",disabled:b.isPending,size:"sm",children:b.isPending?"Connecting...":"Connect"})]})]})]})}function q_e({projectName:e,onBack:t,onClose:n}){const[r,i]=x.useState(""),[a,l]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(null),[b,j]=x.useState(null),k=sze(e||null),E=async C=>{if(C.preventDefault(),w(null),j(null),!r.trim()){w("GCP project ID is required.");return}if(!m.trim()){w("Service-account JSON content is required.");return}try{const _=await k.mutateAsync({gcpProjectId:r.trim(),serviceName:a.trim()||void 0,location:c.trim()||void 0,displayName:f.trim()||void 0,keyJson:m.trim()});y(""),j(`Connected ${_.displayName}.`)}catch(_){const O=_ instanceof rr||_ instanceof Error?_.message:String(_);w(O)}},A=async C=>{if(!C)return;const _=await C.text();y(_)};return s.jsxs(s.Fragment,{children:[s.jsx(oE,{title:"Connect a Cloud Run service",description:s.jsxs(s.Fragment,{children:["v1 supports service-account JSON only. The private key is stored in"," ",s.jsx("code",{children:"~/.canonry/config.yaml"})," on the server and never echoed back to the dashboard."]}),onBack:t}),s.jsxs("form",{onSubmit:Ke(E),className:"mt-6 flex flex-col gap-5 overflow-y-auto pr-1",children:[s.jsx(wr,{label:"Project",description:"Canonry project this source attaches to.",children:s.jsx("input",{type:"text",value:e,disabled:!0,className:"w-full rounded border border-zinc-700 bg-zinc-900/50 px-2 py-1.5 text-sm text-zinc-300"})}),s.jsx(wr,{label:"GCP project ID",description:"The Google Cloud project hosting the Cloud Run service (e.g. my-prod-foo).",required:!0,children:s.jsx("input",{type:"text",value:r,onChange:C=>i(C.target.value),required:!0,autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none"})}),s.jsx(wr,{label:"Service name (optional)",description:"Restrict log pulls to a specific Cloud Run service. Omit to pull all services in the project.",children:s.jsx("input",{type:"text",value:a,onChange:C=>l(C.target.value),autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none"})}),s.jsx(wr,{label:"Location (optional)",description:"Region of the Cloud Run service (e.g. us-central1). Helpful when multiple regions emit logs.",children:s.jsx("input",{type:"text",value:c,onChange:C=>d(C.target.value),autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none"})}),s.jsx(wr,{label:"Display name (optional)",description:"Friendly label shown in the dashboard. Defaults to the project + service combo.",children:s.jsx("input",{type:"text",value:f,onChange:C=>p(C.target.value),autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none"})}),s.jsxs(wr,{label:"Service-account JSON",description:"Paste the contents of the SA key (JSON). The SA needs roles/logging.viewer (or any role granting logging.logEntries.list).",required:!0,children:[s.jsx("textarea",{value:m,onChange:C=>y(C.target.value),rows:6,spellCheck:!1,autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 font-mono text-[11px] text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none",placeholder:'{"type":"service_account","project_id":"…","private_key":"…"}',required:!0}),s.jsxs("label",{className:"mt-2 inline-flex cursor-pointer items-center gap-2 text-xs text-zinc-400 hover:text-zinc-200",children:[s.jsx("input",{type:"file",accept:"application/json,.json",className:"hidden",onChange:C=>{A(C.target.files?.[0]??null)}}),s.jsx("span",{className:"rounded-md border border-zinc-800 px-2 py-1",children:"Or upload a key file"})]})]}),v?s.jsx("p",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:v}):null,b?s.jsx("p",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:b}):null,s.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-zinc-800/60 pt-4",children:[s.jsx(pe,{type:"button",variant:"ghost",size:"sm",onClick:n,children:"Close"}),s.jsx(pe,{type:"submit",disabled:k.isPending,size:"sm",children:k.isPending?"Connecting…":"Connect"})]})]})]})}function F_e({projectName:e,onBack:t,onClose:n}){const[r,i]=x.useState(""),[a,l]=x.useState(""),[c,d]=x.useState(""),[f,p]=x.useState("production"),[m,y]=x.useState(""),[v,w]=x.useState(null),[b,j]=x.useState(null),k=lze(e||null),E=async A=>{if(A.preventDefault(),w(null),j(null),!r.trim()){w("Vercel project ID is required.");return}if(!a.trim()){w("Vercel team ID is required.");return}if(!c.trim()){w("Vercel API token is required.");return}try{const C=await k.mutateAsync({projectId:r.trim(),teamId:a.trim(),token:c.trim(),environment:f,displayName:m.trim()||void 0});d(""),j(`Connected ${C.displayName}.`)}catch(C){const _=C instanceof rr||C instanceof Error?C.message:String(C);w(_)}};return s.jsxs(s.Fragment,{children:[s.jsx(oE,{title:"Connect a Vercel project",description:s.jsxs(s.Fragment,{children:["Pulls request logs straight from Vercel — no in-app instrumentation needed. The API token is stored in ",s.jsx("code",{children:"~/.canonry/config.yaml"})," on the server and never echoed back to the dashboard."]}),onBack:t}),s.jsxs("form",{onSubmit:Ke(E),className:"mt-6 flex flex-col gap-5 overflow-y-auto pr-1",children:[s.jsx(wr,{label:"Project",description:"Canonry project this source attaches to.",children:s.jsx("input",{type:"text",value:e,disabled:!0,className:"w-full rounded border border-zinc-700 bg-zinc-900/50 px-2 py-1.5 text-sm text-zinc-300"})}),s.jsx(wr,{label:"Vercel project ID",description:"The prj_… id from the Vercel dashboard or .vercel/project.json.",required:!0,children:s.jsx("input",{type:"text",value:r,onChange:A=>i(A.target.value),required:!0,autoComplete:"off",placeholder:"prj_…",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"})}),s.jsx(wr,{label:"Vercel team ID",description:"The team_… (or owner) id the project belongs to.",required:!0,children:s.jsx("input",{type:"text",value:a,onChange:A=>l(A.target.value),required:!0,autoComplete:"off",placeholder:"team_…",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"})}),s.jsx(wr,{label:"API token",description:"Create one in Vercel under Account Settings → Tokens. Tokens can expire — use a long-lived token.",required:!0,children:s.jsx("input",{type:"password",value:c,onChange:A=>d(A.target.value),required:!0,autoComplete:"new-password",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"})}),s.jsx(wr,{label:"Environment",description:"Which deployment environment's request logs to pull.",children:s.jsxs("select",{value:f,onChange:A=>p(A.target.value),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",children:[s.jsx("option",{value:"production",children:"production"}),s.jsx("option",{value:"preview",children:"preview"})]})}),s.jsx(wr,{label:"Display name (optional)",description:"Friendly label shown in the dashboard. Defaults to the Vercel project ID.",children:s.jsx("input",{type:"text",value:m,onChange:A=>y(A.target.value),autoComplete:"off",className:"w-full rounded border border-zinc-700 bg-transparent px-2 py-1.5 text-sm text-zinc-200 placeholder-zinc-600 focus:border-zinc-500 focus:outline-none"})}),v?s.jsx("p",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:v}):null,b?s.jsx("p",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:b}):null,s.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2 border-t border-zinc-800/60 pt-4",children:[s.jsx(pe,{type:"button",variant:"ghost",size:"sm",onClick:n,children:"Close"}),s.jsx(pe,{type:"submit",disabled:k.isPending,size:"sm",children:k.isPending?"Connecting…":"Connect"})]})]})]})}function wr({label:e,description:t,required:n,children:r}){return s.jsxs("label",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"text-xs font-medium text-zinc-200",children:[e,n?s.jsx("span",{className:"ml-1 text-rose-400",children:"*"}):null]}),r,s.jsx("span",{className:"text-[11px] text-zinc-500",children:t})]})}function H_e(e){if(!e)return"never";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Vj(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function K_e(){const[e,t]=x.useState(""),[n,r]=x.useState(!1),a=Un({queryKey:_e.projects.all,queryFn:_v}).data??[],l=x.useMemo(()=>e||(a[0]?.name??""),[e,a]),c=nze(l||null),d=c.data?.sources??[];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:"Server traffic"}),s.jsx("p",{className:"page-subtitle",children:"Crawler hits and AI-referral sessions pulled directly from your server logs. Independent of GA — useful when you need server-side evidence that GPTBot or ChatGPT-User actually hit a page."})]}),s.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:s.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),disabled:!l,children:[s.jsx(sy,{className:"size-3.5"}),"Connect a source"]})})]}),s.jsxs("section",{children:[s.jsx("div",{className:"filter-row",role:"toolbar","aria-label":"Project picker",children:a.map(f=>s.jsx("button",{type:"button",className:`filter-chip ${l===f.name?"filter-chip-active":""}`,"aria-pressed":l===f.name,onClick:()=>t(f.name),children:f.displayName??f.name},f.id))}),l?c.isLoading?s.jsx(Pe,{className:"p-6 text-center text-sm text-zinc-500",children:"Loading sources…"}):d.length===0?s.jsxs(Pe,{className:"p-8 text-center",children:[s.jsxs("p",{className:"text-sm text-zinc-300",children:["No traffic sources connected for ",l,"."]}),s.jsx("p",{className:"mt-1 text-xs text-zinc-500",children:"Connect a traffic source to start ingesting crawler hits and AI-referral sessions from your server logs."}),s.jsx("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-2",children:s.jsxs(pe,{type:"button",variant:"outline",size:"sm",onClick:()=>r(!0),children:[s.jsx(sy,{className:"size-3.5"}),"Connect a source"]})})]}):s.jsx(G_e,{projectName:l,sources:d}):s.jsx(Pe,{className:"p-6 text-center text-sm text-zinc-500",children:"No projects yet."})]}),s.jsx(L_e,{open:n,onOpenChange:r,projectName:l})]})}function G_e({projectName:e,sources:t}){const n=E5({queries:t.map(i=>({queryKey:_e.serverTraffic.sourceDetail(e,i.id),queryFn:()=>d4(e,i.id),staleTime:3e4}))}),r=t.map((i,a)=>({source:i,detail:n[a]?.data,isLoading:n[a]?.isLoading??!1}));return s.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:[s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-2 text-left",children:"Source"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Status"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Last sync"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"24h crawler"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"24h AI sessions"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"24h samples"}),s.jsx("th",{className:"px-4 py-2 text-right"})]})}),s.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:r.map(({source:i,detail:a,isLoading:l})=>s.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"font-medium text-zinc-100",children:i.displayName}),s.jsxs("div",{className:"text-[11px] text-zinc-500 font-mono",children:[i.sourceType," · ",i.id.slice(0,8)]})]}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx(ot,{tone:rE(i.status),children:i.status}),i.lastError?s.jsx("p",{className:"mt-1 max-w-[18rem] truncate text-[11px] text-rose-400/80",title:i.lastError,children:i.lastError}):null]}),s.jsx("td",{className:"px-4 py-3 text-zinc-300",children:H_e(i.lastSyncedAt)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:l?"—":Vj(a?.totals24h.crawlerHits??0)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-100",children:l?"—":Vj(a?.totals24h.aiReferralHits??0)}),s.jsx("td",{className:"px-4 py-3 text-right tabular-nums text-zinc-300",children:l?"—":Vj(a?.totals24h.sampleCount??0)}),s.jsx("td",{className:"px-4 py-3 text-right",children:s.jsxs(zt,{to:"/traffic/$projectName/$sourceId",params:{projectName:e,sourceId:i.id},className:"inline-flex items-center gap-1 text-xs text-zinc-300 hover:text-zinc-100",children:[s.jsx(Ch,{className:"size-3"}),"View"]})})]},i.id))})]}),s.jsxs("p",{className:"border-t border-zinc-800/60 px-4 py-2 text-[11px] text-zinc-600",children:["Showing ",t.filter(i=>i.status!==ih.archived).length," active source",t.length===1?"":"s"," for ",e,". Same shape as ",s.jsxs("code",{className:"text-zinc-400",children:["canonry traffic status ",e," --format json"]}),"."]})]})}function Qj({value:e,label:t,delta:n,tone:r,description:i,tooltip:a,isNumeric:l=!0,progress:c,providerCoverage:d}){const m=2*Math.PI*48,y=Number.parseInt(e,10),v=typeof c=="number"&&Number.isFinite(c)?Math.min(Math.max(c,0),100)/100:l&&!Number.isNaN(y)?Math.min(y/100,1):.5,w=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:w,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(Zn,{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 _9(e){return e.kind===$a.crawler?e.botId:e.product}function V_e(e){return e.kind===$a.crawler?e.pathNormalized:e.landingPathNormalized}function T9(e,t){if(t==="hour")return e;const n=new Date(e),r=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,"0"),a=String(n.getDate()).padStart(2,"0");return`${r}-${i}-${a}`}function Q_e(e,t,n){const r=t.pathQuery.trim().toLowerCase();return e.filter(i=>!(t.selectedBucket&&T9(i.tsHour,n)!==t.selectedBucket||t.identity&&_9(i)!==t.identity||t.operator&&i.operator!==t.operator||r&&!V_e(i).toLowerCase().includes(r)))}function Y_e(e,t){if(!e||typeof e!="object")return null;const n=e.activeTooltipIndex;let r;if(typeof n=="number")r=n;else if(typeof n=="string"&&n!=="")r=Number(n);else return null;return!Number.isInteger(r)||r<0||r>=t.length?null:t[r]?.bucket??null}const Nv=[{value:60,label:"1h",granularity:"hour",fetchLimit:500},{value:360,label:"6h",granularity:"hour",fetchLimit:500},{value:1440,label:"24h",granularity:"hour",fetchLimit:500},{value:10080,label:"7d",granularity:"hour",fetchLimit:1e3},{value:720*60,label:"30d",granularity:"day",fetchLimit:2e3},{value:2160*60,label:"90d",granularity:"day",fetchLimit:5e3}],s5=Nv.find(e=>e.label==="7d")??Nv[2],o5=td[0],l5=td[1];function P9(e){const t=new Date(e);return`${t.getMonth()+1}/${t.getDate()} ${String(t.getHours()).padStart(2,"0")}:00`}function W_e(e){const t=new Date(`${e}T00:00:00`);return`${t.getMonth()+1}/${t.getDate()}`}function _g(e){if(!e)return"never";const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Z_e(){const e=Jh({strict:!1}),t=e.projectName??"",n=e.sourceId??"",[r,i]=x.useState(s5.value),[a,l]=x.useState(()=>new Set(["crawler","ai-referral"])),[c,d]=x.useState(null),[f,p]=x.useState(""),[m,y]=x.useState(""),[v,w]=x.useState(""),[b,j]=x.useState(null),[k,E]=x.useState(null),A=x.useMemo(()=>Nv.find(q=>q.value===r)??s5,[r]),C=ize(t||null,n||null),_=aze(t||null,{kind:"all",sourceId:n||void 0,sinceMinutes:r,limit:A.fetchLimit}),O=cze(t||null,n||null),z=C.data,R=_.data?.events??[],$=_.data?.totals,F=x.useMemo(()=>R.filter(q=>q.kind===$a.crawler?a.has("crawler"):a.has("ai-referral")),[R,a]),M=x.useMemo(()=>{const q=new Set;for(const I of R)q.add(_9(I));return f&&q.add(f),[...q].sort((I,D)=>I.localeCompare(D))},[R,f]),U=x.useMemo(()=>{const q=new Set;for(const I of R)q.add(I.operator);return m&&q.add(m),[...q].sort((I,D)=>I.localeCompare(D))},[R,m]),K=x.useMemo(()=>Q_e(F,{selectedBucket:c,identity:f,operator:m,pathQuery:v},A.granularity),[F,c,f,m,v,A.granularity]),Z=x.useMemo(()=>c?Yg(c,A.granularity):null,[c,A.granularity]),Y=x.useMemo(()=>X_e(R,A.granularity,_.data?.windowStart,_.data?.windowEnd),[R,A.granularity,_.data?.windowStart,_.data?.windowEnd]),H=q=>{l(I=>{const D=new Set(I);return D.has(q)?D.size>1&&D.delete(q):D.add(q),D})},X=q=>{const I=Y_e(q,Y);I&&d(D=>D===I?null:I)},ue=()=>{d(null),p(""),y(""),w("")},xe=!!(c||f||m||v.trim()),L=async()=>{j(null),E(null);try{const q=await O.mutateAsync({sinceMinutes:60});E(`Pulled ${q.pulledEvents} entries · ${q.crawlerHits} crawler · ${q.aiReferralHits} AI referral · ${q.unknownHits} unknown`)}catch(q){const I=q instanceof rr||q instanceof Error?q.message:String(q);j(I)}};return!t||!n?s.jsx("div",{className:"page-container",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Missing project name or source id in URL."})}):C.isLoading?s.jsx("div",{className:"page-container",children:s.jsx("p",{className:"text-sm text-zinc-500",children:"Loading source…"})}):C.isError||!z?s.jsxs("div",{className:"page-container",children:[s.jsx("p",{className:"text-sm text-rose-300",children:"Could not load this source."}),s.jsxs(zt,{to:"/traffic",className:"mt-2 inline-flex items-center gap-1 text-xs text-zinc-400 hover:text-zinc-200",children:[s.jsx(h1,{className:"size-3"})," Back to sources"]})]}):s.jsxs("div",{className:"page-container space-y-8",children:[s.jsxs("div",{className:"page-header",children:[s.jsxs("div",{className:"page-header-left",children:[s.jsxs(zt,{to:"/traffic",className:"inline-flex items-center gap-1 text-xs text-zinc-500 hover:text-zinc-200",children:[s.jsx(h1,{className:"size-3"})," All sources"]}),s.jsx("h1",{className:"page-title mt-2",children:z.displayName}),s.jsxs("p",{className:"page-subtitle",children:[z.sourceType," · project ",s.jsx("span",{className:"text-zinc-300",children:t})," ·",s.jsx("span",{className:"ml-1 font-mono text-zinc-400",children:z.id})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ot,{tone:rE(z.status),children:z.status}),s.jsxs(pe,{type:"button",variant:"outline",size:"sm",disabled:O.isPending,onClick:()=>{L()},children:[s.jsx(Ch,{className:`size-3.5 ${O.isPending?"animate-spin":""}`}),O.isPending?"Syncing…":"Sync now"]})]})]}),b?s.jsx("div",{className:"rounded-md border border-rose-800/50 bg-rose-950/30 px-3 py-2 text-xs text-rose-200",children:b}):null,k?s.jsx("div",{className:"rounded-md border border-emerald-800/50 bg-emerald-950/30 px-3 py-2 text-xs text-emerald-200",children:k}):null,s.jsxs("section",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[s.jsx(Qj,{label:"24h crawler hits",value:String(z.totals24h.crawlerHits),delta:z.lastSyncedAt?`last sync ${_g(z.lastSyncedAt)}`:"never synced",tone:z.totals24h.crawlerHits>0?"positive":"neutral",description:"GPTBot, ChatGPT-User, PerplexityBot, etc. — verified crawler requests in the last 24h.",isNumeric:!0,progress:Math.min(100,Math.round(z.totals24h.crawlerHits/1e3*100))}),s.jsx(Qj,{label:"24h AI referral sessions",value:String(z.totals24h.aiReferralHits),delta:z.lastSyncedAt?`last sync ${_g(z.lastSyncedAt)}`:"never synced",tone:z.totals24h.aiReferralHits>0?"positive":"neutral",description:"Sessionized visits arriving from chat.openai.com, perplexity.ai, etc. (Referer header evidence).",isNumeric:!0,progress:Math.min(100,Math.round(z.totals24h.aiReferralHits/1e3*100))}),s.jsx(Qj,{label:"24h sample rows",value:String(z.totals24h.sampleCount),delta:"bounded per sync",tone:"neutral",description:"Per-request samples retained for evidence (capped to keep storage bounded).",isNumeric:!0,progress:Math.min(100,Math.round(z.totals24h.sampleCount/100*100))})]}),s.jsxs("section",{children:[s.jsx("p",{className:"mb-4 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Latest sync run"}),z.latestRun?s.jsxs(Pe,{className:"p-4 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-1.5",children:[s.jsxs("span",{className:"text-zinc-100",children:["Status: ",s.jsx("span",{className:"font-medium",children:z.latestRun.status})]}),s.jsxs("span",{className:"text-zinc-500",children:["Started: ",_g(z.latestRun.startedAt)]}),z.latestRun.finishedAt?s.jsxs("span",{className:"text-zinc-500",children:["Finished: ",_g(z.latestRun.finishedAt)]}):null,s.jsx("span",{className:"font-mono text-[11px] text-zinc-600",children:z.latestRun.runId})]}),z.latestRun.error?s.jsx("p",{className:"mt-2 rounded border border-rose-900/40 bg-rose-950/30 px-3 py-2 text-xs text-rose-300",children:z.latestRun.error}):null]}):s.jsx(Pe,{className:"px-4 py-3 text-sm text-zinc-500",children:'No traffic-sync runs recorded yet. Hit "Sync now" above to create one.'})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Events"}),s.jsx("h2",{className:"mt-1 text-base font-semibold text-zinc-50",children:A.granularity==="day"?"Daily rollups":"Hourly rollups"}),$?s.jsxs("p",{className:"mt-1.5 text-xs text-zinc-500",children:[$.crawlerHits.toLocaleString("en-US")," crawler ·"," ",$.aiReferralHits.toLocaleString("en-US")," AI referral sessions · last ",A.label]}):null]}),s.jsx("div",{className:"filter-row mb-0",role:"toolbar","aria-label":"Window",children:Nv.map(q=>s.jsx("button",{type:"button",className:`filter-chip ${r===q.value?"filter-chip-active":""}`,"aria-pressed":r===q.value,onClick:()=>{i(q.value),d(null)},children:q.label},q.value))})]}),s.jsxs(Pe,{className:"p-4",children:[s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",role:"toolbar","aria-label":"Series",children:[s.jsx(c5,{label:"Crawler",color:o5,count:$?.crawlerHits??0,active:a.has("crawler"),onToggle:()=>H("crawler")}),s.jsx(c5,{label:"AI referral sessions",color:l5,count:$?.aiReferralHits??0,active:a.has("ai-referral"),onToggle:()=>H("ai-referral")})]}),Y.length===0?s.jsx("p",{className:"py-12 text-center text-xs text-zinc-500",children:"No events in this window."}):s.jsx("div",{className:"h-72",children:s.jsx(By,{children:s.jsxs(XOe,{data:Y,margin:{top:4,right:4,bottom:0,left:0},onClick:X,style:{cursor:"pointer"},children:[s.jsx(G8,{stroke:eze,strokeDasharray:"3 3"}),s.jsx(Wh,{dataKey:"label",tick:Lo,stroke:xd,interval:"preserveStartEnd",minTickGap:A.granularity==="day"?24:32}),s.jsx(Zh,{tick:Lo,stroke:xd,allowDecimals:!1}),s.jsx(fv,{...ed}),a.has("crawler")?s.jsx(RN,{dataKey:"crawler",name:"Crawler",fill:o5,stackId:"a",children:Y.map(q=>s.jsx(hv,{fillOpacity:c&&c!==q.bucket?.25:1},q.bucket))}):null,a.has("ai-referral")?s.jsx(RN,{dataKey:"aiReferral",name:"AI referral",fill:l5,stackId:"a",children:Y.map(q=>s.jsx(hv,{fillOpacity:c&&c!==q.bucket?.25:1},q.bucket))}):null]})})})]})]}),s.jsxs("section",{children:[s.jsxs("div",{className:"mb-4 flex flex-wrap items-end justify-between gap-x-4 gap-y-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:"Event rows"}),s.jsxs("p",{className:"mt-1 text-xs text-zinc-500",children:["Showing ",s.jsx("span",{className:"tabular-nums text-zinc-300",children:K.length.toLocaleString("en-US")})," of"," ",s.jsx("span",{className:"tabular-nums text-zinc-500",children:F.length.toLocaleString("en-US")})," events"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("select",{"aria-label":"Filter by identity",value:f,onChange:q=>p(q.target.value),className:"rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600",children:[s.jsx("option",{value:"",children:"All identities"}),M.map(q=>s.jsx("option",{value:q,children:q},q))]}),s.jsxs("select",{"aria-label":"Filter by operator",value:m,onChange:q=>y(q.target.value),className:"rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600",children:[s.jsx("option",{value:"",children:"All operators"}),U.map(q=>s.jsx("option",{value:q,children:q},q))]}),s.jsx("input",{type:"search","aria-label":"Filter by path",placeholder:"path contains…",value:v,onChange:q=>w(q.target.value),className:"w-44 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-xs text-zinc-200 placeholder:text-zinc-600 focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-600"})]})]}),xe?s.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[Z?s.jsx(Tg,{label:`Bucket: ${Z}`,onClear:()=>d(null)}):null,f?s.jsx(Tg,{label:`Identity: ${f}`,onClear:()=>p("")}):null,m?s.jsx(Tg,{label:`Operator: ${m}`,onClear:()=>y("")}):null,v.trim()?s.jsx(Tg,{label:`Path: ${v.trim()}`,onClear:()=>w("")}):null,s.jsx("button",{type:"button",onClick:ue,className:"text-xs text-zinc-500 underline-offset-4 hover:text-zinc-200 hover:underline",children:"Clear all"})]}):null,s.jsx(J_e,{events:K})]})]})}function Yg(e,t){return t==="day"?W_e(e):P9(e)}function X_e(e,t,n,r){const i=new Map;for(const a of e){const l=T9(a.tsHour,t);let c=i.get(l);c||(c={bucket:l,label:Yg(l,t),crawler:0,aiReferral:0},i.set(l,c)),a.kind===$a.crawler?c.crawler+=a.hits:c.aiReferral+=a.hits}if(n&&r){const a=new Date(n),l=new Date(r);if(t==="day"){const c=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate())),d=new Date(Date.UTC(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()));for(;c<=d;){const f=c.getUTCFullYear(),p=String(c.getUTCMonth()+1).padStart(2,"0"),m=String(c.getUTCDate()).padStart(2,"0"),y=`${f}-${p}-${m}`;i.has(y)||i.set(y,{bucket:y,label:Yg(y,t),crawler:0,aiReferral:0}),c.setUTCDate(c.getUTCDate()+1)}}else{const c=new Date(a);for(c.setUTCMinutes(0,0,0);c<=l;){const d=c.toISOString();i.has(d)||i.set(d,{bucket:d,label:Yg(d,t),crawler:0,aiReferral:0}),c.setUTCHours(c.getUTCHours()+1)}}}return[...i.values()].sort((a,l)=>a.bucket<l.bucket?-1:a.bucket>l.bucket?1:0)}function Tg({label:e,onClear:t}){return s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-zinc-700 bg-zinc-800/60 px-2.5 py-1 text-[11px] text-zinc-200",children:[e,s.jsx("button",{type:"button",onClick:t,"aria-label":`Clear ${e}`,className:"rounded-full p-0.5 text-zinc-400 hover:bg-zinc-700/60 hover:text-zinc-100",children:s.jsx(Sc,{className:"size-3"})})]})}function c5({label:e,color:t,count:n,active:r,onToggle:i}){return s.jsxs("button",{type:"button",onClick:i,"aria-pressed":r,className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-xs font-medium transition ${r?"border-zinc-700 bg-zinc-800/60 text-zinc-100":"border-zinc-800 bg-transparent text-zinc-500 hover:text-zinc-300"}`,children:[s.jsx("span",{"aria-hidden":"true",className:`size-2 rounded-full transition-opacity ${r?"opacity-100":"opacity-30"}`,style:{backgroundColor:t}}),s.jsx("span",{children:e}),s.jsx("span",{className:`tabular-nums ${r?"text-zinc-400":"text-zinc-600"}`,children:n.toLocaleString("en-US")})]})}function J_e({events:e}){return e.length===0?s.jsx(Pe,{className:"p-6 text-center text-sm text-zinc-500",children:"No event rows match the current filters."}):s.jsx("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-zinc-900/50 text-[10px] font-semibold uppercase tracking-wider text-zinc-500",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-2 text-left",children:"Hour"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Kind"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Identity"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Evidence / status"}),s.jsx("th",{className:"px-4 py-2 text-left",children:"Path"}),s.jsx("th",{className:"px-4 py-2 text-right",children:"Hits"})]})}),s.jsx("tbody",{className:"divide-y divide-zinc-800/60",children:e.map((t,n)=>s.jsxs("tr",{className:"hover:bg-zinc-900/40 transition-colors",children:[s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zinc-300",children:P9(t.tsHour)}),s.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===$a.crawler?"Crawler":"AI referral"}),s.jsxs("td",{className:"px-4 py-2 text-zinc-100",children:[t.kind===$a.crawler?t.botId:t.product,s.jsx("span",{className:"ml-2 text-[11px] text-zinc-500",children:t.operator})]}),s.jsx("td",{className:"px-4 py-2 text-zinc-300",children:t.kind===$a.crawler?`${t.verificationStatus} · HTTP ${t.status}`:`${t.evidenceType} · ${t.sourceDomain}`}),s.jsx("td",{className:"px-4 py-2 truncate font-mono text-xs text-zinc-300",children:t.kind===$a.crawler?t.pathNormalized:t.landingPathNormalized}),s.jsx("td",{className:"px-4 py-2 text-right tabular-nums text-zinc-100",children:t.hits})]},`${t.kind}:${t.tsHour}:${n}`))})]})})}function e2e(){return s.jsx("div",{className:"page-container",children:s.jsx("section",{className:"page-section",children:s.jsxs(Pe,{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(pe,{asChild:!0,children:s.jsx(zt,{to:"/",children:"Return to overview"})})]})})})}function t2e(){return s.jsx(kde,{children:s.jsx(Nde,{})})}const ui=dV()({component:t2e,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),n2e=ir({getParentRoute:()=>ui,path:"/",component:Ede,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(_e.projects.all);if(t&&t.length===0)throw nk({to:"/setup"})}}),r2e=ir({getParentRoute:()=>ui,path:"/projects",component:Bfe}),ol=ir({getParentRoute:()=>ui,path:"/projects/$projectId",component:()=>s.jsx(dk,{})}),i2e=ir({getParentRoute:()=>ol,path:"/",component:()=>s.jsx(Rc,{tab:"overview"})}),a2e=ir({getParentRoute:()=>ol,path:"/search-console",component:()=>s.jsx(Rc,{tab:"search-console"})}),s2e=ir({getParentRoute:()=>ol,path:"/discovery",component:()=>s.jsx(Rc,{tab:"discovery"})}),o2e=ir({getParentRoute:()=>ol,path:"/report",component:()=>s.jsx(Rc,{tab:"report"})}),l2e=ir({getParentRoute:()=>ol,path:"/activity",component:()=>s.jsx(Rc,{tab:"activity"})}),c2e=ir({getParentRoute:()=>ol,path:"/backlinks",component:()=>s.jsx(Rc,{tab:"backlinks"})}),u2e=ir({getParentRoute:()=>ol,path:"/settings",component:()=>s.jsx(Rc,{tab:"settings"})}),d2e=ir({getParentRoute:()=>ui,path:"/runs",component:A_e}),f2e=ir({getParentRoute:()=>ui,path:"/settings",component:T_e,beforeLoad:({context:e})=>{}}),h2e=ir({getParentRoute:()=>ui,path:"/setup",component:D_e,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(_e.projects.all);if(t&&t.length>0)throw nk({to:"/"})}}),p2e=ir({getParentRoute:()=>ui,path:"/backlinks",component:I_e}),m2e=ir({getParentRoute:()=>ui,path:"/traffic",component:K_e}),g2e=ir({getParentRoute:()=>ui,path:"/traffic/$projectName/$sourceId",component:Z_e}),y2e=ir({getParentRoute:()=>ui,path:"*",component:e2e}),v2e=ui.addChildren([n2e,r2e,ol.addChildren([i2e,a2e,s2e,o2e,l2e,c2e,u2e]),d2e,f2e,h2e,p2e,m2e,g2e,y2e]);function x2e(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const u5=x2e(),b2e=u5==="/"?"":u5.replace(/\/$/,"");function w2e(e,t){return wV({routeTree:v2e,basepath:b2e||"/",context:{queryClient:e},...t?.initialEntries})}const S2e=6e4;function j2e(){const[e,t]=x.useState(zw()?"ready":"checking"),[n,r]=x.useState(""),[i,a]=x.useState(""),[l,c]=x.useState(null),[d,f]=x.useState(!1),[p,m]=x.useState(!1),y=x.useRef(null),v=x.useRef(null),w=()=>{if(!y.current){const k=dY();v.current=k,y.current=w2e(k)}return{queryClient:v.current,router:y.current}};x.useEffect(()=>{if(zw())return;let k=!1;return U2().then(E=>{k||(E.authenticated?t("ready"):t(E.setupRequired?"setup":"login"))}).catch(E=>{k||(c(E instanceof Error?E.message:"Failed to reach the Canonry API"),t("login"))}),()=>{k=!0}},[]),x.useEffect(()=>{if(e!=="ready"||zw())return;const k=setInterval(()=>{U2().then(E=>{E.authenticated||(m(!0),t(E.setupRequired?"setup":"login"))}).catch(()=>{})},S2e);return L2(()=>{m(!0),t("login")}),()=>{clearInterval(k),L2(null)}},[e]);const b=async k=>{if(k.preventDefault(),!n.trim()||n.trim().length<8){c("Password must be at least 8 characters");return}if(n!==i){c("Passwords do not match");return}f(!0),c(null);try{if(!(await UV(n.trim())).authenticated){c("Setup failed");return}r(""),a(""),m(!1),t("ready")}catch(E){c(E instanceof rr||E instanceof Error?E.message:"Setup failed")}finally{f(!1)}},j=async k=>{if(k.preventDefault(),!!n.trim()){f(!0),c(null);try{if(!(await qV(n.trim())).authenticated){c("Incorrect password");return}r(""),m(!1),t("ready")}catch(E){c(E instanceof rr||E instanceof Error?E.message:"Authentication failed")}finally{f(!1)}}};if(e==="ready"){const{queryClient:k,router:E}=w();return s.jsx(b7,{client:k,children:s.jsx(NV,{router:E})})}return 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(Pe,{className:"surface-card w-full",children:e==="checking"?s.jsx(Bg,{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(R1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),s.jsx(D1,{children:"Create a dashboard password"}),s.jsx(M1,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),s.jsx(Bg,{children:s.jsxs("form",{className:"space-y-4",onSubmit:Ke(b),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:k=>r(k.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:k=>a(k.target.value),placeholder:"Re-enter password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(pe,{type:"submit",disabled:d||!n.trim()||!i.trim(),children:d?"Setting up…":"Create password & open dashboard"})]})})]}):s.jsxs(s.Fragment,{children:[s.jsxs(R1,{children:[s.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),s.jsx(D1,{children:"Sign in to Canonry"}),s.jsx(M1,{children:"Enter your dashboard password to continue."})]}),s.jsxs(Bg,{children:[p?s.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,s.jsxs("form",{className:"space-y-4",onSubmit:Ke(j),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:k=>r(k.target.value),placeholder:"Dashboard password"})]}),l?s.jsx("p",{className:"text-sm text-rose-400",children:l}):null,s.jsx(pe,{type:"submit",disabled:d||!n.trim(),children:d?"Signing in…":"Open dashboard"})]})]})]})})})})}const R9=document.getElementById("root");if(!R9)throw new Error("Expected #root element for web app bootstrap.");YK.createRoot(R9).render(s.jsx(x.StrictMode,{children:s.jsx(j2e,{})}));
|