wgts-report 0.1.13 → 0.1.14
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/dist/assets/wgts-report.css +1 -1
- package/dist/assets/wgts-report.js +80 -60
- package/dist/index.html +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var G2=n=>{throw TypeError(n)};var Af=(n,l,a)=>l.has(n)||G2("Cannot "+a);var F=(n,l,a)=>(Af(n,l,"read from private field"),a?a.call(n):l.get(n)),Ce=(n,l,a)=>l.has(n)?G2("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,a),ge=(n,l,a,i)=>(Af(n,l,"write to private field"),i?i.call(n,a):l.set(n,a),a),Ue=(n,l,a)=>(Af(n,l,"access private method"),a);var bu=(n,l,a,i)=>({set _(c){ge(n,l,c,a)},get _(){return F(n,l,i)}});function qj(n,l){for(var a=0;a<l.length;a++){const i=l[a];if(typeof i!="string"&&!Array.isArray(i)){for(const c in i)if(c!=="default"&&!(c in n)){const d=Object.getOwnPropertyDescriptor(i,c);d&&Object.defineProperty(n,c,d.get?d:{enumerable:!0,get:()=>i[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function a(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(c){if(c.ep)return;c.ep=!0;const d=a(c);fetch(c.href,d)}})();function Ij(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Of={exports:{}},mr={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var q2;function Pj(){if(q2)return mr;q2=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function a(i,c,d){var f=null;if(d!==void 0&&(f=""+d),c.key!==void 0&&(f=""+c.key),"key"in c){d={};for(var m in c)m!=="key"&&(d[m]=c[m])}else d=c;return c=d.ref,{$$typeof:n,type:i,key:f,ref:c!==void 0?c:null,props:d}}return mr.Fragment=l,mr.jsx=a,mr.jsxs=a,mr}var I2;function Qj(){return I2||(I2=1,Of.exports=Pj()),Of.exports}var r=Qj(),zf={exports:{}},Te={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react.production.js
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var P2;function Yj(){if(P2)return Te;P2=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),S=Symbol.for("react.view_transition"),j=Symbol.iterator;function b(D){return D===null||typeof D!="object"?null:(D=j&&D[j]||D["@@iterator"],typeof D=="function"?D:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,A={};function T(D,U,q){this.props=D,this.context=U,this.refs=A,this.updater=q||N}T.prototype.isReactComponent={},T.prototype.setState=function(D,U){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,U,"setState")},T.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function L(){}L.prototype=T.prototype;function M(D,U,q){this.props=D,this.context=U,this.refs=A,this.updater=q||N}var _=M.prototype=new L;_.constructor=M,E(_,T.prototype),_.isPureReactComponent=!0;var R=Array.isArray;function k(){}var I={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function O(D,U,q){var re=q.ref;return{$$typeof:n,type:D,key:U,ref:re!==void 0?re:null,props:q}}function se(D,U){return O(D.type,U,D.props)}function ie(D){return typeof D=="object"&&D!==null&&D.$$typeof===n}function W(D){var U={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(q){return U[q]})}var P=/\/+/g;function le(D,U){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):U.toString(36)}function $(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(k,k):(D.status="pending",D.then(function(U){D.status==="pending"&&(D.status="fulfilled",D.value=U)},function(U){D.status==="pending"&&(D.status="rejected",D.reason=U)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Z(D,U,q,re,he){var ye=typeof D;(ye==="undefined"||ye==="boolean")&&(D=null);var we=!1;if(D===null)we=!0;else switch(ye){case"bigint":case"string":case"number":we=!0;break;case"object":switch(D.$$typeof){case n:case l:we=!0;break;case v:return we=D._init,Z(we(D._payload),U,q,re,he)}}if(we)return he=he(D),we=re===""?"."+le(D,0):re,R(he)?(q="",we!=null&&(q=we.replace(P,"$&/")+"/"),Z(he,U,q,"",function(gt){return gt})):he!=null&&(ie(he)&&(he=se(he,q+(he.key==null||D&&D.key===he.key?"":(""+he.key).replace(P,"$&/")+"/")+we)),U.push(he)),1;we=0;var me=re===""?".":re+":";if(R(D))for(var Se=0;Se<D.length;Se++)re=D[Se],ye=me+le(re,Se),we+=Z(re,U,q,ye,he);else if(Se=b(D),typeof Se=="function")for(D=Se.call(D),Se=0;!(re=D.next()).done;)re=re.value,ye=me+le(re,Se++),we+=Z(re,U,q,ye,he);else if(ye==="object"){if(typeof D.then=="function")return Z($(D),U,q,re,he);throw U=String(D),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return we}function J(D,U,q){if(D==null)return D;var re=[],he=0;return Z(D,re,"","",function(ye){return U.call(q,ye,he++)}),re}function ce(D){if(D._status===-1){var U=D._result,q=U();q.then(function(re){(D._status===0||D._status===-1)&&(D._status=1,D._result=re,q.status===void 0&&(q.status="fulfilled",q.value=re))},function(re){(D._status===0||D._status===-1)&&(D._status=2,D._result=re,q.status===void 0&&(q.status="rejected",q.reason=re))}),D._status===-1&&(D._status=0,D._result=q)}if(D._status===1)return D._result.default;throw D._result}var ae=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)};function oe(D){var U=I.T,q={};q.types=U!==null?U.types:null,I.T=q;try{var re=D(),he=I.S;he!==null&&he(q,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(k,ae)}catch(ye){ae(ye)}finally{U!==null&&q.types!==null&&(U.types=q.types),I.T=U}}function xe(D){var U=I.T;if(U!==null){var q=U.types;q===null?U.types=[D]:q.indexOf(D)===-1&&q.push(D)}else oe(xe.bind(null,D))}var je={map:J,forEach:function(D,U,q){J(D,function(){U.apply(this,arguments)},q)},count:function(D){var U=0;return J(D,function(){U++}),U},toArray:function(D){return J(D,function(U){return U})||[]},only:function(D){if(!ie(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Te.Activity=p,Te.Children=je,Te.Component=T,Te.Fragment=a,Te.Profiler=c,Te.PureComponent=M,Te.StrictMode=i,Te.Suspense=g,Te.ViewTransition=S,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Te.__COMPILER_RUNTIME={__proto__:null,c:function(D){return I.H.useMemoCache(D)}},Te.addTransitionType=xe,Te.cache=function(D){return function(){return D.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(D,U,q){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var re=E({},D.props),he=D.key;if(U!=null)for(ye in U.key!==void 0&&(he=""+U.key),U)!K.call(U,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&U.ref===void 0||(re[ye]=U[ye]);var ye=arguments.length-2;if(ye===1)re.children=q;else if(1<ye){for(var we=Array(ye),me=0;me<ye;me++)we[me]=arguments[me+2];re.children=we}return O(D.type,he,re)},Te.createContext=function(D){return D={$$typeof:f,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:d,_context:D},D},Te.createElement=function(D,U,q){var re,he={},ye=null;if(U!=null)for(re in U.key!==void 0&&(ye=""+U.key),U)K.call(U,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(he[re]=U[re]);var we=arguments.length-2;if(we===1)he.children=q;else if(1<we){for(var me=Array(we),Se=0;Se<we;Se++)me[Se]=arguments[Se+2];he.children=me}if(D&&D.defaultProps)for(re in we=D.defaultProps,we)he[re]===void 0&&(he[re]=we[re]);return O(D,ye,he)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(D){return{$$typeof:m,render:D}},Te.isValidElement=ie,Te.lazy=function(D){return{$$typeof:v,_payload:{_status:-1,_result:D},_init:ce}},Te.memo=function(D,U){return{$$typeof:y,type:D,compare:U===void 0?null:U}},Te.startTransition=oe,Te.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Te.use=function(D){return I.H.use(D)},Te.useActionState=function(D,U,q){return I.H.useActionState(D,U,q)},Te.useCallback=function(D,U){return I.H.useCallback(D,U)},Te.useContext=function(D){return I.H.useContext(D)},Te.useDebugValue=function(){},Te.useDeferredValue=function(D,U){return I.H.useDeferredValue(D,U)},Te.useEffect=function(D,U){return I.H.useEffect(D,U)},Te.useEffectEvent=function(D){return I.H.useEffectEvent(D)},Te.useId=function(){return I.H.useId()},Te.useImperativeHandle=function(D,U,q){return I.H.useImperativeHandle(D,U,q)},Te.useInsertionEffect=function(D,U){return I.H.useInsertionEffect(D,U)},Te.useLayoutEffect=function(D,U){return I.H.useLayoutEffect(D,U)},Te.useMemo=function(D,U){return I.H.useMemo(D,U)},Te.useOptimistic=function(D,U){return I.H.useOptimistic(D,U)},Te.useReducer=function(D,U,q){return I.H.useReducer(D,U,q)},Te.useRef=function(D){return I.H.useRef(D)},Te.useState=function(D){return I.H.useState(D)},Te.useSyncExternalStore=function(D,U,q){return I.H.useSyncExternalStore(D,U,q)},Te.useTransition=function(){return I.H.useTransition()},Te.version="19.3.1",Te}var Q2;function mg(){return Q2||(Q2=1,zf.exports=Yj()),zf.exports}var C=mg();const Xj=Ij(C),Kj=qj({__proto__:null,default:Xj},[C]);var Df={exports:{}},gr={},kf={exports:{}},Lf={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.js
|
|
20
20
|
*
|
|
@@ -22,7 +22,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var
|
|
25
|
+
*/var Y2;function Zj(){return Y2||(Y2=1,(function(n){function l($,Z){var J=$.length;$.push(Z);e:for(;0<J;){var ce=J-1>>>1,ae=$[ce];if(0<c(ae,Z))$[ce]=Z,$[J]=ae,J=ce;else break e}}function a($){return $.length===0?null:$[0]}function i($){if($.length===0)return null;var Z=$[0],J=$.pop();if(J!==Z){$[0]=J;e:for(var ce=0,ae=$.length,oe=ae>>>1;ce<oe;){var xe=2*(ce+1)-1,je=$[xe],D=xe+1,U=$[D];if(0>c(je,J))D<ae&&0>c(U,je)?($[ce]=U,$[D]=J,ce=D):($[ce]=je,$[xe]=J,ce=xe);else if(D<ae&&0>c(U,J))$[ce]=U,$[D]=J,ce=D;else break e}}return Z}function c($,Z){var J=$.sortIndex-Z.sortIndex;return J!==0?J:$.id-Z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,m=f.now();n.unstable_now=function(){return f.now()-m}}var g=[],y=[],v=1,p=null,S=3,j=!1,b=!1,N=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function M($){for(var Z=a(y);Z!==null;){if(Z.callback===null)i(y);else if(Z.startTime<=$)i(y),Z.sortIndex=Z.expirationTime,l(g,Z);else break;Z=a(y)}}function _($){if(N=!1,M($),!b)if(a(g)!==null)b=!0,R||(R=!0,ie());else{var Z=a(y);Z!==null&&le(_,Z.startTime-$)}}var R=!1,k=-1,I=5,K=-1;function O(){return E?!0:!(n.unstable_now()-K<I)}function se(){if(E=!1,R){var $=n.unstable_now();K=$;var Z=!0;try{e:{b=!1,N&&(N=!1,T(k),k=-1),j=!0;var J=S;try{t:{for(M($),p=a(g);p!==null&&!(p.expirationTime>$&&O());){var ce=p.callback;if(typeof ce=="function"){p.callback=null,S=p.priorityLevel;var ae=ce(p.expirationTime<=$);if($=n.unstable_now(),typeof ae=="function"){p.callback=ae,M($),Z=!0;break t}p===a(g)&&i(g),M($)}else i(g);p=a(g)}if(p!==null)Z=!0;else{var oe=a(y);oe!==null&&le(_,oe.startTime-$),Z=!1}}break e}finally{p=null,S=J,j=!1}Z=void 0}}finally{Z?ie():R=!1}}}var ie;if(typeof L=="function")ie=function(){L(se)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,P=W.port2;W.port1.onmessage=se,ie=function(){P.postMessage(null)}}else ie=function(){A(se,0)};function le($,Z){k=A(function(){$(n.unstable_now())},Z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function($){$.callback=null},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function($){switch(S){case 1:case 2:case 3:var Z=3;break;default:Z=S}var J=S;S=Z;try{return $()}finally{S=J}},n.unstable_requestPaint=function(){E=!0},n.unstable_runWithPriority=function($,Z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var J=S;S=$;try{return Z()}finally{S=J}},n.unstable_scheduleCallback=function($,Z,J){var ce=n.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?ce+J:ce):J=ce,$){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=J+ae,$={id:v++,callback:Z,priorityLevel:$,startTime:J,expirationTime:ae,sortIndex:-1},J>ce?($.sortIndex=J,l(y,$),a(g)===null&&$===a(y)&&(N?(T(k),k=-1):N=!0,le(_,J-ce))):($.sortIndex=ae,l(g,$),b||j||(b=!0,R||(R=!0,ie()))),$},n.unstable_shouldYield=O,n.unstable_wrapCallback=function($){var Z=S;return function(){var J=S;S=Z;try{return $.apply(this,arguments)}finally{S=J}}}})(Lf)),Lf}var X2;function Jj(){return X2||(X2=1,kf.exports=Zj()),kf.exports}var $f={exports:{}},Vt={};/**
|
|
26
26
|
* @license React
|
|
27
27
|
* react-dom.production.js
|
|
28
28
|
*
|
|
@@ -30,7 +30,7 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var K2;function Wj(){if(K2)return Vt;K2=1;var n=mg();function l(v){var p="https://react.dev/errors/"+v;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)p+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+v+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(l(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},c=Symbol.for("react.portal"),d=Symbol.for("react.recoverable"),f=Symbol.for("react.optimistic_key");function m(v,p,S){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:j==null?null:j===f?f:""+j,children:v,containerInfo:p,implementation:S}}var g=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(v,p){if(v==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Vt.browser=function(v){return{$$typeof:d,_reason:v}},Vt.createPortal=function(v,p){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(l(299));return m(v,p,null,S)},Vt.flushSync=function(v){var p=g.T,S=i.p;try{if(g.T=null,i.p=2,v)return v()}finally{g.T=p,i.p=S,i.d.f()}},Vt.preconnect=function(v,p){typeof v=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(v,p))},Vt.prefetchDNS=function(v){typeof v=="string"&&i.d.D(v)},Vt.preinit=function(v,p){if(typeof v=="string"&&p&&typeof p.as=="string"){var S=p.as,j=y(S,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,N=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;S==="style"?i.d.S(v,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:j,integrity:b,fetchPriority:N}):S==="script"&&i.d.X(v,{crossOrigin:j,integrity:b,fetchPriority:N,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Vt.preinitModule=function(v,p){if(typeof v=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var S=y(p.as,p.crossOrigin);i.d.M(v,{crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&i.d.M(v)},Vt.preload=function(v,p){if(typeof v=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var S=p.as,j=y(S,p.crossOrigin);i.d.L(v,S,{crossOrigin:j,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Vt.preloadModule=function(v,p){if(typeof v=="string")if(p){var S=y(p.as,p.crossOrigin);i.d.m(v,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:S,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else i.d.m(v)},Vt.requestFormReset=function(v){i.d.r(v)},Vt.unstable_batchedUpdates=function(v,p){return v(p)},Vt.useFormState=function(v,p,S){return g.H.useFormState(v,p,S)},Vt.useFormStatus=function(){return g.H.useHostTransitionStatus()},Vt.version="19.3.1",Vt}var Z2;function Ex(){if(Z2)return $f.exports;Z2=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),$f.exports=Wj(),$f.exports}/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-dom-client.production.js
|
|
36
36
|
*
|
|
@@ -38,15 +38,15 @@ var Lv=n=>{throw TypeError(n)};var jh=(n,l,a)=>l.has(n)||Lv("Cannot "+a);var F=(
|
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var
|
|
41
|
+
*/var J2;function ew(){if(J2)return gr;J2=1;var n=Jj(),l=mg(),a=Ex();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){for(var t=e,s=t;s&&!s.alternate;)t=s,(t.flags&4098)!==0&&(e=t.return),s=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(i(188))}function y(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var s=e,o=t;;){var u=s.return;if(u===null)break;var h=u.alternate;if(h===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===s)return g(u),e;if(h===o)return g(u),t;h=h.sibling}throw Error(i(188))}if(s.return!==o.return)s=u,o=h;else{for(var x=!1,w=u.child;w;){if(w===s){x=!0,s=u,o=h;break}if(w===o){x=!0,o=u,s=h;break}w=w.sibling}if(!x){for(w=h.child;w;){if(w===s){x=!0,s=h,o=u;break}if(w===o){x=!0,o=h,s=u;break}w=w.sibling}if(!x)throw Error(i(189))}}if(s.alternate!==o)throw Error(i(190))}if(s.tag!==3)throw Error(i(188));return s.stateNode.current===s?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}function p(e,t,s,o,u,h){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&s(e,o,u,h)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,s,o,u,h))return!0;e=e.sibling}return!1}function S(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function j(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function b(e){var t=[null,null],s=S(e);return s===null||N(t,e,s.child,{foundSelf:!1}),t}function N(e,t,s,o){for(;s!==null;){if(s===t)o.foundSelf=!0;else if(s.tag===5||s.tag===27||s.tag===6){if(o.foundSelf)return e[1]=s,!0;e[0]=s}else if((s.tag!==22||s.memoizedState===null)&&N(e,t,s.child,o))return!0;s=s.sibling}return!1}function E(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var A=null,T=null;function L(e,t,s){return e===s?!0:e===t?(A=e,!0):!1}function M(e,t,s){return e===s?(T=e,!1):e===t?(T!==null&&(A=e),!0):!1}function _(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function R(e,t,s){for(var o=0,u=e;u;u=s(u))o++;u=0;for(var h=t;h;h=s(h))u++;for(;0<o-u;)e=s(e),o--;for(;0<u-o;)t=s(t),u--;for(;o--;){if(e===t||t!==null&&e===t.alternate)return e;e=s(e),t=s(t)}return null}var k=Object.assign,I=Symbol.for("react.element"),K=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),se=Symbol.for("react.fragment"),ie=Symbol.for("react.strict_mode"),W=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),le=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),xe=Symbol.for("react.legacy_hidden"),je=Symbol.for("react.memo_cache_sentinel"),D=Symbol.for("react.view_transition"),U=Symbol.for("react.recoverable"),q=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var he=Symbol.for("react.client.reference");function ye(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case se:return"Fragment";case W:return"Profiler";case ie:return"StrictMode";case Z:return"Suspense";case J:return"SuspenseList";case oe:return"Activity";case D:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case le:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return t=e.displayName||null,t!==null?t:ye(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var we=Array.isArray,me=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,gt={pending:!1,data:null,method:null,action:null},Pt=[],dn=-1;function kt(e){return{current:e}}function rt(e){0>dn||(e.current=Pt[dn],Pt[dn]=null,dn--)}function qe(e,t){dn++,Pt[dn]=e.current,e.current=t}var Qt=kt(null),kn=kt(null),tn=kt(null),hn=kt(null);function Ts(e,t){switch(qe(tn,t),qe(kn,e),qe(Qt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?J1(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=J1(t),e=W1(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}rt(Qt),qe(Qt,e)}function xt(){rt(Qt),rt(kn),rt(tn)}function as(e){var t=e.memoizedState;t!==null&&(Oi._currentValue=t.memoizedState,qe(hn,e)),t=Qt.current;var s=W1(t,e.type);t!==s&&(qe(kn,e),qe(Qt,s))}function Yt(e){kn.current===e&&(rt(Qt),rt(kn)),hn.current===e&&(rt(hn),Oi._currentValue=gt)}var nn,sl;function Et(e){if(nn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);nn=t&&t[1]||"",sl=-1<s.stack.indexOf(`
|
|
42
42
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+
|
|
44
|
-
`),
|
|
45
|
-
`);for(u=
|
|
46
|
-
`+z[
|
|
47
|
-
Error generating stack: `+
|
|
48
|
-
`+i.stack}}var we=Object.prototype.hasOwnProperty,Ue=n.unstable_scheduleCallback,Pe=n.unstable_cancelCallback,vt=n.unstable_shouldYield,pt=n.unstable_requestPaint,et=n.unstable_now,hn=n.unstable_getCurrentPriorityLevel,Nn=n.unstable_ImmediatePriority,ql=n.unstable_UserBlockingPriority,ka=n.unstable_NormalPriority,fo=n.unstable_LowPriority,tn=n.unstable_IdlePriority,Fr=n.log,Vr=n.unstable_setDisableYieldValue,Zs=null,Qt=null;function Xn(e){if(typeof Fr=="function"&&Vr(e),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Zs,e)}catch{}}var Yt=Math.clz32?Math.clz32:qr,Br=Math.log,Gr=Math.LN2;function qr(e){return e>>>=0,e===0?32:31-(Br(e)/Gr|0)|0}var Il=256,Ql=262144,Yl=4194304;function cs(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pl(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var w=i&134217727;return w!==0?(i=w&~f,i!==0?u=cs(i):(p&=w,p!==0?u=cs(p):s||(s=w&~e,s!==0&&(u=cs(s))))):(w=i&~f,w!==0?u=cs(w):p!==0?u=cs(p):s||(s=i&~e,s!==0&&(u=cs(s)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:u}function Js(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ho(e,t){(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var i=31-Yt(s),u=1<<i;t|=e[i],s&=~u}return t}function Ir(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 mo(){var e=Yl;return Yl<<=1,(Yl&62914560)===0&&(Yl=4194304),e}function Ha(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Ws(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ge(e,t,s,i,u,f){var p=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var w=e.entanglements,z=e.expirationTimes,q=e.hiddenUpdates;for(s=p&~s;0<s;){var X=31-Yt(s),ne=1<<X;w[X]=0,z[X]=-1;var V=q[X];if(V!==null)for(q[X]=null,X=0;X<V.length;X++){var Y=V[X];Y!==null&&(Y.lane&=-536870913)}s&=~ne}i!==0&&at(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(p&~t))}function at(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Yt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function nn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-Yt(s),u=1<<i;u&t|e[i]&t&&(e[i]|=t),s&=~u}}function Ua(e,t){var s=t&-t;return s=(s&42)!==0?1:go(s),(s&(e.suspendedLanes|t))!==0?0:s}function go(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function po(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Fa(){var e=Se.p;return e!==0?e:(e=window.event,e===void 0?32:Tv(e.type))}function Kn(e,t){var s=Se.p;try{return Se.p=e,t()}finally{Se.p=s}}var $n=Math.random().toString(36).slice(2),xt="__reactFiber$"+$n,Lt="__reactProps$"+$n,el="__reactContainer$"+$n,yo="__reactEvents$"+$n,Qr="__reactListeners$"+$n,IS="__reactHandles$"+$n,Ng="__reactResources$"+$n,vo="__reactMarker$"+$n,Yr="__reactLoad$"+$n;function Pr(e){delete e[xt],delete e[Lt],delete e[Qr],delete e[IS]}function Xl(e){var t;if(t=e[xt])return t;for(var s=e.parentNode;s;){if(t=s[el]||s[xt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=rv(e);e!==null;){if(s=e[xt])return s;e=rv(e)}return t}e=s,s=e.parentNode}return null}function Va(e){if(e=e[xt]||e[el]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Ba(e){var t=e[Ng];return t||(t=e[Ng]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[vo]=!0}function Cg(e){e[Yr]=void 0}var Mg=new Set,Eg={};function Kl(e,t){Ga(e,t),Ga(e+"Capture",t)}function Ga(e,t){for(Eg[e]=t,e=0;e<t.length;e++)Mg.add(t[e])}var QS=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]*$"),Tg={},_g={};function YS(e){return we.call(_g,e)?!0:we.call(Tg,e)?!1:QS.test(e)?_g[e]=!0:(Tg[e]=!0,!1)}var qe=!1;function Rg(){var e=qe;return qe=!1,e}function Xr(e,t,s){if(YS(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,s)}}function Kr(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,s)}}function _s(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,i)}}function Cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ag(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function PS(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(p){s=""+p,f.call(this,p)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(p){s=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zu(e){if(!e._valueTracker){var t=Ag(e)?"checked":"value";e._valueTracker=PS(e,t,""+e[t])}}function Og(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=Ag(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}var XS=/[\n"\\]/g;function kn(e){return e.replace(XS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ju(e,t,s,i,u,f,p,w){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Cn(t)):e.value!==""+Cn(t)&&(e.value=""+Cn(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?p==="number"&&e.value==t?Wu(e,Cn(e.value)):Wu(e,Cn(t)):s!=null?Wu(e,Cn(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Cn(w):e.removeAttribute("name")}function zg(e,t,s,i,u,f,p,w){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Zu(e);return}s=s!=null?""+Cn(s):"",t=t!=null?""+Cn(t):s,w||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=w?e.checked:!!i,e.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),Zu(e)}function Wu(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function qa(e,t,s,i){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Cn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Dg(e,t,s){if(t!=null&&(t=""+Cn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Cn(s):""}function Lg(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(o(92));if(Te(i)){if(1<i.length)throw Error(o(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=Cn(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Zu(e)}function Ia(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var KS=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 $g(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||KS.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function kg(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="",qe=!0);for(var u in t)i=t[u],t.hasOwnProperty(u)&&s[u]!==i&&($g(e,u,i),qe=!0)}else for(var f in t)t.hasOwnProperty(f)&&$g(e,f,t[f])}function ef(e){if(e.indexOf("-")===-1)return!1;switch(e){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 ZS=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"],["maskType","mask-type"],["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"]]),JS=/^[\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 Zr(e){return JS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function us(){}var tf=null;function nf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qa=null,Ya=null;function Hg(e){var t=Va(e);if(t&&(e=t.stateNode)){var s=e[Lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ju(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+kn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var u=i[Lt]||null;if(!u)throw Error(o(90));Ju(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&Og(i)}break e;case"textarea":Dg(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&qa(e,!!s.multiple,t,!1)}}}var sf=!1;function Ug(e,t,s){if(sf)return e(t,s);sf=!0;try{var i=e(t);return i}finally{if(sf=!1,(Qa!==null||Ya!==null)&&(Zc(),Qa&&(t=Qa,e=Ya,Ya=Qa=null,Hg(t),e)))for(t=0;t<e.length;t++)Hg(e[t])}}function So(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Lt]||null;if(i===null)return null;s=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var Rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lf=!1;if(Rs)try{var bo={};Object.defineProperty(bo,"passive",{get:function(){lf=!0}}),window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{lf=!1}var tl=null,af=null,Jr=null;function Fg(){if(Jr)return Jr;var e,t=af,s=t.length,i,u="value"in tl?tl.value:tl.textContent,f=u.length;for(e=0;e<s&&t[e]===u[e];e++);var p=s-e;for(i=1;i<=p&&t[s-i]===u[f-i];i++);return Jr=u.slice(e,1<i?1-i:void 0)}function Wr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ec(){return!0}function Vg(){return!1}function sn(e){function t(s,i,u,f,p){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=p,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(s=e[w],this[w]=s?s(f):f[w]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?ec:Vg,this.isPropagationStopped=Vg,this}return A(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ec)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ec)},persist:function(){},isPersistent:ec}),t}var nl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tc=sn(nl),jo=A({},nl,{view:0,detail:0}),WS=sn(jo),of,rf,wo,nc=A({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==wo&&(wo&&e.type==="mousemove"?(of=e.screenX-wo.screenX,rf=e.screenY-wo.screenY):rf=of=0,wo=e),of)},movementY:function(e){return"movementY"in e?e.movementY:rf}}),Bg=sn(nc),eb=A({},nc,{dataTransfer:0}),tb=sn(eb),nb=A({},jo,{relatedTarget:0}),cf=sn(nb),sb=A({},nl,{animationName:0,elapsedTime:0,pseudoElement:0}),lb=sn(sb),ab=A({},nl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ib=sn(ab),ob=A({},nl,{data:0}),Gg=sn(ob),rb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cb={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"},ub={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ub[e])?!!t[e]:!1}function uf(){return fb}var db=A({},jo,{key:function(e){if(e.key){var t=rb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uf,charCode:function(e){return e.type==="keypress"?Wr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hb=sn(db),mb=A({},nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qg=sn(mb),gb=A({},nl,{submitter:0}),pb=sn(gb),yb=A({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uf}),vb=sn(yb),xb=A({},nl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Sb=sn(xb),bb=A({},nc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),jb=sn(bb),wb=A({},nl,{newState:0,oldState:0,source:0}),Nb=sn(wb),Cb=[9,13,27,32],ff=Rs&&"CompositionEvent"in window,No=null;Rs&&"documentMode"in document&&(No=document.documentMode);var Mb=Rs&&"TextEvent"in window&&!No,Ig=Rs&&(!ff||No&&8<No&&11>=No),Qg=" ",Yg=!1;function Pg(e,t){switch(e){case"keyup":return Cb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pa=!1;function Eb(e,t){switch(e){case"compositionend":return Xg(t);case"keypress":return t.which!==32?null:(Yg=!0,Qg);case"textInput":return e=t.data,e===Qg&&Yg?null:e;default:return null}}function Tb(e,t){if(Pa)return e==="compositionend"||!ff&&Pg(e,t)?(e=Fg(),Jr=af=tl=null,Pa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Ig&&t.locale!=="ko"?null:t.data;default:return null}}var _b={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_b[e.type]:t==="textarea"}function Zg(e,t,s,i){Qa?Ya?Ya.push(i):Ya=[i]:Qa=i,t=su(t,"onChange"),0<t.length&&(s=new tc("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Co=null,Mo=null;function Rb(e){Hy(e,0)}function sc(e){var t=xo(e);if(Og(t))return e}function Jg(e,t){if(e==="change")return t}var Wg=!1;if(Rs){var df;if(Rs){var hf="oninput"in document;if(!hf){var ep=document.createElement("div");ep.setAttribute("oninput","return;"),hf=typeof ep.oninput=="function"}df=hf}else df=!1;Wg=df&&(!document.documentMode||9<document.documentMode)}function tp(){Co&&(Co.detachEvent("onpropertychange",np),Mo=Co=null)}function np(e){if(e.propertyName==="value"&&sc(Mo)){var t=[];Zg(t,Mo,e,nf(e)),Ug(Rb,t)}}function Ab(e,t,s){e==="focusin"?(tp(),Co=t,Mo=s,Co.attachEvent("onpropertychange",np)):e==="focusout"&&tp()}function Ob(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sc(Mo)}function zb(e,t){if(e==="click")return sc(t)}function Db(e,t){if(e==="input"||e==="change")return sc(t)}function Lb(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mn=typeof Object.is=="function"?Object.is:Lb;function Eo(e,t){if(Mn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!we.call(t,u)||!Mn(e[u],t[u]))return!1}return!0}function mf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function sp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lp(e,t){var s=sp(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=sp(s)}}function ap(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ap(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ip(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=mf(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=mf(e.document)}return t}function gf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var $b=Rs&&"documentMode"in document&&11>=document.documentMode,Xa=null,pf=null,To=null,yf=!1;function op(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;yf||Xa==null||Xa!==mf(i)||(i=Xa,"selectionStart"in i&&gf(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),To&&Eo(To,i)||(To=i,i=su(pf,"onSelect"),0<i.length&&(t=new tc("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Xa)))}function Zl(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ka={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},vf={},rp={};Rs&&(rp=document.createElement("div").style,"AnimationEvent"in window||(delete Ka.animationend.animation,delete Ka.animationiteration.animation,delete Ka.animationstart.animation),"TransitionEvent"in window||delete Ka.transitionend.transition);function Jl(e){if(vf[e])return vf[e];if(!Ka[e])return e;var t=Ka[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in rp)return vf[e]=t[s];return e}var cp=Jl("animationend"),up=Jl("animationiteration"),fp=Jl("animationstart"),kb=Jl("transitionrun"),Hb=Jl("transitionstart"),Ub=Jl("transitioncancel"),dp=Jl("transitionend"),hp=new Map,xf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");xf.push("scrollEnd");function Zn(e,t){hp.set(e,t),Kl(t,[e])}var Fb=0;function As(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=ts.identifierPrefix;var s=Fb++;return e="_"+e+"t_"+s.toString(32)+"_",t.autoName=e}function mp(e){if(e==null||typeof e=="string")return e;var t=null,s=pi;if(s!==null)for(var i=0;i<s.length;i++){var u=e[s[i]];if(u!=null){if(u==="none")return"none";t=t==null?u:t+(" "+u)}}return t??e.default}function Os(e,t){return e=mp(e),t=mp(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var lc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Hn=[],Za=0,Sf=0;function ac(){for(var e=Za,t=Sf=Za=0;t<e;){var s=Hn[t];Hn[t++]=null;var i=Hn[t];Hn[t++]=null;var u=Hn[t];Hn[t++]=null;var f=Hn[t];if(Hn[t++]=null,i!==null&&u!==null){var p=i.pending;p===null?u.next=u:(u.next=p.next,p.next=u),i.pending=u}f!==0&&gp(s,u,f)}}function ic(e,t,s,i){Hn[Za++]=e,Hn[Za++]=t,Hn[Za++]=s,Hn[Za++]=i,Sf|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function bf(e,t,s,i){return ic(e,t,s,i),oc(e)}function Wl(e,t){return ic(e,null,null,t),oc(e)}function gp(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-Yt(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=s|536870912),f):null}function oc(e){if(50<Ko)throw Ko=0,Kc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ja={};function Vb(e,t,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(e,t,s,i){return new Vb(e,t,s,i)}function jf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zs(e,t){var s=e.alternate;return s===null?(s=mn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&1206910976,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function pp(e,t){e.flags&=1206910978;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function rc(e,t,s,i,u,f){var p=0;if(i=e,typeof i=="function")jf(i)&&(p=1);else if(typeof i=="string")p=g2(e,s,Wt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(i){case de:return e=mn(31,s,t,u),e.elementType=de,e.lanes=f,e;case ie:return ea(s.children,u,f,t);case oe:p=8,u|=24;break;case se:return e=mn(12,s,t,u|2),e.elementType=se,e.lanes=f,e;case J:return e=mn(13,s,t,u),e.elementType=J,e.lanes=f,e;case Z:return e=mn(19,s,t,u),e.elementType=Z,e.lanes=f,e;case ve:case L:return e=u|32,e=mn(30,s,t,e),e.elementType=L,e.lanes=f,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case le:p=10;break e;case P:p=9;break e;case $:p=11;break e;case W:p=14;break e;case ae:p=16,i=null;break e}p=29,s=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=mn(p,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function ea(e,t,s,i){return e=mn(7,e,i,t),e.lanes=s,e}function wf(e,t,s){return e=mn(6,e,null,t),e.lanes=s,e}function yp(e){var t=mn(18,null,null,0);return t.stateNode=e,t}function Nf(e,t,s){return t=mn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vp=new WeakMap;function Un(e,t){if(typeof e=="object"&&e!==null){var s=vp.get(e);return s!==void 0?s:(t={value:e,source:t,stack:ue(t)},vp.set(e,t),t)}return{value:e,source:t,stack:ue(t)}}var Wa=[],ei=0,cc=null,_o=0,Fn=[],Vn=0,sl=null,fs=1,ds="";function Ds(e,t){Wa[ei++]=_o,Wa[ei++]=cc,cc=e,_o=t}function xp(e,t,s){Fn[Vn++]=fs,Fn[Vn++]=ds,Fn[Vn++]=sl,sl=e;var i=fs;e=ds;var u=32-Yt(i)-1;i&=~(1<<u),s+=1;var f=32-Yt(t)+u;if(30<f){var p=u-u%5;f=(i&(1<<p)-1).toString(32),i>>=p,u-=p,fs=1<<32-Yt(t)+u|s<<u|i,ds=f+e}else fs=1<<f|s<<u|i,ds=e}function uc(e){e.return!==null&&(Ds(e,1),xp(e,1,0))}function Cf(e){for(;e===cc;)cc=Wa[--ei],Wa[ei]=null,_o=Wa[--ei],Wa[ei]=null;for(;e===sl;)sl=Fn[--Vn],Fn[Vn]=null,ds=Fn[--Vn],Fn[Vn]=null,fs=Fn[--Vn],Fn[Vn]=null}function Sp(e,t){Fn[Vn++]=fs,Fn[Vn++]=ds,Fn[Vn++]=sl,fs=t.id,ds=t.overflow,sl=e}var _t=null,st=null,Oe=!1,ll=null,Bn=!1,Mf=Error(o(519));function al(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ro(Un(t,e)),Mf}function bp(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[xt]=e,t[Lt]=i,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<Jo.length;s++)De(Jo[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),zg(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),Lg(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||By(t.textContent,s)?(i.popover!=null&&(De("beforetoggle",t),De("toggle",t)),i.onScroll!=null&&De("scroll",t),i.onScrollEnd!=null&&De("scrollend",t),i.onClick!=null&&(t.onclick=us),t=!0):t=!1,t||al(e,!0)}function fc(e){for(_t=e.return;_t;)switch(_t.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:_t=_t.return}}function ti(e){if(e!==_t)return!1;if(!Oe)return fc(e),Oe=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||nh(e.type,e.memoizedProps)),s=!s),s&&st&&al(e),fc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));st=ov(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));st=ov(e)}else t===27?(t=st,bl(e.type)?(e=fh,fh=null,st=e):st=t):st=_t?qn(e.stateNode.nextSibling):null;return!0}function ta(){st=_t=null,Oe=!1}function Ef(){var e=ll;return e!==null&&(yn===null?yn=e:yn.push.apply(yn,e),ll=null),e}function Ro(e){ll===null?ll=[e]:ll.push(e)}var Tf=zt(null),na=null,Ls=null;function il(e,t,s){Ge(Tf,t._currentValue),t._currentValue=s}function $s(e){e._currentValue=Tf.current,ut(Tf)}function dc(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function _f(e,t,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var p=u.child;f=f.firstContext;e:for(;f!==null;){var w=f;f=u;for(var z=0;z<t.length;z++)if(w.context===t[z]){f.lanes|=s,w=f.alternate,w!==null&&(w.lanes|=s),dc(f.return,s,e),i||(p=null);break e}f=w.next}}else if(u.tag===18){if(p=u.return,p===null)throw Error(o(341));p.lanes|=s,f=p.alternate,f!==null&&(f.lanes|=s),dc(p,s,e),p=null}else u.tag===13&&u.memoizedState!==null&&u.memoizedState.dehydrated===null?(u.lanes|=s,p=u.alternate,p!==null&&(p.lanes|=s),dc(u.return,s,e),p=u.child,p=p!==null?p.sibling:null):p=u.child;if(p!==null)p.return=u;else for(p=u;p!==null;){if(p===e){p=null;break}if(u=p.sibling,u!==null){u.return=p.return,p=u;break}p=p.return}u=p}}function sa(e,t,s,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var p=u.alternate;if(p===null)throw Error(o(387));if(p=p.memoizedProps,p!==null){var w=u.type;Mn(u.pendingProps.value,p.value)||(e!==null?e.push(w):e=[w])}}else if(u===wn.current){if(p=u.alternate,p===null)throw Error(o(387));p.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Mi):e=[Mi])}u=u.return}return e!==null&&_f(t,e,s,i),t.flags|=262144,e!==null}function hc(e){for(e=e.firstContext;e!==null;){if(!Mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function la(e){na=e,Ls=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return jp(na,e)}function mc(e,t){return na===null&&la(e),jp(e,t)}function jp(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ls===null){if(e===null)throw Error(o(308));Ls=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ls=Ls.next=t;return s}var Bb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Gb=n.unstable_scheduleCallback,qb=n.unstable_NormalPriority,St={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rf(){return{controller:new Bb,data:new Map,refCount:0}}function Ao(e){e.refCount--,e.refCount===0&&Gb(qb,function(){e.controller.abort()})}function wp(e,t){if((e.pendingLanes&4194048)!==0){var s=e.transitionTypes;for(s===null&&(s=e.transitionTypes=[]),e=0;e<t.length;e++){var i=t[e];s.indexOf(i)===-1&&s.push(i)}}}var Oo=null;function Ib(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var zo=null,Af=0,aa=0,ni=null;function Qb(e,t){if(zo===null){var s=zo=[];Af=0,aa=Yd(),ni={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Af++,t.then(Np,Np),t}function Np(){if(--Af===0&&(Oo=null,zo!==null)){ni!==null&&(ni.status="fulfilled");var e=zo;zo=null,aa=0,ni=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Yb(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var Cp=me.S;me.S=function(e,t){if(yy=et(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qb(e,t),Oo!==null)for(var s=Si;s!==null;)wp(s,Oo),s=s.next;if(s=e.types,s!==null){for(var i=Si;i!==null;)wp(i,s),i=i.next;if(aa!==0){i=Oo,i===null&&(i=Oo=[]);for(var u=0;u<s.length;u++){var f=s[u];i.indexOf(f)===-1&&i.push(f)}}}Cp!==null&&Cp(e,t)};var ia=zt(null);function Of(){var e=ia.current;return e!==null?e:nt.pooledCache}function gc(e,t){t===null?Ge(ia,ia.current):Ge(ia,t.pool)}function Mp(){var e=Of();return e===null?null:{parent:St._currentValue,pool:e}}var si=Error(o(460)),zf=Error(o(474)),pc=Error(o(542)),yc={then:function(){}};function Ep(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Tp(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(us,us),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rp(e),e===void 0&&!("reason"in t)?Error(o(600)):e;default:if(typeof t.status=="string")t.then(us,us);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Rp(e),e}throw ra=t,si}}function oa(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ra=s,si):s}}var ra=null;function _p(){if(ra===null)throw Error(o(459));var e=ra;return ra=null,e}function Rp(e){if(e===si||e===pc)throw Error(o(483))}var li=null,Do=0;function vc(e){var t=Do;return Do+=1,li===null&&(li=[]),Tp(li,e,t)}function ol(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xc(e,t){throw t.$$typeof===B?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ap(e){function t(G,H){if(e){var Q=G.deletions;Q===null?(G.deletions=[H],G.flags|=16):Q.push(H)}}function s(G,H){if(!e)return null;for(;H!==null;)t(G,H),H=H.sibling;return null}function i(G){for(var H=new Map;G!==null;)G.key===null?H.set(G.index,G):H.set(G.key,G),G=G.sibling;return H}function u(G,H){return G=zs(G,H),G.index=0,G.sibling=null,G}function f(G,H,Q){return G.index=Q,e?(Q=G.alternate,Q!==null?(Q=Q.index,Q<H?(G.flags|=2,H):Q):(G.flags|=134217730,H)):(G.flags|=1048576,H)}function p(G){return e&&G.alternate===null&&(G.flags|=134217730),G}function w(G,H,Q,ee){return H===null||H.tag!==6?(H=wf(Q,G.mode,ee),H.return=G,H):(H=u(H,Q),H.return=G,H)}function z(G,H,Q,ee){var pe=Q.type;return pe===ie?(G=X(G,H,Q.props.children,ee,Q.key),ol(G,Q),G):H!==null&&(H.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ae&&oa(pe)===H.type)?(H=u(H,Q.props),ol(H,Q),H.return=G,H):(H=rc(Q.type,Q.key,Q.props,null,G.mode,ee),ol(H,Q),H.return=G,H)}function q(G,H,Q,ee){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=Nf(Q,G.mode,ee),H.return=G,H):(H=u(H,Q.children||[]),H.return=G,H)}function X(G,H,Q,ee,pe){return H===null||H.tag!==7?(H=ea(Q,G.mode,ee,pe),H.return=G,H):(H=u(H,Q),H.return=G,H)}function ne(G,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=wf(""+H,G.mode,Q),H.return=G,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case K:return Q=rc(H.type,H.key,H.props,null,G.mode,Q),ol(Q,H),Q.return=G,Q;case k:return H=Nf(H,G.mode,Q),H.return=G,H;case ae:return H=oa(H),ne(G,H,Q)}if(Te(H)||re(H))return H=ea(H,G.mode,Q,null),H.return=G,H;if(typeof H.then=="function")return ne(G,vc(H),Q);if(H.$$typeof===le)return ne(G,mc(G,H),Q);xc(G,H)}return null}function V(G,H,Q,ee){var pe=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return pe!==null?null:w(G,H,""+Q,ee);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:return Q.key===pe?z(G,H,Q,ee):null;case k:return Q.key===pe?q(G,H,Q,ee):null;case ae:return Q=oa(Q),V(G,H,Q,ee)}if(Te(Q)||re(Q))return pe!==null?null:X(G,H,Q,ee,null);if(typeof Q.then=="function")return V(G,H,vc(Q),ee);if(Q.$$typeof===le)return V(G,H,mc(G,Q),ee);xc(G,Q)}return null}function Y(G,H,Q,ee,pe){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return G=G.get(Q)||null,w(H,G,""+ee,pe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case K:return G=G.get(ee.key===null?Q:ee.key)||null,z(H,G,ee,pe);case k:return G=G.get(ee.key===null?Q:ee.key)||null,q(H,G,ee,pe);case ae:return ee=oa(ee),Y(G,H,Q,ee,pe)}if(Te(ee)||re(ee))return G=G.get(Q)||null,X(H,G,ee,pe,null);if(typeof ee.then=="function")return Y(G,H,Q,vc(ee),pe);if(ee.$$typeof===le)return Y(G,H,Q,mc(H,ee),pe);xc(H,ee)}return null}function fe(G,H,Q,ee){for(var pe=null,$e=null,be=H,Ce=H=0,wt=null;be!==null&&Ce<Q.length;Ce++){be.index>Ce?(wt=be,be=null):wt=be.sibling;var Be=V(G,be,Q[Ce],ee);if(Be===null){be===null&&(be=wt);break}e&&be&&Be.alternate===null&&t(G,be),H=f(Be,H,Ce),$e===null?pe=Be:$e.sibling=Be,$e=Be,be=wt}if(Ce===Q.length)return s(G,be),Oe&&Ds(G,Ce),pe;if(be===null){for(;Ce<Q.length;Ce++)be=ne(G,Q[Ce],ee),be!==null&&(H=f(be,H,Ce),$e===null?pe=be:$e.sibling=be,$e=be);return Oe&&Ds(G,Ce),pe}for(be=i(be);Ce<Q.length;Ce++)wt=Y(be,G,Ce,Q[Ce],ee),wt!==null&&(e&&(Be=wt.alternate,Be!==null&&be.delete(Be.key===null?Ce:Be.key)),H=f(wt,H,Ce),$e===null?pe=wt:$e.sibling=wt,$e=wt);return e&&be.forEach(function(Ml){return t(G,Ml)}),Oe&&Ds(G,Ce),pe}function ye(G,H,Q,ee){if(Q==null)throw Error(o(151));for(var pe=null,$e=null,be=H,Ce=H=0,wt=null,Be=Q.next();be!==null&&!Be.done;Ce++,Be=Q.next()){be.index>Ce?(wt=be,be=null):wt=be.sibling;var Ml=V(G,be,Be.value,ee);if(Ml===null){be===null&&(be=wt);break}e&&be&&Ml.alternate===null&&t(G,be),H=f(Ml,H,Ce),$e===null?pe=Ml:$e.sibling=Ml,$e=Ml,be=wt}if(Be.done)return s(G,be),Oe&&Ds(G,Ce),pe;if(be===null){for(;!Be.done;Ce++,Be=Q.next())Be=ne(G,Be.value,ee),Be!==null&&(H=f(Be,H,Ce),$e===null?pe=Be:$e.sibling=Be,$e=Be);return Oe&&Ds(G,Ce),pe}for(be=i(be);!Be.done;Ce++,Be=Q.next())Be=Y(be,G,Ce,Be.value,ee),Be!==null&&(e&&(wt=Be.alternate,wt!==null&&be.delete(wt.key===null?Ce:wt.key)),H=f(Be,H,Ce),$e===null?pe=Be:$e.sibling=Be,$e=Be);return e&&be.forEach(function(E2){return t(G,E2)}),Oe&&Ds(G,Ce),pe}function Ae(G,H,Q,ee){if(typeof Q=="object"&&Q!==null&&Q.type===ie&&Q.key===null&&Q.props.ref===void 0&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:e:{for(var pe=Q.key;H!==null;){if(H.key===pe){if(pe=Q.type,pe===ie){if(H.tag===7){s(G,H.sibling),ee=u(H,Q.props.children),ol(ee,Q),ee.return=G,G=ee;break e}}else if(H.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ae&&oa(pe)===H.type){s(G,H.sibling),ee=u(H,Q.props),ol(ee,Q),ee.return=G,G=ee;break e}s(G,H);break}else t(G,H);H=H.sibling}Q.type===ie?(ee=ea(Q.props.children,G.mode,ee,Q.key),ol(ee,Q),ee.return=G,G=ee):(ee=rc(Q.type,Q.key,Q.props,null,G.mode,ee),ol(ee,Q),ee.return=G,G=ee)}return p(G);case k:e:{for(pe=Q.key;H!==null;){if(H.key===pe)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){s(G,H.sibling),ee=u(H,Q.children||[]),ee.return=G,G=ee;break e}else{s(G,H);break}else t(G,H);H=H.sibling}ee=Nf(Q,G.mode,ee),ee.return=G,G=ee}return p(G);case ae:return Q=oa(Q),Ae(G,H,Q,ee)}if(Te(Q))return fe(G,H,Q,ee);if(re(Q)){if(pe=re(Q),typeof pe!="function")throw Error(o(150));return Q=pe.call(Q),ye(G,H,Q,ee)}if(typeof Q.then=="function")return Ae(G,H,vc(Q),ee);if(Q.$$typeof===le)return Ae(G,H,mc(G,Q),ee);xc(G,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(s(G,H.sibling),ee=u(H,Q),ee.return=G,G=ee):(s(G,H),ee=wf(Q,G.mode,ee),ee.return=G,G=ee),p(G)):s(G,H)}return function(G,H,Q,ee){try{Do=0;var pe=Ae(G,H,Q,ee);return li=null,pe}catch(be){if(be===si||be===pc)throw be;var $e=mn(29,be,null,G.mode);return $e.lanes=ee,$e.return=G,$e}finally{}}}var ca=Ap(!0),Op=Ap(!1),rl=!1;function Df(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function cl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ul(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Qe&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=oc(e),gp(e,null,s),t}return ic(e,i,t,s),oc(e)}function Lo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,nn(e,s)}}function $f(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var p={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=p:f=f.next=p,s=s.next}while(s!==null);f===null?u=f=t:f=f.next=t}else u=f=t;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var kf=!1;function $o(){if(kf){var e=ni;if(e!==null)throw e}}function ko(e,t,s,i){kf=!1;var u=e.updateQueue;rl=!1;var f=u.firstBaseUpdate,p=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var z=w,q=z.next;z.next=null,p===null?f=q:p.next=q,p=z;var X=e.alternate;X!==null&&(X=X.updateQueue,w=X.lastBaseUpdate,w!==p&&(w===null?X.firstBaseUpdate=q:w.next=q,X.lastBaseUpdate=z))}if(f!==null){var ne=u.baseState;p=0,X=q=z=null,w=f;do{var V=w.lane&-536870913,Y=V!==w.lane;if(Y?(Le&V)===V:(i&V)===V){V!==0&&V===aa&&(kf=!0),X!==null&&(X=X.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var fe=e,ye=w;V=t;var Ae=s;switch(ye.tag){case 1:if(fe=ye.payload,typeof fe=="function"){ne=fe.call(Ae,ne,V);break e}ne=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ye.payload,V=typeof fe=="function"?fe.call(Ae,ne,V):fe,V==null)break e;ne=A({},ne,V);break e;case 2:rl=!0}}V=w.callback,V!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=u.callbacks,Y===null?u.callbacks=[V]:Y.push(V))}else Y={lane:V,tag:w.tag,payload:w.payload,callback:w.callback,next:null},X===null?(q=X=Y,z=ne):X=X.next=Y,p|=V;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;Y=w,w=Y.next,Y.next=null,u.lastBaseUpdate=Y,u.shared.pending=null}}while(!0);X===null&&(z=ne),u.baseState=z,u.firstBaseUpdate=q,u.lastBaseUpdate=X,f===null&&(u.shared.lanes=0),yl|=p,e.lanes=p,e.memoizedState=ne}}function zp(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Dp(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)zp(s[e],t)}var fl=zt(null),Sc=zt(0);function Lp(e,t){e=Vs,Ge(Sc,e),Ge(fl,t),Vs=e|t.baseLanes}function Hf(){Ge(Sc,Vs),Ge(fl,fl.current)}function Uf(){Vs=Sc.current,ut(fl),ut(Sc)}var kt=zt(null),Pt=null;function dl(e){var t=e.alternate;Ge(Ht,Ht.current&1),Ge(kt,e),Pt===null&&(t===null||fl.current!==null||t.memoizedState!==null)&&(Pt=e)}function Ff(e){Ge(Ht,Ht.current),Ge(kt,e),Pt===null&&(Pt=e)}function $p(e){e.tag===22?(Ge(Ht,Ht.current),Ge(kt,e),Pt===null&&(Pt=e)):hl()}function hl(){Ge(Ht,Ht.current),Ge(kt,kt.current)}function En(e){ut(kt),Pt===e&&(Pt=null),ut(Ht)}var Ht=zt(0);function Ho(e,t){Ge(kt,kt.current),Ge(Ht,t)}function Vf(e){ut(Ht),ut(kt),Pt===e&&(Pt=null)}function bc(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ch(s)||uh(s)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ks=0,Re=null,tt=null,bt=null,jc=!1,ai=!1,ua=!1,wc=0,Uo=0,ii=null,Pb=0;function ht(){throw Error(o(321))}function Bf(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Mn(e[s],t[s]))return!1;return!0}function Gf(e,t,s,i,u,f){return ks=f,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?x0:S0,ua=!1,f=s(i,u),ua=!1,ai&&(f=Hp(t,s,i,u)),kp(e),f}function kp(e){me.H=Rc;var t=tt!==null&&tt.next!==null;if(ks=0,bt=tt=Re=null,jc=!1,Uo=0,ii=null,t)throw Error(o(300));e===null||jt||(e=e.dependencies,e!==null&&hc(e)&&(jt=!0))}function Hp(e,t,s,i){Re=e;var u=0;do{if(ai&&(ii=null),Uo=0,ai=!1,25<=u)throw Error(o(301));if(u+=1,bt=tt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}me.H=nj,f=t(s,i)}while(ai);return f}function Xb(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Fo(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(Re.flags|=1024),t}function qf(){var e=wc!==0;return wc=0,e}function If(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Qf(e){if(jc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}jc=!1}ks=0,bt=tt=Re=null,ai=!1,Uo=wc=0,ii=null}function ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Re.memoizedState=bt=e:bt=bt.next=e,bt}function yt(){if(tt===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=bt===null?Re.memoizedState:bt.next;if(t!==null)bt=t,tt=e;else{if(e===null)throw Re.alternate===null?Error(o(467)):Error(o(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},bt===null?Re.memoizedState=bt=e:bt=bt.next=e}return bt}function Nc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=Uo;return Uo+=1,ii===null&&(ii=[]),e=Tp(ii,e,t),t=Re,(bt===null?t.memoizedState:bt.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?x0:S0),e}function Cc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Fo(e);if(e.$$typeof===U)return;if(e.$$typeof===le)return $t(e)}throw Error(o(438,String(e)))}function Yf(e){var t=null,s=Re.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=Re.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Nc(),Re.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=je;return t.index++,s}function Hs(e,t){return typeof t=="function"?t(e):t}function Mc(e){var t=yt();return Pf(t,tt,e)}function Pf(e,t,s){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var p=u.next;u.next=f.next,f.next=p}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var w=p=null,z=null,q=t,X=!1;do{var ne=q.lane&-536870913;if(ne!==q.lane?(Le&ne)===ne:(ks&ne)===ne){var V=q.revertLane;if(V===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),ne===aa&&(X=!0);else if((ks&V)===V){q=q.next,V===aa&&(X=!0);continue}else ne={lane:0,revertLane:q.revertLane,gesture:null,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},z===null?(w=z=ne,p=f):z=z.next=ne,Re.lanes|=V,yl|=V;ne=q.action,ua&&s(f,ne),f=q.hasEagerState?q.eagerState:s(f,ne)}else V={lane:ne,revertLane:q.revertLane,gesture:q.gesture,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null},z===null?(w=z=V,p=f):z=z.next=V,Re.lanes|=ne,yl|=ne;q=q.next}while(q!==null&&q!==t);if(z===null?p=f:z.next=w,!Mn(f,e.memoizedState)&&(jt=!0,X&&(s=ni,s!==null)))throw s;e.memoizedState=f,e.baseState=p,e.baseQueue=z,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Xf(e){var t=yt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=t.memoizedState;if(u!==null){s.pending=null;var p=u=u.next;do f=e(f,p.action),p=p.next;while(p!==u);Mn(f,t.memoizedState)||(jt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function Up(e,t,s){var i=Re,u=yt(),f=Oe;if(f){if(s===void 0)throw Error(o(407));s=s()}else s=t();var p=!Mn((tt||u).memoizedState,s);if(p&&(u.memoizedState=s,jt=!0),u=u.queue,Jf(Bp.bind(null,i,u,e),[e]),e=u.getSnapshot!==t||p||bt!==null&&(bt.memoizedState.tag&1)!==0,oi(e?9:8,{destroy:void 0},Vp.bind(null,i,u,s,t),null),e){if(i.flags|=2048,nt===null)throw Error(o(349));f||(ks&127)!==0||Fp(i,t,s)}return s}function Fp(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=Nc(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Vp(e,t,s,i){t.value=s,t.getSnapshot=i,Gp(t)&&qp(e)}function Bp(e,t,s){return s(function(){Gp(t)&&qp(e)})}function Gp(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Mn(e,s)}catch{return!0}}function qp(e){var t=Wl(e,2);t!==null&&vn(t,e,2)}function Kf(e){var t=ln();if(typeof e=="function"){var s=e;if(e=s(),ua){Xn(!0);try{s()}finally{Xn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:e},t}function Ip(e,t,s,i){return e.baseState=s,Pf(e,tt,typeof i=="function"?i:Hs)}function Kb(e,t,s,i,u){if(_c(e))throw Error(o(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){f.listeners.push(p)}};me.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,Qp(t,f)):(f.next=s.next,t.pending=s.next=f)}}function Qp(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=me.T,p={};p.types=f!==null?f.types:null,me.T=p;try{var w=s(u,i),z=me.S;z!==null&&z(p,w),Yp(e,t,w)}catch(q){Zf(e,t,q)}finally{f!==null&&p.types!==null&&(f.types=p.types),me.T=f}}else try{f=s(u,i),Yp(e,t,f)}catch(q){Zf(e,t,q)}}function Yp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Pp(e,t,i)},function(i){return Zf(e,t,i)}):Pp(e,t,s)}function Pp(e,t,s){t.status="fulfilled",t.value=s,Xp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Qp(e,s)))}function Zf(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,Xp(t),t=t.next;while(t!==i)}e.action=null}function Xp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Kp(e,t){return t}function Zp(e,t){if(Oe){var s=nt.formState;if(s!==null){e:{var i=Re;if(Oe){if(st){t:{for(var u=st,f=Bn;u.nodeType!==8;){if(!f){u=null;break t}if(u=qn(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){st=qn(u.nextSibling),i=u.data==="F!";break e}}al(i)}i=!1}i&&(t=s[0])}}return s=ln(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kp,lastRenderedState:t},s.queue=i,s=p0.bind(null,Re,i),i.dispatch=s,i=Kf(!1),f=sd.bind(null,Re,!1,i.queue),i=ln(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Kb.bind(null,Re,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function Jp(e){var t=yt();return Wp(t,tt,e)}function Wp(e,t,s){if(t=Pf(e,t,Kp)[0],e=Mc(Hs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Fo(t)}catch(p){throw p===si?pc:p}else i=t;t=yt();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,oi(9,{destroy:void 0},Zb.bind(null,u,s),null)),[i,f,e]}function Zb(e,t){e.action=t}function e0(e){var t=yt(),s=tt;if(s!==null)return Wp(t,s,e);yt(),t=t.memoizedState,s=yt();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function oi(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=Re.updateQueue,t===null&&(t=Nc(),Re.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function t0(){return yt().memoizedState}function Ec(e,t,s,i){var u=ln();Re.flags|=e,u.memoizedState=oi(1|t,{destroy:void 0},s,i===void 0?null:i)}function Tc(e,t,s,i){var u=yt();i=i===void 0?null:i;var f=u.memoizedState.inst;tt!==null&&i!==null&&Bf(i,tt.memoizedState.deps)?u.memoizedState=oi(t,f,s,i):(Re.flags|=e,u.memoizedState=oi(1|t,f,s,i))}function n0(e,t){Ec(8390656,8,e,t)}function Jf(e,t){Tc(2048,8,e,t)}function Jb(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=Nc(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function s0(e){var t=yt().memoizedState;return Jb({ref:t,nextImpl:e}),function(){if((Qe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function l0(e,t){return Tc(4,2,e,t)}function a0(e,t){return Tc(4,4,e,t)}function i0(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function o0(e,t,s){s=s!=null?s.concat([e]):null,Tc(4,4,i0.bind(null,t,e),s)}function Wf(){}function r0(e,t){var s=yt();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&Bf(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function c0(e,t){var s=yt();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&Bf(t,i[1]))return i[0];if(i=e(),ua){Xn(!0);try{e()}finally{Xn(!1)}}return s.memoizedState=[i,t],i}function ed(e,t,s){return s===void 0||(ks&1073741824)!==0&&(Le&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=xy(),Re.lanes|=e,yl|=e,s)}function u0(e,t,s,i){return Mn(s,t)?s:fl.current!==null?(e=ed(e,s,i),Mn(e,t)||(jt=!0),e):(ks&106)===0||(ks&1073741824)!==0&&(Le&261930)===0?(jt=!0,e.memoizedState=s):(e=xy(),Re.lanes|=e,yl|=e,t)}function f0(e,t,s,i,u){var f=Se.p;Se.p=f!==0&&8>f?f:8;var p=me.T,w={};w.types=p!==null?p.types:null,me.T=w,sd(e,!1,t,s);try{var z=u(),q=me.S;if(q!==null&&q(w,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var X=Yb(z,i);Vo(e,t,X,An(e))}else Vo(e,t,i,An(e))}catch(ne){Vo(e,t,{then:function(){},status:"rejected",reason:ne},An())}finally{Se.p=f,p!==null&&w.types!==null&&(p.types=w.types),me.T=p}}function Wb(){}function td(e,t,s,i){if(e.tag!==5)throw Error(o(476));var u=d0(e).queue;f0(e,u,t,ct,s===null?Wb:function(){return h0(e),s(i)})}function d0(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ct,baseState:ct,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:ct},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function h0(e){var t=d0(e);t.next===null&&(t=e.alternate.memoizedState),Vo(e,t.next.queue,{},An())}function nd(){return $t(Mi)}function m0(){return yt().memoizedState}function g0(){return yt().memoizedState}function ej(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=An();e=cl(s);var i=ul(t,e,s);i!==null&&(vn(i,t,s),Lo(i,t,s)),t={cache:Rf()},e.payload=t;return}t=t.return}}function tj(e,t,s){var i=An();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},_c(e)?y0(t,s):(s=bf(e,t,s,i),s!==null&&(vn(s,e,i),v0(s,t,i)))}function p0(e,t,s){var i=An();Vo(e,t,s,i)}function Vo(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(_c(e))y0(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var p=t.lastRenderedState,w=f(p,s);if(u.hasEagerState=!0,u.eagerState=w,Mn(w,p))return ic(e,t,u,0),nt===null&&ac(),!1}catch{}finally{}if(s=bf(e,t,u,i),s!==null)return vn(s,e,i),v0(s,t,i),!0}return!1}function sd(e,t,s,i){if(i={lane:2,revertLane:Yd(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},_c(e)){if(t)throw Error(o(479))}else t=bf(e,s,i,2),t!==null&&vn(t,e,2)}function _c(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function y0(e,t){ai=jc=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function v0(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,nn(e,s)}}var Rc={readContext:$t,use:Cc,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht,useEffectEvent:ht},x0={readContext:$t,use:Cc,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:n0,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Ec(4194308,4,i0.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ec(4194308,4,e,t)},useInsertionEffect:function(e,t){Ec(4,2,e,t)},useMemo:function(e,t){var s=ln();t=t===void 0?null:t;var i=e();if(ua){Xn(!0);try{e()}finally{Xn(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=ln();if(s!==void 0){var u=s(t);if(ua){Xn(!0);try{s(t)}finally{Xn(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=tj.bind(null,Re,e),[i.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:function(e){e=Kf(e);var t=e.queue,s=p0.bind(null,Re,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Wf,useDeferredValue:function(e,t){var s=ln();return ed(s,e,t)},useTransition:function(){var e=Kf(!1);return e=f0.bind(null,Re,e.queue,!0,!1),ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=Re,u=ln();if(Oe){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),nt===null)throw Error(o(349));(Le&127)!==0||Fp(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,n0(Bp.bind(null,i,f,e),[e]),i.flags|=2048,oi(9,{destroy:void 0},Vp.bind(null,i,f,s,t),null),s},useId:function(){var e=ln(),t=nt.identifierPrefix;if(Oe){var s=ds,i=fs;s=(i&~(1<<32-Yt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=wc++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Pb++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:nd,useFormState:Zp,useActionState:Zp,useOptimistic:function(e){var t=ln();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=sd.bind(null,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:Yf,useCacheRefresh:function(){return ln().memoizedState=ej.bind(null,Re)},useEffectEvent:function(e){var t=ln(),s={impl:e};return t.memoizedState=s,function(){if((Qe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},S0={readContext:$t,use:Cc,useCallback:r0,useContext:$t,useEffect:Jf,useImperativeHandle:o0,useInsertionEffect:l0,useLayoutEffect:a0,useMemo:c0,useReducer:Mc,useRef:t0,useState:function(){return Mc(Hs)},useDebugValue:Wf,useDeferredValue:function(e,t){var s=yt();return u0(s,tt.memoizedState,e,t)},useTransition:function(){var e=Mc(Hs)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Fo(e),t]},useSyncExternalStore:Up,useId:m0,useHostTransitionStatus:nd,useFormState:Jp,useActionState:Jp,useOptimistic:function(e,t){var s=yt();return Ip(s,tt,e,t)},useMemoCache:Yf,useCacheRefresh:g0,useEffectEvent:s0},nj={readContext:$t,use:Cc,useCallback:r0,useContext:$t,useEffect:Jf,useImperativeHandle:o0,useInsertionEffect:l0,useLayoutEffect:a0,useMemo:c0,useReducer:Xf,useRef:t0,useState:function(){return Xf(Hs)},useDebugValue:Wf,useDeferredValue:function(e,t){var s=yt();return tt===null?ed(s,e,t):u0(s,tt.memoizedState,e,t)},useTransition:function(){var e=Xf(Hs)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Fo(e),t]},useSyncExternalStore:Up,useId:m0,useHostTransitionStatus:nd,useFormState:e0,useActionState:e0,useOptimistic:function(e,t){var s=yt();return tt!==null?Ip(s,tt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Yf,useCacheRefresh:g0,useEffectEvent:s0};function ld(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:A({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var ad={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=An(),u=cl(i);u.payload=t,s!=null&&(u.callback=s),t=ul(e,u,i),t!==null&&(vn(t,e,i),Lo(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=An(),u=cl(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=ul(e,u,i),t!==null&&(vn(t,e,i),Lo(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=An(),i=cl(s);i.tag=2,t!=null&&(i.callback=t),t=ul(e,i,s),t!==null&&(vn(t,e,s),Lo(t,e,s))}};function b0(e,t,s,i,u,f,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,p):t.prototype&&t.prototype.isPureReactComponent?!Eo(s,i)||!Eo(u,f):!0}function j0(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&ad.enqueueReplaceState(t,t.state,null)}function fa(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=A({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function w0(e){lc(e)}function N0(e){console.error(e)}function C0(e){lc(e)}function Ac(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function M0(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function id(e,t,s){return s=cl(s),s.tag=3,s.payload={element:null},s.callback=function(){Ac(e,t)},s}function E0(e){return e=cl(e),e.tag=3,e}function T0(e,t,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){M0(t,s,i)}}var p=s.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){M0(t,s,i),typeof u!="function"&&(vl===null?vl=new Set([this]):vl.add(this));var w=i.stack;this.componentDidCatch(i.value,{componentStack:w!==null?w:""})})}function sj(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&sa(t,s,u,!0),s=kt.current,s!==null){switch(s.tag){case 31:case 13:case 19:return Pt===null?Jc():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===yc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),qd(e,i,u)),!1;case 22:return s.flags|=65536,i===yc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),qd(e,i,u)),!1}throw Error(o(435,s.tag))}return qd(e,i,u),Jc(),!1}if(Oe)return t=kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Mf&&(e=Error(o(422),{cause:i}),Ro(Un(e,s)))):(i!==Mf&&(t=Error(o(423),{cause:i}),Ro(Un(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Un(i,s),u=id(e.stateNode,i,u),$f(e,u),mt!==4&&(mt=2)),!1;var f=Error(o(520),{cause:i});if(f=Un(f,s),Xo===null?Xo=[f]:Xo.push(f),mt!==4&&(mt=2),t===null)return!0;i=Un(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=id(s.stateNode,i,e),$f(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(vl===null||!vl.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=E0(u),T0(u,e,s,i),$f(s,u),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var od=Error(o(461)),jt=!1;function Mt(e,t,s,i){t.child=e===null?Op(t,null,s,i):ca(t,e.child,s,i)}function _0(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var p={};for(var w in i)w!=="ref"&&(p[w]=i[w])}else p=i;return la(t),i=Gf(e,t,s,p,f,u),w=qf(),e!==null&&!jt?(If(e,t,u),Us(e,t,u)):(Oe&&w&&uc(t),t.flags|=1,Mt(e,t,i,u),t.child)}function R0(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!jf(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,A0(e,t,f,i,u)):(e=rc(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!gd(e,u)){var p=f.memoizedProps;if(s=s.compare,s=s!==null?s:Eo,s(p,i)&&e.ref===t.ref)return Us(e,t,u)}return t.flags|=1,e=zs(f,i),e.ref=t.ref,e.return=t,t.child=e}function A0(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(Eo(f,i)&&e.ref===t.ref)if(jt=!1,t.pendingProps=i=f,gd(e,u))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,Us(e,t,u)}return rd(e,t,s,i,u)}function O0(e,t,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return z0(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gc(t,f!==null?f.cachePool:null),f!==null?Lp(t,f):Hf(),$p(t);else return i=t.lanes=536870912,z0(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(gc(t,f.cachePool),Lp(t,f),hl(),t.memoizedState=null):(e!==null&&gc(t,null),Hf(),hl());return Mt(e,t,u,s),t.child}function Bo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function z0(e,t,s,i,u){var f=Of();return f=f===null?null:{parent:St._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&gc(t,null),Hf(),$p(t),e!==null&&sa(e,t,i,!0),t.childLanes=u,null}function Oc(e,t){return t=zc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function D0(e,t,s){return ca(t,e.child,null,s),e=Oc(t,t.pendingProps),e.flags|=2,En(t),t.memoizedState=null,e}function lj(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Oe){if(i.mode==="hidden")return e=Oc(t,i),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bo(null,e);if(Ff(t),(e=st)?(e=iv(e,Bn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:sl!==null?{id:fs,overflow:ds}:null,retryLane:536870912,hydrationErrors:null},s=yp(e),s.return=t,t.child=s,_t=t,st=null)):e=null,e===null)throw al(t);return t.lanes=536870912,null}return Oc(t,i)}var f=e.memoizedState;if(f!==null){var p=f.dehydrated;if(Ff(t),u)if(t.flags&256)t.flags&=-257,t=D0(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(jt||sa(e,t,s,!1),u=(s&e.childLanes)!==0,jt||u){if(fl.current===null){if(i=nt,i!==null&&(p=Ua(i,s),p!==0&&p!==f.retryLane))throw f.retryLane=p,Wl(e,p),vn(i,e,p),od;Jc()}t=D0(e,t,s)}else e=f.treeContext,st=qn(p.nextSibling),_t=t,Oe=!0,ll=null,Bn=!1,e!==null&&Sp(t,e),t=Oc(t,i),t.flags|=134221824;return t}return e=zs(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ri(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function rd(e,t,s,i,u){return la(t),s=Gf(e,t,s,i,void 0,u),i=qf(),e!==null&&!jt?(If(e,t,u),Us(e,t,u)):(Oe&&i&&uc(t),t.flags|=1,Mt(e,t,s,u),t.child)}function L0(e,t,s,i,u,f){return la(t),t.updateQueue=null,s=Hp(t,i,s,u),kp(e),i=qf(),e!==null&&!jt?(If(e,t,f),Us(e,t,f)):(Oe&&i&&uc(t),t.flags|=1,Mt(e,t,s,f),t.child)}function $0(e,t,s,i,u){if(la(t),t.stateNode===null){var f=Ja,p=s.contextType;typeof p=="object"&&p!==null&&(f=$t(p)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ad,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Df(t),p=s.contextType,f.context=typeof p=="object"&&p!==null?$t(p):Ja,f.state=t.memoizedState,p=s.getDerivedStateFromProps,typeof p=="function"&&(ld(t,s,p,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(p=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),p!==f.state&&ad.enqueueReplaceState(f,f.state,null),ko(t,i,f,u),$o(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var w=t.memoizedProps,z=fa(s,w);f.props=z;var q=f.context,X=s.contextType;p=Ja,typeof X=="object"&&X!==null&&(p=$t(X));var ne=s.getDerivedStateFromProps;X=typeof ne=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,X||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||q!==p)&&j0(t,f,i,p),rl=!1;var V=t.memoizedState;f.state=V,ko(t,i,f,u),$o(),q=t.memoizedState,w||V!==q||rl?(typeof ne=="function"&&(ld(t,s,ne,i),q=t.memoizedState),(z=rl||b0(t,s,z,i,V,q,p))?(X||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=q),f.props=i,f.state=q,f.context=p,i=z):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Lf(e,t),p=t.memoizedProps,X=fa(s,p),f.props=X,ne=t.pendingProps,V=f.context,q=s.contextType,z=Ja,typeof q=="object"&&q!==null&&(z=$t(q)),w=s.getDerivedStateFromProps,(q=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(p!==ne||V!==z)&&j0(t,f,i,z),rl=!1,V=t.memoizedState,f.state=V,ko(t,i,f,u),$o();var Y=t.memoizedState;p!==ne||V!==Y||rl||e!==null&&e.dependencies!==null&&hc(e.dependencies)?(typeof w=="function"&&(ld(t,s,w,i),Y=t.memoizedState),(X=rl||b0(t,s,X,i,V,Y,z)||e!==null&&e.dependencies!==null&&hc(e.dependencies))?(q||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,Y,z),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,Y,z)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=Y),f.props=i,f.state=Y,f.context=z,i=X):(typeof f.componentDidUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&V===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,ri(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=ca(t,e.child,null,u),t.child=ca(t,null,s,u)):Mt(e,t,s,u),t.memoizedState=f.state,e=t.child):e=Us(e,t,u),e}function k0(e,t,s,i){return ta(),t.flags|=256,Mt(e,t,s,i),t.child}var cd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ud(e){return{baseLanes:e,cachePool:Mp()}}function fd(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Rn),e}function H0(e,t,s){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,p;if((p=f)||(p=e!==null&&e.memoizedState===null?!1:(Ht.current&2)!==0),p&&(u=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(Oe){if(u?dl(t):hl(),(e=st)?(e=iv(e,Bn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:sl!==null?{id:fs,overflow:ds}:null,retryLane:536870912,hydrationErrors:null},s=yp(e),s.return=t,t.child=s,_t=t,st=null)):e=null,e===null)throw al(t);return uh(e)?t.lanes=32:t.lanes=536870912,null}return f=i.children,i=i.fallback,u?(hl(),u=t.mode,f=zc({mode:"hidden",children:f},u),i=ea(i,u,s,null),f.return=t,i.return=t,f.sibling=i,t.child=f,i=t.child,i.memoizedState=ud(s),i.childLanes=fd(e,p,s),t.memoizedState=cd,Bo(null,i)):(dl(t),dd(t,f))}var w=e.memoizedState;if(w!==null){var z=w.dehydrated;if(z!==null)return aj(e,t,f,p,i,z,w,s)}return u?(hl(),u=i.fallback,f=t.mode,w=e.child,z=w.sibling,i=zs(w,{mode:"hidden",children:i.children}),i.subtreeFlags=w.subtreeFlags&1206910976,z!==null?u=zs(z,u):(u=ea(u,f,s,null),u.flags|=2),u.return=t,i.return=t,i.sibling=u,t.child=i,Bo(null,i),i=t.child,u=e.child.memoizedState,u===null?u=ud(s):(f=u.cachePool,f!==null?(w=St._currentValue,f=f.parent!==w?{parent:w,pool:w}:f):f=Mp(),u={baseLanes:u.baseLanes|s,cachePool:f}),i.memoizedState=u,i.childLanes=fd(e,p,s),t.memoizedState=cd,Bo(e.child,i)):(dl(t),s=e.child,e=s.sibling,s=zs(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=s,t.memoizedState=null,s)}function dd(e,t){return t=zc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zc(e,t){return e=mn(22,e,null,t),e.lanes=0,e}function Dc(e,t,s){return ca(t,e.child,null,s),e=dd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function aj(e,t,s,i,u,f,p,w){if(s)return t.flags&256?(dl(t),t.flags&=-257,Dc(e,t,w)):t.memoizedState!==null?(hl(),t.child=e.child,t.flags|=128,null):(hl(),f=u.fallback,p=t.mode,u=zc({mode:"visible",children:u.children},p),f=ea(f,p,w,null),f.flags|=2,u.return=t,f.return=t,u.sibling=f,t.child=u,ca(t,e.child,null,w),u=t.child,u.memoizedState=ud(w),u.childLanes=fd(e,i,w),t.memoizedState=cd,Bo(null,u));if(dl(t),uh(f)){if(i=f.nextSibling&&f.nextSibling.dataset,i)var z=i.dgst;return i=z,i!==""&&(u=Error(o(419)),u.stack="",u.digest=i,Ro({value:u,source:null,stack:null})),Dc(e,t,w)}if(jt||sa(e,t,w,!1),i=(w&e.childLanes)!==0,jt||i){if(fl.current!==null)return Dc(e,t,w);if(i=nt,i!==null&&(u=Ua(i,w),u!==0&&u!==p.retryLane))throw p.retryLane=u,Wl(e,u),vn(i,e,u),od;return ch(f)||Jc(),Dc(e,t,w)}return ch(f)?(t.flags|=192,t.child=e.child,null):(e=p.treeContext,st=qn(f.nextSibling),_t=t,Oe=!0,ll=null,Bn=!1,e!==null&&Sp(t,e),t=dd(t,u.children),t.flags|=134221824,t)}function U0(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),dc(e.return,t,s)}function F0(e){for(var t=null;e!==null;){var s=e.alternate;s!==null&&bc(s)===null&&(t=e),e=e.sibling}return t}function Lc(e,t,s,i,u,f){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=s,p.tailMode=u,p.treeForkCount=f)}function hd(e){var t=e.child;for(e.child=null;t!==null;){var s=t.sibling;t.sibling=e.child,e.child=t,t=s}}function md(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var p=Ht.current;if(t.flags&128)return Ho(t,p),null;var w=(p&2)!==0;if(w?(p=p&1|2,t.flags|=128):p&=1,Ho(t,p),u==="backwards"&&e!==null?(hd(e),Mt(e,t,i,s),hd(e)):Mt(e,t,i,s),i=Oe?_o:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&U0(e,s,t);else if(e.tag===19)U0(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"backwards":s=F0(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null,hd(t)),Lc(t,!0,u,null,f,i);break;case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&bc(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Lc(t,!0,s,null,f,i);break;case"together":Lc(t,!1,null,null,void 0,i);break;case"independent":t.memoizedState=null;break;default:s=F0(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Lc(t,!1,u,s,f,i)}return t.child}function V0(e,t,s){var i=t.pendingProps;return il(t,t.type,i.value),Mt(e,t,i.children,s),t.child}function Us(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),yl|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(sa(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=zs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=zs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function gd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&hc(e)))}function ij(e,t,s){switch(t.tag){case 3:Ts(t,t.stateNode.containerInfo),il(t,St,e.memoizedState.cache),ta();break;case 27:case 5:Yn(t);break;case 4:Ts(t,t.stateNode.containerInfo);break;case 10:il(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ff(t),null;break;case 13:var i=t.memoizedState;if(i!==null){if(i.dehydrated!==null)return dl(t),t.flags|=128,null;i=sa(e,t,s,!1);var u=t.child.childLanes;return i||(s&u)!==0?H0(e,t,s):(dl(t),e=Us(e,t,s),e!==null?e.sibling:null)}dl(t);break;case 19:if(t.flags&128)return md(e,t,s);if(u=(e.flags&128)!==0,i=(s&t.childLanes)!==0,i||(sa(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return md(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),Ho(t,Ht.current),i)break;return null;case 22:return t.lanes=0,O0(e,t,s,t.pendingProps);case 24:il(t,St,e.memoizedState.cache)}return Us(e,t,s)}function B0(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!gd(e,s)&&(t.flags&128)===0)return jt=!1,ij(e,t,s);jt=(e.flags&131072)!==0}else jt=!1,Oe&&(t.flags&1048576)!==0&&xp(t,_o,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=oa(t.elementType),t.type=e,typeof e=="function")jf(e)?(i=fa(e,i),t.tag=1,t=$0(null,t,e,i,s)):(t.tag=0,t=rd(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===$){t.tag=11,t=_0(null,t,e,i,s);break e}else if(u===W){t.tag=14,t=R0(null,t,e,i,s);break e}else if(u===le){t.tag=10,t.type=e,t=V0(null,t,s);break e}}throw t=xe(e)||e,Error(o(306,t,""))}}return t;case 0:return rd(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=fa(i,t.pendingProps),$0(e,t,i,u,s);case 3:e:{if(Ts(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Lf(e,t),ko(t,i,null,s);var p=t.memoizedState;if(i=p.cache,il(t,St,i),i!==f.cache&&_f(t,[St],s,!0),$o(),i=p.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=k0(e,t,i,s);break e}else if(i!==u){u=Un(Error(o(424)),t),Ro(u),t=k0(e,t,i,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(st=qn(e.firstChild),_t=t,Oe=!0,ll=null,Bn=!0,s=Op(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(ta(),i===u){t=Us(e,t,s);break e}Mt(e,t,i,s)}t=t.child}return t;case 26:return ri(e,t),e===null?(s=hv(t.type,null,t.pendingProps,null))?t.memoizedState=s:Oe||(t.stateNode=Qy(t.type,t.pendingProps,en.current,t)):t.memoizedState=hv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Yn(t),e===null&&Oe&&(i=t.stateNode=cv(t.type,t.pendingProps,en.current),_t=t,Bn=!0,u=st,bl(t.type)?(fh=u,st=qn(i.firstChild)):st=u),Mt(e,t,t.pendingProps.children,s),ri(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oe&&((u=i=st)&&(i=e2(i,t.type,t.pendingProps,Bn),i!==null?(t.stateNode=i,_t=t,st=qn(i.firstChild),Bn=!1,u=!0):u=!1),u||al(t)),Yn(t),u=t.type,f=t.pendingProps,p=e!==null?e.memoizedProps:null,i=f.children,nh(u,f)?i=null:p!==null&&nh(u,p)&&(t.flags|=32),t.memoizedState!==null&&(u=Gf(e,t,Xb,null,null,s),Mi._currentValue=u),ri(e,t),Mt(e,t,i,s),t.child;case 6:return e===null&&Oe&&((e=s=st)&&(s=t2(s,t.pendingProps,Bn),s!==null?(t.stateNode=s,_t=t,st=null,e=!0):e=!1),e||al(t)),null;case 13:return H0(e,t,s);case 4:return Ts(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ca(t,null,i,s):Mt(e,t,i,s),t.child;case 11:return _0(e,t,t.type,t.pendingProps,s);case 7:return i=t.pendingProps,ri(e,t),Mt(e,t,i,s),t.child;case 8:return Mt(e,t,t.pendingProps.children,s),t.child;case 12:return Mt(e,t,t.pendingProps.children,s),t.child;case 10:return V0(e,t,s);case 9:return u=t.type._context,i=t.pendingProps.children,la(t),u=$t(u),i=i(u),t.flags|=1,Mt(e,t,i,s),t.child;case 14:return R0(e,t,t.type,t.pendingProps,s);case 15:return A0(e,t,t.type,t.pendingProps,s);case 19:return md(e,t,s);case 31:return lj(e,t,s);case 22:return O0(e,t,s,t.pendingProps);case 24:return la(t),i=$t(St),e===null?(u=Of(),u===null&&(u=nt,f=Rf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},Df(t),il(t,St,u)):((e.lanes&s)!==0&&(Lf(e,t),ko(t,null,null,s),$o()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),il(t,St,i)):(i=f.cache,il(t,St,i),i!==u.cache&&_f(t,[St],s,!0))),Mt(e,t,t.pendingProps.children,s),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),i=t.pendingProps,i.name!=null&&i.name!=="auto"?t.flags|=e===null?18882560:18874368:Oe&&uc(t),e!==null&&e.memoizedProps.name!==i.name?t.flags|=4194816:ri(e,t),Mt(e,t,i.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Fs(e){e.flags|=4}function pd(e,t,s,i,u){var f;if((f=(e.mode&32)!==0)&&(f=s===null?yv(t,i):yv(t,i)&&(i.src!==s.src||i.srcSet!==s.srcSet)),f){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(wy())e.flags|=8192;else throw ra=yc,zf}else e.flags&=-16777217}function G0(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!vv(t))if(wy())e.flags|=8192;else throw ra=yc,zf}function $c(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?mo():536870912,e.lanes|=t,hi|=t)}function Go(e,t){if(!Oe)switch(e.tailMode){case"visible":break;case"collapsed":for(var s=e.tail,i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null;break;default:for(t=e.tail,s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&1206910976,i|=u.flags&1206910976,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function oj(e,t,s){var i=t.pendingProps;switch(Cf(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),$s(St),gt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ti(t)?Fs(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ef())),lt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Fs(t),f!==null?(lt(t),G0(t,f)):(lt(t),pd(t,u,null,i,s))):f?f!==e.memoizedState?(Fs(t),lt(t),G0(t,f)):(lt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Fs(t),lt(t),pd(t,u,e,i,s)),null;case 27:if(qt(t),s=en.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Fs(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return lt(t),t.subtreeFlags&=-33554433,null}e=Wt.current,ti(t)?bp(t):(e=cv(u,i,s),t.stateNode=e,Fs(t))}return lt(t),t.subtreeFlags&=-33554433,null;case 5:if(qt(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Fs(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return lt(t),t.subtreeFlags&=-33554433,null}if(f=Wt.current,ti(t))bp(t);else{var p=er(en.current);switch(f){case 1:f=p.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=p.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=p.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?p.createElement("select",{is:i.is}):p.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?p.createElement(u,{is:i.is}):p.createElement(u)}}f[xt]=t,f[Lt]=i;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)f.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=f;e:switch(Ft(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Fs(t)}}return lt(t),t.subtreeFlags&=-33554433,pd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Fs(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=en.current,ti(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=_t,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[xt]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||By(e.nodeValue,s)),e||al(t,!0)}else e=er(e).createTextNode(i),e[xt]=t,t.stateNode=e}return lt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=ti(t),s!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[xt]=t}else ta(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),e=!1}else s=Ef(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(En(t),t):(En(t),null);if((t.flags&128)!==0)throw Error(o(558))}return lt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ti(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[xt]=t}else ta(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;lt(t),u=!1}else u=Ef(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(En(t),t):(En(t),null)}return En(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),$c(t,t.updateQueue),lt(t),null);case 4:return gt(),e===null&&Zd(t.stateNode.containerInfo),t.flags|=67108864,lt(t),null;case 10:return $s(t.type),lt(t),null;case 19:if(Vf(t),i=t.memoizedState,i===null)return lt(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Go(i,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=bc(e),f!==null){for(t.flags|=128,Go(i,!1),e=f.updateQueue,t.updateQueue=e,$c(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)pp(s,e),s=s.sibling;return Ho(t,Ht.current&1|2),Oe&&Ds(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&et()>Pc&&(t.flags|=128,u=!0,Go(i,!1),t.lanes=4194304)}else{if(!u)if(e=bc(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,$c(t,e),Go(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!f.alternate&&!Oe)return lt(t),null}else 2*et()-i.renderingStartTime>Pc&&s!==536870912&&(t.flags|=128,u=!0,Go(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}if(i.tail!==null){e=i.tail;e:{for(s=e;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=et(),e.sibling=null,f=Ht.current,f=u?f&1|2:f&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!s||Oe?Ho(t,f):(s=f,Ge(kt,t),Ge(Ht,s),Pt===null&&(Pt=t)),Oe&&Ds(t,i.treeForkCount),e}return lt(t),null;case 22:case 23:return En(t),Uf(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),s=t.updateQueue,s!==null&&$c(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&ut(ia),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),$s(St),lt(t),null;case 25:return null;case 30:return t.flags|=33554432,lt(t),null}throw Error(o(156,t.tag))}function rj(e,t){switch(Cf(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $s(St),gt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qt(t),null;case 31:if(t.memoizedState!==null){if(En(t),t.alternate===null)throw Error(o(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(En(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ta()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vf(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return gt(),null;case 10:return $s(t.type),null;case 22:case 23:return En(t),Uf(),e!==null&&ut(ia),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $s(St),null;case 25:return null;default:return null}}function q0(e,t){switch(Cf(t),t.tag){case 3:$s(St),gt();break;case 26:case 27:case 5:qt(t);break;case 4:gt();break;case 31:t.memoizedState!==null&&En(t);break;case 13:En(t);break;case 19:Vf(t);break;case 10:$s(t.type);break;case 22:case 23:En(t),Uf(),e!==null&&ut(ia);break;case 24:$s(St)}}function qo(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,p=s.inst;i=f(),p.destroy=i}s=s.next}while(s!==u)}}catch(w){Ze(t,t.return,w)}}function ml(e,t,s){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var p=i.inst,w=p.destroy;if(w!==void 0){p.destroy=void 0,u=t;var z=s,q=w;try{q()}catch(X){Ze(u,z,X)}}}i=i.next}while(i!==f)}}catch(X){Ze(t,t.return,X)}}function I0(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Dp(t,s)}catch(i){Ze(e,e.return,i)}}}function Q0(e,t,s){s.props=fa(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){Ze(e,t,i)}}function hs(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var u=e.stateNode,f=As(e.memoizedProps,u);(u.ref===null||u.ref.name!==f)&&(u.ref=Wy(f)),i=u.ref;break;case 7:if(e.stateNode===null){var p=new On(e);y(e.child,!1,Jj,p,void 0,void 0),e.stateNode=p}i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(w){Ze(e,t,w)}}function Ut(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){Ze(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){Ze(e,t,u)}else s.current=null}function kc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var s=0;s<t.length;s++)av(e.stateNode,t[s])}function Y0(e){for(var t=e.return;t!==null&&(vd(t)&&av(e.stateNode,t.stateNode),!yd(t));)t=t.return}function Io(e){for(var t=e.return;t!==null&&(vd(t)&&Wj(e.stateNode,t.stateNode),!yd(t));)t=t.return}function yd(e){return e.tag===5||e.tag===3||e.tag===27}function vd(e){return e&&e.tag===7&&e.stateNode!==null}function xd(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){Ze(e,e.return,u)}}function Sd(e,t,s){try{var i=e.stateNode;Dj(i,e.type,s,t),i[Lt]=t}catch(u){Ze(e,e.return,u)}}function P0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bl(e.type)||e.tag===4}function bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||P0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&bl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jd(e,t,s,i){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(u,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(u),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=us)),kc(e,i),qe=!0;else if(u!==4&&(u===27&&(kc(e,i),i=null,bl(e.type)&&(s=e.stateNode,t=null)),e=e.child,e!==null))for(jd(e,t,s,i),e=e.sibling;e!==null;)jd(e,t,s,i),e=e.sibling}function Hc(e,t,s,i){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?s.insertBefore(u,t):s.appendChild(u),kc(e,i),qe=!0;else if(u!==4&&(u===27&&(kc(e,i),i=null,bl(e.type)&&(s=e.stateNode)),e=e.child,e!==null))for(Hc(e,t,s,i),e=e.sibling;e!==null;)Hc(e,t,s,i),e=e.sibling}function X0(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Ft(t,i,s),t[xt]=e,t[Lt]=s}catch(f){Ze(e,e.return,f)}}var Uc=!1,Tn=null;function K0(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Uc=!0)}var ms=null;function Z0(){var e=ms;return ms=null,e}var gn=0;function ci(e,t,s,i,u){return gn=0,J0(e.child,t,s,i,u)}function J0(e,t,s,i,u){for(var f=!1;e!==null;){if(e.tag===5){var p=e.stateNode;if(i!==null){var w=ah(p);i.push(w),w.view&&(f=!0)}else f||ah(p).view&&(f=!0);Uc=!0,Zy(p,gn===0?t:t+"_"+gn,s),gn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&u||J0(e.child,t,s,i,u)&&(f=!0));e=e.sibling}return f}function gs(e,t){for(;e!==null;)e.tag===5?Jy(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||gs(e.child,t)),e=e.sibling}function Fc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Fc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(o(544));var s=t.name;t=Os(t.default,t.share),t!=="none"&&(ci(e,s,t,null,!1)||gs(e.child,!1))}e=e.sibling}}function wd(e,t){if(e.tag===30){var s=e.stateNode,i=e.memoizedProps,u=As(i,s),f=Os(i.default,s.paired?i.share:i.enter);f!=="none"?ci(e,u,f,null,!1)?(Fc(e),s.paired||t||yi(e,i.onEnter)):gs(e.child,!1):Fc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)wd(e,t),e=e.sibling;else Fc(e)}function Nd(e){if(Tn!==null&&Tn.size!==0){var t=Tn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var s=e.memoizedProps,i=s.name;if(i!=null&&i!=="auto"){var u=t.get(i);if(u!==void 0){var f=Os(s.default,s.share);if(f!=="none"&&(ci(e,i,f,null,!1)?(f=e.stateNode,u.paired=f,f.paired=u,yi(e,s.onShare)):gs(e.child,!1)),t.delete(i),t.size===0)break}}}Nd(e)}e=e.sibling}}}function Cd(e){if(e.tag===30){var t=e.memoizedProps,s=As(t,e.stateNode),i=Tn!==null?Tn.get(s):void 0,u=Os(t.default,i!==void 0?t.share:t.exit);u!=="none"&&(ci(e,s,u,null,!1)?i!==void 0?(u=e.stateNode,i.paired=u,u.paired=i,Tn.delete(s),yi(e,t.onShare)):yi(e,t.onExit):gs(e.child,!1)),Tn!==null&&Nd(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Cd(e),e=e.sibling;else Tn!==null&&Nd(e)}function W0(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,s=As(t,e.stateNode);t=Os(t.default,t.update),e.flags&=-5,t!=="none"&&ci(e,s,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&W0(e);e=e.sibling}}function Md(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,gs(e.child,!1))}Md(e)}e=e.sibling}}function Vc(e){if(e.tag===30)e.stateNode.paired=null,gs(e.child,!1),Md(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Vc(e),e=e.sibling;else Md(e)}function ey(e){for(e=e.child;e!==null;)e.tag===30?gs(e.child,!1):(e.subtreeFlags&33554432)!==0&&ey(e),e=e.sibling}function Ed(e,t,s,i,u,f,p){for(var w=!1;t!==null;){if(t.tag===5){var z=t.stateNode;if(f!==null&&gn<f.length){var q=f[gn],X=ah(z);(q.view||X.view)&&(w=!0);var ne;if(ne=(e.flags&4)===0)if(X.clip)ne=!0;else{ne=q.rect;var V=X.rect;ne=ne.y!==V.y||ne.x!==V.x||ne.height!==V.height||ne.width!==V.width}ne&&(e.flags|=4),X.abs?X=!q.abs:(q=q.rect,X=X.rect,X=q.height!==X.height||q.width!==X.width),X&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Zy(z,gn===0?s:s+"_"+gn,u),w&&(e.flags&4)!==0||(ms===null&&(ms=[]),ms.push(z,gn===0?i:i+"_"+gn,t.memoizedProps)),gn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&p?e.flags|=t.flags&32:Ed(e,t.child,s,i,u,f,p)&&(w=!0));t=t.sibling}return w}function ty(e,t){for(e=e.child;e!==null;){if(e.tag===30){var s=e.memoizedProps,i=e.stateNode,u=As(s,i),f=Os(s.default,s.update),p;p=e.memoizedState,e.memoizedState=null,i=e;var w=e.child;gn=0,u=Ed(i,w,u,u,f,p,!1),(e.flags&4)!==0&&u&&yi(e,s.onUpdate)}else(e.subtreeFlags&33554432)!==0&&ty(e);e=e.sibling}}var Rt=!1,Xe=!1,ps=!1,Td=!1,ny=typeof WeakSet=="function"?WeakSet:Set,At=null,ys=!1,Qo=!1,Bc=!1,_d=!1;function cj(e,t,s){if(e=e.containerInfo,eh=Ei,e=ip(e),gf(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var f=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var w=0,z=-1,q=-1,X=0,ne=0,V=e,Y=null;t:for(;;){for(var fe;V!==i||f!==0&&V.nodeType!==3||(z=w+f),V!==p||u!==0&&V.nodeType!==3||(q=w+u),V.nodeType===3&&(w+=V.nodeValue.length),(fe=V.firstChild)!==null;)Y=V,V=fe;for(;;){if(V===e)break t;if(Y===i&&++X===f&&(z=w),Y===p&&++ne===u&&(q=w),(fe=V.nextSibling)!==null)break;V=Y,Y=V.parentNode}V=fe}i=z===-1||q===-1?null:{start:z,end:q}}else i=null}i=i||{start:0,end:0}}else i=null;for(th={focusedElem:e,selectionRange:i},Ei=!1,s=(s&335544064)===s,At=t,t=s?9270:1024;At!==null;){if(e=At,s&&(i=e.deletions,i!==null))for(f=0;f<i.length;f++)s&&Cd(i[f]);if(e.alternate===null&&(e.flags&2)!==0)s&&K0(e),Gc(s);else{if(e.tag===22){if(i=e.alternate,e.memoizedState!==null){i!==null&&i.memoizedState===null&&s&&Cd(i),Gc(s);continue}else if(i!==null&&i.memoizedState!==null){s&&K0(e),Gc(s);continue}}i=e.child,(e.subtreeFlags&t)!==0&&i!==null?(i.return=e,At=i):(s&&W0(e),Gc(s))}}Tn=null}function Gc(e){for(;At!==null;){var t=At,s=e,i=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((u&1024)!==0&&i!==null){s=void 0,u=i.memoizedProps,i=i.memoizedState;var f=t.stateNode;try{var p=fa(t.type,u);s=f.getSnapshotBeforeUpdate(p,i),f.__reactInternalSnapshotBeforeUpdate=s}catch(w){Ze(t,t.return,w)}}break;case 3:if((u&1024)!==0){if(i=t.stateNode.containerInfo,s=i.nodeType,s===9)rh(i);else if(s===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":rh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&i!==null&&(s=As(i.memoizedProps,i.stateNode),u=t.memoizedProps,u=Os(u.default,u.update),u!=="none"&&ci(i,s,u,i.memoizedState=[],!0));break;default:if((u&1024)!==0)throw Error(o(163))}if(i=t.sibling,i!==null){i.return=t.return,At=i;break}At=t.return}}function sy(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:vs(e,s),i&4&&qo(5,s);break;case 1:if(vs(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(p){Ze(s,s.return,p)}else{var u=fa(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Ze(s,s.return,p)}}i&64&&I0(s),i&512&&hs(s,s.return);break;case 3:if(vs(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Dp(e,t)}catch(p){Ze(s,s.return,p)}}break;case 27:t===null&&i&4&&X0(s);case 26:case 5:vs(e,s),t===null&&i&4&&xd(s),i&512&&hs(s,s.return);break;case 12:vs(e,s);break;case 31:vs(e,s),i&4&&oy(e,s);break;case 13:vs(e,s),i&4&&ry(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=bj.bind(null,s),n2(e,s))));break;case 22:if(i=s.memoizedState!==null||Rt,!i){var f=t!==null&&t.memoizedState!==null||Xe;t=Rt,u=Xe,Rt=i,(Xe=f)&&!u?(i=2,(s.subtreeFlags&8772)!==0&&(i|=1),es(e,s,i)):vs(e,s),Rt=t,Xe=u}break;case 30:vs(e,s),i&512&&hs(s,s.return);break;case 7:i&512&&hs(s,s.return);default:vs(e,s)}}function Rd(e,t){for(e=e.child;e!==null;)ly(e,t),e=e.sibling}function ly(e,t){switch(e.tag){case 5:case 26:try{var s=e.stateNode;if(t){var i=s.style;typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"}else{var u=e.stateNode,f=e.memoizedProps.style,p=f!=null&&f.hasOwnProperty("display")?f.display:null;u.style.display=p==null||typeof p=="boolean"?"":(""+p).trim()}}catch(z){Ze(e,e.return,z)}Ad(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,qe=!0}catch(z){Ze(e,e.return,z)}break;case 18:try{var w=e.stateNode;t?Ky(w,!0):Ky(e.stateNode,!1)}catch(z){Ze(e,e.return,z)}break;case 22:case 23:e.memoizedState===null&&Rd(e,t);break;default:Rd(e,t)}}function Ad(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var s=e,i=t;switch(s.tag){case 4:ly(s,i);break e;case 22:s.memoizedState===null&&Ad(s,i);break e;default:Ad(s,i)}}e=e.sibling}}function ay(e){var t=e.alternate;t!==null&&(e.alternate=null,ay(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Pr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ot=null,pn=!1;function Jn(e,t,s){for(s=s.child;s!==null;)iy(e,t,s),s=s.sibling}function iy(e,t,s){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(Zs,s)}catch{}switch(s.tag){case 26:Xe||Ut(s,t),Jn(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!Xe&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Xe||Ut(s,t),Io(s);var i=ot,u=pn;bl(s.type)&&(ot=s.stateNode,pn=!1),Jn(e,t,s),uv(s.stateNode,s.type,s.memoizedProps),ot=i,pn=u;break;case 5:Xe||Ut(s,t),Io(s);case 6:if(s.tag===6&&Io(s),i=ot,u=pn,ot=null,Jn(e,t,s),ot=i,pn=u,ot!==null)if(pn)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(s.stateNode),qe=!0}catch(f){Ze(s,t,f)}else try{ot.removeChild(s.stateNode),qe=!0}catch(f){Ze(s,t,f)}break;case 18:ot!==null&&(pn?(e=ot,Xy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Ti(e)):Xy(ot,s.stateNode));break;case 4:i=ot,u=pn,ot=s.stateNode.containerInfo,pn=!0,Jn(e,t,s),ot=i,pn=u;break;case 0:case 11:case 14:case 15:ml(2,s,t),Xe||ml(4,s,t),Jn(e,t,s);break;case 1:Xe||(Ut(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Q0(s,t,i)),Jn(e,t,s);break;case 21:Jn(e,t,s);break;case 22:Xe=(i=Xe)||s.memoizedState!==null,Jn(e,t,s),Xe=i;break;case 30:Ut(s,t),Jn(e,t,s);break;case 7:Xe||Ut(s,t),Jn(e,t,s);break;default:Jn(e,t,s)}}function oy(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ti(e)}catch(s){Ze(t,t.return,s)}}}function ry(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ti(e)}catch(s){Ze(t,t.return,s)}}function uj(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ny),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ny),t;default:throw Error(o(435,e.tag))}}function qc(e,t){var s=uj(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=jj.bind(null,e,i);i.then(u,u)}})}function an(e,t,s){var i=t.deletions;if(i!==null)for(var u=0;u<i.length;u++){var f=i[u],p=e,w=t,z=w;e:for(;z!==null;){switch(z.tag){case 27:if(bl(z.type)){ot=z.stateNode,pn=!1;break e}break;case 5:ot=z.stateNode,pn=!1;break e;case 3:case 4:ot=z.stateNode.containerInfo,pn=!0;break e}z=z.return}if(ot===null)throw Error(o(160));iy(p,w,f),ot=null,pn=!1,p=f.alternate,p!==null&&(p.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)cy(t,e,s),t=t.sibling}var Wn=null;function cy(e,t,s){var i=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(u&4&&(i=e.updateQueue,i=i!==null?i.events:null,i!==null))for(var f=0;f<i.length;f++){var p=i[f];p.ref.impl=p.nextImpl}an(t,e,s),on(e),u&4&&(ml(3,e,e.return),qo(3,e),ml(5,e,e.return));break;case 1:an(t,e,s),on(e),u&512&&(Xe||i===null||Ut(i,i.return)),u&64&&Rt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?t:s.concat(t))));break;case 26:if(f=Wn,an(t,e,s),on(e),u&512&&(Xe||i===null||Ut(i,i.return)),u&4)if(u=i!==null?i.memoizedState:null,s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null)if(Rt)e.stateNode=Qy(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,s=e.memoizedProps,u=f.ownerDocument||f;t:switch(t){case"title":i=u.getElementsByTagName("title")[0],(!i||i[vo]||i[xt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=u.createElement(t),u.head.insertBefore(i,u.querySelector("head > title"))),Ft(i,t,s),i[xt]=e,Tt(i),t=i;break e;case"link":if(f=pv("link","href",u).get(t+(s.href||""))){for(p=0;p<f.length;p++)if(i=f[p],i.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&i.getAttribute("rel")===(s.rel==null?null:s.rel)&&i.getAttribute("title")===(s.title==null?null:s.title)&&i.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){f.splice(p,1);break t}}i=u.createElement(t),Ft(i,t,s),u.head.appendChild(i);break;case"meta":if(f=pv("meta","content",u).get(t+(s.content||""))){for(p=0;p<f.length;p++)if(i=f[p],i.getAttribute("content")===(s.content==null?null:""+s.content)&&i.getAttribute("name")===(s.name==null?null:s.name)&&i.getAttribute("property")===(s.property==null?null:s.property)&&i.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&i.getAttribute("charset")===(s.charSet==null?null:s.charSet)){f.splice(p,1);break t}}i=u.createElement(t),Ft(i,t,s),u.head.appendChild(i);break;default:throw Error(o(468,t))}i[xt]=e,Tt(i),t=i}e.stateNode=t}else Rt||gh(f,e.type,e.stateNode);else e.stateNode=gv(f,s,e.memoizedProps);else u!==s?(u===null?(t=i.stateNode,t===null||Xe||t.parentNode.removeChild(t)):u.count--,s===null?Rt||gh(f,e.type,e.stateNode):gv(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Sd(e,e.memoizedProps,i.memoizedProps);break;case 27:an(t,e,s),on(e),u&512&&(Xe||i===null||Ut(i,i.return)),i!==null&&u&4&&Sd(e,e.memoizedProps,i.memoizedProps);break;case 5:if(f=ps,ps=!1,an(t,e,s),ps=f,on(e),u&512&&(Xe||i===null||Ut(i,i.return)),e.flags&32){t=e.stateNode;try{Ia(t,""),qe=!0}catch(X){Ze(e,e.return,X)}}u&4&&e.stateNode!=null&&(t=e.memoizedProps,Sd(e,t,i!==null?i.memoizedProps:t)),u&1024&&(Td=!0);break;case 6:if(an(t,e,s),on(e),u&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,s=e.stateNode;try{s.nodeValue=t,qe=!0}catch(X){Ze(e,e.return,X)}}break;case 3:if(qe=!1,au=null,f=Wn,Wn=tr(t.containerInfo),an(t,e,s),Wn=f,on(e),u&4&&i!==null&&i.memoizedState.isDehydrated)try{Ti(t.containerInfo)}catch(X){Ze(e,e.return,X)}Td&&(Td=!1,uy(e)),qe=!1;break;case 4:u=ps,ps=Rt,i=Rg(),f=Wn,Wn=tr(e.stateNode.containerInfo),an(t,e,s),on(e),Wn=f,qe&&Qo&&(Bc=!0),qe=i,ps=u;break;case 12:an(t,e,s),on(e);break;case 31:an(t,e,s),on(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,qc(e,t)));break;case 13:an(t,e,s),on(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Yc=et()),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,qc(e,t)));break;case 22:f=e.memoizedState!==null,p=i!==null&&i.memoizedState!==null;var w=Rt,z=Xe,q=ps;Rt=w||f,ps=q||f,Xe=z||p,an(t,e,s),Xe=z,ps=q,Rt=w,on(e),u&8192&&(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,!f||i===null||p||Rt||Xe||(t=p||Xe,s=Rt,i=Xe,Rt=f||Rt,Xe=t,gl(e,2),Rt=s,Xe=i),!f&&ps||Rd(e,f)),u&4&&(t=e.updateQueue,t!==null&&(s=t.retryQueue,s!==null&&(t.retryQueue=null,qc(e,s))));break;case 19:an(t,e,s),on(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,qc(e,t)));break;case 30:u&512&&(Xe||i===null||Ut(i,i.return)),u=Rg(),f=Qo,p=(s&335544064)===s,w=e.memoizedProps,Qo=p&&Os(w.default,w.update)!=="none",an(t,e,s),on(e),p&&i!==null&&qe&&(e.flags|=4),Qo=f,qe=u;break;case 21:break;case 7:u&512&&(Xe||i===null||Ut(i,i.return)),i&&i.stateNode!==null&&(i.stateNode._fragmentFiber=e);default:an(t,e,s),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(P0(i)){s=i;break}i=i.return}i=null;for(var u=e.return;u!==null;){if(vd(u)){var f=u.stateNode;i===null?i=[f]:i.push(f)}if(yd(u))break;u=u.return}var p=i;if(s==null)throw Error(o(160));switch(s.tag){case 27:var w=s.stateNode,z=bd(e);Hc(e,z,w,p);break;case 5:var q=s.stateNode;s.flags&32&&(Ia(q,""),s.flags&=-33);var X=bd(e);Hc(e,X,q,p);break;case 3:case 4:var ne=s.stateNode.containerInfo,V=bd(e);jd(e,V,ne,p);break;default:throw Error(o(161))}}catch(Y){Ze(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uy(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;uy(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ei=!0,t.reset(),Ei=!1),e=e.sibling}}function ui(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)fy(t,e),t=t.sibling;else ty(t)}function fy(e,t){var s=e.alternate;if(s===null)wd(e,!1);else switch(e.tag){case 3:if(_d=ys=!1,Z0(),ui(t,e),!ys&&!Bc){if(e=ms,e!==null)for(var i=0;i<e.length;i+=3){s=e[i];var u=e[i+1];Jy(s,e[i+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+u+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),_d=!0}ms=null;break;case 5:ui(t,e);break;case 4:i=ys,ys=!1,ui(t,e),ys&&(Bc=!0),ys=i;break;case 22:e.memoizedState===null&&(s.memoizedState!==null?wd(e,!1):ui(t,e));break;case 30:i=ys,u=Z0(),ys=!1,ui(t,e),ys&&(e.flags|=4);var f=e.memoizedProps,p=e.stateNode;t=As(f,p),p=As(s.memoizedProps,p);var w=Os(f.default,f.update);w==="none"?t=!1:(f=s.memoizedState,s.memoizedState=null,s=e.child,gn=0,t=Ed(e,s,t,p,w,f,!0),gn!==(f===null?0:f.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(yi(e,e.memoizedProps.onUpdate),ms=u):u!==null&&(u.push.apply(u,ms),ms=u),ys=(e.flags&32)!==0?!0:i;break;default:ui(t,e)}}function vs(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)sy(e,t.alternate,t),t=t.sibling}function gl(e,t){for(e=e.child;e!==null;){var s=e,i=t;switch(s.tag){case 0:case 11:case 14:case 15:ml(4,s,s.return),gl(s,i);break;case 1:Ut(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&Q0(s,s.return,u),gl(s,i);break;case 27:(i&2)!==0&&uv(s.stateNode,s.type,s.memoizedProps);case 5:Ut(s,s.return),s.tag!==5&&s.tag!==27||Io(s),gl(s,i);break;case 6:Io(s);break;case 26:Ut(s,s.return),u=s.stateNode,s.memoizedState!==null||u===null||Xe||u.parentNode.removeChild(u),gl(s,i);break;case 22:s.memoizedState===null&&gl(s,i);break;case 30:Ut(s,s.return),gl(s,i);break;case 7:Ut(s,s.return);default:gl(s,i)}e=e.sibling}}function es(e,t,s){for(s=(t.subtreeFlags&8772)!==0?s:s&-2,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,p=f.flags,w=(s&1)!==0;switch(f.tag){case 0:case 11:case 15:es(u,f,s),qo(4,f);break;case 1:if(es(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(X){Ze(i,i.return,X)}if(i=f,u=i.updateQueue,u!==null){var z=i.stateNode;try{var q=u.shared.hiddenCallbacks;if(q!==null)for(u.shared.hiddenCallbacks=null,u=0;u<q.length;u++)zp(q[u],z)}catch(X){Ze(i,i.return,X)}}w&&p&64&&I0(f),hs(f,f.return);break;case 27:(s&2)!==0&&X0(f);case 5:f.tag!==5&&f.tag!==27||Y0(f),es(u,f,s),w&&i===null&&p&4&&xd(f),hs(f,f.return);break;case 6:Y0(f);break;case 26:z=f.stateNode,f.memoizedState!==null||z===null||Rt||gh(tr(z.ownerDocument),f.type,z),es(u,f,s),w&&i===null&&p&4&&xd(f),hs(f,f.return);break;case 12:es(u,f,s);break;case 31:es(u,f,s),w&&p&4&&oy(u,f);break;case 13:es(u,f,s),w&&p&4&&ry(u,f);break;case 22:f.memoizedState===null&&es(u,f,s),hs(f,f.return);break;case 30:es(u,f,s),hs(f,f.return);break;case 7:hs(f,f.return);default:es(u,f,s)}t=t.sibling}}function Od(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Ao(s))}function zd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ao(e))}function Gn(e,t,s,i){var u=(s&335544064)===s;if(t.subtreeFlags&(u?10262:10256))for(t=t.child;t!==null;)dy(e,t,s,i),t=t.sibling;else u&&ey(t)}function dy(e,t,s,i){var u=(s&335544064)===s;u&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Vc(t);var f=t.flags;switch(t.tag){case 0:case 11:case 15:Gn(e,t,s,i),f&2048&&qo(9,t);break;case 1:Gn(e,t,s,i);break;case 3:Gn(e,t,s,i),u&&_d&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),f&2048&&(f=null,t.alternate!==null&&(f=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==f&&(t.refCount++,f!=null&&Ao(f)));break;case 12:if(f&2048){Gn(e,t,s,i),f=t.stateNode;try{var p=t.memoizedProps,w=p.id,z=p.onPostCommit;typeof z=="function"&&z(w,t.alternate===null?"mount":"update",f.passiveEffectDuration,-0)}catch(q){Ze(t,t.return,q)}}else Gn(e,t,s,i);break;case 31:Gn(e,t,s,i);break;case 13:Gn(e,t,s,i);break;case 23:break;case 22:p=t.stateNode,w=t.alternate,t.memoizedState!==null?(u&&w!==null&&w.memoizedState===null&&Vc(w),p._visibility&2?Gn(e,t,s,i):Yo(e,t)):(u&&w!==null&&w.memoizedState!==null&&Vc(t),p._visibility&2?Gn(e,t,s,i):(p._visibility|=2,fi(e,t,s,i,(t.subtreeFlags&10256)!==0||!1))),f&2048&&Od(w,t);break;case 24:Gn(e,t,s,i),f&2048&&zd(t.alternate,t);break;case 30:u&&(f=t.alternate,f!==null&&(gs(f.child,!0),gs(t.child,!0))),Gn(e,t,s,i);break;default:Gn(e,t,s,i)}}function fi(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,p=t,w=s,z=i,q=p.flags;switch(p.tag){case 0:case 11:case 15:fi(f,p,w,z,u),qo(8,p);break;case 23:break;case 22:var X=p.stateNode;p.memoizedState!==null?X._visibility&2?fi(f,p,w,z,u):Yo(f,p):(X._visibility|=2,fi(f,p,w,z,u)),u&&q&2048&&Od(p.alternate,p);break;case 24:fi(f,p,w,z,u),u&&q&2048&&zd(p.alternate,p);break;default:fi(f,p,w,z,u)}t=t.sibling}}function Yo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,u=i.flags;switch(i.tag){case 22:Yo(s,i),u&2048&&Od(i.alternate,i);break;case 24:Yo(s,i),u&2048&&zd(i.alternate,i);break;default:Yo(s,i)}t=t.sibling}}var da=8192;function ha(e,t,s){if(e.subtreeFlags&da)for(e=e.child;e!==null;)hy(e,t,s),e=e.sibling}function hy(e,t,s){switch(e.tag){case 26:ha(e,t,s),e.flags&da&&(e.memoizedState!==null?p2(s,Wn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Sv(s,e)));break;case 5:ha(e,t,s),e.flags&da&&(e=e.stateNode,(t&335544128)===t&&Sv(s,e));break;case 3:case 4:var i=Wn;Wn=tr(e.stateNode.containerInfo),ha(e,t,s),Wn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=da,da=16777216,ha(e,t,s),da=i):ha(e,t,s));break;case 30:if((e.flags&da)!==0&&(i=e.memoizedProps.name,i!=null&&i!=="auto")){var u=e.stateNode;u.paired=null,Tn===null&&(Tn=new Map),Tn.set(i,u)}ha(e,t,s);break;default:ha(e,t,s)}}function my(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];At=i,py(i,e)}my(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)gy(e),e=e.sibling}function gy(e){switch(e.tag){case 0:case 11:case 15:Po(e),e.flags&2048&&ml(9,e,e.return);break;case 3:Po(e);break;case 12:Po(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ic(e)):Po(e);break;default:Po(e)}}function Ic(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];At=i,py(i,e)}my(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ml(8,t,t.return),Ic(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Ic(t));break;default:Ic(t)}e=e.sibling}}function py(e,t){for(;At!==null;){var s=At;switch(s.tag){case 0:case 11:case 15:ml(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ao(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,At=i;else e:for(s=e;At!==null;){i=At;var u=i.sibling,f=i.return;if(ay(i),i===s){At=null;break e}if(u!==null){u.return=f,At=u;break e}At=f}}}var fj={getCacheForType:function(e){var t=$t(St),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return $t(St).controller.signal}},dj=typeof WeakMap=="function"?WeakMap:Map,Qe=0,nt=null,ze=null,Le=0,Ke=0,_n=null,pl=!1,di=!1,Dd=!1,Vs=0,mt=0,yl=0,ma=0,Qc=0,Rn=0,hi=0,Xo=null,yn=null,Ld=!1,Yc=0,yy=0,Pc=1/0,Xc=null,vl=null,ft=0,ts=null,ga=null,xs=0,$d=0,kd=null,vy=null,mi=null,gi=null,pi=null,Ko=0,Kc=null;function An(){return(Qe&2)!==0&&Le!==0?Le&-Le:me.T!==null?Yd():Fa()}function xy(){if(Rn===0)if((Le&536870912)===0||Oe){var e=Ql;Ql<<=1,(Ql&3932160)===0&&(Ql=262144),Rn=e}else Rn=536870912;return e=kt.current,e!==null&&(e.flags|=32),Rn}function yi(e,t){if(t!=null){var s=e.stateNode,i=s.ref;i===null&&(i=s.ref=Wy(As(e.memoizedProps,s))),gi===null&&(gi=[]),gi.push(t.bind(null,i))}}function vn(e,t,s){(e===nt&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)&&(vi(e,0),xl(e,Le,Rn,!1)),Ws(e,s),((Qe&2)===0||e!==nt)&&(e===nt&&((Qe&2)===0&&(ma|=s),mt===4&&xl(e,Le,Rn,!1)),Ss(e))}function Sy(e,t,s){if((Qe&6)!==0)throw Error(o(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Js(e,t),u=i?gj(e,t):Ud(e,t,!0),f=i;do{if(u===0){di&&!i&&xl(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!hj(s)){u=Ud(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var w=e;u=Xo;var z=w.current.memoizedState.isDehydrated;if(z&&(vi(w,p).flags|=256),p=Ud(w,p,!1),p!==2&&p!==6){if(Dd&&!z){w.errorRecoveryDisabledLanes|=f,ma|=f,u=4;break e}f=yn,yn=u,f!==null&&(yn===null?yn=f:yn.push.apply(yn,f))}u=p}if(f=!1,u!==2)continue}}if(u===1){vi(e,0),xl(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:xl(i,t,Rn,!pl);break e;case 2:yn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(u=Yc+300-et(),10<u)){if(xl(i,t,Rn,!pl),Pl(i,0,!0)!==0)break e;xs=t,i.timeoutHandle=lh(by.bind(null,i,s,yn,Xc,Ld,t,Rn,ma,hi,pl,f,"Throttled",-0,0),u);break e}by(i,s,yn,Xc,Ld,t,Rn,ma,hi,pl,f,null,-0,0)}}break}while(!0);Ss(e)}function by(e,t,s,i,u,f,p,w,z,q,X,ne,V,Y){e.timeoutHandle=-1;var fe=t.subtreeFlags,ye=(f&335544064)===f;if(ne=null,(ye||fe&8192||(fe&16785408)===16785408)&&(ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:us},Tn=null,hy(t,f,ne),ye&&(fe=ne,ye=e.containerInfo,ye=(ye.nodeType===9?ye:ye.ownerDocument).__reactViewTransition,ye!=null&&(fe.count++,fe.waitingForViewTransition=!0,fe=lr.bind(fe),ye.finished.then(fe,fe))),fe=(f&62914560)===f?Yc-et():(f&4194048)===f?yy-et():0,fe=y2(ne,fe),fe!==null)){xs=f,e.cancelPendingCommit=fe(_y.bind(null,e,t,f,s,i,u,p,w,z,q,X,ne,null,V,Y)),xl(e,f,p,!q);return}_y(e,t,f,s,i,u,p,w,z,q,X,ne)}function hj(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!Mn(f(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function xl(e,t,s,i){t=ho(e,t),t&=~Qc,t&=~ma,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-Yt(u),p=1<<f;i[f]=-1,u&=~p}s!==0&&at(e,s,t)}function Zc(){return(Qe&6)===0?(Zo(0),!1):!0}function Hd(){if(ze!==null){if(Ke===0)var e=ze.return;else e=ze,Ls=na=null,Qf(e),li=null,Do=0,e=ze;for(;e!==null;)q0(e.alternate,e),e=e.return;ze=null}}function vi(e,t){var s=e.timeoutHandle;return s!==-1&&(e.timeoutHandle=-1,kj(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),xs=0,Hd(),nt=e,ze=s=zs(e.current,null),Le=t,Ke=0,_n=null,pl=!1,di=Js(e,t),Dd=!1,hi=Rn=Qc=ma=yl=mt=0,yn=Xo=null,Ld=!1,Vs=ho(e,t),ac(),s}function jy(e,t){Re=null,me.H=Rc,t===si||t===pc?(t=_p(),Ke=3):t===zf?(t=_p(),Ke=4):Ke=t===od?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_n=t,ze===null&&(mt=1,Ac(e,Un(t,e.current)))}function wy(){var e=kt.current;return e===null?!0:(Le&4194048)===Le?Pt===null:(Le&62914560)===Le||(Le&536870912)!==0?e===Pt:!1}function Ny(){var e=me.H;return me.H=Rc,e===null?Rc:e}function Cy(){var e=me.A;return me.A=fj,e}function Jc(){mt=4,pl||(Le&4194048)!==Le&&kt.current!==null||(di=!0),(yl&134217727)===0&&(ma&134217727)===0||nt===null||xl(nt,Le,Rn,!1)}function Ud(e,t,s){var i=Qe;Qe|=2;var u=Ny(),f=Cy();(nt!==e||Le!==t)&&(Xc=null,vi(e,t)),t=!1;var p=mt;e:do try{if(Ke!==0&&ze!==null){var w=ze,z=_n;switch(Ke){case 8:Hd(),p=6;break e;case 3:case 2:case 9:case 6:kt.current===null&&(t=!0);var q=Ke;if(Ke=0,_n=null,xi(e,w,z,q),s&&di){p=0;break e}break;default:q=Ke,Ke=0,_n=null,xi(e,w,z,q)}}mj(),p=mt;break}catch(X){jy(e,X)}while(!0);return t&&e.shellSuspendCounter++,Ls=na=null,Qe=i,me.H=u,me.A=f,ze===null&&(nt=null,Le=0,ac()),p}function mj(){for(;ze!==null;)My(ze)}function gj(e,t){var s=Qe;Qe|=2;var i=Ny(),u=Cy();nt!==e||Le!==t?(Xc=null,Pc=et()+500,vi(e,t)):di=Js(e,t);e:do try{if(Ke!==0&&ze!==null){t=ze;var f=_n;t:switch(Ke){case 1:Ke=0,_n=null,xi(e,t,f,1);break;case 2:case 9:if(Ep(f)){Ke=0,_n=null,Ey(t);break}t=function(){Ke!==2&&Ke!==9||nt!==e||(Ke=7),Ss(e)},f.then(t,t);break e;case 3:Ke=7;break e;case 4:Ke=5;break e;case 7:Ep(f)?(Ke=0,_n=null,Ey(t)):(Ke=0,_n=null,xi(e,t,f,7));break;case 5:var p=null;switch(ze.tag){case 26:p=ze.memoizedState;case 5:case 27:var w=ze;if(p?vv(p):w.stateNode.complete){Ke=0,_n=null;var z=w.sibling;if(z!==null)ze=z;else{var q=w.return;q!==null?(ze=q,Wc(q)):ze=null}break t}}Ke=0,_n=null,xi(e,t,f,5);break;case 6:Ke=0,_n=null,xi(e,t,f,6);break;case 8:Hd(),mt=6;break e;default:throw Error(o(462))}}pj();break}catch(X){jy(e,X)}while(!0);return Ls=na=null,me.H=i,me.A=u,Qe=s,ze!==null?0:(nt=null,Le=0,ac(),mt)}function pj(){for(;ze!==null&&!vt();)My(ze)}function My(e){var t=B0(e.alternate,e,Vs);e.memoizedProps=e.pendingProps,t===null?Wc(e):ze=t}function Ey(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=L0(s,t,t.pendingProps,t.type,void 0,Le);break;case 11:t=L0(s,t,t.pendingProps,t.type.render,t.ref,Le);break;case 5:Qf(t);var i=t;i===_t&&(Oe?(fc(i),i.tag===5&&i.stateNode!=null&&(st=i.stateNode)):(fc(i),Oe=!0));default:q0(s,t),t=ze=pp(t,Vs),t=B0(s,t,Vs)}e.memoizedProps=e.pendingProps,t===null?Wc(e):ze=t}function xi(e,t,s,i){Ls=na=null,Qf(t),li=null,Do=0;var u=t.return;try{if(sj(e,u,t,s,Le)){mt=1,Ac(e,Un(s,e.current)),ze=null;return}}catch(f){if(u!==null)throw ze=u,f;mt=1,Ac(e,Un(s,e.current)),ze=null;return}t.flags&32768?(Oe||i===1?e=!0:di||(Le&536870912)!==0?e=!1:(pl=e=!0,(i===2||i===9||i===3||i===6)&&(i=kt.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ty(t,e)):Wc(t)}function Wc(e){var t=e;do{if((t.flags&32768)!==0){Ty(t,pl);return}e=t.return;var s=oj(t.alternate,t,Vs);if(s!==null){ze=s;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);mt===0&&(mt=5)}function Ty(e,t){do{var s=rj(e.alternate,e);if(s!==null){s.flags&=32767,ze=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=s}while(e!==null);mt=6,ze=null}function _y(e,t,s,i,u,f,p,w,z,q,X,ne){e.cancelPendingCommit=null;do eu();while(ft!==0);if((Qe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===nt&&(ze=nt=null,Le=0),ga=t,ts=e,xs=s,kd=u,vy=i,yj(e,t,s,p,w,z,ne)}}function yj(e,t,s,i,u,f,p){var w=t.lanes|t.childLanes;if($d=w,w|=Sf,ge(e,s,w,i,u,f),gi=null,(s&335544064)===s?(pi=Ib(e),i=10262):(pi=null,i=10256),(t.subtreeFlags&i)!==0||(t.flags&i)!==0?(e.callbackNode=null,e.callbackPriority=0,wj(ka,function(){return Gd(),null})):(e.callbackNode=null,e.callbackPriority=0),Uc=!1,i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=me.T,me.T=null,u=Se.p,Se.p=2,f=Qe,Qe|=4;try{cj(e,t,s)}finally{Qe=f,Se.p=u,me.T=i}}ft=1,Uc?mi=Gj(p,e.containerInfo,pi,Fd,Vd,xj,Bd,Gd,vj):(Fd(),Vd(),Bd())}function vj(e){if(ft!==0){var t=ts.onRecoverableError;t(e,{componentStack:null})}}function xj(){ft===3&&(ft=0,fy(ga,ts),ft=4)}function Fd(){if(ft===1){ft=0;var e=ts,t=ga,s=xs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=me.T,me.T=null;var u=Se.p;Se.p=2;var f=Qe;Qe|=4;try{Qo=Bc=!1,cy(t,e,s),s=th;var p=ip(e.containerInfo),w=s.focusedElem,z=s.selectionRange;if(p!==w&&w&&w.ownerDocument&&ap(w.ownerDocument.documentElement,w)){if(z!==null&&gf(w)){var q=z.start,X=z.end;if(X===void 0&&(X=q),"selectionStart"in w)w.selectionStart=q,w.selectionEnd=Math.min(X,w.value.length);else{var ne=w.ownerDocument||document,V=ne&&ne.defaultView||window;if(V.getSelection){var Y=V.getSelection(),fe=w.textContent.length,ye=Math.min(z.start,fe),Ae=z.end===void 0?ye:Math.min(z.end,fe);!Y.extend&&ye>Ae&&(p=Ae,Ae=ye,ye=p);var G=lp(w,ye),H=lp(w,Ae);if(G&&H&&(Y.rangeCount!==1||Y.anchorNode!==G.node||Y.anchorOffset!==G.offset||Y.focusNode!==H.node||Y.focusOffset!==H.offset)){var Q=ne.createRange();Q.setStart(G.node,G.offset),Y.removeAllRanges(),ye>Ae?(Y.addRange(Q),Y.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),Y.addRange(Q))}}}}for(ne=[],Y=w;Y=Y.parentNode;)Y.nodeType===1&&ne.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<ne.length;w++){var ee=ne[w];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}Ei=!!eh,th=eh=null}finally{Qe=f,Se.p=u,me.T=i}}e.current=t,ft=2}}function Vd(){if(ft===2){ft=0;var e=ts,t=ga,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=me.T,me.T=null;var i=Se.p;Se.p=2;var u=Qe;Qe|=4;try{sy(e,t.alternate,t)}finally{Qe=u,Se.p=i,me.T=s}}ft=3}}function Bd(){if(ft===4||ft===3){ft=0;var e=mi;mi=null,pt();var t=ts,s=ga,i=xs,u=vy,f=(i&335544064)===i?10262:10256;if((s.subtreeFlags&f)!==0||(s.flags&f)!==0?ft=5:(ft=0,ga=ts=null,Ry(t,t.pendingLanes)),f=t.pendingLanes,f===0&&(vl=null),po(i),s=s.stateNode,Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(Zs,s,void 0,(s.current.flags&128)===128)}catch{}if(u!==null){s=me.T,f=Se.p,Se.p=2,me.T=null;try{for(var p=t.onRecoverableError,w=0;w<u.length;w++){var z=u[w];p(z.value,{componentStack:z.stack})}}finally{me.T=s,Se.p=f}}if(u=gi,p=pi,pi=null,u!==null&&(gi=null,p===null&&(p=[]),e!==null))for(z=0;z<u.length;z++)s=(0,u[z])(p),s!==void 0&&e.finished.finally(s);(xs&3)!==0&&eu(),Ss(t),f=t.pendingLanes,(i&261930)!==0&&(f&42)!==0?t===Kc?Ko++:(Ko=0,Kc=t):(Ko=0,Kc=null),Zo(0)}}function Ry(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ao(t)))}function eu(){return mi!==null&&(mi.skipTransition(),mi=null),Fd(),Vd(),Bd(),Gd()}function Gd(){if(ft!==5)return!1;var e=ts,t=$d;$d=0;var s=po(xs),i=me.T,u=Se.p;try{Se.p=32>s?32:s,me.T=null,s=kd,kd=null;var f=ts,p=xs;if(ft=0,ga=ts=null,xs=0,(Qe&6)!==0)throw Error(o(331));var w=Qe;if(Qe|=4,gy(f.current),dy(f,f.current,p,s),Qe=w,Zo(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Zs,f)}catch{}return!0}finally{Se.p=u,me.T=i,Ry(e,t)}}function Ay(e,t,s){t=Un(s,t),t=id(e.stateNode,t,2),e=ul(e,t,2),e!==null&&(Ws(e,2),Ss(e))}function Ze(e,t,s){if(e.tag===3)Ay(e,e,s);else for(;t!==null;){if(t.tag===3){Ay(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(vl===null||!vl.has(i))){e=Un(s,e),s=E0(2),i=ul(t,s,2),i!==null&&(T0(s,i,t,e),Ws(i,2),Ss(i));break}}t=t.return}}function qd(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new dj;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(s)||(Dd=!0,u.add(s),e=Sj.bind(null,e,t,s),t.then(e,e))}function Sj(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,nt===e&&(Le&s)===s&&((mt===4||mt===3&&(Le&62914560)===Le&&300>et()-Yc)&&(Qe&2)===0?vi(e,0):Qc|=s,hi===Le&&(hi=0)),Ss(e)}function Oy(e,t){t===0&&(t=mo()),e=Wl(e,t),e!==null&&(Ws(e,t),Ss(e))}function bj(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Oy(e,s)}function jj(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Oy(e,s)}function wj(e,t){return Ue(e,t)}var Si=null,bi=null,Id=!1,tu=!1,Qd=!1,Sl=0;function Ss(e){e!==bi&&e.next===null&&(bi===null?Si=bi=e:bi=bi.next=e),tu=!0,Id||(Id=!0,Cj())}function Zo(e,t){if(!Qd&&tu){Qd=!0;do for(var s=!1,i=Si;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var p=i.suspendedLanes,w=i.pingedLanes;f=(1<<31-Yt(42|e)+1)-1,f&=u&~(p&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,$y(i,f))}else f=Le,f=Pl(i,i===nt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Js(i,f)||(s=!0,$y(i,f));i=i.next}while(s);Qd=!1}}function Nj(){zy()}function zy(){tu=Id=!1;var e=0;Sl!==0&&$j()&&(e=Sl);for(var t=et(),s=null,i=Si;i!==null;){var u=i.next,f=Dy(i,t);f===0?(i.next=null,s===null?Si=u:s.next=u,u===null&&(bi=s)):(s=i,(e!==0||(f&3)!==0)&&(tu=!0)),i=u}ft!==0&&ft!==5||Zo(e),Sl!==0&&(Sl=0)}function Dy(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var p=31-Yt(f),w=1<<p,z=u[p];z===-1?((w&s)===0||(w&i)!==0)&&(u[p]=Ir(w,t)):z<=t&&(e.expiredLanes|=w),f&=~w}if(t=nt,s=Le,s=Pl(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(Ke===2||Ke===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Pe(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Js(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Pe(i),po(s)){case 2:case 8:s=ql;break;case 32:s=ka;break;case 268435456:s=tn;break;default:s=ka}return i=Ly.bind(null,e),s=Ue(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Pe(i),e.callbackPriority=2,e.callbackNode=null,2}function Ly(e,t){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(eu()&&e.callbackNode!==s)return null;var i=Le;return i=Pl(e,e===nt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Sy(e,i,t),Dy(e,et()),e.callbackNode!=null&&e.callbackNode===s?Ly.bind(null,e):null)}function $y(e,t){if(eu())return null;Sy(e,t,!0)}function Cj(){Hj(function(){(Qe&6)!==0?Ue(Nn,Nj):zy()})}function Yd(){if(Sl===0){var e=aa;e===0&&(e=Il,Il<<=1,(Il&261888)===0&&(Il=256)),Sl=e}return Sl}function ky(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Zr(e)}function Mj(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=ky((u[Lt]||null).action),p=i.submitter;p&&(t=(t=p[Lt]||null)?ky(t.formAction):p.getAttribute("formAction"),t!==null&&(f=t,p=null));var w=new tc("action","action",null,i,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Sl!==0){var z=new FormData(u,p);td(s,{pending:!0,data:z,method:u.method,action:f},null,z)}}else typeof f=="function"&&(w.preventDefault(),z=new FormData(u,p),td(s,{pending:!0,data:z,method:u.method,action:f},f,z))},currentTarget:u}]})}}for(var Pd=0;Pd<xf.length;Pd++){var Xd=xf[Pd],Ej=Xd.toLowerCase(),Tj=Xd[0].toUpperCase()+Xd.slice(1);Zn(Ej,"on"+Tj)}Zn(cp,"onAnimationEnd"),Zn(up,"onAnimationIteration"),Zn(fp,"onAnimationStart"),Zn("dblclick","onDoubleClick"),Zn("focusin","onFocus"),Zn("focusout","onBlur"),Zn(kb,"onTransitionRun"),Zn(Hb,"onTransitionStart"),Zn(Ub,"onTransitionCancel"),Zn(dp,"onTransitionEnd"),Ga("onMouseEnter",["mouseout","mouseover"]),Ga("onMouseLeave",["mouseout","mouseover"]),Ga("onPointerEnter",["pointerout","pointerover"]),Ga("onPointerLeave",["pointerout","pointerover"]),Kl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Kl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Kl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Kl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Kl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jo="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(" "),_j=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jo));function Hy(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var p=i.length-1;0<=p;p--){var w=i[p],z=w.instance,q=w.currentTarget;if(w=w.listener,z!==f&&u.isPropagationStopped())break e;f=w,u.currentTarget=q;try{f(u)}catch(X){lc(X)}u.currentTarget=null,f=z}else for(p=0;p<i.length;p++){if(w=i[p],z=w.instance,q=w.currentTarget,w=w.listener,z!==f&&u.isPropagationStopped())break e;f=w,u.currentTarget=q;try{f(u)}catch(X){lc(X)}u.currentTarget=null,f=z}}}}function De(e,t){var s=t[yo];s===void 0&&(s=t[yo]=new Set);var i=e+"__bubble";s.has(i)||(Uy(t,e,2,!1),s.add(i))}function Kd(e,t,s){var i=0;t&&(i|=4),Uy(s,e,i,t)}var nu="_reactListening"+Math.random().toString(36).slice(2);function Zd(e){if(!e[nu]){e[nu]=!0,Mg.forEach(function(s){s!=="selectionchange"&&(_j.has(s)||Kd(s,!1,e),Kd(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[nu]||(t[nu]=!0,Kd("selectionchange",!1,t))}}function Uy(e,t,s,i){switch(Tv(t)){case 2:var u=b2;break;case 8:u=j2;break;default:u=yh}s=u.bind(null,t,s,e),u=void 0,!lf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function Jd(e,t,s,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var w=i.stateNode.containerInfo;if(w===u)break;if(p===4)for(p=i.return;p!==null;){var z=p.tag;if((z===3||z===4)&&p.stateNode.containerInfo===u)return;p=p.return}for(;w!==null;){if(p=Xl(w),p===null)return;if(z=p.tag,z===5||z===6||z===26||z===27){i=f=p;continue e}w=w.parentNode}}i=i.return}Ug(function(){var q=f,X=nf(s),ne=[];e:{var V=hp.get(e);if(V!==void 0){var Y=tc,fe=e;switch(e){case"keypress":if(Wr(s)===0)break e;case"keydown":case"keyup":Y=hb;break;case"focusin":fe="focus",Y=cf;break;case"focusout":fe="blur",Y=cf;break;case"beforeblur":case"afterblur":Y=cf;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Bg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=tb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=vb;break;case cp:case up:case fp:Y=lb;break;case dp:Y=Sb;break;case"scroll":case"scrollend":Y=WS;break;case"wheel":Y=jb;break;case"copy":case"cut":case"paste":Y=ib;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=qg;break;case"submit":Y=pb;break;case"toggle":case"beforetoggle":Y=Nb}var ye=(t&4)!==0,Ae=!ye&&(e==="scroll"||e==="scrollend"),G=ye?V!==null?V+"Capture":null:V;ye=[];for(var H=q,Q;H!==null;){var ee=H;if(Q=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||Q===null||G===null||(ee=So(H,G),ee!=null&&ye.push(Wo(H,ee,Q))),Ae)break;H=H.return}0<ye.length&&(V=new Y(V,fe,null,s,X),ne.push({event:V,listeners:ye}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",V=e==="mouseout"||e==="pointerout",Y&&s!==tf&&(fe=s.relatedTarget||s.fromElement)&&(Xl(fe)||fe[el]))break e;(V||Y)&&(fe=X.window===X?X:(Y=X.ownerDocument)?Y.defaultView||Y.parentWindow:window,V?(Y=s.relatedTarget||s.toElement,V=q,Y=Y?Xl(Y):null,Y!==null&&(Ae=d(Y),ye=Y.tag,Y!==Ae||ye!==5&&ye!==27&&ye!==6)&&(Y=null)):(V=null,Y=q),V!==Y&&(ye=Bg,ee="onMouseLeave",G="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(ye=qg,ee="onPointerLeave",G="onPointerEnter",H="pointer"),Ae=V==null?fe:xo(V),Q=Y==null?fe:xo(Y),fe=new ye(ee,H+"leave",V,s,X),fe.target=Ae,fe.relatedTarget=Q,ee=null,Xl(X)===q&&(ye=new ye(G,H+"enter",Y,s,X),ye.target=Q,ye.relatedTarget=Ae,ee=ye),Ae=ee,ye=V&&Y?R(V,Y,Rj):null,V!==null&&Fy(ne,fe,V,ye,!1),Y!==null&&Ae!==null&&Fy(ne,Ae,Y,ye,!0)))}e:{if(V=q?xo(q):window,Y=V.nodeName&&V.nodeName.toLowerCase(),Y==="select"||Y==="input"&&V.type==="file")var pe=Jg;else if(Kg(V))if(Wg)pe=Db;else{pe=Ob;var $e=Ab}else Y=V.nodeName,!Y||Y.toLowerCase()!=="input"||V.type!=="checkbox"&&V.type!=="radio"?q&&ef(q.elementType)&&(pe=Jg):pe=zb;if(pe&&(pe=pe(e,q))){Zg(ne,pe,s,X);break e}$e&&$e(e,V,q)}switch($e=q?xo(q):window,e){case"focusin":(Kg($e)||$e.contentEditable==="true")&&(Xa=$e,pf=q,To=null);break;case"focusout":To=pf=Xa=null;break;case"mousedown":yf=!0;break;case"contextmenu":case"mouseup":case"dragend":yf=!1,op(ne,s,X);break;case"selectionchange":if($b)break;case"keydown":case"keyup":op(ne,s,X)}var be;if(ff)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Pa?Pg(e,s)&&(Ce="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ce="onCompositionStart");Ce&&(Ig&&s.locale!=="ko"&&(Pa||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Pa&&(be=Fg()):(tl=X,af="value"in tl?tl.value:tl.textContent,Pa=!0)),$e=su(q,Ce),0<$e.length&&(Ce=new Gg(Ce,e,null,s,X),ne.push({event:Ce,listeners:$e}),be?Ce.data=be:(be=Xg(s),be!==null&&(Ce.data=be)))),(be=Mb?Eb(e,s):Tb(e,s))&&(Ce=su(q,"onBeforeInput"),0<Ce.length&&($e=new Gg("onBeforeInput","beforeinput",null,s,X),ne.push({event:$e,listeners:Ce}),$e.data=be)),Mj(ne,e,q,s,X)}Hy(ne,t)})}function Wo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function su(e,t){for(var s=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=So(e,s),u!=null&&i.unshift(Wo(e,u,f)),u=So(e,t),u!=null&&i.push(Wo(e,u,f))),e.tag===3)return i;e=e.return}return[]}function Rj(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Fy(e,t,s,i,u){for(var f=t._reactName,p=[];s!==null&&s!==i;){var w=s,z=w.alternate,q=w.stateNode;if(w=w.tag,z!==null&&z===i)break;w!==5&&w!==26&&w!==27||q===null||(z=q,u?(q=So(s,f),q!=null&&p.unshift(Wo(s,q,z))):u||(q=So(s,f),q!=null&&p.push(Wo(s,q,z)))),s=s.return}p.length!==0&&e.push({event:t,listeners:p})}var Aj=/\r\n?/g,Oj=/\u0000|\uFFFD/g;function Vy(e){return(typeof e=="string"?e:""+e).replace(Aj,`
|
|
49
|
-
`).replace(Oj,"")}function By(e,t){return t=Vy(t),Vy(e)===t}function Je(e,t,s,i,u,f){switch(s){case"children":if(typeof i=="string")t==="body"||t==="textarea"&&i===""||Ia(e,i);else if(typeof i=="number"||typeof i=="bigint")t!=="body"&&Ia(e,""+i);else return;break;case"className":Kr(e,"class",i);break;case"tabIndex":Kr(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Kr(e,s,i);break;case"style":kg(e,i,f);return;case"data":if(t!=="object"){Kr(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Zr(i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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 f=="function"&&(s==="formAction"?(t!=="input"&&Je(e,t,"name",u.name,u,null),Je(e,t,"formEncType",u.formEncType,u,null),Je(e,t,"formMethod",u.formMethod,u,null),Je(e,t,"formTarget",u.formTarget,u,null)):(Je(e,t,"encType",u.encType,u,null),Je(e,t,"method",u.method,u,null),Je(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Zr(i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=us);return;case"onScroll":i!=null&&De("scroll",e);return;case"onScrollEnd":i!=null&&De("scrollend",e);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(o(60));(f!=null?f.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Zr(i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":De("beforetoggle",e),De("toggle",e),Xr(e,"popover",i);break;case"xlinkActuate":_s(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":_s(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":_s(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":_s(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":_s(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":_s(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":_s(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":_s(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":_s(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Xr(e,"is",i);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=ZS.get(s)||s,Xr(e,s,i);else return}qe=!0}function Wd(e,t,s,i,u,f){switch(s){case"style":kg(e,i,f);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(o(60));(f!=null?f.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"children":if(typeof i=="string")Ia(e,i);else if(typeof i=="number"||typeof i=="bigint")Ia(e,""+i);else return;break;case"onScroll":i!=null&&De("scroll",e);return;case"onScrollEnd":i!=null&&De("scrollend",e);return;case"onClick":i!=null&&(e.onclick=us);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Eg.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),f=s.slice(2,u?s.length-7:void 0),t=e[Lt]||null,t=t!=null?t[s]:null,typeof t=="function"&&e.removeEventListener(f,t,u),typeof i=="function")){typeof t!="function"&&t!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(f,i,u);break e}qe=!0,s in e?e[s]=i:i===!0?e.setAttribute(s,""):Xr(e,s,i)}return}qe=!0}function Ft(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var p=s[f];if(p!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,f,p,s,null)}}u&&Je(e,t,"srcSet",s.srcSet,s,null),i&&Je(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var w=f=p=u=null,z=null,q=null;for(i in s)if(s.hasOwnProperty(i)){var X=s[i];if(X!=null)switch(i){case"name":u=X;break;case"type":p=X;break;case"checked":z=X;break;case"defaultChecked":q=X;break;case"value":f=X;break;case"defaultValue":w=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(o(137,t));break;default:Je(e,t,i,X,s,null)}}zg(e,f,w,z,q,p,u,!1);return;case"select":De("invalid",e),i=p=f=null;for(u in s)if(s.hasOwnProperty(u)&&(w=s[u],w!=null))switch(u){case"value":f=w;break;case"defaultValue":p=w;break;case"multiple":i=w;default:Je(e,t,u,w,s,null)}t=f,s=p,e.multiple=!!i,t!=null?qa(e,!!i,t,!1):s!=null&&qa(e,!!i,s,!0);return;case"textarea":De("invalid",e),f=u=i=null;for(p in s)if(s.hasOwnProperty(p)&&(w=s[p],w!=null))switch(p){case"value":i=w;break;case"defaultValue":u=w;break;case"children":f=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(o(91));break;default:Je(e,t,p,w,s,null)}Lg(e,i,u,f);return;case"option":for(z in s)if(s.hasOwnProperty(z)&&(i=s[z],i!=null))switch(z){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Je(e,t,z,i,s,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(i=0;i<Jo.length;i++)De(Jo[i],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(q in s)if(s.hasOwnProperty(q)&&(i=s[q],i!=null))switch(q){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Je(e,t,q,i,s,null)}return;default:if(ef(t)){for(X in s)s.hasOwnProperty(X)&&(i=s[X],i!==void 0&&Wd(e,t,X,i,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(i=s[w],i!=null&&Je(e,t,w,i,s,null))}var zj={};function Dj(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,p=null,w=null,z=null,q=null,X=null;for(Y in s){var ne=s[Y];if(s.hasOwnProperty(Y)&&ne!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":z=ne;default:i.hasOwnProperty(Y)||Je(e,t,Y,null,i,ne)}}for(var V in i){var Y=i[V];if(ne=s[V],i.hasOwnProperty(V)&&(Y!=null||ne!=null))switch(V){case"type":Y!==ne&&(qe=!0),f=Y;break;case"name":Y!==ne&&(qe=!0),u=Y;break;case"checked":Y!==ne&&(qe=!0),q=Y;break;case"defaultChecked":Y!==ne&&(qe=!0),X=Y;break;case"value":Y!==ne&&(qe=!0),p=Y;break;case"defaultValue":Y!==ne&&(qe=!0),w=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(o(137,t));break;default:Y!==ne&&Je(e,t,V,Y,i,ne)}}Ju(e,p,w,z,q,X,f,u);return;case"select":Y=p=w=V=null;for(f in s)if(z=s[f],s.hasOwnProperty(f)&&z!=null)switch(f){case"value":break;case"multiple":Y=z;default:i.hasOwnProperty(f)||Je(e,t,f,null,i,z)}for(u in i)if(f=i[u],z=s[u],i.hasOwnProperty(u)&&(f!=null||z!=null))switch(u){case"value":f!==z&&(qe=!0),V=f;break;case"defaultValue":f!==z&&(qe=!0),w=f;break;case"multiple":f!==z&&(qe=!0),p=f;default:f!==z&&Je(e,t,u,f,i,z)}t=w,s=p,i=Y,V!=null?qa(e,!!s,V,!1):!!i!=!!s&&(t!=null?qa(e,!!s,t,!0):qa(e,!!s,s?[]:"",!1));return;case"textarea":Y=V=null;for(w in s)if(u=s[w],s.hasOwnProperty(w)&&u!=null&&!i.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Je(e,t,w,null,i,u)}for(p in i)if(u=i[p],f=s[p],i.hasOwnProperty(p)&&(u!=null||f!=null))switch(p){case"value":u!==f&&(qe=!0),V=u;break;case"defaultValue":u!==f&&(qe=!0),Y=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(o(91));break;default:u!==f&&Je(e,t,p,u,i,f)}Dg(e,V,Y);return;case"option":for(var fe in s)if(V=s[fe],s.hasOwnProperty(fe)&&V!=null&&!i.hasOwnProperty(fe))switch(fe){case"selected":e.selected=!1;break;default:Je(e,t,fe,null,i,V)}for(z in i)if(V=i[z],Y=s[z],i.hasOwnProperty(z)&&V!==Y&&(V!=null||Y!=null))switch(z){case"selected":V!==Y&&(qe=!0),e.selected=V&&typeof V!="function"&&typeof V!="symbol";break;default:Je(e,t,z,V,i,Y)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ye in s)V=s[ye],s.hasOwnProperty(ye)&&V!=null&&!i.hasOwnProperty(ye)&&Je(e,t,ye,null,i,V);for(q in i)if(V=i[q],Y=s[q],i.hasOwnProperty(q)&&V!==Y&&(V!=null||Y!=null))switch(q){case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(o(137,t));break;default:Je(e,t,q,V,i,Y)}return;default:if(ef(t)){for(var Ae in s)V=s[Ae],s.hasOwnProperty(Ae)&&V!==void 0&&!i.hasOwnProperty(Ae)&&Wd(e,t,Ae,void 0,i,V);for(X in i)V=i[X],Y=s[X],!i.hasOwnProperty(X)||V===Y||V===void 0&&Y===void 0||Wd(e,t,X,V,i,Y);return}}for(var G in s)V=s[G],s.hasOwnProperty(G)&&V!=null&&!i.hasOwnProperty(G)&&Je(e,t,G,null,i,V);for(ne in i)V=i[ne],Y=s[ne],!i.hasOwnProperty(ne)||V===Y||V==null&&Y==null||Je(e,t,ne,V,i,Y)}function Gy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lj(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,p=u.initiatorType,w=u.duration;if(f&&w&&Gy(p)){for(p=0,w=u.responseEnd,i+=1;i<s.length;i++){var z=s[i],q=z.startTime;if(q>w)break;var X=z.transferSize,ne=z.initiatorType;X&&Gy(ne)&&(z=z.responseEnd,p+=X*(z<w?1:(w-q)/(z-q)))}if(--i,t+=8*(f+p)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var eh=null,th=null;function er(e){return e.nodeType===9?e:e.ownerDocument}function qy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Iy(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Qy(e,t,s,i){return s=er(s).createElement(e),s[xt]=i,s[Lt]=t,Ft(s,e,t),Tt(s),s}function nh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var sh=null;function $j(){var e=window.event;return e&&e.type==="popstate"?e===sh?!1:(sh=e,!0):(sh=null,!1)}var lh=typeof setTimeout=="function"?setTimeout:void 0,kj=typeof clearTimeout=="function"?clearTimeout:void 0,Yy=typeof Promise=="function"?Promise:void 0,Py=typeof requestAnimationFrame=="function"?requestAnimationFrame:lh,Hj=typeof queueMicrotask=="function"?queueMicrotask:typeof Yy<"u"?function(e){return Yy.resolve(null).then(e).catch(Uj)}:lh;function Uj(e){setTimeout(function(){throw e})}function bl(e){return e==="head"}function Xy(e,t){var s=t,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),Ti(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")dh(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,dh(s);for(var f=s.firstChild;f;){var p=f.nextSibling,w=f.nodeName;f[vo]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=p}}else s==="body"&&dh(e.ownerDocument.body);s=u}while(s);Ti(t)}function Ky(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function Zy(e,t,s){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,s!=null&&(e.style.viewTransitionClass=s),s=getComputedStyle(e),s.display==="inline"){if(t=e.getClientRects(),t.length===1)var i=1;else for(var u=i=0;u<t.length;u++){var f=t[u];0<f.width&&0<f.height&&i++}i===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+s.paddingTop,e.marginBottom="-"+s.paddingBottom)}}function Jy(e,t){e=e.style,t=t.style;var s=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(s=t.display,e.display=s==null||typeof s=="boolean"?"":s,s=t.margin,s!=null?e.margin=s:(s=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=s==null||typeof s=="boolean"?"":s,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Fj(e,t,s){return s=s.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=s.innerHeight&&e.left<=s.innerWidth}}function ah(e){var t=e.getBoundingClientRect(),s=getComputedStyle(e);return Fj(t,s,e)}function Vj(e){return e.documentElement.clientHeight}function Bj(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Gj(e,t,s,i,u,f,p,w,z){var q=t.nodeType===9?t:t.ownerDocument;try{var X=q.startViewTransition({update:function(){var V=q.defaultView,Y=V.navigation&&V.navigation.transition,fe=q.fonts.status;i();var ye=[];if(fe==="loaded"&&(Vj(q),q.fonts.status==="loading"&&ye.push(q.fonts.ready)),fe=ye.length,e!==null)for(var Ae=e.suspenseyImages,G=0,H=0;H<Ae.length;H++){var Q=Ae[H];if(!Q.complete){var ee=Q.getBoundingClientRect();if(0<ee.bottom&&0<ee.right&&ee.top<V.innerHeight&&ee.left<V.innerWidth){if(G+=xv(Q),G>iu){ye.length=fe;break}Q=new Promise(Bj.bind(Q)),ye.push(Q)}}}if(0<ye.length)return V=Promise.race([Promise.all(ye),new Promise(function(pe){return setTimeout(pe,500)})]).then(u,u),(Y?Promise.allSettled([Y.finished,V]):V).then(f,f);if(u(),Y)return Y.finished.then(f,f);f()},types:s});q.__reactViewTransition=X;var ne=[];return X.ready.then(function(){for(var V=q.documentElement.getAnimations({subtree:!0}),Y=0;Y<V.length;Y++){var fe=V[Y],ye=fe.effect,Ae=ye.pseudoElement;if(Ae!=null&&Ae.startsWith("::view-transition")){ne.push(fe),fe=ye.getKeyframes();for(var G=Ae=void 0,H=!0,Q=0;Q<fe.length;Q++){var ee=fe[Q],pe=ee.width;if(Ae===void 0)Ae=pe;else if(Ae!==pe){H=!1;break}if(pe=ee.height,G===void 0)G=pe;else if(G!==pe){H=!1;break}delete ee.width,delete ee.height,ee.transform==="none"&&delete ee.transform}H&&Ae!==void 0&&G!==void 0&&(ye.setKeyframes(fe),H=getComputedStyle(ye.target,ye.pseudoElement),H.width!==Ae||H.height!==G)&&(H=fe[0],H.width=Ae,H.height=G,H=fe[fe.length-1],H.width=Ae,H.height=G,ye.setKeyframes(fe))}}p()},function(V){q.__reactViewTransition===X&&(q.__reactViewTransition=null);try{if(typeof V=="object"&&V!==null)switch(V.name){case"InvalidStateError":(V.message==="View transition was skipped because document visibility state is hidden."||V.message==="Skipping view transition because document visibility state has become hidden."||V.message==="Skipping view transition because viewport size changed."||V.message==="Transition was aborted because of invalid state")&&(V=null)}V!==null&&z(V)}finally{i(),u(),p()}}),X.finished.finally(function(){for(var V=0;V<ne.length;V++)ne[V].cancel();q.__reactViewTransition===X&&(q.__reactViewTransition=null),w()}),X}catch{return i(),u(),p(),null}}function pa(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}pa.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:A({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},pa.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,s=e.getAnimations({subtree:!0}),i=[],u=0;u<s.length;u++){var f=s[u].effect;f!==null&&f.target===e&&f.pseudoElement===t&&i.push(s[u])}return i},pa.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wy(e){return{name:e,group:new pa("group",e),imagePair:new pa("image-pair",e),old:new pa("old",e),new:new pa("new",e)}}function On(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}On.prototype.addEventListener=function(e,t,s){var i=null,u=null;if(!(s!=null&&typeof s!="boolean"&&(i=s.signal||null,i!==null&&i.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var f=this._eventListeners;if(tv(f,e,t,s)===-1){var p=this,w=t;s!=null&&typeof s!="boolean"&&s.once===!0&&(w=function(z){p.removeEventListener(e,t,s),typeof t=="function"?t.call(this,z):t.handleEvent(z)}),i!==null&&(u=p.removeEventListener.bind(p,e,t,s),i.addEventListener("abort",u,{once:!0}),u=i.removeEventListener.bind(i,"abort",u)),i=ji(s),f.push({type:e,listener:t,optionsOrUseCapture:s,attachedListener:w,cleanup:u}),y(this._fragmentFiber.child,!1,qj,e,w,i)}this._eventListeners=f}};function qj(e,t,s,i){return T(e).addEventListener(t,s,i),!1}On.prototype.removeEventListener=function(e,t,s){var i=this._eventListeners;if(i!==null&&(t=tv(i,e,t,s),t!==-1)){var u=i[t];s=u.attachedListener;var f=u.cleanup;u=ji(u.optionsOrUseCapture),y(this._fragmentFiber.child,!1,Ij,e,s,u),i.splice(t,1),f!==null&&f()}};function Ij(e,t,s,i){return T(e).removeEventListener(t,s,i),!1}function ji(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function ev(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function tv(e,t,s,i){if(e.length===0)return-1;i=ev(i);for(var u=0;u<e.length;u++){var f=e[u];if(f.type===t&&f.listener===s&&ev(f.optionsOrUseCapture)===i)return u}return-1}On.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=T(t);var s=this._eventListeners;if(s!==null&&0<s.length||!e.bubbles){var i=t.nodeType===9?t.createComment(""):document.createTextNode("");if(s)for(var u=0;u<s.length;u++){var f=s[u];i.addEventListener(f.type,f.attachedListener,ji(f.optionsOrUseCapture))}if(t.appendChild(i),e=i.dispatchEvent(e),s)for(u=0;u<s.length;u++)f=s[u],i.removeEventListener(f.type,f.attachedListener,ji(f.optionsOrUseCapture));return t.removeChild(i),e}return t.dispatchEvent(e)},On.prototype.focus=function(e){y(this._fragmentFiber.child,!0,nv,e,void 0,void 0)};function nv(e,t){return e.tag===6?!1:(e=T(e),s2(e,t))}On.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,ih,t,void 0,void 0);for(var s=t.length-1;0<=s&&!nv(t[s],e);s--);};function ih(e,t){return t.push(e),!1}On.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=T(e),e=er(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,Qj,e,void 0,void 0))};function Qj(e,t){return e.tag===6?!1:(e=T(e),e===t||e.contains(t)?(t.blur(),!0):!1)}On.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,Yj,e,void 0,void 0)};function Yj(e,t){return e.tag===6||(e=T(e),t.observe(e)),!1}On.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,Pj,e,void 0,void 0);for(var s=t=0;s<ns.length;s++){var i=ns[s];i.fragmentInstance===this&&i.observer===e?e.unobserve(i.instance):ns[t++]=i}ns.length=t}};function Pj(e,t){return e.tag===6||(e=T(e),t.unobserve(e)),!1}var ns=[],oh=!1;function Xj(e,t,s){ns.push({fragmentInstance:e,observer:t,instance:s}),oh||(oh=!0,l2(function(){oh=!1;var i=ns;ns=[];for(var u=0;u<i.length;u++){var f=i[u];f.observer.unobserve(f.instance)}}))}On.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,Kj,e,void 0,void 0),e};function Kj(e,t){if(e.tag===6){e=e.stateNode;var s=e.ownerDocument.createRange();s.selectNodeContents(e),t.push.apply(t,s.getClientRects())}else e=T(e),t.push.apply(t,e.getClientRects());return!1}On.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:T(t).getRootNode(e)},On.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];y(this._fragmentFiber.child,!1,ih,s,void 0,void 0);var i=T(t);if(s.length===0){if(s=i,j(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(s=t)}t=this._fragmentFiber;var u=i=s.compareDocumentPosition(e);return s===e?u=Node.DOCUMENT_POSITION_CONTAINS:i&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=b(t)[1],s===null?u=Node.DOCUMENT_POSITION_PRECEDING:(e=T(s).compareDocumentPosition(e),u=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),u|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=T(s[0]),u=T(s[s.length-1]);var f=j(this._fragmentFiber)?t.parentElement:i;if(f==null)return Node.DOCUMENT_POSITION_DISCONNECTED;i=f.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,f=f.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY;var p=t.compareDocumentPosition(e),w=u.compareDocumentPosition(e),z=p&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=i&&f&&p&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=i&&t===e||f&&u===e||z||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!i&&t===e||!f&&u===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:p,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Zj(t,this._fragmentFiber,s[0],s[s.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zj(e,t,s,i,u){var f=Xl(u);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!f)e:{for(;f!==null;){if(f.tag===7&&(f===t||f.alternate===t)){s=!0;break e}f=f.return}s=!1}return s}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(f===null)return f=u.ownerDocument,u===f||u===f.documentElement||u===f.body;e:{for(f=t,t=S(t);f!==null;){if(!(f.tag!==5&&f.tag!==3&&f.tag!==27||f!==t&&f.alternate!==t)){f=!0;break e}f=f.return}f=!1}return f}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!f)&&!(t=f===s)&&(t=R(s,f,E),t===null?t=!1:(y(t,!0,D,f,s),f=O,O=null,t=f!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!f)&&!(t=f===i)&&(t=R(i,f,E),t===null?t=!1:(y(t,!0,C,f,i),f=O,_=O=null,t=f!==null)),t):!1}function sv(e,t){var s=e.ownerDocument.createRange();s.selectNodeContents(e),e=s.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}On.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(o(566));var t=[];y(this._fragmentFiber.child,!1,ih,t,void 0,void 0);var s=e!==!1;if(t.length===0){var i=b(this._fragmentFiber);if(i=s?i[1]||i[0]||S(this._fragmentFiber):i[0]||i[1],i===null)return;if(i.tag===6){e=T(i),sv(e,s);return}if(i=T(i),i.nodeType!==9){if(i.nodeType===11){s="host"in i?i.host:null,s!==null&&s.scrollIntoView(e);return}i.scrollIntoView(e)}}for(i=s?t.length-1:0;i!==(s?-1:t.length);){var u=t[i];u.tag===6?(u=T(u),sv(u,s)):T(u).scrollIntoView(e),i+=s?-1:1}};function Jj(e,t){return e=T(e),lv(e,t),!1}function lv(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function av(e,t){var s=t._eventListeners;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i];e.addEventListener(u.type,u.attachedListener,ji(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(f){for(var p=0,w=0;w<ns.length;w++){var z=ns[w];(z.fragmentInstance!==t||z.observer!==f||z.instance!==e)&&(ns[p++]=z)}ns.length=p,f.observe(e)}),lv(e,t))}function Wj(e,t){var s=t._eventListeners;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i];e.removeEventListener(u.type,u.attachedListener,ji(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(f){typeof f.rootMargin=="string"?Xj(t,f,e):f.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":rh(s),Pr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function e2(e,t,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[vo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=qn(e.nextSibling),e===null)break}return null}function t2(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=qn(e.nextSibling),e===null))return null;return e}function iv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function ch(e){return e.data==="$?"||e.data==="$~"}function uh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function n2(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function qn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var fh=null;function ov(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return qn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function rv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function s2(e,t){function s(){i=!0}if(e.ownerDocument.activeElement===e)return!0;var i=!1;try{e.ownerDocument.addEventListener("focus",s,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",s,!0)}return i}function l2(e){Py(function(){Py(function(t){return e(t)})})}function cv(e,t,s){switch(t=er(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function uv(e,t,s){for(var i in s){var u=s[i];s.hasOwnProperty(i)&&u!=null&&Je(e,t,i,null,zj,u)}s.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===us&&(e.onclick=null),Pr(e)}function dh(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Pr(e)}var In=new Map,fv=new Set;function tr(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Bs=Se.d;Se.d={f:a2,r:i2,D:o2,C:r2,L:c2,m:u2,X:d2,S:f2,M:h2};function a2(){var e=Bs.f(),t=Zc();return e||t}function i2(e){var t=Va(e);t!==null&&t.tag===5&&t.type==="form"?h0(t):Bs.r(e)}var wi=typeof document>"u"?null:document;function dv(e,t,s){var i=wi;if(i&&typeof t=="string"&&t){var u=kn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),fv.has(u)||(fv.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),Ft(t,"link",e),Tt(t),i.head.appendChild(t)))}}function o2(e){Bs.D(e),dv("dns-prefetch",e,null)}function r2(e,t){Bs.C(e,t),dv("preconnect",e,t)}function c2(e,t,s){Bs.L(e,t,s);var i=wi;if(i&&e&&t){var u='link[rel="preload"][as="'+kn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+kn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+kn(s.imageSizes)+'"]')):u+='[href="'+kn(e)+'"]';var f=u;switch(t){case"style":f=Ni(e);break;case"script":f=Ci(e)}if(!(In.has(f)||(e=A({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),In.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(nr(f))||t==="script"&&i.querySelector(sr(f))))){var p=i.createElement("link");Ft(p,"link",e),t==="style"&&(p[Yr]=!0,p.onload=p.onerror=function(){Cg(p)}),Tt(p),i.head.appendChild(p)}}}function u2(e,t){Bs.m(e,t);var s=wi;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+kn(i)+'"][href="'+kn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Ci(e)}if(!In.has(f)&&(e=A({rel:"modulepreload",href:e},t),In.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(sr(f)))return}i=s.createElement("link"),Ft(i,"link",e),Tt(i),s.head.appendChild(i)}}}function f2(e,t,s){Bs.S(e,t,s);var i=wi;if(i&&e){var u=Ba(i).hoistableStyles,f=Ni(e);t=t||"default";var p=u.get(f);if(!p){var w={loading:0,preload:null};if(p=i.querySelector(nr(f)))w.loading=5;else{e=A({rel:"stylesheet",href:e,"data-precedence":t},s),(s=In.get(f))&&hh(e,s);var z=p=i.createElement("link");Tt(z),Ft(z,"link",e),z._p=new Promise(function(q,X){z.onload=q,z.onerror=X}),z.addEventListener("load",function(){w.loading|=1}),z.addEventListener("error",function(){w.loading|=2}),w.loading|=4,lu(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:w},u.set(f,p)}}}function d2(e,t){Bs.X(e,t);var s=wi;if(s&&e){var i=Ba(s).hoistableScripts,u=Ci(e),f=i.get(u);f||(f=s.querySelector(sr(u)),f||(e=A({src:e,async:!0},t),(t=In.get(u))&&mh(e,t),f=s.createElement("script"),Tt(f),Ft(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function h2(e,t){Bs.M(e,t);var s=wi;if(s&&e){var i=Ba(s).hoistableScripts,u=Ci(e),f=i.get(u);f||(f=s.querySelector(sr(u)),f||(e=A({src:e,async:!0,type:"module"},t),(t=In.get(u))&&mh(e,t),f=s.createElement("script"),Tt(f),Ft(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function hv(e,t,s,i){var u=(u=en.current)?tr(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=Ni(s.href),t=Ba(u).hoistableStyles,i=t.get(s),i||(i={type:"style",instance:null,count:0,state:null},t.set(s,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ni(s.href);var f=Ba(u).hoistableStyles,p=f.get(e);if(p||(u=u.ownerDocument||u,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,p),(f=u.querySelector(nr(e)))?f._p||(p.instance=f,p.state.loading=5):(f=In.get(e),f||(f={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},In.set(e,f)),m2(u,e,f,p.state))),t&&i===null)throw Error(o(528,""));return p}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(s=Ci(s),t=Ba(u).hoistableScripts,i=t.get(s),i||(i={type:"script",instance:null,count:0,state:null},t.set(s,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ni(e){return'href="'+kn(e)+'"'}function nr(e){return'link[rel="stylesheet"]['+e+"]"}function mv(e){return A({},e,{"data-precedence":e.precedence,precedence:null})}function m2(e,t,s,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Yr]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[Yr]=!0,t.onload=t.onerror=Cg.bind(null,t),Ft(t,"link",s),Tt(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function Ci(e){return'[src="'+kn(e)+'"]'}function sr(e){return"script[async]"+e}function gv(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+kn(s.href)+'"]');if(i)return t.instance=i,Tt(i),i;var u=A({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Tt(i),Ft(i,"style",u),lu(i,s.precedence,e),t.instance=i;case"stylesheet":u=Ni(s.href);var f=e.querySelector(nr(u));if(f)return t.state.loading|=4,t.instance=f,Tt(f),f;i=mv(s),(u=In.get(u))&&hh(i,u),f=(e.ownerDocument||e).createElement("link"),Tt(f);var p=f;return p._p=new Promise(function(w,z){p.onload=w,p.onerror=z}),Ft(f,"link",i),t.state.loading|=4,lu(f,s.precedence,e),t.instance=f;case"script":return f=Ci(s.src),(u=e.querySelector(sr(f)))?(t.instance=u,Tt(u),u):(i=s,(u=In.get(f))&&(i=A({},s),mh(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Tt(u),Ft(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,lu(i,s.precedence,e));return t.instance}function lu(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,p=0;p<i.length;p++){var w=i[p];if(w.dataset.precedence===t)f=w;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function hh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function mh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var au=null;function pv(e,t,s){if(au===null){var i=new Map,u=au=new Map;u.set(s,i)}else u=au,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[vo]||f[xt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var p=f.getAttribute(t)||"";p=e+p;var w=i.get(p);w?w.push(f):i.set(p,[f])}}return i}function gh(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function g2(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function yv(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function vv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function xv(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Sv(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=xv(t),e.suspenseyImages.push(t)),e=v2.bind(e),t.decode().then(e,e))}function p2(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Ni(i.href),f=t.querySelector(nr(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=lr.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,Tt(f);return}f=t.ownerDocument||t,i=mv(i),(u=In.get(u))&&hh(i,u),f=f.createElement("link"),Tt(f);var p=f;p._p=new Promise(function(w,z){p.onload=w,p.onerror=z}),Ft(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=lr.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var iu=0;function y2(e,t){return e.stylesheets&&e.count===0&&ru(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&ru(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&iu===0&&(iu=62500*Lj());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ru(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>iu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function bv(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ru(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lr(){this.count--,bv(this)}function v2(){this.imgCount--,bv(this)}var ou=null;function ru(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ou=new Map,t.forEach(x2,e),ou=null,lr.call(e))}function x2(e,t){if(!(t.state.loading&4)){var s=ou.get(e);if(s)var i=s.get(null);else{s=new Map,ou.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var p=u[f];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(s.set(p.dataset.precedence,p),i=p)}i&&s.set(null,i)}u=t.instance,p=u.getAttribute("data-precedence"),f=s.get(p)||i,f===i&&s.set(null,u),s.set(p,u),this.count++,i=lr.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Mi={$$typeof:le,Provider:null,Consumer:null,_currentValue:ct,_currentValue2:ct,_threadCount:0};function S2(e,t,s,i,u,f,p,w,z){this.tag=1,this.containerInfo=e,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=Ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ha(0),this.hiddenUpdates=Ha(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.transitionTypes=null,this.incompleteTransitions=new Map}function jv(e,t,s,i,u,f,p,w,z,q,X,ne){return e=new S2(e,t,s,p,z,q,X,ne,w),t=1,f===!0&&(t|=24),f=mn(3,null,null,t),e.current=f,f.stateNode=e,t=Rf(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},Df(f),e}function wv(e){return e?(e=Ja,e):Ja}function Nv(e,t,s,i,u,f){u=wv(u),i.context===null?i.context=u:i.pendingContext=u,i=cl(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=ul(e,i,t),s!==null&&(vn(s,e,t),Lo(s,e,t))}function Cv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function ph(e,t){Cv(e,t),(e=e.alternate)&&Cv(e,t)}function Mv(e){if(e.tag===13||e.tag===31){var t=Wl(e,67108864);t!==null&&vn(t,e,67108864),ph(e,67108864)}}function Ev(e){if(e.tag===13||e.tag===31){var t=An();t=go(t);var s=Wl(e,t);s!==null&&vn(s,e,t),ph(e,t)}}var Ei=!0;function b2(e,t,s,i){var u=me.T;me.T=null;var f=Se.p;try{Se.p=2,yh(e,t,s,i)}finally{Se.p=f,me.T=u}}function j2(e,t,s,i){var u=me.T;me.T=null;var f=Se.p;try{Se.p=8,yh(e,t,s,i)}finally{Se.p=f,me.T=u}}function yh(e,t,s,i){if(Ei){var u=vh(i);if(u===null)Jd(e,t,i,cu,s),_v(e,i);else if(N2(u,e,t,s,i))i.stopPropagation();else if(_v(e,i),t&4&&-1<w2.indexOf(e)){for(;u!==null;){var f=Va(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var p=cs(f.pendingLanes);if(p!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;p;){var z=1<<31-Yt(p);w.entanglements[1]|=z,p&=~z}Ss(f),(Qe&6)===0&&(Pc=et()+500,Zo(0))}}break;case 31:case 13:w=Wl(f,2),w!==null&&vn(w,f,2),Zc(),ph(f,2)}if(f=vh(i),f===null&&Jd(e,t,i,cu,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else Jd(e,t,i,null,s)}}function vh(e){return e=nf(e),xh(e)}var cu=null;function xh(e){if(cu=null,e=Xl(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return cu=e,null}function Tv(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(hn()){case Nn:return 2;case ql:return 8;case ka:case fo:return 32;case tn:return 268435456;default:return 32}default:return 32}}var Sh=!1,jl=null,wl=null,Nl=null,ar=new Map,ir=new Map,Cl=[],w2="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 _v(e,t){switch(e){case"focusin":case"focusout":jl=null;break;case"dragenter":case"dragleave":wl=null;break;case"mouseover":case"mouseout":Nl=null;break;case"pointerover":case"pointerout":ar.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ir.delete(t.pointerId)}}function or(e,t,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Va(t),t!==null&&Mv(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function N2(e,t,s,i,u){switch(t){case"focusin":return jl=or(jl,e,t,s,i,u),!0;case"dragenter":return wl=or(wl,e,t,s,i,u),!0;case"mouseover":return Nl=or(Nl,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return ar.set(f,or(ar.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,ir.set(f,or(ir.get(f)||null,e,t,s,i,u)),!0}return!1}function Rv(e){var t=Xl(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,Kn(e.priority,function(){Ev(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,Kn(e.priority,function(){Ev(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function uu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=vh(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);tf=i,s.target.dispatchEvent(i),tf=null}else return t=Va(s),t!==null&&Mv(t),e.blockedOn=s,!1;t.shift()}return!0}function Av(e,t,s){uu(e)&&s.delete(t)}function C2(){Sh=!1,jl!==null&&uu(jl)&&(jl=null),wl!==null&&uu(wl)&&(wl=null),Nl!==null&&uu(Nl)&&(Nl=null),ar.forEach(Av),ir.forEach(Av)}function fu(e,t){e.blockedOn===t&&(e.blockedOn=null,Sh||(Sh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,C2)))}var du=null;function Ov(e){du!==e&&(du=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){du===e&&(du=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(xh(i||s)===null)continue;break}var f=Va(s);f!==null&&(e.splice(t,3),t-=3,td(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function Ti(e){function t(z){return fu(z,e)}jl!==null&&fu(jl,e),wl!==null&&fu(wl,e),Nl!==null&&fu(Nl,e),ar.forEach(t),ir.forEach(t);for(var s=0;s<Cl.length;s++){var i=Cl[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Cl.length&&(s=Cl[0],s.blockedOn===null);)Rv(s),s.blockedOn===null&&Cl.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],p=u[Lt]||null;if(typeof f=="function")p||Ov(s);else if(p){var w=null;if(f&&f.hasAttribute("formAction")){if(u=f,p=f[Lt]||null)w=p.formAction;else if(xh(u)!==null)continue}else w=p.action;typeof w=="function"?s[i+1]=w:(s.splice(i,3),i-=3),Ov(s)}}}function zv(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(p){return u=p})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function bh(e){this._internalRoot=e}hu.prototype.render=bh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,i=An();Nv(s,i,e,t,null,null)},hu.prototype.unmount=bh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nv(e.current,2,null,e,null,null),Zc(),t[el]=null}};function hu(e){this._internalRoot=e}hu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Fa();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Cl.length&&t!==0&&t<Cl[s].priority;s++);Cl.splice(s,0,e),s===0&&Rv(e)}};var Dv=l.version;if(Dv!=="19.3.1")throw Error(o(527,Dv,"19.3.1"));Se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var M2={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mu.isDisabled&&mu.supportsFiber)try{Zs=mu.inject(M2),Qt=mu}catch{}}return cr.createRoot=function(e,t){if(!c(e))throw Error(o(299));var s=!1,i="",u=w0,f=N0,p=C0;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=jv(e,1,!1,null,null,s,i,null,u,f,p,zv),e[el]=t.current,Zd(e),new bh(t)},cr.hydrateRoot=function(e,t,s){if(!c(e))throw Error(o(299));var i=!1,u="",f=w0,p=N0,w=C0,z=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError),s.formState!==void 0&&(z=s.formState)),t=jv(e,1,!0,t,s??null,i,u,z,f,p,w,zv),t.context=wv(null),s=t.current,i=An(),i=go(i),u=cl(i),u.callback=null,ul(s,u,i),s=i,t.current.lanes=s,Ws(t,s),Ss(t),e[el]=t.current,Zd(e),new hu(t)},cr.version="19.3.1",cr}var Iv;function U2(){if(Iv)return Ch.exports;Iv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Ch.exports=H2(),Ch.exports}var F2=U2();const h1=M.createContext(void 0),m1=n=>{const l=M.useContext(h1);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},V2=({client:n,children:l})=>(M.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),r.jsx(h1.Provider,{value:n,children:l})),B2={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)};var Al,tg,n1,G2=(n1=class{constructor(){Ne(this,Al,B2);Ne(this,tg,!1)}setTimeoutProvider(n){he(this,Al,n)}setTimeout(n,l){return F(this,Al).setTimeout(n,l)}clearTimeout(n){F(this,Al).clearTimeout(n)}setInterval(n,l){return F(this,Al).setInterval(n,l)}clearInterval(n){F(this,Al).clearInterval(n)}},Al=new WeakMap,tg=new WeakMap,n1);const ja=new G2;function q2(n){setTimeout(n,0)}const I2=typeof window>"u"||"Deno"in globalThis;function Sn(){}function Q2(n,l){return typeof n=="function"?n(l):n}function g1(n){return typeof n=="number"&&n>=0&&n!==1/0}function p1(n,l){return Math.max(n+(l||0)-Date.now(),0)}function rt(n,l){return typeof n=="function"?n(l):n}function Qv(n,l){const{type:a="all",exact:o,fetchStatus:c,predicate:d,queryKey:h,stale:m}=n;if(h){if(o){if(l.queryHash!==sg(h,l.options))return!1}else if(!oo(l.queryKey,h))return!1}if(a!=="all"){const g=l.isActive();if(a==="active"&&!g||a==="inactive"&&g)return!1}return!(typeof m=="boolean"&&l.isStale()!==m||c&&c!==l.state.fetchStatus||d&&!d(l))}function Yv(n,l){const{exact:a,status:o,predicate:c,mutationKey:d}=n;if(d){if(!l.options.mutationKey)return!1;if(a){if(Er(l.options.mutationKey)!==Er(d))return!1}else if(!oo(l.options.mutationKey,d))return!1}return!(o&&l.state.status!==o||c&&!c(l))}function sg(n,l){return((l==null?void 0:l.queryKeyHashFn)||Er)(n)}function Er(n){return JSON.stringify(n,(l,a)=>vm(a)?Object.keys(a).sort().reduce((o,c)=>(o[c]=a[c],o),{}):a)}function oo(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(n&&l&&typeof n=="object"&&typeof l=="object"){if(Array.isArray(n)&&Array.isArray(l)){if(l.length>n.length)return!1;for(let o=0;o<l.length;o++)if(!oo(n[o],l[o]))return!1;return!0}const a=Object.keys(l);for(const o of a)if(!oo(n[o],l[o]))return!1;return!0}return!1}const Y2=Object.prototype.hasOwnProperty;function y1(n,l,a=0){if(n===l)return n;if(a>500)return l;const o=Pv(n)&&Pv(l);if(!o&&!(vm(n)&&vm(l)))return l;const c=(o?n:Object.keys(n)).length,d=o?l:Object.keys(l),h=d.length,m=o?new Array(h):{};let g=0;for(let x=0;x<h;x++){const v=o?x:d[x],y=n[v],S=l[v];if(y===S){m[v]=y,(o?x<c:Y2.call(n,v))&&g++;continue}if(y===null||S===null||typeof y!="object"||typeof S!="object"){m[v]=S;continue}const j=y1(y,S,a+1);m[v]=j,j===y&&g++}return c===h&&g===c?n:m}function _h(n,l){if(!l||Object.keys(n).length!==Object.keys(l).length)return!1;for(const a in n)if(n[a]!==l[a])return!1;return!0}function Pv(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function vm(n){if(!Xv(n))return!1;const l=Object.getPrototypeOf(n),a=l==null?void 0:l.constructor;if(a===void 0)return!0;if(typeof a!="function")return!1;const o=a.prototype;return!(!Xv(o)||!o.hasOwnProperty("isPrototypeOf")||l!==Object.prototype)}function Xv(n){return Object.prototype.toString.call(n)==="[object Object]"}function P2(n){return new Promise(l=>{ja.setTimeout(l,n)})}function xm(n,l,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,l):a.structuralSharing!==!1?y1(n,l):l}function lg(n){return n}function X2(n,l,a=0){const o=[...n,l];return a&&o.length>a?o.slice(1):o}function K2(n,l,a=0){const o=[l,...n];return a&&o.length>a?o.slice(0,-1):o}const ag=Symbol();function v1(n,l){return!n.queryFn&&(l!=null&&l.initialPromise)?()=>l.initialPromise:!n.queryFn||n.queryFn===ag?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function x1(n,l){return typeof n=="function"?n(...l):!!n}function Z2(n,l,a){let o=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??(c=l()),o||(o=!0,c.aborted?a():c.addEventListener("abort",a,{once:!0})),c)}),n}let J2=()=>I2;const ig=()=>J2();var Hr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Na,Ol,Pi,s1,W2=(s1=class extends Hr{constructor(){super();Ne(this,Na);Ne(this,Ol);Ne(this,Pi);he(this,Pi,l=>{if(typeof window<"u"&&window.addEventListener){const a=()=>l();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){F(this,Ol)||this.setEventListener(F(this,Pi))}onUnsubscribe(){var l;this.hasListeners()||((l=F(this,Ol))==null||l.call(this),he(this,Ol,void 0))}setEventListener(l){var a;he(this,Pi,l),(a=F(this,Ol))==null||a.call(this),he(this,Ol,l(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(l){F(this,Na)!==l&&(he(this,Na,l),this.onFocus())}onFocus(){const l=this.isFocused();this.listeners.forEach(a=>{a(l)})}isFocused(){var l;return typeof F(this,Na)=="boolean"?F(this,Na):((l=globalThis.document)==null?void 0:l.visibilityState)!=="hidden"}},Na=new WeakMap,Ol=new WeakMap,Pi=new WeakMap,s1);const og=new W2,ew=q2;function tw(){let n=[],l=0,a=m=>{m()},o=m=>{m()},c=ew;const d=m=>{l?n.push(m):c(()=>{a(m)})},h=()=>{const m=n;n=[],m.length&&c(()=>{o(()=>{m.forEach(g=>{a(g)})})})};return{batch:m=>{let g;l++;try{g=m()}finally{l--,l||h()}return g},batchCalls:m=>(...g)=>{d(()=>{m(...g)})},schedule:d,setNotifyFunction:m=>{a=m},setBatchNotifyFunction:m=>{o=m},setScheduler:m=>{c=m}}}const Bt=tw();var Xi,zl,Ki,l1,nw=(l1=class extends Hr{constructor(){super();Ne(this,Xi,!0);Ne(this,zl);Ne(this,Ki);he(this,Ki,l=>{if(typeof window<"u"&&window.addEventListener){const a=()=>l(!0),o=()=>l(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",o)}}})}onSubscribe(){F(this,zl)||this.setEventListener(F(this,Ki))}onUnsubscribe(){var l;this.hasListeners()||((l=F(this,zl))==null||l.call(this),he(this,zl,void 0))}setEventListener(l){var a;he(this,Ki,l),(a=F(this,zl))==null||a.call(this),he(this,zl,l(this.setOnline.bind(this)))}setOnline(l){F(this,Xi)!==l&&(he(this,Xi,l),this.listeners.forEach(a=>{a(l)}))}isOnline(){return F(this,Xi)}},Xi=new WeakMap,zl=new WeakMap,Ki=new WeakMap,l1);const Eu=new nw;function sw(n){return Math.min(1e3*2**n,3e4)}function S1(n){return(n??"online")==="online"?Eu.isOnline():!0}var Sm=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function b1(n){let l=!1,a=0,o,c="pending",d,h;const m=new Promise((_,D)=>{d=_,h=D});m.catch(Sn);const g=()=>c!=="pending",x=_=>{var D;if(!g()){const C=new Sm(_);N(C),(D=n.onCancel)==null||D.call(n,C)}},v=()=>{l=!0},y=()=>{l=!1},S=()=>og.isFocused()&&(n.networkMode==="always"||Eu.isOnline())&&n.canRun(),j=()=>S1(n.networkMode)&&n.canRun(),b=_=>{g()||(o==null||o(),c="resolved",d(_))},N=_=>{g()||(o==null||o(),c="rejected",h(_))},T=_=>new Promise(D=>{var C;o=E=>{(g()||_())&&D(E)},(C=n.onPause)==null||C.call(n)}).then(()=>{var D;o=void 0,g()||(D=n.onContinue)==null||D.call(n)}),O=()=>{if(g())return;let _;const D=a===0?n.initialPromise:void 0;try{_=D??n.fn()}catch(C){_=Promise.reject(C)}Promise.resolve(_).then(b).catch(C=>{var K;if(g())return;const E=n.retry??(ig()?0:3),R=n.retryDelay??sw,A=typeof R=="function"?R(a,C):R,B=E===!0||typeof E=="number"&&a<E||typeof E=="function"&&E(a,C);if(l||!B){N(C);return}a++,(K=n.onFail)==null||K.call(n,a,C),P2(A).then(()=>S()?void 0:T(S)).then(()=>{l?N(C):O()})})};return{promise:m,status:()=>c,cancel:x,continue:()=>(o==null||o(),m),cancelRetry:v,continueRetry:y,canStart:j,start:()=>(j()?O():T(j).then(O),m)}}var Ca,a1,j1=(a1=class{constructor(){Ne(this,Ca)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),g1(this.gcTime)&&he(this,Ca,ja.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(ig()?1/0:3e5))}clearGcTimeout(){F(this,Ca)!==void 0&&(ja.clearTimeout(F(this,Ca)),he(this,Ca,void 0))}},Ca=new WeakMap,a1);function lw(n){return{onFetch:(l,a)=>{var v,y,S,j,b;const o=l.options,c=(S=(y=(v=l.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:S.direction,d=((j=l.state.data)==null?void 0:j.pages)||[],h=((b=l.state.data)==null?void 0:b.pageParams)||[];let m={pages:[],pageParams:[]},g=0;const x=async()=>{let N=!1;const T=D=>{Z2(D,()=>l.signal,()=>N=!0)},O=v1(l.options,l.fetchOptions),_=async(D,C,E)=>{if(N)return Promise.reject(l.signal.reason);if(C==null&&D.pages.length)return Promise.resolve(D);const A=(()=>{const ie={client:l.client,queryKey:l.queryKey,pageParam:C,direction:E?"backward":"forward",meta:l.options.meta};return T(ie),ie})(),B=await O(A),{maxPages:K}=l.options,k=E?K2:X2;return{pages:k(D.pages,B,K),pageParams:k(D.pageParams,C,K)}};if(c&&d.length){const D=c==="backward",C=D?w1:bm,E={pages:d,pageParams:h};m=await _(E,C(o,E),D)}else{const D=n??d.length;do{const C=g===0?h[0]===void 0?o.initialPageParam:h[0]:bm(o,m);if(g>0&&C==null)break;m=await _(m,C),g++}while(g<D)}return m};l.options.persister?l.fetchFn=()=>{var N,T;return(T=(N=l.options).persister)==null?void 0:T.call(N,x,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},a)}:l.fetchFn=x}}}function bm(n,{pages:l,pageParams:a}){const o=l.length-1;return l.length>0?n.getNextPageParam(l[o],l,a[o],a):void 0}function w1(n,{pages:l,pageParams:a}){var o;return l.length>0?(o=n.getPreviousPageParam)==null?void 0:o.call(n,l[0],l,a[0],a):void 0}function aw(n,l){return l?bm(n,l)!=null:!1}function iw(n,l){return!l||!n.getPreviousPageParam?!1:w1(n,l)!=null}var Zi,Ma,Ji,Qn,Ea,Et,zr,Ta,ss,Qs,i1,ow=(i1=class extends j1{constructor(l){super();Ne(this,ss);Ne(this,Zi);Ne(this,Ma);Ne(this,Ji);Ne(this,Qn);Ne(this,Ea);Ne(this,Et);Ne(this,zr);Ne(this,Ta);he(this,Ta,!1),he(this,zr,l.defaultOptions),this.setOptions(l.options),this.observers=[],he(this,Ea,l.client),he(this,Qn,F(this,Ea).getQueryCache()),this.queryKey=l.queryKey,this.queryHash=l.queryHash,he(this,Ma,Zv(this.options)),this.state=l.state??F(this,Ma),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,Zi)}get promise(){var l;return(l=F(this,Et))==null?void 0:l.promise}setOptions(l){if(this.options={...F(this,zr),...l},l!=null&&l._type&&he(this,Zi,l._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=Zv(this.options);a.data!==void 0&&(this.setState(Kv(a.data,a.dataUpdatedAt)),he(this,Ma,a))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,Qn).remove(this)}setData(l,a){const o=xm(this.state.data,l,this.options);return ke(this,ss,Qs).call(this,{data:o,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),o}setState(l){ke(this,ss,Qs).call(this,{type:"setState",state:l})}cancel(l){var o,c;const a=(o=F(this,Et))==null?void 0:o.promise;return(c=F(this,Et))==null||c.cancel(l),a?a.then(Sn).catch(Sn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,Ma)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(l=>rt(l.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ag||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(l=>rt(l.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(l=>l.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(l=0){return this.state.data===void 0?!0:l==="static"?!1:this.state.isInvalidated?!0:!p1(this.state.dataUpdatedAt,l)}onFocus(){var l,a;(l=this.observers.find(o=>o.shouldFetchOnWindowFocus()))==null||l.refetch({cancelRefetch:!1}),(a=F(this,Et))==null||a.continue()}onOnline(){var l,a;(l=this.observers.find(o=>o.shouldFetchOnReconnect()))==null||l.refetch({cancelRefetch:!1}),(a=F(this,Et))==null||a.continue()}addObserver(l){this.observers.includes(l)||(this.observers.push(l),this.clearGcTimeout(),F(this,Qn).notify({type:"observerAdded",query:this,observer:l}))}removeObserver(l){const a=this.observers.indexOf(l);a!==-1&&(this.observers.splice(a,1),this.observers.length||(F(this,Et)&&(F(this,Ta)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?F(this,Et).cancel({revert:!0}):F(this,Et).cancelRetry()),this.scheduleGc()),F(this,Qn).notify({type:"observerRemoved",query:this,observer:l}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ke(this,ss,Qs).call(this,{type:"invalidate"})}async fetch(l,a){var x,v,y,S,j,b,N,T,O,_,D,C;if(this.state.fetchStatus!=="idle"&&((x=F(this,Et))==null?void 0:x.status())!=="rejected"){if(this.state.data!==void 0&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(F(this,Et))return F(this,Et).continueRetry(),F(this,Et).promise}if(l&&this.setOptions(l),!this.options.queryFn){const E=this.observers.find(R=>R.options.queryFn);E&&this.setOptions(E.options)}const o=new AbortController,c=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(he(this,Ta,!0),o.signal)})},d=()=>{const E=v1(this.options,a),A=(()=>{const B={client:F(this,Ea),queryKey:this.queryKey,meta:this.meta};return c(B),B})();return he(this,Ta,!1),this.options.persister?this.options.persister(E,A,this):E(A)},m=(()=>{const E={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:F(this,Ea),state:this.state,fetchFn:d};return c(E),E})();(v=F(this,Zi)==="infinite"?lw(this.options.pages):this.options.behavior)==null||v.onFetch(m,this),he(this,Ji,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((y=m.fetchOptions)==null?void 0:y.meta))&&ke(this,ss,Qs).call(this,{type:"fetch",meta:(S=m.fetchOptions)==null?void 0:S.meta});const g=he(this,Et,b1({initialPromise:a==null?void 0:a.initialPromise,fn:m.fetchFn,onCancel:E=>{E instanceof Sm&&E.revert&&this.setState({...F(this,Ji),fetchStatus:"idle"}),o.abort()},onFail:(E,R)=>{ke(this,ss,Qs).call(this,{type:"failed",failureCount:E,error:R})},onPause:()=>{ke(this,ss,Qs).call(this,{type:"pause"})},onContinue:()=>{ke(this,ss,Qs).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const E=await g.start();if(E===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(E),(b=(j=F(this,Qn).config).onSuccess)==null||b.call(j,E,this),(T=(N=F(this,Qn).config).onSettled)==null||T.call(N,E,this.state.error,this),E}catch(E){if(E instanceof Sm){if(E.silent)return F(this,Et).promise;if(E.revert){if(this.state.data===void 0)throw E;return this.state.data}}throw ke(this,ss,Qs).call(this,{type:"error",error:E}),(_=(O=F(this,Qn).config).onError)==null||_.call(O,E,this),(C=(D=F(this,Qn).config).onSettled)==null||C.call(D,this.state.data,E,this),E}finally{F(this,Et)===g&&he(this,Et,void 0),this.scheduleGc()}}},Zi=new WeakMap,Ma=new WeakMap,Ji=new WeakMap,Qn=new WeakMap,Ea=new WeakMap,Et=new WeakMap,zr=new WeakMap,Ta=new WeakMap,ss=new WeakSet,Qs=function(l){const a=o=>{switch(l.type){case"failed":return{...o,fetchFailureCount:l.failureCount,fetchFailureReason:l.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...N1(o.data,this.options),fetchMeta:l.meta??null};case"success":const c={...o,...Kv(l.data,l.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!l.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return he(this,Ji,l.manual?c:void 0),c;case"error":const d=l.error;return{...o,error:d,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...l.state}}};this.state=a(this.state),Bt.batch(()=>{this.observers.slice().forEach(o=>{o.onQueryUpdate()}),F(this,Qn).notify({query:this,type:"updated",action:l})})},i1);function N1(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:S1(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function Kv(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Zv(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,a=l!==void 0,o=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:a?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var cn,Fe,Dr,un,_a,Wi,Xs,Lr,eo,to,Ra,Aa,Dl,no,Ye,br,jm,wm,Nm,Cm,Mm,Em,Tm,_m,o1,C1=(o1=class extends Hr{constructor(l,a){super();Ne(this,Ye);Ne(this,cn);Ne(this,Fe);Ne(this,Dr);Ne(this,un);Ne(this,_a);Ne(this,Wi);Ne(this,Xs);Ne(this,Lr);Ne(this,eo);Ne(this,to);Ne(this,Ra);Ne(this,Aa);Ne(this,Dl);Ne(this,no,new Set);this.options=a,he(this,cn,l),he(this,Xs,null),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Fe).addObserver(this),Jv(F(this,Fe),this.options)?ke(this,Ye,br).call(this):this.updateResult(),ke(this,Ye,Mm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rm(F(this,Fe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rm(F(this,Fe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ke(this,Ye,Em).call(this),ke(this,Ye,Tm).call(this),F(this,Fe).removeObserver(this)}setOptions(l){const a=this.options,o=F(this,Fe);if(this.options=F(this,cn).defaultQueryOptions(l),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rt(this.options.enabled,F(this,Fe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ke(this,Ye,_m).call(this),F(this,Fe).setOptions(this.options),a._defaulted&&!_h(this.options,a)&&F(this,cn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Fe),observer:this});const c=this.hasListeners();c&&Wv(F(this,Fe),o,this.options,a)&&ke(this,Ye,br).call(this),this.updateResult(),c&&(F(this,Fe)!==o||rt(this.options.enabled,F(this,Fe))!==rt(a.enabled,F(this,Fe))||rt(this.options.staleTime,F(this,Fe))!==rt(a.staleTime,F(this,Fe)))&&ke(this,Ye,wm).call(this);const d=ke(this,Ye,Nm).call(this);c&&(F(this,Fe)!==o||rt(this.options.enabled,F(this,Fe))!==rt(a.enabled,F(this,Fe))||d!==F(this,Dl))&&ke(this,Ye,Cm).call(this,d)}getOptimisticResult(l){const a=F(this,cn).getQueryCache().build(F(this,cn),l),o=this.createResult(a,l);return _h(this.getCurrentResult(),o)||(he(this,un,o),he(this,Wi,this.options),he(this,_a,F(this,Fe).state)),o}getCurrentResult(){return F(this,un)}trackResult(l,a){return new Proxy(l,{get:(o,c)=>(this.trackProp(c),a==null||a(c),Reflect.get(o,c))})}trackProp(l){F(this,no).add(l)}getCurrentQuery(){return F(this,Fe)}refetch({...l}={}){return this.fetch({...l})}fetchOptimistic(l){const a=F(this,cn).defaultQueryOptions(l),o=F(this,cn).getQueryCache().build(F(this,cn),a);let c=()=>{},d;const h=new Promise(m=>{d=m,c=F(this,cn).getQueryCache().subscribe(g=>{g.type==="updated"&&g.query.queryHash===o.queryHash&&o.state.data!==void 0&&(c(),m(this.createResult(o,a)))})});return Promise.race([o.fetch(a).then(()=>{const m=this.createResult(o,a);return d==null||d(m),m}).finally(()=>{c()}),h])}fetch(l){return ke(this,Ye,br).call(this,{...l,cancelRefetch:l.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,un)))}createResult(l,a){var R;const o=F(this,Fe),c=this.options,d=F(this,un),h=F(this,_a),m=F(this,Wi),g=l!==o?l.state:F(this,Dr),{state:x}=l;let v={...x},y=!1,S;if(a._optimisticResults){const A=this.hasListeners(),B=!A&&Jv(l,a),K=A&&Wv(l,o,a,c);(B||K)&&(v={...v,...N1(x.data,l.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:j,errorUpdatedAt:b,status:N}=v;S=v.data;let T=!1;if(a.placeholderData!==void 0&&S===void 0&&N==="pending"){let A;d!=null&&d.isPlaceholderData&&a.placeholderData===(m==null?void 0:m.placeholderData)?(A=d.data,T=!0):A=typeof a.placeholderData=="function"?a.placeholderData((R=F(this,to))==null?void 0:R.state.data,F(this,to)):a.placeholderData,A!==void 0&&(N="success",S=xm(d==null?void 0:d.data,A,a),y=!0)}if(a.select&&S!==void 0&&!T)if(d&&S===(h==null?void 0:h.data)&&a.select===F(this,Lr))S=F(this,eo);else try{he(this,Lr,a.select),S=a.select(S),S=xm(d==null?void 0:d.data,S,a),he(this,eo,S),he(this,Xs,null)}catch(A){he(this,Xs,A)}else S===void 0&&he(this,Xs,null);F(this,Xs)&&(j=F(this,Xs),S=F(this,eo),b=Date.now(),N="error",y=!1);const O=v.fetchStatus==="fetching",_=N==="pending",D=N==="error",C=_&&O,E=S!==void 0;return{status:N,fetchStatus:v.fetchStatus,isPending:_,isSuccess:N==="success",isError:D,isInitialLoading:C,isLoading:C,data:S,dataUpdatedAt:v.dataUpdatedAt,error:j,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:l.isFetched(),isFetchedAfterMount:v.dataUpdateCount>g.dataUpdateCount||v.errorUpdateCount>g.errorUpdateCount,isFetching:O,isRefetching:O&&!_,isLoadingError:D&&!E,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:D&&E,isStale:rg(l,a),refetch:this.refetch,isEnabled:rt(a.enabled,l)!==!1}}updateResult(){const l=F(this,un),a=this.createResult(F(this,Fe),this.options);if(he(this,_a,F(this,Fe).state),he(this,Wi,this.options),F(this,_a).data!==void 0&&he(this,to,F(this,Fe)),_h(a,l))return;he(this,un,a);const c=(()=>{if(!l)return!0;const{notifyOnChangeProps:d}=this.options,h=typeof d=="function"?d():d;if(h==="all"||!h&&!F(this,no).size)return!0;const m=new Set(h??F(this,no));return this.options.throwOnError&&m.add("error"),Object.keys(F(this,un)).some(g=>{const x=g;return F(this,un)[x]!==l[x]&&m.has(x)})})();Bt.batch(()=>{c&&this.listeners.forEach(d=>{d(F(this,un))}),F(this,cn).getQueryCache().notify({query:F(this,Fe),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ke(this,Ye,Mm).call(this)}},cn=new WeakMap,Fe=new WeakMap,Dr=new WeakMap,un=new WeakMap,_a=new WeakMap,Wi=new WeakMap,Xs=new WeakMap,Lr=new WeakMap,eo=new WeakMap,to=new WeakMap,Ra=new WeakMap,Aa=new WeakMap,Dl=new WeakMap,no=new WeakMap,Ye=new WeakSet,br=function(l){ke(this,Ye,_m).call(this);let a=F(this,Fe).fetch(this.options,l);return l!=null&&l.throwOnError||(a=a.catch(Sn)),a},jm=function(l){return!ig()&&rt(this.options.enabled,F(this,Fe))!==!1&&g1(l)},wm=function(){ke(this,Ye,Em).call(this);const l=rt(this.options.staleTime,F(this,Fe));if(F(this,un).isStale||!ke(this,Ye,jm).call(this,l))return;const a=p1(F(this,un).dataUpdatedAt,l)+1;he(this,Ra,ja.setTimeout(()=>{F(this,un).isStale||this.updateResult()},a))},Nm=function(){return rt(this.options.refetchInterval,F(this,Fe))??!1},Cm=function(l){ke(this,Ye,Tm).call(this),he(this,Dl,l),!(F(this,Dl)===0||!ke(this,Ye,jm).call(this,F(this,Dl)))&&he(this,Aa,ja.setInterval(()=>{(this.options.refetchIntervalInBackground||og.isFocused())&&ke(this,Ye,br).call(this)},F(this,Dl)))},Mm=function(){ke(this,Ye,wm).call(this),ke(this,Ye,Cm).call(this,ke(this,Ye,Nm).call(this))},Em=function(){F(this,Ra)!==void 0&&(ja.clearTimeout(F(this,Ra)),he(this,Ra,void 0))},Tm=function(){F(this,Aa)!==void 0&&(ja.clearInterval(F(this,Aa)),he(this,Aa,void 0))},_m=function(){const l=F(this,cn).getQueryCache().build(F(this,cn),this.options);if(l===F(this,Fe))return;const a=F(this,Fe);he(this,Fe,l),he(this,Dr,l.state),this.hasListeners()&&(a==null||a.removeObserver(this),l.addObserver(this))},o1);function rw(n,l){return rt(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&rt(l.retryOnMount,n)===!1)}function Jv(n,l){return rw(n,l)||n.state.data!==void 0&&Rm(n,l,l.refetchOnMount)}function Rm(n,l,a){if(rt(l.enabled,n)!==!1&&rt(l.staleTime,n)!=="static"){const o=rt(a,n);return o==="always"||o!==!1&&rg(n,l)}return!1}function Wv(n,l,a,o){return(n!==l||rt(o.enabled,n)===!1)&&(!a.suspense||n.state.status!=="error")&&rg(n,a)}function rg(n,l){return rt(l.enabled,n)!==!1&&n.isStaleByTime(rt(l.staleTime,n))}var cw=class extends C1{constructor(n,l){super(n,l)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(n){n._type="infinite",super.setOptions(n)}getOptimisticResult(n){return n._type="infinite",super.getOptimisticResult(n)}fetchNextPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"backward"}}})}createResult(n,l){var j,b;const{state:a}=n,o=super.createResult(n,l),{isFetching:c,isRefetching:d,isError:h,isRefetchError:m}=o,g=(b=(j=a.fetchMeta)==null?void 0:j.fetchMore)==null?void 0:b.direction,x=h&&g==="forward",v=c&&g==="forward",y=h&&g==="backward",S=c&&g==="backward";return{...o,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:aw(l,a.data),hasPreviousPage:iw(l,a.data),isFetchNextPageError:x,isFetchingNextPage:v,isFetchPreviousPageError:y,isFetchingPreviousPage:S,isRefetchError:m&&!x&&!y,isRefetching:d&&!v&&!S}}},$r,bs,Kt,Oa,js,Tl,r1,uw=(r1=class extends j1{constructor(l){super();Ne(this,js);Ne(this,$r);Ne(this,bs);Ne(this,Kt);Ne(this,Oa);he(this,$r,l.client),this.mutationId=l.mutationId,he(this,Kt,l.mutationCache),he(this,bs,[]),this.state=l.state||fw(),this.setOptions(l.options),this.scheduleGc()}setOptions(l){this.options=l,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(l){F(this,bs).includes(l)||(F(this,bs).push(l),this.clearGcTimeout(),F(this,Kt).notify({type:"observerAdded",mutation:this,observer:l}))}removeObserver(l){he(this,bs,F(this,bs).filter(a=>a!==l)),this.scheduleGc(),F(this,Kt).notify({type:"observerRemoved",mutation:this,observer:l})}optionalRemove(){F(this,bs).length||(this.state.status==="pending"?this.scheduleGc():F(this,Kt).remove(this))}continue(){var l;return((l=F(this,Oa))==null?void 0:l.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(l){var m,g,x,v,y,S,j,b,N,T,O,_,D,C,E,R,A,B;const a=()=>{ke(this,js,Tl).call(this,{type:"continue"})},o={client:F(this,$r),meta:this.options.meta,mutationKey:this.options.mutationKey},c=he(this,Oa,b1({fn:()=>this.options.mutationFn?this.options.mutationFn(l,o):Promise.reject(new Error("No mutationFn found")),onFail:(K,k)=>{ke(this,js,Tl).call(this,{type:"failed",failureCount:K,error:k})},onPause:()=>{ke(this,js,Tl).call(this,{type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Kt).canRun(this)})),d=this.state.status==="pending",h=!c.canStart();try{if(d)a();else{ke(this,js,Tl).call(this,{type:"pending",variables:l,isPaused:h}),F(this,Kt).config.onMutate&&await F(this,Kt).config.onMutate(l,this,o);const k=await((g=(m=this.options).onMutate)==null?void 0:g.call(m,l,o));k!==this.state.context&&ke(this,js,Tl).call(this,{type:"pending",context:k,variables:l,isPaused:h})}const K=await c.start();return await((v=(x=F(this,Kt).config).onSuccess)==null?void 0:v.call(x,K,l,this.state.context,this,o)),await((S=(y=this.options).onSuccess)==null?void 0:S.call(y,K,l,this.state.context,o)),await((b=(j=F(this,Kt).config).onSettled)==null?void 0:b.call(j,K,null,this.state.variables,this.state.context,this,o)),await((T=(N=this.options).onSettled)==null?void 0:T.call(N,K,null,l,this.state.context,o)),ke(this,js,Tl).call(this,{type:"success",data:K}),K}catch(K){try{await((_=(O=F(this,Kt).config).onError)==null?void 0:_.call(O,K,l,this.state.context,this,o))}catch(k){Promise.reject(k)}try{await((C=(D=this.options).onError)==null?void 0:C.call(D,K,l,this.state.context,o))}catch(k){Promise.reject(k)}try{await((R=(E=F(this,Kt).config).onSettled)==null?void 0:R.call(E,void 0,K,this.state.variables,this.state.context,this,o))}catch(k){Promise.reject(k)}try{await((B=(A=this.options).onSettled)==null?void 0:B.call(A,void 0,K,l,this.state.context,o))}catch(k){Promise.reject(k)}throw ke(this,js,Tl).call(this,{type:"error",error:K}),K}finally{F(this,Oa)===c&&he(this,Oa,void 0),F(this,Kt).runNext(this)}}},$r=new WeakMap,bs=new WeakMap,Kt=new WeakMap,Oa=new WeakMap,js=new WeakSet,Tl=function(l){const a=o=>{switch(l.type){case"failed":return{...o,failureCount:l.failureCount,failureReason:l.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:l.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:l.isPaused,status:"pending",variables:l.variables,submittedAt:Date.now()};case"success":return{...o,data:l.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:l.error,failureCount:o.failureCount+1,failureReason:l.error,isPaused:!1,status:"error"}}};this.state=a(this.state),Bt.batch(()=>{F(this,bs).forEach(o=>{o.onMutationUpdate(l)}),F(this,Kt).notify({mutation:this,type:"updated",action:l})})},r1);function fw(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ll,ls,kr,c1,dw=(c1=class extends Hr{constructor(l={}){super();Ne(this,Ll);Ne(this,ls);Ne(this,kr);this.config=l,he(this,Ll,new Set),he(this,ls,new Map),he(this,kr,0)}build(l,a,o){const c=new uw({client:l,mutationCache:this,mutationId:++gu(this,kr)._,options:l.defaultMutationOptions(a),state:o});return this.add(c),c}add(l){F(this,Ll).add(l);const a=pu(l);if(typeof a=="string"){const o=F(this,ls).get(a);o?o.push(l):F(this,ls).set(a,[l])}this.notify({type:"added",mutation:l})}remove(l){if(F(this,Ll).delete(l)){const a=pu(l);if(typeof a=="string"){const o=F(this,ls).get(a);if(o)if(o.length>1){const c=o.indexOf(l);c!==-1&&o.splice(c,1)}else o[0]===l&&F(this,ls).delete(a)}}this.notify({type:"removed",mutation:l})}canRun(l){var o;const a=pu(l);if(typeof a=="string"){const c=(o=F(this,ls).get(a))==null?void 0:o.find(d=>d.state.status==="pending");return!c||c===l}else return!0}runNext(l){var o,c;const a=pu(l);return typeof a=="string"?((c=(o=F(this,ls).get(a))==null?void 0:o.find(d=>d!==l&&d.state.isPaused))==null?void 0:c.continue())??Promise.resolve():Promise.resolve()}clear(){Bt.batch(()=>{const l=this.getAll();F(this,Ll).clear(),F(this,ls).clear(),l.forEach(a=>{this.notify({type:"removed",mutation:a})})})}getAll(){return Array.from(F(this,Ll))}find(l){const a={exact:!0,...l};return this.getAll().find(o=>Yv(a,o))}findAll(l={}){return this.getAll().filter(a=>Yv(l,a))}notify(l){Bt.batch(()=>{this.listeners.forEach(a=>{a(l)})})}resumePausedMutations(){const l=this.getAll().filter(a=>a.state.isPaused);return Bt.batch(()=>Promise.all(l.map(a=>a.continue().catch(Sn))))}},Ll=new WeakMap,ls=new WeakMap,kr=new WeakMap,c1);function pu(n){var l;return(l=n.options.scope)==null?void 0:l.id}var ws,u1,hw=(u1=class extends Hr{constructor(l={}){super();Ne(this,ws);this.config=l,he(this,ws,new Map)}build(l,a,o){const c=a.queryKey,d=a.queryHash??sg(c,a);let h=this.get(d);return h||(h=new ow({client:l,queryKey:c,queryHash:d,options:l.defaultQueryOptions(a),state:o,defaultOptions:l.getQueryDefaults(c)}),this.add(h)),h}add(l){F(this,ws).has(l.queryHash)||(F(this,ws).set(l.queryHash,l),this.notify({type:"added",query:l}))}remove(l){F(this,ws).get(l.queryHash)===l&&(l.destroy(),F(this,ws).delete(l.queryHash),this.notify({type:"removed",query:l}))}clear(){Bt.batch(()=>{this.getAll().forEach(l=>{this.remove(l)})})}get(l){return F(this,ws).get(l)}getAll(){return[...F(this,ws).values()]}find(l){const a={exact:!0,...l};return this.getAll().find(o=>Qv(a,o))}findAll(l={}){const a=this.getAll();return Object.keys(l).length>0?a.filter(o=>Qv(l,o)):a}notify(l){Bt.batch(()=>{this.listeners.forEach(a=>{a(l)})})}onFocus(){Bt.batch(()=>{this.getAll().forEach(l=>{l.onFocus()})})}onOnline(){Bt.batch(()=>{this.getAll().forEach(l=>{l.onOnline()})})}},ws=new WeakMap,u1),dt,$l,kl,so,lo,Hl,ao,io,f1,mw=(f1=class{constructor(n={}){Ne(this,dt);Ne(this,$l);Ne(this,kl);Ne(this,so);Ne(this,lo);Ne(this,Hl);Ne(this,ao);Ne(this,io);he(this,dt,n.queryCache||new hw),he(this,$l,n.mutationCache||new dw),he(this,kl,n.defaultOptions||{}),he(this,so,new Map),he(this,lo,new Map),he(this,Hl,0)}mount(){gu(this,Hl)._++,F(this,Hl)===1&&(he(this,ao,og.subscribe(async n=>{n&&(await this.resumePausedMutations(),F(this,dt).onFocus())})),he(this,io,Eu.subscribe(async n=>{n&&(await this.resumePausedMutations(),F(this,dt).onOnline())})))}unmount(){var n,l;gu(this,Hl)._--,F(this,Hl)===0&&((n=F(this,ao))==null||n.call(this),he(this,ao,void 0),(l=F(this,io))==null||l.call(this),he(this,io,void 0))}isFetching(n){return F(this,dt).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return F(this,$l).findAll({...n,status:"pending"}).length}getQueryData(n){var a;const l=this.defaultQueryOptions({queryKey:n});return(a=F(this,dt).get(l.queryHash))==null?void 0:a.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),a=F(this,dt).build(this,l),o=a.state.data;return o===void 0?this.fetchQuery(n):(n.revalidateIfStale&&a.isStaleByTime(rt(l.staleTime,a))&&this.prefetchQuery(l),Promise.resolve(o))}getQueriesData(n){return F(this,dt).findAll(n).map(({queryKey:l,state:a})=>[l,a.data])}setQueryData(n,l,a){var h;const o=this.defaultQueryOptions({queryKey:n}),c=(h=F(this,dt).get(o.queryHash))==null?void 0:h.state.data,d=Q2(l,c);if(d!==void 0)return F(this,dt).build(this,o).setData(d,{...a,manual:!0})}setQueriesData(n,l,a){return Bt.batch(()=>F(this,dt).findAll(n).map(({queryKey:o})=>[o,this.setQueryData(o,l,a)]))}getQueryState(n){var a;const l=this.defaultQueryOptions({queryKey:n});return(a=F(this,dt).get(l.queryHash))==null?void 0:a.state}removeQueries(n){const l=F(this,dt);Bt.batch(()=>{l.findAll(n).forEach(a=>{l.remove(a)})})}resetQueries(n,l){const a=F(this,dt);return Bt.batch(()=>{const o=a.findAll(n),c=new Set(o);return o.forEach(d=>{d.reset()}),this.refetchQueries({type:"active",predicate:d=>c.has(d)},l)})}cancelQueries(n,l={}){const a={revert:!0,...l},o=Bt.batch(()=>F(this,dt).findAll(n).map(c=>c.cancel(a)));return Promise.all(o).then(Sn).catch(Sn)}invalidateQueries(n,l={}){return Bt.batch(()=>(F(this,dt).findAll(n).forEach(a=>{a.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},l)))}refetchQueries(n,l={}){const a={...l,cancelRefetch:l.cancelRefetch??!0},o=Bt.batch(()=>F(this,dt).findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,a);return a.throwOnError||(d=d.catch(Sn)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(o).then(Sn)}async query(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const a=F(this,dt).build(this,l),o=a.isStaleByTime(rt(l.staleTime,a))?await a.fetch(l):a.state.data,c=l.select;return c?c(o):o}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const a=F(this,dt).build(this,l);return a.isStaleByTime(rt(l.staleTime,a))?a.fetch(l):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Sn).catch(Sn)}infiniteQuery(n){return n._type="infinite",this.query(n)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Sn).catch(Sn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Eu.isOnline()?F(this,$l).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,dt)}getMutationCache(){return F(this,$l)}getDefaultOptions(){return F(this,kl)}setDefaultOptions(n){he(this,kl,n)}setQueryDefaults(n,l){F(this,so).set(Er(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...F(this,so).values()],a={};return l.forEach(o=>{oo(n,o.queryKey)&&Object.assign(a,o.defaultOptions)}),a}setMutationDefaults(n,l){F(this,lo).set(Er(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...F(this,lo).values()],a={};return l.forEach(o=>{oo(n,o.mutationKey)&&Object.assign(a,o.defaultOptions)}),a}defaultQueryOptions(n){if(n._defaulted)return n;const l={...F(this,kl).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=sg(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===ag&&(l.enabled=!1),l}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...F(this,kl).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){F(this,dt).clear(),F(this,$l).clear()}},dt=new WeakMap,$l=new WeakMap,kl=new WeakMap,so=new WeakMap,lo=new WeakMap,Hl=new WeakMap,ao=new WeakMap,io=new WeakMap,f1);const M1=M.createContext(!1),gw=()=>M.useContext(M1);M1.Provider;function pw(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const yw=M.createContext(pw()),vw=()=>M.useContext(yw),xw=(n,l,a)=>{const o=(a==null?void 0:a.state.status)==="error"&&typeof n.throwOnError=="function"?x1(n.throwOnError,[a.state.error,a]):n.throwOnError;(n.suspense||o)&&(l.isReset()||(n.retryOnMount=!1))},Sw=n=>{M.useEffect(()=>{n.clearReset()},[n])},bw=({result:n,errorResetBoundary:l,throwOnError:a,query:o,suspense:c})=>n.isError&&!l.isReset()&&!n.isFetching&&o&&(c&&n.data===void 0||x1(a,[n.error,o])),jw=n=>{if(n.suspense){const a=c=>c==="static"?c:Math.max(c??1e3,1e3),o=n.staleTime;n.staleTime=typeof o=="function"?(...c)=>a(o(...c)):a(o),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},ww=(n,l)=>(n==null?void 0:n.suspense)&&l.isPending,Nw=(n,l,a)=>l.fetchOptimistic(n).catch(()=>{a.clearReset()});function E1(n,l,a){const o=gw(),c=vw(),d=m1(),h=d.defaultQueryOptions(n),m=d.getQueryCache().get(h.queryHash),g=n.subscribed!==!1;h._optimisticResults=o?"isRestoring":g?"optimistic":void 0,jw(h),xw(h,c,m),Sw(c);const[x]=M.useState(()=>new l(d,h)),v=x.getOptimisticResult(h),y=!o&&g;if(M.useSyncExternalStore(M.useCallback(S=>{const j=y?x.subscribe(Bt.batchCalls(S)):Sn;return x.updateResult(),j},[x,y]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),M.useEffect(()=>{x.setOptions(h)},[h,x]),ww(h,v))throw Nw(h,x,c);if(bw({result:v,errorResetBoundary:c,throwOnError:h.throwOnError,query:m,suspense:h.suspense}))throw v.error;return h.notifyOnChangeProps?v:x.trackResult(v)}function fn(n,l){return E1(n,C1)}function Cw(n,l){return E1(n,cw)}var cg=d1();/**
|
|
43
|
+
`+nn+e+sl}var is=!1;function Rs(e,t){if(!e||is)return"";is=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(t){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(fe){var B=fe}Reflect.construct(e,[],te)}else{try{te.call()}catch(fe){B=fe}te=!1;try{var Y=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),te=!0,new e}finally{te&&(Y!==void 0?Object.defineProperty(e.prototype,"props",Y):delete e.prototype.props)}}}else{try{throw Error()}catch(fe){B=fe}(te=e())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(fe){if(fe&&B&&typeof fe.stack=="string")return[fe.stack,B.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),x=h[0],w=h[1];if(x&&w){var z=x.split(`
|
|
44
|
+
`),G=w.split(`
|
|
45
|
+
`);for(u=o=0;o<z.length&&!z[o].includes("DetermineComponentFrameRoot");)o++;for(;u<G.length&&!G[u].includes("DetermineComponentFrameRoot");)u++;if(o===z.length||u===G.length)for(o=z.length-1,u=G.length-1;1<=o&&0<=u&&z[o]!==G[u];)u--;for(;1<=o&&0<=u;o--,u--)if(z[o]!==G[u]){if(o!==1||u!==1)do if(o--,u--,0>u||z[o]!==G[u]){var X=`
|
|
46
|
+
`+z[o].replace(" at new "," at ");return e.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",e.displayName)),X}while(1<=o&&0<=u);break}}}finally{is=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Et(s):""}function ne(e,t){switch(e.tag){case 26:case 27:case 5:return Et(e.type);case 16:return Et("Lazy");case 13:return e.child!==t&&t!==null?Et("Suspense Fallback"):Et("Suspense");case 19:return Et("SuspenseList");case 0:case 15:return Rs(e.type,!1);case 11:return Rs(e.type.render,!1);case 1:return Rs(e.type,!0);case 31:return Et("Activity");case 30:return Et("ViewTransition");default:return""}}function ue(e){try{var t="",s=null;do t+=ne(e,s),s=e,e=e.return;while(e);return t}catch(o){return`
|
|
47
|
+
Error generating stack: `+o.message+`
|
|
48
|
+
`+o.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=n.unstable_scheduleCallback,Ie=n.unstable_cancelCallback,pt=n.unstable_shouldYield,_t=n.unstable_requestPaint,Fe=n.unstable_now,fn=n.unstable_getCurrentPriorityLevel,mn=n.unstable_ImmediatePriority,Kl=n.unstable_UserBlockingPriority,ll=n.unstable_NormalPriority,As=n.unstable_LowPriority,vo=n.unstable_IdlePriority,sd=n.log,ld=n.unstable_setDisableYieldValue,os=null,Xt=null;function rs(e){if(typeof sd=="function"&&ld(e),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(os,e)}catch{}}var Lt=Math.clz32?Math.clz32:Zr,Kt=Math.log,Kr=Math.LN2;function Zr(e){return e>>>=0,e===0?32:31-(Kt(e)/Kr|0)|0}var Zl=256,Jl=262144,Wl=4194304;function cs(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ea(e,t,s){var o=e.pendingLanes;if(o===0)return 0;var u=0,h=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var w=o&134217727;return w!==0?(o=w&~h,o!==0?u=cs(o):(x&=w,x!==0?u=cs(x):s||(s=w&~e,s!==0&&(u=cs(s))))):(w=o&~h,w!==0?u=cs(w):x!==0?u=cs(x):s||(s=o&~e,s!==0&&(u=cs(s)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,s=t&-t,h>=s||h===32&&(s&4194048)!==0)?t:u}function al(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xo(e,t){(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var o=31-Lt(s),u=1<<o;t|=e[o],s&=~u}return t}function Jr(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 yo(){var e=Wl;return Wl<<=1,(Wl&62914560)===0&&(Wl=4194304),e}function Ia(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function il(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Wr(e,t,s,o,u,h){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var w=e.entanglements,z=e.expirationTimes,G=e.hiddenUpdates;for(s=x&~s;0<s;){var X=31-Lt(s),te=1<<X;w[X]=0,z[X]=-1;var B=G[X];if(B!==null)for(G[X]=null,X=0;X<B.length;X++){var Y=B[X];Y!==null&&(Y.lane&=-536870913)}s&=~te}o!==0&&So(e,o,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(x&~t))}function So(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var o=31-Lt(t);e.entangledLanes|=t,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function bo(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-Lt(s),u=1<<o;u&t|e[o]&t&&(e[o]|=t),s&=~u}}function jo(e,t){var s=t&-t;return s=(s&42)!==0?1:Pa(s),(s&(e.suspendedLanes|t))!==0?0:s}function Pa(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qa(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function wo(){var e=Se.p;return e!==0?e:(e=window.event,e===void 0?32:L2(e.type))}function No(e,t){var s=Se.p;try{return Se.p=e,t()}finally{Se.p=s}}var de=Math.random().toString(36).slice(2),Oe="__reactFiber$"+de,st="__reactProps$"+de,us="__reactContainer$"+de,ec="__reactEvents$"+de,ad="__reactListeners$"+de,Co="__reactHandles$"+de,Qn="__reactResources$"+de,ol="__reactMarker$"+de,ta="__reactLoad$"+de;function na(e){delete e[Oe],delete e[st],delete e[ad],delete e[Co]}function Os(e){var t;if(t=e[Oe])return t;for(var s=e.parentNode;s;){if(t=s[us]||s[Oe]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=p2(e);e!==null;){if(s=e[Oe])return s;e=p2(e)}return t}e=s,s=e.parentNode}return null}function zs(e){if(e=e[Oe]||e[us]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function rl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ya(e){var t=e[Qn];return t||(t=e[Qn]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[ol]=!0}function zg(e){e[ta]=void 0}var Dg=new Set,kg={};function sa(e,t){Xa(e,t),Xa(e+"Capture",t)}function Xa(e,t){for(kg[e]=t,e=0;e<t.length;e++)Dg.add(t[e])}var rS=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Lg={},$g={};function cS(e){return Ne.call($g,e)?!0:Ne.call(Lg,e)?!1:rS.test(e)?$g[e]=!0:(Lg[e]=!0,!1)}var Qe=!1;function Hg(){var e=Qe;return Qe=!1,e}function tc(e,t,s){if(cS(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var o=t.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,s)}}function nc(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,s)}}function Ds(e,t,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,o)}}function Nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ug(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function uS(e,t,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var u=o.get,h=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(x){s=""+x,h.call(this,x)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function id(e){if(!e._valueTracker){var t=Ug(e)?"checked":"value";e._valueTracker=uS(e,t,""+e[t])}}function Fg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=Ug(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}var dS=/[\n"\\]/g;function Ln(e){return e.replace(dS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function od(e,t,s,o,u,h,x,w){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nn(t)):e.value!==""+Nn(t)&&(e.value=""+Nn(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?x==="number"&&e.value==t?rd(e,Nn(e.value)):rd(e,Nn(t)):s!=null?rd(e,Nn(s)):o!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+Nn(w):e.removeAttribute("name")}function Bg(e,t,s,o,u,h,x,w){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||s!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){id(e);return}s=s!=null?""+Nn(s):"",t=t!=null?""+Nn(t):s,w||t===e.value||(e.value=t),e.defaultValue=t}o=o??u,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=w?e.checked:!!o,e.defaultChecked=!!o,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),id(e)}function rd(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Ka(e,t,s,o){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&o&&(e[s].defaultSelected=!0)}else{for(s=""+Nn(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,o&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Vg(e,t,s){if(t!=null&&(t=""+Nn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Nn(s):""}function Gg(e,t,s,o){if(t==null){if(o!=null){if(s!=null)throw Error(i(92));if(we(o)){if(1<o.length)throw Error(i(93));o=o[0]}s=o}s==null&&(s=""),t=s}s=Nn(t),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),id(e)}function Za(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var hS=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 qg(e,t,s){var o=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":o?e.setProperty(t,s):typeof s!="number"||s===0||hS.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Ig(e,t,s){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||t!=null&&t.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="",Qe=!0);for(var u in t)o=t[u],t.hasOwnProperty(u)&&s[u]!==o&&(qg(e,u,o),Qe=!0)}else for(var h in t)t.hasOwnProperty(h)&&qg(e,h,t[h])}function cd(e){if(e.indexOf("-")===-1)return!1;switch(e){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 fS=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"],["maskType","mask-type"],["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"]]),mS=/^[\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 sc(e){return mS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ds(){}var ud=null;function dd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ja=null,Wa=null;function Pg(e){var t=zs(e);if(t&&(e=t.stateNode)){var s=e[st]||null;e:switch(e=t.stateNode,t.type){case"input":if(od(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ln(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var u=o[st]||null;if(!u)throw Error(i(90));od(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)o=s[t],o.form===e.form&&Fg(o)}break e;case"textarea":Vg(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ka(e,!!s.multiple,t,!1)}}}var hd=!1;function Qg(e,t,s){if(hd)return e(t,s);hd=!0;try{var o=e(t);return o}finally{if(hd=!1,(Ja!==null||Wa!==null)&&(su(),Ja&&(t=Ja,e=Wa,Wa=Ja=null,Pg(t),e)))for(t=0;t<e.length;t++)Pg(e[t])}}function Mo(e,t){var s=e.stateNode;if(s===null)return null;var o=s[st]||null;if(o===null)return null;s=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(i(231,t,typeof s));return s}var ks=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fd=!1;if(ks)try{var Eo={};Object.defineProperty(Eo,"passive",{get:function(){fd=!0}}),window.addEventListener("test",Eo,Eo),window.removeEventListener("test",Eo,Eo)}catch{fd=!1}var cl=null,md=null,lc=null;function Yg(){if(lc)return lc;var e,t=md,s=t.length,o,u="value"in cl?cl.value:cl.textContent,h=u.length;for(e=0;e<s&&t[e]===u[e];e++);var x=s-e;for(o=1;o<=x&&t[s-o]===u[h-o];o++);return lc=u.slice(e,1<o?1-o:void 0)}function ac(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ic(){return!0}function Xg(){return!1}function sn(e){function t(s,o,u,h,x){this._reactName=s,this._targetInst=u,this.type=o,this.nativeEvent=h,this.target=x,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(s=e[w],this[w]=s?s(h):h[w]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?ic:Xg,this.isPropagationStopped=Xg,this}return k(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ic)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ic)},persist:function(){},isPersistent:ic}),t}var ul={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oc=sn(ul),_o=k({},ul,{view:0,detail:0}),gS=sn(_o),gd,pd,To,rc=k({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:xd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==To&&(To&&e.type==="mousemove"?(gd=e.screenX-To.screenX,pd=e.screenY-To.screenY):pd=gd=0,To=e),gd)},movementY:function(e){return"movementY"in e?e.movementY:pd}}),Kg=sn(rc),pS=k({},rc,{dataTransfer:0}),vS=sn(pS),xS=k({},_o,{relatedTarget:0}),vd=sn(xS),yS=k({},ul,{animationName:0,elapsedTime:0,pseudoElement:0}),SS=sn(yS),bS=k({},ul,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jS=sn(bS),wS=k({},ul,{data:0}),Zg=sn(wS),NS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CS={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"},MS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ES(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=MS[e])?!!t[e]:!1}function xd(){return ES}var _S=k({},_o,{key:function(e){if(e.key){var t=NS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ac(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?CS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:xd,charCode:function(e){return e.type==="keypress"?ac(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ac(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),TS=sn(_S),RS=k({},rc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jg=sn(RS),AS=k({},ul,{submitter:0}),OS=sn(AS),zS=k({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:xd}),DS=sn(zS),kS=k({},ul,{propertyName:0,elapsedTime:0,pseudoElement:0}),LS=sn(kS),$S=k({},rc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),HS=sn($S),US=k({},ul,{newState:0,oldState:0,source:0}),FS=sn(US),BS=[9,13,27,32],yd=ks&&"CompositionEvent"in window,Ro=null;ks&&"documentMode"in document&&(Ro=document.documentMode);var VS=ks&&"TextEvent"in window&&!Ro,Wg=ks&&(!yd||Ro&&8<Ro&&11>=Ro),e0=" ",t0=!1;function n0(e,t){switch(e){case"keyup":return BS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function s0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ei=!1;function GS(e,t){switch(e){case"compositionend":return s0(t);case"keypress":return t.which!==32?null:(t0=!0,e0);case"textInput":return e=t.data,e===e0&&t0?null:e;default:return null}}function qS(e,t){if(ei)return e==="compositionend"||!yd&&n0(e,t)?(e=Yg(),lc=md=cl=null,ei=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Wg&&t.locale!=="ko"?null:t.data;default:return null}}var IS={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 l0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!IS[e.type]:t==="textarea"}function a0(e,t,s,o){Ja?Wa?Wa.push(o):Wa=[o]:Ja=o,t=cu(t,"onChange"),0<t.length&&(s=new oc("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var Ao=null,Oo=null;function PS(e){P1(e,0)}function cc(e){var t=rl(e);if(Fg(t))return e}function i0(e,t){if(e==="change")return t}var o0=!1;if(ks){var Sd;if(ks){var bd="oninput"in document;if(!bd){var r0=document.createElement("div");r0.setAttribute("oninput","return;"),bd=typeof r0.oninput=="function"}Sd=bd}else Sd=!1;o0=Sd&&(!document.documentMode||9<document.documentMode)}function c0(){Ao&&(Ao.detachEvent("onpropertychange",u0),Oo=Ao=null)}function u0(e){if(e.propertyName==="value"&&cc(Oo)){var t=[];a0(t,Oo,e,dd(e)),Qg(PS,t)}}function QS(e,t,s){e==="focusin"?(c0(),Ao=t,Oo=s,Ao.attachEvent("onpropertychange",u0)):e==="focusout"&&c0()}function YS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return cc(Oo)}function XS(e,t){if(e==="click")return cc(t)}function KS(e,t){if(e==="input"||e==="change")return cc(t)}function ZS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cn=typeof Object.is=="function"?Object.is:ZS;function zo(e,t){if(Cn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var u=s[o];if(!Ne.call(t,u)||!Cn(e[u],t[u]))return!1}return!0}function jd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function d0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function h0(e,t){var s=d0(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=d0(s)}}function f0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?f0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function m0(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=jd(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=jd(e.document)}return t}function wd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var JS=ks&&"documentMode"in document&&11>=document.documentMode,ti=null,Nd=null,Do=null,Cd=!1;function g0(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Cd||ti==null||ti!==jd(o)||(o=ti,"selectionStart"in o&&wd(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Do&&zo(Do,o)||(Do=o,o=cu(Nd,"onSelect"),0<o.length&&(t=new oc("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=ti)))}function la(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var ni={animationend:la("Animation","AnimationEnd"),animationiteration:la("Animation","AnimationIteration"),animationstart:la("Animation","AnimationStart"),transitionrun:la("Transition","TransitionRun"),transitionstart:la("Transition","TransitionStart"),transitioncancel:la("Transition","TransitionCancel"),transitionend:la("Transition","TransitionEnd")},Md={},p0={};ks&&(p0=document.createElement("div").style,"AnimationEvent"in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),"TransitionEvent"in window||delete ni.transitionend.transition);function aa(e){if(Md[e])return Md[e];if(!ni[e])return e;var t=ni[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in p0)return Md[e]=t[s];return e}var v0=aa("animationend"),x0=aa("animationiteration"),y0=aa("animationstart"),WS=aa("transitionrun"),eb=aa("transitionstart"),tb=aa("transitioncancel"),S0=aa("transitionend"),b0=new Map,Ed="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Ed.push("scrollEnd");function Yn(e,t){b0.set(e,t),sa(t,[e])}var nb=0;function Ls(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Jn.identifierPrefix;var s=nb++;return e="_"+e+"t_"+s.toString(32)+"_",t.autoName=e}function j0(e){if(e==null||typeof e=="string")return e;var t=null,s=ji;if(s!==null)for(var o=0;o<s.length;o++){var u=e[s[o]];if(u!=null){if(u==="none")return"none";t=t==null?u:t+(" "+u)}}return t??e.default}function $s(e,t){return e=j0(e),t=j0(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var uc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},$n=[],si=0,_d=0;function dc(){for(var e=si,t=_d=si=0;t<e;){var s=$n[t];$n[t++]=null;var o=$n[t];$n[t++]=null;var u=$n[t];$n[t++]=null;var h=$n[t];if($n[t++]=null,o!==null&&u!==null){var x=o.pending;x===null?u.next=u:(u.next=x.next,x.next=u),o.pending=u}h!==0&&w0(s,u,h)}}function hc(e,t,s,o){$n[si++]=e,$n[si++]=t,$n[si++]=s,$n[si++]=o,_d|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Td(e,t,s,o){return hc(e,t,s,o),fc(e)}function ia(e,t){return hc(e,null,null,t),fc(e)}function w0(e,t,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var u=!1,h=e.return;h!==null;)h.childLanes|=s,o=h.alternate,o!==null&&(o.childLanes|=s),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Lt(s),e=h.hiddenUpdates,o=e[u],o===null?e[u]=[t]:o.push(t),t.lane=s|536870912),h):null}function fc(e){if(50<nr)throw nr=0,nu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var li={};function sb(e,t,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(e,t,s,o){return new sb(e,t,s,o)}function Rd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hs(e,t){var s=e.alternate;return s===null?(s=gn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&1206910976,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function N0(e,t){e.flags&=1206910978;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function mc(e,t,s,o,u,h){var x=0;if(o=e,typeof o=="function")Rd(o)&&(x=1);else if(typeof o=="string")x=Aj(e,s,Qt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(o){case oe:return e=gn(31,s,t,u),e.elementType=oe,e.lanes=h,e;case se:return oa(s.children,u,h,t);case ie:x=8,u|=24;break;case W:return e=gn(12,s,t,u|2),e.elementType=W,e.lanes=h,e;case Z:return e=gn(13,s,t,u),e.elementType=Z,e.lanes=h,e;case J:return e=gn(19,s,t,u),e.elementType=J,e.lanes=h,e;case xe:case D:return e=u|32,e=gn(30,s,t,e),e.elementType=D,e.lanes=h,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case le:x=10;break e;case P:x=9;break e;case $:x=11;break e;case ce:x=14;break e;case ae:x=16,o=null;break e}x=29,s=Error(i(130,e===null?"null":typeof e,"")),o=null}return t=gn(x,s,t,u),t.elementType=e,t.type=o,t.lanes=h,t}function oa(e,t,s,o){return e=gn(7,e,o,t),e.lanes=s,e}function Ad(e,t,s){return e=gn(6,e,null,t),e.lanes=s,e}function C0(e){var t=gn(18,null,null,0);return t.stateNode=e,t}function Od(e,t,s){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var M0=new WeakMap;function Hn(e,t){if(typeof e=="object"&&e!==null){var s=M0.get(e);return s!==void 0?s:(t={value:e,source:t,stack:ue(t)},M0.set(e,t),t)}return{value:e,source:t,stack:ue(t)}}var ai=[],ii=0,gc=null,ko=0,Un=[],Fn=0,dl=null,hs=1,fs="";function Us(e,t){ai[ii++]=ko,ai[ii++]=gc,gc=e,ko=t}function E0(e,t,s){Un[Fn++]=hs,Un[Fn++]=fs,Un[Fn++]=dl,dl=e;var o=hs;e=fs;var u=32-Lt(o)-1;o&=~(1<<u),s+=1;var h=32-Lt(t)+u;if(30<h){var x=u-u%5;h=(o&(1<<x)-1).toString(32),o>>=x,u-=x,hs=1<<32-Lt(t)+u|s<<u|o,fs=h+e}else hs=1<<h|s<<u|o,fs=e}function pc(e){e.return!==null&&(Us(e,1),E0(e,1,0))}function zd(e){for(;e===gc;)gc=ai[--ii],ai[ii]=null,ko=ai[--ii],ai[ii]=null;for(;e===dl;)dl=Un[--Fn],Un[Fn]=null,fs=Un[--Fn],Un[Fn]=null,hs=Un[--Fn],Un[Fn]=null}function _0(e,t){Un[Fn++]=hs,Un[Fn++]=fs,Un[Fn++]=dl,hs=t.id,fs=t.overflow,dl=e}var Rt=null,at=null,De=!1,hl=null,Bn=!1,Dd=Error(i(519));function fl(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Lo(Hn(t,e)),Dd}function T0(e){var t=e.stateNode,s=e.type,o=e.memoizedProps;switch(t[Oe]=e,t[st]=o,s){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(s=0;s<lr.length;s++)Le(lr[s],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),Bg(t,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),Gg(t,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||o.suppressHydrationWarning===!0||K1(t.textContent,s)?(o.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),o.onScroll!=null&&Le("scroll",t),o.onScrollEnd!=null&&Le("scrollend",t),o.onClick!=null&&(t.onclick=ds),t=!0):t=!1,t||fl(e,!0)}function vc(e){for(Rt=e.return;Rt;)switch(Rt.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:Rt=Rt.return}}function oi(e){if(e!==Rt)return!1;if(!De)return vc(e),De=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||df(e.type,e.memoizedProps)),s=!s),s&&at&&fl(e),vc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));at=g2(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));at=g2(e)}else t===27?(t=at,Tl(e.type)?(e=Sf,Sf=null,at=e):at=t):at=Rt?Gn(e.stateNode.nextSibling):null;return!0}function ra(){at=Rt=null,De=!1}function kd(){var e=hl;return e!==null&&(xn===null?xn=e:xn.push.apply(xn,e),hl=null),e}function Lo(e){hl===null?hl=[e]:hl.push(e)}var Ld=kt(null),ca=null,Fs=null;function ml(e,t,s){qe(Ld,t._currentValue),t._currentValue=s}function Bs(e){e._currentValue=Ld.current,rt(Ld)}function xc(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function $d(e,t,s,o){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var x=u.child;h=h.firstContext;e:for(;h!==null;){var w=h;h=u;for(var z=0;z<t.length;z++)if(w.context===t[z]){h.lanes|=s,w=h.alternate,w!==null&&(w.lanes|=s),xc(h.return,s,e),o||(x=null);break e}h=w.next}}else if(u.tag===18){if(x=u.return,x===null)throw Error(i(341));x.lanes|=s,h=x.alternate,h!==null&&(h.lanes|=s),xc(x,s,e),x=null}else u.tag===13&&u.memoizedState!==null&&u.memoizedState.dehydrated===null?(u.lanes|=s,x=u.alternate,x!==null&&(x.lanes|=s),xc(u.return,s,e),x=u.child,x=x!==null?x.sibling:null):x=u.child;if(x!==null)x.return=u;else for(x=u;x!==null;){if(x===e){x=null;break}if(u=x.sibling,u!==null){u.return=x.return,x=u;break}x=x.return}u=x}}function ua(e,t,s,o){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var x=u.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var w=u.type;Cn(u.pendingProps.value,x.value)||(e!==null?e.push(w):e=[w])}}else if(u===hn.current){if(x=u.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Oi):e=[Oi])}u=u.return}return e!==null&&$d(t,e,s,o),t.flags|=262144,e!==null}function yc(e){for(e=e.firstContext;e!==null;){if(!Cn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function da(e){ca=e,Fs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return R0(ca,e)}function Sc(e,t){return ca===null&&da(e),R0(e,t)}function R0(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Fs===null){if(e===null)throw Error(i(308));Fs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fs=Fs.next=t;return s}var lb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},ab=n.unstable_scheduleCallback,ib=n.unstable_NormalPriority,yt={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hd(){return{controller:new lb,data:new Map,refCount:0}}function $o(e){e.refCount--,e.refCount===0&&ab(ib,function(){e.controller.abort()})}function A0(e,t){if((e.pendingLanes&4194048)!==0){var s=e.transitionTypes;for(s===null&&(s=e.transitionTypes=[]),e=0;e<t.length;e++){var o=t[e];s.indexOf(o)===-1&&s.push(o)}}}var Ho=null;function ob(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Uo=null,Ud=0,ha=0,ri=null;function rb(e,t){if(Uo===null){var s=Uo=[];Ud=0,ha=tf(),ri={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Ud++,t.then(O0,O0),t}function O0(){if(--Ud===0&&(Ho=null,Uo!==null)){ri!==null&&(ri.status="fulfilled");var e=Uo;Uo=null,ha=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function cb(e,t){var s=[],o={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){o.status="fulfilled",o.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(o.status="rejected",o.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),o}var z0=me.S;me.S=function(e,t){if(C1=Fe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&rb(e,t),Ho!==null)for(var s=Mi;s!==null;)A0(s,Ho),s=s.next;if(s=e.types,s!==null){for(var o=Mi;o!==null;)A0(o,s),o=o.next;if(ha!==0){o=Ho,o===null&&(o=Ho=[]);for(var u=0;u<s.length;u++){var h=s[u];o.indexOf(h)===-1&&o.push(h)}}}z0!==null&&z0(e,t)};var fa=kt(null);function Fd(){var e=fa.current;return e!==null?e:lt.pooledCache}function bc(e,t){t===null?qe(fa,fa.current):qe(fa,t.pool)}function D0(){var e=Fd();return e===null?null:{parent:yt._currentValue,pool:e}}var ci=Error(i(460)),Bd=Error(i(474)),jc=Error(i(542)),wc={then:function(){}};function k0(e){return e=e.status,e==="fulfilled"||e==="rejected"}function L0(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(ds,ds),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,H0(e),e===void 0&&!("reason"in t)?Error(i(600)):e;default:if(typeof t.status=="string")t.then(ds,ds);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(o){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=o}},function(o){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=o}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,H0(e),e}throw ga=t,ci}}function ma(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ga=s,ci):s}}var ga=null;function $0(){if(ga===null)throw Error(i(459));var e=ga;return ga=null,e}function H0(e){if(e===ci||e===jc)throw Error(i(483))}var ui=null,Fo=0;function Nc(e){var t=Fo;return Fo+=1,ui===null&&(ui=[]),L0(ui,e,t)}function gl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cc(e,t){throw t.$$typeof===I?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function U0(e){function t(V,H){if(e){var Q=V.deletions;Q===null?(V.deletions=[H],V.flags|=16):Q.push(H)}}function s(V,H){if(!e)return null;for(;H!==null;)t(V,H),H=H.sibling;return null}function o(V){for(var H=new Map;V!==null;)V.key===null?H.set(V.index,V):H.set(V.key,V),V=V.sibling;return H}function u(V,H){return V=Hs(V,H),V.index=0,V.sibling=null,V}function h(V,H,Q){return V.index=Q,e?(Q=V.alternate,Q!==null?(Q=Q.index,Q<H?(V.flags|=2,H):Q):(V.flags|=134217730,H)):(V.flags|=1048576,H)}function x(V){return e&&V.alternate===null&&(V.flags|=134217730),V}function w(V,H,Q,ee){return H===null||H.tag!==6?(H=Ad(Q,V.mode,ee),H.return=V,H):(H=u(H,Q),H.return=V,H)}function z(V,H,Q,ee){var pe=Q.type;return pe===se?(V=X(V,H,Q.props.children,ee,Q.key),gl(V,Q),V):H!==null&&(H.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ae&&ma(pe)===H.type)?(H=u(H,Q.props),gl(H,Q),H.return=V,H):(H=mc(Q.type,Q.key,Q.props,null,V.mode,ee),gl(H,Q),H.return=V,H)}function G(V,H,Q,ee){return H===null||H.tag!==4||H.stateNode.containerInfo!==Q.containerInfo||H.stateNode.implementation!==Q.implementation?(H=Od(Q,V.mode,ee),H.return=V,H):(H=u(H,Q.children||[]),H.return=V,H)}function X(V,H,Q,ee,pe){return H===null||H.tag!==7?(H=oa(Q,V.mode,ee,pe),H.return=V,H):(H=u(H,Q),H.return=V,H)}function te(V,H,Q){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=Ad(""+H,V.mode,Q),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case K:return Q=mc(H.type,H.key,H.props,null,V.mode,Q),gl(Q,H),Q.return=V,Q;case O:return H=Od(H,V.mode,Q),H.return=V,H;case ae:return H=ma(H),te(V,H,Q)}if(we(H)||re(H))return H=oa(H,V.mode,Q,null),H.return=V,H;if(typeof H.then=="function")return te(V,Nc(H),Q);if(H.$$typeof===le)return te(V,Sc(V,H),Q);Cc(V,H)}return null}function B(V,H,Q,ee){var pe=H!==null?H.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return pe!==null?null:w(V,H,""+Q,ee);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:return Q.key===pe?z(V,H,Q,ee):null;case O:return Q.key===pe?G(V,H,Q,ee):null;case ae:return Q=ma(Q),B(V,H,Q,ee)}if(we(Q)||re(Q))return pe!==null?null:X(V,H,Q,ee,null);if(typeof Q.then=="function")return B(V,H,Nc(Q),ee);if(Q.$$typeof===le)return B(V,H,Sc(V,Q),ee);Cc(V,Q)}return null}function Y(V,H,Q,ee,pe){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return V=V.get(Q)||null,w(H,V,""+ee,pe);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case K:return V=V.get(ee.key===null?Q:ee.key)||null,z(H,V,ee,pe);case O:return V=V.get(ee.key===null?Q:ee.key)||null,G(H,V,ee,pe);case ae:return ee=ma(ee),Y(V,H,Q,ee,pe)}if(we(ee)||re(ee))return V=V.get(Q)||null,X(H,V,ee,pe,null);if(typeof ee.then=="function")return Y(V,H,Q,Nc(ee),pe);if(ee.$$typeof===le)return Y(V,H,Q,Sc(H,ee),pe);Cc(H,ee)}return null}function fe(V,H,Q,ee){for(var pe=null,He=null,be=H,Me=H=0,jt=null;be!==null&&Me<Q.length;Me++){be.index>Me?(jt=be,be=null):jt=be.sibling;var Ge=B(V,be,Q[Me],ee);if(Ge===null){be===null&&(be=jt);break}e&&be&&Ge.alternate===null&&t(V,be),H=h(Ge,H,Me),He===null?pe=Ge:He.sibling=Ge,He=Ge,be=jt}if(Me===Q.length)return s(V,be),De&&Us(V,Me),pe;if(be===null){for(;Me<Q.length;Me++)be=te(V,Q[Me],ee),be!==null&&(H=h(be,H,Me),He===null?pe=be:He.sibling=be,He=be);return De&&Us(V,Me),pe}for(be=o(be);Me<Q.length;Me++)jt=Y(be,V,Me,Q[Me],ee),jt!==null&&(e&&(Ge=jt.alternate,Ge!==null&&be.delete(Ge.key===null?Me:Ge.key)),H=h(jt,H,Me),He===null?pe=jt:He.sibling=jt,He=jt);return e&&be.forEach(function(Dl){return t(V,Dl)}),De&&Us(V,Me),pe}function ve(V,H,Q,ee){if(Q==null)throw Error(i(151));for(var pe=null,He=null,be=H,Me=H=0,jt=null,Ge=Q.next();be!==null&&!Ge.done;Me++,Ge=Q.next()){be.index>Me?(jt=be,be=null):jt=be.sibling;var Dl=B(V,be,Ge.value,ee);if(Dl===null){be===null&&(be=jt);break}e&&be&&Dl.alternate===null&&t(V,be),H=h(Dl,H,Me),He===null?pe=Dl:He.sibling=Dl,He=Dl,be=jt}if(Ge.done)return s(V,be),De&&Us(V,Me),pe;if(be===null){for(;!Ge.done;Me++,Ge=Q.next())Ge=te(V,Ge.value,ee),Ge!==null&&(H=h(Ge,H,Me),He===null?pe=Ge:He.sibling=Ge,He=Ge);return De&&Us(V,Me),pe}for(be=o(be);!Ge.done;Me++,Ge=Q.next())Ge=Y(be,V,Me,Ge.value,ee),Ge!==null&&(e&&(jt=Ge.alternate,jt!==null&&be.delete(jt.key===null?Me:jt.key)),H=h(Ge,H,Me),He===null?pe=Ge:He.sibling=Ge,He=Ge);return e&&be.forEach(function(Gj){return t(V,Gj)}),De&&Us(V,Me),pe}function Ae(V,H,Q,ee){if(typeof Q=="object"&&Q!==null&&Q.type===se&&Q.key===null&&Q.props.ref===void 0&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case K:e:{for(var pe=Q.key;H!==null;){if(H.key===pe){if(pe=Q.type,pe===se){if(H.tag===7){s(V,H.sibling),ee=u(H,Q.props.children),gl(ee,Q),ee.return=V,V=ee;break e}}else if(H.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===ae&&ma(pe)===H.type){s(V,H.sibling),ee=u(H,Q.props),gl(ee,Q),ee.return=V,V=ee;break e}s(V,H);break}else t(V,H);H=H.sibling}Q.type===se?(ee=oa(Q.props.children,V.mode,ee,Q.key),gl(ee,Q),ee.return=V,V=ee):(ee=mc(Q.type,Q.key,Q.props,null,V.mode,ee),gl(ee,Q),ee.return=V,V=ee)}return x(V);case O:e:{for(pe=Q.key;H!==null;){if(H.key===pe)if(H.tag===4&&H.stateNode.containerInfo===Q.containerInfo&&H.stateNode.implementation===Q.implementation){s(V,H.sibling),ee=u(H,Q.children||[]),ee.return=V,V=ee;break e}else{s(V,H);break}else t(V,H);H=H.sibling}ee=Od(Q,V.mode,ee),ee.return=V,V=ee}return x(V);case ae:return Q=ma(Q),Ae(V,H,Q,ee)}if(we(Q))return fe(V,H,Q,ee);if(re(Q)){if(pe=re(Q),typeof pe!="function")throw Error(i(150));return Q=pe.call(Q),ve(V,H,Q,ee)}if(typeof Q.then=="function")return Ae(V,H,Nc(Q),ee);if(Q.$$typeof===le)return Ae(V,H,Sc(V,Q),ee);Cc(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,H!==null&&H.tag===6?(s(V,H.sibling),ee=u(H,Q),ee.return=V,V=ee):(s(V,H),ee=Ad(Q,V.mode,ee),ee.return=V,V=ee),x(V)):s(V,H)}return function(V,H,Q,ee){try{Fo=0;var pe=Ae(V,H,Q,ee);return ui=null,pe}catch(be){if(be===ci||be===jc)throw be;var He=gn(29,be,null,V.mode);return He.lanes=ee,He.return=V,He}finally{}}}var pa=U0(!0),F0=U0(!1),pl=!1;function Vd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function vl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xl(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Xe&2)!==0){var u=o.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),o.pending=t,t=fc(e),w0(e,null,s),t}return hc(e,o,t,s),fc(e)}function Bo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,bo(e,s)}}function qd(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var u=null,h=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};h===null?u=h=x:h=h.next=x,s=s.next}while(s!==null);h===null?u=h=t:h=h.next=t}else u=h=t;s={baseState:o.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Id=!1;function Vo(){if(Id){var e=ri;if(e!==null)throw e}}function Go(e,t,s,o){Id=!1;var u=e.updateQueue;pl=!1;var h=u.firstBaseUpdate,x=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var z=w,G=z.next;z.next=null,x===null?h=G:x.next=G,x=z;var X=e.alternate;X!==null&&(X=X.updateQueue,w=X.lastBaseUpdate,w!==x&&(w===null?X.firstBaseUpdate=G:w.next=G,X.lastBaseUpdate=z))}if(h!==null){var te=u.baseState;x=0,X=G=z=null,w=h;do{var B=w.lane&-536870913,Y=B!==w.lane;if(Y?($e&B)===B:(o&B)===B){B!==0&&B===ha&&(Id=!0),X!==null&&(X=X.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var fe=e,ve=w;B=t;var Ae=s;switch(ve.tag){case 1:if(fe=ve.payload,typeof fe=="function"){te=fe.call(Ae,te,B);break e}te=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ve.payload,B=typeof fe=="function"?fe.call(Ae,te,B):fe,B==null)break e;te=k({},te,B);break e;case 2:pl=!0}}B=w.callback,B!==null&&(e.flags|=64,Y&&(e.flags|=8192),Y=u.callbacks,Y===null?u.callbacks=[B]:Y.push(B))}else Y={lane:B,tag:w.tag,payload:w.payload,callback:w.callback,next:null},X===null?(G=X=Y,z=te):X=X.next=Y,x|=B;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;Y=w,w=Y.next,Y.next=null,u.lastBaseUpdate=Y,u.shared.pending=null}}while(!0);X===null&&(z=te),u.baseState=z,u.firstBaseUpdate=G,u.lastBaseUpdate=X,h===null&&(u.shared.lanes=0),Cl|=x,e.lanes=x,e.memoizedState=te}}function B0(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function V0(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)B0(s[e],t)}var yl=kt(null),Mc=kt(0);function G0(e,t){e=Ps,qe(Mc,e),qe(yl,t),Ps=e|t.baseLanes}function Pd(){qe(Mc,Ps),qe(yl,yl.current)}function Qd(){Ps=Mc.current,rt(yl),rt(Mc)}var Ht=kt(null),Zt=null;function Sl(e){var t=e.alternate;qe(Ut,Ut.current&1),qe(Ht,e),Zt===null&&(t===null||yl.current!==null||t.memoizedState!==null)&&(Zt=e)}function Yd(e){qe(Ut,Ut.current),qe(Ht,e),Zt===null&&(Zt=e)}function q0(e){e.tag===22?(qe(Ut,Ut.current),qe(Ht,e),Zt===null&&(Zt=e)):bl()}function bl(){qe(Ut,Ut.current),qe(Ht,Ht.current)}function Mn(e){rt(Ht),Zt===e&&(Zt=null),rt(Ut)}var Ut=kt(0);function qo(e,t){qe(Ht,Ht.current),qe(Ut,t)}function Xd(e){rt(Ut),rt(Ht),Zt===e&&(Zt=null)}function Ec(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||xf(s)||yf(s)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vs=0,Re=null,nt=null,St=null,_c=!1,di=!1,va=!1,Tc=0,Io=0,hi=null,ub=0;function ft(){throw Error(i(321))}function Kd(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Cn(e[s],t[s]))return!1;return!0}function Zd(e,t,s,o,u,h){return Vs=h,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,me.H=e===null||e.memoizedState===null?Ep:_p,va=!1,h=s(o,u),va=!1,di&&(h=P0(t,s,o,u)),I0(e),h}function I0(e){me.H=Lc;var t=nt!==null&&nt.next!==null;if(Vs=0,St=nt=Re=null,_c=!1,Io=0,hi=null,t)throw Error(i(300));e===null||bt||(e=e.dependencies,e!==null&&yc(e)&&(bt=!0))}function P0(e,t,s,o){Re=e;var u=0;do{if(di&&(hi=null),Io=0,di=!1,25<=u)throw Error(i(301));if(u+=1,St=nt=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}me.H=xb,h=t(s,o)}while(di);return h}function db(){var e=me.H,t=e.useState()[0];return t=typeof t.then=="function"?Po(t):t,e=e.useState()[0],(nt!==null?nt.memoizedState:null)!==e&&(Re.flags|=1024),t}function Jd(){var e=Tc!==0;return Tc=0,e}function Wd(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function eh(e){if(_c){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_c=!1}Vs=0,St=nt=Re=null,di=!1,Io=Tc=0,hi=null}function ln(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Re.memoizedState=St=e:St=St.next=e,St}function vt(){if(nt===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=nt.next;var t=St===null?Re.memoizedState:St.next;if(t!==null)St=t,nt=e;else{if(e===null)throw Re.alternate===null?Error(i(467)):Error(i(310));nt=e,e={memoizedState:nt.memoizedState,baseState:nt.baseState,baseQueue:nt.baseQueue,queue:nt.queue,next:null},St===null?Re.memoizedState=St=e:St=St.next=e}return St}function Rc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(e){var t=Io;return Io+=1,hi===null&&(hi=[]),e=L0(hi,e,t),t=Re,(St===null?t.memoizedState:St.next)===null&&(t=t.alternate,me.H=t===null||t.memoizedState===null?Ep:_p),e}function Ac(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Po(e);if(e.$$typeof===U)return;if(e.$$typeof===le)return $t(e)}throw Error(i(438,String(e)))}function th(e){var t=null,s=Re.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var o=Re.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(t={data:o.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Rc(),Re.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),o=0;o<e;o++)s[o]=je;return t.index++,s}function Gs(e,t){return typeof t=="function"?t(e):t}function Oc(e){var t=vt();return nh(t,nt,e)}function nh(e,t,s){var o=e.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=s;var u=e.baseQueue,h=o.pending;if(h!==null){if(u!==null){var x=u.next;u.next=h.next,h.next=x}t.baseQueue=u=h,o.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var w=x=null,z=null,G=t,X=!1;do{var te=G.lane&-536870913;if(te!==G.lane?($e&te)===te:(Vs&te)===te){var B=G.revertLane;if(B===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),te===ha&&(X=!0);else if((Vs&B)===B){G=G.next,B===ha&&(X=!0);continue}else te={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},z===null?(w=z=te,x=h):z=z.next=te,Re.lanes|=B,Cl|=B;te=G.action,va&&s(h,te),h=G.hasEagerState?G.eagerState:s(h,te)}else B={lane:te,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},z===null?(w=z=B,x=h):z=z.next=B,Re.lanes|=te,Cl|=te;G=G.next}while(G!==null&&G!==t);if(z===null?x=h:z.next=w,!Cn(h,e.memoizedState)&&(bt=!0,X&&(s=ri,s!==null)))throw s;e.memoizedState=h,e.baseState=x,e.baseQueue=z,o.lastRenderedState=h}return u===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function sh(e){var t=vt(),s=t.queue;if(s===null)throw Error(i(311));s.lastRenderedReducer=e;var o=s.dispatch,u=s.pending,h=t.memoizedState;if(u!==null){s.pending=null;var x=u=u.next;do h=e(h,x.action),x=x.next;while(x!==u);Cn(h,t.memoizedState)||(bt=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),s.lastRenderedState=h}return[h,o]}function Q0(e,t,s){var o=Re,u=vt(),h=De;if(h){if(s===void 0)throw Error(i(407));s=s()}else s=t();var x=!Cn((nt||u).memoizedState,s);if(x&&(u.memoizedState=s,bt=!0),u=u.queue,ih(K0.bind(null,o,u,e),[e]),e=u.getSnapshot!==t||x||St!==null&&(St.memoizedState.tag&1)!==0,fi(e?9:8,{destroy:void 0},X0.bind(null,o,u,s,t),null),e){if(o.flags|=2048,lt===null)throw Error(i(349));h||(Vs&127)!==0||Y0(o,t,s)}return s}function Y0(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Re.updateQueue,t===null?(t=Rc(),Re.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function X0(e,t,s,o){t.value=s,t.getSnapshot=o,Z0(t)&&J0(e)}function K0(e,t,s){return s(function(){Z0(t)&&J0(e)})}function Z0(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Cn(e,s)}catch{return!0}}function J0(e){var t=ia(e,2);t!==null&&yn(t,e,2)}function lh(e){var t=ln();if(typeof e=="function"){var s=e;if(e=s(),va){rs(!0);try{s()}finally{rs(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:e},t}function W0(e,t,s,o){return e.baseState=s,nh(e,nt,typeof o=="function"?o:Gs)}function hb(e,t,s,o,u){if(kc(e))throw Error(i(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){h.listeners.push(x)}};me.T!==null?s(!0):h.isTransition=!1,o(h),s=t.pending,s===null?(h.next=t.pending=h,ep(t,h)):(h.next=s.next,t.pending=s.next=h)}}function ep(e,t){var s=t.action,o=t.payload,u=e.state;if(t.isTransition){var h=me.T,x={};x.types=h!==null?h.types:null,me.T=x;try{var w=s(u,o),z=me.S;z!==null&&z(x,w),tp(e,t,w)}catch(G){ah(e,t,G)}finally{h!==null&&x.types!==null&&(h.types=x.types),me.T=h}}else try{h=s(u,o),tp(e,t,h)}catch(G){ah(e,t,G)}}function tp(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){np(e,t,o)},function(o){return ah(e,t,o)}):np(e,t,s)}function np(e,t,s){t.status="fulfilled",t.value=s,sp(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,ep(e,s)))}function ah(e,t,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do t.status="rejected",t.reason=s,sp(t),t=t.next;while(t!==o)}e.action=null}function sp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function lp(e,t){return t}function ap(e,t){if(De){var s=lt.formState;if(s!==null){e:{var o=Re;if(De){if(at){t:{for(var u=at,h=Bn;u.nodeType!==8;){if(!h){u=null;break t}if(u=Gn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){at=Gn(u.nextSibling),o=u.data==="F!";break e}}fl(o)}o=!1}o&&(t=s[0])}}return s=ln(),s.memoizedState=s.baseState=t,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lp,lastRenderedState:t},s.queue=o,s=Np.bind(null,Re,o),o.dispatch=s,o=lh(!1),h=dh.bind(null,Re,!1,o.queue),o=ln(),u={state:t,dispatch:null,action:e,pending:null},o.queue=u,s=hb.bind(null,Re,u,h,s),u.dispatch=s,o.memoizedState=e,[t,s,!1]}function ip(e){var t=vt();return op(t,nt,e)}function op(e,t,s){if(t=nh(e,t,lp)[0],e=Oc(Gs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var o=Po(t)}catch(x){throw x===ci?jc:x}else o=t;t=vt();var u=t.queue,h=u.dispatch;return s!==t.memoizedState&&(Re.flags|=2048,fi(9,{destroy:void 0},fb.bind(null,u,s),null)),[o,h,e]}function fb(e,t){e.action=t}function rp(e){var t=vt(),s=nt;if(s!==null)return op(t,s,e);vt(),t=t.memoizedState,s=vt();var o=s.queue.dispatch;return s.memoizedState=e,[t,o,!1]}function fi(e,t,s,o){return e={tag:e,create:s,deps:o,inst:t,next:null},t=Re.updateQueue,t===null&&(t=Rc(),Re.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e),e}function cp(){return vt().memoizedState}function zc(e,t,s,o){var u=ln();Re.flags|=e,u.memoizedState=fi(1|t,{destroy:void 0},s,o===void 0?null:o)}function Dc(e,t,s,o){var u=vt();o=o===void 0?null:o;var h=u.memoizedState.inst;nt!==null&&o!==null&&Kd(o,nt.memoizedState.deps)?u.memoizedState=fi(t,h,s,o):(Re.flags|=e,u.memoizedState=fi(1|t,h,s,o))}function up(e,t){zc(8390656,8,e,t)}function ih(e,t){Dc(2048,8,e,t)}function mb(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=Rc(),Re.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function dp(e){var t=vt().memoizedState;return mb({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function hp(e,t){return Dc(4,2,e,t)}function fp(e,t){return Dc(4,4,e,t)}function mp(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gp(e,t,s){s=s!=null?s.concat([e]):null,Dc(4,4,mp.bind(null,t,e),s)}function oh(){}function pp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;return t!==null&&Kd(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function vp(e,t){var s=vt();t=t===void 0?null:t;var o=s.memoizedState;if(t!==null&&Kd(t,o[1]))return o[0];if(o=e(),va){rs(!0);try{e()}finally{rs(!1)}}return s.memoizedState=[o,t],o}function rh(e,t,s){return s===void 0||(Vs&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=E1(),Re.lanes|=e,Cl|=e,s)}function xp(e,t,s,o){return Cn(s,t)?s:yl.current!==null?(e=rh(e,s,o),Cn(e,t)||(bt=!0),e):(Vs&106)===0||(Vs&1073741824)!==0&&($e&261930)===0?(bt=!0,e.memoizedState=s):(e=E1(),Re.lanes|=e,Cl|=e,t)}function yp(e,t,s,o,u){var h=Se.p;Se.p=h!==0&&8>h?h:8;var x=me.T,w={};w.types=x!==null?x.types:null,me.T=w,dh(e,!1,t,s);try{var z=u(),G=me.S;if(G!==null&&G(w,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var X=cb(z,o);Qo(e,t,X,Rn(e))}else Qo(e,t,o,Rn(e))}catch(te){Qo(e,t,{then:function(){},status:"rejected",reason:te},Rn())}finally{Se.p=h,x!==null&&w.types!==null&&(x.types=w.types),me.T=x}}function gb(){}function ch(e,t,s,o){if(e.tag!==5)throw Error(i(476));var u=Sp(e).queue;yp(e,u,t,gt,s===null?gb:function(){return bp(e),s(o)})}function Sp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:gt,baseState:gt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:gt},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function bp(e){var t=Sp(e);t.next===null&&(t=e.alternate.memoizedState),Qo(e,t.next.queue,{},Rn())}function uh(){return $t(Oi)}function jp(){return vt().memoizedState}function wp(){return vt().memoizedState}function pb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Rn();e=vl(s);var o=xl(t,e,s);o!==null&&(yn(o,t,s),Bo(o,t,s)),t={cache:Hd()},e.payload=t;return}t=t.return}}function vb(e,t,s){var o=Rn();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},kc(e)?Cp(t,s):(s=Td(e,t,s,o),s!==null&&(yn(s,e,o),Mp(s,t,o)))}function Np(e,t,s){var o=Rn();Qo(e,t,s,o)}function Qo(e,t,s,o){var u={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(kc(e))Cp(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var x=t.lastRenderedState,w=h(x,s);if(u.hasEagerState=!0,u.eagerState=w,Cn(w,x))return hc(e,t,u,0),lt===null&&dc(),!1}catch{}finally{}if(s=Td(e,t,u,o),s!==null)return yn(s,e,o),Mp(s,t,o),!0}return!1}function dh(e,t,s,o){if(o={lane:2,revertLane:tf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},kc(e)){if(t)throw Error(i(479))}else t=Td(e,s,o,2),t!==null&&yn(t,e,2)}function kc(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function Cp(e,t){di=_c=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Mp(e,t,s){if((s&4194048)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,bo(e,s)}}var Lc={readContext:$t,use:Ac,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft,useEffectEvent:ft},Ep={readContext:$t,use:Ac,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:up,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,zc(4194308,4,mp.bind(null,t,e),s)},useLayoutEffect:function(e,t){return zc(4194308,4,e,t)},useInsertionEffect:function(e,t){zc(4,2,e,t)},useMemo:function(e,t){var s=ln();t=t===void 0?null:t;var o=e();if(va){rs(!0);try{e()}finally{rs(!1)}}return s.memoizedState=[o,t],o},useReducer:function(e,t,s){var o=ln();if(s!==void 0){var u=s(t);if(va){rs(!0);try{s(t)}finally{rs(!1)}}}else u=t;return o.memoizedState=o.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},o.queue=e,e=e.dispatch=vb.bind(null,Re,e),[o.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:function(e){e=lh(e);var t=e.queue,s=Np.bind(null,Re,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:oh,useDeferredValue:function(e,t){var s=ln();return rh(s,e,t)},useTransition:function(){var e=lh(!1);return e=yp.bind(null,Re,e.queue,!0,!1),ln().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var o=Re,u=ln();if(De){if(s===void 0)throw Error(i(407));s=s()}else{if(s=t(),lt===null)throw Error(i(349));($e&127)!==0||Y0(o,t,s)}u.memoizedState=s;var h={value:s,getSnapshot:t};return u.queue=h,up(K0.bind(null,o,h,e),[e]),o.flags|=2048,fi(9,{destroy:void 0},X0.bind(null,o,h,s,t),null),s},useId:function(){var e=ln(),t=lt.identifierPrefix;if(De){var s=fs,o=hs;s=(o&~(1<<32-Lt(o)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Tc++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=ub++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:uh,useFormState:ap,useActionState:ap,useOptimistic:function(e){var t=ln();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=dh.bind(null,Re,!0,s),s.dispatch=t,[e,t]},useMemoCache:th,useCacheRefresh:function(){return ln().memoizedState=pb.bind(null,Re)},useEffectEvent:function(e){var t=ln(),s={impl:e};return t.memoizedState=s,function(){if((Xe&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}},_p={readContext:$t,use:Ac,useCallback:pp,useContext:$t,useEffect:ih,useImperativeHandle:gp,useInsertionEffect:hp,useLayoutEffect:fp,useMemo:vp,useReducer:Oc,useRef:cp,useState:function(){return Oc(Gs)},useDebugValue:oh,useDeferredValue:function(e,t){var s=vt();return xp(s,nt.memoizedState,e,t)},useTransition:function(){var e=Oc(Gs)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Po(e),t]},useSyncExternalStore:Q0,useId:jp,useHostTransitionStatus:uh,useFormState:ip,useActionState:ip,useOptimistic:function(e,t){var s=vt();return W0(s,nt,e,t)},useMemoCache:th,useCacheRefresh:wp,useEffectEvent:dp},xb={readContext:$t,use:Ac,useCallback:pp,useContext:$t,useEffect:ih,useImperativeHandle:gp,useInsertionEffect:hp,useLayoutEffect:fp,useMemo:vp,useReducer:sh,useRef:cp,useState:function(){return sh(Gs)},useDebugValue:oh,useDeferredValue:function(e,t){var s=vt();return nt===null?rh(s,e,t):xp(s,nt.memoizedState,e,t)},useTransition:function(){var e=sh(Gs)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Po(e),t]},useSyncExternalStore:Q0,useId:jp,useHostTransitionStatus:uh,useFormState:rp,useActionState:rp,useOptimistic:function(e,t){var s=vt();return nt!==null?W0(s,nt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:th,useCacheRefresh:wp,useEffectEvent:dp};function hh(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:k({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var fh={enqueueSetState:function(e,t,s){e=e._reactInternals;var o=Rn(),u=vl(o);u.payload=t,s!=null&&(u.callback=s),t=xl(e,u,o),t!==null&&(yn(t,e,o),Bo(t,e,o))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=Rn(),u=vl(o);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=xl(e,u,o),t!==null&&(yn(t,e,o),Bo(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Rn(),o=vl(s);o.tag=2,t!=null&&(o.callback=t),t=xl(e,o,s),t!==null&&(yn(t,e,s),Bo(t,e,s))}};function Tp(e,t,s,o,u,h,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,h,x):t.prototype&&t.prototype.isPureReactComponent?!zo(s,o)||!zo(u,h):!0}function Rp(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&fh.enqueueReplaceState(t,t.state,null)}function xa(e,t){var s=t;if("ref"in t){s={};for(var o in t)o!=="ref"&&(s[o]=t[o])}if(e=e.defaultProps){s===t&&(s=k({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Ap(e){uc(e)}function Op(e){console.error(e)}function zp(e){uc(e)}function $c(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(o){setTimeout(function(){throw o})}}function Dp(e,t,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function mh(e,t,s){return s=vl(s),s.tag=3,s.payload={element:null},s.callback=function(){$c(e,t)},s}function kp(e){return e=vl(e),e.tag=3,e}function Lp(e,t,s,o){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var h=o.value;e.payload=function(){return u(h)},e.callback=function(){Dp(t,s,o)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){Dp(t,s,o),typeof u!="function"&&(Ml===null?Ml=new Set([this]):Ml.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function yb(e,t,s,o,u){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(t=s.alternate,t!==null&&ua(t,s,u,!0),s=Ht.current,s!==null){switch(s.tag){case 31:case 13:case 19:return Zt===null?lu():s.alternate===null&&mt===0&&(mt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,o===wc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([o]):t.add(o),Jh(e,o,u)),!1;case 22:return s.flags|=65536,o===wc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([o]):s.add(o)),Jh(e,o,u)),!1}throw Error(i(435,s.tag))}return Jh(e,o,u),lu(),!1}if(De)return t=Ht.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,o!==Dd&&(e=Error(i(422),{cause:o}),Lo(Hn(e,s)))):(o!==Dd&&(t=Error(i(423),{cause:o}),Lo(Hn(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,o=Hn(o,s),u=mh(e.stateNode,o,u),qd(e,u),mt!==4&&(mt=2)),!1;var h=Error(i(520),{cause:o});if(h=Hn(h,s),tr===null?tr=[h]:tr.push(h),mt!==4&&(mt=2),t===null)return!0;o=Hn(o,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=mh(s.stateNode,o,e),qd(s,e),!1;case 1:if(t=s.type,h=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ml===null||!Ml.has(h))))return s.flags|=65536,u&=-u,s.lanes|=u,u=kp(u),Lp(u,e,s,o),qd(s,u),!1;break;case 22:if(s.memoizedState!==null)return s.flags|=65536,!1}s=s.return}while(s!==null);return!1}var gh=Error(i(461)),bt=!1;function Nt(e,t,s,o){t.child=e===null?F0(t,null,s,o):pa(t,e.child,s,o)}function $p(e,t,s,o,u){s=s.render;var h=t.ref;if("ref"in o){var x={};for(var w in o)w!=="ref"&&(x[w]=o[w])}else x=o;return da(t),o=Zd(e,t,s,x,h,u),w=Jd(),e!==null&&!bt?(Wd(e,t,u),qs(e,t,u)):(De&&w&&pc(t),t.flags|=1,Nt(e,t,o,u),t.child)}function Hp(e,t,s,o,u){if(e===null){var h=s.type;return typeof h=="function"&&!Rd(h)&&h.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=h,Up(e,t,h,o,u)):(e=mc(s.type,null,o,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!wh(e,u)){var x=h.memoizedProps;if(s=s.compare,s=s!==null?s:zo,s(x,o)&&e.ref===t.ref)return qs(e,t,u)}return t.flags|=1,e=Hs(h,o),e.ref=t.ref,e.return=t,t.child=e}function Up(e,t,s,o,u){if(e!==null){var h=e.memoizedProps;if(zo(h,o)&&e.ref===t.ref)if(bt=!1,t.pendingProps=o=h,wh(e,u))(e.flags&131072)!==0&&(bt=!0);else return t.lanes=e.lanes,qs(e,t,u)}return ph(e,t,s,o,u)}function Fp(e,t,s,o){var u=o.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|s:s,e!==null){for(o=t.child=e.child,u=0;o!==null;)u=u|o.lanes|o.childLanes,o=o.sibling;o=u&~h}else o=0,t.child=null;return Bp(e,t,h,s,o)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&bc(t,h!==null?h.cachePool:null),h!==null?G0(t,h):Pd(),q0(t);else return o=t.lanes=536870912,Bp(e,t,h!==null?h.baseLanes|s:s,s,o)}else h!==null?(bc(t,h.cachePool),G0(t,h),bl(),t.memoizedState=null):(e!==null&&bc(t,null),Pd(),bl());return Nt(e,t,u,s),t.child}function Yo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bp(e,t,s,o,u){var h=Fd();return h=h===null?null:{parent:yt._currentValue,pool:h},t.memoizedState={baseLanes:s,cachePool:h},e!==null&&bc(t,null),Pd(),q0(t),e!==null&&ua(e,t,o,!0),t.childLanes=u,null}function Hc(e,t){return t=Uc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vp(e,t,s){return pa(t,e.child,null,s),e=Hc(t,t.pendingProps),e.flags|=2,Mn(t),t.memoizedState=null,e}function Sb(e,t,s){var o=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(o.mode==="hidden")return e=Hc(t,o),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Yo(null,e);if(Yd(t),(e=at)?(e=m2(e,Bn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dl!==null?{id:hs,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},s=C0(e),s.return=t,t.child=s,Rt=t,at=null)):e=null,e===null)throw fl(t);return t.lanes=536870912,null}return Hc(t,o)}var h=e.memoizedState;if(h!==null){var x=h.dehydrated;if(Yd(t),u)if(t.flags&256)t.flags&=-257,t=Vp(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(bt||ua(e,t,s,!1),u=(s&e.childLanes)!==0,bt||u){if(yl.current===null){if(o=lt,o!==null&&(x=jo(o,s),x!==0&&x!==h.retryLane))throw h.retryLane=x,ia(e,x),yn(o,e,x),gh;lu()}t=Vp(e,t,s)}else e=h.treeContext,at=Gn(x.nextSibling),Rt=t,De=!0,hl=null,Bn=!1,e!==null&&_0(t,e),t=Hc(t,o),t.flags|=134221824;return t}return e=Hs(e.child,{mode:o.mode,children:o.children}),e.ref=t.ref,t.child=e,e.return=t,e}function mi(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(i(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function ph(e,t,s,o,u){return da(t),s=Zd(e,t,s,o,void 0,u),o=Jd(),e!==null&&!bt?(Wd(e,t,u),qs(e,t,u)):(De&&o&&pc(t),t.flags|=1,Nt(e,t,s,u),t.child)}function Gp(e,t,s,o,u,h){return da(t),t.updateQueue=null,s=P0(t,o,s,u),I0(e),o=Jd(),e!==null&&!bt?(Wd(e,t,h),qs(e,t,h)):(De&&o&&pc(t),t.flags|=1,Nt(e,t,s,h),t.child)}function qp(e,t,s,o,u){if(da(t),t.stateNode===null){var h=li,x=s.contextType;typeof x=="object"&&x!==null&&(h=$t(x)),h=new s(o,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=fh,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=o,h.state=t.memoizedState,h.refs={},Vd(t),x=s.contextType,h.context=typeof x=="object"&&x!==null?$t(x):li,h.state=t.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(hh(t,s,x,o),h.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(x=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),x!==h.state&&fh.enqueueReplaceState(h,h.state,null),Go(t,o,h,u),Vo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!0}else if(e===null){h=t.stateNode;var w=t.memoizedProps,z=xa(s,w);h.props=z;var G=h.context,X=s.contextType;x=li,typeof X=="object"&&X!==null&&(x=$t(X));var te=s.getDerivedStateFromProps;X=typeof te=="function"||typeof h.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,X||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(w||G!==x)&&Rp(t,h,o,x),pl=!1;var B=t.memoizedState;h.state=B,Go(t,o,h,u),Vo(),G=t.memoizedState,w||B!==G||pl?(typeof te=="function"&&(hh(t,s,te,o),G=t.memoizedState),(z=pl||Tp(t,s,z,o,B,G,x))?(X||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=G),h.props=o,h.state=G,h.context=x,o=z):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{h=t.stateNode,Gd(e,t),x=t.memoizedProps,X=xa(s,x),h.props=X,te=t.pendingProps,B=h.context,G=s.contextType,z=li,typeof G=="object"&&G!==null&&(z=$t(G)),w=s.getDerivedStateFromProps,(G=typeof w=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(x!==te||B!==z)&&Rp(t,h,o,z),pl=!1,B=t.memoizedState,h.state=B,Go(t,o,h,u),Vo();var Y=t.memoizedState;x!==te||B!==Y||pl||e!==null&&e.dependencies!==null&&yc(e.dependencies)?(typeof w=="function"&&(hh(t,s,w,o),Y=t.memoizedState),(X=pl||Tp(t,s,X,o,B,Y,z)||e!==null&&e.dependencies!==null&&yc(e.dependencies))?(G||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,Y,z),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,Y,z)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=Y),h.props=o,h.state=Y,h.context=z,o=X):(typeof h.componentDidUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&B===e.memoizedState||(t.flags|=1024),o=!1)}return h=o,mi(e,t),o=(t.flags&128)!==0,h||o?(h=t.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&o?(t.child=pa(t,e.child,null,u),t.child=pa(t,null,s,u)):Nt(e,t,s,u),t.memoizedState=h.state,e=t.child):e=qs(e,t,u),e}function Ip(e,t,s,o){return ra(),t.flags|=256,Nt(e,t,s,o),t.child}var vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xh(e){return{baseLanes:e,cachePool:D0()}}function yh(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Tn),e}function Pp(e,t,s){var o=t.pendingProps,u=!1,h=(t.flags&128)!==0,x;if((x=h)||(x=e!==null&&e.memoizedState===null?!1:(Ut.current&2)!==0),x&&(u=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(u?Sl(t):bl(),(e=at)?(e=m2(e,Bn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:dl!==null?{id:hs,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},s=C0(e),s.return=t,t.child=s,Rt=t,at=null)):e=null,e===null)throw fl(t);return yf(e)?t.lanes=32:t.lanes=536870912,null}return h=o.children,o=o.fallback,u?(bl(),u=t.mode,h=Uc({mode:"hidden",children:h},u),o=oa(o,u,s,null),h.return=t,o.return=t,h.sibling=o,t.child=h,o=t.child,o.memoizedState=xh(s),o.childLanes=yh(e,x,s),t.memoizedState=vh,Yo(null,o)):(Sl(t),Sh(t,h))}var w=e.memoizedState;if(w!==null){var z=w.dehydrated;if(z!==null)return bb(e,t,h,x,o,z,w,s)}return u?(bl(),u=o.fallback,h=t.mode,w=e.child,z=w.sibling,o=Hs(w,{mode:"hidden",children:o.children}),o.subtreeFlags=w.subtreeFlags&1206910976,z!==null?u=Hs(z,u):(u=oa(u,h,s,null),u.flags|=2),u.return=t,o.return=t,o.sibling=u,t.child=o,Yo(null,o),o=t.child,u=e.child.memoizedState,u===null?u=xh(s):(h=u.cachePool,h!==null?(w=yt._currentValue,h=h.parent!==w?{parent:w,pool:w}:h):h=D0(),u={baseLanes:u.baseLanes|s,cachePool:h}),o.memoizedState=u,o.childLanes=yh(e,x,s),t.memoizedState=vh,Yo(e.child,o)):(Sl(t),s=e.child,e=s.sibling,s=Hs(s,{mode:"visible",children:o.children}),s.return=t,s.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=s,t.memoizedState=null,s)}function Sh(e,t){return t=Uc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Uc(e,t){return e=gn(22,e,null,t),e.lanes=0,e}function Fc(e,t,s){return pa(t,e.child,null,s),e=Sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bb(e,t,s,o,u,h,x,w){if(s)return t.flags&256?(Sl(t),t.flags&=-257,Fc(e,t,w)):t.memoizedState!==null?(bl(),t.child=e.child,t.flags|=128,null):(bl(),h=u.fallback,x=t.mode,u=Uc({mode:"visible",children:u.children},x),h=oa(h,x,w,null),h.flags|=2,u.return=t,h.return=t,u.sibling=h,t.child=u,pa(t,e.child,null,w),u=t.child,u.memoizedState=xh(w),u.childLanes=yh(e,o,w),t.memoizedState=vh,Yo(null,u));if(Sl(t),yf(h)){if(o=h.nextSibling&&h.nextSibling.dataset,o)var z=o.dgst;return o=z,o!==""&&(u=Error(i(419)),u.stack="",u.digest=o,Lo({value:u,source:null,stack:null})),Fc(e,t,w)}if(bt||ua(e,t,w,!1),o=(w&e.childLanes)!==0,bt||o){if(yl.current!==null)return Fc(e,t,w);if(o=lt,o!==null&&(u=jo(o,w),u!==0&&u!==x.retryLane))throw x.retryLane=u,ia(e,u),yn(o,e,u),gh;return xf(h)||lu(),Fc(e,t,w)}return xf(h)?(t.flags|=192,t.child=e.child,null):(e=x.treeContext,at=Gn(h.nextSibling),Rt=t,De=!0,hl=null,Bn=!1,e!==null&&_0(t,e),t=Sh(t,u.children),t.flags|=134221824,t)}function Qp(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),xc(e.return,t,s)}function Yp(e){for(var t=null;e!==null;){var s=e.alternate;s!==null&&Ec(s)===null&&(t=e),e=e.sibling}return t}function Bc(e,t,s,o,u,h){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:u,treeForkCount:h}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=s,x.tailMode=u,x.treeForkCount=h)}function bh(e){var t=e.child;for(e.child=null;t!==null;){var s=t.sibling;t.sibling=e.child,e.child=t,t=s}}function jh(e,t,s){var o=t.pendingProps,u=o.revealOrder,h=o.tail;o=o.children;var x=Ut.current;if(t.flags&128)return qo(t,x),null;var w=(x&2)!==0;if(w?(x=x&1|2,t.flags|=128):x&=1,qo(t,x),u==="backwards"&&e!==null?(bh(e),Nt(e,t,o,s),bh(e)):Nt(e,t,o,s),o=De?ko:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qp(e,s,t);else if(e.tag===19)Qp(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"backwards":s=Yp(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null,bh(t)),Bc(t,!0,u,null,h,o);break;case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Ec(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Bc(t,!0,s,null,h,o);break;case"together":Bc(t,!1,null,null,void 0,o);break;case"independent":t.memoizedState=null;break;default:s=Yp(t.child),s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Bc(t,!1,u,s,h,o)}return t.child}function Xp(e,t,s){var o=t.pendingProps;return ml(t,t.type,o.value),Nt(e,t,o.children,s),t.child}function qs(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Cl|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ua(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,s=Hs(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Hs(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function wh(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&yc(e)))}function jb(e,t,s){switch(t.tag){case 3:Ts(t,t.stateNode.containerInfo),ml(t,yt,e.memoizedState.cache),ra();break;case 27:case 5:as(t);break;case 4:Ts(t,t.stateNode.containerInfo);break;case 10:ml(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Yd(t),null;break;case 13:var o=t.memoizedState;if(o!==null){if(o.dehydrated!==null)return Sl(t),t.flags|=128,null;o=ua(e,t,s,!1);var u=t.child.childLanes;return o||(s&u)!==0?Pp(e,t,s):(Sl(t),e=qs(e,t,s),e!==null?e.sibling:null)}Sl(t);break;case 19:if(t.flags&128)return jh(e,t,s);if(u=(e.flags&128)!==0,o=(s&t.childLanes)!==0,o||(ua(e,t,s,!1),o=(s&t.childLanes)!==0),u){if(o)return jh(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),qo(t,Ut.current),o)break;return null;case 22:return t.lanes=0,Fp(e,t,s,t.pendingProps);case 24:ml(t,yt,e.memoizedState.cache)}return qs(e,t,s)}function Kp(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)bt=!0;else{if(!wh(e,s)&&(t.flags&128)===0)return bt=!1,jb(e,t,s);bt=(e.flags&131072)!==0}else bt=!1,De&&(t.flags&1048576)!==0&&E0(t,ko,t.index);switch(t.lanes=0,t.tag){case 16:e:{var o=t.pendingProps;if(e=ma(t.elementType),t.type=e,typeof e=="function")Rd(e)?(o=xa(e,o),t.tag=1,t=qp(null,t,e,o,s)):(t.tag=0,t=ph(null,t,e,o,s));else{if(e!=null){var u=e.$$typeof;if(u===$){t.tag=11,t=$p(null,t,e,o,s);break e}else if(u===ce){t.tag=14,t=Hp(null,t,e,o,s);break e}else if(u===le){t.tag=10,t.type=e,t=Xp(null,t,s);break e}}throw t=ye(e)||e,Error(i(306,t,""))}}return t;case 0:return ph(e,t,t.type,t.pendingProps,s);case 1:return o=t.type,u=xa(o,t.pendingProps),qp(e,t,o,u,s);case 3:e:{if(Ts(t,t.stateNode.containerInfo),e===null)throw Error(i(387));o=t.pendingProps;var h=t.memoizedState;u=h.element,Gd(e,t),Go(t,o,null,s);var x=t.memoizedState;if(o=x.cache,ml(t,yt,o),o!==h.cache&&$d(t,[yt],s,!0),Vo(),o=x.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Ip(e,t,o,s);break e}else if(o!==u){u=Hn(Error(i(424)),t),Lo(u),t=Ip(e,t,o,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(at=Gn(e.firstChild),Rt=t,De=!0,hl=null,Bn=!0,s=F0(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|134221824,s=s.sibling}else{if(ra(),o===u){t=qs(e,t,s);break e}Nt(e,t,o,s)}t=t.child}return t;case 26:return mi(e,t),e===null?(s=b2(t.type,null,t.pendingProps,null))?t.memoizedState=s:De||(t.stateNode=e2(t.type,t.pendingProps,tn.current,t)):t.memoizedState=b2(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return as(t),e===null&&De&&(o=t.stateNode=v2(t.type,t.pendingProps,tn.current),Rt=t,Bn=!0,u=at,Tl(t.type)?(Sf=u,at=Gn(o.firstChild)):at=u),Nt(e,t,t.pendingProps.children,s),mi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((u=o=at)&&(o=pj(o,t.type,t.pendingProps,Bn),o!==null?(t.stateNode=o,Rt=t,at=Gn(o.firstChild),Bn=!1,u=!0):u=!1),u||fl(t)),as(t),u=t.type,h=t.pendingProps,x=e!==null?e.memoizedProps:null,o=h.children,df(u,h)?o=null:x!==null&&df(u,x)&&(t.flags|=32),t.memoizedState!==null&&(u=Zd(e,t,db,null,null,s),Oi._currentValue=u),mi(e,t),Nt(e,t,o,s),t.child;case 6:return e===null&&De&&((e=s=at)&&(s=vj(s,t.pendingProps,Bn),s!==null?(t.stateNode=s,Rt=t,at=null,e=!0):e=!1),e||fl(t)),null;case 13:return Pp(e,t,s);case 4:return Ts(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=pa(t,null,o,s):Nt(e,t,o,s),t.child;case 11:return $p(e,t,t.type,t.pendingProps,s);case 7:return o=t.pendingProps,mi(e,t),Nt(e,t,o,s),t.child;case 8:return Nt(e,t,t.pendingProps.children,s),t.child;case 12:return Nt(e,t,t.pendingProps.children,s),t.child;case 10:return Xp(e,t,s);case 9:return u=t.type._context,o=t.pendingProps.children,da(t),u=$t(u),o=o(u),t.flags|=1,Nt(e,t,o,s),t.child;case 14:return Hp(e,t,t.type,t.pendingProps,s);case 15:return Up(e,t,t.type,t.pendingProps,s);case 19:return jh(e,t,s);case 31:return Sb(e,t,s);case 22:return Fp(e,t,s,t.pendingProps);case 24:return da(t),o=$t(yt),e===null?(u=Fd(),u===null&&(u=lt,h=Hd(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=s),u=h),t.memoizedState={parent:o,cache:u},Vd(t),ml(t,yt,u)):((e.lanes&s)!==0&&(Gd(e,t),Go(t,null,null,s),Vo()),u=e.memoizedState,h=t.memoizedState,u.parent!==o?(u={parent:o,cache:o},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ml(t,yt,o)):(o=h.cache,ml(t,yt,o),o!==u.cache&&$d(t,[yt],s,!0))),Nt(e,t,t.pendingProps.children,s),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),o=t.pendingProps,o.name!=null&&o.name!=="auto"?t.flags|=e===null?18882560:18874368:De&&pc(t),e!==null&&e.memoizedProps.name!==o.name?t.flags|=4194816:mi(e,t),Nt(e,t,o.children,s),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Is(e){e.flags|=4}function Nh(e,t,s,o,u){var h;if((h=(e.mode&32)!==0)&&(h=s===null?C2(t,o):C2(t,o)&&(o.src!==s.src||o.srcSet!==s.srcSet)),h){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(A1())e.flags|=8192;else throw ga=wc,Bd}else e.flags&=-16777217}function Zp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!M2(t))if(A1())e.flags|=8192;else throw ga=wc,Bd}function Vc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yo():536870912,e.lanes|=t,yi|=t)}function Xo(e,t){if(!De)switch(e.tailMode){case"visible":break;case"collapsed":for(var s=e.tail,o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null;break;default:for(t=e.tail,s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null}}function it(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags&1206910976,o|=u.flags&1206910976,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,o|=u.subtreeFlags,o|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function wb(e,t,s){var o=t.pendingProps;switch(zd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return s=t.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),t.memoizedState.cache!==o&&(t.flags|=2048),Bs(yt),xt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(oi(t)?Is(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kd())),it(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(Is(t),h!==null?(it(t),Zp(t,h)):(it(t),Nh(t,u,null,o,s))):h?h!==e.memoizedState?(Is(t),it(t),Zp(t,h)):(it(t),t.flags&=-16777217):(e=e.memoizedProps,e!==o&&Is(t),it(t),Nh(t,u,e,o,s)),null;case 27:if(Yt(t),s=tn.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Is(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return it(t),t.subtreeFlags&=-33554433,null}e=Qt.current,oi(t)?T0(t):(e=v2(u,o,s),t.stateNode=e,Is(t))}return it(t),t.subtreeFlags&=-33554433,null;case 5:if(Yt(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==o&&Is(t);else{if(!o){if(t.stateNode===null)throw Error(i(166));return it(t),t.subtreeFlags&=-33554433,null}if(h=Qt.current,oi(t))T0(t);else{var x=ir(tn.current);switch(h){case 1:h=x.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=x.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=x.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=x.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?x.createElement("select",{is:o.is}):x.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?x.createElement(u,{is:o.is}):x.createElement(u)}}h[Oe]=t,h[st]=o;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)h.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=h;e:switch(Bt(h,u,o),u){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Is(t)}}return it(t),t.subtreeFlags&=-33554433,Nh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==o&&Is(t);else{if(typeof o!="string"&&t.stateNode===null)throw Error(i(166));if(e=tn.current,oi(t)){if(e=t.stateNode,s=t.memoizedProps,o=null,u=Rt,u!==null)switch(u.tag){case 27:case 5:o=u.memoizedProps}e[Oe]=t,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||K1(e.nodeValue,s)),e||fl(t,!0)}else e=ir(e).createTextNode(o),e[Oe]=t,t.stateNode=e}return it(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(o=oi(t),s!==null){if(e===null){if(!o)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Oe]=t}else ra(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),e=!1}else s=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Mn(t),t):(Mn(t),null);if((t.flags&128)!==0)throw Error(i(558))}return it(t),null;case 13:if(o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=oi(t),o!==null&&o.dehydrated!==null){if(e===null){if(!u)throw Error(i(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(i(317));u[Oe]=t}else ra(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;it(t),u=!1}else u=kd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Mn(t),t):(Mn(t),null)}return Mn(t),(t.flags&128)!==0?(t.lanes=s,t):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=t.child,u=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(u=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==u&&(o.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Vc(t,t.updateQueue),it(t),null);case 4:return xt(),e===null&&af(t.stateNode.containerInfo),t.flags|=67108864,it(t),null;case 10:return Bs(t.type),it(t),null;case 19:if(Xd(t),o=t.memoizedState,o===null)return it(t),null;if(u=(t.flags&128)!==0,h=o.rendering,h===null)if(u)Xo(o,!1);else{if(mt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=Ec(e),h!==null){for(t.flags|=128,Xo(o,!1),e=h.updateQueue,t.updateQueue=e,Vc(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)N0(s,e),s=s.sibling;return qo(t,Ut.current&1|2),De&&Us(t,o.treeForkCount),t.child}e=e.sibling}o.tail!==null&&Fe()>eu&&(t.flags|=128,u=!0,Xo(o,!1),t.lanes=4194304)}else{if(!u)if(e=Ec(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Vc(t,e),Xo(o,!0),o.tail===null&&o.tailMode!=="collapsed"&&o.tailMode!=="visible"&&!h.alternate&&!De)return it(t),null}else 2*Fe()-o.renderingStartTime>eu&&s!==536870912&&(t.flags|=128,u=!0,Xo(o,!1),t.lanes=4194304);o.isBackwards?(h.sibling=t.child,t.child=h):(e=o.last,e!==null?e.sibling=h:t.child=h,o.last=h)}if(o.tail!==null){e=o.tail;e:{for(s=e;s!==null;){if(s.alternate!==null){s=!1;break e}s=s.sibling}s=!0}return o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Fe(),e.sibling=null,h=Ut.current,h=u?h&1|2:h&1,o.tailMode==="visible"||o.tailMode==="collapsed"||!s||De?qo(t,h):(s=h,qe(Ht,t),qe(Ut,s),Zt===null&&(Zt=t)),De&&Us(t,o.treeForkCount),e}return it(t),null;case 22:case 23:return Mn(t),Qd(),o=t.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(t.flags|=8192):o&&(t.flags|=8192),o?(s&536870912)!==0&&(t.flags&128)===0&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),s=t.updateQueue,s!==null&&Vc(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),o!==s&&(t.flags|=2048),e!==null&&rt(fa),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Bs(yt),it(t),null;case 25:return null;case 30:return t.flags|=33554432,it(t),null}throw Error(i(156,t.tag))}function Nb(e,t){switch(zd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bs(yt),xt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Yt(t),null;case 31:if(t.memoizedState!==null){if(Mn(t),t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ra()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xd(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return xt(),null;case 10:return Bs(t.type),null;case 22:case 23:return Mn(t),Qd(),e!==null&&rt(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Bs(yt),null;case 25:return null;default:return null}}function Jp(e,t){switch(zd(t),t.tag){case 3:Bs(yt),xt();break;case 26:case 27:case 5:Yt(t);break;case 4:xt();break;case 31:t.memoizedState!==null&&Mn(t);break;case 13:Mn(t);break;case 19:Xd(t);break;case 10:Bs(t.type);break;case 22:case 23:Mn(t),Qd(),e!==null&&rt(fa);break;case 24:Bs(yt)}}function Ko(e,t){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var u=o.next;s=u;do{if((s.tag&e)===e){o=void 0;var h=s.create,x=s.inst;o=h(),x.destroy=o}s=s.next}while(s!==u)}}catch(w){We(t,t.return,w)}}function jl(e,t,s){try{var o=t.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var h=u.next;o=h;do{if((o.tag&e)===e){var x=o.inst,w=x.destroy;if(w!==void 0){x.destroy=void 0,u=t;var z=s,G=w;try{G()}catch(X){We(u,z,X)}}}o=o.next}while(o!==h)}}catch(X){We(t,t.return,X)}}function Wp(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{V0(t,s)}catch(o){We(e,e.return,o)}}}function e1(e,t,s){s.props=xa(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){We(e,t,o)}}function ms(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:var u=e.stateNode,h=Ls(e.memoizedProps,u);(u.ref===null||u.ref.name!==h)&&(u.ref=o2(h)),o=u.ref;break;case 7:if(e.stateNode===null){var x=new An(e);p(e.child,!1,mj,x,void 0,void 0),e.stateNode=x}o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(w){We(e,t,w)}}function Ft(e,t){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(u){We(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){We(e,t,u)}else s.current=null}function Gc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var s=0;s<t.length;s++)f2(e.stateNode,t[s])}function t1(e){for(var t=e.return;t!==null&&(Mh(t)&&f2(e.stateNode,t.stateNode),!Ch(t));)t=t.return}function Zo(e){for(var t=e.return;t!==null&&(Mh(t)&&gj(e.stateNode,t.stateNode),!Ch(t));)t=t.return}function Ch(e){return e.tag===5||e.tag===3||e.tag===27}function Mh(e){return e&&e.tag===7&&e.stateNode!==null}function Eh(e){var t=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(u){We(e,e.return,u)}}function _h(e,t,s){try{var o=e.stateNode;Kb(o,e.type,s,t),o[st]=t}catch(u){We(e,e.return,u)}}function n1(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Tl(e.type)||e.tag===4}function Th(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||n1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Tl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rh(e,t,s,o){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(u,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(u),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=ds)),Gc(e,o),Qe=!0;else if(u!==4&&(u===27&&(Gc(e,o),o=null,Tl(e.type)&&(s=e.stateNode,t=null)),e=e.child,e!==null))for(Rh(e,t,s,o),e=e.sibling;e!==null;)Rh(e,t,s,o),e=e.sibling}function qc(e,t,s,o){var u=e.tag;if(u===5||u===6)u=e.stateNode,t?s.insertBefore(u,t):s.appendChild(u),Gc(e,o),Qe=!0;else if(u!==4&&(u===27&&(Gc(e,o),o=null,Tl(e.type)&&(s=e.stateNode)),e=e.child,e!==null))for(qc(e,t,s,o),e=e.sibling;e!==null;)qc(e,t,s,o),e=e.sibling}function s1(e){var t=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Bt(t,o,s),t[Oe]=e,t[st]=s}catch(h){We(e,e.return,h)}}var Ic=!1,En=null;function l1(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Ic=!0)}var gs=null;function a1(){var e=gs;return gs=null,e}var pn=0;function gi(e,t,s,o,u){return pn=0,i1(e.child,t,s,o,u)}function i1(e,t,s,o,u){for(var h=!1;e!==null;){if(e.tag===5){var x=e.stateNode;if(o!==null){var w=mf(x);o.push(w),w.view&&(h=!0)}else h||mf(x).view&&(h=!0);Ic=!0,a2(x,pn===0?t:t+"_"+pn,s),pn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&u||i1(e.child,t,s,o,u)&&(h=!0));e=e.sibling}return h}function ps(e,t){for(;e!==null;)e.tag===5?i2(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ps(e.child,t)),e=e.sibling}function Pc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Pc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(i(544));var s=t.name;t=$s(t.default,t.share),t!=="none"&&(gi(e,s,t,null,!1)||ps(e.child,!1))}e=e.sibling}}function Ah(e,t){if(e.tag===30){var s=e.stateNode,o=e.memoizedProps,u=Ls(o,s),h=$s(o.default,s.paired?o.share:o.enter);h!=="none"?gi(e,u,h,null,!1)?(Pc(e),s.paired||t||wi(e,o.onEnter)):ps(e.child,!1):Pc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Ah(e,t),e=e.sibling;else Pc(e)}function Oh(e){if(En!==null&&En.size!==0){var t=En;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var s=e.memoizedProps,o=s.name;if(o!=null&&o!=="auto"){var u=t.get(o);if(u!==void 0){var h=$s(s.default,s.share);if(h!=="none"&&(gi(e,o,h,null,!1)?(h=e.stateNode,u.paired=h,h.paired=u,wi(e,s.onShare)):ps(e.child,!1)),t.delete(o),t.size===0)break}}}Oh(e)}e=e.sibling}}}function zh(e){if(e.tag===30){var t=e.memoizedProps,s=Ls(t,e.stateNode),o=En!==null?En.get(s):void 0,u=$s(t.default,o!==void 0?t.share:t.exit);u!=="none"&&(gi(e,s,u,null,!1)?o!==void 0?(u=e.stateNode,o.paired=u,u.paired=o,En.delete(s),wi(e,t.onShare)):wi(e,t.onExit):ps(e.child,!1)),En!==null&&Oh(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)zh(e),e=e.sibling;else En!==null&&Oh(e)}function o1(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,s=Ls(t,e.stateNode);t=$s(t.default,t.update),e.flags&=-5,t!=="none"&&gi(e,s,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&o1(e);e=e.sibling}}function Dh(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,ps(e.child,!1))}Dh(e)}e=e.sibling}}function Qc(e){if(e.tag===30)e.stateNode.paired=null,ps(e.child,!1),Dh(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Qc(e),e=e.sibling;else Dh(e)}function r1(e){for(e=e.child;e!==null;)e.tag===30?ps(e.child,!1):(e.subtreeFlags&33554432)!==0&&r1(e),e=e.sibling}function kh(e,t,s,o,u,h,x){for(var w=!1;t!==null;){if(t.tag===5){var z=t.stateNode;if(h!==null&&pn<h.length){var G=h[pn],X=mf(z);(G.view||X.view)&&(w=!0);var te;if(te=(e.flags&4)===0)if(X.clip)te=!0;else{te=G.rect;var B=X.rect;te=te.y!==B.y||te.x!==B.x||te.height!==B.height||te.width!==B.width}te&&(e.flags|=4),X.abs?X=!G.abs:(G=G.rect,X=X.rect,X=G.height!==X.height||G.width!==X.width),X&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&a2(z,pn===0?s:s+"_"+pn,u),w&&(e.flags&4)!==0||(gs===null&&(gs=[]),gs.push(z,pn===0?o:o+"_"+pn,t.memoizedProps)),pn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&x?e.flags|=t.flags&32:kh(e,t.child,s,o,u,h,x)&&(w=!0));t=t.sibling}return w}function c1(e,t){for(e=e.child;e!==null;){if(e.tag===30){var s=e.memoizedProps,o=e.stateNode,u=Ls(s,o),h=$s(s.default,s.update),x;x=e.memoizedState,e.memoizedState=null,o=e;var w=e.child;pn=0,u=kh(o,w,u,u,h,x,!1),(e.flags&4)!==0&&u&&wi(e,s.onUpdate)}else(e.subtreeFlags&33554432)!==0&&c1(e);e=e.sibling}}var At=!1,Ze=!1,vs=!1,Lh=!1,u1=typeof WeakSet=="function"?WeakSet:Set,Ot=null,xs=!1,Jo=!1,Yc=!1,$h=!1;function Cb(e,t,s){if(e=e.containerInfo,cf=zi,e=m0(e),wd(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var h=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var w=0,z=-1,G=-1,X=0,te=0,B=e,Y=null;t:for(;;){for(var fe;B!==o||h!==0&&B.nodeType!==3||(z=w+h),B!==x||u!==0&&B.nodeType!==3||(G=w+u),B.nodeType===3&&(w+=B.nodeValue.length),(fe=B.firstChild)!==null;)Y=B,B=fe;for(;;){if(B===e)break t;if(Y===o&&++X===h&&(z=w),Y===x&&++te===u&&(G=w),(fe=B.nextSibling)!==null)break;B=Y,Y=B.parentNode}B=fe}o=z===-1||G===-1?null:{start:z,end:G}}else o=null}o=o||{start:0,end:0}}else o=null;for(uf={focusedElem:e,selectionRange:o},zi=!1,s=(s&335544064)===s,Ot=t,t=s?9270:1024;Ot!==null;){if(e=Ot,s&&(o=e.deletions,o!==null))for(h=0;h<o.length;h++)s&&zh(o[h]);if(e.alternate===null&&(e.flags&2)!==0)s&&l1(e),Xc(s);else{if(e.tag===22){if(o=e.alternate,e.memoizedState!==null){o!==null&&o.memoizedState===null&&s&&zh(o),Xc(s);continue}else if(o!==null&&o.memoizedState!==null){s&&l1(e),Xc(s);continue}}o=e.child,(e.subtreeFlags&t)!==0&&o!==null?(o.return=e,Ot=o):(s&&o1(e),Xc(s))}}En=null}function Xc(e){for(;Ot!==null;){var t=Ot,s=e,o=t.alternate,u=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((u&1024)!==0&&o!==null){s=void 0,u=o.memoizedProps,o=o.memoizedState;var h=t.stateNode;try{var x=xa(t.type,u);s=h.getSnapshotBeforeUpdate(x,o),h.__reactInternalSnapshotBeforeUpdate=s}catch(w){We(t,t.return,w)}}break;case 3:if((u&1024)!==0){if(o=t.stateNode.containerInfo,s=o.nodeType,s===9)vf(o);else if(s===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":vf(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:s&&o!==null&&(s=Ls(o.memoizedProps,o.stateNode),u=t.memoizedProps,u=$s(u.default,u.update),u!=="none"&&gi(o,s,u,o.memoizedState=[],!0));break;default:if((u&1024)!==0)throw Error(i(163))}if(o=t.sibling,o!==null){o.return=t.return,Ot=o;break}Ot=t.return}}function d1(e,t,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:ys(e,s),o&4&&Ko(5,s);break;case 1:if(ys(e,s),o&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(x){We(s,s.return,x)}else{var u=xa(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){We(s,s.return,x)}}o&64&&Wp(s),o&512&&ms(s,s.return);break;case 3:if(ys(e,s),o&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{V0(e,t)}catch(x){We(s,s.return,x)}}break;case 27:t===null&&o&4&&s1(s);case 26:case 5:ys(e,s),t===null&&o&4&&Eh(s),o&512&&ms(s,s.return);break;case 12:ys(e,s);break;case 31:ys(e,s),o&4&&g1(e,s);break;case 13:ys(e,s),o&4&&p1(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=$b.bind(null,s),xj(e,s))));break;case 22:if(o=s.memoizedState!==null||At,!o){var h=t!==null&&t.memoizedState!==null||Ze;t=At,u=Ze,At=o,(Ze=h)&&!u?(o=2,(s.subtreeFlags&8772)!==0&&(o|=1),Zn(e,s,o)):ys(e,s),At=t,Ze=u}break;case 30:ys(e,s),o&512&&ms(s,s.return);break;case 7:o&512&&ms(s,s.return);default:ys(e,s)}}function Hh(e,t){for(e=e.child;e!==null;)h1(e,t),e=e.sibling}function h1(e,t){switch(e.tag){case 5:case 26:try{var s=e.stateNode;if(t){var o=s.style;typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"}else{var u=e.stateNode,h=e.memoizedProps.style,x=h!=null&&h.hasOwnProperty("display")?h.display:null;u.style.display=x==null||typeof x=="boolean"?"":(""+x).trim()}}catch(z){We(e,e.return,z)}Uh(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Qe=!0}catch(z){We(e,e.return,z)}break;case 18:try{var w=e.stateNode;t?l2(w,!0):l2(e.stateNode,!1)}catch(z){We(e,e.return,z)}break;case 22:case 23:e.memoizedState===null&&Hh(e,t);break;default:Hh(e,t)}}function Uh(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var s=e,o=t;switch(s.tag){case 4:h1(s,o);break e;case 22:s.memoizedState===null&&Uh(s,o);break e;default:Uh(s,o)}}e=e.sibling}}function f1(e){var t=e.alternate;t!==null&&(e.alternate=null,f1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&na(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ct=null,vn=!1;function Xn(e,t,s){for(s=s.child;s!==null;)m1(e,t,s),s=s.sibling}function m1(e,t,s){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(os,s)}catch{}switch(s.tag){case 26:Ze||Ft(s,t),Xn(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&!Ze&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ze||Ft(s,t),Zo(s);var o=ct,u=vn;Tl(s.type)&&(ct=s.stateNode,vn=!1),Xn(e,t,s),x2(s.stateNode,s.type,s.memoizedProps),ct=o,vn=u;break;case 5:Ze||Ft(s,t),Zo(s);case 6:if(s.tag===6&&Zo(s),o=ct,u=vn,ct=null,Xn(e,t,s),ct=o,vn=u,ct!==null)if(vn)try{(ct.nodeType===9?ct.body:ct.nodeName==="HTML"?ct.ownerDocument.body:ct).removeChild(s.stateNode),Qe=!0}catch(h){We(s,t,h)}else try{ct.removeChild(s.stateNode),Qe=!0}catch(h){We(s,t,h)}break;case 18:ct!==null&&(vn?(e=ct,s2(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Di(e)):s2(ct,s.stateNode));break;case 4:o=ct,u=vn,ct=s.stateNode.containerInfo,vn=!0,Xn(e,t,s),ct=o,vn=u;break;case 0:case 11:case 14:case 15:jl(2,s,t),Ze||jl(4,s,t),Xn(e,t,s);break;case 1:Ze||(Ft(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"&&e1(s,t,o)),Xn(e,t,s);break;case 21:Xn(e,t,s);break;case 22:Ze=(o=Ze)||s.memoizedState!==null,Xn(e,t,s),Ze=o;break;case 30:Ft(s,t),Xn(e,t,s);break;case 7:Ze||Ft(s,t),Xn(e,t,s);break;default:Xn(e,t,s)}}function g1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Di(e)}catch(s){We(t,t.return,s)}}}function p1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Di(e)}catch(s){We(t,t.return,s)}}function Mb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new u1),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new u1),t;default:throw Error(i(435,e.tag))}}function Kc(e,t){var s=Mb(e);t.forEach(function(o){if(!s.has(o)){s.add(o);var u=Hb.bind(null,e,o);o.then(u,u)}})}function an(e,t,s){var o=t.deletions;if(o!==null)for(var u=0;u<o.length;u++){var h=o[u],x=e,w=t,z=w;e:for(;z!==null;){switch(z.tag){case 27:if(Tl(z.type)){ct=z.stateNode,vn=!1;break e}break;case 5:ct=z.stateNode,vn=!1;break e;case 3:case 4:ct=z.stateNode.containerInfo,vn=!0;break e}z=z.return}if(ct===null)throw Error(i(160));m1(x,w,h),ct=null,vn=!1,x=h.alternate,x!==null&&(x.return=null),h.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)v1(t,e,s),t=t.sibling}var Kn=null;function v1(e,t,s){var o=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(u&4&&(o=e.updateQueue,o=o!==null?o.events:null,o!==null))for(var h=0;h<o.length;h++){var x=o[h];x.ref.impl=x.nextImpl}an(t,e,s),on(e),u&4&&(jl(3,e,e.return),Ko(3,e),jl(5,e,e.return));break;case 1:an(t,e,s),on(e),u&512&&(Ze||o===null||Ft(o,o.return)),u&64&&At&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?t:s.concat(t))));break;case 26:if(h=Kn,an(t,e,s),on(e),u&512&&(Ze||o===null||Ft(o,o.return)),u&4)if(u=o!==null?o.memoizedState:null,s=e.memoizedState,o===null)if(s===null)if(e.stateNode===null)if(At)e.stateNode=e2(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,s=e.memoizedProps,u=h.ownerDocument||h;t:switch(t){case"title":o=u.getElementsByTagName("title")[0],(!o||o[ol]||o[Oe]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=u.createElement(t),u.head.insertBefore(o,u.querySelector("head > title"))),Bt(o,t,s),o[Oe]=e,Tt(o),t=o;break e;case"link":if(h=N2("link","href",u).get(t+(s.href||""))){for(x=0;x<h.length;x++)if(o=h[x],o.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&o.getAttribute("rel")===(s.rel==null?null:s.rel)&&o.getAttribute("title")===(s.title==null?null:s.title)&&o.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){h.splice(x,1);break t}}o=u.createElement(t),Bt(o,t,s),u.head.appendChild(o);break;case"meta":if(h=N2("meta","content",u).get(t+(s.content||""))){for(x=0;x<h.length;x++)if(o=h[x],o.getAttribute("content")===(s.content==null?null:""+s.content)&&o.getAttribute("name")===(s.name==null?null:s.name)&&o.getAttribute("property")===(s.property==null?null:s.property)&&o.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&o.getAttribute("charset")===(s.charSet==null?null:s.charSet)){h.splice(x,1);break t}}o=u.createElement(t),Bt(o,t,s),u.head.appendChild(o);break;default:throw Error(i(468,t))}o[Oe]=e,Tt(o),t=o}e.stateNode=t}else At||Nf(h,e.type,e.stateNode);else e.stateNode=w2(h,s,e.memoizedProps);else u!==s?(u===null?(t=o.stateNode,t===null||Ze||t.parentNode.removeChild(t)):u.count--,s===null?At||Nf(h,e.type,e.stateNode):w2(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&_h(e,e.memoizedProps,o.memoizedProps);break;case 27:an(t,e,s),on(e),u&512&&(Ze||o===null||Ft(o,o.return)),o!==null&&u&4&&_h(e,e.memoizedProps,o.memoizedProps);break;case 5:if(h=vs,vs=!1,an(t,e,s),vs=h,on(e),u&512&&(Ze||o===null||Ft(o,o.return)),e.flags&32){t=e.stateNode;try{Za(t,""),Qe=!0}catch(X){We(e,e.return,X)}}u&4&&e.stateNode!=null&&(t=e.memoizedProps,_h(e,t,o!==null?o.memoizedProps:t)),u&1024&&(Lh=!0);break;case 6:if(an(t,e,s),on(e),u&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,s=e.stateNode;try{s.nodeValue=t,Qe=!0}catch(X){We(e,e.return,X)}}break;case 3:if(Qe=!1,du=null,h=Kn,Kn=or(t.containerInfo),an(t,e,s),Kn=h,on(e),u&4&&o!==null&&o.memoizedState.isDehydrated)try{Di(t.containerInfo)}catch(X){We(e,e.return,X)}Lh&&(Lh=!1,x1(e)),Qe=!1;break;case 4:u=vs,vs=At,o=Hg(),h=Kn,Kn=or(e.stateNode.containerInfo),an(t,e,s),on(e),Kn=h,Qe&&Jo&&(Yc=!0),Qe=o,vs=u;break;case 12:an(t,e,s),on(e);break;case 31:an(t,e,s),on(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Kc(e,t)));break;case 13:an(t,e,s),on(e),e.child.flags&8192&&e.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Wc=Fe()),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Kc(e,t)));break;case 22:h=e.memoizedState!==null,x=o!==null&&o.memoizedState!==null;var w=At,z=Ze,G=vs;At=w||h,vs=G||h,Ze=z||x,an(t,e,s),Ze=z,vs=G,At=w,on(e),u&8192&&(t=e.stateNode,t._visibility=h?t._visibility&-2:t._visibility|1,!h||o===null||x||At||Ze||(t=x||Ze,s=At,o=Ze,At=h||At,Ze=t,wl(e,2),At=s,Ze=o),!h&&vs||Hh(e,h)),u&4&&(t=e.updateQueue,t!==null&&(s=t.retryQueue,s!==null&&(t.retryQueue=null,Kc(e,s))));break;case 19:an(t,e,s),on(e),u&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Kc(e,t)));break;case 30:u&512&&(Ze||o===null||Ft(o,o.return)),u=Hg(),h=Jo,x=(s&335544064)===s,w=e.memoizedProps,Jo=x&&$s(w.default,w.update)!=="none",an(t,e,s),on(e),x&&o!==null&&Qe&&(e.flags|=4),Jo=h,Qe=u;break;case 21:break;case 7:u&512&&(Ze||o===null||Ft(o,o.return)),o&&o.stateNode!==null&&(o.stateNode._fragmentFiber=e);default:an(t,e,s),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var s,o=e.return;o!==null;){if(n1(o)){s=o;break}o=o.return}o=null;for(var u=e.return;u!==null;){if(Mh(u)){var h=u.stateNode;o===null?o=[h]:o.push(h)}if(Ch(u))break;u=u.return}var x=o;if(s==null)throw Error(i(160));switch(s.tag){case 27:var w=s.stateNode,z=Th(e);qc(e,z,w,x);break;case 5:var G=s.stateNode;s.flags&32&&(Za(G,""),s.flags&=-33);var X=Th(e);qc(e,X,G,x);break;case 3:case 4:var te=s.stateNode.containerInfo,B=Th(e);Rh(e,B,te,x);break;default:throw Error(i(161))}}catch(Y){We(e,e.return,Y)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function x1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;x1(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,zi=!0,t.reset(),zi=!1),e=e.sibling}}function pi(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)y1(t,e),t=t.sibling;else c1(t)}function y1(e,t){var s=e.alternate;if(s===null)Ah(e,!1);else switch(e.tag){case 3:if($h=xs=!1,a1(),pi(t,e),!xs&&!Yc){if(e=gs,e!==null)for(var o=0;o<e.length;o+=3){s=e[o];var u=e[o+1];i2(s,e[o+2]),s=s.ownerDocument.documentElement,s!==null&&s.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+u+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),$h=!0}gs=null;break;case 5:pi(t,e);break;case 4:o=xs,xs=!1,pi(t,e),xs&&(Yc=!0),xs=o;break;case 22:e.memoizedState===null&&(s.memoizedState!==null?Ah(e,!1):pi(t,e));break;case 30:o=xs,u=a1(),xs=!1,pi(t,e),xs&&(e.flags|=4);var h=e.memoizedProps,x=e.stateNode;t=Ls(h,x),x=Ls(s.memoizedProps,x);var w=$s(h.default,h.update);w==="none"?t=!1:(h=s.memoizedState,s.memoizedState=null,s=e.child,pn=0,t=kh(e,s,t,x,w,h,!0),pn!==(h===null?0:h.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(wi(e,e.memoizedProps.onUpdate),gs=u):u!==null&&(u.push.apply(u,gs),gs=u),xs=(e.flags&32)!==0?!0:o;break;default:pi(t,e)}}function ys(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)d1(e,t.alternate,t),t=t.sibling}function wl(e,t){for(e=e.child;e!==null;){var s=e,o=t;switch(s.tag){case 0:case 11:case 14:case 15:jl(4,s,s.return),wl(s,o);break;case 1:Ft(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&e1(s,s.return,u),wl(s,o);break;case 27:(o&2)!==0&&x2(s.stateNode,s.type,s.memoizedProps);case 5:Ft(s,s.return),s.tag!==5&&s.tag!==27||Zo(s),wl(s,o);break;case 6:Zo(s);break;case 26:Ft(s,s.return),u=s.stateNode,s.memoizedState!==null||u===null||Ze||u.parentNode.removeChild(u),wl(s,o);break;case 22:s.memoizedState===null&&wl(s,o);break;case 30:Ft(s,s.return),wl(s,o);break;case 7:Ft(s,s.return);default:wl(s,o)}e=e.sibling}}function Zn(e,t,s){for(s=(t.subtreeFlags&8772)!==0?s:s&-2,t=t.child;t!==null;){var o=t.alternate,u=e,h=t,x=h.flags,w=(s&1)!==0;switch(h.tag){case 0:case 11:case 15:Zn(u,h,s),Ko(4,h);break;case 1:if(Zn(u,h,s),o=h,u=o.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(X){We(o,o.return,X)}if(o=h,u=o.updateQueue,u!==null){var z=o.stateNode;try{var G=u.shared.hiddenCallbacks;if(G!==null)for(u.shared.hiddenCallbacks=null,u=0;u<G.length;u++)B0(G[u],z)}catch(X){We(o,o.return,X)}}w&&x&64&&Wp(h),ms(h,h.return);break;case 27:(s&2)!==0&&s1(h);case 5:h.tag!==5&&h.tag!==27||t1(h),Zn(u,h,s),w&&o===null&&x&4&&Eh(h),ms(h,h.return);break;case 6:t1(h);break;case 26:z=h.stateNode,h.memoizedState!==null||z===null||At||Nf(or(z.ownerDocument),h.type,z),Zn(u,h,s),w&&o===null&&x&4&&Eh(h),ms(h,h.return);break;case 12:Zn(u,h,s);break;case 31:Zn(u,h,s),w&&x&4&&g1(u,h);break;case 13:Zn(u,h,s),w&&x&4&&p1(u,h);break;case 22:h.memoizedState===null&&Zn(u,h,s),ms(h,h.return);break;case 30:Zn(u,h,s),ms(h,h.return);break;case 7:ms(h,h.return);default:Zn(u,h,s)}t=t.sibling}}function Fh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&$o(s))}function Bh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$o(e))}function Vn(e,t,s,o){var u=(s&335544064)===s;if(t.subtreeFlags&(u?10262:10256))for(t=t.child;t!==null;)S1(e,t,s,o),t=t.sibling;else u&&r1(t)}function S1(e,t,s,o){var u=(s&335544064)===s;u&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Qc(t);var h=t.flags;switch(t.tag){case 0:case 11:case 15:Vn(e,t,s,o),h&2048&&Ko(9,t);break;case 1:Vn(e,t,s,o);break;case 3:Vn(e,t,s,o),u&&$h&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),h&2048&&(h=null,t.alternate!==null&&(h=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==h&&(t.refCount++,h!=null&&$o(h)));break;case 12:if(h&2048){Vn(e,t,s,o),h=t.stateNode;try{var x=t.memoizedProps,w=x.id,z=x.onPostCommit;typeof z=="function"&&z(w,t.alternate===null?"mount":"update",h.passiveEffectDuration,-0)}catch(G){We(t,t.return,G)}}else Vn(e,t,s,o);break;case 31:Vn(e,t,s,o);break;case 13:Vn(e,t,s,o);break;case 23:break;case 22:x=t.stateNode,w=t.alternate,t.memoizedState!==null?(u&&w!==null&&w.memoizedState===null&&Qc(w),x._visibility&2?Vn(e,t,s,o):Wo(e,t)):(u&&w!==null&&w.memoizedState!==null&&Qc(t),x._visibility&2?Vn(e,t,s,o):(x._visibility|=2,vi(e,t,s,o,(t.subtreeFlags&10256)!==0||!1))),h&2048&&Fh(w,t);break;case 24:Vn(e,t,s,o),h&2048&&Bh(t.alternate,t);break;case 30:u&&(h=t.alternate,h!==null&&(ps(h.child,!0),ps(t.child,!0))),Vn(e,t,s,o);break;default:Vn(e,t,s,o)}}function vi(e,t,s,o,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,x=t,w=s,z=o,G=x.flags;switch(x.tag){case 0:case 11:case 15:vi(h,x,w,z,u),Ko(8,x);break;case 23:break;case 22:var X=x.stateNode;x.memoizedState!==null?X._visibility&2?vi(h,x,w,z,u):Wo(h,x):(X._visibility|=2,vi(h,x,w,z,u)),u&&G&2048&&Fh(x.alternate,x);break;case 24:vi(h,x,w,z,u),u&&G&2048&&Bh(x.alternate,x);break;default:vi(h,x,w,z,u)}t=t.sibling}}function Wo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,o=t,u=o.flags;switch(o.tag){case 22:Wo(s,o),u&2048&&Fh(o.alternate,o);break;case 24:Wo(s,o),u&2048&&Bh(o.alternate,o);break;default:Wo(s,o)}t=t.sibling}}var ya=8192;function Sa(e,t,s){if(e.subtreeFlags&ya)for(e=e.child;e!==null;)b1(e,t,s),e=e.sibling}function b1(e,t,s){switch(e.tag){case 26:Sa(e,t,s),e.flags&ya&&(e.memoizedState!==null?Oj(s,Kn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&_2(s,e)));break;case 5:Sa(e,t,s),e.flags&ya&&(e=e.stateNode,(t&335544128)===t&&_2(s,e));break;case 3:case 4:var o=Kn;Kn=or(e.stateNode.containerInfo),Sa(e,t,s),Kn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ya,ya=16777216,Sa(e,t,s),ya=o):Sa(e,t,s));break;case 30:if((e.flags&ya)!==0&&(o=e.memoizedProps.name,o!=null&&o!=="auto")){var u=e.stateNode;u.paired=null,En===null&&(En=new Map),En.set(o,u)}Sa(e,t,s);break;default:Sa(e,t,s)}}function j1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function er(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Ot=o,N1(o,e)}j1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)w1(e),e=e.sibling}function w1(e){switch(e.tag){case 0:case 11:case 15:er(e),e.flags&2048&&jl(9,e,e.return);break;case 3:er(e);break;case 12:er(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zc(e)):er(e);break;default:er(e)}}function Zc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var o=t[s];Ot=o,N1(o,e)}j1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),Zc(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Zc(t));break;default:Zc(t)}e=e.sibling}}function N1(e,t){for(;Ot!==null;){var s=Ot;switch(s.tag){case 0:case 11:case 15:jl(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:$o(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,Ot=o;else e:for(s=e;Ot!==null;){o=Ot;var u=o.sibling,h=o.return;if(f1(o),o===s){Ot=null;break e}if(u!==null){u.return=h,Ot=u;break e}Ot=h}}}var Eb={getCacheForType:function(e){var t=$t(yt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return $t(yt).controller.signal}},_b=typeof WeakMap=="function"?WeakMap:Map,Xe=0,lt=null,ke=null,$e=0,Je=0,_n=null,Nl=!1,xi=!1,Vh=!1,Ps=0,mt=0,Cl=0,ba=0,Jc=0,Tn=0,yi=0,tr=null,xn=null,Gh=!1,Wc=0,C1=0,eu=1/0,tu=null,Ml=null,dt=0,Jn=null,ja=null,Ss=0,qh=0,Ih=null,M1=null,Si=null,bi=null,ji=null,nr=0,nu=null;function Rn(){return(Xe&2)!==0&&$e!==0?$e&-$e:me.T!==null?tf():wo()}function E1(){if(Tn===0)if(($e&536870912)===0||De){var e=Jl;Jl<<=1,(Jl&3932160)===0&&(Jl=262144),Tn=e}else Tn=536870912;return e=Ht.current,e!==null&&(e.flags|=32),Tn}function wi(e,t){if(t!=null){var s=e.stateNode,o=s.ref;o===null&&(o=s.ref=o2(Ls(e.memoizedProps,s))),bi===null&&(bi=[]),bi.push(t.bind(null,o))}}function yn(e,t,s){(e===lt&&(Je===2||Je===9)||e.cancelPendingCommit!==null)&&(Ni(e,0),El(e,$e,Tn,!1)),il(e,s),((Xe&2)===0||e!==lt)&&(e===lt&&((Xe&2)===0&&(ba|=s),mt===4&&El(e,$e,Tn,!1)),bs(e))}function _1(e,t,s){if((Xe&6)!==0)throw Error(i(327));var o=!s&&(t&127)===0&&(t&e.expiredLanes)===0||al(e,t),u=o?Ab(e,t):Qh(e,t,!0),h=o;do{if(u===0){xi&&!o&&El(e,t,0,!1);break}else{if(s=e.current.alternate,h&&!Tb(s)){u=Qh(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var w=e;u=tr;var z=w.current.memoizedState.isDehydrated;if(z&&(Ni(w,x).flags|=256),x=Qh(w,x,!1),x!==2&&x!==6){if(Vh&&!z){w.errorRecoveryDisabledLanes|=h,ba|=h,u=4;break e}h=xn,xn=u,h!==null&&(xn===null?xn=h:xn.push.apply(xn,h))}u=x}if(h=!1,u!==2)continue}}if(u===1){Ni(e,0),El(e,t,0,!0);break}e:{switch(o=e,h=u,h){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:El(o,t,Tn,!Nl);break e;case 2:xn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(u=Wc+300-Fe(),10<u)){if(El(o,t,Tn,!Nl),ea(o,0,!0)!==0)break e;Ss=t,o.timeoutHandle=ff(T1.bind(null,o,s,xn,tu,Gh,t,Tn,ba,yi,Nl,h,"Throttled",-0,0),u);break e}T1(o,s,xn,tu,Gh,t,Tn,ba,yi,Nl,h,null,-0,0)}}break}while(!0);bs(e)}function T1(e,t,s,o,u,h,x,w,z,G,X,te,B,Y){e.timeoutHandle=-1;var fe=t.subtreeFlags,ve=(h&335544064)===h;if(te=null,(ve||fe&8192||(fe&16785408)===16785408)&&(te={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ds},En=null,b1(t,h,te),ve&&(fe=te,ve=e.containerInfo,ve=(ve.nodeType===9?ve:ve.ownerDocument).__reactViewTransition,ve!=null&&(fe.count++,fe.waitingForViewTransition=!0,fe=ur.bind(fe),ve.finished.then(fe,fe))),fe=(h&62914560)===h?Wc-Fe():(h&4194048)===h?C1-Fe():0,fe=zj(te,fe),fe!==null)){Ss=h,e.cancelPendingCommit=fe($1.bind(null,e,t,h,s,o,u,x,w,z,G,X,te,null,B,Y)),El(e,h,x,!G);return}$1(e,t,h,s,o,u,x,w,z,G,X,te)}function Tb(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var u=s[o],h=u.getSnapshot;u=u.value;try{if(!Cn(h(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function El(e,t,s,o){t=xo(e,t),t&=~Jc,t&=~ba,e.suspendedLanes|=t,e.pingedLanes&=~t,o&&(e.warmLanes|=t),o=e.expirationTimes;for(var u=t;0<u;){var h=31-Lt(u),x=1<<h;o[h]=-1,u&=~x}s!==0&&So(e,s,t)}function su(){return(Xe&6)===0?(sr(0),!1):!0}function Ph(){if(ke!==null){if(Je===0)var e=ke.return;else e=ke,Fs=ca=null,eh(e),ui=null,Fo=0,e=ke;for(;e!==null;)Jp(e.alternate,e),e=e.return;ke=null}}function Ni(e,t){var s=e.timeoutHandle;return s!==-1&&(e.timeoutHandle=-1,Wb(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Ss=0,Ph(),lt=e,ke=s=Hs(e.current,null),$e=t,Je=0,_n=null,Nl=!1,xi=al(e,t),Vh=!1,yi=Tn=Jc=ba=Cl=mt=0,xn=tr=null,Gh=!1,Ps=xo(e,t),dc(),s}function R1(e,t){Re=null,me.H=Lc,t===ci||t===jc?(t=$0(),Je=3):t===Bd?(t=$0(),Je=4):Je=t===gh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,_n=t,ke===null&&(mt=1,$c(e,Hn(t,e.current)))}function A1(){var e=Ht.current;return e===null?!0:($e&4194048)===$e?Zt===null:($e&62914560)===$e||($e&536870912)!==0?e===Zt:!1}function O1(){var e=me.H;return me.H=Lc,e===null?Lc:e}function z1(){var e=me.A;return me.A=Eb,e}function lu(){mt=4,Nl||($e&4194048)!==$e&&Ht.current!==null||(xi=!0),(Cl&134217727)===0&&(ba&134217727)===0||lt===null||El(lt,$e,Tn,!1)}function Qh(e,t,s){var o=Xe;Xe|=2;var u=O1(),h=z1();(lt!==e||$e!==t)&&(tu=null,Ni(e,t)),t=!1;var x=mt;e:do try{if(Je!==0&&ke!==null){var w=ke,z=_n;switch(Je){case 8:Ph(),x=6;break e;case 3:case 2:case 9:case 6:Ht.current===null&&(t=!0);var G=Je;if(Je=0,_n=null,Ci(e,w,z,G),s&&xi){x=0;break e}break;default:G=Je,Je=0,_n=null,Ci(e,w,z,G)}}Rb(),x=mt;break}catch(X){R1(e,X)}while(!0);return t&&e.shellSuspendCounter++,Fs=ca=null,Xe=o,me.H=u,me.A=h,ke===null&&(lt=null,$e=0,dc()),x}function Rb(){for(;ke!==null;)D1(ke)}function Ab(e,t){var s=Xe;Xe|=2;var o=O1(),u=z1();lt!==e||$e!==t?(tu=null,eu=Fe()+500,Ni(e,t)):xi=al(e,t);e:do try{if(Je!==0&&ke!==null){t=ke;var h=_n;t:switch(Je){case 1:Je=0,_n=null,Ci(e,t,h,1);break;case 2:case 9:if(k0(h)){Je=0,_n=null,k1(t);break}t=function(){Je!==2&&Je!==9||lt!==e||(Je=7),bs(e)},h.then(t,t);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:k0(h)?(Je=0,_n=null,k1(t)):(Je=0,_n=null,Ci(e,t,h,7));break;case 5:var x=null;switch(ke.tag){case 26:x=ke.memoizedState;case 5:case 27:var w=ke;if(x?M2(x):w.stateNode.complete){Je=0,_n=null;var z=w.sibling;if(z!==null)ke=z;else{var G=w.return;G!==null?(ke=G,au(G)):ke=null}break t}}Je=0,_n=null,Ci(e,t,h,5);break;case 6:Je=0,_n=null,Ci(e,t,h,6);break;case 8:Ph(),mt=6;break e;default:throw Error(i(462))}}Ob();break}catch(X){R1(e,X)}while(!0);return Fs=ca=null,me.H=o,me.A=u,Xe=s,ke!==null?0:(lt=null,$e=0,dc(),mt)}function Ob(){for(;ke!==null&&!pt();)D1(ke)}function D1(e){var t=Kp(e.alternate,e,Ps);e.memoizedProps=e.pendingProps,t===null?au(e):ke=t}function k1(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Gp(s,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Gp(s,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:eh(t);var o=t;o===Rt&&(De?(vc(o),o.tag===5&&o.stateNode!=null&&(at=o.stateNode)):(vc(o),De=!0));default:Jp(s,t),t=ke=N0(t,Ps),t=Kp(s,t,Ps)}e.memoizedProps=e.pendingProps,t===null?au(e):ke=t}function Ci(e,t,s,o){Fs=ca=null,eh(t),ui=null,Fo=0;var u=t.return;try{if(yb(e,u,t,s,$e)){mt=1,$c(e,Hn(s,e.current)),ke=null;return}}catch(h){if(u!==null)throw ke=u,h;mt=1,$c(e,Hn(s,e.current)),ke=null;return}t.flags&32768?(De||o===1?e=!0:xi||($e&536870912)!==0?e=!1:(Nl=e=!0,(o===2||o===9||o===3||o===6)&&(o=Ht.current,o!==null&&o.tag===13&&(o.flags|=16384))),L1(t,e)):au(t)}function au(e){var t=e;do{if((t.flags&32768)!==0){L1(t,Nl);return}e=t.return;var s=wb(t.alternate,t,Ps);if(s!==null){ke=s;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);mt===0&&(mt=5)}function L1(e,t){do{var s=Nb(e.alternate,e);if(s!==null){s.flags&=32767,ke=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=s}while(e!==null);mt=6,ke=null}function $1(e,t,s,o,u,h,x,w,z,G,X,te){e.cancelPendingCommit=null;do iu();while(dt!==0);if((Xe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===lt&&(ke=lt=null,$e=0),ja=t,Jn=e,Ss=s,Ih=u,M1=o,zb(e,t,s,x,w,z,te)}}function zb(e,t,s,o,u,h,x){var w=t.lanes|t.childLanes;if(qh=w,w|=_d,Wr(e,s,w,o,u,h),bi=null,(s&335544064)===s?(ji=ob(e),o=10262):(ji=null,o=10256),(t.subtreeFlags&o)!==0||(t.flags&o)!==0?(e.callbackNode=null,e.callbackPriority=0,Ub(ll,function(){return Zh(),null})):(e.callbackNode=null,e.callbackPriority=0),Ic=!1,o=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||o){o=me.T,me.T=null,u=Se.p,Se.p=2,h=Xe,Xe|=4;try{Cb(e,t,s)}finally{Xe=h,Se.p=u,me.T=o}}dt=1,Ic?Si=aj(x,e.containerInfo,ji,Yh,Xh,kb,Kh,Zh,Db):(Yh(),Xh(),Kh())}function Db(e){if(dt!==0){var t=Jn.onRecoverableError;t(e,{componentStack:null})}}function kb(){dt===3&&(dt=0,y1(ja,Jn),dt=4)}function Yh(){if(dt===1){dt=0;var e=Jn,t=ja,s=Ss,o=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||o){o=me.T,me.T=null;var u=Se.p;Se.p=2;var h=Xe;Xe|=4;try{Jo=Yc=!1,v1(t,e,s),s=uf;var x=m0(e.containerInfo),w=s.focusedElem,z=s.selectionRange;if(x!==w&&w&&w.ownerDocument&&f0(w.ownerDocument.documentElement,w)){if(z!==null&&wd(w)){var G=z.start,X=z.end;if(X===void 0&&(X=G),"selectionStart"in w)w.selectionStart=G,w.selectionEnd=Math.min(X,w.value.length);else{var te=w.ownerDocument||document,B=te&&te.defaultView||window;if(B.getSelection){var Y=B.getSelection(),fe=w.textContent.length,ve=Math.min(z.start,fe),Ae=z.end===void 0?ve:Math.min(z.end,fe);!Y.extend&&ve>Ae&&(x=Ae,Ae=ve,ve=x);var V=h0(w,ve),H=h0(w,Ae);if(V&&H&&(Y.rangeCount!==1||Y.anchorNode!==V.node||Y.anchorOffset!==V.offset||Y.focusNode!==H.node||Y.focusOffset!==H.offset)){var Q=te.createRange();Q.setStart(V.node,V.offset),Y.removeAllRanges(),ve>Ae?(Y.addRange(Q),Y.extend(H.node,H.offset)):(Q.setEnd(H.node,H.offset),Y.addRange(Q))}}}}for(te=[],Y=w;Y=Y.parentNode;)Y.nodeType===1&&te.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<te.length;w++){var ee=te[w];ee.element.scrollLeft=ee.left,ee.element.scrollTop=ee.top}}zi=!!cf,uf=cf=null}finally{Xe=h,Se.p=u,me.T=o}}e.current=t,dt=2}}function Xh(){if(dt===2){dt=0;var e=Jn,t=ja,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=me.T,me.T=null;var o=Se.p;Se.p=2;var u=Xe;Xe|=4;try{d1(e,t.alternate,t)}finally{Xe=u,Se.p=o,me.T=s}}dt=3}}function Kh(){if(dt===4||dt===3){dt=0;var e=Si;Si=null,_t();var t=Jn,s=ja,o=Ss,u=M1,h=(o&335544064)===o?10262:10256;if((s.subtreeFlags&h)!==0||(s.flags&h)!==0?dt=5:(dt=0,ja=Jn=null,H1(t,t.pendingLanes)),h=t.pendingLanes,h===0&&(Ml=null),Qa(o),s=s.stateNode,Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(os,s,void 0,(s.current.flags&128)===128)}catch{}if(u!==null){s=me.T,h=Se.p,Se.p=2,me.T=null;try{for(var x=t.onRecoverableError,w=0;w<u.length;w++){var z=u[w];x(z.value,{componentStack:z.stack})}}finally{me.T=s,Se.p=h}}if(u=bi,x=ji,ji=null,u!==null&&(bi=null,x===null&&(x=[]),e!==null))for(z=0;z<u.length;z++)s=(0,u[z])(x),s!==void 0&&e.finished.finally(s);(Ss&3)!==0&&iu(),bs(t),h=t.pendingLanes,(o&261930)!==0&&(h&42)!==0?t===nu?nr++:(nr=0,nu=t):(nr=0,nu=null),sr(0)}}function H1(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$o(t)))}function iu(){return Si!==null&&(Si.skipTransition(),Si=null),Yh(),Xh(),Kh(),Zh()}function Zh(){if(dt!==5)return!1;var e=Jn,t=qh;qh=0;var s=Qa(Ss),o=me.T,u=Se.p;try{Se.p=32>s?32:s,me.T=null,s=Ih,Ih=null;var h=Jn,x=Ss;if(dt=0,ja=Jn=null,Ss=0,(Xe&6)!==0)throw Error(i(331));var w=Xe;if(Xe|=4,w1(h.current),S1(h,h.current,x,s),Xe=w,sr(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(os,h)}catch{}return!0}finally{Se.p=u,me.T=o,H1(e,t)}}function U1(e,t,s){t=Hn(s,t),t=mh(e.stateNode,t,2),e=xl(e,t,2),e!==null&&(il(e,2),bs(e))}function We(e,t,s){if(e.tag===3)U1(e,e,s);else for(;t!==null;){if(t.tag===3){U1(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ml===null||!Ml.has(o))){e=Hn(s,e),s=kp(2),o=xl(t,s,2),o!==null&&(Lp(s,o,t,e),il(o,2),bs(o));break}}t=t.return}}function Jh(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new _b;var u=new Set;o.set(t,u)}else u=o.get(t),u===void 0&&(u=new Set,o.set(t,u));u.has(s)||(Vh=!0,u.add(s),e=Lb.bind(null,e,t,s),t.then(e,e))}function Lb(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,lt===e&&($e&s)===s&&((mt===4||mt===3&&($e&62914560)===$e&&300>Fe()-Wc)&&(Xe&2)===0?Ni(e,0):Jc|=s,yi===$e&&(yi=0)),bs(e)}function F1(e,t){t===0&&(t=yo()),e=ia(e,t),e!==null&&(il(e,t),bs(e))}function $b(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),F1(e,s)}function Hb(e,t){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(i(314))}o!==null&&o.delete(t),F1(e,s)}function Ub(e,t){return Pe(e,t)}var Mi=null,Ei=null,Wh=!1,ou=!1,ef=!1,_l=0;function bs(e){e!==Ei&&e.next===null&&(Ei===null?Mi=Ei=e:Ei=Ei.next=e),ou=!0,Wh||(Wh=!0,Bb())}function sr(e,t){if(!ef&&ou){ef=!0;do for(var s=!1,o=Mi;o!==null;){if(e!==0){var u=o.pendingLanes;if(u===0)var h=0;else{var x=o.suspendedLanes,w=o.pingedLanes;h=(1<<31-Lt(42|e)+1)-1,h&=u&~(x&~w),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(s=!0,q1(o,h))}else h=$e,h=ea(o,o===lt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||al(o,h)||(s=!0,q1(o,h));o=o.next}while(s);ef=!1}}function Fb(){B1()}function B1(){ou=Wh=!1;var e=0;_l!==0&&Jb()&&(e=_l);for(var t=Fe(),s=null,o=Mi;o!==null;){var u=o.next,h=V1(o,t);h===0?(o.next=null,s===null?Mi=u:s.next=u,u===null&&(Ei=s)):(s=o,(e!==0||(h&3)!==0)&&(ou=!0)),o=u}dt!==0&&dt!==5||sr(e),_l!==0&&(_l=0)}function V1(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var x=31-Lt(h),w=1<<x,z=u[x];z===-1?((w&s)===0||(w&o)!==0)&&(u[x]=Jr(w,t)):z<=t&&(e.expiredLanes|=w),h&=~w}if(t=lt,s=$e,s=ea(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===t&&(Je===2||Je===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ie(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||al(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(o!==null&&Ie(o),Qa(s)){case 2:case 8:s=Kl;break;case 32:s=ll;break;case 268435456:s=vo;break;default:s=ll}return o=G1.bind(null,e),s=Pe(s,o),e.callbackPriority=t,e.callbackNode=s,t}return o!==null&&o!==null&&Ie(o),e.callbackPriority=2,e.callbackNode=null,2}function G1(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(iu()&&e.callbackNode!==s)return null;var o=$e;return o=ea(e,e===lt?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(_1(e,o,t),V1(e,Fe()),e.callbackNode!=null&&e.callbackNode===s?G1.bind(null,e):null)}function q1(e,t){if(iu())return null;_1(e,t,!0)}function Bb(){ej(function(){(Xe&6)!==0?Pe(mn,Fb):B1()})}function tf(){if(_l===0){var e=ha;e===0&&(e=Zl,Zl<<=1,(Zl&261888)===0&&(Zl=256)),_l=e}return _l}function I1(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:sc(e)}function Vb(e,t,s,o,u){if(t==="submit"&&s&&s.stateNode===u){var h=I1((u[st]||null).action),x=o.submitter;x&&(t=(t=x[st]||null)?I1(t.formAction):x.getAttribute("formAction"),t!==null&&(h=t,x=null));var w=new oc("action","action",null,o,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(_l!==0){var z=new FormData(u,x);ch(s,{pending:!0,data:z,method:u.method,action:h},null,z)}}else typeof h=="function"&&(w.preventDefault(),z=new FormData(u,x),ch(s,{pending:!0,data:z,method:u.method,action:h},h,z))},currentTarget:u}]})}}for(var nf=0;nf<Ed.length;nf++){var sf=Ed[nf],Gb=sf.toLowerCase(),qb=sf[0].toUpperCase()+sf.slice(1);Yn(Gb,"on"+qb)}Yn(v0,"onAnimationEnd"),Yn(x0,"onAnimationIteration"),Yn(y0,"onAnimationStart"),Yn("dblclick","onDoubleClick"),Yn("focusin","onFocus"),Yn("focusout","onBlur"),Yn(WS,"onTransitionRun"),Yn(eb,"onTransitionStart"),Yn(tb,"onTransitionCancel"),Yn(S0,"onTransitionEnd"),Xa("onMouseEnter",["mouseout","mouseover"]),Xa("onMouseLeave",["mouseout","mouseover"]),Xa("onPointerEnter",["pointerout","pointerover"]),Xa("onPointerLeave",["pointerout","pointerover"]),sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sa("onBeforeInput",["compositionend","keypress","textInput","paste"]),sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lr="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(" "),Ib=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lr));function P1(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],u=o.event;o=o.listeners;e:{var h=void 0;if(t)for(var x=o.length-1;0<=x;x--){var w=o[x],z=w.instance,G=w.currentTarget;if(w=w.listener,z!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=G;try{h(u)}catch(X){uc(X)}u.currentTarget=null,h=z}else for(x=0;x<o.length;x++){if(w=o[x],z=w.instance,G=w.currentTarget,w=w.listener,z!==h&&u.isPropagationStopped())break e;h=w,u.currentTarget=G;try{h(u)}catch(X){uc(X)}u.currentTarget=null,h=z}}}}function Le(e,t){var s=t[ec];s===void 0&&(s=t[ec]=new Set);var o=e+"__bubble";s.has(o)||(Q1(t,e,2,!1),s.add(o))}function lf(e,t,s){var o=0;t&&(o|=4),Q1(s,e,o,t)}var ru="_reactListening"+Math.random().toString(36).slice(2);function af(e){if(!e[ru]){e[ru]=!0,Dg.forEach(function(s){s!=="selectionchange"&&(Ib.has(s)||lf(s,!1,e),lf(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ru]||(t[ru]=!0,lf("selectionchange",!1,t))}}function Q1(e,t,s,o){switch(L2(t)){case 2:var u=$j;break;case 8:u=Hj;break;default:u=Mf}s=u.bind(null,t,s,e),u=void 0,!fd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),o?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function of(e,t,s,o,u){var h=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var x=o.tag;if(x===3||x===4){var w=o.stateNode.containerInfo;if(w===u)break;if(x===4)for(x=o.return;x!==null;){var z=x.tag;if((z===3||z===4)&&x.stateNode.containerInfo===u)return;x=x.return}for(;w!==null;){if(x=Os(w),x===null)return;if(z=x.tag,z===5||z===6||z===26||z===27){o=h=x;continue e}w=w.parentNode}}o=o.return}Qg(function(){var G=h,X=dd(s),te=[];e:{var B=b0.get(e);if(B!==void 0){var Y=oc,fe=e;switch(e){case"keypress":if(ac(s)===0)break e;case"keydown":case"keyup":Y=TS;break;case"focusin":fe="focus",Y=vd;break;case"focusout":fe="blur",Y=vd;break;case"beforeblur":case"afterblur":Y=vd;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Kg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=vS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=DS;break;case v0:case x0:case y0:Y=SS;break;case S0:Y=LS;break;case"scroll":case"scrollend":Y=gS;break;case"wheel":Y=HS;break;case"copy":case"cut":case"paste":Y=jS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Jg;break;case"submit":Y=OS;break;case"toggle":case"beforetoggle":Y=FS}var ve=(t&4)!==0,Ae=!ve&&(e==="scroll"||e==="scrollend"),V=ve?B!==null?B+"Capture":null:B;ve=[];for(var H=G,Q;H!==null;){var ee=H;if(Q=ee.stateNode,ee=ee.tag,ee!==5&&ee!==26&&ee!==27||Q===null||V===null||(ee=Mo(H,V),ee!=null&&ve.push(ar(H,ee,Q))),Ae)break;H=H.return}0<ve.length&&(B=new Y(B,fe,null,s,X),te.push({event:B,listeners:ve}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",B=e==="mouseout"||e==="pointerout",Y&&s!==ud&&(fe=s.relatedTarget||s.fromElement)&&(Os(fe)||fe[us]))break e;(B||Y)&&(fe=X.window===X?X:(Y=X.ownerDocument)?Y.defaultView||Y.parentWindow:window,B?(Y=s.relatedTarget||s.toElement,B=G,Y=Y?Os(Y):null,Y!==null&&(Ae=d(Y),ve=Y.tag,Y!==Ae||ve!==5&&ve!==27&&ve!==6)&&(Y=null)):(B=null,Y=G),B!==Y&&(ve=Kg,ee="onMouseLeave",V="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Jg,ee="onPointerLeave",V="onPointerEnter",H="pointer"),Ae=B==null?fe:rl(B),Q=Y==null?fe:rl(Y),fe=new ve(ee,H+"leave",B,s,X),fe.target=Ae,fe.relatedTarget=Q,ee=null,Os(X)===G&&(ve=new ve(V,H+"enter",Y,s,X),ve.target=Q,ve.relatedTarget=Ae,ee=ve),Ae=ee,ve=B&&Y?R(B,Y,Pb):null,B!==null&&Y1(te,fe,B,ve,!1),Y!==null&&Ae!==null&&Y1(te,Ae,Y,ve,!0)))}e:{if(B=G?rl(G):window,Y=B.nodeName&&B.nodeName.toLowerCase(),Y==="select"||Y==="input"&&B.type==="file")var pe=i0;else if(l0(B))if(o0)pe=KS;else{pe=YS;var He=QS}else Y=B.nodeName,!Y||Y.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?G&&cd(G.elementType)&&(pe=i0):pe=XS;if(pe&&(pe=pe(e,G))){a0(te,pe,s,X);break e}He&&He(e,B,G)}switch(He=G?rl(G):window,e){case"focusin":(l0(He)||He.contentEditable==="true")&&(ti=He,Nd=G,Do=null);break;case"focusout":Do=Nd=ti=null;break;case"mousedown":Cd=!0;break;case"contextmenu":case"mouseup":case"dragend":Cd=!1,g0(te,s,X);break;case"selectionchange":if(JS)break;case"keydown":case"keyup":g0(te,s,X)}var be;if(yd)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else ei?n0(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(Wg&&s.locale!=="ko"&&(ei||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&ei&&(be=Yg()):(cl=X,md="value"in cl?cl.value:cl.textContent,ei=!0)),He=cu(G,Me),0<He.length&&(Me=new Zg(Me,e,null,s,X),te.push({event:Me,listeners:He}),be?Me.data=be:(be=s0(s),be!==null&&(Me.data=be)))),(be=VS?GS(e,s):qS(e,s))&&(Me=cu(G,"onBeforeInput"),0<Me.length&&(He=new Zg("onBeforeInput","beforeinput",null,s,X),te.push({event:He,listeners:Me}),He.data=be)),Vb(te,e,G,s,X)}P1(te,t)})}function ar(e,t,s){return{instance:e,listener:t,currentTarget:s}}function cu(e,t){for(var s=t+"Capture",o=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=Mo(e,s),u!=null&&o.unshift(ar(e,u,h)),u=Mo(e,t),u!=null&&o.push(ar(e,u,h))),e.tag===3)return o;e=e.return}return[]}function Pb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Y1(e,t,s,o,u){for(var h=t._reactName,x=[];s!==null&&s!==o;){var w=s,z=w.alternate,G=w.stateNode;if(w=w.tag,z!==null&&z===o)break;w!==5&&w!==26&&w!==27||G===null||(z=G,u?(G=Mo(s,h),G!=null&&x.unshift(ar(s,G,z))):u||(G=Mo(s,h),G!=null&&x.push(ar(s,G,z)))),s=s.return}x.length!==0&&e.push({event:t,listeners:x})}var Qb=/\r\n?/g,Yb=/\u0000|\uFFFD/g;function X1(e){return(typeof e=="string"?e:""+e).replace(Qb,`
|
|
49
|
+
`).replace(Yb,"")}function K1(e,t){return t=X1(t),X1(e)===t}function et(e,t,s,o,u,h){switch(s){case"children":if(typeof o=="string")t==="body"||t==="textarea"&&o===""||Za(e,o);else if(typeof o=="number"||typeof o=="bigint")t!=="body"&&Za(e,""+o);else return;break;case"className":nc(e,"class",o);break;case"tabIndex":nc(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":nc(e,s,o);break;case"style":Ig(e,o,h);return;case"data":if(t!=="object"){nc(e,"data",o);break}case"src":case"href":if(o===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=sc(o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"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 h=="function"&&(s==="formAction"?(t!=="input"&&et(e,t,"name",u.name,u,null),et(e,t,"formEncType",u.formEncType,u,null),et(e,t,"formMethod",u.formMethod,u,null),et(e,t,"formTarget",u.formTarget,u,null)):(et(e,t,"encType",u.encType,u,null),et(e,t,"method",u.method,u,null),et(e,t,"target",u.target,u,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=sc(o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=ds);return;case"onScroll":o!=null&&Le("scroll",e);return;case"onScrollEnd":o!=null&&Le("scrollend",e);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(i(60));(h!=null?h.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=sc(o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":Le("beforetoggle",e),Le("toggle",e),tc(e,"popover",o);break;case"xlinkActuate":Ds(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Ds(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Ds(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Ds(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Ds(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Ds(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Ds(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Ds(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Ds(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":tc(e,"is",o);break;case"innerText":case"textContent":return;default:if(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")s=fS.get(s)||s,tc(e,s,o);else return}Qe=!0}function rf(e,t,s,o,u,h){switch(s){case"style":Ig(e,o,h);return;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(i(61));if(s=o.__html,s!=null){if(u.children!=null)throw Error(i(60));(h!=null?h.__html:void 0)!==s&&(e.innerHTML=s)}}break;case"children":if(typeof o=="string")Za(e,o);else if(typeof o=="number"||typeof o=="bigint")Za(e,""+o);else return;break;case"onScroll":o!=null&&Le("scroll",e);return;case"onScrollEnd":o!=null&&Le("scrollend",e);return;case"onClick":o!=null&&(e.onclick=ds);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!kg.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),h=s.slice(2,u?s.length-7:void 0),t=e[st]||null,t=t!=null?t[s]:null,typeof t=="function"&&e.removeEventListener(h,t,u),typeof o=="function")){typeof t!="function"&&t!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(h,o,u);break e}Qe=!0,s in e?e[s]=o:o===!0?e.setAttribute(s,""):tc(e,s,o)}return}Qe=!0}function Bt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var o=!1,u=!1,h;for(h in s)if(s.hasOwnProperty(h)){var x=s[h];if(x!=null)switch(h){case"src":o=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:et(e,t,h,x,s,null)}}u&&et(e,t,"srcSet",s.srcSet,s,null),o&&et(e,t,"src",s.src,s,null);return;case"input":Le("invalid",e);var w=h=x=u=null,z=null,G=null;for(o in s)if(s.hasOwnProperty(o)){var X=s[o];if(X!=null)switch(o){case"name":u=X;break;case"type":x=X;break;case"checked":z=X;break;case"defaultChecked":G=X;break;case"value":h=X;break;case"defaultValue":w=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,t));break;default:et(e,t,o,X,s,null)}}Bg(e,h,w,z,G,x,u,!1);return;case"select":Le("invalid",e),o=x=h=null;for(u in s)if(s.hasOwnProperty(u)&&(w=s[u],w!=null))switch(u){case"value":h=w;break;case"defaultValue":x=w;break;case"multiple":o=w;default:et(e,t,u,w,s,null)}t=h,s=x,e.multiple=!!o,t!=null?Ka(e,!!o,t,!1):s!=null&&Ka(e,!!o,s,!0);return;case"textarea":Le("invalid",e),h=u=o=null;for(x in s)if(s.hasOwnProperty(x)&&(w=s[x],w!=null))switch(x){case"value":o=w;break;case"defaultValue":u=w;break;case"children":h=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(i(91));break;default:et(e,t,x,w,s,null)}Gg(e,o,u,h);return;case"option":for(z in s)if(s.hasOwnProperty(z)&&(o=s[z],o!=null))switch(z){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:et(e,t,z,o,s,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(o=0;o<lr.length;o++)Le(lr[o],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(G in s)if(s.hasOwnProperty(G)&&(o=s[G],o!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:et(e,t,G,o,s,null)}return;default:if(cd(t)){for(X in s)s.hasOwnProperty(X)&&(o=s[X],o!==void 0&&rf(e,t,X,o,s,void 0));return}}for(w in s)s.hasOwnProperty(w)&&(o=s[w],o!=null&&et(e,t,w,o,s,null))}var Xb={};function Kb(e,t,s,o){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,x=null,w=null,z=null,G=null,X=null;for(Y in s){var te=s[Y];if(s.hasOwnProperty(Y)&&te!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":z=te;default:o.hasOwnProperty(Y)||et(e,t,Y,null,o,te)}}for(var B in o){var Y=o[B];if(te=s[B],o.hasOwnProperty(B)&&(Y!=null||te!=null))switch(B){case"type":Y!==te&&(Qe=!0),h=Y;break;case"name":Y!==te&&(Qe=!0),u=Y;break;case"checked":Y!==te&&(Qe=!0),G=Y;break;case"defaultChecked":Y!==te&&(Qe=!0),X=Y;break;case"value":Y!==te&&(Qe=!0),x=Y;break;case"defaultValue":Y!==te&&(Qe=!0),w=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:Y!==te&&et(e,t,B,Y,o,te)}}od(e,x,w,z,G,X,h,u);return;case"select":Y=x=w=B=null;for(h in s)if(z=s[h],s.hasOwnProperty(h)&&z!=null)switch(h){case"value":break;case"multiple":Y=z;default:o.hasOwnProperty(h)||et(e,t,h,null,o,z)}for(u in o)if(h=o[u],z=s[u],o.hasOwnProperty(u)&&(h!=null||z!=null))switch(u){case"value":h!==z&&(Qe=!0),B=h;break;case"defaultValue":h!==z&&(Qe=!0),w=h;break;case"multiple":h!==z&&(Qe=!0),x=h;default:h!==z&&et(e,t,u,h,o,z)}t=w,s=x,o=Y,B!=null?Ka(e,!!s,B,!1):!!o!=!!s&&(t!=null?Ka(e,!!s,t,!0):Ka(e,!!s,s?[]:"",!1));return;case"textarea":Y=B=null;for(w in s)if(u=s[w],s.hasOwnProperty(w)&&u!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:et(e,t,w,null,o,u)}for(x in o)if(u=o[x],h=s[x],o.hasOwnProperty(x)&&(u!=null||h!=null))switch(x){case"value":u!==h&&(Qe=!0),B=u;break;case"defaultValue":u!==h&&(Qe=!0),Y=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(i(91));break;default:u!==h&&et(e,t,x,u,o,h)}Vg(e,B,Y);return;case"option":for(var fe in s)if(B=s[fe],s.hasOwnProperty(fe)&&B!=null&&!o.hasOwnProperty(fe))switch(fe){case"selected":e.selected=!1;break;default:et(e,t,fe,null,o,B)}for(z in o)if(B=o[z],Y=s[z],o.hasOwnProperty(z)&&B!==Y&&(B!=null||Y!=null))switch(z){case"selected":B!==Y&&(Qe=!0),e.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:et(e,t,z,B,o,Y)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in s)B=s[ve],s.hasOwnProperty(ve)&&B!=null&&!o.hasOwnProperty(ve)&&et(e,t,ve,null,o,B);for(G in o)if(B=o[G],Y=s[G],o.hasOwnProperty(G)&&B!==Y&&(B!=null||Y!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(i(137,t));break;default:et(e,t,G,B,o,Y)}return;default:if(cd(t)){for(var Ae in s)B=s[Ae],s.hasOwnProperty(Ae)&&B!==void 0&&!o.hasOwnProperty(Ae)&&rf(e,t,Ae,void 0,o,B);for(X in o)B=o[X],Y=s[X],!o.hasOwnProperty(X)||B===Y||B===void 0&&Y===void 0||rf(e,t,X,B,o,Y);return}}for(var V in s)B=s[V],s.hasOwnProperty(V)&&B!=null&&!o.hasOwnProperty(V)&&et(e,t,V,null,o,B);for(te in o)B=o[te],Y=s[te],!o.hasOwnProperty(te)||B===Y||B==null&&Y==null||et(e,t,te,B,o,Y)}function Z1(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Zb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var u=s[o],h=u.transferSize,x=u.initiatorType,w=u.duration;if(h&&w&&Z1(x)){for(x=0,w=u.responseEnd,o+=1;o<s.length;o++){var z=s[o],G=z.startTime;if(G>w)break;var X=z.transferSize,te=z.initiatorType;X&&Z1(te)&&(z=z.responseEnd,x+=X*(z<w?1:(w-G)/(z-G)))}if(--o,t+=8*(h+x)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var cf=null,uf=null;function ir(e){return e.nodeType===9?e:e.ownerDocument}function J1(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function W1(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function e2(e,t,s,o){return s=ir(s).createElement(e),s[Oe]=o,s[st]=t,Bt(s,e,t),Tt(s),s}function df(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var hf=null;function Jb(){var e=window.event;return e&&e.type==="popstate"?e===hf?!1:(hf=e,!0):(hf=null,!1)}var ff=typeof setTimeout=="function"?setTimeout:void 0,Wb=typeof clearTimeout=="function"?clearTimeout:void 0,t2=typeof Promise=="function"?Promise:void 0,n2=typeof requestAnimationFrame=="function"?requestAnimationFrame:ff,ej=typeof queueMicrotask=="function"?queueMicrotask:typeof t2<"u"?function(e){return t2.resolve(null).then(e).catch(tj)}:ff;function tj(e){setTimeout(function(){throw e})}function Tl(e){return e==="head"}function s2(e,t){var s=t,o=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(u),Di(t);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")bf(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,bf(s);for(var h=s.firstChild;h;){var x=h.nextSibling,w=h.nodeName;h[ol]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&h.rel.toLowerCase()==="stylesheet"||s.removeChild(h),h=x}}else s==="body"&&bf(e.ownerDocument.body);s=u}while(s);Di(t)}function l2(e,t){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function a2(e,t,s){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,s!=null&&(e.style.viewTransitionClass=s),s=getComputedStyle(e),s.display==="inline"){if(t=e.getClientRects(),t.length===1)var o=1;else for(var u=o=0;u<t.length;u++){var h=t[u];0<h.width&&0<h.height&&o++}o===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+s.paddingTop,e.marginBottom="-"+s.paddingBottom)}}function i2(e,t){e=e.style,t=t.style;var s=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=s==null||typeof s=="boolean"?"":(""+s).trim(),s=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=s==null||typeof s=="boolean"?"":(""+s).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(s=t.display,e.display=s==null||typeof s=="boolean"?"":s,s=t.margin,s!=null?e.margin=s:(s=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=s==null||typeof s=="boolean"?"":s,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function nj(e,t,s){return s=s.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=s.innerHeight&&e.left<=s.innerWidth}}function mf(e){var t=e.getBoundingClientRect(),s=getComputedStyle(e);return nj(t,s,e)}function sj(e){return e.documentElement.clientHeight}function lj(e){this.addEventListener("load",e),this.addEventListener("error",e)}function aj(e,t,s,o,u,h,x,w,z){var G=t.nodeType===9?t:t.ownerDocument;try{var X=G.startViewTransition({update:function(){var B=G.defaultView,Y=B.navigation&&B.navigation.transition,fe=G.fonts.status;o();var ve=[];if(fe==="loaded"&&(sj(G),G.fonts.status==="loading"&&ve.push(G.fonts.ready)),fe=ve.length,e!==null)for(var Ae=e.suspenseyImages,V=0,H=0;H<Ae.length;H++){var Q=Ae[H];if(!Q.complete){var ee=Q.getBoundingClientRect();if(0<ee.bottom&&0<ee.right&&ee.top<B.innerHeight&&ee.left<B.innerWidth){if(V+=E2(Q),V>hu){ve.length=fe;break}Q=new Promise(lj.bind(Q)),ve.push(Q)}}}if(0<ve.length)return B=Promise.race([Promise.all(ve),new Promise(function(pe){return setTimeout(pe,500)})]).then(u,u),(Y?Promise.allSettled([Y.finished,B]):B).then(h,h);if(u(),Y)return Y.finished.then(h,h);h()},types:s});G.__reactViewTransition=X;var te=[];return X.ready.then(function(){for(var B=G.documentElement.getAnimations({subtree:!0}),Y=0;Y<B.length;Y++){var fe=B[Y],ve=fe.effect,Ae=ve.pseudoElement;if(Ae!=null&&Ae.startsWith("::view-transition")){te.push(fe),fe=ve.getKeyframes();for(var V=Ae=void 0,H=!0,Q=0;Q<fe.length;Q++){var ee=fe[Q],pe=ee.width;if(Ae===void 0)Ae=pe;else if(Ae!==pe){H=!1;break}if(pe=ee.height,V===void 0)V=pe;else if(V!==pe){H=!1;break}delete ee.width,delete ee.height,ee.transform==="none"&&delete ee.transform}H&&Ae!==void 0&&V!==void 0&&(ve.setKeyframes(fe),H=getComputedStyle(ve.target,ve.pseudoElement),H.width!==Ae||H.height!==V)&&(H=fe[0],H.width=Ae,H.height=V,H=fe[fe.length-1],H.width=Ae,H.height=V,ve.setKeyframes(fe))}}x()},function(B){G.__reactViewTransition===X&&(G.__reactViewTransition=null);try{if(typeof B=="object"&&B!==null)switch(B.name){case"InvalidStateError":(B.message==="View transition was skipped because document visibility state is hidden."||B.message==="Skipping view transition because document visibility state has become hidden."||B.message==="Skipping view transition because viewport size changed."||B.message==="Transition was aborted because of invalid state")&&(B=null)}B!==null&&z(B)}finally{o(),u(),x()}}),X.finished.finally(function(){for(var B=0;B<te.length;B++)te[B].cancel();G.__reactViewTransition===X&&(G.__reactViewTransition=null),w()}),X}catch{return o(),u(),x(),null}}function wa(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}wa.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:k({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},wa.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,s=e.getAnimations({subtree:!0}),o=[],u=0;u<s.length;u++){var h=s[u].effect;h!==null&&h.target===e&&h.pseudoElement===t&&o.push(s[u])}return o},wa.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function o2(e){return{name:e,group:new wa("group",e),imagePair:new wa("image-pair",e),old:new wa("old",e),new:new wa("new",e)}}function An(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}An.prototype.addEventListener=function(e,t,s){var o=null,u=null;if(!(s!=null&&typeof s!="boolean"&&(o=s.signal||null,o!==null&&o.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var h=this._eventListeners;if(c2(h,e,t,s)===-1){var x=this,w=t;s!=null&&typeof s!="boolean"&&s.once===!0&&(w=function(z){x.removeEventListener(e,t,s),typeof t=="function"?t.call(this,z):t.handleEvent(z)}),o!==null&&(u=x.removeEventListener.bind(x,e,t,s),o.addEventListener("abort",u,{once:!0}),u=o.removeEventListener.bind(o,"abort",u)),o=_i(s),h.push({type:e,listener:t,optionsOrUseCapture:s,attachedListener:w,cleanup:u}),p(this._fragmentFiber.child,!1,ij,e,w,o)}this._eventListeners=h}};function ij(e,t,s,o){return E(e).addEventListener(t,s,o),!1}An.prototype.removeEventListener=function(e,t,s){var o=this._eventListeners;if(o!==null&&(t=c2(o,e,t,s),t!==-1)){var u=o[t];s=u.attachedListener;var h=u.cleanup;u=_i(u.optionsOrUseCapture),p(this._fragmentFiber.child,!1,oj,e,s,u),o.splice(t,1),h!==null&&h()}};function oj(e,t,s,o){return E(e).removeEventListener(t,s,o),!1}function _i(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function r2(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function c2(e,t,s,o){if(e.length===0)return-1;o=r2(o);for(var u=0;u<e.length;u++){var h=e[u];if(h.type===t&&h.listener===s&&r2(h.optionsOrUseCapture)===o)return u}return-1}An.prototype.dispatchEvent=function(e){var t=S(this._fragmentFiber);if(t===null)return!0;t=E(t);var s=this._eventListeners;if(s!==null&&0<s.length||!e.bubbles){var o=t.nodeType===9?t.createComment(""):document.createTextNode("");if(s)for(var u=0;u<s.length;u++){var h=s[u];o.addEventListener(h.type,h.attachedListener,_i(h.optionsOrUseCapture))}if(t.appendChild(o),e=o.dispatchEvent(e),s)for(u=0;u<s.length;u++)h=s[u],o.removeEventListener(h.type,h.attachedListener,_i(h.optionsOrUseCapture));return t.removeChild(o),e}return t.dispatchEvent(e)},An.prototype.focus=function(e){p(this._fragmentFiber.child,!0,u2,e,void 0,void 0)};function u2(e,t){return e.tag===6?!1:(e=E(e),yj(e,t))}An.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,gf,t,void 0,void 0);for(var s=t.length-1;0<=s&&!u2(t[s],e);s--);};function gf(e,t){return t.push(e),!1}An.prototype.blur=function(){var e=S(this._fragmentFiber);e!==null&&(e=E(e),e=ir(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,rj,e,void 0,void 0))};function rj(e,t){return e.tag===6?!1:(e=E(e),e===t||e.contains(t)?(t.blur(),!0):!1)}An.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,cj,e,void 0,void 0)};function cj(e,t){return e.tag===6||(e=E(e),t.observe(e)),!1}An.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,uj,e,void 0,void 0);for(var s=t=0;s<Wn.length;s++){var o=Wn[s];o.fragmentInstance===this&&o.observer===e?e.unobserve(o.instance):Wn[t++]=o}Wn.length=t}};function uj(e,t){return e.tag===6||(e=E(e),t.unobserve(e)),!1}var Wn=[],pf=!1;function dj(e,t,s){Wn.push({fragmentInstance:e,observer:t,instance:s}),pf||(pf=!0,Sj(function(){pf=!1;var o=Wn;Wn=[];for(var u=0;u<o.length;u++){var h=o[u];h.observer.unobserve(h.instance)}}))}An.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,hj,e,void 0,void 0),e};function hj(e,t){if(e.tag===6){e=e.stateNode;var s=e.ownerDocument.createRange();s.selectNodeContents(e),t.push.apply(t,s.getClientRects())}else e=E(e),t.push.apply(t,e.getClientRects());return!1}An.prototype.getRootNode=function(e){var t=S(this._fragmentFiber);return t===null?this:E(t).getRootNode(e)},An.prototype.compareDocumentPosition=function(e){var t=S(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var s=[];p(this._fragmentFiber.child,!1,gf,s,void 0,void 0);var o=E(t);if(s.length===0){if(s=o,j(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(s=t)}t=this._fragmentFiber;var u=o=s.compareDocumentPosition(e);return s===e?u=Node.DOCUMENT_POSITION_CONTAINS:o&Node.DOCUMENT_POSITION_CONTAINED_BY&&(s=b(t)[1],s===null?u=Node.DOCUMENT_POSITION_PRECEDING:(e=E(s).compareDocumentPosition(e),u=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),u|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=E(s[0]),u=E(s[s.length-1]);var h=j(this._fragmentFiber)?t.parentElement:o;if(h==null)return Node.DOCUMENT_POSITION_DISCONNECTED;o=h.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,h=h.compareDocumentPosition(u)&Node.DOCUMENT_POSITION_CONTAINED_BY;var x=t.compareDocumentPosition(e),w=u.compareDocumentPosition(e),z=x&Node.DOCUMENT_POSITION_CONTAINED_BY||w&Node.DOCUMENT_POSITION_CONTAINED_BY;return w=o&&h&&x&Node.DOCUMENT_POSITION_FOLLOWING&&w&Node.DOCUMENT_POSITION_PRECEDING,t=o&&t===e||h&&u===e||z||w?Node.DOCUMENT_POSITION_CONTAINED_BY:!o&&t===e||!h&&u===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:x,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||fj(t,this._fragmentFiber,s[0],s[s.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function fj(e,t,s,o,u){var h=Os(u);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(s=!!h)e:{for(;h!==null;){if(h.tag===7&&(h===t||h.alternate===t)){s=!0;break e}h=h.return}s=!1}return s}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(h===null)return h=u.ownerDocument,u===h||u===h.documentElement||u===h.body;e:{for(h=t,t=S(t);h!==null;){if(!(h.tag!==5&&h.tag!==3&&h.tag!==27||h!==t&&h.alternate!==t)){h=!0;break e}h=h.return}h=!1}return h}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!h)&&!(t=h===s)&&(t=R(s,h,_),t===null?t=!1:(p(t,!0,L,h,s),h=A,A=null,t=h!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!h)&&!(t=h===o)&&(t=R(o,h,_),t===null?t=!1:(p(t,!0,M,h,o),h=A,T=A=null,t=h!==null)),t):!1}function d2(e,t){var s=e.ownerDocument.createRange();s.selectNodeContents(e),e=s.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}An.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,gf,t,void 0,void 0);var s=e!==!1;if(t.length===0){var o=b(this._fragmentFiber);if(o=s?o[1]||o[0]||S(this._fragmentFiber):o[0]||o[1],o===null)return;if(o.tag===6){e=E(o),d2(e,s);return}if(o=E(o),o.nodeType!==9){if(o.nodeType===11){s="host"in o?o.host:null,s!==null&&s.scrollIntoView(e);return}o.scrollIntoView(e)}}for(o=s?t.length-1:0;o!==(s?-1:t.length);){var u=t[o];u.tag===6?(u=E(u),d2(u,s)):E(u).scrollIntoView(e),o+=s?-1:1}};function mj(e,t){return e=E(e),h2(e,t),!1}function h2(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function f2(e,t){var s=t._eventListeners;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o];e.addEventListener(u.type,u.attachedListener,_i(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(h){for(var x=0,w=0;w<Wn.length;w++){var z=Wn[w];(z.fragmentInstance!==t||z.observer!==h||z.instance!==e)&&(Wn[x++]=z)}Wn.length=x,h.observe(e)}),h2(e,t))}function gj(e,t){var s=t._eventListeners;if(s!==null)for(var o=0;o<s.length;o++){var u=s[o];e.removeEventListener(u.type,u.attachedListener,_i(u.optionsOrUseCapture))}e.nodeType!==3&&(s=t._observers,s!==null&&s.forEach(function(h){typeof h.rootMargin=="string"?dj(t,h,e):h.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function vf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":vf(s),na(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function pj(e,t,s,o){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[ol])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=Gn(e.nextSibling),e===null)break}return null}function vj(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Gn(e.nextSibling),e===null))return null;return e}function m2(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Gn(e.nextSibling),e===null))return null;return e}function xf(e){return e.data==="$?"||e.data==="$~"}function yf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function xj(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var o=function(){t(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Gn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Sf=null;function g2(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Gn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function p2(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function yj(e,t){function s(){o=!0}if(e.ownerDocument.activeElement===e)return!0;var o=!1;try{e.ownerDocument.addEventListener("focus",s,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",s,!0)}return o}function Sj(e){n2(function(){n2(function(t){return e(t)})})}function v2(e,t,s){switch(t=ir(s),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function x2(e,t,s){for(var o in s){var u=s[o];s.hasOwnProperty(o)&&u!=null&&et(e,t,o,null,Xb,u)}s.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===ds&&(e.onclick=null),na(e)}function bf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);na(e)}var qn=new Map,y2=new Set;function or(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Qs=Se.d;Se.d={f:bj,r:jj,D:wj,C:Nj,L:Cj,m:Mj,X:_j,S:Ej,M:Tj};function bj(){var e=Qs.f(),t=su();return e||t}function jj(e){var t=zs(e);t!==null&&t.tag===5&&t.type==="form"?bp(t):Qs.r(e)}var Ti=typeof document>"u"?null:document;function S2(e,t,s){var o=Ti;if(o&&typeof t=="string"&&t){var u=Ln(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),y2.has(u)||(y2.add(u),e={rel:e,crossOrigin:s,href:t},o.querySelector(u)===null&&(t=o.createElement("link"),Bt(t,"link",e),Tt(t),o.head.appendChild(t)))}}function wj(e){Qs.D(e),S2("dns-prefetch",e,null)}function Nj(e,t){Qs.C(e,t),S2("preconnect",e,t)}function Cj(e,t,s){Qs.L(e,t,s);var o=Ti;if(o&&e&&t){var u='link[rel="preload"][as="'+Ln(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Ln(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Ln(s.imageSizes)+'"]')):u+='[href="'+Ln(e)+'"]';var h=u;switch(t){case"style":h=Ri(e);break;case"script":h=Ai(e)}if(!(qn.has(h)||(e=k({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),qn.set(h,e),o.querySelector(u)!==null||t==="style"&&o.querySelector(rr(h))||t==="script"&&o.querySelector(cr(h))))){var x=o.createElement("link");Bt(x,"link",e),t==="style"&&(x[ta]=!0,x.onload=x.onerror=function(){zg(x)}),Tt(x),o.head.appendChild(x)}}}function Mj(e,t){Qs.m(e,t);var s=Ti;if(s&&e){var o=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Ln(o)+'"][href="'+Ln(e)+'"]',h=u;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Ai(e)}if(!qn.has(h)&&(e=k({rel:"modulepreload",href:e},t),qn.set(h,e),s.querySelector(u)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(cr(h)))return}o=s.createElement("link"),Bt(o,"link",e),Tt(o),s.head.appendChild(o)}}}function Ej(e,t,s){Qs.S(e,t,s);var o=Ti;if(o&&e){var u=Ya(o).hoistableStyles,h=Ri(e);t=t||"default";var x=u.get(h);if(!x){var w={loading:0,preload:null};if(x=o.querySelector(rr(h)))w.loading=5;else{e=k({rel:"stylesheet",href:e,"data-precedence":t},s),(s=qn.get(h))&&jf(e,s);var z=x=o.createElement("link");Tt(z),Bt(z,"link",e),z._p=new Promise(function(G,X){z.onload=G,z.onerror=X}),z.addEventListener("load",function(){w.loading|=1}),z.addEventListener("error",function(){w.loading|=2}),w.loading|=4,uu(x,t,o)}x={type:"stylesheet",instance:x,count:1,state:w},u.set(h,x)}}}function _j(e,t){Qs.X(e,t);var s=Ti;if(s&&e){var o=Ya(s).hoistableScripts,u=Ai(e),h=o.get(u);h||(h=s.querySelector(cr(u)),h||(e=k({src:e,async:!0},t),(t=qn.get(u))&&wf(e,t),h=s.createElement("script"),Tt(h),Bt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function Tj(e,t){Qs.M(e,t);var s=Ti;if(s&&e){var o=Ya(s).hoistableScripts,u=Ai(e),h=o.get(u);h||(h=s.querySelector(cr(u)),h||(e=k({src:e,async:!0,type:"module"},t),(t=qn.get(u))&&wf(e,t),h=s.createElement("script"),Tt(h),Bt(h,"link",e),s.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(u,h))}}function b2(e,t,s,o){var u=(u=tn.current)?or(u):null;if(!u)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(s=Ri(s.href),t=Ya(u).hoistableStyles,o=t.get(s),o||(o={type:"style",instance:null,count:0,state:null},t.set(s,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ri(s.href);var h=Ya(u).hoistableStyles,x=h.get(e);if(x||(u=u.ownerDocument||u,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,x),(h=u.querySelector(rr(e)))?h._p||(x.instance=h,x.state.loading=5):(h=qn.get(e),h||(h={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},qn.set(e,h)),Rj(u,e,h,x.state))),t&&o===null)throw Error(i(528,""));return x}if(t&&o!==null)throw Error(i(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(s=Ai(s),t=Ya(u).hoistableScripts,o=t.get(s),o||(o={type:"script",instance:null,count:0,state:null},t.set(s,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ri(e){return'href="'+Ln(e)+'"'}function rr(e){return'link[rel="stylesheet"]['+e+"]"}function j2(e){return k({},e,{"data-precedence":e.precedence,precedence:null})}function Rj(e,t,s,o){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[ta]!==!0){o.loading=1;return}}else t=e.createElement("link"),t[ta]=!0,t.onload=t.onerror=zg.bind(null,t),Bt(t,"link",s),Tt(t),e.head.appendChild(t);o.preload=t,t.addEventListener("load",function(){return o.loading|=1}),t.addEventListener("error",function(){return o.loading|=2})}function Ai(e){return'[src="'+Ln(e)+'"]'}function cr(e){return"script[async]"+e}function w2(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var o=e.querySelector('style[data-href~="'+Ln(s.href)+'"]');if(o)return t.instance=o,Tt(o),o;var u=k({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Tt(o),Bt(o,"style",u),uu(o,s.precedence,e),t.instance=o;case"stylesheet":u=Ri(s.href);var h=e.querySelector(rr(u));if(h)return t.state.loading|=4,t.instance=h,Tt(h),h;o=j2(s),(u=qn.get(u))&&jf(o,u),h=(e.ownerDocument||e).createElement("link"),Tt(h);var x=h;return x._p=new Promise(function(w,z){x.onload=w,x.onerror=z}),Bt(h,"link",o),t.state.loading|=4,uu(h,s.precedence,e),t.instance=h;case"script":return h=Ai(s.src),(u=e.querySelector(cr(h)))?(t.instance=u,Tt(u),u):(o=s,(u=qn.get(h))&&(o=k({},s),wf(o,u)),e=e.ownerDocument||e,u=e.createElement("script"),Tt(u),Bt(u,"link",o),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(o=t.instance,t.state.loading|=4,uu(o,s.precedence,e));return t.instance}function uu(e,t,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=o.length?o[o.length-1]:null,h=u,x=0;x<o.length;x++){var w=o[x];if(w.dataset.precedence===t)h=w;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function jf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function wf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var du=null;function N2(e,t,s){if(du===null){var o=new Map,u=du=new Map;u.set(s,o)}else u=du,o=u.get(s),o||(o=new Map,u.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var h=s[u];if(!(h[ol]||h[Oe]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var x=h.getAttribute(t)||"";x=e+x;var w=o.get(x);w?w.push(h):o.set(x,[h])}}return o}function Nf(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function Aj(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function C2(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function M2(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function E2(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function _2(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=E2(t),e.suspenseyImages.push(t)),e=Dj.bind(e),t.decode().then(e,e))}function Oj(e,t,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Ri(o.href),h=t.querySelector(rr(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ur.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=h,Tt(h);return}h=t.ownerDocument||t,o=j2(o),(u=qn.get(u))&&jf(o,u),h=h.createElement("link"),Tt(h);var x=h;x._p=new Promise(function(w,z){x.onload=w,x.onerror=z}),Bt(h,"link",o),s.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=ur.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var hu=0;function zj(e,t){return e.stylesheets&&e.count===0&&mu(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&mu(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&hu===0&&(hu=62500*Zb());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mu(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>hu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(u)}}:null}function T2(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)mu(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ur(){this.count--,T2(this)}function Dj(){this.imgCount--,T2(this)}var fu=null;function mu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fu=new Map,t.forEach(kj,e),fu=null,ur.call(e))}function kj(e,t){if(!(t.state.loading&4)){var s=fu.get(e);if(s)var o=s.get(null);else{s=new Map,fu.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var x=u[h];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),o=x)}o&&s.set(null,o)}u=t.instance,x=u.getAttribute("data-precedence"),h=s.get(x)||o,h===o&&s.set(null,u),s.set(x,u),this.count++,o=ur.bind(this),u.addEventListener("load",o),u.addEventListener("error",o),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Oi={$$typeof:le,Provider:null,Consumer:null,_currentValue:gt,_currentValue2:gt,_threadCount:0};function Lj(e,t,s,o,u,h,x,w,z){this.tag=1,this.containerInfo=e,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=Ia(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ia(0),this.hiddenUpdates=Ia(null),this.identifierPrefix=o,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.transitionTypes=null,this.incompleteTransitions=new Map}function R2(e,t,s,o,u,h,x,w,z,G,X,te){return e=new Lj(e,t,s,x,z,G,X,te,w),t=1,h===!0&&(t|=24),h=gn(3,null,null,t),e.current=h,h.stateNode=e,t=Hd(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:o,isDehydrated:s,cache:t},Vd(h),e}function A2(e){return e?(e=li,e):li}function O2(e,t,s,o,u,h){u=A2(u),o.context===null?o.context=u:o.pendingContext=u,o=vl(t),o.payload={element:s},h=h===void 0?null:h,h!==null&&(o.callback=h),s=xl(e,o,t),s!==null&&(yn(s,e,t),Bo(s,e,t))}function z2(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Cf(e,t){z2(e,t),(e=e.alternate)&&z2(e,t)}function D2(e){if(e.tag===13||e.tag===31){var t=ia(e,67108864);t!==null&&yn(t,e,67108864),Cf(e,67108864)}}function k2(e){if(e.tag===13||e.tag===31){var t=Rn();t=Pa(t);var s=ia(e,t);s!==null&&yn(s,e,t),Cf(e,t)}}var zi=!0;function $j(e,t,s,o){var u=me.T;me.T=null;var h=Se.p;try{Se.p=2,Mf(e,t,s,o)}finally{Se.p=h,me.T=u}}function Hj(e,t,s,o){var u=me.T;me.T=null;var h=Se.p;try{Se.p=8,Mf(e,t,s,o)}finally{Se.p=h,me.T=u}}function Mf(e,t,s,o){if(zi){var u=Ef(o);if(u===null)of(e,t,o,gu,s),$2(e,o);else if(Fj(u,e,t,s,o))o.stopPropagation();else if($2(e,o),t&4&&-1<Uj.indexOf(e)){for(;u!==null;){var h=zs(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var x=cs(h.pendingLanes);if(x!==0){var w=h;for(w.pendingLanes|=2,w.entangledLanes|=2;x;){var z=1<<31-Lt(x);w.entanglements[1]|=z,x&=~z}bs(h),(Xe&6)===0&&(eu=Fe()+500,sr(0))}}break;case 31:case 13:w=ia(h,2),w!==null&&yn(w,h,2),su(),Cf(h,2)}if(h=Ef(o),h===null&&of(e,t,o,gu,s),h===u)break;u=h}u!==null&&o.stopPropagation()}else of(e,t,o,null,s)}}function Ef(e){return e=dd(e),_f(e)}var gu=null;function _f(e){if(gu=null,e=Os(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=f(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return gu=e,null}function L2(e){switch(e){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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fn()){case mn:return 2;case Kl:return 8;case ll:case As:return 32;case vo:return 268435456;default:return 32}default:return 32}}var Tf=!1,Rl=null,Al=null,Ol=null,dr=new Map,hr=new Map,zl=[],Uj="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 $2(e,t){switch(e){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":Al=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":dr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hr.delete(t.pointerId)}}function fr(e,t,s,o,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:h,targetContainers:[u]},t!==null&&(t=zs(t),t!==null&&D2(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function Fj(e,t,s,o,u){switch(t){case"focusin":return Rl=fr(Rl,e,t,s,o,u),!0;case"dragenter":return Al=fr(Al,e,t,s,o,u),!0;case"mouseover":return Ol=fr(Ol,e,t,s,o,u),!0;case"pointerover":var h=u.pointerId;return dr.set(h,fr(dr.get(h)||null,e,t,s,o,u)),!0;case"gotpointercapture":return h=u.pointerId,hr.set(h,fr(hr.get(h)||null,e,t,s,o,u)),!0}return!1}function H2(e){var t=Os(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=f(s),t!==null){e.blockedOn=t,No(e.priority,function(){k2(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,No(e.priority,function(){k2(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function pu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Ef(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);ud=o,s.target.dispatchEvent(o),ud=null}else return t=zs(s),t!==null&&D2(t),e.blockedOn=s,!1;t.shift()}return!0}function U2(e,t,s){pu(e)&&s.delete(t)}function Bj(){Tf=!1,Rl!==null&&pu(Rl)&&(Rl=null),Al!==null&&pu(Al)&&(Al=null),Ol!==null&&pu(Ol)&&(Ol=null),dr.forEach(U2),hr.forEach(U2)}function vu(e,t){e.blockedOn===t&&(e.blockedOn=null,Tf||(Tf=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Bj)))}var xu=null;function F2(e){xu!==e&&(xu=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){xu===e&&(xu=null);for(var t=0;t<e.length;t+=3){var s=e[t],o=e[t+1],u=e[t+2];if(typeof o!="function"){if(_f(o||s)===null)continue;break}var h=zs(s);h!==null&&(e.splice(t,3),t-=3,ch(h,{pending:!0,data:u,method:s.method,action:o},o,u))}}))}function Di(e){function t(z){return vu(z,e)}Rl!==null&&vu(Rl,e),Al!==null&&vu(Al,e),Ol!==null&&vu(Ol,e),dr.forEach(t),hr.forEach(t);for(var s=0;s<zl.length;s++){var o=zl[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<zl.length&&(s=zl[0],s.blockedOn===null);)H2(s),s.blockedOn===null&&zl.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var u=s[o],h=s[o+1],x=u[st]||null;if(typeof h=="function")x||F2(s);else if(x){var w=null;if(h&&h.hasAttribute("formAction")){if(u=h,x=h[st]||null)w=x.formAction;else if(_f(u)!==null)continue}else w=x.action;typeof w=="function"?s[o+1]=w:(s.splice(o,3),o-=3),F2(s)}}}function B2(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(x){return u=x})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Rf(e){this._internalRoot=e}yu.prototype.render=Rf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var s=t.current,o=Rn();O2(s,o,e,t,null,null)},yu.prototype.unmount=Rf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;O2(e.current,2,null,e,null,null),su(),t[us]=null}};function yu(e){this._internalRoot=e}yu.prototype.unstable_scheduleHydration=function(e){if(e){var t=wo();e={blockedOn:null,target:e,priority:t};for(var s=0;s<zl.length&&t!==0&&t<zl[s].priority;s++);zl.splice(s,0,e),s===0&&H2(e)}};var V2=l.version;if(V2!=="19.3.1")throw Error(i(527,V2,"19.3.1"));Se.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=y(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Vj={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:me,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Su=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Su.isDisabled&&Su.supportsFiber)try{os=Su.inject(Vj),Xt=Su}catch{}}return gr.createRoot=function(e,t){if(!c(e))throw Error(i(299));var s=!1,o="",u=Ap,h=Op,x=zp;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=R2(e,1,!1,null,null,s,o,null,u,h,x,B2),e[us]=t.current,af(e),new Rf(t)},gr.hydrateRoot=function(e,t,s){if(!c(e))throw Error(i(299));var o=!1,u="",h=Ap,x=Op,w=zp,z=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError),s.formState!==void 0&&(z=s.formState)),t=R2(e,1,!0,t,s??null,o,u,z,h,x,w,B2),t.context=A2(null),s=t.current,o=Rn(),o=Pa(o),u=vl(o),u.callback=null,xl(s,u,o),s=o,t.current.lanes=s,il(t,s),bs(t),e[us]=t.current,af(e),new yu(t)},gr.version="19.3.1",gr}var W2;function tw(){if(W2)return Df.exports;W2=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Df.exports=ew(),Df.exports}var nw=tw();const _x=C.createContext(void 0),Tx=n=>{const l=C.useContext(_x);if(!l)throw new Error("No QueryClient set, use QueryClientProvider to set one");return l},sw=({client:n,children:l})=>(C.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),r.jsx(_x.Provider,{value:n,children:l})),lw={setTimeout:(n,l)=>setTimeout(n,l),clearTimeout:n=>clearTimeout(n),setInterval:(n,l)=>setInterval(n,l),clearInterval:n=>clearInterval(n)};var Ul,fg,vx,aw=(vx=class{constructor(){Ce(this,Ul,lw);Ce(this,fg,!1)}setTimeoutProvider(n){ge(this,Ul,n)}setTimeout(n,l){return F(this,Ul).setTimeout(n,l)}clearTimeout(n){F(this,Ul).clearTimeout(n)}setInterval(n,l){return F(this,Ul).setInterval(n,l)}clearInterval(n){F(this,Ul).clearInterval(n)}},Ul=new WeakMap,fg=new WeakMap,vx);const Ta=new aw;function iw(n){setTimeout(n,0)}const ow=typeof window>"u"||"Deno"in globalThis;function bn(){}function rw(n,l){return typeof n=="function"?n(l):n}function Rx(n){return typeof n=="number"&&n>=0&&n!==1/0}function Ax(n,l){return Math.max(n+(l||0)-Date.now(),0)}function ut(n,l){return typeof n=="function"?n(l):n}function ev(n,l){const{type:a="all",exact:i,fetchStatus:c,predicate:d,queryKey:f,stale:m}=n;if(f){if(i){if(l.queryHash!==gg(f,l.options))return!1}else if(!mo(l.queryKey,f))return!1}if(a!=="all"){const g=l.isActive();if(a==="active"&&!g||a==="inactive"&&g)return!1}return!(typeof m=="boolean"&&l.isStale()!==m||c&&c!==l.state.fetchStatus||d&&!d(l))}function tv(n,l){const{exact:a,status:i,predicate:c,mutationKey:d}=n;if(d){if(!l.options.mutationKey)return!1;if(a){if(zr(l.options.mutationKey)!==zr(d))return!1}else if(!mo(l.options.mutationKey,d))return!1}return!(i&&l.state.status!==i||c&&!c(l))}function gg(n,l){return((l==null?void 0:l.queryKeyHashFn)||zr)(n)}function zr(n){return JSON.stringify(n,(l,a)=>_m(a)?Object.keys(a).sort().reduce((i,c)=>(i[c]=a[c],i),{}):a)}function mo(n,l){if(n===l)return!0;if(typeof n!=typeof l)return!1;if(n&&l&&typeof n=="object"&&typeof l=="object"){if(Array.isArray(n)&&Array.isArray(l)){if(l.length>n.length)return!1;for(let i=0;i<l.length;i++)if(!mo(n[i],l[i]))return!1;return!0}const a=Object.keys(l);for(const i of a)if(!mo(n[i],l[i]))return!1;return!0}return!1}const cw=Object.prototype.hasOwnProperty;function Ox(n,l,a=0){if(n===l)return n;if(a>500)return l;const i=nv(n)&&nv(l);if(!i&&!(_m(n)&&_m(l)))return l;const c=(i?n:Object.keys(n)).length,d=i?l:Object.keys(l),f=d.length,m=i?new Array(f):{};let g=0;for(let y=0;y<f;y++){const v=i?y:d[y],p=n[v],S=l[v];if(p===S){m[v]=p,(i?y<c:cw.call(n,v))&&g++;continue}if(p===null||S===null||typeof p!="object"||typeof S!="object"){m[v]=S;continue}const j=Ox(p,S,a+1);m[v]=j,j===p&&g++}return c===f&&g===c?n:m}function Hf(n,l){if(!l||Object.keys(n).length!==Object.keys(l).length)return!1;for(const a in n)if(n[a]!==l[a])return!1;return!0}function nv(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function _m(n){if(!sv(n))return!1;const l=Object.getPrototypeOf(n),a=l==null?void 0:l.constructor;if(a===void 0)return!0;if(typeof a!="function")return!1;const i=a.prototype;return!(!sv(i)||!i.hasOwnProperty("isPrototypeOf")||l!==Object.prototype)}function sv(n){return Object.prototype.toString.call(n)==="[object Object]"}function uw(n){return new Promise(l=>{Ta.setTimeout(l,n)})}function Tm(n,l,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,l):a.structuralSharing!==!1?Ox(n,l):l}function pg(n){return n}function dw(n,l,a=0){const i=[...n,l];return a&&i.length>a?i.slice(1):i}function hw(n,l,a=0){const i=[l,...n];return a&&i.length>a?i.slice(0,-1):i}const vg=Symbol();function zx(n,l){return!n.queryFn&&(l!=null&&l.initialPromise)?()=>l.initialPromise:!n.queryFn||n.queryFn===vg?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Dx(n,l){return typeof n=="function"?n(...l):!!n}function fw(n,l,a){let i=!1,c;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(c??(c=l()),i||(i=!0,c.aborted?a():c.addEventListener("abort",a,{once:!0})),c)}),n}let mw=()=>ow;const xg=()=>mw();var Ir=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Aa,Fl,eo,xx,gw=(xx=class extends Ir{constructor(){super();Ce(this,Aa);Ce(this,Fl);Ce(this,eo);ge(this,eo,l=>{if(typeof window<"u"&&window.addEventListener){const a=()=>l();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){F(this,Fl)||this.setEventListener(F(this,eo))}onUnsubscribe(){var l;this.hasListeners()||((l=F(this,Fl))==null||l.call(this),ge(this,Fl,void 0))}setEventListener(l){var a;ge(this,eo,l),(a=F(this,Fl))==null||a.call(this),ge(this,Fl,l(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(l){F(this,Aa)!==l&&(ge(this,Aa,l),this.onFocus())}onFocus(){const l=this.isFocused();this.listeners.forEach(a=>{a(l)})}isFocused(){var l;return typeof F(this,Aa)=="boolean"?F(this,Aa):((l=globalThis.document)==null?void 0:l.visibilityState)!=="hidden"}},Aa=new WeakMap,Fl=new WeakMap,eo=new WeakMap,xx);const yg=new gw,pw=iw;function vw(){let n=[],l=0,a=m=>{m()},i=m=>{m()},c=pw;const d=m=>{l?n.push(m):c(()=>{a(m)})},f=()=>{const m=n;n=[],m.length&&c(()=>{i(()=>{m.forEach(g=>{a(g)})})})};return{batch:m=>{let g;l++;try{g=m()}finally{l--,l||f()}return g},batchCalls:m=>(...g)=>{d(()=>{m(...g)})},schedule:d,setNotifyFunction:m=>{a=m},setBatchNotifyFunction:m=>{i=m},setScheduler:m=>{c=m}}}const qt=vw();var to,Bl,no,yx,xw=(yx=class extends Ir{constructor(){super();Ce(this,to,!0);Ce(this,Bl);Ce(this,no);ge(this,no,l=>{if(typeof window<"u"&&window.addEventListener){const a=()=>l(!0),i=()=>l(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",i)}}})}onSubscribe(){F(this,Bl)||this.setEventListener(F(this,no))}onUnsubscribe(){var l;this.hasListeners()||((l=F(this,Bl))==null||l.call(this),ge(this,Bl,void 0))}setEventListener(l){var a;ge(this,no,l),(a=F(this,Bl))==null||a.call(this),ge(this,Bl,l(this.setOnline.bind(this)))}setOnline(l){F(this,to)!==l&&(ge(this,to,l),this.listeners.forEach(a=>{a(l)}))}isOnline(){return F(this,to)}},to=new WeakMap,Bl=new WeakMap,no=new WeakMap,yx);const Du=new xw;function yw(n){return Math.min(1e3*2**n,3e4)}function kx(n){return(n??"online")==="online"?Du.isOnline():!0}var Rm=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function Lx(n){let l=!1,a=0,i,c="pending",d,f;const m=new Promise((T,L)=>{d=T,f=L});m.catch(bn);const g=()=>c!=="pending",y=T=>{var L;if(!g()){const M=new Rm(T);N(M),(L=n.onCancel)==null||L.call(n,M)}},v=()=>{l=!0},p=()=>{l=!1},S=()=>yg.isFocused()&&(n.networkMode==="always"||Du.isOnline())&&n.canRun(),j=()=>kx(n.networkMode)&&n.canRun(),b=T=>{g()||(i==null||i(),c="resolved",d(T))},N=T=>{g()||(i==null||i(),c="rejected",f(T))},E=T=>new Promise(L=>{var M;i=_=>{(g()||T())&&L(_)},(M=n.onPause)==null||M.call(n)}).then(()=>{var L;i=void 0,g()||(L=n.onContinue)==null||L.call(n)}),A=()=>{if(g())return;let T;const L=a===0?n.initialPromise:void 0;try{T=L??n.fn()}catch(M){T=Promise.reject(M)}Promise.resolve(T).then(b).catch(M=>{var K;if(g())return;const _=n.retry??(xg()?0:3),R=n.retryDelay??yw,k=typeof R=="function"?R(a,M):R,I=_===!0||typeof _=="number"&&a<_||typeof _=="function"&&_(a,M);if(l||!I){N(M);return}a++,(K=n.onFail)==null||K.call(n,a,M),uw(k).then(()=>S()?void 0:E(S)).then(()=>{l?N(M):A()})})};return{promise:m,status:()=>c,cancel:y,continue:()=>(i==null||i(),m),cancelRetry:v,continueRetry:p,canStart:j,start:()=>(j()?A():E(j).then(A),m)}}var Oa,Sx,$x=(Sx=class{constructor(){Ce(this,Oa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Rx(this.gcTime)&&ge(this,Oa,Ta.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(xg()?1/0:3e5))}clearGcTimeout(){F(this,Oa)!==void 0&&(Ta.clearTimeout(F(this,Oa)),ge(this,Oa,void 0))}},Oa=new WeakMap,Sx);function Sw(n){return{onFetch:(l,a)=>{var v,p,S,j,b;const i=l.options,c=(S=(p=(v=l.fetchOptions)==null?void 0:v.meta)==null?void 0:p.fetchMore)==null?void 0:S.direction,d=((j=l.state.data)==null?void 0:j.pages)||[],f=((b=l.state.data)==null?void 0:b.pageParams)||[];let m={pages:[],pageParams:[]},g=0;const y=async()=>{let N=!1;const E=L=>{fw(L,()=>l.signal,()=>N=!0)},A=zx(l.options,l.fetchOptions),T=async(L,M,_)=>{if(N)return Promise.reject(l.signal.reason);if(M==null&&L.pages.length)return Promise.resolve(L);const k=(()=>{const se={client:l.client,queryKey:l.queryKey,pageParam:M,direction:_?"backward":"forward",meta:l.options.meta};return E(se),se})(),I=await A(k),{maxPages:K}=l.options,O=_?hw:dw;return{pages:O(L.pages,I,K),pageParams:O(L.pageParams,M,K)}};if(c&&d.length){const L=c==="backward",M=L?Hx:Am,_={pages:d,pageParams:f};m=await T(_,M(i,_),L)}else{const L=n??d.length;do{const M=g===0?f[0]===void 0?i.initialPageParam:f[0]:Am(i,m);if(g>0&&M==null)break;m=await T(m,M),g++}while(g<L)}return m};l.options.persister?l.fetchFn=()=>{var N,E;return(E=(N=l.options).persister)==null?void 0:E.call(N,y,{client:l.client,queryKey:l.queryKey,meta:l.options.meta,signal:l.signal},a)}:l.fetchFn=y}}}function Am(n,{pages:l,pageParams:a}){const i=l.length-1;return l.length>0?n.getNextPageParam(l[i],l,a[i],a):void 0}function Hx(n,{pages:l,pageParams:a}){var i;return l.length>0?(i=n.getPreviousPageParam)==null?void 0:i.call(n,l[0],l,a[0],a):void 0}function bw(n,l){return l?Am(n,l)!=null:!1}function jw(n,l){return!l||!n.getPreviousPageParam?!1:Hx(n,l)!=null}var so,za,lo,In,Da,Ct,Fr,ka,es,Zs,bx,ww=(bx=class extends $x{constructor(l){super();Ce(this,es);Ce(this,so);Ce(this,za);Ce(this,lo);Ce(this,In);Ce(this,Da);Ce(this,Ct);Ce(this,Fr);Ce(this,ka);ge(this,ka,!1),ge(this,Fr,l.defaultOptions),this.setOptions(l.options),this.observers=[],ge(this,Da,l.client),ge(this,In,F(this,Da).getQueryCache()),this.queryKey=l.queryKey,this.queryHash=l.queryHash,ge(this,za,av(this.options)),this.state=l.state??F(this,za),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return F(this,so)}get promise(){var l;return(l=F(this,Ct))==null?void 0:l.promise}setOptions(l){if(this.options={...F(this,Fr),...l},l!=null&&l._type&&ge(this,so,l._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=av(this.options);a.data!==void 0&&(this.setState(lv(a.data,a.dataUpdatedAt)),ge(this,za,a))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,In).remove(this)}setData(l,a){const i=Tm(this.state.data,l,this.options);return Ue(this,es,Zs).call(this,{data:i,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),i}setState(l){Ue(this,es,Zs).call(this,{type:"setState",state:l})}cancel(l){var i,c;const a=(i=F(this,Ct))==null?void 0:i.promise;return(c=F(this,Ct))==null||c.cancel(l),a?a.then(bn).catch(bn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return F(this,za)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(l=>ut(l.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(l=>ut(l.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(l=>l.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(l=0){return this.state.data===void 0?!0:l==="static"?!1:this.state.isInvalidated?!0:!Ax(this.state.dataUpdatedAt,l)}onFocus(){var l,a;(l=this.observers.find(i=>i.shouldFetchOnWindowFocus()))==null||l.refetch({cancelRefetch:!1}),(a=F(this,Ct))==null||a.continue()}onOnline(){var l,a;(l=this.observers.find(i=>i.shouldFetchOnReconnect()))==null||l.refetch({cancelRefetch:!1}),(a=F(this,Ct))==null||a.continue()}addObserver(l){this.observers.includes(l)||(this.observers.push(l),this.clearGcTimeout(),F(this,In).notify({type:"observerAdded",query:this,observer:l}))}removeObserver(l){const a=this.observers.indexOf(l);a!==-1&&(this.observers.splice(a,1),this.observers.length||(F(this,Ct)&&(F(this,ka)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?F(this,Ct).cancel({revert:!0}):F(this,Ct).cancelRetry()),this.scheduleGc()),F(this,In).notify({type:"observerRemoved",query:this,observer:l}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ue(this,es,Zs).call(this,{type:"invalidate"})}async fetch(l,a){var y,v,p,S,j,b,N,E,A,T,L,M;if(this.state.fetchStatus!=="idle"&&((y=F(this,Ct))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(F(this,Ct))return F(this,Ct).continueRetry(),F(this,Ct).promise}if(l&&this.setOptions(l),!this.options.queryFn){const _=this.observers.find(R=>R.options.queryFn);_&&this.setOptions(_.options)}const i=new AbortController,c=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(ge(this,ka,!0),i.signal)})},d=()=>{const _=zx(this.options,a),k=(()=>{const I={client:F(this,Da),queryKey:this.queryKey,meta:this.meta};return c(I),I})();return ge(this,ka,!1),this.options.persister?this.options.persister(_,k,this):_(k)},m=(()=>{const _={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:F(this,Da),state:this.state,fetchFn:d};return c(_),_})();(v=F(this,so)==="infinite"?Sw(this.options.pages):this.options.behavior)==null||v.onFetch(m,this),ge(this,lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=m.fetchOptions)==null?void 0:p.meta))&&Ue(this,es,Zs).call(this,{type:"fetch",meta:(S=m.fetchOptions)==null?void 0:S.meta});const g=ge(this,Ct,Lx({initialPromise:a==null?void 0:a.initialPromise,fn:m.fetchFn,onCancel:_=>{_ instanceof Rm&&_.revert&&this.setState({...F(this,lo),fetchStatus:"idle"}),i.abort()},onFail:(_,R)=>{Ue(this,es,Zs).call(this,{type:"failed",failureCount:_,error:R})},onPause:()=>{Ue(this,es,Zs).call(this,{type:"pause"})},onContinue:()=>{Ue(this,es,Zs).call(this,{type:"continue"})},retry:m.options.retry,retryDelay:m.options.retryDelay,networkMode:m.options.networkMode,canRun:()=>!0}));try{const _=await g.start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(b=(j=F(this,In).config).onSuccess)==null||b.call(j,_,this),(E=(N=F(this,In).config).onSettled)==null||E.call(N,_,this.state.error,this),_}catch(_){if(_ instanceof Rm){if(_.silent)return F(this,Ct).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw Ue(this,es,Zs).call(this,{type:"error",error:_}),(T=(A=F(this,In).config).onError)==null||T.call(A,_,this),(M=(L=F(this,In).config).onSettled)==null||M.call(L,this.state.data,_,this),_}finally{F(this,Ct)===g&&ge(this,Ct,void 0),this.scheduleGc()}}},so=new WeakMap,za=new WeakMap,lo=new WeakMap,In=new WeakMap,Da=new WeakMap,Ct=new WeakMap,Fr=new WeakMap,ka=new WeakMap,es=new WeakSet,Zs=function(l){const a=i=>{switch(l.type){case"failed":return{...i,fetchFailureCount:l.failureCount,fetchFailureReason:l.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Ux(i.data,this.options),fetchMeta:l.meta??null};case"success":const c={...i,...lv(l.data,l.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!l.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ge(this,lo,l.manual?c:void 0),c;case"error":const d=l.error;return{...i,error:d,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:d,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...l.state}}};this.state=a(this.state),qt.batch(()=>{this.observers.slice().forEach(i=>{i.onQueryUpdate()}),F(this,In).notify({query:this,type:"updated",action:l})})},bx);function Ux(n,l){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kx(l.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function lv(n,l){return{data:n,dataUpdatedAt:l??Date.now(),error:null,isInvalidated:!1,status:"success"}}function av(n){const l=typeof n.initialData=="function"?n.initialData():n.initialData,a=l!==void 0,i=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:l,dataUpdateCount:0,dataUpdatedAt:a?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var cn,Be,Br,un,La,ao,el,Vr,io,oo,$a,Ha,Vl,ro,Ke,_r,Om,zm,Dm,km,Lm,$m,Hm,Um,jx,Fx=(jx=class extends Ir{constructor(l,a){super();Ce(this,Ke);Ce(this,cn);Ce(this,Be);Ce(this,Br);Ce(this,un);Ce(this,La);Ce(this,ao);Ce(this,el);Ce(this,Vr);Ce(this,io);Ce(this,oo);Ce(this,$a);Ce(this,Ha);Ce(this,Vl);Ce(this,ro,new Set);this.options=a,ge(this,cn,l),ge(this,el,null),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(F(this,Be).addObserver(this),iv(F(this,Be),this.options)?Ue(this,Ke,_r).call(this):this.updateResult(),Ue(this,Ke,Lm).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fm(F(this,Be),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fm(F(this,Be),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ue(this,Ke,$m).call(this),Ue(this,Ke,Hm).call(this),F(this,Be).removeObserver(this)}setOptions(l){const a=this.options,i=F(this,Be);if(this.options=F(this,cn).defaultQueryOptions(l),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ut(this.options.enabled,F(this,Be))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ue(this,Ke,Um).call(this),F(this,Be).setOptions(this.options),a._defaulted&&!Hf(this.options,a)&&F(this,cn).getQueryCache().notify({type:"observerOptionsUpdated",query:F(this,Be),observer:this});const c=this.hasListeners();c&&ov(F(this,Be),i,this.options,a)&&Ue(this,Ke,_r).call(this),this.updateResult(),c&&(F(this,Be)!==i||ut(this.options.enabled,F(this,Be))!==ut(a.enabled,F(this,Be))||ut(this.options.staleTime,F(this,Be))!==ut(a.staleTime,F(this,Be)))&&Ue(this,Ke,zm).call(this);const d=Ue(this,Ke,Dm).call(this);c&&(F(this,Be)!==i||ut(this.options.enabled,F(this,Be))!==ut(a.enabled,F(this,Be))||d!==F(this,Vl))&&Ue(this,Ke,km).call(this,d)}getOptimisticResult(l){const a=F(this,cn).getQueryCache().build(F(this,cn),l),i=this.createResult(a,l);return Hf(this.getCurrentResult(),i)||(ge(this,un,i),ge(this,ao,this.options),ge(this,La,F(this,Be).state)),i}getCurrentResult(){return F(this,un)}trackResult(l,a){return new Proxy(l,{get:(i,c)=>(this.trackProp(c),a==null||a(c),Reflect.get(i,c))})}trackProp(l){F(this,ro).add(l)}getCurrentQuery(){return F(this,Be)}refetch({...l}={}){return this.fetch({...l})}fetchOptimistic(l){const a=F(this,cn).defaultQueryOptions(l),i=F(this,cn).getQueryCache().build(F(this,cn),a);let c=()=>{},d;const f=new Promise(m=>{d=m,c=F(this,cn).getQueryCache().subscribe(g=>{g.type==="updated"&&g.query.queryHash===i.queryHash&&i.state.data!==void 0&&(c(),m(this.createResult(i,a)))})});return Promise.race([i.fetch(a).then(()=>{const m=this.createResult(i,a);return d==null||d(m),m}).finally(()=>{c()}),f])}fetch(l){return Ue(this,Ke,_r).call(this,{...l,cancelRefetch:l.cancelRefetch??!0}).then(()=>(this.updateResult(),F(this,un)))}createResult(l,a){var R;const i=F(this,Be),c=this.options,d=F(this,un),f=F(this,La),m=F(this,ao),g=l!==i?l.state:F(this,Br),{state:y}=l;let v={...y},p=!1,S;if(a._optimisticResults){const k=this.hasListeners(),I=!k&&iv(l,a),K=k&&ov(l,i,a,c);(I||K)&&(v={...v,...Ux(y.data,l.options)}),a._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:j,errorUpdatedAt:b,status:N}=v;S=v.data;let E=!1;if(a.placeholderData!==void 0&&S===void 0&&N==="pending"){let k;d!=null&&d.isPlaceholderData&&a.placeholderData===(m==null?void 0:m.placeholderData)?(k=d.data,E=!0):k=typeof a.placeholderData=="function"?a.placeholderData((R=F(this,oo))==null?void 0:R.state.data,F(this,oo)):a.placeholderData,k!==void 0&&(N="success",S=Tm(d==null?void 0:d.data,k,a),p=!0)}if(a.select&&S!==void 0&&!E)if(d&&S===(f==null?void 0:f.data)&&a.select===F(this,Vr))S=F(this,io);else try{ge(this,Vr,a.select),S=a.select(S),S=Tm(d==null?void 0:d.data,S,a),ge(this,io,S),ge(this,el,null)}catch(k){ge(this,el,k)}else S===void 0&&ge(this,el,null);F(this,el)&&(j=F(this,el),S=F(this,io),b=Date.now(),N="error",p=!1);const A=v.fetchStatus==="fetching",T=N==="pending",L=N==="error",M=T&&A,_=S!==void 0;return{status:N,fetchStatus:v.fetchStatus,isPending:T,isSuccess:N==="success",isError:L,isInitialLoading:M,isLoading:M,data:S,dataUpdatedAt:v.dataUpdatedAt,error:j,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:l.isFetched(),isFetchedAfterMount:v.dataUpdateCount>g.dataUpdateCount||v.errorUpdateCount>g.errorUpdateCount,isFetching:A,isRefetching:A&&!T,isLoadingError:L&&!_,isPaused:v.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:L&&_,isStale:Sg(l,a),refetch:this.refetch,isEnabled:ut(a.enabled,l)!==!1}}updateResult(){const l=F(this,un),a=this.createResult(F(this,Be),this.options);if(ge(this,La,F(this,Be).state),ge(this,ao,this.options),F(this,La).data!==void 0&&ge(this,oo,F(this,Be)),Hf(a,l))return;ge(this,un,a);const c=(()=>{if(!l)return!0;const{notifyOnChangeProps:d}=this.options,f=typeof d=="function"?d():d;if(f==="all"||!f&&!F(this,ro).size)return!0;const m=new Set(f??F(this,ro));return this.options.throwOnError&&m.add("error"),Object.keys(F(this,un)).some(g=>{const y=g;return F(this,un)[y]!==l[y]&&m.has(y)})})();qt.batch(()=>{c&&this.listeners.forEach(d=>{d(F(this,un))}),F(this,cn).getQueryCache().notify({query:F(this,Be),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ue(this,Ke,Lm).call(this)}},cn=new WeakMap,Be=new WeakMap,Br=new WeakMap,un=new WeakMap,La=new WeakMap,ao=new WeakMap,el=new WeakMap,Vr=new WeakMap,io=new WeakMap,oo=new WeakMap,$a=new WeakMap,Ha=new WeakMap,Vl=new WeakMap,ro=new WeakMap,Ke=new WeakSet,_r=function(l){Ue(this,Ke,Um).call(this);let a=F(this,Be).fetch(this.options,l);return l!=null&&l.throwOnError||(a=a.catch(bn)),a},Om=function(l){return!xg()&&ut(this.options.enabled,F(this,Be))!==!1&&Rx(l)},zm=function(){Ue(this,Ke,$m).call(this);const l=ut(this.options.staleTime,F(this,Be));if(F(this,un).isStale||!Ue(this,Ke,Om).call(this,l))return;const a=Ax(F(this,un).dataUpdatedAt,l)+1;ge(this,$a,Ta.setTimeout(()=>{F(this,un).isStale||this.updateResult()},a))},Dm=function(){return ut(this.options.refetchInterval,F(this,Be))??!1},km=function(l){Ue(this,Ke,Hm).call(this),ge(this,Vl,l),!(F(this,Vl)===0||!Ue(this,Ke,Om).call(this,F(this,Vl)))&&ge(this,Ha,Ta.setInterval(()=>{(this.options.refetchIntervalInBackground||yg.isFocused())&&Ue(this,Ke,_r).call(this)},F(this,Vl)))},Lm=function(){Ue(this,Ke,zm).call(this),Ue(this,Ke,km).call(this,Ue(this,Ke,Dm).call(this))},$m=function(){F(this,$a)!==void 0&&(Ta.clearTimeout(F(this,$a)),ge(this,$a,void 0))},Hm=function(){F(this,Ha)!==void 0&&(Ta.clearInterval(F(this,Ha)),ge(this,Ha,void 0))},Um=function(){const l=F(this,cn).getQueryCache().build(F(this,cn),this.options);if(l===F(this,Be))return;const a=F(this,Be);ge(this,Be,l),ge(this,Br,l.state),this.hasListeners()&&(a==null||a.removeObserver(this),l.addObserver(this))},jx);function Nw(n,l){return ut(l.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&ut(l.retryOnMount,n)===!1)}function iv(n,l){return Nw(n,l)||n.state.data!==void 0&&Fm(n,l,l.refetchOnMount)}function Fm(n,l,a){if(ut(l.enabled,n)!==!1&&ut(l.staleTime,n)!=="static"){const i=ut(a,n);return i==="always"||i!==!1&&Sg(n,l)}return!1}function ov(n,l,a,i){return(n!==l||ut(i.enabled,n)===!1)&&(!a.suspense||n.state.status!=="error")&&Sg(n,a)}function Sg(n,l){return ut(l.enabled,n)!==!1&&n.isStaleByTime(ut(l.staleTime,n))}var Cw=class extends Fx{constructor(n,l){super(n,l)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(n){n._type="infinite",super.setOptions(n)}getOptimisticResult(n){return n._type="infinite",super.getOptimisticResult(n)}fetchNextPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"backward"}}})}createResult(n,l){var j,b;const{state:a}=n,i=super.createResult(n,l),{isFetching:c,isRefetching:d,isError:f,isRefetchError:m}=i,g=(b=(j=a.fetchMeta)==null?void 0:j.fetchMore)==null?void 0:b.direction,y=f&&g==="forward",v=c&&g==="forward",p=f&&g==="backward",S=c&&g==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:bw(l,a.data),hasPreviousPage:jw(l,a.data),isFetchNextPageError:y,isFetchingNextPage:v,isFetchPreviousPageError:p,isFetchingPreviousPage:S,isRefetchError:m&&!y&&!p,isRefetching:d&&!v&&!S}}},Gr,js,Wt,Ua,ws,Ll,wx,Mw=(wx=class extends $x{constructor(l){super();Ce(this,ws);Ce(this,Gr);Ce(this,js);Ce(this,Wt);Ce(this,Ua);ge(this,Gr,l.client),this.mutationId=l.mutationId,ge(this,Wt,l.mutationCache),ge(this,js,[]),this.state=l.state||Ew(),this.setOptions(l.options),this.scheduleGc()}setOptions(l){this.options=l,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(l){F(this,js).includes(l)||(F(this,js).push(l),this.clearGcTimeout(),F(this,Wt).notify({type:"observerAdded",mutation:this,observer:l}))}removeObserver(l){ge(this,js,F(this,js).filter(a=>a!==l)),this.scheduleGc(),F(this,Wt).notify({type:"observerRemoved",mutation:this,observer:l})}optionalRemove(){F(this,js).length||(this.state.status==="pending"?this.scheduleGc():F(this,Wt).remove(this))}continue(){var l;return((l=F(this,Ua))==null?void 0:l.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(l){var m,g,y,v,p,S,j,b,N,E,A,T,L,M,_,R,k,I;const a=()=>{Ue(this,ws,Ll).call(this,{type:"continue"})},i={client:F(this,Gr),meta:this.options.meta,mutationKey:this.options.mutationKey},c=ge(this,Ua,Lx({fn:()=>this.options.mutationFn?this.options.mutationFn(l,i):Promise.reject(new Error("No mutationFn found")),onFail:(K,O)=>{Ue(this,ws,Ll).call(this,{type:"failed",failureCount:K,error:O})},onPause:()=>{Ue(this,ws,Ll).call(this,{type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Wt).canRun(this)})),d=this.state.status==="pending",f=!c.canStart();try{if(d)a();else{Ue(this,ws,Ll).call(this,{type:"pending",variables:l,isPaused:f}),F(this,Wt).config.onMutate&&await F(this,Wt).config.onMutate(l,this,i);const O=await((g=(m=this.options).onMutate)==null?void 0:g.call(m,l,i));O!==this.state.context&&Ue(this,ws,Ll).call(this,{type:"pending",context:O,variables:l,isPaused:f})}const K=await c.start();return await((v=(y=F(this,Wt).config).onSuccess)==null?void 0:v.call(y,K,l,this.state.context,this,i)),await((S=(p=this.options).onSuccess)==null?void 0:S.call(p,K,l,this.state.context,i)),await((b=(j=F(this,Wt).config).onSettled)==null?void 0:b.call(j,K,null,this.state.variables,this.state.context,this,i)),await((E=(N=this.options).onSettled)==null?void 0:E.call(N,K,null,l,this.state.context,i)),Ue(this,ws,Ll).call(this,{type:"success",data:K}),K}catch(K){try{await((T=(A=F(this,Wt).config).onError)==null?void 0:T.call(A,K,l,this.state.context,this,i))}catch(O){Promise.reject(O)}try{await((M=(L=this.options).onError)==null?void 0:M.call(L,K,l,this.state.context,i))}catch(O){Promise.reject(O)}try{await((R=(_=F(this,Wt).config).onSettled)==null?void 0:R.call(_,void 0,K,this.state.variables,this.state.context,this,i))}catch(O){Promise.reject(O)}try{await((I=(k=this.options).onSettled)==null?void 0:I.call(k,void 0,K,l,this.state.context,i))}catch(O){Promise.reject(O)}throw Ue(this,ws,Ll).call(this,{type:"error",error:K}),K}finally{F(this,Ua)===c&&ge(this,Ua,void 0),F(this,Wt).runNext(this)}}},Gr=new WeakMap,js=new WeakMap,Wt=new WeakMap,Ua=new WeakMap,ws=new WeakSet,Ll=function(l){const a=i=>{switch(l.type){case"failed":return{...i,failureCount:l.failureCount,failureReason:l.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:l.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:l.isPaused,status:"pending",variables:l.variables,submittedAt:Date.now()};case"success":return{...i,data:l.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:l.error,failureCount:i.failureCount+1,failureReason:l.error,isPaused:!1,status:"error"}}};this.state=a(this.state),qt.batch(()=>{F(this,js).forEach(i=>{i.onMutationUpdate(l)}),F(this,Wt).notify({mutation:this,type:"updated",action:l})})},wx);function Ew(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gl,ts,qr,Nx,_w=(Nx=class extends Ir{constructor(l={}){super();Ce(this,Gl);Ce(this,ts);Ce(this,qr);this.config=l,ge(this,Gl,new Set),ge(this,ts,new Map),ge(this,qr,0)}build(l,a,i){const c=new Mw({client:l,mutationCache:this,mutationId:++bu(this,qr)._,options:l.defaultMutationOptions(a),state:i});return this.add(c),c}add(l){F(this,Gl).add(l);const a=ju(l);if(typeof a=="string"){const i=F(this,ts).get(a);i?i.push(l):F(this,ts).set(a,[l])}this.notify({type:"added",mutation:l})}remove(l){if(F(this,Gl).delete(l)){const a=ju(l);if(typeof a=="string"){const i=F(this,ts).get(a);if(i)if(i.length>1){const c=i.indexOf(l);c!==-1&&i.splice(c,1)}else i[0]===l&&F(this,ts).delete(a)}}this.notify({type:"removed",mutation:l})}canRun(l){var i;const a=ju(l);if(typeof a=="string"){const c=(i=F(this,ts).get(a))==null?void 0:i.find(d=>d.state.status==="pending");return!c||c===l}else return!0}runNext(l){var i,c;const a=ju(l);return typeof a=="string"?((c=(i=F(this,ts).get(a))==null?void 0:i.find(d=>d!==l&&d.state.isPaused))==null?void 0:c.continue())??Promise.resolve():Promise.resolve()}clear(){qt.batch(()=>{const l=this.getAll();F(this,Gl).clear(),F(this,ts).clear(),l.forEach(a=>{this.notify({type:"removed",mutation:a})})})}getAll(){return Array.from(F(this,Gl))}find(l){const a={exact:!0,...l};return this.getAll().find(i=>tv(a,i))}findAll(l={}){return this.getAll().filter(a=>tv(l,a))}notify(l){qt.batch(()=>{this.listeners.forEach(a=>{a(l)})})}resumePausedMutations(){const l=this.getAll().filter(a=>a.state.isPaused);return qt.batch(()=>Promise.all(l.map(a=>a.continue().catch(bn))))}},Gl=new WeakMap,ts=new WeakMap,qr=new WeakMap,Nx);function ju(n){var l;return(l=n.options.scope)==null?void 0:l.id}var Ns,Cx,Tw=(Cx=class extends Ir{constructor(l={}){super();Ce(this,Ns);this.config=l,ge(this,Ns,new Map)}build(l,a,i){const c=a.queryKey,d=a.queryHash??gg(c,a);let f=this.get(d);return f||(f=new ww({client:l,queryKey:c,queryHash:d,options:l.defaultQueryOptions(a),state:i,defaultOptions:l.getQueryDefaults(c)}),this.add(f)),f}add(l){F(this,Ns).has(l.queryHash)||(F(this,Ns).set(l.queryHash,l),this.notify({type:"added",query:l}))}remove(l){F(this,Ns).get(l.queryHash)===l&&(l.destroy(),F(this,Ns).delete(l.queryHash),this.notify({type:"removed",query:l}))}clear(){qt.batch(()=>{this.getAll().forEach(l=>{this.remove(l)})})}get(l){return F(this,Ns).get(l)}getAll(){return[...F(this,Ns).values()]}find(l){const a={exact:!0,...l};return this.getAll().find(i=>ev(a,i))}findAll(l={}){const a=this.getAll();return Object.keys(l).length>0?a.filter(i=>ev(l,i)):a}notify(l){qt.batch(()=>{this.listeners.forEach(a=>{a(l)})})}onFocus(){qt.batch(()=>{this.getAll().forEach(l=>{l.onFocus()})})}onOnline(){qt.batch(()=>{this.getAll().forEach(l=>{l.onOnline()})})}},Ns=new WeakMap,Cx),ht,ql,Il,co,uo,Pl,ho,fo,Mx,Rw=(Mx=class{constructor(n={}){Ce(this,ht);Ce(this,ql);Ce(this,Il);Ce(this,co);Ce(this,uo);Ce(this,Pl);Ce(this,ho);Ce(this,fo);ge(this,ht,n.queryCache||new Tw),ge(this,ql,n.mutationCache||new _w),ge(this,Il,n.defaultOptions||{}),ge(this,co,new Map),ge(this,uo,new Map),ge(this,Pl,0)}mount(){bu(this,Pl)._++,F(this,Pl)===1&&(ge(this,ho,yg.subscribe(async n=>{n&&(await this.resumePausedMutations(),F(this,ht).onFocus())})),ge(this,fo,Du.subscribe(async n=>{n&&(await this.resumePausedMutations(),F(this,ht).onOnline())})))}unmount(){var n,l;bu(this,Pl)._--,F(this,Pl)===0&&((n=F(this,ho))==null||n.call(this),ge(this,ho,void 0),(l=F(this,fo))==null||l.call(this),ge(this,fo,void 0))}isFetching(n){return F(this,ht).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return F(this,ql).findAll({...n,status:"pending"}).length}getQueryData(n){var a;const l=this.defaultQueryOptions({queryKey:n});return(a=F(this,ht).get(l.queryHash))==null?void 0:a.state.data}ensureQueryData(n){const l=this.defaultQueryOptions(n),a=F(this,ht).build(this,l),i=a.state.data;return i===void 0?this.fetchQuery(n):(n.revalidateIfStale&&a.isStaleByTime(ut(l.staleTime,a))&&this.prefetchQuery(l),Promise.resolve(i))}getQueriesData(n){return F(this,ht).findAll(n).map(({queryKey:l,state:a})=>[l,a.data])}setQueryData(n,l,a){var f;const i=this.defaultQueryOptions({queryKey:n}),c=(f=F(this,ht).get(i.queryHash))==null?void 0:f.state.data,d=rw(l,c);if(d!==void 0)return F(this,ht).build(this,i).setData(d,{...a,manual:!0})}setQueriesData(n,l,a){return qt.batch(()=>F(this,ht).findAll(n).map(({queryKey:i})=>[i,this.setQueryData(i,l,a)]))}getQueryState(n){var a;const l=this.defaultQueryOptions({queryKey:n});return(a=F(this,ht).get(l.queryHash))==null?void 0:a.state}removeQueries(n){const l=F(this,ht);qt.batch(()=>{l.findAll(n).forEach(a=>{l.remove(a)})})}resetQueries(n,l){const a=F(this,ht);return qt.batch(()=>{const i=a.findAll(n),c=new Set(i);return i.forEach(d=>{d.reset()}),this.refetchQueries({type:"active",predicate:d=>c.has(d)},l)})}cancelQueries(n,l={}){const a={revert:!0,...l},i=qt.batch(()=>F(this,ht).findAll(n).map(c=>c.cancel(a)));return Promise.all(i).then(bn).catch(bn)}invalidateQueries(n,l={}){return qt.batch(()=>(F(this,ht).findAll(n).forEach(a=>{a.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},l)))}refetchQueries(n,l={}){const a={...l,cancelRefetch:l.cancelRefetch??!0},i=qt.batch(()=>F(this,ht).findAll(n).filter(c=>!c.isDisabled()&&!c.isStatic()).map(c=>{let d=c.fetch(void 0,a);return a.throwOnError||(d=d.catch(bn)),c.state.fetchStatus==="paused"?Promise.resolve():d}));return Promise.all(i).then(bn)}async query(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const a=F(this,ht).build(this,l),i=a.isStaleByTime(ut(l.staleTime,a))?await a.fetch(l):a.state.data,c=l.select;return c?c(i):i}fetchQuery(n){const l=this.defaultQueryOptions(n);l.retry===void 0&&(l.retry=!1);const a=F(this,ht).build(this,l);return a.isStaleByTime(ut(l.staleTime,a))?a.fetch(l):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(bn).catch(bn)}infiniteQuery(n){return n._type="infinite",this.query(n)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(bn).catch(bn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Du.isOnline()?F(this,ql).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,ht)}getMutationCache(){return F(this,ql)}getDefaultOptions(){return F(this,Il)}setDefaultOptions(n){ge(this,Il,n)}setQueryDefaults(n,l){F(this,co).set(zr(n),{queryKey:n,defaultOptions:l})}getQueryDefaults(n){const l=[...F(this,co).values()],a={};return l.forEach(i=>{mo(n,i.queryKey)&&Object.assign(a,i.defaultOptions)}),a}setMutationDefaults(n,l){F(this,uo).set(zr(n),{mutationKey:n,defaultOptions:l})}getMutationDefaults(n){const l=[...F(this,uo).values()],a={};return l.forEach(i=>{mo(n,i.mutationKey)&&Object.assign(a,i.defaultOptions)}),a}defaultQueryOptions(n){if(n._defaulted)return n;const l={...F(this,Il).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return l.queryHash||(l.queryHash=gg(l.queryKey,l)),l.refetchOnReconnect===void 0&&(l.refetchOnReconnect=l.networkMode!=="always"),l.throwOnError===void 0&&(l.throwOnError=!!l.suspense),!l.networkMode&&l.persister&&(l.networkMode="offlineFirst"),l.queryFn===vg&&(l.enabled=!1),l}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...F(this,Il).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){F(this,ht).clear(),F(this,ql).clear()}},ht=new WeakMap,ql=new WeakMap,Il=new WeakMap,co=new WeakMap,uo=new WeakMap,Pl=new WeakMap,ho=new WeakMap,fo=new WeakMap,Mx);const Bx=C.createContext(!1),Aw=()=>C.useContext(Bx);Bx.Provider;function Ow(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const zw=C.createContext(Ow()),Dw=()=>C.useContext(zw),kw=(n,l,a)=>{const i=(a==null?void 0:a.state.status)==="error"&&typeof n.throwOnError=="function"?Dx(n.throwOnError,[a.state.error,a]):n.throwOnError;(n.suspense||i)&&(l.isReset()||(n.retryOnMount=!1))},Lw=n=>{C.useEffect(()=>{n.clearReset()},[n])},$w=({result:n,errorResetBoundary:l,throwOnError:a,query:i,suspense:c})=>n.isError&&!l.isReset()&&!n.isFetching&&i&&(c&&n.data===void 0||Dx(a,[n.error,i])),Hw=n=>{if(n.suspense){const a=c=>c==="static"?c:Math.max(c??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...c)=>a(i(...c)):a(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Uw=(n,l)=>(n==null?void 0:n.suspense)&&l.isPending,Fw=(n,l,a)=>l.fetchOptimistic(n).catch(()=>{a.clearReset()});function Vx(n,l,a){const i=Aw(),c=Dw(),d=Tx(),f=d.defaultQueryOptions(n),m=d.getQueryCache().get(f.queryHash),g=n.subscribed!==!1;f._optimisticResults=i?"isRestoring":g?"optimistic":void 0,Hw(f),kw(f,c,m),Lw(c);const[y]=C.useState(()=>new l(d,f)),v=y.getOptimisticResult(f),p=!i&&g;if(C.useSyncExternalStore(C.useCallback(S=>{const j=p?y.subscribe(qt.batchCalls(S)):bn;return y.updateResult(),j},[y,p]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),C.useEffect(()=>{y.setOptions(f)},[f,y]),Uw(f,v))throw Fw(f,y,c);if($w({result:v,errorResetBoundary:c,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw v.error;return f.notifyOnChangeProps?v:y.trackResult(v)}function Dt(n,l){return Vx(n,Fx)}function Bw(n,l){return Vx(n,Cw)}var Pr=Ex();/**
|
|
50
50
|
* @remix-run/router v1.23.4
|
|
51
51
|
*
|
|
52
52
|
* Copyright (c) Remix Software Inc.
|
|
@@ -55,7 +55,7 @@ Error generating stack: `+i.message+`
|
|
|
55
55
|
* LICENSE.md file in the root directory of this source tree.
|
|
56
56
|
*
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function
|
|
58
|
+
*/function Dr(){return Dr=Object.assign?Object.assign.bind():function(n){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var i in a)({}).hasOwnProperty.call(a,i)&&(n[i]=a[i])}return n},Dr.apply(null,arguments)}var Ql;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(Ql||(Ql={}));const rv="popstate";function Vw(n){n===void 0&&(n={});function l(i,c){let{pathname:d,search:f,hash:m}=i.location;return Bm("",{pathname:d,search:f,hash:m},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function a(i,c){return typeof c=="string"?c:qx(c)}return qw(l,a,null,n)}function wt(n,l){if(n===!1||n===null||typeof n>"u")throw new Error(l)}function Gx(n,l){if(!n){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Gw(){return Math.random().toString(36).substr(2,8)}function cv(n,l){return{usr:n.state,key:n.key,idx:l}}function Bm(n,l,a,i){return a===void 0&&(a=null),Dr({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof l=="string"?po(l):l,{state:a,key:l&&l.key||i||Gw()})}function qx(n){let{pathname:l="/",search:a="",hash:i=""}=n;return a&&a!=="?"&&(l+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(l+=i.charAt(0)==="#"?i:"#"+i),l}function po(n){let l={};if(n){let a=n.indexOf("#");a>=0&&(l.hash=n.substr(a),n=n.substr(0,a));let i=n.indexOf("?");i>=0&&(l.search=n.substr(i),n=n.substr(0,i)),n&&(l.pathname=n)}return l}function qw(n,l,a,i){i===void 0&&(i={});let{window:c=document.defaultView,v5Compat:d=!1}=i,f=c.history,m=Ql.Pop,g=null,y=v();y==null&&(y=0,f.replaceState(Dr({},f.state,{idx:y}),""));function v(){return(f.state||{idx:null}).idx}function p(){m=Ql.Pop;let E=v(),A=E==null?null:E-y;y=E,g&&g({action:m,location:N.location,delta:A})}function S(E,A){m=Ql.Push;let T=Bm(N.location,E,A);y=v()+1;let L=cv(T,y),M=N.createHref(T);try{f.pushState(L,"",M)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;c.location.assign(M)}d&&g&&g({action:m,location:N.location,delta:1})}function j(E,A){m=Ql.Replace;let T=Bm(N.location,E,A);y=v();let L=cv(T,y),M=N.createHref(T);f.replaceState(L,"",M),d&&g&&g({action:m,location:N.location,delta:0})}function b(E){let A=c.location.origin!=="null"?c.location.origin:c.location.href,T=typeof E=="string"?E:qx(E);return T=T.replace(/ $/,"%20"),wt(A,"No window.location.(origin|href) available to create URL for href: "+T),new URL(T,A)}let N={get action(){return m},get location(){return n(c,f)},listen(E){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(rv,p),g=E,()=>{c.removeEventListener(rv,p),g=null}},createHref(E){return l(c,E)},createURL:b,encodeLocation(E){let A=b(E);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:S,replace:j,go(E){return f.go(E)}};return N}var uv;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(uv||(uv={}));function Iw(n,l,a){return a===void 0&&(a="/"),Pw(n,l,a)}function Pw(n,l,a,i){let c=typeof l=="string"?po(l):l,d=Xx(c.pathname||"/",a);if(d==null)return null;let f=Ix(n);Qw(f);let m=null,g=Yx(d);for(let y=0;m==null&&y<f.length;++y)m=nN(f[y],g);return m}function Ix(n,l,a,i){l===void 0&&(l=[]),a===void 0&&(a=[]),i===void 0&&(i="");let c=(d,f,m)=>{let g={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};g.relativePath.startsWith("/")&&(wt(g.relativePath.startsWith(i),'Absolute route path "'+g.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),g.relativePath=g.relativePath.slice(i.length));let y=Fa([i,g.relativePath]),v=a.concat(g);d.children&&d.children.length>0&&(wt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Ix(d.children,l,v,y)),!(d.path==null&&!d.index)&&l.push({path:y,score:eN(y,d.index),routesMeta:v})};return n.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,f);else for(let g of Px(d.path))c(d,f,g)}),l}function Px(n){let l=n.split("/");if(l.length===0)return[];let[a,...i]=l,c=a.endsWith("?"),d=a.replace(/\?$/,"");if(i.length===0)return c?[d,""]:[d];let f=Px(i.join("/")),m=[];return m.push(...f.map(g=>g===""?d:[d,g].join("/"))),c&&m.push(...f),m.map(g=>n.startsWith("/")&&g===""?"/":g)}function Qw(n){n.sort((l,a)=>l.score!==a.score?a.score-l.score:tN(l.routesMeta.map(i=>i.childrenIndex),a.routesMeta.map(i=>i.childrenIndex)))}const Yw=/^:[\w-]+$/,Xw=3,Kw=2,Zw=1,Jw=10,Ww=-2,dv=n=>n==="*";function eN(n,l){let a=n.split("/"),i=a.length;return a.some(dv)&&(i+=Ww),l&&(i+=Kw),a.filter(c=>!dv(c)).reduce((c,d)=>c+(Yw.test(d)?Xw:d===""?Zw:Jw),i)}function tN(n,l){return n.length===l.length&&n.slice(0,-1).every((i,c)=>i===l[c])?n[n.length-1]-l[l.length-1]:0}function nN(n,l,a){let{routesMeta:i}=n,c={},d="/",f=[];for(let m=0;m<i.length;++m){let g=i[m],y=m===i.length-1,v=d==="/"?l:l.slice(d.length)||"/",p=Qx({path:g.relativePath,caseSensitive:g.caseSensitive,end:y},v),S=g.route;if(!p)return null;Object.assign(c,p.params),f.push({params:c,pathname:Fa([d,p.pathname]),pathnameBase:rN(Fa([d,p.pathnameBase])),route:S}),p.pathnameBase!=="/"&&(d=Fa([d,p.pathnameBase]))}return f}function Qx(n,l){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[a,i]=sN(n.path,n.caseSensitive,n.end),c=l.match(a);if(!c)return null;let d=c[0],f=d.replace(/(.)\/+$/,"$1"),m=c.slice(1);return{params:i.reduce((y,v,p)=>{let{paramName:S,isOptional:j}=v;if(S==="*"){let N=m[p]||"";f=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const b=m[p];return j&&!b?y[S]=void 0:y[S]=(b||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:f,pattern:n}}function sN(n,l,a){l===void 0&&(l=!1),a===void 0&&(a=!0),Gx(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,m,g)=>(i.push({paramName:m,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,l?void 0:"i"),i]}function Yx(n){try{return n.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Gx(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+l+").")),n}}function Xx(n,l){if(l==="/")return n;if(!n.toLowerCase().startsWith(l.toLowerCase()))return null;let a=l.endsWith("/")?l.length-1:l.length,i=n.charAt(a);return i&&i!=="/"?null:n.slice(a)||"/"}function lN(n,l){l===void 0&&(l="/");let{pathname:a,search:i="",hash:c=""}=typeof n=="string"?po(n):n,d;return a?(a=Kx(a),a.startsWith("/")?d=hv(a.substring(1),"/"):d=hv(a,l)):d=l,{pathname:d,search:cN(i),hash:uN(c)}}function hv(n,l){let a=l.replace(/\/+$/,"").split("/");return n.split("/").forEach(c=>{c===".."?a.length>1&&a.pop():c!=="."&&a.push(c)}),a.length>1?a.join("/"):"/"}function Uf(n,l,a,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+l+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+a+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function aN(n){return n.filter((l,a)=>a===0||l.route.path&&l.route.path.length>0)}function iN(n,l){let a=aN(n);return l?a.map((i,c)=>c===a.length-1?i.pathname:i.pathnameBase):a.map(i=>i.pathnameBase)}function oN(n,l,a,i){i===void 0&&(i=!1);let c;typeof n=="string"?c=po(n):(c=Dr({},n),wt(!c.pathname||!c.pathname.includes("?"),Uf("?","pathname","search",c)),wt(!c.pathname||!c.pathname.includes("#"),Uf("#","pathname","hash",c)),wt(!c.search||!c.search.includes("#"),Uf("#","search","hash",c)));let d=n===""||c.pathname==="",f=d?"/":c.pathname,m;if(f==null)m=a;else{let p=l.length-1;if(!i&&f.startsWith("..")){let S=f.split("/");for(;S[0]==="..";)S.shift(),p-=1;c.pathname=S.join("/")}m=p>=0?l[p]:"/"}let g=lN(c,m),y=f&&f!=="/"&&f.endsWith("/"),v=(d||f===".")&&a.endsWith("/");return!g.pathname.endsWith("/")&&(y||v)&&(g.pathname+="/"),g}const Kx=n=>n.replace(/\/\/+/g,"/"),Fa=n=>Kx(n.join("/")),rN=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),cN=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,uN=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function dN(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const Zx=["post","put","patch","delete"];new Set(Zx);const hN=["get",...Zx];new Set(hN);/**
|
|
59
59
|
* React Router v6.30.6
|
|
60
60
|
*
|
|
61
61
|
* Copyright (c) Remix Software Inc.
|
|
@@ -64,7 +64,7 @@ Error generating stack: `+i.message+`
|
|
|
64
64
|
* LICENSE.md file in the root directory of this source tree.
|
|
65
65
|
*
|
|
66
66
|
* @license MIT
|
|
67
|
-
*/function
|
|
67
|
+
*/function kr(){return kr=Object.assign?Object.assign.bind():function(n){for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var i in a)({}).hasOwnProperty.call(a,i)&&(n[i]=a[i])}return n},kr.apply(null,arguments)}const bg=C.createContext(null),fN=C.createContext(null),Iu=C.createContext(null),Pu=C.createContext(null),Ga=C.createContext({outlet:null,matches:[],isDataRoute:!1}),Jx=C.createContext(null);function Qr(){return C.useContext(Pu)!=null}function Qu(){return Qr()||wt(!1),C.useContext(Pu).location}function mN(n){Qr()||wt(!1);let{pathname:l}=Qu();return C.useMemo(()=>Qx(n,Yx(l)),[l,n])}function Wx(n){C.useContext(Iu).static||C.useLayoutEffect(n)}function jg(){let{isDataRoute:n}=C.useContext(Ga);return n?_N():gN()}function gN(){Qr()||wt(!1);let n=C.useContext(bg),{basename:l,future:a,navigator:i}=C.useContext(Iu),{matches:c}=C.useContext(Ga),{pathname:d}=Qu(),f=JSON.stringify(iN(c,a.v7_relativeSplatPath)),m=C.useRef(!1);return Wx(()=>{m.current=!0}),C.useCallback(function(y,v){if(v===void 0&&(v={}),!m.current)return;if(typeof y=="number"){i.go(y);return}let p=oN(y,JSON.parse(f),d,v.relative==="path");n==null&&l!=="/"&&(p.pathname=p.pathname==="/"?l:Fa([l,p.pathname])),(v.replace?i.replace:i.push)(p,v.state,v)},[l,i,f,d,n])}function pN(){let{matches:n}=C.useContext(Ga),l=n[n.length-1];return l?l.params:{}}function vN(n,l){return xN(n,l)}function xN(n,l,a,i){Qr()||wt(!1);let{navigator:c}=C.useContext(Iu),{matches:d}=C.useContext(Ga),f=d[d.length-1],m=f?f.params:{};f&&f.pathname;let g=f?f.pathnameBase:"/";f&&f.route;let y=Qu(),v;if(l){var p;let E=typeof l=="string"?po(l):l;g==="/"||(p=E.pathname)!=null&&p.startsWith(g)||wt(!1),v=E}else v=y;let S=v.pathname||"/",j=S;if(g!=="/"){let E=g.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(E.length).join("/")}let b=Iw(n,{pathname:j}),N=wN(b&&b.map(E=>Object.assign({},E,{params:Object.assign({},m,E.params),pathname:Fa([g,c.encodeLocation?c.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?g:Fa([g,c.encodeLocation?c.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),d,a,i);return l&&N?C.createElement(Pu.Provider,{value:{location:kr({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:Ql.Pop}},N):N}function yN(){let n=EN(),l=dN(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),a=n instanceof Error?n.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},l),a?C.createElement("pre",{style:c},a):null,null)}const SN=C.createElement(yN,null);class bN extends C.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,a){return a.location!==l.location||a.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:a.error,location:a.location,revalidation:l.revalidation||a.revalidation}}componentDidCatch(l,a){console.error("React Router caught the following error during render",l,a)}render(){return this.state.error!==void 0?C.createElement(Ga.Provider,{value:this.props.routeContext},C.createElement(Jx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function jN(n){let{routeContext:l,match:a,children:i}=n,c=C.useContext(bg);return c&&c.static&&c.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=a.route.id),C.createElement(Ga.Provider,{value:l},i)}function wN(n,l,a,i){var c;if(l===void 0&&(l=[]),a===void 0&&(a=null),i===void 0&&(i=null),n==null){var d;if(!a)return null;if(a.errors)n=a.matches;else if((d=i)!=null&&d.v7_partialHydration&&l.length===0&&!a.initialized&&a.matches.length>0)n=a.matches;else return null}let f=n,m=(c=a)==null?void 0:c.errors;if(m!=null){let v=f.findIndex(p=>p.route.id&&(m==null?void 0:m[p.route.id])!==void 0);v>=0||wt(!1),f=f.slice(0,Math.min(f.length,v+1))}let g=!1,y=-1;if(a&&i&&i.v7_partialHydration)for(let v=0;v<f.length;v++){let p=f[v];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(y=v),p.route.id){let{loaderData:S,errors:j}=a,b=p.route.loader&&S[p.route.id]===void 0&&(!j||j[p.route.id]===void 0);if(p.route.lazy||b){g=!0,y>=0?f=f.slice(0,y+1):f=[f[0]];break}}}return f.reduceRight((v,p,S)=>{let j,b=!1,N=null,E=null;a&&(j=m&&p.route.id?m[p.route.id]:void 0,N=p.route.errorElement||SN,g&&(y<0&&S===0?(TN("route-fallback"),b=!0,E=null):y===S&&(b=!0,E=p.route.hydrateFallbackElement||null)));let A=l.concat(f.slice(0,S+1)),T=()=>{let L;return j?L=N:b?L=E:p.route.Component?L=C.createElement(p.route.Component,null):p.route.element?L=p.route.element:L=v,C.createElement(jN,{match:p,routeContext:{outlet:v,matches:A,isDataRoute:a!=null},children:L})};return a&&(p.route.ErrorBoundary||p.route.errorElement||S===0)?C.createElement(bN,{location:a.location,revalidation:a.revalidation,component:N,error:j,children:T(),routeContext:{outlet:null,matches:A,isDataRoute:!0}}):T()},null)}var ey=(function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n})(ey||{}),ty=(function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n})(ty||{});function NN(n){let l=C.useContext(bg);return l||wt(!1),l}function CN(n){let l=C.useContext(fN);return l||wt(!1),l}function MN(n){let l=C.useContext(Ga);return l||wt(!1),l}function ny(n){let l=MN(),a=l.matches[l.matches.length-1];return a.route.id||wt(!1),a.route.id}function EN(){var n;let l=C.useContext(Jx),a=CN(),i=ny();return l!==void 0?l:(n=a.errors)==null?void 0:n[i]}function _N(){let{router:n}=NN(ey.UseNavigateStable),l=ny(ty.UseNavigateStable),a=C.useRef(!1);return Wx(()=>{a.current=!0}),C.useCallback(function(c,d){d===void 0&&(d={}),a.current&&(typeof c=="number"?n.navigate(c):n.navigate(c,kr({fromRouteId:l},d)))},[n,l])}const fv={};function TN(n,l,a){fv[n]||(fv[n]=!0)}function RN(n,l){n==null||n.v7_startTransition,n==null||n.v7_relativeSplatPath}function Vm(n){wt(!1)}function AN(n){let{basename:l="/",children:a=null,location:i,navigationType:c=Ql.Pop,navigator:d,static:f=!1,future:m}=n;Qr()&&wt(!1);let g=l.replace(/^\/*/,"/"),y=C.useMemo(()=>({basename:g,navigator:d,static:f,future:kr({v7_relativeSplatPath:!1},m)}),[g,m,d,f]);typeof i=="string"&&(i=po(i));let{pathname:v="/",search:p="",hash:S="",state:j=null,key:b="default"}=i,N=C.useMemo(()=>{let E=Xx(v,g);return E==null?null:{location:{pathname:E,search:p,hash:S,state:j,key:b},navigationType:c}},[g,v,p,S,j,b,c]);return N==null?null:C.createElement(Iu.Provider,{value:y},C.createElement(Pu.Provider,{children:a,value:N}))}function ON(n){let{children:l,location:a}=n;return vN(Gm(l),a)}new Promise(()=>{});function Gm(n,l){l===void 0&&(l=[]);let a=[];return C.Children.forEach(n,(i,c)=>{if(!C.isValidElement(i))return;let d=[...l,c];if(i.type===C.Fragment){a.push.apply(a,Gm(i.props.children,d));return}i.type!==Vm&&wt(!1),!i.props.index||!i.props.children||wt(!1);let f={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(f.children=Gm(i.props.children,d)),a.push(f)}),a}/**
|
|
68
68
|
* React Router DOM v6.30.6
|
|
69
69
|
*
|
|
70
70
|
* Copyright (c) Remix Software Inc.
|
|
@@ -73,208 +73,228 @@ Error generating stack: `+i.message+`
|
|
|
73
73
|
* LICENSE.md file in the root directory of this source tree.
|
|
74
74
|
*
|
|
75
75
|
* @license MIT
|
|
76
|
-
*/function
|
|
76
|
+
*/function qm(n){return n===void 0&&(n=""),new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((l,a)=>{let i=n[a];return l.concat(Array.isArray(i)?i.map(c=>[a,c]):[[a,i]])},[]))}function zN(n,l){let a=qm(n);return l&&l.forEach((i,c)=>{a.has(c)||l.getAll(c).forEach(d=>{a.append(c,d)})}),a}const DN="6";try{window.__reactRouterVersion=DN}catch{}const kN="startTransition",mv=Kj[kN];function LN(n){let{basename:l,children:a,future:i,window:c}=n,d=C.useRef();d.current==null&&(d.current=Vw({window:c,v5Compat:!0}));let f=d.current,[m,g]=C.useState({action:f.action,location:f.location}),{v7_startTransition:y}=i||{},v=C.useCallback(p=>{y&&mv?mv(()=>g(p)):g(p)},[g,y]);return C.useLayoutEffect(()=>f.listen(v),[f,v]),C.useEffect(()=>RN(i),[i]),C.createElement(AN,{basename:l,children:a,location:m.location,navigationType:m.action,navigator:f,future:i})}var gv;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(gv||(gv={}));var pv;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(pv||(pv={}));function $N(n){let l=C.useRef(qm(n)),a=C.useRef(!1),i=Qu(),c=C.useMemo(()=>zN(i.search,a.current?null:l.current),[i.search]),d=jg(),f=C.useCallback((m,g)=>{const y=qm(typeof m=="function"?m(c):m);a.current=!0,d("?"+y,g)},[d,c]);return[c,f]}function HN(n){const l=n.replace(/^\/+/,"").replace(/\/+$/,"");return l?`/${l}`:""}const rn=typeof window>"u"?void 0:window.$isabl,Pn={apiHost:((rn==null?void 0:rn.apiHost)??"").replace(/\/$/,""),basePath:HN((rn==null?void 0:rn.basePath)??"/wgts"),theme:(rn==null?void 0:rn.theme)==="sand"?"th-sand":(rn==null?void 0:rn.theme)==="msk"?"th-msk":"th-clean",isablUiUrl:((rn==null?void 0:rn.isablUiUrl)??"/beta").replace(/\/+$/,"")};function UN(n){return`${Pn.isablUiUrl}/explorer?r=analyses:${n}`}const Im="user-token";/**
|
|
77
77
|
* @license lucide-react v0.468.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const
|
|
81
|
+
*/const FN=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sy=(...n)=>n.filter((l,a,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===a).join(" ").trim();/**
|
|
82
82
|
* @license lucide-react v0.468.0 - ISC
|
|
83
83
|
*
|
|
84
84
|
* This source code is licensed under the ISC license.
|
|
85
85
|
* See the LICENSE file in the root directory of this source tree.
|
|
86
|
-
*/var
|
|
86
|
+
*/var BN={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"};/**
|
|
87
87
|
* @license lucide-react v0.468.0 - ISC
|
|
88
88
|
*
|
|
89
89
|
* This source code is licensed under the ISC license.
|
|
90
90
|
* See the LICENSE file in the root directory of this source tree.
|
|
91
|
-
*/const
|
|
91
|
+
*/const VN=C.forwardRef(({color:n="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:c="",children:d,iconNode:f,...m},g)=>C.createElement("svg",{ref:g,...BN,width:l,height:l,stroke:n,strokeWidth:i?Number(a)*24/Number(l):a,className:sy("lucide",c),...m},[...f.map(([y,v])=>C.createElement(y,v)),...Array.isArray(d)?d:[d]]));/**
|
|
92
92
|
* @license lucide-react v0.468.0 - ISC
|
|
93
93
|
*
|
|
94
94
|
* This source code is licensed under the ISC license.
|
|
95
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/const
|
|
96
|
+
*/const ze=(n,l)=>{const a=C.forwardRef(({className:i,...c},d)=>C.createElement(VN,{ref:d,iconNode:l,className:sy(`lucide-${FN(n)}`,i),...c}));return a.displayName=`${n}`,a};/**
|
|
97
97
|
* @license lucide-react v0.468.0 - ISC
|
|
98
98
|
*
|
|
99
99
|
* This source code is licensed under the ISC license.
|
|
100
100
|
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
-
*/const
|
|
101
|
+
*/const GN=ze("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
102
102
|
* @license lucide-react v0.468.0 - ISC
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const
|
|
106
|
+
*/const ku=ze("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
107
107
|
* @license lucide-react v0.468.0 - ISC
|
|
108
108
|
*
|
|
109
109
|
* This source code is licensed under the ISC license.
|
|
110
110
|
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
-
*/const
|
|
111
|
+
*/const ly=ze("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
|
112
112
|
* @license lucide-react v0.468.0 - ISC
|
|
113
113
|
*
|
|
114
114
|
* This source code is licensed under the ISC license.
|
|
115
115
|
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
-
*/const
|
|
116
|
+
*/const ay=ze("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
117
117
|
* @license lucide-react v0.468.0 - ISC
|
|
118
118
|
*
|
|
119
119
|
* This source code is licensed under the ISC license.
|
|
120
120
|
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
-
*/const
|
|
121
|
+
*/const qN=ze("AudioWaveform",[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]]);/**
|
|
122
122
|
* @license lucide-react v0.468.0 - ISC
|
|
123
123
|
*
|
|
124
124
|
* This source code is licensed under the ISC license.
|
|
125
125
|
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
-
*/const
|
|
126
|
+
*/const IN=ze("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
|
|
127
127
|
* @license lucide-react v0.468.0 - ISC
|
|
128
128
|
*
|
|
129
129
|
* This source code is licensed under the ISC license.
|
|
130
130
|
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
-
*/const
|
|
131
|
+
*/const iy=ze("ChartScatter",[["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}],["circle",{cx:"18.5",cy:"5.5",r:".5",fill:"currentColor",key:"lysivs"}],["circle",{cx:"11.5",cy:"11.5",r:".5",fill:"currentColor",key:"byv1b8"}],["circle",{cx:"7.5",cy:"16.5",r:".5",fill:"currentColor",key:"nkw3mc"}],["circle",{cx:"17.5",cy:"14.5",r:".5",fill:"currentColor",key:"1gjh6j"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]]);/**
|
|
132
132
|
* @license lucide-react v0.468.0 - ISC
|
|
133
133
|
*
|
|
134
134
|
* This source code is licensed under the ISC license.
|
|
135
135
|
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
-
*/const
|
|
136
|
+
*/const oy=ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
137
137
|
* @license lucide-react v0.468.0 - ISC
|
|
138
138
|
*
|
|
139
139
|
* This source code is licensed under the ISC license.
|
|
140
140
|
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
-
*/const
|
|
141
|
+
*/const ry=ze("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
142
142
|
* @license lucide-react v0.468.0 - ISC
|
|
143
143
|
*
|
|
144
144
|
* This source code is licensed under the ISC license.
|
|
145
145
|
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
-
*/const
|
|
146
|
+
*/const Yu=ze("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
147
147
|
* @license lucide-react v0.468.0 - ISC
|
|
148
148
|
*
|
|
149
149
|
* This source code is licensed under the ISC license.
|
|
150
150
|
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
-
*/const
|
|
151
|
+
*/const PN=ze("CircleAlert",[["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"}]]);/**
|
|
152
152
|
* @license lucide-react v0.468.0 - ISC
|
|
153
153
|
*
|
|
154
154
|
* This source code is licensed under the ISC license.
|
|
155
155
|
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
-
*/const
|
|
156
|
+
*/const QN=ze("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
157
157
|
* @license lucide-react v0.468.0 - ISC
|
|
158
158
|
*
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
-
*/const
|
|
161
|
+
*/const YN=ze("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);/**
|
|
162
162
|
* @license lucide-react v0.468.0 - ISC
|
|
163
163
|
*
|
|
164
164
|
* This source code is licensed under the ISC license.
|
|
165
165
|
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
-
*/const
|
|
166
|
+
*/const cy=ze("Copy",[["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"}]]);/**
|
|
167
167
|
* @license lucide-react v0.468.0 - ISC
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
170
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const
|
|
171
|
+
*/const Pm=ze("Crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]);/**
|
|
172
172
|
* @license lucide-react v0.468.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const
|
|
176
|
+
*/const Xu=ze("Dna",[["path",{d:"m10 16 1.5 1.5",key:"11lckj"}],["path",{d:"m14 8-1.5-1.5",key:"1ohn8i"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m17 6-2.891-2.891",key:"xu6p2f"}],["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"m20 9 .891.891",key:"3xwk7g"}],["path",{d:"M3.109 14.109 4 15",key:"q76aoh"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m7 18 2.891 2.891",key:"1sisit"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}]]);/**
|
|
177
177
|
* @license lucide-react v0.468.0 - ISC
|
|
178
178
|
*
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const
|
|
181
|
+
*/const uy=ze("ExternalLink",[["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"}]]);/**
|
|
182
182
|
* @license lucide-react v0.468.0 - ISC
|
|
183
183
|
*
|
|
184
184
|
* This source code is licensed under the ISC license.
|
|
185
185
|
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
-
*/const
|
|
186
|
+
*/const dy=ze("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
|
|
187
187
|
* @license lucide-react v0.468.0 - ISC
|
|
188
188
|
*
|
|
189
189
|
* This source code is licensed under the ISC license.
|
|
190
190
|
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
-
*/const
|
|
191
|
+
*/const XN=ze("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
192
192
|
* @license lucide-react v0.468.0 - ISC
|
|
193
193
|
*
|
|
194
194
|
* This source code is licensed under the ISC license.
|
|
195
195
|
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
-
*/const
|
|
196
|
+
*/const KN=ze("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
|
|
197
197
|
* @license lucide-react v0.468.0 - ISC
|
|
198
198
|
*
|
|
199
199
|
* This source code is licensed under the ISC license.
|
|
200
200
|
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
-
*/const
|
|
201
|
+
*/const ZN=ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
202
202
|
* @license lucide-react v0.468.0 - ISC
|
|
203
203
|
*
|
|
204
204
|
* This source code is licensed under the ISC license.
|
|
205
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
-
*/const
|
|
206
|
+
*/const JN=ze("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
207
207
|
* @license lucide-react v0.468.0 - ISC
|
|
208
208
|
*
|
|
209
209
|
* This source code is licensed under the ISC license.
|
|
210
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
-
*/const
|
|
211
|
+
*/const WN=ze("Link2",[["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"}]]);/**
|
|
212
212
|
* @license lucide-react v0.468.0 - ISC
|
|
213
213
|
*
|
|
214
214
|
* This source code is licensed under the ISC license.
|
|
215
215
|
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const
|
|
216
|
+
*/const eC=ze("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
|
|
217
217
|
* @license lucide-react v0.468.0 - ISC
|
|
218
218
|
*
|
|
219
219
|
* This source code is licensed under the ISC license.
|
|
220
220
|
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const
|
|
221
|
+
*/const tC=ze("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
222
222
|
* @license lucide-react v0.468.0 - ISC
|
|
223
223
|
*
|
|
224
224
|
* This source code is licensed under the ISC license.
|
|
225
225
|
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
-
*/const
|
|
226
|
+
*/const nC=ze("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
|
|
227
227
|
* @license lucide-react v0.468.0 - ISC
|
|
228
228
|
*
|
|
229
229
|
* This source code is licensed under the ISC license.
|
|
230
230
|
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
-
*/const
|
|
231
|
+
*/const sC=ze("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
232
232
|
* @license lucide-react v0.468.0 - ISC
|
|
233
233
|
*
|
|
234
234
|
* This source code is licensed under the ISC license.
|
|
235
235
|
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
-
*/const
|
|
236
|
+
*/const lC=ze("Orbit",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M10.4 21.9a10 10 0 0 0 9.941-15.416",key:"eohfx2"}],["path",{d:"M13.5 2.1a10 10 0 0 0-9.841 15.416",key:"19pvbm"}]]);/**
|
|
237
237
|
* @license lucide-react v0.468.0 - ISC
|
|
238
238
|
*
|
|
239
239
|
* This source code is licensed under the ISC license.
|
|
240
240
|
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
-
*/const
|
|
241
|
+
*/const aC=ze("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
242
242
|
* @license lucide-react v0.468.0 - ISC
|
|
243
243
|
*
|
|
244
244
|
* This source code is licensed under the ISC license.
|
|
245
245
|
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
-
*/const
|
|
246
|
+
*/const iC=ze("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
247
247
|
* @license lucide-react v0.468.0 - ISC
|
|
248
248
|
*
|
|
249
249
|
* This source code is licensed under the ISC license.
|
|
250
250
|
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
-
*/const
|
|
251
|
+
*/const oC=ze("Pill",[["path",{d:"m10.5 20.5 10-10a4.95 4.95 0 1 0-7-7l-10 10a4.95 4.95 0 1 0 7 7Z",key:"wa1lgi"}],["path",{d:"m8.5 8.5 7 7",key:"rvfmvr"}]]);/**
|
|
252
252
|
* @license lucide-react v0.468.0 - ISC
|
|
253
253
|
*
|
|
254
254
|
* This source code is licensed under the ISC license.
|
|
255
255
|
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
-
*/const
|
|
256
|
+
*/const Lu=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
257
257
|
* @license lucide-react v0.468.0 - ISC
|
|
258
258
|
*
|
|
259
259
|
* This source code is licensed under the ISC license.
|
|
260
260
|
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
-
*/const
|
|
261
|
+
*/const rC=ze("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
262
262
|
* @license lucide-react v0.468.0 - ISC
|
|
263
263
|
*
|
|
264
264
|
* This source code is licensed under the ISC license.
|
|
265
265
|
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
-
*/const
|
|
266
|
+
*/const cC=ze("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);/**
|
|
267
267
|
* @license lucide-react v0.468.0 - ISC
|
|
268
268
|
*
|
|
269
269
|
* This source code is licensed under the ISC license.
|
|
270
270
|
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/const
|
|
271
|
+
*/const hy=ze("TriangleAlert",[["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"}]]);/**
|
|
272
272
|
* @license lucide-react v0.468.0 - ISC
|
|
273
273
|
*
|
|
274
274
|
* This source code is licensed under the ISC license.
|
|
275
275
|
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const Z1=He("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function PN(n){if(n.value===null)return n.text??"";switch(n.key){case"coverage":return`${Math.round(n.value)}×`;case"tmb":return n.value<.01?n.value.toPrecision(2):n.value.toFixed(2);default:return n.value.toFixed(2)}}function XN(n){return n.status==="failed"?"Failed":n.status==="skipped"?"Not in this mode":"Not run"}const KN=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"});function J1(n){if(!n)return"";const l=new Date(n);return Number.isNaN(l.getTime())?"":KN.format(l)}function hg(n,l){return n.startsWith(`${l}_`)?n.slice(l.length+1):n}function km(n){return n==null?"–":n.toFixed(2)}const cx={missense_variant:"Missense",stop_gained:"Nonsense",stop_lost:"Stop lost",start_lost:"Start lost",frameshift_variant:"Frameshift",inframe_deletion:"In-frame deletion",inframe_insertion:"In-frame insertion",splice_acceptor_variant:"Splice acceptor",splice_donor_variant:"Splice donor",splice_region_variant:"Splice region",synonymous_variant:"Synonymous",intron_variant:"Intronic",upstream_gene_variant:"Upstream",downstream_gene_variant:"Downstream","5_prime_UTR_variant":"5′ UTR","3_prime_UTR_variant":"3′ UTR"};function ZN(n,l){const a=(n??l??"").split("&")[0];if(!a)return"–";if(cx[a])return cx[a];const o=a.replace(/_/g," ");return o.charAt(0).toUpperCase()+o.slice(1)}function Rr(n,l){return`chr${n}:${l.toLocaleString("en-US")}`}const bn=[["1",249250621],["2",243199373],["3",198022430],["4",191154276],["5",180915260],["6",171115067],["7",159138663],["8",146364022],["9",141213431],["10",135534747],["11",135006516],["12",133851895],["13",115169878],["14",107349540],["15",102531392],["16",90354753],["17",81195210],["18",78077248],["19",59128983],["20",63025520],["21",48129895],["22",51304566],["X",155270560]],Hm=.0025,JN=bn.reduce((n,[,l])=>n+l,0),WN=1-Hm*bn.length,Gu=(()=>{const n={};let l=Hm/2;for(const[a,o]of bn){const c=o/JN*WN;n[a]=[l,l+c],l+=c+Hm}return n})(),ux=Object.fromEntries(bn);function Ru(n,l){const a=n.replace(/^chr/,""),o=Gu[a];if(!o)return null;const c=Math.min(Math.max(l,0),ux[a]);return o[0]+c/ux[a]*(o[1]-o[0])}function fx(n,l,a,o){const c=o*2*Math.PI-Math.PI/2;return[n+a*Math.cos(c),l+a*Math.sin(c)]}function Ah(n,l,a,o,c){const[d,h]=fx(n,l,a,o),[m,g]=fx(n,l,a,c),x=c-o>.5?1:0;return`M${d.toFixed(2)},${h.toFixed(2)} A${a},${a} 0 ${x} 1 ${m.toFixed(2)},${g.toFixed(2)}`}function Um(n,l="start"){let a=null;for(const d of bn){const[h,m]=d,[g,x]=Gu[h];if(n<g&&l==="end"&&a)return{chrom:a[0],pos:a[1]};if(n<=x)return{chrom:h,pos:Math.round(Math.max(0,(n-g)/(x-g))*m)};a=d}const[o,c]=bn[bn.length-1];return{chrom:o,pos:c}}function jr(n,l){const a=l>=1e6?0:l>=1e5?1:2;return`${(n/1e6).toFixed(a)} Mb`}const eC={hero:{box:220,ring:78,ringW:10,gain:93,gainW:7,amp:94,ampW:13,loss:63,lossW:7,drv:50,drvW:9},switcher:{box:48,ring:16,ringW:4.5,gain:21,gainW:3,amp:21,ampW:4.5,loss:11,lossW:3,drv:0,drvW:0},mini:{box:20,ring:7,ringW:2.6,gain:7,gainW:2.6,amp:7,ampW:2.6,loss:7,lossW:2.6,drv:0,drvW:0}},dx=.004,hx=.003;function tC(n,l,a){const o=Ru(n,l),c=Ru(n,a);return o===null||c===null?null:c-o<dx?[o,o+dx]:[o,c]}function Oh(n){return n.length<=1?n[0]??"":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function nC(n,l,a){return n===1?`one ${l}`:`${n} ${a}`}function W1(n){const a=[["amp","amplification","amplifications"],["gain","gain","gains"],["loss","loss","losses"]].flatMap(([h,m,g])=>{const x=n.events.filter(b=>b.kind===h);if(x.length===0)return[];const v=[...new Set(x.map(b=>b.chrom))],y=v.length>6?[...v.slice(0,6),`${v.length-6} more`]:v,S=v.length===1?`chromosome ${v[0]}`:`chromosomes ${Oh(y)}`,j=h==="amp"&&x.length===1&&x[0].total_cn!==null?` (${Math.round(x[0].total_cn)} copies)`:"";return[`${nC(x.length,m,g)} on ${S}${j}`]}),o=a.length?Oh(a):`no copy-number changes against ${n.baseline} copies`,c=[...new Set(n.drivers.map(h=>h.gene).filter(h=>!!h))].sort(),d=c.length?`Drivers in ${Oh(c)}.`:"No drivers.";return`${o.charAt(0).toUpperCase()}${o.slice(1)}. ${d}`}function mg({fingerprint:n,size:l,title:a,subtitle:o,className:c}){const d=eC[l],h=d.box/2,m=(n==null?void 0:n.events)??[],g=(n==null?void 0:n.drivers)??[],x=n?`Genome fingerprint: ${W1(n)}`:"No copy-number data";return r.jsxs("svg",{viewBox:`0 0 ${d.box} ${d.box}`,role:l==="mini"?void 0:"img","aria-label":l==="mini"?void 0:x,"aria-hidden":l==="mini"?!0:void 0,className:c,children:[r.jsxs("g",{fill:"none",strokeLinecap:"butt",children:[Object.entries(Gu).map(([v,[y,S]])=>r.jsx("path",{className:"r-neu",strokeWidth:d.ringW,d:Ah(h,h,d.ring,y,S)},v)),m.map((v,y)=>{const S=tC(v.chrom,v.start,v.end);if(!S)return null;const j=v.kind==="loss"?d.loss:v.kind==="amp"?d.amp:d.gain,b=v.kind==="loss"?d.lossW:v.kind==="amp"?d.ampW:d.gainW;return r.jsx("path",{className:`r-${v.kind}`,strokeWidth:b,d:Ah(h,h,j,S[0],S[1])},`${v.chrom}-${v.start}-${y}`)}),d.drvW>0&&g.map((v,y)=>{const S=Ru(v.chrom,v.pos);return S===null?null:r.jsx("path",{className:"r-drv",strokeWidth:d.drvW,d:Ah(h,h,d.drv,S-hx/2,S+hx/2)},`${v.gene}-${v.pos}-${y}`)})]}),l==="hero"&&a&&r.jsxs(r.Fragment,{children:[r.jsx("text",{className:"t-ink",x:h,y:h-2,textAnchor:"middle",fontSize:"24",fontWeight:"800",children:a}),o&&r.jsx("text",{className:"t-faint",x:h,y:h+18,textAnchor:"middle",fontSize:"12",fontWeight:"600",children:o})]})]})}const sC={"DNA|WG":{label:"WGS",icon:Vu},"RNA|WT":{label:"RNA",icon:TN}};function mx({children:n}){return r.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:n})}function lC({sex:n}){const l=n==null?void 0:n.toUpperCase();return l==="MALE"?r.jsxs(mx,{children:[r.jsx("circle",{cx:"12",cy:"9",r:"4.5"}),r.jsx("path",{d:"M7.6 8.2c.5-2.9 2.4-4.7 4.6-4.7 2.6 0 4.4 1.7 4.4 4.3-2.2.1-4.2-.6-5.6-2.1"}),r.jsx("path",{d:"M3.5 21a8.5 7.5 0 0 1 17 0"}),r.jsx("path",{d:"m10 15.6 2 2.2 2-2.2"})]}):l==="FEMALE"?r.jsxs(mx,{children:[r.jsx("circle",{cx:"12",cy:"9.2",r:"3.4"}),r.jsx("path",{d:"M6.3 14.2C4.6 9 6.6 2.8 12 2.8s7.4 6.2 5.7 11.4"}),r.jsx("path",{d:"M5 21.2a7 6.3 0 0 1 14 0"})]}):r.jsx(IN,{size:16,"aria-hidden":!0})}const eS="wgts-patient-root";function aC(n,l){const a=n.getBoundingClientRect(),o=n.closest(".topbar"),c=o==null?void 0:o.parentElement,d=o&&c?c.getBoundingClientRect().top-o.getBoundingClientRect().top:0;return{x:a.left-l.left+a.width/2,y:a.top+d-l.top+a.height/2}}const tS=8;function zh(n,l,a,o){const c=a>=n.x?1:-1,d=Math.min(tS,Math.abs(a-n.x)/2,(l-n.y-14)/2);return[`M${n.x},${n.y+14}`,`V${l-d}`,`Q${n.x},${l} ${n.x+c*d},${l}`,`H${a-c*d}`,`Q${a},${l} ${a},${l+d}`,`V${o}`].join(" ")}function iC(n,l,a){const o=a.x>l.x?1:-1,c=Math.min(tS,Math.abs(a.x-l.x)/2,(l.top-n)/2);return[`M${l.x},${l.top}`,`V${n+c}`,`Q${l.x},${n} ${l.x+o*c},${n}`,`H${a.x-o*c}`,`Q${a.x},${n} ${a.x},${n+c}`,`V${a.top}`].join(" ")}function oC(n,l,a){const o=l.left+l.width/2,c=a.left+a.width/2,d=n-7,m=(n-25-.25*d)/.75;return`M${o},${d} C${o},${m} ${c},${m} ${c},${d}`}function rC(n,l){var o,c;const a=n.samples.find(d=>d.id===l);for(const d of(a==null?void 0:a.experiments)??[]){const h=(o=n.experiments[d])==null?void 0:o.normal,m=h?(c=n.experiments[h])==null?void 0:c.sample:void 0;if(m&&m!==l)return m}return null}function cC({data:n,sampleId:l,fingerprint:a,onSample:o}){const c=M.useRef(null),[d,h]=M.useState(null),[m,g]=M.useState(!1);M.useEffect(()=>{if(!d||m)return;const O=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(O)},[d,m]);const x=new Set(n.failures.map(O=>O.sample)),v=M.useRef(l),[y,S]=M.useState(null);M.useEffect(()=>{if(v.current===l)return;const O=v.current;v.current=l,S(_=>({from:O,to:l,n:((_==null?void 0:_.n)??0)+1}))},[l]);const j=rC(n,l);M.useLayoutEffect(()=>{const O=c.current;if(!O)return;const _=()=>{const C=O.getBoundingClientRect(),E=document.getElementById(eS);if(!E)return;const R=Array.from(O.querySelectorAll("[data-sample]")).map(K=>{const k=K.getBoundingClientRect();return{id:K.dataset.sample,x:k.left-C.left+22,left:k.left-C.left,width:k.width,top:k.top-C.top,bottom:k.bottom-C.top}}),A=aC(E,C),B=Math.min(...R.map(K=>K.top));h({root:A,trunk:B-12,tabs:R})};if(_(),typeof ResizeObserver>"u")return;const D=new ResizeObserver(_);return D.observe(O),()=>D.disconnect()},[n,l]);const b=d==null?void 0:d.tabs.find(O=>O.id===l),N=j?d==null?void 0:d.tabs.find(O=>O.id===j):void 0,T=y?d==null?void 0:d.tabs.find(O=>O.id===y.from):void 0;return r.jsxs("div",{ref:c,className:"ltabs",children:[d&&r.jsxs("svg",{className:"ltabs-links","aria-hidden":!0,children:[d.tabs.map(O=>r.jsx("path",{d:zh(d.root,d.trunk,O.x,O.top)},O.id)),b&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":m,style:{d:`path("${zh(d.root,d.trunk,b.x,b.top)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":m,style:{d:`path("${zh(d.root,d.trunk,b.x,b.top)}")`}}),T&&y&&y.to===b.id&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:iC(d.trunk,T,b)},`bead-${y.n}`)]}),b&&N&&r.jsxs("g",{className:"ltabs-match",children:[r.jsx("path",{d:oC(d.trunk,b,N)}),r.jsx("text",{x:(b.left+b.width/2+N.left+N.width/2)/2,y:d.trunk-27,children:"matched normal"})]})]}),b&&r.jsx("span",{className:"ltabs-thumb","data-moving":m,"aria-hidden":!0,style:{width:b.width,height:b.bottom-b.top,transform:`translate(${b.left}px, ${b.top}px)`}}),r.jsx("div",{className:"ltabs-row",role:"tablist","aria-label":"Samples",children:n.samples.map(O=>{const _=O.id===l,D=a==null?void 0:a.samples.find(E=>E.sample===O.id),C=O.experiments.map(E=>({id:E,...n.experiments[E]})).filter(E=>E.technique);return r.jsxs("button",{type:"button",role:"tab","data-sample":O.id,"aria-selected":_,className:"ltab",onClick:()=>o(O.id),children:[r.jsxs("span",{className:"ltab-name",children:[O.category==="TUMOR"?r.jsx(mg,{fingerprint:D,size:"mini",className:"h-[18px] w-[18px] flex-none"}):r.jsx(X1,{size:15,"aria-hidden":!0,className:"flex-none"}),hg(O.id,n.individual.id)," ",O.category==="TUMOR"?"tumour":"normal",x.has(O.id)&&r.jsx("span",{className:"ltab-warn",title:"A module failed for this sample","aria-label":"A module failed"})]}),r.jsxs("span",{className:"ltab-exps",children:[C.length===0&&r.jsx("span",{children:"No experiments"}),C.map(E=>{const R=sC[E.technique],A=(R==null?void 0:R.icon)??Vu;return r.jsxs("span",{title:E.id,children:[r.jsx(A,{size:12,"aria-hidden":!0}),(R==null?void 0:R.label)??E.technique]},E.id)})]})]},O.id)})})]})}function uC({data:n,sampleId:l,fingerprint:a,onSample:o}){return r.jsx("div",{className:"ctabs",role:"tablist","aria-label":"Samples",children:n.samples.map(c=>{const d=a==null?void 0:a.samples.find(h=>h.sample===c.id);return r.jsxs("button",{type:"button",role:"tab","aria-selected":c.id===l,className:"ctab",onClick:()=>o(c.id),children:[c.category==="TUMOR"?r.jsx(mg,{fingerprint:d,size:"mini",className:"h-[16px] w-[16px] flex-none"}):r.jsx(X1,{size:14,"aria-hidden":!0,className:"flex-none"}),hg(c.id,n.individual.id)," ",c.category==="TUMOR"?"tumour":"normal"]},c.id)})})}function Cr(n){let l=n;const a=new Set;return{get:()=>l,set:o=>{Object.is(o,l)||(l=o,a.forEach(c=>c()))},subscribe:o=>(a.add(o),()=>a.delete(o))}}function qu(n){return M.useSyncExternalStore(n.subscribe,n.get,n.get)}const gg=Cr(!1),Ar=()=>gg.set(!0),yu=()=>gg.set(!1),fC=Cr(!0);function nS({individualId:n,subtitle:l,patientIcon:a,report:o,compact:c,headerInView:d=fC}){const h=!qu(d),[m,g]=M.useState(!1),[x,v]=M.useState(!1);M.useEffect(()=>{const S=()=>v(window.scrollY>4);return S(),window.addEventListener("scroll",S,{passive:!0}),()=>window.removeEventListener("scroll",S)},[]);async function y(){try{await navigator.clipboard.writeText(window.location.href),g(!0),window.setTimeout(()=>g(!1),1600)}catch{window.prompt("Copy this link",window.location.href)}}return r.jsxs("div",{className:"topbar flex flex-wrap items-center justify-between gap-x-4 gap-y-3 px-8 pt-3 pb-2","data-scrolled":x,children:[r.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 items-center gap-2 text-[13.5px]",children:[r.jsx("button",{type:"button",className:"crumb",onClick:Ar,title:"Browse projects and patients",children:"Patients"}),n&&r.jsxs(r.Fragment,{children:[r.jsx(dg,{size:14,"aria-hidden":!0,style:{color:"var(--chev)"}}),a&&r.jsx("span",{id:eS,className:"ltabs-icon",children:a}),r.jsx("h1",{className:"m-0 text-[20px] font-semibold tracking-tight",style:{color:"var(--ink)"},children:n}),l&&r.jsx("span",{className:"ml-1.5 truncate text-[13.5px]",style:{color:"var(--muted)"},children:l})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,r.jsx("button",{type:"button",className:"sc-ib","aria-label":"Copy a link to this view",onClick:y,children:r.jsx($N,{size:16,"aria-hidden":!0})}),r.jsx("span",{"aria-live":"polite",className:"text-xs",style:{color:"var(--muted)"},children:m?"Link copied":""})]}),c&&r.jsx("div",{className:"topbar-compact","data-open":h,inert:!h,"aria-hidden":!h,children:r.jsx("div",{children:c})})]})}function dC(){const n=fg(),[l,a]=M.useState("");return r.jsxs("div",{className:`wgts ${is.theme}`,children:[r.jsx("aside",{className:"side","aria-label":"Navigation",children:r.jsxs("div",{className:"side-brand",children:[r.jsx("span",{className:"side-badge","aria-hidden":!0,children:r.jsx(Vu,{size:17,strokeWidth:2})}),r.jsx("span",{className:"side-text side-title",children:"WGTS Reports"}),r.jsx("button",{type:"button",className:"side-search-icon","aria-label":"Browse projects and patients",title:"Browse projects and patients",onClick:Ar,children:r.jsx(_u,{size:17,"aria-hidden":!0})})]})}),r.jsxs("div",{className:"page",children:[r.jsx(nS,{}),r.jsxs("main",{className:"flex flex-col gap-4 px-8 pt-8 pb-10",children:[r.jsx("h1",{className:"m-0 text-[28px] font-semibold tracking-tight",children:"Open a patient"}),r.jsx("p",{className:"m-0 max-w-[60ch] text-[14.5px]",style:{color:"var(--ink-2)"},children:"Browse the projects that have a dashboard and pick a patient, or enter an individual's system id to see its WGTS report as live charts and tables."}),r.jsx("div",{children:r.jsxs("button",{type:"button",className:"sc-btn sc-b1 gap-2",onClick:Ar,children:[r.jsx(zN,{size:16,"aria-hidden":!0}),"Browse projects and patients"]})}),r.jsxs("form",{className:"flex flex-wrap gap-2",onSubmit:o=>{o.preventDefault(),l.trim()&&n(`/${l.trim()}`)},children:[r.jsxs("div",{className:"field w-[340px] max-w-full",children:[r.jsx(_u,{size:16,"aria-hidden":!0,style:{color:"var(--chev)"}}),r.jsx("label",{className:"sr-only",htmlFor:"open-id",children:"Individual id"}),r.jsx("input",{id:"open-id",placeholder:"IID_H000001",value:l,onChange:o=>a(o.target.value)})]}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:!l.trim(),children:"Open"})]})]})]})]})}class Iu extends Error{}class sS extends Error{}function hC(){try{return localStorage.getItem(Lm)}catch{return null}}function lS(n){try{n?localStorage.setItem(Lm,n):localStorage.removeItem(Lm)}catch{}}function aS(){const n=hC();return{Accept:"application/json",...n?{Authorization:`Token ${n}`}:{}}}async function jn(n,l={}){const a=new URLSearchParams;for(const[d,h]of Object.entries(l))h&&a.set(d,h);const o=a.toString(),c=await fetch(`${is.apiHost}/wgts/api/${n}${o?`?${o}`:""}`,{headers:aS()});if(c.status===401)throw new Iu;if(c.status===403){const d=await c.json().catch(()=>({}));throw new sS(d.detail??"You may not see this patient's results.")}if(!c.ok)throw new Error(`The dashboard API answered ${c.status}.`);return await c.json()}async function mC(n){if(!(await fetch(`${is.apiHost}/api/v1/auth/`,{headers:{Accept:"application/json",Authorization:`Token ${n}`}})).ok)throw new Error("Isabl did not accept that token.");lS(n)}async function gC(n,l){const a=await fetch(`${is.apiHost}/api/v1/rest-auth/login/`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({username:n,password:l})});if(!a.ok)throw new Error("Isabl did not accept that username and password.");const o=await a.json();lS(o.key)}async function iS(n){const l=await fetch(`${is.apiHost}/wgts/api/${n}`,{headers:aS()});if(l.status===401)throw new Iu;if(!l.ok)throw new Error(`The dashboard API answered ${l.status}.`);return await l.json()}const pC=()=>iS("projects/"),yC=n=>iS(`projects/${n}/individuals/`);function Fm(n){const l=n.toUpperCase();return l.startsWith("BATTENBERG")||l.startsWith("CNV_")?"cn":l.startsWith("ANNOT_SNVS")||l.startsWith("ANNOT_INDELS")||l.startsWith("FFPERASE")?"mut":l.startsWith("MSISENSOR")?"msi":"other"}function ro(n){return`fam-${Fm(n)}`}function oS(n){return n.pk?`${n.app} #${n.pk}`:n.app}function Gt(n){return`${n.app}#${n.pk??""}`}const rS={drivers:"gene",coding:"position",all:"position"},vC=100;function gx(){return{scope:"drivers",sort:rS.drivers,q:"",effects:[],flags:[],range:null,ffpe:!1}}function cS(n){return(n.q.trim()?1:0)+n.effects.length+n.flags.length+(n.range?1:0)}function xC(n){const l={scope:n.scope,sort:n.sort,q:n.q.trim()||void 0,effects:n.effects.join(",")||void 0,flags:n.flags.join(",")||void 0,ffpe:n.ffpe?"all":void 0};return n.range&&(l[`${n.range.measure}_min`]=String(n.range.low),l[`${n.range.measure}_max`]=String(n.range.high)),l}const uS={missense:"Missense",truncating:"Truncating",splice:"Splice",inframe:"In-frame",synonymous:"Synonymous",other:"Other"},fS={hotspot:"Hotspot",in_dmp:"In DMP",oncogene:"Oncogene",tsg:"Tumour suppressor"};function SC(n){return`${n.chrom}:${n.pos}:${n.ref}>${n.alt}`}const dS=/^(?:chr)?([0-9]{1,2}|[XYxy]):([0-9,]+)(?:-([0-9,]+))?$/;function bC(n){return dS.test(n.trim())}function jC(n,l,a){return`chr${n}:${l.toLocaleString("en-US")}-${a.toLocaleString("en-US")}`}const wC={GENOMIC_EXACT:"exact match",GENOMIC_POS:"same position",CODON:"same codon",GENE:"same gene"};function NC(n){var d;if(!n)return null;const l=n.split(";"),a=(d=n.match(/SOM=(\d+)/))==null?void 0:d[1],o=wC[l[0]];return!a&&!o?n:[a?`${Number(a).toLocaleString("en-US")} somatic ${a==="1"?"sample":"samples"}`:"",o].filter(Boolean).join(", ")}function CC(n){const l=n==null?void 0:n.match(/^(\d+)\/(\d+)$/);return l?`${l[1]} of ${l[2]} ${l[2]==="1"?"copy":"copies"}`:n}function MC(n){return n.oncogene&&n.tsg?"Oncogene and TSG":n.oncogene?"Oncogene":n.tsg?"TSG":null}const Jt=(n,l)=>!(l instanceof Iu)&&n<2;function EC(n,l){return fn({queryKey:["individual",n,l??null],queryFn:()=>jn(`individuals/${encodeURIComponent(n)}/`,{version:l}),retry:Jt})}function TC(n,l,a){return fn({queryKey:["metrics",n,l,a??null],queryFn:()=>jn(`individuals/${encodeURIComponent(n)}/metrics/`,{sample:l,version:a}),enabled:!!l,retry:Jt})}function _C(n,l){return fn({queryKey:["fingerprint",n,l??null],queryFn:()=>jn(`individuals/${encodeURIComponent(n)}/fingerprint/`,{version:l}),retry:Jt})}const os=(n,l)=>`individuals/${encodeURIComponent(n)}/${l}/`;function RC(n,l,a){return fn({queryKey:["cn",n,l,a??null],queryFn:()=>jn(os(n,"cn"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function AC(n,l,a,o,c){return fn({queryKey:["ccf",n,l,a,o,c??null],queryFn:()=>jn(os(n,"ccf"),{sample:l,measure:a,version:c,ffpe:o?"all":void 0}),enabled:!!l,retry:Jt})}function OC(n,l,a){return fn({queryKey:["signatures",n,l,a??null],queryFn:()=>jn(os(n,"signatures"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function zC(n,l,a){return fn({queryKey:["context",n,l,a??null],queryFn:()=>jn(os(n,"context"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function DC(n,l,a){return fn({queryKey:["fga",n,l,a??null],queryFn:()=>jn(os(n,"fga"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function LC(n,l,a){return fn({queryKey:["tmb",n,l,a??null],queryFn:()=>jn(os(n,"tmb"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function $C(n,l,a){return fn({queryKey:["circos",n,l,a??null],queryFn:()=>jn(os(n,"circos"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function kC(n,l,a,o){return fn({queryKey:["cnsv",n,l,a,o??null],queryFn:()=>jn(os(n,"cnsv"),{sample:l,chrom:a,version:o}),enabled:!!l,placeholderData:lg,retry:Jt})}function HC(n,l,a,o){return fn({queryKey:["raw-cn",n,l,o??null],queryFn:()=>jn(os(n,"raw-cn"),{sample:l,version:o}),enabled:!!l&&a,retry:Jt})}function UC(n,l,a){return fn({queryKey:["svs",n,l,a??null],queryFn:()=>jn(os(n,"svs"),{sample:l,version:a}),enabled:!!l,retry:Jt})}function FC(n,l,a,o){return Cw({queryKey:["variants",n,l,a,o??null],queryFn:({pageParam:c})=>jn(os(n,"variants"),{sample:l,version:o,...xC(a),page:String(c),page_size:String(vC)}),initialPageParam:1,getNextPageParam:(c,d,h)=>c.status!=="ok"||!c.data?void 0:d.reduce((g,x)=>g+(x.status==="ok"&&x.data?x.data.rows.length:0),0)<c.data.total?h+1:void 0,enabled:!!l,placeholderData:lg,retry:Jt})}function VC(){return fn({queryKey:["picker","projects"],queryFn:pC,staleTime:6e4,retry:Jt})}function BC(n){return fn({queryKey:["picker","patients",n],queryFn:()=>yC(n),staleTime:6e4,placeholderData:lg,retry:Jt})}const Qi=6,GC=16,hS=7,Au=6;function Dh(n){const l=Math.min(hS,(n-Au)/2);return`M${Qi},${Au} V${n-l}`}function Lh(n){const l=Math.min(hS,(n-Au)/2);return`M${Qi},${n-l} Q${Qi},${n} ${Qi+l},${n} H${GC}`}function qC(n,l){return`M${Qi},${n} V${l}`}function IC(n,l,a,o){const[c,d]=M.useState(null),[h,m]=M.useState([]),[g,x]=M.useState(!1),[v,y]=M.useState(null),[S,j]=M.useState(280),b=n.map(R=>`${R.key}:${R.available}`).join();M.useLayoutEffect(()=>{if(!c)return;const R=()=>{const B=Array.from(c.querySelectorAll(a));m(n.flatMap((K,k)=>{const ie=B[k];if(!ie)return[];const oe=ie.offsetTop,se=ie.offsetHeight;return[{key:K.key,cy:oe+se/2,top:oe,height:se,available:K.available}]}))};if(R(),typeof ResizeObserver>"u")return;const A=new ResizeObserver(R);return A.observe(c),()=>A.disconnect()},[c,b,a,o]);const N=h.find(R=>R.key===l&&R.available),T=N?{top:N.top,height:N.height}:null;M.useEffect(()=>{if(!N||g)return;const R=requestAnimationFrame(()=>x(!0));return()=>cancelAnimationFrame(R)},[N,g]);const[O,_]=M.useState(l);M.useEffect(()=>{if(O===l)return;const R=O;_(l),R&&l&&y(A=>({from:R,to:l,n:((A==null?void 0:A.n)??0)+1}))},[l,O]);const D=v?h.find(R=>R.key===v.from):void 0,[C,E]=M.useState(null);return M.useLayoutEffect(()=>{if(N&&C!==null&&C!==N.cy){const R=Math.abs(N.cy-C)/38;j(Math.round(Math.min(620,240+80*R)))}E(N?N.cy:null)},[N==null?void 0:N.key,N==null?void 0:N.cy]),{setBox:d,tree:h,on:N,light:T,glides:g,hop:v,leaving:D,duration:S}}function QC({tree:n,on:l,light:a,glides:o,hop:c,leaving:d}){return r.jsxs(r.Fragment,{children:[n.length>0&&r.jsxs("svg",{className:"ltabs-links side-tree","aria-hidden":!0,children:[r.jsx("circle",{cx:Qi,cy:Au,r:"2.5",className:"side-root"}),r.jsx("path",{d:Dh(n[n.length-1].cy)}),n.map(h=>r.jsx("path",{d:Lh(h.cy),"data-off":h.available?void 0:"true"},h.key)),l&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":o,style:{d:`path("${Dh(l.cy)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":o,style:{d:`path("${Dh(l.cy)}")`}})]}),n.map(h=>r.jsxs("g",{className:"side-stub","data-active":h.key===(l==null?void 0:l.key)||void 0,children:[r.jsx("path",{className:"ltabs-haze",d:Lh(h.cy)}),r.jsx("path",{className:"ltabs-on",d:Lh(h.cy)})]},h.key)),l&&d&&c&&c.to===l.key&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:qC(d.cy,l.cy)},`bead-${c.n}`)]}),r.jsx("span",{className:"side-light","aria-hidden":!0,"data-on":a?"true":void 0,"data-glides":o||void 0,style:a?{transform:`translateY(${a.top}px)`,height:a.height}:void 0})]})}const $h=[{key:"overview",label:"Overview",icon:LN},{key:"copyNumber",label:"Copy number",icon:MN},{key:"mutations",label:"Mutations",icon:HN},{key:"structuralVariants",label:"Structural variants",icon:qN},{key:"circos",label:"Circos",icon:FN},{key:"cnsv",label:"CN/SV by chromosome",icon:I1},{key:"signatures",label:"Signatures and HRD",icon:_N},{key:"rna",label:"RNA",icon:YN,soon:!0},{key:"germline",label:"Germline",icon:GN,soon:!0},{key:"quality",label:"Quality",icon:AN,soon:!0}],px="wgts-side-collapsed";function YC(){const[n,l]=M.useState(()=>{try{return localStorage.getItem(px)==="1"}catch{return!1}});return[n,o=>{l(o);try{localStorage.setItem(px,o?"1":"0")}catch{}}]}function PC({analyses:n,onPage:l,sampleLabel:a,picked:o,onPick:c,sections:d,activeStore:h,onSection:m}){const g=qu(h),[x,v]=YC(),{setBox:y,...S}=IC($h.map(({key:A})=>({key:A,available:d.has(A)})),g,".sc-nav",x),[j,b]=M.useState(!1),[N,T]=M.useState(!1),O=["cn","mut","msi","other"],_=(A,B)=>O.indexOf(Fm(A.app))-O.indexOf(Fm(B.app))||A.app.localeCompare(B.app),D=N||o!==null;M.useEffect(()=>{const A=B=>{B.key.toLowerCase()==="k"&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),Ar())};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[]);const C=n.filter(A=>A.role==="input"),E=C.filter(A=>l.has(Gt(A))).sort(_),R=[...C.filter(A=>!l.has(Gt(A))).sort(_),...n.filter(A=>A.role==="cohort")];return r.jsxs("aside",{className:"side","aria-label":"Patient navigation","data-collapsed":x||void 0,children:[r.jsxs("div",{className:"side-brand",children:[r.jsx("span",{className:"side-badge","aria-hidden":!0,children:r.jsx(Vu,{size:17,strokeWidth:2})}),r.jsx("span",{className:"side-text side-title",children:"WGTS Reports"}),r.jsx("button",{type:"button",className:"side-search-icon","aria-label":"Browse projects and patients",title:"Browse projects and patients (Ctrl or ⌘ K)",onClick:Ar,children:r.jsx(_u,{size:17,"aria-hidden":!0})}),r.jsx("button",{type:"button",className:"side-toggle","aria-label":x?"Expand the menu":"Collapse the menu","aria-expanded":!x,title:x?"Expand the menu":"Collapse the menu",onClick:()=>v(!x),children:x?r.jsx(BN,{size:17,"aria-hidden":!0}):r.jsx(VN,{size:17,"aria-hidden":!0})})]}),r.jsxs("nav",{ref:y,"aria-label":"Patient sections",className:"side-nav",style:{"--duration":`${S.duration}ms`},children:[r.jsx(QC,{...S}),$h.map(({key:A,label:B,icon:K,soon:k},ie)=>{const oe=d.has(A);return r.jsxs("div",{className:"contents",children:[k&&!$h[ie-1].soon&&r.jsx("span",{className:"side-group",children:"Coming soon"}),r.jsxs("button",{type:"button",className:"sc-nav","aria-current":oe&&g===A?"location":void 0,"aria-label":B,disabled:!oe,title:x?B:oe?void 0:"Not available for this sample yet",onClick:()=>m(A),children:[r.jsx(K,{size:17,strokeWidth:1.7,"aria-hidden":!0}),r.jsx("span",{className:"side-text",children:B})]})]},A)})]}),r.jsx("div",{className:"flex-auto"}),r.jsxs("section",{"aria-label":"Analyses on this page",className:"side-sources",children:[r.jsxs("button",{type:"button",className:"side-fold","aria-expanded":D,onClick:()=>T(A=>!A),children:["Analyses on this page",r.jsx("span",{className:"side-count",children:E.length}),r.jsx(Y1,{size:14,"aria-hidden":!0,"data-open":D})]}),D&&E.length===0&&r.jsxs("span",{className:"px-3 text-xs",style:{color:"var(--menu-muted)"},children:["Nothing on this page reads an analysis for ",a||"this sample","."]}),D&&E.map(A=>{const B=Gt(A),K=A.state==="failed",k=A.modules.filter(ie=>ie.status==="failed");return r.jsxs("button",{type:"button",className:`tb-src${K?" fail":""}`,"aria-pressed":o===B,title:K?k.map(ie=>`${ie.label} failed`).join("; "):"Show what it feeds",onClick:()=>c(o===B?null:B),children:[K?r.jsx(K1,{size:12,strokeWidth:2.6,"aria-hidden":!0,style:{color:"var(--fail-d)",margin:"0 -2px"}}):r.jsx("span",{className:`tb-dot ${ro(A.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"truncate",children:[A.app," ",A.version??""]}),K&&r.jsx("span",{className:"sr-only",children:", failed"}),r.jsx("span",{className:"tb-n",children:A.pk?`#${A.pk}`:""})]},B)}),D&&R.length>0&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"tb-src","aria-expanded":j,onClick:()=>b(A=>!A),children:[r.jsx("span",{className:"tb-dot fam-other","aria-hidden":!0}),j?"Hide":"Show"," ",R.length," more for ",a||"this sample"]}),j&&R.map(A=>r.jsxs("span",{className:"tb-src",style:{cursor:"default"},children:[r.jsx("span",{className:`tb-dot ${ro(A.app)}`,"aria-hidden":!0}),r.jsx("span",{className:"truncate",children:A.role==="cohort"?`${A.app}${A.project?`, project ${A.project}`:""}`:`${A.app} ${A.version??""}`}),r.jsx("span",{className:"tb-n",children:A.pk?`#${A.pk}`:""})]},Gt(A)))]}),D&&r.jsx("span",{className:"px-3 pt-2 text-xs leading-normal",style:{color:"var(--menu-muted)"},children:"Pick one to see what it feeds."})]})]})}function ba({envelope:n}){const l=n.status==="error",a=l?RN:ON;return r.jsxs("div",{className:"flex items-start gap-2.5 text-sm",style:{color:"var(--ink-2)"},children:[r.jsx(a,{size:18,"aria-hidden":!0,style:{color:l?"var(--warn-ink)":"var(--chev)",flex:"none"}}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("span",{className:"font-semibold",style:{color:"var(--ink)"},children:l?"This panel could not be read":"Nothing to show here"}),n.warnings.map(o=>r.jsx("span",{children:o},o))]})]})}const Vm={summary:{title:"Genome fingerprint and summary",intro:"A one-glance portrait of the selected tumour: its copy-number changes and driver mutations drawn as a ring, a sentence describing them, and the headline measurements of the sample.",sections:[{heading:"The fingerprint ring",paragraphs:["The ring is the whole genome. Chromosome 1 starts at the top and the ring runs clockwise through chromosome 22 to X, each chromosome's arc in proportion to its length (GRCh37).","Copy-number changes are called against the tumour's baseline, its ploidy rounded to whole copies. Very short changes are drawn at a minimum length so they stay visible."],terms:[["Gains (outer track, orange)","Regions with at least one copy more than the baseline."],["Amplifications (outer track, darker and thicker)","Regions with three or more copies above the baseline."],["Losses (inner track, blue)","Regions with at least one copy fewer than the baseline."],["Drivers (black ticks)","Where the tumour's likely driver mutations sit (see the Mutations card for how they are flagged)."]]},{heading:"The sentence",paragraphs:["Written from the same data as the ring: how many amplifications, gains and losses there are and on which chromosomes, and which genes carry driver mutations."]},{heading:"The measurements",paragraphs:["Each tile shows a value, a small picture of where it sits on its scale when it has a natural one, and the analysis it came from. A tile with no value says why: the analysis was not run, it failed, or it does not apply to this kind of report (tumour-only reports have no matched normal)."],terms:[["Purity","The estimated fraction of cells in the sample that are tumour cells, from 0 to 1. The ring fills to the value."],["Ploidy","The tumour's average number of copies across the genome. The scale runs from 1 to 6 copies; the tall tick marks 2, a diploid genome."],["Coverage","The median sequencing depth of the tumour across the genome, in reads (×)."],["TMB per Mb","Tumour mutational burden: somatic SNVs and indels per megabase of genome. The report computes it from the counts of the SNV and indel calls. The scale is logarithmic, 0.01 to 100."],["MSI score","The MSIsensor score: the percentage of microsatellite sites that look unstable in the tumour."],["FGA","Fraction of the genome altered: the share of the genome whose copy number differs from the baseline, from 0 to 1. It is read from the project-wide Battenberg tables."]]},{heading:"Linking back to the analyses",paragraphs:[`Every value names its analysis, with version and Isabl id. Picking an analysis in the side menu's "Analyses on this page" highlights the tiles and cards it feeds.`]}]},copyNumber:{title:"Copy number",intro:"How many copies of each part of the genome the tumour carries, segment by segment, from chromosome 1 to X.",sections:[{heading:"What is drawn",paragraphs:['Each horizontal stroke is one segment: a stretch of the genome with a constant copy number. Its height is the number of copies, from 0 up to 8; anything higher is drawn at the top and the axis reads "8+". A gain or amplification rises as a column from the baseline to its stroke, and a loss falls to it, so the changes read as a landscape. Alternating grey bands mark the chromosomes, named in a strip along the bottom.',`The line across the plot is the baseline: the tumour's ploidy rounded to whole copies (labelled, for example, "2 copies"). Segments are coloured by how they compare with it.`],terms:[["Grey","Neutral: the same number of copies as the baseline."],["Orange","Gain: at least one copy more than the baseline."],["Dark orange","Amplification: three or more copies above the baseline."],["Blue","Loss: at least one copy fewer than the baseline."]]},{heading:"Total or allele-specific",paragraphs:["Total shows all copies together. Allele-specific, when the analysis provides it, splits each segment into its major allele (the more common parental copy, dark) and minor allele (light). Where the two are equal they are drawn slightly apart so both stay visible. A minor allele of 0 means one parent's copy is lost there (loss of heterozygosity)."]},{heading:"Driver genes",paragraphs:["A label along the top names each gene with likely driver mutations, one per gene, joined by a line to a dot on the segment the gene sits on, so its copy number can be read off at once. Hover one for its protein changes and the copies there."]},{heading:"Amplified and lost genes",paragraphs:["The oncogenes the report calls amplified and the tumour suppressors it calls homozygously lost, from the copy number over each gene, in chromosome order. The row of cells shows the copy number (all eight filled means eight copies or more). When the sample has RNA, each gene also shows its expression against each expression cohort: the log2 of this sample's level over the cohort's mean, so +1 is twice the cohort's level. Point at a gene to mark it on the plot; click it to glide to its chromosome."]},{heading:"Fraction of genome altered against the cohort",paragraphs:["The tumour's FGA (the share of the genome whose copy number differs from the baseline) set against every tumour in the project's FGA table, by disease, as the report draws it: only diseases with at least five tumours, plus this tumour's own, highest median first, with some disease labels merged (OSOS and CHOS as OS, MFH as US, LIHB as HBL). Each box spans the middle half of a disease's tumours, the line in it is the median, the whiskers reach the furthest tumours within one and a half box-lengths, and each dot is one tumour. The pin is this tumour; hover a disease for its numbers and, in the tumour's own disease, where it ranks.","The cohort is the one the report compared with when it ran. It does not grow as the project does; rerun the report to compare with the cohort as it is now."]},{heading:"Reading and moving around",terms:[["Hover a segment","Its call, copies (major + minor), coordinates and, when available, log2 ratio. A readout at the foot of the plot gives the pointer's place on the genome."],["Click a segment","Lists the mutations inside it in the Mutations card."],["Click a driver","Finds that gene in the Mutations card."],["Scroll up or down over the plot","Zooms around the pointer: up zooms in, down zooms out (two fingers on a trackpad, or a mouse wheel). A pinch zooms too. A scroll that starts outside the plot keeps scrolling the page, and once the whole genome is in view, scrolling down scrolls the page again."],["Scroll sideways, or drag","Pans a zoomed view (two fingers sideways on a trackpad, or Shift and a mouse wheel)."],["Arrow keys, plus and minus, 0","With the plot focused: pan, zoom in and out, and show the whole genome."],["Double-click a chromosome, or click its name","Glides to fill the view with it; the strip then counts megabases."],["The overview","The whole genome in miniature under the strip. Its window shows where the plot is: drag the window to move, its ends to resize, or click elsewhere to centre it there. The button by the title returns to the whole genome."],["Hover a mutation in the table","Marks it here, with a ring on the segment it sits on and its copy number."]]},{heading:"Tumour-only reports",paragraphs:["Without a matched normal there is no ploidy estimate, so segments come from CNVkit and are called against two copies. Allele-specific copy numbers are not available."]}]},mutations:{title:"Mutations",intro:"The tumour's somatic SNVs and indels that passed the callers' filters: how they are distributed across cancer cells, and a searchable, filterable table of every call.",sections:[{heading:"Which mutations",terms:[["Drivers","Likely drivers flagged by the report: coding mutations that match OncoKB or COSMIC driver annotations (the exact protein change, or a damaging consequence in a known cancer gene), plus known hotspots the callers missed and the report recovered from the tumour's reads."],["Coding","Mutations whose effect changes a protein, by the report's list of coding effects."],["All","Every PASS SNV and indel."]],paragraphs:["The counts beside each choice follow the search and filters, so they always say what you would see."]},{heading:"FFPE samples",paragraphs:["Formalin-fixed (FFPE) tissue damages DNA in ways that look like mutations, mostly C>T changes at low allele fractions. For an FFPE sample, FFPERASE scores each SNV and indel for how likely it is to be such an artifact, and the report counts only the calls scored at or below its threshold (quoted beside the table). Its SNV, indel and coding totals and the TMB leave the rest out.",`The report marks each call it leaves out, and the dashboard follows that mark: the Coding and All counts, the table and the curve leave those calls out, and the card's subtitle says so. Drivers are all listed, as in the report, and any the filter would remove carry an "FFPE filtered" tag. "Show filtered calls", under FFPE filter beside the table, brings the removed calls back, tagged the same way.`]},{heading:"Cancer cell fraction and variant allele fraction",paragraphs:["The curve across the top is a smoothed histogram of every PASS mutation; driver mutations sit on it as labelled dots, and the diamond on the axis is the median. Switch between the two measures:"],terms:[["CCF",'Cancer cell fraction: the estimated share of cancer cells carrying the mutation, corrected for purity and copy number. Around 1 (the "clonal" mark) means nearly every cancer cell has it, which suggests it arose early; clearly below 1 means a subclone. Estimates can land somewhat above 1. Shown from 0 to 2.'],["VAF","Variant allele fraction: the share of sequencing reads at the position that carry the mutation, from 0 to 1. Raw, not corrected for purity or copy number. Tumour-only reports open on VAF, since CCF needs a matched normal."]]},{heading:"Filtering by the curve",paragraphs:["Drag across the curve to keep only mutations in that CCF or VAF range: the curve stays lit inside the range and fades outside it, and the range is read out at its foot. Drag the edges to resize it, or its body to move it. The range appears with the other filters and can be removed there, or by clicking the curve."]},{heading:"Coding mutations against reference cohorts",paragraphs:["At the foot of the card, the tumour's coding SNVs and indels set against reference tumours of the same disease, as the report's TMB figure draws them: Grobner and colleagues' published pan-cancer cohort, where the disease has a match there, and MSK's TMB reference project. Each cohort is a violin cut at its smallest and largest tumour; two cohorts share one violin, one on each side. The bar inside marks the middle half and the circle the median. The line across is this tumour; hover a cohort for its numbers and where the tumour ranks.","Counts are coding mutations as the report counts them (after the FFPE filter for FFPE samples), the same numbers as the Coding tab. The MSK cohort leaves out tumours far above its 99th percentile, as the report does. The cohorts are the ones the report compared with when it ran; rerun the report to compare with them as they are now."]},{heading:"The table",terms:[["Gene and position","The gene, and the mutation's chromosome and position (GRCh37)."],["Change","The protein change, with the cDNA change beneath."],["Effect","What the mutation does to the gene, from the VEP consequence (or the report's effect). Truncating effects are in bold."],["VAF and CCF bars","The value with a bar for quick comparison; the CCF bar's tick marks 1, clonal."],["Driver","Flagged as a likely driver (shown when the table is not already limited to drivers)."],["Hotspot","The exact protein change is a known recurrent cancer hotspot."],["In DMP","The same mutation was also found by the patient's clinical MSK-IMPACT (DMP) sequencing."],["FFPE filtered","FFPE samples only: the report's FFPE artifact filter leaves this call out of its counts (see FFPE samples)."]]},{heading:"Opening a row",terms:[["Variant","SNV or indel, with the reference and alternate bases."],["Reads","Reads supporting the mutation out of all reads at the position. Only hotspots the report recovered from the tumour's reads have them; the callers' tables give no single count."],["Normal VAF","The mutation's allele fraction in the matched normal; near 0 for a somatic mutation."],["Mutant copies","How many copies of that part of the genome carry the mutation, out of all copies there."],["Consequence","The full VEP consequence."],["COSMIC","How many samples in COSMIC carry it, and how closely they match (exact change, same position, codon or gene)."],["Expression","The gene's expression in the tumour's RNA, in transcripts per million, when RNA was sequenced."],["Gene role","Whether the gene is a known oncogene or tumour suppressor gene (TSG)."],["Show on copy number","Zooms the Copy number card to the mutation's chromosome and marks it."]]},{heading:"Searching and filtering",paragraphs:["Search takes a gene, a protein or cDNA change, a COSMIC term, or a locus such as chr12:25,398,284 or a range such as chr8:1-50,000,000. Press / anywhere on the page to jump to it. Each filter's count is how many rows you would get by ticking it, given everything else."],terms:[["Missense","One amino acid replaced by another."],["Truncating","Stop gained or lost, start lost, or a frameshift."],["Splice","Changes a splice site or splice region."],["In-frame","Inserts or deletes amino acids without shifting the reading frame."],["Synonymous","Changes the DNA but not the amino acid."],["Other","Everything else, such as intronic, UTR or upstream changes."]]}]},structuralVariants:{title:"Structural variants",intro:"The tumour's rearrangements as the report shows them: those with a breakpoint in an oncogene or tumour suppressor, those that take in a whole gene, and how all of them group into rearrangement signatures.",sections:[{heading:"Which rearrangements",paragraphs:["The report works from the high-confidence structural variants of ANNOT_SVS, which keeps calls made by two or more callers (SvABA, BRASS and GRIDSS) and annotates the genes they touch with AnnotSV. The count beside the title is how many of these the report counts, its rearrangements total.",`The tables keep the rearrangements whose genes include an oncogene or tumour suppressor, by the report's gene lists. It also searches the callers' raw calls for known rearrangements the high-confidence set can miss, such as CIC fusions, and adds them; a rescued event that is not a two-caller PASS says so in its callers, as in "gridss (CIC rescued)".`]},{heading:"The two tables",terms:[["Rearranged oncogenes and tumour suppressors",'One row per rearrangement and gene it hits, with the gene and breakpoint on each side. A gene near a breakpoint rather than in it is named as the report names it, such as "TERT +/- 100Kb".'],["Whole-gene rearrangements","Rearrangements that take in a whole oncogene or tumour suppressor, from start to end: a deletion of the whole gene, for example."],["Role","Whether the row's genes include an oncogene, a tumour suppressor or both, as the report colours its rows. Click a role above the tables to show only its rows."],["Left and right","Each breakpoint's gene, position (GRCh37) and where it falls in the gene, as AnnotSV writes it (intron5, exon2-exon5). Breakpoints are ordered by chromosome, then position."],["Callers and support","The callers that made the call, and the most reads any of them gives in support."],["Pileups","Supporting reads over all reads at each breakpoint in the tumour's alignments, left then right."],["Expression","For tumours with RNA: whether each gene's expression is high or low against each expression cohort (p63 is cohort project 63): at or above its 90th percentile, at or below its 10th, or neither (None). N/A means the cohort has no value for the gene."]],paragraphs:["Open a row to see both breakpoints, show them on the copy-number card, or copy their IGV loci."]},{heading:"Rearrangement signatures",paragraphs:["WGSPOST groups the tumour's rearrangements the way rearrangement signatures are described: clustered (rearrangements that sit unusually close together, as in chromothripsis) or dispersed, then by class and, except for translocations, by size from under 1 kb to over 1 Mb. Each bar is how many rearrangements fall in a group, grouped under its class; lighter bars are the clustered ones, in the shaded zone. A group with none shows a short stub on the baseline. Hover a bar for its name and its share of all rearrangements, or a class in the key to light its bars.","WGSPOST counts from its own copy of the calls, so its total can differ slightly from the report's rearrangements count."],terms:[["Deletion","A stretch of the genome lost between two breakpoints."],["Tandem duplication","A stretch copied next to itself."],["Inversion","A stretch turned around in place."],["Translocation","A join between two chromosomes."]]}]},circos:{title:"Integrated circos",intro:"The tumour's whole genome on one circle, as WGSPOST's integrated circos draws it: every SNV, indel, copy-number change and rearrangement, from the outside in, with the counts beside it.",sections:[{heading:"The rings, from the outside in",terms:[["Drivers","Genes with likely driver mutations, outside the circle, as the Mutations card flags them."],["Chromosomes","1 to 22 and X, clockwise from the top, each in proportion to its length (GRCh37). Y is left out, as in WGSPOST's figure."],["SNV rainfall","One dot per SNV the report counts, coloured by its substitution (in the pyrimidine context). Its distance from the centre is the distance to the SNV before it on the chromosome, on a log scale: the rings mark 100 bp, 10 kb and 1 Mb. Mutations far apart sit near the outside; clusters, such as kataegis, fall inwards."],["Insertions and deletions","Two thin rings of ticks: insertions, then deletions, coloured by the mechanism WGSPOST's microhomology and repeat callers assign (complex indels are grey)."],["Copy number","Gains of the major allele, darker for more copies (2 to 3, 4 to 7, 8 or more), then loss of heterozygosity, where the minor allele has no copies. From Battenberg (CNVkit for tumour-only reports)."],["Rearrangements","Links across the middle, coloured by class as in the Structural variants card: deletions, tandem duplications, inversions and translocations."]]},{heading:"Reading it",paragraphs:["Click a chromosome to open it out to a large share of the circle, with its megabases counted inside the ring; click it again to close it. Hover a dot, a tick or a link for its details, and a chromosome for its counts. Hover a bar beside the circle to light its calls on it: a substitution, an indel kind or a rearrangement class. The buttons above the circle hide and show each track.","The circle is drawn from the same calls as the rest of the report (WGSPOST builds its figure from them too), so its counts match the Mutations and Structural variants cards. The indel kinds are WGSPOST's own classification of its indels."]}]},cnsv:{title:"Copy number and rearrangements by chromosome",intro:"One chromosome at a time, the evidence behind the copy-number calls set against the rearrangements, as WGSPOST's CN/SV integration figures show it; and Battenberg's raw data for the tumour and its normal.",sections:[{heading:"The CN/SV view, from the top",terms:[["BAF","The B-allele frequency of each heterozygous SNP in the tumour, after Battenberg's phasing (its corrected phased BAF). Balanced copies sit at 0.5; a gain or a loss pulls the SNPs of a segment away from it."],["Segments","Battenberg's copy-number segments, drawn at their BAF and labelled with their allele copies and the share of cells that carry them (“2+1: 64%” means two copies of one allele and one of the other, in 64% of cells). Green when every cell carries the state; red when it is subclonal, with the second state below."],["Rearrangements","Arcs join the two ends of a rearrangement within the chromosome: deletions and tandem duplications on the upper lane, inversions on the lower, coloured by class as in the Structural variants card. An arrow marks an end whose partner is on another chromosome, labelled with that chromosome. Faint lines drop from each end to the copy number below it, where a breakpoint often meets a step."],["Copy number","BRASS's read-depth copy number, averaged in 100 kb windows as the report's figure does, over alternating whole-copy bands. The dashed line is Battenberg's total copy number for the same stretch, green or red as its segment."]]},{heading:"Battenberg raw",paragraphs:["Battenberg's input data, as its Tumor and Germline figures show it: the LogR (read depth against the normal, on a log scale) and BAF of the tumour, then of the normal, at SNP loci across the chromosome or the whole genome. Homozygous loci sit at 0 and 1 in the BAF; the normal's heterozygous SNPs gather at 0.5."]},{heading:"Reading it",paragraphs:["Pick a chromosome above the plot; chromosomes with data stand out. Scroll up or down over the plot to zoom around the pointer (up zooms in), sideways or drag to pan, double-click to zoom in, and click a rearrangement to fit it in view; the arrow keys, plus, minus and 0 work too. Hover anywhere for the segment, its state and the read depth at that point, or a rearrangement for its ends.","Points are thinned to evenly spaced SNPs, at most 10,000 per chromosome (1,500 across the genome), so the shape of the data is kept while the page stays fast. The report shows the same figures as images, so there is nothing here to compare against it number by number."]}]},signaturesHrd:{title:"Signatures and HRD",intro:"Which mutational processes left their mark on the tumour, set against tumours of the same disease, and whether it shows homologous recombination deficiency (HRD), as the report shows them.",sections:[{heading:"Mutational signatures",paragraphs:["WGSPOST fits known COSMIC substitution signatures to the tumour's somatic SNVs and estimates how many mutations each one accounts for. The left column is this tumour: each band is a signature's share of its mutations, the largest first.","The right column is the average of tumours of the same disease in the cohort (n is how many), each tumour's shares averaged and scaled to the cohort's average mutation count. A ribbon joins each signature's two bands, widening or narrowing with its share, so a signature can be followed from the tumour to its cohort; a label on the ribbon says how many percentage points the tumour leads or trails the cohort by, where the difference is at least 5. Hover a band, a ribbon or a row of the table for the numbers.","Seven signatures get colours of their own (eight when there are no more than eight); any beyond that are drawn together as Other. A tumour without a cohort to compare shows its own shares as one column."],terms:[["Signature","A pattern of substitutions, by the base change and its neighbours, that a mutational process leaves (SBS1, SBS5)."],["Aetiology","The process the report links a signature to, when it names one."]]},{heading:"96 mutational contexts",paragraphs:["Every substitution is one of six kinds (C>A, C>G, C>T, T>A, T>C, T>G, naming the pyrimidine base of the pair) and sits between two neighbouring bases, which gives 96 contexts. The top panel counts the tumour's SNVs in each, as WGSPOST's MutationalPatterns step does. The middle panel is what the fitted signatures rebuild: each signature's probabilities for the 96 contexts, weighted by its contribution above and added up. The bottom panel is the first minus the second, so a bar above the line is a context with more SNVs than the signatures explain.","Share draws each profile as percentages of its own total, which is how the report's figure compares the two; Count draws SNVs. Both profiles share one scale, and the difference its own. Click a class in the header to open it and name its sixteen contexts, written as the base before, the mutated base in colour, and the base after. Hover a column to read all three panels at once.","Cosine similarity and RSS are the report's own measures of the fit: the closer to 1 (cosine) and to 0 (RSS), the better the signatures explain the tumour. They are computed by the report from the relative profiles, as MutationalPatterns does. For an FFPE sample, switch between the run the report uses (its FFPE-filtered calls) and the unfiltered one. When the report did not include the signature matrix its fit used, only the observed profile is drawn."]},{heading:"HRD scores",paragraphs:["Two classifiers estimate whether the tumour has lost homologous recombination repair, as BRCA1 or BRCA2 loss does: HRDetect, from the substitution, indel and rearrangement patterns below, and CHORD, from its own set of mutation features. The report rates each HIGH at or above its threshold and LOW below it; the line on each gauge is the threshold."]},{heading:"HRDetect features",paragraphs:["The six features HRDetect weighs, for every tumour in the cohort and this one, each scaled from 0 (the cohort's lowest) to 1 (its highest). Each row is one feature: the pin is this tumour, the dots beneath are the cohort's samples, the shaded band is the middle half of the cohort and the line in it the median. With eight or more cohort samples a smoothed outline of how the samples are spread is drawn above the dots; with fewer it is left out, because it would suggest more than the data says. The words at the right say how many of the other cohort samples the tumour is above. Hover a row for the unscaled value. For FFPE samples the tumour's values come from its FFPE-filtered analysis."],terms:[["Del. MH","The share of deletions with microhomology at their ends, a sign of repair by end joining."],["SBS3 and SBS8","Substitution signatures 3 and 8."],["RS3 and RS5","Rearrangement signatures 3 (small tandem duplications) and 5 (deletions)."],["HRD index","Loss of heterozygosity, telomeric allelic imbalance and large-scale state transitions, combined."]]}]}},XC={summary:{BATTENBERG:"Tumour purity and ploidy, and the copy-number segments the ring's gains and losses are called from.","BATTENBERG cohort":"Project-wide Battenberg tables, which hold the FGA value and the cohort it is compared with.",CNV_UNMATCHED:"Copy-number segments of a tumour-only report (CNVkit), which the ring's gains and losses are called from.",MOSDEPTH:"The median sequencing coverage.",MSISENSOR:"The MSI score.",MSISENSOR_UNMATCHED:"The MSI score of a tumour-only report.",ANNOT_SNVS:"Somatic SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS:"Somatic indel calls: their count goes into TMB, and driver indels are marked on the ring.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls: their count goes into TMB, and driver indels are marked on the ring.",WGSPOST:"Cancer cell fractions of the mutations, read together with the driver calls marked on the ring."},copyNumber:{BATTENBERG:"Every segment drawn: total copies, major and minor allele copies, and the ploidy the baseline is rounded from.","BATTENBERG cohort":"Project-wide Battenberg tables of FGA: the tumour's own FGA, and the cohort the FGA figure compares it with, as it was when the report ran.",CNV_UNMATCHED:"The segments of a tumour-only report (CNVkit), drawn against two copies."},mutations:{ANNOT_SNVS:"The tumour's PASS somatic SNVs and their annotation: gene, protein and cDNA change, effect, VAF, read counts, normal VAF and COSMIC.","ANNOT_SNVS cohort":"The TMB reference project's coding SNVs: MSK's reference tumours for the disease, counted for the TMB figure, as they were when the report ran.","ANNOT_INDELS cohort":"The TMB reference project's coding indels, counted for the TMB figure like its SNVs.",ANNOT_INDELS:"The tumour's PASS somatic indels and their annotation, as for SNVs.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls and their annotation.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls and their annotation.",WGSPOST:"Each mutation's cancer cell fraction (CCF) and how many copies carry it.",BATTENBERG:"Ploidy, which fills in the copy count where WGSPOST has none, and purity, which gives a CCF to hotspots recovered from the tumour's reads.",FFPERASE_SNVS:"FFPE samples: each SNV's artifact score. Calls scoring above the report's threshold are left out of the counts.",FFPERASE_INDELS:"FFPE samples: each indel's artifact score. Calls scoring above the report's threshold are left out of the counts."},structuralVariants:{ANNOT_SVS:"The high-confidence structural variants and their AnnotSV gene annotation: the rearrangements the report counts and the rows of its tables.",ANNOT_SVS_UNMATCHED:"Tumour-only structural variants and their annotation, kept when rare in the population.",SVABA:"Raw SvABA calls, searched for known rearrangements the high-confidence set missed (rescued events).",GRIDSS:"Raw GRIDSS calls, searched for rescued events like SvABA's.",SVABA_UNMATCHED:"Raw tumour-only SvABA calls, searched for rescued events.",GRIDSS_UNMATCHED:"Raw tumour-only GRIDSS calls, searched for rescued events.",WGSPOST:"The rearrangement-signature counts.",WGSPOST_UNMATCHED:"The rearrangement-signature counts of a tumour-only report."},circos:{ANNOT_SNVS:"The SNVs of the rainfall, with their positions and substitutions.",ANNOT_SNVS_UNMATCHED:"The tumour-only SNVs of the rainfall.",WGSPOST:"The indel classification behind the indel rings (microhomology, repeat or other), and the signature contributions beside the circle.",WGSPOST_UNMATCHED:"The indel classification of a tumour-only report.",BATTENBERG:"The copy-number rings: major and minor allele copies of each segment, and the purity and ploidy beside the circle.",CNV_UNMATCHED:"The copy number of a tumour-only report (CNVkit).",ANNOT_SVS:"The rearrangements drawn across the middle.",ANNOT_SVS_UNMATCHED:"The tumour-only rearrangements drawn across the middle."},cnsv:{BATTENBERG:"The BAF per SNP, the segments with their allele states, and the raw tumour and normal LogR and BAF.",BRASS:"The read-depth copy number in 100 kb windows.",ANNOT_SVS:"The rearrangements drawn as arcs and arrows."},signaturesHrd:{WGSPOST:"The tumour's signature contributions, its SNV counts in the 96 mutational contexts, its HRDetect and CHORD scores, and its HRDetect features.",WGSPOST_FFPE:"For an FFPE sample, the same from the FFPE-filtered calls.","WGSPOST cohort":"The cohort's signature contributions and HRDetect features, which the tumour is compared with."}};function KC(n,l){const a=l.role==="cohort"||l.app.endsWith("Project Application"),o=l.app.replace(/ Project Application$/,""),c=XC[n];return(a?c[`${o} cohort`]:c[o])??(a?"A project-wide run the report reads for comparison with the cohort.":"An analysis the report reads to build this card.")}function ZC({topic:n,lineage:l,subject:a,onClose:o}){const c=Vm[n],d=M.useId(),h=M.useRef(null),m=l.filter(C=>C.role!=="cohort"&&!C.app.endsWith("Project Application")),g=l.filter(C=>!m.includes(C)),x=M.useRef(o);x.current=o,M.useEffect(()=>{var B;const C=document.activeElement;(B=h.current)==null||B.focus();const E=document.documentElement,R=E.style.overflow;E.style.overflow="hidden";const A=K=>{K.key==="Escape"&&x.current()};return document.addEventListener("keydown",A),()=>{document.removeEventListener("keydown",A),E.style.overflow=R,C==null||C.focus()}},[]);const v=[...c.sections.map(C=>C.heading),"Sources"],y=v.map((C,E)=>`${d}-s${E}`),[S,j]=M.useState(0),b=M.useRef(null),N=M.useRef(!1),T=M.useRef(null),O=M.useRef(0);M.useEffect(()=>{const C=b.current;if(!C)return;const E=24,R=()=>{const K=C.getBoundingClientRect().top,k=Math.max(0,C.scrollHeight-C.clientHeight),ie=y.map(le=>{const $=document.getElementById(le);return $?$.getBoundingClientRect().top-K:1/0}),oe=Math.max(0,...ie.map(le=>Number.isFinite(le)?le+C.scrollTop-k-E:0)),se=E+(k>0?oe*Math.min(1,C.scrollTop/k):0);let P=0;ie.forEach((le,$)=>{le<=se&&(P=$)}),j(P)},A=()=>{if(N.current){T.current===null?(window.clearTimeout(O.current),O.current=window.setTimeout(()=>T.current=C.scrollTop,160)):Math.abs(C.scrollTop-T.current)>4&&(N.current=!1,T.current=null,R());return}R()},B=()=>{N.current&&T.current===null&&(window.clearTimeout(O.current),N.current=!1,R())};return R(),C.addEventListener("scroll",A,{passive:!0}),C.addEventListener("wheel",B,{passive:!0}),C.addEventListener("touchstart",B,{passive:!0}),()=>{window.clearTimeout(O.current),C.removeEventListener("scroll",A),C.removeEventListener("wheel",B),C.removeEventListener("touchstart",B)}},[]);const _=C=>{var R;const E=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;N.current=!0,T.current=null,j(C),window.clearTimeout(O.current),O.current=window.setTimeout(()=>{var A;return T.current=((A=b.current)==null?void 0:A.scrollTop)??0},160),(R=document.getElementById(y[C]))==null||R.scrollIntoView({behavior:E?"auto":"smooth",block:"start"})},D=C=>r.jsxs("li",{className:"info-source",children:[r.jsx("span",{className:`tb-dot ${ro(C.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"info-source-text",children:[C.pk?r.jsxs("a",{className:"info-source-name info-source-link",href:B1(C.pk),target:"_blank",rel:"noopener noreferrer",title:"Open this analysis in Isabl",children:[r.jsxs("span",{className:"mono",children:[C.app,C.version?` ${C.version}`:""]}),r.jsxs("span",{className:"mono info-source-pk",children:["#",C.pk]}),r.jsx(EN,{size:13,"aria-hidden":!0,className:"info-source-arrow"})]}):r.jsxs("span",{className:"info-source-name",children:[r.jsxs("span",{className:"mono",children:[C.app,C.version?` ${C.version}`:""]}),C.project?r.jsxs("span",{className:"info-source-pk",children:["project ",C.project]}):null]}),r.jsx("span",{className:"info-source-role",children:KC(n,C)})]})]},Gt(C));return cg.createPortal(r.jsx("div",{className:`info-backdrop ${is.theme}`,onMouseDown:C=>C.target===C.currentTarget&&o(),children:r.jsxs("div",{className:"info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":d,children:[r.jsx("button",{ref:h,type:"button",className:"info-close","aria-label":"Close",onClick:o,children:r.jsx(Bu,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail","aria-label":"Contents",children:[r.jsx("span",{className:"info-kicker",children:a??"About"}),r.jsx("h2",{id:d,children:c.title}),r.jsx("ol",{children:v.map((C,E)=>r.jsx("li",{children:r.jsx("button",{type:"button","aria-current":E===S?"true":void 0,onClick:()=>_(E),children:C})},C))})]}),r.jsxs("div",{ref:b,className:"info-main",children:[r.jsx("p",{className:"info-intro",children:c.intro}),c.sections.map((C,E)=>{var R;return r.jsxs("section",{id:y[E],className:"info-section",children:[r.jsx("h3",{children:C.heading}),(R=C.paragraphs)==null?void 0:R.map(A=>r.jsx("p",{children:A},A)),C.terms&&r.jsx("dl",{children:C.terms.map(([A,B])=>r.jsxs("div",{children:[r.jsx("dt",{children:A}),r.jsx("dd",{children:B})]},A))})]},C.heading)}),r.jsxs("section",{id:y[y.length-1],className:"info-section","aria-label":"Sources",children:[r.jsx("h3",{children:"Sources"}),r.jsx("p",{children:"The analyses this card reads, with their version and Isabl id, and what each one is responsible for."}),l.length===0&&r.jsx("p",{children:"No analyses recorded for this card."}),r.jsx("ul",{className:"info-sources",children:m.map(D)}),g.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{children:"Cohort runs"}),r.jsx("ul",{className:"info-sources",children:g.map(D)})]})]})]})]})}),document.body)}function yx(n){return n.split(" ").map(l=>/^[A-Z0-9]{2,}$/.test(l)?l:l.toLowerCase()).join(" ")}function mS({topic:n,lineage:l,subject:a}){const[o,c]=M.useState(!1);return r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"sc-ib sm info-trigger","aria-label":`About ${yx(Vm[n].title)}`,title:`About ${yx(Vm[n].title)}`,"aria-haspopup":"dialog",onClick:()=>c(!0),children:r.jsx(DN,{size:15,"aria-hidden":!0})}),o&&r.jsx(ZC,{topic:n,lineage:l,subject:a,onClose:()=>c(!1)})]})}function JC({lineage:n,children:l}){const[a,o]=M.useState(!1),c=n.filter(h=>h.role!=="cohort"),d=n.filter(h=>h.role==="cohort");return r.jsxs("div",{className:"sc-cf",children:[l,l&&r.jsx("span",{className:"flex-auto"}),n.length>0&&r.jsx("span",{className:"text-xs",style:{color:"var(--muted)"},children:"Sources"}),c.map(h=>h.pk?r.jsxs("a",{className:"sc-src sc-src-link",href:B1(h.pk),target:"_blank",rel:"noopener noreferrer",title:"Open this analysis in Isabl",children:[r.jsx("span",{className:`tb-dot ${ro(h.app)}`,"aria-hidden":!0}),h.app," ",h.version??""," #",h.pk]},Gt(h)):r.jsxs("span",{className:"sc-src",children:[r.jsx("span",{className:`tb-dot ${ro(h.app)}`,"aria-hidden":!0}),h.app," ",h.version??""]},Gt(h))),d.length>0&&r.jsxs("button",{type:"button",className:"sc-src",style:{border:0,cursor:"pointer"},"aria-expanded":a,onClick:()=>o(h=>!h),children:[a?"Hide":"+"," ",d.length," cohort ",d.length===1?"run":"runs"]}),a&&d.map(h=>r.jsxs("span",{className:"sc-src",children:[r.jsx("span",{className:"tb-dot fam-other","aria-hidden":!0}),h.app,h.project?`, project ${h.project}`:""," ",h.pk?`#${h.pk}`:""]},Gt(h)))]})}function Qu(...n){const l=new Map;for(const a of n.flat())a&&!l.has(Gt(a))&&l.set(Gt(a),a);return[...l.values()]}const uo=M.forwardRef(function({title:l,subtitle:a,controls:o,lineage:c,picked:d,footer:h,className:m="",info:g,expandable:x,children:v},y){const S=!!d&&c.some(N=>Gt(N)===d),[j,b]=WC();return r.jsxs(r.Fragment,{children:[j&&r.jsx("div",{className:"sc-full-backdrop","aria-hidden":!0,onClick:()=>b(!1)}),r.jsxs("section",{ref:y,className:`sc-card flex flex-col ${m}`,"data-picked":S,"data-full":j||void 0,"aria-label":l,children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2.5 px-5 pt-5 pb-4",children:[r.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[r.jsx("h2",{className:"m-0 text-[19px] font-semibold tracking-tight",children:l}),a&&r.jsx("span",{className:"text-[13px]",style:{color:"var(--muted)"},children:a})]}),(o||g||x)&&r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o,x&&r.jsx("button",{type:"button",className:"sc-ib","aria-label":j?"Exit full screen":`Expand ${l.toLowerCase()} to full screen`,title:j?"Exit full screen (Esc)":"Expand to full screen","aria-pressed":j,onClick:()=>b(!j),children:j?r.jsx(UN,{size:16,"aria-hidden":!0}):r.jsx(kN,{size:16,"aria-hidden":!0})}),g&&r.jsx(mS,{topic:g,lineage:c,subject:typeof a=="string"?a:void 0})]})]}),r.jsx("div",{className:"min-w-0 flex-auto",children:v}),(c.length>0||h)&&r.jsx(JC,{lineage:c,children:h})]})]})});function WC(){const[n,l]=M.useState(!1);return M.useEffect(()=>{if(!n)return;const a=document.documentElement,o=a.style.overflow;a.style.overflow="hidden";const c=d=>{var h,m;d.key==="Escape"&&((m=(h=d.target)==null?void 0:h.closest)!=null&&m.call(h,"input, textarea, select")||document.querySelector(".info-backdrop")||l(!1))};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),a.style.overflow=o}},[n]),[n,l]}function Vl({label:n,envelope:l,loading:a,skeletonHeight:o=160,children:c}){return r.jsxs(r.Fragment,{children:[a&&!l&&r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:o},"aria-label":`Loading ${n}`})}),l&&l.status!=="ok"&&r.jsx("div",{className:"px-5 py-4",children:r.jsx(ba,{envelope:l})}),(l==null?void 0:l.status)==="ok"&&l.data!==null&&c(l.data),(l==null?void 0:l.status)==="ok"&&l.warnings.length>0&&r.jsx("div",{className:"px-5 pb-1 text-xs",style:{color:"var(--warn-ink)"},children:l.warnings.join(" ")})]})}function eM({title:n,subtitle:l,controls:a,envelope:o,loading:c,picked:d,skeletonHeight:h=160,footer:m,className:g="",info:x,moreLineage:v,children:y}){return r.jsx(uo,{title:n,subtitle:l,controls:a,lineage:Qu(o==null?void 0:o.lineage,v),picked:d,footer:m,className:g,info:x,children:r.jsx(Vl,{label:n,envelope:o,loading:c,skeletonHeight:h,children:y})})}function tM(n,l){const[a,o]=M.useState(null),[c,d]=M.useState(!1);return M.useLayoutEffect(()=>{const h=n.current;if(!h)return;const m=()=>{const x=h.querySelector('[aria-pressed="true"]');o(x?{x:x.offsetLeft,y:x.offsetTop,width:x.offsetWidth,height:x.offsetHeight}:null)};if(m(),typeof ResizeObserver>"u")return;const g=new ResizeObserver(m);g.observe(h);for(const x of Array.from(h.children))g.observe(x);return()=>g.disconnect()},[n,l]),M.useEffect(()=>{if(a&&!c){const h=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(h)}},[a,c]),{thumb:a,moving:c}}function Bl({label:n,options:l,value:a,onChange:o,className:c=""}){const d=M.useRef(null),{thumb:h,moving:m}=tM(d,a);return r.jsxs("div",{ref:d,className:`sc-track ${c}`,role:"group","aria-label":n,children:[h&&r.jsx("span",{className:"sc-thumb","data-moving":m,"aria-hidden":!0,style:{width:h.width,height:h.height,transform:`translate(${h.x}px, ${h.y}px)`}}),l.map(g=>r.jsx("button",{type:"button",className:"sc-seg","aria-pressed":g.value===a,disabled:g.disabled,title:g.title,onClick:()=>o(g.value),children:g.label},g.value))]})}function nM(n){var a;const l=[];return n.mode==="unmatched"&&l.push("Tumour only"),n.individual.germline_consent&&l.push("Germline consented"),(a=n.individual.dmp_id)!=null&&a.startsWith("P-")&&l.push("DMP linked"),l}function sM({data:n,onVersion:l}){const a=n.report,[o,c]=M.useState(!1),d=M.useRef(null);M.useEffect(()=>{if(!o)return;const m=x=>{var v;(v=d.current)!=null&&v.contains(x.target)||c(!1)},g=x=>{x.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",m),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",g)}},[o]);const h=nM(n);return r.jsxs("div",{ref:d,className:"report-menu",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2","aria-expanded":o,"aria-haspopup":"dialog",onClick:()=>c(m=>!m),children:["Report ",a.version,r.jsx(Y1,{size:14,"aria-hidden":!0})]}),o&&r.jsxs("div",{className:"report-pop",role:"dialog","aria-label":"Report",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[r.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--muted)"},children:"Report version"}),r.jsx(Bl,{label:"Report version",value:a.version,onChange:m=>{l(m),c(!1)},options:n.versions.map(m=>({value:m.version,label:m.version}))})]}),r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["WGTS_REPORT ",a.analysis?`run #${a.analysis}`:"run indexed by hand",a.built?`, built ${J1(a.built)}`:""]}),h.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2",children:h.map(m=>r.jsx("span",{className:"sc-chip",children:m},m))})]})]})}const Bm=["purity","ploidy","coverage","tmb","msi","fga"];function lM({value:n}){const a=2*Math.PI*13,o=Math.min(Math.max(n,0),1);return r.jsxs("svg",{viewBox:"0 0 34 34",className:"kpi-glyph h-[34px] w-[34px]","aria-hidden":!0,children:[r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",className:"kpi-track"}),r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",strokeLinecap:"round",className:"kpi-fill",strokeDasharray:`${o*a} ${a}`,transform:"rotate(-90 17 17)"})]})}function vx({value:n,min:l,max:a,ticks:o,reference:c}){const d=h=>4+(Math.min(Math.max(h,l),a)-l)/(a-l)*64;return r.jsxs("svg",{viewBox:"0 0 72 20",className:"kpi-glyph h-[18px] w-[60px]","aria-hidden":!0,children:[r.jsx("line",{x1:"4",x2:"68",y1:"12",y2:"12",className:"kpi-track",strokeWidth:"2",strokeLinecap:"round"}),o.map(h=>r.jsx("line",{x1:d(h),x2:d(h),y1:h===c?5:9,y2:"15",className:"kpi-tick",strokeWidth:h===c?1.5:1},h)),r.jsx("circle",{cx:d(n),cy:"12",r:"4.5",className:"kpi-dot",strokeWidth:"2"})]})}function aM({metric:n}){const l=n.value;if(l===null)return null;switch(n.key){case"purity":case"fga":return r.jsx(lM,{value:l});case"ploidy":return r.jsx(vx,{value:l,min:1,max:6,ticks:[1,2,3,4,5,6],reference:2});case"tmb":return r.jsx(vx,{value:Math.log10(Math.max(l,.01)),min:-2,max:2,ticks:[-2,-1,0,1,2]});default:return null}}const iM={purity:"Share of tumour cells, 0 to 1",fga:"Share of the genome altered, 0 to 1",ploidy:"On a scale of 1 to 6 copies; the tall tick marks 2",tmb:"On a log scale from 0.01 to 100 mutations per Mb"};function oM({metric:n,picked:l}){const a=n.value===null&&!n.text,o=!!l&&n.sources.some(c=>Gt(c)===l);return r.jsxs("div",{className:"kpi","data-picked":o,title:iM[n.key],children:[r.jsxs("span",{className:"kpi-top",children:[r.jsx("span",{className:"kpi-label",children:n.label}),r.jsx(aM,{metric:n})]}),r.jsx("span",{className:"kpi-value","data-empty":a,children:a?XN(n):PN(n)}),n.sources.length>0?r.jsx("span",{className:"flex flex-col gap-0.5",children:n.sources.map(c=>r.jsxs("span",{className:"kpi-src",children:[r.jsx("span",{className:`tb-dot ${ro(c.app)}`,"aria-hidden":!0}),r.jsx("span",{className:"min-w-0",children:oS(c)})]},Gt(c)))}):r.jsx("span",{className:"kpi-src",children:n.etl?`from ${n.etl}`:"no source"})]})}function rM({sampleLabel:n,fingerprint:l,metrics:a,picked:o,lineage:c=[]}){var h;const d=(((h=a==null?void 0:a.data)==null?void 0:h.metrics)??[]).filter(m=>Bm.includes(m.key));return r.jsxs("section",{className:"sc-card relative flex flex-wrap items-center gap-x-8 gap-y-5 px-6 py-5","aria-label":`Genome fingerprint and summary of ${n}`,children:[r.jsx("span",{className:"absolute top-3 right-3",children:r.jsx(mS,{topic:"summary",lineage:c,subject:n})}),r.jsx(mg,{fingerprint:l,size:"hero",title:n.split(" ")[0],subtitle:"tumour",className:"h-[210px] w-[210px] max-w-full flex-none"}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_230px] flex-col gap-3",children:[r.jsxs("h2",{className:"m-0 text-lg font-semibold tracking-tight",children:["Genome fingerprint of ",n]}),r.jsx("p",{className:"m-0 max-w-[46ch] text-[14.5px] leading-relaxed",style:{color:"var(--ink-2)"},children:l?W1(l):"No copy-number data for this sample."}),r.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-[12.5px]",style:{color:"var(--ink-2)"},children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--gain)"}}),"Gains, outer track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--loss)"}}),"Losses, inner track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-3 w-[5px] rounded-sm",style:{background:"var(--ink)"}}),"Drivers"]})]}),r.jsx("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:"Chromosome 1 starts at the top and the ring runs clockwise to X."})]}),r.jsxs("div",{className:"kpi-grid min-w-0 flex-[1.4_1_420px]",children:[a===void 0&&Bm.map(m=>r.jsx("div",{className:"kpi","aria-hidden":!0,children:r.jsx("div",{className:"skeleton h-[70px]"})},m)),a&&a.status!=="ok"&&r.jsx("div",{className:"col-span-full",children:r.jsx(ba,{envelope:a})}),d.map(m=>r.jsx(oM,{metric:m,picked:o},m.key))]})]})}function cM({sampleLabel:n,failures:l,analyses:a}){return l.length===0?null:r.jsx("div",{className:"flex flex-col gap-2.5",children:l.map(o=>{const c=a.filter(d=>d.modules.some(h=>h.etl===o.etl&&h.status==="failed"));return r.jsxs("div",{className:"sc-card flex flex-wrap items-center gap-x-4 gap-y-3 px-[18px] py-3.5",role:"status",children:[r.jsx("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-[10px]",style:{background:"var(--warn-soft)",color:"var(--warn-ink)"},children:r.jsx(K1,{size:18,"aria-hidden":!0})}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_360px] flex-col gap-0.5",children:[r.jsxs("span",{className:"text-[14.5px] font-semibold",children:[o.label," failed for ",n]}),r.jsx("span",{className:"text-[13.5px]",style:{color:"var(--ink-2)"},children:o.message.split(`
|
|
277
|
-
`)[0]}),c.length>0&&r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["Reading ",c.map(oS).join(", ")]})]})]},`${o.etl}-${o.node}`)})})}function uM({onSignedIn:n}){const[l,a]=M.useState("password"),[o,c]=M.useState(""),[d,h]=M.useState(""),[m,g]=M.useState(""),[x,v]=M.useState(null),[y,S]=M.useState(!1),j=l==="password"?!!o&&!!d:!!m.trim();return r.jsxs("form",{className:"sc-card mx-auto mt-16 flex w-[380px] max-w-full flex-col gap-3 p-6",onSubmit:async b=>{b.preventDefault(),S(!0),v(null);try{l==="password"?await gC(o,d):await mC(m.trim()),n()}catch(N){v(N.message)}finally{S(!1)}},children:[r.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Sign in to Isabl"}),r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--ink-2)"},children:"The WGTS dashboard uses your Isabl account."}),l==="password"?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"username",children:["Username",r.jsx("span",{className:"field",children:r.jsx("input",{id:"username",autoComplete:"username",value:o,onChange:b=>c(b.target.value)})})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"password",children:["Password",r.jsx("span",{className:"field",children:r.jsx("input",{id:"password",type:"password",autoComplete:"current-password",value:d,onChange:b=>h(b.target.value)})})]})]}):r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"token",children:["API token",r.jsx("span",{className:"field",children:r.jsx("input",{id:"token",type:"password",autoComplete:"off",spellCheck:!1,value:m,onChange:b=>g(b.target.value)})}),r.jsx("span",{className:"text-xs font-normal",style:{color:"var(--muted)"},children:"The token the Isabl CLI uses. Admins find it under Auth Token in Django admin."})]}),x&&r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--warn-ink)"},role:"alert",children:x}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:y||!j,children:y?"Signing in":"Sign in"}),r.jsx("button",{type:"button",className:"self-start border-0 bg-transparent p-0 text-[13px] font-semibold",style:{color:"var(--link)",cursor:"pointer"},onClick:()=>{a(l==="password"?"token":"password"),v(null)},children:l==="password"?"Use an API token instead":"Use a username and password instead"})]})}const it=1e3,Gm=.35,fM=8,Ou=.1;function Mu(n,l){return(Ru(n,l)??0)*it}function Ns(n){const[l,a]=Gu[n.replace(/^chr/,"")];return[l*it,a*it]}function kh(n,l,a){const[o,c]=n,d=Math.min(it,Math.max(Gm,(c-o)*a)),h=Math.min(Math.max(l-(l-o)/(c-o)*d,0),it-d);return[h,h+d]}function ur(n,l){const a=n[1]-n[0],o=Math.min(Math.max(n[0]+l,0),it-a);return[o,o+a]}function dM(n,l,a){const o=Math.min(Math.max(a,0),it);return l===0?[Math.min(o,n[1]-Gm),n[1]]:[n[0],Math.max(o,n[0]+Gm)]}function hM(n,l,a){const o=(n[0]+n[1])/2+((l[0]+l[1])/2-(n[0]+n[1])/2)*a,[c,d]=[n[1]-n[0],l[1]-l[0]],h=Math.exp(Math.log(c)+(Math.log(d)-Math.log(c))*a),m=Math.min(Math.max(o-h/2,0),it-h);return[m,m+h]}function xx(n){return n[1]-n[0]<it-.5}function qm(n){for(const[l]of bn){const[a,o]=Ns(l);if(n>=a&&n<=o)return l}return null}function mM(n,l){const a=n.segments.flatMap(c=>l==="total"?[c.total_cn]:[c.major_cn,c.minor_cn]),o=Math.max(...a.map(c=>c??0));return Math.min(fM,Math.max(n.baseline+2,Math.ceil(o)))}function gM(n){const l=10**Math.floor(Math.log10(n)),a=n/l;return(a<1.5?1:a<3.5?2:a<7.5?5:10)*l}function pM(n,l,a=5){const o=bn.filter(([S])=>{const[j,b]=Ns(S);return b>n&&j<l});if(o.length!==1)return o.map(([S])=>{const[j,b]=Ns(S);return{value:(j+b)/2,label:S}});const[c,d]=o[0],[h,m]=Ns(c),g=(Math.max(n,h)-h)/(m-h)*d,x=(Math.min(l,m)-h)/(m-h)*d,v=gM(Math.max(x-g,1)/a),y=[];for(let S=Math.ceil(g/v)*v;S<=x;S+=v)y.push({value:h+S/d*(m-h),label:jr(S,v)});return y}function yM(n,l){if(n<=.5&&l>=it-.5)return null;const a=Um(n/it,"start"),o=Um(l/it,"end");if(a.chrom===o.chrom){const c=(o.pos-a.pos)/10;return`chr${a.chrom}: ${jr(a.pos,c).replace(" Mb","")}–${jr(o.pos,c)}`}return`chr${a.chrom}:${jr(a.pos,1e6)} – chr${o.chrom}:${jr(o.pos,1e6)}`}function vM(n){const{chrom:l,pos:a}=Um(Math.min(Math.max(n,0),it)/it,"start");return`chr${l} · ${(a/1e6).toFixed(1)} Mb`}const Yu=n=>n.call??"neutral",xM={neutral:"Neutral",gain:"Gain",amp:"Amplification",loss:"Loss"},gS={neutral:"var(--chev)",gain:"var(--gain)",amp:"var(--gain-strong)",loss:"var(--loss)"};function SM(n){return{call:xM[Yu(n)],copies:n.total_cn===null?"? copies":`${n.total_cn} ${n.total_cn===1?"copy":"copies"}`,alleles:n.major_cn!==null&&n.minor_cn!==null?`${n.major_cn} + ${n.minor_cn}`:"",span:`chr${n.chrom}:${n.start.toLocaleString("en-US")}–${n.end.toLocaleString("en-US")}`,log2:n.log2!==null?n.log2.toFixed(2):""}}function bM(n){const l=new Map;for(const a of n){const o=a.gene??"?",c=l.get(o)??{gene:o,x:Mu(a.chrom,a.pos),chrom:a.chrom,pos:a.pos,changes:"",list:[]};a.protein_change&&c.list.push(a.protein_change),l.set(o,c)}return[...l.values()].map(({list:a,...o})=>({...o,changes:a.join(", ")})).sort((a,o)=>a.x-o.x)}function Hh(n,l,a){const o=l.replace(/^chr/,"");return n.segments.find(c=>c.chrom===o&&c.start<=a&&a<=c.end)}function Uh(n,l){return n?l==="total"?n.total_cn:n.major_cn:null}function jM(n){const l=n.length;if(l===0)return"";const a=m=>m.toFixed(2);if(l===1)return`M${a(n[0][0])},${a(n[0][1])}`;const o=n.slice(1).map((m,g)=>m[0]-n[g][0]),c=n.slice(1).map((m,g)=>o[g]===0?0:(m[1]-n[g][1])/o[g]),d=n.map((m,g)=>g===0?c[0]:g===l-1?c[l-2]:c[g-1]*c[g]<=0?0:(c[g-1]+c[g])/2);for(let m=0;m<l-1;m++){if(c[m]===0){d[m]=0,d[m+1]=0;continue}const g=d[m]/c[m],x=d[m+1]/c[m],v=Math.hypot(g,x);v>3&&(d[m]=3*g*c[m]/v,d[m+1]=3*x*c[m]/v)}let h=`M${a(n[0][0])},${a(n[0][1])}`;for(let m=0;m<l-1;m++){const[g,x]=n[m],[v,y]=n[m+1];h+=` C${a(g+o[m]/3)},${a(x+d[m]*o[m]/3)} ${a(v-o[m]/3)},${a(y-d[m+1]*o[m]/3)} ${a(v)},${a(y)}`}return h}function zu(n,l){const a=[],o=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c].left-n[d].left).forEach(c=>{let d=a.findIndex(h=>h+l<=n[c].left);d===-1&&(d=a.push(0)-1),a[d]=n[c].left+n[c].width,o[c]=d}),o}function Pu(n,l=4){const a=Math.max(n,1)/l,o=10**Math.floor(Math.log10(a)),c=a/o,d=Math.max(1,(c<=1?1:c<=2?2:c<=5?5:10)*o),h=[];for(let m=0;m<Math.max(n,1)+d&&(h.push(m),!(m>=n&&h.length>1));m+=d);return h}const pg=n=>1-(1-n)**3;function Cs(n,l,a=500){return n.length*l*(a>=600?.6:.56)}function Zt({x:n,y:l,width:a,above:o=!1,children:c}){const d=n>a-320,h=o?Math.min(Math.max(n,110),a-110):n,m=o?"translate(-50%, calc(-100% - 6px))":`translate(${d?"calc(-100% - 14px)":"14px"}, -50%)`;return r.jsx("div",{className:"ctip",style:{left:h,top:l,transform:m},role:"presentation",children:c})}function Du(n,l,a){const o=n.clientX;let c=!1;const d=m=>{const g=m.clientX-o;Math.abs(g)>3&&(c=!0),l(g,m)},h=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),a==null||a(c)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",h),window.addEventListener("pointercancel",h)}const wM=.01,NM=16,CM=160;function pS(n,l){const a=S=>{const j=n.getBoundingClientRect();return[S.clientX-j.left,S.clientY-j.top]};let o="page",c=-1/0;const d=S=>{n.contains(S.target)||(o="page",c=S.timeStamp)},h=S=>{const[j,b]=a(S),N=l(),T=S.ctrlKey||S.metaKey;if(!T&&(S.timeStamp-c>CM&&(o="plot"),c=S.timeStamp,o==="page")||!N.inside(j,b))return;const O=S.deltaMode===1?NM:S.deltaMode===2?n.clientWidth:1,_=(S.deltaX||(S.shiftKey?S.deltaY:0))*O;if(!T&&_!==0&&(S.shiftKey||Math.abs(S.deltaX)>Math.abs(S.deltaY))){S.preventDefault(),N.pan(_);return}if(S.deltaY===0)return;const C=Math.max(-50,Math.min(50,S.deltaY*O));N.zoom(Math.exp(C*wM),j)||T?S.preventDefault():o="page"};let m=1,g=null;const x=S=>{const j=S,[b,N]=a(j);l().inside(b,N)&&(S.preventDefault(),m=1,g=b)},v=S=>{if(g===null)return;S.preventDefault();const j=S.scale;j>0&&j!==m&&l().zoom(m/j,g),m=j},y=S=>{g!==null&&(S.preventDefault(),g=null)};return window.addEventListener("wheel",d,{capture:!0,passive:!0}),n.addEventListener("wheel",h,{passive:!1}),n.addEventListener("gesturestart",x),n.addEventListener("gesturechange",v),n.addEventListener("gestureend",y),()=>{window.removeEventListener("wheel",d,{capture:!0}),n.removeEventListener("wheel",h),n.removeEventListener("gesturestart",x),n.removeEventListener("gesturechange",v),n.removeEventListener("gestureend",y)}}function Es(n=640){const l=M.useRef(null),[a,o]=M.useState(n);return M.useLayoutEffect(()=>{const c=l.current;if(!c)return;const d=()=>o(Math.round(c.clientWidth)||n);if(d(),typeof ResizeObserver>"u")return;const h=new ResizeObserver(d);return h.observe(c),()=>h.disconnect()},[n]),[l,a]}const Sx=36,MM=14,wr=232,bx=22,Gi=28,jx=19,EM=480,TM=M.memo(function({segments:l,spans:a,mode:o,shown:c,geo:d,hover:h,grad:m,onHover:g,onClick:x}){const v=c[1]-c[0],y=b=>d.plotL+(b-c[0])/v*d.plotW,S=b=>d.plotTop+(1-Math.min(Math.max(b,0),d.top)/d.top)*wr,j=S(d.baseline);return r.jsx("g",{children:l.map((b,N)=>{const[T,O]=a[N];if(O<c[0]-1||T>c[1]+1)return null;const _=Yu(b),D=y(T),C=Math.max(y(O)-D,_==="neutral"?2:7),E=h===N;if(o==="total"){if(b.total_cn===null)return null;const B=S(b.total_cn);return r.jsxs("g",{className:"cn-seg","data-call":_,"data-on":E||void 0,children:[_!=="neutral"&&r.jsx("rect",{x:D,y:Math.min(B,j),width:C,height:Math.abs(B-j),fill:`url(#${m[_]})`,className:"cn-col"}),r.jsx("line",{x1:D,x2:D+C,y1:B,y2:B,style:{stroke:gS[_]},className:"cn-line"}),r.jsx("rect",{x:D-2,y:Math.min(B,j)-9,width:C+4,height:Math.abs(B-j)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:D+C/2,y:B}),onMouseLeave:()=>g(null),onClick:()=>x(b)})]},N)}if(b.major_cn===null||b.minor_cn===null)return null;const R=S(b.major_cn+Ou),A=S(b.minor_cn-Ou);return r.jsxs("g",{className:"cn-seg","data-on":E||void 0,children:[r.jsx("line",{x1:D,x2:D+C,y1:A,y2:A,className:"cn-line cn-minor"}),r.jsx("line",{x1:D,x2:D+C,y1:R,y2:R,className:"cn-line cn-major"}),r.jsx("rect",{x:D-2,y:Math.min(R,A)-9,width:C+4,height:Math.abs(R-A)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:D+C/2,y:R}),onMouseLeave:()=>g(null),onClick:()=>x(b)})]},N)})})}),_M=M.memo(function({segments:l,spans:a,mode:o,top:c,baseline:d,plotL:h,plotW:m,y0:g}){const x=v=>g+3+(1-Math.min(v,c)/c)*(Gi-6);return r.jsxs("g",{pointerEvents:"none",children:[bn.map(([v],y)=>{const[S,j]=Ns(v);return y%2===0?r.jsx("rect",{x:h+S/it*m,y:g,width:(j-S)/it*m,height:Gi,className:"cn-mini-band"},v):null}),r.jsx("line",{x1:h,x2:h+m,y1:x(d),y2:x(d),className:"cn-mini-base"}),l.map((v,y)=>{const S=o==="total"?v.total_cn:v.major_cn;if(S===null)return null;const j=Yu(v),b=h+a[y][0]/it*m,N=Math.max((a[y][1]-a[y][0])/it*m,j==="neutral"?1:2);return r.jsx("line",{x1:b,x2:b+N,y1:x(S),y2:x(S),className:"cn-mini-line",style:{stroke:o==="total"?gS[j]:"var(--ink-2)"}},y)})]})});function RM({data:n,mode:l,drivers:a,focus:o,locate:c,view:d,onView:h,onSegment:m,onGene:g}){const[x,v]=Es(900),y=M.useRef(null),S=M.useId(),j={gain:`${S}-gain`,amp:`${S}-amp`,loss:`${S}-loss`},[b,N]=M.useState(d.window),T=M.useRef(b);T.current=b,M.useLayoutEffect(()=>{const te=d.window,ue=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!d.smooth||ue){N(te);return}const we=T.current,Ue=performance.now();let Pe=0;const vt=pt=>{const et=Math.min(1,(pt-Ue)/EM);N(hM(we,te,pg(et))),et<1&&(Pe=requestAnimationFrame(vt))};return Pe=requestAnimationFrame(vt),()=>cancelAnimationFrame(Pe)},[d]);const[O,_]=M.useState(null),[D,C]=M.useState(null),[E,R]=M.useState(null),[A,B]=M.useState(!1),K=M.useRef(!1),k=M.useMemo(()=>mM(n,l),[n,l]),ie=M.useMemo(()=>n.segments.some(te=>Math.max(te.total_cn??0,te.major_cn??0)>k),[n,k]),oe=M.useMemo(()=>n.segments.map(te=>[Mu(te.chrom,te.start),Mu(te.chrom,te.end)]),[n]),se=M.useMemo(()=>bM(a),[a]),P=Sx,le=Math.max(v-Sx-MM,200),$=b[1]-b[0],J=te=>P+(te-b[0])/$*le,Z=te=>b[0]+(te-P)/le*$,W=te=>Cs(te,11.5,600)+14,ae=M.useMemo(()=>{const te=se.map(ue=>({left:P+ue.x/it*le-W(ue.gene)/2,width:W(ue.gene)}));return se.length?Math.max(...zu(te,4))+1:0},[se,P,le]),ve=(ae?ae*jx+8:4)+4,je=ve+wr,L=je+10,U=L+bx+12,I=U+Gi+6,re={plotL:P,plotW:le,plotTop:ve,top:k,baseline:n.baseline},ce=te=>ve+(1-Math.min(Math.max(te,0),k)/k)*wr,xe=se.map((te,ue)=>({m:te,index:ue,x:J(te.x)})).filter(({x:te})=>te>=P-4&&te<=P+le+4),Te=zu(xe.map(({m:te,x:ue})=>({left:ue-W(te.gene)/2,width:W(te.gene)})),4),me=(te,ue)=>te>=P&&te<=P+le&&ue>=ve&&ue<=je,Se=te=>{const ue=y.current.getBoundingClientRect();return[te.clientX-ue.left,te.clientY-ue.top]},ct=M.useCallback(te=>h({window:te,smooth:!1}),[h]),Ct=M.useCallback(te=>h({window:te,smooth:!0}),[h]),dn=M.useRef({shown:b,plotL:P,plotW:le,plotTop:ve,plotBottom:je,move:ct});dn.current={shown:b,plotL:P,plotW:le,plotTop:ve,plotBottom:je,move:ct},M.useEffect(()=>{const te=x.current;if(!te||!y.current)return;const ue=()=>y.current.getBoundingClientRect();return pS(te,()=>{const we=dn.current,Ue=()=>ue().left-te.getBoundingClientRect().left,Pe=()=>ue().top-te.getBoundingClientRect().top,vt=we.shown[1]-we.shown[0];return{inside:(pt,et)=>{const hn=pt-Ue(),Nn=et-Pe();return hn>=we.plotL&&hn<=we.plotL+we.plotW&&Nn>=we.plotTop&&Nn<=we.plotBottom},zoom:(pt,et)=>{const hn=kh(we.shown,we.shown[0]+(et-Ue()-we.plotL)/we.plotW*vt,pt);return Math.abs(hn[0]-we.shown[0])<1e-6&&Math.abs(hn[1]-we.shown[1])<1e-6?!1:(we.move(hn),!0)},pan:pt=>we.move(ur(we.shown,pt/we.plotW*vt))}})},[x]),M.useEffect(()=>{c&&/^(\d+|X)$/.test(c.chrom.replace(/^chr/,""))&&Ct(Ns(c.chrom))},[c,Ct]);const zt=te=>{if(te.button!==0)return;const[ue,we]=Se(te);if(!me(ue,we)||!xx(b))return;te.preventDefault();const Ue=b;B(!0),Du(te,Pe=>ct(ur(Ue,-(Pe/le)*(Ue[1]-Ue[0]))),Pe=>{B(!1),Pe&&(K.current=!0,setTimeout(()=>K.current=!1,0))})},ut=te=>{const[ue,we]=Se(te);R(me(ue,we)?ue:null)},Ge=te=>{const[ue,we]=Se(te);if(!me(ue,we))return;const Ue=qm(Z(ue));Ue&&Ct(Ns(Ue))},Wt=te=>{const ue=(b[0]+b[1])/2;if(te.key==="ArrowLeft"||te.key==="ArrowRight")te.preventDefault(),ct(ur(b,(te.key==="ArrowLeft"?-.15:.15)*$));else if(te.key==="+"||te.key==="=")Ct(kh(b,ue,.6));else if(te.key==="-")Ct(kh(b,ue,1/.6));else if(te.key==="0"||te.key==="Home")Ct([0,it]);else return;te.key!=="ArrowLeft"&&te.key!=="ArrowRight"&&te.preventDefault()},rs=M.useCallback(te=>{K.current||m(te)},[m]),en=bn.map(([te],ue)=>{const[we,Ue]=Ns(te);return{chrom:te,i:ue,x0:J(we),x1:J(Ue)}}).filter(({x0:te,x1:ue})=>ue>P&&te<P+le),wn=en.length===1?en[0]:null,Ts=wn?pM(b[0],b[1],Math.max(2,Math.round(le/120))):[],gt=(()=>{if(!o)return null;const te=Mu(o.chrom,o.pos);if(te<b[0]||te>b[1])return null;const ue=Hh(n,o.chrom,o.pos),we=Uh(ue,l),Ue=l==="allele"&&we!==null?Ou:0;return{x:J(te),y:ce((we??n.baseline)+Ue),copies:(ue==null?void 0:ue.total_cn)??null}})(),Yn=O?n.segments[O.index]:null,qt=Yn?SM(Yn):null,Dt=D!==null?se[D]:null,Ks=te=>P+te/it*le,It={x0:Ks(b[0]),x1:Ks(b[1])},Ln=xx(b),Pn=(te,ue)=>{te.stopPropagation(),te.preventDefault();const we=b;B(!0),Du(te,Ue=>{const Pe=Ue/le*it;ct(ue==="move"?ur(we,Pe):dM(we,ue,we[ue]+Pe))},()=>B(!1))};return r.jsxs("div",{ref:x,className:"cn","data-dragging":A||void 0,"data-zoomed":Ln||void 0,tabIndex:0,role:"group","aria-label":`Copy number of ${n.sample} across the genome, against ${n.baseline} copies.`,"aria-keyshortcuts":"ArrowLeft ArrowRight + - 0",onKeyDown:Wt,children:[r.jsxs("svg",{ref:y,width:v,height:I,"aria-hidden":!0,onPointerDown:zt,onPointerMove:ut,onPointerLeave:()=>R(null),onDoubleClick:Ge,children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:j.gain,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain)"},stopOpacity:.46}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain)"},stopOpacity:.04})]}),r.jsxs("linearGradient",{id:j.amp,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain-strong)"},stopOpacity:.62}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain-strong)"},stopOpacity:.05})]}),r.jsxs("linearGradient",{id:j.loss,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--loss)"},stopOpacity:.04}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--loss)"},stopOpacity:.46})]}),r.jsx("clipPath",{id:`${S}-plot`,children:r.jsx("rect",{x:P-4,y:ve-2,width:le+8,height:wr+4})})]}),r.jsx("g",{clipPath:`url(#${S}-plot)`,children:bn.map(([te],ue)=>{const[we,Ue]=Ns(te),Pe=J(we),vt=J(Ue);return ue%2===0&&vt>P&&Pe<P+le?r.jsx("rect",{x:Pe,y:ve,width:vt-Pe,height:wr,className:"cn-band"},te):null})}),Array.from({length:k+1},(te,ue)=>r.jsxs("g",{children:[r.jsx("line",{x1:P,x2:P+le,y1:ce(ue),y2:ce(ue),className:"cn-grid"}),r.jsx("text",{x:P-10,y:ce(ue)+4,textAnchor:"end",className:"cn-tick",children:ue===k&&ie?`${ue}+`:ue})]},ue)),r.jsx("line",{x1:P,x2:P+le,y1:ce(n.baseline),y2:ce(n.baseline),className:"cn-baseline"}),r.jsxs("text",{x:P+8,y:ce(n.baseline)-7,className:"cn-baseline-label",children:[n.baseline," copies"]}),r.jsx("g",{className:"cn-reveal",children:r.jsx("g",{clipPath:`url(#${S}-plot)`,children:r.jsx(TM,{segments:n.segments,spans:oe,mode:l,shown:b,geo:re,hover:O?O.index:null,grad:j,onHover:_,onClick:rs})})}),E!==null&&!A&&!O&&D===null&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:E,x2:E,y1:ve,y2:je,className:"cn-guide"}),r.jsxs("g",{transform:`translate(${Math.min(Math.max(E,P+52),P+le-52)} ${je-24})`,children:[r.jsx("rect",{x:-50,width:100,height:18,rx:9,className:"cn-readout"}),r.jsx("text",{y:12.5,textAnchor:"middle",className:"cn-readout-text",children:vM(Z(E))})]})]}),xe.map(({m:te,x:ue,index:we},Ue)=>{const Pe=Hh(n,te.chrom,te.pos),vt=Uh(Pe,l),pt=ce((vt??n.baseline)+(l==="allele"&&vt!==null?Ou:0)),et=W(te.gene),hn=4+Te[Ue]*jx,Nn=D===we;return r.jsxs("g",{className:"cn-driver","data-on":Nn||void 0,onPointerDown:ql=>ql.stopPropagation(),onMouseEnter:()=>C(we),onMouseLeave:()=>C(null),onClick:()=>g(te.gene),children:[r.jsx("line",{x1:ue,x2:ue,y1:hn+16,y2:pt,className:"cn-leader"}),r.jsx("rect",{x:ue-et/2,y:hn,width:et,height:16,rx:8,className:"cn-chip"}),r.jsx("text",{x:ue,y:hn+11.5,textAnchor:"middle",className:"cn-gene",children:te.gene}),r.jsx("circle",{cx:ue,cy:pt,r:Nn?6.5:5,className:"cn-dot"})]},te.gene)}),gt&&o&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:gt.x,x2:gt.x,y1:ve,y2:je,className:"cn-focus-line"}),r.jsx("circle",{cx:gt.x,cy:gt.y,r:6.5,className:"cn-focus-dot"}),(()=>{const te=`${o.gene??"?"}${gt.copies!==null?` ${gt.copies} copies`:""}`,ue=Cs(te,11.5,600)+14,we=gt.x+12+ue>P+le;return r.jsxs("g",{transform:`translate(${we?gt.x-12-ue:gt.x+12} ${gt.y-12})`,children:[r.jsx("rect",{width:ue,height:22,rx:7,className:"cn-focus-chip"}),r.jsx("text",{x:7,y:15,className:"cn-focus-text",children:te})]})})()]}),r.jsxs("g",{className:"cn-strip",children:[en.map(({chrom:te,i:ue,x0:we,x1:Ue})=>{const Pe=Math.max(we,P),vt=Math.min(Ue,P+le),pt=vt-Pe,et=wn?`chr${te}`:te;return r.jsxs("g",{className:"cn-pill",onClick:()=>Ct(Ns(te)),role:"presentation",children:[r.jsx("title",{children:`Zoom to chromosome ${te}`}),r.jsx("rect",{x:Pe+.5,y:L,width:Math.max(pt-1,1),height:bx,rx:7,"data-odd":ue%2?"":void 0}),pt>=Cs(et,11,600)+3&&r.jsx("text",{x:wn?Pe+10:(Pe+vt)/2,y:L+15,textAnchor:wn?"start":"middle",children:et})]},te)}),wn&&Ts.map(te=>{const ue=J(te.value);return ue>Math.max(wn.x0,P)+70&&ue<P+le-20?r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:ue,x2:ue,y1:L+3,y2:L+9,className:"cn-mb-tick"}),r.jsx("text",{x:ue,y:L+18,textAnchor:"middle",className:"cn-mb",children:te.label})]},te.value):null})]}),r.jsx(_M,{segments:n.segments,spans:oe,mode:l,top:k,baseline:n.baseline,plotL:P,plotW:le,y0:U}),r.jsx("rect",{x:P,y:U,width:le,height:Gi,fill:"transparent",className:"cn-mini-track",onPointerDown:te=>{const[ue]=Se(te),we=b[1]-b[0],Ue=(ue-P)/le*it;Ct(ur([Ue-we/2,Ue+we/2],0))}}),Ln&&r.jsxs("g",{className:"cn-mini-window",children:[r.jsx("rect",{x:It.x0,y:U-1,width:Math.max(It.x1-It.x0,4),height:Gi+2,rx:6,onPointerDown:te=>Pn(te,"move"),className:"cn-mini-win"}),[0,1].map(te=>r.jsx("rect",{x:(te===0?It.x0:It.x1)-4,y:U+Gi/2-9,width:8,height:18,rx:4,className:"cn-mini-handle",onPointerDown:ue=>Pn(ue,te)},te))]})]}),qt&&O&&r.jsxs(Zt,{x:O.x+0,y:O.y+0,width:v,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"cn-call-dot","data-call":Yu(Yn),"aria-hidden":!0}),qt.call,r.jsx("span",{className:"ctip-sub",children:qt.copies})]}),qt.alleles&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Alleles"}),r.jsx("b",{children:qt.alleles})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Region"}),r.jsx("b",{className:"mono",children:qt.span})]}),qt.log2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"log2 ratio"}),r.jsx("b",{children:qt.log2})]}),r.jsx("span",{className:"ctip-note",children:"Click to list the mutations in this segment"})]}),Dt&&D!==null&&r.jsxs(Zt,{x:J(Dt.x),y:ve+10,width:v,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:Dt.gene}),Dt.changes&&r.jsx("span",{className:"ctip-sub",children:Dt.changes})]}),(()=>{const te=Uh(Hh(n,Dt.chrom,Dt.pos),l);return te!==null?r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Copy number here"}),r.jsx("b",{children:te})]}):null})(),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}const AM={"del.mh.prop":{short:"Del. MH",long:"Deletions with microhomology (share of deletions)"},SNV3:{short:"SBS3",long:"Substitution signature 3"},SV3:{short:"RS3",long:"Rearrangement signature 3"},SV5:{short:"RS5",long:"Rearrangement signature 5"},hrd:{short:"HRD index",long:"HRD index (loss of heterozygosity, telomeric imbalance, large-scale transitions)"},SNV8:{short:"SBS8",long:"Substitution signature 8"}};function wx(n,l="short"){var a;return((a=AM[n])==null?void 0:a[l])??n}const Fh=8;function OM(n){const l=n.find(c=>c.group==="sample")??n[0],a=[...(l==null?void 0:l.signatures)??[]].sort((c,d)=>(d.proportion??0)-(c.proportion??0)).map(c=>c.signature),o=a.length>Fh?Fh-1:Fh;return{shown:a.slice(0,o),other:a.slice(o)}}function Nx(n){return n.group==="sample"?"This tumour":`${n.label.replace(/\(\d+\)$/,"")} cohort${n.cohort_n?`, n = ${n.cohort_n}`:""}`}const Cx=["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#6250d6","#e34948"],zM="#a3a3ab";function DM(n){const{shown:l,other:a}=OM(n),o=n.find(g=>g.group==="sample")??n[0],c=n.find(g=>g.group==="cohort")??null,d=(g,x,v)=>g?g.signatures.filter(y=>x.includes(y.signature)).reduce((y,S)=>y+(S[v]??0),0):null,h=(g,x,v)=>{var y,S;return{name:g,members:x,colour:v,share:d(o,x,"proportion")??0,cohortShare:d(c,x,"proportion"),count:d(o,x,"count")??0,cohortCount:d(c,x,"count"),aetiology:x.length===1?((y=o==null?void 0:o.signatures.find(j=>j.signature===g))==null?void 0:y.aetiology)??((S=c==null?void 0:c.signatures.find(j=>j.signature===g))==null?void 0:S.aetiology)??null:`${x.length} smaller signatures`}},m=l.map((g,x)=>h(g,[g],Cx[x%Cx.length]));return a.length&&m.push(h("Other",a,zM)),m}function Rl(n){return n.cohortShare===null?null:(n.share-n.cohortShare)*100}function Mx(n,l,a){const o=Math.max(l-a*Math.max(n.length-1,0),0),c=n.reduce((h,m)=>h+m,0)||1;let d=0;return n.map(h=>{const m=h/c*o,g={y0:d,y1:d+m};return d+=m+a,g})}function LM(n,l,a,o){const c=(n+a)/2,d=h=>h.toFixed(2);return`M${d(n)},${d(l.y0)} C${d(c)},${d(l.y0)} ${d(c)},${d(o.y0)} ${d(a)},${d(o.y0)} L${d(a)},${d(o.y1)} C${d(c)},${d(o.y1)} ${d(c)},${d(l.y1)} ${d(n)},${d(l.y1)} Z`}function Ms(n,l){const a=(n.length-1)*l,o=Math.floor(a),c=Math.ceil(a);return n[o]+(n[c]-n[o])*(a-o)}function yS(n){var c;const l=n.cohort.filter(d=>d!==null&&Number.isFinite(d)).sort((d,h)=>d-h);if(l.length===0)return null;const a=((c=n.sample)==null?void 0:c.value)??null,o=[...l];if(a!==null){const d=o.indexOf(a);d>=0&&o.splice(d,1)}return{values:l,q1:Ms(l,.25),median:Ms(l,.5),q3:Ms(l,.75),tumour:a,above:a===null?null:o.filter(d=>d<a).length,others:o.length}}function $M(n,l=64){const a=n.length,o=n.reduce((x,v)=>x+v,0)/a,c=Math.sqrt(n.reduce((x,v)=>x+(v-o)**2,0)/Math.max(a-1,1)),d=Math.min(c,(Ms(n,.75)-Ms(n,.25))/1.34)||c||.1,h=Math.max(.9*d*a**-.2,.02),m=Array.from({length:l+1},(x,v)=>{const y=v/l;return{x:y,y:n.reduce((S,j)=>S+Math.exp(-.5*((y-j)/h)**2),0)}}),g=Math.max(...m.map(x=>x.y))||1;return m.map(x=>({x:x.x,y:x.y/g}))}function kM(n,l){const a=[],o=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c]-n[d]).forEach(c=>{let d=0;for(;a.some(h=>h.level===d&&Math.abs(h.x-n[c])<l);)d+=1;a.push({x:n[c],level:d}),o[c]=d}),o}function Vh(n){return n.above===null||n.others===0?"":n.above===n.others?n.others===1?"Above the other sample":"Highest in the cohort":n.above===0?"Lowest in the cohort":`Above ${n.above} of ${n.others} others`}function qi(n,l,a,o){const c=Math.PI*(1-Math.min(Math.max(o,0),1));return{x:n+a*Math.cos(c),y:l-a*Math.sin(c)}}function HM(n){const{value:l,exact:a}=n;return l===null?"–":l===0&&a!=null&&a>0?a<1e-4?"<0.0001":String(Number(a.toPrecision(2))):l.toFixed(2)}function UM(n){const l=n.threshold;if(l===null)return null;const a=n.exact??n.value;return a===null||!n.rating?`High at ${l} and above`:n.rating==="HIGH"?`At or above the ${l} threshold`:a<l/2?`Well below the ${l} threshold`:`Below the ${l} threshold`}function Im(n){const l=n.filter(h=>h!==null&&Number.isFinite(h)).sort((h,m)=>h-m);if(!l.length)return null;const a=Ms(l,.25),o=Ms(l,.75),c=1.5*(o-a),d=l.filter(h=>h>=a-c&&h<=o+c);return{n:l.length,min:l[0],max:l[l.length-1],q1:a,median:Ms(l,.5),q3:o,low:d[0]??a,high:d[d.length-1]??o}}function FM(n,l=48){const a=n.filter(b=>b!==null&&Number.isFinite(b));if(a.length<2)return[];const o=Math.min(...a),c=Math.max(...a);if(c===o)return[];const d=a.length,h=a.reduce((b,N)=>b+N,0)/d,m=Math.sqrt(a.reduce((b,N)=>b+(N-h)**2,0)/(d-1)),g=[...a].sort((b,N)=>b-N),x=Ms(g,.75)-Ms(g,.25),v=Math.min(m,x/1.34)||m||(c-o)/4,y=Math.max(.9*v*d**-.2,(c-o)/200),S=Array.from({length:l+1},(b,N)=>{const T=o+(c-o)*N/l;return{v:T,d:a.reduce((O,_)=>O+Math.exp(-.5*((T-_)/y)**2),0)}}),j=Math.max(...S.map(b=>b.d))||1;return S.map(b=>({v:b.v,d:b.d/j}))}function vS(n,l,a){if(n===null)return"";const o=l.filter(d=>d!==null&&Number.isFinite(d));if(!o.length)return"";const c=o.filter(d=>d<n).length;return c===o.length?`Higher than every ${a}`:c===0?`Lower than every ${a}`:`Higher than ${c} of ${o.length} ${a}s`}function VM(n,l){const a=[],o=new Array(n.length).fill(0),c=[...n.keys()].sort((d,h)=>n[d]-n[h]);for(const d of c){let h=0;const m=g=>g===0?0:g%2?-Math.ceil(g/2):g/2;for(;a.some(g=>g.slot===m(h)&&Math.abs(g.y-n[d])<l);)h+=1;a.push({y:n[d],slot:m(h)}),o[d]=m(h)}return o}const _i=46,Ri=30,Ai=210,Ex=30,BM=58,GM=132,Tx=6,Oi=n=>`${Math.round(n*100)}%`;function qM({data:n}){var C,E;const[l,a]=Es(760),[o,c]=M.useState(((C=n.projects[0])==null?void 0:C.project)??null),[d,h]=M.useState(null),m=n.projects.find(R=>R.project===o)??n.projects[0],g=m.diseases,x=a-_i-8,v=Math.min(GM,Math.max(BM,x/Math.max(g.length,1))),y=v*g.length,S=Math.max(a,_i+y+8),j=_i+Math.max(0,(x-y)/2),b=Math.max(x,y),N=R=>Ri+Ai*(1-Math.min(Math.max(R,0),1)),T=m.tumour?g.findIndex(R=>{var A;return R.disease===((A=m.tumour)==null?void 0:A.disease)}):-1,O=M.useMemo(()=>g.map(R=>{const A=R.values.filter(K=>K!==null),B=A.map(K=>N(K));return{disease:R,stats:Im(A),values:A,py:B,slots:VM(B,Tx)}}),[g]),_=d===null?null:O[d],D=((E=m.tumour)==null?void 0:E.fga)??null;return r.jsxs("section",{className:"fga sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Fraction of genome altered against the cohort",r.jsxs("span",{className:"sv-h-n",children:["project ",m.project,", n = ",m.n]})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"}),n.projects.length>1&&r.jsx(Bl,{label:"Project",value:m.project??"",onChange:R=>c(R),options:n.projects.map(R=>({value:R.project??"",label:`Project ${R.project}`}))})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:l,className:"fga-plot",onMouseLeave:()=>h(null),children:[r.jsx("div",{className:"fga-scroll",children:r.jsxs("svg",{width:S,height:Ri+Ai+Ex,role:"img","aria-label":`FGA by disease in project ${m.project}`,children:[[0,.25,.5,.75,1].map(R=>r.jsxs("g",{children:[r.jsx("line",{x1:_i,x2:_i+b,y1:N(R),y2:N(R),className:R===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:_i-8,y:N(R)+4,textAnchor:"end",className:"ctx-tick",children:Oi(R)})]},R)),O.map(({disease:R,stats:A,values:B,py:K,slots:k},ie)=>{const oe=j+v*ie+v/2,se=Math.min(30,v*.46),P=ie===T;return r.jsxs("g",{className:"fga-col","data-on":d===ie||void 0,"data-mine":P||void 0,children:[r.jsx("rect",{x:j+v*ie+2,y:Ri-6,width:v-4,height:Ai+12,rx:10,className:"fga-band"}),A&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:oe,x2:oe,y1:N(A.high),y2:N(A.low),className:"fga-whisker"}),r.jsx("rect",{x:oe-se/2,y:N(A.q3),width:se,height:Math.max(N(A.q1)-N(A.q3),1.5),rx:5,className:"fga-box"}),r.jsx("line",{x1:oe-se/2,x2:oe+se/2,y1:N(A.median),y2:N(A.median),className:"fga-median"})]}),B.map((le,$)=>r.jsx("circle",{cx:oe+k[$]*(Tx+1),cy:K[$],r:2.8,className:"fga-dot"},$)),r.jsx("text",{x:oe,y:Ri+Ai+20,textAnchor:"middle",className:"fga-label",children:R.disease}),r.jsx("rect",{x:j+v*ie,y:Ri-8,width:v,height:Ai+Ex+8,fill:"transparent",tabIndex:0,"aria-label":`${R.name??R.disease}: ${B.length} samples`,onMouseEnter:()=>h(ie),onFocus:()=>h(ie),onBlur:()=>h(null)})]},R.disease)}),T>=0&&D!==null&&r.jsxs("g",{className:"fga-pin",pointerEvents:"none",transform:`translate(${j+v*T+v/2} ${N(D)})`,children:[r.jsx("circle",{r:8,className:"fga-pin-dot"}),r.jsxs("g",{transform:"translate(0 -18)",children:[r.jsx("rect",{x:-44,y:-11,width:88,height:20,rx:10,className:"fga-pin-chip"}),r.jsxs("text",{y:3.5,textAnchor:"middle",className:"fga-pin-text",children:["This tumour ",Oi(D)]})]})]})]})}),_&&d!==null&&r.jsxs(Zt,{x:Math.min(j+v*d+v/2,a-10),y:Ri+Ai/2,width:a,children:[r.jsx("span",{className:"ctip-title",children:_.disease.name??_.disease.disease}),_.stats&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Samples"}),r.jsx("b",{children:_.stats.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Oi(_.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Oi(_.stats.q1),"–",Oi(_.stats.q3)]})]})]}),d===T&&D!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",Oi(D),"."," ",vS(D,IM(_.values,D),`${_.disease.disease} sample`)]})]})]})})]})}function IM(n,l){const a=n.indexOf(l);return a<0?n:[...n.slice(0,a),...n.slice(a+1)]}const _x=8,Rx=n=>`chr${n.chrom} · ${(n.start/1e6).toFixed(1)} Mb`;function QM({gene:n}){const l=n.copy_number??0,a=Math.min(Math.round(l),_x);return r.jsx("span",{className:"cng-meter","data-alteration":n.alteration,"aria-hidden":!0,children:Array.from({length:_x},(o,c)=>r.jsx("span",{"data-on":c<a||void 0},c))})}function YM({project:n,value:l}){if(l===null)return null;const a=l>=0;return r.jsxs("span",{className:"cng-expr","data-up":a||void 0,title:`RNA expression against the project ${n} cohort: log2 of this sample's level over the cohort mean`,children:[r.jsx("span",{className:"cng-arrow","aria-hidden":!0,children:a?"▲":"▼"}),a?"+":"−",Math.abs(l).toFixed(1),r.jsxs("i",{children:["p",n]})]})}function PM({genes:n,onHover:l,onLocate:a}){const o=n.filter(d=>d.alteration==="amplification").length,c=n.length-o;return r.jsxs("section",{className:"cng sig-section","aria-label":"Amplified and lost genes",children:[r.jsxs("h3",{className:"sv-h",children:["Amplified and lost genes",r.jsx("span",{className:"sv-h-n",children:n.length?`${o} amplified oncogene${o===1?"":"s"}, ${c} lost tumour suppressor${c===1?"":"s"}`:"none"})]}),n.length===0?r.jsx("p",{className:"sv-empty",children:"The report calls no amplified oncogenes or homozygously lost tumour suppressors."}):r.jsx("ul",{className:"cng-list",onMouseLeave:()=>l(null),children:n.map(d=>r.jsx("li",{children:r.jsxs("button",{type:"button",className:"cng-row","data-alteration":d.alteration,onMouseEnter:()=>l(d),onFocus:()=>l(d),onBlur:()=>l(null),onClick:()=>a(d),"aria-label":`${d.gene}, ${d.alteration}, ${d.copy_number??"unknown"} copies, ${Rx(d)}: show on the plot`,children:[r.jsx("span",{className:"cng-gene",children:d.gene}),r.jsx("span",{className:"cng-where mono",children:Rx(d)}),r.jsxs("span",{className:"cng-copies",children:[r.jsx(QM,{gene:d}),r.jsxs("span",{className:"cng-n",children:[d.copy_number===null?"?":d.copy_number,r.jsx("small",{children:d.copy_number===1?" copy":" copies"})]})]}),r.jsx("span",{className:"cng-call",children:d.alteration==="amplification"?"Amplified":"Lost"}),r.jsx("span",{className:"cng-exprs",children:d.expression.map(h=>r.jsx(YM,{project:h.project,value:h.log2_fold},h.project))})]})},d.gene))})]})}function fr({color:n,label:l}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-1 w-3.5 rounded-sm",style:{background:n}}),l]})}function XM({envelope:n,loading:l}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(qM,{data:n.data}):(n==null?void 0:n.status)==="missing"&&n.warnings.some(a=>a.includes("Rerun"))?r.jsxs("section",{className:"sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsx("h3",{className:"sv-h",children:"Fraction of genome altered against the cohort"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")})]}):l&&!n?r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:200},"aria-label":"Loading the FGA cohort figure"})}):null}function KM({envelope:n,loading:l,picked:a,sampleLabel:o,drivers:c,focus:d,locate:h,onSegment:m,onGene:g,fga:x,fgaLoading:v=!1,onOpenChromosome:y}){var ie;const[S,j]=M.useState("total"),[b,N]=M.useState(null),[T,O]=M.useState(null),_=oe=>({chrom:oe.chrom,pos:Math.round((oe.start+oe.end)/2),gene:oe.gene}),D=M.useMemo(()=>T&&(!h||T.nonce>h.nonce)?T:h,[h,T]),[C,E]=M.useState({window:[0,it],smooth:!1}),R=((ie=n==null?void 0:n.data)==null?void 0:ie.allele_specific)??!1,A=yM(...C.window),B=M.useCallback(()=>E({window:[0,it],smooth:!0}),[]),K=A?qm(C.window[0]+1e-6):null,k=K&&K===qm(C.window[1]-1e-6)?K:null;return r.jsx(eM,{title:"Copy number",subtitle:`Copy number across the genome, ${o}`,info:"copyNumber",envelope:n,loading:l,picked:a,skeletonHeight:250,moreLineage:x==null?void 0:x.lineage,controls:r.jsxs(r.Fragment,{children:[A&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-xs",style:{color:"var(--ink-2)"},"aria-live":"polite",children:A}),r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole genome",title:"Show the whole genome",onClick:B,children:r.jsx(Z1,{size:15,"aria-hidden":!0})}),k&&y&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":`Open chromosome ${k} in the CN/SV view`,title:`Open chromosome ${k} in the CN/SV view`,onClick:()=>y(k),children:r.jsx(I1,{size:15,"aria-hidden":!0})})]}),r.jsx(Bl,{label:"Copy number view",value:R?S:"total",onChange:j,options:[{value:"total",label:"Total"},{value:"allele",label:"Allele-specific",disabled:!R}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[S==="total"||!R?r.jsxs(r.Fragment,{children:[r.jsx(fr,{color:"var(--gain)",label:"Gain"}),r.jsx(fr,{color:"var(--gain-strong)",label:"Amplification"}),r.jsx(fr,{color:"var(--loss)",label:"Loss"})]}):r.jsxs(r.Fragment,{children:[r.jsx(fr,{color:"var(--ink-2)",label:"Major allele"}),r.jsx(fr,{color:"var(--chev)",label:"Minor allele"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:"Scroll up or down over the plot to zoom, sideways (or drag) to pan, or move the window in the overview. Double-click a chromosome, or click its name, to fill the view."})]}),children:oe=>r.jsxs(r.Fragment,{children:[r.jsx(RM,{data:oe,mode:R?S:"total",drivers:c,focus:b??d,locate:D,view:C,onView:E,onSegment:m,onGene:g}),oe.genes&&r.jsx(PM,{genes:oe.genes,onHover:se=>N(se?_(se):null),onLocate:se=>O({..._(se),nonce:Date.now()})}),r.jsx(XM,{envelope:x,loading:v})]})})}function ZM(n){const[l,a]=n.range;return[[l,0],...n.bins.map(o=>[(o.x0+o.x1)/2,o.n]),[a,0]]}function Bh(n,l){for(let a=1;a<n.length;a++){const[o,c]=n[a-1],[d,h]=n[a];if(l<=d)return d===o?h:c+(l-o)/(d-o)*(h-c)}return n[n.length-1][1]}function JM(n){return n==="ccf"?"CCF":"VAF"}function Gs(n,l){return Math.min(Math.max(l,n.range[0]),n.range[1])}function WM(n){const l=n.measure==="ccf"?.25:.1,a=[];for(let o=n.range[0];o<=n.range[1]+1e-9;o+=l)a.push(Math.round(o*100)/100);return a}function eE(n,l){return n.measure==="ccf"?l===1?"1.0":l.toFixed(2).replace(/0$/,""):l.toFixed(1)}const ya=14,tE=22,dr=118,nE=40,zi=19,Ax=n=>Math.round(n*100)/100;function sE({data:n,range:l,focus:a,onRange:o,onGene:c}){const[d,h]=Es(),m=M.useId(),g=M.useRef(null),[x,v]=M.useState(null),[y,S]=M.useState(null),[j,b]=n.range,N=h-tE,T=U=>ya+(U-j)/(b-j)*(N-ya),O=U=>j+(U-ya)/(N-ya)*(b-j),_=M.useMemo(()=>ZM(n),[n]),D=Math.max(1,..._.map(U=>U[1])),C=U=>U*zi+8+dr,E=(U,I)=>C(U)-I/(D*1.1)*dr,R=M.useMemo(()=>[...n.drivers].sort((U,I)=>U.value-I.value),[n.drivers]),A=R.map(U=>({left:T(Gs(n,U.value))-Cs(U.gene??"?",11.5,600)/2-6,width:Cs(U.gene??"?",11.5,600)+12})),B=zu(A,4),K=R.length?Math.max(...B)+1:0,k=C(K),ie=k+nE,oe=_.map(([U,I])=>[T(U),E(K,I)]),se=jM(oe),P=`${se} L${T(b).toFixed(2)},${k} L${T(j).toFixed(2)},${k} Z`,le=U=>U.kind==="new"?[Math.min(U.from,U.to),Math.max(U.from,U.to)]:U.kind==="edge"?[Math.min(U.fixed,U.to),Math.max(U.fixed,U.to)]:U.range,$=x?le(x):l,J=U=>{const I=g.current.getBoundingClientRect();return O(Math.min(Math.max(U-I.left,ya),N))},Z=(U,I,re)=>{U.preventDefault(),U.stopPropagation();let ce=I(J(U.clientX));v(ce),Du(U,(xe,Te)=>{ce=re(ce,J(Te.clientX)),v(ce)},()=>{const[xe,Te]=le(ce);if(v(null),T(Te)-T(xe)<4)return o(null);o([Ax(Gs(n,xe)),Ax(Gs(n,Te))])})},W=(U,I)=>U.kind==="move"?U:{...U,to:I},ae=(U,I)=>{if(U.kind!=="move")return U;const re=U.range[1]-U.range[0],ce=Math.min(Math.max(U.range[0]+(I-U.grab),j),b-re);return{...U,grab:I,range:[ce,ce+re]}},de=$?[T(Gs(n,$[0])),T(Gs(n,$[1]))]:null,ve=JM(n.measure),je=a?n.measure==="ccf"?a.ccf:a.vaf:null,L=y!==null?R[y]:null;return r.jsxs("div",{ref:d,className:"dens","data-brushing":x?"":void 0,children:[r.jsxs("svg",{ref:g,width:h,height:ie,role:"img","aria-label":`${ve} of ${n.total} variants in ${n.sample}${n.drivers.length?`, with ${n.drivers.map(U=>`${U.gene} at ${U.value.toFixed(2)}`).join(", ")}`:""}.`,onPointerDown:U=>{U.button===0&&Z(U,I=>({kind:"new",from:I,to:I}),W)},children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:`${m}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.42}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.03})]}),r.jsx("clipPath",{id:`${m}-spot`,children:de&&r.jsx("rect",{x:de[0],y:0,width:Math.max(de[1]-de[0],0),height:ie})})]}),WM(n).map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:T(U),x2:T(U),y1:K*zi+8,y2:k,className:"dens-grid","data-clonal":n.measure==="ccf"&&U===1?"":void 0}),r.jsx("text",{x:T(U),y:k+18,textAnchor:"middle",className:"dens-tick",children:eE(n,U)})]},U)),n.measure==="ccf"&&j<=1&&b>=1&&r.jsx("text",{x:T(1),y:k+31,textAnchor:"middle",className:"dens-clonal",children:"clonal"}),r.jsxs("g",{className:"dens-curve","data-dim":de?"":void 0,children:[r.jsx("path",{d:P,fill:`url(#${m}-fill)`}),r.jsx("path",{d:se,className:"dens-line"})]}),de&&r.jsx("g",{className:"dens-curve dens-lit",children:r.jsxs("g",{clipPath:`url(#${m}-spot)`,children:[r.jsx("path",{d:P,fill:`url(#${m}-fill)`}),r.jsx("path",{d:se,className:"dens-line"})]})}),r.jsx("line",{x1:ya,x2:N,y1:k,y2:k,className:"dens-axis"}),n.median!==null&&r.jsx("path",{d:`M${T(n.median)},${k+1} l4.5,-6 l-4.5,-6 l-4.5,6 z`,className:"dens-median",children:r.jsx("title",{children:`Median ${n.median.toFixed(2)}`})}),R.map((U,I)=>{const re=Gs(n,U.value),ce=T(re),xe=E(K,Bh(_,re)),Te=U.gene??"?",me=Cs(Te,11.5,600)+12,Se=8+B[I]*zi,ct=y===I;return r.jsxs("g",{className:"dens-driver","data-on":ct||void 0,onPointerDown:Ct=>Ct.stopPropagation(),onMouseEnter:()=>S(I),onMouseLeave:()=>S(null),onClick:()=>U.gene&&c(U.gene),children:[r.jsx("line",{x1:ce,x2:ce,y1:Se+15,y2:xe,className:"dens-leader"}),r.jsx("rect",{x:ce-me/2,y:Se,width:me,height:16,rx:8,className:"dens-chip"}),r.jsx("text",{x:ce,y:Se+11.5,textAnchor:"middle",className:"dens-gene",children:Te}),r.jsx("circle",{cx:ce,cy:xe,r:ct?7:5.5,className:"dens-dot"})]},`${Te}-${I}`)}),je!=null&&r.jsx("g",{className:"dens-focus",pointerEvents:"none",children:(()=>{const U=Gs(n,je),I=T(U),re=E(K,Bh(_,U)),ce=`${(a==null?void 0:a.gene)??"?"} ${je.toFixed(2)}`,xe=Cs(ce,11,600)+14,Te=I+12+xe>h;return r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:I,x2:I,y1:re,y2:k,className:"dens-focus-line"}),r.jsx("circle",{cx:I,cy:re,r:6.5,className:"dens-focus-dot"}),r.jsxs("g",{transform:`translate(${Te?I-12-xe:I+12} ${re-11})`,children:[r.jsx("rect",{width:xe,height:22,rx:7,className:"dens-focus-chip"}),r.jsx("text",{x:7,y:15,className:"dens-focus-text",children:ce})]})]})})()}),$&&de&&r.jsxs("g",{className:"dens-brush",children:[r.jsx("rect",{x:de[0],y:K*zi+4,width:Math.max(de[1]-de[0],0),height:dr+8,className:"dens-sel",onPointerDown:U=>Z(U,I=>({kind:"move",grab:I,range:$}),ae)}),[0,1].map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:de[U],x2:de[U],y1:K*zi+4,y2:k,className:"dens-sel-edge"}),r.jsx("rect",{x:de[U]-5,y:K*zi+4,width:10,height:dr+8,className:"dens-edge",onPointerDown:I=>Z(I,()=>({kind:"edge",fixed:$[1-U],to:$[U]}),W)}),r.jsx("rect",{x:de[U]-3,y:k-dr/2-10,width:6,height:20,rx:3,className:"dens-grip",pointerEvents:"none"})]},U)),r.jsxs("g",{transform:`translate(${Math.min(Math.max((de[0]+de[1])/2,ya+48),N-48)} ${k-30})`,pointerEvents:"none",children:[r.jsx("rect",{x:-48,y:0,width:96,height:20,rx:10,className:"dens-readout"}),r.jsxs("text",{y:14,textAnchor:"middle",className:"dens-readout-text",children:[$[0].toFixed(2)," – ",$[1].toFixed(2)]})]})]})]}),L&&y!==null&&r.jsxs(Zt,{x:T(Gs(n,L.value)),y:E(K,Bh(_,Gs(n,L.value)))-22,width:h,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:L.gene??"?"}),L.protein_change&&r.jsxs("span",{className:"ctip-sub",children:[" ",L.protein_change]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:ve}),r.jsx("b",{children:L.value.toFixed(2)})]}),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}function lE({envelope:n,loading:l,measure:a,onMeasure:o,range:c,focus:d,onRange:h,onGene:m}){const g=a==="ccf"?"Cancer cell fraction":"Variant allele fraction",x=(n==null?void 0:n.status)==="ok"?n.data:null;return r.jsxs("div",{className:"strip",children:[r.jsxs("div",{className:"strip-head",children:[r.jsx("span",{className:"text-[13px] font-semibold",children:g}),x&&r.jsxs("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:[x.median!==null?`Median ${x.median.toFixed(2)}. `:"","Drag across the plot to filter the table."]}),r.jsx("span",{className:"flex-auto"}),r.jsx(Bl,{label:"Measure",value:a,onChange:o,options:[{value:"ccf",label:"CCF"},{value:"vaf",label:"VAF"}]})]}),r.jsx(Vl,{label:g,envelope:n,loading:l,skeletonHeight:180,children:v=>r.jsx(sE,{data:v,range:c,focus:d,onRange:h,onGene:m})})]})}const aE=Object.keys(uS),iE=Object.keys(fS);function Ox(n,l){return n.includes(l)?n.filter(a=>a!==l):[...n,l]}function Gh({label:n,count:l,active:a,onClick:o}){return r.jsxs("button",{type:"button",className:"facet","aria-pressed":a,"data-empty":!a&&l===0,onClick:o,children:[r.jsx("span",{className:"facet-check","aria-hidden":!0,children:a&&r.jsx(Q1,{size:11,strokeWidth:3})}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"facet-n",children:l===void 0?"":l.toLocaleString("en-US")})]})}function oE({table:n,data:l,onChange:a}){const o=l==null?void 0:l.facets.effects,c=l==null?void 0:l.facets.flags,d=n.range;return r.jsxs("aside",{className:"facets","aria-label":"Filters",children:[r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Effect",children:[r.jsx("span",{className:"facet-title",children:"Effect"}),aE.map(h=>r.jsx(Gh,{label:uS[h],count:o==null?void 0:o[h],active:n.effects.includes(h),onClick:()=>a({effects:Ox(n.effects,h)})},h))]}),r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Flags",children:[r.jsx("span",{className:"facet-title",children:"Flags"}),iE.map(h=>r.jsx(Gh,{label:fS[h],count:c==null?void 0:c[h],active:n.flags.includes(h),onClick:()=>a({flags:Ox(n.flags,h)})},h))]}),(l==null?void 0:l.ffpe)&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"FFPE filter",children:[r.jsx("span",{className:"facet-title",children:"FFPE filter"}),r.jsx(Gh,{label:"Show filtered calls",count:l.ffpe.removed,active:n.ffpe,onClick:()=>a({ffpe:!n.ffpe})}),r.jsx("span",{className:"facet-note",children:l.ffpe.threshold!==null?`As in the report, calls FFPERASE scores above ${l.ffpe.threshold} are left out of the counts.`:"As in the report, calls its FFPE filter removes are left out of the counts."})]}),d&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Range",children:[r.jsxs("span",{className:"facet-title",children:[d.measure==="ccf"?"CCF":"VAF"," range"]}),r.jsxs("span",{className:"facet-range",children:[r.jsxs("span",{className:"mono",children:[d.low.toFixed(2)," – ",d.high.toFixed(2)]}),r.jsx("button",{type:"button",className:"sc-ib xs","aria-label":"Remove the range",title:"Remove the range",onClick:()=>a({range:null}),children:r.jsx(Bu,{size:13,"aria-hidden":!0})})]})]}),cS(n)>0&&r.jsx("button",{type:"button",className:"facet-clear",onClick:()=>a({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]})}const qh=48,hr=16,mr=200,rE=26,Di=["#1baf7a","#eda100"],Ih=[{key:"snvs",label:"SNVs"},{key:"indels",label:"Indels"}];function cE({data:n}){const[l,a]=Es(760),[o,c]=M.useState(null),d=n.cohorts,h=d.length>1,m=(a-qh-8)/Ih.length,g=Math.min(m*.34,90),x=b=>{const N=[...d.flatMap(O=>O[b]),n.tumour[b]].filter(O=>O!==null),T=Pu(Math.max(...N,1),4);return{ticks:T,top:T[T.length-1]}},v=o?d[o.cohort]:null,y=o&&v?v[o.event]:[],S=Im(y),j=o?n.tumour[o.event]:null;return r.jsxs("section",{className:"tmbc sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Coding mutations against reference cohorts",n.disease&&r.jsx("span",{className:"sv-h-n",children:n.disease})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[d.map((b,N)=>r.jsxs("li",{children:[r.jsx("span",{className:"sv-swatch",style:{background:Di[N%Di.length]},"aria-hidden":!0}),b.cohort,b.n!==null&&r.jsx("span",{className:"sv-key-n",children:b.n})]},b.cohort??N)),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]})]}),r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:l,className:"fga-plot",onMouseLeave:()=>c(null),children:[r.jsx("svg",{width:a,height:hr+mr+rE,role:"img","aria-label":`Coding SNVs and indels against ${d.map(b=>b.cohort).join(" and ")}`,children:Ih.map(({key:b,label:N},T)=>{const{ticks:O,top:_}=x(b),D=qh+m*T,C=D+m/2,E=A=>hr+mr*(1-A/_),R=n.tumour[b];return r.jsxs("g",{children:[O.map(A=>r.jsxs("g",{children:[r.jsx("line",{x1:D+6,x2:D+m-6,y1:E(A),y2:E(A),className:A===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:D,y:E(A)+4,textAnchor:"end",className:"ctx-tick",children:A.toLocaleString("en-US")})]},A)),d.map((A,B)=>{const K=FM(A[b]),k=h?B===0?-1:1:0,ie=Di[B%Di.length],oe=K.length?k===0?[...K.map($=>`${C+$.d*g},${E($.v)}`),...[...K].reverse().map($=>`${C-$.d*g},${E($.v)}`)]:[`${C},${E(K[0].v)}`,...K.map($=>`${C+k*$.d*g},${E($.v)}`),`${C},${E(K[K.length-1].v)}`]:[],se=Im(A[b]),P=(o==null?void 0:o.event)===b&&o.cohort===B,le=k===0?C:C+k*6;return r.jsxs("g",{className:"tmb-violin","data-on":P||void 0,onMouseEnter:()=>c({event:b,cohort:B}),children:[oe.length>0&&r.jsx("polygon",{points:oe.join(" "),style:{fill:ie,stroke:ie},className:"tmb-shape"}),se&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:le,x2:le,y1:E(se.q1),y2:E(se.q3),className:"tmb-iqr"}),r.jsx("circle",{cx:le,cy:E(se.median),r:3,className:"tmb-median"})]}),!oe.length&&A[b].map(($,J)=>$===null?null:r.jsx("circle",{cx:C+k*10,cy:E($),r:3,style:{fill:ie}},J)),r.jsx("rect",{x:k===1?C:C-g-4,y:hr,width:k===0?g*2+8:g+4,height:mr,fill:"transparent"})]},A.cohort??B)}),R!==null&&r.jsxs("g",{pointerEvents:"none",className:"tmb-tumour",children:[r.jsx("line",{x1:C-g-10,x2:C+g+10,y1:E(R),y2:E(R),className:"tmb-tumour-line"}),r.jsx("circle",{cx:C,cy:E(R),r:7,className:"fga-pin-dot"}),r.jsx("text",{x:C+12,y:E(R)-9,className:"tmb-tumour-text",children:R.toLocaleString("en-US")})]}),r.jsx("text",{x:C,y:hr+mr+19,textAnchor:"middle",className:"fga-label",children:N})]},b)})}),o&&v&&r.jsxs(Zt,{x:qh+m*Ih.findIndex(b=>b.key===o.event)+m/2+(h?o.cohort===0?-g/2:g/2:0),y:hr+mr/2,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Di[o.cohort%Di.length]},"aria-hidden":!0}),v.cohort,", coding ",o.event==="snvs"?"SNVs":"indels"]}),S&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Tumours"}),r.jsx("b",{children:S.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Math.round(S.median).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Math.round(S.q1).toLocaleString("en-US"),"–",Math.round(S.q3).toLocaleString("en-US")]})]})]}),j!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",j.toLocaleString("en-US"),". ",vS(j,y,`${v.cohort} tumour`)]})]})]})})]})}/**
|
|
276
|
+
*/const uC=ze("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
277
|
+
* @license lucide-react v0.468.0 - ISC
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the ISC license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const dC=ze("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
282
|
+
* @license lucide-react v0.468.0 - ISC
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the ISC license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const hC=ze("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);/**
|
|
287
|
+
* @license lucide-react v0.468.0 - ISC
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the ISC license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const Yr=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
292
|
+
* @license lucide-react v0.468.0 - ISC
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the ISC license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const fy=ze("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function fC(n){if(n.value===null)return n.text??"";switch(n.key){case"coverage":return`${Math.round(n.value)}×`;case"tmb":return n.value<.01?n.value.toPrecision(2):n.value.toFixed(2);default:return n.value.toFixed(2)}}function mC(n){return n.status==="failed"?"Failed":n.status==="skipped"?"Not in this mode":"Not run"}const gC=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short",year:"numeric"});function my(n){if(!n)return"";const l=new Date(n);return Number.isNaN(l.getTime())?"":gC.format(l)}function Lr(n,l){return n.startsWith(`${l}_`)?n.slice(l.length+1):n}function Qm(n){return n==null?"–":n.toFixed(2)}const vv={missense_variant:"Missense",stop_gained:"Nonsense",stop_lost:"Stop lost",start_lost:"Start lost",frameshift_variant:"Frameshift",inframe_deletion:"In-frame deletion",inframe_insertion:"In-frame insertion",splice_acceptor_variant:"Splice acceptor",splice_donor_variant:"Splice donor",splice_region_variant:"Splice region",synonymous_variant:"Synonymous",intron_variant:"Intronic",upstream_gene_variant:"Upstream",downstream_gene_variant:"Downstream","5_prime_UTR_variant":"5′ UTR","3_prime_UTR_variant":"3′ UTR"};function pC(n,l){const a=(n??l??"").split("&")[0];if(!a)return"–";if(vv[a])return vv[a];const i=a.replace(/_/g," ");return i.charAt(0).toUpperCase()+i.slice(1)}function $r(n,l){return`chr${n}:${l.toLocaleString("en-US")}`}const jn=[["1",249250621],["2",243199373],["3",198022430],["4",191154276],["5",180915260],["6",171115067],["7",159138663],["8",146364022],["9",141213431],["10",135534747],["11",135006516],["12",133851895],["13",115169878],["14",107349540],["15",102531392],["16",90354753],["17",81195210],["18",78077248],["19",59128983],["20",63025520],["21",48129895],["22",51304566],["X",155270560]],Ym=.0025,vC=jn.reduce((n,[,l])=>n+l,0),xC=1-Ym*jn.length,Ku=(()=>{const n={};let l=Ym/2;for(const[a,i]of jn){const c=i/vC*xC;n[a]=[l,l+c],l+=c+Ym}return n})(),xv=Object.fromEntries(jn);function $u(n,l){const a=n.replace(/^chr/,""),i=Ku[a];if(!i)return null;const c=Math.min(Math.max(l,0),xv[a]);return i[0]+c/xv[a]*(i[1]-i[0])}function yv(n,l,a,i){const c=i*2*Math.PI-Math.PI/2;return[n+a*Math.cos(c),l+a*Math.sin(c)]}function Ff(n,l,a,i,c){const[d,f]=yv(n,l,a,i),[m,g]=yv(n,l,a,c),y=c-i>.5?1:0;return`M${d.toFixed(2)},${f.toFixed(2)} A${a},${a} 0 ${y} 1 ${m.toFixed(2)},${g.toFixed(2)}`}function Xm(n,l="start"){let a=null;for(const d of jn){const[f,m]=d,[g,y]=Ku[f];if(n<g&&l==="end"&&a)return{chrom:a[0],pos:a[1]};if(n<=y)return{chrom:f,pos:Math.round(Math.max(0,(n-g)/(y-g))*m)};a=d}const[i,c]=jn[jn.length-1];return{chrom:i,pos:c}}function Tr(n,l){const a=l>=1e6?0:l>=1e5?1:2;return`${(n/1e6).toFixed(a)} Mb`}const yC={hero:{box:220,ring:78,ringW:10,gain:93,gainW:7,amp:94,ampW:13,loss:63,lossW:7,drv:50,drvW:9},switcher:{box:48,ring:16,ringW:4.5,gain:21,gainW:3,amp:21,ampW:4.5,loss:11,lossW:3,drv:0,drvW:0},mini:{box:20,ring:7,ringW:2.6,gain:7,gainW:2.6,amp:7,ampW:2.6,loss:7,lossW:2.6,drv:0,drvW:0}},Sv=.004,bv=.003;function SC(n,l,a){const i=$u(n,l),c=$u(n,a);return i===null||c===null?null:c-i<Sv?[i,i+Sv]:[i,c]}function Bf(n){return n.length<=1?n[0]??"":`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`}function bC(n,l,a){return n===1?`one ${l}`:`${n} ${a}`}function gy(n){const a=[["amp","amplification","amplifications"],["gain","gain","gains"],["loss","loss","losses"]].flatMap(([f,m,g])=>{const y=n.events.filter(b=>b.kind===f);if(y.length===0)return[];const v=[...new Set(y.map(b=>b.chrom))],p=v.length>6?[...v.slice(0,6),`${v.length-6} more`]:v,S=v.length===1?`chromosome ${v[0]}`:`chromosomes ${Bf(p)}`,j=f==="amp"&&y.length===1&&y[0].total_cn!==null?` (${Math.round(y[0].total_cn)} copies)`:"";return[`${bC(y.length,m,g)} on ${S}${j}`]}),i=a.length?Bf(a):`no copy-number changes against ${n.baseline} copies`,c=[...new Set(n.drivers.map(f=>f.gene).filter(f=>!!f))].sort(),d=c.length?`Drivers in ${Bf(c)}.`:"No drivers.";return`${i.charAt(0).toUpperCase()}${i.slice(1)}. ${d}`}function wg({fingerprint:n,size:l,title:a,subtitle:i,className:c}){const d=yC[l],f=d.box/2,m=(n==null?void 0:n.events)??[],g=(n==null?void 0:n.drivers)??[],y=n?`Genome fingerprint: ${gy(n)}`:"No copy-number data";return r.jsxs("svg",{viewBox:`0 0 ${d.box} ${d.box}`,role:l==="mini"?void 0:"img","aria-label":l==="mini"?void 0:y,"aria-hidden":l==="mini"?!0:void 0,className:c,children:[r.jsxs("g",{fill:"none",strokeLinecap:"butt",children:[Object.entries(Ku).map(([v,[p,S]])=>r.jsx("path",{className:"r-neu",strokeWidth:d.ringW,d:Ff(f,f,d.ring,p,S)},v)),m.map((v,p)=>{const S=SC(v.chrom,v.start,v.end);if(!S)return null;const j=v.kind==="loss"?d.loss:v.kind==="amp"?d.amp:d.gain,b=v.kind==="loss"?d.lossW:v.kind==="amp"?d.ampW:d.gainW;return r.jsx("path",{className:`r-${v.kind}`,strokeWidth:b,d:Ff(f,f,j,S[0],S[1])},`${v.chrom}-${v.start}-${p}`)}),d.drvW>0&&g.map((v,p)=>{const S=$u(v.chrom,v.pos);return S===null?null:r.jsx("path",{className:"r-drv",strokeWidth:d.drvW,d:Ff(f,f,d.drv,S-bv/2,S+bv/2)},`${v.gene}-${v.pos}-${p}`)})]}),l==="hero"&&a&&r.jsxs(r.Fragment,{children:[r.jsx("text",{className:"t-ink",x:f,y:f-2,textAnchor:"middle",fontSize:"24",fontWeight:"800",children:a}),i&&r.jsx("text",{className:"t-faint",x:f,y:f+18,textAnchor:"middle",fontSize:"12",fontWeight:"600",children:i})]})]})}const jC={"DNA|WG":{label:"WGS",icon:Xu},"RNA|WT":{label:"RNA",icon:qN}};function jv({children:n}){return r.jsx("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:n})}function wC({sex:n}){const l=n==null?void 0:n.toUpperCase();return l==="MALE"?r.jsxs(jv,{children:[r.jsx("circle",{cx:"12",cy:"9",r:"4.5"}),r.jsx("path",{d:"M7.6 8.2c.5-2.9 2.4-4.7 4.6-4.7 2.6 0 4.4 1.7 4.4 4.3-2.2.1-4.2-.6-5.6-2.1"}),r.jsx("path",{d:"M3.5 21a8.5 7.5 0 0 1 17 0"}),r.jsx("path",{d:"m10 15.6 2 2.2 2-2.2"})]}):l==="FEMALE"?r.jsxs(jv,{children:[r.jsx("circle",{cx:"12",cy:"9.2",r:"3.4"}),r.jsx("path",{d:"M6.3 14.2C4.6 9 6.6 2.8 12 2.8s7.4 6.2 5.7 11.4"}),r.jsx("path",{d:"M5 21.2a7 6.3 0 0 1 14 0"})]}):r.jsx(uC,{size:16,"aria-hidden":!0})}const py="wgts-patient-root";function NC(n,l){const a=n.getBoundingClientRect(),i=n.closest(".topbar"),c=i==null?void 0:i.parentElement,d=i&&c?c.getBoundingClientRect().top-i.getBoundingClientRect().top:0;return{x:a.left-l.left+a.width/2,y:a.top+d-l.top+a.height/2}}const vy=8;function Vf(n,l,a,i){const c=a>=n.x?1:-1,d=Math.min(vy,Math.abs(a-n.x)/2,(l-n.y-14)/2);return[`M${n.x},${n.y+14}`,`V${l-d}`,`Q${n.x},${l} ${n.x+c*d},${l}`,`H${a-c*d}`,`Q${a},${l} ${a},${l+d}`,`V${i}`].join(" ")}function CC(n,l,a){const i=a.x>l.x?1:-1,c=Math.min(vy,Math.abs(a.x-l.x)/2,(l.top-n)/2);return[`M${l.x},${l.top}`,`V${n+c}`,`Q${l.x},${n} ${l.x+i*c},${n}`,`H${a.x-i*c}`,`Q${a.x},${n} ${a.x},${n+c}`,`V${a.top}`].join(" ")}function MC(n,l,a){const i=l.left+l.width/2,c=a.left+a.width/2,d=n-7,m=(n-25-.25*d)/.75;return`M${i},${d} C${i},${m} ${c},${m} ${c},${d}`}function EC(n,l){var i,c;const a=n.samples.find(d=>d.id===l);for(const d of(a==null?void 0:a.experiments)??[]){const f=(i=n.experiments[d])==null?void 0:i.normal,m=f?(c=n.experiments[f])==null?void 0:c.sample:void 0;if(m&&m!==l)return m}return null}function _C({data:n,sampleId:l,fingerprint:a,onSample:i}){const c=C.useRef(null),[d,f]=C.useState(null),[m,g]=C.useState(!1);C.useEffect(()=>{if(!d||m)return;const A=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(A)},[d,m]);const y=new Set(n.failures.map(A=>A.sample)),v=C.useRef(l),[p,S]=C.useState(null);C.useEffect(()=>{if(v.current===l)return;const A=v.current;v.current=l,S(T=>({from:A,to:l,n:((T==null?void 0:T.n)??0)+1}))},[l]);const j=EC(n,l);C.useLayoutEffect(()=>{const A=c.current;if(!A)return;const T=()=>{const M=A.getBoundingClientRect(),_=document.getElementById(py);if(!_)return;const R=Array.from(A.querySelectorAll("[data-sample]")).map(K=>{const O=K.getBoundingClientRect();return{id:K.dataset.sample,x:O.left-M.left+22,left:O.left-M.left,width:O.width,top:O.top-M.top,bottom:O.bottom-M.top}}),k=NC(_,M),I=Math.min(...R.map(K=>K.top));f({root:k,trunk:I-12,tabs:R})};if(T(),typeof ResizeObserver>"u")return;const L=new ResizeObserver(T);return L.observe(A),()=>L.disconnect()},[n,l]);const b=d==null?void 0:d.tabs.find(A=>A.id===l),N=j?d==null?void 0:d.tabs.find(A=>A.id===j):void 0,E=p?d==null?void 0:d.tabs.find(A=>A.id===p.from):void 0;return r.jsxs("div",{ref:c,className:"ltabs",children:[d&&r.jsxs("svg",{className:"ltabs-links","aria-hidden":!0,children:[d.tabs.map(A=>r.jsx("path",{d:Vf(d.root,d.trunk,A.x,A.top)},A.id)),b&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":m,style:{d:`path("${Vf(d.root,d.trunk,b.x,b.top)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":m,style:{d:`path("${Vf(d.root,d.trunk,b.x,b.top)}")`}}),E&&p&&p.to===b.id&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:CC(d.trunk,E,b)},`bead-${p.n}`)]}),b&&N&&r.jsxs("g",{className:"ltabs-match",children:[r.jsx("path",{d:MC(d.trunk,b,N)}),r.jsx("text",{x:(b.left+b.width/2+N.left+N.width/2)/2,y:d.trunk-27,children:"matched normal"})]})]}),b&&r.jsx("span",{className:"ltabs-thumb","data-moving":m,"aria-hidden":!0,style:{width:b.width,height:b.bottom-b.top,transform:`translate(${b.left}px, ${b.top}px)`}}),r.jsx("div",{className:"ltabs-row",role:"tablist","aria-label":"Samples",children:n.samples.map(A=>{const T=A.id===l,L=a==null?void 0:a.samples.find(_=>_.sample===A.id),M=A.experiments.map(_=>({id:_,...n.experiments[_]})).filter(_=>_.technique);return r.jsxs("button",{type:"button",role:"tab","data-sample":A.id,"aria-selected":T,className:"ltab",onClick:()=>i(A.id),children:[r.jsxs("span",{className:"ltab-name",children:[A.category==="TUMOR"?r.jsx(wg,{fingerprint:L,size:"mini",className:"h-[18px] w-[18px] flex-none"}):r.jsx(dy,{size:15,"aria-hidden":!0,className:"flex-none"}),Lr(A.id,n.individual.id)," ",A.category==="TUMOR"?"tumour":"normal",y.has(A.id)&&r.jsx("span",{className:"ltab-warn",title:"A module failed for this sample","aria-label":"A module failed"})]}),r.jsxs("span",{className:"ltab-exps",children:[M.length===0&&r.jsx("span",{children:"No experiments"}),M.map(_=>{const R=jC[_.technique],k=(R==null?void 0:R.icon)??Xu;return r.jsxs("span",{title:_.id,children:[r.jsx(k,{size:12,"aria-hidden":!0}),(R==null?void 0:R.label)??_.technique]},_.id)})]})]},A.id)})})]})}function TC({data:n,sampleId:l,fingerprint:a,onSample:i}){return r.jsx("div",{className:"ctabs",role:"tablist","aria-label":"Samples",children:n.samples.map(c=>{const d=a==null?void 0:a.samples.find(f=>f.sample===c.id);return r.jsxs("button",{type:"button",role:"tab","aria-selected":c.id===l,className:"ctab",onClick:()=>i(c.id),children:[c.category==="TUMOR"?r.jsx(wg,{fingerprint:d,size:"mini",className:"h-[16px] w-[16px] flex-none"}):r.jsx(dy,{size:14,"aria-hidden":!0,className:"flex-none"}),Lr(c.id,n.individual.id)," ",c.category==="TUMOR"?"tumour":"normal"]},c.id)})})}function Ji(n){let l=n;const a=new Set;return{get:()=>l,set:i=>{Object.is(i,l)||(l=i,a.forEach(c=>c()))},subscribe:i=>(a.add(i),()=>a.delete(i))}}function Xr(n){return C.useSyncExternalStore(n.subscribe,n.get,n.get)}const Ng=Ji(!1),Hr=()=>Ng.set(!0),wu=()=>Ng.set(!1),RC=Ji(!0);function xy({individualId:n,subtitle:l,details:a,patientIcon:i,report:c,compact:d,headerInView:f=RC}){const m=!Xr(f),[g,y]=C.useState(!1),[v,p]=C.useState(!1);C.useEffect(()=>{const j=()=>p(window.scrollY>4);return j(),window.addEventListener("scroll",j,{passive:!0}),()=>window.removeEventListener("scroll",j)},[]);async function S(){try{await navigator.clipboard.writeText(window.location.href),y(!0),window.setTimeout(()=>y(!1),1600)}catch{window.prompt("Copy this link",window.location.href)}}return r.jsxs("div",{className:"topbar flex flex-wrap items-center justify-between gap-x-4 gap-y-3 px-8 pt-3 pb-2","data-scrolled":v,children:[r.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex min-w-0 flex-1 items-center gap-2 text-[13.5px]",children:[r.jsx("button",{type:"button",className:"crumb",onClick:Hr,title:"Browse projects and patients",children:"Patients"}),n&&r.jsxs(r.Fragment,{children:[r.jsx(Yu,{size:14,"aria-hidden":!0,style:{color:"var(--chev)"}}),i&&r.jsx("span",{id:py,className:"ltabs-icon",children:i}),r.jsx("h1",{className:"m-0 flex-none text-[20px] font-semibold tracking-tight",style:{color:"var(--ink)"},children:n}),l&&r.jsx("span",{className:"ml-1.5 truncate text-[13.5px]",style:{color:"var(--muted)"},children:l}),a]})]}),r.jsxs("div",{className:"flex flex-none flex-wrap items-center gap-2",children:[c,r.jsx("button",{type:"button",className:"sc-ib","aria-label":"Copy a link to this view",onClick:S,children:r.jsx(WN,{size:16,"aria-hidden":!0})}),r.jsx("span",{"aria-live":"polite",className:"text-xs",style:{color:"var(--muted)"},children:g?"Link copied":""})]}),d&&r.jsx("div",{className:"topbar-compact","data-open":m,inert:!m,"aria-hidden":!m,children:r.jsx("div",{children:d})})]})}function AC(){const n=jg(),[l,a]=C.useState("");return r.jsxs("div",{className:`wgts ${Pn.theme}`,children:[r.jsx("aside",{className:"side","aria-label":"Navigation",children:r.jsxs("div",{className:"side-brand",children:[r.jsx("span",{className:"side-badge","aria-hidden":!0,children:r.jsx(Xu,{size:17,strokeWidth:2})}),r.jsx("span",{className:"side-text side-title",children:"WGTS Reports"}),r.jsx("button",{type:"button",className:"side-search-icon","aria-label":"Browse projects and patients",title:"Browse projects and patients",onClick:Hr,children:r.jsx(Lu,{size:17,"aria-hidden":!0})})]})}),r.jsxs("div",{className:"page",children:[r.jsx(xy,{}),r.jsxs("main",{className:"flex flex-col gap-4 px-8 pt-8 pb-10",children:[r.jsx("h1",{className:"m-0 text-[28px] font-semibold tracking-tight",children:"Open a patient"}),r.jsx("p",{className:"m-0 max-w-[60ch] text-[14.5px]",style:{color:"var(--ink-2)"},children:"Browse the projects that have a dashboard and pick a patient, or enter an individual's system id to see its WGTS report as live charts and tables."}),r.jsx("div",{children:r.jsxs("button",{type:"button",className:"sc-btn sc-b1 gap-2",onClick:Hr,children:[r.jsx(XN,{size:16,"aria-hidden":!0}),"Browse projects and patients"]})}),r.jsxs("form",{className:"flex flex-wrap gap-2",onSubmit:i=>{i.preventDefault(),l.trim()&&n(`/${l.trim()}`)},children:[r.jsxs("div",{className:"field w-[340px] max-w-full",children:[r.jsx(Lu,{size:16,"aria-hidden":!0,style:{color:"var(--chev)"}}),r.jsx("label",{className:"sr-only",htmlFor:"open-id",children:"Individual id"}),r.jsx("input",{id:"open-id",placeholder:"IID_H000001",value:l,onChange:i=>a(i.target.value)})]}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:!l.trim(),children:"Open"})]})]})]})]})}class Zu extends Error{}class yy extends Error{}function OC(){try{return localStorage.getItem(Im)}catch{return null}}function Sy(n){try{n?localStorage.setItem(Im,n):localStorage.removeItem(Im)}catch{}}function by(){const n=OC();return{Accept:"application/json",...n?{Authorization:`Token ${n}`}:{}}}async function It(n,l={}){const a=new URLSearchParams;for(const[d,f]of Object.entries(l))f&&a.set(d,f);const i=a.toString(),c=await fetch(`${Pn.apiHost}/wgts/api/${n}${i?`?${i}`:""}`,{headers:by()});if(c.status===401)throw new Zu;if(c.status===403){const d=await c.json().catch(()=>({}));throw new yy(d.detail??"You may not see this patient's results.")}if(!c.ok)throw new Error(`The dashboard API answered ${c.status}.`);return await c.json()}async function zC(n){if(!(await fetch(`${Pn.apiHost}/api/v1/auth/`,{headers:{Accept:"application/json",Authorization:`Token ${n}`}})).ok)throw new Error("Isabl did not accept that token.");Sy(n)}async function DC(n,l){const a=await fetch(`${Pn.apiHost}/api/v1/rest-auth/login/`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({username:n,password:l})});if(!a.ok)throw new Error("Isabl did not accept that username and password.");const i=await a.json();Sy(i.key)}async function jy(n){const l=await fetch(`${Pn.apiHost}/wgts/api/${n}`,{headers:by()});if(l.status===401)throw new Zu;if(!l.ok)throw new Error(`The dashboard API answered ${l.status}.`);return await l.json()}const kC=()=>jy("projects/"),LC=n=>jy(`projects/${n}/individuals/`);function Km(n){const l=n.toUpperCase();return l.startsWith("BATTENBERG")||l.startsWith("CNV_")?"cn":l.startsWith("ANNOT_SNVS")||l.startsWith("ANNOT_INDELS")||l.startsWith("FFPERASE")?"mut":l.startsWith("MSISENSOR")?"msi":"other"}function Zm(n){return`fam-${Km(n)}`}function $C(n){return n.pk?`${n.app} #${n.pk}`:n.app}function zn(n){return`${n.app}#${n.pk??""}`}const wy={drivers:"gene",coding:"position",all:"position"},HC=100;function wv(){return{scope:"drivers",sort:wy.drivers,q:"",effects:[],flags:[],range:null,ffpe:!1}}function Ny(n){return(n.q.trim()?1:0)+n.effects.length+n.flags.length+(n.range?1:0)}function UC(n){const l={scope:n.scope,sort:n.sort,q:n.q.trim()||void 0,effects:n.effects.join(",")||void 0,flags:n.flags.join(",")||void 0,ffpe:n.ffpe?"all":void 0};return n.range&&(l[`${n.range.measure}_min`]=String(n.range.low),l[`${n.range.measure}_max`]=String(n.range.high)),l}const Cy={missense:"Missense",truncating:"Truncating",splice:"Splice",inframe:"In-frame",synonymous:"Synonymous",other:"Other"},My={hotspot:"Hotspot",in_dmp:"In DMP",oncogene:"Oncogene",tsg:"Tumour suppressor"};function FC(n){return`${n.chrom}:${n.pos}:${n.ref}>${n.alt}`}const Ey=/^(?:chr)?([0-9]{1,2}|[XYxy]):([0-9,]+)(?:-([0-9,]+))?$/;function BC(n){return Ey.test(n.trim())}function VC(n,l,a){return`chr${n}:${l.toLocaleString("en-US")}-${a.toLocaleString("en-US")}`}const GC={GENOMIC_EXACT:"exact match",GENOMIC_POS:"same position",CODON:"same codon",GENE:"same gene"};function qC(n){var d;if(!n)return null;const l=n.split(";"),a=(d=n.match(/SOM=(\d+)/))==null?void 0:d[1],i=GC[l[0]];return!a&&!i?n:[a?`${Number(a).toLocaleString("en-US")} somatic ${a==="1"?"sample":"samples"}`:"",i].filter(Boolean).join(", ")}function IC(n){const l=n==null?void 0:n.match(/^(\d+)\/(\d+)$/);return l?`${l[1]} of ${l[2]} ${l[2]==="1"?"copy":"copies"}`:n}function PC(n){return n.oncogene&&n.tsg?"Oncogene and TSG":n.oncogene?"Oncogene":n.tsg?"TSG":null}const Mt=(n,l)=>!(l instanceof Zu)&&n<2;function QC(n,l){return Dt({queryKey:["individual",n,l??null],queryFn:()=>It(`individuals/${encodeURIComponent(n)}/`,{version:l}),retry:Mt})}function YC(n,l,a){return Dt({queryKey:["metrics",n,l,a??null],queryFn:()=>It(`individuals/${encodeURIComponent(n)}/metrics/`,{sample:l,version:a}),enabled:!!l,retry:Mt})}function XC(n,l){return Dt({queryKey:["fingerprint",n,l??null],queryFn:()=>It(`individuals/${encodeURIComponent(n)}/fingerprint/`,{version:l}),retry:Mt})}const wn=(n,l)=>`individuals/${encodeURIComponent(n)}/${l}/`;function KC(n,l,a){return Dt({queryKey:["cn",n,l,a??null],queryFn:()=>It(wn(n,"cn"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function ZC(n,l,a,i,c){return Dt({queryKey:["ccf",n,l,a,i,c??null],queryFn:()=>It(wn(n,"ccf"),{sample:l,measure:a,version:c,ffpe:i?"all":void 0}),enabled:!!l,retry:Mt})}function JC(n,l,a){return Dt({queryKey:["signatures",n,l,a??null],queryFn:()=>It(wn(n,"signatures"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function WC(n,l,a){return Dt({queryKey:["context",n,l,a??null],queryFn:()=>It(wn(n,"context"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function e3(n,l,a){return Dt({queryKey:["fga",n,l,a??null],queryFn:()=>It(wn(n,"fga"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function t3(n,l,a){return Dt({queryKey:["tmb",n,l,a??null],queryFn:()=>It(wn(n,"tmb"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function n3(n,l,a){return Dt({queryKey:["circos",n,l,a??null],queryFn:()=>It(wn(n,"circos"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function s3(n,l,a,i){return Dt({queryKey:["cnsv",n,l,a,i??null],queryFn:()=>It(wn(n,"cnsv"),{sample:l,chrom:a,version:i}),enabled:!!l,placeholderData:pg,retry:Mt})}function l3(n,l,a,i){return Dt({queryKey:["raw-cn",n,l,i??null],queryFn:()=>It(wn(n,"raw-cn"),{sample:l,version:i}),enabled:!!l&&a,retry:Mt})}function a3(n,l,a){return Dt({queryKey:["rna",n,l,a??null],queryFn:()=>It(wn(n,"rna"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function i3(n,l,a){return Dt({queryKey:["results",n,a??null],queryFn:()=>It(wn(n,"results"),{version:a}),enabled:l,retry:Mt})}function o3(n,l,a){return Dt({queryKey:["treatments",n,l,a??null],queryFn:()=>It(wn(n,"treatments"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function r3(n,l,a){return Dt({queryKey:["svs",n,l,a??null],queryFn:()=>It(wn(n,"svs"),{sample:l,version:a}),enabled:!!l,retry:Mt})}function c3(n,l,a,i){return Bw({queryKey:["variants",n,l,a,i??null],queryFn:({pageParam:c})=>It(wn(n,"variants"),{sample:l,version:i,...UC(a),page:String(c),page_size:String(HC)}),initialPageParam:1,getNextPageParam:(c,d,f)=>c.status!=="ok"||!c.data?void 0:d.reduce((g,y)=>g+(y.status==="ok"&&y.data?y.data.rows.length:0),0)<c.data.total?f+1:void 0,enabled:!!l,placeholderData:pg,retry:Mt})}function u3(){return Dt({queryKey:["picker","projects"],queryFn:kC,staleTime:6e4,retry:Mt})}function d3(n){return Dt({queryKey:["picker","patients",n],queryFn:()=>LC(n),staleTime:6e4,placeholderData:pg,retry:Mt})}const Ba=6,h3=16,_y=7,go=6;function Gf(n){const l=Math.min(_y,(n-go)/2);return`M${Ba},${go} V${n-l}`}function qf(n){const l=Math.min(_y,(n-go)/2);return`M${Ba},${n-l} Q${Ba},${n} ${Ba+l},${n} H${h3}`}function f3(n,l){return`M${Ba},${n} V${l}`}function m3(n,l,a,i){const[c,d]=C.useState(null),[f,m]=C.useState([]),[g,y]=C.useState(!1),[v,p]=C.useState(null),[S,j]=C.useState(280),b=n.map(R=>`${R.key}:${R.available}`).join();C.useLayoutEffect(()=>{if(!c)return;const R=()=>{const I=Array.from(c.querySelectorAll(a));m(n.flatMap((K,O)=>{const se=I[O];if(!se)return[];const ie=se.offsetTop,W=se.offsetHeight;return[{key:K.key,cy:ie+W/2,top:ie,height:W,available:K.available}]}))};if(R(),typeof ResizeObserver>"u")return;const k=new ResizeObserver(R);return k.observe(c),()=>k.disconnect()},[c,b,a,i]);const N=f.find(R=>R.key===l&&R.available),E=N?{top:N.top,height:N.height}:null;C.useEffect(()=>{if(!N||g)return;const R=requestAnimationFrame(()=>y(!0));return()=>cancelAnimationFrame(R)},[N,g]);const[A,T]=C.useState(l);C.useEffect(()=>{if(A===l)return;const R=A;T(l),R&&l&&p(k=>({from:R,to:l,n:((k==null?void 0:k.n)??0)+1}))},[l,A]);const L=v?f.find(R=>R.key===v.from):void 0,[M,_]=C.useState(null);return C.useLayoutEffect(()=>{if(N&&M!==null&&M!==N.cy){const R=Math.abs(N.cy-M)/38;j(Math.round(Math.min(620,240+80*R)))}_(N?N.cy:null)},[N==null?void 0:N.key,N==null?void 0:N.cy]),{setBox:d,tree:f,on:N,light:E,glides:g,hop:v,leaving:L,duration:S}}function g3({tree:n,on:l,light:a,glides:i,hop:c,leaving:d}){return r.jsxs(r.Fragment,{children:[n.length>0&&r.jsxs("svg",{className:"ltabs-links side-tree","aria-hidden":!0,children:[r.jsx("circle",{cx:Ba,cy:go,r:"2.5",className:"side-root"}),r.jsx("path",{d:Gf(n[n.length-1].cy)}),n.map(f=>r.jsx("path",{d:qf(f.cy),"data-off":f.available?void 0:"true"},f.key)),l&&r.jsxs(r.Fragment,{children:[r.jsx("path",{className:"ltabs-haze","data-moving":i,style:{d:`path("${Gf(l.cy)}")`}}),r.jsx("path",{className:"ltabs-on","data-moving":i,style:{d:`path("${Gf(l.cy)}")`}})]}),n.map(f=>r.jsxs("g",{className:"side-stub","data-active":f.key===(l==null?void 0:l.key)||void 0,children:[r.jsx("path",{className:"ltabs-haze",d:qf(f.cy)}),r.jsx("path",{className:"ltabs-on",d:qf(f.cy)})]},f.key)),l&&d&&c&&c.to===l.key&&r.jsx("path",{className:"ltabs-bead",pathLength:1,d:f3(d.cy,l.cy)},`bead-${c.n}`)]}),r.jsx("span",{className:"side-light","aria-hidden":!0,"data-on":a?"true":void 0,"data-glides":i||void 0,style:a?{transform:`translateY(${a.top}px)`,height:a.height}:void 0})]})}const p3=13,Gt=6;function v3(n,l){const a=n.base+p3,i=n.x+2*Gt+4;return[`M${n.barLeft},${n.bar} H${n.barRight}`,`M${n.x},${n.top} V${n.base-Gt}`,`q0,${Gt} ${Gt},${Gt}`,`H${i-Gt}`,`q${Gt},0 ${Gt},${Gt}`,`V${a-Gt}`,`q0,${Gt} ${-Gt},${Gt}`,`H${l.x+Gt}`,`q${-Gt},0 ${-Gt},${Gt}`,`V${l.root}`].join(" ")}function x3(n,l){const a=l.firstChild,i=document.createElement("canvas").getContext("2d");if(!a||!(i!=null&&i.measureText))return null;const c=getComputedStyle(n);i.font=`${c.fontWeight} ${c.fontSize} ${c.fontFamily}`;const d=i.measureText("t"),f=i.measureText("x"),m=i.measureText(n.textContent??"");if(!d||!f||!Number.isFinite(d.actualBoundingBoxRight)||!Number.isFinite(m==null?void 0:m.fontBoundingBoxAscent))return null;const g=l.getBoundingClientRect();if(!g.width)return null;const y=parseFloat(c.lineHeight)||n.getBoundingClientRect().height,v=n.getBoundingClientRect().top+(y-m.fontBoundingBoxAscent-m.fontBoundingBoxDescent)/2+m.fontBoundingBoxAscent,p=g.left-d.actualBoundingBoxLeft,S=g.left+d.actualBoundingBoxRight;return{x:p+(S-p)*.42,top:v-d.actualBoundingBoxAscent+1,bar:v-f.actualBoundingBoxAscent+1,base:v-1.2,barLeft:p+.6,barRight:S-.6}}function y3({watch:n}){const l=C.useRef(null),a=C.useRef(null),[i,c]=C.useState(null);return C.useLayoutEffect(()=>{var v;const d=l.current,f=a.current,m=d==null?void 0:d.closest(".side");if(!m||!d||!f)return;const g=()=>{const p=m.querySelector(".side-nav"),S=x3(d,f);if(!p||!S)return;const j=m.getBoundingClientRect(),b=p.getBoundingClientRect(),N=m.scrollLeft-j.left,E=m.scrollTop-j.top,A={x:S.x+N,top:S.top+E,bar:S.bar+E,base:S.base+E,barLeft:S.barLeft+N,barRight:S.barRight+N};c({d:v3(A,{x:b.left+N+Ba,root:b.top+E+go}),width:m.scrollWidth,height:b.top+E+go+2})};if(g(),(v=document.fonts)==null||v.ready.then(g),typeof ResizeObserver>"u")return;const y=new ResizeObserver(g);y.observe(m);for(const p of Array.from(m.children))y.observe(p);return()=>y.disconnect()},[n]),r.jsxs(r.Fragment,{children:[r.jsxs("span",{ref:l,className:"neon-word","data-drawn":i?"true":void 0,children:["WGTS Repor",r.jsx("span",{ref:a,className:"neon-t",children:"t"})]}),i&&r.jsxs("svg",{className:"ltabs-links neon-flow",width:i.width,height:i.height,"aria-hidden":!0,children:[r.jsx("path",{className:"ltabs-haze",d:i.d}),r.jsx("path",{className:"ltabs-on",d:i.d})]})]})}function S3({logo:n,onClose:l}){const a=C.useId(),i=C.useRef(null),c=C.useRef(l);return c.current=l,C.useEffect(()=>{var y;const d=document.activeElement;(y=i.current)==null||y.focus();const f=document.documentElement,m=f.style.overflow;f.style.overflow="hidden";const g=v=>{v.key==="Escape"&&c.current()};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g),f.style.overflow=m,d==null||d.focus()}},[]),Pr.createPortal(r.jsx("div",{className:`info-backdrop ${Pn.theme}`,onMouseDown:d=>d.target===d.currentTarget&&l(),children:r.jsxs("div",{className:"about-dialog",role:"dialog","aria-modal":"true","aria-labelledby":a,children:[r.jsx("button",{ref:i,type:"button",className:"info-close","aria-label":"Close",onClick:l,children:r.jsx(Yr,{size:18,"aria-hidden":!0})}),r.jsx("span",{className:"about-logo",role:"img","aria-label":"Memorial Sloan Kettering Cancer Center",style:{"--logo":`url("${n}")`}}),r.jsx("h2",{id:a,className:"sr-only",children:"About this report"}),r.jsxs("p",{className:"about-text",children:["This report is developed and maintained by the ",r.jsx("strong",{className:"about-lab",children:"Andrew McPherson"})," Lab. If you have any questions or concerns, please feel free to reach out."]})]})}),document.body)}const Nv="data:image/svg+xml,%3csvg%20role='img'%20width='230'%20height='46'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20332.4%2069.1'%3e%3ctitle%3eMemorial%20Sloan%20Kettering%20Cancer%20Center%3c/title%3e%3cdesc%3eMemorial%20Sloan%20Kettering%20Cancer%20Center%20logo.%3c/desc%3e%3cpath%20fill='%23000'%20d='M75.5%2029.4c2.1-.4%202.5-.9%202.5-3.2v-9.4c0-.9-.4-1.3-2.5-1.4v-1h5.7l4.4%2012.1h.2l4.4-12.1h5.7v1c-2%20.1-2.5.3-2.5%201v11.7c0%20.7.5%201%202.5%201v1h-7.1v-1c1.9-.1%202.1-.2%202.1-1V16.4h-.2l-5.2%2013.9h-1l-5.2-13.9h-.2v9.8c0%202.2.2%202.8%202.3%203.2v.9h-6.1v-.9zm23.4-4.7c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm18.2-4.5c1.7%200%202.7%201.2%202.7%203.4v6c0%20.6.4.8%201.8.8v1h-5.3v-1c1.2%200%201.4-.3%201.4-.8v-5.1c0-2-.7-2.6-2.1-2.6-.8%200-1.7.4-2.6%201.1v6.5c0%20.6.2.8%201.6.8v1h-5.2v-1c1.2%200%201.4-.3%201.4-.8v-5.1c0-2-.8-2.6-2.2-2.6-1.1%200-1.8.5-2.5.9v6.8c0%20.6.2.8%201.4.8v1h-5.3v-1c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.7c1.3-.9%202.5-1.7%204.1-1.7%201.2%200%202.2.7%202.6%202%201.4-1.2%202.8-2%204.3-2zm4.9%205.8c0-3.4%202.2-5.8%205.5-5.8%203.4%200%205.5%202.3%205.5%205.7%200%203.4-2.2%205.8-5.5%205.8-3.5%200-5.5-2.4-5.5-5.7zm8.5-.1c0-3.2-1.2-4.7-3.2-4.7-1.9%200-2.9%201.4-2.9%204.7%200%203.2%201.2%204.7%203.2%204.7%201.8%200%202.9-1.5%202.9-4.7zm3.2%204.5c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zm9.7%200c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.3-1.2-1.7-1.2v-1l3.9-.1v9.3c0%20.6.3.8%201.8.8v1h-5.7v-1zm1.4-14.2c0-.9.6-1.5%201.4-1.5.9%200%201.4.6%201.4%201.5s-.6%201.5-1.4%201.5c-.8-.1-1.4-.6-1.4-1.5zm5.3%2012.8c0-1%20.5-2%201.5-2.5%201.8-1%204.7-1.4%205.1-1.7V23c0-2.1-.6-2.9-2.2-2.9-.8%200-1.2.2-1.6.5.2.4.3.8.3%201.1%200%20.7-.5%201.3-1.3%201.3s-1.3-.6-1.3-1.3c0-1.6%202-2.7%204.3-2.7%202.5%200%204%201.1%204%203.4v5.3c0%201.2.2%201.5%201.8%201.3l.1.8c-.9.3-1.4.5-2.1.5-1.3%200-1.6-.5-1.8-1.9h-.2c-1%201.1-2.1%201.9-3.5%201.9-2.1.1-3.1-1-3.1-2.4zm6.6-.4v-2.9c-3.4.8-4.1%201.3-4.1%202.7%200%20.9.5%201.6%201.7%201.6.9.1%201.8-.6%202.4-1.4zm4.7%201.8c1.4%200%201.8-.3%201.8-.8V15.8c0-.7-.5-1.2-1.9-1.2v-1l4-.1v15c0%20.6.4.8%201.8.8v1h-5.7v-1zm11.1-3.7h.9c1.3%202.8%202.9%203.9%204.9%203.9%202.2%200%203.1-1.4%203.1-2.7%200-1.7-1.1-2.4-4.1-3.4-2.2-.8-4.6-1.5-4.6-4.5s2.4-4.8%205.4-4.8c1.4%200%202.2.3%203%20.6l.8-.7h.7v4.7h-.9c-.8-2.2-2.1-3.3-4-3.3-1.5%200-2.8%201-2.8%202.6s1.2%202.2%203.8%203.1c2.2.7%204.6%201.5%204.6%204.5%200%202.4-1.5%205.2-5.5%205.2-1.3%200-2.5-.3-3.5-.7l-1.3.8h-.7v-5.3zm11.7%203.7c1.4%200%201.8-.3%201.8-.8V15.8c0-.7-.5-1.2-1.9-1.2v-1l4-.1v15c0%20.6.4.8%201.8.8v1h-5.7v-1zm6.2-4.4c0-3.4%202.2-5.8%205.5-5.8%203.4%200%205.5%202.3%205.5%205.7%200%203.4-2.2%205.8-5.5%205.8-3.5%200-5.5-2.4-5.5-5.7zm8.5-.1c0-3.2-1.2-4.7-3.2-4.7-1.9%200-2.9%201.4-2.9%204.7%200%203.2%201.2%204.7%203.2%204.7%201.9%200%202.9-1.5%202.9-4.7zm3.6%203.1c0-1%20.5-2%201.5-2.5%201.8-1%204.7-1.4%205.1-1.7V23c0-2.1-.6-2.9-2.2-2.9-.8%200-1.2.2-1.6.5.2.4.3.8.3%201.1%200%20.7-.5%201.3-1.3%201.3s-1.3-.6-1.3-1.3c0-1.6%202-2.7%204.3-2.7%202.5%200%204%201.1%204%203.4v5.3c0%201.2.2%201.5%201.8%201.3l.1.8c-.9.3-1.4.5-2.1.5-1.3%200-1.6-.5-1.8-1.9h-.2c-1%201.1-2.1%201.9-3.5%201.9-2.1.1-3.1-1-3.1-2.4zm6.6-.4v-2.9c-3.4.8-4.1%201.3-4.1%202.7%200%20.9.5%201.6%201.7%201.6%201%20.1%201.8-.6%202.4-1.4zm4.8%201.8c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.7c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.8.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.1-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1H219v-1.1zm22.2-1.1c0%20.8.1%201%202%201v1h-7v-1c2-.1%202.5-.3%202.5-1V16.5c0-.7-.5-1-2.5-1v-1h7.3v1c-2.1.1-2.3.2-2.3%201v6.2l5.2-5.2c1.2-1.2%201.1-1.9-.7-2.1v-.9h6.2v.9c-1.8.3-2.5.7-4.2%202.4l-3.2%203.1%204.7%206.4c.9%201.2%201.3%201.8%203.3%202.1v1h-7v-1c1.7-.2%202.1-.6%201.3-1.7l-3.7-5.2-1.7%201.6v4.1zm14-3.5c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.6-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm4.8%203.9v-7.1h-2v-.8l2-.4v-3.1l2.1-.9v4h3.4v1.2h-3.4v6.8c0%201.3.4%201.9%201.4%201.9.7%200%201.2-.5%201.7-1.3l.7.5c-.9%201.6-1.7%202.2-3.2%202.2-1.7.1-2.7-1.1-2.7-3zm8.5%200v-7.1h-2v-.8l2-.4v-3.1l2.1-.9v4h3.4v1.2h-3.4v6.8c0%201.3.4%201.9%201.4%201.9.7%200%201.2-.5%201.7-1.3l.7.5c-.9%201.6-1.7%202.2-3.2%202.2-1.8.1-2.7-1.1-2.7-3zm8.9-2.8c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zm9.7%200c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.3-1.2-1.7-1.2v-1l3.9-.1v9.3c0%20.6.3.8%201.8.8v1h-5.7v-1zm1.3-14.2c0-.9.6-1.5%201.4-1.5.9%200%201.4.6%201.4%201.5s-.6%201.5-1.4%201.5c-.8-.1-1.4-.6-1.4-1.5zm5.4%2014.2c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.7c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.8.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.1-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1h-5.5v-1.1zm22.8-11.7c.8%200%201.3.5%201.3%201.2%200%20.6-.4%201.1-.9%201.1-.6%200-1.1-.4-1.1-1.1-.5.2-1.1.6-1.4%201.1%201%20.6%201.7%201.6%201.7%203%200%202.3-1.9%203.8-4.3%203.8-.5%200-1%200-1.4-.2-.6.3-1%20.7-1%201.1%200%20.5.3%201%202.3%201h1.1c3.2%200%204.6.8%204.6%202.8%200%201.9-2%204-5.8%204-3.2%200-4.8-1.2-4.8-2.6%200-1.1%201.1-2.1%202.9-2.4V30c-1.4-.3-1.9-.9-1.9-1.9%200-.7.6-1.4%201.7-2-1.2-.6-2-1.6-2-3.2%200-2.3%201.9-3.8%204.4-3.8.7%200%201.4.1%201.9.3.4-1%201.4-1.8%202.7-1.8zm-.9%2014.5c0-1-.6-1.6-3-1.6h-2c-1.3.2-2.1.9-2.1%201.9%200%201.1%201.2%201.9%203.6%201.9%202.1-.1%203.5-1.1%203.5-2.2zm-1.7-9.2c0-1.8-.9-2.9-2.2-2.9-1.2%200-2%20.7-2%202.9s1%202.8%202.2%202.8c1.1%200%202-.8%202-2.8zM75.6%2047.6c0-4.9%203.6-8.5%208.2-8.5%201.7%200%202.9.6%203.8%201.1l.7-1h.9v5.5h-.8c-1.1-2.7-2.5-4.3-4.9-4.3-2.8%200-5.2%202.5-5.2%207.2%200%204.4%202.8%206.7%205.6%206.7%202.7%200%204-1.5%205-3.5l1%20.5c-1%202.3-3.1%204.6-6.6%204.6-4.5-.1-7.7-3.4-7.7-8.3zM91.1%2053c0-1%20.5-2%201.5-2.5%201.8-1%204.7-1.4%205.1-1.7v-.7c0-2.1-.6-2.9-2.2-2.9-.8%200-1.2.2-1.6.5.2.4.3.8.3%201.1%200%20.7-.5%201.3-1.3%201.3s-1.3-.6-1.3-1.3c0-1.6%202-2.7%204.3-2.7%202.5%200%204%201.1%204%203.4v5.3c0%201.2.2%201.5%201.8%201.3l.1.8c-.9.3-1.4.5-2.1.5-1.3%200-1.6-.5-1.8-1.9h-.2c-1%201.1-2.1%201.9-3.5%201.9-2.1.1-3.1-1-3.1-2.4zm6.5-.4v-2.9c-3.4.8-4.1%201.3-4.1%202.7%200%20.9.5%201.6%201.7%201.6%201%20.1%201.9-.7%202.4-1.4zm4.9%201.8c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1V46c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.7.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.1-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1h-5.5v-1.1zm13.1-4.4c0-3.4%202.4-5.8%205.4-5.8%202.5%200%204%201.4%204%202.7%200%20.9-.6%201.6-1.4%201.6-.8%200-1.4-.5-1.4-1.2s.4-1.1.8-1.3c-.3-.4-1.1-.8-2-.8-1.8%200-3.1%201.2-3.1%204.3%200%202.9%201.3%204.7%203.6%204.7%201.3%200%202.4-.7%203.2-1.7l.6.6c-1%201.5-2.3%202.5-4.6%202.5-3.1%200-5.1-2.4-5.1-5.6zm12.8-.2c0%202.5%201.2%204.5%203.6%204.5%201.3%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5.1-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zm13.5-6.8c0-4.9%203.6-8.5%208.2-8.5%201.7%200%202.9.6%203.8%201.1l.7-1h.9v5.5h-.8c-1.1-2.7-2.5-4.3-4.9-4.3-2.8%200-5.2%202.5-5.2%207.2%200%204.4%202.8%206.7%205.6%206.7%202.7%200%204-1.5%205-3.5l1%20.5c-1%202.3-3.1%204.6-6.6%204.6-4.5-.1-7.7-3.4-7.7-8.3zm18%202.2c0%202.5%201.2%204.5%203.6%204.5%201.3%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5h-7.4zm5-1.1c.1-2-.7-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1V46c1.3-.9%202.7-1.7%204.3-1.7%201.7%200%202.8%201.2%202.8%203.4v6c0%20.6.3.8%201.8.8v1h-5.5v-1c1.2%200%201.5-.3%201.5-.8v-5.1c0-2-.7-2.6-2.2-2.6-1.1%200-2%20.5-2.7.9v6.8c0%20.6.3.8%201.5.8v1h-5.5v-1.1zm14.5-1.8v-7.1h-2v-.8l2-.4v-3.1l2.1-.9v4h3.4v1.2h-3.4v6.8c0%201.3.4%201.9%201.4%201.9.7%200%201.2-.5%201.7-1.3l.7.5c-.9%201.6-1.7%202.2-3.2%202.2-1.8%200-2.7-1.1-2.7-3zm8.9-2.8c0%202.5%201.2%204.5%203.6%204.5%201.4%200%202.5-.8%203.4-2l.6.6c-.9%201.5-2.3%202.8-4.7%202.8-3.4%200-5.2-2.4-5.2-5.6%200-3.3%202.1-5.8%205.2-5.8%203.4%200%204.7%202.8%204.5%205.5H200zm5.1-1.1c.1-2-.6-3.6-2.4-3.6-1.5%200-2.5%201-2.7%203.7l5.1-.1zm3.3%205.7c1.4%200%201.8-.3%201.8-.8v-7c0-.7-.4-1.2-1.8-1.2v-1l3.9-.1v1.9c.8-1.1%201.9-2%203.1-2%201.2%200%201.8.8%201.8%201.8%200%20.8-.6%201.4-1.3%201.4-.7%200-1.4-.4-1.4-1.3v-.4c-1.1%200-1.8.7-2.3%201.3v6.5c0%20.6.4.8%202%20.8v1h-6v-.9zM18.7%2053.3l.6.1-1%207.8-.9-.1.9-6.9-1.5.3-.1-.7%202-.5zm5.9%208.5c-1.6-.1-2.9-1.1-2.8-2.4%200-.9.7-1.6%201.7-1.8-.7-.4-1.3-1-1.2-1.9%200-1.2%201.3-2%202.8-1.9%201.4.1%202.6%201%202.5%202.2%200%20.9-.7%201.4-1.4%201.7.9.4%201.5%201.1%201.5%202-.2%201.4-1.5%202.2-3.1%202.1zm.2-3.7c-1.1-.1-2.1.5-2.1%201.4%200%20.8.7%201.5%202%201.6%201.3.1%202.1-.6%202.1-1.4%200-.9-.9-1.5-2-1.6zm.1-3.5c-1-.1-1.8.5-1.8%201.3-.1.9.7%201.5%201.7%201.5s1.8-.5%201.9-1.4c0-.7-.7-1.4-1.8-1.4zm8.5%207.3c-1.7.1-3-.8-3-2.1%200-.9.6-1.6%201.5-2-.7-.3-1.4-.8-1.4-1.7%200-1.2%201.2-2.1%202.6-2.2%201.4%200%202.7.8%202.7%202%200%20.9-.6%201.5-1.3%201.8.9.3%201.6.9%201.7%201.8%200%201.4-1.2%202.3-2.8%202.4zm-.2-3.7c-1.1%200-2%20.7-2%201.6%200%20.8.8%201.4%202.1%201.4%201.3-.1%202-.7%202-1.5%200-1-.9-1.6-2.1-1.5zm-.1-3.6c-1%200-1.8.6-1.7%201.4%200%20.9.8%201.4%201.8%201.4s1.8-.6%201.7-1.5c0-.7-.8-1.3-1.8-1.3zm9.3-1.5l.7%205.2%201.2-.2.1.7-1.2.2.2%201.8-.8.2-.2-1.8-4.1.5-.3-.6%203.7-5.9.7-.1zm-.7%201.3L39%2058.8l3.2-.4-.5-4zm-9.5-39.2l7.5%207.5%202.4-2.4L30.5%208.7%2018.9%2020.3l2.4%202.4%207.5-7.5v12.1h-8.3v3.4h8.3v2.9h-8.3V37h8.3v3h-8.3v3.4h8.3v8.7h3.4v-8.7h8.3V40h-8.3v-3h8.2v-3.4h-8.2v-2.9h8.3v-3.4h-8.3V15.2zm27.6%207.2c-2.5-11-9-18.2-18.9-21.1C37.9.5%2034.5%200%2030.8%200h-.3c-3.9%200-7.5.5-10.6%201.4-9.6%202.9-16%2010-18.5%2021C.5%2026%200%2029.9%200%2034.3s.4%208.4%201.2%2012c2.6%2011.5%209.4%2018.9%2019.9%2021.6%202.8.7%205.9%201.1%209.2%201.1h.3c3.3%200%206.4-.4%209.2-1%2010.5-2.6%2017.3-10%2020-21.6.8-3.5%201.2-7.4%201.2-11.6.1-4.6-.3-8.7-1.2-12.4zm-3.8%2024c-2%208.1-6.7%2015.4-16.5%2018.1-2.6.7-5.6%201.1-9.1%201.1h-.3c-3.4%200-6.5-.5-9.1-1.2-9.7-2.8-14.4-10-16.4-18.1-1-3.9-1.3-8.1-1.3-12%200-3.7.4-7.6%201.3-11.3%201.9-7.9%206.2-15%2015.2-18%202.9-1%206.4-1.6%2010.4-1.6h.3c3.9%200%207.2.6%2010%201.5%209.2%203%2013.6%2010.1%2015.5%2018%20.9%203.9%201.3%208%201.2%2011.8.1%203.8-.3%207.8-1.2%2011.7z'%3e%3c/path%3e%3c/svg%3e",If=[{key:"overview",label:"Overview",icon:JN},{key:"copyNumber",label:"Copy number",icon:GN},{key:"mutations",label:"Mutations",icon:nC},{key:"structuralVariants",label:"Structural variants",icon:cC},{key:"circos",label:"Circos",icon:lC},{key:"cnsv",label:"CN/SV by chromosome",icon:iy},{key:"signatures",label:"Signatures and HRD",icon:IN},{key:"rna",label:"RNA",icon:hC},{key:"treatments",label:"Treatments",icon:oC},{key:"germline",label:"Germline",icon:rC,soon:!0},{key:"quality",label:"Quality",icon:QN,soon:!0}],Cv="wgts-side-collapsed",Ty=Ji(!1);function b3(){const[n,l]=C.useState(()=>{try{return localStorage.getItem(Cv)==="1"}catch{return!1}});return C.useEffect(()=>Ty.set(n),[n]),[n,i=>{l(i);try{localStorage.setItem(Cv,i?"1":"0")}catch{}}]}function j3({analyses:n,onPage:l,sampleLabel:a,picked:i,onPick:c,sections:d,activeStore:f,onSection:m,profile:g}){const y=Xr(f),[v,p]=b3(),{setBox:S,...j}=m3(If.map(({key:O})=>({key:O,available:d.has(O)})),y,".sc-nav",v),[b,N]=C.useState(!1),[E,A]=C.useState(!1),[T,L]=C.useState(!1),M=["cn","mut","msi","other"],_=(O,se)=>M.indexOf(Km(O.app))-M.indexOf(Km(se.app))||O.app.localeCompare(se.app),R=T||i!==null;C.useEffect(()=>{const O=se=>{se.key.toLowerCase()==="k"&&(se.metaKey||se.ctrlKey)&&(se.preventDefault(),Hr())};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[]);const k=n.filter(O=>O.role==="input"),I=k.filter(O=>l.has(zn(O))).sort(_),K=[...k.filter(O=>!l.has(zn(O))).sort(_),...n.filter(O=>O.role==="cohort")];return r.jsxs("aside",{className:"side","aria-label":"Patient navigation","data-collapsed":v||void 0,children:[r.jsxs("div",{className:"side-brand",children:[v?r.jsx("span",{className:"side-badge","aria-label":"WGTS Report",children:r.jsx(Xu,{size:17,strokeWidth:2,"aria-hidden":!0})}):r.jsx(y3,{watch:!!g}),r.jsx("button",{type:"button",className:"side-search-icon","aria-label":"Browse projects and patients",title:"Browse projects and patients (Ctrl or ⌘ K)",onClick:Hr,children:r.jsx(Lu,{size:17,"aria-hidden":!0})}),r.jsx("button",{type:"button",className:"side-toggle","aria-label":v?"Expand the menu":"Collapse the menu","aria-expanded":!v,title:v?"Expand the menu":"Collapse the menu",onClick:()=>p(!v),children:v?r.jsx(iC,{size:17,"aria-hidden":!0}):r.jsx(aC,{size:17,"aria-hidden":!0})})]}),g&&!v&&r.jsx("section",{className:"side-profile","aria-label":"Patient and sample",children:g}),r.jsxs("nav",{ref:S,"aria-label":"Patient sections",className:"side-nav",style:{"--duration":`${j.duration}ms`},children:[r.jsx(g3,{...j}),If.map(({key:O,label:se,icon:ie,soon:W},P)=>{const le=d.has(O);return r.jsxs("div",{className:"contents",children:[W&&!If[P-1].soon&&r.jsx("span",{className:"side-group",children:"Coming soon"}),r.jsxs("button",{type:"button",className:"sc-nav","aria-current":le&&y===O?"location":void 0,"aria-label":se,disabled:!le,title:v?se:le?void 0:"Not available for this sample yet",onClick:()=>m(O),children:[r.jsx(ie,{size:17,strokeWidth:1.7,"aria-hidden":!0}),r.jsx("span",{className:"side-text",children:se})]})]},O)})]}),r.jsx("div",{className:"flex-auto"}),r.jsxs("div",{className:"side-foot",children:[r.jsxs("section",{"aria-label":"Analyses on this page",className:"side-sources",children:[r.jsxs("button",{type:"button",className:"side-fold","aria-expanded":R,onClick:()=>L(O=>!O),children:["Analyses on this page",r.jsx("span",{className:"side-count",children:I.length}),r.jsx(ry,{size:14,"aria-hidden":!0,"data-open":R})]}),R&&I.length===0&&r.jsxs("span",{className:"px-3 text-xs",style:{color:"var(--menu-muted)"},children:["Nothing on this page reads an analysis for ",a||"this sample","."]}),R&&I.map(O=>{const se=zn(O),ie=O.state==="failed",W=O.modules.filter(P=>P.status==="failed");return r.jsxs("button",{type:"button",className:`tb-src${ie?" fail":""}`,"aria-pressed":i===se,title:ie?W.map(P=>`${P.label} failed`).join("; "):"Show what it feeds",onClick:()=>c(i===se?null:se),children:[ie?r.jsx(hy,{size:12,strokeWidth:2.6,"aria-hidden":!0,style:{color:"var(--fail-d)",margin:"0 -2px"}}):r.jsx("span",{className:`tb-dot ${Zm(O.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"truncate",children:[O.app," ",O.version??""]}),ie&&r.jsx("span",{className:"sr-only",children:", failed"}),r.jsx("span",{className:"tb-n",children:O.pk?`#${O.pk}`:""})]},se)}),R&&K.length>0&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"tb-src","aria-expanded":b,onClick:()=>N(O=>!O),children:[r.jsx("span",{className:"tb-dot fam-other","aria-hidden":!0}),b?"Hide":"Show"," ",K.length," more for ",a||"this sample"]}),b&&K.map(O=>r.jsxs("span",{className:"tb-src",style:{cursor:"default"},children:[r.jsx("span",{className:`tb-dot ${Zm(O.app)}`,"aria-hidden":!0}),r.jsx("span",{className:"truncate",children:O.role==="cohort"?`${O.app}${O.project?`, project ${O.project}`:""}`:`${O.app} ${O.version??""}`}),r.jsx("span",{className:"tb-n",children:O.pk?`#${O.pk}`:""})]},zn(O)))]}),R&&r.jsx("span",{className:"px-3 pt-2 text-xs leading-normal",style:{color:"var(--menu-muted)"},children:"Pick one to see what it feeds."})]}),!v&&r.jsx("button",{type:"button",className:"side-msk","aria-label":"About this report",title:"About this report",onClick:()=>A(!0),style:{"--logo":`url("${Nv}")`}}),E&&r.jsx(S3,{logo:Nv,onClose:()=>A(!1)})]})]})}function _a({envelope:n}){const l=n.status==="error",a=l?PN:YN;return r.jsxs("div",{className:"flex items-start gap-2.5 text-sm",style:{color:"var(--ink-2)"},children:[r.jsx(a,{size:18,"aria-hidden":!0,style:{color:l?"var(--warn-ink)":"var(--chev)",flex:"none"}}),r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsx("span",{className:"font-semibold",style:{color:"var(--ink)"},children:l?"This panel could not be read":"Nothing to show here"}),n.warnings.map(i=>r.jsx("span",{children:i},i))]})]})}const Jm={summary:{title:"Genome fingerprint and summary",intro:"A one-glance portrait of the selected tumour: its copy-number changes and driver mutations drawn as a ring, a sentence describing them, and the headline measurements of the sample.",sections:[{heading:"The fingerprint ring",paragraphs:["The ring is the whole genome. Chromosome 1 starts at the top and the ring runs clockwise through chromosome 22 to X, each chromosome's arc in proportion to its length (GRCh37).","Copy-number changes are called against the tumour's baseline, its ploidy rounded to whole copies. Very short changes are drawn at a minimum length so they stay visible."],terms:[["Gains (outer track, orange)","Regions with at least one copy more than the baseline."],["Amplifications (outer track, darker and thicker)","Regions with three or more copies above the baseline."],["Losses (inner track, blue)","Regions with at least one copy fewer than the baseline."],["Drivers (black ticks)","Where the tumour's likely driver mutations sit (see the Mutations card for how they are flagged)."]]},{heading:"The sentence",paragraphs:["Written from the same data as the ring: how many amplifications, gains and losses there are and on which chromosomes, and which genes carry driver mutations."]},{heading:"The measurements",paragraphs:["Each tile shows a value, a small picture of where it sits on its scale when it has a natural one, and the analysis it came from. A tile with no value says why: the analysis was not run, it failed, or it does not apply to this kind of report (tumour-only reports have no matched normal)."],terms:[["Purity","The estimated fraction of cells in the sample that are tumour cells, from 0 to 1. The ring fills to the value."],["Ploidy","The tumour's average number of copies across the genome. The scale runs from 1 to 6 copies; the tall tick marks 2, a diploid genome."],["Coverage","The median sequencing depth of the tumour across the genome, in reads (×)."],["TMB per Mb","Tumour mutational burden: somatic SNVs and indels per megabase of genome. The report computes it from the counts of the SNV and indel calls. The scale is logarithmic, 0.01 to 100."],["MSI score","The MSIsensor score: the percentage of microsatellite sites that look unstable in the tumour."],["FGA","Fraction of the genome altered: the share of the genome whose copy number differs from the baseline, from 0 to 1. It is read from the project-wide Battenberg tables."]]},{heading:"Linking back to the analyses",paragraphs:[`Every value names its analysis, with version and Isabl id. Picking an analysis in the side menu's "Analyses on this page" highlights the tiles and cards it feeds.`]}]},copyNumber:{title:"Copy number",intro:"How many copies of each part of the genome the tumour carries, segment by segment, from chromosome 1 to X.",sections:[{heading:"What is drawn",paragraphs:['Each horizontal stroke is one segment: a stretch of the genome with a constant copy number. Its height is the number of copies, from 0 up to 8; anything higher is drawn at the top and the axis reads "8+". A gain or amplification rises as a column from the baseline to its stroke, and a loss falls to it, so the changes read as a landscape. Alternating grey bands mark the chromosomes, named in a strip along the bottom.',`The line across the plot is the baseline: the tumour's ploidy rounded to whole copies (labelled, for example, "2 copies"). Segments are coloured by how they compare with it.`],terms:[["Grey","Neutral: the same number of copies as the baseline."],["Orange","Gain: at least one copy more than the baseline."],["Dark orange","Amplification: three or more copies above the baseline."],["Blue","Loss: at least one copy fewer than the baseline."]]},{heading:"Total or allele-specific",paragraphs:["Total shows all copies together. Allele-specific, when the analysis provides it, splits each segment into its major allele (the more common parental copy, dark) and minor allele (light). Where the two are equal they are drawn slightly apart so both stay visible. A minor allele of 0 means one parent's copy is lost there (loss of heterozygosity)."]},{heading:"Driver genes",paragraphs:["A label along the top names each gene with likely driver mutations, one per gene, joined by a line to a dot on the segment the gene sits on, so its copy number can be read off at once. Hover one for its protein changes and the copies there."]},{heading:"Amplified and lost genes",paragraphs:["The oncogenes the report calls amplified and the tumour suppressors it calls homozygously lost, from the copy number over each gene, in chromosome order. The row of cells shows the copy number (all eight filled means eight copies or more). When the sample has RNA, each gene also shows its expression against each expression cohort: the log2 of this sample's level over the cohort's mean, so +1 is twice the cohort's level. Point at a gene to mark it on the plot; click it to glide to its chromosome."]},{heading:"Fraction of genome altered against the cohort",paragraphs:["The tumour's FGA (the share of the genome whose copy number differs from the baseline) set against every tumour in the project's FGA table, by disease, as the report draws it: only diseases with at least five tumours, plus this tumour's own, highest median first, with some disease labels merged (OSOS and CHOS as OS, MFH as US, LIHB as HBL). Each box spans the middle half of a disease's tumours, the line in it is the median, the whiskers reach the furthest tumours within one and a half box-lengths, and each dot is one tumour. The pin is this tumour; hover a disease for its numbers and, in the tumour's own disease, where it ranks.","The cohort is the one the report compared with when it ran. It does not grow as the project does; rerun the report to compare with the cohort as it is now."]},{heading:"Reading and moving around",terms:[["Hover a segment","Its call, copies (major + minor), coordinates and, when available, log2 ratio. A readout at the foot of the plot gives the pointer's place on the genome."],["Click a segment","Lists the mutations inside it in the Mutations card."],["Click a driver","Finds that gene in the Mutations card."],["Scroll up or down over the plot","Zooms around the pointer: up zooms in, down zooms out (two fingers on a trackpad, or a mouse wheel). A pinch zooms too. A scroll that starts outside the plot keeps scrolling the page, and once the whole genome is in view, scrolling down scrolls the page again."],["Scroll sideways, or drag","Pans a zoomed view (two fingers sideways on a trackpad, or Shift and a mouse wheel)."],["Arrow keys, plus and minus, 0","With the plot focused: pan, zoom in and out, and show the whole genome."],["Double-click a chromosome, or click its name","Glides to fill the view with it; the strip then counts megabases."],["The overview","The whole genome in miniature under the strip. Its window shows where the plot is: drag the window to move, its ends to resize, or click elsewhere to centre it there. The button by the title returns to the whole genome."],["Hover a mutation in the table","Marks it here, with a ring on the segment it sits on and its copy number."]]},{heading:"Tumour-only reports",paragraphs:["Without a matched normal there is no ploidy estimate, so segments come from CNVkit and are called against two copies. Allele-specific copy numbers are not available."]}]},mutations:{title:"Mutations",intro:"The tumour's somatic SNVs and indels that passed the callers' filters: how they are distributed across cancer cells, and a searchable, filterable table of every call.",sections:[{heading:"Which mutations",terms:[["Drivers","Likely drivers flagged by the report: coding mutations that match OncoKB or COSMIC driver annotations (the exact protein change, or a damaging consequence in a known cancer gene), plus known hotspots the callers missed and the report recovered from the tumour's reads."],["Coding","Mutations whose effect changes a protein, by the report's list of coding effects."],["All","Every PASS SNV and indel."]],paragraphs:["The counts beside each choice follow the search and filters, so they always say what you would see."]},{heading:"FFPE samples",paragraphs:["Formalin-fixed (FFPE) tissue damages DNA in ways that look like mutations, mostly C>T changes at low allele fractions. For an FFPE sample, FFPERASE scores each SNV and indel for how likely it is to be such an artifact, and the report counts only the calls scored at or below its threshold (quoted beside the table). Its SNV, indel and coding totals and the TMB leave the rest out.",`The report marks each call it leaves out, and the dashboard follows that mark: the Coding and All counts, the table and the curve leave those calls out, and the card's subtitle says so. Drivers are all listed, as in the report, and any the filter would remove carry an "FFPE filtered" tag. "Show filtered calls", under FFPE filter beside the table, brings the removed calls back, tagged the same way.`]},{heading:"Cancer cell fraction and variant allele fraction",paragraphs:["The curve across the top is a smoothed histogram of every PASS mutation; driver mutations sit on it as labelled dots, and the diamond on the axis is the median. Switch between the two measures:"],terms:[["CCF",'Cancer cell fraction: the estimated share of cancer cells carrying the mutation, corrected for purity and copy number. Around 1 (the "clonal" mark) means nearly every cancer cell has it, which suggests it arose early; clearly below 1 means a subclone. Estimates can land somewhat above 1. Shown from 0 to 2.'],["VAF","Variant allele fraction: the share of sequencing reads at the position that carry the mutation, from 0 to 1. Raw, not corrected for purity or copy number. Tumour-only reports open on VAF, since CCF needs a matched normal."]]},{heading:"Filtering by the curve",paragraphs:["Drag across the curve to keep only mutations in that CCF or VAF range: the curve stays lit inside the range and fades outside it, and the range is read out at its foot. Drag the edges to resize it, or its body to move it. The range appears with the other filters and can be removed there, or by clicking the curve."]},{heading:"Coding mutations against reference cohorts",paragraphs:["At the foot of the card, the tumour's coding SNVs and indels set against reference tumours of the same disease, as the report's TMB figure draws them: Grobner and colleagues' published pan-cancer cohort, where the disease has a match there, and MSK's TMB reference project. Each cohort is a violin cut at its smallest and largest tumour; two cohorts share one violin, one on each side. The bar inside marks the middle half and the circle the median. The line across is this tumour; hover a cohort for its numbers and where the tumour ranks.","Counts are coding mutations as the report counts them (after the FFPE filter for FFPE samples), the same numbers as the Coding tab. The MSK cohort leaves out tumours far above its 99th percentile, as the report does. The cohorts are the ones the report compared with when it ran; rerun the report to compare with them as they are now."]},{heading:"The table",terms:[["Gene and position","The gene, and the mutation's chromosome and position (GRCh37)."],["Change","The protein change, with the cDNA change beneath."],["Effect","What the mutation does to the gene, from the VEP consequence (or the report's effect). Truncating effects are in bold."],["VAF and CCF bars","The value with a bar for quick comparison; the CCF bar's tick marks 1, clonal."],["Driver","Flagged as a likely driver (shown when the table is not already limited to drivers)."],["Hotspot","The exact protein change is a known recurrent cancer hotspot."],["In DMP","The same mutation was also found by the patient's clinical MSK-IMPACT (DMP) sequencing."],["FFPE filtered","FFPE samples only: the report's FFPE artifact filter leaves this call out of its counts (see FFPE samples)."]]},{heading:"Opening a row",terms:[["Variant","SNV or indel, with the reference and alternate bases."],["Reads","Reads supporting the mutation out of all reads at the position. Only hotspots the report recovered from the tumour's reads have them; the callers' tables give no single count."],["Normal VAF","The mutation's allele fraction in the matched normal; near 0 for a somatic mutation."],["Mutant copies","How many copies of that part of the genome carry the mutation, out of all copies there."],["Consequence","The full VEP consequence."],["COSMIC","How many samples in COSMIC carry it, and how closely they match (exact change, same position, codon or gene)."],["Expression","The gene's expression in the tumour's RNA, in transcripts per million, when RNA was sequenced."],["Gene role","Whether the gene is a known oncogene or tumour suppressor gene (TSG)."],["Show on copy number","Zooms the Copy number card to the mutation's chromosome and marks it."]]},{heading:"Searching and filtering",paragraphs:["Search takes a gene, a protein or cDNA change, a COSMIC term, or a locus such as chr12:25,398,284 or a range such as chr8:1-50,000,000. Press / anywhere on the page to jump to it. Each filter's count is how many rows you would get by ticking it, given everything else."],terms:[["Missense","One amino acid replaced by another."],["Truncating","Stop gained or lost, start lost, or a frameshift."],["Splice","Changes a splice site or splice region."],["In-frame","Inserts or deletes amino acids without shifting the reading frame."],["Synonymous","Changes the DNA but not the amino acid."],["Other","Everything else, such as intronic, UTR or upstream changes."]]}]},structuralVariants:{title:"Structural variants",intro:"The tumour's rearrangements as the report shows them: those with a breakpoint in an oncogene or tumour suppressor, those that take in a whole gene, and how all of them group into rearrangement signatures.",sections:[{heading:"Which rearrangements",paragraphs:["The report works from the high-confidence structural variants of ANNOT_SVS, which keeps calls made by two or more callers (SvABA, BRASS and GRIDSS) and annotates the genes they touch with AnnotSV. The count beside the title is how many of these the report counts, its rearrangements total.",`The tables keep the rearrangements whose genes include an oncogene or tumour suppressor, by the report's gene lists. It also searches the callers' raw calls for known rearrangements the high-confidence set can miss, such as CIC fusions, and adds them; a rescued event that is not a two-caller PASS says so in its callers, as in "gridss (CIC rescued)".`]},{heading:"The two tables",terms:[["Rearranged oncogenes and tumour suppressors",'One row per rearrangement and gene it hits, with the gene and breakpoint on each side. A gene near a breakpoint rather than in it is named as the report names it, such as "TERT +/- 100Kb".'],["Whole-gene rearrangements","Rearrangements that take in a whole oncogene or tumour suppressor, from start to end: a deletion of the whole gene, for example."],["Role","Whether the row's genes include an oncogene, a tumour suppressor or both, as the report colours its rows. Click a role above the tables to show only its rows."],["Left and right","Each breakpoint's gene, position (GRCh37) and where it falls in the gene, as AnnotSV writes it (intron5, exon2-exon5). Breakpoints are ordered by chromosome, then position."],["Callers and support","The callers that made the call, and the most reads any of them gives in support."],["Pileups","Supporting reads over all reads at each breakpoint in the tumour's alignments, left then right."],["Expression","For tumours with RNA: whether each gene's expression is high or low against each expression cohort (p63 is cohort project 63): at or above its 90th percentile, at or below its 10th, or neither (None). N/A means the cohort has no value for the gene."]],paragraphs:["Open a row to see both breakpoints, show them on the copy-number card, or copy their IGV loci."]},{heading:"Rearrangement signatures",paragraphs:["WGSPOST groups the tumour's rearrangements the way rearrangement signatures are described: clustered (rearrangements that sit unusually close together, as in chromothripsis) or dispersed, then by class and, except for translocations, by size from under 1 kb to over 1 Mb. Each bar is how many rearrangements fall in a group, grouped under its class; lighter bars are the clustered ones, in the shaded zone. A group with none shows a short stub on the baseline. Hover a bar for its name and its share of all rearrangements, or a class in the key to light its bars.","WGSPOST counts from its own copy of the calls, so its total can differ slightly from the report's rearrangements count."],terms:[["Deletion","A stretch of the genome lost between two breakpoints."],["Tandem duplication","A stretch copied next to itself."],["Inversion","A stretch turned around in place."],["Translocation","A join between two chromosomes."]]}]},circos:{title:"Integrated circos",intro:"The tumour's whole genome on one circle, as WGSPOST's integrated circos draws it: every SNV, indel, copy-number change and rearrangement, from the outside in, with the counts beside it.",sections:[{heading:"The rings, from the outside in",terms:[["Drivers","Genes with likely driver mutations, outside the circle, as the Mutations card flags them."],["Chromosomes","1 to 22 and X, clockwise from the top, each in proportion to its length (GRCh37). Y is left out, as in WGSPOST's figure."],["SNV rainfall","One dot per SNV the report counts, coloured by its substitution (in the pyrimidine context). Its distance from the centre is the distance to the SNV before it on the chromosome, on a log scale: the rings mark 100 bp, 10 kb and 1 Mb. Mutations far apart sit near the outside; clusters, such as kataegis, fall inwards."],["Insertions and deletions","Two thin rings of ticks: insertions, then deletions, coloured by the mechanism WGSPOST's microhomology and repeat callers assign (complex indels are grey)."],["Copy number","Gains of the major allele, darker for more copies (2 to 3, 4 to 7, 8 or more), then loss of heterozygosity, where the minor allele has no copies. From Battenberg (CNVkit for tumour-only reports)."],["Rearrangements","Links across the middle, coloured by class as in the Structural variants card: deletions, tandem duplications, inversions and translocations."]]},{heading:"Reading it",paragraphs:["Click a chromosome to open it out to a large share of the circle, with its megabases counted inside the ring; click it again to close it. Hover a dot, a tick or a link for its details, and a chromosome for its counts. Hover a bar beside the circle to light its calls on it: a substitution, an indel kind or a rearrangement class. The buttons above the circle hide and show each track.","The circle is drawn from the same calls as the rest of the report (WGSPOST builds its figure from them too), so its counts match the Mutations and Structural variants cards. The indel kinds are WGSPOST's own classification of its indels."]}]},cnsv:{title:"Copy number and rearrangements by chromosome",intro:"One chromosome at a time, the evidence behind the copy-number calls set against the rearrangements, as WGSPOST's CN/SV integration figures show it; and Battenberg's raw data for the tumour and its normal.",sections:[{heading:"The CN/SV view, from the top",terms:[["BAF","The B-allele frequency of each heterozygous SNP in the tumour, after Battenberg's phasing (its corrected phased BAF). Balanced copies sit at 0.5; a gain or a loss pulls the SNPs of a segment away from it."],["Segments","Battenberg's copy-number segments, drawn at their BAF and labelled with their allele copies and the share of cells that carry them (“2+1: 64%” means two copies of one allele and one of the other, in 64% of cells). Green when every cell carries the state; red when it is subclonal, with the second state below."],["Rearrangements","Arcs join the two ends of a rearrangement within the chromosome: deletions and tandem duplications on the upper lane, inversions on the lower, coloured by class as in the Structural variants card. An arrow marks an end whose partner is on another chromosome, labelled with that chromosome. Faint lines drop from each end to the copy number below it, where a breakpoint often meets a step."],["Copy number","BRASS's read-depth copy number, averaged in 100 kb windows as the report's figure does, over alternating whole-copy bands. The dashed line is Battenberg's total copy number for the same stretch, green or red as its segment."]]},{heading:"Battenberg raw",paragraphs:["Battenberg's input data, as its Tumor and Germline figures show it: the LogR (read depth against the normal, on a log scale) and BAF of the tumour, then of the normal, at SNP loci across the chromosome or the whole genome. Homozygous loci sit at 0 and 1 in the BAF; the normal's heterozygous SNPs gather at 0.5."]},{heading:"Reading it",paragraphs:["Pick a chromosome above the plot; chromosomes with data stand out. Scroll up or down over the plot to zoom around the pointer (up zooms in), sideways or drag to pan, double-click to zoom in, and click a rearrangement to fit it in view; the arrow keys, plus, minus and 0 work too. Hover anywhere for the segment, its state and the read depth at that point, or a rearrangement for its ends.","Points are thinned to evenly spaced SNPs, at most 10,000 per chromosome (1,500 across the genome), so the shape of the data is kept while the page stays fast. The report shows the same figures as images, so there is nothing here to compare against it number by number."]}]},rna:{title:"RNA",intro:"What the tumour's RNA shows, as the report lists it: genes fused together, and cancer genes expressed far above tumours like it.",sections:[{heading:"Fusions",terms:[["Confident","Fusions ANNOT_FUSIONS is confident in, one row per gene pair: the most split and spanning reads among the pair's calls, and every caller that found it. Open a pair for its breakpoint events and every other field the report shows."],["Rescued","Fusions with less support that ANNOT_FUSIONS keeps because they involve genes known to fuse in cancer."],["Split and spanning reads","Split reads cross the junction itself; spanning read pairs have one mate on each gene. The bars compare the fusions in the list."],["Highlighted","The fusions the report colours: OncoKB calls them oncogenic or likely oncogenic, or, for calls the report grouped itself, one gene is a COSMIC fusion gene."],["Breakpoints","Click an end to show it on the copy-number plot, where a fusion's genomic breakpoint often meets a change in copy number or a rearrangement."]]},{heading:"Overexpressed cancer genes",paragraphs:["Oncogenes, tumour suppressors and COSMIC Census genes whose level in the tumour is above the 95% confidence interval of its cohort's mean and at least four times that mean (a log2 fold change over 2), as the report finds them. Tumours of blood cancers are compared with blood cancers, solid tumours with solid tumours. The bar is the log2 fold change, with the times-the-mean beside it; when the tumour belongs to several cohort projects there is one bar per project.","The cohort is as it was when the report ran; keeping it current is planned."]}]},treatments:{title:"Available treatments",intro:"Drugs OncoKB associates with the tumour's alterations, as the report lists them: its likely drivers, rearrangements, fusions and copy-number changes, and the alterations its DMP (MSK-IMPACT) test found.",sections:[{heading:"Reading the table",terms:[["Level","OncoKB's level of evidence for the association, the strongest first: 1 and 2 are standard care (FDA-recognised, or in guidelines), 3A and 3B clinical evidence, 4 biological evidence, R1 and R2 resistance. Hover the badge for OncoKB's own description."],["Alteration","The gene and the change OncoKB matched, with its kind (SNV/Indel, Fusion/SV or CNA). Click it for OncoKB's page."],["Drugs","Each option on its own: drugs joined by + are given together."],["Tumour type","The cancer type the level holds for; All Solid Tumors and similar apply across types."],["Called by","Who found the alteration: Isabl's own calls, the DMP's, or both. “Called by Isabl only” leaves out what only the DMP found."]]},{heading:"Where it comes from",paragraphs:["The report asks OncoKB for each alteration, for the tumour's disease, when it runs, and keeps one row per alteration, drug and level. OncoKB's knowledge changes over time; rerunning the report asks it again."]}]},signaturesHrd:{title:"Signatures and HRD",intro:"Which mutational processes left their mark on the tumour, set against tumours of the same disease, and whether it shows homologous recombination deficiency (HRD), as the report shows them.",sections:[{heading:"Mutational signatures",paragraphs:["WGSPOST fits known COSMIC substitution signatures to the tumour's somatic SNVs and estimates how many mutations each one accounts for. The left column is this tumour: each band is a signature's share of its mutations, the largest first.","The right column is the average of tumours of the same disease in the cohort (n is how many), each tumour's shares averaged and scaled to the cohort's average mutation count. A ribbon joins each signature's two bands, widening or narrowing with its share, so a signature can be followed from the tumour to its cohort; a label on the ribbon says how many percentage points the tumour leads or trails the cohort by, where the difference is at least 5. Hover a band, a ribbon or a row of the table for the numbers.","Seven signatures get colours of their own (eight when there are no more than eight); any beyond that are drawn together as Other. A tumour without a cohort to compare shows its own shares as one column."],terms:[["Signature","A pattern of substitutions, by the base change and its neighbours, that a mutational process leaves (SBS1, SBS5)."],["Aetiology","The process the report links a signature to, when it names one."]]},{heading:"96 mutational contexts",paragraphs:["Every substitution is one of six kinds (C>A, C>G, C>T, T>A, T>C, T>G, naming the pyrimidine base of the pair) and sits between two neighbouring bases, which gives 96 contexts. The top panel counts the tumour's SNVs in each, as WGSPOST's MutationalPatterns step does. The middle panel is what the fitted signatures rebuild: each signature's probabilities for the 96 contexts, weighted by its contribution above and added up. The bottom panel is the first minus the second, so a bar above the line is a context with more SNVs than the signatures explain.","Share draws each profile as percentages of its own total, which is how the report's figure compares the two; Count draws SNVs. Both profiles share one scale, and the difference its own. Click a class in the header to open it and name its sixteen contexts, written as the base before, the mutated base in colour, and the base after. Hover a column to read all three panels at once.","Cosine similarity and RSS are the report's own measures of the fit: the closer to 1 (cosine) and to 0 (RSS), the better the signatures explain the tumour. They are computed by the report from the relative profiles, as MutationalPatterns does. For an FFPE sample, switch between the run the report uses (its FFPE-filtered calls) and the unfiltered one. When the report did not include the signature matrix its fit used, only the observed profile is drawn."]},{heading:"HRD scores",paragraphs:["Two classifiers estimate whether the tumour has lost homologous recombination repair, as BRCA1 or BRCA2 loss does: HRDetect, from the substitution, indel and rearrangement patterns below, and CHORD, from its own set of mutation features. The report rates each HIGH at or above its threshold and LOW below it; the line on each gauge is the threshold."]},{heading:"HRDetect features",paragraphs:["The six features HRDetect weighs, for every tumour in the cohort and this one, each scaled from 0 (the cohort's lowest) to 1 (its highest). Each row is one feature: the pin is this tumour, the dots beneath are the cohort's samples, the shaded band is the middle half of the cohort and the line in it the median. With eight or more cohort samples a smoothed outline of how the samples are spread is drawn above the dots; with fewer it is left out, because it would suggest more than the data says. The words at the right say how many of the other cohort samples the tumour is above. Hover a row for the unscaled value. For FFPE samples the tumour's values come from its FFPE-filtered analysis."],terms:[["Del. MH","The share of deletions with microhomology at their ends, a sign of repair by end joining."],["SBS3 and SBS8","Substitution signatures 3 and 8."],["RS3 and RS5","Rearrangement signatures 3 (small tandem duplications) and 5 (deletions)."],["HRD index","Loss of heterozygosity, telomeric allelic imbalance and large-scale state transitions, combined."]]}]}},w3={summary:{BATTENBERG:"Tumour purity and ploidy, and the copy-number segments the ring's gains and losses are called from.","BATTENBERG cohort":"Project-wide Battenberg tables, which hold the FGA value and the cohort it is compared with.",CNV_UNMATCHED:"Copy-number segments of a tumour-only report (CNVkit), which the ring's gains and losses are called from.",MOSDEPTH:"The median sequencing coverage.",MSISENSOR:"The MSI score.",MSISENSOR_UNMATCHED:"The MSI score of a tumour-only report.",ANNOT_SNVS:"Somatic SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS:"Somatic indel calls: their count goes into TMB, and driver indels are marked on the ring.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls: their count goes into TMB, and driver SNVs are marked on the ring.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls: their count goes into TMB, and driver indels are marked on the ring.",WGSPOST:"Cancer cell fractions of the mutations, read together with the driver calls marked on the ring."},copyNumber:{BATTENBERG:"Every segment drawn: total copies, major and minor allele copies, and the ploidy the baseline is rounded from.","BATTENBERG cohort":"Project-wide Battenberg tables of FGA: the tumour's own FGA, and the cohort the FGA figure compares it with, as it was when the report ran.",CNV_UNMATCHED:"The segments of a tumour-only report (CNVkit), drawn against two copies."},mutations:{ANNOT_SNVS:"The tumour's PASS somatic SNVs and their annotation: gene, protein and cDNA change, effect, VAF, read counts, normal VAF and COSMIC.","ANNOT_SNVS cohort":"The TMB reference project's coding SNVs: MSK's reference tumours for the disease, counted for the TMB figure, as they were when the report ran.","ANNOT_INDELS cohort":"The TMB reference project's coding indels, counted for the TMB figure like its SNVs.",ANNOT_INDELS:"The tumour's PASS somatic indels and their annotation, as for SNVs.",ANNOT_SNVS_UNMATCHED:"Tumour-only SNV calls and their annotation.",ANNOT_INDELS_UNMATCHED:"Tumour-only indel calls and their annotation.",WGSPOST:"Each mutation's cancer cell fraction (CCF) and how many copies carry it.",BATTENBERG:"Ploidy, which fills in the copy count where WGSPOST has none, and purity, which gives a CCF to hotspots recovered from the tumour's reads.",FFPERASE_SNVS:"FFPE samples: each SNV's artifact score. Calls scoring above the report's threshold are left out of the counts.",FFPERASE_INDELS:"FFPE samples: each indel's artifact score. Calls scoring above the report's threshold are left out of the counts."},structuralVariants:{ANNOT_SVS:"The high-confidence structural variants and their AnnotSV gene annotation: the rearrangements the report counts and the rows of its tables.",ANNOT_SVS_UNMATCHED:"Tumour-only structural variants and their annotation, kept when rare in the population.",SVABA:"Raw SvABA calls, searched for known rearrangements the high-confidence set missed (rescued events).",GRIDSS:"Raw GRIDSS calls, searched for rescued events like SvABA's.",SVABA_UNMATCHED:"Raw tumour-only SvABA calls, searched for rescued events.",GRIDSS_UNMATCHED:"Raw tumour-only GRIDSS calls, searched for rescued events.",WGSPOST:"The rearrangement-signature counts.",WGSPOST_UNMATCHED:"The rearrangement-signature counts of a tumour-only report."},circos:{ANNOT_SNVS:"The SNVs of the rainfall, with their positions and substitutions.",ANNOT_SNVS_UNMATCHED:"The tumour-only SNVs of the rainfall.",WGSPOST:"The indel classification behind the indel rings (microhomology, repeat or other), and the signature contributions beside the circle.",WGSPOST_UNMATCHED:"The indel classification of a tumour-only report.",BATTENBERG:"The copy-number rings: major and minor allele copies of each segment, and the purity and ploidy beside the circle.",CNV_UNMATCHED:"The copy number of a tumour-only report (CNVkit).",ANNOT_SVS:"The rearrangements drawn across the middle.",ANNOT_SVS_UNMATCHED:"The tumour-only rearrangements drawn across the middle."},cnsv:{BATTENBERG:"The BAF per SNP, the segments with their allele states, and the raw tumour and normal LogR and BAF.",BRASS:"The read-depth copy number in 100 kb windows.",ANNOT_SVS:"The rearrangements drawn as arcs and arrows."},rna:{ANNOT_FUSIONS:"The confident and rescued fusions, and the link to the fusion callers' report.","SALMON_GENCODE cohort":"The tumour's gene levels and its project's, which the overexpressed genes are found against."},treatments:{ANNOT_SNVS:"The SNV drivers OncoKB is asked about.",ANNOT_INDELS:"The indel drivers OncoKB is asked about.",ANNOT_SVS:"The rearrangements of known oncogenes and fusions OncoKB is asked about.",BATTENBERG:"The amplified and lost genes OncoKB is asked about.",ANNOT_FUSIONS:"The RNA fusions OncoKB is asked about."},signaturesHrd:{WGSPOST:"The tumour's signature contributions, its SNV counts in the 96 mutational contexts, its HRDetect and CHORD scores, and its HRDetect features.",WGSPOST_FFPE:"For an FFPE sample, the same from the FFPE-filtered calls.","WGSPOST cohort":"The cohort's signature contributions and HRDetect features, which the tumour is compared with."}};function N3(n,l){const a=l.role==="cohort"||l.app.endsWith("Project Application"),i=l.app.replace(/ Project Application$/,""),c=w3[n];return(a?c[`${i} cohort`]:c[i])??(a?"A project-wide run the report reads for comparison with the cohort.":"An analysis the report reads to build this card.")}function C3({topic:n,lineage:l,subject:a,onClose:i}){const c=Jm[n],d=C.useId(),f=C.useRef(null),m=l.filter(M=>M.role!=="cohort"&&!M.app.endsWith("Project Application")),g=l.filter(M=>!m.includes(M)),y=C.useRef(i);y.current=i,C.useEffect(()=>{var I;const M=document.activeElement;(I=f.current)==null||I.focus();const _=document.documentElement,R=_.style.overflow;_.style.overflow="hidden";const k=K=>{K.key==="Escape"&&y.current()};return document.addEventListener("keydown",k),()=>{document.removeEventListener("keydown",k),_.style.overflow=R,M==null||M.focus()}},[]);const v=[...c.sections.map(M=>M.heading),"Sources"],p=v.map((M,_)=>`${d}-s${_}`),[S,j]=C.useState(0),b=C.useRef(null),N=C.useRef(!1),E=C.useRef(null),A=C.useRef(0);C.useEffect(()=>{const M=b.current;if(!M)return;const _=24,R=()=>{const K=M.getBoundingClientRect().top,O=Math.max(0,M.scrollHeight-M.clientHeight),se=p.map(le=>{const $=document.getElementById(le);return $?$.getBoundingClientRect().top-K:1/0}),ie=Math.max(0,...se.map(le=>Number.isFinite(le)?le+M.scrollTop-O-_:0)),W=_+(O>0?ie*Math.min(1,M.scrollTop/O):0);let P=0;se.forEach((le,$)=>{le<=W&&(P=$)}),j(P)},k=()=>{if(N.current){E.current===null?(window.clearTimeout(A.current),A.current=window.setTimeout(()=>E.current=M.scrollTop,160)):Math.abs(M.scrollTop-E.current)>4&&(N.current=!1,E.current=null,R());return}R()},I=()=>{N.current&&E.current===null&&(window.clearTimeout(A.current),N.current=!1,R())};return R(),M.addEventListener("scroll",k,{passive:!0}),M.addEventListener("wheel",I,{passive:!0}),M.addEventListener("touchstart",I,{passive:!0}),()=>{window.clearTimeout(A.current),M.removeEventListener("scroll",k),M.removeEventListener("wheel",I),M.removeEventListener("touchstart",I)}},[]);const T=M=>{var R;const _=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;N.current=!0,E.current=null,j(M),window.clearTimeout(A.current),A.current=window.setTimeout(()=>{var k;return E.current=((k=b.current)==null?void 0:k.scrollTop)??0},160),(R=document.getElementById(p[M]))==null||R.scrollIntoView({behavior:_?"auto":"smooth",block:"start"})},L=M=>r.jsxs("li",{className:"info-source",children:[r.jsx("span",{className:`tb-dot ${Zm(M.app)}`,"aria-hidden":!0}),r.jsxs("span",{className:"info-source-text",children:[M.pk?r.jsxs("a",{className:"info-source-name info-source-link",href:UN(M.pk),target:"_blank",rel:"noopener noreferrer",title:"Open this analysis in Isabl",children:[r.jsxs("span",{className:"mono",children:[M.app,M.version?` ${M.version}`:""]}),r.jsxs("span",{className:"mono info-source-pk",children:["#",M.pk]}),r.jsx(ly,{size:13,"aria-hidden":!0,className:"info-source-arrow"})]}):r.jsxs("span",{className:"info-source-name",children:[r.jsxs("span",{className:"mono",children:[M.app,M.version?` ${M.version}`:""]}),M.project?r.jsxs("span",{className:"info-source-pk",children:["project ",M.project]}):null]}),r.jsx("span",{className:"info-source-role",children:N3(n,M)})]})]},zn(M));return Pr.createPortal(r.jsx("div",{className:`info-backdrop ${Pn.theme}`,onMouseDown:M=>M.target===M.currentTarget&&i(),children:r.jsxs("div",{className:"info-dialog",role:"dialog","aria-modal":"true","aria-labelledby":d,children:[r.jsx("button",{ref:f,type:"button",className:"info-close","aria-label":"Close",onClick:i,children:r.jsx(Yr,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail","aria-label":"Contents",children:[r.jsx("span",{className:"info-kicker",children:a??"About"}),r.jsx("h2",{id:d,children:c.title}),r.jsx("ol",{children:v.map((M,_)=>r.jsx("li",{children:r.jsx("button",{type:"button","aria-current":_===S?"true":void 0,onClick:()=>T(_),children:M})},M))})]}),r.jsxs("div",{ref:b,className:"info-main",children:[r.jsx("p",{className:"info-intro",children:c.intro}),c.sections.map((M,_)=>{var R;return r.jsxs("section",{id:p[_],className:"info-section",children:[r.jsx("h3",{children:M.heading}),(R=M.paragraphs)==null?void 0:R.map(k=>r.jsx("p",{children:k},k)),M.terms&&r.jsx("dl",{children:M.terms.map(([k,I])=>r.jsxs("div",{children:[r.jsx("dt",{children:k}),r.jsx("dd",{children:I})]},k))})]},M.heading)}),r.jsxs("section",{id:p[p.length-1],className:"info-section","aria-label":"Sources",children:[r.jsx("h3",{children:"Sources"}),r.jsx("p",{children:"The analyses this card reads, with their version and Isabl id, and what each one is responsible for."}),l.length===0&&r.jsx("p",{children:"No analyses recorded for this card."}),r.jsx("ul",{className:"info-sources",children:m.map(L)}),g.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h4",{children:"Cohort runs"}),r.jsx("ul",{className:"info-sources",children:g.map(L)})]})]})]})]})}),document.body)}function Mv(n){return n.split(" ").map(l=>/^[A-Z0-9]{2,}$/.test(l)?l:l.toLowerCase()).join(" ")}function Ry({topic:n,lineage:l,subject:a}){const[i,c]=C.useState(!1);return r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"sc-ib sm info-trigger","aria-label":`About ${Mv(Jm[n].title)}`,title:`About ${Mv(Jm[n].title)}`,"aria-haspopup":"dialog",onClick:()=>c(!0),children:r.jsx(ZN,{size:15,"aria-hidden":!0})}),i&&r.jsx(C3,{topic:n,lineage:l,subject:a,onClose:()=>c(!1)})]})}function M3({children:n}){return r.jsx("div",{className:"sc-cf",children:n})}function Ju(...n){const l=new Map;for(const a of n.flat())a&&!l.has(zn(a))&&l.set(zn(a),a);return[...l.values()]}const nl=C.forwardRef(function({title:l,subtitle:a,controls:i,lineage:c,picked:d,footer:f,className:m="",info:g,expandable:y,children:v},p){const S=!!d&&c.some(N=>zn(N)===d),[j,b]=E3();return r.jsxs(r.Fragment,{children:[j&&r.jsx("div",{className:"sc-full-backdrop","aria-hidden":!0,onClick:()=>b(!1)}),r.jsxs("section",{ref:p,className:`sc-card flex flex-col ${m}`,"data-picked":S,"data-full":j||void 0,"aria-label":l,children:[r.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-2.5 px-5 pt-5 pb-4",children:[r.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[r.jsx("h2",{className:"m-0 text-[19px] font-semibold tracking-tight",children:l}),a&&r.jsx("span",{className:"text-[13px]",style:{color:"var(--muted)"},children:a})]}),(i||g||y)&&r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i,y&&r.jsx("button",{type:"button",className:"sc-ib","aria-label":j?"Exit full screen":`Expand ${l.toLowerCase()} to full screen`,title:j?"Exit full screen (Esc)":"Expand to full screen","aria-pressed":j,onClick:()=>b(!j),children:j?r.jsx(sC,{size:16,"aria-hidden":!0}):r.jsx(tC,{size:16,"aria-hidden":!0})}),g&&r.jsx(Ry,{topic:g,lineage:c,subject:typeof a=="string"?a:void 0})]})]}),r.jsx("div",{className:"min-w-0 flex-auto",children:v}),f&&r.jsx(M3,{children:f})]})]})});function E3(){const[n,l]=C.useState(!1);return C.useEffect(()=>{if(!n)return;const a=document.documentElement,i=a.style.overflow;a.style.overflow="hidden";const c=d=>{var f,m;d.key==="Escape"&&((m=(f=d.target)==null?void 0:f.closest)!=null&&m.call(f,"input, textarea, select")||document.querySelector(".info-backdrop")||l(!1))};return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c),a.style.overflow=i}},[n]),[n,l]}function ss({label:n,envelope:l,loading:a,skeletonHeight:i=160,children:c}){return r.jsxs(r.Fragment,{children:[a&&!l&&r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:i},"aria-label":`Loading ${n}`})}),l&&l.status!=="ok"&&r.jsx("div",{className:"px-5 py-4",children:r.jsx(_a,{envelope:l})}),(l==null?void 0:l.status)==="ok"&&l.data!==null&&c(l.data),(l==null?void 0:l.status)==="ok"&&l.warnings.length>0&&r.jsx("div",{className:"px-5 pb-1 text-xs",style:{color:"var(--warn-ink)"},children:l.warnings.join(" ")})]})}function _3({title:n,subtitle:l,controls:a,envelope:i,loading:c,picked:d,skeletonHeight:f=160,footer:m,className:g="",info:y,moreLineage:v,children:p}){return r.jsx(nl,{title:n,subtitle:l,controls:a,lineage:Ju(i==null?void 0:i.lineage,v),picked:d,footer:m,className:g,info:y,children:r.jsx(ss,{label:n,envelope:i,loading:c,skeletonHeight:f,children:p})})}function T3(n,l){const[a,i]=C.useState(null),[c,d]=C.useState(!1);return C.useLayoutEffect(()=>{const f=n.current;if(!f)return;const m=()=>{const y=f.querySelector('[aria-pressed="true"]');i(y?{x:y.offsetLeft,y:y.offsetTop,width:y.offsetWidth,height:y.offsetHeight}:null)};if(m(),typeof ResizeObserver>"u")return;const g=new ResizeObserver(m);g.observe(f);for(const y of Array.from(f.children))g.observe(y);return()=>g.disconnect()},[n,l]),C.useEffect(()=>{if(a&&!c){const f=requestAnimationFrame(()=>d(!0));return()=>cancelAnimationFrame(f)}},[a,c]),{thumb:a,moving:c}}function ls({label:n,options:l,value:a,onChange:i,className:c=""}){const d=C.useRef(null),{thumb:f,moving:m}=T3(d,a);return r.jsxs("div",{ref:d,className:`sc-track ${c}`,role:"group","aria-label":n,children:[f&&r.jsx("span",{className:"sc-thumb","data-moving":m,"aria-hidden":!0,style:{width:f.width,height:f.height,transform:`translate(${f.x}px, ${f.y}px)`}}),l.map(g=>r.jsx("button",{type:"button",className:"sc-seg","aria-pressed":g.value===a,disabled:g.disabled,title:g.title,onClick:()=>i(g.value),children:g.label},g.value))]})}function R3(n){var a;const l=[];return n.mode==="unmatched"&&l.push("Tumour only"),n.individual.germline_consent&&l.push("Germline consented"),(a=n.individual.dmp_id)!=null&&a.startsWith("P-")&&l.push("DMP linked"),l}function A3({data:n,onVersion:l}){const a=n.report,[i,c]=C.useState(!1),d=C.useRef(null);C.useEffect(()=>{if(!i)return;const m=y=>{var v;(v=d.current)!=null&&v.contains(y.target)||c(!1)},g=y=>{y.key==="Escape"&&c(!1)};return document.addEventListener("mousedown",m),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",g)}},[i]);const f=R3(n);return r.jsxs("div",{ref:d,className:"report-menu",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2","aria-expanded":i,"aria-haspopup":"dialog",onClick:()=>c(m=>!m),children:["Report ",a.version,r.jsx(ry,{size:14,"aria-hidden":!0})]}),i&&r.jsxs("div",{className:"report-pop",role:"dialog","aria-label":"Report",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[r.jsx("span",{className:"text-[13px] font-medium",style:{color:"var(--muted)"},children:"Report version"}),r.jsx(ls,{label:"Report version",value:a.version,onChange:m=>{l(m),c(!1)},options:n.versions.map(m=>({value:m.version,label:m.version}))})]}),r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["WGTS_REPORT ",a.analysis?`run #${a.analysis}`:"run indexed by hand",a.built?`, built ${my(a.built)}`:""]}),f.length>0&&r.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(m=>r.jsx("span",{className:"sc-chip",children:m},m))})]})]})}const Wm=["purity","ploidy","coverage","tmb","msi","fga"];function O3({value:n}){const a=2*Math.PI*13,i=Math.min(Math.max(n,0),1);return r.jsxs("svg",{viewBox:"0 0 34 34",className:"kpi-glyph h-[34px] w-[34px]","aria-hidden":!0,children:[r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",className:"kpi-track"}),r.jsx("circle",{cx:"17",cy:"17",r:13,fill:"none",strokeWidth:"4",strokeLinecap:"round",className:"kpi-fill",strokeDasharray:`${i*a} ${a}`,transform:"rotate(-90 17 17)"})]})}function Ev({value:n,min:l,max:a,ticks:i,reference:c}){const d=f=>4+(Math.min(Math.max(f,l),a)-l)/(a-l)*64;return r.jsxs("svg",{viewBox:"0 0 72 20",className:"kpi-glyph h-[18px] w-[60px]","aria-hidden":!0,children:[r.jsx("line",{x1:"4",x2:"68",y1:"12",y2:"12",className:"kpi-track",strokeWidth:"2",strokeLinecap:"round"}),i.map(f=>r.jsx("line",{x1:d(f),x2:d(f),y1:f===c?5:9,y2:"15",className:"kpi-tick",strokeWidth:f===c?1.5:1},f)),r.jsx("circle",{cx:d(n),cy:"12",r:"4.5",className:"kpi-dot",strokeWidth:"2"})]})}function z3({metric:n}){const l=n.value;if(l===null)return null;switch(n.key){case"purity":case"fga":return r.jsx(O3,{value:l});case"ploidy":return r.jsx(Ev,{value:l,min:1,max:6,ticks:[1,2,3,4,5,6],reference:2});case"tmb":return r.jsx(Ev,{value:Math.log10(Math.max(l,.01)),min:-2,max:2,ticks:[-2,-1,0,1,2]});default:return null}}const D3={purity:"Share of tumour cells, 0 to 1",fga:"Share of the genome altered, 0 to 1",ploidy:"On a scale of 1 to 6 copies; the tall tick marks 2",tmb:"On a log scale from 0.01 to 100 mutations per Mb"};function k3({metric:n,picked:l}){const a=n.value===null&&!n.text,i=!!l&&n.sources.some(c=>zn(c)===l);return r.jsxs("div",{className:"kpi","data-picked":i,title:D3[n.key],children:[r.jsxs("span",{className:"kpi-top",children:[r.jsx("span",{className:"kpi-label",children:n.label}),r.jsx(z3,{metric:n})]}),r.jsx("span",{className:"kpi-value","data-empty":a,children:a?mC(n):fC(n)})]})}function L3({sampleLabel:n,fingerprint:l,metrics:a,picked:i,lineage:c=[]}){var f;const d=(((f=a==null?void 0:a.data)==null?void 0:f.metrics)??[]).filter(m=>Wm.includes(m.key));return r.jsxs("section",{className:"sc-card relative flex flex-wrap items-center gap-x-8 gap-y-5 px-6 py-5","aria-label":`Genome fingerprint and summary of ${n}`,children:[r.jsx("span",{className:"absolute top-3 right-3",children:r.jsx(Ry,{topic:"summary",lineage:c,subject:n})}),r.jsx(wg,{fingerprint:l,size:"hero",title:n.split(" ")[0],subtitle:"tumour",className:"h-[210px] w-[210px] max-w-full flex-none"}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_230px] flex-col gap-3",children:[r.jsxs("h2",{className:"m-0 text-lg font-semibold tracking-tight",children:["Genome fingerprint of ",n]}),r.jsx("p",{className:"m-0 max-w-[46ch] text-[14.5px] leading-relaxed",style:{color:"var(--ink-2)"},children:l?gy(l):"No copy-number data for this sample."}),r.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 text-[12.5px]",style:{color:"var(--ink-2)"},children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--gain)"}}),"Gains, outer track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-[5px] w-3.5 rounded-[3px]",style:{background:"var(--loss)"}}),"Losses, inner track"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-3 w-[5px] rounded-sm",style:{background:"var(--ink)"}}),"Drivers"]})]}),r.jsx("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:"Chromosome 1 starts at the top and the ring runs clockwise to X."})]}),r.jsxs("div",{className:"kpi-grid min-w-0 flex-[1.4_1_420px]",children:[a===void 0&&Wm.map(m=>r.jsx("div",{className:"kpi","aria-hidden":!0,children:r.jsx("div",{className:"skeleton h-[70px]"})},m)),a&&a.status!=="ok"&&r.jsx("div",{className:"col-span-full",children:r.jsx(_a,{envelope:a})}),d.map(m=>r.jsx(k3,{metric:m,picked:i},m.key))]})]})}function $3({sampleLabel:n,failures:l,analyses:a}){return l.length===0?null:r.jsx("div",{className:"flex flex-col gap-2.5",children:l.map(i=>{const c=a.filter(d=>d.modules.some(f=>f.etl===i.etl&&f.status==="failed"));return r.jsxs("div",{className:"sc-card flex flex-wrap items-center gap-x-4 gap-y-3 px-[18px] py-3.5",role:"status",children:[r.jsx("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-[10px]",style:{background:"var(--warn-soft)",color:"var(--warn-ink)"},children:r.jsx(hy,{size:18,"aria-hidden":!0})}),r.jsxs("div",{className:"flex min-w-0 flex-[1_1_360px] flex-col gap-0.5",children:[r.jsxs("span",{className:"text-[14.5px] font-semibold",children:[i.label," failed for ",n]}),r.jsx("span",{className:"text-[13.5px]",style:{color:"var(--ink-2)"},children:i.message.split(`
|
|
297
|
+
`)[0]}),c.length>0&&r.jsxs("span",{className:"mono text-[11.5px]",style:{color:"var(--muted)"},children:["Reading ",c.map($C).join(", ")]})]})]},`${i.etl}-${i.node}`)})})}function H3({onSignedIn:n}){const[l,a]=C.useState("password"),[i,c]=C.useState(""),[d,f]=C.useState(""),[m,g]=C.useState(""),[y,v]=C.useState(null),[p,S]=C.useState(!1),j=l==="password"?!!i&&!!d:!!m.trim();return r.jsxs("form",{className:"sc-card mx-auto mt-16 flex w-[380px] max-w-full flex-col gap-3 p-6",onSubmit:async b=>{b.preventDefault(),S(!0),v(null);try{l==="password"?await DC(i,d):await zC(m.trim()),n()}catch(N){v(N.message)}finally{S(!1)}},children:[r.jsx("h1",{className:"m-0 text-lg font-semibold",children:"Sign in to Isabl"}),r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--ink-2)"},children:"The WGTS dashboard uses your Isabl account."}),l==="password"?r.jsxs(r.Fragment,{children:[r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"username",children:["Username",r.jsx("span",{className:"field",children:r.jsx("input",{id:"username",autoComplete:"username",value:i,onChange:b=>c(b.target.value)})})]}),r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"password",children:["Password",r.jsx("span",{className:"field",children:r.jsx("input",{id:"password",type:"password",autoComplete:"current-password",value:d,onChange:b=>f(b.target.value)})})]})]}):r.jsxs("label",{className:"flex flex-col gap-1 text-[13px] font-semibold",htmlFor:"token",children:["API token",r.jsx("span",{className:"field",children:r.jsx("input",{id:"token",type:"password",autoComplete:"off",spellCheck:!1,value:m,onChange:b=>g(b.target.value)})}),r.jsx("span",{className:"text-xs font-normal",style:{color:"var(--muted)"},children:"The token the Isabl CLI uses. Admins find it under Auth Token in Django admin."})]}),y&&r.jsx("p",{className:"m-0 text-sm",style:{color:"var(--warn-ink)"},role:"alert",children:y}),r.jsx("button",{type:"submit",className:"sc-btn sc-b1",disabled:p||!j,children:p?"Signing in":"Sign in"}),r.jsx("button",{type:"button",className:"self-start border-0 bg-transparent p-0 text-[13px] font-semibold",style:{color:"var(--link)",cursor:"pointer"},onClick:()=>{a(l==="password"?"token":"password"),v(null)},children:l==="password"?"Use an API token instead":"Use a username and password instead"})]})}const ot=1e3,eg=.35,U3=8,Hu=.1;function zu(n,l){return($u(n,l)??0)*ot}function Cs(n){const[l,a]=Ku[n.replace(/^chr/,"")];return[l*ot,a*ot]}function Pf(n,l,a){const[i,c]=n,d=Math.min(ot,Math.max(eg,(c-i)*a)),f=Math.min(Math.max(l-(l-i)/(c-i)*d,0),ot-d);return[f,f+d]}function pr(n,l){const a=n[1]-n[0],i=Math.min(Math.max(n[0]+l,0),ot-a);return[i,i+a]}function F3(n,l,a){const i=Math.min(Math.max(a,0),ot);return l===0?[Math.min(i,n[1]-eg),n[1]]:[n[0],Math.max(i,n[0]+eg)]}function B3(n,l,a){const i=(n[0]+n[1])/2+((l[0]+l[1])/2-(n[0]+n[1])/2)*a,[c,d]=[n[1]-n[0],l[1]-l[0]],f=Math.exp(Math.log(c)+(Math.log(d)-Math.log(c))*a),m=Math.min(Math.max(i-f/2,0),ot-f);return[m,m+f]}function _v(n){return n[1]-n[0]<ot-.5}function tg(n){for(const[l]of jn){const[a,i]=Cs(l);if(n>=a&&n<=i)return l}return null}function V3(n,l){const a=n.segments.flatMap(c=>l==="total"?[c.total_cn]:[c.major_cn,c.minor_cn]),i=Math.max(...a.map(c=>c??0));return Math.min(U3,Math.max(n.baseline+2,Math.ceil(i)))}function G3(n){const l=10**Math.floor(Math.log10(n)),a=n/l;return(a<1.5?1:a<3.5?2:a<7.5?5:10)*l}function q3(n,l,a=5){const i=jn.filter(([S])=>{const[j,b]=Cs(S);return b>n&&j<l});if(i.length!==1)return i.map(([S])=>{const[j,b]=Cs(S);return{value:(j+b)/2,label:S}});const[c,d]=i[0],[f,m]=Cs(c),g=(Math.max(n,f)-f)/(m-f)*d,y=(Math.min(l,m)-f)/(m-f)*d,v=G3(Math.max(y-g,1)/a),p=[];for(let S=Math.ceil(g/v)*v;S<=y;S+=v)p.push({value:f+S/d*(m-f),label:Tr(S,v)});return p}function I3(n,l){if(n<=.5&&l>=ot-.5)return null;const a=Xm(n/ot,"start"),i=Xm(l/ot,"end");if(a.chrom===i.chrom){const c=(i.pos-a.pos)/10;return`chr${a.chrom}: ${Tr(a.pos,c).replace(" Mb","")}–${Tr(i.pos,c)}`}return`chr${a.chrom}:${Tr(a.pos,1e6)} – chr${i.chrom}:${Tr(i.pos,1e6)}`}function P3(n){const{chrom:l,pos:a}=Xm(Math.min(Math.max(n,0),ot)/ot,"start");return`chr${l} · ${(a/1e6).toFixed(1)} Mb`}const Wu=n=>n.call??"neutral",Q3={neutral:"Neutral",gain:"Gain",amp:"Amplification",loss:"Loss"},Ay={neutral:"var(--chev)",gain:"var(--gain)",amp:"var(--gain-strong)",loss:"var(--loss)"};function Y3(n){return{call:Q3[Wu(n)],copies:n.total_cn===null?"? copies":`${n.total_cn} ${n.total_cn===1?"copy":"copies"}`,alleles:n.major_cn!==null&&n.minor_cn!==null?`${n.major_cn} + ${n.minor_cn}`:"",span:`chr${n.chrom}:${n.start.toLocaleString("en-US")}–${n.end.toLocaleString("en-US")}`,log2:n.log2!==null?n.log2.toFixed(2):""}}function X3(n){const l=new Map;for(const a of n){const i=a.gene??"?",c=l.get(i)??{gene:i,x:zu(a.chrom,a.pos),chrom:a.chrom,pos:a.pos,changes:"",list:[]};a.protein_change&&c.list.push(a.protein_change),l.set(i,c)}return[...l.values()].map(({list:a,...i})=>({...i,changes:a.join(", ")})).sort((a,i)=>a.x-i.x)}function Qf(n,l,a){const i=l.replace(/^chr/,"");return n.segments.find(c=>c.chrom===i&&c.start<=a&&a<=c.end)}function Yf(n,l){return n?l==="total"?n.total_cn:n.major_cn:null}function K3(n){const l=n.length;if(l===0)return"";const a=m=>m.toFixed(2);if(l===1)return`M${a(n[0][0])},${a(n[0][1])}`;const i=n.slice(1).map((m,g)=>m[0]-n[g][0]),c=n.slice(1).map((m,g)=>i[g]===0?0:(m[1]-n[g][1])/i[g]),d=n.map((m,g)=>g===0?c[0]:g===l-1?c[l-2]:c[g-1]*c[g]<=0?0:(c[g-1]+c[g])/2);for(let m=0;m<l-1;m++){if(c[m]===0){d[m]=0,d[m+1]=0;continue}const g=d[m]/c[m],y=d[m+1]/c[m],v=Math.hypot(g,y);v>3&&(d[m]=3*g*c[m]/v,d[m+1]=3*y*c[m]/v)}let f=`M${a(n[0][0])},${a(n[0][1])}`;for(let m=0;m<l-1;m++){const[g,y]=n[m],[v,p]=n[m+1];f+=` C${a(g+i[m]/3)},${a(y+d[m]*i[m]/3)} ${a(v-i[m]/3)},${a(p-d[m+1]*i[m]/3)} ${a(v)},${a(p)}`}return f}function Uu(n,l){const a=[],i=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c].left-n[d].left).forEach(c=>{let d=a.findIndex(f=>f+l<=n[c].left);d===-1&&(d=a.push(0)-1),a[d]=n[c].left+n[c].width,i[c]=d}),i}function ed(n,l=4){const a=Math.max(n,1)/l,i=10**Math.floor(Math.log10(a)),c=a/i,d=Math.max(1,(c<=1?1:c<=2?2:c<=5?5:10)*i),f=[];for(let m=0;m<Math.max(n,1)+d&&(f.push(m),!(m>=n&&f.length>1));m+=d);return f}const Cg=n=>1-(1-n)**3;function Ms(n,l,a=500){return n.length*l*(a>=600?.6:.56)}function en({x:n,y:l,width:a,above:i=!1,children:c}){const d=n>a-320,f=i?Math.min(Math.max(n,110),a-110):n,m=i?"translate(-50%, calc(-100% - 6px))":`translate(${d?"calc(-100% - 14px)":"14px"}, -50%)`;return r.jsx("div",{className:"ctip",style:{left:f,top:l,transform:m},role:"presentation",children:c})}function Fu(n,l,a){const i=n.clientX;let c=!1;const d=m=>{const g=m.clientX-i;Math.abs(g)>3&&(c=!0),l(g,m)},f=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),a==null||a(c)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",f),window.addEventListener("pointercancel",f)}const Z3=.01,J3=16,W3=160;function Oy(n,l){const a=S=>{const j=n.getBoundingClientRect();return[S.clientX-j.left,S.clientY-j.top]};let i="page",c=-1/0;const d=S=>{n.contains(S.target)||(i="page",c=S.timeStamp)},f=S=>{const[j,b]=a(S),N=l(),E=S.ctrlKey||S.metaKey;if(!E&&(S.timeStamp-c>W3&&(i="plot"),c=S.timeStamp,i==="page")||!N.inside(j,b))return;const A=S.deltaMode===1?J3:S.deltaMode===2?n.clientWidth:1,T=(S.deltaX||(S.shiftKey?S.deltaY:0))*A;if(!E&&T!==0&&(S.shiftKey||Math.abs(S.deltaX)>Math.abs(S.deltaY))){S.preventDefault(),N.pan(T);return}if(S.deltaY===0)return;const M=Math.max(-50,Math.min(50,S.deltaY*A));N.zoom(Math.exp(M*Z3),j)||E?S.preventDefault():i="page"};let m=1,g=null;const y=S=>{const j=S,[b,N]=a(j);l().inside(b,N)&&(S.preventDefault(),m=1,g=b)},v=S=>{if(g===null)return;S.preventDefault();const j=S.scale;j>0&&j!==m&&l().zoom(m/j,g),m=j},p=S=>{g!==null&&(S.preventDefault(),g=null)};return window.addEventListener("wheel",d,{capture:!0,passive:!0}),n.addEventListener("wheel",f,{passive:!1}),n.addEventListener("gesturestart",y),n.addEventListener("gesturechange",v),n.addEventListener("gestureend",p),()=>{window.removeEventListener("wheel",d,{capture:!0}),n.removeEventListener("wheel",f),n.removeEventListener("gesturestart",y),n.removeEventListener("gesturechange",v),n.removeEventListener("gestureend",p)}}function _s(n=640){const l=C.useRef(null),[a,i]=C.useState(n);return C.useLayoutEffect(()=>{const c=l.current;if(!c)return;const d=()=>i(Math.round(c.clientWidth)||n);if(d(),typeof ResizeObserver>"u")return;const f=new ResizeObserver(d);return f.observe(c),()=>f.disconnect()},[n]),[l,a]}const Tv=36,eM=14,Rr=232,Rv=22,Xi=28,Av=19,tM=480,nM=C.memo(function({segments:l,spans:a,mode:i,shown:c,geo:d,hover:f,grad:m,onHover:g,onClick:y}){const v=c[1]-c[0],p=b=>d.plotL+(b-c[0])/v*d.plotW,S=b=>d.plotTop+(1-Math.min(Math.max(b,0),d.top)/d.top)*Rr,j=S(d.baseline);return r.jsx("g",{children:l.map((b,N)=>{const[E,A]=a[N];if(A<c[0]-1||E>c[1]+1)return null;const T=Wu(b),L=p(E),M=Math.max(p(A)-L,T==="neutral"?2:7),_=f===N;if(i==="total"){if(b.total_cn===null)return null;const I=S(b.total_cn);return r.jsxs("g",{className:"cn-seg","data-call":T,"data-on":_||void 0,children:[T!=="neutral"&&r.jsx("rect",{x:L,y:Math.min(I,j),width:M,height:Math.abs(I-j),fill:`url(#${m[T]})`,className:"cn-col"}),r.jsx("line",{x1:L,x2:L+M,y1:I,y2:I,style:{stroke:Ay[T]},className:"cn-line"}),r.jsx("rect",{x:L-2,y:Math.min(I,j)-9,width:M+4,height:Math.abs(I-j)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:L+M/2,y:I}),onMouseLeave:()=>g(null),onClick:()=>y(b)})]},N)}if(b.major_cn===null||b.minor_cn===null)return null;const R=S(b.major_cn+Hu),k=S(b.minor_cn-Hu);return r.jsxs("g",{className:"cn-seg","data-on":_||void 0,children:[r.jsx("line",{x1:L,x2:L+M,y1:k,y2:k,className:"cn-line cn-minor"}),r.jsx("line",{x1:L,x2:L+M,y1:R,y2:R,className:"cn-line cn-major"}),r.jsx("rect",{x:L-2,y:Math.min(R,k)-9,width:M+4,height:Math.abs(R-k)+18,fill:"transparent",className:"cn-hit",onMouseEnter:()=>g({index:N,x:L+M/2,y:R}),onMouseLeave:()=>g(null),onClick:()=>y(b)})]},N)})})}),sM=C.memo(function({segments:l,spans:a,mode:i,top:c,baseline:d,plotL:f,plotW:m,y0:g}){const y=v=>g+3+(1-Math.min(v,c)/c)*(Xi-6);return r.jsxs("g",{pointerEvents:"none",children:[jn.map(([v],p)=>{const[S,j]=Cs(v);return p%2===0?r.jsx("rect",{x:f+S/ot*m,y:g,width:(j-S)/ot*m,height:Xi,className:"cn-mini-band"},v):null}),r.jsx("line",{x1:f,x2:f+m,y1:y(d),y2:y(d),className:"cn-mini-base"}),l.map((v,p)=>{const S=i==="total"?v.total_cn:v.major_cn;if(S===null)return null;const j=Wu(v),b=f+a[p][0]/ot*m,N=Math.max((a[p][1]-a[p][0])/ot*m,j==="neutral"?1:2);return r.jsx("line",{x1:b,x2:b+N,y1:y(S),y2:y(S),className:"cn-mini-line",style:{stroke:i==="total"?Ay[j]:"var(--ink-2)"}},p)})]})});function lM({data:n,mode:l,drivers:a,focus:i,locate:c,view:d,onView:f,onSegment:m,onGene:g}){const[y,v]=_s(900),p=C.useRef(null),S=C.useId(),j={gain:`${S}-gain`,amp:`${S}-amp`,loss:`${S}-loss`},[b,N]=C.useState(d.window),E=C.useRef(b);E.current=b,C.useLayoutEffect(()=>{const ne=d.window,ue=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!d.smooth||ue){N(ne);return}const Ne=E.current,Pe=performance.now();let Ie=0;const pt=_t=>{const Fe=Math.min(1,(_t-Pe)/tM);N(B3(Ne,ne,Cg(Fe))),Fe<1&&(Ie=requestAnimationFrame(pt))};return Ie=requestAnimationFrame(pt),()=>cancelAnimationFrame(Ie)},[d]);const[A,T]=C.useState(null),[L,M]=C.useState(null),[_,R]=C.useState(null),[k,I]=C.useState(!1),K=C.useRef(!1),O=C.useMemo(()=>V3(n,l),[n,l]),se=C.useMemo(()=>n.segments.some(ne=>Math.max(ne.total_cn??0,ne.major_cn??0)>O),[n,O]),ie=C.useMemo(()=>n.segments.map(ne=>[zu(ne.chrom,ne.start),zu(ne.chrom,ne.end)]),[n]),W=C.useMemo(()=>X3(a),[a]),P=Tv,le=Math.max(v-Tv-eM,200),$=b[1]-b[0],Z=ne=>P+(ne-b[0])/$*le,J=ne=>b[0]+(ne-P)/le*$,ce=ne=>Ms(ne,11.5,600)+14,ae=C.useMemo(()=>{const ne=W.map(ue=>({left:P+ue.x/ot*le-ce(ue.gene)/2,width:ce(ue.gene)}));return W.length?Math.max(...Uu(ne,4))+1:0},[W,P,le]),xe=(ae?ae*Av+8:4)+4,je=xe+Rr,D=je+10,U=D+Rv+12,q=U+Xi+6,re={plotL:P,plotW:le,plotTop:xe,top:O,baseline:n.baseline},he=ne=>xe+(1-Math.min(Math.max(ne,0),O)/O)*Rr,ye=W.map((ne,ue)=>({m:ne,index:ue,x:Z(ne.x)})).filter(({x:ne})=>ne>=P-4&&ne<=P+le+4),we=Uu(ye.map(({m:ne,x:ue})=>({left:ue-ce(ne.gene)/2,width:ce(ne.gene)})),4),me=(ne,ue)=>ne>=P&&ne<=P+le&&ue>=xe&&ue<=je,Se=ne=>{const ue=p.current.getBoundingClientRect();return[ne.clientX-ue.left,ne.clientY-ue.top]},gt=C.useCallback(ne=>f({window:ne,smooth:!1}),[f]),Pt=C.useCallback(ne=>f({window:ne,smooth:!0}),[f]),dn=C.useRef({shown:b,plotL:P,plotW:le,plotTop:xe,plotBottom:je,move:gt});dn.current={shown:b,plotL:P,plotW:le,plotTop:xe,plotBottom:je,move:gt},C.useEffect(()=>{const ne=y.current;if(!ne||!p.current)return;const ue=()=>p.current.getBoundingClientRect();return Oy(ne,()=>{const Ne=dn.current,Pe=()=>ue().left-ne.getBoundingClientRect().left,Ie=()=>ue().top-ne.getBoundingClientRect().top,pt=Ne.shown[1]-Ne.shown[0];return{inside:(_t,Fe)=>{const fn=_t-Pe(),mn=Fe-Ie();return fn>=Ne.plotL&&fn<=Ne.plotL+Ne.plotW&&mn>=Ne.plotTop&&mn<=Ne.plotBottom},zoom:(_t,Fe)=>{const fn=Pf(Ne.shown,Ne.shown[0]+(Fe-Pe()-Ne.plotL)/Ne.plotW*pt,_t);return Math.abs(fn[0]-Ne.shown[0])<1e-6&&Math.abs(fn[1]-Ne.shown[1])<1e-6?!1:(Ne.move(fn),!0)},pan:_t=>Ne.move(pr(Ne.shown,_t/Ne.plotW*pt))}})},[y]),C.useEffect(()=>{c&&/^(\d+|X)$/.test(c.chrom.replace(/^chr/,""))&&Pt(Cs(c.chrom))},[c,Pt]);const kt=ne=>{if(ne.button!==0)return;const[ue,Ne]=Se(ne);if(!me(ue,Ne)||!_v(b))return;ne.preventDefault();const Pe=b;I(!0),Fu(ne,Ie=>gt(pr(Pe,-(Ie/le)*(Pe[1]-Pe[0]))),Ie=>{I(!1),Ie&&(K.current=!0,setTimeout(()=>K.current=!1,0))})},rt=ne=>{const[ue,Ne]=Se(ne);R(me(ue,Ne)?ue:null)},qe=ne=>{const[ue,Ne]=Se(ne);if(!me(ue,Ne))return;const Pe=tg(J(ue));Pe&&Pt(Cs(Pe))},Qt=ne=>{const ue=(b[0]+b[1])/2;if(ne.key==="ArrowLeft"||ne.key==="ArrowRight")ne.preventDefault(),gt(pr(b,(ne.key==="ArrowLeft"?-.15:.15)*$));else if(ne.key==="+"||ne.key==="=")Pt(Pf(b,ue,.6));else if(ne.key==="-")Pt(Pf(b,ue,1/.6));else if(ne.key==="0"||ne.key==="Home")Pt([0,ot]);else return;ne.key!=="ArrowLeft"&&ne.key!=="ArrowRight"&&ne.preventDefault()},kn=C.useCallback(ne=>{K.current||m(ne)},[m]),tn=jn.map(([ne],ue)=>{const[Ne,Pe]=Cs(ne);return{chrom:ne,i:ue,x0:Z(Ne),x1:Z(Pe)}}).filter(({x0:ne,x1:ue})=>ue>P&&ne<P+le),hn=tn.length===1?tn[0]:null,Ts=hn?q3(b[0],b[1],Math.max(2,Math.round(le/120))):[],xt=(()=>{if(!i)return null;const ne=zu(i.chrom,i.pos);if(ne<b[0]||ne>b[1])return null;const ue=Qf(n,i.chrom,i.pos),Ne=Yf(ue,l),Pe=l==="allele"&&Ne!==null?Hu:0;return{x:Z(ne),y:he((Ne??n.baseline)+Pe),copies:(ue==null?void 0:ue.total_cn)??null}})(),as=A?n.segments[A.index]:null,Yt=as?Y3(as):null,nn=L!==null?W[L]:null,sl=ne=>P+ne/ot*le,Et={x0:sl(b[0]),x1:sl(b[1])},is=_v(b),Rs=(ne,ue)=>{ne.stopPropagation(),ne.preventDefault();const Ne=b;I(!0),Fu(ne,Pe=>{const Ie=Pe/le*ot;gt(ue==="move"?pr(Ne,Ie):F3(Ne,ue,Ne[ue]+Ie))},()=>I(!1))};return r.jsxs("div",{ref:y,className:"cn","data-dragging":k||void 0,"data-zoomed":is||void 0,tabIndex:0,role:"group","aria-label":`Copy number of ${n.sample} across the genome, against ${n.baseline} copies.`,"aria-keyshortcuts":"ArrowLeft ArrowRight + - 0",onKeyDown:Qt,children:[r.jsxs("svg",{ref:p,width:v,height:q,"aria-hidden":!0,onPointerDown:kt,onPointerMove:rt,onPointerLeave:()=>R(null),onDoubleClick:qe,children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:j.gain,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain)"},stopOpacity:.46}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain)"},stopOpacity:.04})]}),r.jsxs("linearGradient",{id:j.amp,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--gain-strong)"},stopOpacity:.62}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--gain-strong)"},stopOpacity:.05})]}),r.jsxs("linearGradient",{id:j.loss,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--loss)"},stopOpacity:.04}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--loss)"},stopOpacity:.46})]}),r.jsx("clipPath",{id:`${S}-plot`,children:r.jsx("rect",{x:P-4,y:xe-2,width:le+8,height:Rr+4})})]}),r.jsx("g",{clipPath:`url(#${S}-plot)`,children:jn.map(([ne],ue)=>{const[Ne,Pe]=Cs(ne),Ie=Z(Ne),pt=Z(Pe);return ue%2===0&&pt>P&&Ie<P+le?r.jsx("rect",{x:Ie,y:xe,width:pt-Ie,height:Rr,className:"cn-band"},ne):null})}),Array.from({length:O+1},(ne,ue)=>r.jsxs("g",{children:[r.jsx("line",{x1:P,x2:P+le,y1:he(ue),y2:he(ue),className:"cn-grid"}),r.jsx("text",{x:P-10,y:he(ue)+4,textAnchor:"end",className:"cn-tick",children:ue===O&&se?`${ue}+`:ue})]},ue)),r.jsx("line",{x1:P,x2:P+le,y1:he(n.baseline),y2:he(n.baseline),className:"cn-baseline"}),r.jsxs("text",{x:P+8,y:he(n.baseline)-7,className:"cn-baseline-label",children:[n.baseline," copies"]}),r.jsx("g",{className:"cn-reveal",children:r.jsx("g",{clipPath:`url(#${S}-plot)`,children:r.jsx(nM,{segments:n.segments,spans:ie,mode:l,shown:b,geo:re,hover:A?A.index:null,grad:j,onHover:T,onClick:kn})})}),_!==null&&!k&&!A&&L===null&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:_,x2:_,y1:xe,y2:je,className:"cn-guide"}),r.jsxs("g",{transform:`translate(${Math.min(Math.max(_,P+52),P+le-52)} ${je-24})`,children:[r.jsx("rect",{x:-50,width:100,height:18,rx:9,className:"cn-readout"}),r.jsx("text",{y:12.5,textAnchor:"middle",className:"cn-readout-text",children:P3(J(_))})]})]}),ye.map(({m:ne,x:ue,index:Ne},Pe)=>{const Ie=Qf(n,ne.chrom,ne.pos),pt=Yf(Ie,l),_t=he((pt??n.baseline)+(l==="allele"&&pt!==null?Hu:0)),Fe=ce(ne.gene),fn=4+we[Pe]*Av,mn=L===Ne;return r.jsxs("g",{className:"cn-driver","data-on":mn||void 0,onPointerDown:Kl=>Kl.stopPropagation(),onMouseEnter:()=>M(Ne),onMouseLeave:()=>M(null),onClick:()=>g(ne.gene),children:[r.jsx("line",{x1:ue,x2:ue,y1:fn+16,y2:_t,className:"cn-leader"}),r.jsx("rect",{x:ue-Fe/2,y:fn,width:Fe,height:16,rx:8,className:"cn-chip"}),r.jsx("text",{x:ue,y:fn+11.5,textAnchor:"middle",className:"cn-gene",children:ne.gene}),r.jsx("circle",{cx:ue,cy:_t,r:mn?6.5:5,className:"cn-dot"})]},ne.gene)}),xt&&i&&r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:xt.x,x2:xt.x,y1:xe,y2:je,className:"cn-focus-line"}),r.jsx("circle",{cx:xt.x,cy:xt.y,r:6.5,className:"cn-focus-dot"}),(()=>{const ne=`${i.gene??"?"}${xt.copies!==null?` ${xt.copies} copies`:""}`,ue=Ms(ne,11.5,600)+14,Ne=xt.x+12+ue>P+le;return r.jsxs("g",{transform:`translate(${Ne?xt.x-12-ue:xt.x+12} ${xt.y-12})`,children:[r.jsx("rect",{width:ue,height:22,rx:7,className:"cn-focus-chip"}),r.jsx("text",{x:7,y:15,className:"cn-focus-text",children:ne})]})})()]}),r.jsxs("g",{className:"cn-strip",children:[tn.map(({chrom:ne,i:ue,x0:Ne,x1:Pe})=>{const Ie=Math.max(Ne,P),pt=Math.min(Pe,P+le),_t=pt-Ie,Fe=hn?`chr${ne}`:ne;return r.jsxs("g",{className:"cn-pill",onClick:()=>Pt(Cs(ne)),role:"presentation",children:[r.jsx("title",{children:`Zoom to chromosome ${ne}`}),r.jsx("rect",{x:Ie+.5,y:D,width:Math.max(_t-1,1),height:Rv,rx:7,"data-odd":ue%2?"":void 0}),_t>=Ms(Fe,11,600)+3&&r.jsx("text",{x:hn?Ie+10:(Ie+pt)/2,y:D+15,textAnchor:hn?"start":"middle",children:Fe})]},ne)}),hn&&Ts.map(ne=>{const ue=Z(ne.value);return ue>Math.max(hn.x0,P)+70&&ue<P+le-20?r.jsxs("g",{pointerEvents:"none",children:[r.jsx("line",{x1:ue,x2:ue,y1:D+3,y2:D+9,className:"cn-mb-tick"}),r.jsx("text",{x:ue,y:D+18,textAnchor:"middle",className:"cn-mb",children:ne.label})]},ne.value):null})]}),r.jsx(sM,{segments:n.segments,spans:ie,mode:l,top:O,baseline:n.baseline,plotL:P,plotW:le,y0:U}),r.jsx("rect",{x:P,y:U,width:le,height:Xi,fill:"transparent",className:"cn-mini-track",onPointerDown:ne=>{const[ue]=Se(ne),Ne=b[1]-b[0],Pe=(ue-P)/le*ot;Pt(pr([Pe-Ne/2,Pe+Ne/2],0))}}),is&&r.jsxs("g",{className:"cn-mini-window",children:[r.jsx("rect",{x:Et.x0,y:U-1,width:Math.max(Et.x1-Et.x0,4),height:Xi+2,rx:6,onPointerDown:ne=>Rs(ne,"move"),className:"cn-mini-win"}),[0,1].map(ne=>r.jsx("rect",{x:(ne===0?Et.x0:Et.x1)-4,y:U+Xi/2-9,width:8,height:18,rx:4,className:"cn-mini-handle",onPointerDown:ue=>Rs(ue,ne)},ne))]})]}),Yt&&A&&r.jsxs(en,{x:A.x+0,y:A.y+0,width:v,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"cn-call-dot","data-call":Wu(as),"aria-hidden":!0}),Yt.call,r.jsx("span",{className:"ctip-sub",children:Yt.copies})]}),Yt.alleles&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Alleles"}),r.jsx("b",{children:Yt.alleles})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Region"}),r.jsx("b",{className:"mono",children:Yt.span})]}),Yt.log2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"log2 ratio"}),r.jsx("b",{children:Yt.log2})]}),r.jsx("span",{className:"ctip-note",children:"Click to list the mutations in this segment"})]}),nn&&L!==null&&r.jsxs(en,{x:Z(nn.x),y:xe+10,width:v,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:nn.gene}),nn.changes&&r.jsx("span",{className:"ctip-sub",children:nn.changes})]}),(()=>{const ne=Yf(Qf(n,nn.chrom,nn.pos),l);return ne!==null?r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Copy number here"}),r.jsx("b",{children:ne})]}):null})(),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}const aM={"del.mh.prop":{short:"Del. MH",long:"Deletions with microhomology (share of deletions)"},SNV3:{short:"SBS3",long:"Substitution signature 3"},SV3:{short:"RS3",long:"Rearrangement signature 3"},SV5:{short:"RS5",long:"Rearrangement signature 5"},hrd:{short:"HRD index",long:"HRD index (loss of heterozygosity, telomeric imbalance, large-scale transitions)"},SNV8:{short:"SBS8",long:"Substitution signature 8"}};function Ov(n,l="short"){var a;return((a=aM[n])==null?void 0:a[l])??n}const Xf=8;function iM(n){const l=n.find(c=>c.group==="sample")??n[0],a=[...(l==null?void 0:l.signatures)??[]].sort((c,d)=>(d.proportion??0)-(c.proportion??0)).map(c=>c.signature),i=a.length>Xf?Xf-1:Xf;return{shown:a.slice(0,i),other:a.slice(i)}}function zv(n){return n.group==="sample"?"This tumour":`${n.label.replace(/\(\d+\)$/,"")} cohort${n.cohort_n?`, n = ${n.cohort_n}`:""}`}const Dv=["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#6250d6","#e34948"],oM="#a3a3ab";function rM(n){const{shown:l,other:a}=iM(n),i=n.find(g=>g.group==="sample")??n[0],c=n.find(g=>g.group==="cohort")??null,d=(g,y,v)=>g?g.signatures.filter(p=>y.includes(p.signature)).reduce((p,S)=>p+(S[v]??0),0):null,f=(g,y,v)=>{var p,S;return{name:g,members:y,colour:v,share:d(i,y,"proportion")??0,cohortShare:d(c,y,"proportion"),count:d(i,y,"count")??0,cohortCount:d(c,y,"count"),aetiology:y.length===1?((p=i==null?void 0:i.signatures.find(j=>j.signature===g))==null?void 0:p.aetiology)??((S=c==null?void 0:c.signatures.find(j=>j.signature===g))==null?void 0:S.aetiology)??null:`${y.length} smaller signatures`}},m=l.map((g,y)=>f(g,[g],Dv[y%Dv.length]));return a.length&&m.push(f("Other",a,oM)),m}function Hl(n){return n.cohortShare===null?null:(n.share-n.cohortShare)*100}function kv(n,l,a){const i=Math.max(l-a*Math.max(n.length-1,0),0),c=n.reduce((f,m)=>f+m,0)||1;let d=0;return n.map(f=>{const m=f/c*i,g={y0:d,y1:d+m};return d+=m+a,g})}function cM(n,l,a,i){const c=(n+a)/2,d=f=>f.toFixed(2);return`M${d(n)},${d(l.y0)} C${d(c)},${d(l.y0)} ${d(c)},${d(i.y0)} ${d(a)},${d(i.y0)} L${d(a)},${d(i.y1)} C${d(c)},${d(i.y1)} ${d(c)},${d(l.y1)} ${d(n)},${d(l.y1)} Z`}function Es(n,l){const a=(n.length-1)*l,i=Math.floor(a),c=Math.ceil(a);return n[i]+(n[c]-n[i])*(a-i)}function zy(n){var c;const l=n.cohort.filter(d=>d!==null&&Number.isFinite(d)).sort((d,f)=>d-f);if(l.length===0)return null;const a=((c=n.sample)==null?void 0:c.value)??null,i=[...l];if(a!==null){const d=i.indexOf(a);d>=0&&i.splice(d,1)}return{values:l,q1:Es(l,.25),median:Es(l,.5),q3:Es(l,.75),tumour:a,above:a===null?null:i.filter(d=>d<a).length,others:i.length}}function uM(n,l=64){const a=n.length,i=n.reduce((y,v)=>y+v,0)/a,c=Math.sqrt(n.reduce((y,v)=>y+(v-i)**2,0)/Math.max(a-1,1)),d=Math.min(c,(Es(n,.75)-Es(n,.25))/1.34)||c||.1,f=Math.max(.9*d*a**-.2,.02),m=Array.from({length:l+1},(y,v)=>{const p=v/l;return{x:p,y:n.reduce((S,j)=>S+Math.exp(-.5*((p-j)/f)**2),0)}}),g=Math.max(...m.map(y=>y.y))||1;return m.map(y=>({x:y.x,y:y.y/g}))}function dM(n,l){const a=[],i=new Array(n.length).fill(0);return[...n.keys()].sort((c,d)=>n[c]-n[d]).forEach(c=>{let d=0;for(;a.some(f=>f.level===d&&Math.abs(f.x-n[c])<l);)d+=1;a.push({x:n[c],level:d}),i[c]=d}),i}function Kf(n){return n.above===null||n.others===0?"":n.above===n.others?n.others===1?"Above the other sample":"Highest in the cohort":n.above===0?"Lowest in the cohort":`Above ${n.above} of ${n.others} others`}function Ki(n,l,a,i){const c=Math.PI*(1-Math.min(Math.max(i,0),1));return{x:n+a*Math.cos(c),y:l-a*Math.sin(c)}}function hM(n){const{value:l,exact:a}=n;return l===null?"–":l===0&&a!=null&&a>0?a<1e-4?"<0.0001":String(Number(a.toPrecision(2))):l.toFixed(2)}function fM(n){const l=n.threshold;if(l===null)return null;const a=n.exact??n.value;return a===null||!n.rating?`High at ${l} and above`:n.rating==="HIGH"?`At or above the ${l} threshold`:a<l/2?`Well below the ${l} threshold`:`Below the ${l} threshold`}function ng(n){const l=n.filter(f=>f!==null&&Number.isFinite(f)).sort((f,m)=>f-m);if(!l.length)return null;const a=Es(l,.25),i=Es(l,.75),c=1.5*(i-a),d=l.filter(f=>f>=a-c&&f<=i+c);return{n:l.length,min:l[0],max:l[l.length-1],q1:a,median:Es(l,.5),q3:i,low:d[0]??a,high:d[d.length-1]??i}}function mM(n,l=48){const a=n.filter(b=>b!==null&&Number.isFinite(b));if(a.length<2)return[];const i=Math.min(...a),c=Math.max(...a);if(c===i)return[];const d=a.length,f=a.reduce((b,N)=>b+N,0)/d,m=Math.sqrt(a.reduce((b,N)=>b+(N-f)**2,0)/(d-1)),g=[...a].sort((b,N)=>b-N),y=Es(g,.75)-Es(g,.25),v=Math.min(m,y/1.34)||m||(c-i)/4,p=Math.max(.9*v*d**-.2,(c-i)/200),S=Array.from({length:l+1},(b,N)=>{const E=i+(c-i)*N/l;return{v:E,d:a.reduce((A,T)=>A+Math.exp(-.5*((E-T)/p)**2),0)}}),j=Math.max(...S.map(b=>b.d))||1;return S.map(b=>({v:b.v,d:b.d/j}))}function Dy(n,l,a){if(n===null)return"";const i=l.filter(d=>d!==null&&Number.isFinite(d));if(!i.length)return"";const c=i.filter(d=>d<n).length;return c===i.length?`Higher than every ${a}`:c===0?`Lower than every ${a}`:`Higher than ${c} of ${i.length} ${a}s`}function gM(n,l){const a=[],i=new Array(n.length).fill(0),c=[...n.keys()].sort((d,f)=>n[d]-n[f]);for(const d of c){let f=0;const m=g=>g===0?0:g%2?-Math.ceil(g/2):g/2;for(;a.some(g=>g.slot===m(f)&&Math.abs(g.y-n[d])<l);)f+=1;a.push({y:n[d],slot:m(f)}),i[d]=m(f)}return i}const ki=46,Li=30,$i=210,Lv=30,pM=58,vM=132,$v=6,Hi=n=>`${Math.round(n*100)}%`;function xM({data:n}){var M,_;const[l,a]=_s(760),[i,c]=C.useState(((M=n.projects[0])==null?void 0:M.project)??null),[d,f]=C.useState(null),m=n.projects.find(R=>R.project===i)??n.projects[0],g=m.diseases,y=a-ki-8,v=Math.min(vM,Math.max(pM,y/Math.max(g.length,1))),p=v*g.length,S=Math.max(a,ki+p+8),j=ki+Math.max(0,(y-p)/2),b=Math.max(y,p),N=R=>Li+$i*(1-Math.min(Math.max(R,0),1)),E=m.tumour?g.findIndex(R=>{var k;return R.disease===((k=m.tumour)==null?void 0:k.disease)}):-1,A=C.useMemo(()=>g.map(R=>{const k=R.values.filter(K=>K!==null),I=k.map(K=>N(K));return{disease:R,stats:ng(k),values:k,py:I,slots:gM(I,$v)}}),[g]),T=d===null?null:A[d],L=((_=m.tumour)==null?void 0:_.fga)??null;return r.jsxs("section",{className:"fga sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Fraction of genome altered against the cohort",r.jsxs("span",{className:"sv-h-n",children:["project ",m.project,", n = ",m.n]})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"}),n.projects.length>1&&r.jsx(ls,{label:"Project",value:m.project??"",onChange:R=>c(R),options:n.projects.map(R=>({value:R.project??"",label:`Project ${R.project}`}))})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:l,className:"fga-plot",onMouseLeave:()=>f(null),children:[r.jsx("div",{className:"fga-scroll",children:r.jsxs("svg",{width:S,height:Li+$i+Lv,role:"img","aria-label":`FGA by disease in project ${m.project}`,children:[[0,.25,.5,.75,1].map(R=>r.jsxs("g",{children:[r.jsx("line",{x1:ki,x2:ki+b,y1:N(R),y2:N(R),className:R===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:ki-8,y:N(R)+4,textAnchor:"end",className:"ctx-tick",children:Hi(R)})]},R)),A.map(({disease:R,stats:k,values:I,py:K,slots:O},se)=>{const ie=j+v*se+v/2,W=Math.min(30,v*.46),P=se===E;return r.jsxs("g",{className:"fga-col","data-on":d===se||void 0,"data-mine":P||void 0,children:[r.jsx("rect",{x:j+v*se+2,y:Li-6,width:v-4,height:$i+12,rx:10,className:"fga-band"}),k&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:ie,x2:ie,y1:N(k.high),y2:N(k.low),className:"fga-whisker"}),r.jsx("rect",{x:ie-W/2,y:N(k.q3),width:W,height:Math.max(N(k.q1)-N(k.q3),1.5),rx:5,className:"fga-box"}),r.jsx("line",{x1:ie-W/2,x2:ie+W/2,y1:N(k.median),y2:N(k.median),className:"fga-median"})]}),I.map((le,$)=>r.jsx("circle",{cx:ie+O[$]*($v+1),cy:K[$],r:2.8,className:"fga-dot"},$)),r.jsx("text",{x:ie,y:Li+$i+20,textAnchor:"middle",className:"fga-label",children:R.disease}),r.jsx("rect",{x:j+v*se,y:Li-8,width:v,height:$i+Lv+8,fill:"transparent",tabIndex:0,"aria-label":`${R.name??R.disease}: ${I.length} samples`,onMouseEnter:()=>f(se),onFocus:()=>f(se),onBlur:()=>f(null)})]},R.disease)}),E>=0&&L!==null&&r.jsxs("g",{className:"fga-pin",pointerEvents:"none",transform:`translate(${j+v*E+v/2} ${N(L)})`,children:[r.jsx("circle",{r:8,className:"fga-pin-dot"}),r.jsxs("g",{transform:"translate(0 -18)",children:[r.jsx("rect",{x:-44,y:-11,width:88,height:20,rx:10,className:"fga-pin-chip"}),r.jsxs("text",{y:3.5,textAnchor:"middle",className:"fga-pin-text",children:["This tumour ",Hi(L)]})]})]})]})}),T&&d!==null&&r.jsxs(en,{x:Math.min(j+v*d+v/2,a-10),y:Li+$i/2,width:a,children:[r.jsx("span",{className:"ctip-title",children:T.disease.name??T.disease.disease}),T.stats&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Samples"}),r.jsx("b",{children:T.stats.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Hi(T.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Hi(T.stats.q1),"–",Hi(T.stats.q3)]})]})]}),d===E&&L!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",Hi(L),"."," ",Dy(L,yM(T.values,L),`${T.disease.disease} sample`)]})]})]})})]})}function yM(n,l){const a=n.indexOf(l);return a<0?n:[...n.slice(0,a),...n.slice(a+1)]}const Hv=8,Uv=n=>`chr${n.chrom} · ${(n.start/1e6).toFixed(1)} Mb`;function SM({gene:n}){const l=n.copy_number??0,a=Math.min(Math.round(l),Hv);return r.jsx("span",{className:"cng-meter","data-alteration":n.alteration,"aria-hidden":!0,children:Array.from({length:Hv},(i,c)=>r.jsx("span",{"data-on":c<a||void 0},c))})}function bM({project:n,value:l}){if(l===null)return null;const a=l>=0;return r.jsxs("span",{className:"cng-expr","data-up":a||void 0,title:`RNA expression against the project ${n} cohort: log2 of this sample's level over the cohort mean`,children:[r.jsx("span",{className:"cng-arrow","aria-hidden":!0,children:a?"▲":"▼"}),a?"+":"−",Math.abs(l).toFixed(1),r.jsxs("i",{children:["p",n]})]})}function jM({genes:n,onHover:l,onLocate:a}){const i=n.filter(d=>d.alteration==="amplification").length,c=n.length-i;return r.jsxs("section",{className:"cng sig-section","aria-label":"Amplified and lost genes",children:[r.jsxs("h3",{className:"sv-h",children:["Amplified and lost genes",r.jsx("span",{className:"sv-h-n",children:n.length?`${i} amplified oncogene${i===1?"":"s"}, ${c} lost tumour suppressor${c===1?"":"s"}`:"none"})]}),n.length===0?r.jsx("p",{className:"sv-empty",children:"The report calls no amplified oncogenes or homozygously lost tumour suppressors."}):r.jsx("ul",{className:"cng-list",onMouseLeave:()=>l(null),children:n.map(d=>r.jsx("li",{children:r.jsxs("button",{type:"button",className:"cng-row","data-alteration":d.alteration,onMouseEnter:()=>l(d),onFocus:()=>l(d),onBlur:()=>l(null),onClick:()=>a(d),"aria-label":`${d.gene}, ${d.alteration}, ${d.copy_number??"unknown"} copies, ${Uv(d)}: show on the plot`,children:[r.jsx("span",{className:"cng-gene",children:d.gene}),r.jsx("span",{className:"cng-where mono",children:Uv(d)}),r.jsxs("span",{className:"cng-copies",children:[r.jsx(SM,{gene:d}),r.jsxs("span",{className:"cng-n",children:[d.copy_number===null?"?":d.copy_number,r.jsx("small",{children:d.copy_number===1?" copy":" copies"})]})]}),r.jsx("span",{className:"cng-call",children:d.alteration==="amplification"?"Amplified":"Lost"}),r.jsx("span",{className:"cng-exprs",children:d.expression.map(f=>r.jsx(bM,{project:f.project,value:f.log2_fold},f.project))})]})},d.gene))})]})}function vr({color:n,label:l}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"h-1 w-3.5 rounded-sm",style:{background:n}}),l]})}function wM({envelope:n,loading:l}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(xM,{data:n.data}):(n==null?void 0:n.status)==="missing"&&n.warnings.some(a=>a.includes("Rerun"))?r.jsxs("section",{className:"sig-section","aria-label":"Fraction of genome altered against the cohort",children:[r.jsx("h3",{className:"sv-h",children:"Fraction of genome altered against the cohort"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")})]}):l&&!n?r.jsx("div",{className:"px-5 py-3",children:r.jsx("div",{className:"skeleton",style:{height:200},"aria-label":"Loading the FGA cohort figure"})}):null}function NM({envelope:n,loading:l,picked:a,sampleLabel:i,drivers:c,focus:d,locate:f,onSegment:m,onGene:g,fga:y,fgaLoading:v=!1,onOpenChromosome:p}){var se;const[S,j]=C.useState("total"),[b,N]=C.useState(null),[E,A]=C.useState(null),T=ie=>({chrom:ie.chrom,pos:Math.round((ie.start+ie.end)/2),gene:ie.gene}),L=C.useMemo(()=>E&&(!f||E.nonce>f.nonce)?E:f,[f,E]),[M,_]=C.useState({window:[0,ot],smooth:!1}),R=((se=n==null?void 0:n.data)==null?void 0:se.allele_specific)??!1,k=I3(...M.window),I=C.useCallback(()=>_({window:[0,ot],smooth:!0}),[]),K=k?tg(M.window[0]+1e-6):null,O=K&&K===tg(M.window[1]-1e-6)?K:null;return r.jsx(_3,{title:"Copy number",subtitle:`Copy number across the genome, ${i}`,info:"copyNumber",envelope:n,loading:l,picked:a,skeletonHeight:250,moreLineage:y==null?void 0:y.lineage,controls:r.jsxs(r.Fragment,{children:[k&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-xs",style:{color:"var(--ink-2)"},"aria-live":"polite",children:k}),r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole genome",title:"Show the whole genome",onClick:I,children:r.jsx(fy,{size:15,"aria-hidden":!0})}),O&&p&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":`Open chromosome ${O} in the CN/SV view`,title:`Open chromosome ${O} in the CN/SV view`,onClick:()=>p(O),children:r.jsx(iy,{size:15,"aria-hidden":!0})})]}),r.jsx(ls,{label:"Copy number view",value:R?S:"total",onChange:j,options:[{value:"total",label:"Total"},{value:"allele",label:"Allele-specific",disabled:!R}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[S==="total"||!R?r.jsxs(r.Fragment,{children:[r.jsx(vr,{color:"var(--gain)",label:"Gain"}),r.jsx(vr,{color:"var(--gain-strong)",label:"Amplification"}),r.jsx(vr,{color:"var(--loss)",label:"Loss"})]}):r.jsxs(r.Fragment,{children:[r.jsx(vr,{color:"var(--ink-2)",label:"Major allele"}),r.jsx(vr,{color:"var(--chev)",label:"Minor allele"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:"Scroll up or down over the plot to zoom, sideways (or drag) to pan, or move the window in the overview. Double-click a chromosome, or click its name, to fill the view."})]}),children:ie=>r.jsxs(r.Fragment,{children:[r.jsx(lM,{data:ie,mode:R?S:"total",drivers:c,focus:b??d,locate:L,view:M,onView:_,onSegment:m,onGene:g}),ie.genes&&r.jsx(jM,{genes:ie.genes,onHover:W=>N(W?T(W):null),onLocate:W=>A({...T(W),nonce:Date.now()})}),r.jsx(wM,{envelope:y,loading:v})]})})}function CM(n){const[l,a]=n.range;return[[l,0],...n.bins.map(i=>[(i.x0+i.x1)/2,i.n]),[a,0]]}function Zf(n,l){for(let a=1;a<n.length;a++){const[i,c]=n[a-1],[d,f]=n[a];if(l<=d)return d===i?f:c+(l-i)/(d-i)*(f-c)}return n[n.length-1][1]}function MM(n){return n==="ccf"?"CCF":"VAF"}function Ys(n,l){return Math.min(Math.max(l,n.range[0]),n.range[1])}function EM(n){const l=n.measure==="ccf"?.25:.1,a=[];for(let i=n.range[0];i<=n.range[1]+1e-9;i+=l)a.push(Math.round(i*100)/100);return a}function _M(n,l){return n.measure==="ccf"?l===1?"1.0":l.toFixed(2).replace(/0$/,""):l.toFixed(1)}const Na=14,TM=22,xr=118,RM=40,Ui=19,Fv=n=>Math.round(n*100)/100;function AM({data:n,range:l,focus:a,onRange:i,onGene:c}){const[d,f]=_s(),m=C.useId(),g=C.useRef(null),[y,v]=C.useState(null),[p,S]=C.useState(null),[j,b]=n.range,N=f-TM,E=U=>Na+(U-j)/(b-j)*(N-Na),A=U=>j+(U-Na)/(N-Na)*(b-j),T=C.useMemo(()=>CM(n),[n]),L=Math.max(1,...T.map(U=>U[1])),M=U=>U*Ui+8+xr,_=(U,q)=>M(U)-q/(L*1.1)*xr,R=C.useMemo(()=>[...n.drivers].sort((U,q)=>U.value-q.value),[n.drivers]),k=R.map(U=>({left:E(Ys(n,U.value))-Ms(U.gene??"?",11.5,600)/2-6,width:Ms(U.gene??"?",11.5,600)+12})),I=Uu(k,4),K=R.length?Math.max(...I)+1:0,O=M(K),se=O+RM,ie=T.map(([U,q])=>[E(U),_(K,q)]),W=K3(ie),P=`${W} L${E(b).toFixed(2)},${O} L${E(j).toFixed(2)},${O} Z`,le=U=>U.kind==="new"?[Math.min(U.from,U.to),Math.max(U.from,U.to)]:U.kind==="edge"?[Math.min(U.fixed,U.to),Math.max(U.fixed,U.to)]:U.range,$=y?le(y):l,Z=U=>{const q=g.current.getBoundingClientRect();return A(Math.min(Math.max(U-q.left,Na),N))},J=(U,q,re)=>{U.preventDefault(),U.stopPropagation();let he=q(Z(U.clientX));v(he),Fu(U,(ye,we)=>{he=re(he,Z(we.clientX)),v(he)},()=>{const[ye,we]=le(he);if(v(null),E(we)-E(ye)<4)return i(null);i([Fv(Ys(n,ye)),Fv(Ys(n,we))])})},ce=(U,q)=>U.kind==="move"?U:{...U,to:q},ae=(U,q)=>{if(U.kind!=="move")return U;const re=U.range[1]-U.range[0],he=Math.min(Math.max(U.range[0]+(q-U.grab),j),b-re);return{...U,grab:q,range:[he,he+re]}},oe=$?[E(Ys(n,$[0])),E(Ys(n,$[1]))]:null,xe=MM(n.measure),je=a?n.measure==="ccf"?a.ccf:a.vaf:null,D=p!==null?R[p]:null;return r.jsxs("div",{ref:d,className:"dens","data-brushing":y?"":void 0,children:[r.jsxs("svg",{ref:g,width:f,height:se,role:"img","aria-label":`${xe} of ${n.total} variants in ${n.sample}${n.drivers.length?`, with ${n.drivers.map(U=>`${U.gene} at ${U.value.toFixed(2)}`).join(", ")}`:""}.`,onPointerDown:U=>{U.button===0&&J(U,q=>({kind:"new",from:q,to:q}),ce)},children:[r.jsxs("defs",{children:[r.jsxs("linearGradient",{id:`${m}-fill`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.42}),r.jsx("stop",{offset:"1",style:{stopColor:"var(--ccf-fill)"},stopOpacity:.03})]}),r.jsx("clipPath",{id:`${m}-spot`,children:oe&&r.jsx("rect",{x:oe[0],y:0,width:Math.max(oe[1]-oe[0],0),height:se})})]}),EM(n).map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:E(U),x2:E(U),y1:K*Ui+8,y2:O,className:"dens-grid","data-clonal":n.measure==="ccf"&&U===1?"":void 0}),r.jsx("text",{x:E(U),y:O+18,textAnchor:"middle",className:"dens-tick",children:_M(n,U)})]},U)),n.measure==="ccf"&&j<=1&&b>=1&&r.jsx("text",{x:E(1),y:O+31,textAnchor:"middle",className:"dens-clonal",children:"clonal"}),r.jsxs("g",{className:"dens-curve","data-dim":oe?"":void 0,children:[r.jsx("path",{d:P,fill:`url(#${m}-fill)`}),r.jsx("path",{d:W,className:"dens-line"})]}),oe&&r.jsx("g",{className:"dens-curve dens-lit",children:r.jsxs("g",{clipPath:`url(#${m}-spot)`,children:[r.jsx("path",{d:P,fill:`url(#${m}-fill)`}),r.jsx("path",{d:W,className:"dens-line"})]})}),r.jsx("line",{x1:Na,x2:N,y1:O,y2:O,className:"dens-axis"}),n.median!==null&&r.jsx("path",{d:`M${E(n.median)},${O+1} l4.5,-6 l-4.5,-6 l-4.5,6 z`,className:"dens-median",children:r.jsx("title",{children:`Median ${n.median.toFixed(2)}`})}),R.map((U,q)=>{const re=Ys(n,U.value),he=E(re),ye=_(K,Zf(T,re)),we=U.gene??"?",me=Ms(we,11.5,600)+12,Se=8+I[q]*Ui,gt=p===q;return r.jsxs("g",{className:"dens-driver","data-on":gt||void 0,onPointerDown:Pt=>Pt.stopPropagation(),onMouseEnter:()=>S(q),onMouseLeave:()=>S(null),onClick:()=>U.gene&&c(U.gene),children:[r.jsx("line",{x1:he,x2:he,y1:Se+15,y2:ye,className:"dens-leader"}),r.jsx("rect",{x:he-me/2,y:Se,width:me,height:16,rx:8,className:"dens-chip"}),r.jsx("text",{x:he,y:Se+11.5,textAnchor:"middle",className:"dens-gene",children:we}),r.jsx("circle",{cx:he,cy:ye,r:gt?7:5.5,className:"dens-dot"})]},`${we}-${q}`)}),je!=null&&r.jsx("g",{className:"dens-focus",pointerEvents:"none",children:(()=>{const U=Ys(n,je),q=E(U),re=_(K,Zf(T,U)),he=`${(a==null?void 0:a.gene)??"?"} ${je.toFixed(2)}`,ye=Ms(he,11,600)+14,we=q+12+ye>f;return r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:q,x2:q,y1:re,y2:O,className:"dens-focus-line"}),r.jsx("circle",{cx:q,cy:re,r:6.5,className:"dens-focus-dot"}),r.jsxs("g",{transform:`translate(${we?q-12-ye:q+12} ${re-11})`,children:[r.jsx("rect",{width:ye,height:22,rx:7,className:"dens-focus-chip"}),r.jsx("text",{x:7,y:15,className:"dens-focus-text",children:he})]})]})})()}),$&&oe&&r.jsxs("g",{className:"dens-brush",children:[r.jsx("rect",{x:oe[0],y:K*Ui+4,width:Math.max(oe[1]-oe[0],0),height:xr+8,className:"dens-sel",onPointerDown:U=>J(U,q=>({kind:"move",grab:q,range:$}),ae)}),[0,1].map(U=>r.jsxs("g",{children:[r.jsx("line",{x1:oe[U],x2:oe[U],y1:K*Ui+4,y2:O,className:"dens-sel-edge"}),r.jsx("rect",{x:oe[U]-5,y:K*Ui+4,width:10,height:xr+8,className:"dens-edge",onPointerDown:q=>J(q,()=>({kind:"edge",fixed:$[1-U],to:$[U]}),ce)}),r.jsx("rect",{x:oe[U]-3,y:O-xr/2-10,width:6,height:20,rx:3,className:"dens-grip",pointerEvents:"none"})]},U)),r.jsxs("g",{transform:`translate(${Math.min(Math.max((oe[0]+oe[1])/2,Na+48),N-48)} ${O-30})`,pointerEvents:"none",children:[r.jsx("rect",{x:-48,y:0,width:96,height:20,rx:10,className:"dens-readout"}),r.jsxs("text",{y:14,textAnchor:"middle",className:"dens-readout-text",children:[$[0].toFixed(2)," – ",$[1].toFixed(2)]})]})]})]}),D&&p!==null&&r.jsxs(en,{x:E(Ys(n,D.value)),y:_(K,Zf(T,Ys(n,D.value)))-22,width:f,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("i",{children:D.gene??"?"}),D.protein_change&&r.jsxs("span",{className:"ctip-sub",children:[" ",D.protein_change]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:xe}),r.jsx("b",{children:D.value.toFixed(2)})]}),r.jsx("span",{className:"ctip-note",children:"Driver. Click to find it in the table"})]})]})}function OM({envelope:n,loading:l,measure:a,onMeasure:i,range:c,focus:d,onRange:f,onGene:m}){const g=a==="ccf"?"Cancer cell fraction":"Variant allele fraction",y=(n==null?void 0:n.status)==="ok"?n.data:null;return r.jsxs("div",{className:"strip",children:[r.jsxs("div",{className:"strip-head",children:[r.jsx("span",{className:"text-[13px] font-semibold",children:g}),y&&r.jsxs("span",{className:"text-[12.5px]",style:{color:"var(--muted)"},children:[y.median!==null?`Median ${y.median.toFixed(2)}. `:"","Drag across the plot to filter the table."]}),r.jsx("span",{className:"flex-auto"}),r.jsx(ls,{label:"Measure",value:a,onChange:i,options:[{value:"ccf",label:"CCF"},{value:"vaf",label:"VAF"}]})]}),r.jsx(ss,{label:g,envelope:n,loading:l,skeletonHeight:180,children:v=>r.jsx(AM,{data:v,range:c,focus:d,onRange:f,onGene:m})})]})}const zM=Object.keys(Cy),DM=Object.keys(My);function Bv(n,l){return n.includes(l)?n.filter(a=>a!==l):[...n,l]}function Jf({label:n,count:l,active:a,onClick:i}){return r.jsxs("button",{type:"button",className:"facet","aria-pressed":a,"data-empty":!a&&l===0,onClick:i,children:[r.jsx("span",{className:"facet-check","aria-hidden":!0,children:a&&r.jsx(oy,{size:11,strokeWidth:3})}),r.jsx("span",{className:"truncate",children:n}),r.jsx("span",{className:"facet-n",children:l===void 0?"":l.toLocaleString("en-US")})]})}function kM({table:n,data:l,onChange:a}){const i=l==null?void 0:l.facets.effects,c=l==null?void 0:l.facets.flags,d=n.range;return r.jsxs("aside",{className:"facets","aria-label":"Filters",children:[r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Effect",children:[r.jsx("span",{className:"facet-title",children:"Effect"}),zM.map(f=>r.jsx(Jf,{label:Cy[f],count:i==null?void 0:i[f],active:n.effects.includes(f),onClick:()=>a({effects:Bv(n.effects,f)})},f))]}),r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Flags",children:[r.jsx("span",{className:"facet-title",children:"Flags"}),DM.map(f=>r.jsx(Jf,{label:My[f],count:c==null?void 0:c[f],active:n.flags.includes(f),onClick:()=>a({flags:Bv(n.flags,f)})},f))]}),(l==null?void 0:l.ffpe)&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"FFPE filter",children:[r.jsx("span",{className:"facet-title",children:"FFPE filter"}),r.jsx(Jf,{label:"Show filtered calls",count:l.ffpe.removed,active:n.ffpe,onClick:()=>a({ffpe:!n.ffpe})}),r.jsx("span",{className:"facet-note",children:l.ffpe.threshold!==null?`As in the report, calls FFPERASE scores above ${l.ffpe.threshold} are left out of the counts.`:"As in the report, calls its FFPE filter removes are left out of the counts."})]}),d&&r.jsxs("div",{className:"facet-group",role:"group","aria-label":"Range",children:[r.jsxs("span",{className:"facet-title",children:[d.measure==="ccf"?"CCF":"VAF"," range"]}),r.jsxs("span",{className:"facet-range",children:[r.jsxs("span",{className:"mono",children:[d.low.toFixed(2)," – ",d.high.toFixed(2)]}),r.jsx("button",{type:"button",className:"sc-ib xs","aria-label":"Remove the range",title:"Remove the range",onClick:()=>a({range:null}),children:r.jsx(Yr,{size:13,"aria-hidden":!0})})]})]}),Ny(n)>0&&r.jsx("button",{type:"button",className:"facet-clear",onClick:()=>a({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]})}const Wf=48,yr=16,Sr=200,LM=26,Fi=["#1baf7a","#eda100"],em=[{key:"snvs",label:"SNVs"},{key:"indels",label:"Indels"}];function $M({data:n}){const[l,a]=_s(760),[i,c]=C.useState(null),d=n.cohorts,f=d.length>1,m=(a-Wf-8)/em.length,g=Math.min(m*.34,90),y=b=>{const N=[...d.flatMap(A=>A[b]),n.tumour[b]].filter(A=>A!==null),E=ed(Math.max(...N,1),4);return{ticks:E,top:E[E.length-1]}},v=i?d[i.cohort]:null,p=i&&v?v[i.event]:[],S=ng(p),j=i?n.tumour[i.event]:null;return r.jsxs("section",{className:"tmbc sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["Coding mutations against reference cohorts",n.disease&&r.jsx("span",{className:"sv-h-n",children:n.disease})]}),r.jsxs("div",{className:"ctx-controls",children:[r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[d.map((b,N)=>r.jsxs("li",{children:[r.jsx("span",{className:"sv-swatch",style:{background:Fi[N%Fi.length]},"aria-hidden":!0}),b.cohort,b.n!==null&&r.jsx("span",{className:"sv-key-n",children:b.n})]},b.cohort??N)),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]})]}),r.jsx("span",{className:"snap",title:"Cohorts show the samples the report compared with when it ran. Rerun the report to compare with the cohort as it is now.",children:"Cohort as of the report run"})]})]}),r.jsx("div",{className:"fga-wrap",children:r.jsxs("div",{ref:l,className:"fga-plot",onMouseLeave:()=>c(null),children:[r.jsx("svg",{width:a,height:yr+Sr+LM,role:"img","aria-label":`Coding SNVs and indels against ${d.map(b=>b.cohort).join(" and ")}`,children:em.map(({key:b,label:N},E)=>{const{ticks:A,top:T}=y(b),L=Wf+m*E,M=L+m/2,_=k=>yr+Sr*(1-k/T),R=n.tumour[b];return r.jsxs("g",{children:[A.map(k=>r.jsxs("g",{children:[r.jsx("line",{x1:L+6,x2:L+m-6,y1:_(k),y2:_(k),className:k===0?"ctx-base":"ctx-grid"}),r.jsx("text",{x:L,y:_(k)+4,textAnchor:"end",className:"ctx-tick",children:k.toLocaleString("en-US")})]},k)),d.map((k,I)=>{const K=mM(k[b]),O=f?I===0?-1:1:0,se=Fi[I%Fi.length],ie=K.length?O===0?[...K.map($=>`${M+$.d*g},${_($.v)}`),...[...K].reverse().map($=>`${M-$.d*g},${_($.v)}`)]:[`${M},${_(K[0].v)}`,...K.map($=>`${M+O*$.d*g},${_($.v)}`),`${M},${_(K[K.length-1].v)}`]:[],W=ng(k[b]),P=(i==null?void 0:i.event)===b&&i.cohort===I,le=O===0?M:M+O*6;return r.jsxs("g",{className:"tmb-violin","data-on":P||void 0,onMouseEnter:()=>c({event:b,cohort:I}),children:[ie.length>0&&r.jsx("polygon",{points:ie.join(" "),style:{fill:se,stroke:se},className:"tmb-shape"}),W&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:le,x2:le,y1:_(W.q1),y2:_(W.q3),className:"tmb-iqr"}),r.jsx("circle",{cx:le,cy:_(W.median),r:3,className:"tmb-median"})]}),!ie.length&&k[b].map(($,Z)=>$===null?null:r.jsx("circle",{cx:M+O*10,cy:_($),r:3,style:{fill:se}},Z)),r.jsx("rect",{x:O===1?M:M-g-4,y:yr,width:O===0?g*2+8:g+4,height:Sr,fill:"transparent"})]},k.cohort??I)}),R!==null&&r.jsxs("g",{pointerEvents:"none",className:"tmb-tumour",children:[r.jsx("line",{x1:M-g-10,x2:M+g+10,y1:_(R),y2:_(R),className:"tmb-tumour-line"}),r.jsx("circle",{cx:M,cy:_(R),r:7,className:"fga-pin-dot"}),r.jsx("text",{x:M+12,y:_(R)-9,className:"tmb-tumour-text",children:R.toLocaleString("en-US")})]}),r.jsx("text",{x:M,y:yr+Sr+19,textAnchor:"middle",className:"fga-label",children:N})]},b)})}),i&&v&&r.jsxs(en,{x:Wf+m*em.findIndex(b=>b.key===i.event)+m/2+(f?i.cohort===0?-g/2:g/2:0),y:yr+Sr/2,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Fi[i.cohort%Fi.length]},"aria-hidden":!0}),v.cohort,", coding ",i.event==="snvs"?"SNVs":"indels"]}),S&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Tumours"}),r.jsx("b",{children:S.n})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Median"}),r.jsx("b",{children:Math.round(S.median).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Math.round(S.q1).toLocaleString("en-US"),"–",Math.round(S.q3).toLocaleString("en-US")]})]})]}),j!==null&&r.jsxs("span",{className:"ctip-note",children:["This tumour ",j.toLocaleString("en-US"),". ",Dy(j,p,`${v.cohort} tumour`)]})]})]})})]})}/**
|
|
278
298
|
* table-core
|
|
279
299
|
*
|
|
280
300
|
* Copyright (c) TanStack
|
|
@@ -283,10 +303,10 @@ Error generating stack: `+i.message+`
|
|
|
283
303
|
* LICENSE.md file in the root directory of this source tree.
|
|
284
304
|
*
|
|
285
305
|
* @license MIT
|
|
286
|
-
*/function
|
|
306
|
+
*/function Yl(n,l){return typeof n=="function"?n(l):n}function Dn(n,l){return a=>{l.setState(i=>({...i,[n]:Yl(a,i[n])}))}}function td(n){return n instanceof Function}function HM(n){return Array.isArray(n)&&n.every(l=>typeof l=="number")}function UM(n,l){const a=[],i=c=>{c.forEach(d=>{a.push(d);const f=l(d);f!=null&&f.length&&i(f)})};return i(n),a}function Ee(n,l,a){let i=[],c;return d=>{let f;a.key&&a.debug&&(f=Date.now());const m=n(d);if(!(m.length!==i.length||m.some((v,p)=>i[p]!==v)))return c;i=m;let y;if(a.key&&a.debug&&(y=Date.now()),c=l(...m),a==null||a.onChange==null||a.onChange(c),a.key&&a.debug&&a!=null&&a.debug()){const v=Math.round((Date.now()-f)*100)/100,p=Math.round((Date.now()-y)*100)/100,S=p/16,j=(b,N)=>{for(b=String(b);b.length<N;)b=" "+b;return b};console.info(`%c⏱ ${j(p,5)} /${j(v,5)} ms`,`
|
|
287
307
|
font-size: .6rem;
|
|
288
308
|
font-weight: bold;
|
|
289
|
-
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,a==null?void 0:a.key)}return c}}function Ee(n,l,a,o){return{debug:()=>{var c;return(c=n==null?void 0:n.debugAll)!=null?c:n[l]},key:!1,onChange:o}}function dE(n,l,a,o){const c=()=>{var h;return(h=d.getValue())!=null?h:n.options.renderFallbackValue},d={id:`${l.id}_${a.id}`,row:l,column:a,getValue:()=>l.getValue(o),renderValue:c,getContext:Me(()=>[n,a,l,d],(h,m,g,x)=>({table:h,column:m,row:g,cell:x,getValue:x.getValue,renderValue:x.renderValue}),Ee(n.options,"debugCells"))};return n._features.forEach(h=>{h.createCell==null||h.createCell(d,a,l,n)},{}),d}function hE(n,l,a,o){var c,d;const m={...n._getDefaultColumnDef(),...l},g=m.accessorKey;let x=(c=(d=m.id)!=null?d:g?typeof String.prototype.replaceAll=="function"?g.replaceAll(".","_"):g.replace(/\./g,"_"):void 0)!=null?c:typeof m.header=="string"?m.header:void 0,v;if(m.accessorFn?v=m.accessorFn:g&&(g.includes(".")?v=S=>{let j=S;for(const N of g.split(".")){var b;j=(b=j)==null?void 0:b[N]}return j}:v=S=>S[m.accessorKey]),!x)throw new Error;let y={id:`${String(x)}`,accessorFn:v,parent:o,depth:a,columnDef:m,columns:[],getFlatColumns:Me(()=>[!0],()=>{var S;return[y,...(S=y.columns)==null?void 0:S.flatMap(j=>j.getFlatColumns())]},Ee(n.options,"debugColumns")),getLeafColumns:Me(()=>[n._getOrderColumnsFn()],S=>{var j;if((j=y.columns)!=null&&j.length){let b=y.columns.flatMap(N=>N.getLeafColumns());return S(b)}return[y]},Ee(n.options,"debugColumns"))};for(const S of n._features)S.createColumn==null||S.createColumn(y,n);return y}const Xt="debugHeaders";function zx(n,l,a){var o;let d={id:(o=a.id)!=null?o:l.id,column:l,index:a.index,isPlaceholder:!!a.isPlaceholder,placeholderId:a.placeholderId,depth:a.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const h=[],m=g=>{g.subHeaders&&g.subHeaders.length&&g.subHeaders.map(m),h.push(g)};return m(d),h},getContext:()=>({table:n,header:d,column:l})};return n._features.forEach(h=>{h.createHeader==null||h.createHeader(d,n)}),d}const mE={createTable:n=>{n.getHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,o,c)=>{var d,h;const m=(d=o==null?void 0:o.map(y=>a.find(S=>S.id===y)).filter(Boolean))!=null?d:[],g=(h=c==null?void 0:c.map(y=>a.find(S=>S.id===y)).filter(Boolean))!=null?h:[],x=a.filter(y=>!(o!=null&&o.includes(y.id))&&!(c!=null&&c.includes(y.id)));return vu(l,[...m,...x,...g],n)},Ee(n.options,Xt)),n.getCenterHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,o,c)=>(a=a.filter(d=>!(o!=null&&o.includes(d.id))&&!(c!=null&&c.includes(d.id))),vu(l,a,n,"center")),Ee(n.options,Xt)),n.getLeftHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(l,a,o)=>{var c;const d=(c=o==null?void 0:o.map(h=>a.find(m=>m.id===h)).filter(Boolean))!=null?c:[];return vu(l,d,n,"left")},Ee(n.options,Xt)),n.getRightHeaderGroups=Me(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(l,a,o)=>{var c;const d=(c=o==null?void 0:o.map(h=>a.find(m=>m.id===h)).filter(Boolean))!=null?c:[];return vu(l,d,n,"right")},Ee(n.options,Xt)),n.getFooterGroups=Me(()=>[n.getHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getLeftFooterGroups=Me(()=>[n.getLeftHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getCenterFooterGroups=Me(()=>[n.getCenterHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getRightFooterGroups=Me(()=>[n.getRightHeaderGroups()],l=>[...l].reverse(),Ee(n.options,Xt)),n.getFlatHeaders=Me(()=>[n.getHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getLeftFlatHeaders=Me(()=>[n.getLeftHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getCenterFlatHeaders=Me(()=>[n.getCenterHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getRightFlatHeaders=Me(()=>[n.getRightHeaderGroups()],l=>l.map(a=>a.headers).flat(),Ee(n.options,Xt)),n.getCenterLeafHeaders=Me(()=>[n.getCenterFlatHeaders()],l=>l.filter(a=>{var o;return!((o=a.subHeaders)!=null&&o.length)}),Ee(n.options,Xt)),n.getLeftLeafHeaders=Me(()=>[n.getLeftFlatHeaders()],l=>l.filter(a=>{var o;return!((o=a.subHeaders)!=null&&o.length)}),Ee(n.options,Xt)),n.getRightLeafHeaders=Me(()=>[n.getRightFlatHeaders()],l=>l.filter(a=>{var o;return!((o=a.subHeaders)!=null&&o.length)}),Ee(n.options,Xt)),n.getLeafHeaders=Me(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(l,a,o)=>{var c,d,h,m,g,x;return[...(c=(d=l[0])==null?void 0:d.headers)!=null?c:[],...(h=(m=a[0])==null?void 0:m.headers)!=null?h:[],...(g=(x=o[0])==null?void 0:x.headers)!=null?g:[]].map(v=>v.getLeafHeaders()).flat()},Ee(n.options,Xt))}};function vu(n,l,a,o){var c,d;let h=0;const m=function(S,j){j===void 0&&(j=1),h=Math.max(h,j),S.filter(b=>b.getIsVisible()).forEach(b=>{var N;(N=b.columns)!=null&&N.length&&m(b.columns,j+1)},0)};m(n);let g=[];const x=(S,j)=>{const b={depth:j,id:[o,`${j}`].filter(Boolean).join("_"),headers:[]},N=[];S.forEach(T=>{const O=[...N].reverse()[0],_=T.column.depth===b.depth;let D,C=!1;if(_&&T.column.parent?D=T.column.parent:(D=T.column,C=!0),O&&(O==null?void 0:O.column)===D)O.subHeaders.push(T);else{const E=zx(a,D,{id:[o,j,D.id,T==null?void 0:T.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${N.filter(R=>R.column===D).length}`:void 0,depth:j,index:N.length});E.subHeaders.push(T),N.push(E)}b.headers.push(T),T.headerGroup=b}),g.push(b),j>0&&x(N,j-1)},v=l.map((S,j)=>zx(a,S,{depth:h,index:j}));x(v,h-1),g.reverse();const y=S=>S.filter(b=>b.column.getIsVisible()).map(b=>{let N=0,T=0,O=[0];b.subHeaders&&b.subHeaders.length?(O=[],y(b.subHeaders).forEach(D=>{let{colSpan:C,rowSpan:E}=D;N+=C,O.push(E)})):N=1;const _=Math.min(...O);return T=T+_,b.colSpan=N,b.rowSpan=T,{colSpan:N,rowSpan:T}});return y((c=(d=g[0])==null?void 0:d.headers)!=null?c:[]),g}const gE=(n,l,a,o,c,d,h)=>{let m={id:l,index:o,original:a,depth:c,parentId:h,_valuesCache:{},_uniqueValuesCache:{},getValue:g=>{if(m._valuesCache.hasOwnProperty(g))return m._valuesCache[g];const x=n.getColumn(g);if(x!=null&&x.accessorFn)return m._valuesCache[g]=x.accessorFn(m.original,o),m._valuesCache[g]},getUniqueValues:g=>{if(m._uniqueValuesCache.hasOwnProperty(g))return m._uniqueValuesCache[g];const x=n.getColumn(g);if(x!=null&&x.accessorFn)return x.columnDef.getUniqueValues?(m._uniqueValuesCache[g]=x.columnDef.getUniqueValues(m.original,o),m._uniqueValuesCache[g]):(m._uniqueValuesCache[g]=[m.getValue(g)],m._uniqueValuesCache[g])},renderValue:g=>{var x;return(x=m.getValue(g))!=null?x:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>fE(m.subRows,g=>g.subRows),getParentRow:()=>m.parentId?n.getRow(m.parentId,!0):void 0,getParentRows:()=>{let g=[],x=m;for(;;){const v=x.getParentRow();if(!v)break;g.push(v),x=v}return g.reverse()},getAllCells:Me(()=>[n.getAllLeafColumns()],g=>g.map(x=>dE(n,m,x,x.id)),Ee(n.options,"debugRows")),_getAllCellsByColumnId:Me(()=>[m.getAllCells()],g=>g.reduce((x,v)=>(x[v.column.id]=v,x),{}),Ee(n.options,"debugRows"))};for(let g=0;g<n._features.length;g++){const x=n._features[g];x==null||x.createRow==null||x.createRow(m,n)}return m},pE={createColumn:(n,l)=>{n._getFacetedRowModel=l.options.getFacetedRowModel&&l.options.getFacetedRowModel(l,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():l.getPreFilteredRowModel(),n._getFacetedUniqueValues=l.options.getFacetedUniqueValues&&l.options.getFacetedUniqueValues(l,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=l.options.getFacetedMinMaxValues&&l.options.getFacetedMinMaxValues(l,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},xS=(n,l,a)=>{var o,c;const d=a==null||(o=a.toString())==null?void 0:o.toLowerCase();return!!(!((c=n.getValue(l))==null||(c=c.toString())==null||(c=c.toLowerCase())==null)&&c.includes(d))};xS.autoRemove=n=>as(n);const SS=(n,l,a)=>{var o;return!!(!((o=n.getValue(l))==null||(o=o.toString())==null)&&o.includes(a))};SS.autoRemove=n=>as(n);const bS=(n,l,a)=>{var o;return((o=n.getValue(l))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(a==null?void 0:a.toLowerCase())};bS.autoRemove=n=>as(n);const jS=(n,l,a)=>{var o;return(o=n.getValue(l))==null?void 0:o.includes(a)};jS.autoRemove=n=>as(n);const wS=(n,l,a)=>!a.some(o=>{var c;return!((c=n.getValue(l))!=null&&c.includes(o))});wS.autoRemove=n=>as(n)||!(n!=null&&n.length);const NS=(n,l,a)=>a.some(o=>{var c;return(c=n.getValue(l))==null?void 0:c.includes(o)});NS.autoRemove=n=>as(n)||!(n!=null&&n.length);const CS=(n,l,a)=>n.getValue(l)===a;CS.autoRemove=n=>as(n);const MS=(n,l,a)=>n.getValue(l)==a;MS.autoRemove=n=>as(n);const yg=(n,l,a)=>{let[o,c]=a;const d=n.getValue(l);return d>=o&&d<=c};yg.resolveFilterValue=n=>{let[l,a]=n,o=typeof l!="number"?parseFloat(l):l,c=typeof a!="number"?parseFloat(a):a,d=l===null||Number.isNaN(o)?-1/0:o,h=a===null||Number.isNaN(c)?1/0:c;if(d>h){const m=d;d=h,h=m}return[d,h]};yg.autoRemove=n=>as(n)||as(n[0])&&as(n[1]);const Ps={includesString:xS,includesStringSensitive:SS,equalsString:bS,arrIncludes:jS,arrIncludesAll:wS,arrIncludesSome:NS,equals:CS,weakEquals:MS,inNumberRange:yg};function as(n){return n==null||n===""}const yE={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:Dn("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,l)=>{n.getAutoFilterFn=()=>{const a=l.getCoreRowModel().flatRows[0],o=a==null?void 0:a.getValue(n.id);return typeof o=="string"?Ps.includesString:typeof o=="number"?Ps.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Ps.equals:Array.isArray(o)?Ps.arrIncludes:Ps.weakEquals},n.getFilterFn=()=>{var a,o;return Xu(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(a=(o=l.options.filterFns)==null?void 0:o[n.columnDef.filterFn])!=null?a:Ps[n.columnDef.filterFn]},n.getCanFilter=()=>{var a,o,c;return((a=n.columnDef.enableColumnFilter)!=null?a:!0)&&((o=l.options.enableColumnFilters)!=null?o:!0)&&((c=l.options.enableFilters)!=null?c:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var a;return(a=l.getState().columnFilters)==null||(a=a.find(o=>o.id===n.id))==null?void 0:a.value},n.getFilterIndex=()=>{var a,o;return(a=(o=l.getState().columnFilters)==null?void 0:o.findIndex(c=>c.id===n.id))!=null?a:-1},n.setFilterValue=a=>{l.setColumnFilters(o=>{const c=n.getFilterFn(),d=o==null?void 0:o.find(v=>v.id===n.id),h=Fl(a,d?d.value:void 0);if(Dx(c,h,n)){var m;return(m=o==null?void 0:o.filter(v=>v.id!==n.id))!=null?m:[]}const g={id:n.id,value:h};if(d){var x;return(x=o==null?void 0:o.map(v=>v.id===n.id?g:v))!=null?x:[]}return o!=null&&o.length?[...o,g]:[g]})}},createRow:(n,l)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=l=>{const a=n.getAllLeafColumns(),o=c=>{var d;return(d=Fl(l,c))==null?void 0:d.filter(h=>{const m=a.find(g=>g.id===h.id);if(m){const g=m.getFilterFn();if(Dx(g,h.value,m))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(o)},n.resetColumnFilters=l=>{var a,o;n.setColumnFilters(l?[]:(a=(o=n.initialState)==null?void 0:o.columnFilters)!=null?a:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function Dx(n,l,a){return(n&&n.autoRemove?n.autoRemove(l,a):!1)||typeof l>"u"||typeof l=="string"&&!l}const vE=(n,l,a)=>a.reduce((o,c)=>{const d=c.getValue(n);return o+(typeof d=="number"?d:0)},0),xE=(n,l,a)=>{let o;return a.forEach(c=>{const d=c.getValue(n);d!=null&&(o>d||o===void 0&&d>=d)&&(o=d)}),o},SE=(n,l,a)=>{let o;return a.forEach(c=>{const d=c.getValue(n);d!=null&&(o<d||o===void 0&&d>=d)&&(o=d)}),o},bE=(n,l,a)=>{let o,c;return a.forEach(d=>{const h=d.getValue(n);h!=null&&(o===void 0?h>=h&&(o=c=h):(o>h&&(o=h),c<h&&(c=h)))}),[o,c]},jE=(n,l)=>{let a=0,o=0;if(l.forEach(c=>{let d=c.getValue(n);d!=null&&(d=+d)>=d&&(++a,o+=d)}),a)return o/a},wE=(n,l)=>{if(!l.length)return;const a=l.map(d=>d.getValue(n));if(!uE(a))return;if(a.length===1)return a[0];const o=Math.floor(a.length/2),c=a.sort((d,h)=>d-h);return a.length%2!==0?c[o]:(c[o-1]+c[o])/2},NE=(n,l)=>Array.from(new Set(l.map(a=>a.getValue(n))).values()),CE=(n,l)=>new Set(l.map(a=>a.getValue(n))).size,ME=(n,l)=>l.length,Qh={sum:vE,min:xE,max:SE,extent:bE,mean:jE,median:wE,unique:NE,uniqueCount:CE,count:ME},EE={getDefaultColumnDef:()=>({aggregatedCell:n=>{var l,a;return(l=(a=n.getValue())==null||a.toString==null?void 0:a.toString())!=null?l:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:Dn("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,l)=>{n.toggleGrouping=()=>{l.setGrouping(a=>a!=null&&a.includes(n.id)?a.filter(o=>o!==n.id):[...a??[],n.id])},n.getCanGroup=()=>{var a,o;return((a=n.columnDef.enableGrouping)!=null?a:!0)&&((o=l.options.enableGrouping)!=null?o:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var a;return(a=l.getState().grouping)==null?void 0:a.includes(n.id)},n.getGroupedIndex=()=>{var a;return(a=l.getState().grouping)==null?void 0:a.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const a=n.getCanGroup();return()=>{a&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const a=l.getCoreRowModel().flatRows[0],o=a==null?void 0:a.getValue(n.id);if(typeof o=="number")return Qh.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Qh.extent},n.getAggregationFn=()=>{var a,o;if(!n)throw new Error;return Xu(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(a=(o=l.options.aggregationFns)==null?void 0:o[n.columnDef.aggregationFn])!=null?a:Qh[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=l=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(l),n.resetGrouping=l=>{var a,o;n.setGrouping(l?[]:(a=(o=n.initialState)==null?void 0:o.grouping)!=null?a:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,l)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=a=>{if(n._groupingValuesCache.hasOwnProperty(a))return n._groupingValuesCache[a];const o=l.getColumn(a);return o!=null&&o.columnDef.getGroupingValue?(n._groupingValuesCache[a]=o.columnDef.getGroupingValue(n.original),n._groupingValuesCache[a]):n.getValue(a)},n._groupingValuesCache={}},createCell:(n,l,a,o)=>{n.getIsGrouped=()=>l.getIsGrouped()&&l.id===a.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&l.getIsGrouped(),n.getIsAggregated=()=>{var c;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((c=a.subRows)!=null&&c.length)}}};function TE(n,l,a){if(!(l!=null&&l.length)||!a)return n;const o=n.filter(d=>!l.includes(d.id));return a==="remove"?o:[...l.map(d=>n.find(h=>h.id===d)).filter(Boolean),...o]}const _E={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:Dn("columnOrder",n)}),createColumn:(n,l)=>{n.getIndex=Me(a=>[Mr(l,a)],a=>a.findIndex(o=>o.id===n.id),Ee(l.options,"debugColumns")),n.getIsFirstColumn=a=>{var o;return((o=Mr(l,a)[0])==null?void 0:o.id)===n.id},n.getIsLastColumn=a=>{var o;const c=Mr(l,a);return((o=c[c.length-1])==null?void 0:o.id)===n.id}},createTable:n=>{n.setColumnOrder=l=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(l),n.resetColumnOrder=l=>{var a;n.setColumnOrder(l?[]:(a=n.initialState.columnOrder)!=null?a:[])},n._getOrderColumnsFn=Me(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(l,a,o)=>c=>{let d=[];if(!(l!=null&&l.length))d=c;else{const h=[...l],m=[...c];for(;m.length&&h.length;){const g=h.shift(),x=m.findIndex(v=>v.id===g);x>-1&&d.push(m.splice(x,1)[0])}d=[...d,...m]}return TE(d,a,o)},Ee(n.options,"debugTable"))}},Yh=()=>({left:[],right:[]}),RE={getInitialState:n=>({columnPinning:Yh(),...n}),getDefaultOptions:n=>({onColumnPinningChange:Dn("columnPinning",n)}),createColumn:(n,l)=>{n.pin=a=>{const o=n.getLeafColumns().map(c=>c.id).filter(Boolean);l.setColumnPinning(c=>{var d,h;if(a==="right"){var m,g;return{left:((m=c==null?void 0:c.left)!=null?m:[]).filter(y=>!(o!=null&&o.includes(y))),right:[...((g=c==null?void 0:c.right)!=null?g:[]).filter(y=>!(o!=null&&o.includes(y))),...o]}}if(a==="left"){var x,v;return{left:[...((x=c==null?void 0:c.left)!=null?x:[]).filter(y=>!(o!=null&&o.includes(y))),...o],right:((v=c==null?void 0:c.right)!=null?v:[]).filter(y=>!(o!=null&&o.includes(y)))}}return{left:((d=c==null?void 0:c.left)!=null?d:[]).filter(y=>!(o!=null&&o.includes(y))),right:((h=c==null?void 0:c.right)!=null?h:[]).filter(y=>!(o!=null&&o.includes(y)))}})},n.getCanPin=()=>n.getLeafColumns().some(o=>{var c,d,h;return((c=o.columnDef.enablePinning)!=null?c:!0)&&((d=(h=l.options.enableColumnPinning)!=null?h:l.options.enablePinning)!=null?d:!0)}),n.getIsPinned=()=>{const a=n.getLeafColumns().map(m=>m.id),{left:o,right:c}=l.getState().columnPinning,d=a.some(m=>o==null?void 0:o.includes(m)),h=a.some(m=>c==null?void 0:c.includes(m));return d?"left":h?"right":!1},n.getPinnedIndex=()=>{var a,o;const c=n.getIsPinned();return c?(a=(o=l.getState().columnPinning)==null||(o=o[c])==null?void 0:o.indexOf(n.id))!=null?a:-1:0}},createRow:(n,l)=>{n.getCenterVisibleCells=Me(()=>[n._getAllVisibleCells(),l.getState().columnPinning.left,l.getState().columnPinning.right],(a,o,c)=>{const d=[...o??[],...c??[]];return a.filter(h=>!d.includes(h.column.id))},Ee(l.options,"debugRows")),n.getLeftVisibleCells=Me(()=>[n._getAllVisibleCells(),l.getState().columnPinning.left],(a,o)=>(o??[]).map(d=>a.find(h=>h.column.id===d)).filter(Boolean).map(d=>({...d,position:"left"})),Ee(l.options,"debugRows")),n.getRightVisibleCells=Me(()=>[n._getAllVisibleCells(),l.getState().columnPinning.right],(a,o)=>(o??[]).map(d=>a.find(h=>h.column.id===d)).filter(Boolean).map(d=>({...d,position:"right"})),Ee(l.options,"debugRows"))},createTable:n=>{n.setColumnPinning=l=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(l),n.resetColumnPinning=l=>{var a,o;return n.setColumnPinning(l?Yh():(a=(o=n.initialState)==null?void 0:o.columnPinning)!=null?a:Yh())},n.getIsSomeColumnsPinned=l=>{var a;const o=n.getState().columnPinning;if(!l){var c,d;return!!((c=o.left)!=null&&c.length||(d=o.right)!=null&&d.length)}return!!((a=o[l])!=null&&a.length)},n.getLeftLeafColumns=Me(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(l,a)=>(a??[]).map(o=>l.find(c=>c.id===o)).filter(Boolean),Ee(n.options,"debugColumns")),n.getRightLeafColumns=Me(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(l,a)=>(a??[]).map(o=>l.find(c=>c.id===o)).filter(Boolean),Ee(n.options,"debugColumns")),n.getCenterLeafColumns=Me(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,o)=>{const c=[...a??[],...o??[]];return l.filter(d=>!c.includes(d.id))},Ee(n.options,"debugColumns"))}};function AE(n){return n||(typeof document<"u"?document:null)}const xu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Ph=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),OE={getDefaultColumnDef:()=>xu,getInitialState:n=>({columnSizing:{},columnSizingInfo:Ph(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Dn("columnSizing",n),onColumnSizingInfoChange:Dn("columnSizingInfo",n)}),createColumn:(n,l)=>{n.getSize=()=>{var a,o,c;const d=l.getState().columnSizing[n.id];return Math.min(Math.max((a=n.columnDef.minSize)!=null?a:xu.minSize,(o=d??n.columnDef.size)!=null?o:xu.size),(c=n.columnDef.maxSize)!=null?c:xu.maxSize)},n.getStart=Me(a=>[a,Mr(l,a),l.getState().columnSizing],(a,o)=>o.slice(0,n.getIndex(a)).reduce((c,d)=>c+d.getSize(),0),Ee(l.options,"debugColumns")),n.getAfter=Me(a=>[a,Mr(l,a),l.getState().columnSizing],(a,o)=>o.slice(n.getIndex(a)+1).reduce((c,d)=>c+d.getSize(),0),Ee(l.options,"debugColumns")),n.resetSize=()=>{l.setColumnSizing(a=>{let{[n.id]:o,...c}=a;return c})},n.getCanResize=()=>{var a,o;return((a=n.columnDef.enableResizing)!=null?a:!0)&&((o=l.options.enableColumnResizing)!=null?o:!0)},n.getIsResizing=()=>l.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,l)=>{n.getSize=()=>{let a=0;const o=c=>{if(c.subHeaders.length)c.subHeaders.forEach(o);else{var d;a+=(d=c.column.getSize())!=null?d:0}};return o(n),a},n.getStart=()=>{if(n.index>0){const a=n.headerGroup.headers[n.index-1];return a.getStart()+a.getSize()}return 0},n.getResizeHandler=a=>{const o=l.getColumn(n.column.id),c=o==null?void 0:o.getCanResize();return d=>{if(!o||!c||(d.persist==null||d.persist(),Xh(d)&&d.touches&&d.touches.length>1))return;const h=n.getSize(),m=n?n.getLeafHeaders().map(O=>[O.column.id,O.column.getSize()]):[[o.id,o.getSize()]],g=Xh(d)?Math.round(d.touches[0].clientX):d.clientX,x={},v=(O,_)=>{typeof _=="number"&&(l.setColumnSizingInfo(D=>{var C,E;const R=l.options.columnResizeDirection==="rtl"?-1:1,A=(_-((C=D==null?void 0:D.startOffset)!=null?C:0))*R,B=Math.max(A/((E=D==null?void 0:D.startSize)!=null?E:0),-.999999);return D.columnSizingStart.forEach(K=>{let[k,ie]=K;x[k]=Math.round(Math.max(ie+ie*B,0)*100)/100}),{...D,deltaOffset:A,deltaPercentage:B}}),(l.options.columnResizeMode==="onChange"||O==="end")&&l.setColumnSizing(D=>({...D,...x})))},y=O=>v("move",O),S=O=>{v("end",O),l.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},j=AE(a),b={moveHandler:O=>y(O.clientX),upHandler:O=>{j==null||j.removeEventListener("mousemove",b.moveHandler),j==null||j.removeEventListener("mouseup",b.upHandler),S(O.clientX)}},N={moveHandler:O=>(O.cancelable&&(O.preventDefault(),O.stopPropagation()),y(O.touches[0].clientX),!1),upHandler:O=>{var _;j==null||j.removeEventListener("touchmove",N.moveHandler),j==null||j.removeEventListener("touchend",N.upHandler),O.cancelable&&(O.preventDefault(),O.stopPropagation()),S((_=O.touches[0])==null?void 0:_.clientX)}},T=zE()?{passive:!1}:!1;Xh(d)?(j==null||j.addEventListener("touchmove",N.moveHandler,T),j==null||j.addEventListener("touchend",N.upHandler,T)):(j==null||j.addEventListener("mousemove",b.moveHandler,T),j==null||j.addEventListener("mouseup",b.upHandler,T)),l.setColumnSizingInfo(O=>({...O,startOffset:g,startSize:h,deltaOffset:0,deltaPercentage:0,columnSizingStart:m,isResizingColumn:o.id}))}}},createTable:n=>{n.setColumnSizing=l=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(l),n.setColumnSizingInfo=l=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(l),n.resetColumnSizing=l=>{var a;n.setColumnSizing(l?{}:(a=n.initialState.columnSizing)!=null?a:{})},n.resetHeaderSizeInfo=l=>{var a;n.setColumnSizingInfo(l?Ph():(a=n.initialState.columnSizingInfo)!=null?a:Ph())},n.getTotalSize=()=>{var l,a;return(l=(a=n.getHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0},n.getLeftTotalSize=()=>{var l,a;return(l=(a=n.getLeftHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0},n.getCenterTotalSize=()=>{var l,a;return(l=(a=n.getCenterHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0},n.getRightTotalSize=()=>{var l,a;return(l=(a=n.getRightHeaderGroups()[0])==null?void 0:a.headers.reduce((o,c)=>o+c.getSize(),0))!=null?l:0}}};let Su=null;function zE(){if(typeof Su=="boolean")return Su;let n=!1;try{const l={get passive(){return n=!0,!1}},a=()=>{};window.addEventListener("test",a,l),window.removeEventListener("test",a)}catch{n=!1}return Su=n,Su}function Xh(n){return n.type==="touchstart"}const DE={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:Dn("columnVisibility",n)}),createColumn:(n,l)=>{n.toggleVisibility=a=>{n.getCanHide()&&l.setColumnVisibility(o=>({...o,[n.id]:a??!n.getIsVisible()}))},n.getIsVisible=()=>{var a,o;const c=n.columns;return(a=c.length?c.some(d=>d.getIsVisible()):(o=l.getState().columnVisibility)==null?void 0:o[n.id])!=null?a:!0},n.getCanHide=()=>{var a,o;return((a=n.columnDef.enableHiding)!=null?a:!0)&&((o=l.options.enableHiding)!=null?o:!0)},n.getToggleVisibilityHandler=()=>a=>{n.toggleVisibility==null||n.toggleVisibility(a.target.checked)}},createRow:(n,l)=>{n._getAllVisibleCells=Me(()=>[n.getAllCells(),l.getState().columnVisibility],a=>a.filter(o=>o.column.getIsVisible()),Ee(l.options,"debugRows")),n.getVisibleCells=Me(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(a,o,c)=>[...a,...o,...c],Ee(l.options,"debugRows"))},createTable:n=>{const l=(a,o)=>Me(()=>[o(),o().filter(c=>c.getIsVisible()).map(c=>c.id).join("_")],c=>c.filter(d=>d.getIsVisible==null?void 0:d.getIsVisible()),Ee(n.options,"debugColumns"));n.getVisibleFlatColumns=l("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=l("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=l("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=l("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=l("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=a=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(a),n.resetColumnVisibility=a=>{var o;n.setColumnVisibility(a?{}:(o=n.initialState.columnVisibility)!=null?o:{})},n.toggleAllColumnsVisible=a=>{var o;a=(o=a)!=null?o:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((c,d)=>({...c,[d.id]:a||!(d.getCanHide!=null&&d.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(a=>!(a.getIsVisible!=null&&a.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(a=>a.getIsVisible==null?void 0:a.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>a=>{var o;n.toggleAllColumnsVisible((o=a.target)==null?void 0:o.checked)}}};function Mr(n,l){return l?l==="center"?n.getCenterVisibleLeafColumns():l==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const LE={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},$E={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:Dn("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:l=>{var a;const o=(a=n.getCoreRowModel().flatRows[0])==null||(a=a._getAllCellsByColumnId()[l.id])==null?void 0:a.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(n,l)=>{n.getCanGlobalFilter=()=>{var a,o,c,d;return((a=n.columnDef.enableGlobalFilter)!=null?a:!0)&&((o=l.options.enableGlobalFilter)!=null?o:!0)&&((c=l.options.enableFilters)!=null?c:!0)&&((d=l.options.getColumnCanGlobalFilter==null?void 0:l.options.getColumnCanGlobalFilter(n))!=null?d:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>Ps.includesString,n.getGlobalFilterFn=()=>{var l,a;const{globalFilterFn:o}=n.options;return Xu(o)?o:o==="auto"?n.getGlobalAutoFilterFn():(l=(a=n.options.filterFns)==null?void 0:a[o])!=null?l:Ps[o]},n.setGlobalFilter=l=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(l)},n.resetGlobalFilter=l=>{n.setGlobalFilter(l?void 0:n.initialState.globalFilter)}}},kE={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:Dn("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let l=!1,a=!1;n._autoResetExpanded=()=>{var o,c;if(!l){n._queue(()=>{l=!0});return}if((o=(c=n.options.autoResetAll)!=null?c:n.options.autoResetExpanded)!=null?o:!n.options.manualExpanding){if(a)return;a=!0,n._queue(()=>{n.resetExpanded(),a=!1})}},n.setExpanded=o=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(o),n.toggleAllRowsExpanded=o=>{o??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=o=>{var c,d;n.setExpanded(o?{}:(c=(d=n.initialState)==null?void 0:d.expanded)!=null?c:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const o=n.getState().expanded;return o===!0||Object.values(o).some(Boolean)},n.getIsAllRowsExpanded=()=>{const o=n.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||n.getRowModel().flatRows.some(c=>!c.getIsExpanded()))},n.getExpandedDepth=()=>{let o=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(d=>{const h=d.split(".");o=Math.max(o,h.length)}),o},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,l)=>{n.toggleExpanded=a=>{l.setExpanded(o=>{var c;const d=o===!0?!0:!!(o!=null&&o[n.id]);let h={};if(o===!0?Object.keys(l.getRowModel().rowsById).forEach(m=>{h[m]=!0}):h=o,a=(c=a)!=null?c:!d,!d&&a)return{...h,[n.id]:!0};if(d&&!a){const{[n.id]:m,...g}=h;return g}return o})},n.getIsExpanded=()=>{var a;const o=l.getState().expanded;return!!((a=l.options.getIsRowExpanded==null?void 0:l.options.getIsRowExpanded(n))!=null?a:o===!0||o!=null&&o[n.id])},n.getCanExpand=()=>{var a,o,c;return(a=l.options.getRowCanExpand==null?void 0:l.options.getRowCanExpand(n))!=null?a:((o=l.options.enableExpanding)!=null?o:!0)&&!!((c=n.subRows)!=null&&c.length)},n.getIsAllParentsExpanded=()=>{let a=!0,o=n;for(;a&&o.parentId;)o=l.getRow(o.parentId,!0),a=o.getIsExpanded();return a},n.getToggleExpandedHandler=()=>{const a=n.getCanExpand();return()=>{a&&n.toggleExpanded()}}}},Qm=0,Ym=10,Kh=()=>({pageIndex:Qm,pageSize:Ym}),HE={getInitialState:n=>({...n,pagination:{...Kh(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:Dn("pagination",n)}),createTable:n=>{let l=!1,a=!1;n._autoResetPageIndex=()=>{var o,c;if(!l){n._queue(()=>{l=!0});return}if((o=(c=n.options.autoResetAll)!=null?c:n.options.autoResetPageIndex)!=null?o:!n.options.manualPagination){if(a)return;a=!0,n._queue(()=>{n.resetPageIndex(),a=!1})}},n.setPagination=o=>{const c=d=>Fl(o,d);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(c)},n.resetPagination=o=>{var c;n.setPagination(o?Kh():(c=n.initialState.pagination)!=null?c:Kh())},n.setPageIndex=o=>{n.setPagination(c=>{let d=Fl(o,c.pageIndex);const h=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return d=Math.max(0,Math.min(d,h)),{...c,pageIndex:d}})},n.resetPageIndex=o=>{var c,d;n.setPageIndex(o?Qm:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageIndex)!=null?c:Qm)},n.resetPageSize=o=>{var c,d;n.setPageSize(o?Ym:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageSize)!=null?c:Ym)},n.setPageSize=o=>{n.setPagination(c=>{const d=Math.max(1,Fl(o,c.pageSize)),h=c.pageSize*c.pageIndex,m=Math.floor(h/d);return{...c,pageIndex:m,pageSize:d}})},n.setPageCount=o=>n.setPagination(c=>{var d;let h=Fl(o,(d=n.options.pageCount)!=null?d:-1);return typeof h=="number"&&(h=Math.max(-1,h)),{...c,pageCount:h}}),n.getPageOptions=Me(()=>[n.getPageCount()],o=>{let c=[];return o&&o>0&&(c=[...new Array(o)].fill(null).map((d,h)=>h)),c},Ee(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:o}=n.getState().pagination,c=n.getPageCount();return c===-1?!0:c===0?!1:o<c-1},n.previousPage=()=>n.setPageIndex(o=>o-1),n.nextPage=()=>n.setPageIndex(o=>o+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var o;return(o=n.options.pageCount)!=null?o:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var o;return(o=n.options.rowCount)!=null?o:n.getPrePaginationRowModel().rows.length}}},Zh=()=>({top:[],bottom:[]}),UE={getInitialState:n=>({rowPinning:Zh(),...n}),getDefaultOptions:n=>({onRowPinningChange:Dn("rowPinning",n)}),createRow:(n,l)=>{n.pin=(a,o,c)=>{const d=o?n.getLeafRows().map(g=>{let{id:x}=g;return x}):[],h=c?n.getParentRows().map(g=>{let{id:x}=g;return x}):[],m=new Set([...h,n.id,...d]);l.setRowPinning(g=>{var x,v;if(a==="bottom"){var y,S;return{top:((y=g==null?void 0:g.top)!=null?y:[]).filter(N=>!(m!=null&&m.has(N))),bottom:[...((S=g==null?void 0:g.bottom)!=null?S:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)]}}if(a==="top"){var j,b;return{top:[...((j=g==null?void 0:g.top)!=null?j:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)],bottom:((b=g==null?void 0:g.bottom)!=null?b:[]).filter(N=>!(m!=null&&m.has(N)))}}return{top:((x=g==null?void 0:g.top)!=null?x:[]).filter(N=>!(m!=null&&m.has(N))),bottom:((v=g==null?void 0:g.bottom)!=null?v:[]).filter(N=>!(m!=null&&m.has(N)))}})},n.getCanPin=()=>{var a;const{enableRowPinning:o,enablePinning:c}=l.options;return typeof o=="function"?o(n):(a=o??c)!=null?a:!0},n.getIsPinned=()=>{const a=[n.id],{top:o,bottom:c}=l.getState().rowPinning,d=a.some(m=>o==null?void 0:o.includes(m)),h=a.some(m=>c==null?void 0:c.includes(m));return d?"top":h?"bottom":!1},n.getPinnedIndex=()=>{var a,o;const c=n.getIsPinned();if(!c)return-1;const d=(a=c==="top"?l.getTopRows():l.getBottomRows())==null?void 0:a.map(h=>{let{id:m}=h;return m});return(o=d==null?void 0:d.indexOf(n.id))!=null?o:-1}},createTable:n=>{n.setRowPinning=l=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(l),n.resetRowPinning=l=>{var a,o;return n.setRowPinning(l?Zh():(a=(o=n.initialState)==null?void 0:o.rowPinning)!=null?a:Zh())},n.getIsSomeRowsPinned=l=>{var a;const o=n.getState().rowPinning;if(!l){var c,d;return!!((c=o.top)!=null&&c.length||(d=o.bottom)!=null&&d.length)}return!!((a=o[l])!=null&&a.length)},n._getPinnedRows=(l,a,o)=>{var c;return((c=n.options.keepPinnedRows)==null||c?(a??[]).map(h=>{const m=n.getRow(h,!0);return m.getIsAllParentsExpanded()?m:null}):(a??[]).map(h=>l.find(m=>m.id===h))).filter(Boolean).map(h=>({...h,position:o}))},n.getTopRows=Me(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(l,a)=>n._getPinnedRows(l,a,"top"),Ee(n.options,"debugRows")),n.getBottomRows=Me(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(l,a)=>n._getPinnedRows(l,a,"bottom"),Ee(n.options,"debugRows")),n.getCenterRows=Me(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(l,a,o)=>{const c=new Set([...a??[],...o??[]]);return l.filter(d=>!c.has(d.id))},Ee(n.options,"debugRows"))}},FE={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:Dn("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=l=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(l),n.resetRowSelection=l=>{var a;return n.setRowSelection(l?{}:(a=n.initialState.rowSelection)!=null?a:{})},n.toggleAllRowsSelected=l=>{n.setRowSelection(a=>{l=typeof l<"u"?l:!n.getIsAllRowsSelected();const o={...a},c=n.getPreGroupedRowModel().flatRows;return l?c.forEach(d=>{d.getCanSelect()&&(o[d.id]=!0)}):c.forEach(d=>{delete o[d.id]}),o})},n.toggleAllPageRowsSelected=l=>n.setRowSelection(a=>{const o=typeof l<"u"?l:!n.getIsAllPageRowsSelected(),c={...a};return n.getRowModel().rows.forEach(d=>{Pm(c,d.id,o,!0,n)}),c}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=Me(()=>[n.getState().rowSelection,n.getCoreRowModel()],(l,a)=>Object.keys(l).length?Jh(n,a):{rows:[],flatRows:[],rowsById:{}},Ee(n.options,"debugTable")),n.getFilteredSelectedRowModel=Me(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(l,a)=>Object.keys(l).length?Jh(n,a):{rows:[],flatRows:[],rowsById:{}},Ee(n.options,"debugTable")),n.getGroupedSelectedRowModel=Me(()=>[n.getState().rowSelection,n.getSortedRowModel()],(l,a)=>Object.keys(l).length?Jh(n,a):{rows:[],flatRows:[],rowsById:{}},Ee(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const l=n.getFilteredRowModel().flatRows,{rowSelection:a}=n.getState();let o=!!(l.length&&Object.keys(a).length);return o&&l.some(c=>c.getCanSelect()&&!a[c.id])&&(o=!1),o},n.getIsAllPageRowsSelected=()=>{const l=n.getPaginationRowModel().flatRows.filter(c=>c.getCanSelect()),{rowSelection:a}=n.getState();let o=!!l.length;return o&&l.some(c=>!a[c.id])&&(o=!1),o},n.getIsSomeRowsSelected=()=>{var l;const a=Object.keys((l=n.getState().rowSelection)!=null?l:{}).length;return a>0&&a<n.getFilteredRowModel().flatRows.length},n.getIsSomePageRowsSelected=()=>{const l=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:l.filter(a=>a.getCanSelect()).some(a=>a.getIsSelected()||a.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>l=>{n.toggleAllRowsSelected(l.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>l=>{n.toggleAllPageRowsSelected(l.target.checked)}},createRow:(n,l)=>{n.toggleSelected=(a,o)=>{const c=n.getIsSelected();l.setRowSelection(d=>{var h;if(a=typeof a<"u"?a:!c,n.getCanSelect()&&c===a)return d;const m={...d};return Pm(m,n.id,a,(h=o==null?void 0:o.selectChildren)!=null?h:!0,l),m})},n.getIsSelected=()=>{const{rowSelection:a}=l.getState();return vg(n,a)},n.getIsSomeSelected=()=>{const{rowSelection:a}=l.getState();return Xm(n,a)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:a}=l.getState();return Xm(n,a)==="all"},n.getCanSelect=()=>{var a;return typeof l.options.enableRowSelection=="function"?l.options.enableRowSelection(n):(a=l.options.enableRowSelection)!=null?a:!0},n.getCanSelectSubRows=()=>{var a;return typeof l.options.enableSubRowSelection=="function"?l.options.enableSubRowSelection(n):(a=l.options.enableSubRowSelection)!=null?a:!0},n.getCanMultiSelect=()=>{var a;return typeof l.options.enableMultiRowSelection=="function"?l.options.enableMultiRowSelection(n):(a=l.options.enableMultiRowSelection)!=null?a:!0},n.getToggleSelectedHandler=()=>{const a=n.getCanSelect();return o=>{var c;a&&n.toggleSelected((c=o.target)==null?void 0:c.checked)}}}},Pm=(n,l,a,o,c)=>{var d;const h=c.getRow(l,!0);a?(h.getCanMultiSelect()||Object.keys(n).forEach(m=>delete n[m]),h.getCanSelect()&&(n[l]=!0)):delete n[l],o&&(d=h.subRows)!=null&&d.length&&h.getCanSelectSubRows()&&h.subRows.forEach(m=>Pm(n,m.id,a,o,c))};function Jh(n,l){const a=n.getState().rowSelection,o=[],c={},d=function(h,m){return h.map(g=>{var x;const v=vg(g,a);if(v&&(o.push(g),c[g.id]=g),(x=g.subRows)!=null&&x.length&&(g={...g,subRows:d(g.subRows)}),v)return g}).filter(Boolean)};return{rows:d(l.rows),flatRows:o,rowsById:c}}function vg(n,l){var a;return(a=l[n.id])!=null?a:!1}function Xm(n,l,a){var o;if(!((o=n.subRows)!=null&&o.length))return!1;let c=!0,d=!1;return n.subRows.forEach(h=>{if(!(d&&!c)&&(h.getCanSelect()&&(vg(h,l)?d=!0:c=!1),h.subRows&&h.subRows.length)){const m=Xm(h,l);m==="all"?d=!0:(m==="some"&&(d=!0),c=!1)}}),c?"all":d?"some":!1}const Km=/([0-9]+)/gm,VE=(n,l,a)=>ES(Gl(n.getValue(a)).toLowerCase(),Gl(l.getValue(a)).toLowerCase()),BE=(n,l,a)=>ES(Gl(n.getValue(a)),Gl(l.getValue(a))),GE=(n,l,a)=>xg(Gl(n.getValue(a)).toLowerCase(),Gl(l.getValue(a)).toLowerCase()),qE=(n,l,a)=>xg(Gl(n.getValue(a)),Gl(l.getValue(a))),IE=(n,l,a)=>{const o=n.getValue(a),c=l.getValue(a);return o>c?1:o<c?-1:0},QE=(n,l,a)=>xg(n.getValue(a),l.getValue(a));function xg(n,l){return n===l?0:n>l?1:-1}function Gl(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function ES(n,l){const a=n.split(Km).filter(Boolean),o=l.split(Km).filter(Boolean);for(;a.length&&o.length;){const c=a.shift(),d=o.shift(),h=parseInt(c,10),m=parseInt(d,10),g=[h,m].sort();if(isNaN(g[0])){if(c>d)return 1;if(d>c)return-1;continue}if(isNaN(g[1]))return isNaN(h)?-1:1;if(h>m)return 1;if(m>h)return-1}return a.length-o.length}const gr={alphanumeric:VE,alphanumericCaseSensitive:BE,text:GE,textCaseSensitive:qE,datetime:IE,basic:QE},YE={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:Dn("sorting",n),isMultiSortEvent:l=>l.shiftKey}),createColumn:(n,l)=>{n.getAutoSortingFn=()=>{const a=l.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const c of a){const d=c==null?void 0:c.getValue(n.id);if(Object.prototype.toString.call(d)==="[object Date]")return gr.datetime;if(typeof d=="string"&&(o=!0,d.split(Km).length>1))return gr.alphanumeric}return o?gr.text:gr.basic},n.getAutoSortDir=()=>{const a=l.getFilteredRowModel().flatRows[0];return typeof(a==null?void 0:a.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var a,o;if(!n)throw new Error;return Xu(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(a=(o=l.options.sortingFns)==null?void 0:o[n.columnDef.sortingFn])!=null?a:gr[n.columnDef.sortingFn]},n.toggleSorting=(a,o)=>{const c=n.getNextSortingOrder(),d=typeof a<"u"&&a!==null;l.setSorting(h=>{const m=h==null?void 0:h.find(j=>j.id===n.id),g=h==null?void 0:h.findIndex(j=>j.id===n.id);let x=[],v,y=d?a:c==="desc";if(h!=null&&h.length&&n.getCanMultiSort()&&o?m?v="toggle":v="add":h!=null&&h.length&&g!==h.length-1?v="replace":m?v="toggle":v="replace",v==="toggle"&&(d||c||(v="remove")),v==="add"){var S;x=[...h,{id:n.id,desc:y}],x.splice(0,x.length-((S=l.options.maxMultiSortColCount)!=null?S:Number.MAX_SAFE_INTEGER))}else v==="toggle"?x=h.map(j=>j.id===n.id?{...j,desc:y}:j):v==="remove"?x=h.filter(j=>j.id!==n.id):x=[{id:n.id,desc:y}];return x})},n.getFirstSortDir=()=>{var a,o;return((a=(o=n.columnDef.sortDescFirst)!=null?o:l.options.sortDescFirst)!=null?a:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=a=>{var o,c;const d=n.getFirstSortDir(),h=n.getIsSorted();return h?h!==d&&((o=l.options.enableSortingRemoval)==null||o)&&(!(a&&(c=l.options.enableMultiRemove)!=null)||c)?!1:h==="desc"?"asc":"desc":d},n.getCanSort=()=>{var a,o;return((a=n.columnDef.enableSorting)!=null?a:!0)&&((o=l.options.enableSorting)!=null?o:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var a,o;return(a=(o=n.columnDef.enableMultiSort)!=null?o:l.options.enableMultiSort)!=null?a:!!n.accessorFn},n.getIsSorted=()=>{var a;const o=(a=l.getState().sorting)==null?void 0:a.find(c=>c.id===n.id);return o?o.desc?"desc":"asc":!1},n.getSortIndex=()=>{var a,o;return(a=(o=l.getState().sorting)==null?void 0:o.findIndex(c=>c.id===n.id))!=null?a:-1},n.clearSorting=()=>{l.setSorting(a=>a!=null&&a.length?a.filter(o=>o.id!==n.id):[])},n.getToggleSortingHandler=()=>{const a=n.getCanSort();return o=>{a&&(o.persist==null||o.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?l.options.isMultiSortEvent==null?void 0:l.options.isMultiSortEvent(o):!1))}}},createTable:n=>{n.setSorting=l=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(l),n.resetSorting=l=>{var a,o;n.setSorting(l?[]:(a=(o=n.initialState)==null?void 0:o.sorting)!=null?a:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},PE=[mE,DE,_E,RE,pE,yE,LE,$E,YE,EE,kE,HE,UE,FE,OE];function XE(n){var l,a;const o=[...PE,...(l=n._features)!=null?l:[]];let c={_features:o};const d=c._features.reduce((S,j)=>Object.assign(S,j.getDefaultOptions==null?void 0:j.getDefaultOptions(c)),{}),h=S=>c.options.mergeOptions?c.options.mergeOptions(d,S):{...d,...S};let g={...{},...(a=n.initialState)!=null?a:{}};c._features.forEach(S=>{var j;g=(j=S.getInitialState==null?void 0:S.getInitialState(g))!=null?j:g});const x=[];let v=!1;const y={_features:o,options:{...d,...n},initialState:g,_queue:S=>{x.push(S),v||(v=!0,Promise.resolve().then(()=>{for(;x.length;)x.shift()();v=!1}).catch(j=>setTimeout(()=>{throw j})))},reset:()=>{c.setState(c.initialState)},setOptions:S=>{const j=Fl(S,c.options);c.options=h(j)},getState:()=>c.options.state,setState:S=>{c.options.onStateChange==null||c.options.onStateChange(S)},_getRowId:(S,j,b)=>{var N;return(N=c.options.getRowId==null?void 0:c.options.getRowId(S,j,b))!=null?N:`${b?[b.id,j].join("."):j}`},getCoreRowModel:()=>(c._getCoreRowModel||(c._getCoreRowModel=c.options.getCoreRowModel(c)),c._getCoreRowModel()),getRowModel:()=>c.getPaginationRowModel(),getRow:(S,j)=>{let b=(j?c.getPrePaginationRowModel():c.getRowModel()).rowsById[S];if(!b&&(b=c.getCoreRowModel().rowsById[S],!b))throw new Error;return b},_getDefaultColumnDef:Me(()=>[c.options.defaultColumn],S=>{var j;return S=(j=S)!=null?j:{},{header:b=>{const N=b.header.column.columnDef;return N.accessorKey?N.accessorKey:N.accessorFn?N.id:null},cell:b=>{var N,T;return(N=(T=b.renderValue())==null||T.toString==null?void 0:T.toString())!=null?N:null},...c._features.reduce((b,N)=>Object.assign(b,N.getDefaultColumnDef==null?void 0:N.getDefaultColumnDef()),{}),...S}},Ee(n,"debugColumns")),_getColumnDefs:()=>c.options.columns,getAllColumns:Me(()=>[c._getColumnDefs()],S=>{const j=function(b,N,T){return T===void 0&&(T=0),b.map(O=>{const _=hE(c,O,T,N),D=O;return _.columns=D.columns?j(D.columns,_,T+1):[],_})};return j(S)},Ee(n,"debugColumns")),getAllFlatColumns:Me(()=>[c.getAllColumns()],S=>S.flatMap(j=>j.getFlatColumns()),Ee(n,"debugColumns")),_getAllFlatColumnsById:Me(()=>[c.getAllFlatColumns()],S=>S.reduce((j,b)=>(j[b.id]=b,j),{}),Ee(n,"debugColumns")),getAllLeafColumns:Me(()=>[c.getAllColumns(),c._getOrderColumnsFn()],(S,j)=>{let b=S.flatMap(N=>N.getLeafColumns());return j(b)},Ee(n,"debugColumns")),getColumn:S=>c._getAllFlatColumnsById()[S]};Object.assign(c,y);for(let S=0;S<c._features.length;S++){const j=c._features[S];j==null||j.createTable==null||j.createTable(c)}return c}function TS(){return n=>Me(()=>[n.options.data],l=>{const a={rows:[],flatRows:[],rowsById:{}},o=function(c,d,h){d===void 0&&(d=0);const m=[];for(let x=0;x<c.length;x++){const v=gE(n,n._getRowId(c[x],x,h),c[x],x,d,void 0,h==null?void 0:h.id);if(a.flatRows.push(v),a.rowsById[v.id]=v,m.push(v),n.options.getSubRows){var g;v.originalSubRows=n.options.getSubRows(c[x],x),(g=v.originalSubRows)!=null&&g.length&&(v.subRows=o(v.originalSubRows,d+1,v))}}return m};return a.rows=o(l),a},Ee(n.options,"debugTable","getRowModel",()=>n._autoResetPageIndex()))}function _S(){return n=>Me(()=>[n.getState().expanded,n.getPreExpandedRowModel(),n.options.paginateExpandedRows],(l,a,o)=>!a.rows.length||l!==!0&&!Object.keys(l??{}).length||!o?a:KE(a),Ee(n.options,"debugTable"))}function KE(n){const l=[],a=o=>{var c;l.push(o),(c=o.subRows)!=null&&c.length&&o.getIsExpanded()&&o.subRows.forEach(a)};return n.rows.forEach(a),{rows:l,flatRows:n.flatRows,rowsById:n.rowsById}}function ZE(){return n=>Me(()=>[n.getState().sorting,n.getPreSortedRowModel()],(l,a)=>{if(!a.rows.length||!(l!=null&&l.length))return a;const o=n.getState().sorting,c=[],d=o.filter(g=>{var x;return(x=n.getColumn(g.id))==null?void 0:x.getCanSort()}),h={};d.forEach(g=>{const x=n.getColumn(g.id);x&&(h[g.id]={sortUndefined:x.columnDef.sortUndefined,invertSorting:x.columnDef.invertSorting,sortingFn:x.getSortingFn()})});const m=g=>{const x=g.map(v=>({...v}));return x.sort((v,y)=>{for(let j=0;j<d.length;j+=1){var S;const b=d[j],N=h[b.id],T=N.sortUndefined,O=(S=b==null?void 0:b.desc)!=null?S:!1;let _=0;if(T){const D=v.getValue(b.id),C=y.getValue(b.id),E=D===void 0,R=C===void 0;if(E||R){if(T==="first")return E?-1:1;if(T==="last")return E?1:-1;_=E&&R?0:E?T:-T}}if(_===0&&(_=N.sortingFn(v,y,b.id)),_!==0)return O&&(_*=-1),N.invertSorting&&(_*=-1),_}return v.index-y.index}),x.forEach(v=>{var y;c.push(v),(y=v.subRows)!=null&&y.length&&(v.subRows=m(v.subRows))}),x};return{rows:m(a.rows),flatRows:c,rowsById:a.rowsById}},Ee(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/**
|
|
309
|
+
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,a==null?void 0:a.key)}return c}}function _e(n,l,a,i){return{debug:()=>{var c;return(c=n==null?void 0:n.debugAll)!=null?c:n[l]},key:!1,onChange:i}}function FM(n,l,a,i){const c=()=>{var f;return(f=d.getValue())!=null?f:n.options.renderFallbackValue},d={id:`${l.id}_${a.id}`,row:l,column:a,getValue:()=>l.getValue(i),renderValue:c,getContext:Ee(()=>[n,a,l,d],(f,m,g,y)=>({table:f,column:m,row:g,cell:y,getValue:y.getValue,renderValue:y.renderValue}),_e(n.options,"debugCells"))};return n._features.forEach(f=>{f.createCell==null||f.createCell(d,a,l,n)},{}),d}function BM(n,l,a,i){var c,d;const m={...n._getDefaultColumnDef(),...l},g=m.accessorKey;let y=(c=(d=m.id)!=null?d:g?typeof String.prototype.replaceAll=="function"?g.replaceAll(".","_"):g.replace(/\./g,"_"):void 0)!=null?c:typeof m.header=="string"?m.header:void 0,v;if(m.accessorFn?v=m.accessorFn:g&&(g.includes(".")?v=S=>{let j=S;for(const N of g.split(".")){var b;j=(b=j)==null?void 0:b[N]}return j}:v=S=>S[m.accessorKey]),!y)throw new Error;let p={id:`${String(y)}`,accessorFn:v,parent:i,depth:a,columnDef:m,columns:[],getFlatColumns:Ee(()=>[!0],()=>{var S;return[p,...(S=p.columns)==null?void 0:S.flatMap(j=>j.getFlatColumns())]},_e(n.options,"debugColumns")),getLeafColumns:Ee(()=>[n._getOrderColumnsFn()],S=>{var j;if((j=p.columns)!=null&&j.length){let b=p.columns.flatMap(N=>N.getLeafColumns());return S(b)}return[p]},_e(n.options,"debugColumns"))};for(const S of n._features)S.createColumn==null||S.createColumn(p,n);return p}const Jt="debugHeaders";function Vv(n,l,a){var i;let d={id:(i=a.id)!=null?i:l.id,column:l,index:a.index,isPlaceholder:!!a.isPlaceholder,placeholderId:a.placeholderId,depth:a.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const f=[],m=g=>{g.subHeaders&&g.subHeaders.length&&g.subHeaders.map(m),f.push(g)};return m(d),f},getContext:()=>({table:n,header:d,column:l})};return n._features.forEach(f=>{f.createHeader==null||f.createHeader(d,n)}),d}const VM={createTable:n=>{n.getHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,i,c)=>{var d,f;const m=(d=i==null?void 0:i.map(p=>a.find(S=>S.id===p)).filter(Boolean))!=null?d:[],g=(f=c==null?void 0:c.map(p=>a.find(S=>S.id===p)).filter(Boolean))!=null?f:[],y=a.filter(p=>!(i!=null&&i.includes(p.id))&&!(c!=null&&c.includes(p.id)));return Nu(l,[...m,...y,...g],n)},_e(n.options,Jt)),n.getCenterHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,i,c)=>(a=a.filter(d=>!(i!=null&&i.includes(d.id))&&!(c!=null&&c.includes(d.id))),Nu(l,a,n,"center")),_e(n.options,Jt)),n.getLeftHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(l,a,i)=>{var c;const d=(c=i==null?void 0:i.map(f=>a.find(m=>m.id===f)).filter(Boolean))!=null?c:[];return Nu(l,d,n,"left")},_e(n.options,Jt)),n.getRightHeaderGroups=Ee(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(l,a,i)=>{var c;const d=(c=i==null?void 0:i.map(f=>a.find(m=>m.id===f)).filter(Boolean))!=null?c:[];return Nu(l,d,n,"right")},_e(n.options,Jt)),n.getFooterGroups=Ee(()=>[n.getHeaderGroups()],l=>[...l].reverse(),_e(n.options,Jt)),n.getLeftFooterGroups=Ee(()=>[n.getLeftHeaderGroups()],l=>[...l].reverse(),_e(n.options,Jt)),n.getCenterFooterGroups=Ee(()=>[n.getCenterHeaderGroups()],l=>[...l].reverse(),_e(n.options,Jt)),n.getRightFooterGroups=Ee(()=>[n.getRightHeaderGroups()],l=>[...l].reverse(),_e(n.options,Jt)),n.getFlatHeaders=Ee(()=>[n.getHeaderGroups()],l=>l.map(a=>a.headers).flat(),_e(n.options,Jt)),n.getLeftFlatHeaders=Ee(()=>[n.getLeftHeaderGroups()],l=>l.map(a=>a.headers).flat(),_e(n.options,Jt)),n.getCenterFlatHeaders=Ee(()=>[n.getCenterHeaderGroups()],l=>l.map(a=>a.headers).flat(),_e(n.options,Jt)),n.getRightFlatHeaders=Ee(()=>[n.getRightHeaderGroups()],l=>l.map(a=>a.headers).flat(),_e(n.options,Jt)),n.getCenterLeafHeaders=Ee(()=>[n.getCenterFlatHeaders()],l=>l.filter(a=>{var i;return!((i=a.subHeaders)!=null&&i.length)}),_e(n.options,Jt)),n.getLeftLeafHeaders=Ee(()=>[n.getLeftFlatHeaders()],l=>l.filter(a=>{var i;return!((i=a.subHeaders)!=null&&i.length)}),_e(n.options,Jt)),n.getRightLeafHeaders=Ee(()=>[n.getRightFlatHeaders()],l=>l.filter(a=>{var i;return!((i=a.subHeaders)!=null&&i.length)}),_e(n.options,Jt)),n.getLeafHeaders=Ee(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(l,a,i)=>{var c,d,f,m,g,y;return[...(c=(d=l[0])==null?void 0:d.headers)!=null?c:[],...(f=(m=a[0])==null?void 0:m.headers)!=null?f:[],...(g=(y=i[0])==null?void 0:y.headers)!=null?g:[]].map(v=>v.getLeafHeaders()).flat()},_e(n.options,Jt))}};function Nu(n,l,a,i){var c,d;let f=0;const m=function(S,j){j===void 0&&(j=1),f=Math.max(f,j),S.filter(b=>b.getIsVisible()).forEach(b=>{var N;(N=b.columns)!=null&&N.length&&m(b.columns,j+1)},0)};m(n);let g=[];const y=(S,j)=>{const b={depth:j,id:[i,`${j}`].filter(Boolean).join("_"),headers:[]},N=[];S.forEach(E=>{const A=[...N].reverse()[0],T=E.column.depth===b.depth;let L,M=!1;if(T&&E.column.parent?L=E.column.parent:(L=E.column,M=!0),A&&(A==null?void 0:A.column)===L)A.subHeaders.push(E);else{const _=Vv(a,L,{id:[i,j,L.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:M,placeholderId:M?`${N.filter(R=>R.column===L).length}`:void 0,depth:j,index:N.length});_.subHeaders.push(E),N.push(_)}b.headers.push(E),E.headerGroup=b}),g.push(b),j>0&&y(N,j-1)},v=l.map((S,j)=>Vv(a,S,{depth:f,index:j}));y(v,f-1),g.reverse();const p=S=>S.filter(b=>b.column.getIsVisible()).map(b=>{let N=0,E=0,A=[0];b.subHeaders&&b.subHeaders.length?(A=[],p(b.subHeaders).forEach(L=>{let{colSpan:M,rowSpan:_}=L;N+=M,A.push(_)})):N=1;const T=Math.min(...A);return E=E+T,b.colSpan=N,b.rowSpan=E,{colSpan:N,rowSpan:E}});return p((c=(d=g[0])==null?void 0:d.headers)!=null?c:[]),g}const GM=(n,l,a,i,c,d,f)=>{let m={id:l,index:i,original:a,depth:c,parentId:f,_valuesCache:{},_uniqueValuesCache:{},getValue:g=>{if(m._valuesCache.hasOwnProperty(g))return m._valuesCache[g];const y=n.getColumn(g);if(y!=null&&y.accessorFn)return m._valuesCache[g]=y.accessorFn(m.original,i),m._valuesCache[g]},getUniqueValues:g=>{if(m._uniqueValuesCache.hasOwnProperty(g))return m._uniqueValuesCache[g];const y=n.getColumn(g);if(y!=null&&y.accessorFn)return y.columnDef.getUniqueValues?(m._uniqueValuesCache[g]=y.columnDef.getUniqueValues(m.original,i),m._uniqueValuesCache[g]):(m._uniqueValuesCache[g]=[m.getValue(g)],m._uniqueValuesCache[g])},renderValue:g=>{var y;return(y=m.getValue(g))!=null?y:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>UM(m.subRows,g=>g.subRows),getParentRow:()=>m.parentId?n.getRow(m.parentId,!0):void 0,getParentRows:()=>{let g=[],y=m;for(;;){const v=y.getParentRow();if(!v)break;g.push(v),y=v}return g.reverse()},getAllCells:Ee(()=>[n.getAllLeafColumns()],g=>g.map(y=>FM(n,m,y,y.id)),_e(n.options,"debugRows")),_getAllCellsByColumnId:Ee(()=>[m.getAllCells()],g=>g.reduce((y,v)=>(y[v.column.id]=v,y),{}),_e(n.options,"debugRows"))};for(let g=0;g<n._features.length;g++){const y=n._features[g];y==null||y.createRow==null||y.createRow(m,n)}return m},qM={createColumn:(n,l)=>{n._getFacetedRowModel=l.options.getFacetedRowModel&&l.options.getFacetedRowModel(l,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():l.getPreFilteredRowModel(),n._getFacetedUniqueValues=l.options.getFacetedUniqueValues&&l.options.getFacetedUniqueValues(l,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=l.options.getFacetedMinMaxValues&&l.options.getFacetedMinMaxValues(l,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},ky=(n,l,a)=>{var i,c;const d=a==null||(i=a.toString())==null?void 0:i.toLowerCase();return!!(!((c=n.getValue(l))==null||(c=c.toString())==null||(c=c.toLowerCase())==null)&&c.includes(d))};ky.autoRemove=n=>ns(n);const Ly=(n,l,a)=>{var i;return!!(!((i=n.getValue(l))==null||(i=i.toString())==null)&&i.includes(a))};Ly.autoRemove=n=>ns(n);const $y=(n,l,a)=>{var i;return((i=n.getValue(l))==null||(i=i.toString())==null?void 0:i.toLowerCase())===(a==null?void 0:a.toLowerCase())};$y.autoRemove=n=>ns(n);const Hy=(n,l,a)=>{var i;return(i=n.getValue(l))==null?void 0:i.includes(a)};Hy.autoRemove=n=>ns(n);const Uy=(n,l,a)=>!a.some(i=>{var c;return!((c=n.getValue(l))!=null&&c.includes(i))});Uy.autoRemove=n=>ns(n)||!(n!=null&&n.length);const Fy=(n,l,a)=>a.some(i=>{var c;return(c=n.getValue(l))==null?void 0:c.includes(i)});Fy.autoRemove=n=>ns(n)||!(n!=null&&n.length);const By=(n,l,a)=>n.getValue(l)===a;By.autoRemove=n=>ns(n);const Vy=(n,l,a)=>n.getValue(l)==a;Vy.autoRemove=n=>ns(n);const Mg=(n,l,a)=>{let[i,c]=a;const d=n.getValue(l);return d>=i&&d<=c};Mg.resolveFilterValue=n=>{let[l,a]=n,i=typeof l!="number"?parseFloat(l):l,c=typeof a!="number"?parseFloat(a):a,d=l===null||Number.isNaN(i)?-1/0:i,f=a===null||Number.isNaN(c)?1/0:c;if(d>f){const m=d;d=f,f=m}return[d,f]};Mg.autoRemove=n=>ns(n)||ns(n[0])&&ns(n[1]);const Ws={includesString:ky,includesStringSensitive:Ly,equalsString:$y,arrIncludes:Hy,arrIncludesAll:Uy,arrIncludesSome:Fy,equals:By,weakEquals:Vy,inNumberRange:Mg};function ns(n){return n==null||n===""}const IM={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:Dn("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,l)=>{n.getAutoFilterFn=()=>{const a=l.getCoreRowModel().flatRows[0],i=a==null?void 0:a.getValue(n.id);return typeof i=="string"?Ws.includesString:typeof i=="number"?Ws.inNumberRange:typeof i=="boolean"||i!==null&&typeof i=="object"?Ws.equals:Array.isArray(i)?Ws.arrIncludes:Ws.weakEquals},n.getFilterFn=()=>{var a,i;return td(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(a=(i=l.options.filterFns)==null?void 0:i[n.columnDef.filterFn])!=null?a:Ws[n.columnDef.filterFn]},n.getCanFilter=()=>{var a,i,c;return((a=n.columnDef.enableColumnFilter)!=null?a:!0)&&((i=l.options.enableColumnFilters)!=null?i:!0)&&((c=l.options.enableFilters)!=null?c:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var a;return(a=l.getState().columnFilters)==null||(a=a.find(i=>i.id===n.id))==null?void 0:a.value},n.getFilterIndex=()=>{var a,i;return(a=(i=l.getState().columnFilters)==null?void 0:i.findIndex(c=>c.id===n.id))!=null?a:-1},n.setFilterValue=a=>{l.setColumnFilters(i=>{const c=n.getFilterFn(),d=i==null?void 0:i.find(v=>v.id===n.id),f=Yl(a,d?d.value:void 0);if(Gv(c,f,n)){var m;return(m=i==null?void 0:i.filter(v=>v.id!==n.id))!=null?m:[]}const g={id:n.id,value:f};if(d){var y;return(y=i==null?void 0:i.map(v=>v.id===n.id?g:v))!=null?y:[]}return i!=null&&i.length?[...i,g]:[g]})}},createRow:(n,l)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=l=>{const a=n.getAllLeafColumns(),i=c=>{var d;return(d=Yl(l,c))==null?void 0:d.filter(f=>{const m=a.find(g=>g.id===f.id);if(m){const g=m.getFilterFn();if(Gv(g,f.value,m))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(i)},n.resetColumnFilters=l=>{var a,i;n.setColumnFilters(l?[]:(a=(i=n.initialState)==null?void 0:i.columnFilters)!=null?a:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function Gv(n,l,a){return(n&&n.autoRemove?n.autoRemove(l,a):!1)||typeof l>"u"||typeof l=="string"&&!l}const PM=(n,l,a)=>a.reduce((i,c)=>{const d=c.getValue(n);return i+(typeof d=="number"?d:0)},0),QM=(n,l,a)=>{let i;return a.forEach(c=>{const d=c.getValue(n);d!=null&&(i>d||i===void 0&&d>=d)&&(i=d)}),i},YM=(n,l,a)=>{let i;return a.forEach(c=>{const d=c.getValue(n);d!=null&&(i<d||i===void 0&&d>=d)&&(i=d)}),i},XM=(n,l,a)=>{let i,c;return a.forEach(d=>{const f=d.getValue(n);f!=null&&(i===void 0?f>=f&&(i=c=f):(i>f&&(i=f),c<f&&(c=f)))}),[i,c]},KM=(n,l)=>{let a=0,i=0;if(l.forEach(c=>{let d=c.getValue(n);d!=null&&(d=+d)>=d&&(++a,i+=d)}),a)return i/a},ZM=(n,l)=>{if(!l.length)return;const a=l.map(d=>d.getValue(n));if(!HM(a))return;if(a.length===1)return a[0];const i=Math.floor(a.length/2),c=a.sort((d,f)=>d-f);return a.length%2!==0?c[i]:(c[i-1]+c[i])/2},JM=(n,l)=>Array.from(new Set(l.map(a=>a.getValue(n))).values()),WM=(n,l)=>new Set(l.map(a=>a.getValue(n))).size,eE=(n,l)=>l.length,tm={sum:PM,min:QM,max:YM,extent:XM,mean:KM,median:ZM,unique:JM,uniqueCount:WM,count:eE},tE={getDefaultColumnDef:()=>({aggregatedCell:n=>{var l,a;return(l=(a=n.getValue())==null||a.toString==null?void 0:a.toString())!=null?l:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:Dn("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,l)=>{n.toggleGrouping=()=>{l.setGrouping(a=>a!=null&&a.includes(n.id)?a.filter(i=>i!==n.id):[...a??[],n.id])},n.getCanGroup=()=>{var a,i;return((a=n.columnDef.enableGrouping)!=null?a:!0)&&((i=l.options.enableGrouping)!=null?i:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var a;return(a=l.getState().grouping)==null?void 0:a.includes(n.id)},n.getGroupedIndex=()=>{var a;return(a=l.getState().grouping)==null?void 0:a.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const a=n.getCanGroup();return()=>{a&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const a=l.getCoreRowModel().flatRows[0],i=a==null?void 0:a.getValue(n.id);if(typeof i=="number")return tm.sum;if(Object.prototype.toString.call(i)==="[object Date]")return tm.extent},n.getAggregationFn=()=>{var a,i;if(!n)throw new Error;return td(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(a=(i=l.options.aggregationFns)==null?void 0:i[n.columnDef.aggregationFn])!=null?a:tm[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=l=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(l),n.resetGrouping=l=>{var a,i;n.setGrouping(l?[]:(a=(i=n.initialState)==null?void 0:i.grouping)!=null?a:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,l)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=a=>{if(n._groupingValuesCache.hasOwnProperty(a))return n._groupingValuesCache[a];const i=l.getColumn(a);return i!=null&&i.columnDef.getGroupingValue?(n._groupingValuesCache[a]=i.columnDef.getGroupingValue(n.original),n._groupingValuesCache[a]):n.getValue(a)},n._groupingValuesCache={}},createCell:(n,l,a,i)=>{n.getIsGrouped=()=>l.getIsGrouped()&&l.id===a.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&l.getIsGrouped(),n.getIsAggregated=()=>{var c;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((c=a.subRows)!=null&&c.length)}}};function nE(n,l,a){if(!(l!=null&&l.length)||!a)return n;const i=n.filter(d=>!l.includes(d.id));return a==="remove"?i:[...l.map(d=>n.find(f=>f.id===d)).filter(Boolean),...i]}const sE={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:Dn("columnOrder",n)}),createColumn:(n,l)=>{n.getIndex=Ee(a=>[Or(l,a)],a=>a.findIndex(i=>i.id===n.id),_e(l.options,"debugColumns")),n.getIsFirstColumn=a=>{var i;return((i=Or(l,a)[0])==null?void 0:i.id)===n.id},n.getIsLastColumn=a=>{var i;const c=Or(l,a);return((i=c[c.length-1])==null?void 0:i.id)===n.id}},createTable:n=>{n.setColumnOrder=l=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(l),n.resetColumnOrder=l=>{var a;n.setColumnOrder(l?[]:(a=n.initialState.columnOrder)!=null?a:[])},n._getOrderColumnsFn=Ee(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(l,a,i)=>c=>{let d=[];if(!(l!=null&&l.length))d=c;else{const f=[...l],m=[...c];for(;m.length&&f.length;){const g=f.shift(),y=m.findIndex(v=>v.id===g);y>-1&&d.push(m.splice(y,1)[0])}d=[...d,...m]}return nE(d,a,i)},_e(n.options,"debugTable"))}},nm=()=>({left:[],right:[]}),lE={getInitialState:n=>({columnPinning:nm(),...n}),getDefaultOptions:n=>({onColumnPinningChange:Dn("columnPinning",n)}),createColumn:(n,l)=>{n.pin=a=>{const i=n.getLeafColumns().map(c=>c.id).filter(Boolean);l.setColumnPinning(c=>{var d,f;if(a==="right"){var m,g;return{left:((m=c==null?void 0:c.left)!=null?m:[]).filter(p=>!(i!=null&&i.includes(p))),right:[...((g=c==null?void 0:c.right)!=null?g:[]).filter(p=>!(i!=null&&i.includes(p))),...i]}}if(a==="left"){var y,v;return{left:[...((y=c==null?void 0:c.left)!=null?y:[]).filter(p=>!(i!=null&&i.includes(p))),...i],right:((v=c==null?void 0:c.right)!=null?v:[]).filter(p=>!(i!=null&&i.includes(p)))}}return{left:((d=c==null?void 0:c.left)!=null?d:[]).filter(p=>!(i!=null&&i.includes(p))),right:((f=c==null?void 0:c.right)!=null?f:[]).filter(p=>!(i!=null&&i.includes(p)))}})},n.getCanPin=()=>n.getLeafColumns().some(i=>{var c,d,f;return((c=i.columnDef.enablePinning)!=null?c:!0)&&((d=(f=l.options.enableColumnPinning)!=null?f:l.options.enablePinning)!=null?d:!0)}),n.getIsPinned=()=>{const a=n.getLeafColumns().map(m=>m.id),{left:i,right:c}=l.getState().columnPinning,d=a.some(m=>i==null?void 0:i.includes(m)),f=a.some(m=>c==null?void 0:c.includes(m));return d?"left":f?"right":!1},n.getPinnedIndex=()=>{var a,i;const c=n.getIsPinned();return c?(a=(i=l.getState().columnPinning)==null||(i=i[c])==null?void 0:i.indexOf(n.id))!=null?a:-1:0}},createRow:(n,l)=>{n.getCenterVisibleCells=Ee(()=>[n._getAllVisibleCells(),l.getState().columnPinning.left,l.getState().columnPinning.right],(a,i,c)=>{const d=[...i??[],...c??[]];return a.filter(f=>!d.includes(f.column.id))},_e(l.options,"debugRows")),n.getLeftVisibleCells=Ee(()=>[n._getAllVisibleCells(),l.getState().columnPinning.left],(a,i)=>(i??[]).map(d=>a.find(f=>f.column.id===d)).filter(Boolean).map(d=>({...d,position:"left"})),_e(l.options,"debugRows")),n.getRightVisibleCells=Ee(()=>[n._getAllVisibleCells(),l.getState().columnPinning.right],(a,i)=>(i??[]).map(d=>a.find(f=>f.column.id===d)).filter(Boolean).map(d=>({...d,position:"right"})),_e(l.options,"debugRows"))},createTable:n=>{n.setColumnPinning=l=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(l),n.resetColumnPinning=l=>{var a,i;return n.setColumnPinning(l?nm():(a=(i=n.initialState)==null?void 0:i.columnPinning)!=null?a:nm())},n.getIsSomeColumnsPinned=l=>{var a;const i=n.getState().columnPinning;if(!l){var c,d;return!!((c=i.left)!=null&&c.length||(d=i.right)!=null&&d.length)}return!!((a=i[l])!=null&&a.length)},n.getLeftLeafColumns=Ee(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(l,a)=>(a??[]).map(i=>l.find(c=>c.id===i)).filter(Boolean),_e(n.options,"debugColumns")),n.getRightLeafColumns=Ee(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(l,a)=>(a??[]).map(i=>l.find(c=>c.id===i)).filter(Boolean),_e(n.options,"debugColumns")),n.getCenterLeafColumns=Ee(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(l,a,i)=>{const c=[...a??[],...i??[]];return l.filter(d=>!c.includes(d.id))},_e(n.options,"debugColumns"))}};function aE(n){return n||(typeof document<"u"?document:null)}const Cu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},sm=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),iE={getDefaultColumnDef:()=>Cu,getInitialState:n=>({columnSizing:{},columnSizingInfo:sm(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Dn("columnSizing",n),onColumnSizingInfoChange:Dn("columnSizingInfo",n)}),createColumn:(n,l)=>{n.getSize=()=>{var a,i,c;const d=l.getState().columnSizing[n.id];return Math.min(Math.max((a=n.columnDef.minSize)!=null?a:Cu.minSize,(i=d??n.columnDef.size)!=null?i:Cu.size),(c=n.columnDef.maxSize)!=null?c:Cu.maxSize)},n.getStart=Ee(a=>[a,Or(l,a),l.getState().columnSizing],(a,i)=>i.slice(0,n.getIndex(a)).reduce((c,d)=>c+d.getSize(),0),_e(l.options,"debugColumns")),n.getAfter=Ee(a=>[a,Or(l,a),l.getState().columnSizing],(a,i)=>i.slice(n.getIndex(a)+1).reduce((c,d)=>c+d.getSize(),0),_e(l.options,"debugColumns")),n.resetSize=()=>{l.setColumnSizing(a=>{let{[n.id]:i,...c}=a;return c})},n.getCanResize=()=>{var a,i;return((a=n.columnDef.enableResizing)!=null?a:!0)&&((i=l.options.enableColumnResizing)!=null?i:!0)},n.getIsResizing=()=>l.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,l)=>{n.getSize=()=>{let a=0;const i=c=>{if(c.subHeaders.length)c.subHeaders.forEach(i);else{var d;a+=(d=c.column.getSize())!=null?d:0}};return i(n),a},n.getStart=()=>{if(n.index>0){const a=n.headerGroup.headers[n.index-1];return a.getStart()+a.getSize()}return 0},n.getResizeHandler=a=>{const i=l.getColumn(n.column.id),c=i==null?void 0:i.getCanResize();return d=>{if(!i||!c||(d.persist==null||d.persist(),lm(d)&&d.touches&&d.touches.length>1))return;const f=n.getSize(),m=n?n.getLeafHeaders().map(A=>[A.column.id,A.column.getSize()]):[[i.id,i.getSize()]],g=lm(d)?Math.round(d.touches[0].clientX):d.clientX,y={},v=(A,T)=>{typeof T=="number"&&(l.setColumnSizingInfo(L=>{var M,_;const R=l.options.columnResizeDirection==="rtl"?-1:1,k=(T-((M=L==null?void 0:L.startOffset)!=null?M:0))*R,I=Math.max(k/((_=L==null?void 0:L.startSize)!=null?_:0),-.999999);return L.columnSizingStart.forEach(K=>{let[O,se]=K;y[O]=Math.round(Math.max(se+se*I,0)*100)/100}),{...L,deltaOffset:k,deltaPercentage:I}}),(l.options.columnResizeMode==="onChange"||A==="end")&&l.setColumnSizing(L=>({...L,...y})))},p=A=>v("move",A),S=A=>{v("end",A),l.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},j=aE(a),b={moveHandler:A=>p(A.clientX),upHandler:A=>{j==null||j.removeEventListener("mousemove",b.moveHandler),j==null||j.removeEventListener("mouseup",b.upHandler),S(A.clientX)}},N={moveHandler:A=>(A.cancelable&&(A.preventDefault(),A.stopPropagation()),p(A.touches[0].clientX),!1),upHandler:A=>{var T;j==null||j.removeEventListener("touchmove",N.moveHandler),j==null||j.removeEventListener("touchend",N.upHandler),A.cancelable&&(A.preventDefault(),A.stopPropagation()),S((T=A.touches[0])==null?void 0:T.clientX)}},E=oE()?{passive:!1}:!1;lm(d)?(j==null||j.addEventListener("touchmove",N.moveHandler,E),j==null||j.addEventListener("touchend",N.upHandler,E)):(j==null||j.addEventListener("mousemove",b.moveHandler,E),j==null||j.addEventListener("mouseup",b.upHandler,E)),l.setColumnSizingInfo(A=>({...A,startOffset:g,startSize:f,deltaOffset:0,deltaPercentage:0,columnSizingStart:m,isResizingColumn:i.id}))}}},createTable:n=>{n.setColumnSizing=l=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(l),n.setColumnSizingInfo=l=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(l),n.resetColumnSizing=l=>{var a;n.setColumnSizing(l?{}:(a=n.initialState.columnSizing)!=null?a:{})},n.resetHeaderSizeInfo=l=>{var a;n.setColumnSizingInfo(l?sm():(a=n.initialState.columnSizingInfo)!=null?a:sm())},n.getTotalSize=()=>{var l,a;return(l=(a=n.getHeaderGroups()[0])==null?void 0:a.headers.reduce((i,c)=>i+c.getSize(),0))!=null?l:0},n.getLeftTotalSize=()=>{var l,a;return(l=(a=n.getLeftHeaderGroups()[0])==null?void 0:a.headers.reduce((i,c)=>i+c.getSize(),0))!=null?l:0},n.getCenterTotalSize=()=>{var l,a;return(l=(a=n.getCenterHeaderGroups()[0])==null?void 0:a.headers.reduce((i,c)=>i+c.getSize(),0))!=null?l:0},n.getRightTotalSize=()=>{var l,a;return(l=(a=n.getRightHeaderGroups()[0])==null?void 0:a.headers.reduce((i,c)=>i+c.getSize(),0))!=null?l:0}}};let Mu=null;function oE(){if(typeof Mu=="boolean")return Mu;let n=!1;try{const l={get passive(){return n=!0,!1}},a=()=>{};window.addEventListener("test",a,l),window.removeEventListener("test",a)}catch{n=!1}return Mu=n,Mu}function lm(n){return n.type==="touchstart"}const rE={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:Dn("columnVisibility",n)}),createColumn:(n,l)=>{n.toggleVisibility=a=>{n.getCanHide()&&l.setColumnVisibility(i=>({...i,[n.id]:a??!n.getIsVisible()}))},n.getIsVisible=()=>{var a,i;const c=n.columns;return(a=c.length?c.some(d=>d.getIsVisible()):(i=l.getState().columnVisibility)==null?void 0:i[n.id])!=null?a:!0},n.getCanHide=()=>{var a,i;return((a=n.columnDef.enableHiding)!=null?a:!0)&&((i=l.options.enableHiding)!=null?i:!0)},n.getToggleVisibilityHandler=()=>a=>{n.toggleVisibility==null||n.toggleVisibility(a.target.checked)}},createRow:(n,l)=>{n._getAllVisibleCells=Ee(()=>[n.getAllCells(),l.getState().columnVisibility],a=>a.filter(i=>i.column.getIsVisible()),_e(l.options,"debugRows")),n.getVisibleCells=Ee(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(a,i,c)=>[...a,...i,...c],_e(l.options,"debugRows"))},createTable:n=>{const l=(a,i)=>Ee(()=>[i(),i().filter(c=>c.getIsVisible()).map(c=>c.id).join("_")],c=>c.filter(d=>d.getIsVisible==null?void 0:d.getIsVisible()),_e(n.options,"debugColumns"));n.getVisibleFlatColumns=l("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=l("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=l("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=l("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=l("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=a=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(a),n.resetColumnVisibility=a=>{var i;n.setColumnVisibility(a?{}:(i=n.initialState.columnVisibility)!=null?i:{})},n.toggleAllColumnsVisible=a=>{var i;a=(i=a)!=null?i:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((c,d)=>({...c,[d.id]:a||!(d.getCanHide!=null&&d.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(a=>!(a.getIsVisible!=null&&a.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(a=>a.getIsVisible==null?void 0:a.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>a=>{var i;n.toggleAllColumnsVisible((i=a.target)==null?void 0:i.checked)}}};function Or(n,l){return l?l==="center"?n.getCenterVisibleLeafColumns():l==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const cE={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},uE={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:Dn("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:l=>{var a;const i=(a=n.getCoreRowModel().flatRows[0])==null||(a=a._getAllCellsByColumnId()[l.id])==null?void 0:a.getValue();return typeof i=="string"||typeof i=="number"}}),createColumn:(n,l)=>{n.getCanGlobalFilter=()=>{var a,i,c,d;return((a=n.columnDef.enableGlobalFilter)!=null?a:!0)&&((i=l.options.enableGlobalFilter)!=null?i:!0)&&((c=l.options.enableFilters)!=null?c:!0)&&((d=l.options.getColumnCanGlobalFilter==null?void 0:l.options.getColumnCanGlobalFilter(n))!=null?d:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>Ws.includesString,n.getGlobalFilterFn=()=>{var l,a;const{globalFilterFn:i}=n.options;return td(i)?i:i==="auto"?n.getGlobalAutoFilterFn():(l=(a=n.options.filterFns)==null?void 0:a[i])!=null?l:Ws[i]},n.setGlobalFilter=l=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(l)},n.resetGlobalFilter=l=>{n.setGlobalFilter(l?void 0:n.initialState.globalFilter)}}},dE={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:Dn("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let l=!1,a=!1;n._autoResetExpanded=()=>{var i,c;if(!l){n._queue(()=>{l=!0});return}if((i=(c=n.options.autoResetAll)!=null?c:n.options.autoResetExpanded)!=null?i:!n.options.manualExpanding){if(a)return;a=!0,n._queue(()=>{n.resetExpanded(),a=!1})}},n.setExpanded=i=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(i),n.toggleAllRowsExpanded=i=>{i??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=i=>{var c,d;n.setExpanded(i?{}:(c=(d=n.initialState)==null?void 0:d.expanded)!=null?c:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(i=>i.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>i=>{i.persist==null||i.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const i=n.getState().expanded;return i===!0||Object.values(i).some(Boolean)},n.getIsAllRowsExpanded=()=>{const i=n.getState().expanded;return typeof i=="boolean"?i===!0:!(!Object.keys(i).length||n.getRowModel().flatRows.some(c=>!c.getIsExpanded()))},n.getExpandedDepth=()=>{let i=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(d=>{const f=d.split(".");i=Math.max(i,f.length)}),i},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,l)=>{n.toggleExpanded=a=>{l.setExpanded(i=>{var c;const d=i===!0?!0:!!(i!=null&&i[n.id]);let f={};if(i===!0?Object.keys(l.getRowModel().rowsById).forEach(m=>{f[m]=!0}):f=i,a=(c=a)!=null?c:!d,!d&&a)return{...f,[n.id]:!0};if(d&&!a){const{[n.id]:m,...g}=f;return g}return i})},n.getIsExpanded=()=>{var a;const i=l.getState().expanded;return!!((a=l.options.getIsRowExpanded==null?void 0:l.options.getIsRowExpanded(n))!=null?a:i===!0||i!=null&&i[n.id])},n.getCanExpand=()=>{var a,i,c;return(a=l.options.getRowCanExpand==null?void 0:l.options.getRowCanExpand(n))!=null?a:((i=l.options.enableExpanding)!=null?i:!0)&&!!((c=n.subRows)!=null&&c.length)},n.getIsAllParentsExpanded=()=>{let a=!0,i=n;for(;a&&i.parentId;)i=l.getRow(i.parentId,!0),a=i.getIsExpanded();return a},n.getToggleExpandedHandler=()=>{const a=n.getCanExpand();return()=>{a&&n.toggleExpanded()}}}},sg=0,lg=10,am=()=>({pageIndex:sg,pageSize:lg}),hE={getInitialState:n=>({...n,pagination:{...am(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:Dn("pagination",n)}),createTable:n=>{let l=!1,a=!1;n._autoResetPageIndex=()=>{var i,c;if(!l){n._queue(()=>{l=!0});return}if((i=(c=n.options.autoResetAll)!=null?c:n.options.autoResetPageIndex)!=null?i:!n.options.manualPagination){if(a)return;a=!0,n._queue(()=>{n.resetPageIndex(),a=!1})}},n.setPagination=i=>{const c=d=>Yl(i,d);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(c)},n.resetPagination=i=>{var c;n.setPagination(i?am():(c=n.initialState.pagination)!=null?c:am())},n.setPageIndex=i=>{n.setPagination(c=>{let d=Yl(i,c.pageIndex);const f=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return d=Math.max(0,Math.min(d,f)),{...c,pageIndex:d}})},n.resetPageIndex=i=>{var c,d;n.setPageIndex(i?sg:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageIndex)!=null?c:sg)},n.resetPageSize=i=>{var c,d;n.setPageSize(i?lg:(c=(d=n.initialState)==null||(d=d.pagination)==null?void 0:d.pageSize)!=null?c:lg)},n.setPageSize=i=>{n.setPagination(c=>{const d=Math.max(1,Yl(i,c.pageSize)),f=c.pageSize*c.pageIndex,m=Math.floor(f/d);return{...c,pageIndex:m,pageSize:d}})},n.setPageCount=i=>n.setPagination(c=>{var d;let f=Yl(i,(d=n.options.pageCount)!=null?d:-1);return typeof f=="number"&&(f=Math.max(-1,f)),{...c,pageCount:f}}),n.getPageOptions=Ee(()=>[n.getPageCount()],i=>{let c=[];return i&&i>0&&(c=[...new Array(i)].fill(null).map((d,f)=>f)),c},_e(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:i}=n.getState().pagination,c=n.getPageCount();return c===-1?!0:c===0?!1:i<c-1},n.previousPage=()=>n.setPageIndex(i=>i-1),n.nextPage=()=>n.setPageIndex(i=>i+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var i;return(i=n.options.pageCount)!=null?i:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var i;return(i=n.options.rowCount)!=null?i:n.getPrePaginationRowModel().rows.length}}},im=()=>({top:[],bottom:[]}),fE={getInitialState:n=>({rowPinning:im(),...n}),getDefaultOptions:n=>({onRowPinningChange:Dn("rowPinning",n)}),createRow:(n,l)=>{n.pin=(a,i,c)=>{const d=i?n.getLeafRows().map(g=>{let{id:y}=g;return y}):[],f=c?n.getParentRows().map(g=>{let{id:y}=g;return y}):[],m=new Set([...f,n.id,...d]);l.setRowPinning(g=>{var y,v;if(a==="bottom"){var p,S;return{top:((p=g==null?void 0:g.top)!=null?p:[]).filter(N=>!(m!=null&&m.has(N))),bottom:[...((S=g==null?void 0:g.bottom)!=null?S:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)]}}if(a==="top"){var j,b;return{top:[...((j=g==null?void 0:g.top)!=null?j:[]).filter(N=>!(m!=null&&m.has(N))),...Array.from(m)],bottom:((b=g==null?void 0:g.bottom)!=null?b:[]).filter(N=>!(m!=null&&m.has(N)))}}return{top:((y=g==null?void 0:g.top)!=null?y:[]).filter(N=>!(m!=null&&m.has(N))),bottom:((v=g==null?void 0:g.bottom)!=null?v:[]).filter(N=>!(m!=null&&m.has(N)))}})},n.getCanPin=()=>{var a;const{enableRowPinning:i,enablePinning:c}=l.options;return typeof i=="function"?i(n):(a=i??c)!=null?a:!0},n.getIsPinned=()=>{const a=[n.id],{top:i,bottom:c}=l.getState().rowPinning,d=a.some(m=>i==null?void 0:i.includes(m)),f=a.some(m=>c==null?void 0:c.includes(m));return d?"top":f?"bottom":!1},n.getPinnedIndex=()=>{var a,i;const c=n.getIsPinned();if(!c)return-1;const d=(a=c==="top"?l.getTopRows():l.getBottomRows())==null?void 0:a.map(f=>{let{id:m}=f;return m});return(i=d==null?void 0:d.indexOf(n.id))!=null?i:-1}},createTable:n=>{n.setRowPinning=l=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(l),n.resetRowPinning=l=>{var a,i;return n.setRowPinning(l?im():(a=(i=n.initialState)==null?void 0:i.rowPinning)!=null?a:im())},n.getIsSomeRowsPinned=l=>{var a;const i=n.getState().rowPinning;if(!l){var c,d;return!!((c=i.top)!=null&&c.length||(d=i.bottom)!=null&&d.length)}return!!((a=i[l])!=null&&a.length)},n._getPinnedRows=(l,a,i)=>{var c;return((c=n.options.keepPinnedRows)==null||c?(a??[]).map(f=>{const m=n.getRow(f,!0);return m.getIsAllParentsExpanded()?m:null}):(a??[]).map(f=>l.find(m=>m.id===f))).filter(Boolean).map(f=>({...f,position:i}))},n.getTopRows=Ee(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(l,a)=>n._getPinnedRows(l,a,"top"),_e(n.options,"debugRows")),n.getBottomRows=Ee(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(l,a)=>n._getPinnedRows(l,a,"bottom"),_e(n.options,"debugRows")),n.getCenterRows=Ee(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(l,a,i)=>{const c=new Set([...a??[],...i??[]]);return l.filter(d=>!c.has(d.id))},_e(n.options,"debugRows"))}},mE={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:Dn("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=l=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(l),n.resetRowSelection=l=>{var a;return n.setRowSelection(l?{}:(a=n.initialState.rowSelection)!=null?a:{})},n.toggleAllRowsSelected=l=>{n.setRowSelection(a=>{l=typeof l<"u"?l:!n.getIsAllRowsSelected();const i={...a},c=n.getPreGroupedRowModel().flatRows;return l?c.forEach(d=>{d.getCanSelect()&&(i[d.id]=!0)}):c.forEach(d=>{delete i[d.id]}),i})},n.toggleAllPageRowsSelected=l=>n.setRowSelection(a=>{const i=typeof l<"u"?l:!n.getIsAllPageRowsSelected(),c={...a};return n.getRowModel().rows.forEach(d=>{ag(c,d.id,i,!0,n)}),c}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=Ee(()=>[n.getState().rowSelection,n.getCoreRowModel()],(l,a)=>Object.keys(l).length?om(n,a):{rows:[],flatRows:[],rowsById:{}},_e(n.options,"debugTable")),n.getFilteredSelectedRowModel=Ee(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(l,a)=>Object.keys(l).length?om(n,a):{rows:[],flatRows:[],rowsById:{}},_e(n.options,"debugTable")),n.getGroupedSelectedRowModel=Ee(()=>[n.getState().rowSelection,n.getSortedRowModel()],(l,a)=>Object.keys(l).length?om(n,a):{rows:[],flatRows:[],rowsById:{}},_e(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const l=n.getFilteredRowModel().flatRows,{rowSelection:a}=n.getState();let i=!!(l.length&&Object.keys(a).length);return i&&l.some(c=>c.getCanSelect()&&!a[c.id])&&(i=!1),i},n.getIsAllPageRowsSelected=()=>{const l=n.getPaginationRowModel().flatRows.filter(c=>c.getCanSelect()),{rowSelection:a}=n.getState();let i=!!l.length;return i&&l.some(c=>!a[c.id])&&(i=!1),i},n.getIsSomeRowsSelected=()=>{var l;const a=Object.keys((l=n.getState().rowSelection)!=null?l:{}).length;return a>0&&a<n.getFilteredRowModel().flatRows.length},n.getIsSomePageRowsSelected=()=>{const l=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:l.filter(a=>a.getCanSelect()).some(a=>a.getIsSelected()||a.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>l=>{n.toggleAllRowsSelected(l.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>l=>{n.toggleAllPageRowsSelected(l.target.checked)}},createRow:(n,l)=>{n.toggleSelected=(a,i)=>{const c=n.getIsSelected();l.setRowSelection(d=>{var f;if(a=typeof a<"u"?a:!c,n.getCanSelect()&&c===a)return d;const m={...d};return ag(m,n.id,a,(f=i==null?void 0:i.selectChildren)!=null?f:!0,l),m})},n.getIsSelected=()=>{const{rowSelection:a}=l.getState();return Eg(n,a)},n.getIsSomeSelected=()=>{const{rowSelection:a}=l.getState();return ig(n,a)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:a}=l.getState();return ig(n,a)==="all"},n.getCanSelect=()=>{var a;return typeof l.options.enableRowSelection=="function"?l.options.enableRowSelection(n):(a=l.options.enableRowSelection)!=null?a:!0},n.getCanSelectSubRows=()=>{var a;return typeof l.options.enableSubRowSelection=="function"?l.options.enableSubRowSelection(n):(a=l.options.enableSubRowSelection)!=null?a:!0},n.getCanMultiSelect=()=>{var a;return typeof l.options.enableMultiRowSelection=="function"?l.options.enableMultiRowSelection(n):(a=l.options.enableMultiRowSelection)!=null?a:!0},n.getToggleSelectedHandler=()=>{const a=n.getCanSelect();return i=>{var c;a&&n.toggleSelected((c=i.target)==null?void 0:c.checked)}}}},ag=(n,l,a,i,c)=>{var d;const f=c.getRow(l,!0);a?(f.getCanMultiSelect()||Object.keys(n).forEach(m=>delete n[m]),f.getCanSelect()&&(n[l]=!0)):delete n[l],i&&(d=f.subRows)!=null&&d.length&&f.getCanSelectSubRows()&&f.subRows.forEach(m=>ag(n,m.id,a,i,c))};function om(n,l){const a=n.getState().rowSelection,i=[],c={},d=function(f,m){return f.map(g=>{var y;const v=Eg(g,a);if(v&&(i.push(g),c[g.id]=g),(y=g.subRows)!=null&&y.length&&(g={...g,subRows:d(g.subRows)}),v)return g}).filter(Boolean)};return{rows:d(l.rows),flatRows:i,rowsById:c}}function Eg(n,l){var a;return(a=l[n.id])!=null?a:!1}function ig(n,l,a){var i;if(!((i=n.subRows)!=null&&i.length))return!1;let c=!0,d=!1;return n.subRows.forEach(f=>{if(!(d&&!c)&&(f.getCanSelect()&&(Eg(f,l)?d=!0:c=!1),f.subRows&&f.subRows.length)){const m=ig(f,l);m==="all"?d=!0:(m==="some"&&(d=!0),c=!1)}}),c?"all":d?"some":!1}const og=/([0-9]+)/gm,gE=(n,l,a)=>Gy(Xl(n.getValue(a)).toLowerCase(),Xl(l.getValue(a)).toLowerCase()),pE=(n,l,a)=>Gy(Xl(n.getValue(a)),Xl(l.getValue(a))),vE=(n,l,a)=>_g(Xl(n.getValue(a)).toLowerCase(),Xl(l.getValue(a)).toLowerCase()),xE=(n,l,a)=>_g(Xl(n.getValue(a)),Xl(l.getValue(a))),yE=(n,l,a)=>{const i=n.getValue(a),c=l.getValue(a);return i>c?1:i<c?-1:0},SE=(n,l,a)=>_g(n.getValue(a),l.getValue(a));function _g(n,l){return n===l?0:n>l?1:-1}function Xl(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function Gy(n,l){const a=n.split(og).filter(Boolean),i=l.split(og).filter(Boolean);for(;a.length&&i.length;){const c=a.shift(),d=i.shift(),f=parseInt(c,10),m=parseInt(d,10),g=[f,m].sort();if(isNaN(g[0])){if(c>d)return 1;if(d>c)return-1;continue}if(isNaN(g[1]))return isNaN(f)?-1:1;if(f>m)return 1;if(m>f)return-1}return a.length-i.length}const br={alphanumeric:gE,alphanumericCaseSensitive:pE,text:vE,textCaseSensitive:xE,datetime:yE,basic:SE},bE={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:Dn("sorting",n),isMultiSortEvent:l=>l.shiftKey}),createColumn:(n,l)=>{n.getAutoSortingFn=()=>{const a=l.getFilteredRowModel().flatRows.slice(10);let i=!1;for(const c of a){const d=c==null?void 0:c.getValue(n.id);if(Object.prototype.toString.call(d)==="[object Date]")return br.datetime;if(typeof d=="string"&&(i=!0,d.split(og).length>1))return br.alphanumeric}return i?br.text:br.basic},n.getAutoSortDir=()=>{const a=l.getFilteredRowModel().flatRows[0];return typeof(a==null?void 0:a.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var a,i;if(!n)throw new Error;return td(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(a=(i=l.options.sortingFns)==null?void 0:i[n.columnDef.sortingFn])!=null?a:br[n.columnDef.sortingFn]},n.toggleSorting=(a,i)=>{const c=n.getNextSortingOrder(),d=typeof a<"u"&&a!==null;l.setSorting(f=>{const m=f==null?void 0:f.find(j=>j.id===n.id),g=f==null?void 0:f.findIndex(j=>j.id===n.id);let y=[],v,p=d?a:c==="desc";if(f!=null&&f.length&&n.getCanMultiSort()&&i?m?v="toggle":v="add":f!=null&&f.length&&g!==f.length-1?v="replace":m?v="toggle":v="replace",v==="toggle"&&(d||c||(v="remove")),v==="add"){var S;y=[...f,{id:n.id,desc:p}],y.splice(0,y.length-((S=l.options.maxMultiSortColCount)!=null?S:Number.MAX_SAFE_INTEGER))}else v==="toggle"?y=f.map(j=>j.id===n.id?{...j,desc:p}:j):v==="remove"?y=f.filter(j=>j.id!==n.id):y=[{id:n.id,desc:p}];return y})},n.getFirstSortDir=()=>{var a,i;return((a=(i=n.columnDef.sortDescFirst)!=null?i:l.options.sortDescFirst)!=null?a:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=a=>{var i,c;const d=n.getFirstSortDir(),f=n.getIsSorted();return f?f!==d&&((i=l.options.enableSortingRemoval)==null||i)&&(!(a&&(c=l.options.enableMultiRemove)!=null)||c)?!1:f==="desc"?"asc":"desc":d},n.getCanSort=()=>{var a,i;return((a=n.columnDef.enableSorting)!=null?a:!0)&&((i=l.options.enableSorting)!=null?i:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var a,i;return(a=(i=n.columnDef.enableMultiSort)!=null?i:l.options.enableMultiSort)!=null?a:!!n.accessorFn},n.getIsSorted=()=>{var a;const i=(a=l.getState().sorting)==null?void 0:a.find(c=>c.id===n.id);return i?i.desc?"desc":"asc":!1},n.getSortIndex=()=>{var a,i;return(a=(i=l.getState().sorting)==null?void 0:i.findIndex(c=>c.id===n.id))!=null?a:-1},n.clearSorting=()=>{l.setSorting(a=>a!=null&&a.length?a.filter(i=>i.id!==n.id):[])},n.getToggleSortingHandler=()=>{const a=n.getCanSort();return i=>{a&&(i.persist==null||i.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?l.options.isMultiSortEvent==null?void 0:l.options.isMultiSortEvent(i):!1))}}},createTable:n=>{n.setSorting=l=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(l),n.resetSorting=l=>{var a,i;n.setSorting(l?[]:(a=(i=n.initialState)==null?void 0:i.sorting)!=null?a:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},jE=[VM,rE,sE,lE,qM,IM,cE,uE,bE,tE,dE,hE,fE,mE,iE];function wE(n){var l,a;const i=[...jE,...(l=n._features)!=null?l:[]];let c={_features:i};const d=c._features.reduce((S,j)=>Object.assign(S,j.getDefaultOptions==null?void 0:j.getDefaultOptions(c)),{}),f=S=>c.options.mergeOptions?c.options.mergeOptions(d,S):{...d,...S};let g={...{},...(a=n.initialState)!=null?a:{}};c._features.forEach(S=>{var j;g=(j=S.getInitialState==null?void 0:S.getInitialState(g))!=null?j:g});const y=[];let v=!1;const p={_features:i,options:{...d,...n},initialState:g,_queue:S=>{y.push(S),v||(v=!0,Promise.resolve().then(()=>{for(;y.length;)y.shift()();v=!1}).catch(j=>setTimeout(()=>{throw j})))},reset:()=>{c.setState(c.initialState)},setOptions:S=>{const j=Yl(S,c.options);c.options=f(j)},getState:()=>c.options.state,setState:S=>{c.options.onStateChange==null||c.options.onStateChange(S)},_getRowId:(S,j,b)=>{var N;return(N=c.options.getRowId==null?void 0:c.options.getRowId(S,j,b))!=null?N:`${b?[b.id,j].join("."):j}`},getCoreRowModel:()=>(c._getCoreRowModel||(c._getCoreRowModel=c.options.getCoreRowModel(c)),c._getCoreRowModel()),getRowModel:()=>c.getPaginationRowModel(),getRow:(S,j)=>{let b=(j?c.getPrePaginationRowModel():c.getRowModel()).rowsById[S];if(!b&&(b=c.getCoreRowModel().rowsById[S],!b))throw new Error;return b},_getDefaultColumnDef:Ee(()=>[c.options.defaultColumn],S=>{var j;return S=(j=S)!=null?j:{},{header:b=>{const N=b.header.column.columnDef;return N.accessorKey?N.accessorKey:N.accessorFn?N.id:null},cell:b=>{var N,E;return(N=(E=b.renderValue())==null||E.toString==null?void 0:E.toString())!=null?N:null},...c._features.reduce((b,N)=>Object.assign(b,N.getDefaultColumnDef==null?void 0:N.getDefaultColumnDef()),{}),...S}},_e(n,"debugColumns")),_getColumnDefs:()=>c.options.columns,getAllColumns:Ee(()=>[c._getColumnDefs()],S=>{const j=function(b,N,E){return E===void 0&&(E=0),b.map(A=>{const T=BM(c,A,E,N),L=A;return T.columns=L.columns?j(L.columns,T,E+1):[],T})};return j(S)},_e(n,"debugColumns")),getAllFlatColumns:Ee(()=>[c.getAllColumns()],S=>S.flatMap(j=>j.getFlatColumns()),_e(n,"debugColumns")),_getAllFlatColumnsById:Ee(()=>[c.getAllFlatColumns()],S=>S.reduce((j,b)=>(j[b.id]=b,j),{}),_e(n,"debugColumns")),getAllLeafColumns:Ee(()=>[c.getAllColumns(),c._getOrderColumnsFn()],(S,j)=>{let b=S.flatMap(N=>N.getLeafColumns());return j(b)},_e(n,"debugColumns")),getColumn:S=>c._getAllFlatColumnsById()[S]};Object.assign(c,p);for(let S=0;S<c._features.length;S++){const j=c._features[S];j==null||j.createTable==null||j.createTable(c)}return c}function qy(){return n=>Ee(()=>[n.options.data],l=>{const a={rows:[],flatRows:[],rowsById:{}},i=function(c,d,f){d===void 0&&(d=0);const m=[];for(let y=0;y<c.length;y++){const v=GM(n,n._getRowId(c[y],y,f),c[y],y,d,void 0,f==null?void 0:f.id);if(a.flatRows.push(v),a.rowsById[v.id]=v,m.push(v),n.options.getSubRows){var g;v.originalSubRows=n.options.getSubRows(c[y],y),(g=v.originalSubRows)!=null&&g.length&&(v.subRows=i(v.originalSubRows,d+1,v))}}return m};return a.rows=i(l),a},_e(n.options,"debugTable","getRowModel",()=>n._autoResetPageIndex()))}function Iy(){return n=>Ee(()=>[n.getState().expanded,n.getPreExpandedRowModel(),n.options.paginateExpandedRows],(l,a,i)=>!a.rows.length||l!==!0&&!Object.keys(l??{}).length||!i?a:NE(a),_e(n.options,"debugTable"))}function NE(n){const l=[],a=i=>{var c;l.push(i),(c=i.subRows)!=null&&c.length&&i.getIsExpanded()&&i.subRows.forEach(a)};return n.rows.forEach(a),{rows:l,flatRows:n.flatRows,rowsById:n.rowsById}}function CE(){return n=>Ee(()=>[n.getState().sorting,n.getPreSortedRowModel()],(l,a)=>{if(!a.rows.length||!(l!=null&&l.length))return a;const i=n.getState().sorting,c=[],d=i.filter(g=>{var y;return(y=n.getColumn(g.id))==null?void 0:y.getCanSort()}),f={};d.forEach(g=>{const y=n.getColumn(g.id);y&&(f[g.id]={sortUndefined:y.columnDef.sortUndefined,invertSorting:y.columnDef.invertSorting,sortingFn:y.getSortingFn()})});const m=g=>{const y=g.map(v=>({...v}));return y.sort((v,p)=>{for(let j=0;j<d.length;j+=1){var S;const b=d[j],N=f[b.id],E=N.sortUndefined,A=(S=b==null?void 0:b.desc)!=null?S:!1;let T=0;if(E){const L=v.getValue(b.id),M=p.getValue(b.id),_=L===void 0,R=M===void 0;if(_||R){if(E==="first")return _?-1:1;if(E==="last")return _?1:-1;T=_&&R?0:_?E:-E}}if(T===0&&(T=N.sortingFn(v,p,b.id)),T!==0)return A&&(T*=-1),N.invertSorting&&(T*=-1),T}return v.index-p.index}),y.forEach(v=>{var p;c.push(v),(p=v.subRows)!=null&&p.length&&(v.subRows=m(v.subRows))}),y};return{rows:m(a.rows),flatRows:c,rowsById:a.rowsById}},_e(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/**
|
|
290
310
|
* react-table
|
|
291
311
|
*
|
|
292
312
|
* Copyright (c) TanStack
|
|
@@ -295,4 +315,4 @@ Error generating stack: `+i.message+`
|
|
|
295
315
|
* LICENSE.md file in the root directory of this source tree.
|
|
296
316
|
*
|
|
297
317
|
* @license MIT
|
|
298
|
-
*/function Lu(n,l){return n?JE(n)?M.createElement(n,l):n:null}function JE(n){return WE(n)||typeof n=="function"||eT(n)}function WE(n){return typeof n=="function"&&(()=>{const l=Object.getPrototypeOf(n);return l.prototype&&l.prototype.isReactComponent})()}function eT(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function RS(n){const l={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[a]=M.useState(()=>({current:XE(l)})),[o,c]=M.useState(()=>a.current.initialState);return a.current.setOptions(d=>({...d,...n,state:{...o,...n.state},onStateChange:h=>{c(h),n.onStateChange==null||n.onStateChange(h)}})),a.current}function $u({value:n,onChange:l,label:a="Search mutations",placeholder:o="Search gene, change or locus",shortcut:c=!0,delay:d=250}){const[h,m]=M.useState(n),g=M.useRef(null),x=M.useRef(l);x.current=l,M.useEffect(()=>m(n),[n]),M.useEffect(()=>{if(h===n)return;const y=window.setTimeout(()=>x.current(h),d);return()=>window.clearTimeout(y)},[h,n,d]),M.useEffect(()=>{if(!c)return;const y=S=>{var j,b,N;S.key!=="/"||S.metaKey||S.ctrlKey||S.altKey||(b=(j=S.target)==null?void 0:j.closest)!=null&&b.call(j,"input, textarea, select, [contenteditable]")||(S.preventDefault(),(N=g.current)==null||N.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c]);const v=()=>{m(""),l("")};return r.jsxs("div",{className:"tsearch",children:[r.jsx(_u,{size:15,"aria-hidden":!0}),r.jsx("input",{ref:g,type:"search","aria-label":a,placeholder:o,value:h,onChange:y=>{m(y.target.value),d===0&&l(y.target.value)},onKeyDown:y=>{y.key==="Escape"&&v(),y.key==="Enter"&&l(h)}}),h?r.jsx("button",{type:"button",className:"search-clear","aria-label":"Clear the search",onClick:v,children:r.jsx(Bu,{size:14,"aria-hidden":!0})}):c?r.jsx("kbd",{className:"kbd","aria-hidden":!0,children:"/"}):null]})}const Wh=n=>n.toLocaleString("en-US");function Ku({shown:n,total:l,noun:a,loaded:o=!1,note:c}){const h=n>=l?`${Wh(l)} ${l===1?a[0]:a[1]}`:`${Wh(n)} of ${Wh(l)} ${a[1]}${o?" loaded":""}`;return r.jsxs("div",{className:"vt-foot",role:"status",children:[c?r.jsx("span",{className:"vt-foot-note",children:c}):null,r.jsx("span",{className:"vt-foot-count",children:h})]})}function tT(n){return typeof n=="object"?n.key:n}function nT(n,l){const a=n.length;return new Proxy(n,{get(o,c,d){if(typeof c=="string"){const h=c.charCodeAt(0);if(h>=48&&h<=57){const m=+c;if(Number.isInteger(m)&&m>=0&&m<a){let g=o[m];if(typeof g!="object"){const x=l[m*2];g=o[m]={index:m,key:g,start:x,size:l[m*2+1],end:x+l[m*2+1],lane:0}}return g}}if(c==="length")return a}return Reflect.get(o,c,d)}})}function Li(n,l,a){let o=a.initialDeps??[],c,d=!0;function h(){const m=n();return(m.length!==o.length||m.some((x,v)=>o[v]!==x))&&(o=m,c=l(...m),a!=null&&a.onChange&&!(d&&a.skipInitialOnChange)&&a.onChange(c),d=!1),c}return h.updateDeps=m=>{o=m},h}function Lx(n,l){if(n===void 0)throw new Error("Unexpected undefined");return n}const $x=(n,l)=>Math.abs(n-l)<1.01,sT=(n,l,a)=>{let o;return Object.assign(function(...c){n.clearTimeout(o),o=n.setTimeout(()=>l.apply(this,c),a)},{cancel:()=>{n.clearTimeout(o)}})};let pr;const em=()=>{if(pr!==void 0)return pr;if(typeof navigator>"u")return pr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return pr=!0;const n=navigator.maxTouchPoints;return pr=navigator.platform==="MacIntel"&&n!==void 0&&n>0},kx=n=>{const{offsetWidth:l,offsetHeight:a}=n;return{width:l,height:a}},lT=n=>n,aT=n=>{const l=Math.max(n.startIndex-n.overscan,0),o=Math.min(n.endIndex+n.overscan,n.count-1)-l+1,c=new Array(o);for(let d=0;d<o;d++)c[d]=l+d;return c},iT=(n,l)=>{const a=n.scrollElement;if(!a)return;const o=n.targetWindow;if(!o)return;const c=h=>{const{width:m,height:g}=h;l({width:Math.round(m),height:Math.round(g)})};if(c(kx(a)),!o.ResizeObserver)return()=>{};const d=new o.ResizeObserver(h=>{const m=()=>{const g=h[0];if(g!=null&&g.borderBoxSize){const x=g.borderBoxSize[0];if(x){c({width:x.inlineSize,height:x.blockSize});return}}c(kx(a))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()});return d.observe(a,{box:"border-box"}),()=>{d.unobserve(a)}},ku={passive:!0},oT=typeof window>"u"?!0:"onscrollend"in window,rT=(n,l,a)=>{const o=n.scrollElement;if(!o)return;const c=n.targetWindow;if(!c)return;const d=n.options.useScrollendEvent&&oT;let h=0;const m=d?null:sT(c,()=>l(a(o),!1),n.options.isScrollingResetDelay),g=y=>()=>{h=a(o),m==null||m(),l(h,y)},x=g(!0),v=g(!1);return o.addEventListener("scroll",x,ku),d&&o.addEventListener("scrollend",v,ku),()=>{o.removeEventListener("scroll",x),d&&o.removeEventListener("scrollend",v),m==null||m.cancel()}},cT=(n,l)=>rT(n,l,a=>{const{horizontal:o,isRtl:c}=n.options;return o?a.scrollLeft*(c&&-1||1):a.scrollTop}),uT=(n,l,a)=>{if(a.options.useCachedMeasurements){const o=a.indexFromElement(n),c=a.options.getItemKey(o);return a.itemSizeCache.get(c)??a.options.estimateSize(o)}if(l!=null&&l.borderBoxSize){const o=l.borderBoxSize[0];if(o)return Math.round(o[a.options.horizontal?"inlineSize":"blockSize"])}if(!l){const o=a.indexFromElement(n),c=a.options.getItemKey(o),d=a.itemSizeCache.get(c);if(d!==void 0)return d}return n[a.options.horizontal?"offsetWidth":"offsetHeight"]},fT=(n,{adjustments:l=0,behavior:a},o)=>{var c,d;(d=(c=o.scrollElement)==null?void 0:c.scrollTo)==null||d.call(c,{[o.options.horizontal?"left":"top"]:n+l,behavior:a})},dT=fT;function hT(n,l,a,o){if(l===0)return!1;const c=o(0),d=new Set;let h=0;for(;h<n;){const g=a(h);if(g===c)break;d.add(g),h++}const m=n-h;if(m===0||m>=l)return!1;for(let g=0;g<m;g++)if(o(g)!==a(h+g))return!1;for(let g=m;g<l;g++)if(d.has(o(g)))return!1;return!0}class mT{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var a,o,c;return((c=(o=(a=this.targetWindow)==null?void 0:a.performance)==null?void 0:o.now)==null?void 0:c.call(o))??Date.now()},this.observer=(()=>{let a=null;const o=()=>a||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:a=new this.targetWindow.ResizeObserver(c=>{c.forEach(d=>{const h=()=>{const m=d.target,g=this.indexFromElement(m);if(!m.isConnected){this.observer.unobserve(m);for(const[x,v]of this.elementsCache)if(v===m){this.elementsCache.delete(x);break}return}this.isIndexInRange(g)&&this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(m,d,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(h):h()})}));return{disconnect:()=>{var c;(c=o())==null||c.disconnect(),a=null},observe:c=>{var d;return(d=o())==null?void 0:d.observe(c,{box:"border-box"})},unobserve:c=>{var d;return(d=o())==null?void 0:d.unobserve(c)}}})(),this.range=null,this.setOptions=a=>{var o;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lT,rangeExtractor:aT,onChange:()=>{},measureElement:uT,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const y in a){const S=a[y];S!==void 0&&(c[y]=S)}const d=this.options;let h=null,m=null,g=!1;if(d!==void 0&&d.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const y=d.count,S=c.count,j=this.getMeasurements(),b=((o=this._singleLaneMeasurements)==null?void 0:o.items)??j,N=C=>tT(b[C]),T=y>0?N(0):null,O=y>0?N(y-1):null;if(S!==y||y>0&&S>0&&(c.getItemKey(0)!==T||c.getItemKey(S-1)!==O)){g=!0;const C=y>0?this.getVirtualItemForOffset(this.getScrollOffset())??j[0]:null;C&&(h=[C.key,this.getScrollOffset()-C.start]);const E=c.followOnAppend===!0?"auto":c.followOnAppend||null;E&&S>0&&this.isAtEnd(d.scrollEndThreshold)&&(y===0||c.getItemKey(S-1)!==O)&&(S>y||hT(y,S,N,c.getItemKey))&&(m=E)}}this.options=c,g&&(this.pendingMin=0,this.itemSizeCacheVersion++);let x=!1,v=0;if(h&&this.scrollOffset!==null){const[y,S]=h,j=this.getMeasurements(),{count:b,getItemKey:N}=this.options;let T=0;for(;T<b&&N(T)!==y;)T++;if(T<b){const O=j[T];if(O){const _=Math.max(0,O.start+S);!m&&_!==this.scrollOffset&&(v=_-this.scrollOffset,this.scrollOffset=_,x=!0)}}}(x||m)&&(this.pendingScrollAnchor=[x?h[0]:null,x?h[1]:0,m,v])},this.notify=a=>{var o,c;(c=(o=this.options).onChange)==null||c.call(o,this,a)},this.maybeNotify=Li(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),a=>{this.notify(a)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(a=>a()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var a,o;const c=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==c){if(this.cleanup(),!c){this.maybeNotify();return}if(this.scrollElement=c,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((a=this.scrollElement)==null?void 0:a.window)??null,this.elementsCache.forEach(h=>{this.observer.observe(h)}),this.unsubs.push(this.options.observeElementRect(this,h=>{this.scrollRect=h,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(h,m)=>{if(m&&this._intendedScrollOffset===null&&h===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(h-this._intendedScrollOffset)<1.5&&(h=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(h-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const g=this.getScrollOffset();this.scrollDirection=m?g===h?this.scrollDirection:g<h?"forward":"backward":null,this.scrollOffset=h,this.isScrolling=m,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const h=this.scrollElement,m=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},g=()=>{this._iosTouching=!1,!(!em()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};h.addEventListener("touchstart",m,ku),h.addEventListener("touchend",g,ku),this.unsubs.push(()=>{h.removeEventListener("touchstart",m),h.removeEventListener("touchend",g),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const d=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,d&&this.scrollElement&&this.options.enabled){const[h,m,g,x]=d;h!==null&&!g&&(em()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?x!==0&&(this._iosDeferredAdjustment+=x):((o=this.scrollState)==null?void 0:o.behavior)==="smooth"&&!$x(this.getScrollOffset()-x,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),g&&this.scrollToEnd({behavior:g})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:a,maxAtWrite:o}=this._clampedAdjustment,c=this.getMaxScrollOffset();c>o+.5&&(this._clampedAdjustment=a>c+.5?{target:a,maxAtWrite:c}:null,this._scrollToOffset(a,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const a=this.getScrollOffset(),o=this.getMaxScrollOffset();if(a<0||a>o)return;if(this._iosDeferredAdjustment<0&&a>=o-1){this._iosDeferredAdjustment=0;return}const c=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(a,{adjustments:this.scrollAdjustments+=c,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Li(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(a,o,c,d,h,m,g,x)=>(this.prevLanes!==void 0&&this.prevLanes!==m&&(this.lanesChangedFlag=!0),this.prevLanes=m,this.pendingMin=null,{count:a,paddingStart:o,scrollMargin:c,getItemKey:d,enabled:h,lanes:m,laneAssignmentMode:g,gap:x}),{key:!1}),this.isIndexInRange=a=>a>=0&&a<this.options.count,this.getMeasurements=Li(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:a,paddingStart:o,scrollMargin:c,getItemKey:d,enabled:h,lanes:m,laneAssignmentMode:g,gap:x},v)=>{var y;const S=this.itemSizeCache;if(!h)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>a)for(const _ of this.laneAssignments.keys())_>=a&&this.laneAssignments.delete(_);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const j=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===a&&(this.lanesSettling=!1),m===1){const _=a*2;let D=(y=this._singleLaneMeasurements)==null?void 0:y.flat;if(!D||D.length<_){const A=new Float64Array(_);D&&j>0&&A.set(D.subarray(0,j*2)),D=A}const C=j===0?new Array(a):this._singleLaneMeasurements.items.slice();let E;if(j===0)E=o+c;else{const A=j-1;E=D[A*2]+D[A*2+1]+x}for(let A=j;A<a;A++){const B=d(A);C[A]=B;const K=S.get(B),k=typeof K=="number"?K:this.options.estimateSize(A);D[A*2]=E,D[A*2+1]=k,E+=k+x}this._singleLaneMeasurements={flat:D,items:C};const R=nT(C,D);return this.measurementsCache=R,R}const b=this.measurementsCache.slice(0,j),N=new Array(m).fill(void 0),T=new Float64Array(m);let O=0;for(let _=0;_<j;_++){const D=b[_];D&&(N[D.lane]===void 0&&O++,N[D.lane]=_,T[D.lane]=D.end)}for(let _=j;_<a;_++){const D=d(_),C=this.laneAssignments.get(_);let E,R;const A=g==="estimate"||S.has(D);if(C!==void 0&&this.options.lanes>1){E=C;const ie=N[E],oe=ie!==void 0?b[ie]:void 0;R=oe?oe.end+x:o+c}else if(O===m){let ie=0,oe=T[0],se=N[0];for(let P=1;P<m;P++){const le=T[P];(le<oe||le===oe&&N[P]<se)&&(ie=P,oe=le,se=N[P])}E=ie,R=oe+x,A&&this.laneAssignments.set(_,E)}else E=_%this.options.lanes,R=o+c,A&&this.laneAssignments.set(_,E);const B=S.get(D),K=typeof B=="number"?B:this.options.estimateSize(_),k=R+K;b[_]={index:_,start:R,size:K,end:k,key:D,lane:E},N[E]===void 0&&O++,N[E]=_,T[E]=k}return this.measurementsCache=b,b},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Li(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(a,o,c,d)=>a.length===0||o===0?(this.range=null,null):(this.range=pT(a,o,c,d,d===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Li(()=>{let a=null,o=null;const c=this.calculateRange();return c&&(a=c.startIndex,o=c.endIndex),this.maybeNotify.updateDeps([this.isScrolling,a,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,a,o]},(a,o,c,d,h)=>d===null||h===null?[]:a({startIndex:d,endIndex:h,overscan:o,count:c}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=a=>{const o=this.options.indexAttribute,c=a.getAttribute(o);return c?parseInt(c,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=a=>{var o;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const c=this.scrollState.index??((o=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:o.index);if(c!==void 0&&this.range){const d=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),h=Math.max(0,c-d),m=Math.min(this.options.count-1,c+d);return a>=h&&a<=m}return!0},this.measureElement=a=>{if(!a){this.elementsCache.forEach((h,m)=>{h.isConnected||(this.observer.unobserve(h),this.elementsCache.delete(m))});return}const o=this.indexFromElement(a);if(!this.isIndexInRange(o))return;const c=this.options.getItemKey(o),d=this.elementsCache.get(c);d!==a&&(d&&this.observer.unobserve(d),this.observer.observe(a),this.elementsCache.set(c,a)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(o)&&this.resizeItem(o,this.options.measureElement(a,void 0,this))},this.resizeItem=(a,o)=>{var c,d,h;if(!this.isIndexInRange(a))return;let m,g,x;const v=(c=this._singleLaneMeasurements)==null?void 0:c.flat;if(this.options.lanes===1&&v!=null)x=this.options.getItemKey(a),g=v[a*2],m=v[a*2+1];else{const j=this.measurementsCache[a];if(!j)return;x=j.key,g=j.start,m=j.size}const y=this.itemSizeCache.get(x)??m,S=o-y;if(S!==0){const j=this.options.anchorTo==="end"&&((d=this.scrollState)==null?void 0:d.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=j?this.getTotalSize():0,N=this.getScrollOffset()+this.scrollAdjustments,O=!this.itemSizeCache.has(x)?g<N:g+y<=N&&this.scrollDirection!=="backward",_=((h=this.scrollState)==null?void 0:h.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[a]??{index:a,key:x,start:g,size:m,end:g+m,lane:0},S,this):O);(this.pendingMin===null||a<this.pendingMin)&&(this.pendingMin=a),this.itemSizeCache.set(x,o),this.itemSizeCacheVersion++;let D=!1;j?D=this.applyScrollAdjustment(this.getTotalSize()-b):_&&(D=this.applyScrollAdjustment(S)),this.notify(D),this._retryClampedAdjustment()}},this.getVirtualItems=Li(()=>[this.getVirtualIndexes(),this.getMeasurements()],(a,o)=>{const c=[];for(let d=0,h=a.length;d<h;d++){const m=a[d],g=o[m];c.push(g)}return c},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=a=>{var o;const c=this.getMeasurements();if(c.length===0)return;const d=(o=this._singleLaneMeasurements)==null?void 0:o.flat,h=this.options.lanes===1&&d!=null,m=AS(0,c.length-1,h?g=>d[g*2]:g=>Lx(c[g]).start,a);return Lx(c[m])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const a=this.scrollElement.document.documentElement;return this.options.horizontal?a.scrollWidth-this.scrollElement.innerWidth:a.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(a=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=a,this.getOffsetForAlignment=(a,o,c=0)=>{if(!this.scrollElement)return 0;const d=this.getSize(),h=this.getScrollOffset();o==="auto"&&(o=a>=h+d?"end":"start"),o==="center"?a+=(c-d)/2:o==="end"&&(a-=d);const m=this.getMaxScrollOffset();return Math.max(Math.min(m,a),0)},this.getOffsetForIndex=(a,o="auto")=>{a=Math.max(0,Math.min(a,this.options.count-1));const c=this.getSize(),d=this.getScrollOffset(),h=this.measurementsCache[a];if(!h)return;if(o==="auto")if(h.end>=d+c-this.options.scrollPaddingEnd)o="end";else if(h.start<=d+this.options.scrollPaddingStart)o="start";else return[d,o];if(o==="end"&&a===this.options.count-1)return[this.getMaxScrollOffset(),o];const m=o==="end"?h.end+this.options.scrollPaddingEnd:h.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(m,o,h.size),o]},this.scrollToOffset=(a,{align:o="start",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0;const d=this.getOffsetForAlignment(a,o),h=this.now();this.scrollState={index:null,align:o,behavior:c,startedAt:h,lastTargetOffset:d,stableFrames:0},this._scrollToOffset(d,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollToIndex=(a,{align:o="auto",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0,a=Math.max(0,Math.min(a,this.options.count-1));const d=this.getOffsetForIndex(a,o);if(!d)return;const[h,m]=d,g=this.now();this.scrollState={index:a,align:m,behavior:c,startedAt:g,lastTargetOffset:h,stableFrames:0},this._scrollToOffset(h,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollBy=(a,{behavior:o="auto"}={})=>{const c=this.getScrollOffset()+a,d=this.now();this.scrollState={index:null,align:"start",behavior:o,startedAt:d,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:a="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:a});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:a})},this.getTotalSize=()=>{var a,o;const c=this.getMeasurements();let d;if(c.length===0)d=this.options.paddingStart;else if(this.options.lanes===1){const h=c.length-1,m=(a=this._singleLaneMeasurements)==null?void 0:a.flat;m!=null?d=m[h*2]+m[h*2+1]:d=((o=c[h])==null?void 0:o.end)??0}else{const h=Array(this.options.lanes).fill(null);let m=c.length-1;for(;m>=0&&h.some(g=>g===null);){const g=c[m];h[g.lane]===null&&(h[g.lane]=g.end),m--}d=Math.max(...h.filter(g=>g!==null))}return Math.max(d-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const a=[];if(this.itemSizeCache.size===0)return a;const o=this.getMeasurements();for(const c of o)c&&this.itemSizeCache.has(c.key)&&a.push({index:c.index,key:c.key,start:c.start,size:c.size,end:c.end,lane:c.lane});return a},this._scrollToOffset=(a,{adjustments:o,behavior:c})=>{this._intendedScrollOffset=a+(o??0),this.options.scrollToFn(a,{behavior:c,adjustments:o},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(l)}applyScrollAdjustment(l,a){if(l===0)return!1;if(em()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=l,!1;{const o=this.getScrollOffset()+this.scrollAdjustments+l,c=this.scrollElement,d=c!==null&&("scrollHeight"in c||"document"in c)?this.getMaxScrollOffset():null;return this._clampedAdjustment=d!==null&&o>d+.5?{target:o,maxAtWrite:d}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:a}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const o=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,c=o?o[0]:this.scrollState.lastTargetOffset,d=1,h=c!==this.scrollState.lastTargetOffset;if(!h&&$x(c,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=d){this.getScrollOffset()!==c&&this._scrollToOffset(c,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,h){const m=this.getSize()||600,g=Math.abs(c-this.getScrollOffset()),x=this.scrollState.behavior==="smooth"&&g>m;this.scrollState.lastTargetOffset=c,x||(this.scrollState.behavior="auto"),this._scrollToOffset(c,{adjustments:void 0,behavior:x?"smooth":"auto"})}this.scheduleScrollReconcile()}}const AS=(n,l,a,o)=>{for(;n<=l;){const c=(n+l)/2|0,d=a(c);if(d<o)n=c+1;else if(d>o)l=c-1;else return c}return n>0?n-1:0};function gT(n,l,a){let o=0;for(;o<=l;){const c=(o+l)/2|0,d=n[c*2];if(d<a)o=c+1;else if(d>a)l=c-1;else return c}return o>0?o-1:0}function pT(n,l,a,o,c){const d=n.length-1;if(n.length<=o)return{startIndex:0,endIndex:d};if(o===1&&c!==null){const x=gT(c,d,a);let v=x;const y=a+l;for(;v<d&&c[v*2]+c[v*2+1]<y;)v++;return{startIndex:x,endIndex:v}}let m=AS(0,d,x=>n[x].start,a),g=m;if(o===1)for(;g<d&&n[g].end<a+l;)g++;else if(o>1){const x=Array(o).fill(0);for(;g<d&&x.some(y=>y<a+l);){const y=n[g];x[y.lane]=y.end,g++}const v=Array(o).fill(a+l);for(;m>=0&&v.some(y=>y>=a);){const y=n[m];v[y.lane]=y.start,m--}m=Math.max(0,m-m%o),g=Math.min(d,g+(o-1-g%o))}return{startIndex:m,endIndex:g}}const tm=typeof document<"u"?M.useLayoutEffect:M.useEffect;function yT({useFlushSync:n=!0,directDomUpdates:l=!1,directDomUpdatesMode:a="transform",...o}){const c=M.useReducer(y=>y+1,0)[1],d=M.useRef({enabled:l,mode:a,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});d.current.enabled=l,d.current.mode=a;const h=M.useRef(!1),m=y=>{const S=d.current;if(!S.enabled||!S.container)return;const j=y.getTotalSize();if(j!==S.lastSize){S.lastSize=j;const b=y.options.horizontal?"width":"height";S.container.style[b]=`${j}px`}},g=y=>{const S=d.current;if(!S.enabled||!S.container)return;m(y);const j=!!y.options.horizontal,b=S.mode==="transform",N=j?"left":"top",T=y.options.scrollMargin,O=y.getVirtualItems();for(const _ of O){const D=_.start-T,C=y.elementsCache.get(_.key);C&&S.lastPositions.get(C)!==D&&(S.lastPositions.set(C,D),b?C.style.transform=j?`translate3d(${D}px, 0, 0)`:`translate3d(0, ${D}px, 0)`:C.style[N]=`${D}px`)}},x={...o,onChange:(y,S)=>{var j;const b=d.current;let N=!0;if(b.enabled){g(y);const T=y.range,O=b.prevRange;N=!O||O.isScrolling!==y.isScrolling||O.startIndex!==(T==null?void 0:T.startIndex)||O.endIndex!==(T==null?void 0:T.endIndex),N&&(b.prevRange=T?{startIndex:T.startIndex,endIndex:T.endIndex,isScrolling:y.isScrolling}:null)}N&&(n&&S&&!h.current?cg.flushSync(c):c()),(j=o.onChange)==null||j.call(o,y,S)}},[v]=M.useState(()=>{const y=new mT(x),S=y.measureElement;return y.measureElement=j=>{h.current=!0;try{S(j)}finally{h.current=!1}},Object.assign(y,{containerRef:j=>{const b=d.current;if(b.container=j,b.lastSize=null,j&&b.enabled){const N=y.getTotalSize();b.lastSize=N;const T=y.options.horizontal?"width":"height";j.style[T]=`${N}px`}}})});return v.setOptions(x),tm(()=>v._didMount(),[]),tm(()=>(m(v),v._willUpdate())),tm(()=>{g(v)}),v}function vT(n){return yT({observeElementRect:iT,observeElementOffset:cT,scrollToFn:dT,...n})}const OS=33,$i=32,xT=25;function zS({items:n,scrollRef:l,columnCount:a,getKey:o,render:c,onEndReached:d,endThreshold:h=15,rowHeight:m=OS}){var T;const g=vT({count:n.length,getScrollElement:()=>l.current,estimateSize:()=>m,overscan:8,scrollMargin:$i,getItemKey:O=>o(n[O],O),initialRect:{width:1e3,height:$i+m*10}}),x=!((T=g.scrollRect)!=null&&T.height),v=x?n.slice(0,xT).map((O,_)=>({key:o(O,_),index:_,start:$i+_*m,end:$i+(_+1)*m})):g.getVirtualItems(),y=v[0],S=v[v.length-1],j=(S==null?void 0:S.index)??-1;M.useEffect(()=>{d&&j>=0&&j>=n.length-h&&d()},[j,n.length,h,d]);const b=!x&&y?y.start-$i:0,N=!x&&S?g.getTotalSize()-(S.end-$i):0;return r.jsxs(r.Fragment,{children:[b>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:b},children:r.jsx("td",{colSpan:a})})}),v.map(O=>r.jsx("tbody",{"data-index":O.index,ref:x?void 0:g.measureElement,children:c(n[O.index],O.index)},O.key)),N>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:N},children:r.jsx("td",{colSpan:a})})})]})}function Da({text:n,query:l}){const a=l.trim();if(!a||bC(a))return r.jsx(r.Fragment,{children:n});const o=[],c=n.toLowerCase(),d=a.toLowerCase();let h=0;for(let m=c.indexOf(d);m!==-1;m=c.indexOf(d,h))m>h&&o.push(n.slice(h,m)),o.push(r.jsx("mark",{children:n.slice(m,m+a.length)},m)),h=m+a.length;return o.push(n.slice(h)),r.jsx(r.Fragment,{children:o})}function Hx({value:n,max:l,clonal:a}){return n===null?r.jsx("span",{style:{color:"var(--chev)"},children:"–"}):r.jsxs("span",{className:"vbar",children:[r.jsx("span",{className:"vbar-n",children:km(n)}),r.jsxs("span",{className:"vbar-track","aria-hidden":!0,children:[r.jsx("span",{className:"vbar-fill",style:{width:`${Math.min(n/l,1)*100}%`}}),a&&r.jsx("span",{className:"vbar-tick",style:{left:`${1/l*100}%`}})]})]})}function ST({variant:n,showDriver:l}){return r.jsxs("span",{className:"flex flex-wrap gap-1.5",children:[l&&n.is_driver&&r.jsx("span",{className:"sc-pill p-neu",children:"Driver"}),n.hotspot&&r.jsx("span",{className:"sc-pill p-hot",children:"Hotspot"}),n.in_dmp&&r.jsx("span",{className:"sc-pill p-dmp",children:"In DMP"}),n.ffpe_removed&&r.jsx("span",{className:"sc-pill p-ffpe",title:"Left out of the report's counts by its FFPE artifact filter",children:"FFPE filtered"})]})}function bT(n){return`${n.ref}>${n.alt}`}function jT({variant:n,onLocate:l}){const[a,o]=M.useState(!1),c=`chr${n.chrom}:${n.pos}`,d=[["Variant",`${n.kind==="snv"?"SNV":n.kind==="indel"?"Indel":n.kind}, ${bT(n)}`],...n.depth!==null?[["Reads",`${n.alt_reads??"?"} of ${n.depth}`]]:[],["Normal VAF",km(n.normal_vaf)],["Mutant copies",CC(n.mut_alleles)??"–"],["Consequence",(n.consequence??n.effect??"–").replace(/&/g,", ")],["COSMIC",NC(n.cosmic)??"–"],...n.ffpe_score!==null||n.ffpe_removed?[["FFPE artifact score",n.ffpe_score!==null?km(n.ffpe_score):"Not scored"]]:[],["Expression",n.gene_tpm!==null?`${n.gene_tpm.toFixed(1)} TPM`:"–"],["Gene role",MC(n)??"–"]];return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:d.map(([h,m])=>r.jsxs("div",{children:[r.jsx("dt",{children:h}),r.jsx("dd",{children:m})]},h))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l(n),children:[r.jsx($m,{size:14,"aria-hidden":!0}),"Show on copy number"]}),r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(c),o(!0),window.setTimeout(()=>o(!1),1500)}catch{window.prompt("Copy this locus",c)}},children:[r.jsx(P1,{size:14,"aria-hidden":!0}),a?"Copied":"Copy locus"]})]})]})}function wT({sort:n,current:l,onSort:a}){const o=l.replace(/^-/,"")===n.key,c=l.startsWith("-"),d=o?c?n.key:`-${n.key}`:n.descFirst?`-${n.key}`:n.key;return r.jsxs("button",{type:"button",className:"vt-sort","data-active":o,onClick:()=>a(d),title:`Sort by ${n.label.toLowerCase()}`,children:[n.label,o&&c?r.jsx(Tu,{size:12,"aria-hidden":!0}):o?r.jsx(q1,{size:12,"aria-hidden":!0}):r.jsx(Tu,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function NT({data:n,rows:l,hasMore:a,loadingMore:o,onMore:c,table:d,fetching:h,showCcf:m,onTable:g,onHover:x,onLocate:v}){const[y,S]=M.useState({}),j=d.q,b=d.scope!=="drivers",N=M.useMemo(()=>[{id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),meta:{className:"pin vt-x"},cell:({row:R})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":R.getIsExpanded(),"aria-label":`Details of ${R.original.gene??"this mutation"} ${R.original.protein_change??""}`.trim(),onClick:A=>{A.stopPropagation(),R.toggleExpanded()},onFocus:()=>x(R.original),children:r.jsx(dg,{size:14,"aria-hidden":!0})})},{id:"gene",header:"Gene",meta:{className:"pin vt-g",sorts:[{key:"gene",label:"Gene"},{key:"position",label:"Position"}]},cell:({row:{original:R}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Da,{text:R.gene??"–",query:j})}),r.jsx("span",{className:"vt-sub mono",children:Rr(R.chrom,R.pos)})]})},{id:"change",header:"Change",cell:({row:{original:R}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-[12.5px] font-medium",children:r.jsx(Da,{text:R.protein_change??"–",query:j})}),R.cdna_change&&r.jsx("span",{className:"vt-sub mono",children:r.jsx(Da,{text:R.cdna_change,query:j})})]})},{id:"effect",header:"Effect",meta:{sorts:[{key:"effect",label:"Effect"}]},cell:({row:{original:R}})=>r.jsx("span",{className:R.effect_class==="truncating"?"font-semibold":void 0,children:ZN(R.consequence,R.effect)})},{id:"vaf",header:"VAF",meta:{className:"n",sorts:[{key:"vaf",label:"VAF",descFirst:!0}]},cell:({row:{original:R}})=>r.jsx(Hx,{value:R.vaf,max:1})},...m?[{id:"ccf",header:"CCF",meta:{className:"n",sorts:[{key:"ccf",label:"CCF",descFirst:!0}]},cell:({row:{original:R}})=>r.jsx(Hx,{value:R.ccf,max:1.25,clonal:!0})}]:[],{id:"flags",header:"Flags",cell:({row:{original:R}})=>r.jsx(ST,{variant:R,showDriver:b})}],[j,b,m,x]),T=RS({data:l,columns:N,getRowId:SC,getCoreRowModel:TS(),getExpandedRowModel:_S(),getRowCanExpand:()=>!0,manualPagination:!0,state:{expanded:y},onExpandedChange:S}),O=d.sort.replace(/^-/,""),_=T.getVisibleLeafColumns().length,D=cS(d)>0,C=M.useRef(null),E=JSON.stringify([d.scope,d.sort,d.q,d.effects,d.flags,d.range,d.ffpe]);return M.useEffect(()=>{C.current&&(C.current.scrollTop=0)},[E]),r.jsxs("div",{className:"flex min-w-0 flex-col",children:[r.jsx("div",{className:"tbar",children:r.jsx($u,{value:d.q,onChange:R=>g({q:R})})}),r.jsxs("div",{ref:C,className:"vt-scroll vt-viewport",onMouseLeave:()=>x(null),"aria-busy":h,children:[h&&r.jsx("div",{className:"vt-progress","aria-hidden":!0}),r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:T.getHeaderGroups().map(R=>r.jsx("tr",{children:R.headers.map(A=>{var k;const B=A.column.columnDef.meta,K=(k=B==null?void 0:B.sorts)==null?void 0:k.some(ie=>ie.key===O);return r.jsx("th",{className:B==null?void 0:B.className,"aria-sort":K?d.sort.startsWith("-")?"descending":"ascending":void 0,children:B!=null&&B.sorts?r.jsx("span",{className:"vt-sorts",children:B.sorts.map(ie=>r.jsx(wT,{sort:ie,current:d.sort,onSort:oe=>g({sort:oe})},ie.key))}):Lu(A.column.columnDef.header,A.getContext())},A.id)})},R.id))}),r.jsx(zS,{items:T.getRowModel().rows,scrollRef:C,columnCount:_,getKey:R=>R.id,onEndReached:a&&!o?c:void 0,render:R=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":R.getIsExpanded(),onClick:()=>R.toggleExpanded(),onMouseEnter:()=>x(R.original),children:R.getVisibleCells().map(A=>{var B;return r.jsx("td",{className:(B=A.column.columnDef.meta)==null?void 0:B.className,children:Lu(A.column.columnDef.cell,A.getContext())},A.id)})}),R.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:_,children:r.jsx(jT,{variant:R.original,onLocate:v})})})]})}),l.length===0&&r.jsx("tbody",{children:r.jsx("tr",{children:r.jsx("td",{colSpan:_,children:r.jsx("div",{className:"vt-empty",children:D?r.jsxs(r.Fragment,{children:["No mutations match these filters.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>g({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]}):`No ${d.scope==="all"?"":`${d.scope} `}mutations in this sample.`})})})})]})]}),n.total>0&&r.jsx(Ku,{shown:l.length,total:n.total,noun:["mutation","mutations"],loaded:!0,note:o?"Loading more…":l.length<n.total?"Scroll the table for more":void 0})]})}const CT=M.forwardRef(function({variants:l,rows:a,hasMore:o,loadingMore:c,onMore:d,variantsLoading:h,variantsFetching:m,density:g,densityLoading:x,picked:v,measure:y,onMeasure:S,table:j,onTable:b,hovered:N,onHover:T,onLocate:O,showCcf:_,tmb:D},C){var ie,oe;const E=(l==null?void 0:l.status)==="ok"?l.data??void 0:void 0,R=E==null?void 0:E.counts,A=(g==null?void 0:g.status)==="ok"?(ie=g.data)==null?void 0:ie.total:void 0,B=(g==null?void 0:g.status)==="ok"?(oe=g.data)==null?void 0:oe.ffpe:null,K=se=>se===void 0?"":se.toLocaleString("en-US"),k=j.range&&j.range.measure===y?[j.range.low,j.range.high]:null;return r.jsxs(uo,{ref:C,title:"Mutations",subtitle:A!==void 0?`${K(A)} PASS SNVs and indels${B&&!B.shown?", after the FFPE filter":""}`:void 0,lineage:Qu(g==null?void 0:g.lineage,l==null?void 0:l.lineage,D==null?void 0:D.lineage),picked:v,className:"mut",info:"mutations",expandable:!0,controls:r.jsx(r.Fragment,{children:r.jsx(Bl,{label:"Which mutations",value:j.scope,onChange:se=>b({scope:se,sort:rS[se]}),options:[{value:"drivers",label:r.jsxs(r.Fragment,{children:["Drivers",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.drivers)})]})},{value:"coding",label:r.jsxs(r.Fragment,{children:["Coding",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.coding)})]})},{value:"all",label:r.jsxs(r.Fragment,{children:["All",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.all)})]})}]})}),children:[r.jsx(lE,{envelope:g,loading:x,measure:y,onMeasure:S,range:k,focus:N,onRange:se=>{!se&&!j.range||b({range:se?{measure:y,low:se[0],high:se[1]}:null})},onGene:se=>b({q:se})}),E&&l&&l.warnings.length>0&&r.jsx("div",{className:"px-5 py-2 text-xs",role:"note",style:{color:"var(--warn-ink)"},children:l.warnings.join(" ")}),E?r.jsxs("div",{className:"mut-body",children:[r.jsx(oE,{table:j,data:E,onChange:b}),r.jsx(NT,{data:E,rows:a,hasMore:o,loadingMore:c,onMore:d,table:j,fetching:m,showCcf:_,onTable:b,onHover:T,onLocate:O})]}):r.jsx("div",{className:"mut-rule",children:r.jsx(Vl,{label:"mutations",envelope:l,loading:h,skeletonHeight:240,children:()=>null})}),(D==null?void 0:D.status)==="ok"&&D.data&&r.jsx(cE,{data:D.data}),(D==null?void 0:D.status)==="missing"&&D.warnings.some(se=>se.includes("Rerun"))&&r.jsxs("section",{className:"sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsx("h3",{className:"sv-h",children:"Coding mutations against reference cohorts"}),r.jsx("p",{className:"sv-empty",children:D.warnings.join(" ")})]})]})}),Sg={oncogene:"Oncogene",tsg:"Tumour suppressor",both:"Oncogene and TSG"},DS=["oncogene","tsg","both"],$a={deletion:"Deletion","tandem-duplication":"Tandem duplication",inversion:"Inversion",translocation:"Translocation"},MT={"<1kb":"<1 kb","1kb-10kb":"1–10 kb","10kb-100kb":"10–100 kb","100kb-1Mb":"100 kb–1 Mb",">1Mb":">1 Mb"};function ET(n){return n?MT[n]??n:""}const TT={DEL:"Deletion",DUP:"Duplication",INV:"Inversion",TRA:"Translocation",BND:"Breakend",INS:"Insertion"};function bg(n){return n?TT[n]??n:"–"}function _T(n){return n==null?"–":n>=1e6?`${(n/1e6).toLocaleString("en-US",{maximumFractionDigits:1})} Mb`:n>=1e3?`${(n/1e3).toLocaleString("en-US",{maximumFractionDigits:1})} kb`:`${n.toLocaleString("en-US")} bp`}function RT(n){return n.some(l=>l.left_expression||l.right_expression||l.expression)}function AT(n){const l={oncogene:0,tsg:0,both:0};for(const a of n)a.role&&(l[a.role]+=1);return l}function OT(n){const l=n.trim().match(dS);if(!l)return null;const a=Number(l[2].replace(/,/g,"")),o=l[3]?Number(l[3].replace(/,/g,"")):a;return{chrom:l[1].toUpperCase(),start:Math.min(a,o),end:Math.max(a,o)}}function zT(n,l){const a=l.trim().toLowerCase();if(!a)return!0;const o=OT(l);if(o){const c=(d,h)=>(d==null?void 0:d.toUpperCase())===o.chrom&&h!==null&&h>=o.start&&h<=o.end;return c(n.left_chrom,n.left_pos)||c(n.right_chrom,n.right_pos)}return[n.gene,n.left_gene,n.right_gene,n.callers,n.left_loc,n.right_loc,n.sv_type,bg(n.sv_type),n.role?Sg[n.role]:null].some(c=>c==null?void 0:c.toLowerCase().includes(a))}const zn={deletion:"var(--sv-del)","tandem-duplication":"var(--sv-dup)",inversion:"var(--sv-inv)",translocation:"var(--sv-tra)"},DT={deletion:"Deletion","tandem-duplication":"Tandem dup.",inversion:"Inversion",translocation:"Transl."},LT={"<1kb":"<1k","1kb-10kb":"10k","10kb-100kb":"100k","100kb-1Mb":"1M",">1Mb":">1M"};function $T(n){return n.size?LT[n.size]??n.size:""}function Ux(n){const l=`${n.clustered?"Clustered":"Dispersed"} ${$a[n.sv_class].toLowerCase()}s`;return n.size?`${l}, ${ET(n.size)}`:l}function kT(n){const l=[];return n.forEach((a,o)=>{const c=l[l.length-1];c&&c.clustered===a.clustered&&c.sv_class===a.sv_class?c.end=o:l.push({clustered:a.clustered,sv_class:a.sv_class,start:o,end:o})}),l}function HT(n){const l=new Map;for(const a of n)l.set(a.sv_class,(l.get(a.sv_class)??0)+a.count);return[...l].map(([a,o])=>({sv_class:a,count:o}))}const UT=45;function FT({role:n}){return n?r.jsx("span",{className:`sc-pill p-${n==="oncogene"?"onco":n}`,children:Sg[n]}):r.jsx("span",{style:{color:"var(--chev)"},children:"–"})}function VT({rows:n,shown:l,onToggle:a}){const o=AT(n);return r.jsx("div",{className:"sv-legend",role:"group","aria-label":"Show rows by gene role",children:DS.filter(c=>o[c]>0).map(c=>r.jsxs("button",{type:"button",className:`sv-legend-item p-${c==="oncogene"?"onco":c}`,"aria-pressed":l.includes(c),onClick:()=>a(c),children:[Sg[c],r.jsx("span",{className:"sv-legend-n",children:o[c]})]},c))})}function Fx({gene:n,chrom:l,pos:a,loc:o,query:c}){return r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"sv-end",children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Da,{text:n||"–",query:c})}),o&&r.jsx("span",{className:"sv-loc",children:o})]}),r.jsx("span",{className:"vt-sub stack mono",children:l&&a!==null?Rr(l,a):"–"})]})}function LS(n){return n?n.replace(/,\s*/g,", "):"–"}function BT({label:n,sorted:l,onClick:a}){return r.jsxs("button",{type:"button",className:"vt-sort","data-active":!!l,onClick:a,title:`Sort by ${n.toLowerCase()}`,children:[n,l==="desc"?r.jsx(Tu,{size:12,"aria-hidden":!0}):l==="asc"?r.jsx(q1,{size:12,"aria-hidden":!0}):r.jsx(Tu,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function GT({row:n,onLocate:l}){const[a,o]=M.useState(!1),c=n.left_chrom&&n.left_pos!==null?{chrom:n.left_chrom,pos:n.left_pos}:null,d=n.right_chrom&&n.right_pos!==null?{chrom:n.right_chrom,pos:n.right_pos}:null,h=[["Type",bg(n.sv_type)],["Left breakpoint",c?`${Rr(c.chrom,c.pos)}${n.left_loc?`, ${n.left_loc}`:""}`:"–"],["Right breakpoint",d?`${Rr(d.chrom,d.pos)}${n.right_loc?`, ${n.right_loc}`:""}`:"–"],["Pileups (left, right)",[n.left_pileup,n.right_pileup].filter(Boolean).join(", ")||"–"],["Orientation",n.orientation??"–"],["Callers",LS(n.callers)]],m=n.gene??n.left_gene,g=n.gene??n.right_gene;return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:h.map(([x,v])=>r.jsxs("div",{children:[r.jsx("dt",{children:x}),r.jsx("dd",{children:v})]},x))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l({...c,gene:m}),children:[r.jsx($m,{size:14,"aria-hidden":!0}),"Show ",d&&d.chrom===c.chrom?"it":"left breakpoint"," on copy number"]}),d&&d.chrom!==(c==null?void 0:c.chrom)&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l({...d,gene:g}),children:[r.jsx($m,{size:14,"aria-hidden":!0}),"Show right breakpoint on copy number"]}),n.igv_locus&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(n.igv_locus??""),o(!0),window.setTimeout(()=>o(!1),1500)}catch{window.prompt("Copy these IGV loci",n.igv_locus??"")}},children:[r.jsx(P1,{size:14,"aria-hidden":!0}),a?"Copied":"Copy IGV loci"]})]})]})}function Vx({kind:n,rows:l,total:a=l.length,query:o="",onLocate:c}){const[d,h]=M.useState({}),[m,g]=M.useState([]),x=M.useRef(null),v=RT(l);M.useEffect(()=>{x.current&&(x.current.scrollTop=0)},[o,l.length]);const y=M.useMemo(()=>{const N={id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),enableSorting:!1,meta:{className:"pin vt-x"},cell:({row:_})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":_.getIsExpanded(),"aria-label":`Details of ${_.original.gene??[_.original.left_gene,_.original.right_gene].filter(Boolean).join(" and ")}`,onClick:D=>{D.stopPropagation(),_.toggleExpanded()},children:r.jsx(dg,{size:14,"aria-hidden":!0})})},T=[{id:"type",header:"Type",accessorFn:_=>_.sv_type??"",cell:({row:{original:_}})=>bg(_.sv_type)},{id:"role",header:"Role",accessorFn:_=>_.role?DS.indexOf(_.role):9,cell:({row:{original:_}})=>r.jsx(FT,{role:_.role})},{id:"callers",header:"Callers",accessorFn:_=>_.callers??"",cell:({row:{original:_}})=>r.jsx("span",{className:"text-[12.5px]",children:LS(_.callers)})},{id:"support",header:"Support",accessorFn:_=>_.max_support??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:_}})=>r.jsx("span",{className:"mono",children:_.max_support??"–"})},{id:"pileups",header:"Pileups",enableSorting:!1,cell:({row:{original:_}})=>r.jsx("span",{className:"mono text-[12px]",children:[_.left_pileup,_.right_pileup].filter(Boolean).join(" · ")||"–"})}],O=v?[{id:"expression",header:"Expression",enableSorting:!1,cell:({row:{original:_}})=>n==="whole_gene"?r.jsx("span",{className:"text-[12.5px]",children:_.expression??"–"}):r.jsxs("span",{className:"flex flex-col text-[12.5px] leading-snug",children:[r.jsx("span",{children:_.left_expression??"–"}),r.jsx("span",{style:{color:"var(--muted)"},children:_.right_expression??"–"})]})}]:[];return n==="whole_gene"?[N,{id:"gene",header:"Gene",accessorFn:_=>_.gene??"",meta:{className:"pin vt-g"},cell:({row:{original:_}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Da,{text:_.gene??"–",query:o})}),r.jsx("span",{className:"vt-sub mono",children:_.left_chrom&&_.left_pos!==null&&_.right_pos!==null?`${Rr(_.left_chrom,_.left_pos)}–${_.right_pos.toLocaleString("en-US")}`:"–"})]})},{id:"length",header:"Length",accessorFn:_=>_.length??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:_}})=>r.jsx("span",{className:"mono",children:_T(_.length)})},...T,...O]:[N,{id:"left",header:"Left",accessorFn:_=>_.left_gene??"",meta:{className:"pin vt-g"},cell:({row:{original:_}})=>r.jsx(Fx,{gene:_.left_gene,chrom:_.left_chrom,pos:_.left_pos,loc:_.left_loc,query:o})},{id:"right",header:"Right",accessorFn:_=>_.right_gene??"",cell:({row:{original:_}})=>r.jsx(Fx,{gene:_.right_gene,chrom:_.right_chrom,pos:_.right_pos,loc:_.right_loc,query:o})},...T,...O]},[n,v,o]),S=RS({data:l,columns:y,getRowId:N=>`${n}-${N.row}`,getCoreRowModel:TS(),getSortedRowModel:ZE(),getExpandedRowModel:_S(),getRowCanExpand:()=>!0,state:{expanded:d,sorting:m},onExpandedChange:h,onSortingChange:g}),j=S.getVisibleLeafColumns().length,b=n==="onco"?UT:OS;return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:x,className:"vt-scroll vt-viewport",style:{"--row-h":`${b}px`},children:r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:S.getHeaderGroups().map(N=>r.jsx("tr",{children:N.headers.map(T=>{const O=T.column.columnDef.meta,_=T.column.getIsSorted();return r.jsx("th",{className:O==null?void 0:O.className,"aria-sort":_?_==="desc"?"descending":"ascending":void 0,children:T.column.getCanSort()?r.jsx(BT,{label:String(T.column.columnDef.header),sorted:_,onClick:T.column.getToggleSortingHandler()}):Lu(T.column.columnDef.header,T.getContext())},T.id)})},N.id))}),r.jsx(zS,{items:S.getRowModel().rows,scrollRef:x,columnCount:j,rowHeight:b,getKey:N=>N.id,render:N=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":N.getIsExpanded(),onClick:()=>N.toggleExpanded(),children:N.getVisibleCells().map(T=>{var O;return r.jsx("td",{className:(O=T.column.columnDef.meta)==null?void 0:O.className,children:Lu(T.column.columnDef.cell,T.getContext())},T.id)})}),N.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:j,children:r.jsx(GT,{row:N.original,onLocate:c})})})]})})]})}),r.jsx(Ku,{shown:l.length,total:a,noun:["row","rows"]})]})}const yr=176,nm=34,sm=7,lm=22,bu=30,qT={deletion:"Del","tandem-duplication":"Dup",inversion:"Inv",translocation:"Tra"};function IT(n,l){return[$a[n],DT[n],qT[n]].find(o=>Cs(o,12)+8<=l)??""}function QT(n,l,a,o,c){const d=Math.min(c,a/2,o);return`M${n},${l+o} V${l+d} Q${n},${l} ${n+d},${l} H${n+a-d} Q${n+a},${l} ${n+a},${l+d} V${l+o} Z`}function YT({categories:n,total:l,litClass:a}){const[o,c]=Es(),d=M.useId(),[h,m]=M.useState(null),g=kT(n),x=Math.max(0,...n.map(k=>k.count)),v=Pu(x,3),y=v[v.length-1],S=n.length,j=(g.length-1)*sm,b=n.some(k=>k.clustered)&&n.some(k=>!k.clustered),N=Math.max((c-bu-6-j-(b?lm-sm:0))/S,4),T=Math.min(26,N*.64),O=[],_=[];let D=bu;g.forEach((k,ie)=>{ie>0&&(D+=g[ie-1].clustered!==k.clustered?lm:sm);const oe=D;for(let le=k.start;le<=k.end;le++)O[le]=D+(N-T)/2,D+=N;const se=_.find(le=>le.clustered===k.clustered&&le.x1>=oe-lm-1),P=n.slice(k.start,k.end+1).reduce((le,$)=>le+$.count,0);se?(se.x1=D,se.count+=P):_.push({clustered:k.clustered,x0:oe,x1:D,count:P})});const C=k=>nm+yr-k/y*yr,E=nm+yr,R=k=>h!==null?k===h:a?n[k].sv_class===a:!0,A=h===null?null:n[h],B=A&&l?Math.round(A.count/l*100):0,K=E+62;return r.jsxs("div",{ref:o,className:"rs","data-lit":h!==null||a?"":void 0,children:[r.jsxs("svg",{width:c,height:K,role:"img","aria-label":`Rearrangement signatures: ${n.filter(k=>k.count>0).map(k=>`${k.category} ${k.count}`).join(", ")}`,children:[r.jsx("defs",{children:Object.keys(zn).map(k=>r.jsxs("linearGradient",{id:`${d}-${k}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:zn[k]}}),r.jsx("stop",{offset:"1",style:{stopColor:zn[k]},stopOpacity:.72})]},k))}),_.map(k=>r.jsxs("g",{children:[b&&k.clustered&&r.jsx("rect",{x:k.x0-6,y:0,width:k.x1-k.x0+12,height:E+56,rx:14,className:"rs-zone"}),b&&r.jsxs("text",{x:k.x0,y:17,className:"rs-zone-name",children:[k.clustered?"Clustered":"Dispersed",r.jsxs("tspan",{className:"rs-zone-n",children:[" ",k.count.toLocaleString("en-US")]})]})]},k.clustered?"c":"d")),v.map(k=>r.jsxs("g",{children:[r.jsx("line",{x1:bu-4,x2:c,y1:C(k),y2:C(k),className:k===0?"rs-base":"rs-grid"}),r.jsx("text",{x:bu-10,y:C(k)+4,textAnchor:"end",className:"rs-tick",children:k.toLocaleString("en-US")})]},k)),n.map((k,ie)=>{const oe=k.count/y*yr,se=R(ie);return r.jsxs("g",{className:"rs-bar","data-off":se?void 0:"",children:[k.count>0?r.jsxs(r.Fragment,{children:[r.jsx("path",{d:QT(O[ie],C(k.count),T,oe,6),fill:`url(#${d}-${k.sv_class})`,fillOpacity:k.clustered?.5:1}),r.jsx("text",{x:O[ie]+T/2,y:C(k.count)-7,textAnchor:"middle",className:"rs-count",children:k.count.toLocaleString("en-US")})]}):r.jsx("rect",{x:O[ie],y:E-3,width:T,height:3,rx:1.5,style:{fill:zn[k.sv_class]},fillOpacity:.28}),k.size&&N>=26&&r.jsx("text",{x:O[ie]+T/2,y:E+16,textAnchor:"middle",className:"rs-size",children:$T(k)}),r.jsx("rect",{x:O[ie]-(N-T)/2,y:nm-8,width:N,height:yr+30,fill:"transparent",tabIndex:0,"aria-label":`${Ux(k)}: ${k.count}`,onMouseEnter:()=>m(ie),onMouseLeave:()=>m(null),onFocus:()=>m(ie),onBlur:()=>m(null)})]},k.category)}),g.map(k=>{const ie=O[k.start],oe=O[k.end]+T,se=IT(k.sv_class,oe-ie+(N-T));return r.jsxs("g",{className:"rs-class","data-off":a&&a!==k.sv_class?"":void 0,children:[r.jsx("line",{x1:ie,x2:oe,y1:E+26,y2:E+26,style:{stroke:zn[k.sv_class]},className:"rs-bracket"}),r.jsx("text",{x:(ie+oe)/2,y:E+44,textAnchor:"middle",className:"rs-class-name",children:se})]},`${k.clustered}-${k.sv_class}`)})]}),A&&h!==null&&r.jsxs(Zt,{x:O[h]+T/2,y:Math.max(C(A.count)-8,40),width:c,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[A.sv_class],opacity:A.clustered?.5:1},"aria-hidden":!0}),Ux(A)]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements"}),r.jsx("b",{children:A.count.toLocaleString("en-US")})]}),l>0&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Of all of them"}),r.jsxs("b",{children:[B===0&&A.count>0?"<1":B,"%"]})]})]})]})}function $S(n,l,a){return`${n.toLocaleString("en-US")} ${n===1?l:a}`}function PT({categories:n,total:l}){const[a,o]=M.useState(null),c=HT(n);return r.jsxs("div",{className:"sv-sigs",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h3",{className:"sv-h",children:["Rearrangement signatures",r.jsx("span",{className:"sv-h-n",children:$S(l,"rearrangement","rearrangements")})]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Classes",onMouseLeave:()=>o(null),children:[c.map(({sv_class:d,count:h})=>r.jsxs("li",{"data-on":a===d||void 0,onMouseEnter:()=>o(d),children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[d]},"aria-hidden":!0}),$a[d],r.jsx("span",{className:"sv-key-n",children:h.toLocaleString("en-US")})]},d)),r.jsx("li",{className:"sv-sigs-note",children:"Lighter bars: clustered"})]})]}),r.jsx("div",{className:"sv-sigs-plot",children:r.jsx(YT,{categories:n,total:l,litClass:a})})]})}function XT({data:n,query:l,onQuery:a,onLocate:o}){const[c,d]=M.useState([]),h=j=>d(b=>b.includes(j)?b.filter(N=>N!==j):[...b,j]),m=j=>j.filter(b=>zT(b,l)),g=j=>c.length?j.filter(b=>b.role&&c.includes(b.role)):j,x=[...n.onco,...n.whole_gene],v=[...m(n.onco),...m(n.whole_gene)],y=g(m(n.onco)),S=g(m(n.whole_gene));return x.length===0?r.jsx("p",{className:"sv-empty",children:"No rearrangements with breakpoints in oncogenes or tumour suppressors."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"tbar",children:[v.length>0&&r.jsx(VT,{rows:v,shown:c,onToggle:h}),r.jsx($u,{value:l,onChange:a,label:"Search structural variants",placeholder:"Search gene, caller or locus",shortcut:!1})]}),v.length===0&&r.jsxs("div",{className:"vt-empty sv-empty",children:["No rows match this search.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>a(""),children:"Clear the search"})]}),y.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Rearranged oncogenes and tumour suppressors",children:[r.jsx("h3",{className:"sv-h",children:"Rearranged oncogenes and tumour suppressors"}),r.jsx(Vx,{kind:"onco",rows:y,total:n.onco.length,query:l,onLocate:o})]}),S.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Whole-gene rearrangements",children:[r.jsx("h3",{className:"sv-h",children:"Whole-gene rearrangements"}),r.jsx(Vx,{kind:"whole_gene",rows:S,total:n.whole_gene.length,query:l,onLocate:o})]})]})}const KT=M.forwardRef(function({envelope:l,loading:a,picked:o,onLocate:c},d){const h=(l==null?void 0:l.status)==="ok"?l.data:null,[m,g]=M.useState("");return r.jsx(uo,{ref:d,title:"Structural variants",subtitle:h?$S(h.rearrangements,"rearrangement","rearrangements"):void 0,lineage:(l==null?void 0:l.lineage)??[],picked:o,info:"structuralVariants",className:"svs",expandable:!0,children:r.jsx(Vl,{label:"structural variants",envelope:l,loading:a,skeletonHeight:220,children:x=>r.jsxs("div",{className:"sv-body",children:[r.jsx(XT,{data:x,query:m,onQuery:g,onLocate:c}),x.signatures&&r.jsx(PT,{categories:x.signatures.categories,total:x.signatures.total})]})})})}),Bx=["C>A","C>G","C>T","T>A","T>C","T>G"],wa={"C>A":"#03bcee","C>G":"#222222","C>T":"#e32926","T>A":"#999999","T>C":"#a1ce63","T>G":"#e9a9a5"};function ZT(n,l){const a=n.contexts.every(g=>g.reconstructed!==null),o=n.contexts.reduce((g,x)=>g+x.observed,0),c=a?n.contexts.reduce((g,x)=>g+(x.reconstructed??0),0):0,d=n.contexts.map(g=>l==="share"?o?g.observed/o*100:0:g.observed),h=a?n.contexts.map(g=>l==="share"?c?(g.reconstructed??0)/c*100:0:g.reconstructed??0):null,m=h?d.map((g,x)=>g-h[x]):null;return{observed:d,reconstructed:h,difference:m,top:Math.max(0,...d,...h??[]),reach:m?Math.max(0,...m.map(Math.abs)):0}}function JT(n){const l=[];return n.forEach((a,o)=>{const c=l[l.length-1];c&&c.substitution===a.substitution?c.end=o:l.push({substitution:a.substitution,start:o,end:o})}),l}function WT(n,l,a,o=10){const c=l-o*(n.length-1),d=y=>y.end-y.start+1,h=n.reduce((y,S)=>y+d(S),0),m=a?n.find(y=>y.substitution===a):void 0,g=m?Math.min(.62,Math.max(.4,d(m)*30/c)):0,x=[];let v=0;for(const y of n){const S=d(y),j=m?y===m?c*g:c*(1-g)*S/(h-d(m)):c*S/h,b=j/S;for(let N=0;N<S;N++)x.push({x:v+N*b+b*.11,width:b*.78});v+=j+o}return x}function am(n){return[n.five_prime,n.substitution[0],n.three_prime]}function im(n,l){return l==="count"?Math.round(n).toLocaleString("en-US"):`${n.toFixed(n>=10?1:2)}%`}function Gx(n,l){return n==="cosine"?l.toFixed(3):l.toExponential(2).replace("e-","e−").replace("e+","e")}const xn=46,e_=6,va=28,om=14,qs=96,ki=84,t_=["This tumour","Rebuilt from its signatures","Difference"],n_={reported:"Reported run",unfiltered:"Unfiltered"};function s_({data:n}){const[l,a]=Es(760),[o,c]=M.useState("share"),[d,h]=M.useState("reported"),[m,g]=M.useState(null),[x,v]=M.useState(null),y=n.runs.find(se=>se.source===d)??n.runs[0],S=n.reconstructed&&y.contexts.every(se=>se.reconstructed!==null),j=M.useMemo(()=>ZT(y,o),[y,o]),b=M.useMemo(()=>JT(y.contexts),[y]),N=Math.max(a-xn-e_,240),T=M.useMemo(()=>WT(b,N,m,om),[b,N,m]),O=S?3:1,_=m?22:0,D=[va,va+qs+om,va+2*(qs+om)],C=(S?D[2]+ki:D[0]+qs)+_+8,E=o==="share"?"%":"",R=Pu(j.top,2),A=R[R.length-1],B=Math.max(j.reach*1.15,o==="share"?.5:1),K=(se,P)=>P===2?ki/2*(1-se/B):qs*(1-se/A),k=[j.observed,j.reconstructed,j.difference],ie=x===null?null:y.contexts[x],oe=se=>xn+T[se].x+T[se].width/2;return r.jsxs("section",{className:"ctx sig-section","aria-label":"96 mutational contexts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["96 mutational contexts",r.jsxs("span",{className:"sv-h-n",children:[Math.round(y.total).toLocaleString("en-US")," SNVs"]})]}),r.jsxs("div",{className:"ctx-controls",children:[S&&n.fit&&r.jsxs("span",{className:"ctx-fit",title:"How well the fitted signatures rebuild the profile, as the report measures it",children:[n.fit.cosine!==null&&r.jsxs("span",{children:["Cosine similarity ",r.jsx("b",{children:Gx("cosine",n.fit.cosine)})]}),n.fit.rss!==null&&r.jsxs("span",{children:["RSS ",r.jsx("b",{children:Gx("rss",n.fit.rss)})]})]}),n.runs.length>1&&r.jsx(Bl,{label:"Run",value:d,onChange:h,options:n.runs.map(se=>({value:se.source,label:n_[se.source]}))}),r.jsx(Bl,{label:"Profile measure",value:o,onChange:c,options:[{value:"share",label:"Share"},{value:"count",label:"Count"}]})]})]}),r.jsx("div",{className:"ctx-wrap",children:r.jsxs("div",{ref:l,className:"ctx-plot",onMouseLeave:()=>v(null),children:[r.jsxs("svg",{width:a,height:C,role:"img","aria-label":`SNVs in the 96 mutational contexts${S?", observed and rebuilt from signatures":""}`,children:[r.jsx("g",{transform:`translate(${xn} 0)`,children:b.map(se=>{const P=T[se.start],le=T[se.end],$=P.x-P.width*.14,J=le.x+le.width*1.14,Z=m===se.substitution;return r.jsxs("g",{className:"ctx-chip","data-on":Z||void 0,role:"button",tabIndex:0,"aria-pressed":Z,"aria-label":`${se.substitution}: ${Z?"show all classes":"label its sixteen contexts"}`,onClick:()=>g(Z?null:se.substitution),onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),g(Z?null:se.substitution))},children:[r.jsx("rect",{x:$,y:0,width:Math.max(J-$,1),height:22,rx:11}),r.jsx("circle",{cx:$+11,cy:11,r:4.5,fill:wa[se.substitution]}),r.jsx("text",{x:$+22,y:15,children:se.substitution})]},se.substitution)})}),Array.from({length:O},(se,P)=>{const le=D[P],$=P===2?ki:qs,J=k[P];return J?r.jsxs("g",{transform:`translate(0 ${le})`,className:"ctx-panel",children:[P<2?R.map(Z=>r.jsxs("g",{children:[r.jsx("line",{x1:xn,x2:xn+N,y1:K(Z,P),y2:K(Z,P),className:Z===0?"ctx-base":"ctx-grid"}),r.jsxs("text",{x:xn-8,y:K(Z,P)+4,textAnchor:"end",className:"ctx-tick",children:[Z,E]})]},Z)):r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:xn,x2:xn+N,y1:$/2,y2:$/2,className:"ctx-base"}),r.jsx("text",{x:xn-8,y:$/2+4,textAnchor:"end",className:"ctx-tick",children:"0"})]}),r.jsx("text",{x:xn+2,y:12,className:"ctx-name",children:t_[P]}),r.jsx("g",{className:"ctx-bars","data-hover":x!==null||void 0,children:J.map((Z,W)=>{const ae=T[W],de=xn+ae.x,ve=P===2?$/2:$,je=K(Z,P),L=wa[y.contexts[W].substitution],U=Math.abs(ve-je);return r.jsx("rect",{x:de,y:Math.min(je,ve),width:ae.width,height:Math.max(U,Z===0?0:.8),rx:Math.min(2,ae.width/2),fill:L,className:"ctx-bar","data-on":x===W||void 0,"data-dim":m&&y.contexts[W].substitution!==m?"":void 0},W)})})]},P):null}),x!==null&&r.jsx("rect",{x:xn+T[x].x-2,y:va-4,width:T[x].width+4,height:(S?D[2]+ki:D[0]+qs)-va+8,rx:4,className:"ctx-column",pointerEvents:"none"}),m&&y.contexts.map((se,P)=>se.substitution===m?r.jsxs("text",{x:xn+T[P].x+T[P].width/2,y:(S?D[2]+ki:D[0]+qs)+16,textAnchor:"middle",className:"ctx-tri",children:[am(se)[0],r.jsx("tspan",{className:"ctx-tri-mid",style:{fill:wa[se.substitution]},children:am(se)[1]}),am(se)[2]]},P):null),T.map((se,P)=>r.jsx("rect",{x:xn+se.x-(se.width*.14+1),y:va,width:se.width*1.28+2,height:(S?D[2]+ki:D[0]+qs)-va,fill:"transparent",className:"ctx-hit",tabIndex:0,"aria-label":`${y.contexts[P].context}: ${y.contexts[P].observed} SNVs`,onMouseEnter:()=>v(P),onFocus:()=>v(P),onBlur:()=>v(null)},P))]}),ie&&x!==null&&r.jsxs(Zt,{x:oe(x),y:D[0]+qs/2,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:wa[ie.substitution]},"aria-hidden":!0}),r.jsx("span",{className:"mono",children:ie.context})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Observed"}),r.jsxs("b",{children:[im(j.observed[x],o),r.jsxs("i",{children:[" ",o==="share"?`${ie.observed.toLocaleString("en-US")} SNVs`:""]})]})]}),j.reconstructed&&j.difference&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rebuilt"}),r.jsx("b",{children:im(j.reconstructed[x],o)})]}),r.jsxs("span",{className:"ctip-note",children:[j.difference[x]>=0?"Observed above":"Observed below"," the signatures by"," ",im(Math.abs(j.difference[x]),o).replace("%",o==="share"?" points":"")]})]})]})]})}),!S&&r.jsx("p",{className:"ctx-note",children:"Only the observed profile is shown: this report did not include the signature matrix its fit used, so what the signatures rebuild cannot be drawn."})]})}const Sa=n=>n==null?"–":n.toFixed(2),l_=8,a_=250,Ie={w:232,h:148,cx:116,cy:122,r:92};function rm(n,l){const a=qi(Ie.cx,Ie.cy,Ie.r,n),o=qi(Ie.cx,Ie.cy,Ie.r,l);return`M${a.x.toFixed(2)},${a.y.toFixed(2)} A${Ie.r},${Ie.r} 0 0 1 ${o.x.toFixed(2)},${o.y.toFixed(2)}`}function i_({score:n}){const l=n.value===null?null:n.exact??n.value,a=l===null?null:Math.min(Math.max(l,0),1),o=HM(n),c=n.value!==null&&o!==n.value.toFixed(2),d=UM(n),h=n.rating==="HIGH",m=n.threshold,g=m===null?null:[qi(Ie.cx,Ie.cy,Ie.r-14,m),qi(Ie.cx,Ie.cy,Ie.r+14,m),qi(Ie.cx,Ie.cy,Ie.r+27,m)],x=a===null?null:qi(Ie.cx,Ie.cy,Ie.r,a);return r.jsxs("div",{className:"hrd-score","data-high":h||void 0,children:[r.jsxs("div",{className:"hrd-score-head",children:[r.jsx("span",{className:"hrd-name",children:n.name}),n.rating&&r.jsx("span",{className:`sc-pill ${h?"p-warn":"p-neu"}`,children:n.rating})]}),r.jsxs("svg",{width:Ie.w,height:Ie.h,viewBox:`0 0 ${Ie.w} ${Ie.h}`,role:"img","aria-label":`${n.name} ${a===null?"has no score":`scores ${o}`}${n.rating?`, rated ${n.rating}`:""}`,className:"hrd-gauge",children:[r.jsx("path",{d:rm(0,1),pathLength:1,className:"hrd-track"}),m!==null&&r.jsx("path",{d:rm(m,1),pathLength:1,className:"hrd-zone"}),a!==null&&r.jsx("path",{d:rm(0,1),pathLength:1,className:"hrd-fill",style:{"--v":a}}),g&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:g[0].x,y1:g[0].y,x2:g[1].x,y2:g[1].y,className:"hrd-tick"}),r.jsx("text",{x:g[2].x,y:g[2].y+4,textAnchor:"middle",className:"hrd-tick-label",children:m})]}),x&&r.jsx("circle",{cx:x.x,cy:x.y,r:8.5,className:"hrd-end"}),r.jsx("text",{x:Ie.cx,y:Ie.cy-10,textAnchor:"middle",className:"hrd-num",children:o}),r.jsx("text",{x:Ie.cx-Ie.r,y:Ie.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"0"}),r.jsx("text",{x:Ie.cx+Ie.r,y:Ie.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"1"})]}),(d||c)&&r.jsxs("span",{className:"hrd-rule",children:[d,c&&r.jsxs("span",{className:"hrd-rounded",children:["The report rounds it to ",Sa(n.value)]})]})]})}function o_(n){const l=n.filter(a=>a.stats&&a.stats.tumour!==null);return{above:l.filter(a=>a.stats.tumour>a.stats.median).length,of:l.length}}const r_="var(--font)";function c_({features:n}){var D;const[l,a]=Es(720),[o,c]=M.useState(null),d=n.map(C=>({feature:C,stats:yS(C)})),h=a<640,m=h?0:116,g=h?0:168,x=m+10,v=a-g-14,y=C=>x+C*(v-x),S=h?28:0,j=h?100:70,b=S+38,N=30,T=d.length*j+14,O=T+22,_=o===null?null:d[o];return r.jsxs("div",{ref:l,className:"clouds",onMouseLeave:()=>c(null),children:[r.jsxs("svg",{width:a,height:O,role:"img","aria-label":"HRDetect features against the cohort",style:{fontFamily:r_},children:[[0,.25,.5,.75,1].map(C=>r.jsx("line",{x1:y(C),x2:y(C),y1:0,y2:T,className:"cloud-grid","data-major":C===0||C===1||void 0},C)),d.map(({feature:C,stats:E},R)=>{var se;const A=R*j,B=wx(C.feature),K=E&&E.values.length<=a_?E.values:[],k=kM(K.map(y),7.5),ie=E&&E.values.length>=l_?$M(E.values):null,oe=E&&E.tumour!==null?y(E.tumour):null;return r.jsxs("g",{transform:`translate(0 ${A})`,className:"cloud-row","data-on":o===R||void 0,onMouseEnter:()=>c(R),children:[r.jsx("rect",{x:0,y:2,width:a,height:j-4,rx:12,className:"cloud-hit"}),E&&r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:y(E.q1),y:S+4,width:Math.max(y(E.q3)-y(E.q1),2),height:j-S-10,rx:8,className:"cloud-iqr"}),r.jsx("line",{x1:y(E.median),x2:y(E.median),y1:S+10,y2:j-14,className:"cloud-median"}),ie&&r.jsxs(r.Fragment,{children:[r.jsx("path",{d:`M${y(0)},${b} ${ie.map(P=>`L${y(P.x).toFixed(1)},${(b-P.y*N).toFixed(1)}`).join(" ")} L${y(1)},${b} Z`,className:"cloud-area"}),r.jsx("path",{d:ie.map((P,le)=>`${le?"L":"M"}${y(P.x).toFixed(1)},${(b-P.y*N).toFixed(1)}`).join(" "),className:"cloud-line"})]}),K.map((P,le)=>r.jsx("circle",{cx:y(P),cy:b+11+Math.min(k[le],2)*7,r:3,className:"cloud-dot"},le)),oe!==null&&r.jsxs("g",{className:"cloud-pin",transform:`translate(${oe} 0)`,children:[r.jsx("line",{y1:S+8,y2:b,className:"cloud-stem"}),r.jsx("circle",{cy:b,r:8,className:"cloud-pin-dot"})]})]}),r.jsx("text",{x:h?4:6,y:h?18:b-6,className:"cloud-name",children:B}),!h&&r.jsxs("text",{x:6,y:b+10,className:"cloud-raw",children:["raw ",Sa((se=C.sample)==null?void 0:se.raw)]}),E&&r.jsx("text",{x:a-4,y:h?18:b-6,textAnchor:"end",className:"cloud-rank",children:Vh(E)}),!h&&E&&r.jsxs("text",{x:a-4,y:b+10,textAnchor:"end",className:"cloud-raw",children:["of ",E.values.length," in the cohort"]})]},C.feature)}),r.jsxs("g",{transform:`translate(0 ${T})`,className:"cloud-axis",children:[r.jsx("text",{x:y(0),y:12,textAnchor:"start",children:"0 · cohort lowest"}),r.jsx("text",{x:y(.5),y:12,textAnchor:"middle",children:"0.5"}),r.jsx("text",{x:y(1),y:12,textAnchor:"end",children:"cohort highest · 1"})]})]}),_&&o!==null&&_.stats&&r.jsxs(Zt,{x:_.stats.tumour!==null?y(_.stats.tumour):y(_.stats.median),y:o*j+b,width:a,children:[r.jsx("span",{className:"ctip-title",children:wx(_.feature.feature,"long")}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[Sa((D=_.feature.sample)==null?void 0:D.raw)," ",r.jsxs("i",{children:["scaled ",Sa(_.stats.tumour)]})]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort median"}),r.jsx("b",{children:Sa(_.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Sa(_.stats.q1),"–",Sa(_.stats.q3)]})]}),Vh(_.stats)&&r.jsx("span",{className:"ctip-note",children:Vh(_.stats)})]})]})}const vr=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,xr=n=>Math.round(n).toLocaleString("en-US"),u_=n=>`${n>=0?"+":"−"}${Math.abs(n).toFixed(Math.abs(n)>=10?0:1)}`,qx=3,Hi=26,Ui=52;function f_({groups:n,bands:l,lit:a,onLight:o}){const[c,d]=Es(),h=n.find(R=>R.group==="sample")??n[0],m=n.find(R=>R.group==="cohort")??null,g=m!==null,x=d>=440,v=x?d>=620?118:92:0,y=g?330:230,S=Mx(l.map(R=>R.share),y,qx),j=g?Mx(l.map(R=>R.cohortShare??0),y,qx):[],b=g?v:0,N=d-v-Hi,T=b+Hi,O=N,_=l.find(R=>R.name===a)??null,D=_?l.indexOf(_):-1,C=D<0?0:Ui+((S[D].y0+S[D].y1)/2+(g?(j[D].y0+j[D].y1)/2:(S[D].y0+S[D].y1)/2))/2,E=(R,A,B,K,k,ie)=>{const oe=R.y1-R.y0;if(!x||oe<17)return null;const se=Ui+(R.y0+R.y1)/2,P=oe>=36;return r.jsxs("text",{x:k,y:se,textAnchor:ie,className:"flow-label",children:[r.jsxs("tspan",{x:k,dy:P?"-0.35em":"0.35em",className:"flow-name",children:[A.name,!P&&r.jsxs("tspan",{className:"flow-share",children:[" ",vr(B)]})]}),P&&r.jsxs("tspan",{x:k,dy:"1.35em",className:"flow-share",children:[vr(B),K]})]})};return r.jsxs("div",{ref:c,className:"flow","data-lit":a??void 0,children:[r.jsxs("svg",{width:d,height:Ui+y+4,role:"img","aria-label":"Signature shares, tumour against cohort",children:[r.jsxs("g",{className:"flow-head",children:[r.jsx("text",{x:0,y:16,className:"flow-col",children:Nx(h)}),r.jsxs("text",{x:0,y:34,className:"flow-sub",children:[xr(h.total)," mutations"]}),m&&r.jsxs(r.Fragment,{children:[r.jsx("text",{x:d,y:16,textAnchor:"end",className:"flow-col",children:Nx(m)}),r.jsxs("text",{x:d,y:34,textAnchor:"end",className:"flow-sub",children:["about ",xr(m.total)," each, on average"]})]})]}),g&&r.jsx("g",{className:"flow-ribs",transform:`translate(0 ${Ui})`,children:l.map((R,A)=>r.jsx("path",{d:LM(T,S[A],O,j[A]),fill:R.colour,className:"flow-rib","data-on":a===R.name||void 0,onMouseEnter:()=>o(R.name),onMouseLeave:()=>o(null)},R.name))}),l.map((R,A)=>{const B=a===R.name||void 0,K=(k,ie)=>k.y1-k.y0>.4&&r.jsx("rect",{x:ie,y:Ui+k.y0,width:Hi,height:k.y1-k.y0,rx:Math.min(5,(k.y1-k.y0)/2),fill:R.colour,className:"flow-seg","data-on":B,tabIndex:0,"aria-label":`${R.name}, ${vr(R.share)} of this tumour`,onMouseEnter:()=>o(R.name),onMouseLeave:()=>o(null),onFocus:()=>o(R.name),onBlur:()=>o(null)});return r.jsxs("g",{className:"flow-band","data-on":B,children:[K(S[A],b),g&&K(j[A],N),E(S[A],R,R.share,R.count?` · ${xr(R.count)}`:"",g?b-10:b+Hi+10,g?"end":"start"),g&&E(j[A],R,R.cohortShare??0,"",N+Hi+10,"start")]},R.name)}),g&&d>=520&&l.map((R,A)=>{const B=Rl(R),K=S[A],k=j[A];if(B===null||Math.abs(B)<5||Math.min(K.y1-K.y0,k.y1-k.y0)<22)return null;const ie=(T+O)/2,oe=Ui+(K.y0+K.y1+k.y0+k.y1)/4;return r.jsxs("g",{transform:`translate(${ie} ${oe})`,className:"flow-delta","data-on":a===R.name||void 0,children:[r.jsx("rect",{x:-30,y:-10,width:60,height:20,rx:10}),r.jsxs("text",{y:4,textAnchor:"middle",children:[u_(B)," pts"]})]},R.name)})]}),_&&r.jsxs(Zt,{x:g?d/2:b+Hi+v+20,y:C,width:d,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:_.colour},"aria-hidden":!0}),_.name]}),_.aetiology&&r.jsx("span",{className:"ctip-sub",children:_.aetiology}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[vr(_.share)," ",r.jsxs("i",{children:[xr(_.count)," mutations"]})]})]}),_.cohortShare!==null&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort"}),r.jsxs("b",{children:[vr(_.cohortShare)," ",r.jsx("i",{children:_.cohortCount!==null?`about ${xr(_.cohortCount)} each`:""})]})]}),Rl(_)!==null&&r.jsx("span",{className:"ctip-note",children:Math.abs(Rl(_))<1?"About the same as its cohort":`${Math.abs(Rl(_)).toFixed(Math.abs(Rl(_))>=10?0:1)} points ${Rl(_)>0?"above":"below"} its cohort`})]})]})}const Ix=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,kS=n=>Math.round(n).toLocaleString("en-US");function d_({points:n,reach:l}){if(n===null)return null;const a=Math.min(Math.abs(n)/l,1)*100;return r.jsx("span",{className:"lead","aria-hidden":!0,children:r.jsx("span",{className:"lead-bar","data-up":n>=0||void 0,style:{width:`${Math.max(a,n===0?0:3)}%`}})})}function h_({groups:n}){const[l,a]=M.useState(null),o=M.useMemo(()=>DM(n),[n]),c=n.find(h=>h.group==="cohort"),d=Math.max(10,...o.map(h=>Math.abs(Rl(h)??0)));return r.jsxs("section",{className:"sig-section","aria-label":"Mutational signatures",children:[r.jsx("h3",{className:"sv-h",children:"Mutational signatures"}),r.jsxs("div",{className:"sig-grid",children:[r.jsx(f_,{groups:n,bands:o,lit:l,onLight:a}),r.jsxs("div",{className:"sig-tablebox",children:[r.jsxs("table",{className:"sig-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Signature"}),r.jsx("th",{className:"n",children:"This tumour"}),c&&r.jsx("th",{className:"n",children:"Cohort"}),c&&r.jsx("th",{className:"lead-h",children:"Against cohort"})]})}),r.jsx("tbody",{children:o.map(h=>{const m=Rl(h);return r.jsxs("tr",{"data-lit":l===h.name||void 0,onMouseEnter:()=>a(h.name),onMouseLeave:()=>a(null),children:[r.jsxs("td",{children:[r.jsxs("span",{className:"sig-name",title:h.members.length>1?h.members.join(", "):void 0,children:[r.jsx("span",{className:"sv-swatch",style:{background:h.colour},"aria-hidden":!0}),h.name]}),h.aetiology&&r.jsx("span",{className:"sig-aetiology",children:h.aetiology})]}),r.jsxs("td",{className:"n",children:[r.jsx("span",{className:"mono",children:Ix(h.share)}),r.jsx("span",{className:"sig-count",children:kS(h.count)})]}),c&&r.jsx("td",{className:"n mono",children:Ix(h.cohortShare??0)}),c&&r.jsx("td",{children:r.jsxs("span",{className:"lead-cell",children:[r.jsx(d_,{points:m,reach:d}),r.jsx("span",{className:"lead-n mono",children:m===null?"":`${m>=0?"+":"−"}${Math.abs(m).toFixed(0)}`})]})})]},h.name)})})]}),r.jsx(Ku,{shown:o.length,total:o.length,noun:["signature","signatures"]})]})]})]})}function m_({envelope:n,loading:l}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(s_,{data:n.data}):n?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")||"No 96-context profile for this sample."})]}):l?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("div",{className:"px-5 pb-3",children:r.jsx("div",{className:"skeleton",style:{height:220},"aria-label":"Loading 96 mutational contexts"})})]}):null}function g_({hrd:n}){const l=M.useMemo(()=>o_(n.features.map(a=>({feature:a,stats:yS(a)}))),[n.features]);return r.jsxs("section",{className:"sig-section","aria-label":"Homologous recombination deficiency",children:[r.jsx("h3",{className:"sv-h",children:"Homologous recombination deficiency"}),r.jsxs("div",{className:"hrd-body",children:[n.scores.length>0&&r.jsx("div",{className:"hrd-scores",children:n.scores.map(a=>r.jsx(i_,{score:a},a.name))}),n.features.length>0&&r.jsxs("div",{className:"hrd-chart",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h4",{className:"hrd-sub",children:["HRDetect features against the cohort",n.cohort_n?r.jsxs("span",{className:"sv-h-n",children:["n = ",n.cohort_n]}):null]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-dot","aria-hidden":!0}),"Cohort sample"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-band","aria-hidden":!0}),"Middle half of the cohort"]})]})]}),l.of>0&&r.jsxs("p",{className:"hrd-lede",children:["Above the cohort median on ",r.jsx("b",{children:l.above})," of ",l.of," features"]}),r.jsx(c_,{features:n.features})]})]})]})}const p_=M.forwardRef(function({envelope:l,loading:a,contextEnvelope:o,contextLoading:c=!1,picked:d},h){var x;const m=(l==null?void 0:l.status)==="ok"?l.data:null,g=(x=m==null?void 0:m.signatures)==null?void 0:x.find(v=>v.group==="sample");return r.jsx(uo,{ref:h,title:"Signatures and HRD",subtitle:g?`${kS(g.total)} mutations attributed to signatures`:void 0,lineage:Qu(l==null?void 0:l.lineage,o==null?void 0:o.lineage),picked:d,info:"signaturesHrd",className:"sigs",children:r.jsx(Vl,{label:"signatures and HRD",envelope:l,loading:a,skeletonHeight:300,children:v=>r.jsxs("div",{className:"sig-body",children:[v.signatures?r.jsx(h_,{groups:v.signatures}):r.jsx("p",{className:"sv-empty",children:"No signature contributions for this sample."}),r.jsx(m_,{envelope:o,loading:c}),v.hrd&&r.jsx(g_,{hrd:v.hrd})]})})})});function Zm(n){return n.kind==="insertion"?"insertion":n.kind==="complex"?"complex":n.mechanism==="microhomology"?"microhomology":n.mechanism==="repeat"?"repeat":"other deletion"}const Jm=[{key:"microhomology",label:"Deletion, microhomology",colour:"#9f1d2d"},{key:"repeat",label:"Deletion, repeat",colour:"#d6455a"},{key:"other deletion",label:"Deletion, other",colour:"#f19aa6"},{key:"insertion",label:"Insertion",colour:"#1f9a6c"},{key:"complex",label:"Complex",colour:"#8a8a93"}],Qx=Object.fromEntries(Jm.map(n=>[n.key,n.colour]));function Ii(n){switch((n.sv_type??"").toUpperCase()){case"DEL":return"deletion";case"DUP":return"tandem-duplication";case"INV":return"inversion";default:return n.chrom1===n.chrom2?"inversion":"translocation"}}const ju=bn;function Yx(n=null,l=.42,a=.012){var g;const o=ju.reduce((x,[,v])=>x+v,0),c=2*Math.PI-a*ju.length,d=n?((g=ju.find(([x])=>x===n))==null?void 0:g[1])??0:0,h=[];let m=a/2;for(const[x,v]of ju){const y=!n||!d?v/o*c:x===n?c*l:v/(o-d)*c*(1-l);h.push({chrom:x,length:v,a0:m,a1:m+y}),m+=y+a}return h}function y_(n,l,a){return l.map((o,c)=>({...o,a0:n[c].a0+(o.a0-n[c].a0)*a,a1:n[c].a1+(o.a1-n[c].a1)*a}))}function v_(n){return new Map(n.map(l=>[l.chrom,l]))}function Is(n,l,a){const o=n.get(l.replace(/^chr/,""));if(!o)return null;const c=Math.min(Math.max(a/o.length,0),1);return o.a0+c*(o.a1-o.a0)}function Ot(n,l,a,o){return[n+a*Math.sin(o),l-a*Math.cos(o)]}function wu(n,l,a,o,c,d){const h=d-c>Math.PI?1:0,[m,g]=Ot(n,l,o,c),[x,v]=Ot(n,l,o,d),[y,S]=Ot(n,l,a,d),[j,b]=Ot(n,l,a,c),N=T=>T.toFixed(2);return`M${N(m)},${N(g)} A${o},${o} 0 ${h} 1 ${N(x)},${N(v)} L${N(y)},${N(S)} A${a},${a} 0 ${h} 0 ${N(j)},${N(b)} Z`}function x_(n,l,a,o,c){const[d,h]=Ot(n,l,a,o),[m,g]=Ot(n,l,a,c);let x=Math.abs(o-c);x>Math.PI&&(x=2*Math.PI-x);const v=Math.min(x/Math.PI,1),y=(o+c)/2+(Math.abs(o-c)>Math.PI?Math.PI:0),[S,j]=Ot(n,l,a*(1-v*.95),y),b=N=>N.toFixed(2);return`M${b(d)},${b(h)} Q${b(S)},${b(j)} ${b(m)},${b(g)}`}function cm(n,l,a,o){const c=Math.log10(Math.max(n,1));return l+Math.min(c,o)/o*(a-l)}function Px(n,l,a,o){const c=Math.atan2(a-n,l-o);return c<0?c+2*Math.PI:c}function Xx(n,l){return n.find(a=>l>=a.a0&&l<=a.a1)??null}function S_(n,l=12){const a=new Map;return n.forEach((o,c)=>{const d=`${Math.floor(o.x/l)},${Math.floor(o.y/l)}`,h=a.get(d);h?h.push(c):a.set(d,[c])}),(o,c,d=7)=>{const h=Math.floor(o/l),m=Math.floor(c/l);let g=null,x=d*d;for(let v=-1;v<=1;v++)for(let y=-1;y<=1;y++)for(const S of a.get(`${h+v},${m+y}`)??[]){const j=(n[S].x-o)**2+(n[S].y-c)**2;j<=x&&(x=j,g=S)}return g}}const We={ideoIn:.955,rainOut:.93,rainIn:.64,insOut:.625,insIn:.6,delOut:.59,delIn:.565,majOut:.553,majIn:.515,minOut:.505,minIn:.47,link:.455},um=8,b_=560,fm=1e6,Nu=(n,l)=>`chr${n}:${l.toLocaleString("en-US")}`,Kx=n=>n>=1e6?`${(n/1e6).toFixed(1)} Mb`:n>=1e3?`${(n/1e3).toFixed(1)} kb`:`${n} bp`;function j_(n){return n===null||n<2?null:n<4?"color-mix(in srgb, var(--gain) 45%, transparent)":n<8?"color-mix(in srgb, var(--gain) 80%, transparent)":"var(--gain-strong)"}function w_({data:n,drivers:l,size:a,tracks:o,lit:c}){var P,le;const d=M.useRef(null),[h,m]=M.useState(null),[g,x]=M.useState(null),[v,y]=M.useState(()=>Yx()),S=M.useRef(v);S.current=v,M.useLayoutEffect(()=>{const $=Yx(h);if(typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches){y($);return}const Z=S.current,W=performance.now();let ae=0;const de=ve=>{const je=Math.min(1,(ve-W)/b_);y(y_(Z,$,pg(je))),je<1&&(ae=requestAnimationFrame(de))};return ae=requestAnimationFrame(de),()=>cancelAnimationFrame(ae)},[h]);const j=M.useMemo(()=>v_(v),[v]),b=a/2,N=a/2,T=a/2-58,O=$=>T*$,_=M.useMemo(()=>{const $=[];for(const[J,Z]of Object.entries(n.snvs))for(let W=0;W<Z.pos.length;W++){const ae=Is(j,J,Z.pos[W]);if(ae===null)continue;const[de,ve]=Ot(b,N,cm(Z.distance[W],O(We.rainIn),O(We.rainOut),um),ae);$.push({x:de,y:ve,chrom:J,pos:Z.pos[W],substitution:Z.substitution[W],distance:Z.distance[W]})}return $},[n.snvs,j,a]),D=M.useMemo(()=>S_(_),[_]);M.useEffect(()=>{const $=d.current;if(!$)return;const J=typeof window<"u"&&window.devicePixelRatio||1;$.width=a*J,$.height=a*J;const Z=$.getContext("2d");if(Z){if(Z.setTransform(J,0,0,J,0,0),Z.clearRect(0,0,a,a),o.rainfall){const W=h?2.1:1.6;for(const ae of _){const de=c&&(c.kind!=="substitution"||c.value!==ae.substitution);Z.globalAlpha=de?.1:.85,Z.fillStyle=wa[ae.substitution]??"#999",Z.beginPath(),Z.arc(ae.x,ae.y,W,0,2*Math.PI),Z.fill()}}if(o.indels&&n.indels){Z.lineWidth=h?1.6:1.1;for(const W of n.indels){const ae=Is(j,W.chrom,(W.start+W.end)/2);if(ae===null)continue;const de=Zm(W),ve=c&&(c.kind!=="indel"||c.value!==de);Z.globalAlpha=ve?.12:.9,Z.strokeStyle=Qx[de];const je=W.kind==="insertion"?O(We.insIn):O(We.delIn),L=W.kind==="insertion"?O(We.insOut):O(We.delOut),[U,I]=Ot(b,N,je,ae),[re,ce]=Ot(b,N,L,ae);Z.beginPath(),Z.moveTo(U,I),Z.lineTo(re,ce),Z.stroke()}}Z.globalAlpha=1}},[_,n.indels,j,a,o.rainfall,o.indels,c,h,b,N,T]);const C=M.useMemo(()=>{const $=new Map;for(const ae of l)ae.gene&&!$.has(ae.gene)&&$.set(ae.gene,ae);const J=[...$.values()].map(ae=>({d:ae,angle:Is(j,ae.chrom,ae.pos)})).filter(ae=>ae.angle!==null).sort((ae,de)=>ae.angle-de.angle),Z=T+30,W=zu(J.map(ae=>({left:ae.angle*Z,width:Cs(ae.d.gene??"",11,600)+8})),2);return J.map((ae,de)=>({...ae,row:W[de]}))},[l,j,T]),E=n.svs,R=E.map($=>[Is(j,$.chrom1,$.pos1),Is(j,$.chrom2,$.pos2)]),A=h?j.get(h):void 0,B=A?Pu(A.length/fm,8).filter($=>$*fm<=A.length):[],K=$=>{var ve;if((ve=$.target.classList)!=null&&ve.contains("circ-link-hit"))return;const J=$.currentTarget.getBoundingClientRect(),Z=$.clientX-J.left,W=$.clientY-J.top,ae=Math.hypot(Z-b,W-N),de=Px(b,N,Z,W);if(ae>=O(We.ideoIn)&&ae<=T+22){const je=Xx(v,de);x(je?{kind:"chrom",chrom:je.chrom,x:Z,y:W}:null);return}if(o.rainfall&&ae>=O(We.rainIn)-4&&ae<=O(We.rainOut)+4){const je=D(Z,W);if(je!==null){const L=_[je];x({kind:"snv",chrom:L.chrom,pos:L.pos,substitution:L.substitution,distance:L.distance,x:L.x,y:L.y});return}}if(o.indels&&n.indels&&ae>=O(We.delIn)&&ae<=O(We.insOut)){let je=-1,L=.01;if(n.indels.forEach((U,I)=>{const re=Is(j,U.chrom,(U.start+U.end)/2);re!==null&&Math.abs(re-de)<L&&(L=Math.abs(re-de),je=I)}),je>=0){x({kind:"indel",index:je,x:Z,y:W});return}}(g==null?void 0:g.kind)!=="link"&&x(null)},k=$=>!c||c.kind==="sv"&&c.value===Ii($),ie=(g==null?void 0:g.kind)==="chrom"?g.chrom:null,oe=(g==null?void 0:g.kind)==="link"?E[g.index]:null,se=(g==null?void 0:g.kind)==="indel"&&n.indels?n.indels[g.index]:null;return r.jsxs("div",{className:"circ",style:{width:a,height:a},onMouseLeave:()=>x(null),children:[r.jsxs("svg",{width:a,height:a,className:"circ-under","aria-hidden":!0,children:[v.map(($,J)=>r.jsx("path",{d:wu(b,N,O(We.rainIn),O(We.rainOut),$.a0,$.a1),className:"circ-band","data-odd":J%2||void 0,"data-on":ie===$.chrom||h===$.chrom||void 0},$.chrom)),[2,4,6].map($=>r.jsx("circle",{cx:b,cy:N,r:cm(10**$,O(We.rainIn),O(We.rainOut),um),className:"circ-grid"},$))]}),r.jsx("canvas",{ref:d,className:"circ-canvas",style:{width:a,height:a},"aria-hidden":!0}),r.jsxs("svg",{width:a,height:a,className:"circ-over",role:"img","aria-label":`Integrated circos: ${n.snv_total.toLocaleString("en-US")} SNVs, ${((P=n.indels)==null?void 0:P.length)??0} indels, ${E.length} rearrangements`,onMouseMove:K,onClick:$=>{const J=$.currentTarget.getBoundingClientRect(),Z=$.clientX-J.left,W=$.clientY-J.top,ae=Math.hypot(Z-b,W-N);if(ae<O(We.ideoIn)||ae>T+22)return;const de=Xx(v,Px(b,N,Z,W));de&&m(ve=>ve===de.chrom?null:de.chrom)},children:[[2,4,6].map($=>{const[J,Z]=Ot(b,N,cm(10**$,O(We.rainIn),O(We.rainOut),um),0);return r.jsx("text",{x:J+3,y:Z-2,className:"circ-scale",children:$===2?"100 bp":$===4?"10 kb":"1 Mb"},$)}),o.copyNumber&&n.segments.map(($,J)=>{const Z=Is(j,$.chrom,$.start),W=Is(j,$.chrom,$.end);if(Z===null||W===null||W-Z<=0)return null;const ae=j_($.major_cn),de=$.minor_cn===0;return r.jsxs("g",{children:[ae&&r.jsx("path",{d:wu(b,N,O(We.majIn),O(We.majOut),Z,W),style:{fill:ae},className:"circ-cn"}),de&&r.jsx("path",{d:wu(b,N,O(We.minIn),O(We.minOut),Z,W),className:"circ-loh"})]},J)}),o.copyNumber&&r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:b,cy:N,r:O(We.majIn),className:"circ-ring-line"}),r.jsx("circle",{cx:b,cy:N,r:O(We.minIn),className:"circ-ring-line"})]}),o.links&&E.map(($,J)=>{const[Z,W]=R[J];if(Z===null||W===null)return null;const ae=x_(b,N,O(We.link),Z,W),de=(g==null?void 0:g.kind)==="link"&&g.index===J,ve=Ii($);return r.jsxs("g",{className:"circ-link","data-on":de||void 0,"data-dim":!k($)||void 0,children:[r.jsx("path",{d:ae,style:{stroke:zn[ve]},className:"circ-link-line"}),r.jsx("path",{d:ae,className:"circ-link-hit",onMouseEnter:je=>{const L=je.currentTarget.ownerSVGElement.getBoundingClientRect();x({kind:"link",index:J,x:je.clientX-L.left,y:je.clientY-L.top})},onMouseLeave:()=>x(null)})]},J)}),v.map(($,J)=>{const Z=($.a0+$.a1)/2,[W,ae]=Ot(b,N,T+13,Z),de=($.a1-$.a0)*T;return r.jsxs("g",{className:"circ-chrom","data-on":ie===$.chrom||h===$.chrom||void 0,children:[r.jsx("path",{d:wu(b,N,O(We.ideoIn),T,$.a0,$.a1),className:"circ-ideo","data-odd":J%2||void 0}),de>9&&r.jsx("text",{x:W,y:ae+4,textAnchor:"middle",className:"circ-name",children:$.chrom})]},$.chrom)}),A&&B.map($=>{const J=Is(j,A.chrom,$*fm);if(J===null)return null;const[Z,W]=Ot(b,N,O(We.ideoIn),J),[ae,de]=Ot(b,N,O(We.ideoIn)-6,J),[ve,je]=Ot(b,N,O(We.ideoIn)-15,J);return r.jsxs("g",{className:"circ-mb",children:[r.jsx("line",{x1:Z,y1:W,x2:ae,y2:de}),r.jsx("text",{x:ve,y:je+3,textAnchor:"middle",children:$})]},$)}),C.map(({d:$,angle:J,row:Z})=>{const[W,ae]=Ot(b,N,T+2,J),[de,ve]=Ot(b,N,T+24+Z*13,J),[je,L]=Ot(b,N,T+28+Z*13,J),U=Math.sin(J)>=0;return r.jsxs("g",{className:"circ-driver",children:[r.jsx("line",{x1:W,y1:ae,x2:de,y2:ve}),r.jsx("text",{x:je,y:L+4,textAnchor:U?"start":"end",children:$.gene})]},$.gene)}),h&&r.jsxs("text",{x:b,y:N+4,textAnchor:"middle",className:"circ-centre",children:["chr",h," · click it again to close"]})]}),(g==null?void 0:g.kind)==="snv"&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:wa[g.substitution]},"aria-hidden":!0}),g.substitution," SNV"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Nu(g.chrom,g.pos)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From the SNV before"}),r.jsx("b",{children:Kx(g.distance)})]})]}),se&&g&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Qx[Zm(se)]},"aria-hidden":!0}),se.kind==="deletion"?`Deletion, ${se.mechanism==="none"?"other":se.mechanism}`:se.kind==="insertion"?"Insertion":"Complex indel"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Nu(se.chrom,se.start)})]})]}),oe&&g&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[Ii(oe)]},"aria-hidden":!0}),$a[Ii(oe)]]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From"}),r.jsx("b",{className:"mono",children:Nu(oe.chrom1,oe.pos1)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"To"}),r.jsx("b",{className:"mono",children:Nu(oe.chrom2,oe.pos2)})]}),oe.chrom1===oe.chrom2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Spanning"}),r.jsx("b",{children:Kx(Math.abs(oe.pos2-oe.pos1))})]})]}),(g==null?void 0:g.kind)==="chrom"&&r.jsxs(Zt,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:["Chromosome ",g.chrom]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"SNVs"}),r.jsx("b",{children:(((le=n.snvs[g.chrom])==null?void 0:le.pos.length)??0).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements touching it"}),r.jsx("b",{children:E.filter($=>$.chrom1===g.chrom||$.chrom2===g.chrom).length})]}),r.jsx("span",{className:"ctip-note",children:h===g.chrom?"Click to close it":"Click to open it out"})]})]})}const N_=[{key:"rainfall",label:"SNV rainfall"},{key:"indels",label:"Indels"},{key:"copyNumber",label:"Copy number"},{key:"links",label:"Rearrangements"}],Zx=["translocation","inversion","deletion","tandem-duplication"];function Cu({label:n,sub:l,count:a,top:o,colour:c,on:d,onEnter:h,onLeave:m}){return r.jsxs("li",{className:"circ-bar","data-on":d||void 0,onMouseEnter:h,onMouseLeave:m,tabIndex:h?0:void 0,onFocus:h,onBlur:m,children:[r.jsxs("span",{className:"circ-bar-label",children:[r.jsx("span",{className:"sv-swatch",style:{background:c},"aria-hidden":!0}),n,l&&r.jsx("i",{children:l})]}),r.jsx("span",{className:"circ-bar-track",children:r.jsx("span",{style:{width:`${o?a/o*100:0}%`,background:c}})}),r.jsx("span",{className:"circ-bar-n mono",children:a.toLocaleString("en-US")})]})}function C_({data:n,lit:l,onLit:a}){var x;const o=M.useMemo(()=>{const v=Object.fromEntries(Bx.map(y=>[y,0]));for(const y of Object.values(n.snvs))for(const S of y.substitution)v[S]=(v[S]??0)+1;return v},[n.snvs]),c=M.useMemo(()=>{const v=Object.fromEntries(Jm.map(y=>[y.key,0]));for(const y of n.indels??[])v[Zm(y)]+=1;return v},[n.indels]),d=M.useMemo(()=>{const v=Object.fromEntries(Zx.map(y=>[y,0]));for(const y of n.svs)v[Ii(y)]+=1;return v},[n.svs]),h=Math.max(0,...n.signatures.map(v=>v.count??0)),m=()=>a(null),g=(v,y)=>(l==null?void 0:l.kind)===v&&l.value===y;return r.jsxs("div",{className:"circ-panels",children:[r.jsxs("section",{"aria-label":"Substitutions",children:[r.jsxs("h4",{children:["Substitutions ",r.jsx("span",{children:n.snv_total.toLocaleString("en-US")})]}),r.jsx("ul",{children:Bx.map(v=>r.jsx(Cu,{label:v,count:o[v],top:Math.max(...Object.values(o),1),colour:wa[v],on:g("substitution",v),onEnter:()=>a({kind:"substitution",value:v}),onLeave:m},v))}),n.signatures.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h5",{children:"Top signatures"}),r.jsx("ul",{children:n.signatures.map(v=>r.jsx(Cu,{label:v.signature,sub:v.aetiology,count:Math.round(v.count??0),top:h,colour:"var(--chev)"},v.signature))})]})]}),r.jsxs("section",{"aria-label":"Indels",children:[r.jsxs("h4",{children:["Indels ",r.jsx("span",{children:(((x=n.indels)==null?void 0:x.length)??0).toLocaleString("en-US")})]}),n.indels?r.jsx("ul",{children:Jm.map(v=>r.jsx(Cu,{label:v.label,count:c[v.key],top:Math.max(...Object.values(c),1),colour:v.colour,on:g("indel",v.key),onEnter:()=>a({kind:"indel",value:v.key}),onLeave:m},v.key))}):r.jsx("p",{className:"circ-note",children:"This report did not include WGSPOST's indel classification; rerun it to see indels here."})]}),r.jsxs("section",{"aria-label":"Karyotype",children:[r.jsx("h4",{children:"Karyotype"}),r.jsxs("p",{className:"circ-karyo",children:["Purity ",r.jsx("b",{children:n.purity===null?"–":n.purity.toFixed(2)})," · Ploidy ",r.jsx("b",{children:n.ploidy===null?"–":n.ploidy.toFixed(1)})]}),r.jsxs("ul",{className:"circ-key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-gain","aria-hidden":!0})," Gain of the major allele, darker for more copies"]}),r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-loh","aria-hidden":!0})," Loss of heterozygosity (no minor allele)"]})]})]}),r.jsxs("section",{"aria-label":"Rearrangements",children:[r.jsxs("h4",{children:["Rearrangements ",r.jsx("span",{children:n.svs.length.toLocaleString("en-US")})]}),r.jsx("ul",{children:Zx.map(v=>r.jsx(Cu,{label:$a[v],count:d[v],top:Math.max(...Object.values(d),1),colour:zn[v],on:g("sv",v),onEnter:()=>a({kind:"sv",value:v}),onLeave:m},v))})]})]})}const M_=M.forwardRef(function({envelope:l,loading:a,picked:o,drivers:c},d){const[h,m]=Es(900),[g,x]=M.useState({rainfall:!0,indels:!0,copyNumber:!0,links:!0}),[v,y]=M.useState(null),S=m>=860,j=Math.max(280,Math.min(S?m-340:m,680));return r.jsx(uo,{ref:d,title:"Integrated circos",subtitle:"SNVs, indels, copy number and rearrangements around the genome",lineage:(l==null?void 0:l.lineage)??[],picked:o,info:"circos",className:"circos",controls:r.jsx("div",{className:"circ-tracks",role:"group","aria-label":"Tracks",children:N_.map(b=>r.jsx("button",{type:"button",className:"circ-track","aria-pressed":g[b.key],onClick:()=>x(N=>({...N,[b.key]:!N[b.key]})),children:b.label},b.key))}),children:r.jsx("div",{ref:h,children:r.jsx(Vl,{label:"integrated circos",envelope:l,loading:a,skeletonHeight:420,children:b=>r.jsxs("div",{className:"circ-body","data-wide":S||void 0,children:[r.jsxs("div",{className:"circ-stage",children:[r.jsx(w_,{data:b,drivers:c,size:j,tracks:g,lit:v}),r.jsx("p",{className:"circ-hint",children:"Click a chromosome to open it out. Closer SNVs sit further in: clusters such as kataegis fall towards the centre."})]}),r.jsx(C_,{data:b,lit:v,onLit:y})]})})})})}),HS=Object.fromEntries([...bn,["Y",59373566]]),Or=Object.keys(HS),Yi=n=>HS[n]??1,E_=2e4;function dm(n){return[1,Yi(n)]}function Nr(n,l,a,o){const c=Math.min(Math.max((n[1]-n[0])*a,E_),o-1),d=(l-n[0])/(n[1]-n[0]||1);return US([l-d*c,l-d*c+c],o)}function hm(n,l,a){return US([n[0]+l,n[1]+l],a)}function US([n,l],a){const o=Math.min(l-n,a-1),c=Math.min(Math.max(n,1),a-o);return[c,c+o]}function T_(n,l,a){return[n[0]+(l[0]-n[0])*a,n[1]+(l[1]-n[1])*a]}function FS([n,l],a=6){const o=(l-n)/a,c=10**Math.floor(Math.log10(o)),d=o/c,h=(d<1.5?1:d<3.5?2:d<7.5?5:10)*c,m=[];for(let g=Math.ceil(n/h)*h;g<=l;g+=h)m.push({value:g,label:h<1e5?`${(g/1e3).toLocaleString("en-US")} kb`:`${+(g/1e6).toFixed(2)} Mb`});return m}function __(n){const l=n.filter(d=>Number.isFinite(d)).sort((d,h)=>d-h);if(!l.length)return[0,4];const a=d=>l[Math.min(l.length-1,Math.max(0,Math.round(d*(l.length-1))))],o=Math.max(0,Math.floor(a(.01))),c=Math.max(Math.ceil(a(.995)),o+1);return[o,c]}function R_(n,l=1){const a=n.filter(d=>Number.isFinite(d)).map(Math.abs).sort((d,h)=>d-h),o=a.length?a[Math.min(a.length-1,Math.floor(.995*(a.length-1)))]:l,c=Math.max(l,Math.ceil(o*2)/2);return[-c,c]}const Jx=n=>n===null?"":`: ${+(n*100).toFixed(1)}%`;function VS(n){if(n.major_cn===null||n.minor_cn===null)return[];const l=[`${n.major_cn}+${n.minor_cn}${Jx(n.clonal_frac)}`];return n.major_cn_2!==null&&n.minor_cn_2!==null&&l.push(`${n.major_cn_2}+${n.minor_cn_2}${Jx(n.clonal_frac_2)}`),l}const jg=n=>n.clonal_frac!==null&&n.clonal_frac<1;function A_(n,l){const a=[];for(const o of n){const c=Ii(o);if(o.chrom1===l&&o.chrom2===l){const[d,h]=o.pos1<=o.pos2?[o.pos1,o.pos2]:[o.pos2,o.pos1],m=c==="inversion"?"lower":"upper",g=c==="tandem-duplication"?!1:c==="inversion"?o.orientation!=="--":!0;a.push({kind:"arc",sv:o,svClass:c,from:d,to:h,lane:m,up:g})}else o.chrom1===l?a.push({kind:"out",sv:o,svClass:c,at:o.pos1,partner:o.chrom2,partnerPos:o.pos2}):o.chrom2===l&&a.push({kind:"out",sv:o,svClass:c,at:o.pos2,partner:o.chrom1,partnerPos:o.pos1})}return a}function BS(n,l){let a=0,o=n.length-1;if(o<0)return-1;for(;a<o;){const c=a+o>>1;n[c]<l?a=c+1:o=c}return a>0&&Math.abs(n[a-1]-l)<=Math.abs(n[a]-l)?a-1:a}const Ys=(()=>{const n={};let l=0;for(const a of Or)n[a]=l,l+=Yi(a);return{offsets:n,total:l}})(),O_=420;function GS({view:n,onView:l,length:a,left:o,plotW:c}){const d=M.useRef(null),[h,m]=M.useState(n.span),g=M.useRef(h);g.current=h,M.useLayoutEffect(()=>{const C=n.span,E=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!n.smooth||E){m(C);return}const R=g.current,A=performance.now();let B=0;const K=k=>{const ie=Math.min(1,(k-A)/O_);m(T_(R,C,pg(ie))),ie<1&&(B=requestAnimationFrame(K))};return B=requestAnimationFrame(K),()=>cancelAnimationFrame(B)},[n]);const x=M.useCallback(C=>o+(C-h[0])/(h[1]-h[0])*c,[h,o,c]),v=M.useCallback(C=>h[0]+(C-o)/c*(h[1]-h[0]),[h,o,c]),y=M.useCallback(C=>l({span:C,smooth:!1}),[l]),S=M.useCallback(C=>l({span:C,smooth:!0}),[l]),j=h[1]-h[0]<a-1,b=M.useRef({shown:h,plotW:c,left:o,move:y,length:a});b.current={shown:h,plotW:c,left:o,move:y,length:a},M.useEffect(()=>{const C=d.current;if(C)return pS(C,()=>{const E=b.current,R=E.shown[1]-E.shown[0];return{inside:A=>A>=E.left&&A<=E.left+E.plotW,zoom:(A,B)=>{const K=Nr(E.shown,E.shown[0]+(B-E.left)/E.plotW*R,A,E.length);return Math.abs(K[0]-E.shown[0])<1&&Math.abs(K[1]-E.shown[1])<1?!1:(E.move(K),!0)},pan:A=>E.move(hm(E.shown,A/E.plotW*R,E.length))}})},[]);const N=C=>{var E;return C.clientX-(((E=d.current)==null?void 0:E.getBoundingClientRect().left)??0)},T=M.useRef(!1);return{box:d,shown:h,x,posAt:v,localX:N,glide:S,zoomed:j,dragged:T,handlers:{onPointerDown:C=>{if(C.button!==0||!j)return;const E=h;Du(C,R=>y(hm(E,-(R/c)*(E[1]-E[0]),a)),R=>{R&&(T.current=!0,setTimeout(()=>T.current=!1,0))})},onDoubleClick:C=>{const E=N(C);E>=o&&E<=o+c&&S(Nr(h,v(E),.5,a))},onKeyDown:C=>{const E=(h[0]+h[1])/2,R=h[1]-h[0];if(C.key==="ArrowLeft"||C.key==="ArrowRight")y(hm(h,(C.key==="ArrowLeft"?-.15:.15)*R,a));else if(C.key==="+"||C.key==="=")S(Nr(h,E,.6,a));else if(C.key==="-")S(Nr(h,E,1/.6,a));else if(C.key==="0"||C.key==="Home")S([1,a]);else return;C.preventDefault()}}}}const Ve=52,wg=14,Fi=150,Vi=96,xa=170,z_=26,Sr=n=>Math.round(n).toLocaleString("en-US"),D_=n=>`${+(n/1e6).toFixed(n<1e7?3:2)} Mb`;function L_(n,l,a){return!n||typeof getComputedStyle>"u"?a:getComputedStyle(n).getPropertyValue(l).trim()||a}function Wm({width:n,height:l,top:a,xs:o,ys:c,colour:d,radius:h=1.3,alpha:m=.5,label:g}){const x=M.useRef(null);return M.useEffect(()=>{const v=x.current;if(!v)return;const y=typeof window<"u"&&window.devicePixelRatio||1;v.width=Math.round(n*y),v.height=Math.round(l*y);const S=v.getContext("2d");if(S){S.setTransform(y,0,0,y,0,0),S.clearRect(0,0,n,l),S.fillStyle=d.startsWith("--")?L_(v,d,"#666"):d,S.globalAlpha=m;for(let j=0;j<o.length;j++){const b=o[j];b<Ve-h||b>n-wg+h||!Number.isFinite(c[j])||(S.beginPath(),S.arc(b,c[j],h,0,2*Math.PI),S.fill())}S.globalAlpha=1}},[n,l,o,c,d,h,m]),r.jsx("canvas",{ref:x,className:"cnsv-dots",style:{top:a,width:n,height:l},"aria-label":g,role:"img"})}function $_({data:n,width:l,view:a,onView:o}){const c=M.useId(),d=Yi(n.chrom),h=Math.max(l-Ve-wg,200),{box:m,shown:g,x,posAt:v,localX:y,glide:S,zoomed:j,dragged:b,handlers:N}=GS({view:a,onView:o,length:d,left:Ve,plotW:h}),T=0,O=Fi+10,_=O+Vi,D=_+xa,C=D+z_,E=O+Vi*.4,R=O+Vi*.8,A=I=>T+8+(1-I)*(Fi-16),[B,K]=M.useMemo(()=>{var I;return __(((I=n.depth)==null?void 0:I.cn)??[])},[n.depth]),k=I=>_+6+(1-(Math.min(Math.max(I,B),K)-B)/(K-B))*(xa-12),ie=M.useMemo(()=>n.baf?n.baf.pos.map(x):[],[n.baf,x]),oe=M.useMemo(()=>n.baf?n.baf.baf.map(A):[],[n.baf]),se=M.useMemo(()=>n.depth?n.depth.start.map((I,re)=>(I+n.depth.end[re])/2):[],[n.depth]),P=M.useMemo(()=>se.map(x),[se,x]),le=M.useMemo(()=>n.depth?n.depth.cn.map(k):[],[n.depth,B,K]),$=M.useMemo(()=>A_(n.svs,n.chrom),[n.svs,n.chrom]),[J,Z]=M.useState(null),W=(J==null?void 0:J.kind)==="sv"?J.mark.sv:null,ae=I=>{var ce,xe;if((xe=(ce=I.target).closest)!=null&&xe.call(ce,".cnsv-sv-hit"))return;const re=y(I);Z(re>=Ve&&re<=Ve+h?{kind:"cursor",x:re,pos:v(re)}:null)},de=I=>{if(b.current)return;const[re,ce]=I.kind==="arc"?[I.from,I.to]:[I.at-5e5,I.at+5e5],xe=Math.max((ce-re)*.4,15e4);S(Nr([re-xe,ce+xe],(re+ce)/2,1,d))},ve=FS(g,Math.max(2,Math.round(h/110))),je=n.segments.filter(I=>I.end>=g[0]&&I.start<=g[1]),L=M.useMemo(()=>{const I=Math.max(1,Math.ceil((K-B)/6)),re=[];for(let ce=B;ce<=K;ce+=I)re.push(ce);return re},[B,K]),U=`${c}-clip`;return r.jsxs("div",{ref:m,className:"cnsv-view",style:{height:C},tabIndex:0,role:"group","aria-label":`Chromosome ${n.chrom}: BAF, rearrangements and read depth. Arrow keys pan, plus and minus zoom.`,"data-zoomed":j||void 0,...N,onPointerMove:ae,onPointerLeave:()=>Z(null),children:[n.baf&&r.jsx(Wm,{width:l,height:Fi,top:T,xs:ie,ys:oe.map(I=>I-T),colour:"--ink-2",alpha:.32,label:"BAF per SNP"}),n.depth&&r.jsx(Wm,{width:l,height:xa,top:_,xs:P,ys:le.map(I=>I-_),colour:"--ink",radius:1.6,alpha:.78,label:"Read-depth copy number"}),r.jsxs("svg",{width:l,height:C,className:"cnsv-svg","aria-hidden":!0,children:[r.jsxs("defs",{children:[r.jsx("clipPath",{id:U,children:r.jsx("rect",{x:Ve,y:0,width:h,height:D})}),r.jsx("marker",{id:`${c}-arrow`,viewBox:"0 0 8 8",refX:"4",refY:"4",markerWidth:"7",markerHeight:"7",orient:"auto",children:r.jsx("path",{d:"M0,8 L4,0 L8,8 Z",fill:"var(--sv-tra)"})})]}),r.jsx("g",{className:"cnsv-grid",children:[0,.25,.5,.75,1].map(I=>r.jsx("line",{x1:Ve,x2:Ve+h,y1:A(I),y2:A(I),"data-mid":I===.5||void 0},I))}),[0,.5,1].map(I=>r.jsx("text",{x:Ve-8,y:A(I)+4,className:"cnsv-ylab",children:I},I)),r.jsx("text",{x:14,y:T+Fi/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${T+Fi/2})`,children:"BAF"}),r.jsx("g",{clipPath:`url(#${U})`,children:je.map(I=>r.jsx(k_,{segment:I,x,y:A},`${I.start}-${I.end}`))}),!n.baf&&r.jsx(mm,{x:Ve+h/2,y:T+Fi/2,text:"No BAF data for this chromosome"}),r.jsx("line",{x1:Ve,x2:Ve+h,y1:E,y2:E,className:"cnsv-lane"}),r.jsx("line",{x1:Ve,x2:Ve+h,y1:R,y2:R,className:"cnsv-lane"}),r.jsx("text",{x:14,y:O+Vi/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${O+Vi/2})`,children:"SVs"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-svs","data-lit":W?"true":void 0,children:$.map((I,re)=>r.jsx(H_,{mark:I,x,upper:E,lower:R,svTop:O,bottom:_+xa,arrow:`url(#${c}-arrow)`,on:W===I.sv,onEnter:(ce,xe)=>Z({kind:"sv",mark:I,x:ce,y:xe}),onLeave:()=>Z(null),onClick:()=>de(I)},`${I.sv.id??re}-${I.kind}-${re}`))}),$.length===0&&r.jsx(mm,{x:Ve+h/2,y:O+Vi/2,text:"No rearrangements on this chromosome"}),r.jsx("g",{className:"cnsv-bands",children:Array.from({length:K-B+1},(I,re)=>B+re).map(I=>r.jsx("rect",{x:Ve,width:h,y:Math.min(k(I+.5),k(I-.5)),height:Math.abs(k(I-.5)-k(I+.5)),"data-odd":I%2===1||void 0},I))}),L.map(I=>r.jsx("text",{x:Ve-8,y:k(I)+4,className:"cnsv-ylab",children:I},I)),r.jsx("text",{x:14,y:_+xa/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${_+xa/2})`,children:"Copy number"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-total",children:je.filter(I=>I.total_cn!==null).map(I=>r.jsxs("g",{"data-sub":jg(I)||void 0,children:[r.jsx("line",{x1:x(I.start),x2:x(I.end),y1:k(I.total_cn),y2:k(I.total_cn),className:"cnsv-total-halo"}),r.jsx("line",{x1:x(I.start),x2:x(I.end),y1:k(I.total_cn),y2:k(I.total_cn)})]},`${I.start}-t`))}),!n.depth&&r.jsx(mm,{x:Ve+h/2,y:_+xa/2,text:"No BRASS read depth for this chromosome"}),r.jsx("line",{x1:Ve,x2:Ve+h,y1:D,y2:D,className:"cnsv-axis"}),ve.map(I=>r.jsxs("g",{transform:`translate(${x(I.value)},${D})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:I.label})]},I.value)),(J==null?void 0:J.kind)==="cursor"&&r.jsx("line",{x1:J.x,x2:J.x,y1:0,y2:D,className:"cnsv-cursor"})]}),J&&r.jsx(U_,{hot:J,data:n,mids:se,width:l,upper:E})]})}function mm({x:n,y:l,text:a}){return r.jsx("text",{x:n,y:l,className:"cnsv-empty",children:a})}function k_({segment:n,x:l,y:a}){if(n.baf===null)return null;const o=l(n.start),c=l(n.end),d=VS(n),h=d.length>0&&c-o>Math.max(...d.map(x=>Cs(x,11,600)))+10,m=a(n.baf),g=n.baf>.3;return r.jsxs("g",{className:"cnsv-seg","data-sub":jg(n)||void 0,children:[r.jsx("line",{x1:o,x2:c,y1:m,y2:m}),h&&d.map((x,v)=>r.jsx("text",{x:(Math.max(o,Ve)+Math.min(c,1e4))/2,y:g?m+15+v*13:m-8-(d.length-1-v)*13,children:x},x))]})}function H_({mark:n,x:l,upper:a,lower:o,svTop:c,bottom:d,arrow:h,on:m,onEnter:g,onLeave:x,onClick:v}){const y=zn[n.svClass];if(n.kind==="out"){const D=l(n.at),C=`M${D},${o+14} L${D},${c+12}`;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:y},children:[r.jsx("line",{x1:D,x2:D,y1:o+14,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:C,className:"cnsv-out",markerEnd:h}),r.jsx("text",{x:D,y:c+6,className:"cnsv-partner",children:n.partner}),r.jsx("path",{d:C,className:"cnsv-sv-hit",onPointerEnter:()=>g(D,c+20),onPointerLeave:x,onClick:v})]})}const S=l(n.from),j=l(n.to),b=n.lane==="upper"?a:o,N=Math.max((j-S)/2,.5),T=Math.min(n.lane==="upper"?30:18,Math.max(5,N*1.6)),O=`M${S},${b} A${N},${T} 0 0 ${n.up?1:0} ${j},${b}`,_=n.up?b-T:b+T;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:y},children:[r.jsx("line",{x1:S,x2:S,y1:b,y2:d,className:"cnsv-drop"}),r.jsx("line",{x1:j,x2:j,y1:b,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:O,className:"cnsv-arc"}),r.jsx("path",{d:O,className:"cnsv-sv-hit",onPointerEnter:()=>g((S+j)/2,_),onPointerLeave:x,onClick:v})]})}function U_({hot:n,data:l,mids:a,width:o,upper:c}){if(n.kind==="sv"){const{mark:y}=n,S=y.sv,j=y.kind==="arc"?`${l.chrom}:${Sr(y.from)}–${Sr(y.to)}`:`${l.chrom}:${Sr(y.at)} to ${y.partner}:${Sr(y.partnerPos)}`;return r.jsxs(Zt,{x:n.x,y:n.y,width:o,children:[r.jsxs("b",{children:[r.jsx("span",{className:"sv-swatch",style:{background:zn[y.svClass]},"aria-hidden":!0})," ",$a[y.svClass]]}),r.jsx("span",{className:"mono",children:j}),y.kind==="arc"&&r.jsxs("span",{children:[D_(y.to-y.from)," apart"]}),S.orientation&&r.jsxs("span",{children:["Orientation ",S.orientation]}),r.jsx("i",{children:"Click to fit it in view"})]})}const d=n.pos,h=l.segments.find(y=>y.start<=d&&y.end>=d),m=l.depth&&a.length?BS(a,d):-1,g=l.window??1e5,x=m>=0&&Math.abs(a[m]-d)<=g?l.depth.cn[m]:null,v=h?VS(h):[];return r.jsxs(Zt,{x:n.x,y:c,width:o,children:[r.jsxs("b",{className:"mono",children:[l.chrom,":",Sr(d)]}),h?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:["Battenberg ",v.join(", ")||"–",jg(h)?" (subclonal)":""]}),r.jsxs("span",{children:["Segment BAF ",h.baf===null?"–":h.baf.toFixed(2),", total copy number ",h.total_cn??"–"]})]}):r.jsx("span",{children:"No Battenberg segment here"}),r.jsxs("span",{children:["Read depth ",x===null?"–":`${x.toFixed(2)} copies`]})]})}const _l=92,Wx=14,F_=26,gm=[{source:"tumour",measure:"logr",label:"LogR"},{source:"tumour",measure:"baf",label:"BAF"},{source:"normal",measure:"logr",label:"LogR"},{source:"normal",measure:"baf",label:"BAF"}],eg={tumour:"Tumour",normal:"Normal"};function V_(n){if(!n)return null;const l={pos:[],baf:[],logr:[],at:[],chrom:[]};for(const a of Or){const o=n[a];if(!o)continue;const c=Ys.offsets[a];for(let d=0;d<o.pos.length;d++)l.pos.push(o.pos[d]),l.baf.push(o.baf[d]),l.logr.push(o.logr[d]),l.at.push(c+o.pos[d]),l.chrom.push(a)}return l}function B_(n,l){return n?{...n,at:n.pos,chrom:n.pos.map(()=>l)}:null}function e1(n){const{width:l}=n,a=Math.max(l-Ve-wg,200),o=n.scope==="genome",c=o?Ys.total:Yi(n.chrom),d=M.useMemo(()=>({span:[0,Ys.total],smooth:!1}),[]),h=GS({view:o?d:n.view,onView:o?()=>{}:n.onView,length:c,left:Ve,plotW:a}),m=o?C=>Ve+C/Ys.total*a:h.x,g=M.useMemo(()=>{var E;const C={};for(const R of["tumour","normal"])C[R]=n.scope==="genome"?V_(n.sources[R]):B_((E=n.raw)==null?void 0:E[R],n.chrom);return C},[n.scope,n.scope==="genome"?n.sources:n.raw]),x=M.useMemo(()=>{var E;const C={};for(const R of["tumour","normal"])C[R]=R_((((E=g[R])==null?void 0:E.logr)??[]).filter(A=>A!==null));return C},[g]),v=C=>C*(_l+Wx)+(C>=2?Wx:0),y=v(gm.length-1)+_l+4,S=y+F_,j=(C,E,R,A)=>{const[B,K]=E==="baf"?[0,1]:x[R]??[-1,1];return 6+(1-(Math.min(Math.max(A,B),K)-B)/(K-B))*(_l-12)},b=M.useMemo(()=>{var E;const C={};for(const R of["tumour","normal"])C[R]=((E=g[R])==null?void 0:E.at.map(m))??[];return C},[g,o?a:h.shown,a]),[N,T]=M.useState(null),O=C=>{const E=h.localX(C);T(E>=Ve&&E<=Ve+a?E:null)},_=o?[]:FS(h.shown,Math.max(2,Math.round(a/110))),D=["tumour","normal"].some(C=>{var E;return(((E=g[C])==null?void 0:E.pos.length)??0)>0});return r.jsxs("div",{ref:h.box,className:"cnsv-view cnsv-raw",style:{height:S},tabIndex:o?void 0:0,role:"group","aria-label":o?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF on chromosome ${n.chrom}`,...o?{}:h.handlers,"data-zoomed":!o&&h.zoomed||void 0,onPointerMove:O,onPointerLeave:()=>T(null),children:[gm.map((C,E)=>{const R=g[C.source],A=(R==null?void 0:R[C.measure])??[];return r.jsx(Wm,{width:l,height:_l,top:v(E),xs:b[C.source]??[],ys:A.map(B=>B===null?NaN:j(E,C.measure,C.source,B)),colour:C.source==="tumour"?"--ink-2":"--faint",radius:o?1.05:1.6,alpha:o?.4:.6,label:`${eg[C.source]} ${C.label}`},`${C.source}-${C.measure}`)}),r.jsxs("svg",{width:l,height:S,className:"cnsv-svg","aria-hidden":!0,children:[gm.map((C,E)=>{const R=v(E),[A,B]=C.measure==="baf"?[0,1]:x[C.source]??[-1,1],K=C.measure==="baf"?[0,.5,1]:[A,0,B];return r.jsxs("g",{transform:`translate(0,${R})`,children:[r.jsx("rect",{x:Ve,y:0,width:a,height:_l,className:"cnsv-raw-bg"}),K.map(k=>r.jsxs("g",{children:[r.jsx("line",{x1:Ve,x2:Ve+a,y1:j(E,C.measure,C.source,k),y2:j(E,C.measure,C.source,k),className:"cnsv-raw-grid","data-mid":k===0||k===.5||void 0}),r.jsx("text",{x:Ve-8,y:j(E,C.measure,C.source,k)+4,className:"cnsv-ylab",children:+k.toFixed(1)})]},k)),r.jsx("text",{x:14,y:_l/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${_l/2})`,children:C.label}),C.measure==="logr"&&r.jsx("text",{x:Ve+8,y:14,className:"cnsv-row-caption",children:eg[C.source]})]},`${C.source}-${C.measure}`)}),r.jsx("line",{x1:Ve,x2:Ve+a,y1:y,y2:y,className:"cnsv-axis"}),o?Or.map(C=>{const E=m(Ys.offsets[C]),R=m(Ys.offsets[C]+Yi(C));return r.jsxs("g",{children:[r.jsx("line",{x1:E,x2:E,y1:0,y2:y,className:"cnsv-chrom-sep"}),R-E>12&&r.jsx("text",{x:(E+R)/2,y:y+17,className:"cnsv-chrom-name",onClick:()=>n.scope==="genome"&&n.onPick(C),children:C})]},C)}):_.map(C=>r.jsxs("g",{transform:`translate(${m(C.value)},${y})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:C.label})]},C.value)),N!==null&&r.jsx("line",{x1:N,x2:N,y1:0,y2:y,className:"cnsv-cursor"}),!D&&r.jsxs("text",{x:Ve+a/2,y:y/2,className:"cnsv-empty",children:["No raw Battenberg data ",o?"in this report":"for this chromosome"]})]}),N!==null&&r.jsx(G_,{cursor:N,placed:g,at:o?C=>(C-Ve)/a*Ys.total:h.posAt,width:l}),o&&r.jsx("div",{className:"cnsv-chrom-hits",style:{top:y,left:0,width:l},children:Or.map(C=>{const E=m(Ys.offsets[C]),R=m(Ys.offsets[C]+Yi(C));return r.jsx("button",{type:"button",style:{left:E,width:R-E},"aria-label":`Open chromosome ${C}`,onClick:()=>n.scope==="genome"&&n.onPick(C)},C)})})]})}function G_({cursor:n,placed:l,at:a,width:o}){const c=a(n),d=["tumour","normal"].map(m=>{const g=l[m];if(!g||!g.at.length)return null;const x=BS(g.at,c),v=y=>y===null?"–":y.toFixed(2);return{source:m,chrom:g.chrom[x],pos:g.pos[x],text:`LogR ${v(g.logr[x])}, BAF ${v(g.baf[x])}`}}),h=d.find(Boolean);return h?r.jsxs(Zt,{x:n,y:_l,width:o,children:[r.jsxs("b",{className:"mono",children:[h.chrom,":",h.pos.toLocaleString("en-US")]}),d.map(m=>m&&r.jsxs("span",{children:[eg[m.source],": ",m.text]},m.source)),r.jsx("i",{children:"The nearest locus kept"})]}):null}const q_=["deletion","tandem-duplication","inversion","translocation"];function El({kind:n,colour:l,label:a}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`cnsv-key-${n}`,style:{background:n==="dot"||n==="line"?l:void 0,color:l},"aria-hidden":!0}),a]})}function I_({chrom:n,withData:l,genome:a,allowGenome:o,onPick:c,onGenome:d}){return r.jsxs("div",{className:"cnsv-picker",role:"group","aria-label":"Chromosome",children:[o&&r.jsx("button",{type:"button",className:"cnsv-chip cnsv-chip-genome","aria-pressed":a,onClick:d,children:"Genome"}),Or.map(h=>r.jsx("button",{type:"button",className:"cnsv-chip","aria-pressed":!a&&h===n,"data-empty":!l.has(h)||void 0,"aria-label":`Chromosome ${h}`,onClick:()=>c(h),children:h},h))]})}const Q_=M.forwardRef(function({envelope:l,loading:a,rawGenome:o,rawGenomeLoading:c,picked:d,chrom:h,onChrom:m,mode:g,onMode:x,genome:v,onGenome:y},S){const[j,b]=Es(900),[N,T]=M.useState({span:dm(h),smooth:!1});M.useEffect(()=>T({span:dm(h),smooth:!1}),[h]);const O=dm(h),_=N.span[1]-N.span[0]<O[1]-O[0]-1,D=l==null?void 0:l.data,C=new Set((D==null?void 0:D.chromosomes)??[]),E=g==="raw"&&v,R=A=>{y(!1),m(A)};return r.jsx(uo,{ref:S,title:"Copy number and rearrangements by chromosome",subtitle:g==="integrated"?`BAF, rearrangements and read depth along chromosome ${h}`:E?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF along chromosome ${h}`,lineage:(l==null?void 0:l.lineage)??[],picked:d,info:"cnsv",className:"cnsv",controls:r.jsxs(r.Fragment,{children:[_&&!E&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole chromosome",title:"Show the whole chromosome",onClick:()=>T({span:O,smooth:!0}),children:r.jsx(Z1,{size:15,"aria-hidden":!0})}),r.jsx(Bl,{label:"View",value:g,onChange:x,options:[{value:"integrated",label:"CN/SV"},{value:"raw",label:"Battenberg raw"}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[g==="integrated"?r.jsxs(r.Fragment,{children:[r.jsx(El,{kind:"dot",colour:"var(--chev)",label:"BAF per SNP"}),r.jsx(El,{kind:"line",colour:"var(--cnsv-clonal)",label:"Clonal segment"}),r.jsx(El,{kind:"line",colour:"var(--cnsv-subclonal)",label:"Subclonal segment"}),r.jsx(El,{kind:"dot",colour:"var(--ink)",label:"Read depth (BRASS)"}),r.jsx(El,{kind:"dash",colour:"var(--cnsv-clonal)",label:"Battenberg total copy number"}),q_.map(A=>r.jsx(El,{kind:"line",colour:zn[A],label:$a[A]},A))]}):r.jsxs(r.Fragment,{children:[r.jsx(El,{kind:"dot",colour:"var(--ink-2)",label:"Tumour"}),r.jsx(El,{kind:"dot",colour:"var(--faint)",label:"Normal"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:E?"Click a chromosome's name to open it.":"Scroll up or down over the plot to zoom, sideways (or drag) to pan. Click a rearrangement to fit it."})]}),children:r.jsxs("div",{className:"cnsv-body",children:[r.jsx(I_,{chrom:h,withData:C,genome:E,allowGenome:g==="raw",onPick:R,onGenome:()=>y(!0)}),r.jsx("div",{ref:j,"data-stale":!E&&D&&D.chrom!==h||void 0,children:E?r.jsx(Vl,{label:"raw Battenberg data",envelope:o,loading:c,skeletonHeight:440,children:A=>r.jsx(e1,{scope:"genome",sources:A.sources,segments:A.segments,width:b,onPick:R})}):r.jsx(Vl,{label:"chromosome view",envelope:l,loading:a,skeletonHeight:460,children:A=>g==="integrated"?r.jsx($_,{data:A,width:b,view:N,onView:T},A.chrom):r.jsx(e1,{scope:"chromosome",chrom:A.chrom,raw:A.raw,width:b,view:N,onView:T},A.chrom)})})]})})});function Y_(n){var o;const l=n.samples.filter(c=>c.category==="TUMOR");return(o=l.find(c=>Object.values(c.datasets??{}).some(d=>Object.values(d).includes("ok")))??l[0]??n.samples[0])==null?void 0:o.id}const P_=[];function X_(n){const l=M.useRef(!1);return M.useEffect(()=>{let a=0;const o=()=>{l.current=!0,window.clearTimeout(a),a=window.setTimeout(()=>l.current=!1,150)};return window.addEventListener("scroll",o,{passive:!0}),()=>{window.removeEventListener("scroll",o),window.clearTimeout(a)}},[]),M.useCallback(a=>{(a===null||!l.current)&&n(a)},[n])}function K_(n){var a,o;const l=(o=(a=n==null?void 0:n.samples.find(c=>{var d;return(d=c.disease)==null?void 0:d.name}))==null?void 0:a.disease)==null?void 0:o.name;return l?l.charAt(0)+l.slice(1).toLowerCase():void 0}function Bi(n,l){const a=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;n==null||n.scrollIntoView({behavior:a?"auto":"smooth",block:l})}const t1=160;function Z_(n,l){const a=M.useRef(n);a.current=n;const o=M.useRef(null),c=M.useRef(null),d=M.useRef(0),h=M.useRef(()=>{}),m=M.useRef(()=>{});M.useEffect(()=>{let v=0;const y=()=>{var E;if(v=0,o.current)return;const T=a.current.filter(([,R])=>R.current).map(([R,A])=>[R,A.current.getBoundingClientRect().top]),O=Math.max(0,document.documentElement.scrollHeight-window.innerHeight),_=Math.max(0,...T.map(([,R])=>R+window.scrollY-O-t1)),D=t1+(O>0?_*Math.min(1,window.scrollY/O):0);let C=((E=T[0])==null?void 0:E[0])??null;for(const[R,A]of T)A<=D&&(C=R);l.set(C)},S=()=>{o.current=null,c.current=null,y()};m.current=()=>{c.current=window.scrollY};const j=()=>{if(o.current){c.current===null?(window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)):Math.abs(window.scrollY-c.current)>4&&S();return}v||(v=requestAnimationFrame(y))},b=()=>{o.current&&c.current===null&&(window.clearTimeout(d.current),S())};return h.current=y,y(),window.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j),window.addEventListener("wheel",b,{passive:!0}),window.addEventListener("touchstart",b,{passive:!0}),window.addEventListener("keydown",b),()=>{window.removeEventListener("scroll",j),window.removeEventListener("resize",j),window.removeEventListener("wheel",b),window.removeEventListener("touchstart",b),window.removeEventListener("keydown",b),window.clearTimeout(d.current),v&&cancelAnimationFrame(v)}},[]);const g=M.useRef("");return M.useEffect(()=>{const v=n.filter(([,y])=>y.current).map(([y])=>y).join();v!==g.current&&(g.current=v,h.current())}),v=>{o.current=v,c.current=null,l.set(v),window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)}}function J_({held:n,sampleId:l,...a}){const o=qu(n);return r.jsx(cC,{...a,sampleId:o??l})}function W_(){var Fr,Vr,Zs,Qt,Xn,Yt,Br,Gr,qr,Il,Ql,Yl,cs,Pl,Js,ho,Ir,mo,Ha,Ws;const{individual:n=""}=eN(),[l,a]=bN(),o=l.get("version")??void 0,[c,d]=M.useState(null),[h,m]=M.useState(null),[g,x]=M.useState(gx),[v,y]=M.useState(null),S=X_(y),[j,b]=M.useState(null),N=M.useRef(null),[T,O]=M.useState(null),_=M.useRef(Cr(!0)).current,D=M.useRef(null),C=M.useRef(null),E=M.useRef(null),R=M.useRef(null),A=M.useRef(null),B=M.useRef(null),K=M.useRef(Cr(null)).current,k=Z_([["overview",C],["copyNumber",N],["mutations",D],["structuralVariants",E],["circos",A],["cnsv",B],["signatures",R]],K),ie=m1();M.useEffect(()=>{const ge=T;if(!ge||typeof IntersectionObserver>"u")return;const at=new IntersectionObserver(([nn])=>_.set(nn.isIntersecting),{rootMargin:"-72px 0px 0px 0px",threshold:0});return at.observe(ge),()=>at.disconnect()},[T]);const oe=M.useCallback(ge=>x(at=>({...at,...ge})),[]),se=M.useCallback(ge=>{oe({q:jC(ge.chrom,ge.start,ge.end),scope:"all",sort:"position"}),Bi(D.current,"start")},[oe]),P=M.useCallback(ge=>{oe({q:ge}),Bi(D.current,"start")},[oe]),le=M.useCallback(ge=>{b({chrom:ge.chrom,pos:ge.pos,gene:ge.gene,nonce:Date.now()}),Bi(N.current,"center")},[]),$=M.useCallback(ge=>{b({...ge,nonce:Date.now()}),Bi(N.current,"center")},[]),J=EC(n,o),Z=J.data,W=(Z==null?void 0:Z.status)==="ok"?Z.data??void 0:void 0,ae=l.get("sample")??(W?Y_(W):void 0),de=W==null?void 0:W.samples.find(ge=>ge.id===ae),ve=(de==null?void 0:de.category)==="TUMOR"?ae:void 0,je=h??((W==null?void 0:W.mode)==="unmatched"?"vaf":"ccf"),L=TC(n,W?ae:void 0,o),U=_C(n,o),I=RC(n,ve,o),re=AC(n,ve,je,g.ffpe,o),ce=FC(n,ve,g,o),xe=(Fr=ce.data)==null?void 0:Fr.pages[0],Te=M.useMemo(()=>{var ge;return((ge=ce.data)==null?void 0:ge.pages.flatMap(at=>at.status==="ok"&&at.data?at.data.rows:[]))??[]},[ce.data]),{fetchNextPage:me}=ce,Se=M.useCallback(()=>void me(),[me]),ct=UC(n,ve,o),Ct=OC(n,ve,o),dn=zC(n,ve,o),zt=DC(n,ve,o),ut=LC(n,ve,o),Ge=$C(n,ve,o),[Wt,rs]=M.useState("1"),[en,wn]=M.useState("integrated"),[Ts,gt]=M.useState(!1),Yn=kC(n,ve,Wt,o),qt=HC(n,ve,en==="raw"&&Ts,o),Dt=(Zs=(Vr=U.data)==null?void 0:Vr.data)==null?void 0:Zs.samples.find(ge=>ge.sample===ae),Ks=M.useMemo(()=>(Dt==null?void 0:Dt.drivers)??P_,[Dt]),It=M.useMemo(()=>v?{chrom:v.chrom,pos:v.pos,gene:v.gene}:j,[v,j]),Ln=M.useRef(null),Pn=M.useRef(Cr(null)).current,te=(ge,at)=>{var nn;(nn=Ln.current)==null||nn.toggleAttribute("data-gliding",ge),Ln.current&&(Ln.current.style.minHeight=ge&&at?`${at}px`:"")},ue=M.useRef(null);M.useEffect(()=>()=>{var ge;return(ge=ue.current)==null?void 0:ge.call(ue)},[]);const we=ge=>{var xt,Lt;if(ge===ae)return;(xt=ue.current)==null||xt.call(ue);const at=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches,nn=50;if(at||window.scrollY<=nn)return window.scrollTo({top:0,behavior:"auto"}),Ue("sample",ge);const Ua=window.scrollY,go=Math.min(520,240+Ua*.12),po=performance.now();te(!0,document.documentElement.scrollHeight-(((Lt=Ln.current)==null?void 0:Lt.getBoundingClientRect().top)??0)-Ua),Pn.set(ae??null),k("overview"),M.startTransition(()=>Ue("sample",ge));let Fa=0;function Kn(){cancelAnimationFrame(Fa),window.removeEventListener("wheel",Kn),window.removeEventListener("touchstart",Kn),window.removeEventListener("keydown",Kn),ue.current=null,Pn.set(null),te(!1)}const $n=el=>{const yo=Math.min(1,(el-po)/go),Qr=Ua*(1-yo)**3;window.scrollTo({top:Qr,behavior:"instant"}),Qr<=nn&&Pn.set(null),yo<1?Fa=requestAnimationFrame($n):Kn()};window.addEventListener("wheel",Kn,{passive:!0}),window.addEventListener("touchstart",Kn,{passive:!0}),window.addEventListener("keydown",Kn),ue.current=Kn,Fa=requestAnimationFrame($n)},Ue=(ge,at)=>{const nn=new URLSearchParams(l);nn.set(ge,at),a(nn,{replace:!1}),d(null),x(gx()),y(null),b(null)},Pe=[J,L,U,I,re,ce,ct,Ct,dn,zt,ut,Ge].map(ge=>ge.error);if(Pe.some(ge=>ge instanceof Iu))return r.jsx("div",{className:`wgts ${is.theme}`,children:r.jsx("main",{className:"page",children:r.jsx(uM,{onSignedIn:()=>ie.invalidateQueries()})})});const vt=Pe.find(ge=>ge instanceof sS),pt=de&&W?hg(de.id,W.individual.id):"",et=new Set(W?ve?["overview","copyNumber","mutations","structuralVariants","circos","cnsv","signatures"]:["overview"]:[]),hn=ge=>{if(k(ge),ge==="overview"){const nn=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:nn?"auto":"smooth"});return}const at={copyNumber:N,mutations:D,structuralVariants:E,circos:A,cnsv:B,signatures:R}[ge];Bi((at==null?void 0:at.current)??null,"start")},Nn=W&&ae&&W.analyses[ae]||[],ql=(W==null?void 0:W.failures.filter(ge=>ge.sample===ae))??[],ka=new Set(Nn.map(Gt)),fo=new Set,tn=ge=>ge==null?void 0:ge.forEach(at=>ka.has(Gt(at))&&fo.add(Gt(at)));for(const ge of((Xn=(Qt=L.data)==null?void 0:Qt.data)==null?void 0:Xn.metrics)??[])Bm.includes(ge.key)&&tn(ge.sources);tn((Yt=U.data)==null?void 0:Yt.lineage),tn((Br=I.data)==null?void 0:Br.lineage),tn((Gr=re.data)==null?void 0:Gr.lineage),tn(xe==null?void 0:xe.lineage),tn((qr=ct.data)==null?void 0:qr.lineage),tn((Il=Ct.data)==null?void 0:Il.lineage),tn((Ql=dn.data)==null?void 0:Ql.lineage),tn((Yl=zt.data)==null?void 0:Yl.lineage),tn((cs=ut.data)==null?void 0:cs.lineage),tn((Pl=Ge.data)==null?void 0:Pl.lineage),tn((Js=Yn.data)==null?void 0:Js.lineage);for(const ge of Nn)ge.state==="failed"&&ql.length>0&&fo.add(Gt(ge));return r.jsxs("div",{className:`wgts ${is.theme}`,children:[r.jsx(PC,{analyses:Nn,onPage:fo,sampleLabel:pt,picked:c,onPick:d,sections:et,activeStore:K,onSection:hn}),r.jsxs("div",{ref:Ln,className:"page",children:[r.jsx(nS,{individualId:n,subtitle:[K_(W),(ho=W==null?void 0:W.individual.sex)==null?void 0:ho.toLowerCase(),(W==null?void 0:W.mode)==="unmatched"?"tumour only":void 0].filter(Boolean).join(", ")||void 0,patientIcon:W?r.jsx(lC,{sex:W.individual.sex}):void 0,report:W?r.jsx(sM,{data:W,onVersion:ge=>Ue("version",ge)}):void 0,compact:W&&ae?r.jsx(uC,{data:W,sampleId:ae,fingerprint:((Ir=U.data)==null?void 0:Ir.data)??void 0,onSample:we}):void 0,headerInView:_}),r.jsxs("main",{className:"flex flex-1 flex-col",children:[W&&ae&&r.jsx("div",{className:"px-8 pt-1",children:r.jsx("div",{ref:O,children:r.jsx(J_,{held:Pn,data:W,sampleId:ae,fingerprint:((mo=U.data)==null?void 0:mo.data)??void 0,onSample:ge=>Ue("sample",ge)})})}),r.jsxs("div",{className:"sheet",children:[J.isPending&&r.jsx("div",{className:"skeleton h-24","aria-label":"Loading the patient"}),vt&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:{status:"error",data:null,lineage:[],warnings:[vt.message]}})}),J.isError&&!vt&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:{status:"error",data:null,lineage:[],warnings:[J.error.message]}})}),Z&&Z.status!=="ok"&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:Z})}),(Z==null?void 0:Z.status)==="ok"&&Z.warnings.length>0&&r.jsx("div",{className:"sc-card px-6 py-4",children:r.jsx(ba,{envelope:{...Z,status:"missing"}})}),W&&ae&&r.jsxs(r.Fragment,{children:[r.jsx(cM,{sampleLabel:pt,failures:ql,analyses:Nn}),ve?r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:C,className:"page-section",children:r.jsx(rM,{sampleLabel:`${pt} tumour`,fingerprint:Dt,metrics:L.data,picked:c,lineage:Qu((Ha=L.data)==null?void 0:Ha.lineage,(Ws=U.data)==null?void 0:Ws.lineage)})}),r.jsx("div",{ref:N,className:"page-section",children:r.jsx(KM,{envelope:I.data,loading:I.isPending,picked:c,sampleLabel:pt,drivers:Ks,focus:It,locate:j,onSegment:se,onGene:P,fga:zt.data,fgaLoading:zt.isPending,onOpenChromosome:ge=>{rs(ge),gt(!1),k("cnsv"),Bi(B.current,"start")}})}),r.jsx(CT,{ref:D,variants:xe,rows:Te,hasMore:ce.hasNextPage,loadingMore:ce.isFetchingNextPage,onMore:Se,variantsLoading:ce.isPending,variantsFetching:ce.isFetching&&ce.isPlaceholderData,density:re.data,densityLoading:re.isPending,picked:c,measure:je,onMeasure:ge=>{m(ge),g.range&&g.range.measure!==ge&&oe({range:null})},table:g,onTable:oe,hovered:v,onHover:S,onLocate:le,showCcf:W.mode!=="unmatched",tmb:ut.data}),r.jsx(KT,{ref:E,envelope:ct.data,loading:ct.isPending,picked:c,onLocate:$}),r.jsx(M_,{ref:A,envelope:Ge.data,loading:Ge.isPending,picked:c,drivers:Ks}),r.jsx(Q_,{ref:B,envelope:Yn.data,loading:Yn.isPending,rawGenome:qt.data,rawGenomeLoading:qt.isPending,picked:c,chrom:Wt,onChrom:rs,mode:en,onMode:wn,genome:Ts,onGenome:gt}),r.jsx(p_,{ref:R,envelope:Ct.data,loading:Ct.isPending,contextEnvelope:dn.data,contextLoading:dn.isPending,picked:c})]}):r.jsx("div",{ref:C,className:"sc-card px-6 py-5",children:r.jsx(ba,{envelope:{status:"missing",data:null,lineage:[],warnings:[`${pt} is a normal sample. Its germline and quality panels arrive with those sections.`]}})})]})]})]})]})]})}const pm=200,qS="wgts-picker-scope";function eR(){try{const n=localStorage.getItem(qS);return n&&/^\d+$/.test(n)?Number(n):"all"}catch{return"all"}}function tR(n,l){const a=l.toLowerCase().split(/\s+/).filter(Boolean);return a.length===0?n:n.filter(o=>{const c=`${o.individual} ${o.diseases.join(" ")} ${o.report_version}`.toLowerCase();return a.every(d=>c.includes(d))})}function nR(n,l){const a=l.toLowerCase().split(/\s+/).filter(Boolean);return a.length===0?n:n.filter(o=>{const c=`${o.title} ${o.short_title??""} ${o.description??""}`.toLowerCase();return a.every(d=>c.includes(d))})}const ym=n=>n.toLocaleString("en-US");function sR(){return qu(gg)?r.jsx(lR,{}):null}function lR(){var k,ie,oe,se;const n=fg(),l=((k=Jw("/:individual"))==null?void 0:k.params.individual)??"",a=M.useId(),o=M.useRef(null),[c,d]=M.useState(eR),[h,m]=M.useState(""),[g,x]=M.useState(""),[v,y]=M.useState(0),S=VC(),j=BC(c);M.useEffect(()=>{const P=document.activeElement,le=document.documentElement,$=le.style.overflow;return le.style.overflow="hidden",requestAnimationFrame(()=>{var J;return(J=document.querySelector(".pick-main .tsearch input"))==null?void 0:J.focus()}),()=>{le.style.overflow=$,P==null||P.focus()}},[]);const b=P=>{d(P),x(""),y(0);try{localStorage.setItem(qS,String(P))}catch{}requestAnimationFrame(()=>{var le;return(le=document.querySelector(".pick-main .tsearch input"))==null?void 0:le.focus()})},N=((ie=S.data)==null?void 0:ie.results)??[],T=M.useMemo(()=>nR(N,h),[N,h]),O=c==="all"?null:N.find(P=>P.pk===c)??((oe=j.data)==null?void 0:oe.project)??null,_=((se=j.data)==null?void 0:se.results)??[],D=M.useMemo(()=>tR(_,g),[_,g]),C=D.slice(0,pm),E=M.useRef(null),R=P=>{yu(),P.individual!==l&&n(`/${encodeURIComponent(P.individual)}`)};M.useEffect(()=>{var P,le,$;($=(le=(P=E.current)==null?void 0:P.querySelector(`[data-index="${v}"]`))==null?void 0:le.scrollIntoView)==null||$.call(le,{block:"nearest"})},[v]),M.useEffect(()=>y(0),[g]);const A=P=>{const le=P.target,$=le instanceof HTMLInputElement&&!!le.closest(".pick-main");if(P.key==="Escape"){if(le instanceof HTMLInputElement&&le.value)return;yu()}else if($&&P.key==="ArrowDown")P.preventDefault(),y(J=>Math.min(J+1,C.length-1));else if($&&P.key==="ArrowUp")P.preventDefault(),y(J=>Math.max(J-1,0));else if($&&P.key==="Enter"&&C[v])P.preventDefault(),R(C[v]);else if(le instanceof HTMLInputElement&&le.closest(".pick-rail")&&P.key==="Enter"){P.preventDefault();const J=T[0];J&&b(J.pk)}},B=S.isPending,K=S.isError||j.isError;return cg.createPortal(r.jsx("div",{className:`info-backdrop ${is.theme}`,onMouseDown:P=>P.target===P.currentTarget&&yu(),children:r.jsxs("div",{className:"info-dialog pick",role:"dialog","aria-modal":"true","aria-labelledby":a,tabIndex:-1,onKeyDown:A,children:[r.jsx("button",{ref:o,type:"button",className:"info-close","aria-label":"Close",onClick:yu,children:r.jsx(Bu,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail pick-rail","aria-label":"Projects",children:[r.jsx("span",{className:"info-kicker",children:"Browse"}),r.jsx("h2",{id:a,children:"Projects"}),r.jsx($u,{value:h,onChange:m,label:"Search projects",placeholder:"Search projects",shortcut:!1,delay:0}),r.jsxs("ol",{children:[r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c==="all"?"true":void 0,onClick:()=>b("all"),children:[r.jsx("span",{className:"pick-name",children:r.jsxs("span",{children:[r.jsx(QN,{size:14,"aria-hidden":!0}),"All patients"]})}),r.jsx("span",{className:"pick-n",children:S.data?ym(S.data.total):""})]})}),T.map(P=>r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c===P.pk?"true":void 0,onClick:()=>b(P.pk),title:P.short_title?`${P.title} (${P.short_title})`:P.title,children:[r.jsx("span",{className:"pick-name",children:P.title}),r.jsx("span",{className:"pick-n",children:ym(P.patients)})]})},P.pk))]}),B&&r.jsx("p",{className:"pick-note",children:"Loading projects…"}),!B&&N.length>0&&T.length===0&&r.jsxs("p",{className:"pick-note",children:["No project matches “",h,"”."]}),!B&&!S.isError&&N.length===0&&r.jsx("p",{className:"pick-note",children:"No project has a dashboard yet. “All patients” lists every one."})]}),r.jsxs("div",{className:"pick-main",children:[r.jsxs("header",{className:"pick-head",children:[r.jsx("span",{className:"info-kicker",children:(O==null?void 0:O.short_title)??(c==="all"?"Every project":"Project")}),r.jsx("h3",{children:(O==null?void 0:O.title)??"All patients"}),(O==null?void 0:O.description)&&r.jsx("p",{children:O.description})]}),r.jsx("div",{className:"tbar",children:r.jsx($u,{value:g,onChange:x,label:"Search patients",placeholder:"Search id or disease",shortcut:!1,delay:0})}),r.jsx("div",{ref:E,className:"pick-list",role:"group","aria-label":"Patients","aria-busy":j.isFetching,children:K?r.jsx("p",{className:"pick-note",children:"The patients could not be loaded. Close this window and try again."}):j.isPending?r.jsx("p",{className:"pick-note",children:"Loading patients…"}):C.length===0?r.jsx("p",{className:"pick-note",children:g?`No patient matches “${g}”.`:"No patients with a dashboard in this project yet."}):C.map((P,le)=>r.jsxs("button",{type:"button",className:"pick-row","data-index":le,"data-active":le===v||void 0,"data-current":P.individual===l||void 0,onMouseEnter:()=>y(le),onClick:()=>R(P),children:[r.jsx("span",{className:"pick-id mono",children:r.jsx(Da,{text:P.individual,query:g})}),r.jsx("span",{className:"pick-diseases",children:P.diseases.length>0?P.diseases.map($=>r.jsx("span",{className:"sc-chip",children:r.jsx(Da,{text:$,query:g})},$)):r.jsx("span",{className:"pick-faint",children:"No tumour disease recorded"})}),r.jsx("span",{className:"pick-aside",children:P.individual===l?r.jsxs("span",{className:"pick-here",children:[r.jsx(Q1,{size:13,"aria-hidden":!0}),"On this page"]}):r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[ym(P.samples)," ",P.samples===1?"sample":"samples"]}),r.jsxs("span",{className:"pick-faint",children:["report ",P.report_version,P.built?`, ${J1(P.built)}`:""]})]})})]},P.individual))}),j.data&&r.jsx(Ku,{shown:D.length,total:_.length,noun:["patient","patients"],note:D.length>pm?`Showing the first ${pm}; search to narrow`:void 0})]})]})}),document.body)}const aR=new mw({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}});function iR(){return r.jsx(V2,{client:aR,children:r.jsxs(SN,{basename:is.basePath,children:[r.jsxs(pN,{children:[r.jsx(Om,{path:"/",element:r.jsx(dC,{})}),r.jsx(Om,{path:"/:individual",element:r.jsx(W_,{})})]}),r.jsx(sR,{})]})})}F2.createRoot(document.getElementById("root")).render(r.jsx(M.StrictMode,{children:r.jsx(iR,{})}));
|
|
318
|
+
*/function Bu(n,l){return n?ME(n)?C.createElement(n,l):n:null}function ME(n){return EE(n)||typeof n=="function"||_E(n)}function EE(n){return typeof n=="function"&&(()=>{const l=Object.getPrototypeOf(n);return l.prototype&&l.prototype.isReactComponent})()}function _E(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Py(n){const l={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[a]=C.useState(()=>({current:wE(l)})),[i,c]=C.useState(()=>a.current.initialState);return a.current.setOptions(d=>({...d,...n,state:{...i,...n.state},onStateChange:f=>{c(f),n.onStateChange==null||n.onStateChange(f)}})),a.current}function Vu({value:n,onChange:l,label:a="Search mutations",placeholder:i="Search gene, change or locus",shortcut:c=!0,delay:d=250}){const[f,m]=C.useState(n),g=C.useRef(null),y=C.useRef(l);y.current=l,C.useEffect(()=>m(n),[n]),C.useEffect(()=>{if(f===n)return;const p=window.setTimeout(()=>y.current(f),d);return()=>window.clearTimeout(p)},[f,n,d]),C.useEffect(()=>{if(!c)return;const p=S=>{var j,b,N;S.key!=="/"||S.metaKey||S.ctrlKey||S.altKey||(b=(j=S.target)==null?void 0:j.closest)!=null&&b.call(j,"input, textarea, select, [contenteditable]")||(S.preventDefault(),(N=g.current)==null||N.focus())};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[c]);const v=()=>{m(""),l("")};return r.jsxs("div",{className:"tsearch",children:[r.jsx(Lu,{size:15,"aria-hidden":!0}),r.jsx("input",{ref:g,type:"search","aria-label":a,placeholder:i,value:f,onChange:p=>{m(p.target.value),d===0&&l(p.target.value)},onKeyDown:p=>{p.key==="Escape"&&v(),p.key==="Enter"&&l(f)}}),f?r.jsx("button",{type:"button",className:"search-clear","aria-label":"Clear the search",onClick:v,children:r.jsx(Yr,{size:14,"aria-hidden":!0})}):c?r.jsx("kbd",{className:"kbd","aria-hidden":!0,children:"/"}):null]})}const rm=n=>n.toLocaleString("en-US");function nd({shown:n,total:l,noun:a,loaded:i=!1,note:c}){const f=n>=l?`${rm(l)} ${l===1?a[0]:a[1]}`:`${rm(n)} of ${rm(l)} ${a[1]}${i?" loaded":""}`;return r.jsxs("div",{className:"vt-foot",role:"status",children:[c?r.jsx("span",{className:"vt-foot-note",children:c}):null,r.jsx("span",{className:"vt-foot-count",children:f})]})}function TE(n){return typeof n=="object"?n.key:n}function RE(n,l){const a=n.length;return new Proxy(n,{get(i,c,d){if(typeof c=="string"){const f=c.charCodeAt(0);if(f>=48&&f<=57){const m=+c;if(Number.isInteger(m)&&m>=0&&m<a){let g=i[m];if(typeof g!="object"){const y=l[m*2];g=i[m]={index:m,key:g,start:y,size:l[m*2+1],end:y+l[m*2+1],lane:0}}return g}}if(c==="length")return a}return Reflect.get(i,c,d)}})}function Bi(n,l,a){let i=a.initialDeps??[],c,d=!0;function f(){const m=n();return(m.length!==i.length||m.some((y,v)=>i[v]!==y))&&(i=m,c=l(...m),a!=null&&a.onChange&&!(d&&a.skipInitialOnChange)&&a.onChange(c),d=!1),c}return f.updateDeps=m=>{i=m},f}function qv(n,l){if(n===void 0)throw new Error("Unexpected undefined");return n}const Iv=(n,l)=>Math.abs(n-l)<1.01,AE=(n,l,a)=>{let i;return Object.assign(function(...c){n.clearTimeout(i),i=n.setTimeout(()=>l.apply(this,c),a)},{cancel:()=>{n.clearTimeout(i)}})};let jr;const cm=()=>{if(jr!==void 0)return jr;if(typeof navigator>"u")return jr=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return jr=!0;const n=navigator.maxTouchPoints;return jr=navigator.platform==="MacIntel"&&n!==void 0&&n>0},Pv=n=>{const{offsetWidth:l,offsetHeight:a}=n;return{width:l,height:a}},OE=n=>n,zE=n=>{const l=Math.max(n.startIndex-n.overscan,0),i=Math.min(n.endIndex+n.overscan,n.count-1)-l+1,c=new Array(i);for(let d=0;d<i;d++)c[d]=l+d;return c},DE=(n,l)=>{const a=n.scrollElement;if(!a)return;const i=n.targetWindow;if(!i)return;const c=f=>{const{width:m,height:g}=f;l({width:Math.round(m),height:Math.round(g)})};if(c(Pv(a)),!i.ResizeObserver)return()=>{};const d=new i.ResizeObserver(f=>{const m=()=>{const g=f[0];if(g!=null&&g.borderBoxSize){const y=g.borderBoxSize[0];if(y){c({width:y.inlineSize,height:y.blockSize});return}}c(Pv(a))};n.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(m):m()});return d.observe(a,{box:"border-box"}),()=>{d.unobserve(a)}},Gu={passive:!0},kE=typeof window>"u"?!0:"onscrollend"in window,LE=(n,l,a)=>{const i=n.scrollElement;if(!i)return;const c=n.targetWindow;if(!c)return;const d=n.options.useScrollendEvent&&kE;let f=0;const m=d?null:AE(c,()=>l(a(i),!1),n.options.isScrollingResetDelay),g=p=>()=>{f=a(i),m==null||m(),l(f,p)},y=g(!0),v=g(!1);return i.addEventListener("scroll",y,Gu),d&&i.addEventListener("scrollend",v,Gu),()=>{i.removeEventListener("scroll",y),d&&i.removeEventListener("scrollend",v),m==null||m.cancel()}},$E=(n,l)=>LE(n,l,a=>{const{horizontal:i,isRtl:c}=n.options;return i?a.scrollLeft*(c&&-1||1):a.scrollTop}),HE=(n,l,a)=>{if(a.options.useCachedMeasurements){const i=a.indexFromElement(n),c=a.options.getItemKey(i);return a.itemSizeCache.get(c)??a.options.estimateSize(i)}if(l!=null&&l.borderBoxSize){const i=l.borderBoxSize[0];if(i)return Math.round(i[a.options.horizontal?"inlineSize":"blockSize"])}if(!l){const i=a.indexFromElement(n),c=a.options.getItemKey(i),d=a.itemSizeCache.get(c);if(d!==void 0)return d}return n[a.options.horizontal?"offsetWidth":"offsetHeight"]},UE=(n,{adjustments:l=0,behavior:a},i)=>{var c,d;(d=(c=i.scrollElement)==null?void 0:c.scrollTo)==null||d.call(c,{[i.options.horizontal?"left":"top"]:n+l,behavior:a})},FE=UE;function BE(n,l,a,i){if(l===0)return!1;const c=i(0),d=new Set;let f=0;for(;f<n;){const g=a(f);if(g===c)break;d.add(g),f++}const m=n-f;if(m===0||m>=l)return!1;for(let g=0;g<m;g++)if(i(g)!==a(f+g))return!1;for(let g=m;g<l;g++)if(d.has(i(g)))return!1;return!0}class VE{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var a,i,c;return((c=(i=(a=this.targetWindow)==null?void 0:a.performance)==null?void 0:i.now)==null?void 0:c.call(i))??Date.now()},this.observer=(()=>{let a=null;const i=()=>a||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:a=new this.targetWindow.ResizeObserver(c=>{c.forEach(d=>{const f=()=>{const m=d.target,g=this.indexFromElement(m);if(!m.isConnected){this.observer.unobserve(m);for(const[y,v]of this.elementsCache)if(v===m){this.elementsCache.delete(y);break}return}this.isIndexInRange(g)&&this.shouldMeasureDuringScroll(g)&&this.resizeItem(g,this.options.measureElement(m,d,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(f):f()})}));return{disconnect:()=>{var c;(c=i())==null||c.disconnect(),a=null},observe:c=>{var d;return(d=i())==null?void 0:d.observe(c,{box:"border-box"})},unobserve:c=>{var d;return(d=i())==null?void 0:d.unobserve(c)}}})(),this.range=null,this.setOptions=a=>{var i;const c={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:OE,rangeExtractor:zE,onChange:()=>{},measureElement:HE,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const p in a){const S=a[p];S!==void 0&&(c[p]=S)}const d=this.options;let f=null,m=null,g=!1;if(d!==void 0&&d.enabled&&c.enabled&&c.anchorTo==="end"&&this.scrollElement!==null){const p=d.count,S=c.count,j=this.getMeasurements(),b=((i=this._singleLaneMeasurements)==null?void 0:i.items)??j,N=M=>TE(b[M]),E=p>0?N(0):null,A=p>0?N(p-1):null;if(S!==p||p>0&&S>0&&(c.getItemKey(0)!==E||c.getItemKey(S-1)!==A)){g=!0;const M=p>0?this.getVirtualItemForOffset(this.getScrollOffset())??j[0]:null;M&&(f=[M.key,this.getScrollOffset()-M.start]);const _=c.followOnAppend===!0?"auto":c.followOnAppend||null;_&&S>0&&this.isAtEnd(d.scrollEndThreshold)&&(p===0||c.getItemKey(S-1)!==A)&&(S>p||BE(p,S,N,c.getItemKey))&&(m=_)}}this.options=c,g&&(this.pendingMin=0,this.itemSizeCacheVersion++);let y=!1,v=0;if(f&&this.scrollOffset!==null){const[p,S]=f,j=this.getMeasurements(),{count:b,getItemKey:N}=this.options;let E=0;for(;E<b&&N(E)!==p;)E++;if(E<b){const A=j[E];if(A){const T=Math.max(0,A.start+S);!m&&T!==this.scrollOffset&&(v=T-this.scrollOffset,this.scrollOffset=T,y=!0)}}}(y||m)&&(this.pendingScrollAnchor=[y?f[0]:null,y?f[1]:0,m,v])},this.notify=a=>{var i,c;(c=(i=this.options).onChange)==null||c.call(i,this,a)},this.maybeNotify=Bi(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),a=>{this.notify(a)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(a=>a()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var a,i;const c=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==c){if(this.cleanup(),!c){this.maybeNotify();return}if(this.scrollElement=c,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((a=this.scrollElement)==null?void 0:a.window)??null,this.elementsCache.forEach(f=>{this.observer.observe(f)}),this.unsubs.push(this.options.observeElementRect(this,f=>{this.scrollRect=f,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(f,m)=>{if(m&&this._intendedScrollOffset===null&&f===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(f-this._intendedScrollOffset)<1.5&&(f=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(f-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;const g=this.getScrollOffset();this.scrollDirection=m?g===f?this.scrollDirection:g<f?"forward":"backward":null,this.scrollOffset=f,this.isScrolling=m,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const f=this.scrollElement,m=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},g=()=>{this._iosTouching=!1,!(!cm()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};f.addEventListener("touchstart",m,Gu),f.addEventListener("touchend",g,Gu),this.unsubs.push(()=>{f.removeEventListener("touchstart",m),f.removeEventListener("touchend",g),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const d=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,d&&this.scrollElement&&this.options.enabled){const[f,m,g,y]=d;f!==null&&!g&&(cm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?y!==0&&(this._iosDeferredAdjustment+=y):((i=this.scrollState)==null?void 0:i.behavior)==="smooth"&&!Iv(this.getScrollOffset()-y,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),g&&this.scrollToEnd({behavior:g})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;const{target:a,maxAtWrite:i}=this._clampedAdjustment,c=this.getMaxScrollOffset();c>i+.5&&(this._clampedAdjustment=a>c+.5?{target:a,maxAtWrite:c}:null,this._scrollToOffset(a,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const a=this.getScrollOffset(),i=this.getMaxScrollOffset();if(a<0||a>i)return;if(this._iosDeferredAdjustment<0&&a>=i-1){this._iosDeferredAdjustment=0;return}const c=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(a,{adjustments:this.scrollAdjustments+=c,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Bi(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(a,i,c,d,f,m,g,y)=>(this.prevLanes!==void 0&&this.prevLanes!==m&&(this.lanesChangedFlag=!0),this.prevLanes=m,this.pendingMin=null,{count:a,paddingStart:i,scrollMargin:c,getItemKey:d,enabled:f,lanes:m,laneAssignmentMode:g,gap:y}),{key:!1}),this.isIndexInRange=a=>a>=0&&a<this.options.count,this.getMeasurements=Bi(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:a,paddingStart:i,scrollMargin:c,getItemKey:d,enabled:f,lanes:m,laneAssignmentMode:g,gap:y},v)=>{var p;const S=this.itemSizeCache;if(!f)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>a)for(const T of this.laneAssignments.keys())T>=a&&this.laneAssignments.delete(T);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(T=>{this.itemSizeCache.set(T.key,T.size)}));const j=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===a&&(this.lanesSettling=!1),m===1){const T=a*2;let L=(p=this._singleLaneMeasurements)==null?void 0:p.flat;if(!L||L.length<T){const k=new Float64Array(T);L&&j>0&&k.set(L.subarray(0,j*2)),L=k}const M=j===0?new Array(a):this._singleLaneMeasurements.items.slice();let _;if(j===0)_=i+c;else{const k=j-1;_=L[k*2]+L[k*2+1]+y}for(let k=j;k<a;k++){const I=d(k);M[k]=I;const K=S.get(I),O=typeof K=="number"?K:this.options.estimateSize(k);L[k*2]=_,L[k*2+1]=O,_+=O+y}this._singleLaneMeasurements={flat:L,items:M};const R=RE(M,L);return this.measurementsCache=R,R}const b=this.measurementsCache.slice(0,j),N=new Array(m).fill(void 0),E=new Float64Array(m);let A=0;for(let T=0;T<j;T++){const L=b[T];L&&(N[L.lane]===void 0&&A++,N[L.lane]=T,E[L.lane]=L.end)}for(let T=j;T<a;T++){const L=d(T),M=this.laneAssignments.get(T);let _,R;const k=g==="estimate"||S.has(L);if(M!==void 0&&this.options.lanes>1){_=M;const se=N[_],ie=se!==void 0?b[se]:void 0;R=ie?ie.end+y:i+c}else if(A===m){let se=0,ie=E[0],W=N[0];for(let P=1;P<m;P++){const le=E[P];(le<ie||le===ie&&N[P]<W)&&(se=P,ie=le,W=N[P])}_=se,R=ie+y,k&&this.laneAssignments.set(T,_)}else _=T%this.options.lanes,R=i+c,k&&this.laneAssignments.set(T,_);const I=S.get(L),K=typeof I=="number"?I:this.options.estimateSize(T),O=R+K;b[T]={index:T,start:R,size:K,end:O,key:L,lane:_},N[_]===void 0&&A++,N[_]=T,E[_]=O}return this.measurementsCache=b,b},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Bi(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(a,i,c,d)=>a.length===0||i===0?(this.range=null,null):(this.range=qE(a,i,c,d,d===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Bi(()=>{let a=null,i=null;const c=this.calculateRange();return c&&(a=c.startIndex,i=c.endIndex),this.maybeNotify.updateDeps([this.isScrolling,a,i]),[this.options.rangeExtractor,this.options.overscan,this.options.count,a,i]},(a,i,c,d,f)=>d===null||f===null?[]:a({startIndex:d,endIndex:f,overscan:i,count:c}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=a=>{const i=this.options.indexAttribute,c=a.getAttribute(i);return c?parseInt(c,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=a=>{var i;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const c=this.scrollState.index??((i=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:i.index);if(c!==void 0&&this.range){const d=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),f=Math.max(0,c-d),m=Math.min(this.options.count-1,c+d);return a>=f&&a<=m}return!0},this.measureElement=a=>{if(!a){this.elementsCache.forEach((f,m)=>{f.isConnected||(this.observer.unobserve(f),this.elementsCache.delete(m))});return}const i=this.indexFromElement(a);if(!this.isIndexInRange(i))return;const c=this.options.getItemKey(i),d=this.elementsCache.get(c);d!==a&&(d&&this.observer.unobserve(d),this.observer.observe(a),this.elementsCache.set(c,a)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(i)&&this.resizeItem(i,this.options.measureElement(a,void 0,this))},this.resizeItem=(a,i)=>{var c,d,f;if(!this.isIndexInRange(a))return;let m,g,y;const v=(c=this._singleLaneMeasurements)==null?void 0:c.flat;if(this.options.lanes===1&&v!=null)y=this.options.getItemKey(a),g=v[a*2],m=v[a*2+1];else{const j=this.measurementsCache[a];if(!j)return;y=j.key,g=j.start,m=j.size}const p=this.itemSizeCache.get(y)??m,S=i-p;if(S!==0){const j=this.options.anchorTo==="end"&&((d=this.scrollState)==null?void 0:d.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,b=j?this.getTotalSize():0,N=this.getScrollOffset()+this.scrollAdjustments,A=!this.itemSizeCache.has(y)?g<N:g+p<=N&&this.scrollDirection!=="backward",T=((f=this.scrollState)==null?void 0:f.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[a]??{index:a,key:y,start:g,size:m,end:g+m,lane:0},S,this):A);(this.pendingMin===null||a<this.pendingMin)&&(this.pendingMin=a),this.itemSizeCache.set(y,i),this.itemSizeCacheVersion++;let L=!1;j?L=this.applyScrollAdjustment(this.getTotalSize()-b):T&&(L=this.applyScrollAdjustment(S)),this.notify(L),this._retryClampedAdjustment()}},this.getVirtualItems=Bi(()=>[this.getVirtualIndexes(),this.getMeasurements()],(a,i)=>{const c=[];for(let d=0,f=a.length;d<f;d++){const m=a[d],g=i[m];c.push(g)}return c},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=a=>{var i;const c=this.getMeasurements();if(c.length===0)return;const d=(i=this._singleLaneMeasurements)==null?void 0:i.flat,f=this.options.lanes===1&&d!=null,m=Qy(0,c.length-1,f?g=>d[g*2]:g=>qv(c[g]).start,a);return qv(c[m])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const a=this.scrollElement.document.documentElement;return this.options.horizontal?a.scrollWidth-this.scrollElement.innerWidth:a.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(a=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=a,this.getOffsetForAlignment=(a,i,c=0)=>{if(!this.scrollElement)return 0;const d=this.getSize(),f=this.getScrollOffset();i==="auto"&&(i=a>=f+d?"end":"start"),i==="center"?a+=(c-d)/2:i==="end"&&(a-=d);const m=this.getMaxScrollOffset();return Math.max(Math.min(m,a),0)},this.getOffsetForIndex=(a,i="auto")=>{a=Math.max(0,Math.min(a,this.options.count-1));const c=this.getSize(),d=this.getScrollOffset(),f=this.measurementsCache[a];if(!f)return;if(i==="auto")if(f.end>=d+c-this.options.scrollPaddingEnd)i="end";else if(f.start<=d+this.options.scrollPaddingStart)i="start";else return[d,i];if(i==="end"&&a===this.options.count-1)return[this.getMaxScrollOffset(),i];const m=i==="end"?f.end+this.options.scrollPaddingEnd:f.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(m,i,f.size),i]},this.scrollToOffset=(a,{align:i="start",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0;const d=this.getOffsetForAlignment(a,i),f=this.now();this.scrollState={index:null,align:i,behavior:c,startedAt:f,lastTargetOffset:d,stableFrames:0},this._scrollToOffset(d,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollToIndex=(a,{align:i="auto",behavior:c="auto"}={})=>{this._iosDeferredAdjustment=0,a=Math.max(0,Math.min(a,this.options.count-1));const d=this.getOffsetForIndex(a,i);if(!d)return;const[f,m]=d,g=this.now();this.scrollState={index:a,align:m,behavior:c,startedAt:g,lastTargetOffset:f,stableFrames:0},this._scrollToOffset(f,{adjustments:void 0,behavior:c}),this.scheduleScrollReconcile()},this.scrollBy=(a,{behavior:i="auto"}={})=>{const c=this.getScrollOffset()+a,d=this.now();this.scrollState={index:null,align:"start",behavior:i,startedAt:d,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:a="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:a});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:a})},this.getTotalSize=()=>{var a,i;const c=this.getMeasurements();let d;if(c.length===0)d=this.options.paddingStart;else if(this.options.lanes===1){const f=c.length-1,m=(a=this._singleLaneMeasurements)==null?void 0:a.flat;m!=null?d=m[f*2]+m[f*2+1]:d=((i=c[f])==null?void 0:i.end)??0}else{const f=Array(this.options.lanes).fill(null);let m=c.length-1;for(;m>=0&&f.some(g=>g===null);){const g=c[m];f[g.lane]===null&&(f[g.lane]=g.end),m--}d=Math.max(...f.filter(g=>g!==null))}return Math.max(d-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const a=[];if(this.itemSizeCache.size===0)return a;const i=this.getMeasurements();for(const c of i)c&&this.itemSizeCache.has(c.key)&&a.push({index:c.index,key:c.key,start:c.start,size:c.size,end:c.end,lane:c.lane});return a},this._scrollToOffset=(a,{adjustments:i,behavior:c})=>{this._intendedScrollOffset=a+(i??0),this.options.scrollToFn(a,{behavior:c,adjustments:i},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(l)}applyScrollAdjustment(l,a){if(l===0)return!1;if(cm()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=l,!1;{const i=this.getScrollOffset()+this.scrollAdjustments+l,c=this.scrollElement,d=c!==null&&("scrollHeight"in c||"document"in c)?this.getMaxScrollOffset():null;return this._clampedAdjustment=d!==null&&i>d+.5?{target:i,maxAtWrite:d}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:a}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const i=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,c=i?i[0]:this.scrollState.lastTargetOffset,d=1,f=c!==this.scrollState.lastTargetOffset;if(!f&&Iv(c,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=d){this.getScrollOffset()!==c&&this._scrollToOffset(c,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,f){const m=this.getSize()||600,g=Math.abs(c-this.getScrollOffset()),y=this.scrollState.behavior==="smooth"&&g>m;this.scrollState.lastTargetOffset=c,y||(this.scrollState.behavior="auto"),this._scrollToOffset(c,{adjustments:void 0,behavior:y?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Qy=(n,l,a,i)=>{for(;n<=l;){const c=(n+l)/2|0,d=a(c);if(d<i)n=c+1;else if(d>i)l=c-1;else return c}return n>0?n-1:0};function GE(n,l,a){let i=0;for(;i<=l;){const c=(i+l)/2|0,d=n[c*2];if(d<a)i=c+1;else if(d>a)l=c-1;else return c}return i>0?i-1:0}function qE(n,l,a,i,c){const d=n.length-1;if(n.length<=i)return{startIndex:0,endIndex:d};if(i===1&&c!==null){const y=GE(c,d,a);let v=y;const p=a+l;for(;v<d&&c[v*2]+c[v*2+1]<p;)v++;return{startIndex:y,endIndex:v}}let m=Qy(0,d,y=>n[y].start,a),g=m;if(i===1)for(;g<d&&n[g].end<a+l;)g++;else if(i>1){const y=Array(i).fill(0);for(;g<d&&y.some(p=>p<a+l);){const p=n[g];y[p.lane]=p.end,g++}const v=Array(i).fill(a+l);for(;m>=0&&v.some(p=>p>=a);){const p=n[m];v[p.lane]=p.start,m--}m=Math.max(0,m-m%i),g=Math.min(d,g+(i-1-g%i))}return{startIndex:m,endIndex:g}}const um=typeof document<"u"?C.useLayoutEffect:C.useEffect;function IE({useFlushSync:n=!0,directDomUpdates:l=!1,directDomUpdatesMode:a="transform",...i}){const c=C.useReducer(p=>p+1,0)[1],d=C.useRef({enabled:l,mode:a,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});d.current.enabled=l,d.current.mode=a;const f=C.useRef(!1),m=p=>{const S=d.current;if(!S.enabled||!S.container)return;const j=p.getTotalSize();if(j!==S.lastSize){S.lastSize=j;const b=p.options.horizontal?"width":"height";S.container.style[b]=`${j}px`}},g=p=>{const S=d.current;if(!S.enabled||!S.container)return;m(p);const j=!!p.options.horizontal,b=S.mode==="transform",N=j?"left":"top",E=p.options.scrollMargin,A=p.getVirtualItems();for(const T of A){const L=T.start-E,M=p.elementsCache.get(T.key);M&&S.lastPositions.get(M)!==L&&(S.lastPositions.set(M,L),b?M.style.transform=j?`translate3d(${L}px, 0, 0)`:`translate3d(0, ${L}px, 0)`:M.style[N]=`${L}px`)}},y={...i,onChange:(p,S)=>{var j;const b=d.current;let N=!0;if(b.enabled){g(p);const E=p.range,A=b.prevRange;N=!A||A.isScrolling!==p.isScrolling||A.startIndex!==(E==null?void 0:E.startIndex)||A.endIndex!==(E==null?void 0:E.endIndex),N&&(b.prevRange=E?{startIndex:E.startIndex,endIndex:E.endIndex,isScrolling:p.isScrolling}:null)}N&&(n&&S&&!f.current?Pr.flushSync(c):c()),(j=i.onChange)==null||j.call(i,p,S)}},[v]=C.useState(()=>{const p=new VE(y),S=p.measureElement;return p.measureElement=j=>{f.current=!0;try{S(j)}finally{f.current=!1}},Object.assign(p,{containerRef:j=>{const b=d.current;if(b.container=j,b.lastSize=null,j&&b.enabled){const N=p.getTotalSize();b.lastSize=N;const E=p.options.horizontal?"width":"height";j.style[E]=`${N}px`}}})});return v.setOptions(y),um(()=>v._didMount(),[]),um(()=>(m(v),v._willUpdate())),um(()=>{g(v)}),v}function PE(n){return IE({observeElementRect:DE,observeElementOffset:$E,scrollToFn:FE,...n})}const Yy=33,Vi=32,QE=25;function Xy({items:n,scrollRef:l,columnCount:a,getKey:i,render:c,onEndReached:d,endThreshold:f=15,rowHeight:m=Yy}){var E;const g=PE({count:n.length,getScrollElement:()=>l.current,estimateSize:()=>m,overscan:8,scrollMargin:Vi,getItemKey:A=>i(n[A],A),initialRect:{width:1e3,height:Vi+m*10}}),y=!((E=g.scrollRect)!=null&&E.height),v=y?n.slice(0,QE).map((A,T)=>({key:i(A,T),index:T,start:Vi+T*m,end:Vi+(T+1)*m})):g.getVirtualItems(),p=v[0],S=v[v.length-1],j=(S==null?void 0:S.index)??-1;C.useEffect(()=>{d&&j>=0&&j>=n.length-f&&d()},[j,n.length,f,d]);const b=!y&&p?p.start-Vi:0,N=!y&&S?g.getTotalSize()-(S.end-Vi):0;return r.jsxs(r.Fragment,{children:[b>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:b},children:r.jsx("td",{colSpan:a})})}),v.map(A=>r.jsx("tbody",{"data-index":A.index,ref:y?void 0:g.measureElement,children:c(n[A.index],A.index)},A.key)),N>0&&r.jsx("tbody",{"aria-hidden":!0,children:r.jsx("tr",{className:"vt-spacer",style:{height:N},children:r.jsx("td",{colSpan:a})})})]})}function Va({text:n,query:l}){const a=l.trim();if(!a||BC(a))return r.jsx(r.Fragment,{children:n});const i=[],c=n.toLowerCase(),d=a.toLowerCase();let f=0;for(let m=c.indexOf(d);m!==-1;m=c.indexOf(d,f))m>f&&i.push(n.slice(f,m)),i.push(r.jsx("mark",{children:n.slice(m,m+a.length)},m)),f=m+a.length;return i.push(n.slice(f)),r.jsx(r.Fragment,{children:i})}function Qv({value:n,max:l,clonal:a}){return n===null?r.jsx("span",{style:{color:"var(--chev)"},children:"–"}):r.jsxs("span",{className:"vbar",children:[r.jsx("span",{className:"vbar-n",children:Qm(n)}),r.jsxs("span",{className:"vbar-track","aria-hidden":!0,children:[r.jsx("span",{className:"vbar-fill",style:{width:`${Math.min(n/l,1)*100}%`}}),a&&r.jsx("span",{className:"vbar-tick",style:{left:`${1/l*100}%`}})]})]})}function YE({variant:n,showDriver:l}){return r.jsxs("span",{className:"flex flex-wrap gap-1.5",children:[l&&n.is_driver&&r.jsx("span",{className:"sc-pill p-neu",children:"Driver"}),n.hotspot&&r.jsx("span",{className:"sc-pill p-hot",children:"Hotspot"}),n.in_dmp&&r.jsx("span",{className:"sc-pill p-dmp",children:"In DMP"}),n.ffpe_removed&&r.jsx("span",{className:"sc-pill p-ffpe",title:"Left out of the report's counts by its FFPE artifact filter",children:"FFPE filtered"})]})}function XE(n){return`${n.ref}>${n.alt}`}function KE({variant:n,onLocate:l}){const[a,i]=C.useState(!1),c=`chr${n.chrom}:${n.pos}`,d=[["Variant",`${n.kind==="snv"?"SNV":n.kind==="indel"?"Indel":n.kind}, ${XE(n)}`],...n.depth!==null?[["Reads",`${n.alt_reads??"?"} of ${n.depth}`]]:[],["Normal VAF",Qm(n.normal_vaf)],["Mutant copies",IC(n.mut_alleles)??"–"],["Consequence",(n.consequence??n.effect??"–").replace(/&/g,", ")],["COSMIC",qC(n.cosmic)??"–"],...n.ffpe_score!==null||n.ffpe_removed?[["FFPE artifact score",n.ffpe_score!==null?Qm(n.ffpe_score):"Not scored"]]:[],["Expression",n.gene_tpm!==null?`${n.gene_tpm.toFixed(1)} TPM`:"–"],["Gene role",PC(n)??"–"]];return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:d.map(([f,m])=>r.jsxs("div",{children:[r.jsx("dt",{children:f}),r.jsx("dd",{children:m})]},f))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l(n),children:[r.jsx(Pm,{size:14,"aria-hidden":!0}),"Show on copy number"]}),r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(c),i(!0),window.setTimeout(()=>i(!1),1500)}catch{window.prompt("Copy this locus",c)}},children:[r.jsx(cy,{size:14,"aria-hidden":!0}),a?"Copied":"Copy locus"]})]})]})}function ZE({sort:n,current:l,onSort:a}){const i=l.replace(/^-/,"")===n.key,c=l.startsWith("-"),d=i?c?n.key:`-${n.key}`:n.descFirst?`-${n.key}`:n.key;return r.jsxs("button",{type:"button",className:"vt-sort","data-active":i,onClick:()=>a(d),title:`Sort by ${n.label.toLowerCase()}`,children:[n.label,i&&c?r.jsx(ku,{size:12,"aria-hidden":!0}):i?r.jsx(ay,{size:12,"aria-hidden":!0}):r.jsx(ku,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function JE({data:n,rows:l,hasMore:a,loadingMore:i,onMore:c,table:d,fetching:f,showCcf:m,onTable:g,onHover:y,onLocate:v}){const[p,S]=C.useState({}),j=d.q,b=d.scope!=="drivers",N=C.useMemo(()=>[{id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),meta:{className:"pin vt-x"},cell:({row:R})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":R.getIsExpanded(),"aria-label":`Details of ${R.original.gene??"this mutation"} ${R.original.protein_change??""}`.trim(),onClick:k=>{k.stopPropagation(),R.toggleExpanded()},onFocus:()=>y(R.original),children:r.jsx(Yu,{size:14,"aria-hidden":!0})})},{id:"gene",header:"Gene",meta:{className:"pin vt-g",sorts:[{key:"gene",label:"Gene"},{key:"position",label:"Position"}]},cell:({row:{original:R}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Va,{text:R.gene??"–",query:j})}),r.jsx("span",{className:"vt-sub mono",children:$r(R.chrom,R.pos)})]})},{id:"change",header:"Change",cell:({row:{original:R}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"mono text-[12.5px] font-medium",children:r.jsx(Va,{text:R.protein_change??"–",query:j})}),R.cdna_change&&r.jsx("span",{className:"vt-sub mono",children:r.jsx(Va,{text:R.cdna_change,query:j})})]})},{id:"effect",header:"Effect",meta:{sorts:[{key:"effect",label:"Effect"}]},cell:({row:{original:R}})=>r.jsx("span",{className:R.effect_class==="truncating"?"font-semibold":void 0,children:pC(R.consequence,R.effect)})},{id:"vaf",header:"VAF",meta:{className:"n",sorts:[{key:"vaf",label:"VAF",descFirst:!0}]},cell:({row:{original:R}})=>r.jsx(Qv,{value:R.vaf,max:1})},...m?[{id:"ccf",header:"CCF",meta:{className:"n",sorts:[{key:"ccf",label:"CCF",descFirst:!0}]},cell:({row:{original:R}})=>r.jsx(Qv,{value:R.ccf,max:1.25,clonal:!0})}]:[],{id:"flags",header:"Flags",cell:({row:{original:R}})=>r.jsx(YE,{variant:R,showDriver:b})}],[j,b,m,y]),E=Py({data:l,columns:N,getRowId:FC,getCoreRowModel:qy(),getExpandedRowModel:Iy(),getRowCanExpand:()=>!0,manualPagination:!0,state:{expanded:p},onExpandedChange:S}),A=d.sort.replace(/^-/,""),T=E.getVisibleLeafColumns().length,L=Ny(d)>0,M=C.useRef(null),_=JSON.stringify([d.scope,d.sort,d.q,d.effects,d.flags,d.range,d.ffpe]);return C.useEffect(()=>{M.current&&(M.current.scrollTop=0)},[_]),r.jsxs("div",{className:"flex min-w-0 flex-col",children:[r.jsx("div",{className:"tbar",children:r.jsx(Vu,{value:d.q,onChange:R=>g({q:R})})}),r.jsxs("div",{ref:M,className:"vt-scroll vt-viewport",onMouseLeave:()=>y(null),"aria-busy":f,children:[f&&r.jsx("div",{className:"vt-progress","aria-hidden":!0}),r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:E.getHeaderGroups().map(R=>r.jsx("tr",{children:R.headers.map(k=>{var O;const I=k.column.columnDef.meta,K=(O=I==null?void 0:I.sorts)==null?void 0:O.some(se=>se.key===A);return r.jsx("th",{className:I==null?void 0:I.className,"aria-sort":K?d.sort.startsWith("-")?"descending":"ascending":void 0,children:I!=null&&I.sorts?r.jsx("span",{className:"vt-sorts",children:I.sorts.map(se=>r.jsx(ZE,{sort:se,current:d.sort,onSort:ie=>g({sort:ie})},se.key))}):Bu(k.column.columnDef.header,k.getContext())},k.id)})},R.id))}),r.jsx(Xy,{items:E.getRowModel().rows,scrollRef:M,columnCount:T,getKey:R=>R.id,onEndReached:a&&!i?c:void 0,render:R=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":R.getIsExpanded(),onClick:()=>R.toggleExpanded(),onMouseEnter:()=>y(R.original),children:R.getVisibleCells().map(k=>{var I;return r.jsx("td",{className:(I=k.column.columnDef.meta)==null?void 0:I.className,children:Bu(k.column.columnDef.cell,k.getContext())},k.id)})}),R.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:T,children:r.jsx(KE,{variant:R.original,onLocate:v})})})]})}),l.length===0&&r.jsx("tbody",{children:r.jsx("tr",{children:r.jsx("td",{colSpan:T,children:r.jsx("div",{className:"vt-empty",children:L?r.jsxs(r.Fragment,{children:["No mutations match these filters.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>g({q:"",effects:[],flags:[],range:null}),children:"Clear all filters"})]}):`No ${d.scope==="all"?"":`${d.scope} `}mutations in this sample.`})})})})]})]}),n.total>0&&r.jsx(nd,{shown:l.length,total:n.total,noun:["mutation","mutations"],loaded:!0,note:i?"Loading more…":l.length<n.total?"Scroll the table for more":void 0})]})}const WE=C.forwardRef(function({variants:l,rows:a,hasMore:i,loadingMore:c,onMore:d,variantsLoading:f,variantsFetching:m,density:g,densityLoading:y,picked:v,measure:p,onMeasure:S,table:j,onTable:b,hovered:N,onHover:E,onLocate:A,showCcf:T,tmb:L},M){var se,ie;const _=(l==null?void 0:l.status)==="ok"?l.data??void 0:void 0,R=_==null?void 0:_.counts,k=(g==null?void 0:g.status)==="ok"?(se=g.data)==null?void 0:se.total:void 0,I=(g==null?void 0:g.status)==="ok"?(ie=g.data)==null?void 0:ie.ffpe:null,K=W=>W===void 0?"":W.toLocaleString("en-US"),O=j.range&&j.range.measure===p?[j.range.low,j.range.high]:null;return r.jsxs(nl,{ref:M,title:"Mutations",subtitle:k!==void 0?`${K(k)} PASS SNVs and indels${I&&!I.shown?", after the FFPE filter":""}`:void 0,lineage:Ju(g==null?void 0:g.lineage,l==null?void 0:l.lineage,L==null?void 0:L.lineage),picked:v,className:"mut",info:"mutations",expandable:!0,controls:r.jsx(r.Fragment,{children:r.jsx(ls,{label:"Which mutations",value:j.scope,onChange:W=>b({scope:W,sort:wy[W]}),options:[{value:"drivers",label:r.jsxs(r.Fragment,{children:["Drivers",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.drivers)})]})},{value:"coding",label:r.jsxs(r.Fragment,{children:["Coding",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.coding)})]})},{value:"all",label:r.jsxs(r.Fragment,{children:["All",r.jsx("span",{className:"seg-n",children:K(R==null?void 0:R.all)})]})}]})}),children:[r.jsx(OM,{envelope:g,loading:y,measure:p,onMeasure:S,range:O,focus:N,onRange:W=>{!W&&!j.range||b({range:W?{measure:p,low:W[0],high:W[1]}:null})},onGene:W=>b({q:W})}),_&&l&&l.warnings.length>0&&r.jsx("div",{className:"px-5 py-2 text-xs",role:"note",style:{color:"var(--warn-ink)"},children:l.warnings.join(" ")}),_?r.jsxs("div",{className:"mut-body",children:[r.jsx(kM,{table:j,data:_,onChange:b}),r.jsx(JE,{data:_,rows:a,hasMore:i,loadingMore:c,onMore:d,table:j,fetching:m,showCcf:T,onTable:b,onHover:E,onLocate:A})]}):r.jsx("div",{className:"mut-rule",children:r.jsx(ss,{label:"mutations",envelope:l,loading:f,skeletonHeight:240,children:()=>null})}),(L==null?void 0:L.status)==="ok"&&L.data&&r.jsx($M,{data:L.data}),(L==null?void 0:L.status)==="missing"&&L.warnings.some(W=>W.includes("Rerun"))&&r.jsxs("section",{className:"sig-section","aria-label":"Coding mutations against reference cohorts",children:[r.jsx("h3",{className:"sv-h",children:"Coding mutations against reference cohorts"}),r.jsx("p",{className:"sv-empty",children:L.warnings.join(" ")})]})]})}),Tg={oncogene:"Oncogene",tsg:"Tumour suppressor",both:"Oncogene and TSG"},Ky=["oncogene","tsg","both"],qa={deletion:"Deletion","tandem-duplication":"Tandem duplication",inversion:"Inversion",translocation:"Translocation"},e4={"<1kb":"<1 kb","1kb-10kb":"1–10 kb","10kb-100kb":"10–100 kb","100kb-1Mb":"100 kb–1 Mb",">1Mb":">1 Mb"};function t4(n){return n?e4[n]??n:""}const n4={DEL:"Deletion",DUP:"Duplication",INV:"Inversion",TRA:"Translocation",BND:"Breakend",INS:"Insertion"};function Rg(n){return n?n4[n]??n:"–"}function s4(n){return n==null?"–":n>=1e6?`${(n/1e6).toLocaleString("en-US",{maximumFractionDigits:1})} Mb`:n>=1e3?`${(n/1e3).toLocaleString("en-US",{maximumFractionDigits:1})} kb`:`${n.toLocaleString("en-US")} bp`}function l4(n){return n.some(l=>l.left_expression||l.right_expression||l.expression)}function a4(n){const l={oncogene:0,tsg:0,both:0};for(const a of n)a.role&&(l[a.role]+=1);return l}function i4(n){const l=n.trim().match(Ey);if(!l)return null;const a=Number(l[2].replace(/,/g,"")),i=l[3]?Number(l[3].replace(/,/g,"")):a;return{chrom:l[1].toUpperCase(),start:Math.min(a,i),end:Math.max(a,i)}}function o4(n,l){const a=l.trim().toLowerCase();if(!a)return!0;const i=i4(l);if(i){const c=(d,f)=>(d==null?void 0:d.toUpperCase())===i.chrom&&f!==null&&f>=i.start&&f<=i.end;return c(n.left_chrom,n.left_pos)||c(n.right_chrom,n.right_pos)}return[n.gene,n.left_gene,n.right_gene,n.callers,n.left_loc,n.right_loc,n.sv_type,Rg(n.sv_type),n.role?Tg[n.role]:null].some(c=>c==null?void 0:c.toLowerCase().includes(a))}const On={deletion:"var(--sv-del)","tandem-duplication":"var(--sv-dup)",inversion:"var(--sv-inv)",translocation:"var(--sv-tra)"},r4={deletion:"Deletion","tandem-duplication":"Tandem dup.",inversion:"Inversion",translocation:"Transl."},c4={"<1kb":"<1k","1kb-10kb":"10k","10kb-100kb":"100k","100kb-1Mb":"1M",">1Mb":">1M"};function u4(n){return n.size?c4[n.size]??n.size:""}function Yv(n){const l=`${n.clustered?"Clustered":"Dispersed"} ${qa[n.sv_class].toLowerCase()}s`;return n.size?`${l}, ${t4(n.size)}`:l}function d4(n){const l=[];return n.forEach((a,i)=>{const c=l[l.length-1];c&&c.clustered===a.clustered&&c.sv_class===a.sv_class?c.end=i:l.push({clustered:a.clustered,sv_class:a.sv_class,start:i,end:i})}),l}function h4(n){const l=new Map;for(const a of n)l.set(a.sv_class,(l.get(a.sv_class)??0)+a.count);return[...l].map(([a,i])=>({sv_class:a,count:i}))}const f4=45;function m4({role:n}){return n?r.jsx("span",{className:`sc-pill p-${n==="oncogene"?"onco":n}`,children:Tg[n]}):r.jsx("span",{style:{color:"var(--chev)"},children:"–"})}function g4({rows:n,shown:l,onToggle:a}){const i=a4(n);return r.jsx("div",{className:"sv-legend",role:"group","aria-label":"Show rows by gene role",children:Ky.filter(c=>i[c]>0).map(c=>r.jsxs("button",{type:"button",className:`sv-legend-item p-${c==="oncogene"?"onco":c}`,"aria-pressed":l.includes(c),onClick:()=>a(c),children:[Tg[c],r.jsx("span",{className:"sv-legend-n",children:i[c]})]},c))})}function Xv({gene:n,chrom:l,pos:a,loc:i,query:c}){return r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"sv-end",children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Va,{text:n||"–",query:c})}),i&&r.jsx("span",{className:"sv-loc",children:i})]}),r.jsx("span",{className:"vt-sub stack mono",children:l&&a!==null?$r(l,a):"–"})]})}function Zy(n){return n?n.replace(/,\s*/g,", "):"–"}function p4({label:n,sorted:l,onClick:a}){return r.jsxs("button",{type:"button",className:"vt-sort","data-active":!!l,onClick:a,title:`Sort by ${n.toLowerCase()}`,children:[n,l==="desc"?r.jsx(ku,{size:12,"aria-hidden":!0}):l==="asc"?r.jsx(ay,{size:12,"aria-hidden":!0}):r.jsx(ku,{size:12,"aria-hidden":!0,className:"vt-sort-idle"})]})}function v4({row:n,onLocate:l}){const[a,i]=C.useState(!1),c=n.left_chrom&&n.left_pos!==null?{chrom:n.left_chrom,pos:n.left_pos}:null,d=n.right_chrom&&n.right_pos!==null?{chrom:n.right_chrom,pos:n.right_pos}:null,f=[["Type",Rg(n.sv_type)],["Left breakpoint",c?`${$r(c.chrom,c.pos)}${n.left_loc?`, ${n.left_loc}`:""}`:"–"],["Right breakpoint",d?`${$r(d.chrom,d.pos)}${n.right_loc?`, ${n.right_loc}`:""}`:"–"],["Pileups (left, right)",[n.left_pileup,n.right_pileup].filter(Boolean).join(", ")||"–"],["Orientation",n.orientation??"–"],["Callers",Zy(n.callers)]],m=n.gene??n.left_gene,g=n.gene??n.right_gene;return r.jsxs("div",{className:"vt-detail-body",children:[r.jsx("dl",{className:"vt-facts",children:f.map(([y,v])=>r.jsxs("div",{children:[r.jsx("dt",{children:y}),r.jsx("dd",{children:v})]},y))}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l({...c,gene:m}),children:[r.jsx(Pm,{size:14,"aria-hidden":!0}),"Show ",d&&d.chrom===c.chrom?"it":"left breakpoint"," on copy number"]}),d&&d.chrom!==(c==null?void 0:c.chrom)&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>l({...d,gene:g}),children:[r.jsx(Pm,{size:14,"aria-hidden":!0}),"Show right breakpoint on copy number"]}),n.igv_locus&&r.jsxs("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:async()=>{try{await navigator.clipboard.writeText(n.igv_locus??""),i(!0),window.setTimeout(()=>i(!1),1500)}catch{window.prompt("Copy these IGV loci",n.igv_locus??"")}},children:[r.jsx(cy,{size:14,"aria-hidden":!0}),a?"Copied":"Copy IGV loci"]})]})]})}function Kv({kind:n,rows:l,total:a=l.length,query:i="",onLocate:c}){const[d,f]=C.useState({}),[m,g]=C.useState([]),y=C.useRef(null),v=l4(l);C.useEffect(()=>{y.current&&(y.current.scrollTop=0)},[i,l.length]);const p=C.useMemo(()=>{const N={id:"expand",header:()=>r.jsx("span",{className:"sr-only",children:"Details"}),enableSorting:!1,meta:{className:"pin vt-x"},cell:({row:T})=>r.jsx("button",{type:"button",className:"vt-expand","aria-expanded":T.getIsExpanded(),"aria-label":`Details of ${T.original.gene??[T.original.left_gene,T.original.right_gene].filter(Boolean).join(" and ")}`,onClick:L=>{L.stopPropagation(),T.toggleExpanded()},children:r.jsx(Yu,{size:14,"aria-hidden":!0})})},E=[{id:"type",header:"Type",accessorFn:T=>T.sv_type??"",cell:({row:{original:T}})=>Rg(T.sv_type)},{id:"role",header:"Role",accessorFn:T=>T.role?Ky.indexOf(T.role):9,cell:({row:{original:T}})=>r.jsx(m4,{role:T.role})},{id:"callers",header:"Callers",accessorFn:T=>T.callers??"",cell:({row:{original:T}})=>r.jsx("span",{className:"text-[12.5px]",children:Zy(T.callers)})},{id:"support",header:"Support",accessorFn:T=>T.max_support??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:T}})=>r.jsx("span",{className:"mono",children:T.max_support??"–"})},{id:"pileups",header:"Pileups",enableSorting:!1,cell:({row:{original:T}})=>r.jsx("span",{className:"mono text-[12px]",children:[T.left_pileup,T.right_pileup].filter(Boolean).join(" · ")||"–"})}],A=v?[{id:"expression",header:"Expression",enableSorting:!1,cell:({row:{original:T}})=>n==="whole_gene"?r.jsx("span",{className:"text-[12.5px]",children:T.expression??"–"}):r.jsxs("span",{className:"flex flex-col text-[12.5px] leading-snug",children:[r.jsx("span",{children:T.left_expression??"–"}),r.jsx("span",{style:{color:"var(--muted)"},children:T.right_expression??"–"})]})}]:[];return n==="whole_gene"?[N,{id:"gene",header:"Gene",accessorFn:T=>T.gene??"",meta:{className:"pin vt-g"},cell:({row:{original:T}})=>r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"vt-gene",children:r.jsx(Va,{text:T.gene??"–",query:i})}),r.jsx("span",{className:"vt-sub mono",children:T.left_chrom&&T.left_pos!==null&&T.right_pos!==null?`${$r(T.left_chrom,T.left_pos)}–${T.right_pos.toLocaleString("en-US")}`:"–"})]})},{id:"length",header:"Length",accessorFn:T=>T.length??-1,sortDescFirst:!0,meta:{className:"n"},cell:({row:{original:T}})=>r.jsx("span",{className:"mono",children:s4(T.length)})},...E,...A]:[N,{id:"left",header:"Left",accessorFn:T=>T.left_gene??"",meta:{className:"pin vt-g"},cell:({row:{original:T}})=>r.jsx(Xv,{gene:T.left_gene,chrom:T.left_chrom,pos:T.left_pos,loc:T.left_loc,query:i})},{id:"right",header:"Right",accessorFn:T=>T.right_gene??"",cell:({row:{original:T}})=>r.jsx(Xv,{gene:T.right_gene,chrom:T.right_chrom,pos:T.right_pos,loc:T.right_loc,query:i})},...E,...A]},[n,v,i]),S=Py({data:l,columns:p,getRowId:N=>`${n}-${N.row}`,getCoreRowModel:qy(),getSortedRowModel:CE(),getExpandedRowModel:Iy(),getRowCanExpand:()=>!0,state:{expanded:d,sorting:m},onExpandedChange:f,onSortingChange:g}),j=S.getVisibleLeafColumns().length,b=n==="onco"?f4:Yy;return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:y,className:"vt-scroll vt-viewport",style:{"--row-h":`${b}px`},children:r.jsxs("table",{className:"vt",children:[r.jsx("thead",{children:S.getHeaderGroups().map(N=>r.jsx("tr",{children:N.headers.map(E=>{const A=E.column.columnDef.meta,T=E.column.getIsSorted();return r.jsx("th",{className:A==null?void 0:A.className,"aria-sort":T?T==="desc"?"descending":"ascending":void 0,children:E.column.getCanSort()?r.jsx(p4,{label:String(E.column.columnDef.header),sorted:T,onClick:E.column.getToggleSortingHandler()}):Bu(E.column.columnDef.header,E.getContext())},E.id)})},N.id))}),r.jsx(Xy,{items:S.getRowModel().rows,scrollRef:y,columnCount:j,rowHeight:b,getKey:N=>N.id,render:N=>r.jsxs(r.Fragment,{children:[r.jsx("tr",{className:"vt-row","data-expanded":N.getIsExpanded(),onClick:()=>N.toggleExpanded(),children:N.getVisibleCells().map(E=>{var A;return r.jsx("td",{className:(A=E.column.columnDef.meta)==null?void 0:A.className,children:Bu(E.column.columnDef.cell,E.getContext())},E.id)})}),N.getIsExpanded()&&r.jsx("tr",{className:"vt-detail",children:r.jsx("td",{colSpan:j,children:r.jsx(v4,{row:N.original,onLocate:c})})})]})})]})}),r.jsx(nd,{shown:l.length,total:a,noun:["row","rows"]})]})}const wr=176,dm=34,hm=7,fm=22,Eu=30,x4={deletion:"Del","tandem-duplication":"Dup",inversion:"Inv",translocation:"Tra"};function y4(n,l){return[qa[n],r4[n],x4[n]].find(i=>Ms(i,12)+8<=l)??""}function S4(n,l,a,i,c){const d=Math.min(c,a/2,i);return`M${n},${l+i} V${l+d} Q${n},${l} ${n+d},${l} H${n+a-d} Q${n+a},${l} ${n+a},${l+d} V${l+i} Z`}function b4({categories:n,total:l,litClass:a}){const[i,c]=_s(),d=C.useId(),[f,m]=C.useState(null),g=d4(n),y=Math.max(0,...n.map(O=>O.count)),v=ed(y,3),p=v[v.length-1],S=n.length,j=(g.length-1)*hm,b=n.some(O=>O.clustered)&&n.some(O=>!O.clustered),N=Math.max((c-Eu-6-j-(b?fm-hm:0))/S,4),E=Math.min(26,N*.64),A=[],T=[];let L=Eu;g.forEach((O,se)=>{se>0&&(L+=g[se-1].clustered!==O.clustered?fm:hm);const ie=L;for(let le=O.start;le<=O.end;le++)A[le]=L+(N-E)/2,L+=N;const W=T.find(le=>le.clustered===O.clustered&&le.x1>=ie-fm-1),P=n.slice(O.start,O.end+1).reduce((le,$)=>le+$.count,0);W?(W.x1=L,W.count+=P):T.push({clustered:O.clustered,x0:ie,x1:L,count:P})});const M=O=>dm+wr-O/p*wr,_=dm+wr,R=O=>f!==null?O===f:a?n[O].sv_class===a:!0,k=f===null?null:n[f],I=k&&l?Math.round(k.count/l*100):0,K=_+62;return r.jsxs("div",{ref:i,className:"rs","data-lit":f!==null||a?"":void 0,children:[r.jsxs("svg",{width:c,height:K,role:"img","aria-label":`Rearrangement signatures: ${n.filter(O=>O.count>0).map(O=>`${O.category} ${O.count}`).join(", ")}`,children:[r.jsx("defs",{children:Object.keys(On).map(O=>r.jsxs("linearGradient",{id:`${d}-${O}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[r.jsx("stop",{offset:"0",style:{stopColor:On[O]}}),r.jsx("stop",{offset:"1",style:{stopColor:On[O]},stopOpacity:.72})]},O))}),T.map(O=>r.jsxs("g",{children:[b&&O.clustered&&r.jsx("rect",{x:O.x0-6,y:0,width:O.x1-O.x0+12,height:_+56,rx:14,className:"rs-zone"}),b&&r.jsxs("text",{x:O.x0,y:17,className:"rs-zone-name",children:[O.clustered?"Clustered":"Dispersed",r.jsxs("tspan",{className:"rs-zone-n",children:[" ",O.count.toLocaleString("en-US")]})]})]},O.clustered?"c":"d")),v.map(O=>r.jsxs("g",{children:[r.jsx("line",{x1:Eu-4,x2:c,y1:M(O),y2:M(O),className:O===0?"rs-base":"rs-grid"}),r.jsx("text",{x:Eu-10,y:M(O)+4,textAnchor:"end",className:"rs-tick",children:O.toLocaleString("en-US")})]},O)),n.map((O,se)=>{const ie=O.count/p*wr,W=R(se);return r.jsxs("g",{className:"rs-bar","data-off":W?void 0:"",children:[O.count>0?r.jsxs(r.Fragment,{children:[r.jsx("path",{d:S4(A[se],M(O.count),E,ie,6),fill:`url(#${d}-${O.sv_class})`,fillOpacity:O.clustered?.5:1}),r.jsx("text",{x:A[se]+E/2,y:M(O.count)-7,textAnchor:"middle",className:"rs-count",children:O.count.toLocaleString("en-US")})]}):r.jsx("rect",{x:A[se],y:_-3,width:E,height:3,rx:1.5,style:{fill:On[O.sv_class]},fillOpacity:.28}),O.size&&N>=26&&r.jsx("text",{x:A[se]+E/2,y:_+16,textAnchor:"middle",className:"rs-size",children:u4(O)}),r.jsx("rect",{x:A[se]-(N-E)/2,y:dm-8,width:N,height:wr+30,fill:"transparent",tabIndex:0,"aria-label":`${Yv(O)}: ${O.count}`,onMouseEnter:()=>m(se),onMouseLeave:()=>m(null),onFocus:()=>m(se),onBlur:()=>m(null)})]},O.category)}),g.map(O=>{const se=A[O.start],ie=A[O.end]+E,W=y4(O.sv_class,ie-se+(N-E));return r.jsxs("g",{className:"rs-class","data-off":a&&a!==O.sv_class?"":void 0,children:[r.jsx("line",{x1:se,x2:ie,y1:_+26,y2:_+26,style:{stroke:On[O.sv_class]},className:"rs-bracket"}),r.jsx("text",{x:(se+ie)/2,y:_+44,textAnchor:"middle",className:"rs-class-name",children:W})]},`${O.clustered}-${O.sv_class}`)})]}),k&&f!==null&&r.jsxs(en,{x:A[f]+E/2,y:Math.max(M(k.count)-8,40),width:c,above:!0,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:On[k.sv_class],opacity:k.clustered?.5:1},"aria-hidden":!0}),Yv(k)]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements"}),r.jsx("b",{children:k.count.toLocaleString("en-US")})]}),l>0&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Of all of them"}),r.jsxs("b",{children:[I===0&&k.count>0?"<1":I,"%"]})]})]})]})}function Jy(n,l,a){return`${n.toLocaleString("en-US")} ${n===1?l:a}`}function j4({categories:n,total:l}){const[a,i]=C.useState(null),c=h4(n);return r.jsxs("div",{className:"sv-sigs",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h3",{className:"sv-h",children:["Rearrangement signatures",r.jsx("span",{className:"sv-h-n",children:Jy(l,"rearrangement","rearrangements")})]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Classes",onMouseLeave:()=>i(null),children:[c.map(({sv_class:d,count:f})=>r.jsxs("li",{"data-on":a===d||void 0,onMouseEnter:()=>i(d),children:[r.jsx("span",{className:"sv-swatch",style:{background:On[d]},"aria-hidden":!0}),qa[d],r.jsx("span",{className:"sv-key-n",children:f.toLocaleString("en-US")})]},d)),r.jsx("li",{className:"sv-sigs-note",children:"Lighter bars: clustered"})]})]}),r.jsx("div",{className:"sv-sigs-plot",children:r.jsx(b4,{categories:n,total:l,litClass:a})})]})}function w4({data:n,query:l,onQuery:a,onLocate:i}){const[c,d]=C.useState([]),f=j=>d(b=>b.includes(j)?b.filter(N=>N!==j):[...b,j]),m=j=>j.filter(b=>o4(b,l)),g=j=>c.length?j.filter(b=>b.role&&c.includes(b.role)):j,y=[...n.onco,...n.whole_gene],v=[...m(n.onco),...m(n.whole_gene)],p=g(m(n.onco)),S=g(m(n.whole_gene));return y.length===0?r.jsx("p",{className:"sv-empty",children:"No rearrangements with breakpoints in oncogenes or tumour suppressors."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"tbar",children:[v.length>0&&r.jsx(g4,{rows:v,shown:c,onToggle:f}),r.jsx(Vu,{value:l,onChange:a,label:"Search structural variants",placeholder:"Search gene, caller or locus",shortcut:!1})]}),v.length===0&&r.jsxs("div",{className:"vt-empty sv-empty",children:["No rows match this search.",r.jsx("button",{type:"button",className:"sc-btn sc-b2 sm",onClick:()=>a(""),children:"Clear the search"})]}),p.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Rearranged oncogenes and tumour suppressors",children:[r.jsx("h3",{className:"sv-h",children:"Rearranged oncogenes and tumour suppressors"}),r.jsx(Kv,{kind:"onco",rows:p,total:n.onco.length,query:l,onLocate:i})]}),S.length>0&&r.jsxs("section",{className:"sv-table","aria-label":"Whole-gene rearrangements",children:[r.jsx("h3",{className:"sv-h",children:"Whole-gene rearrangements"}),r.jsx(Kv,{kind:"whole_gene",rows:S,total:n.whole_gene.length,query:l,onLocate:i})]})]})}const N4=C.forwardRef(function({envelope:l,loading:a,picked:i,onLocate:c},d){const f=(l==null?void 0:l.status)==="ok"?l.data:null,[m,g]=C.useState("");return r.jsx(nl,{ref:d,title:"Structural variants",subtitle:f?Jy(f.rearrangements,"rearrangement","rearrangements"):void 0,lineage:(l==null?void 0:l.lineage)??[],picked:i,info:"structuralVariants",className:"svs",expandable:!0,children:r.jsx(ss,{label:"structural variants",envelope:l,loading:a,skeletonHeight:220,children:y=>r.jsxs("div",{className:"sv-body",children:[r.jsx(w4,{data:y,query:m,onQuery:g,onLocate:c}),y.signatures&&r.jsx(j4,{categories:y.signatures.categories,total:y.signatures.total})]})})})}),Zv=["C>A","C>G","C>T","T>A","T>C","T>G"],Ra={"C>A":"#03bcee","C>G":"#222222","C>T":"#e32926","T>A":"#999999","T>C":"#a1ce63","T>G":"#e9a9a5"};function C4(n,l){const a=n.contexts.every(g=>g.reconstructed!==null),i=n.contexts.reduce((g,y)=>g+y.observed,0),c=a?n.contexts.reduce((g,y)=>g+(y.reconstructed??0),0):0,d=n.contexts.map(g=>l==="share"?i?g.observed/i*100:0:g.observed),f=a?n.contexts.map(g=>l==="share"?c?(g.reconstructed??0)/c*100:0:g.reconstructed??0):null,m=f?d.map((g,y)=>g-f[y]):null;return{observed:d,reconstructed:f,difference:m,top:Math.max(0,...d,...f??[]),reach:m?Math.max(0,...m.map(Math.abs)):0}}function M4(n){const l=[];return n.forEach((a,i)=>{const c=l[l.length-1];c&&c.substitution===a.substitution?c.end=i:l.push({substitution:a.substitution,start:i,end:i})}),l}function E4(n,l,a,i=10){const c=l-i*(n.length-1),d=p=>p.end-p.start+1,f=n.reduce((p,S)=>p+d(S),0),m=a?n.find(p=>p.substitution===a):void 0,g=m?Math.min(.62,Math.max(.4,d(m)*30/c)):0,y=[];let v=0;for(const p of n){const S=d(p),j=m?p===m?c*g:c*(1-g)*S/(f-d(m)):c*S/f,b=j/S;for(let N=0;N<S;N++)y.push({x:v+N*b+b*.11,width:b*.78});v+=j+i}return y}function mm(n){return[n.five_prime,n.substitution[0],n.three_prime]}function gm(n,l){return l==="count"?Math.round(n).toLocaleString("en-US"):`${n.toFixed(n>=10?1:2)}%`}function Jv(n,l){return n==="cosine"?l.toFixed(3):l.toExponential(2).replace("e-","e−").replace("e+","e")}const Sn=46,_4=6,Ca=28,pm=14,Xs=96,Gi=84,T4=["This tumour","Rebuilt from its signatures","Difference"],R4={reported:"Reported run",unfiltered:"Unfiltered"};function A4({data:n}){const[l,a]=_s(760),[i,c]=C.useState("share"),[d,f]=C.useState("reported"),[m,g]=C.useState(null),[y,v]=C.useState(null),p=n.runs.find(W=>W.source===d)??n.runs[0],S=n.reconstructed&&p.contexts.every(W=>W.reconstructed!==null),j=C.useMemo(()=>C4(p,i),[p,i]),b=C.useMemo(()=>M4(p.contexts),[p]),N=Math.max(a-Sn-_4,240),E=C.useMemo(()=>E4(b,N,m,pm),[b,N,m]),A=S?3:1,T=m?22:0,L=[Ca,Ca+Xs+pm,Ca+2*(Xs+pm)],M=(S?L[2]+Gi:L[0]+Xs)+T+8,_=i==="share"?"%":"",R=ed(j.top,2),k=R[R.length-1],I=Math.max(j.reach*1.15,i==="share"?.5:1),K=(W,P)=>P===2?Gi/2*(1-W/I):Xs*(1-W/k),O=[j.observed,j.reconstructed,j.difference],se=y===null?null:p.contexts[y],ie=W=>Sn+E[W].x+E[W].width/2;return r.jsxs("section",{className:"ctx sig-section","aria-label":"96 mutational contexts",children:[r.jsxs("div",{className:"ctx-head",children:[r.jsxs("h3",{className:"sv-h",children:["96 mutational contexts",r.jsxs("span",{className:"sv-h-n",children:[Math.round(p.total).toLocaleString("en-US")," SNVs"]})]}),r.jsxs("div",{className:"ctx-controls",children:[S&&n.fit&&r.jsxs("span",{className:"ctx-fit",title:"How well the fitted signatures rebuild the profile, as the report measures it",children:[n.fit.cosine!==null&&r.jsxs("span",{children:["Cosine similarity ",r.jsx("b",{children:Jv("cosine",n.fit.cosine)})]}),n.fit.rss!==null&&r.jsxs("span",{children:["RSS ",r.jsx("b",{children:Jv("rss",n.fit.rss)})]})]}),n.runs.length>1&&r.jsx(ls,{label:"Run",value:d,onChange:f,options:n.runs.map(W=>({value:W.source,label:R4[W.source]}))}),r.jsx(ls,{label:"Profile measure",value:i,onChange:c,options:[{value:"share",label:"Share"},{value:"count",label:"Count"}]})]})]}),r.jsx("div",{className:"ctx-wrap",children:r.jsxs("div",{ref:l,className:"ctx-plot",onMouseLeave:()=>v(null),children:[r.jsxs("svg",{width:a,height:M,role:"img","aria-label":`SNVs in the 96 mutational contexts${S?", observed and rebuilt from signatures":""}`,children:[r.jsx("g",{transform:`translate(${Sn} 0)`,children:b.map(W=>{const P=E[W.start],le=E[W.end],$=P.x-P.width*.14,Z=le.x+le.width*1.14,J=m===W.substitution;return r.jsxs("g",{className:"ctx-chip","data-on":J||void 0,role:"button",tabIndex:0,"aria-pressed":J,"aria-label":`${W.substitution}: ${J?"show all classes":"label its sixteen contexts"}`,onClick:()=>g(J?null:W.substitution),onKeyDown:ce=>{(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),g(J?null:W.substitution))},children:[r.jsx("rect",{x:$,y:0,width:Math.max(Z-$,1),height:22,rx:11}),r.jsx("circle",{cx:$+11,cy:11,r:4.5,fill:Ra[W.substitution]}),r.jsx("text",{x:$+22,y:15,children:W.substitution})]},W.substitution)})}),Array.from({length:A},(W,P)=>{const le=L[P],$=P===2?Gi:Xs,Z=O[P];return Z?r.jsxs("g",{transform:`translate(0 ${le})`,className:"ctx-panel",children:[P<2?R.map(J=>r.jsxs("g",{children:[r.jsx("line",{x1:Sn,x2:Sn+N,y1:K(J,P),y2:K(J,P),className:J===0?"ctx-base":"ctx-grid"}),r.jsxs("text",{x:Sn-8,y:K(J,P)+4,textAnchor:"end",className:"ctx-tick",children:[J,_]})]},J)):r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:Sn,x2:Sn+N,y1:$/2,y2:$/2,className:"ctx-base"}),r.jsx("text",{x:Sn-8,y:$/2+4,textAnchor:"end",className:"ctx-tick",children:"0"})]}),r.jsx("text",{x:Sn+2,y:12,className:"ctx-name",children:T4[P]}),r.jsx("g",{className:"ctx-bars","data-hover":y!==null||void 0,children:Z.map((J,ce)=>{const ae=E[ce],oe=Sn+ae.x,xe=P===2?$/2:$,je=K(J,P),D=Ra[p.contexts[ce].substitution],U=Math.abs(xe-je);return r.jsx("rect",{x:oe,y:Math.min(je,xe),width:ae.width,height:Math.max(U,J===0?0:.8),rx:Math.min(2,ae.width/2),fill:D,className:"ctx-bar","data-on":y===ce||void 0,"data-dim":m&&p.contexts[ce].substitution!==m?"":void 0},ce)})})]},P):null}),y!==null&&r.jsx("rect",{x:Sn+E[y].x-2,y:Ca-4,width:E[y].width+4,height:(S?L[2]+Gi:L[0]+Xs)-Ca+8,rx:4,className:"ctx-column",pointerEvents:"none"}),m&&p.contexts.map((W,P)=>W.substitution===m?r.jsxs("text",{x:Sn+E[P].x+E[P].width/2,y:(S?L[2]+Gi:L[0]+Xs)+16,textAnchor:"middle",className:"ctx-tri",children:[mm(W)[0],r.jsx("tspan",{className:"ctx-tri-mid",style:{fill:Ra[W.substitution]},children:mm(W)[1]}),mm(W)[2]]},P):null),E.map((W,P)=>r.jsx("rect",{x:Sn+W.x-(W.width*.14+1),y:Ca,width:W.width*1.28+2,height:(S?L[2]+Gi:L[0]+Xs)-Ca,fill:"transparent",className:"ctx-hit",tabIndex:0,"aria-label":`${p.contexts[P].context}: ${p.contexts[P].observed} SNVs`,onMouseEnter:()=>v(P),onFocus:()=>v(P),onBlur:()=>v(null)},P))]}),se&&y!==null&&r.jsxs(en,{x:ie(y),y:L[0]+Xs/2,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Ra[se.substitution]},"aria-hidden":!0}),r.jsx("span",{className:"mono",children:se.context})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Observed"}),r.jsxs("b",{children:[gm(j.observed[y],i),r.jsxs("i",{children:[" ",i==="share"?`${se.observed.toLocaleString("en-US")} SNVs`:""]})]})]}),j.reconstructed&&j.difference&&r.jsxs(r.Fragment,{children:[r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rebuilt"}),r.jsx("b",{children:gm(j.reconstructed[y],i)})]}),r.jsxs("span",{className:"ctip-note",children:[j.difference[y]>=0?"Observed above":"Observed below"," the signatures by"," ",gm(Math.abs(j.difference[y]),i).replace("%",i==="share"?" points":"")]})]})]})]})}),!S&&r.jsx("p",{className:"ctx-note",children:"Only the observed profile is shown: this report did not include the signature matrix its fit used, so what the signatures rebuild cannot be drawn."})]})}const Ea=n=>n==null?"–":n.toFixed(2),O4=8,z4=250,Ye={w:232,h:148,cx:116,cy:122,r:92};function vm(n,l){const a=Ki(Ye.cx,Ye.cy,Ye.r,n),i=Ki(Ye.cx,Ye.cy,Ye.r,l);return`M${a.x.toFixed(2)},${a.y.toFixed(2)} A${Ye.r},${Ye.r} 0 0 1 ${i.x.toFixed(2)},${i.y.toFixed(2)}`}function D4({score:n}){const l=n.value===null?null:n.exact??n.value,a=l===null?null:Math.min(Math.max(l,0),1),i=hM(n),c=n.value!==null&&i!==n.value.toFixed(2),d=fM(n),f=n.rating==="HIGH",m=n.threshold,g=m===null?null:[Ki(Ye.cx,Ye.cy,Ye.r-14,m),Ki(Ye.cx,Ye.cy,Ye.r+14,m),Ki(Ye.cx,Ye.cy,Ye.r+27,m)],y=a===null?null:Ki(Ye.cx,Ye.cy,Ye.r,a);return r.jsxs("div",{className:"hrd-score","data-high":f||void 0,children:[r.jsxs("div",{className:"hrd-score-head",children:[r.jsx("span",{className:"hrd-name",children:n.name}),n.rating&&r.jsx("span",{className:`sc-pill ${f?"p-warn":"p-neu"}`,children:n.rating})]}),r.jsxs("svg",{width:Ye.w,height:Ye.h,viewBox:`0 0 ${Ye.w} ${Ye.h}`,role:"img","aria-label":`${n.name} ${a===null?"has no score":`scores ${i}`}${n.rating?`, rated ${n.rating}`:""}`,className:"hrd-gauge",children:[r.jsx("path",{d:vm(0,1),pathLength:1,className:"hrd-track"}),m!==null&&r.jsx("path",{d:vm(m,1),pathLength:1,className:"hrd-zone"}),a!==null&&r.jsx("path",{d:vm(0,1),pathLength:1,className:"hrd-fill",style:{"--v":a}}),g&&r.jsxs(r.Fragment,{children:[r.jsx("line",{x1:g[0].x,y1:g[0].y,x2:g[1].x,y2:g[1].y,className:"hrd-tick"}),r.jsx("text",{x:g[2].x,y:g[2].y+4,textAnchor:"middle",className:"hrd-tick-label",children:m})]}),y&&r.jsx("circle",{cx:y.x,cy:y.y,r:8.5,className:"hrd-end"}),r.jsx("text",{x:Ye.cx,y:Ye.cy-10,textAnchor:"middle",className:"hrd-num",children:i}),r.jsx("text",{x:Ye.cx-Ye.r,y:Ye.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"0"}),r.jsx("text",{x:Ye.cx+Ye.r,y:Ye.cy+18,textAnchor:"middle",className:"hrd-end-label",children:"1"})]}),(d||c)&&r.jsxs("span",{className:"hrd-rule",children:[d,c&&r.jsxs("span",{className:"hrd-rounded",children:["The report rounds it to ",Ea(n.value)]})]})]})}function k4(n){const l=n.filter(a=>a.stats&&a.stats.tumour!==null);return{above:l.filter(a=>a.stats.tumour>a.stats.median).length,of:l.length}}const L4="var(--font)";function $4({features:n}){var L;const[l,a]=_s(720),[i,c]=C.useState(null),d=n.map(M=>({feature:M,stats:zy(M)})),f=a<640,m=f?0:116,g=f?0:168,y=m+10,v=a-g-14,p=M=>y+M*(v-y),S=f?28:0,j=f?100:70,b=S+38,N=30,E=d.length*j+14,A=E+22,T=i===null?null:d[i];return r.jsxs("div",{ref:l,className:"clouds",onMouseLeave:()=>c(null),children:[r.jsxs("svg",{width:a,height:A,role:"img","aria-label":"HRDetect features against the cohort",style:{fontFamily:L4},children:[[0,.25,.5,.75,1].map(M=>r.jsx("line",{x1:p(M),x2:p(M),y1:0,y2:E,className:"cloud-grid","data-major":M===0||M===1||void 0},M)),d.map(({feature:M,stats:_},R)=>{var W;const k=R*j,I=Ov(M.feature),K=_&&_.values.length<=z4?_.values:[],O=dM(K.map(p),7.5),se=_&&_.values.length>=O4?uM(_.values):null,ie=_&&_.tumour!==null?p(_.tumour):null;return r.jsxs("g",{transform:`translate(0 ${k})`,className:"cloud-row","data-on":i===R||void 0,onMouseEnter:()=>c(R),children:[r.jsx("rect",{x:0,y:2,width:a,height:j-4,rx:12,className:"cloud-hit"}),_&&r.jsxs(r.Fragment,{children:[r.jsx("rect",{x:p(_.q1),y:S+4,width:Math.max(p(_.q3)-p(_.q1),2),height:j-S-10,rx:8,className:"cloud-iqr"}),r.jsx("line",{x1:p(_.median),x2:p(_.median),y1:S+10,y2:j-14,className:"cloud-median"}),se&&r.jsxs(r.Fragment,{children:[r.jsx("path",{d:`M${p(0)},${b} ${se.map(P=>`L${p(P.x).toFixed(1)},${(b-P.y*N).toFixed(1)}`).join(" ")} L${p(1)},${b} Z`,className:"cloud-area"}),r.jsx("path",{d:se.map((P,le)=>`${le?"L":"M"}${p(P.x).toFixed(1)},${(b-P.y*N).toFixed(1)}`).join(" "),className:"cloud-line"})]}),K.map((P,le)=>r.jsx("circle",{cx:p(P),cy:b+11+Math.min(O[le],2)*7,r:3,className:"cloud-dot"},le)),ie!==null&&r.jsxs("g",{className:"cloud-pin",transform:`translate(${ie} 0)`,children:[r.jsx("line",{y1:S+8,y2:b,className:"cloud-stem"}),r.jsx("circle",{cy:b,r:8,className:"cloud-pin-dot"})]})]}),r.jsx("text",{x:f?4:6,y:f?18:b-6,className:"cloud-name",children:I}),!f&&r.jsxs("text",{x:6,y:b+10,className:"cloud-raw",children:["raw ",Ea((W=M.sample)==null?void 0:W.raw)]}),_&&r.jsx("text",{x:a-4,y:f?18:b-6,textAnchor:"end",className:"cloud-rank",children:Kf(_)}),!f&&_&&r.jsxs("text",{x:a-4,y:b+10,textAnchor:"end",className:"cloud-raw",children:["of ",_.values.length," in the cohort"]})]},M.feature)}),r.jsxs("g",{transform:`translate(0 ${E})`,className:"cloud-axis",children:[r.jsx("text",{x:p(0),y:12,textAnchor:"start",children:"0 · cohort lowest"}),r.jsx("text",{x:p(.5),y:12,textAnchor:"middle",children:"0.5"}),r.jsx("text",{x:p(1),y:12,textAnchor:"end",children:"cohort highest · 1"})]})]}),T&&i!==null&&T.stats&&r.jsxs(en,{x:T.stats.tumour!==null?p(T.stats.tumour):p(T.stats.median),y:i*j+b,width:a,children:[r.jsx("span",{className:"ctip-title",children:Ov(T.feature.feature,"long")}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[Ea((L=T.feature.sample)==null?void 0:L.raw)," ",r.jsxs("i",{children:["scaled ",Ea(T.stats.tumour)]})]})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort median"}),r.jsx("b",{children:Ea(T.stats.median)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Middle half"}),r.jsxs("b",{children:[Ea(T.stats.q1),"–",Ea(T.stats.q3)]})]}),Kf(T.stats)&&r.jsx("span",{className:"ctip-note",children:Kf(T.stats)})]})]})}const Nr=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,Cr=n=>Math.round(n).toLocaleString("en-US"),H4=n=>`${n>=0?"+":"−"}${Math.abs(n).toFixed(Math.abs(n)>=10?0:1)}`,Wv=3,qi=26,Ii=52;function U4({groups:n,bands:l,lit:a,onLight:i}){const[c,d]=_s(),f=n.find(R=>R.group==="sample")??n[0],m=n.find(R=>R.group==="cohort")??null,g=m!==null,y=d>=440,v=y?d>=620?118:92:0,p=g?330:230,S=kv(l.map(R=>R.share),p,Wv),j=g?kv(l.map(R=>R.cohortShare??0),p,Wv):[],b=g?v:0,N=d-v-qi,E=b+qi,A=N,T=l.find(R=>R.name===a)??null,L=T?l.indexOf(T):-1,M=L<0?0:Ii+((S[L].y0+S[L].y1)/2+(g?(j[L].y0+j[L].y1)/2:(S[L].y0+S[L].y1)/2))/2,_=(R,k,I,K,O,se)=>{const ie=R.y1-R.y0;if(!y||ie<17)return null;const W=Ii+(R.y0+R.y1)/2,P=ie>=36;return r.jsxs("text",{x:O,y:W,textAnchor:se,className:"flow-label",children:[r.jsxs("tspan",{x:O,dy:P?"-0.35em":"0.35em",className:"flow-name",children:[k.name,!P&&r.jsxs("tspan",{className:"flow-share",children:[" ",Nr(I)]})]}),P&&r.jsxs("tspan",{x:O,dy:"1.35em",className:"flow-share",children:[Nr(I),K]})]})};return r.jsxs("div",{ref:c,className:"flow","data-lit":a??void 0,children:[r.jsxs("svg",{width:d,height:Ii+p+4,role:"img","aria-label":"Signature shares, tumour against cohort",children:[r.jsxs("g",{className:"flow-head",children:[r.jsx("text",{x:0,y:16,className:"flow-col",children:zv(f)}),r.jsxs("text",{x:0,y:34,className:"flow-sub",children:[Cr(f.total)," mutations"]}),m&&r.jsxs(r.Fragment,{children:[r.jsx("text",{x:d,y:16,textAnchor:"end",className:"flow-col",children:zv(m)}),r.jsxs("text",{x:d,y:34,textAnchor:"end",className:"flow-sub",children:["about ",Cr(m.total)," each, on average"]})]})]}),g&&r.jsx("g",{className:"flow-ribs",transform:`translate(0 ${Ii})`,children:l.map((R,k)=>r.jsx("path",{d:cM(E,S[k],A,j[k]),fill:R.colour,className:"flow-rib","data-on":a===R.name||void 0,onMouseEnter:()=>i(R.name),onMouseLeave:()=>i(null)},R.name))}),l.map((R,k)=>{const I=a===R.name||void 0,K=(O,se)=>O.y1-O.y0>.4&&r.jsx("rect",{x:se,y:Ii+O.y0,width:qi,height:O.y1-O.y0,rx:Math.min(5,(O.y1-O.y0)/2),fill:R.colour,className:"flow-seg","data-on":I,tabIndex:0,"aria-label":`${R.name}, ${Nr(R.share)} of this tumour`,onMouseEnter:()=>i(R.name),onMouseLeave:()=>i(null),onFocus:()=>i(R.name),onBlur:()=>i(null)});return r.jsxs("g",{className:"flow-band","data-on":I,children:[K(S[k],b),g&&K(j[k],N),_(S[k],R,R.share,R.count?` · ${Cr(R.count)}`:"",g?b-10:b+qi+10,g?"end":"start"),g&&_(j[k],R,R.cohortShare??0,"",N+qi+10,"start")]},R.name)}),g&&d>=520&&l.map((R,k)=>{const I=Hl(R),K=S[k],O=j[k];if(I===null||Math.abs(I)<5||Math.min(K.y1-K.y0,O.y1-O.y0)<22)return null;const se=(E+A)/2,ie=Ii+(K.y0+K.y1+O.y0+O.y1)/4;return r.jsxs("g",{transform:`translate(${se} ${ie})`,className:"flow-delta","data-on":a===R.name||void 0,children:[r.jsx("rect",{x:-30,y:-10,width:60,height:20,rx:10}),r.jsxs("text",{y:4,textAnchor:"middle",children:[H4(I)," pts"]})]},R.name)})]}),T&&r.jsxs(en,{x:g?d/2:b+qi+v+20,y:M,width:d,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:T.colour},"aria-hidden":!0}),T.name]}),T.aetiology&&r.jsx("span",{className:"ctip-sub",children:T.aetiology}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"This tumour"}),r.jsxs("b",{children:[Nr(T.share)," ",r.jsxs("i",{children:[Cr(T.count)," mutations"]})]})]}),T.cohortShare!==null&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Cohort"}),r.jsxs("b",{children:[Nr(T.cohortShare)," ",r.jsx("i",{children:T.cohortCount!==null?`about ${Cr(T.cohortCount)} each`:""})]})]}),Hl(T)!==null&&r.jsx("span",{className:"ctip-note",children:Math.abs(Hl(T))<1?"About the same as its cohort":`${Math.abs(Hl(T)).toFixed(Math.abs(Hl(T))>=10?0:1)} points ${Hl(T)>0?"above":"below"} its cohort`})]})]})}const ex=n=>`${(n*100).toFixed(n>=.1||n===0?0:1)}%`,Wy=n=>Math.round(n).toLocaleString("en-US");function F4({points:n,reach:l}){if(n===null)return null;const a=Math.min(Math.abs(n)/l,1)*100;return r.jsx("span",{className:"lead","aria-hidden":!0,children:r.jsx("span",{className:"lead-bar","data-up":n>=0||void 0,style:{width:`${Math.max(a,n===0?0:3)}%`}})})}function B4({groups:n}){const[l,a]=C.useState(null),i=C.useMemo(()=>rM(n),[n]),c=n.find(f=>f.group==="cohort"),d=Math.max(10,...i.map(f=>Math.abs(Hl(f)??0)));return r.jsxs("section",{className:"sig-section","aria-label":"Mutational signatures",children:[r.jsx("h3",{className:"sv-h",children:"Mutational signatures"}),r.jsxs("div",{className:"sig-grid",children:[r.jsx(U4,{groups:n,bands:i,lit:l,onLight:a}),r.jsxs("div",{className:"sig-tablebox",children:[r.jsxs("table",{className:"sig-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Signature"}),r.jsx("th",{className:"n",children:"This tumour"}),c&&r.jsx("th",{className:"n",children:"Cohort"}),c&&r.jsx("th",{className:"lead-h",children:"Against cohort"})]})}),r.jsx("tbody",{children:i.map(f=>{const m=Hl(f);return r.jsxs("tr",{"data-lit":l===f.name||void 0,onMouseEnter:()=>a(f.name),onMouseLeave:()=>a(null),children:[r.jsxs("td",{children:[r.jsxs("span",{className:"sig-name",title:f.members.length>1?f.members.join(", "):void 0,children:[r.jsx("span",{className:"sv-swatch",style:{background:f.colour},"aria-hidden":!0}),f.name]}),f.aetiology&&r.jsx("span",{className:"sig-aetiology",children:f.aetiology})]}),r.jsxs("td",{className:"n",children:[r.jsx("span",{className:"mono",children:ex(f.share)}),r.jsx("span",{className:"sig-count",children:Wy(f.count)})]}),c&&r.jsx("td",{className:"n mono",children:ex(f.cohortShare??0)}),c&&r.jsx("td",{children:r.jsxs("span",{className:"lead-cell",children:[r.jsx(F4,{points:m,reach:d}),r.jsx("span",{className:"lead-n mono",children:m===null?"":`${m>=0?"+":"−"}${Math.abs(m).toFixed(0)}`})]})})]},f.name)})})]}),r.jsx(nd,{shown:i.length,total:i.length,noun:["signature","signatures"]})]})]})]})}function V4({envelope:n,loading:l}){return(n==null?void 0:n.status)==="ok"&&n.data?r.jsx(A4,{data:n.data}):n?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("p",{className:"sv-empty",children:n.warnings.join(" ")||"No 96-context profile for this sample."})]}):l?r.jsxs("section",{className:"sig-section","aria-label":"96 mutational contexts",children:[r.jsx("h3",{className:"sv-h",children:"96 mutational contexts"}),r.jsx("div",{className:"px-5 pb-3",children:r.jsx("div",{className:"skeleton",style:{height:220},"aria-label":"Loading 96 mutational contexts"})})]}):null}function G4({hrd:n}){const l=C.useMemo(()=>k4(n.features.map(a=>({feature:a,stats:zy(a)}))),[n.features]);return r.jsxs("section",{className:"sig-section","aria-label":"Homologous recombination deficiency",children:[r.jsx("h3",{className:"sv-h",children:"Homologous recombination deficiency"}),r.jsxs("div",{className:"hrd-body",children:[n.scores.length>0&&r.jsx("div",{className:"hrd-scores",children:n.scores.map(a=>r.jsx(D4,{score:a},a.name))}),n.features.length>0&&r.jsxs("div",{className:"hrd-chart",children:[r.jsxs("div",{className:"sv-sigs-head",children:[r.jsxs("h4",{className:"hrd-sub",children:["HRDetect features against the cohort",n.cohort_n?r.jsxs("span",{className:"sv-h-n",children:["n = ",n.cohort_n]}):null]}),r.jsxs("ul",{className:"sv-sigs-key","aria-label":"Key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-pin","aria-hidden":!0}),"This tumour"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-dot","aria-hidden":!0}),"Cohort sample"]}),r.jsxs("li",{children:[r.jsx("span",{className:"hrd-key-band","aria-hidden":!0}),"Middle half of the cohort"]})]})]}),l.of>0&&r.jsxs("p",{className:"hrd-lede",children:["Above the cohort median on ",r.jsx("b",{children:l.above})," of ",l.of," features"]}),r.jsx($4,{features:n.features})]})]})]})}const q4=C.forwardRef(function({envelope:l,loading:a,contextEnvelope:i,contextLoading:c=!1,picked:d},f){var y;const m=(l==null?void 0:l.status)==="ok"?l.data:null,g=(y=m==null?void 0:m.signatures)==null?void 0:y.find(v=>v.group==="sample");return r.jsx(nl,{ref:f,title:"Signatures and HRD",subtitle:g?`${Wy(g.total)} mutations attributed to signatures`:void 0,lineage:Ju(l==null?void 0:l.lineage,i==null?void 0:i.lineage),picked:d,info:"signaturesHrd",className:"sigs",children:r.jsx(ss,{label:"signatures and HRD",envelope:l,loading:a,skeletonHeight:300,children:v=>r.jsxs("div",{className:"sig-body",children:[v.signatures?r.jsx(B4,{groups:v.signatures}):r.jsx("p",{className:"sv-empty",children:"No signature contributions for this sample."}),r.jsx(V4,{envelope:i,loading:c}),v.hrd&&r.jsx(G4,{hrd:v.hrd})]})})})});function rg(n){return n.kind==="insertion"?"insertion":n.kind==="complex"?"complex":n.mechanism==="microhomology"?"microhomology":n.mechanism==="repeat"?"repeat":"other deletion"}const cg=[{key:"microhomology",label:"Deletion, microhomology",colour:"#9f1d2d"},{key:"repeat",label:"Deletion, repeat",colour:"#d6455a"},{key:"other deletion",label:"Deletion, other",colour:"#f19aa6"},{key:"insertion",label:"Insertion",colour:"#1f9a6c"},{key:"complex",label:"Complex",colour:"#8a8a93"}],tx=Object.fromEntries(cg.map(n=>[n.key,n.colour]));function Zi(n){switch((n.sv_type??"").toUpperCase()){case"DEL":return"deletion";case"DUP":return"tandem-duplication";case"INV":return"inversion";default:return n.chrom1===n.chrom2?"inversion":"translocation"}}const _u=jn;function nx(n=null,l=.42,a=.012){var g;const i=_u.reduce((y,[,v])=>y+v,0),c=2*Math.PI-a*_u.length,d=n?((g=_u.find(([y])=>y===n))==null?void 0:g[1])??0:0,f=[];let m=a/2;for(const[y,v]of _u){const p=!n||!d?v/i*c:y===n?c*l:v/(i-d)*c*(1-l);f.push({chrom:y,length:v,a0:m,a1:m+p}),m+=p+a}return f}function I4(n,l,a){return l.map((i,c)=>({...i,a0:n[c].a0+(i.a0-n[c].a0)*a,a1:n[c].a1+(i.a1-n[c].a1)*a}))}function P4(n){return new Map(n.map(l=>[l.chrom,l]))}function Ks(n,l,a){const i=n.get(l.replace(/^chr/,""));if(!i)return null;const c=Math.min(Math.max(a/i.length,0),1);return i.a0+c*(i.a1-i.a0)}function zt(n,l,a,i){return[n+a*Math.sin(i),l-a*Math.cos(i)]}function Tu(n,l,a,i,c,d){const f=d-c>Math.PI?1:0,[m,g]=zt(n,l,i,c),[y,v]=zt(n,l,i,d),[p,S]=zt(n,l,a,d),[j,b]=zt(n,l,a,c),N=E=>E.toFixed(2);return`M${N(m)},${N(g)} A${i},${i} 0 ${f} 1 ${N(y)},${N(v)} L${N(p)},${N(S)} A${a},${a} 0 ${f} 0 ${N(j)},${N(b)} Z`}function Q4(n,l,a,i,c){const[d,f]=zt(n,l,a,i),[m,g]=zt(n,l,a,c);let y=Math.abs(i-c);y>Math.PI&&(y=2*Math.PI-y);const v=Math.min(y/Math.PI,1),p=(i+c)/2+(Math.abs(i-c)>Math.PI?Math.PI:0),[S,j]=zt(n,l,a*(1-v*.95),p),b=N=>N.toFixed(2);return`M${b(d)},${b(f)} Q${b(S)},${b(j)} ${b(m)},${b(g)}`}function xm(n,l,a,i){const c=Math.log10(Math.max(n,1));return l+Math.min(c,i)/i*(a-l)}function sx(n,l,a,i){const c=Math.atan2(a-n,l-i);return c<0?c+2*Math.PI:c}function lx(n,l){return n.find(a=>l>=a.a0&&l<=a.a1)??null}function Y4(n,l=12){const a=new Map;return n.forEach((i,c)=>{const d=`${Math.floor(i.x/l)},${Math.floor(i.y/l)}`,f=a.get(d);f?f.push(c):a.set(d,[c])}),(i,c,d=7)=>{const f=Math.floor(i/l),m=Math.floor(c/l);let g=null,y=d*d;for(let v=-1;v<=1;v++)for(let p=-1;p<=1;p++)for(const S of a.get(`${f+v},${m+p}`)??[]){const j=(n[S].x-i)**2+(n[S].y-c)**2;j<=y&&(y=j,g=S)}return g}}const tt={ideoIn:.955,rainOut:.93,rainIn:.64,insOut:.625,insIn:.6,delOut:.59,delIn:.565,majOut:.553,majIn:.515,minOut:.505,minIn:.47,link:.455},ym=8,X4=560,Sm=1e6,Ru=(n,l)=>`chr${n}:${l.toLocaleString("en-US")}`,ax=n=>n>=1e6?`${(n/1e6).toFixed(1)} Mb`:n>=1e3?`${(n/1e3).toFixed(1)} kb`:`${n} bp`;function K4(n){return n===null||n<2?null:n<4?"color-mix(in srgb, var(--gain) 45%, transparent)":n<8?"color-mix(in srgb, var(--gain) 80%, transparent)":"var(--gain-strong)"}function Z4({data:n,drivers:l,size:a,tracks:i,lit:c}){var P,le;const d=C.useRef(null),[f,m]=C.useState(null),[g,y]=C.useState(null),[v,p]=C.useState(()=>nx()),S=C.useRef(v);S.current=v,C.useLayoutEffect(()=>{const $=nx(f);if(typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches){p($);return}const J=S.current,ce=performance.now();let ae=0;const oe=xe=>{const je=Math.min(1,(xe-ce)/X4);p(I4(J,$,Cg(je))),je<1&&(ae=requestAnimationFrame(oe))};return ae=requestAnimationFrame(oe),()=>cancelAnimationFrame(ae)},[f]);const j=C.useMemo(()=>P4(v),[v]),b=a/2,N=a/2,E=a/2-58,A=$=>E*$,T=C.useMemo(()=>{const $=[];for(const[Z,J]of Object.entries(n.snvs))for(let ce=0;ce<J.pos.length;ce++){const ae=Ks(j,Z,J.pos[ce]);if(ae===null)continue;const[oe,xe]=zt(b,N,xm(J.distance[ce],A(tt.rainIn),A(tt.rainOut),ym),ae);$.push({x:oe,y:xe,chrom:Z,pos:J.pos[ce],substitution:J.substitution[ce],distance:J.distance[ce]})}return $},[n.snvs,j,a]),L=C.useMemo(()=>Y4(T),[T]);C.useEffect(()=>{const $=d.current;if(!$)return;const Z=typeof window<"u"&&window.devicePixelRatio||1;$.width=a*Z,$.height=a*Z;const J=$.getContext("2d");if(J){if(J.setTransform(Z,0,0,Z,0,0),J.clearRect(0,0,a,a),i.rainfall){const ce=f?2.1:1.6;for(const ae of T){const oe=c&&(c.kind!=="substitution"||c.value!==ae.substitution);J.globalAlpha=oe?.1:.85,J.fillStyle=Ra[ae.substitution]??"#999",J.beginPath(),J.arc(ae.x,ae.y,ce,0,2*Math.PI),J.fill()}}if(i.indels&&n.indels){J.lineWidth=f?1.6:1.1;for(const ce of n.indels){const ae=Ks(j,ce.chrom,(ce.start+ce.end)/2);if(ae===null)continue;const oe=rg(ce),xe=c&&(c.kind!=="indel"||c.value!==oe);J.globalAlpha=xe?.12:.9,J.strokeStyle=tx[oe];const je=ce.kind==="insertion"?A(tt.insIn):A(tt.delIn),D=ce.kind==="insertion"?A(tt.insOut):A(tt.delOut),[U,q]=zt(b,N,je,ae),[re,he]=zt(b,N,D,ae);J.beginPath(),J.moveTo(U,q),J.lineTo(re,he),J.stroke()}}J.globalAlpha=1}},[T,n.indels,j,a,i.rainfall,i.indels,c,f,b,N,E]);const M=C.useMemo(()=>{const $=new Map;for(const ae of l)ae.gene&&!$.has(ae.gene)&&$.set(ae.gene,ae);const Z=[...$.values()].map(ae=>({d:ae,angle:Ks(j,ae.chrom,ae.pos)})).filter(ae=>ae.angle!==null).sort((ae,oe)=>ae.angle-oe.angle),J=E+30,ce=Uu(Z.map(ae=>({left:ae.angle*J,width:Ms(ae.d.gene??"",11,600)+8})),2);return Z.map((ae,oe)=>({...ae,row:ce[oe]}))},[l,j,E]),_=n.svs,R=_.map($=>[Ks(j,$.chrom1,$.pos1),Ks(j,$.chrom2,$.pos2)]),k=f?j.get(f):void 0,I=k?ed(k.length/Sm,8).filter($=>$*Sm<=k.length):[],K=$=>{var xe;if((xe=$.target.classList)!=null&&xe.contains("circ-link-hit"))return;const Z=$.currentTarget.getBoundingClientRect(),J=$.clientX-Z.left,ce=$.clientY-Z.top,ae=Math.hypot(J-b,ce-N),oe=sx(b,N,J,ce);if(ae>=A(tt.ideoIn)&&ae<=E+22){const je=lx(v,oe);y(je?{kind:"chrom",chrom:je.chrom,x:J,y:ce}:null);return}if(i.rainfall&&ae>=A(tt.rainIn)-4&&ae<=A(tt.rainOut)+4){const je=L(J,ce);if(je!==null){const D=T[je];y({kind:"snv",chrom:D.chrom,pos:D.pos,substitution:D.substitution,distance:D.distance,x:D.x,y:D.y});return}}if(i.indels&&n.indels&&ae>=A(tt.delIn)&&ae<=A(tt.insOut)){let je=-1,D=.01;if(n.indels.forEach((U,q)=>{const re=Ks(j,U.chrom,(U.start+U.end)/2);re!==null&&Math.abs(re-oe)<D&&(D=Math.abs(re-oe),je=q)}),je>=0){y({kind:"indel",index:je,x:J,y:ce});return}}(g==null?void 0:g.kind)!=="link"&&y(null)},O=$=>!c||c.kind==="sv"&&c.value===Zi($),se=(g==null?void 0:g.kind)==="chrom"?g.chrom:null,ie=(g==null?void 0:g.kind)==="link"?_[g.index]:null,W=(g==null?void 0:g.kind)==="indel"&&n.indels?n.indels[g.index]:null;return r.jsxs("div",{className:"circ",style:{width:a,height:a},onMouseLeave:()=>y(null),children:[r.jsxs("svg",{width:a,height:a,className:"circ-under","aria-hidden":!0,children:[v.map(($,Z)=>r.jsx("path",{d:Tu(b,N,A(tt.rainIn),A(tt.rainOut),$.a0,$.a1),className:"circ-band","data-odd":Z%2||void 0,"data-on":se===$.chrom||f===$.chrom||void 0},$.chrom)),[2,4,6].map($=>r.jsx("circle",{cx:b,cy:N,r:xm(10**$,A(tt.rainIn),A(tt.rainOut),ym),className:"circ-grid"},$))]}),r.jsx("canvas",{ref:d,className:"circ-canvas",style:{width:a,height:a},"aria-hidden":!0}),r.jsxs("svg",{width:a,height:a,className:"circ-over",role:"img","aria-label":`Integrated circos: ${n.snv_total.toLocaleString("en-US")} SNVs, ${((P=n.indels)==null?void 0:P.length)??0} indels, ${_.length} rearrangements`,onMouseMove:K,onClick:$=>{const Z=$.currentTarget.getBoundingClientRect(),J=$.clientX-Z.left,ce=$.clientY-Z.top,ae=Math.hypot(J-b,ce-N);if(ae<A(tt.ideoIn)||ae>E+22)return;const oe=lx(v,sx(b,N,J,ce));oe&&m(xe=>xe===oe.chrom?null:oe.chrom)},children:[[2,4,6].map($=>{const[Z,J]=zt(b,N,xm(10**$,A(tt.rainIn),A(tt.rainOut),ym),0);return r.jsx("text",{x:Z+3,y:J-2,className:"circ-scale",children:$===2?"100 bp":$===4?"10 kb":"1 Mb"},$)}),i.copyNumber&&n.segments.map(($,Z)=>{const J=Ks(j,$.chrom,$.start),ce=Ks(j,$.chrom,$.end);if(J===null||ce===null||ce-J<=0)return null;const ae=K4($.major_cn),oe=$.minor_cn===0;return r.jsxs("g",{children:[ae&&r.jsx("path",{d:Tu(b,N,A(tt.majIn),A(tt.majOut),J,ce),style:{fill:ae},className:"circ-cn"}),oe&&r.jsx("path",{d:Tu(b,N,A(tt.minIn),A(tt.minOut),J,ce),className:"circ-loh"})]},Z)}),i.copyNumber&&r.jsxs(r.Fragment,{children:[r.jsx("circle",{cx:b,cy:N,r:A(tt.majIn),className:"circ-ring-line"}),r.jsx("circle",{cx:b,cy:N,r:A(tt.minIn),className:"circ-ring-line"})]}),i.links&&_.map(($,Z)=>{const[J,ce]=R[Z];if(J===null||ce===null)return null;const ae=Q4(b,N,A(tt.link),J,ce),oe=(g==null?void 0:g.kind)==="link"&&g.index===Z,xe=Zi($);return r.jsxs("g",{className:"circ-link","data-on":oe||void 0,"data-dim":!O($)||void 0,children:[r.jsx("path",{d:ae,style:{stroke:On[xe]},className:"circ-link-line"}),r.jsx("path",{d:ae,className:"circ-link-hit",onMouseEnter:je=>{const D=je.currentTarget.ownerSVGElement.getBoundingClientRect();y({kind:"link",index:Z,x:je.clientX-D.left,y:je.clientY-D.top})},onMouseLeave:()=>y(null)})]},Z)}),v.map(($,Z)=>{const J=($.a0+$.a1)/2,[ce,ae]=zt(b,N,E+13,J),oe=($.a1-$.a0)*E;return r.jsxs("g",{className:"circ-chrom","data-on":se===$.chrom||f===$.chrom||void 0,children:[r.jsx("path",{d:Tu(b,N,A(tt.ideoIn),E,$.a0,$.a1),className:"circ-ideo","data-odd":Z%2||void 0}),oe>9&&r.jsx("text",{x:ce,y:ae+4,textAnchor:"middle",className:"circ-name",children:$.chrom})]},$.chrom)}),k&&I.map($=>{const Z=Ks(j,k.chrom,$*Sm);if(Z===null)return null;const[J,ce]=zt(b,N,A(tt.ideoIn),Z),[ae,oe]=zt(b,N,A(tt.ideoIn)-6,Z),[xe,je]=zt(b,N,A(tt.ideoIn)-15,Z);return r.jsxs("g",{className:"circ-mb",children:[r.jsx("line",{x1:J,y1:ce,x2:ae,y2:oe}),r.jsx("text",{x:xe,y:je+3,textAnchor:"middle",children:$})]},$)}),M.map(({d:$,angle:Z,row:J})=>{const[ce,ae]=zt(b,N,E+2,Z),[oe,xe]=zt(b,N,E+24+J*13,Z),[je,D]=zt(b,N,E+28+J*13,Z),U=Math.sin(Z)>=0;return r.jsxs("g",{className:"circ-driver",children:[r.jsx("line",{x1:ce,y1:ae,x2:oe,y2:xe}),r.jsx("text",{x:je,y:D+4,textAnchor:U?"start":"end",children:$.gene})]},$.gene)}),f&&r.jsxs("text",{x:b,y:N+4,textAnchor:"middle",className:"circ-centre",children:["chr",f," · click it again to close"]})]}),(g==null?void 0:g.kind)==="snv"&&r.jsxs(en,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:Ra[g.substitution]},"aria-hidden":!0}),g.substitution," SNV"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Ru(g.chrom,g.pos)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From the SNV before"}),r.jsx("b",{children:ax(g.distance)})]})]}),W&&g&&r.jsxs(en,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:tx[rg(W)]},"aria-hidden":!0}),W.kind==="deletion"?`Deletion, ${W.mechanism==="none"?"other":W.mechanism}`:W.kind==="insertion"?"Insertion":"Complex indel"]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Position"}),r.jsx("b",{className:"mono",children:Ru(W.chrom,W.start)})]})]}),ie&&g&&r.jsxs(en,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:[r.jsx("span",{className:"sv-swatch",style:{background:On[Zi(ie)]},"aria-hidden":!0}),qa[Zi(ie)]]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"From"}),r.jsx("b",{className:"mono",children:Ru(ie.chrom1,ie.pos1)})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"To"}),r.jsx("b",{className:"mono",children:Ru(ie.chrom2,ie.pos2)})]}),ie.chrom1===ie.chrom2&&r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Spanning"}),r.jsx("b",{children:ax(Math.abs(ie.pos2-ie.pos1))})]})]}),(g==null?void 0:g.kind)==="chrom"&&r.jsxs(en,{x:g.x,y:g.y,width:a,children:[r.jsxs("span",{className:"ctip-title",children:["Chromosome ",g.chrom]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"SNVs"}),r.jsx("b",{children:(((le=n.snvs[g.chrom])==null?void 0:le.pos.length)??0).toLocaleString("en-US")})]}),r.jsxs("span",{className:"ctip-row",children:[r.jsx("span",{children:"Rearrangements touching it"}),r.jsx("b",{children:_.filter($=>$.chrom1===g.chrom||$.chrom2===g.chrom).length})]}),r.jsx("span",{className:"ctip-note",children:f===g.chrom?"Click to close it":"Click to open it out"})]})]})}const J4=[{key:"rainfall",label:"SNV rainfall"},{key:"indels",label:"Indels"},{key:"copyNumber",label:"Copy number"},{key:"links",label:"Rearrangements"}],ix=["translocation","inversion","deletion","tandem-duplication"];function Au({label:n,sub:l,count:a,top:i,colour:c,on:d,onEnter:f,onLeave:m}){return r.jsxs("li",{className:"circ-bar","data-on":d||void 0,onMouseEnter:f,onMouseLeave:m,tabIndex:f?0:void 0,onFocus:f,onBlur:m,children:[r.jsxs("span",{className:"circ-bar-label",children:[r.jsx("span",{className:"sv-swatch",style:{background:c},"aria-hidden":!0}),n,l&&r.jsx("i",{children:l})]}),r.jsx("span",{className:"circ-bar-track",children:r.jsx("span",{style:{width:`${i?a/i*100:0}%`,background:c}})}),r.jsx("span",{className:"circ-bar-n mono",children:a.toLocaleString("en-US")})]})}function W4({data:n,lit:l,onLit:a}){var y;const i=C.useMemo(()=>{const v=Object.fromEntries(Zv.map(p=>[p,0]));for(const p of Object.values(n.snvs))for(const S of p.substitution)v[S]=(v[S]??0)+1;return v},[n.snvs]),c=C.useMemo(()=>{const v=Object.fromEntries(cg.map(p=>[p.key,0]));for(const p of n.indels??[])v[rg(p)]+=1;return v},[n.indels]),d=C.useMemo(()=>{const v=Object.fromEntries(ix.map(p=>[p,0]));for(const p of n.svs)v[Zi(p)]+=1;return v},[n.svs]),f=Math.max(0,...n.signatures.map(v=>v.count??0)),m=()=>a(null),g=(v,p)=>(l==null?void 0:l.kind)===v&&l.value===p;return r.jsxs("div",{className:"circ-panels",children:[r.jsxs("section",{"aria-label":"Substitutions",children:[r.jsxs("h4",{children:["Substitutions ",r.jsx("span",{children:n.snv_total.toLocaleString("en-US")})]}),r.jsx("ul",{children:Zv.map(v=>r.jsx(Au,{label:v,count:i[v],top:Math.max(...Object.values(i),1),colour:Ra[v],on:g("substitution",v),onEnter:()=>a({kind:"substitution",value:v}),onLeave:m},v))}),n.signatures.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("h5",{children:"Top signatures"}),r.jsx("ul",{children:n.signatures.map(v=>r.jsx(Au,{label:v.signature,sub:v.aetiology,count:Math.round(v.count??0),top:f,colour:"var(--chev)"},v.signature))})]})]}),r.jsxs("section",{"aria-label":"Indels",children:[r.jsxs("h4",{children:["Indels ",r.jsx("span",{children:(((y=n.indels)==null?void 0:y.length)??0).toLocaleString("en-US")})]}),n.indels?r.jsx("ul",{children:cg.map(v=>r.jsx(Au,{label:v.label,count:c[v.key],top:Math.max(...Object.values(c),1),colour:v.colour,on:g("indel",v.key),onEnter:()=>a({kind:"indel",value:v.key}),onLeave:m},v.key))}):r.jsx("p",{className:"circ-note",children:"This report did not include WGSPOST's indel classification; rerun it to see indels here."})]}),r.jsxs("section",{"aria-label":"Karyotype",children:[r.jsx("h4",{children:"Karyotype"}),r.jsxs("p",{className:"circ-karyo",children:["Purity ",r.jsx("b",{children:n.purity===null?"–":n.purity.toFixed(2)})," · Ploidy ",r.jsx("b",{children:n.ploidy===null?"–":n.ploidy.toFixed(1)})]}),r.jsxs("ul",{className:"circ-key",children:[r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-gain","aria-hidden":!0})," Gain of the major allele, darker for more copies"]}),r.jsxs("li",{children:[r.jsx("span",{className:"circ-key-loh","aria-hidden":!0})," Loss of heterozygosity (no minor allele)"]})]})]}),r.jsxs("section",{"aria-label":"Rearrangements",children:[r.jsxs("h4",{children:["Rearrangements ",r.jsx("span",{children:n.svs.length.toLocaleString("en-US")})]}),r.jsx("ul",{children:ix.map(v=>r.jsx(Au,{label:qa[v],count:d[v],top:Math.max(...Object.values(d),1),colour:On[v],on:g("sv",v),onEnter:()=>a({kind:"sv",value:v}),onLeave:m},v))})]})]})}const e5=C.forwardRef(function({envelope:l,loading:a,picked:i,drivers:c},d){const[f,m]=_s(900),[g,y]=C.useState({rainfall:!0,indels:!0,copyNumber:!0,links:!0}),[v,p]=C.useState(null),S=m>=860,j=Math.max(280,Math.min(S?m-340:m,680));return r.jsx(nl,{ref:d,title:"Integrated circos",subtitle:"SNVs, indels, copy number and rearrangements around the genome",lineage:(l==null?void 0:l.lineage)??[],picked:i,info:"circos",className:"circos",controls:r.jsx("div",{className:"circ-tracks",role:"group","aria-label":"Tracks",children:J4.map(b=>r.jsx("button",{type:"button",className:"circ-track","aria-pressed":g[b.key],onClick:()=>y(N=>({...N,[b.key]:!N[b.key]})),children:b.label},b.key))}),children:r.jsx("div",{ref:f,children:r.jsx(ss,{label:"integrated circos",envelope:l,loading:a,skeletonHeight:420,children:b=>r.jsxs("div",{className:"circ-body","data-wide":S||void 0,children:[r.jsxs("div",{className:"circ-stage",children:[r.jsx(Z4,{data:b,drivers:c,size:j,tracks:g,lit:v}),r.jsx("p",{className:"circ-hint",children:"Click a chromosome to open it out. Closer SNVs sit further in: clusters such as kataegis fall towards the centre."})]}),r.jsx(W4,{data:b,lit:v,onLit:p})]})})})})}),eS=Object.fromEntries([...jn,["Y",59373566]]),Ur=Object.keys(eS),Wi=n=>eS[n]??1,t5=2e4;function bm(n){return[1,Wi(n)]}function Ar(n,l,a,i){const c=Math.min(Math.max((n[1]-n[0])*a,t5),i-1),d=(l-n[0])/(n[1]-n[0]||1);return tS([l-d*c,l-d*c+c],i)}function jm(n,l,a){return tS([n[0]+l,n[1]+l],a)}function tS([n,l],a){const i=Math.min(l-n,a-1),c=Math.min(Math.max(n,1),a-i);return[c,c+i]}function n5(n,l,a){return[n[0]+(l[0]-n[0])*a,n[1]+(l[1]-n[1])*a]}function nS([n,l],a=6){const i=(l-n)/a,c=10**Math.floor(Math.log10(i)),d=i/c,f=(d<1.5?1:d<3.5?2:d<7.5?5:10)*c,m=[];for(let g=Math.ceil(n/f)*f;g<=l;g+=f)m.push({value:g,label:f<1e5?`${(g/1e3).toLocaleString("en-US")} kb`:`${+(g/1e6).toFixed(2)} Mb`});return m}function s5(n){const l=n.filter(d=>Number.isFinite(d)).sort((d,f)=>d-f);if(!l.length)return[0,4];const a=d=>l[Math.min(l.length-1,Math.max(0,Math.round(d*(l.length-1))))],i=Math.max(0,Math.floor(a(.01))),c=Math.max(Math.ceil(a(.995)),i+1);return[i,c]}function l5(n,l=1){const a=n.filter(d=>Number.isFinite(d)).map(Math.abs).sort((d,f)=>d-f),i=a.length?a[Math.min(a.length-1,Math.floor(.995*(a.length-1)))]:l,c=Math.max(l,Math.ceil(i*2)/2);return[-c,c]}const ox=n=>n===null?"":`: ${+(n*100).toFixed(1)}%`;function sS(n){if(n.major_cn===null||n.minor_cn===null)return[];const l=[`${n.major_cn}+${n.minor_cn}${ox(n.clonal_frac)}`];return n.major_cn_2!==null&&n.minor_cn_2!==null&&l.push(`${n.major_cn_2}+${n.minor_cn_2}${ox(n.clonal_frac_2)}`),l}const Ag=n=>n.clonal_frac!==null&&n.clonal_frac<1;function a5(n,l){const a=[];for(const i of n){const c=Zi(i);if(i.chrom1===l&&i.chrom2===l){const[d,f]=i.pos1<=i.pos2?[i.pos1,i.pos2]:[i.pos2,i.pos1],m=c==="inversion"?"lower":"upper",g=c==="tandem-duplication"?!1:c==="inversion"?i.orientation!=="--":!0;a.push({kind:"arc",sv:i,svClass:c,from:d,to:f,lane:m,up:g})}else i.chrom1===l?a.push({kind:"out",sv:i,svClass:c,at:i.pos1,partner:i.chrom2,partnerPos:i.pos2}):i.chrom2===l&&a.push({kind:"out",sv:i,svClass:c,at:i.pos2,partner:i.chrom1,partnerPos:i.pos1})}return a}function lS(n,l){let a=0,i=n.length-1;if(i<0)return-1;for(;a<i;){const c=a+i>>1;n[c]<l?a=c+1:i=c}return a>0&&Math.abs(n[a-1]-l)<=Math.abs(n[a]-l)?a-1:a}const Js=(()=>{const n={};let l=0;for(const a of Ur)n[a]=l,l+=Wi(a);return{offsets:n,total:l}})(),i5=420;function aS({view:n,onView:l,length:a,left:i,plotW:c}){const d=C.useRef(null),[f,m]=C.useState(n.span),g=C.useRef(f);g.current=f,C.useLayoutEffect(()=>{const M=n.span,_=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;if(!n.smooth||_){m(M);return}const R=g.current,k=performance.now();let I=0;const K=O=>{const se=Math.min(1,(O-k)/i5);m(n5(R,M,Cg(se))),se<1&&(I=requestAnimationFrame(K))};return I=requestAnimationFrame(K),()=>cancelAnimationFrame(I)},[n]);const y=C.useCallback(M=>i+(M-f[0])/(f[1]-f[0])*c,[f,i,c]),v=C.useCallback(M=>f[0]+(M-i)/c*(f[1]-f[0]),[f,i,c]),p=C.useCallback(M=>l({span:M,smooth:!1}),[l]),S=C.useCallback(M=>l({span:M,smooth:!0}),[l]),j=f[1]-f[0]<a-1,b=C.useRef({shown:f,plotW:c,left:i,move:p,length:a});b.current={shown:f,plotW:c,left:i,move:p,length:a},C.useEffect(()=>{const M=d.current;if(M)return Oy(M,()=>{const _=b.current,R=_.shown[1]-_.shown[0];return{inside:k=>k>=_.left&&k<=_.left+_.plotW,zoom:(k,I)=>{const K=Ar(_.shown,_.shown[0]+(I-_.left)/_.plotW*R,k,_.length);return Math.abs(K[0]-_.shown[0])<1&&Math.abs(K[1]-_.shown[1])<1?!1:(_.move(K),!0)},pan:k=>_.move(jm(_.shown,k/_.plotW*R,_.length))}})},[]);const N=M=>{var _;return M.clientX-(((_=d.current)==null?void 0:_.getBoundingClientRect().left)??0)},E=C.useRef(!1);return{box:d,shown:f,x:y,posAt:v,localX:N,glide:S,zoomed:j,dragged:E,handlers:{onPointerDown:M=>{if(M.button!==0||!j)return;const _=f;Fu(M,R=>p(jm(_,-(R/c)*(_[1]-_[0]),a)),R=>{R&&(E.current=!0,setTimeout(()=>E.current=!1,0))})},onDoubleClick:M=>{const _=N(M);_>=i&&_<=i+c&&S(Ar(f,v(_),.5,a))},onKeyDown:M=>{const _=(f[0]+f[1])/2,R=f[1]-f[0];if(M.key==="ArrowLeft"||M.key==="ArrowRight")p(jm(f,(M.key==="ArrowLeft"?-.15:.15)*R,a));else if(M.key==="+"||M.key==="=")S(Ar(f,_,.6,a));else if(M.key==="-")S(Ar(f,_,1/.6,a));else if(M.key==="0"||M.key==="Home")S([1,a]);else return;M.preventDefault()}}}}const Ve=52,Og=14,Pi=150,Qi=96,Ma=170,o5=26,Mr=n=>Math.round(n).toLocaleString("en-US"),r5=n=>`${+(n/1e6).toFixed(n<1e7?3:2)} Mb`;function c5(n,l,a){return!n||typeof getComputedStyle>"u"?a:getComputedStyle(n).getPropertyValue(l).trim()||a}function ug({width:n,height:l,top:a,xs:i,ys:c,colour:d,radius:f=1.3,alpha:m=.5,label:g}){const y=C.useRef(null);return C.useEffect(()=>{const v=y.current;if(!v)return;const p=typeof window<"u"&&window.devicePixelRatio||1;v.width=Math.round(n*p),v.height=Math.round(l*p);const S=v.getContext("2d");if(S){S.setTransform(p,0,0,p,0,0),S.clearRect(0,0,n,l),S.fillStyle=d.startsWith("--")?c5(v,d,"#666"):d,S.globalAlpha=m;for(let j=0;j<i.length;j++){const b=i[j];b<Ve-f||b>n-Og+f||!Number.isFinite(c[j])||(S.beginPath(),S.arc(b,c[j],f,0,2*Math.PI),S.fill())}S.globalAlpha=1}},[n,l,i,c,d,f,m]),r.jsx("canvas",{ref:y,className:"cnsv-dots",style:{top:a,width:n,height:l},"aria-label":g,role:"img"})}function u5({data:n,width:l,view:a,onView:i}){const c=C.useId(),d=Wi(n.chrom),f=Math.max(l-Ve-Og,200),{box:m,shown:g,x:y,posAt:v,localX:p,glide:S,zoomed:j,dragged:b,handlers:N}=aS({view:a,onView:i,length:d,left:Ve,plotW:f}),E=0,A=Pi+10,T=A+Qi,L=T+Ma,M=L+o5,_=A+Qi*.4,R=A+Qi*.8,k=q=>E+8+(1-q)*(Pi-16),[I,K]=C.useMemo(()=>{var q;return s5(((q=n.depth)==null?void 0:q.cn)??[])},[n.depth]),O=q=>T+6+(1-(Math.min(Math.max(q,I),K)-I)/(K-I))*(Ma-12),se=C.useMemo(()=>n.baf?n.baf.pos.map(y):[],[n.baf,y]),ie=C.useMemo(()=>n.baf?n.baf.baf.map(k):[],[n.baf]),W=C.useMemo(()=>n.depth?n.depth.start.map((q,re)=>(q+n.depth.end[re])/2):[],[n.depth]),P=C.useMemo(()=>W.map(y),[W,y]),le=C.useMemo(()=>n.depth?n.depth.cn.map(O):[],[n.depth,I,K]),$=C.useMemo(()=>a5(n.svs,n.chrom),[n.svs,n.chrom]),[Z,J]=C.useState(null),ce=(Z==null?void 0:Z.kind)==="sv"?Z.mark.sv:null,ae=q=>{var he,ye;if((ye=(he=q.target).closest)!=null&&ye.call(he,".cnsv-sv-hit"))return;const re=p(q);J(re>=Ve&&re<=Ve+f?{kind:"cursor",x:re,pos:v(re)}:null)},oe=q=>{if(b.current)return;const[re,he]=q.kind==="arc"?[q.from,q.to]:[q.at-5e5,q.at+5e5],ye=Math.max((he-re)*.4,15e4);S(Ar([re-ye,he+ye],(re+he)/2,1,d))},xe=nS(g,Math.max(2,Math.round(f/110))),je=n.segments.filter(q=>q.end>=g[0]&&q.start<=g[1]),D=C.useMemo(()=>{const q=Math.max(1,Math.ceil((K-I)/6)),re=[];for(let he=I;he<=K;he+=q)re.push(he);return re},[I,K]),U=`${c}-clip`;return r.jsxs("div",{ref:m,className:"cnsv-view",style:{height:M},tabIndex:0,role:"group","aria-label":`Chromosome ${n.chrom}: BAF, rearrangements and read depth. Arrow keys pan, plus and minus zoom.`,"data-zoomed":j||void 0,...N,onPointerMove:ae,onPointerLeave:()=>J(null),children:[n.baf&&r.jsx(ug,{width:l,height:Pi,top:E,xs:se,ys:ie.map(q=>q-E),colour:"--ink-2",alpha:.32,label:"BAF per SNP"}),n.depth&&r.jsx(ug,{width:l,height:Ma,top:T,xs:P,ys:le.map(q=>q-T),colour:"--ink",radius:1.6,alpha:.78,label:"Read-depth copy number"}),r.jsxs("svg",{width:l,height:M,className:"cnsv-svg","aria-hidden":!0,children:[r.jsxs("defs",{children:[r.jsx("clipPath",{id:U,children:r.jsx("rect",{x:Ve,y:0,width:f,height:L})}),r.jsx("marker",{id:`${c}-arrow`,viewBox:"0 0 8 8",refX:"4",refY:"4",markerWidth:"7",markerHeight:"7",orient:"auto",children:r.jsx("path",{d:"M0,8 L4,0 L8,8 Z",fill:"var(--sv-tra)"})})]}),r.jsx("g",{className:"cnsv-grid",children:[0,.25,.5,.75,1].map(q=>r.jsx("line",{x1:Ve,x2:Ve+f,y1:k(q),y2:k(q),"data-mid":q===.5||void 0},q))}),[0,.5,1].map(q=>r.jsx("text",{x:Ve-8,y:k(q)+4,className:"cnsv-ylab",children:q},q)),r.jsx("text",{x:14,y:E+Pi/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${E+Pi/2})`,children:"BAF"}),r.jsx("g",{clipPath:`url(#${U})`,children:je.map(q=>r.jsx(d5,{segment:q,x:y,y:k},`${q.start}-${q.end}`))}),!n.baf&&r.jsx(wm,{x:Ve+f/2,y:E+Pi/2,text:"No BAF data for this chromosome"}),r.jsx("line",{x1:Ve,x2:Ve+f,y1:_,y2:_,className:"cnsv-lane"}),r.jsx("line",{x1:Ve,x2:Ve+f,y1:R,y2:R,className:"cnsv-lane"}),r.jsx("text",{x:14,y:A+Qi/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${A+Qi/2})`,children:"SVs"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-svs","data-lit":ce?"true":void 0,children:$.map((q,re)=>r.jsx(h5,{mark:q,x:y,upper:_,lower:R,svTop:A,bottom:T+Ma,arrow:`url(#${c}-arrow)`,on:ce===q.sv,onEnter:(he,ye)=>J({kind:"sv",mark:q,x:he,y:ye}),onLeave:()=>J(null),onClick:()=>oe(q)},`${q.sv.id??re}-${q.kind}-${re}`))}),$.length===0&&r.jsx(wm,{x:Ve+f/2,y:A+Qi/2,text:"No rearrangements on this chromosome"}),r.jsx("g",{className:"cnsv-bands",children:Array.from({length:K-I+1},(q,re)=>I+re).map(q=>r.jsx("rect",{x:Ve,width:f,y:Math.min(O(q+.5),O(q-.5)),height:Math.abs(O(q-.5)-O(q+.5)),"data-odd":q%2===1||void 0},q))}),D.map(q=>r.jsx("text",{x:Ve-8,y:O(q)+4,className:"cnsv-ylab",children:q},q)),r.jsx("text",{x:14,y:T+Ma/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${T+Ma/2})`,children:"Copy number"}),r.jsx("g",{clipPath:`url(#${U})`,className:"cnsv-total",children:je.filter(q=>q.total_cn!==null).map(q=>r.jsxs("g",{"data-sub":Ag(q)||void 0,children:[r.jsx("line",{x1:y(q.start),x2:y(q.end),y1:O(q.total_cn),y2:O(q.total_cn),className:"cnsv-total-halo"}),r.jsx("line",{x1:y(q.start),x2:y(q.end),y1:O(q.total_cn),y2:O(q.total_cn)})]},`${q.start}-t`))}),!n.depth&&r.jsx(wm,{x:Ve+f/2,y:T+Ma/2,text:"No BRASS read depth for this chromosome"}),r.jsx("line",{x1:Ve,x2:Ve+f,y1:L,y2:L,className:"cnsv-axis"}),xe.map(q=>r.jsxs("g",{transform:`translate(${y(q.value)},${L})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:q.label})]},q.value)),(Z==null?void 0:Z.kind)==="cursor"&&r.jsx("line",{x1:Z.x,x2:Z.x,y1:0,y2:L,className:"cnsv-cursor"})]}),Z&&r.jsx(f5,{hot:Z,data:n,mids:W,width:l,upper:_})]})}function wm({x:n,y:l,text:a}){return r.jsx("text",{x:n,y:l,className:"cnsv-empty",children:a})}function d5({segment:n,x:l,y:a}){if(n.baf===null)return null;const i=l(n.start),c=l(n.end),d=sS(n),f=d.length>0&&c-i>Math.max(...d.map(y=>Ms(y,11,600)))+10,m=a(n.baf),g=n.baf>.3;return r.jsxs("g",{className:"cnsv-seg","data-sub":Ag(n)||void 0,children:[r.jsx("line",{x1:i,x2:c,y1:m,y2:m}),f&&d.map((y,v)=>r.jsx("text",{x:(Math.max(i,Ve)+Math.min(c,1e4))/2,y:g?m+15+v*13:m-8-(d.length-1-v)*13,children:y},y))]})}function h5({mark:n,x:l,upper:a,lower:i,svTop:c,bottom:d,arrow:f,on:m,onEnter:g,onLeave:y,onClick:v}){const p=On[n.svClass];if(n.kind==="out"){const L=l(n.at),M=`M${L},${i+14} L${L},${c+12}`;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:p},children:[r.jsx("line",{x1:L,x2:L,y1:i+14,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:M,className:"cnsv-out",markerEnd:f}),r.jsx("text",{x:L,y:c+6,className:"cnsv-partner",children:n.partner}),r.jsx("path",{d:M,className:"cnsv-sv-hit",onPointerEnter:()=>g(L,c+20),onPointerLeave:y,onClick:v})]})}const S=l(n.from),j=l(n.to),b=n.lane==="upper"?a:i,N=Math.max((j-S)/2,.5),E=Math.min(n.lane==="upper"?30:18,Math.max(5,N*1.6)),A=`M${S},${b} A${N},${E} 0 0 ${n.up?1:0} ${j},${b}`,T=n.up?b-E:b+E;return r.jsxs("g",{className:"cnsv-sv","data-on":m||void 0,style:{color:p},children:[r.jsx("line",{x1:S,x2:S,y1:b,y2:d,className:"cnsv-drop"}),r.jsx("line",{x1:j,x2:j,y1:b,y2:d,className:"cnsv-drop"}),r.jsx("path",{d:A,className:"cnsv-arc"}),r.jsx("path",{d:A,className:"cnsv-sv-hit",onPointerEnter:()=>g((S+j)/2,T),onPointerLeave:y,onClick:v})]})}function f5({hot:n,data:l,mids:a,width:i,upper:c}){if(n.kind==="sv"){const{mark:p}=n,S=p.sv,j=p.kind==="arc"?`${l.chrom}:${Mr(p.from)}–${Mr(p.to)}`:`${l.chrom}:${Mr(p.at)} to ${p.partner}:${Mr(p.partnerPos)}`;return r.jsxs(en,{x:n.x,y:n.y,width:i,children:[r.jsxs("b",{children:[r.jsx("span",{className:"sv-swatch",style:{background:On[p.svClass]},"aria-hidden":!0})," ",qa[p.svClass]]}),r.jsx("span",{className:"mono",children:j}),p.kind==="arc"&&r.jsxs("span",{children:[r5(p.to-p.from)," apart"]}),S.orientation&&r.jsxs("span",{children:["Orientation ",S.orientation]}),r.jsx("i",{children:"Click to fit it in view"})]})}const d=n.pos,f=l.segments.find(p=>p.start<=d&&p.end>=d),m=l.depth&&a.length?lS(a,d):-1,g=l.window??1e5,y=m>=0&&Math.abs(a[m]-d)<=g?l.depth.cn[m]:null,v=f?sS(f):[];return r.jsxs(en,{x:n.x,y:c,width:i,children:[r.jsxs("b",{className:"mono",children:[l.chrom,":",Mr(d)]}),f?r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:["Battenberg ",v.join(", ")||"–",Ag(f)?" (subclonal)":""]}),r.jsxs("span",{children:["Segment BAF ",f.baf===null?"–":f.baf.toFixed(2),", total copy number ",f.total_cn??"–"]})]}):r.jsx("span",{children:"No Battenberg segment here"}),r.jsxs("span",{children:["Read depth ",y===null?"–":`${y.toFixed(2)} copies`]})]})}const $l=92,rx=14,m5=26,Nm=[{source:"tumour",measure:"logr",label:"LogR"},{source:"tumour",measure:"baf",label:"BAF"},{source:"normal",measure:"logr",label:"LogR"},{source:"normal",measure:"baf",label:"BAF"}],dg={tumour:"Tumour",normal:"Normal"};function g5(n){if(!n)return null;const l={pos:[],baf:[],logr:[],at:[],chrom:[]};for(const a of Ur){const i=n[a];if(!i)continue;const c=Js.offsets[a];for(let d=0;d<i.pos.length;d++)l.pos.push(i.pos[d]),l.baf.push(i.baf[d]),l.logr.push(i.logr[d]),l.at.push(c+i.pos[d]),l.chrom.push(a)}return l}function p5(n,l){return n?{...n,at:n.pos,chrom:n.pos.map(()=>l)}:null}function cx(n){const{width:l}=n,a=Math.max(l-Ve-Og,200),i=n.scope==="genome",c=i?Js.total:Wi(n.chrom),d=C.useMemo(()=>({span:[0,Js.total],smooth:!1}),[]),f=aS({view:i?d:n.view,onView:i?()=>{}:n.onView,length:c,left:Ve,plotW:a}),m=i?M=>Ve+M/Js.total*a:f.x,g=C.useMemo(()=>{var _;const M={};for(const R of["tumour","normal"])M[R]=n.scope==="genome"?g5(n.sources[R]):p5((_=n.raw)==null?void 0:_[R],n.chrom);return M},[n.scope,n.scope==="genome"?n.sources:n.raw]),y=C.useMemo(()=>{var _;const M={};for(const R of["tumour","normal"])M[R]=l5((((_=g[R])==null?void 0:_.logr)??[]).filter(k=>k!==null));return M},[g]),v=M=>M*($l+rx)+(M>=2?rx:0),p=v(Nm.length-1)+$l+4,S=p+m5,j=(M,_,R,k)=>{const[I,K]=_==="baf"?[0,1]:y[R]??[-1,1];return 6+(1-(Math.min(Math.max(k,I),K)-I)/(K-I))*($l-12)},b=C.useMemo(()=>{var _;const M={};for(const R of["tumour","normal"])M[R]=((_=g[R])==null?void 0:_.at.map(m))??[];return M},[g,i?a:f.shown,a]),[N,E]=C.useState(null),A=M=>{const _=f.localX(M);E(_>=Ve&&_<=Ve+a?_:null)},T=i?[]:nS(f.shown,Math.max(2,Math.round(a/110))),L=["tumour","normal"].some(M=>{var _;return(((_=g[M])==null?void 0:_.pos.length)??0)>0});return r.jsxs("div",{ref:f.box,className:"cnsv-view cnsv-raw",style:{height:S},tabIndex:i?void 0:0,role:"group","aria-label":i?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF on chromosome ${n.chrom}`,...i?{}:f.handlers,"data-zoomed":!i&&f.zoomed||void 0,onPointerMove:A,onPointerLeave:()=>E(null),children:[Nm.map((M,_)=>{const R=g[M.source],k=(R==null?void 0:R[M.measure])??[];return r.jsx(ug,{width:l,height:$l,top:v(_),xs:b[M.source]??[],ys:k.map(I=>I===null?NaN:j(_,M.measure,M.source,I)),colour:M.source==="tumour"?"--ink-2":"--faint",radius:i?1.05:1.6,alpha:i?.4:.6,label:`${dg[M.source]} ${M.label}`},`${M.source}-${M.measure}`)}),r.jsxs("svg",{width:l,height:S,className:"cnsv-svg","aria-hidden":!0,children:[Nm.map((M,_)=>{const R=v(_),[k,I]=M.measure==="baf"?[0,1]:y[M.source]??[-1,1],K=M.measure==="baf"?[0,.5,1]:[k,0,I];return r.jsxs("g",{transform:`translate(0,${R})`,children:[r.jsx("rect",{x:Ve,y:0,width:a,height:$l,className:"cnsv-raw-bg"}),K.map(O=>r.jsxs("g",{children:[r.jsx("line",{x1:Ve,x2:Ve+a,y1:j(_,M.measure,M.source,O),y2:j(_,M.measure,M.source,O),className:"cnsv-raw-grid","data-mid":O===0||O===.5||void 0}),r.jsx("text",{x:Ve-8,y:j(_,M.measure,M.source,O)+4,className:"cnsv-ylab",children:+O.toFixed(1)})]},O)),r.jsx("text",{x:14,y:$l/2,className:"cnsv-track-name",transform:`rotate(-90 14 ${$l/2})`,children:M.label}),M.measure==="logr"&&r.jsx("text",{x:Ve+8,y:14,className:"cnsv-row-caption",children:dg[M.source]})]},`${M.source}-${M.measure}`)}),r.jsx("line",{x1:Ve,x2:Ve+a,y1:p,y2:p,className:"cnsv-axis"}),i?Ur.map(M=>{const _=m(Js.offsets[M]),R=m(Js.offsets[M]+Wi(M));return r.jsxs("g",{children:[r.jsx("line",{x1:_,x2:_,y1:0,y2:p,className:"cnsv-chrom-sep"}),R-_>12&&r.jsx("text",{x:(_+R)/2,y:p+17,className:"cnsv-chrom-name",onClick:()=>n.scope==="genome"&&n.onPick(M),children:M})]},M)}):T.map(M=>r.jsxs("g",{transform:`translate(${m(M.value)},${p})`,className:"cnsv-tick",children:[r.jsx("line",{y2:4}),r.jsx("text",{y:17,children:M.label})]},M.value)),N!==null&&r.jsx("line",{x1:N,x2:N,y1:0,y2:p,className:"cnsv-cursor"}),!L&&r.jsxs("text",{x:Ve+a/2,y:p/2,className:"cnsv-empty",children:["No raw Battenberg data ",i?"in this report":"for this chromosome"]})]}),N!==null&&r.jsx(v5,{cursor:N,placed:g,at:i?M=>(M-Ve)/a*Js.total:f.posAt,width:l}),i&&r.jsx("div",{className:"cnsv-chrom-hits",style:{top:p,left:0,width:l},children:Ur.map(M=>{const _=m(Js.offsets[M]),R=m(Js.offsets[M]+Wi(M));return r.jsx("button",{type:"button",style:{left:_,width:R-_},"aria-label":`Open chromosome ${M}`,onClick:()=>n.scope==="genome"&&n.onPick(M)},M)})})]})}function v5({cursor:n,placed:l,at:a,width:i}){const c=a(n),d=["tumour","normal"].map(m=>{const g=l[m];if(!g||!g.at.length)return null;const y=lS(g.at,c),v=p=>p===null?"–":p.toFixed(2);return{source:m,chrom:g.chrom[y],pos:g.pos[y],text:`LogR ${v(g.logr[y])}, BAF ${v(g.baf[y])}`}}),f=d.find(Boolean);return f?r.jsxs(en,{x:n,y:$l,width:i,children:[r.jsxs("b",{className:"mono",children:[f.chrom,":",f.pos.toLocaleString("en-US")]}),d.map(m=>m&&r.jsxs("span",{children:[dg[m.source],": ",m.text]},m.source)),r.jsx("i",{children:"The nearest locus kept"})]}):null}const x5=["deletion","tandem-duplication","inversion","translocation"];function kl({kind:n,colour:l,label:a}){return r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:`cnsv-key-${n}`,style:{background:n==="dot"||n==="line"?l:void 0,color:l},"aria-hidden":!0}),a]})}function y5({chrom:n,withData:l,genome:a,allowGenome:i,onPick:c,onGenome:d}){return r.jsxs("div",{className:"cnsv-picker",role:"group","aria-label":"Chromosome",children:[i&&r.jsx("button",{type:"button",className:"cnsv-chip cnsv-chip-genome","aria-pressed":a,onClick:d,children:"Genome"}),Ur.map(f=>r.jsx("button",{type:"button",className:"cnsv-chip","aria-pressed":!a&&f===n,"data-empty":!l.has(f)||void 0,"aria-label":`Chromosome ${f}`,onClick:()=>c(f),children:f},f))]})}const S5=C.forwardRef(function({envelope:l,loading:a,rawGenome:i,rawGenomeLoading:c,picked:d,chrom:f,onChrom:m,mode:g,onMode:y,genome:v,onGenome:p},S){const[j,b]=_s(900),[N,E]=C.useState({span:bm(f),smooth:!1});C.useEffect(()=>E({span:bm(f),smooth:!1}),[f]);const A=bm(f),T=N.span[1]-N.span[0]<A[1]-A[0]-1,L=l==null?void 0:l.data,M=new Set((L==null?void 0:L.chromosomes)??[]),_=g==="raw"&&v,R=k=>{p(!1),m(k)};return r.jsx(nl,{ref:S,title:"Copy number and rearrangements by chromosome",subtitle:g==="integrated"?`BAF, rearrangements and read depth along chromosome ${f}`:_?"Battenberg's raw LogR and BAF across the genome":`Battenberg's raw LogR and BAF along chromosome ${f}`,lineage:(l==null?void 0:l.lineage)??[],picked:d,info:"cnsv",className:"cnsv",controls:r.jsxs(r.Fragment,{children:[T&&!_&&r.jsx("button",{type:"button",className:"sc-ib sm","aria-label":"Show the whole chromosome",title:"Show the whole chromosome",onClick:()=>E({span:A,smooth:!0}),children:r.jsx(fy,{size:15,"aria-hidden":!0})}),r.jsx(ls,{label:"View",value:g,onChange:y,options:[{value:"integrated",label:"CN/SV"},{value:"raw",label:"Battenberg raw"}]})]}),footer:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[12.5px]",style:{color:"var(--ink-2)"},children:[g==="integrated"?r.jsxs(r.Fragment,{children:[r.jsx(kl,{kind:"dot",colour:"var(--chev)",label:"BAF per SNP"}),r.jsx(kl,{kind:"line",colour:"var(--cnsv-clonal)",label:"Clonal segment"}),r.jsx(kl,{kind:"line",colour:"var(--cnsv-subclonal)",label:"Subclonal segment"}),r.jsx(kl,{kind:"dot",colour:"var(--ink)",label:"Read depth (BRASS)"}),r.jsx(kl,{kind:"dash",colour:"var(--cnsv-clonal)",label:"Battenberg total copy number"}),x5.map(k=>r.jsx(kl,{kind:"line",colour:On[k],label:qa[k]},k))]}):r.jsxs(r.Fragment,{children:[r.jsx(kl,{kind:"dot",colour:"var(--ink-2)",label:"Tumour"}),r.jsx(kl,{kind:"dot",colour:"var(--faint)",label:"Normal"})]}),r.jsx("span",{style:{color:"var(--faint)"},children:_?"Click a chromosome's name to open it.":"Scroll up or down over the plot to zoom, sideways (or drag) to pan. Click a rearrangement to fit it."})]}),children:r.jsxs("div",{className:"cnsv-body",children:[r.jsx(y5,{chrom:f,withData:M,genome:_,allowGenome:g==="raw",onPick:R,onGenome:()=>p(!0)}),r.jsx("div",{ref:j,"data-stale":!_&&L&&L.chrom!==f||void 0,children:_?r.jsx(ss,{label:"raw Battenberg data",envelope:i,loading:c,skeletonHeight:440,children:k=>r.jsx(cx,{scope:"genome",sources:k.sources,segments:k.segments,width:b,onPick:R})}):r.jsx(ss,{label:"chromosome view",envelope:l,loading:a,skeletonHeight:460,children:k=>g==="integrated"?r.jsx(u5,{data:k,width:b,view:N,onView:E},k.chrom):r.jsx(cx,{scope:"chromosome",chrom:k.chrom,raw:k.raw,width:b,view:N,onView:E},k.chrom)})})]})})});function b5(n){const l=/^(?:chr)?([0-9]{1,2}|[XYM]T?):([0-9,]+)/i.exec((n??"").trim());return l?{chrom:l[1].toUpperCase(),pos:Number(l[2].replace(/,/g,""))}:null}function j5(n){const l=2**n;return`${l>=100?Math.round(l).toLocaleString("en-US"):+l.toFixed(l>=10?0:1)}×`}function ux(n){return[...new Set((n.callers??"").split(",").map(l=>l.trim()).filter(Boolean))]}function w5(n){return n.highlighted?n.oncokb?`OncoKB: ${n.oncokb}`:"A COSMIC fusion gene":null}const hg=n=>Math.max(...Object.values(n.folds));function N5(n,l){if(l==="report")return n;const a=[...n];return l==="fold"?a.sort((i,c)=>hg(c)-hg(i)):a.sort((i,c)=>i.gene.localeCompare(c.gene)),a}function C5({details:n}){const l=Object.entries(n);return l.length?r.jsx("dl",{className:"rna-details",children:l.map(([a,i])=>r.jsxs("div",{children:[r.jsx("dt",{children:a}),r.jsx("dd",{children:i===null?"–":String(i)})]},a))}):null}function Ou({value:n,gene:l,onLocate:a}){const i=b5(n);return i?r.jsxs("button",{type:"button",className:"rna-break",title:`Show ${l??n} on the copy-number plot`,"aria-label":`Show ${n} on the copy-number plot`,onClick:()=>a({...i,gene:l}),children:[r.jsx(eC,{size:12,"aria-hidden":!0}),r.jsx("span",{className:"mono",children:n})]}):r.jsx("span",{className:"mono",children:n??"–"})}function M5({fusion:n,top:l}){const a=(i,c,d,f)=>r.jsxs("span",{className:"rna-read","data-kind":f,children:[r.jsx("span",{className:"rna-read-label",children:d}),r.jsx("span",{className:"rna-read-track","aria-hidden":!0,children:r.jsx("span",{style:{width:`${c&&i?Math.max(i/c*100,3):0}%`}})}),r.jsx("span",{className:"rna-read-n mono",children:i??"–"})]});return r.jsxs("span",{className:"rna-reads",children:[a(n.split_reads,l.split,"Split","split"),a(n.span_reads,l.span,"Spanning","span")]})}function E5({pair:n,top:l,onLocate:a}){const[i,c]=C.useState(!1),d=w5(n),f=[...new Set(n.breakpoints.flatMap(g=>Object.keys(g.details)))],m=n.breakpoints.length>0||Object.keys(n.details).length>0||n.description;return r.jsxs("li",{className:"rna-fusion","data-on":n.highlighted||void 0,"data-open":i||void 0,children:[r.jsxs("div",{className:"rna-fusion-main",children:[r.jsxs("span",{className:"rna-junction","aria-label":`${n.gene1??"?"} fused to ${n.gene2??"?"}`,children:[r.jsx("b",{children:n.gene1??"?"}),r.jsx("span",{className:"rna-join","aria-hidden":!0}),r.jsx("b",{children:n.gene2??"?"})]}),d&&r.jsx("span",{className:"sc-pill p-onco",children:d}),r.jsx(M5,{fusion:n,top:l}),r.jsx("span",{className:"rna-callers",children:ux(n).map(g=>r.jsx("span",{className:"rna-caller",children:g},g))}),m&&r.jsxs("button",{type:"button",className:"rna-more","aria-expanded":i,onClick:()=>c(g=>!g),children:[r.jsx(Yu,{size:14,"aria-hidden":!0}),n.breakpoints.length?`${n.breakpoints.length} breakpoint${n.breakpoints.length===1?"":"s"}`:"Details"]})]}),r.jsxs("div",{className:"rna-ends",children:[r.jsx(Ou,{value:n.left_break,gene:n.gene1,onLocate:a}),r.jsx("span",{"aria-hidden":!0,children:"→"}),r.jsx(Ou,{value:n.right_break,gene:n.gene2,onLocate:a})]}),i&&r.jsxs("div",{className:"rna-open",children:[n.description&&r.jsx("p",{className:"rna-desc",children:n.description}),r.jsx(C5,{details:n.details}),n.breakpoints.length>0&&r.jsxs("table",{className:"rna-bp",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{children:"Left break"}),r.jsx("th",{children:"Right break"}),r.jsx("th",{children:"Split"}),r.jsx("th",{children:"Spanning"}),r.jsx("th",{children:"Callers"}),f.map(g=>r.jsx("th",{children:g},g))]})}),r.jsx("tbody",{children:n.breakpoints.map((g,y)=>r.jsxs("tr",{children:[r.jsx("td",{children:r.jsx(Ou,{value:g.left_break,gene:g.gene1,onLocate:a})}),r.jsx("td",{children:r.jsx(Ou,{value:g.right_break,gene:g.gene2,onLocate:a})}),r.jsx("td",{className:"mono",children:g.split_reads??"–"}),r.jsx("td",{className:"mono",children:g.span_reads??"–"}),r.jsx("td",{children:ux(g).join(", ")}),f.map(v=>r.jsx("td",{children:g.details[v]===void 0||g.details[v]===null?"–":String(g.details[v])},v))]},`${g.left_break}-${g.right_break}-${y}`))})]})]})]})}function _5({rna:n,onLocate:l}){const[a,i]=C.useState("confident"),c=n[a],d={split:Math.max(0,...c.map(f=>f.split_reads??0)),span:Math.max(0,...c.map(f=>f.span_reads??0))};return r.jsxs("section",{className:"rna-section","aria-label":"Fusions",children:[r.jsxs("div",{className:"rna-head",children:[r.jsx("h3",{className:"sv-h",children:"Fusions"}),r.jsx(ls,{label:"Fusion set",value:a,onChange:i,options:[{value:"confident",label:`Confident ${n.confident.length}`},{value:"rescued",label:`Rescued ${n.rescued.length}`}]})]}),c.length?r.jsx("ul",{className:"rna-fusions",children:c.map((f,m)=>r.jsx(E5,{pair:f,top:d,onLocate:l},`${f.gene1}-${f.gene2}-${m}`))}):r.jsx("p",{className:"sv-empty",children:a==="confident"?"No confident fusions.":"No rescued fusions."}),n.fusion_report&&r.jsxs("a",{className:"rna-report",href:n.fusion_report,target:"_blank",rel:"noreferrer",children:["Open the fusion callers' report ",r.jsx(uy,{size:13,"aria-hidden":!0})]})]})}function T5({gene:n,projects:l,top:a}){return r.jsxs("li",{className:"rna-gene",children:[r.jsxs("span",{className:"rna-gene-name",children:[r.jsx("b",{children:n.gene}),n.band&&r.jsx("span",{className:"mono",children:n.band})]}),r.jsx("span",{className:"rna-folds","data-single":l.length===1||void 0,children:l.filter(i=>n.folds[i]!==void 0).map(i=>r.jsxs("span",{className:"rna-fold",title:`log2 fold change ${n.folds[i].toFixed(2)} against project ${i}`,children:[l.length>1&&r.jsxs("span",{className:"rna-fold-p",children:["p",i]}),r.jsx("span",{className:"rna-fold-track","aria-hidden":!0,children:r.jsx("span",{style:{width:`${a?Math.max(n.folds[i]/a*100,3):0}%`}})}),r.jsxs("span",{className:"rna-fold-n mono",children:[n.folds[i].toFixed(2)," ",r.jsxs("i",{children:["(",j5(n.folds[i]),")"]})]})]},i))}),n.cancers&&r.jsx("span",{className:"rna-cancers",title:n.cancers,children:n.cancers})]})}function R5({rna:n}){const[l,a]=C.useState("report"),i=N5(n.overexpressed,l),c=Math.max(0,...n.overexpressed.map(hg));return r.jsxs("section",{className:"rna-section","aria-label":"Overexpressed cancer genes",children:[r.jsxs("div",{className:"rna-head",children:[r.jsxs("h3",{className:"sv-h",children:["Overexpressed cancer genes ",r.jsx("span",{className:"rna-count",children:n.overexpressed.length})]}),n.overexpressed.length>1&&r.jsx(ls,{label:"Sort genes",value:l,onChange:a,options:[{value:"report",label:"As reported"},{value:"fold",label:"Largest"},{value:"gene",label:"A–Z"}]})]}),i.length?r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"rna-genes",children:i.map(d=>r.jsx(T5,{gene:d,projects:n.projects,top:c},d.gene))}),r.jsxs("p",{className:"rna-note",children:["log2 fold change over the mean of ",n.projects.length>1?"each":"its"," cohort (project ",n.projects.join(", "),"), as the cohort was when the report ran."]})]}):r.jsx("p",{className:"sv-empty",children:"No overexpressed cancer genes."})]})}const A5=C.forwardRef(function({envelope:l,loading:a,picked:i,sampleLabel:c,onLocate:d},f){var p;const m=((p=l==null?void 0:l.data)==null?void 0:p.experiments)??[],[g,y]=C.useState(null),v=m.find(S=>S.node===g)??m[0];return r.jsx(nl,{ref:f,title:"RNA",subtitle:`Fusions and overexpressed cancer genes, ${c}`,lineage:(l==null?void 0:l.lineage)??[],picked:i,info:"rna",className:"rna",controls:m.length>1?r.jsx(ls,{label:"RNA experiment",value:(v==null?void 0:v.node)??"",onChange:y,options:m.map(S=>({value:S.node,label:S.node.split("-").slice(-2).join("-")}))}):void 0,children:r.jsx(ss,{label:"RNA",envelope:l,loading:a,skeletonHeight:260,children:()=>v?r.jsxs("div",{className:"rna-body",children:[r.jsx(_5,{rna:v,onLocate:d},`f-${v.node}`),r.jsx(R5,{rna:v},`o-${v.node}`)]}):null})})});function O5(n,l=[],a=new Date){const i=l.filter(f=>typeof f=="number").map(f=>Math.floor(f/365)),c=typeof n=="number"?Math.max(a.getFullYear()-n-1,0):null,d=[...i,...c===null?[]:[c]];return d.length?Math.max(...d):null}function z5(n){return typeof n=="number"?Math.round(n/365.25*10)/10:null}const D5=n=>(n??[]).filter(l=>l.includes("XPRO")),k5=n=>(n??"").replace(/^LEVEL_/,"")||"–",L5={LEVEL_1:"#33A02C",LEVEL_2:"#1F78B4",LEVEL_3A:"#984EA3",LEVEL_3B:"#BE98CE",LEVEL_4:"#424242",LEVEL_R1:"#EE3424",LEVEL_R2:"#F79A92"},$5=(n,l)=>l||L5[n??""]||"var(--chev)";function iS(n){return n&&n.replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/&/g,"&").replace(/\s+/g," ").trim()||null}function H5(n){return(n??"").split(",").map(l=>l.split("+").map(a=>a.trim()).filter(Boolean)).filter(l=>l.length)}const Cm=n=>(n??"").split(",").map(l=>l.trim()).filter(Boolean),qu=n=>n?n.charAt(0)+n.slice(1).toLowerCase():null;function tl({label:n,off:l,title:a,children:i}){return r.jsxs("p",{className:"pp-line","data-off":l||void 0,title:a,children:[n&&r.jsx("span",{className:"pp-label",children:n}),i]})}function U5({data:n,sample:l}){var g;const a=n.individual,i=n.samples.filter(y=>y.category==="TUMOR"),c=[...new Set(i.map(y=>{var v;return(v=y.disease)==null?void 0:v.name}).filter(Boolean))],d=O5(a.birth_year,i.map(y=>y.collection_days)),f=[qu(a.sex),d!==null?`${d} years old`:null].filter(Boolean).join(", "),m=(g=a.links)==null?void 0:g.cbioportal;return r.jsxs("div",{className:"pp",children:[r.jsxs("div",{className:"pp-group","aria-label":"Patient",children:[c.length>0&&r.jsx("p",{className:"pp-lead",children:c.map(qu).join(", ")}),f&&r.jsx(tl,{children:f}),a.dmp_id&&r.jsx(tl,{label:"DMP",children:m?r.jsxs("a",{href:m,target:"_blank",rel:"noreferrer",title:"Open the patient in cBioPortal",className:"pp-link",children:[a.dmp_id,r.jsx(ly,{size:12,"aria-hidden":!0})]}):a.dmp_id}),D5(a.tags).map(y=>r.jsx(tl,{children:y},y)),r.jsx(tl,{off:!a.germline_consent,title:a.germline_consent?"Consented to germline results (Part C)":"Not consented to germline results",children:a.germline_consent?"Germline consented":"No germline consent"})]}),r.jsx("div",{className:"pp-samples",children:n.samples.map(y=>r.jsx(F5,{data:n,sample:y,shown:y.id===(l==null?void 0:l.id)},y.id))})]})}function F5({data:n,sample:l,shown:a}){const i=z5(l.collection_days),c=[qu(l.disease_status),l.tissue_site].filter(Boolean).join(", ");return r.jsxs("div",{className:"pp-group","aria-label":a?"Sample":void 0,"aria-hidden":!a||void 0,"data-hidden":!a||void 0,children:[r.jsxs("p",{className:"pp-lead",children:[Lr(l.id,n.individual.id)," ",l.category==="TUMOR"?"tumour":"normal"]}),l.identifier&&r.jsx(tl,{title:"The sample's identifier",children:l.identifier}),c&&r.jsx(tl,{children:c}),l.source&&r.jsx(tl,{label:"Source",children:qu(l.source)}),l.matched_impact&&r.jsx(tl,{label:"IMPACT",title:"The matched MSK-IMPACT sample",children:l.matched_impact}),i!==null&&r.jsxs(tl,{title:`${Math.round(l.collection_days??0).toLocaleString("en-US")} days after birth`,children:["Collected at ",i," years"]})]})}function B5({children:n}){var m;const[l,a]=C.useState(!1),i=C.useRef(null),c=C.useRef(null),[d,f]=C.useState(null);return C.useLayoutEffect(()=>{if(!l||!i.current)return;const g=i.current.getBoundingClientRect();f({top:g.bottom+8,left:g.left-8});const y=v=>{var S,j;const p=!((S=c.current)!=null&&S.contains(v.target))&&!((j=i.current)!=null&&j.contains(v.target));(v instanceof KeyboardEvent&&v.key==="Escape"||!(v instanceof KeyboardEvent)&&p)&&a(!1)};return window.addEventListener("pointerdown",y),window.addEventListener("keydown",y),()=>{window.removeEventListener("pointerdown",y),window.removeEventListener("keydown",y)}},[l]),r.jsxs(r.Fragment,{children:[r.jsx("button",{ref:i,type:"button",className:"sc-ib sm","aria-expanded":l,"aria-label":"Patient and sample details",title:"Patient and sample details",onClick:()=>a(g=>!g),children:r.jsx(KN,{size:15,"aria-hidden":!0})}),l&&d&&Pr.createPortal(r.jsx("div",{ref:c,className:"pp-card",style:{top:d.top,left:d.left},role:"dialog","aria-label":"Patient and sample details",children:n}),((m=i.current)==null?void 0:m.closest(".wgts"))??document.body)]})}const Er=(n,l=2)=>n===null?"–":String(+n.toFixed(l)),dx=n=>n===null?"–":n>=1?n.toFixed(1):String(+n.toPrecision(2)),hx=(n,l)=>n===null&&l===null?"–":`${n??"–"} | ${l??"–"}`,fx=n=>n?n.charAt(0)+n.slice(1).toLowerCase():"–",mx=[{key:"coverage",label:"Coverage",value:n=>n.coverage===null?"–":`${Math.round(n.coverage)}×`,numeric:!0},{key:"purity",label:"Purity",value:n=>Er(n.purity),numeric:!0},{key:"ploidy",label:"Ploidy",value:n=>Er(n.ploidy),numeric:!0},{key:"msi",label:"MSI",value:n=>Er(n.msi),numeric:!0},{key:"hrd",label:"HRDetect | CHORD",value:n=>n.hrdetect===null&&n.chord===null?"–":`${Er(n.hrdetect)} | ${Er(n.chord)}`,numeric:!0},{key:"tmb",label:"TMB",title:"Mutations per Mb, genome-wide",value:n=>dx(n.tmb_genome),numeric:!0},{key:"tmb_coding",label:"Coding TMB",title:"Coding mutations per Mb",value:n=>dx(n.tmb_coding),numeric:!0},{key:"wgs",label:"SNVs | indels",title:"Genome-wide",value:n=>hx(n.snvs_wgs,n.indels_wgs),numeric:!0},{key:"coding",label:"Coding SNVs | indels",value:n=>hx(n.snvs_coding,n.indels_coding),numeric:!0},{key:"svs",label:"Rearrangements",value:n=>n.rearrangements===null?"–":String(n.rearrangements),numeric:!0},{key:"fusions",label:"RNA fusions",value:n=>n.rna?String(n.fusions??"–"):"–",numeric:!0},{key:"overexpressed",label:"Overexpressed genes",value:n=>n.rna?String(n.overexpressed??"–"):"–",numeric:!0},{key:"treatments",label:"Druggable targets",title:"OncoKB treatments for the tumour's alterations",value:n=>String(n.treatments??0),numeric:!0},{key:"tumour_source",label:"Tumour source",value:n=>fx(n.tumour_source)},{key:"normal_source",label:"Normal source",value:n=>fx(n.normal_source)},{key:"normal",label:"Normal used",value:n=>n.normal??"–"}];function V5({envelope:n,loading:l,picked:a,current:i,label:c,onSample:d}){return r.jsx(nl,{title:"All tumours",subtitle:"The report's results for each of the patient's tumours",lineage:(n==null?void 0:n.lineage)??[],picked:a,info:"summary",className:"pt-results",children:r.jsx(ss,{label:"results summary",envelope:n,loading:l,skeletonHeight:120,children:f=>r.jsx("div",{className:"pt-results-scroll",children:r.jsxs("table",{className:"pt-results-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Tumour"}),r.jsx("th",{scope:"col",children:"Data"}),mx.map(m=>r.jsx("th",{scope:"col",title:m.title,"data-num":m.numeric||void 0,children:m.label},m.key))]})}),r.jsx("tbody",{children:f.tumours.map(m=>r.jsxs("tr",{"data-current":m.sample===i||void 0,children:[r.jsx("th",{scope:"row",children:r.jsx("button",{type:"button",onClick:()=>d(m.sample),"aria-current":m.sample===i||void 0,children:c(m.sample)})}),r.jsx("td",{children:r.jsxs("span",{className:"pt-data",children:[r.jsx("span",{"data-on":m.wgs||void 0,children:"WGS"}),r.jsx("span",{"data-on":m.rna||void 0,children:"RNA"}),r.jsx("span",{"data-on":!!m.normal||void 0,children:"Normal"})]})}),mx.map(g=>r.jsx("td",{"data-num":g.numeric||void 0,className:g.numeric?"mono":void 0,children:g.value(m)},g.key))]},m.sample))})]})})})})}function gx({treatment:n}){const l=iS(n.level_description);return r.jsx("span",{className:"tx-level",style:{background:$5(n.level,n.level_color)},title:l?`${n.level}: ${l}`:n.level??void 0,"aria-label":`OncoKB ${n.level??"level unknown"}`,children:k5(n.level)})}function G5({drugs:n}){const l=H5(n);return l.length?r.jsx("span",{className:"tx-drugs",children:l.map((a,i)=>r.jsx("span",{className:"tx-option",title:a.length>1?"Given together":void 0,children:a.map((c,d)=>r.jsxs("span",{children:[d>0&&r.jsx("i",{"aria-hidden":!0,children:"+"}),c]},c))},i))}):r.jsx("span",{children:"–"})}const q5=C.forwardRef(function({envelope:l,loading:a,picked:i,sampleLabel:c},d){var v,p;const[f,m]=C.useState(!1),g=C.useMemo(()=>{var j;const S=((j=l==null?void 0:l.data)==null?void 0:j.treatments)??[];return f?S.filter(b=>Cm(b.found_by).includes("Isabl")):S},[l,f]),y=[...new Set((((v=l==null?void 0:l.data)==null?void 0:v.treatments)??[]).map(S=>S.level).filter(Boolean))];return r.jsx(nl,{ref:d,title:"Available treatments",subtitle:`OncoKB's biomarker-drug associations for ${c}'s alterations`,lineage:(l==null?void 0:l.lineage)??[],picked:i,info:"treatments",className:"tx",controls:(p=l==null?void 0:l.data)!=null&&p.treatments.some(S=>!Cm(S.found_by).includes("Isabl"))?r.jsxs("label",{className:"tx-toggle",children:[r.jsx("input",{type:"checkbox",checked:f,onChange:S=>m(S.target.checked)}),"Called by Isabl only"]}):void 0,footer:y.length?r.jsxs("span",{className:"tx-legend",children:[y.map(S=>{const j=l.data.treatments.find(b=>b.level===S);return r.jsxs("span",{title:iS(j.level_description)??void 0,children:[r.jsx(gx,{treatment:j})," ",S.replace("LEVEL_","Level ")]},S)}),r.jsxs("a",{href:"https://www.oncokb.org/levels",target:"_blank",rel:"noreferrer",children:["OncoKB levels of evidence ",r.jsx(uy,{size:11,"aria-hidden":!0})]})]}):void 0,children:r.jsx(ss,{label:"treatments",envelope:l,loading:a,skeletonHeight:160,children:()=>g.length?r.jsx("div",{className:"tx-scroll",children:r.jsxs("table",{className:"tx-table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",children:"Level"}),r.jsx("th",{scope:"col",children:"Alteration"}),r.jsx("th",{scope:"col",children:"Drugs"}),r.jsx("th",{scope:"col",children:"Tumour type"}),r.jsx("th",{scope:"col",children:"Called by"})]})}),r.jsx("tbody",{children:g.map((S,j)=>{const b=S.alteration&&S.gene&&!S.alteration.includes(S.gene)?`${S.gene} ${S.alteration}`:S.alteration??S.gene;return r.jsxs("tr",{children:[r.jsx("td",{children:r.jsx(gx,{treatment:S})}),r.jsxs("td",{children:[S.url?r.jsx("a",{href:S.url,target:"_blank",rel:"noreferrer",className:"tx-alt",title:"Open in OncoKB",children:b}):r.jsx("span",{className:"tx-alt",children:b}),S.alteration_type&&r.jsx("span",{className:"tx-type",children:S.alteration_type})]}),r.jsxs("td",{children:[r.jsx(G5,{drugs:S.drugs}),S.approved_indications&&r.jsx("span",{className:"tx-approved",children:S.approved_indications})]}),r.jsx("td",{children:S.tumor_type??"–"}),r.jsx("td",{children:r.jsx("span",{className:"tx-by",children:Cm(S.found_by).map(N=>r.jsx("span",{"data-who":N,children:N},N))})})]},`${S.gene}-${S.alteration}-${S.level}-${j}`)})})]})}):r.jsx("p",{className:"sv-empty px-5",children:f?"No treatments for alterations Isabl called.":"OncoKB reports no treatments for this tumour's alterations."})})})});function I5(n){var i;const l=n.samples.filter(c=>c.category==="TUMOR");return(i=l.find(c=>Object.values(c.datasets??{}).some(d=>Object.values(d).includes("ok")))??l[0]??n.samples[0])==null?void 0:i.id}const P5=[];function Q5(n){const l=C.useRef(!1);return C.useEffect(()=>{let a=0;const i=()=>{l.current=!0,window.clearTimeout(a),a=window.setTimeout(()=>l.current=!1,150)};return window.addEventListener("scroll",i,{passive:!0}),()=>{window.removeEventListener("scroll",i),window.clearTimeout(a)}},[]),C.useCallback(a=>{(a===null||!l.current)&&n(a)},[n])}function Yi(n,l){const a=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;n==null||n.scrollIntoView({behavior:a?"auto":"smooth",block:l})}const px=160;function Y5(n,l){const a=C.useRef(n);a.current=n;const i=C.useRef(null),c=C.useRef(null),d=C.useRef(0),f=C.useRef(()=>{}),m=C.useRef(()=>{});C.useEffect(()=>{let v=0;const p=()=>{var _;if(v=0,i.current)return;const E=a.current.filter(([,R])=>R.current).map(([R,k])=>[R,k.current.getBoundingClientRect().top]),A=Math.max(0,document.documentElement.scrollHeight-window.innerHeight),T=Math.max(0,...E.map(([,R])=>R+window.scrollY-A-px)),L=px+(A>0?T*Math.min(1,window.scrollY/A):0);let M=((_=E[0])==null?void 0:_[0])??null;for(const[R,k]of E)k<=L&&(M=R);l.set(M)},S=()=>{i.current=null,c.current=null,p()};m.current=()=>{c.current=window.scrollY};const j=()=>{if(i.current){c.current===null?(window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)):Math.abs(window.scrollY-c.current)>4&&S();return}v||(v=requestAnimationFrame(p))},b=()=>{i.current&&c.current===null&&(window.clearTimeout(d.current),S())};return f.current=p,p(),window.addEventListener("scroll",j,{passive:!0}),window.addEventListener("resize",j),window.addEventListener("wheel",b,{passive:!0}),window.addEventListener("touchstart",b,{passive:!0}),window.addEventListener("keydown",b),()=>{window.removeEventListener("scroll",j),window.removeEventListener("resize",j),window.removeEventListener("wheel",b),window.removeEventListener("touchstart",b),window.removeEventListener("keydown",b),window.clearTimeout(d.current),v&&cancelAnimationFrame(v)}},[]);const g=C.useRef("");return C.useEffect(()=>{const v=n.filter(([,p])=>p.current).map(([p])=>p).join();v!==g.current&&(g.current=v,f.current())}),v=>{i.current=v,c.current=null,l.set(v),window.clearTimeout(d.current),d.current=window.setTimeout(m.current,160)}}function X5({held:n,sampleId:l,...a}){const i=Xr(n);return r.jsx(_C,{...a,sampleId:i??l})}function K5(){var Kr,Zr,Zl,Jl,Wl,cs,ea,al,xo,Jr,yo,Ia,il,Wr,So,bo,jo,Pa,Qa,wo,No;const{individual:n=""}=pN(),[l,a]=$N(),i=l.get("version")??void 0,[c,d]=C.useState(null),[f,m]=C.useState(null),[g,y]=C.useState(wv),[v,p]=C.useState(null),S=Q5(p),[j,b]=C.useState(null),N=C.useRef(null),[E,A]=C.useState(null),T=C.useRef(Ji(!0)).current,L=C.useRef(null),M=C.useRef(null),_=C.useRef(null),R=C.useRef(null),k=C.useRef(null),I=C.useRef(null),K=C.useRef(null),O=C.useRef(null),se=C.useRef(Ji(null)).current,ie=Y5([["overview",M],["copyNumber",N],["mutations",L],["structuralVariants",_],["circos",k],["cnsv",I],["signatures",R],["rna",K],["treatments",O]],se),W=Tx();C.useEffect(()=>{const de=E;if(!de||typeof IntersectionObserver>"u")return;const Oe=new IntersectionObserver(([st])=>T.set(st.isIntersecting),{rootMargin:"-72px 0px 0px 0px",threshold:0});return Oe.observe(de),()=>Oe.disconnect()},[E]);const P=C.useCallback(de=>y(Oe=>({...Oe,...de})),[]),le=C.useCallback(de=>{P({q:VC(de.chrom,de.start,de.end),scope:"all",sort:"position"}),Yi(L.current,"start")},[P]),$=C.useCallback(de=>{P({q:de}),Yi(L.current,"start")},[P]),Z=C.useCallback(de=>{b({chrom:de.chrom,pos:de.pos,gene:de.gene,nonce:Date.now()}),Yi(N.current,"center")},[]),J=C.useCallback(de=>{b({...de,nonce:Date.now()}),Yi(N.current,"center")},[]),ce=QC(n,i),ae=ce.data,oe=(ae==null?void 0:ae.status)==="ok"?ae.data??void 0:void 0,xe=l.get("sample")??(oe?I5(oe):void 0),je=oe==null?void 0:oe.samples.find(de=>de.id===xe),D=(je==null?void 0:je.category)==="TUMOR"?xe:void 0,U=f??((oe==null?void 0:oe.mode)==="unmatched"?"vaf":"ccf"),q=YC(n,oe?xe:void 0,i),re=XC(n,i),he=KC(n,D,i),ye=ZC(n,D,U,g.ffpe,i),we=c3(n,D,g,i),me=(Kr=we.data)==null?void 0:Kr.pages[0],Se=C.useMemo(()=>{var de;return((de=we.data)==null?void 0:de.pages.flatMap(Oe=>Oe.status==="ok"&&Oe.data?Oe.data.rows:[]))??[]},[we.data]),{fetchNextPage:gt}=we,Pt=C.useCallback(()=>void gt(),[gt]),dn=r3(n,D,i),kt=JC(n,D,i),rt=WC(n,D,i),qe=e3(n,D,i),Qt=t3(n,D,i),kn=n3(n,D,i),[tn,hn]=C.useState("1"),[Ts,xt]=C.useState("integrated"),[as,Yt]=C.useState(!1),nn=s3(n,D,tn,i),sl=l3(n,D,Ts==="raw"&&as,i),Et=a3(n,D,i),is=o3(n,D,i),Rs=i3(n,!!oe,i),ne=Xr(Ty),ue=(Zl=(Zr=re.data)==null?void 0:Zr.data)==null?void 0:Zl.samples.find(de=>de.sample===xe),Ne=C.useMemo(()=>(ue==null?void 0:ue.drivers)??P5,[ue]),Pe=C.useMemo(()=>v?{chrom:v.chrom,pos:v.pos,gene:v.gene}:j,[v,j]),Ie=C.useRef(null),pt=C.useRef(Ji(null)).current,_t=(de,Oe)=>{var st;(st=Ie.current)==null||st.toggleAttribute("data-gliding",de),Ie.current&&(Ie.current.style.minHeight=de&&Oe?`${Oe}px`:"")},Fe=C.useRef(null);C.useEffect(()=>()=>{var de;return(de=Fe.current)==null?void 0:de.call(Fe)},[]);const fn=de=>{var ta,na;if(de===xe)return;(ta=Fe.current)==null||ta.call(Fe);const Oe=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches,st=50;if(Oe||window.scrollY<=st)return window.scrollTo({top:0,behavior:"auto"}),mn("sample",de);const us=window.scrollY,ec=Math.min(520,240+us*.12),ad=performance.now();_t(!0,document.documentElement.scrollHeight-(((na=Ie.current)==null?void 0:na.getBoundingClientRect().top)??0)-us),pt.set(xe??null),ie("overview"),C.startTransition(()=>mn("sample",de));let Co=0;function Qn(){cancelAnimationFrame(Co),window.removeEventListener("wheel",Qn),window.removeEventListener("touchstart",Qn),window.removeEventListener("keydown",Qn),Fe.current=null,pt.set(null),_t(!1)}const ol=Os=>{const zs=Math.min(1,(Os-ad)/ec),rl=us*(1-zs)**3;window.scrollTo({top:rl,behavior:"instant"}),rl<=st&&pt.set(null),zs<1?Co=requestAnimationFrame(ol):Qn()};window.addEventListener("wheel",Qn,{passive:!0}),window.addEventListener("touchstart",Qn,{passive:!0}),window.addEventListener("keydown",Qn),Fe.current=Qn,Co=requestAnimationFrame(ol)},mn=(de,Oe)=>{const st=new URLSearchParams(l);st.set(de,Oe),a(st,{replace:!1}),d(null),y(wv()),p(null),b(null)},Kl=[ce,q,re,he,ye,we,dn,kt,rt,qe,Qt,kn].map(de=>de.error);if(Kl.some(de=>de instanceof Zu))return r.jsx("div",{className:`wgts ${Pn.theme}`,children:r.jsx("main",{className:"page",children:r.jsx(H3,{onSignedIn:()=>W.invalidateQueries()})})});const ll=Kl.find(de=>de instanceof yy),As=je&&oe?Lr(je.id,oe.individual.id):"",vo=oe?r.jsx(U5,{data:oe,sample:je}):void 0,sd=new Set(oe?D?["overview","copyNumber","mutations","structuralVariants","circos","cnsv","signatures","rna","treatments"]:["overview"]:[]),ld=de=>{if(ie(de),de==="overview"){const st=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:0,behavior:st?"auto":"smooth"});return}const Oe={copyNumber:N,mutations:L,structuralVariants:_,circos:k,cnsv:I,signatures:R,rna:K,treatments:O}[de];Yi((Oe==null?void 0:Oe.current)??null,"start")},os=oe&&xe&&oe.analyses[xe]||[],Xt=(oe==null?void 0:oe.failures.filter(de=>de.sample===xe))??[],rs=new Set(os.map(zn)),Lt=new Set,Kt=de=>de==null?void 0:de.forEach(Oe=>rs.has(zn(Oe))&&Lt.add(zn(Oe)));for(const de of((Wl=(Jl=q.data)==null?void 0:Jl.data)==null?void 0:Wl.metrics)??[])Wm.includes(de.key)&&Kt(de.sources);Kt((cs=re.data)==null?void 0:cs.lineage),Kt((ea=he.data)==null?void 0:ea.lineage),Kt((al=ye.data)==null?void 0:al.lineage),Kt(me==null?void 0:me.lineage),Kt((xo=dn.data)==null?void 0:xo.lineage),Kt((Jr=kt.data)==null?void 0:Jr.lineage),Kt((yo=rt.data)==null?void 0:yo.lineage),Kt((Ia=qe.data)==null?void 0:Ia.lineage),Kt((il=Qt.data)==null?void 0:il.lineage),Kt((Wr=kn.data)==null?void 0:Wr.lineage),Kt((So=nn.data)==null?void 0:So.lineage),Kt((bo=Et.data)==null?void 0:bo.lineage),Kt((jo=is.data)==null?void 0:jo.lineage);for(const de of os)de.state==="failed"&&Xt.length>0&&Lt.add(zn(de));return r.jsxs("div",{className:`wgts ${Pn.theme}`,children:[r.jsx(j3,{analyses:os,onPage:Lt,sampleLabel:As,picked:c,onPick:d,sections:sd,activeStore:se,onSection:ld,profile:vo}),r.jsxs("div",{ref:Ie,className:"page",children:[r.jsx(xy,{individualId:n,subtitle:(oe==null?void 0:oe.mode)==="unmatched"?"tumour only":void 0,details:oe&&ne?r.jsx(B5,{children:vo}):void 0,patientIcon:oe?r.jsx(wC,{sex:oe.individual.sex}):void 0,report:oe?r.jsx(A3,{data:oe,onVersion:de=>mn("version",de)}):void 0,compact:oe&&xe?r.jsx(TC,{data:oe,sampleId:xe,fingerprint:((Pa=re.data)==null?void 0:Pa.data)??void 0,onSample:fn}):void 0,headerInView:T}),r.jsxs("main",{className:"flex flex-1 flex-col",children:[oe&&xe&&r.jsx("div",{className:"px-8 pt-1",children:r.jsx("div",{ref:A,children:r.jsx(X5,{held:pt,data:oe,sampleId:xe,fingerprint:((Qa=re.data)==null?void 0:Qa.data)??void 0,onSample:de=>mn("sample",de)})})}),r.jsxs("div",{className:"sheet",children:[ce.isPending&&r.jsx("div",{className:"skeleton h-24","aria-label":"Loading the patient"}),ll&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(_a,{envelope:{status:"error",data:null,lineage:[],warnings:[ll.message]}})}),ce.isError&&!ll&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(_a,{envelope:{status:"error",data:null,lineage:[],warnings:[ce.error.message]}})}),ae&&ae.status!=="ok"&&r.jsx("div",{className:"sc-card px-6 py-5",children:r.jsx(_a,{envelope:ae})}),(ae==null?void 0:ae.status)==="ok"&&ae.warnings.length>0&&r.jsx("div",{className:"sc-card px-6 py-4",children:r.jsx(_a,{envelope:{...ae,status:"missing"}})}),oe&&xe&&r.jsxs(r.Fragment,{children:[r.jsx($3,{sampleLabel:As,failures:Xt,analyses:os}),D?r.jsxs(r.Fragment,{children:[r.jsxs("div",{ref:M,className:"page-section",children:[r.jsx(L3,{sampleLabel:`${As} tumour`,fingerprint:ue,metrics:q.data,picked:c,lineage:Ju((wo=q.data)==null?void 0:wo.lineage,(No=re.data)==null?void 0:No.lineage)}),r.jsx(V5,{envelope:Rs.data,loading:Rs.isPending,picked:c,current:xe??void 0,label:de=>oe?Lr(de,oe.individual.id):de,onSample:de=>mn("sample",de)})]}),r.jsx("div",{ref:N,className:"page-section",children:r.jsx(NM,{envelope:he.data,loading:he.isPending,picked:c,sampleLabel:As,drivers:Ne,focus:Pe,locate:j,onSegment:le,onGene:$,fga:qe.data,fgaLoading:qe.isPending,onOpenChromosome:de=>{hn(de),Yt(!1),ie("cnsv"),Yi(I.current,"start")}})}),r.jsx(WE,{ref:L,variants:me,rows:Se,hasMore:we.hasNextPage,loadingMore:we.isFetchingNextPage,onMore:Pt,variantsLoading:we.isPending,variantsFetching:we.isFetching&&we.isPlaceholderData,density:ye.data,densityLoading:ye.isPending,picked:c,measure:U,onMeasure:de=>{m(de),g.range&&g.range.measure!==de&&P({range:null})},table:g,onTable:P,hovered:v,onHover:S,onLocate:Z,showCcf:oe.mode!=="unmatched",tmb:Qt.data}),r.jsx(N4,{ref:_,envelope:dn.data,loading:dn.isPending,picked:c,onLocate:J}),r.jsx(e5,{ref:k,envelope:kn.data,loading:kn.isPending,picked:c,drivers:Ne}),r.jsx(S5,{ref:I,envelope:nn.data,loading:nn.isPending,rawGenome:sl.data,rawGenomeLoading:sl.isPending,picked:c,chrom:tn,onChrom:hn,mode:Ts,onMode:xt,genome:as,onGenome:Yt}),r.jsx(q4,{ref:R,envelope:kt.data,loading:kt.isPending,contextEnvelope:rt.data,contextLoading:rt.isPending,picked:c}),r.jsx(A5,{ref:K,envelope:Et.data,loading:Et.isPending,picked:c,sampleLabel:As,onLocate:J}),r.jsx(q5,{ref:O,envelope:is.data,loading:is.isPending,picked:c,sampleLabel:As})]}):r.jsx("div",{ref:M,className:"sc-card px-6 py-5",children:r.jsx(_a,{envelope:{status:"missing",data:null,lineage:[],warnings:[`${As} is a normal sample. Its germline and quality panels arrive with those sections.`]}})})]})]})]})]})]})}const Mm=200,oS="wgts-picker-scope";function Z5(){try{const n=localStorage.getItem(oS);return n&&/^\d+$/.test(n)?Number(n):"all"}catch{return"all"}}function J5(n,l){const a=l.toLowerCase().split(/\s+/).filter(Boolean);return a.length===0?n:n.filter(i=>{const c=`${i.individual} ${i.diseases.join(" ")} ${i.report_version}`.toLowerCase();return a.every(d=>c.includes(d))})}function W5(n,l){const a=l.toLowerCase().split(/\s+/).filter(Boolean);return a.length===0?n:n.filter(i=>{const c=`${i.title} ${i.short_title??""} ${i.description??""}`.toLowerCase();return a.every(d=>c.includes(d))})}const Em=n=>n.toLocaleString("en-US");function e_(){return Xr(Ng)?r.jsx(t_,{}):null}function t_(){var O,se,ie,W;const n=jg(),l=((O=mN("/:individual"))==null?void 0:O.params.individual)??"",a=C.useId(),i=C.useRef(null),[c,d]=C.useState(Z5),[f,m]=C.useState(""),[g,y]=C.useState(""),[v,p]=C.useState(0),S=u3(),j=d3(c);C.useEffect(()=>{const P=document.activeElement,le=document.documentElement,$=le.style.overflow;return le.style.overflow="hidden",requestAnimationFrame(()=>{var Z;return(Z=document.querySelector(".pick-main .tsearch input"))==null?void 0:Z.focus()}),()=>{le.style.overflow=$,P==null||P.focus()}},[]);const b=P=>{d(P),y(""),p(0);try{localStorage.setItem(oS,String(P))}catch{}requestAnimationFrame(()=>{var le;return(le=document.querySelector(".pick-main .tsearch input"))==null?void 0:le.focus()})},N=((se=S.data)==null?void 0:se.results)??[],E=C.useMemo(()=>W5(N,f),[N,f]),A=c==="all"?null:N.find(P=>P.pk===c)??((ie=j.data)==null?void 0:ie.project)??null,T=((W=j.data)==null?void 0:W.results)??[],L=C.useMemo(()=>J5(T,g),[T,g]),M=L.slice(0,Mm),_=C.useRef(null),R=P=>{wu(),P.individual!==l&&n(`/${encodeURIComponent(P.individual)}`)};C.useEffect(()=>{var P,le,$;($=(le=(P=_.current)==null?void 0:P.querySelector(`[data-index="${v}"]`))==null?void 0:le.scrollIntoView)==null||$.call(le,{block:"nearest"})},[v]),C.useEffect(()=>p(0),[g]);const k=P=>{const le=P.target,$=le instanceof HTMLInputElement&&!!le.closest(".pick-main");if(P.key==="Escape"){if(le instanceof HTMLInputElement&&le.value)return;wu()}else if($&&P.key==="ArrowDown")P.preventDefault(),p(Z=>Math.min(Z+1,M.length-1));else if($&&P.key==="ArrowUp")P.preventDefault(),p(Z=>Math.max(Z-1,0));else if($&&P.key==="Enter"&&M[v])P.preventDefault(),R(M[v]);else if(le instanceof HTMLInputElement&&le.closest(".pick-rail")&&P.key==="Enter"){P.preventDefault();const Z=E[0];Z&&b(Z.pk)}},I=S.isPending,K=S.isError||j.isError;return Pr.createPortal(r.jsx("div",{className:`info-backdrop ${Pn.theme}`,onMouseDown:P=>P.target===P.currentTarget&&wu(),children:r.jsxs("div",{className:"info-dialog pick",role:"dialog","aria-modal":"true","aria-labelledby":a,tabIndex:-1,onKeyDown:k,children:[r.jsx("button",{ref:i,type:"button",className:"info-close","aria-label":"Close",onClick:wu,children:r.jsx(Yr,{size:18,"aria-hidden":!0})}),r.jsxs("nav",{className:"info-rail pick-rail","aria-label":"Projects",children:[r.jsx("span",{className:"info-kicker",children:"Browse"}),r.jsx("h2",{id:a,children:"Projects"}),r.jsx(Vu,{value:f,onChange:m,label:"Search projects",placeholder:"Search projects",shortcut:!1,delay:0}),r.jsxs("ol",{children:[r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c==="all"?"true":void 0,onClick:()=>b("all"),children:[r.jsx("span",{className:"pick-name",children:r.jsxs("span",{children:[r.jsx(dC,{size:14,"aria-hidden":!0}),"All patients"]})}),r.jsx("span",{className:"pick-n",children:S.data?Em(S.data.total):""})]})}),E.map(P=>r.jsx("li",{children:r.jsxs("button",{type:"button","aria-current":c===P.pk?"true":void 0,onClick:()=>b(P.pk),title:P.short_title?`${P.title} (${P.short_title})`:P.title,children:[r.jsx("span",{className:"pick-name",children:P.title}),r.jsx("span",{className:"pick-n",children:Em(P.patients)})]})},P.pk))]}),I&&r.jsx("p",{className:"pick-note",children:"Loading projects…"}),!I&&N.length>0&&E.length===0&&r.jsxs("p",{className:"pick-note",children:["No project matches “",f,"”."]}),!I&&!S.isError&&N.length===0&&r.jsx("p",{className:"pick-note",children:"No project has a dashboard yet. “All patients” lists every one."})]}),r.jsxs("div",{className:"pick-main",children:[r.jsxs("header",{className:"pick-head",children:[r.jsx("span",{className:"info-kicker",children:(A==null?void 0:A.short_title)??(c==="all"?"Every project":"Project")}),r.jsx("h3",{children:(A==null?void 0:A.title)??"All patients"}),(A==null?void 0:A.description)&&r.jsx("p",{children:A.description})]}),r.jsx("div",{className:"tbar",children:r.jsx(Vu,{value:g,onChange:y,label:"Search patients",placeholder:"Search id or disease",shortcut:!1,delay:0})}),r.jsx("div",{ref:_,className:"pick-list",role:"group","aria-label":"Patients","aria-busy":j.isFetching,children:K?r.jsx("p",{className:"pick-note",children:"The patients could not be loaded. Close this window and try again."}):j.isPending?r.jsx("p",{className:"pick-note",children:"Loading patients…"}):M.length===0?r.jsx("p",{className:"pick-note",children:g?`No patient matches “${g}”.`:"No patients with a dashboard in this project yet."}):M.map((P,le)=>r.jsxs("button",{type:"button",className:"pick-row","data-index":le,"data-active":le===v||void 0,"data-current":P.individual===l||void 0,onMouseEnter:()=>p(le),onClick:()=>R(P),children:[r.jsx("span",{className:"pick-id mono",children:r.jsx(Va,{text:P.individual,query:g})}),r.jsx("span",{className:"pick-diseases",children:P.diseases.length>0?P.diseases.map($=>r.jsx("span",{className:"sc-chip",children:r.jsx(Va,{text:$,query:g})},$)):r.jsx("span",{className:"pick-faint",children:"No tumour disease recorded"})}),r.jsx("span",{className:"pick-aside",children:P.individual===l?r.jsxs("span",{className:"pick-here",children:[r.jsx(oy,{size:13,"aria-hidden":!0}),"On this page"]}):r.jsxs(r.Fragment,{children:[r.jsxs("span",{children:[Em(P.samples)," ",P.samples===1?"sample":"samples"]}),r.jsxs("span",{className:"pick-faint",children:["report ",P.report_version,P.built?`, ${my(P.built)}`:""]})]})})]},P.individual))}),j.data&&r.jsx(nd,{shown:L.length,total:T.length,noun:["patient","patients"],note:L.length>Mm?`Showing the first ${Mm}; search to narrow`:void 0})]})]})}),document.body)}const n_=new Rw({defaultOptions:{queries:{staleTime:6e4,refetchOnWindowFocus:!1}}});function s_(){return r.jsx(sw,{client:n_,children:r.jsxs(LN,{basename:Pn.basePath,children:[r.jsxs(ON,{children:[r.jsx(Vm,{path:"/",element:r.jsx(AC,{})}),r.jsx(Vm,{path:"/:individual",element:r.jsx(K5,{})})]}),r.jsx(e_,{})]})})}nw.createRoot(document.getElementById("root")).render(r.jsx(C.StrictMode,{children:r.jsx(s_,{})}));
|