@oxide/skepsis 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlights-xCDO0bP7.js","assets/appendItems-BDl89Ia1.js","assets/lib-K5iW4li2.js","assets/unwrapDefault-ByDmBtHB.js","assets/preload-helper-BLdHbfdN.js","assets/stream-tokenizer-Baxxf9P5.js","assets/shiki-CoZZwYQ-.js","assets/core-B7Q2IdxQ.js","assets/langs-BzPOrwLe.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlights-CzsfRyuJ.js","assets/appendItems-BDl89Ia1.js","assets/lib-K5iW4li2.js","assets/unwrapDefault-ByDmBtHB.js","assets/preload-helper-BLdHbfdN.js","assets/stream-tokenizer-Baxxf9P5.js","assets/shiki-7tdSK7dy.js","assets/core-B7Q2IdxQ.js","assets/langs-BzPOrwLe.js"])))=>i.map(i=>d[i]);
2
2
  import{i as e,n as t}from"./lib-K5iW4li2.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v}from"./appendItems-BDl89Ia1.js";import{t as y}from"./preload-helper-BLdHbfdN.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var b=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),x=t(((e,t)=>{t.exports=b()})),S=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ee=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&&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)};function te(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ee)}catch(e){ee(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function L(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else te(L.bind(null,e))}var ne={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ne,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=L,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=te,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),C=t(((e,t)=>{t.exports=S()})),w=t((e=>{var t=C();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),T=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=w()})),E=t((e=>{var t=x(),n=C(),r=T();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function f(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&f(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function p(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 m(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 h(e){var t=[null,null],n=p(e);return n===null||g(t,e,n.child,{foundSelf:!1}),t}function g(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&g(e,t,n.child,r))return!0;n=n.sibling}return!1}function _(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 v=null,y=null;function b(e,t,n){return e===n||e===t&&(v=e,!0)}function S(e,t,n){return e===n?(y=e,!1):e===t&&(y!==null&&(v=e),!0)}function w(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 E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),N=Symbol.for(`react.profiler`),P=Symbol.for(`react.consumer`),F=Symbol.for(`react.context`),I=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),L=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.legacy_hidden`),R=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.for(`react.view_transition`),oe=Symbol.for(`react.recoverable`),se=Symbol.iterator;function ce(e){return typeof e!=`object`||!e?null:(e=se&&e[se]||e[`@@iterator`],typeof e==`function`?e:null)}var le=Symbol.for(`react.client.reference`);function ue(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case N:return`Profiler`;case M:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`;case ae:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case F:return e.displayName||`Context`;case P:return(e._context.displayName||`Context`)+`.Consumer`;case I:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case L:return t=e.displayName||null,t===null?ue(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var de=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},me=[],he=-1;function ge(e){return{current:e}}function _e(e){0>he||(e.current=me[he],me[he]=null,he--)}function ve(e,t){he++,me[he]=e.current,e.current=t}var ye=ge(null),be=ge(null),xe=ge(null),Se=ge(null);function Ce(e,t){switch(ve(xe,t),ve(be,e),ve(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=vp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}_e(ye),ve(ye,e)}function we(){_e(ye),_e(be),_e(xe)}function Te(e){var t=e.memoizedState;t!==null&&(mh._currentValue=t.memoizedState,ve(Se,e)),t=ye.current;var n=vp(t,e.type);t!==n&&(ve(be,e),ve(ye,n))}function B(e){be.current===e&&(_e(ye),_e(be)),Se.current===e&&(_e(Se),mh._currentValue=pe)}var Ee,De;function Oe(e){if(Ee===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ee=t&&t[1]||``,De=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Ee+e+De}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -7,7 +7,7 @@ import{i as e,n as t}from"./lib-K5iW4li2.js";import{_ as n,a as r,c as i,d as a,
7
7
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ke=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Oe(n):``}function je(e,t){switch(e.tag){case 26:case 27:case 5:return Oe(e.type);case 16:return Oe(`Lazy`);case 13:return e.child!==t&&t!==null?Oe(`Suspense Fallback`):Oe(`Suspense`);case 19:return Oe(`SuspenseList`);case 0:case 15:return Ae(e.type,!1);case 11:return Ae(e.type.render,!1);case 1:return Ae(e.type,!0);case 31:return Oe(`Activity`);case 30:return Oe(`ViewTransition`);default:return``}}function Me(e){try{var t=``,n=null;do t+=je(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
8
  Error generating stack: `+e.message+`
9
9
  `+e.stack}}var Ne=Object.prototype.hasOwnProperty,Pe=t.unstable_scheduleCallback,Fe=t.unstable_cancelCallback,Ie=t.unstable_shouldYield,Le=t.unstable_requestPaint,Re=t.unstable_now,ze=t.unstable_getCurrentPriorityLevel,Be=t.unstable_ImmediatePriority,Ve=t.unstable_UserBlockingPriority,He=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,We=t.unstable_IdlePriority,Ge=t.log,Ke=t.unstable_setDisableYieldValue,qe=null,Je=null;function Ye(e){if(typeof Ge==`function`&&Ke(e),Je&&typeof Je.setStrictMode==`function`)try{Je.setStrictMode(qe,e)}catch{}}var Xe=Math.clz32?Math.clz32:$e,Ze=Math.log,Qe=Math.LN2;function $e(e){return e>>>=0,e===0?32:31-(Ze(e)/Qe|0)|0}var et=256,tt=262144,nt=4194304;function rt(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 V(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=rt(n))):i=rt(o):i=rt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=rt(n))):i=rt(o)):i=rt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function it(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function at(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Xe(n),i=1<<r;t|=e[r],n&=~i}return t}function ot(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 st(){var e=nt;return nt<<=1,!(nt&62914560)&&(nt=4194304),e}function ct(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function lt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Xe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Xe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ft(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Xe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function pt(e,t){var n=t&-t;return n=n&42?1:mt(n),(n&(e.suspendedLanes|t))===0?n:0}function mt(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 ht(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function gt(){var e=fe.p;return e===0?(e=window.event,e===void 0?32:Ah(e.type)):e}function _t(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var vt=Math.random().toString(36).slice(2),yt=`__reactFiber$`+vt,bt=`__reactProps$`+vt,xt=`__reactContainer$`+vt,St=`__reactEvents$`+vt,Ct=`__reactListeners$`+vt,wt=`__reactHandles$`+vt,Tt=`__reactResources$`+vt,Et=`__reactMarker$`+vt,Dt=`__reactLoad$`+vt;function Ot(e){delete e[yt],delete e[bt],delete e[Ct],delete e[wt]}function kt(e){var t;if(t=e[yt])return t;for(var n=e.parentNode;n;){if(t=n[xt]||n[yt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[yt])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function H(e){if(e=e[yt]||e[xt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function At(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function jt(e){var t=e[Tt];return t||=e[Tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Mt(e){e[Et]=!0}function Nt(e){e[Dt]=void 0}var Pt=new Set,Ft={};function It(e,t){Lt(e,t),Lt(e+`Capture`,t)}function Lt(e,t){for(Ft[e]=t,e=0;e<t.length;e++)Pt.add(t[e])}var Rt=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]*$`),zt={},Bt={};function Vt(e){return Ne.call(Bt,e)?!0:Ne.call(zt,e)?!1:Rt.test(e)?Bt[e]=!0:(zt[e]=!0,!1)}var U=!1;function Ht(){var e=U;return U=!1,e}function Ut(e,t,n){if(Vt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Wt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Gt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Kt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Jt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Yt(e){if(!e._valueTracker){var t=qt(e)?`checked`:`value`;e._valueTracker=Jt(e,t,``+e[t])}}function Xt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var Zt=/[\n"\\]/g;function Qt(e){return e.replace(Zt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function $t(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Kt(t)):e.value!==``+Kt(t)&&(e.value=``+Kt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):tn(e,Kt(n)):o===`number`&&e.value==t?tn(e,Kt(e.value)):tn(e,Kt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Kt(s):e.removeAttribute(`name`)}function en(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Yt(e);return}n=n==null?``:``+Kt(n),t=t==null?n:``+Kt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Yt(e)}function tn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function nn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Kt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function rn(e,t,n){t!=null&&(t=``+Kt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Kt(n)}function W(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(de(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Kt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Yt(e)}function an(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var on=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 sn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||on.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function cn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,U=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(sn(e,a,r),U=!0)}else for(var o in t)t.hasOwnProperty(o)&&sn(e,o,t[o])}function ln(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 un=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`]]),dn=/^[\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 fn(e){return dn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function pn(){}var mn=null;function hn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gn=null,_n=null;function vn(e){var t=H(e);if(t&&(e=t.stateNode)){var n=e[bt]||null;a:switch(e=t.stateNode,t.type){case`input`:if($t(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Qt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[bt]||null;if(!a)throw Error(i(90));$t(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Xt(r)}break a;case`textarea`:rn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&nn(e,!!n.multiple,t,!1)}}}var yn=!1;function bn(e,t,n){if(yn)return e(t,n);yn=!0;try{return e(t)}finally{if(yn=!1,(gn!==null||_n!==null)&&(Ud(),gn&&(t=gn,e=_n,_n=gn=null,vn(t),e)))for(t=0;t<e.length;t++)vn(e[t])}}function xn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[bt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Sn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Cn=!1;if(Sn)try{var wn={};Object.defineProperty(wn,"passive",{get:function(){Cn=!0}}),window.addEventListener(`test`,wn,wn),window.removeEventListener(`test`,wn,wn)}catch{Cn=!1}var Tn=null,En=null,Dn=null;function On(){if(Dn)return Dn;var e,t=En,n=t.length,r,i=`value`in Tn?Tn.value:Tn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Dn=i.slice(e,1<r?1-r:void 0)}function kn(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 An(){return!0}function jn(){return!1}function Mn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?An:jn,this.isPropagationStopped=jn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=An)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=An)},persist:function(){},isPersistent:An}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pn=Mn(Nn),Fn=D({},Nn,{view:0,detail:0}),In=Mn(Fn),Ln,Rn,zn,Bn=D({},Fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zn,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!==zn&&(zn&&e.type===`mousemove`?(Ln=e.screenX-zn.screenX,Rn=e.screenY-zn.screenY):Rn=Ln=0,zn=e),Ln)},movementY:function(e){return`movementY`in e?e.movementY:Rn}}),Vn=Mn(Bn),Hn=Mn(D({},Bn,{dataTransfer:0})),Un=Mn(D({},Fn,{relatedTarget:0})),Wn=Mn(D({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0})),Gn=Mn(D({},Nn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Kn=Mn(D({},Nn,{data:0})),qn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Jn={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`},Yn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yn[e])?!!t[e]:!1}function Zn(){return Xn}var Qn=Mn(D({},Fn,{key:function(e){if(e.key){var t=qn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=kn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zn,charCode:function(e){return e.type===`keypress`?kn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?kn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),$n=Mn(D({},Bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),er=Mn(D({},Nn,{submitter:0})),tr=Mn(D({},Fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zn})),nr=Mn(D({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0})),rr=Mn(D({},Bn,{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})),ir=Mn(D({},Nn,{newState:0,oldState:0,source:0})),ar=[9,13,27,32],or=Sn&&`CompositionEvent`in window,sr=null;Sn&&`documentMode`in document&&(sr=document.documentMode);var cr=Sn&&`TextEvent`in window&&!sr,lr=Sn&&(!or||sr&&8<sr&&11>=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=On(),Dn=En=Tn=null,mr=!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 lr&&t.locale!==`ko`?null:t.data;default:return null}}var _r={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 vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!_r[e.type]:t===`textarea`}function yr(e,t,n,r){gn?_n?_n.push(r):_n=[r]:gn=r,t=ep(t,`onChange`),0<t.length&&(n=new Pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var br=null,xr=null;function Sr(e){Kf(e,0)}function Cr(e){if(Xt(At(e)))return e}function wr(e,t){if(e===`change`)return t}var Tr=!1;if(Sn){var Er;if(Sn){var Dr=`oninput`in document;if(!Dr){var Or=document.createElement(`div`);Or.setAttribute(`oninput`,`return;`),Dr=typeof Or.oninput==`function`}Er=Dr}else Er=!1;Tr=Er&&(!document.documentMode||9<document.documentMode)}function kr(){br&&(br.detachEvent(`onpropertychange`,Ar),xr=br=null)}function Ar(e){if(e.propertyName===`value`&&Cr(xr)){var t=[];yr(t,xr,e,hn(e)),bn(Sr,t)}}function jr(e,t,n){e===`focusin`?(kr(),br=t,xr=n,br.attachEvent(`onpropertychange`,Ar)):e===`focusout`&&kr()}function Mr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Cr(xr)}function Nr(e,t){if(e===`click`)return Cr(t)}function Pr(e,t){if(e===`input`||e===`change`)return Cr(t)}function Fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Ir=typeof Object.is==`function`?Object.is:Fr;function Lr(e,t){if(Ir(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ne.call(t,i)||!Ir(e[i],t[i]))return!1}return!0}function Rr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Br(e,t){var n=zr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=zr(n)}}function Vr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Vr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rr(e.document)}return t}function Ur(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 Wr=Sn&&`documentMode`in document&&11>=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==Rr(r)||(r=Gr,`selectionStart`in r&&Ur(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qr&&Lr(qr,r)||(qr=r,r=ep(Kr,`onSelect`),0<r.length&&(t=new Pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Gr)))}function Xr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Zr={animationend:Xr(`Animation`,`AnimationEnd`),animationiteration:Xr(`Animation`,`AnimationIteration`),animationstart:Xr(`Animation`,`AnimationStart`),transitionrun:Xr(`Transition`,`TransitionRun`),transitionstart:Xr(`Transition`,`TransitionStart`),transitioncancel:Xr(`Transition`,`TransitionCancel`),transitionend:Xr(`Transition`,`TransitionEnd`)},Qr={},$r={};Sn&&($r=document.createElement(`div`).style,`AnimationEvent`in window||(delete Zr.animationend.animation,delete Zr.animationiteration.animation,delete Zr.animationstart.animation),`TransitionEvent`in window||delete Zr.transitionend.transition);function ei(e){if(Qr[e])return Qr[e];if(!Zr[e])return e;var t=Zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $r)return Qr[e]=t[n];return e}var ti=ei(`animationend`),ni=ei(`animationiteration`),ri=ei(`animationstart`),ii=ei(`transitionrun`),ai=ei(`transitionstart`),oi=ei(`transitioncancel`),si=ei(`transitionend`),ci=new Map,li=`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(` `);li.push(`scrollEnd`);function ui(e,t){ci.set(e,t),It(t,[e])}var di=0;function fi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=wd.identifierPrefix;var n=di++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function pi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Md;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function mi(e,t){return e=pi(e),t=pi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var hi=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&&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)},gi=[],_i=0,vi=0;function yi(){for(var e=_i,t=vi=_i=0;t<e;){var n=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var i=gi[t];gi[t++]=null;var a=gi[t];if(gi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Ci(n,i,a)}}function bi(e,t,n,r){gi[_i++]=e,gi[_i++]=t,gi[_i++]=n,gi[_i++]=r,vi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function xi(e,t,n,r){return bi(e,t,n,r),wi(e)}function Si(e,t){return bi(e,null,null,t),wi(e)}function Ci(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Xe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function wi(e){if(50<Nd)throw Nd=0,Pd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ti={};function Ei(e,t,n,r){this.tag=e,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Di(e,t,n,r){return new Ei(e,t,n,r)}function Oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ki(e,t){var n=e.alternate;return n===null?(n=Di(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ai(e,t){e.flags&=1206910978;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ji(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Oi(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,ye.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case re:return e=Di(31,n,t,a),e.elementType=re,e.lanes=o,e;case j:return Mi(n.children,a,o,t);case M:s=8,a|=24;break;case N:return e=Di(12,n,t,a|2),e.elementType=N,e.lanes=o,e;case ee:return e=Di(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=Di(19,n,t,a),e.elementType=te,e.lanes=o,e;case ie:case ae:return e=a|32,e=Di(30,n,t,e),e.elementType=ae,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case F:s=10;break a;case P:s=9;break a;case I:s=11;break a;case L:s=14;break a;case ne:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Di(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Mi(e,t,n,r){return e=Di(7,e,r,t),e.lanes=n,e}function Ni(e,t,n){return e=Di(6,e,null,t),e.lanes=n,e}function Pi(e){var t=Di(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=Di(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ii=new WeakMap;function Li(e,t){if(typeof e==`object`&&e){var n=Ii.get(e);return n===void 0?(t={value:e,source:t,stack:Me(t)},Ii.set(e,t),t):n}return{value:e,source:t,stack:Me(t)}}var Ri=[],zi=0,Bi=null,Vi=0,Hi=[],Ui=0,Wi=null,Gi=1,Ki=``;function qi(e,t){Ri[zi++]=Vi,Ri[zi++]=Bi,Bi=e,Vi=t}function Ji(e,t,n){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Wi=e;var r=Gi;e=Ki;var i=32-Xe(r)-1;r&=~(1<<i),n+=1;var a=32-Xe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Gi=1<<32-Xe(t)+i|n<<i|r,Ki=a+e}else Gi=1<<a|n<<i|r,Ki=e}function Yi(e){e.return!==null&&(qi(e,1),Ji(e,1,0))}function Xi(e){for(;e===Bi;)Bi=Ri[--zi],Ri[zi]=null,Vi=Ri[--zi],Ri[zi]=null;for(;e===Wi;)Wi=Hi[--Ui],Hi[Ui]=null,Ki=Hi[--Ui],Hi[Ui]=null,Gi=Hi[--Ui],Hi[Ui]=null}function Zi(e,t){Hi[Ui++]=Gi,Hi[Ui++]=Ki,Hi[Ui++]=Wi,Gi=t.id,Ki=t.overflow,Wi=e}var Qi=null,$i=null,G=!1,ea=null,ta=!1,na=Error(i(519));function ra(e){throw la(Li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),na}function ia(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[yt]=e,t[bt]=r,n){case`dialog`:qf(`cancel`,t),qf(`close`,t);break;case`iframe`:case`object`:case`embed`:qf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)qf(Wf[n],t);break;case`source`:qf(`error`,t);break;case`img`:case`image`:case`link`:qf(`error`,t),qf(`load`,t);break;case`details`:qf(`toggle`,t);break;case`input`:qf(`invalid`,t),en(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:qf(`invalid`,t);break;case`textarea`:qf(`invalid`,t),W(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||op(t.textContent,n)?(r.popover!=null&&(qf(`beforetoggle`,t),qf(`toggle`,t)),r.onScroll!=null&&qf(`scroll`,t),r.onScrollEnd!=null&&qf(`scrollend`,t),r.onClick!=null&&(t.onclick=pn),t=!0):t=!1,t||ra(e,!0)}function aa(e){for(Qi=e.return;Qi;)switch(Qi.tag){case 5:case 31:case 13:ta=!1;return;case 27:case 3:ta=!0;return;default:Qi=Qi.return}}function oa(e){if(e!==Qi)return!1;if(!G)return aa(e),G=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||bp(e.type,e.memoizedProps)),n=!n),n&&$i&&ra(e),aa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));$i=vm(e)}else t===27?(t=$i,kp(e.type)?(e=_m,_m=null,$i=e):$i=t):$i=Qi?gm(e.stateNode.nextSibling):null;return!0}function sa(){$i=Qi=null,G=!1}function ca(){var e=ea;return e!==null&&(gd===null?gd=e:gd.push.apply(gd,e),ea=null),e}function la(e){ea===null?ea=[e]:ea.push(e)}var ua=ge(null),da=null,fa=null;function pa(e,t,n){ve(ua,t._currentValue),t._currentValue=n}function ma(e){e._currentValue=ua.current,_e(ua)}function ha(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ga(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ha(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ha(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ha(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function _a(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Ir(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&ga(t,e,n,r),t.flags|=262144,e!==null}function va(e){for(e=e.firstContext;e!==null;){if(!Ir(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ya(e){da=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ba(e){return Sa(da,e)}function xa(e,t){return da===null&&ya(e),Sa(e,t)}function Sa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},fa===null){if(e===null)throw Error(i(308));fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else fa=fa.next=t;return n}var Ca=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},wa=t.unstable_scheduleCallback,Ta=t.unstable_NormalPriority,Ea={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Da(){return{controller:new Ca,data:new Map,refCount:0}}function Oa(e){e.refCount--,e.refCount===0&&wa(Ta,function(){e.controller.abort()})}function ka(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Aa=null;function ja(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ma=null,Na=0,Pa=0,Fa=null;function Ia(e,t){if(Ma===null){var n=Ma=[];Na=0,Pa=zf(),Fa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Na++,t.then(La,La),t}function La(){if(--Na===0&&(Aa=null,Ma!==null)){Fa!==null&&(Fa.status=`fulfilled`);var e=Ma;Ma=null,Pa=0,Fa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ra(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var za=z.S;z.S=function(e,t){if(yd=Re(),typeof t==`object`&&t&&typeof t.then==`function`&&Ia(e,t),Aa!==null)for(var n=Tf;n!==null;)ka(n,Aa),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)ka(r,n),r=r.next;if(Pa!==0){r=Aa,r===null&&(r=Aa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}za!==null&&za(e,t)};var Ba=ge(null);function Va(){var e=Ba.current;return e===null?ed.pooledCache:e}function Ha(e,t){t===null?ve(Ba,Ba.current):ve(Ba,t.pool)}function Ua(){var e=Va();return e===null?null:{parent:Ea._currentValue,pool:e}}var Wa=Error(i(460)),Ga=Error(i(474)),Ka=Error(i(542)),qa={then:function(){}};function Ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(pn,pn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(pn,pn);else{if(e=ed,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e}throw Za=t,Wa}}function Xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Za=e,Wa):e}}var Za=null;function Qa(){if(Za===null)throw Error(i(459));var e=Za;return Za=null,e}function $a(e){if(e===Wa||e===Ka)throw Error(i(483))}var eo=null,to=0;function no(e){var t=to;return to+=1,eo===null&&(eo=[]),Ya(eo,e,t)}function ro(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function io(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ao(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ki(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ni(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),ro(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ne&&Xa(i)===t.type)?(t=a(t,n.props),ro(t,n),t.return=e,t):(t=ji(n.type,n.key,n.props,null,e.mode,r),ro(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=ji(t.type,t.key,t.props,null,e.mode,n),ro(n,t),n.return=e,n;case A:return t=Fi(t,e.mode,n),t.return=e,t;case ne:return t=Xa(t),f(e,t,n)}if(de(t)||ce(t))return t=Mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,no(t),n);if(t.$$typeof===F)return f(e,xa(e,t),n);io(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case ne:return n=Xa(n),p(e,t,n,r)}if(de(n)||ce(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,no(n),r);if(n.$$typeof===F)return p(e,t,xa(e,n),r);io(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ne:return r=Xa(r),m(e,t,n,r,i)}if(de(r)||ce(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,no(r),i);if(r.$$typeof===F)return m(e,t,n,xa(t,r),i);io(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),G&&qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return G&&qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),G&&qi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),G&&qi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return G&&qi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),G&&qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ro(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ne&&Xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ro(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Mi(o.props.children,e.mode,c,o.key),ro(c,o),c.return=e,e=c):(c=ji(o.type,o.key,o.props,null,e.mode,c),ro(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Fi(o,e.mode,c),c.return=e,e=c}return s(e);case ne:return o=Xa(o),_(e,r,o,c)}if(de(o))return h(e,r,o,c);if(ce(o)){if(l=ce(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,no(o),c);if(o.$$typeof===F)return _(e,r,xa(e,o),c);io(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{to=0;var i=_(e,t,n,r);return eo=null,i}catch(t){if(t===Wa||t===Ka)throw t;var a=Di(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var oo=ao(!0),so=ao(!1),co=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uo(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 fo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function po(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,$u&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=wi(e),Ci(e,null,n),t}return bi(e,r,t,n),wi(e)}function mo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}function ho(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var go=!1;function _o(){if(go){var e=Fa;if(e!==null)throw e}}function vo(e,t,n,r){go=!1;var i=e.updateQueue;co=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(nd&f)===f:(r&f)===f){f!==0&&f===Pa&&(go=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:co=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ud|=o,e.lanes=o,e.memoizedState=d}}function yo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function bo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)yo(n[e],t)}var xo=ge(null),So=ge(0);function Co(e,t){e=cd,ve(So,e),ve(xo,t),cd=e|t.baseLanes}function wo(){ve(So,cd),ve(xo,xo.current)}function To(){cd=So.current,_e(xo),_e(So)}var Eo=ge(null),Do=null;function Oo(e){var t=e.alternate;ve(No,No.current&1),ve(Eo,e),Do===null&&(t===null||xo.current!==null||t.memoizedState!==null)&&(Do=e)}function ko(e){ve(No,No.current),ve(Eo,e),Do===null&&(Do=e)}function Ao(e){e.tag===22?(ve(No,No.current),ve(Eo,e),Do===null&&(Do=e)):jo()}function jo(){ve(No,No.current),ve(Eo,Eo.current)}function Mo(e){_e(Eo),Do===e&&(Do=null),_e(No)}var No=ge(0);function Po(e,t){ve(Eo,Eo.current),ve(No,t)}function Fo(e){_e(No),_e(Eo),Do===e&&(Do=null)}function Io(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)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 Lo=0,K=null,Ro=null,zo=null,Bo=!1,Vo=!1,Ho=!1,Uo=0,Wo=0,Go=null,Ko=0;function qo(){throw Error(i(321))}function Jo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ir(e[n],t[n]))return!1;return!0}function Yo(e,t,n,r,i,a){return Lo=a,K=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?fc:pc,Ho=!1,a=n(r,i),Ho=!1,Vo&&(a=Zo(t,n,r,i)),Xo(e),a}function Xo(e){z.H=dc;var t=Ro!==null&&Ro.next!==null;if(Lo=0,zo=Ro=K=null,Bo=!1,Wo=0,Go=null,t)throw Error(i(300));e===null||Ac||(e=e.dependencies,e!==null&&va(e)&&(Ac=!0))}function Zo(e,t,n,r){K=e;var a=0;do{if(Vo&&(Go=null),Wo=0,Vo=!1,25<=a)throw Error(i(301));if(a+=1,zo=Ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}z.H=mc,o=t(n,r)}while(Vo);return o}function Qo(){var e=z.H,t=e.useState()[0];return t=typeof t.then==`function`?as(t):t,e=e.useState()[0],(Ro===null?null:Ro.memoizedState)!==e&&(K.flags|=1024),t}function $o(){var e=Uo!==0;return Uo=0,e}function es(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ts(e){if(Bo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Bo=!1}Lo=0,zo=Ro=K=null,Vo=!1,Wo=Uo=0,Go=null}function ns(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zo===null?K.memoizedState=zo=e:zo=zo.next=e,zo}function rs(){if(Ro===null){var e=K.alternate;e=e===null?null:e.memoizedState}else e=Ro.next;var t=zo===null?K.memoizedState:zo.next;if(t!==null)zo=t,Ro=e;else{if(e===null)throw K.alternate===null?Error(i(467)):Error(i(310));Ro=e,e={memoizedState:Ro.memoizedState,baseState:Ro.baseState,baseQueue:Ro.baseQueue,queue:Ro.queue,next:null},zo===null?K.memoizedState=zo=e:zo=zo.next=e}return zo}function is(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function as(e){var t=Wo;return Wo+=1,Go===null&&(Go=[]),e=Ya(Go,e,t),t=K,(zo===null?t.memoizedState:zo.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?fc:pc),e}function os(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return as(e);if(e.$$typeof===oe)return;if(e.$$typeof===F)return ba(e)}throw Error(i(438,String(e)))}function ss(e){var t=null,n=K.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=K.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=is(),K.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=R;return t.index++,n}function cs(e,t){return typeof t==`function`?t(e):t}function ls(e){return us(rs(),Ro,e)}function us(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Lo&f)===f:(nd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Pa&&(d=!0);else if((Lo&p)===p){u=u.next,p===Pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,K.lanes|=p,ud|=p;f=u.action,Ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,K.lanes|=f,ud|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Ir(o,e.memoizedState)&&(Ac=!0,d&&(n=Fa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ds(e){var t=rs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Ir(o,t.memoizedState)||(Ac=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function fs(e,t,n){var r=K,a=rs(),o=G;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Ir((Ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Ac=!0),a=a.queue,Ls(hs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||zo!==null&&!!(zo.memoizedState.tag&1),Ms(e?9:8,{destroy:void 0},ms.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ed===null)throw Error(i(349));o||Lo&127||ps(r,t,n)}return n}function ps(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=K.updateQueue,t===null?(t=is(),K.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ms(e,t,n,r){t.value=n,t.getSnapshot=r,gs(t)&&_s(e)}function hs(e,t,n){return n(function(){gs(t)&&_s(e)})}function gs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ir(e,n)}catch{return!0}}function _s(e){var t=Si(e,2);t!==null&&Rd(t,e,2)}function vs(e){var t=ns();if(typeof e==`function`){var n=e;if(e=n(),Ho){Ye(!0);try{n()}finally{Ye(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:e},t}function ys(e,t,n,r){return e.baseState=n,us(e,Ro,typeof r==`function`?r:cs)}function bs(e,t,n,r,a){if(cc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};z.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,xs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function xs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=z.T,o={};o.types=a===null?null:a.types,z.T=o;try{var s=n(i,r),c=z.S;c!==null&&c(o,s),Ss(e,t,s)}catch(n){ws(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),z.T=a}}else try{a=n(i,r),Ss(e,t,a)}catch(n){ws(e,t,n)}}function Ss(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Cs(e,t,n)},function(n){return ws(e,t,n)}):Cs(e,t,n)}function Cs(e,t,n){t.status=`fulfilled`,t.value=n,Ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,xs(e,n)))}function ws(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ts(t),t=t.next;while(t!==r)}e.action=null}function Ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Es(e,t){return t}function Ds(e,t){if(G){var n=ed.formState;if(n!==null){a:{var r=K;if(G){if($i){b:{for(var i=$i,a=ta;i.nodeType!==8;)if(!a||(i=gm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){$i=gm(i.nextSibling),r=i.data===`F!`;break a}}ra(r)}r=!1}r&&(t=n[0])}}return n=ns(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Es,lastRenderedState:t},n.queue=r,n=ac.bind(null,K,r),r.dispatch=n,r=vs(!1),a=sc.bind(null,K,!1,r.queue),r=ns(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=bs.bind(null,K,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Os(e){return ks(rs(),Ro,e)}function ks(e,t,n){if(t=us(e,t,Es)[0],e=ls(cs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=as(t)}catch(e){throw e===Wa?Ka:e}else r=t;t=rs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(K.flags|=2048,Ms(9,{destroy:void 0},As.bind(null,i,n),null)),[r,a,e]}function As(e,t){e.action=t}function js(e){var t=rs(),n=Ro;if(n!==null)return ks(t,n,e);rs(),t=t.memoizedState,n=rs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ms(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=K.updateQueue,t===null&&(t=is(),K.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ns(){return rs().memoizedState}function Ps(e,t,n,r){var i=ns();K.flags|=e,i.memoizedState=Ms(1|t,{destroy:void 0},n,r===void 0?null:r)}function Fs(e,t,n,r){var i=rs();r=r===void 0?null:r;var a=i.memoizedState.inst;Ro!==null&&r!==null&&Jo(r,Ro.memoizedState.deps)?i.memoizedState=Ms(t,a,n,r):(K.flags|=e,i.memoizedState=Ms(1|t,a,n,r))}function Is(e,t){Ps(8390656,8,e,t)}function Ls(e,t){Fs(2048,8,e,t)}function Rs(e){K.flags|=4;var t=K.updateQueue;if(t===null)t=is(),K.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zs(e){var t=rs().memoizedState;return Rs({ref:t,nextImpl:e}),function(){if($u&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Bs(e,t){return Fs(4,2,e,t)}function Vs(e,t){return Fs(4,4,e,t)}function Hs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Us(e,t,n){n=n==null?null:n.concat([e]),Fs(4,4,Hs.bind(null,t,e),n)}function Ws(){}function Gs(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Jo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ks(e,t){var n=rs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Jo(t,r[1]))return r[0];if(r=e(),Ho){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r}function qs(e,t,n){return n===void 0||Lo&1073741824&&!(nd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Id(),K.lanes|=e,ud|=e,n)}function Js(e,t,n,r){return Ir(n,t)?n:xo.current===null?!(Lo&106)||Lo&1073741824&&!(nd&261930)?(Ac=!0,e.memoizedState=n):(e=Id(),K.lanes|=e,ud|=e,t):(e=qs(e,n,r),Ir(e,t)||(Ac=!0),e)}function Ys(e,t,n,r,i){var a=fe.p;fe.p=a!==0&&8>a?a:8;var o=z.T,s={};s.types=o===null?null:o.types,z.T=s,sc(e,!1,t,n);try{var c=i(),l=z.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?oc(e,t,Ra(c,r),Fd(e)):oc(e,t,r,Fd(e))}catch(n){oc(e,t,{then:function(){},status:`rejected`,reason:n},Fd())}finally{fe.p=a,o!==null&&s.types!==null&&(o.types=s.types),z.T=o}}function Xs(){}function Zs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Qs(e).queue;Ys(e,a,t,pe,n===null?Xs:function(){return $s(e),n(r)})}function Qs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:pe,baseState:pe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:pe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function $s(e){var t=Qs(e);t.next===null&&(t=e.alternate.memoizedState),oc(e,t.next.queue,{},Fd())}function ec(){return ba(mh)}function tc(){return rs().memoizedState}function nc(){return rs().memoizedState}function rc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Fd();e=fo(n);var r=po(t,e,n);r!==null&&(Rd(r,t,n),mo(r,t,n)),t={cache:Da()},e.payload=t;return}t=t.return}}function ic(e,t,n){var r=Fd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},cc(e)?lc(t,n):(n=xi(e,t,n,r),n!==null&&(Rd(n,e,r),uc(n,t,r)))}function ac(e,t,n){oc(e,t,n,Fd())}function oc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(cc(e))lc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ir(s,o))return bi(e,t,i,0),ed===null&&yi(),!1}catch{}if(n=xi(e,t,i,r),n!==null)return Rd(n,e,r),uc(n,t,r),!0}return!1}function sc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},cc(e)){if(t)throw Error(i(479))}else t=xi(e,n,r,2),t!==null&&Rd(t,e,2)}function cc(e){var t=e.alternate;return e===K||t!==null&&t===K}function lc(e,t){Vo=Bo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ft(e,n)}}var dc={readContext:ba,use:os,useCallback:qo,useContext:qo,useEffect:qo,useImperativeHandle:qo,useLayoutEffect:qo,useInsertionEffect:qo,useMemo:qo,useReducer:qo,useRef:qo,useState:qo,useDebugValue:qo,useDeferredValue:qo,useTransition:qo,useSyncExternalStore:qo,useId:qo,useHostTransitionStatus:qo,useFormState:qo,useActionState:qo,useOptimistic:qo,useMemoCache:qo,useCacheRefresh:qo,useEffectEvent:qo},fc={readContext:ba,use:os,useCallback:function(e,t){return ns().memoizedState=[e,t===void 0?null:t],e},useContext:ba,useEffect:Is,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ps(4194308,4,Hs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){Ps(4,2,e,t)},useMemo:function(e,t){var n=ns();t=t===void 0?null:t;var r=e();if(Ho){Ye(!0);try{e()}finally{Ye(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ns();if(n!==void 0){var i=n(t);if(Ho){Ye(!0);try{n(t)}finally{Ye(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ic.bind(null,K,e),[r.memoizedState,e]},useRef:function(e){var t=ns();return e={current:e},t.memoizedState=e},useState:function(e){e=vs(e);var t=e.queue,n=ac.bind(null,K,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ws,useDeferredValue:function(e,t){return qs(ns(),e,t)},useTransition:function(){var e=vs(!1);return e=Ys.bind(null,K,e.queue,!0,!1),ns().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=K,a=ns();if(G){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ed===null)throw Error(i(349));nd&127||ps(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Is(hs.bind(null,r,o,e),[e]),r.flags|=2048,Ms(9,{destroy:void 0},ms.bind(null,r,o,n,t),null),n},useId:function(){var e=ns(),t=ed.identifierPrefix;if(G){var n=Ki,r=Gi;n=(r&~(1<<32-Xe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Uo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Ko++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ec,useFormState:Ds,useActionState:Ds,useOptimistic:function(e){var t=ns();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=sc.bind(null,K,!0,n),n.dispatch=t,[e,t]},useMemoCache:ss,useCacheRefresh:function(){return ns().memoizedState=rc.bind(null,K)},useEffectEvent:function(e){var t=ns(),n={impl:e};return t.memoizedState=n,function(){if($u&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},pc={readContext:ba,use:os,useCallback:Gs,useContext:ba,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ls,useRef:Ns,useState:function(){return ls(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){return Js(rs(),Ro.memoizedState,e,t)},useTransition:function(){var e=ls(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){return ys(rs(),Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs},mc={readContext:ba,use:os,useCallback:Gs,useContext:ba,useEffect:Ls,useImperativeHandle:Us,useInsertionEffect:Bs,useLayoutEffect:Vs,useMemo:Ks,useReducer:ds,useRef:Ns,useState:function(){return ds(cs)},useDebugValue:Ws,useDeferredValue:function(e,t){var n=rs();return Ro===null?qs(n,e,t):Js(n,Ro.memoizedState,e,t)},useTransition:function(){var e=ds(cs)[0],t=rs().memoizedState;return[typeof e==`boolean`?e:as(e),t]},useSyncExternalStore:fs,useId:tc,useHostTransitionStatus:ec,useFormState:js,useActionState:js,useOptimistic:function(e,t){var n=rs();return Ro===null?(n.baseState=e,[e,n.queue.dispatch]):ys(n,Ro,e,t)},useMemoCache:ss,useCacheRefresh:nc,useEffectEvent:zs};function hc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=fo(r);i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Rd(t,e,r),mo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fd(),i=fo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=po(e,i,r),t!==null&&(Rd(t,e,r),mo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fd(),r=fo(n);r.tag=2,t!=null&&(r.callback=t),t=po(e,r,n),t!==null&&(Rd(t,e,n),mo(t,e,n))}};function _c(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Lr(n,r)||!Lr(i,a):!0}function vc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&gc.enqueueReplaceState(t,t.state,null)}function yc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function bc(e){hi(e)}function xc(e){console.error(e)}function Sc(e){hi(e)}function Cc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function wc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Tc(e,t,n){return n=fo(n),n.tag=3,n.payload={element:null},n.callback=function(){Cc(e,t)},n}function Ec(e){return e=fo(e),e.tag=3,e}function Dc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){wc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){wc(t,n,r),typeof i!=`function`&&(Sd===null?Sd=new Set([this]):Sd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Oc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&_a(t,n,a,!0),n=Eo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Do===null?Xd():n.alternate===null&&ld===0&&(ld=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,a)),!1;case 22:return n.flags|=65536,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),yf(e,r,a)),!1}throw Error(i(435,n.tag))}return yf(e,r,a),Xd(),!1}if(G)return t=Eo.current,t===null?(r!==na&&(t=Error(i(423),{cause:r}),la(Li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Li(r,n),a=Tc(e.stateNode,r,a),ho(e,a),ld!==4&&(ld=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==na&&(e=Error(i(422),{cause:r}),la(Li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Li(o,n),hd===null?hd=[o]:hd.push(o),ld!==4&&(ld=2),t===null)return!0;r=Li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Tc(n.stateNode,r,e),ho(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Sd===null||!Sd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ec(a),Dc(a,e,n,r),ho(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var kc=Error(i(461)),Ac=!1;function jc(e,t,n,r){t.child=e===null?so(t,null,n,r):oo(t,e.child,n,r)}function Mc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ya(t),r=Yo(e,t,n,o,a,i),s=$o(),e!==null&&!Ac?(es(e,t,i),ol(e,t,i)):(G&&s&&Yi(t),t.flags|=1,jc(e,t,r,i),t.child)}function Nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Pc(e,t,a,r,i)):(e=ji(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!sl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Lr:n,n(o,r)&&e.ref===t.ref)return ol(e,t,i)}return t.flags|=1,e=ki(a,r),e.ref=t.ref,e.return=t,t.child=e}function Pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Lr(a,r)&&e.ref===t.ref){if(Ac=!1,t.pendingProps=r=a,sl(e,i))e.flags&131072&&(Ac=!0);else return t.lanes=e.lanes,ol(e,t,i)}}return Hc(e,t,n,r,i)}function Fc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ha(t,a===null?null:a.cachePool),a===null?wo():Co(t,a),Ao(t);else return r=t.lanes=536870912,Lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ha(t,null),wo(),jo()):(Ha(t,a.cachePool),Co(t,a),jo(),t.memoizedState=null);return jc(e,t,i,n),t.child}function Ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Lc(e,t,n,r,i){var a=Va();return a=a===null?null:{parent:Ea._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ha(t,null),wo(),Ao(t),e!==null&&_a(e,t,r,!0),t.childLanes=i,null}function Rc(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 zc(e,t,n){return oo(t,e.child,null,n),e=Rc(t,t.pendingProps),e.flags|=2,Mo(t),t.memoizedState=null,e}function Bc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(G){if(r.mode===`hidden`)return e=Rc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Ic(null,e);if(ko(t),(e=$i)?(e=fm(e,ta),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ra(t);return t.lanes=536870912,null}return Rc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(ko(t),a){if(t.flags&256)t.flags&=-257,t=zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Ac||_a(e,t,n,!1),a=(n&e.childLanes)!==0,Ac||a){if(xo.current===null){if(r=ed,r!==null&&(s=pt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Si(e,s),Rd(r,e,s),kc;Xd()}t=zc(e,t,n)}else e=o.treeContext,$i=gm(s.nextSibling),Qi=t,G=!0,ea=null,ta=!1,e!==null&&Zi(t,e),t=Rc(t,r),t.flags|=134221824;return t}return e=ki(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Hc(e,t,n,r,i){return ya(t),n=Yo(e,t,n,r,void 0,i),r=$o(),e!==null&&!Ac?(es(e,t,i),ol(e,t,i)):(G&&r&&Yi(t),t.flags|=1,jc(e,t,n,i),t.child)}function Uc(e,t,n,r,i,a){return ya(t),t.updateQueue=null,n=Zo(t,r,n,i),Xo(e),r=$o(),e!==null&&!Ac?(es(e,t,a),ol(e,t,a)):(G&&r&&Yi(t),t.flags|=1,jc(e,t,n,a),t.child)}function Wc(e,t,n,r,i){if(ya(t),t.stateNode===null){var a=Ti,o=n.contextType;typeof o==`object`&&o&&(a=ba(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=gc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},lo(t),o=n.contextType,a.context=typeof o==`object`&&o?ba(o):Ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(hc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&gc.enqueueReplaceState(a,a.state,null),vo(t,r,a,i),_o(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=yc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ti,typeof u==`object`&&u&&(o=ba(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&vc(t,a,r,o),co=!1;var f=t.memoizedState;a.state=f,vo(t,r,a,i),_o(),l=t.memoizedState,s||f!==l||co?(typeof d==`function`&&(hc(t,n,d,r),l=t.memoizedState),(c=co||_c(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,uo(e,t),o=t.memoizedProps,u=yc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ti,typeof l==`object`&&l&&(c=ba(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&vc(t,a,r,c),co=!1,f=t.memoizedState,a.state=f,vo(t,r,a,i),_o();var p=t.memoizedState;o!==d||f!==p||co||e!==null&&e.dependencies!==null&&va(e.dependencies)?(typeof s==`function`&&(hc(t,n,s,r),p=t.memoizedState),(u=co||_c(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&va(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Vc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=oo(t,e.child,null,i),t.child=oo(t,null,n,i)):jc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ol(e,t,i),e}function Gc(e,t,n,r){return sa(),t.flags|=256,jc(e,t,n,r),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Ua()}}function Jc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=pd),e}function Yc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(No.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(G){if(i?Oo(t):jo(),(e=$i)?(e=fm(e,ta),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wi===null?null:{id:Gi,overflow:Ki},retryLane:536870912,hydrationErrors:null},n=Pi(e),n.return=t,t.child=n,Qi=t,$i=null)):e=null,e===null)throw ra(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(jo(),i=t.mode,a=Zc({mode:`hidden`,children:a},i),r=Mi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=qc(n),r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(null,r)):(Oo(t),Xc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return $c(e,t,a,o,r,c,s,n)}return i?(jo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=ki(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Mi(i,a,n,null),i.flags|=2):i=ki(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Ic(null,r),r=t.child,i=e.child.memoizedState,i===null?i=qc(n):(a=i.cachePool,a===null?a=Ua():(s=Ea._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Jc(e,o,n),t.memoizedState=Kc,Ic(e.child,r)):(Oo(t),n=e.child,e=n.sibling,n=ki(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function Xc(e,t){return t=Zc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=Di(22,e,null,t),e.lanes=0,e}function Qc(e,t,n){return oo(t,e.child,null,n),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $c(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Oo(t),t.flags&=-257,Qc(e,t,c)):t.memoizedState===null?(jo(),o=a.fallback,s=t.mode,a=Zc({mode:`visible`,children:a.children},s),o=Mi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,oo(t,e.child,null,c),a=t.child,a.memoizedState=qc(c),a.childLanes=Jc(e,r,c),t.memoizedState=Kc,Ic(null,a)):(jo(),t.child=e.child,t.flags|=128,null);if(Oo(t),mm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,la({value:a,source:null,stack:null})),Qc(e,t,c)}if(Ac||_a(e,t,c,!1),r=(c&e.childLanes)!==0,Ac||r){if(xo.current!==null)return Qc(e,t,c);if(r=ed,r!==null&&(a=pt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Si(e,a),Rd(r,e,a),kc;return pm(o)||Xd(),Qc(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,$i=gm(o.nextSibling),Qi=t,G=!0,ea=null,ta=!1,e!==null&&Zi(t,e),t=Xc(t,a.children),t.flags|=134221824,t)}function el(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ha(e.return,t,n)}function tl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Io(n)===null&&(t=e),e=e.sibling}return t}function nl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function rl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function il(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=No.current;if(t.flags&128)return Po(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Po(t,o),i===`backwards`&&e!==null?(rl(e),jc(e,t,r,n),rl(e)):jc(e,t,r,n),r=G?Vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&el(e,n,t);else if(e.tag===19)el(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,rl(t)),nl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Io(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}nl(t,!0,n,null,a,r);break;case`together`:nl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=tl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),nl(t,!1,i,n,a,r)}return t.child}function al(e,t,n){var r=t.pendingProps;return pa(t,t.type,r.value),jc(e,t,r.children,n),t.child}function ol(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ud|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(_a(e,t,n,!1),(n&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,n=ki(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ki(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&va(e)))}function cl(e,t,n){switch(t.tag){case 3:Ce(t,t.stateNode.containerInfo),pa(t,Ea,e.memoizedState.cache),sa();break;case 27:case 5:Te(t);break;case 4:Ce(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ko(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Oo(t),t.flags|=128,null;r=_a(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Yc(e,t,n):(Oo(t),e=ol(e,t,n),e===null?null:e.sibling)}Oo(t);break;case 19:if(t.flags&128)return il(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(_a(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return il(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Po(t,No.current),r)break;return null;case 22:return t.lanes=0,Fc(e,t,n,t.pendingProps);case 24:pa(t,Ea,e.memoizedState.cache)}return ol(e,t,n)}function ll(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Ac=!0;else{if(!sl(e,n)&&!(t.flags&128))return Ac=!1,cl(e,t,n);Ac=!!(e.flags&131072)}}else Ac=!1,G&&t.flags&1048576&&Ji(t,Vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Xa(t.elementType),t.type=e,typeof e==`function`)Oi(e)?(r=yc(e,r),t.tag=1,t=Wc(null,t,e,r,n)):(t.tag=0,t=Hc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===I){t.tag=11,t=Mc(null,t,e,r,n);break a}if(a===L){t.tag=14,t=Nc(null,t,e,r,n);break a}if(a===F){t.tag=10,t.type=e,t=al(null,t,n);break a}}throw t=ue(e)||e,Error(i(306,t,``))}}return t;case 0:return Hc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=yc(r,t.pendingProps),Wc(e,t,r,a,n);case 3:a:{if(Ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,uo(e,t),vo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,pa(t,Ea,r),r!==o.cache&&ga(t,[Ea],n,!0),_o(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Gc(e,t,r,n);break a}if(r!==a){a=Li(Error(i(424)),t),la(a),t=Gc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for($i=gm(e.firstChild),Qi=t,G=!0,ea=null,ta=!0,n=so(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(sa(),r===a){t=ol(e,t,n);break a}jc(e,t,r,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:G||(t.stateNode=yp(t.type,t.pendingProps,xe.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Te(t),e===null&&G&&(r=t.stateNode=Sm(t.type,t.pendingProps,xe.current),Qi=t,ta=!0,a=$i,kp(t.type)?(_m=a,$i=gm(r.firstChild)):$i=a),jc(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&G&&((a=r=$i)&&(r=um(r,t.type,t.pendingProps,ta),r===null?a=!1:(t.stateNode=r,Qi=t,$i=gm(r.firstChild),ta=!1,a=!0)),a||ra(t)),Te(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,bp(a,o)?r=null:s!==null&&bp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Yo(e,t,Qo,null,null,n),mh._currentValue=a),Vc(e,t),jc(e,t,r,n),t.child;case 6:return e===null&&G&&((e=n=$i)&&(n=dm(n,t.pendingProps,ta),n===null?e=!1:(t.stateNode=n,Qi=t,$i=null,e=!0)),e||ra(t)),null;case 13:return Yc(e,t,n);case 4:return Ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=oo(t,null,r,n):jc(e,t,r,n),t.child;case 11:return Mc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Vc(e,t),jc(e,t,r,n),t.child;case 8:return jc(e,t,t.pendingProps.children,n),t.child;case 12:return jc(e,t,t.pendingProps.children,n),t.child;case 10:return al(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ya(t),a=ba(a),r=r(a),t.flags|=1,jc(e,t,r,n),t.child;case 14:return Nc(e,t,t.type,t.pendingProps,n);case 15:return Pc(e,t,t.type,t.pendingProps,n);case 19:return il(e,t,n);case 31:return Bc(e,t,n);case 22:return Fc(e,t,n,t.pendingProps);case 24:return ya(t),r=ba(Ea),e===null?(a=Va(),a===null&&(a=ed,o=Da(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},lo(t),pa(t,Ea,a)):((e.lanes&n)!==0&&(uo(e,t),vo(t,null,null,n),_o()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,pa(t,Ea,r),r!==a.cache&&ga(t,[Ea],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),pa(t,Ea,r))),jc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:G&&Yi(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Vc(e,t),jc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function ul(e){e.flags|=4}function dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw Za=qa,Ga}}else e.flags&=-16777217}function fl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(qd())e.flags|=8192;else throw Za=qa,Ga}}function pl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:st(),e.lanes|=t,md|=t)}function ml(e,t){if(!G)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function hl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gl(e,t,n){var r=t.pendingProps;switch(Xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hl(t),null;case 1:return hl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ma(Ea),we(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(oa(t)?ul(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ca())),hl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(ul(t),o===null?(hl(t),dl(t,a,null,r,n)):(hl(t),fl(t,o))):o?o===e.memoizedState?(hl(t),t.flags&=-16777217):(ul(t),hl(t),fl(t,o)):(e=e.memoizedProps,e!==r&&ul(t),hl(t),dl(t,a,e,r,n)),null;case 27:if(B(t),n=xe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}e=ye.current,oa(t)?ia(t,e):(e=Sm(a,r,n),t.stateNode=e,ul(t))}return hl(t),t.subtreeFlags&=-33554433,null;case 5:if(B(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hl(t),t.subtreeFlags&=-33554433,null}if(o=ye.current,oa(t))ia(t,o);else{var s=gp(xe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[yt]=t,o[bt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(lp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ul(t)}}return hl(t),t.subtreeFlags&=-33554433,dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ul(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=xe.current,oa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Qi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[yt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||op(e.nodeValue,n)),e||ra(t,!0)}else e=gp(e).createTextNode(r),e[yt]=t,t.stateNode=e}return hl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=oa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[yt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),e=!1}else n=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Mo(t),t):(Mo(t),null);if(t.flags&128)throw Error(i(558))}return hl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=oa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[yt]=t}else sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hl(t),a=!1}else a=ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Mo(t),t):(Mo(t),null)}return Mo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),pl(t,t.updateQueue),hl(t),null);case 4:return we(),e===null&&Xf(t.stateNode.containerInfo),t.flags|=67108864,hl(t),null;case 10:return ma(t.type),hl(t),null;case 19:if(Fo(t),r=t.memoizedState,r===null)return hl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)ml(r,!1);else{if(ld!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Io(e),o!==null){for(t.flags|=128,ml(r,!1),e=o.updateQueue,t.updateQueue=e,pl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ai(n,e),n=n.sibling;return Po(t,No.current&1|2),G&&qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Re()>bd&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Io(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,pl(t,e),ml(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!G)return hl(t),null}else 2*Re()-r.renderingStartTime>bd&&n!==536870912&&(t.flags|=128,a=!0,ml(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Re(),e.sibling=null,o=No.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||G?Po(t,o):(n=o,ve(Eo,t),ve(No,n),Do===null&&(Do=t)),G&&qi(t,r.treeForkCount),e}return hl(t),null;case 22:case 23:return Mo(t),To(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(hl(t),t.subtreeFlags&6&&(t.flags|=8192)):hl(t),n=t.updateQueue,n!==null&&pl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&_e(Ba),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ma(Ea),hl(t),null;case 25:return null;case 30:return t.flags|=33554432,hl(t),null}throw Error(i(156,t.tag))}function _l(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ma(Ea),we(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return B(t),null;case 31:if(t.memoizedState!==null){if(Mo(t),t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Mo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fo(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 we(),null;case 10:return ma(t.type),null;case 22:case 23:return Mo(t),To(),e!==null&&_e(Ba),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ma(Ea),null;case 25:return null;default:return null}}function vl(e,t){switch(Xi(t),t.tag){case 3:ma(Ea),we();break;case 26:case 27:case 5:B(t);break;case 4:we();break;case 31:t.memoizedState!==null&&Mo(t);break;case 13:Mo(t);break;case 19:Fo(t);break;case 10:ma(t.type);break;case 22:case 23:Mo(t),To(),e!==null&&_e(Ba);break;case 24:ma(Ea)}}function yl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){vf(t,t.return,e)}}function bl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function xl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{bo(t,n)}catch(t){vf(e,e.return,t)}}}function Sl(e,t,n){n.props=yc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function Cl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=fi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Vp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Hp(e);f(e.child,!1,am,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){vf(e,t,n)}}function wl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){vf(e,t,n)}else n.current=null}}function Tl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)sm(e.stateNode,t[n])}function El(e){for(var t=e.return;t!==null&&(kl(t)&&sm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Dl(e){for(var t=e.return;t!==null&&(kl(t)&&cm(e.stateNode,t.stateNode),!Ol(t));)t=t.return}function Ol(e){return e.tag===5||e.tag===3||e.tag===27}function kl(e){return e&&e.tag===7&&e.stateNode!==null}function Al(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){vf(e,e.return,t)}}function jl(e,t,n){try{var r=e.stateNode;dp(r,e.type,n,t),r[bt]=t}catch(t){vf(e,e.return,t)}}function Ml(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&kp(e.type)||e.tag===4}function Nl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ml(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&&kp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Pl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pn)),Tl(e,r),U=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,kp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Pl(e,t,n,r),e=e.sibling;e!==null;)Pl(e,t,n,r),e=e.sibling}function Fl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Tl(e,r),U=!0;else if(i!==4&&(i===27&&(Tl(e,r),r=null,kp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Fl(e,t,n,r),e=e.sibling;e!==null;)Fl(e,t,n,r),e=e.sibling}function Il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lp(t,r,n),t[yt]=e,t[bt]=n}catch(t){vf(e,e.return,t)}}var Ll=!1,Rl=null;function zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Ll=!0)}var Bl=null;function Vl(){var e=Bl;return Bl=null,e}var Hl=0;function Ul(e,t,n,r,i){return Hl=0,Wl(e.child,t,n,r,i)}function Wl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Fp(o);r.push(s),s.view&&(a=!0)}else a||Fp(o).view&&(a=!0);Ll=!0,Mp(o,Hl===0?t:t+`_`+Hl,n),Hl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Wl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Gl(e,t){for(;e!==null;)e.tag===5?Np(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Gl(e.child,t),e=e.sibling}function Kl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Kl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=mi(t.default,t.share),t!==`none`&&(Ul(e,n,t,null,!1)||Gl(e.child,!1))}e=e.sibling}}function ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=fi(r,n),a=mi(r.default,n.paired?r.share:r.enter);a===`none`?Kl(e):Ul(e,i,a,null,!1)?(Kl(e),n.paired||t||Ld(e,r.onEnter)):Gl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ql(e,t),e=e.sibling;else Kl(e)}function Jl(e){if(Rl!==null&&Rl.size!==0){var t=Rl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=mi(n.default,n.share);if(a!==`none`&&(Ul(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ld(e,n.onShare)):Gl(e.child,!1)),t.delete(r),t.size===0)break}}}Jl(e)}e=e.sibling}}}function Yl(e){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode),r=Rl===null?void 0:Rl.get(n),i=mi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Ul(e,n,i,null,!1)?r===void 0?Ld(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Rl.delete(n),Ld(e,t.onShare)):Gl(e.child,!1)),Rl!==null&&Jl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Rl!==null&&Jl(e)}function Xl(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=fi(t,e.stateNode);t=mi(t.default,t.update),e.flags&=-5,t!==`none`&&Ul(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&Xl(e);e=e.sibling}}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Gl(e.child,!1))}Zl(e)}e=e.sibling}}function Ql(e){if(e.tag===30)e.stateNode.paired=null,Gl(e.child,!1),Zl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Zl(e)}function $l(e){for(e=e.child;e!==null;)e.tag===30?Gl(e.child,!1):e.subtreeFlags&33554432&&$l(e),e=e.sibling}function eu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Hl<a.length){var l=a[Hl],u=Fp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Mp(c,Hl===0?n:n+`_`+Hl,i),s&&e.flags&4||(Bl===null&&(Bl=[]),Bl.push(c,Hl===0?r:r+`_`+Hl,t.memoizedProps)),Hl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:eu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function tu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=fi(n,r),a=mi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ip)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Hl=0,i=eu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ld(e,n.onUpdate))}else e.subtreeFlags&33554432&&tu(e,t);e=e.sibling}}var nu=!1,ru=!1,iu=!1,au=!1,ou=typeof WeakSet==`function`?WeakSet:Set,su=null,cu=!1,lu=!1,uu=!1,du=!1;function fu(e,t,n){if(e=e.containerInfo,mp=Ch,e=Hr(e),Ur(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(hp={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,su=t,t=n?9270:1024;su!==null;){if(e=su,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Yl(r[a]);if(e.alternate===null&&e.flags&2)n&&zl(e),pu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Yl(r),pu(n);continue}if(r!==null&&r.memoizedState!==null){n&&zl(e),pu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,su=r):(n&&Xl(e),pu(n))}}Rl=null}function pu(e){for(;su!==null;){var t=su,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=yc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=fi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=mi(a.default,a.update),a!==`none`&&Ul(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,su=r;break}su=t.return}}function mu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pu(e,n),r&4&&yl(5,n);break;case 1:if(Pu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=yc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&xl(n),r&512&&Cl(n,n.return);break;case 3:if(Pu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{bo(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Il(n);case 26:case 5:Pu(e,n),t===null&&r&4&&Al(n),r&512&&Cl(n,n.return);break;case 12:Pu(e,n);break;case 31:Pu(e,n),r&4&&Cu(e,n);break;case 13:Pu(e,n),r&4&&wu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||nu,!r){var a=t!==null&&t.memoizedState!==null||ru;t=nu,i=ru,nu=r,(ru=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Iu(e,n,r)):Pu(e,n),nu=t,ru=i}break;case 30:Pu(e,n),r&512&&Cl(n,n.return);break;case 7:r&512&&Cl(n,n.return);default:Pu(e,n)}}function hu(e,t){for(e=e.child;e!==null;)gu(e,t),e=e.sibling}function gu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){vf(e,e.return,t)}_u(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,U=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?jp(s,!0):jp(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&hu(e,t);break;default:hu(e,t)}}function _u(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:gu(n,r);break a;case 22:n.memoizedState===null&&_u(n,r);break a;default:_u(n,r)}}e=e.sibling}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ot(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 yu=null,bu=!1;function xu(e,t,n){for(n=n.child;n!==null;)Su(e,t,n),n=n.sibling}function Su(e,t,n){if(Je&&typeof Je.onCommitFiberUnmount==`function`)try{Je.onCommitFiberUnmount(qe,n)}catch{}switch(n.tag){case 26:ru||wl(n,t),xu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!ru&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ru||wl(n,t),Dl(n);var r=yu,i=bu;kp(n.type)&&(yu=n.stateNode,bu=!1),xu(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),yu=r,bu=i;break;case 5:ru||wl(n,t),Dl(n);case 6:if(n.tag===6&&Dl(n),r=yu,i=bu,yu=null,xu(e,t,n),yu=r,bu=i,yu!==null){if(bu)try{(yu.nodeType===9?yu.body:yu.nodeName===`HTML`?yu.ownerDocument.body:yu).removeChild(n.stateNode),U=!0}catch(e){vf(n,t,e)}else try{yu.removeChild(n.stateNode),U=!0}catch(e){vf(n,t,e)}}break;case 18:yu!==null&&(bu?(e=yu,Ap(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Yh(e)):Ap(yu,n.stateNode));break;case 4:r=yu,i=bu,yu=n.stateNode.containerInfo,bu=!0,xu(e,t,n),yu=r,bu=i;break;case 0:case 11:case 14:case 15:bl(2,n,t),ru||bl(4,n,t),xu(e,t,n);break;case 1:ru||(wl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Sl(n,t,r)),xu(e,t,n);break;case 21:xu(e,t,n);break;case 22:ru=(r=ru)||n.memoizedState!==null,xu(e,t,n),ru=r;break;case 30:wl(n,t),xu(e,t,n);break;case 7:ru||wl(n,t),xu(e,t,n);break;default:xu(e,t,n)}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yh(e)}catch(e){vf(t,t.return,e)}}}function wu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yh(e)}catch(e){vf(t,t.return,e)}}function Tu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ou),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ou),t;default:throw Error(i(435,e.tag))}}function Eu(e,t){var n=Tu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Du(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(kp(l.type)){yu=l.stateNode,bu=!1;break a}break;case 5:yu=l.stateNode,bu=!1;break a;case 3:case 4:yu=l.stateNode.containerInfo,bu=!0;break a}l=l.return}if(yu===null)throw Error(i(160));Su(s,c,o),yu=null,bu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ku(t,e,n),t=t.sibling}var Ou=null;function ku(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Du(t,e,n),Au(e),a&4&&(bl(3,e,e.return),yl(3,e),bl(5,e,e.return));break;case 1:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),a&64&&nu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Ou,Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(nu)e.stateNode=yp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Et]||r[yt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),lp(r,t,n),r[yt]=e,Mt(r),t=r;break a;case`link`:if(o=Qm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Qm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),lp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[yt]=e,Mt(r),t=r}e.stateNode=t}}else nu||$m(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&jl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||ru||t.parentNode.removeChild(t)):a.count--,n===null?nu||$m(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:Du(t,e,n),Au(e),a&512&&(ru||r===null||wl(r,r.return)),r!==null&&a&4&&jl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=iu,iu=!1,Du(t,e,n),iu=o,Au(e),a&512&&(ru||r===null||wl(r,r.return)),e.flags&32){t=e.stateNode;try{an(t,``),U=!0}catch(t){vf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,jl(e,t,r===null?t:r.memoizedProps)),a&1024&&(au=!0);break;case 6:if(Du(t,e,n),Au(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,U=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(U=!1,Zm=null,o=Ou,Ou=Dm(t.containerInfo),Du(t,e,n),Ou=o,Au(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Yh(t.containerInfo)}catch(t){vf(e,e.return,t)}au&&(au=!1,ju(e)),U=!1;break;case 4:a=iu,iu=nu,r=Ht(),o=Ou,Ou=Dm(e.stateNode.containerInfo),Du(t,e,n),Au(e),Ou=o,U&&lu&&(uu=!0),U=r,iu=a;break;case 12:Du(t,e,n),Au(e);break;case 31:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 13:Du(t,e,n),Au(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vd=Re()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=nu,l=ru,u=iu;nu=c||o,iu=u||o,ru=l||s,Du(t,e,n),ru=l,iu=u,nu=c,Au(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||nu||ru||(t=s||ru,n=nu,r=ru,nu=o||nu,ru=t,Fu(e,2),nu=n,ru=r),!o&&iu||hu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Eu(e,n))));break;case 19:Du(t,e,n),Au(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Eu(e,t)));break;case 30:a&512&&(ru||r===null||wl(r,r.return)),a=Ht(),o=lu,s=(n&335544064)===n,c=e.memoizedProps,lu=s&&mi(c.default,c.update)!==`none`,Du(t,e,n),Au(e),s&&r!==null&&U&&(e.flags|=4),lu=o,U=a;break;case 21:break;case 7:a&512&&(ru||r===null||wl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Du(t,e,n),Au(e)}}function Au(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ml(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(kl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ol(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Fl(e,Nl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(an(l,``),n.flags&=-33),Fl(e,Nl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Pl(e,Nl(e),u,s);break;default:throw Error(i(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ju(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ju(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Mu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Nu(t,e),t=t.sibling;else tu(t,!1)}function Nu(e,t){var n=e.alternate;if(n===null)ql(e,!1);else switch(e.tag){case 3:if(du=cu=!1,Vl(),Mu(t,e),!cu&&!uu){if(e=Bl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Np(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}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`})),du=!0}Bl=null;break;case 5:Mu(t,e);break;case 4:r=cu,cu=!1,Mu(t,e),cu&&(uu=!0),cu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Mu(t,e):ql(e,!1));break;case 30:r=cu,i=Vl(),cu=!1,Mu(t,e),cu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=fi(a,o),o=fi(n.memoizedProps,o);var s=mi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Hl=0,t=eu(e,n,t,o,s,a,!0),Hl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ld(e,e.memoizedProps.onUpdate),Bl=i):i!==null&&(i.push.apply(i,Bl),Bl=i),cu=e.flags&32?!0:r;break;default:Mu(t,e)}}function Pu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mu(e,t.alternate,t),t=t.sibling}function Fu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:bl(4,n,n.return),Fu(n,r);break;case 1:wl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Sl(n,n.return,i),Fu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:wl(n,n.return),n.tag!==5&&n.tag!==27||Dl(n),Fu(n,r);break;case 6:Dl(n);break;case 26:wl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||ru||i.parentNode.removeChild(i),Fu(n,r);break;case 22:n.memoizedState===null&&Fu(n,r);break;case 30:wl(n,n.return),Fu(n,r);break;case 7:wl(n,n.return);default:Fu(n,r)}e=e.sibling}}function Iu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Iu(i,a,n),yl(4,a);break;case 1:if(Iu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)yo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&xl(a),Cl(a,a.return);break;case 27:n&2&&Il(a);case 5:a.tag!==5&&a.tag!==27||El(a),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 6:El(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||nu||$m(Dm(c.ownerDocument),a.type,c),Iu(i,a,n),s&&r===null&&o&4&&Al(a),Cl(a,a.return);break;case 12:Iu(i,a,n);break;case 31:Iu(i,a,n),s&&o&4&&Cu(i,a);break;case 13:Iu(i,a,n),s&&o&4&&wu(i,a);break;case 22:a.memoizedState===null&&Iu(i,a,n),Cl(a,a.return);break;case 30:Iu(i,a,n),Cl(a,a.return);break;case 7:Cl(a,a.return);default:Iu(i,a,n)}t=t.sibling}}function Lu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Oa(n))}function Ru(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oa(e))}function zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Bu(e,t,n,r),t=t.sibling;else i&&$l(t)}function Bu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Ql(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:zu(e,t,n,r),a&2048&&yl(9,t);break;case 1:zu(e,t,n,r);break;case 3:zu(e,t,n,r),i&&du&&(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=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Oa(a)));break;case 12:if(a&2048){zu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){vf(t,t.return,e)}}else zu(e,t,n,r);break;case 31:zu(e,t,n,r);break;case 13:zu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Ql(t),o._visibility&2?zu(e,t,n,r):(o._visibility|=2,Vu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Ql(s),o._visibility&2?zu(e,t,n,r):Hu(e,t)),a&2048&&Lu(s,t);break;case 24:zu(e,t,n,r),a&2048&&Ru(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Gl(a.child,!0),Gl(t.child,!0))),zu(e,t,n,r);break;default:zu(e,t,n,r)}}function Vu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Vu(a,o,s,c,i),yl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Vu(a,o,s,c,i)):u._visibility&2?Vu(a,o,s,c,i):Hu(a,o),i&&l&2048&&Lu(o.alternate,o);break;case 24:Vu(a,o,s,c,i),i&&l&2048&&Ru(o.alternate,o);break;default:Vu(a,o,s,c,i)}t=t.sibling}}function Hu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Hu(n,r),i&2048&&Lu(r.alternate,r);break;case 24:Hu(n,r),i&2048&&Ru(r.alternate,r);break;default:Hu(n,r)}t=t.sibling}}var Uu=8192;function Wu(e,t,n){if(e.subtreeFlags&Uu)for(e=e.child;e!==null;)Gu(e,t,n),e=e.sibling}function Gu(e,t,n){switch(e.tag){case 26:Wu(e,t,n),e.flags&Uu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,Ou,e.memoizedState,e.memoizedProps));break;case 5:Wu(e,t,n),e.flags&Uu&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=Ou;Ou=Dm(e.stateNode.containerInfo),Wu(e,t,n),Ou=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Uu,Uu=16777216,Wu(e,t,n),Uu=r):Wu(e,t,n));break;case 30:if((e.flags&Uu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Rl===null&&(Rl=new Map),Rl.set(r,i)}Wu(e,t,n);break;default:Wu(e,t,n)}}function Ku(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 qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ju(e),e=e.sibling}function Ju(e){switch(e.tag){case 0:case 11:case 15:qu(e),e.flags&2048&&bl(9,e,e.return);break;case 3:qu(e);break;case 12:qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):qu(e);break;default:qu(e)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];su=r,Xu(r,e)}Ku(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bl(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function Xu(e,t){for(;su!==null;){var n=su;switch(n.tag){case 0:case 11:case 15:bl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Oa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,su=r;else a:for(n=e;su!==null;){r=su;var i=r.sibling,a=r.return;if(vu(r),r===n){su=null;break a}if(i!==null){i.return=a,su=i;break a}su=a}}}var Zu={getCacheForType:function(e){var t=ba(Ea),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ba(Ea).controller.signal}},Qu=typeof WeakMap==`function`?WeakMap:Map,$u=0,ed=null,td=null,nd=0,rd=0,id=null,ad=!1,od=!1,sd=!1,cd=0,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=null,gd=null,_d=!1,vd=0,yd=0,bd=1/0,xd=null,Sd=null,Cd=0,wd=null,Td=null,Ed=0,Dd=0,Od=null,kd=null,Ad=null,jd=null,Md=null,Nd=0,Pd=null;function Fd(){return $u&2&&nd!==0?nd&-nd:z.T===null?gt():zf()}function Id(){if(pd===0){if(!(nd&536870912)||G){var e=tt;tt<<=1,!(tt&3932160)&&(tt=262144),pd=e}else pd=536870912}return e=Eo.current,e!==null&&(e.flags|=32),pd}function Ld(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Vp(fi(e.memoizedProps,n))),jd===null&&(jd=[]),jd.push(t.bind(null,r))}}function Rd(e,t,n){(e===ed&&(rd===2||rd===9)||e.cancelPendingCommit!==null)&&(Gd(e,0),Hd(e,nd,pd,!1)),lt(e,n),$u&2&&e===ed||(e===ed&&(!($u&2)&&(dd|=n),ld===4&&Hd(e,nd,pd,!1)),jf(e))}function zd(e,t,n){if($u&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||it(e,t),a=r?$d(e,t):Zd(e,t,!0),o=r;do{if(a===0){od&&!r&&Hd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Vd(n))a=Zd(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=hd;var l=c.current.memoizedState.isDehydrated;if(l&&(Gd(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(sd&&!l){c.errorRecoveryDisabledLanes|=o,dd|=o,a=4;break a}o=gd,gd=a,o!==null&&(gd===null?gd=o:gd.push.apply(gd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Gd(e,0),Hd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Hd(r,t,pd,!ad);break a;case 2:gd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=vd+300-Re(),10<a)){if(Hd(r,t,pd,!ad),V(r,0,!0)!==0)break a;Ed=t,r.timeoutHandle=Cp(Bd.bind(null,r,n,gd,xd,_d,t,pd,dd,md,ad,o,`Throttled`,-0,0),a);break a}Bd(r,n,gd,xd,_d,t,pd,dd,md,ad,o,null,-0,0)}break}}while(1);jf(e)}function Bd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pn},Rl=null,Gu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?vd-Re():(a&4194048)===a?yd-Re():0,m=sh(d,m),m!==null)?(Ed=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Hd(e,a,o,!l)):sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Vd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Ir(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Hd(e,t,n,r){t=at(e,t),t&=~fd,t&=~dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Xe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&dt(e,n,t)}function Ud(){return $u&6?!0:(Mf(0,!1),!1)}function Wd(){if(td!==null){if(rd===0)var e=td.return;else e=td,fa=da=null,ts(e),eo=null,to=0,e=td;for(;e!==null;)vl(e.alternate,e),e=e.return;td=null}}function Gd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,wp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ed=0,Wd(),ed=e,td=n=ki(e.current,null),nd=t,rd=0,id=null,ad=!1,od=it(e,t),sd=!1,md=pd=fd=dd=ud=ld=0,gd=hd=null,_d=!1,cd=at(e,t),yi(),n}function Kd(e,t){K=null,z.H=dc,t===Wa||t===Ka?(t=Qa(),rd=3):t===Ga?(t=Qa(),rd=4):rd=t===kc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,id=t,td===null&&(ld=1,Cc(e,Li(t,e.current)))}function qd(){var e=Eo.current;return e===null?!0:(nd&4194048)===nd?Do===null:(nd&62914560)===nd||nd&536870912?e===Do:!1}function Jd(){var e=z.H;return z.H=dc,e===null?dc:e}function Yd(){var e=z.A;return z.A=Zu,e}function Xd(){ld=4,ad||(nd&4194048)!==nd&&Eo.current!==null||(od=!0),!(ud&134217727)&&!(dd&134217727)||ed===null||Hd(ed,nd,pd,!1)}function Zd(e,t,n){var r=$u;$u|=2;var i=Jd(),a=Yd();(ed!==e||nd!==t)&&(xd=null,Gd(e,t)),t=!1;var o=ld;a:do try{if(rd!==0&&td!==null){var s=td,c=id;switch(rd){case 8:Wd(),o=6;break a;case 3:case 2:case 9:case 6:Eo.current===null&&(t=!0);var l=rd;if(rd=0,id=null,rf(e,s,c,l),n&&od){o=0;break a}break;default:l=rd,rd=0,id=null,rf(e,s,c,l)}}Qd(),o=ld;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,fa=da=null,$u=r,z.H=i,z.A=a,td===null&&(ed=null,nd=0,yi()),o}function Qd(){for(;td!==null;)tf(td)}function $d(e,t){var n=$u;$u|=2;var r=Jd(),a=Yd();ed!==e||nd!==t?(xd=null,bd=Re()+500,Gd(e,t)):od=it(e,t);a:do try{if(rd!==0&&td!==null){t=td;var o=id;b:switch(rd){case 1:rd=0,id=null,rf(e,t,o,1);break;case 2:case 9:if(Ja(o)){rd=0,id=null,nf(t);break}t=function(){rd!==2&&rd!==9||ed!==e||(rd=7),jf(e)},o.then(t,t);break a;case 3:rd=7;break a;case 4:rd=5;break a;case 7:Ja(o)?(rd=0,id=null,nf(t)):(rd=0,id=null,rf(e,t,o,7));break;case 5:var s=null;switch(td.tag){case 26:s=td.memoizedState;case 5:case 27:var c=td;if(s?nh(s):c.stateNode.complete){rd=0,id=null;var l=c.sibling;if(l!==null)td=l;else{var u=c.return;u===null?td=null:(td=u,af(u))}break b}}rd=0,id=null,rf(e,t,o,5);break;case 6:rd=0,id=null,rf(e,t,o,6);break;case 8:Wd(),ld=6;break a;default:throw Error(i(462))}}ef();break}catch(t){Kd(e,t)}while(1);return fa=da=null,z.H=r,z.A=a,$u=n,td===null?(ed=null,nd=0,yi(),ld):0}function ef(){for(;td!==null&&!Ie();)tf(td)}function tf(e){var t=ll(e.alternate,e,cd);e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Uc(n,t,t.pendingProps,t.type,void 0,nd);break;case 11:t=Uc(n,t,t.pendingProps,t.type.render,t.ref,nd);break;case 5:ts(t);var r=t;r===Qi&&(G?(aa(r),r.tag===5&&r.stateNode!=null&&($i=r.stateNode)):(aa(r),G=!0));default:vl(n,t),t=td=Ai(t,cd),t=ll(n,t,cd)}e.memoizedProps=e.pendingProps,t===null?af(e):td=t}function rf(e,t,n,r){fa=da=null,ts(t),eo=null,to=0;var i=t.return;try{if(Oc(e,i,t,n,nd)){ld=1,Cc(e,Li(n,e.current)),td=null;return}}catch(t){if(i!==null)throw td=i,t;ld=1,Cc(e,Li(n,e.current)),td=null;return}t.flags&32768?(G||r===1?e=!0:od||nd&536870912?e=!1:(ad=e=!0,(r===2||r===9||r===3||r===6)&&(r=Eo.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,ad);return}e=t.return;var n=gl(t.alternate,t,cd);if(n!==null){td=n;return}if(t=t.sibling,t!==null){td=t;return}td=t=e}while(t!==null);ld===0&&(ld=5)}function of(e,t){do{var n=_l(e.alternate,e);if(n!==null){n.flags&=32767,td=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){td=e;return}td=e=n}while(e!==null);ld=6,td=null}function sf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(Cd!==0);if($u&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ed&&(td=ed=null,nd=0),Td=t,wd=e,Ed=n,Od=a,kd=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Dd=s,s|=vi,ut(e,n,s,r,i,a),jd=null,(n&335544064)===n?(Md=ja(e),r=10262):(Md=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(He,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Ll=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=z.T,z.T=null,i=fe.p,fe.p=2,a=$u,$u|=4;try{fu(e,t,n)}finally{$u=a,fe.p=i,z.T=r}}Cd=1,Ll?Ad=zp(o,e.containerInfo,Md,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(Cd!==0){var t=wd.onRecoverableError;t(e,{componentStack:null})}}function uf(){Cd===3&&(Cd=0,Nu(Td,wd),Cd=4)}function df(){if(Cd===1){Cd=0;var e=wd,t=Td,n=Ed,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=z.T,z.T=null;var i=fe.p;fe.p=2;var a=$u;$u|=4;try{lu=uu=!1,ku(t,e,n),n=hp;var o=Hr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Vr(s.ownerDocument.documentElement,s)){if(c!==null&&Ur(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Br(s,h),v=Br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ch=!!mp,hp=mp=null}finally{$u=a,fe.p=i,z.T=r}}e.current=t,Cd=2}}function ff(){if(Cd===2){Cd=0;var e=wd,t=Td,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=z.T,z.T=null;var r=fe.p;fe.p=2;var i=$u;$u|=4;try{mu(e,t.alternate,t)}finally{$u=i,fe.p=r,z.T=n}}Cd=3}}function pf(){if(Cd===4||Cd===3){Cd=0;var e=Ad;Ad=null,Le();var t=wd,n=Td,r=Ed,i=kd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Cd=5:(Cd=0,Td=wd=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Sd=null),ht(r),n=n.stateNode,Je&&typeof Je.onCommitFiberRoot==`function`)try{Je.onCommitFiberRoot(qe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=z.T,a=fe.p,fe.p=2,z.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{z.T=n,fe.p=a}}if(i=jd,o=Md,Md=null,i!==null&&(jd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Ed&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Pd?Nd++:(Nd=0,Pd=t):(Nd=0,Pd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Oa(t)))}function hf(){return Ad!==null&&(Ad.skipTransition(),Ad=null),df(),ff(),pf(),gf()}function gf(){if(Cd!==5)return!1;var e=wd,t=Dd;Dd=0;var n=ht(Ed),r=z.T,a=fe.p;try{fe.p=32>n?32:n,z.T=null,n=Od,Od=null;var o=wd,s=Ed;if(Cd=0,Td=wd=null,Ed=0,$u&6)throw Error(i(331));var c=$u;if($u|=4,Ju(o.current),Bu(o,o.current,s,n),$u=c,Mf(0,!1),Je&&typeof Je.onPostCommitFiberRoot==`function`)try{Je.onPostCommitFiberRoot(qe,o)}catch{}return!0}finally{fe.p=a,z.T=r,mf(e,t)}}function _f(e,t,n){t=Li(n,t),t=Tc(e.stateNode,t,2),e=po(e,t,2),e!==null&&(lt(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Sd===null||!Sd.has(r))){e=Li(n,e),n=Ec(2),r=po(t,n,2),r!==null&&(Dc(n,r,t,e),lt(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Qu;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(sd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ed===e&&(nd&n)===n&&(ld===4||ld===3&&(nd&62914560)===nd&&300>Re()-vd?$u&2?fd|=n:Gd(e,0):fd|=n,md===nd&&(md=0)),jf(e)}function xf(e,t){t===0&&(t=st()),e=Si(e,t),e!==null&&(lt(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),xf(e,n)}function wf(e,t){return Pe(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Xe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=nd,a=V(r,r===ed?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||it(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&Sp()&&(e=Af);for(var t=Re(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}Cd!==0&&Cd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Xe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ot(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ed,n=nd,n=V(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(rd===2||rd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Fe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||it(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Fe(r),ht(n)){case 2:case 8:n=Ve;break;case 32:n=He;break;case 268435456:n=We;break;default:n=He}return r=If.bind(null,e),n=Pe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Fe(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(Cd!==0&&Cd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=nd;return r=V(e,e===ed?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(zd(e,r,t),Ff(e,Re()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;zd(e,t,!0)}function Rf(){Dp(function(){$u&6?Pe(Be,Nf):Pf()})}function zf(){if(Af===0){var e=Pa;e===0&&(e=et,et<<=1,!(et&261888)&&(et=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:fn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[bt]||null).action),o=r.submitter;o&&(t=(t=o[bt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);Zs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Zs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<li.length;Hf++){var Uf=li[Hf];ui(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}ui(ti,`onAnimationEnd`),ui(ni,`onAnimationIteration`),ui(ri,`onAnimationStart`),ui(`dblclick`,`onDoubleClick`),ui(`focusin`,`onFocus`),ui(`focusout`,`onBlur`),ui(ii,`onTransitionRun`),ui(ai,`onTransitionStart`),ui(oi,`onTransitionCancel`),ui(si,`onTransitionEnd`),Lt(`onMouseEnter`,[`mouseout`,`mouseover`]),Lt(`onMouseLeave`,[`mouseout`,`mouseover`]),Lt(`onPointerEnter`,[`pointerout`,`pointerover`]),Lt(`onPointerLeave`,[`pointerout`,`pointerover`]),It(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),It(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),It(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),It(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),It(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),It(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`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(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){hi(e)}i.currentTarget=null,a=c}}}}function qf(e,t){var n=t[St];n===void 0&&(n=t[St]=new Set);var r=e+`__bubble`;n.has(r)||(Zf(t,e,2,!1),n.add(r))}function Jf(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var Yf=`_reactListening`+Math.random().toString(36).slice(2);function Xf(e){if(!e[Yf]){e[Yf]=!0,Pt.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||Jf(t,!1,e),Jf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yf]||(t[Yf]=!0,Jf(`selectionchange`,!1,t))}}function Zf(e,t,n,r){switch(Ah(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!Cn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Qf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=kt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}bn(function(){var r=a,i=hn(n),s=[];a:{var c=ci.get(e);if(c!==void 0){var l=Pn,u=e;switch(e){case`keypress`:if(kn(n)===0)break a;case`keydown`:case`keyup`:l=Qn;break;case`focusin`:u=`focus`,l=Un;break;case`focusout`:u=`blur`,l=Un;break;case`beforeblur`:case`afterblur`:l=Un;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Hn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=tr;break;case ti:case ni:case ri:l=Wn;break;case si:l=nr;break;case`scroll`:case`scrollend`:l=In;break;case`wheel`:l=rr;break;case`copy`:case`cut`:case`paste`:l=Gn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=$n;break;case`submit`:l=er;break;case`toggle`:case`beforetoggle`:l=ir}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=xn(m,p),g!=null&&d.push($f(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==mn&&(u=n.relatedTarget||n.fromElement)&&(kt(u)||u[xt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?kt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=$n,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:At(c),h=l==null?u:At(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,kt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,tp):null,c!==null&&np(s,u,c,d,!1),l!==null&&f!==null&&np(s,f,l,d,!0)))}a:{if(c=r?At(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=wr;else if(vr(c)){if(Tr)_=Pr;else{_=Mr;var v=jr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&ln(r.elementType)&&(_=wr):_=Nr;if(_&&=_(e,r)){yr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?At(r):window,e){case`focusin`:(vr(v)||v.contentEditable===`true`)&&(Gr=v,Kr=r,qr=null);break;case`focusout`:qr=Kr=Gr=null;break;case`mousedown`:Jr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Jr=!1,Yr(s,n,i);break;case`selectionchange`:if(Wr)break;case`keydown`:case`keyup`:Yr(s,n,i)}var y;if(or)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else mr?fr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(lr&&n.locale!==`ko`&&(mr||b!==`onCompositionStart`?b===`onCompositionEnd`&&mr&&(y=On()):(Tn=i,En=`value`in Tn?Tn.value:Tn.textContent,mr=!0)),v=ep(r,b),0<v.length&&(b=new Kn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=pr(n),y!==null&&(b.data=y)))),(y=cr?hr(e,n):gr(e,n))&&(b=ep(r,`onBeforeInput`),0<b.length&&(v=new Kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Vf(s,e,r,n,i)}Kf(s,t)})}function $f(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ep(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=xn(e,n),i!=null&&r.unshift($f(e,i,a)),i=xn(e,t),i!=null&&r.push($f(e,i,a))),e.tag===3)return r;e=e.return}return[]}function tp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function np(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=xn(n,a),l!=null&&o.unshift($f(n,l,c))):i||(l=xn(n,a),l!=null&&o.push($f(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var rp=/\r\n?/g,ip=/\u0000|\uFFFD/g;function ap(e){return(typeof e==`string`?e:``+e).replace(rp,`
10
- `).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function sp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Wt(e,`class`,r);break;case`tabIndex`:Wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Wt(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&sp(e,t,`name`,a.name,a,null),sp(e,t,`formEncType`,a.formEncType,a,null),sp(e,t,`formMethod`,a.formMethod,a,null),sp(e,t,`formTarget`,a.formTarget,a,null)):(sp(e,t,`encType`,a.encType,a,null),sp(e,t,`method`,a.method,a,null),sp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=fn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:qf(`beforetoggle`,e),qf(`toggle`,e),Ut(e,`popover`,r);break;case`xlinkActuate`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ut(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=un.get(n)||n,Ut(e,n,r);else return}U=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:cn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ft.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}U=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ut(e,n,r)}return}U=!0}function lp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:qf(`error`,e),qf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:sp(e,t,o,s,n,null)}}a&&sp(e,t,`srcSet`,n.srcSet,n,null),r&&sp(e,t,`src`,n.src,n,null);return;case`input`:qf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:sp(e,t,r,d,n,null)}}en(e,o,c,l,u,s,a,!1);return;case`select`:for(a in qf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:sp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&nn(e,!!r,n,!0):nn(e,!!r,t,!1);return;case`textarea`:for(s in qf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:sp(e,t,s,c,n,null)}W(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:sp(e,t,l,r,n,null)}return;case`dialog`:qf(`beforetoggle`,e),qf(`toggle`,e),qf(`cancel`,e),qf(`close`,e);break;case`iframe`:case`object`:qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)qf(Wf[r],e);break;case`image`:qf(`error`,e),qf(`load`,e);break;case`details`:qf(`toggle`,e);break;case`embed`:case`source`:case`link`:qf(`error`,e),qf(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:sp(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&sp(e,t,c,r,n,null))}var up={};function dp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||sp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(U=!0),o=m;break;case`name`:m!==f&&(U=!0),a=m;break;case`checked`:m!==f&&(U=!0),u=m;break;case`defaultChecked`:m!==f&&(U=!0),d=m;break;case`value`:m!==f&&(U=!0),s=m;break;case`defaultValue`:m!==f&&(U=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&sp(e,t,p,m,r,f)}}$t(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||sp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(U=!0),p=o;break;case`defaultValue`:o!==l&&(U=!0),c=o;break;case`multiple`:o!==l&&(U=!0),s=o;default:o!==l&&sp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?nn(e,!!n,n?[]:``,!1):nn(e,!!n,t,!0)):nn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:sp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(U=!0),p=a;break;case`defaultValue`:a!==o&&(U=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&sp(e,t,s,a,r,o)}rn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:sp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(U=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:sp(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&sp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:sp(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&cp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&sp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||sp(e,t,f,p,r,m)}function fp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&fp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&fp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 vp(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 yp(e,t,n,r){return n=gp(n).createElement(e),n[yt]=r,n[bt]=t,lp(n,e,t),Mt(n),n}function bp(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 xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,Ep=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Dp=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Op)};function Op(e){setTimeout(function(){throw e})}function kp(e){return e===`head`}function Ap(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function jp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Mp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Np(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Pp(e,t,n){return n=n.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<=n.innerHeight&&e.left<=n.innerWidth}}function Fp(e){return Pp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ip(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Pp(t,n,e)}function Lp(e){return e.documentElement.clientHeight}function Rp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function zp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Lp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(Rp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Bp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Bp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Bp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Bp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vp(e){return{name:e,group:new Bp(`group`,e),imagePair:new Bp(`image-pair`,e),old:new Bp(`old`,e),new:new Bp(`new`,e)}}function Hp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(qp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Gp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Up,e,s,r)}this._eventListeners=a}};function Up(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Hp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Gp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Wp,e,n,i),r.splice(t,1),a!==null&&a()}};function Wp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Gp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Kp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function qp(e,t,n,r){if(e.length===0)return-1;r=Kp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Kp(a.optionsOrUseCapture)===r)return i}return-1}Hp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Gp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Gp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Hp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=_(e),bm(e,t))}Hp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Yp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Jp(t[n],e);n--);};function Yp(e,t){return t.push(e),!1}Hp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=gp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Xp,e,void 0,void 0))};function Xp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Hp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Hp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0);for(var n=t=0;n<$p.length;n++){var r=$p[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):$p[t++]=r}$p.length=t}};function Qp(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var $p=[],em=!1;function tm(e,t,n){$p.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=$p;$p=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Hp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Hp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Hp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Yp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,w),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,w),t===null?t=!1:(f(t,!0,S,a,r),a=v,y=v=null,t=a!==null)),t):!1}function im(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Hp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Yp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),im(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),im(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=_(e),om(e,t),!1}function om(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<$p.length;i++){var a=$p[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&($p[r++]=a)}$p.length=r,n.observe(e)}),om(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gm(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 _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function xm(e){Ep(function(){Ep(function(t){return e(t)})})}function Sm(e,t,n){switch(t=gp(n),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 Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&sp(e,t,r,null,up,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===pn&&(e.onclick=null),Ot(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var Tm=new Map,Em=new Set;function Dm(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 Om=fe.d;fe.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Ud();return e||t}function Am(e){var t=H(e);t!==null&&t.tag===5&&t.type===`form`?$s(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=Qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),Mt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Qt(n.imageSizes)+`"]`)):i+=`[href="`+Qt(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Nt(o)}),Mt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Qt(r)+`"][href="`+Qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),lp(r,`link`,e),Mt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=jt(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);Mt(c),lp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=jt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Mt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=jt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Mt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=xe.current)?Dm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Vm(n.href),t=jt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vm(n.href);var o=jt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tm.set(e,o)),Wm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Gm(n),t=jt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vm(e){return`href="`+Qt(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Nt.bind(null,t),lp(t,`link`,n),Mt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Gm(e){return`[src="`+Qt(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Qt(n.href)+`"]`);if(r)return t.instance=r,Mt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Mt(r),lp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,Mt(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),Mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),lp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,Mt(a),a):(r=n,(a=Tm.get(o))&&(r=D({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Mt(a),lp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jm(r,n.precedence,e));return t.instance}function Jm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=new Map,i=Zm=new Map;i.set(n,r)}else i=Zm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===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 th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vm(r.href),a=t.querySelector(Hm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Mt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),Mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),lp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*pp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:F,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){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=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},lo(a),e}function _h(e){return e?(e=Ti,e):Ti}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(Rd(n,e,t),mo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Rd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Fd();t=mt(t);var n=Si(e,t);n!==null&&Rd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=z.T;z.T=null;var a=fe.p;try{fe.p=2,Eh(e,t,n,r)}finally{fe.p=a,z.T=i}}function Th(e,t,n,r){var i=z.T;z.T=null;var a=fe.p;try{fe.p=8,Eh(e,t,n,r)}finally{fe.p=a,z.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)Qf(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=H(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=rt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Xe(o);s.entanglements[1]|=c,o&=~c}jf(a),!($u&6)&&(bd=Re()+500,Mf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Rd(s,a,2),Ud(),bh(a,2)}if(a=Dh(r),a===null&&Qf(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Dh(e){return e=hn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=kt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(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(ze()){case Be:return 2;case Ve:return 8;case He:case Ue:return 32;case We:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`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 zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=H(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=kt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,_t(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,_t(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=H(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=H(n);a!==null&&(e.splice(t,3),t-=3,Zs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Fd(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Ud(),t[xt]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.0`)throw Error(i(527,$h,`19.3.0`));fe.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=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:z,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{qe=tg.inject(eg),Je=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=bc,s=xc,c=Sc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[xt]=t.current,Xf(e),new Zh(t)}})),D=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()}))(),O=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),k=t(((e,t)=>{t.exports=O()})),A=e(C(),1),j=k(),M=A.createContext(void 0),N=e=>{let t=A.useContext(M);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},P=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,j.jsx)(M.Provider,{value:e,children:t})),F={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},I=new class{#e=F;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ee(e){setTimeout(e,0)}var te=typeof window>`u`||`Deno`in globalThis;function L(){}function ne(e,t){return typeof e==`function`?e(t):e}function re(e){return typeof e==`number`&&e>=0&&e!==1/0}function ie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function R(e,t){return typeof e==`function`?e(t):e}function ae(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==se(o,t.options))return!1}else if(!le(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function oe(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ce(t.options.mutationKey)!==ce(a))return!1}else if(!le(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function se(e,t){return(t?.queryKeyHashFn||ce)(e)}function ce(e){return JSON.stringify(e,(e,t)=>pe(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function le(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!le(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!le(e[r],t[r]))return!1;return!0}return!1}var ue=Object.prototype.hasOwnProperty;function de(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=fe(e)&&fe(t);if(!r&&!(pe(e)&&pe(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ue.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=de(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function z(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function fe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pe(e){if(!me(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!me(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function me(e){return Object.prototype.toString.call(e)===`[object Object]`}function he(e){return new Promise(t=>{I.setTimeout(t,e)})}function ge(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:de(e,t)}function _e(e){return e}function ve(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ye(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var be=Symbol();function xe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===be?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Se(e,t){return typeof e==`function`?e(...t):!!e}function Ce(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var we=()=>te,Te=()=>we(),B=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ee=new class extends B{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},De=ee;function Oe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=De,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ke=Oe(),Ae=new class extends B{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function je(e){return Math.min(1e3*2**e,3e4)}function Me(e){return(e??`online`)!==`online`||Ae.isOnline()}var Ne=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Pe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(L);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ne(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ee.isFocused()&&(e.networkMode===`always`||Ae.isOnline())&&e.canRun(),p=()=>Me(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Te()?0:3),a=e.retryDelay??je,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),he(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Fe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),re(this.gcTime)&&(this.#e=I.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Te()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(I.clearTimeout(this.#e),this.#e=void 0)}};function Ie(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Ce(e,()=>t.signal,()=>n=!0)},u=xe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ye:ve;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Re:Le,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Le(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Le(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Re(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ze=class extends Fe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=He(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=He(this.options);e.data!==void 0&&(this.setState(Ve(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ge(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(L).catch(L):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>R(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===be||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>R(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ie(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=xe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ie(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Pe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ne&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ne){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Be(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ve(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ke.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Be(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Me(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ve(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function He(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ue=class extends B{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ge(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ke(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ke(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof R(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!z(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&qe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||R(this.options.enabled,this.#t)!==R(t.enabled,this.#t)||R(this.options.staleTime,this.#t)!==R(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||R(this.options.enabled,this.#t)!==R(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return z(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(L)),t}#h(e){return!Te()&&R(this.options.enabled,this.#t)!==!1&&re(e)}#g(){this.#b();let e=R(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ie(this.#r.dataUpdatedAt,e)+1;this.#u=I.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=I.setInterval(()=>{(this.options.refetchIntervalInBackground||Ee.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(I.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(I.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ge(e,t),o=i&&qe(e,n,t,r);(a||o)&&(l={...l,...Be(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ge(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ge(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Je(e,t),refetch:this.refetch,isEnabled:R(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),z(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ke.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function We(e,t){return R(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||R(t.retryOnMount,e)!==!1)}function Ge(e,t){return We(e,t)||e.state.data!==void 0&&Ke(e,t,t.refetchOnMount)}function Ke(e,t,n){if(R(t.enabled,e)!==!1&&R(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Je(e,t)}return!1}function qe(e,t,n,r){return(e!==t||R(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Je(e,n)}function Je(e,t){return R(t.enabled,e)!==!1&&e.isStaleByTime(R(t.staleTime,e))}var Ye=class extends Fe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Xe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Pe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ke.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Xe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ze=class extends B{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ye({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Qe(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Qe(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Qe(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Qe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ke.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>oe(t,e))}findAll(e={}){return this.getAll().filter(t=>oe(e,t))}notify(e){ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ke.batch(()=>Promise.all(e.map(e=>e.continue().catch(L))))}};function Qe(e){return e.options.scope?.id}var $e=class extends B{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),z(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ce(t.mutationKey)!==ce(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Xe();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ke.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function et(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var tt=class extends B{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ke.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!z(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(et(e,n).forEach(e=>{e.destroy()}),et(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=de(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Ue(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ke.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},nt=class extends B{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??se(r,t),a=this.get(i);return a||(a=new ze({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ae(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ae(e,t)):t}notify(e){ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new nt,this.#t=e.mutationCache||new Ze,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ee.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ae.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(R(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ne(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ke.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ke.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ke.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ke.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(L).catch(L)}invalidateQueries(e,t={}){return ke.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ke.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(L)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(L)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(R(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(R(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(L).catch(L)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(L).catch(L)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Ae.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ce(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{le(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ce(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{le(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=se(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===be&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},V=A.createContext(!1),it=()=>A.useContext(V);V.Provider;function at(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ot=A.createContext(at()),st=()=>A.useContext(ot),ct=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Se(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},lt=e=>{A.useEffect(()=>{e.clearReset()},[e])},ut=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Se(n,[e.error,r])),dt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ft=(e,t)=>e?.suspense&&t.isPending,pt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mt({queries:e,...t},n){let r=N(n),i=it(),a=st(),o=t.subscribed!==!1,s=A.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{dt(e);let t=r.getQueryCache().get(e.queryHash);ct(e,a,t)}),lt(a);let[c]=A.useState(()=>new tt(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;A.useSyncExternalStore(A.useCallback(e=>f?c.subscribe(ke.batchCalls(e)):L,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>ft(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&ft(n,e)?pt(n,new Ue(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&ut({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function ht(e,t,n){let r=it(),i=st(),a=N(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,dt(o),ct(o,i,s),lt(i);let[l]=A.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(A.useSyncExternalStore(A.useCallback(e=>{let t=d?l.subscribe(ke.batchCalls(e)):L;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),A.useEffect(()=>{l.setOptions(o)},[o,l]),ft(o,u))throw pt(o,l,i);if(ut({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function gt(e,t){return ht(e,Ue,t)}function _t(e,t){let n=N(t),[r]=A.useState(()=>new $e(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);let i=A.useSyncExternalStore(A.useCallback(e=>r.subscribe(ke.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=A.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(L)},[r]);if(i.error&&Se(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var vt={};function yt(e,t){let n=A.useRef(vt);return n.current===vt&&(n.current=e(t)),n}var bt=[],xt=void 0;function St(){return xt}function Ct(e){bt.push(e)}function wt(e){let t=(t,n)=>{let r=yt(Et).current,i;try{xt=r;for(let e of bt)e.before(r);i=e(t,n);for(let e of bt)e.after(r);r.didInitialize=!0}finally{xt=void 0}return i};return t.displayName=e.displayName||e.name,t}function Tt(e){return A.forwardRef(wt(e))}function Et(){return{didInitialize:!1}}function Dt(){}var Ot=Object.freeze([]),kt=Object.freeze({}),H=typeof document<`u`?A.useLayoutEffect:()=>{};function At(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var jt=At(`https://base-ui.com/production-error`,`Base UI`),Mt=A.createContext(void 0);function Nt(e){let t=A.useContext(Mt);if(t===void 0&&!e)throw Error(jt(72));return t}function Pt(e){A.useEffect(e,Ot)}var Ft=0,It=class e{static create(){return new e}currentId=Ft;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ft,t()},e)}isStarted(){return this.currentId!==Ft}clear=()=>{this.currentId!==Ft&&(clearTimeout(this.currentId),this.currentId=Ft)};disposeEffect=()=>this.clear};function Lt(){let e=yt(It.create).current;return Pt(e.disposeEffect),e}function Rt(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:zt,platform:Bt,maxTouchPoints:Vt}=Rt(),U=zt.toLowerCase(),Ht=Bt.toLowerCase(),Ut=/^i(os$|p)/.test(Ht)||Ht===`macintel`&&Vt>1,Wt=`android`,Gt=Ht===Wt||U.includes(Wt),Kt=!Ut&&Ht.startsWith(`mac`);Ht.startsWith(`win`),!Gt&&/^(linux|chrome os)/.test(Ht);var qt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!qt&&U.includes(`firefox`),!qt&&U.includes(`chrom`);var Jt=/jsdom|happydom/.test(U);function Yt(e){return`nativeEvent`in e}function Xt(e){return e.pointerType===``&&e.isTrusted?!0:Gt&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Zt(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Qt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function $t(){return typeof window<`u`}function en(e){return rn(e)?(e.nodeName||``).toLowerCase():`#document`}function tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nn(e){return((rn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rn(e){return $t()?e instanceof Node||e instanceof tn(e).Node:!1}function W(e){return $t()?e instanceof Element||e instanceof tn(e).Element:!1}function an(e){return $t()?e instanceof HTMLElement||e instanceof tn(e).HTMLElement:!1}function on(e){return!$t()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof tn(e).ShadowRoot}function sn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function cn(e){return/^(table|td|th)$/.test(en(e))}function ln(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var un=/transform|translate|scale|rotate|perspective|filter/,dn=/paint|layout|strict|content/,fn=e=>!!e&&e!==`none`,pn;function mn(e){let t=W(e)?vn(e):e;return fn(t.transform)||fn(t.translate)||fn(t.scale)||fn(t.rotate)||fn(t.perspective)||!gn()&&(fn(t.backdropFilter)||fn(t.filter))||un.test(t.willChange||``)||dn.test(t.contain||``)}function hn(e){let t=bn(e);for(;an(t)&&!_n(t);){if(mn(t))return t;if(ln(t))return null;t=bn(t)}return null}function gn(){return pn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),pn}function _n(e){return/^(html|body|#document)$/.test(en(e))}function vn(e){return tn(e).getComputedStyle(e)}function yn(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(en(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||on(e)&&e.host||nn(e);return on(t)?t.host:t}function xn(e){let t=bn(e);return _n(t)?(e.ownerDocument||e).body:an(t)&&sn(t)?t:xn(t)}function Sn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xn(e),i=r===e.ownerDocument?.body,a=tn(r);if(i){let e=Cn(a);return t.concat(a,a.visualViewport||[],sn(r)?r:[],e&&n?Sn(e):[])}return t.concat(r,Sn(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Tn(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&on(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function En(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Dn=`data-base-ui-focusable`,On=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,kn=`data-starting-style`,An=`data-ending-style`,jn={[kn]:``},Mn={[An]:``},Nn={transitionStatus(e){return e===`starting`?jn:e===`ending`?Mn:null}},Pn=`data-open`,Fn=`data-closed`,In=`data-anchor-hidden`,Ln={"data-popup-open":``},Rn={[Pn]:``},zn={[Fn]:``},Bn={[In]:``},Vn={open(e){return e?Ln:null}},Hn={open(e){return e?Rn:zn},anchorHidden(e){return e?Bn:null}},Un={...Hn,...Nn},Wn=`data-trigger-disabled`;function Gn(e,t){if(!W(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Wn);for(let[,e]of t.entries())if(Tn(e,n))return!e.hasAttribute(Wn);return!1}function Kn(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function qn(e){return e.matches(`html,body`)}function Jn(e){return an(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Yn(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${On}`)!=null}function Xn(e){if(!e||Jt)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Zn(e,t){return t!=null&&!Zt(t)?0:typeof e==`function`?e():e}function Qn(e,t,n){let r=Zn(e,n);return typeof r==`number`?r:r?.[t]}function $n(e){return typeof e==`function`?e():e}function er(e,t){return t||e===`click`||e===`mousedown`}function tr(e){return e?.includes(`mouse`)&&e!==`mousedown`}var nr=`none`,rr=`trigger-press`,ir=`trigger-hover`,ar=`trigger-focus`,or=`outside-press`,sr=`escape-key`,cr=`disabled`,lr=`imperative-action`;function ur(e,t,n,r){let i=!1,a=!1,o=r??kt;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var dr=A.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new It,currentIdRef:{current:null},currentContextRef:{current:null}});function fr(e,t){e.current=t.current}function pr(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=A.useRef(n),a=A.useRef(n),o=A.useRef(null),s=A.useRef(null),c=Lt();return H(()=>{a.current=n,o.current?i.current={open:Qn(i.current,`open`),close:Qn(n,`close`)}:i.current=n},[n,o,i,a]),(0,j.jsx)(dr.Provider,{value:A.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function mr(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=A.useContext(dr),[f,p]=A.useState(!1),m=A.useRef(n);return H(()=>{m.current=n},[n]),H(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),H(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Qn(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,ur(nr))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),H(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,fr(o,c),d.clear()}},[l,a,o,i,c,d]),A.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}function hr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function gr(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function _r(e,t,n,r){let i=yt(yr).current;return br(i,e,t,n,r)&&Sr(i,[e,t,n,r]),i.callback}function vr(e){let t=yt(yr).current;return xr(t,e)&&Sr(t,e),t.callback}function yr(){return{callback:null,cleanup:null,refs:[]}}function br(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function xr(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Sr(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Cr(e){let t=yt(wr,e).current;return t.next=e,H(t.effect),t}function wr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Tr={...A},Er=Tr.useInsertionEffect,Dr=Er&&Er!==Tr.useLayoutEffect?Er:e=>e();function Or(e){let t=yt(kr).current;return t.next=e,Dr(t.effect),t.trampoline}function kr(){let e={next:void 0,callback:Ar,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ar(){}var jr=null;globalThis.requestAnimationFrame;var Mr=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Nr=class e{static create(){return new e}static request(e){return Mr.request(e)}static cancel(e){return Mr.cancel(e)}currentId=jr;request(e){this.cancel(),this.currentId=Mr.request(()=>{this.currentId=jr,e()})}cancel=()=>{this.currentId!==jr&&(Mr.cancel(this.currentId),this.currentId=jr)};disposeEffect=()=>this.cancel};function Pr(){let e=yt(Nr.create).current;return Pt(e.disposeEffect),e}function Fr(e){return e?.ownerDocument||document}var Ir=Math.min,Lr=Math.max,Rr=Math.round,zr=Math.floor,Br=e=>({x:e,y:e}),Vr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Hr(e,t,n){return Lr(e,Ir(t,n))}function Ur(e,t){return typeof e==`function`?e(t):e}function Wr(e){return e.split(`-`)[0]}function Gr(e){return e.split(`-`)[1]}function Kr(e){return e===`x`?`y`:`x`}function qr(e){return e===`y`?`height`:`width`}function Jr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Yr(e){return Kr(Jr(e))}function Xr(e,t,n){n===void 0&&(n=!1);let r=Gr(e),i=Yr(e),a=qr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ai(o)),[o,ai(o)]}function Zr(e){let t=ai(e);return[Qr(e),t,Qr(t)]}function Qr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var $r=[`left`,`right`],ei=[`right`,`left`],ti=[`top`,`bottom`],ni=[`bottom`,`top`];function ri(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ei:$r:t?$r:ei;case`left`:case`right`:return t?ti:ni;default:return[]}}function ii(e,t,n,r){let i=Gr(e),a=ri(Wr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Qr)))),a}function ai(e){let t=Wr(e);return Vr[t]+e.slice(t.length)}function oi(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function si(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:oi(e)}function ci(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function li(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...li(e,t.id,n)])}function ui(e){return`data-base-ui-${e}`}var di=0;function fi(e,t=`mui`){let[n,r]=A.useState(e),i=e||n;return A.useEffect(()=>{n??(di+=1,r(`${t}-${di}`))},[n,t]),i}var pi=Tr.useId;function mi(e,t){if(pi!==void 0){let n=pi();return e??(t?`${t}-${n}`:n)}return fi(e,t)}var hi=19;function gi(e){return hi>=e}function _i(e){if(!A.isValidElement(e))return null;let t=e,n=t.props;return(gi(19)?n?.ref:t.ref)??null}function vi(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function yi(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function bi(e,t){return typeof e==`function`?e(t):e}function xi(e,t){return typeof e==`function`?e(t):e}var Si={};function Ci(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ti(t);let a=Ti(e);return t&&(a=Ei(a,t)),n&&(a=Ei(a,n)),r&&(a=Ei(a,r)),i&&(a=Ei(a,i)),a}function wi(e){if(e.length===0)return Si;if(e.length===1)return Ti(e[0]);let t=Ti(e[0]);for(let n=1;n<e.length;n+=1)t=Ei(t,e[n]);return t}function Ti(e){return Ai(e)?{...ji(e,Si)}:Di(e)}function Ei(e,t){return Ai(t)?ji(t,e):Oi(e,t)}function Di(e){let t={...e};for(let e in t){let n=t[e];ki(e,n)&&(t[e]=Ni(n))}return t}function Oi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=vi(e.style,r);break;case`className`:e[n]=Fi(e.className,r);break;default:e[n]=ki(n,r)?Mi(e[n],r):r}}return e}function ki(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ai(e){return typeof e==`function`}function ji(e,t){return Ai(e)?e(t):e??Si}function Mi(e,t){return t?e?(...n)=>{let r=n[0];if(Ii(r)){let i=r;Pi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ni(t):e}function Ni(e){return e&&((...t)=>{let n=t[0];return Ii(n)&&Pi(n),e(...t)})}function Pi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Fi(e,t){return t?e?t+` `+e:t:e}function Ii(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Li(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Vi(r));let i=Ri(t,n,r);if(n.enabled===!1)return null;let a=n.state??kt;return Hi(e,r,i,a)}function Ri(e,t,n){let{className:r,style:i}=e,{state:a=kt,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?bi(r,a):void 0,d=l?xi(i,a):void 0,f=l?yi(a,c):kt,p=l&&s?zi(s):void 0,m=l?vi(f,p)??{}:kt;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?vr([m.ref,_i(n),...o]):_r(m.ref,_i(n),o):_r(null,null)),l?(u!==void 0&&(m.className=Fi(m.className,u)),d!==void 0&&(m.style=vi(m.style,d)),m):kt}function zi(e){return Array.isArray(e)?wi(e):Ci(void 0,e)}var Bi=Symbol.for(`react.lazy`);function Vi(e){if(e?.$$typeof!==Bi)return e;let t=A.Children.toArray(e)[0];return A.isValidElement(t)?t:e}function Hi(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ci(n,t.props);return e.ref=n.ref,A.cloneElement(t,e)}if(e&&typeof e==`string`)return Ui(e,n);throw Error(jt(8))}function Ui(e,t){return e===`button`?(0,A.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,A.createElement)(`img`,{alt:``,...t,key:t.key}):A.createElement(e,t)}var Wi={style:{transition:`none`}},Gi={fallbackAxisSide:`end`},Ki=e(T(),1),qi=A.createContext(null),Ji=()=>A.useContext(qi),Yi=ui(`portal`);function Xi(e={}){let{ref:t,container:n,componentProps:r=kt,elementProps:i}=e,a=mi(),o=Ji()?.portalNode,[s,c]=A.useState(null),[l,u]=A.useState(null),d=Or(e=>{e!==null&&u(e)}),f=A.useRef(null);H(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(rn(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Li(`div`,r,{ref:[t,d],props:[{id:a,[Yi]:``},i]}),m=s&&p?Ki.createPortal(p,s):null;return{node:l,nodeId:A.isValidElement(p)?p.props.id:void 0,subtree:m}}function Zi(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Qi=A.createContext(null),$i=A.createContext(null),G=()=>A.useContext(Qi)?.id||null,ea=e=>{let t=A.useContext($i);return e??t};function ta(e){return e==null?e:`current`in e?e.current:e}function na(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function ra(e){return e!=null&&e.clientX!=null}function ia(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=A.useRef(!1),u=A.useRef(null),[d,f]=A.useState(),[p,m]=A.useState([]),h=Or(e=>{i.set(`positionReference`,e)}),g=Or((e,t,n)=>{l.current||(!c.current.openEvent||ra(c.current.openEvent))&&i.set(`positionReference`,na(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Or(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=Zt(d)?o:a;A.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=tn(o);function r(t){let n=En(t);Tn(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||ra(c.current.openEvent)?u.current=hr(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),A.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),A.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),A.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=A.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return A.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function aa(){return!1}function oa(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function sa(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=aa,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=ea(c),h=Or(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Or(()=>a),{escapeKey:y,outsidePress:b}=oa(s),x=A.useRef(!1),S=A.useRef(!1),C=A.useRef(!1),w=A.useRef(!1),T=A.useRef(!1),E=A.useRef(``),D=A.useRef(null),O=Lt(),k=Lt(),j=Or(()=>{k.clear(),f.current.insideReactTree=!1}),M=Or(e=>{let t=f.current.floatingContext?.nodeId;return(m?li(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Or(e=>Kn(e,l.select(`floatingElement`))||Kn(e,l.select(`domReferenceElement`))),P=Or(e=>{o()&&l.setOpen(!1,ur(rr,e.nativeEvent))}),F=Or(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&M(`__escapeKeyBubbles`))return;let t=ur(sr,Yt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=Or(()=>{f.current.insideReactTree=!0,k.start(0,j)}),ee=Or(e=>{if(!u||!n||e.button!==0)return;let t=En(e.nativeEvent);Tn(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),te=Or(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});A.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),A.useEffect(()=>{if(!u||!n)return u||(w.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new It,t=new It,i=Fr(d);function a(){e.clear(),T.current=!0}function o(){e.start(qt?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function k(e){let t=f.current.floatingContext?.nodeId,n=m&&li(m.nodesRef.current,t).some(t=>Kn(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=En(e),r=`[${ui(`inert`)}]`,i=W(n)?n.getRootNode():null,a=Array.from((on(i)?i:Fr(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Tn(e,n))))return;let s=W(n)?n:null;for(;s&&!_n(s);){let e=bn(s);if(_n(e)||!W(e))break;s=e}if(!(a.length&&W(n)&&!qn(n)&&!Tn(n,l.select(`floatingElement`))&&a.every(e=>!Tn(s,e)))){if(an(n)&&!(`touches`in e)){let t=_n(n),r=vn(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!k(e)){if(p()===`intentional`){if(e.detail!==0&&!Xt(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(e)||M(`__outsidePressBubbles`)||(l.setOpen(!1,ur(or,e)),j())}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function ee(e,t){let n=En(e);if(!n)return;let r=hr(n,e.type,()=>{t(e),r()})}function te(e){E.current=`touch`,ee(e,I)}function L(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&ee(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function ne(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),p()===`intentional`&&(e.type===`pointercancel`?n&&s():k(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function re(e){if(p()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(A(e),O.clear(),D.current=null)}function ie(e){ee(e,re)}function R(e){p()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&A(e),O.clear(),D.current=null)}function ae(e){ee(e,R)}let oe=gr(r&&gr(hr(i,`keydown`,F),hr(i,`compositionstart`,a),hr(i,`compositionend`,o)),_&&gr(hr(i,`click`,L,!0),hr(i,`pointerdown`,L,!0),hr(i,`pointerup`,ne,!0),hr(i,`pointercancel`,ne,!0),hr(i,`mousedown`,L,!0),hr(i,`mouseup`,ne,!0),hr(i,`touchstart`,te,{capture:!0,passive:!0}),hr(i,`touchmove`,ie,{capture:!0,passive:!0}),hr(i,`touchend`,ae,{capture:!0,passive:!0})));return()=>{oe(),e.clear(),t.clear(),c(),C.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,O]);let L=A.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ne=A.useMemo(()=>({onKeyDown:F,onPointerDown:te,onMouseDown:te,onClickCapture:I,onMouseDownCapture(e){I(),ee(e)},onPointerDownCapture(e){I(),ee(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,ee,te]);return A.useMemo(()=>n?{reference:L,floating:ne,trigger:L}:{},[n,L,ne])}function ca(e,t,n){let{reference:r,floating:i}=e,a=Jr(t),o=Yr(t),s=qr(o),c=Wr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Gr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function la(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ur(t,e),p=si(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ci(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ci(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ua=50,da=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:la},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ca(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ua&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ca(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},fa=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ur(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Wr(r),_=Jr(o),v=Wr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ai(o)]:Zr(o)),x=p!==`none`;!d&&x&&b.push(...ii(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Xr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Jr(t)||T.every(e=>Jr(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Jr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},pa=new Set([`left`,`top`]);async function ma(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Wr(n),s=Gr(n),c=Jr(n)===`y`,l=pa.has(o)?-1:1,u=a&&c?-1:1,d=Ur(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ha=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ma(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ga=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ur(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Jr(i),p=Kr(f),m=u[p],h=u[f],g=(e,t)=>Hr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},_a=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ur(e,t),u={x:n,y:r},d=Jr(i),f=Kr(d),p=u[f],m=u[d],h=Ur(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=pa.has(Wr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},va=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Ur(e,t),c=await i.detectOverflow(t,s),l=Wr(n),u=Gr(n),d=Jr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ir(p-c[m],g),y=Ir(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Lr(c.left,c.right):S=p-2*Lr(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ya(e){let t=vn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=an(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Rr(n)!==a||Rr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ba(e){return W(e)?e:e.contextElement}function xa(e){let t=ba(e);if(!an(t))return Br(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ya(t),o=(a?Rr(n.width):n.width)/r,s=(a?Rr(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Sa=Br(0);function Ca(e){let t=tn(e);return!gn()||!t.visualViewport?Sa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wa(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===tn(e)}function Ta(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ba(e),o=Br(1);t&&(r?W(r)&&(o=xa(r)):o=xa(e));let s=wa(a,n,r)?Ca(a):Br(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=tn(a),t=W(r)?tn(r):r,n=e,i=Cn(n);for(;i&&t!==n;){let e=xa(i),t=i.getBoundingClientRect(),r=vn(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=tn(i),i=Cn(n)}}return ci({width:u,height:d,x:c,y:l})}function Ea(e,t){let n=yn(e).scrollLeft;return t?t.left+n:Ta(nn(e)).left+n}function Da(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ea(e,n),y:n.top+t.scrollTop}}function Oa(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=nn(r),s=t?ln(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Br(1),u=Br(0),d=an(r);if((d||!a)&&((en(r)!==`body`||sn(o))&&(c=yn(r)),d)){let e=Ta(r);l=xa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Da(o,c):Br(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ka(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Aa(e){let t=yn(e),n=e.ownerDocument.body,r=Lr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Lr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ea(e),o=-t.scrollTop;return vn(n).direction===`rtl`&&(a+=Lr(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ja=25;function Ma(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=tn(e),a=nn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!gn()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ea(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ja&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Na(e,t){let n=Ta(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xa(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Pa(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ma(e,n,t);else if(t===`document`)r=Aa(nn(e));else if(W(t))r=Na(t,n);else{let n=Ca(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ci(r)}function Fa(e,t){let n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>W(e)&&en(e)!==`body`),i=null,a=vn(e).position===`fixed`,o=a?bn(e):e;for(;W(o)&&!_n(o);){let e=vn(o),t=mn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bn(o)}return t.set(e,r),r}function Ia(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ln(t)?[]:Fa(t,this._c):[].concat(n),r],o=Pa(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Pa(t,a[e],i);s=Lr(n.top,s),c=Ir(n.right,c),l=Ir(n.bottom,l),u=Lr(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function La(e){let{width:t,height:n}=ya(e);return{width:t,height:n}}function Ra(e,t,n){let r=an(t),i=nn(t),a=n===`fixed`,o=Ta(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Br(0);if((r||!a)&&((en(t)!==`body`||sn(i))&&(s=yn(t)),r)){let e=Ta(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ea(i));let l=i&&!r&&!a?Da(i,s):Br(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function za(e){return vn(e).position===`static`}function Ba(e,t){if(!an(e)||vn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return nn(e)===n&&(n=n.ownerDocument.body),n}function Va(e,t){let n=tn(e);if(ln(e))return n;if(!an(e)){let t=bn(e);for(;t&&!_n(t);){if(W(t)&&!za(t))return t;t=bn(t)}return n}let r=Ba(e,t);for(;r&&cn(r)&&za(r);)r=Ba(r,t);return r&&_n(r)&&za(r)&&!mn(r)?n:r||hn(e)||n}var Ha=async function(e){let t=this.getOffsetParent||Va,n=this.getDimensions,r=await n(e.floating);return{reference:Ra(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ua(e){return vn(e).direction===`rtl`}var Wa={convertOffsetParentRelativeRectToViewportRelativeRect:Oa,getDocumentElement:nn,getClippingRect:Ia,getOffsetParent:Va,getElementRects:Ha,getClientRects:ka,getDimensions:La,getScale:xa,isElement:W,isRTL:Ua};function Ga(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ka(e,t,n){let r=null,i,a=nn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=zr(d),h=zr(a.clientWidth-(u+f)),g=zr(a.clientHeight-(d+p)),_=zr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Lr(0,Ir(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ga(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=tn(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function qa(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ba(e),u=i||a?[...l?Sn(l):[],...t?Sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ka(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ta(e):null;c&&g();function g(){let t=Ta(e);h&&!Ga(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ja=ha,Ya=ga,Xa=fa,Za=va,Qa=_a,$a=(e,t,n)=>{let r=new Map,i=n??{},a={...Wa,...i.platform,_c:r};return da(e,t,{...i,platform:a})},eo=typeof document<`u`?A.useLayoutEffect:function(){};function to(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!to(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!to(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function no(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ro(e,t){let n=no(e);return Math.round(t*n)/n}function io(e){let t=A.useRef(e);return eo(()=>{t.current=e}),t}function ao(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=A.useState(r);to(f,r)||p(r);let[m,h]=A.useState(null),[g,_]=A.useState(null),v=A.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=A.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=A.useRef(null),C=A.useRef(null),w=A.useRef(u),T=c!=null,E=io(c),D=io(i),O=io(l),k=A.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),$a(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};j.current&&!to(w.current,t)&&(w.current=t,Ki.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);eo(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=A.useRef(!1);eo(()=>(j.current=!0,()=>{j.current=!1}),[]),eo(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let M=A.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=A.useMemo(()=>({reference:b,floating:x}),[b,x]),P=A.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ro(N.floating,u.x),r=ro(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...no(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return A.useMemo(()=>({...u,update:k,refs:M,elements:N,floatingStyles:P}),[u,k,M,N,P])}var oo=(e,t)=>{let n=Ja(e);return{name:n.name,fn:n.fn,options:[e,t]}},so=(e,t)=>{let n=Ya(e);return{name:n.name,fn:n.fn,options:[e,t]}},co=(e,t)=>({fn:Qa(e).fn,options:[e,t]}),lo=(e,t)=>{let n=Xa(e);return{name:n.name,fn:n.fn,options:[e,t]}},uo=(e,t)=>{let n=Za(e);return{name:n.name,fn:n.fn,options:[e,t]}},fo=t((e=>{var t=C();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),po=t(((e,t)=>{t.exports=fo()})),mo=t((e=>{var t=C(),n=po();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ho=t(((e,t)=>{t.exports=mo()})),go=po(),_o=ho(),vo=gi(19)?xo:So;function yo(e,t,n,r,i){return vo(e,t,n,r,i)}function bo(e,t,n,r,i){let a=A.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,go.useSyncExternalStore)(e.subscribe,a,a)}Ct({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,go.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function xo(e,t,n,r,i){let a=St();if(!a)return bo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function So(e,t,n,r,i){return(0,_o.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Co=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return yo(this,e,t,n,r)}},wo=class extends Co{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){A.useDebugValue(e);let n=this;H(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;H(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;H(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){A.useDebugValue(e);let n=this,r=t!==void 0;H(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return A.useDebugValue(e),yo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){A.useDebugValue(e);let n=Or(t??Dt);this.context[e]=n}useStateSetter(e){let t=A.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},To={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Eo=class extends wo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Zi(),nested:n,triggerElements:i},To),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Qt(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Do(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=A.useRef(null);r===void 0&&f.current===null&&(f.current=new Eo({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),H(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};W(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Oo(e,t=!1,n=!1,r=!1){let[i,a]=A.useState(e&&t?`idle`:void 0),[o,s]=A.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),H(()=>{if(!e&&o&&i!==`ending`&&n){let e=Nr.request(()=>{a(`ending`)});return()=>{Nr.cancel(e)}}},[e,o,i,n]),H(()=>{if(!e||t)return;let n=Nr.request(()=>{a(void 0)});return()=>{Nr.cancel(n)}},[t,e]),H(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Nr.request(()=>{a(`idle`)});return()=>{Nr.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var ko=null;function Ao(e){if(!ko){let e=[];ko=e,queueMicrotask(()=>{ko=null,Ki.flushSync(()=>{for(let t of e)t()})})}ko.push(e)}function jo(e,t=!1,n=!1){let r=Pr();return Or((i,a=null)=>{r.cancel();let o=ta(e);if(o==null)return;let s=o,c=()=>{n?Ao(()=>{a?.aborted||i()}):Ki.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{a?.aborted||(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=kn;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Mo(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Or(a),s=jo(r,n,i);A.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var No={tabIndex:-1,[Dn]:``};function Po(e,t=!1){let n=mi(),r=G()!=null,i=yt(()=>e(n,r)).current;return Do({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Fo({handle:e,store:t}){return H(()=>e.attachStore(t),[e,t]),null}function Io(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Lo(e,t){let n=A.useRef(null);return Or(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Io(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Io(t))})}function K(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Ro(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function zo(e,t,n,r={}){let i=n.reason,a=i===ir,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Ro(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=K(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Ki.flushSync(l):l()}function Bo(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Lo(e,n),o=Or(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Or(e=>{a(e),e&&o(e)});return H(()=>(s(t.current),()=>s(null)),[s,t,n,e]),H(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Vo(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=A.useRef(null),i=e.useState(`open`);H(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ur(nr);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Ho(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=Oo(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=Or(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Mo({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function Uo(e,t){e.useSyncedValues(t),H(()=>()=>{e.update({activeTriggerProps:kt,inactiveTriggerProps:kt,popupProps:kt})},[e])}var Wo=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Go(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Eo({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:kt,inactiveTriggerProps:kt,popupProps:kt}}var Ko=e=>e.triggerIdProp??e.activeTriggerId,qo=e=>e.openProp??e.open,Jo=e=>(e.popupElement?.id??e.floatingId)||void 0;function Yo(e,t){return t!==void 0&&qo(e)&&Ko(e)===t}function Xo(e,t){return Yo(e,t)?!0:t!==void 0&&qo(e)&&Ko(e)==null&&e.triggerCount===1}var Zo={open:qo,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ko,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Jo,isTriggerActive:(e,t)=>t!==void 0&&Ko(e)===t,isOpenedByTrigger:(e,t)=>Yo(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ko(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Xo(e,t)?Jo(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Qo(e){let t=A.useCallback(t=>e===void 0?Dt:e.subscribeStore(t),[e]),n=A.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,go.useSyncExternalStore)(t,n,()=>e?.serverStore)}function $o(e){return es(e,e.rootContext)}function es(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=A.useState(null),[d,f]=A.useState(void 0),[p,m]=A.useState(void 0),h=A.useRef(null),g=ea(r),_=A.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=ao({...e,elements:{..._,...l&&{reference:l}}}),y=W(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=A.useCallback(e=>{let t=W(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=A.useCallback(e=>{(W(e)||e===null)&&(h.current=e,f(e)),(W(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!W(e))&&v.refs.setReference(e)},[v.refs,f]),C=A.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=A.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=A.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=A.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return H(()=>{o&&(h.current=o)},[o]),H(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),A.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var ts=Kt&&qt;function ns(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=A.useRef(!1),c=A.useRef(null),l=A.useRef(!0),u=Lt();A.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=tn(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&an(e)&&e===wn(Fr(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return gr(hr(t,`blur`,r),ts&&hr(t,`keydown`,a,!0),ts&&hr(t,`pointerdown`,o,!0))},[i,n]),A.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);W(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=A.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=En(t.nativeEvent);if(W(a)){if(ts&&!t.relatedTarget){if(!l.current&&!Jn(a))return}else if(!Xn(a))return}let o=Gn(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;i.select(`open`)&&o||p===0||p===void 0?i.setOpen(!0,ur(ar,d,f)):u.start(p,()=>{s.current||i.setOpen(!0,ur(ar,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=W(n)&&n.hasAttribute(ui(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=wn(Fr(e));!n&&t===e||Tn(o.current.floatingContext?.refs.floating.current,t)||Tn(e,t)||a||Gn(n??t,i.context.triggerElements)||i.setOpen(!1,ur(ar,r))})}}},[o,r,i,u]);return A.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var rs=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new It,this.restTimeout=new It,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},is=new WeakMap;function as(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&is.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),is.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function os(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=is.get(n);a&&a!==e&&as(a),as(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,is.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function ss(e){let t=e.context.dataRef.current,n=yt(()=>t.hoverInteractionState??rs.create()).current;return t.hoverInteractionState||=n,Pt(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function cs(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=ea(),d=G(),f=ss(a),p=Lt(),m=Or(()=>er(l.current.openEvent?.type,f.interactedInside)),h=Or(()=>tr(l.current.openEvent?.type)),g=Or(()=>{as(f)});H(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),A.useEffect(()=>g,[g]),H(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&W(c)&&s){let e=c,t=s,n=Fr(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return os(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),A.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&li(u.nodesRef.current,d).length>0)}function t(e){let t=Qn(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,ur(ir,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=En(e);Yn(t)?f.interactedInside=t?.closest(`[aria-haspopup]`)!=null:f.interactedInside=!1}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Gn(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;u&&r&&W(o)&&li(u.nodesRef.current,r,!1).some(e=>Tn(e.context?.elements.floating,o))||(f.handler?f.handler(n):(g(),h()&&!m()&&t(n)))}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,ur(ir,t)),u.events.emit(`floating.closed`,t)})}let y=s;return gr(y&&hr(y,`mouseenter`,c),y&&hr(y,`mouseleave`,_),y&&hr(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var ls={current:null};function us(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ls,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=ea(l),y=ss(h),b=A.useRef(!1),x=Cr(i),S=Cr(r),C=Cr(o),w=Cr(n),T=Cr(p),E=Cr(f),D=Or(()=>er(g.current.openEvent?.type,y.interactedInside)),O=Or(()=>T.current?.()!==!1),k=Or((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Tn(e,t);if(!W(n))return!1;let i=n;return r.hasMatchingElement(e=>Tn(e,i))&&(!e||!Tn(e,i))}),j=Or(()=>{y.handler&&=(Fr(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=Or(()=>{as(y)});return u&&(y.handleCloseOptions=i?.__options),A.useEffect(()=>j,[j]),A.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===ir,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),A.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Qn(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,ur(ir,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,ur(ir,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!W(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Zt(y.pointerType))return;let t=$n(C.current),n=Qn(S.current,`open`,y.pointerType),r=En(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(W(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Tn(e,r)){s=e;break}}W(i)&&W(o)&&!h.context.triggerElements.hasElement(i)&&Tn(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&W(s)&&W(o)&&Tn(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;m?O()&&h.setOpen(!0,ur(ir,e,s)):p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,ur(ir,e,s))}):g&&O()&&h.setOpen(!0,ur(ir,e,s)))}function i(t){if(D()){M();return}j();let n=Fr(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Gn(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t)}else y.pointerType===`touch`&&Tn(h.select(`floatingElement`),t.relatedTarget)||e(t)}}function o(e){Tn(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?hr(t,`mouseout`,o):void 0;return s?gr(hr(t,`mousemove`,r,{once:!0}),hr(t,`mouseenter`,r),hr(t,`mouseleave`,i),l):gr(hr(t,`mouseenter`,r),hr(t,`mouseleave`,i),l)},[j,M,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),A.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!Zt(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;os(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=$n(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,ur(ir,t,n))}y.pointerType===`touch`?Ki.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var ds=.1,fs=ds*ds,ps=.5;function ms(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function hs(e,t,n,r,i,a,o,s,c,l){let u=!1;return ms(e,t,n,r,i,a)&&(u=!u),ms(e,t,i,a,o,s)&&(u=!u),ms(e,t,o,s,c,l)&&(u=!u),ms(e,t,c,l,n,r)&&(u=!u),u}function gs(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function _s(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function vs(e={}){let{blockPointerEvents:t=!1}=e,n=new It,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*fs;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=En(r),g=r.type===`mouseleave`,_=Tn(u,h),v=Tn(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&W(r.relatedTarget)&&Tn(u,r.relatedTarget))return;function y(){return!!(s&&li(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=_s(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=_s(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=_s(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=_s(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!gs(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?ps/2:ps*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+ps+1,o=C||T?S.bottom-ps:S.top,s=C?T?S.bottom-ps:S.top:S.bottom-ps;M=hs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?ps/2:ps*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-ps,o=C||T?S.top+ps:S.bottom,s=C?T?S.top+ps:S.bottom:S.top+ps;M=hs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?ps/2:ps*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+ps+1,o=w||E?S.right-ps:S.left,s=w?E?S.right-ps:S.left:S.right-ps;M=hs(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?ps/2:ps*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-ps,o=w||E?S.left+ps:S.right,s=w?E?S.left+ps:S.right:S.left+ps;M=hs(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var ys={...Zo,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bs=class extends wo{constructor(e,t,n){let r=new Wo;super(xs(e,r,t,n),Ss(r),ys)}setOpen=(e,t)=>{zo(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ur(rr,e))}};function xs(e,t,n,r=!1){return{...Go(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Ss(e){return{popupRef:A.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Cs=wt(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Po((e,t)=>new bs({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Vo(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Ho(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=A.useRef(null);H(()=>{m&&t&&p.setOpen(!1,ur(cr))},[m,t,p]),H(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),H(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),A.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,ur(lr))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,j.jsxs)(Mt.Provider,{value:p,children:[l&&(0,j.jsx)(Fo,{handle:l,store:p}),T&&(0,j.jsx)(ws,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function ws({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=sa(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=ia(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=A.useMemo(()=>Ci(a.reference,i.reference),[a.reference,i.reference]);return Uo(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??kt}),null}function Ts(e){return mi(e,`base-ui`)}var Es=A.createContext(void 0);function Ds(){return A.useContext(Es)}var Os=`data-base-ui-tooltip-trigger`;function ks(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(W(n))return n}}let t=e.target;return W(t)?t:null}function As(e){let t=e;for(;t;){let e=t.closest(`[${Os}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&W(n.host)?n.host:null}return null}var js=Tt(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=Nt(!0),m=Qo(a)??p;if(!m)throw Error(jt(82));let h=Ts(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=A.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=Bo(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=Ds(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=mr(v,{open:_}),O=ss(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),j=s??k,M=Cr(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=A.useRef(!1),I=Lt(),ee=A.useRef(void 0);function te(){return D&&w.current!=null?0:c??C??600}function L(e){let t=y.current;if(!t||!e)return!1;let n=As(e);return n!==null&&n!==t&&Tn(t,n)}function ne(e){let t=L(e);return F.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,I.clear()),t}let re=us(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?vs():null,restMs:te,delay(){return u==null&&D?{close:Qn(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),ie=ns(v,{enabled:!j}).reference,R=e=>{let t=F.current,n=ks(e),r=ne(n),i=y.current,a=i&&n&&Tn(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,ur(ir,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&Zt(ee.current)){let t=()=>{F.current||M.current||m.select(`open`)||m.setOpen(!0,ur(ir,e,i))},n=te();n===0?(I.clear(),t()):I.start(n,t)}},ae=m.useState(`triggerProps`,S);return Li(`button`,e,{state:{open:_},ref:[t,x,y],props:[re,ie,S||N!==`none`?ae:void 0,{onMouseOver(e){R(e.nativeEvent)},onFocus(e){L(ks(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),ee.current=void 0},onPointerEnter(e){ee.current=e.pointerType},onPointerDown(e){ee.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Wn]:j?``:void 0,[Os]:j?void 0:``},f],stateAttributesMapping:Vn})}),Ms=A.createContext(void 0);function Ns(){let e=A.useContext(Ms);if(e===void 0)throw Error(jt(70));return e}var Ps=A.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Xi({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,j.jsxs)(A.Fragment,{children:[l,c&&Ki.createPortal(n,c)]})}),Fs=A.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Nt().useState(`mounted`)||n?(0,j.jsx)(Ms.Provider,{value:n,children:(0,j.jsx)(Ps,{ref:t,...r})}):null}),Is=A.createContext(void 0);function Ls(){let e=A.useContext(Is);if(e===void 0)throw Error(jt(71));return e}var Rs=A.createContext(void 0);function zs(){return A.useContext(Rs)?.direction??`ltr`}var Bs=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Ur(e,t)||{};if(l==null)return{};let f=si(u),p={x:n,y:r},m=Yr(i),h=qr(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];w&&await o.isElement?.(C)||(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Hr(k,j,A),N=!c.arrow&&Gr(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Vs=(e,t)=>{let{name:n,fn:r}=Bs(e);return{name:n,fn:r,options:[e,t]}},Hs={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Us={sideX:`left`,sideY:`top`},Ws=`--available-width`,Gs=`--available-height`,Ks=`--anchor-width`,qs=`--anchor-height`,Js=`--transform-origin`,Ys=Ws,Xs=Gs;function Zs(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Qs(e,t,n){let{rects:r,placement:i}=e;return{side:Zs(t,Wr(i),n),align:Gr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $s(e){return ec(e,$o)}function ec(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=A.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=Or(j),N=j?M:n,P=Cr(n),F=Cr(g),I=zs()===`rtl`,ee=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],te=o===`center`?ee:`${ee}-${o}`,L=l;typeof L==`number`?L={top:L,right:L,bottom:L,left:L}:L&&={top:L.top||0,right:L.right||0,bottom:L.bottom||0,left:L.left||0};let ne=+(i===`bottom`),re=+(i===`top`),ie=+(i===`right`),R=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:L},oe=A.useRef(null),se=Cr(a),ce=Cr(s),le=typeof a==`function`?0:a,ue=typeof s==`function`?0:s,de=[];p&&de.push(p),de.push(oo(e=>{let t=Qs(e,i,I),n=typeof se.current==`function`?se.current(t):se.current,r=typeof ce.current==`function`?ce.current(t):ce.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,ue,I,i]));let z=E===`none`&&T!==`shift`,fe=!z&&(u||O||T===`shift`),pe=T===`none`?null:lo({...ae,padding:{top:L.top+1+ne,right:L.right+1+R,bottom:L.bottom+1+re,left:L.left+1+ie},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),me=z?null:so({...ae,rootBoundary:k,mainAxis:E!==`none`,crossAxis:fe,limiter:u||O?void 0:co(e=>{if(!oe.current)return{};let{width:t,height:n}=oe.current.getBoundingClientRect(),r=Jr(Wr(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})},[ae,u,O,k,L,E]);T===`shift`||E===`shift`||o===`center`?de.push(me,pe):de.push(pe,me),de.push(uo({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(Ys,`${t}px`),i.setProperty(Xs,`${n}px`);let a=tn(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Ks,`${u}px`),i.setProperty(qs,`${d}px`)}}),Vs(e=>({element:oe.current||Fr(e.elements.floating).createElement(`div`),padding:oe.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Wr(r),u=Gr(r),d=Jr(l)===`y`,f=oe.current,p=typeof a==`function`?a(Qs(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return fe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Js,d?`${m} ${h}`:`${h} ${m}`),{}}},Hs,b),H(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let he=A.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:ge,elements:_e,x:ve,y:ye,middlewareData:be,update:xe,placement:Se,context:Ce,isPositioned:we,floatingStyles:Te}=t({rootContext:h,open:m?g:void 0,placement:te,middleware:de,strategy:r,whileElementsMounted:m?void 0:(...e)=>qa(...e,he),nodeId:y,externalTree:S}),{sideX:B,sideY:Ee}=be.adaptiveOrigin||Us,De=we?r:`fixed`,Oe=A.useMemo(()=>{let e;return e=we?b?{position:De,[B]:ve,[Ee]:ye}:{...Te,position:De}:{position:De,top:0,left:0},e[Ys]=`100vw`,e[Xs]=`100vh`,we||(e.opacity=0),e},[b,De,B,ve,Ee,ye,Te,we]),ke=A.useRef(null);H(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(tc(t)?t.current:t)||null;n!==ke.current&&(ge.setPositionReference(n),ke.current=n)},[g,ge,N,P]),A.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&tc(e)&&e.current!==ke.current&&(ge.setPositionReference(e.current),ke.current=e.current)},[g,ge,N,P]),A.useEffect(()=>{if(m&&g&&_e.reference&&_e.floating)return qa(_e.reference,_e.floating,xe,he)},[m,g,_e,xe,he]);let Ae=Wr(Se),je=Zs(i,Ae,I),Me=Gr(Se)||`center`,Ne=!!be.hide?.referenceHidden;H(()=>{x&&g&&we&&Ae!==ee&&w(Ae)},[x,g,we,Ae,ee]);let Pe=A.useMemo(()=>({position:`absolute`,top:be.arrow?.y,left:be.arrow?.x}),[be.arrow]),Fe=be.arrow?.centerOffset!==0;return A.useMemo(()=>({positionerStyles:Oe,arrowStyles:Pe,arrowRef:oe,arrowUncentered:Fe,side:je,align:Me,physicalSide:Ae,anchorHidden:Ne,refs:ge,context:Ce,isPositioned:we,update:xe}),[Oe,Pe,oe,Fe,je,Me,Ae,Ne,ge,Ce,we,xe])}function tc(e){return e!=null&&`current`in e}function nc(e){return e===`starting`?Wi:kt}function rc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Li(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},nc(r),i],stateAttributesMapping:Hn})}var ic=A.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Gi,style:g,..._}=e,v=Nt(),y=Ns(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=$s({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=rc(e,A.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,j.jsx)(Is.Provider,{value:D,children:O})}),ac=A.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Nt(),{side:s,align:c}=Ls(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Mo({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),cs(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Li(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[No,f,nc(d),a],stateAttributesMapping:Un})}),oc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=A.useMemo(()=>({open:t,close:n}),[t,n]);return(0,j.jsx)(Es.Provider,{value:t,children:(0,j.jsx)(pr,{delay:i,timeoutMs:r,children:e.children})})},sc=`diffs-container`,cc=(()=>{try{return!1}catch{return!1}})(),lc=/(?=^From [a-f0-9]+ .+$)/m,uc=/(?=^diff --git)/gm,dc=/(?<=\n)/,fc=/^(---|\+\+\+)\s+([^\t\r\n]+)/,pc=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,mc=`header-prefix`,hc=`header-filename-suffix`,gc=`header-metadata`,_c=`header-custom`,vc={dark:`pierre-dark`,light:`pierre-light`},yc=`data-theme-css`,bc=`data-unsafe-css`,xc=`data-diffs-scrollbar-measure`,Sc=`data-diffs-code-view-header`,Cc=`data-diffs-code-view-footer`,wc=`--diffs-scrollbar-gutter-measured`,Tc=1e5,Ec={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},Dc={...Ec,hunkLineCount:1},Oc={paddingTop:8,paddingBottom:8,gap:8},kc={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},Ac=Object.freeze({fromStart:0,fromEnd:0}),jc={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Mc=Object.freeze([]),Nc={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Pc=new Map,Fc=new Map,Ic=new Map,Lc=new Set;function Rc(e=vc){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function zc(e,t=n()){return typeof t!=`string`&&t.isDisposed?!1:(typeof t==`string`?a(t):t.themeResolver).hasResolvedThemes(Rc(e))}var Bc;async function Vc(e){let t=n(e);d(t);try{if(t===`highlights`){let{HighlightsHighlighter:e}=await y(async()=>{let{HighlightsHighlighter:e}=await import(`./highlights-xCDO0bP7.js`);return{HighlightsHighlighter:e}},__vite__mapDeps([0,1,2,3,4,5]));return new e}let{ShikiHighlighter:e}=await y(async()=>{let{ShikiHighlighter:e}=await import(`./shiki-CoZZwYQ-.js`);return{ShikiHighlighter:e}},__vite__mapDeps([6,1,2,3,4,5,7]));return await e.create(t)}finally{s()}}async function Hc({themes:e,langs:t,preferredHighlighter:n}){Uc();let r=Bc??=Vc(c()??n),i;try{i=await r}catch(e){throw Bc===r&&(Bc=void 0),e}if(Bc===r&&(Bc=i),await Promise.all([i.themeResolver.resolveThemes(e),i.loadLanguages(t)]),i.isDisposed)throw new m;return i}function Uc(){Bc!=null&&!(`then`in Bc)&&Bc.isDisposed&&(Bc=void 0)}function Wc({theme:e,lang:t,langs:n}={}){Uc();let r=Bc;if(!(r==null||`then`in r||e!=null&&!zc(e,r)||(t!=null||n!=null)&&!r.hasLoadedLanguages([...t==null?[]:[t],...n??[]])))return r}async function Gc(e){await Hc(e)}var Kc=new Set,qc=null;function Jc(e){Kc.add(e),qc??=requestAnimationFrame(Xc)}function Yc(e){Kc.delete(e)&&Kc.size===0&&qc!=null&&(cancelAnimationFrame(qc),qc=null)}function Xc(e){let t=new Set(Kc);Kc.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}qc=Kc.size>0?requestAnimationFrame(Xc):null}function Zc(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function Qc(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function $c(e,t){let n=e?.theme??vc,r=t?.theme??vc,i=el(e),a=el(t);return Qc(n,r)&&Zc(e,t,[`theme`,`parseDiffOptions`])&&Zc(i,a)}function el(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function tl(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function nl({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function rl(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function il(){return i({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[u({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function al(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function ol(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var sl=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Yc(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||tl(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||i)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||r||i)&&(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&ol(e.composedPath())||(Dl(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(Dl(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;Dl(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null?Dl(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`):(this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility())};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();Dl(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);Dl(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=fl(i)&&this.hoveredLine?.lineElement===i.lineElement;dl(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),dl(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),fl(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(ml(i)&&p!=null){p(i);break}if(pl(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!fl(i))break;dl(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,Dl(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),Dl(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),Dl(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();ol(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}else if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners()}else this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(al(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=l(il());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);ul(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){this.placeUtilityFromSelection()||(this.hoveredLine==null?this.hideUtility():this.showUtilityOnLine(this.hoveredLine))}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(_l(t));if(ul(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(ul(n)&&(!t||n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(ul(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&ol(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=_l(e);if(t&&ol(n))return;let r=vl(e);return r==null?this.pathFromAnnotationSlot(e):_l(r)}pathFromAnnotationSlot(e){let t=yl(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return _l(t);let n=xl(bl(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:_l(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=Sl(t)?t:Sl(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}tl(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Jc(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{Yc(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!wl(this.renderedSelectedLinesState,n),i=!wl(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);hl(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=El(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=El(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e)}else if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:gl(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:gl(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Tl(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Tl(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function cl({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:ll({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function ll({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function ul(e){return e!=null&&`kind`in e&&e.kind===`line`}function dl(e){return e!=null&&`kind`in e&&e.kind===`token`}function fl(e){return ul(e)||dl(e)}function pl(e){return`type`in e&&e.type===`line-info`}function ml(e){return`kind`in e&&e.kind===`merge-conflict-action`}function hl(e){return e===`current`||e===`incoming`||e===`both`}function gl(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function _l(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function vl(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function yl(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function bl(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function xl(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function Sl(e){return e!=null&&typeof e.elementFromPoint==`function`}function Cl(e,t){return e===t||tl(e??void 0,t??void 0)}function wl(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Cl(e?.range??null,t.range)}function Tl(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function El(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function Dl(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var Ol=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),jl(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?Pl(t):Fl(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null)console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);else if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:kl(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:Al(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&Ml(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function kl(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function Al(e){return Math.max(Math.ceil(e),0)}function jl(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Ml(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Nl(e))}function Ml(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function Nl(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function Pl(e){e.codeElement.isConnected&&Nl(e)}function Fl(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function Il(e,t){let n=Array.isArray(e)?e:[e];return t==null?n.every(e=>e===`text`||e===`ansi`||Lc.has(e)):t.hasLoadedLanguages(n)}function Ll(e,t){return Qc(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Rl(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function zl(e){return i({tagName:`div`,children:[i({tagName:`div`,children:e.annotations?.map(e=>i({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Bl(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function Vl({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,a={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return i({tagName:`div`,children:[t===`custom`?i({tagName:`slot`,properties:{name:_c}}):Hl({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[Ul(r)]],properties:a})}function Hl({name:e,prevName:t,iconType:n}){let r=[i({tagName:`slot`,properties:{name:mc}}),u({name:Bl(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(i({tagName:`div`,children:[i({tagName:`bdi`,children:[v(t)]})],properties:{"data-prev-name":``}})),r.push(u({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(i({tagName:`div`,children:[i({tagName:`bdi`,children:[v(e)]})],properties:{"data-title":``}})),r.push(i({tagName:`slot`,properties:{name:hc}})),i({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Ul(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(i({tagName:`span`,children:[v(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(i({tagName:`span`,children:[v(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(i({tagName:`slot`,properties:{name:gc}})),i({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Wl(e){return i({tagName:`pre`,properties:Gl(e)})}function Gl({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var Kl=new Map,ql=0,Jl={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,odin:`odin`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,BUCK:`python`,BUILD:`python`,PACKAGE:`python`,WORKSPACE:`python`,Tiltfile:`python`,bazel:`python`,bxl:`python`,bzl:`python`,bzlmod:`python`,star:`python`,sky:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Yl(e){let t=Xl(e);if(t!=null)return t;let n=e.split(/[/\\]/).pop()??e;return n===e?`text`:Xl(n)??`text`}function Xl(e){if(Kl.has(e))return Kl.get(e)??`text`;if(Object.hasOwn(Jl,e))return Jl[e]??null;let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Kl.has(t[1]))return Kl.get(t[1])??`text`;if(Object.hasOwn(Jl,t[1]))return Jl[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Kl.has(n)?Kl.get(n)??`text`:Object.hasOwn(Jl,n)?Jl[n]??`text`:null}function Zl(){return ql}function Ql(){return Object.fromEntries(Kl)}function $l(e,{theme:t,preferredHighlighter:r}){return{langs:Array.isArray(e)?e:[e??`text`],themes:Rc(t),preferredHighlighter:n(r)}}function eu(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function tu(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function nu(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var ru=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,iu=/^0(?:\.0+)?%?$/;function au(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function ou(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function su(e){if(e==null)return null;let t=ou(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function cu(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||ru.test(t))return!0;let n=au(t);return n!=null&&iu.test(n)}function lu(e,t,n){if(t==null||n==null)return!1;let r=su(e),i=su(t),a=su(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var uu=new WeakMap;function du(e){let t=uu.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;fu(r,`editor.background`,i),fu(r,`editor.foreground`,a),fu(r,`sideBar.background`,o),fu(r,`sideBar.foreground`,s),fu(r,`input.background`,n[`input.background`]??o),fu(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),fu(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),fu(r,`gitDecoration.addedResourceForeground`,pu(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),fu(r,`gitDecoration.modifiedResourceForeground`,pu(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),fu(r,`gitDecoration.deletedResourceForeground`,pu(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(cu(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(cu(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(mu(l,o)||lu(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return uu.set(e,u),u}function fu(e,t,n){n!=null&&n!==``&&(e[t]=n)}function pu(...e){for(let t of e)if(t!=null&&t!==``)return t}function mu(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function hu({theme:e=vc,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=gu(i,t);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${nu(`global`)}fg:${a.fg};`,r+=`${nu(`global`)}bg:${a.bg};`,r+=_u(i,n)}else{let n=t.getTheme(e.dark),i=gu(n,t);r+=`${nu(`global`)}dark:${i.fg};`,r+=`${nu(`global`)}dark-bg:${i.bg};`,r+=_u(n,`dark`),n=t.getTheme(e.light),i=gu(n,t),r+=`${nu(`global`)}light:${i.fg};`,r+=`${nu(`global`)}light-bg:${i.bg};`,r+=_u(n,`light`)}return r}function gu(e,t){if(t.name===`highlights`&&e.zed?.cssVariables===!0){let e=nu(`token`);return{fg:`var(${e}foreground)`,bg:`var(${e}background)`}}return du(e)}function _u(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${nu(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${nu(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${nu(`global`)}${t}modified-color:${a};`),n}var vu=10,yu=13,bu=4,xu=40;function Su(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
10
+ `).replace(ip,``)}function op(e,t){return t=ap(t),ap(e)===t}function sp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||an(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&an(e,``+r);else return;break;case`className`:Wt(e,`class`,r);break;case`tabIndex`:Wt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Wt(e,n,r);break;case`style`:cn(e,r,o);return;case`data`:if(t!==`object`){Wt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&sp(e,t,`name`,a.name,a,null),sp(e,t,`formEncType`,a.formEncType,a,null),sp(e,t,`formMethod`,a.formMethod,a,null),sp(e,t,`formTarget`,a.formTarget,a,null)):(sp(e,t,`encType`,a.encType,a,null),sp(e,t,`method`,a.method,a,null),sp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=fn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=pn);return;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=fn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:qf(`beforetoggle`,e),qf(`toggle`,e),Ut(e,`popover`,r);break;case`xlinkActuate`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Gt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Gt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ut(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=un.get(n)||n,Ut(e,n,r);else return}U=!0}function cp(e,t,n,r,a,o){switch(n){case`style`:cn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)an(e,r);else if(typeof r==`number`||typeof r==`bigint`)an(e,``+r);else return;break;case`onScroll`:r!=null&&qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=pn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ft.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[bt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}U=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ut(e,n,r)}return}U=!0}function lp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:qf(`error`,e),qf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:sp(e,t,o,s,n,null)}}a&&sp(e,t,`srcSet`,n.srcSet,n,null),r&&sp(e,t,`src`,n.src,n,null);return;case`input`:qf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:sp(e,t,r,d,n,null)}}en(e,o,c,l,u,s,a,!1);return;case`select`:for(a in qf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:sp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&nn(e,!!r,n,!0):nn(e,!!r,t,!1);return;case`textarea`:for(s in qf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:sp(e,t,s,c,n,null)}W(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:sp(e,t,l,r,n,null)}return;case`dialog`:qf(`beforetoggle`,e),qf(`toggle`,e),qf(`cancel`,e),qf(`close`,e);break;case`iframe`:case`object`:qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)qf(Wf[r],e);break;case`image`:qf(`error`,e),qf(`load`,e);break;case`details`:qf(`toggle`,e);break;case`embed`:case`source`:case`link`:qf(`error`,e),qf(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:sp(e,t,u,r,n,null)}return;default:if(ln(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&sp(e,t,c,r,n,null))}var up={};function dp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||sp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(U=!0),o=m;break;case`name`:m!==f&&(U=!0),a=m;break;case`checked`:m!==f&&(U=!0),u=m;break;case`defaultChecked`:m!==f&&(U=!0),d=m;break;case`value`:m!==f&&(U=!0),s=m;break;case`defaultValue`:m!==f&&(U=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&sp(e,t,p,m,r,f)}}$t(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||sp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(U=!0),p=o;break;case`defaultValue`:o!==l&&(U=!0),c=o;break;case`multiple`:o!==l&&(U=!0),s=o;default:o!==l&&sp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?nn(e,!!n,n?[]:``,!1):nn(e,!!n,t,!0)):nn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:sp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(U=!0),p=a;break;case`defaultValue`:a!==o&&(U=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&sp(e,t,s,a,r,o)}rn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:sp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(U=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:sp(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&sp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:sp(e,t,u,p,r,m)}return;default:if(ln(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&cp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&sp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||sp(e,t,f,p,r,m)}function fp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function pp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&fp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&fp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.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 mp=null,hp=null;function gp(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 vp(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 yp(e,t,n,r){return n=gp(n).createElement(e),n[yt]=r,n[bt]=t,lp(n,e,t),Mt(n),n}function bp(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 xp=null;function Sp(){var e=window.event;return e&&e.type===`popstate`?e!==xp&&(xp=e,!0):(xp=null,!1)}var Cp=typeof setTimeout==`function`?setTimeout:void 0,wp=typeof clearTimeout==`function`?clearTimeout:void 0,Tp=typeof Promise==`function`?Promise:void 0,Ep=typeof requestAnimationFrame==`function`?requestAnimationFrame:Cp,Dp=typeof queueMicrotask==`function`?queueMicrotask:Tp===void 0?Cp:function(e){return Tp.resolve(null).then(e).catch(Op)};function Op(e){setTimeout(function(){throw e})}function kp(e){return e===`head`}function Ap(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Et]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function jp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Mp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Np(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Pp(e,t,n){return n=n.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<=n.innerHeight&&e.left<=n.innerWidth}}function Fp(e){return Pp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ip(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Pp(t,n,e)}function Lp(e){return e.documentElement.clientHeight}function Rp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function zp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Lp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(Rp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Bp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Bp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Bp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Bp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Vp(e){return{name:e,group:new Bp(`group`,e),imagePair:new Bp(`image-pair`,e),old:new Bp(`old`,e),new:new Bp(`new`,e)}}function Hp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Hp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(qp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Gp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Up,e,s,r)}this._eventListeners=a}};function Up(e,t,n,r){return _(e).addEventListener(t,n,r),!1}Hp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=qp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Gp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Wp,e,n,i),r.splice(t,1),a!==null&&a()}};function Wp(e,t,n,r){return _(e).removeEventListener(t,n,r),!1}function Gp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Kp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function qp(e,t,n,r){if(e.length===0)return-1;r=Kp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Kp(a.optionsOrUseCapture)===r)return i}return-1}Hp.prototype.dispatchEvent=function(e){var t=p(this._fragmentFiber);if(t===null)return!0;t=_(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Gp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Gp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Hp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Jp,e,void 0,void 0)};function Jp(e,t){return e.tag!==6&&(e=_(e),bm(e,t))}Hp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Yp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Jp(t[n],e);n--);};function Yp(e,t){return t.push(e),!1}Hp.prototype.blur=function(){var e=p(this._fragmentFiber);e!==null&&(e=_(e),e=gp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Xp,e,void 0,void 0))};function Xp(e,t){return e.tag!==6&&(e=_(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Hp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag===6||(e=_(e),t.observe(e)),!1}Hp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0);for(var n=t=0;n<$p.length;n++){var r=$p[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):$p[t++]=r}$p.length=t}};function Qp(e,t){return e.tag===6||(e=_(e),t.unobserve(e)),!1}var $p=[],em=!1;function tm(e,t,n){$p.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=$p;$p=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Hp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=_(e),t.push.apply(t,e.getClientRects());return!1}Hp.prototype.getRootNode=function(e){var t=p(this._fragmentFiber);return t===null?this:_(t).getRootNode(e)},Hp.prototype.compareDocumentPosition=function(e){var t=p(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Yp,n,void 0,void 0);var r=_(t);if(n.length===0){if(n=r,m(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=h(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=_(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=_(n[0]),i=_(n[n.length-1]);var a=m(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=kt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=p(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,w),t===null?t=!1:(f(t,!0,b,a,n),a=v,v=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,w),t===null?t=!1:(f(t,!0,S,a,r),a=v,y=v=null,t=a!==null)),t):!1}function im(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Hp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Yp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=h(this._fragmentFiber);if(r=n?r[1]||r[0]||p(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=_(r),im(e,n);return}if(r=_(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=_(a),im(a,n)):_(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=_(e),om(e,t),!1}function om(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<$p.length;i++){var a=$p[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&($p[r++]=a)}$p.length=r,n.observe(e)}),om(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Gp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lm(n),Ot(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Et])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gm(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 _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function xm(e){Ep(function(){Ep(function(t){return e(t)})})}function Sm(e,t,n){switch(t=gp(n),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 Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&sp(e,t,r,null,up,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===pn&&(e.onclick=null),Ot(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ot(e)}var Tm=new Map,Em=new Set;function Dm(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 Om=fe.d;fe.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Ud();return e||t}function Am(e){var t=H(e);t!==null&&t.tag===5&&t.type===`form`?$s(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=Qt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),lp(t,`link`,e),Mt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+Qt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Qt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Qt(n.imageSizes)+`"]`)):i+=`[href="`+Qt(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);lp(o,`link`,e),t===`style`&&(o[Dt]=!0,o.onload=o.onerror=function(){Nt(o)}),Mt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Qt(r)+`"][href="`+Qt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),lp(r,`link`,e),Mt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=jt(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);Mt(c),lp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=jt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Mt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=jt(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Mt(a),lp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=xe.current)?Dm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Vm(n.href),t=jt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vm(n.href);var o=jt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tm.set(e,o)),Wm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Gm(n),t=jt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vm(e){return`href="`+Qt(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Dt]){r.loading=1;return}}else t=e.createElement(`link`),t[Dt]=!0,t.onload=t.onerror=Nt.bind(null,t),lp(t,`link`,n),Mt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Gm(e){return`[src="`+Qt(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Qt(n.href)+`"]`);if(r)return t.instance=r,Mt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Mt(r),lp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,Mt(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),Mt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),lp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,Mt(a),a):(r=n,(a=Tm.get(o))&&(r=D({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Mt(a),lp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jm(r,n.precedence,e));return t.instance}function Jm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=new Map,i=Zm=new Map;i.set(n,r)}else i=Zm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Et]||a[yt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===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 th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vm(r.href),a=t.querySelector(Hm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Mt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),Mt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),lp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*pp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:F,Provider:null,Consumer:null,_currentValue:pe,_currentValue2:pe,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){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=ct(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ct(0),this.hiddenUpdates=ct(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Di(3,null,null,t),e.current=a,a.stateNode=e,t=Da(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},lo(a),e}function _h(e){return e?(e=Ti,e):Ti}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=fo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=po(e,r,t),n!==null&&(Rd(n,e,t),mo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Si(e,67108864);t!==null&&Rd(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Fd();t=mt(t);var n=Si(e,t);n!==null&&Rd(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=z.T;z.T=null;var a=fe.p;try{fe.p=2,Eh(e,t,n,r)}finally{fe.p=a,z.T=i}}function Th(e,t,n,r){var i=z.T;z.T=null;var a=fe.p;try{fe.p=8,Eh(e,t,n,r)}finally{fe.p=a,z.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)Qf(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=H(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=rt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Xe(o);s.entanglements[1]|=c,o&=~c}jf(a),!($u&6)&&(bd=Re()+500,Mf(0,!1))}}break;case 31:case 13:s=Si(a,2),s!==null&&Rd(s,a,2),Ud(),bh(a,2)}if(a=Dh(r),a===null&&Qf(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Qf(e,t,r,null,n)}}function Dh(e){return e=hn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=kt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(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(ze()){case Be:return 2;case Ve:return 8;case He:case Ue:return 32;case We:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`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 zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=H(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=kt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,_t(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,_t(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mn=r,n.target.dispatchEvent(r),mn=null}else return t=H(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=H(n);a!==null&&(e.splice(t,3),t-=3,Zs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[bt]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[bt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Fd(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Ud(),t[xt]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.0`)throw Error(i(527,$h,`19.3.0`));fe.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=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:z,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{qe=tg.inject(eg),Je=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=bc,s=xc,c=Sc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[xt]=t.current,Xf(e),new Zh(t)}})),D=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=E()}))(),O=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),k=t(((e,t)=>{t.exports=O()})),A=e(C(),1),j=k(),M=A.createContext(void 0),N=e=>{let t=A.useContext(M);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},P=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,j.jsx)(M.Provider,{value:e,children:t})),F={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},I=new class{#e=F;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ee(e){setTimeout(e,0)}var te=typeof window>`u`||`Deno`in globalThis;function L(){}function ne(e,t){return typeof e==`function`?e(t):e}function re(e){return typeof e==`number`&&e>=0&&e!==1/0}function ie(e,t){return Math.max(e+(t||0)-Date.now(),0)}function R(e,t){return typeof e==`function`?e(t):e}function ae(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==se(o,t.options))return!1}else if(!le(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function oe(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ce(t.options.mutationKey)!==ce(a))return!1}else if(!le(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function se(e,t){return(t?.queryKeyHashFn||ce)(e)}function ce(e){return JSON.stringify(e,(e,t)=>pe(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function le(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!le(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!le(e[r],t[r]))return!1;return!0}return!1}var ue=Object.prototype.hasOwnProperty;function de(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=fe(e)&&fe(t);if(!r&&!(pe(e)&&pe(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ue.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=de(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function z(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function fe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pe(e){if(!me(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!me(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function me(e){return Object.prototype.toString.call(e)===`[object Object]`}function he(e){return new Promise(t=>{I.setTimeout(t,e)})}function ge(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:de(e,t)}function _e(e){return e}function ve(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ye(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var be=Symbol();function xe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===be?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Se(e,t){return typeof e==`function`?e(...t):!!e}function Ce(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0})),i)}),e}var we=()=>te,Te=()=>we(),B=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ee=new class extends B{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},De=ee;function Oe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=De,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ke=Oe(),Ae=new class extends B{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function je(e){return Math.min(1e3*2**e,3e4)}function Me(e){return(e??`online`)!==`online`||Ae.isOnline()}var Ne=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Pe(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(L);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ne(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Ee.isFocused()&&(e.networkMode===`always`||Ae.isOnline())&&e.canRun(),p=()=>Me(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Te()?0:3),a=e.retryDelay??je,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);t||!s?h(r):(n++,e.onFail?.(n,r),he(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()}))})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Fe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),re(this.gcTime)&&(this.#e=I.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Te()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(I.clearTimeout(this.#e),this.#e=void 0)}};function Ie(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Ce(e,()=>t.signal,()=>n=!0)},u=xe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?ye:ve;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Re:Le,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Le(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Le(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Re(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ze=class extends Fe{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=He(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=He(this.options);e.data!==void 0&&(this.setState(Ve(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ge(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(L).catch(L):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>R(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===be||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>R(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ie(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=xe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Ie(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Pe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ne&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ne){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Be(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ve(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ke.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Be(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Me(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ve(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function He(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ue=class extends B{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Ge(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ke(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ke(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof R(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!z(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&qe(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||R(this.options.enabled,this.#t)!==R(t.enabled,this.#t)||R(this.options.staleTime,this.#t)!==R(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||R(this.options.enabled,this.#t)!==R(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return z(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(L)),t}#h(e){return!Te()&&R(this.options.enabled,this.#t)!==!1&&re(e)}#g(){this.#b();let e=R(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=ie(this.#r.dataUpdatedAt,e)+1;this.#u=I.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=I.setInterval(()=>{(this.options.refetchIntervalInBackground||Ee.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(I.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(I.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Ge(e,t),o=i&&qe(e,n,t,r);(a||o)&&(l={...l,...Be(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ge(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ge(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Je(e,t),refetch:this.refetch,isEnabled:R(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),z(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ke.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function We(e,t){return R(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||R(t.retryOnMount,e)!==!1)}function Ge(e,t){return We(e,t)||e.state.data!==void 0&&Ke(e,t,t.refetchOnMount)}function Ke(e,t,n){if(R(t.enabled,e)!==!1&&R(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Je(e,t)}return!1}function qe(e,t,n,r){return(e!==t||R(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Je(e,n)}function Je(e,t){return R(t.enabled,e)!==!1&&e.isStaleByTime(R(t.staleTime,e))}var Ye=class extends Fe{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Xe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Pe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ke.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Xe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ze=class extends B{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new Ye({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Qe(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Qe(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Qe(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Qe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ke.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>oe(t,e))}findAll(e={}){return this.getAll().filter(t=>oe(e,t))}notify(e){ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ke.batch(()=>Promise.all(e.map(e=>e.continue().catch(L))))}};function Qe(e){return e.options.scope?.id}var $e=class extends B{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),z(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ce(t.mutationKey)!==ce(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Xe();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ke.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function et(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var tt=class extends B{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ke.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!z(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(et(e,n).forEach(e=>{e.destroy()}),et(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=de(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new Ue(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&ke.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},nt=class extends B{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??se(r,t),a=this.get(i);return a||(a=new ze({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ke.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ae(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ae(e,t)):t}notify(e){ke.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ke.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ke.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},rt=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new nt,this.#t=e.mutationCache||new Ze,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Ee.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Ae.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(R(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ne(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ke.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ke.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ke.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ke.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(L).catch(L)}invalidateQueries(e,t={}){return ke.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ke.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(L)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(L)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(R(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(R(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(L).catch(L)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(L).catch(L)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Ae.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ce(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{le(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ce(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{le(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=se(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===be&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},V=A.createContext(!1),it=()=>A.useContext(V);V.Provider;function at(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ot=A.createContext(at()),st=()=>A.useContext(ot),ct=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Se(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},lt=e=>{A.useEffect(()=>{e.clearReset()},[e])},ut=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Se(n,[e.error,r])),dt=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ft=(e,t)=>e?.suspense&&t.isPending,pt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function mt({queries:e,...t},n){let r=N(n),i=it(),a=st(),o=t.subscribed!==!1,s=A.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{dt(e);let t=r.getQueryCache().get(e.queryHash);ct(e,a,t)}),lt(a);let[c]=A.useState(()=>new tt(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;A.useSyncExternalStore(A.useCallback(e=>f?c.subscribe(ke.batchCalls(e)):L,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),A.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>ft(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&ft(n,e)?pt(n,new Ue(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&ut({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function ht(e,t,n){let r=it(),i=st(),a=N(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,dt(o),ct(o,i,s),lt(i);let[l]=A.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(A.useSyncExternalStore(A.useCallback(e=>{let t=d?l.subscribe(ke.batchCalls(e)):L;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),A.useEffect(()=>{l.setOptions(o)},[o,l]),ft(o,u))throw pt(o,l,i);if(ut({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function gt(e,t){return ht(e,Ue,t)}function _t(e,t){let n=N(t),[r]=A.useState(()=>new $e(n,e));A.useEffect(()=>{r.setOptions(e)},[r,e]);let i=A.useSyncExternalStore(A.useCallback(e=>r.subscribe(ke.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=A.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(L)},[r]);if(i.error&&Se(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var vt={};function yt(e,t){let n=A.useRef(vt);return n.current===vt&&(n.current=e(t)),n}var bt=[],xt=void 0;function St(){return xt}function Ct(e){bt.push(e)}function wt(e){let t=(t,n)=>{let r=yt(Et).current,i;try{xt=r;for(let e of bt)e.before(r);i=e(t,n);for(let e of bt)e.after(r);r.didInitialize=!0}finally{xt=void 0}return i};return t.displayName=e.displayName||e.name,t}function Tt(e){return A.forwardRef(wt(e))}function Et(){return{didInitialize:!1}}function Dt(){}var Ot=Object.freeze([]),kt=Object.freeze({}),H=typeof document<`u`?A.useLayoutEffect:()=>{};function At(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var jt=At(`https://base-ui.com/production-error`,`Base UI`),Mt=A.createContext(void 0);function Nt(e){let t=A.useContext(Mt);if(t===void 0&&!e)throw Error(jt(72));return t}function Pt(e){A.useEffect(e,Ot)}var Ft=0,It=class e{static create(){return new e}currentId=Ft;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ft,t()},e)}isStarted(){return this.currentId!==Ft}clear=()=>{this.currentId!==Ft&&(clearTimeout(this.currentId),this.currentId=Ft)};disposeEffect=()=>this.clear};function Lt(){let e=yt(It.create).current;return Pt(e.disposeEffect),e}function Rt(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:zt,platform:Bt,maxTouchPoints:Vt}=Rt(),U=zt.toLowerCase(),Ht=Bt.toLowerCase(),Ut=/^i(os$|p)/.test(Ht)||Ht===`macintel`&&Vt>1,Wt=`android`,Gt=Ht===Wt||U.includes(Wt),Kt=!Ut&&Ht.startsWith(`mac`);Ht.startsWith(`win`),!Gt&&/^(linux|chrome os)/.test(Ht);var qt=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!qt&&U.includes(`firefox`),!qt&&U.includes(`chrom`);var Jt=/jsdom|happydom/.test(U);function Yt(e){return`nativeEvent`in e}function Xt(e){return e.pointerType===``&&e.isTrusted?!0:Gt&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Zt(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Qt(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function $t(){return typeof window<`u`}function en(e){return rn(e)?(e.nodeName||``).toLowerCase():`#document`}function tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function nn(e){return((rn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function rn(e){return $t()?e instanceof Node||e instanceof tn(e).Node:!1}function W(e){return $t()?e instanceof Element||e instanceof tn(e).Element:!1}function an(e){return $t()?e instanceof HTMLElement||e instanceof tn(e).HTMLElement:!1}function on(e){return!$t()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof tn(e).ShadowRoot}function sn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function cn(e){return/^(table|td|th)$/.test(en(e))}function ln(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var un=/transform|translate|scale|rotate|perspective|filter/,dn=/paint|layout|strict|content/,fn=e=>!!e&&e!==`none`,pn;function mn(e){let t=W(e)?vn(e):e;return fn(t.transform)||fn(t.translate)||fn(t.scale)||fn(t.rotate)||fn(t.perspective)||!gn()&&(fn(t.backdropFilter)||fn(t.filter))||un.test(t.willChange||``)||dn.test(t.contain||``)}function hn(e){let t=bn(e);for(;an(t)&&!_n(t);){if(mn(t))return t;if(ln(t))return null;t=bn(t)}return null}function gn(){return pn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),pn}function _n(e){return/^(html|body|#document)$/.test(en(e))}function vn(e){return tn(e).getComputedStyle(e)}function yn(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bn(e){if(en(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||on(e)&&e.host||nn(e);return on(t)?t.host:t}function xn(e){let t=bn(e);return _n(t)?(e.ownerDocument||e).body:an(t)&&sn(t)?t:xn(t)}function Sn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xn(e),i=r===e.ownerDocument?.body,a=tn(r);if(i){let e=Cn(a);return t.concat(a,a.visualViewport||[],sn(r)?r:[],e&&n?Sn(e):[])}return t.concat(r,Sn(r,[],n))}function Cn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Tn(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&on(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function En(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Dn=`data-base-ui-focusable`,On=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,kn=`data-starting-style`,An=`data-ending-style`,jn={[kn]:``},Mn={[An]:``},Nn={transitionStatus(e){return e===`starting`?jn:e===`ending`?Mn:null}},Pn=`data-open`,Fn=`data-closed`,In=`data-anchor-hidden`,Ln={"data-popup-open":``},Rn={[Pn]:``},zn={[Fn]:``},Bn={[In]:``},Vn={open(e){return e?Ln:null}},Hn={open(e){return e?Rn:zn},anchorHidden(e){return e?Bn:null}},Un={...Hn,...Nn},Wn=`data-trigger-disabled`;function Gn(e,t){if(!W(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Wn);for(let[,e]of t.entries())if(Tn(e,n))return!e.hasAttribute(Wn);return!1}function Kn(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function qn(e){return e.matches(`html,body`)}function Jn(e){return an(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Yn(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${On}`)!=null}function Xn(e){if(!e||Jt)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Zn(e,t){return t!=null&&!Zt(t)?0:typeof e==`function`?e():e}function Qn(e,t,n){let r=Zn(e,n);return typeof r==`number`?r:r?.[t]}function $n(e){return typeof e==`function`?e():e}function er(e,t){return t||e===`click`||e===`mousedown`}function tr(e){return e?.includes(`mouse`)&&e!==`mousedown`}var nr=`none`,rr=`trigger-press`,ir=`trigger-hover`,ar=`trigger-focus`,or=`outside-press`,sr=`escape-key`,cr=`disabled`,lr=`imperative-action`;function ur(e,t,n,r){let i=!1,a=!1,o=r??kt;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}var dr=A.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new It,currentIdRef:{current:null},currentContextRef:{current:null}});function fr(e,t){e.current=t.current}function pr(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=A.useRef(n),a=A.useRef(n),o=A.useRef(null),s=A.useRef(null),c=Lt();return H(()=>{a.current=n,o.current?i.current={open:Qn(i.current,`open`),close:Qn(n,`close`)}:i.current=n},[n,o,i,a]),(0,j.jsx)(dr.Provider,{value:A.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:s,timeout:c}),[r,c]),children:t})}function mr(e,t={open:!1}){let{open:n}=t,r=`rootStore`in e?e.rootStore:e,i=r.useState(`floatingId`),{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=A.useContext(dr),[f,p]=A.useState(!1),m=A.useRef(n);return H(()=>{m.current=n},[n]),H(()=>{function e(){l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current,d.clear()}if(a.current&&!n&&a.current===i){if(p(!1),s){let t=i;return d.start(s,()=>{r.select(`open`)||a.current&&a.current!==t||e()}),()=>{(m.current||a.current!==t)&&d.clear()}}e()}},[n,i,a,o,s,c,l,d,r]),H(()=>{if(!n)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:r.setOpen,setIsInstantPhase:p},a.current=i,o.current={open:0,close:Qn(c.current,`close`)},t!==null&&t!==i?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,ur(nr))):(p(!1),e?.setIsInstantPhase(!1))},[n,i,r,a,o,c,l,d]),H(()=>()=>{if(a.current===i){if(l.current=null,!m.current)return;a.current=null,fr(o,c),d.clear()}},[l,a,o,i,c,d]),A.useMemo(()=>({activeIdRef:a,hasProvider:u,delayRef:o,isInstantPhase:f}),[a,u,o,f])}function hr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function gr(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function _r(e,t,n,r){let i=yt(yr).current;return br(i,e,t,n,r)&&Sr(i,[e,t,n,r]),i.callback}function vr(e){let t=yt(yr).current;return xr(t,e)&&Sr(t,e),t.callback}function yr(){return{callback:null,cleanup:null,refs:[]}}function br(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function xr(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Sr(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}function Cr(e){let t=yt(wr,e).current;return t.next=e,H(t.effect),t}function wr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var Tr={...A},Er=Tr.useInsertionEffect,Dr=Er&&Er!==Tr.useLayoutEffect?Er:e=>e();function Or(e){let t=yt(kr).current;return t.next=e,Dr(t.effect),t.trampoline}function kr(){let e={next:void 0,callback:Ar,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Ar(){}var jr=null;globalThis.requestAnimationFrame;var Mr=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Nr=class e{static create(){return new e}static request(e){return Mr.request(e)}static cancel(e){return Mr.cancel(e)}currentId=jr;request(e){this.cancel(),this.currentId=Mr.request(()=>{this.currentId=jr,e()})}cancel=()=>{this.currentId!==jr&&(Mr.cancel(this.currentId),this.currentId=jr)};disposeEffect=()=>this.cancel};function Pr(){let e=yt(Nr.create).current;return Pt(e.disposeEffect),e}function Fr(e){return e?.ownerDocument||document}var Ir=Math.min,Lr=Math.max,Rr=Math.round,zr=Math.floor,Br=e=>({x:e,y:e}),Vr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Hr(e,t,n){return Lr(e,Ir(t,n))}function Ur(e,t){return typeof e==`function`?e(t):e}function Wr(e){return e.split(`-`)[0]}function Gr(e){return e.split(`-`)[1]}function Kr(e){return e===`x`?`y`:`x`}function qr(e){return e===`y`?`height`:`width`}function Jr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Yr(e){return Kr(Jr(e))}function Xr(e,t,n){n===void 0&&(n=!1);let r=Gr(e),i=Yr(e),a=qr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ai(o)),[o,ai(o)]}function Zr(e){let t=ai(e);return[Qr(e),t,Qr(t)]}function Qr(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var $r=[`left`,`right`],ei=[`right`,`left`],ti=[`top`,`bottom`],ni=[`bottom`,`top`];function ri(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ei:$r:t?$r:ei;case`left`:case`right`:return t?ti:ni;default:return[]}}function ii(e,t,n,r){let i=Gr(e),a=ri(Wr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Qr)))),a}function ai(e){let t=Wr(e);return Vr[t]+e.slice(t.length)}function oi(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function si(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:oi(e)}function ci(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function li(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...li(e,t.id,n)])}function ui(e){return`data-base-ui-${e}`}var di=0;function fi(e,t=`mui`){let[n,r]=A.useState(e),i=e||n;return A.useEffect(()=>{n??(di+=1,r(`${t}-${di}`))},[n,t]),i}var pi=Tr.useId;function mi(e,t){if(pi!==void 0){let n=pi();return e??(t?`${t}-${n}`:n)}return fi(e,t)}var hi=19;function gi(e){return hi>=e}function _i(e){if(!A.isValidElement(e))return null;let t=e,n=t.props;return(gi(19)?n?.ref:t.ref)??null}function vi(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function yi(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function bi(e,t){return typeof e==`function`?e(t):e}function xi(e,t){return typeof e==`function`?e(t):e}var Si={};function Ci(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Ti(t);let a=Ti(e);return t&&(a=Ei(a,t)),n&&(a=Ei(a,n)),r&&(a=Ei(a,r)),i&&(a=Ei(a,i)),a}function wi(e){if(e.length===0)return Si;if(e.length===1)return Ti(e[0]);let t=Ti(e[0]);for(let n=1;n<e.length;n+=1)t=Ei(t,e[n]);return t}function Ti(e){return Ai(e)?{...ji(e,Si)}:Di(e)}function Ei(e,t){return Ai(t)?ji(t,e):Oi(e,t)}function Di(e){let t={...e};for(let e in t){let n=t[e];ki(e,n)&&(t[e]=Ni(n))}return t}function Oi(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=vi(e.style,r);break;case`className`:e[n]=Fi(e.className,r);break;default:e[n]=ki(n,r)?Mi(e[n],r):r}}return e}function ki(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function Ai(e){return typeof e==`function`}function ji(e,t){return Ai(e)?e(t):e??Si}function Mi(e,t){return t?e?(...n)=>{let r=n[0];if(Ii(r)){let i=r;Pi(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ni(t):e}function Ni(e){return e&&((...t)=>{let n=t[0];return Ii(n)&&Pi(n),e(...t)})}function Pi(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Fi(e,t){return t?e?t+` `+e:t:e}function Ii(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function Li(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=Vi(r));let i=Ri(t,n,r);if(n.enabled===!1)return null;let a=n.state??kt;return Hi(e,r,i,a)}function Ri(e,t,n){let{className:r,style:i}=e,{state:a=kt,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?bi(r,a):void 0,d=l?xi(i,a):void 0,f=l?yi(a,c):kt,p=l&&s?zi(s):void 0,m=l?vi(f,p)??{}:kt;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?vr([m.ref,_i(n),...o]):_r(m.ref,_i(n),o):_r(null,null)),l?(u!==void 0&&(m.className=Fi(m.className,u)),d!==void 0&&(m.style=vi(m.style,d)),m):kt}function zi(e){return Array.isArray(e)?wi(e):Ci(void 0,e)}var Bi=Symbol.for(`react.lazy`);function Vi(e){if(e?.$$typeof!==Bi)return e;let t=A.Children.toArray(e)[0];return A.isValidElement(t)?t:e}function Hi(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Ci(n,t.props);return e.ref=n.ref,A.cloneElement(t,e)}if(e&&typeof e==`string`)return Ui(e,n);throw Error(jt(8))}function Ui(e,t){return e===`button`?(0,A.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,A.createElement)(`img`,{alt:``,...t,key:t.key}):A.createElement(e,t)}var Wi={style:{transition:`none`}},Gi={fallbackAxisSide:`end`},Ki=e(T(),1),qi=A.createContext(null),Ji=()=>A.useContext(qi),Yi=ui(`portal`);function Xi(e={}){let{ref:t,container:n,componentProps:r=kt,elementProps:i}=e,a=mi(),o=Ji()?.portalNode,[s,c]=A.useState(null),[l,u]=A.useState(null),d=Or(e=>{e!==null&&u(e)}),f=A.useRef(null);H(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(rn(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=Li(`div`,r,{ref:[t,d],props:[{id:a,[Yi]:``},i]}),m=s&&p?Ki.createPortal(p,s):null;return{node:l,nodeId:A.isValidElement(p)?p.props.id:void 0,subtree:m}}function Zi(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Qi=A.createContext(null),$i=A.createContext(null),G=()=>A.useContext(Qi)?.id||null,ea=e=>{let t=A.useContext($i);return e??t};function ta(e){return e==null?e:`current`in e?e.current:e}function na(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function ra(e){return e!=null&&e.clientX!=null}function ia(e,t={}){let{enabled:n=!0,axis:r=`both`}=t,i=`rootStore`in e?e.rootStore:e,a=i.useState(`open`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.context.dataRef,l=A.useRef(!1),u=A.useRef(null),[d,f]=A.useState(),[p,m]=A.useState([]),h=Or(e=>{i.set(`positionReference`,e)}),g=Or((e,t,n)=>{l.current||(!c.current.openEvent||ra(c.current.openEvent))&&i.set(`positionReference`,na(n??s,{x:e,y:t,axis:r,dataRef:c,pointerType:d}))}),_=Or(e=>{a?u.current||(g(e.clientX,e.clientY,e.currentTarget),m([])):g(e.clientX,e.clientY,e.currentTarget)}),v=Zt(d)?o:a;A.useEffect(()=>{if(!n){h(s);return}if(!v)return;function e(){u.current?.(),u.current=null}let t=tn(o);function r(t){let n=En(t);Tn(o,n)?e():g(t.clientX,t.clientY)}return!c.current.openEvent||ra(c.current.openEvent)?u.current=hr(t,`mousemove`,r):h(s),e},[v,n,o,c,s,i,g,h,p]),A.useEffect(()=>()=>{i.set(`positionReference`,null)},[i]),A.useEffect(()=>{n&&!o&&(l.current=!1)},[n,o]),A.useEffect(()=>{!n&&a&&(l.current=!0)},[n,a]);let y=A.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:_,onMouseEnter:_}},[_]);return A.useMemo(()=>n?{reference:y,trigger:y}:{},[n,y])}function aa(){return!1}function oa(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function sa(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=aa,bubbles:s,externalTree:c}=t,l=`rootStore`in e?e.rootStore:e,u=l.useState(`open`),d=l.useState(`floatingElement`),{dataRef:f,events:p}=l.context,m=ea(c),h=Or(typeof i==`function`?i:()=>!1),g=typeof i==`function`?h:i,_=g!==!1,v=Or(()=>a),{escapeKey:y,outsidePress:b}=oa(s),x=A.useRef(!1),S=A.useRef(!1),C=A.useRef(!1),w=A.useRef(!1),T=A.useRef(!1),E=A.useRef(``),D=A.useRef(null),O=Lt(),k=Lt(),j=Or(()=>{k.clear(),f.current.insideReactTree=!1}),M=Or(e=>{let t=f.current.floatingContext?.nodeId;return(m?li(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),N=Or(e=>Kn(e,l.select(`floatingElement`))||Kn(e,l.select(`domReferenceElement`))),P=Or(e=>{o()&&l.setOpen(!1,ur(rr,e.nativeEvent))}),F=Or(e=>{if(!u||!n||!r||e.key!==`Escape`||T.current||!y&&M(`__escapeKeyBubbles`))return;let t=ur(sr,Yt(e)?e.nativeEvent:e);l.setOpen(!1,t),t.isCanceled||e.preventDefault(),!y&&!t.isPropagationAllowed&&e.stopPropagation()}),I=Or(()=>{f.current.insideReactTree=!0,k.start(0,j)}),ee=Or(e=>{if(!u||!n||e.button!==0)return;let t=En(e.nativeEvent);Tn(l.select(`floatingElement`),t)&&(x.current||(x.current=!0,S.current=!1))}),te=Or(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});A.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),A.useEffect(()=>{if(!u||!n)return u||(w.current=!1),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let e=new It,t=new It,i=Fr(d);function a(){e.clear(),T.current=!0}function o(){e.start(qt?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function p(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function h(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function k(e){let t=f.current.floatingContext?.nodeId,n=m&&li(m.nodesRef.current,t).some(t=>Kn(e,t.context?.elements.floating));return N(e)||n}function A(e){if(h(e)){e.type!==`click`&&!N(e)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let n=En(e),r=`[${ui(`inert`)}]`,i=W(n)?n.getRootNode():null,a=Array.from((on(i)?i:Fr(l.select(`floatingElement`))).querySelectorAll(r)),o=l.context.triggerElements;if(n&&(o.hasElement(n)||o.hasMatchingElement(e=>Tn(e,n))))return;let s=W(n)?n:null;for(;s&&!_n(s);){let e=bn(s);if(_n(e)||!W(e))break;s=e}if(!(a.length&&W(n)&&!qn(n)&&!Tn(n,l.select(`floatingElement`))&&a.every(e=>!Tn(s,e)))){if(an(n)&&!(`touches`in e)){let t=_n(n),r=vn(n),i=/auto|scroll/,a=t||i.test(r.overflowX),o=t||i.test(r.overflowY),s=a&&n.clientWidth>0&&n.scrollWidth>n.clientWidth,c=o&&n.clientHeight>0&&n.scrollHeight>n.clientHeight,l=r.direction===`rtl`,u=c&&(l?e.offsetX<=n.offsetWidth-n.clientWidth:e.offsetX>n.clientWidth),d=s&&e.offsetY>n.clientHeight;if(u||d)return}if(!k(e)){if(p()===`intentional`){if(e.detail!==0&&!Xt(e)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}typeof g==`function`&&!g(e)||M(`__outsidePressBubbles`)||(l.setOpen(!1,ur(or,e)),j())}}}function P(e){p()===`sloppy`&&e.pointerType!==`touch`&&l.select(`open`)&&n&&!N(e)&&A(e)}function I(e){if(p()!==`sloppy`||!l.select(`open`)||!n||N(e))return;let t=e.touches[0];t&&(D.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function ee(e,t){let n=En(e);if(!n)return;let r=hr(n,e.type,()=>{t(e),r()})}function te(e){E.current=`touch`,ee(e,I)}function L(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&ee(e,e=>{e.type===`pointerdown`?P(e):A(e)})}function ne(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),p()===`intentional`&&(e.type===`pointercancel`?n&&s():k(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function re(e){if(p()!==`sloppy`||!D.current||N(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(A(e),O.clear(),D.current=null)}function ie(e){ee(e,re)}function R(e){p()===`sloppy`&&D.current&&!N(e)&&(D.current.dismissOnTouchEnd&&A(e),O.clear(),D.current=null)}function ae(e){ee(e,R)}let oe=gr(r&&gr(hr(i,`keydown`,F),hr(i,`compositionstart`,a),hr(i,`compositionend`,o)),_&&gr(hr(i,`click`,L,!0),hr(i,`pointerdown`,L,!0),hr(i,`pointerup`,ne,!0),hr(i,`pointercancel`,ne,!0),hr(i,`mousedown`,L,!0),hr(i,`mouseup`,ne,!0),hr(i,`touchstart`,te,{capture:!0,passive:!0}),hr(i,`touchmove`,ie,{capture:!0,passive:!0}),hr(i,`touchend`,ae,{capture:!0,passive:!0})));return()=>{oe(),e.clear(),t.clear(),c(),C.current=!1,j()}},[f,d,r,_,g,u,n,y,b,F,j,v,M,N,m,l,O]);let L=A.useMemo(()=>({onKeyDown:F,onPointerDown:P,onClick:P}),[F,P]),ne=A.useMemo(()=>({onKeyDown:F,onPointerDown:te,onMouseDown:te,onClickCapture:I,onMouseDownCapture(e){I(),ee(e)},onPointerDownCapture(e){I(),ee(e)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[F,I,ee,te]);return A.useMemo(()=>n?{reference:L,floating:ne,trigger:L}:{},[n,L,ne])}function ca(e,t,n){let{reference:r,floating:i}=e,a=Jr(t),o=Yr(t),s=qr(o),c=Wr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Gr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function la(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ur(t,e),p=si(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ci(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ci(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ua=50,da=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:la},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ca(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ua&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ca(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},fa=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ur(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Wr(r),_=Jr(o),v=Wr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ai(o)]:Zr(o)),x=p!==`none`;!d&&x&&b.push(...ii(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Xr(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Jr(t)||T.every(e=>Jr(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Jr(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},pa=new Set([`left`,`top`]);async function ma(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Wr(n),s=Gr(n),c=Jr(n)===`y`,l=pa.has(o)?-1:1,u=a&&c?-1:1,d=Ur(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ha=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await ma(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ga=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ur(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Jr(i),p=Kr(f),m=u[p],h=u[f],g=(e,t)=>Hr(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},_a=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ur(e,t),u={x:n,y:r},d=Jr(i),f=Kr(d),p=u[f],m=u[d],h=Ur(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=pa.has(Wr(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},va=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Ur(e,t),c=await i.detectOverflow(t,s),l=Wr(n),u=Gr(n),d=Jr(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ir(p-c[m],g),y=Ir(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Lr(c.left,c.right):S=p-2*Lr(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ya(e){let t=vn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=an(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Rr(n)!==a||Rr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ba(e){return W(e)?e:e.contextElement}function xa(e){let t=ba(e);if(!an(t))return Br(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ya(t),o=(a?Rr(n.width):n.width)/r,s=(a?Rr(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Sa=Br(0);function Ca(e){let t=tn(e);return!gn()||!t.visualViewport?Sa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wa(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===tn(e)}function Ta(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ba(e),o=Br(1);t&&(r?W(r)&&(o=xa(r)):o=xa(e));let s=wa(a,n,r)?Ca(a):Br(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=tn(a),t=W(r)?tn(r):r,n=e,i=Cn(n);for(;i&&t!==n;){let e=xa(i),t=i.getBoundingClientRect(),r=vn(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=tn(i),i=Cn(n)}}return ci({width:u,height:d,x:c,y:l})}function Ea(e,t){let n=yn(e).scrollLeft;return t?t.left+n:Ta(nn(e)).left+n}function Da(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ea(e,n),y:n.top+t.scrollTop}}function Oa(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=nn(r),s=t?ln(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Br(1),u=Br(0),d=an(r);if((d||!a)&&((en(r)!==`body`||sn(o))&&(c=yn(r)),d)){let e=Ta(r);l=xa(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Da(o,c):Br(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ka(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Aa(e){let t=yn(e),n=e.ownerDocument.body,r=Lr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Lr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ea(e),o=-t.scrollTop;return vn(n).direction===`rtl`&&(a+=Lr(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ja=25;function Ma(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=tn(e),a=nn(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!gn()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ea(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ja&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Na(e,t){let n=Ta(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xa(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Pa(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Ma(e,n,t);else if(t===`document`)r=Aa(nn(e));else if(W(t))r=Na(t,n);else{let n=Ca(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ci(r)}function Fa(e,t){let n=t.get(e);if(n)return n;let r=Sn(e,[],!1).filter(e=>W(e)&&en(e)!==`body`),i=null,a=vn(e).position===`fixed`,o=a?bn(e):e;for(;W(o)&&!_n(o);){let e=vn(o),t=mn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bn(o)}return t.set(e,r),r}function Ia(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ln(t)?[]:Fa(t,this._c):[].concat(n),r],o=Pa(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Pa(t,a[e],i);s=Lr(n.top,s),c=Ir(n.right,c),l=Ir(n.bottom,l),u=Lr(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function La(e){let{width:t,height:n}=ya(e);return{width:t,height:n}}function Ra(e,t,n){let r=an(t),i=nn(t),a=n===`fixed`,o=Ta(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Br(0);if((r||!a)&&((en(t)!==`body`||sn(i))&&(s=yn(t)),r)){let e=Ta(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ea(i));let l=i&&!r&&!a?Da(i,s):Br(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function za(e){return vn(e).position===`static`}function Ba(e,t){if(!an(e)||vn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return nn(e)===n&&(n=n.ownerDocument.body),n}function Va(e,t){let n=tn(e);if(ln(e))return n;if(!an(e)){let t=bn(e);for(;t&&!_n(t);){if(W(t)&&!za(t))return t;t=bn(t)}return n}let r=Ba(e,t);for(;r&&cn(r)&&za(r);)r=Ba(r,t);return r&&_n(r)&&za(r)&&!mn(r)?n:r||hn(e)||n}var Ha=async function(e){let t=this.getOffsetParent||Va,n=this.getDimensions,r=await n(e.floating);return{reference:Ra(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ua(e){return vn(e).direction===`rtl`}var Wa={convertOffsetParentRelativeRectToViewportRelativeRect:Oa,getDocumentElement:nn,getClippingRect:Ia,getOffsetParent:Va,getElementRects:Ha,getClientRects:ka,getDimensions:La,getScale:xa,isElement:W,isRTL:Ua};function Ga(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ka(e,t,n){let r=null,i,a=nn(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=zr(d),h=zr(a.clientWidth-(u+f)),g=zr(a.clientHeight-(d+p)),_=zr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Lr(0,Ir(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ga(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=tn(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function qa(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=ba(e),u=i||a?[...l?Sn(l):[],...t?Sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ka(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Ta(e):null;c&&g();function g(){let t=Ta(e);h&&!Ga(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Ja=ha,Ya=ga,Xa=fa,Za=va,Qa=_a,$a=(e,t,n)=>{let r=new Map,i=n??{},a={...Wa,...i.platform,_c:r};return da(e,t,{...i,platform:a})},eo=typeof document<`u`?A.useLayoutEffect:function(){};function to(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!to(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!to(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function no(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ro(e,t){let n=no(e);return Math.round(t*n)/n}function io(e){let t=A.useRef(e);return eo(()=>{t.current=e}),t}function ao(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=A.useState(r);to(f,r)||p(r);let[m,h]=A.useState(null),[g,_]=A.useState(null),v=A.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=A.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=A.useRef(null),C=A.useRef(null),w=A.useRef(u),T=c!=null,E=io(c),D=io(i),O=io(l),k=A.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),$a(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};j.current&&!to(w.current,t)&&(w.current=t,Ki.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);eo(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=A.useRef(!1);eo(()=>(j.current=!0,()=>{j.current=!1}),[]),eo(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let M=A.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),N=A.useMemo(()=>({reference:b,floating:x}),[b,x]),P=A.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=ro(N.floating,u.x),r=ro(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...no(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return A.useMemo(()=>({...u,update:k,refs:M,elements:N,floatingStyles:P}),[u,k,M,N,P])}var oo=(e,t)=>{let n=Ja(e);return{name:n.name,fn:n.fn,options:[e,t]}},so=(e,t)=>{let n=Ya(e);return{name:n.name,fn:n.fn,options:[e,t]}},co=(e,t)=>({fn:Qa(e).fn,options:[e,t]}),lo=(e,t)=>{let n=Xa(e);return{name:n.name,fn:n.fn,options:[e,t]}},uo=(e,t)=>{let n=Za(e);return{name:n.name,fn:n.fn,options:[e,t]}},fo=t((e=>{var t=C();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),po=t(((e,t)=>{t.exports=fo()})),mo=t((e=>{var t=C(),n=po();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ho=t(((e,t)=>{t.exports=mo()})),go=po(),_o=ho(),vo=gi(19)?xo:So;function yo(e,t,n,r,i){return vo(e,t,n,r,i)}function bo(e,t,n,r,i){let a=A.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,go.useSyncExternalStore)(e.subscribe,a,a)}Ct({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,go.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function xo(e,t,n,r,i){let a=St();if(!a)return bo(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function So(e,t,n,r,i){return(0,_o.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Co=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return yo(this,e,t,n,r)}},wo=class extends Co{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){A.useDebugValue(e);let n=this;H(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;H(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;H(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){A.useDebugValue(e);let n=this,r=t!==void 0;H(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return A.useDebugValue(e),yo(this,this.selectors[e],t,n,r)}useContextCallback(e,t){A.useDebugValue(e);let n=Or(t??Dt);this.context[e]=n}useStateSetter(e){let t=A.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},To={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Eo=class extends wo{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Zi(),nested:n,triggerElements:i},To),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Qt(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Do(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=o,f=A.useRef(null);r===void 0&&f.current===null&&(f.current=new Eo({open:s,transitionStatus:void 0,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:d,floatingId:i,syncOnly:!0,nested:a}));let p=r??f.current;return t.useSyncedValue(`floatingId`,i),H(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};W(c)&&(e.domReferenceElement=c),p.state.positionReference===p.state.referenceElement&&(e.positionReference=c),p.update(e)},[s,i,c,l,p]),p.context.onOpenChange=d,p.context.nested=a,p}function Oo(e,t=!1,n=!1,r=!1){let[i,a]=A.useState(e&&t?`idle`:void 0),[o,s]=A.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),H(()=>{if(!e&&o&&i!==`ending`&&n){let e=Nr.request(()=>{a(`ending`)});return()=>{Nr.cancel(e)}}},[e,o,i,n]),H(()=>{if(!e||t)return;let n=Nr.request(()=>{a(void 0)});return()=>{Nr.cancel(n)}},[t,e]),H(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Nr.request(()=>{a(`idle`)});return()=>{Nr.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var ko=null;function Ao(e){if(!ko){let e=[];ko=e,queueMicrotask(()=>{ko=null,Ki.flushSync(()=>{for(let t of e)t()})})}ko.push(e)}function jo(e,t=!1,n=!1){let r=Pr();return Or((i,a=null)=>{r.cancel();let o=ta(e);if(o==null)return;let s=o,c=()=>{n?Ao(()=>{a?.aborted||i()}):Ki.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(s.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||c()},()=>{a?.aborted||(s.getAnimations().some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=kn;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Mo(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=Or(a),s=jo(r,n,i);A.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}var No={tabIndex:-1,[Dn]:``};function Po(e,t=!1){let n=mi(),r=G()!=null,i=yt(()=>e(n,r)).current;return Do({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Fo({handle:e,store:t}){return H(()=>e.attachStore(t),[e,t]),null}function Io(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Lo(e,t){let n=A.useRef(null);return Or(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Io(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Io(t))})}function K(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function Ro(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function zo(e,t,n,r={}){let i=n.reason,a=i===ir,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Ro(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=K(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Ki.flushSync(l):l()}function Bo(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Lo(e,n),o=Or(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=Or(e=>{a(e),e&&o(e)});return H(()=>(s(t.current),()=>s(null)),[s,t,n,e]),H(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Vo(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=A.useRef(null),i=e.useState(`open`);H(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=ur(nr);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function Ho(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=Oo(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),c=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:c});let l=Or(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return Mo({enabled:i&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}function Uo(e,t){e.useSyncedValues(t),H(()=>()=>{e.update({activeTriggerProps:kt,inactiveTriggerProps:kt,popupProps:kt})},[e])}var Wo=class{constructor(){this.idMap=new Map}add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}};function Go(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Eo({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:kt,inactiveTriggerProps:kt,popupProps:kt}}var Ko=e=>e.triggerIdProp??e.activeTriggerId,qo=e=>e.openProp??e.open,Jo=e=>(e.popupElement?.id??e.floatingId)||void 0;function Yo(e,t){return t!==void 0&&qo(e)&&Ko(e)===t}function Xo(e,t){return Yo(e,t)?!0:t!==void 0&&qo(e)&&Ko(e)==null&&e.triggerCount===1}var Zo={open:qo,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Ko,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Jo,isTriggerActive:(e,t)=>t!==void 0&&Ko(e)===t,isOpenedByTrigger:(e,t)=>Yo(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Ko(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Xo(e,t)?Jo(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Qo(e){let t=A.useCallback(t=>e===void 0?Dt:e.subscribeStore(t),[e]),n=A.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,go.useSyncExternalStore)(t,n,()=>e?.serverStore)}function $o(e){return es(e,e.rootContext)}function es(e,t){let{nodeId:n,externalTree:r}=e,i=t.useState(`referenceElement`),a=t.useState(`floatingElement`),o=t.useState(`domReferenceElement`),s=t.useState(`open`),c=t.useState(`floatingId`),[l,u]=A.useState(null),[d,f]=A.useState(void 0),[p,m]=A.useState(void 0),h=A.useRef(null),g=ea(r),_=A.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),v=ao({...e,elements:{..._,...l&&{reference:l}}}),y=W(d)?d:null,b=p===void 0?t.state.floatingElement:p;t.useSyncedValue(`referenceElement`,d??null),t.useSyncedValue(`domReferenceElement`,d===void 0?o:y),t.useSyncedValue(`floatingElement`,b);let x=A.useCallback(e=>{let t=W(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),v.refs.setReference(t)},[v.refs]),S=A.useCallback(e=>{(W(e)||e===null)&&(h.current=e,f(e)),(W(v.refs.reference.current)||v.refs.reference.current===null||e!==null&&!W(e))&&v.refs.setReference(e)},[v.refs,f]),C=A.useCallback(e=>{m(e),v.refs.setFloating(e)},[v.refs]),w=A.useMemo(()=>({...v.refs,setReference:S,setFloating:C,setPositionReference:x,domReference:h}),[v.refs,S,C,x]),T=A.useMemo(()=>({...v.elements,domReference:o}),[v.elements,o]),E=A.useMemo(()=>({...v,dataRef:t.context.dataRef,open:s,onOpenChange:t.setOpen,events:t.context.events,floatingId:c,refs:w,elements:T,nodeId:n,rootStore:t}),[v,w,T,n,t,s,c]);return H(()=>{o&&(h.current=o)},[o]),H(()=>{t.context.dataRef.current.floatingContext=E;let e=g?.nodesRef.current.find(e=>e.id===n);e&&(e.context=E)}),A.useMemo(()=>({...v,context:E,refs:w,elements:T,rootStore:t}),[v,w,T,E,t])}var ts=Kt&&qt;function ns(e,t={}){let{enabled:n=!0,delay:r}=t,i=`rootStore`in e?e.rootStore:e,{events:a,dataRef:o}=i.context,s=A.useRef(!1),c=A.useRef(null),l=A.useRef(!0),u=Lt();A.useEffect(()=>{let e=i.select(`domReferenceElement`);if(!n)return;let t=tn(e);function r(){let e=i.select(`domReferenceElement`);!i.select(`open`)&&an(e)&&e===wn(Fr(e))&&(s.current=!0,c.current=e)}function a(){l.current=!0}function o(){l.current=!1}return gr(hr(t,`blur`,r),ts&&hr(t,`keydown`,a,!0),ts&&hr(t,`pointerdown`,o,!0))},[i,n]),A.useEffect(()=>{if(!n)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=i.select(`domReferenceElement`);W(e)&&(c.current=e,s.current=!0)}}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[a,n,i]);let d=A.useMemo(()=>{function e(){s.current=!1,c.current=null}return{onMouseLeave(){e()},onFocus(t){let n=t.currentTarget;if(s.current){if(c.current===n)return;e()}let a=En(t.nativeEvent);if(W(a)){if(ts&&!t.relatedTarget){if(!l.current&&!Jn(a))return}else if(!Xn(a))return}let o=Gn(t.relatedTarget,i.context.triggerElements),{nativeEvent:d,currentTarget:f}=t,p=typeof r==`function`?r():r;i.select(`open`)&&o||p===0||p===void 0?i.setOpen(!0,ur(ar,d,f)):u.start(p,()=>{s.current||i.setOpen(!0,ur(ar,d,f))})},onBlur(t){e();let n=t.relatedTarget,r=t.nativeEvent,a=W(n)&&n.hasAttribute(ui(`focus-guard`))&&n.getAttribute(`data-type`)===`outside`;u.start(0,()=>{let e=i.select(`domReferenceElement`),t=wn(Fr(e));!n&&t===e||Tn(o.current.floatingContext?.refs.floating.current,t)||Tn(e,t)||a||Gn(n??t,i.context.triggerElements)||i.setOpen(!1,ur(ar,r))})}}},[o,r,i,u]);return A.useMemo(()=>n?{reference:d,trigger:d}:{},[n,d])}var rs=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new It,this.restTimeout=new It,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},is=new WeakMap;function as(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&is.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),is.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function os(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=is.get(n);a&&a!==e&&as(a),as(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,is.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function ss(e){let t=e.context.dataRef.current,n=yt(()=>t.hoverInteractionState??rs.create()).current;return t.hoverInteractionState||=n,Pt(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function cs(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=`rootStore`in e?e.rootStore:e,o=a.useState(`open`),s=a.useState(`floatingElement`),c=a.useState(`domReferenceElement`),{dataRef:l}=a.context,u=ea(),d=G(),f=ss(a),p=Lt(),m=Or(()=>er(l.current.openEvent?.type,f.interactedInside)),h=Or(()=>tr(l.current.openEvent?.type)),g=Or(()=>{as(f)});H(()=>{o||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,g())},[o,f,g]),A.useEffect(()=>g,[g]),H(()=>{if(n&&o&&f.handleCloseOptions?.blockPointerEvents&&h()&&W(c)&&s){let e=c,t=s,n=Fr(s),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=f.pointerEventsScopeElement===t?null:f.pointerEventsScopeElement,a=r===t?null:r,o=f.handleCloseOptions?.getScope?.()??i??a??e.closest(`[data-rootownerid]`)??n.body;return os(f,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{g()}}},[n,o,c,s,f,h,u,d,g]),A.useEffect(()=>{if(!n)return;function e(){return!!(u&&d&&li(u.nodesRef.current,d).length>0)}function t(e){let t=Qn(r,`close`,f.pointerType),n=()=>{a.setOpen(!1,ur(ir,e)),u?.events.emit(`floating.closed`,e)};t?f.openChangeTimeout.start(t,n):(f.openChangeTimeout.clear(),n())}function o(e){let t=En(e);Yn(t)?f.interactedInside=t?.closest(`[aria-haspopup]`)!=null:f.interactedInside=!1}function c(){f.openChangeTimeout.clear(),p.clear(),u?.events.off(`floating.closed`,v),g()}function _(n){if(e()&&u){u.events.on(`floating.closed`,v);return}if(Gn(n.relatedTarget,a.context.triggerElements))return;let r=l.current.floatingContext?.nodeId??i,o=n.relatedTarget;u&&r&&W(o)&&li(u.nodesRef.current,r,!1).some(e=>Tn(e.context?.elements.floating,o))||(f.handler?f.handler(n):(g(),h()&&!m()&&t(n)))}function v(t){u&&d&&!e()&&p.start(0,()=>{u.events.off(`floating.closed`,v),a.setOpen(!1,ur(ir,t)),u.events.emit(`floating.closed`,t)})}let y=s;return gr(y&&hr(y,`mouseenter`,c),y&&hr(y,`mouseleave`,_),y&&hr(y,`pointerdown`,o,!0),()=>{u?.events.off(`floating.closed`,v)})},[n,s,a,l,r,i,h,m,g,f,u,d,p])}var ls={current:null};function us(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=ls,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,h=`rootStore`in e?e.rootStore:e,{dataRef:g,events:_}=h.context,v=ea(l),y=ss(h),b=A.useRef(!1),x=Cr(i),S=Cr(r),C=Cr(o),w=Cr(n),T=Cr(p),E=Cr(f),D=Or(()=>er(g.current.openEvent?.type,y.interactedInside)),O=Or(()=>T.current?.()!==!1),k=Or((e,t,n)=>{let r=h.context.triggerElements;if(r.hasElement(t))return!e||!Tn(e,t);if(!W(n))return!1;let i=n;return r.hasMatchingElement(e=>Tn(e,i))&&(!e||!Tn(e,i))}),j=Or(()=>{y.handler&&=(Fr(h.select(`domReferenceElement`)).removeEventListener(`mousemove`,y.handler),void 0)}),M=Or(()=>{as(y)});return u&&(y.handleCloseOptions=i?.__options),A.useEffect(()=>j,[j]),A.useEffect(()=>{if(!n)return;function e(e){e.open?b.current=!1:(b.current=e.reason===ir,j(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[n,_,y,j]),A.useEffect(()=>{if(!n)return;function e(e,t=!0){let n=Qn(S.current,`close`,y.pointerType);n?y.openChangeTimeout.start(n,()=>{h.setOpen(!1,ur(ir,e)),v?.events.emit(`floating.closed`,e)}):t&&(y.openChangeTimeout.clear(),h.setOpen(!1,ur(ir,e)),v?.events.emit(`floating.closed`,e))}let t=c.current??(u?h.select(`domReferenceElement`):null);if(!W(t))return;function r(e){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,a&&!Zt(y.pointerType))return;let t=$n(C.current),n=Qn(S.current,`open`,y.pointerType),r=En(e),i=e.currentTarget??null,o=h.select(`domReferenceElement`),s=i;if(W(r)&&!h.context.triggerElements.hasElement(r)){for(let e of h.context.triggerElements.elements())if(Tn(e,r)){s=e;break}}W(i)&&W(o)&&!h.context.triggerElements.hasElement(i)&&Tn(i,o)&&(s=o);let c=s!=null&&k(o,s,r),l=h.select(`open`),u=E.current?.()??h.select(`transitionStatus`)===`ending`,d=!l&&u&&b.current,f=!c&&W(s)&&W(o)&&Tn(o,s)&&d,p=t>0&&!n,m=c&&(l||d)||f,g=!l||c;m?O()&&h.setOpen(!0,ur(ir,e,s)):p||(n?y.openChangeTimeout.start(n,()=>{g&&O()&&h.setOpen(!0,ur(ir,e,s))}):g&&O()&&h.setOpen(!0,ur(ir,e,s)))}function i(t){if(D()){M();return}j();let n=Fr(h.select(`domReferenceElement`));y.restTimeout.clear(),y.restTimeoutPending=!1;let r=g.current.floatingContext??d?.();if(!Gn(t.relatedTarget,h.context.triggerElements)){if(x.current&&r){h.select(`open`)||y.openChangeTimeout.clear();let i=c.current;y.handler=x.current({...r,tree:v,x:t.clientX,y:t.clientY,onClose(){M(),j(),w.current&&!D()&&i===h.select(`domReferenceElement`)&&e(t,!0)}}),n.addEventListener(`mousemove`,y.handler),y.handler(t)}else y.pointerType===`touch`&&Tn(h.select(`floatingElement`),t.relatedTarget)||e(t)}}function o(e){Tn(t,e.relatedTarget)||(y.openChangeTimeout.clear(),y.restTimeout.clear(),y.restTimeoutPending=!1)}let l=m?hr(t,`mouseout`,o):void 0;return s?gr(hr(t,`mousemove`,r,{once:!0}),hr(t,`mouseenter`,r),hr(t,`mouseleave`,i),l):gr(hr(t,`mouseenter`,r),hr(t,`mouseleave`,i),l)},[j,M,g,S,h,n,x,y,u,k,D,a,s,C,c,v,w,d,E,O,m]),A.useMemo(()=>{if(!n)return;function e(e){y.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,n=e.currentTarget,r=h.select(`domReferenceElement`),i=h.select(`open`),o=k(r,n,e.target);if(a&&!Zt(y.pointerType))return;if(i&&o&&y.handleCloseOptions?.blockPointerEvents){let e=h.select(`floatingElement`);if(e){let t=y.handleCloseOptions?.getScope?.()??n.ownerDocument.body;os(y,{scopeElement:t,referenceElement:n,floatingElement:e})}}let s=$n(C.current);if(i&&!o||s===0||!o&&y.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;y.restTimeout.clear();function c(){if(y.restTimeoutPending=!1,D())return;let e=h.select(`open`);!y.blockMouseMove&&(!e||o)&&O()&&h.setOpen(!0,ur(ir,t,n))}y.pointerType===`touch`?Ki.flushSync(()=>{c()}):o&&i?c():(y.restTimeoutPending=!0,y.restTimeout.start(s,c))}}},[n,y,D,k,a,h,C,O])}var ds=.1,fs=ds*ds,ps=.5;function ms(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function hs(e,t,n,r,i,a,o,s,c,l){let u=!1;return ms(e,t,n,r,i,a)&&(u=!u),ms(e,t,i,a,o,s)&&(u=!u),ms(e,t,o,s,c,l)&&(u=!u),ms(e,t,c,l,n,r)&&(u=!u),u}function gs(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function _s(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function vs(e={}){let{blockPointerEvents:t=!1}=e,n=new It,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*fs;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=En(r),g=r.type===`mouseleave`,_=Tn(u,h),v=Tn(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&W(r.relatedTarget)&&Tn(u,r.relatedTarget))return;function y(){return!!(s&&li(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=_s(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=_s(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=_s(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=_s(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!gs(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?ps/2:ps*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+ps+1,o=C||T?S.bottom-ps:S.top,s=C?T?S.bottom-ps:S.top:S.bottom-ps;M=hs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?ps/2:ps*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-ps,o=C||T?S.top+ps:S.bottom,s=C?T?S.top+ps:S.bottom:S.top+ps;M=hs(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?ps/2:ps*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+ps+1,o=w||E?S.right-ps:S.left,s=w?E?S.right-ps:S.left:S.right-ps;M=hs(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?ps/2:ps*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-ps,o=w||E?S.left+ps:S.right,s=w?E?S.left+ps:S.right:S.left+ps;M=hs(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}var ys={...Zo,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},bs=class extends wo{constructor(e,t,n){let r=new Wo;super(xs(e,r,t,n),Ss(r),ys)}setOpen=(e,t)=>{zo(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ur(rr,e))}};function xs(e,t,n,r=!1){return{...Go(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Ss(e){return{popupRef:A.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}var Cs=wt(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Po((e,t)=>new bs({open:n,openProp:r,activeTriggerId:d,triggerIdProp:u},e,t));p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`mounted`),v=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),Vo(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:y,transitionStatus:b}=Ho(h,p),x=p.useState(`isInstantPhase`),S=p.useState(`instantType`),C=p.useState(`lastOpenChangeReason`),w=A.useRef(null);H(()=>{m&&t&&p.setOpen(!1,ur(cr))},[m,t,p]),H(()=>{b===`ending`&&C===`none`||b!==`ending`&&x?(S!==`delay`&&(w.current=S),p.set(`instantType`,`delay`)):w.current!==null&&(p.set(`instantType`,w.current),w.current=null)},[b,x,C,S,p]),H(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]),A.useImperativeHandle(o,()=>({unmount:y,close:()=>p.setOpen(!1,ur(lr))}),[y,p]);let T=h||_||!t&&a!==`none`;return(0,j.jsxs)(Mt.Provider,{value:p,children:[l&&(0,j.jsx)(Fo,{handle:l,store:p}),T&&(0,j.jsx)(ws,{store:p,disabled:t,trackCursorAxis:a}),typeof f==`function`?f({payload:v}):f]})});function ws({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState(`floatingRootContext`),i=sa(r,{enabled:!t,referencePress:()=>e.select(`closeOnClick`)}),a=ia(r,{enabled:!t&&n!==`none`,axis:n===`none`?void 0:n}),o=A.useMemo(()=>Ci(a.reference,i.reference),[a.reference,i.reference]);return Uo(e,{activeTriggerProps:o,inactiveTriggerProps:o,popupProps:i.floating??kt}),null}function Ts(e){return mi(e,`base-ui`)}var Es=A.createContext(void 0);function Ds(){return A.useContext(Es)}var Os=`data-base-ui-tooltip-trigger`;function ks(e){if(`composedPath`in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if(W(n))return n}}let t=e.target;return W(t)?t:null}function As(e){let t=e;for(;t;){let e=t.closest(`[${Os}]`);if(e)return e;let n=t.getRootNode();t=`host`in n&&W(n.host)?n.host:null}return null}var js=Tt(function(e,t){let{render:n,className:r,style:i,handle:a,payload:o,disabled:s,delay:c,closeOnClick:l=!0,closeDelay:u,id:d,...f}=e,p=Nt(!0),m=Qo(a)??p;if(!m)throw Error(jt(82));let h=Ts(d),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),v=m.useState(`floatingRootContext`),y=A.useRef(null),b=u??0,{registerTrigger:x,isMountedByThisTrigger:S}=Bo(h,y,m,{payload:o,closeOnClick:l,closeDelay:b}),C=Ds(),{activeIdRef:w,delayRef:T,isInstantPhase:E,hasProvider:D}=mr(v,{open:_}),O=ss(v);m.useSyncedValue(`isInstantPhase`,E);let k=m.useState(`disabled`),j=s??k,M=Cr(j),N=m.useState(`trackCursorAxis`),P=m.useState(`disableHoverablePopup`),F=A.useRef(!1),I=Lt(),ee=A.useRef(void 0);function te(){return D&&w.current!=null?0:c??C??600}function L(e){let t=y.current;if(!t||!e)return!1;let n=As(e);return n!==null&&n!==t&&Tn(t,n)}function ne(e){let t=L(e);return F.current=t,t&&(O.openChangeTimeout.clear(),O.restTimeout.clear(),O.restTimeoutPending=!1,I.clear()),t}let re=us(v,{enabled:!j,mouseOnly:!0,move:!1,handleClose:!P&&N!==`both`?vs():null,restMs:te,delay(){return u==null&&D?{close:Qn(T.current,`close`)}:{close:b}},triggerElementRef:y,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`,shouldOpen(){return!F.current}}),ie=ns(v,{enabled:!j}).reference,R=e=>{let t=F.current,n=ks(e),r=ne(n),i=y.current,a=i&&n&&Tn(i,n);if(r&&m.select(`open`)&&m.select(`lastOpenChangeReason`)===`trigger-hover`)m.setOpen(!1,ur(ir,e));else if(t&&!r&&a&&!M.current&&!m.select(`open`)&&i&&Zt(ee.current)){let t=()=>{F.current||M.current||m.select(`open`)||m.setOpen(!0,ur(ir,e,i))},n=te();n===0?(I.clear(),t()):I.start(n,t)}},ae=m.useState(`triggerProps`,S);return Li(`button`,e,{state:{open:_},ref:[t,x,y],props:[re,ie,S||N!==`none`?ae:void 0,{onMouseOver(e){R(e.nativeEvent)},onFocus(e){L(ks(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){F.current=!1,I.clear(),ee.current=void 0},onPointerEnter(e){ee.current=e.pointerType},onPointerDown(e){ee.current=e.pointerType,m.set(`closeOnClick`,l),l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},onClick(e){l&&!m.select(`open`)&&m.cancelPendingOpen(e.nativeEvent)},id:h,[Wn]:j?``:void 0,[Os]:j?void 0:``},f],stateAttributesMapping:Vn})}),Ms=A.createContext(void 0);function Ns(){let e=A.useContext(Ms);if(e===void 0)throw Error(jt(70));return e}var Ps=A.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,style:o,...s}=e,{node:c,subtree:l}=Xi({container:r,ref:t,componentProps:e,elementProps:s});return!l&&!c?null:(0,j.jsxs)(A.Fragment,{children:[l,c&&Ki.createPortal(n,c)]})}),Fs=A.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return Nt().useState(`mounted`)||n?(0,j.jsx)(Ms.Provider,{value:n,children:(0,j.jsx)(Ps,{ref:t,...r})}):null}),Is=A.createContext(void 0);function Ls(){let e=A.useContext(Is);if(e===void 0)throw Error(jt(71));return e}var Rs=A.createContext(void 0);function zs(){return A.useContext(Rs)?.direction??`ltr`}var Bs=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=Ur(e,t)||{};if(l==null)return{};let f=si(u),p={x:n,y:r},m=Yr(i),h=qr(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];w&&await o.isElement?.(C)||(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=Hr(k,j,A),N=!c.arrow&&Gr(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),Vs=(e,t)=>{let{name:n,fn:r}=Bs(e);return{name:n,fn:r,options:[e,t]}},Hs={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Us={sideX:`left`,sideY:`top`},Ws=`--available-width`,Gs=`--available-height`,Ks=`--anchor-width`,qs=`--anchor-height`,Js=`--transform-origin`,Ys=Ws,Xs=Gs;function Zs(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Qs(e,t,n){let{rects:r,placement:i}=e;return{side:Zs(t,Wr(i),n),align:Gr(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $s(e){return ec(e,$o)}function ec(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,[C,w]=A.useState(null);!g&&C!==null&&w(null);let T=_.side||`flip`,E=_.align||`flip`,D=_.fallbackAxisSide||`end`,O=v?.crossAxis??!1,k=v?.rootBoundary,j=typeof n==`function`?n:void 0,M=Or(j),N=j?M:n,P=Cr(n),F=Cr(g),I=zs()===`rtl`,ee=C||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":I?`left`:`right`,"inline-start":I?`right`:`left`}[i],te=o===`center`?ee:`${ee}-${o}`,L=l;typeof L==`number`?L={top:L,right:L,bottom:L,left:L}:L&&={top:L.top||0,right:L.right||0,bottom:L.bottom||0,left:L.left||0};let ne=+(i===`bottom`),re=+(i===`top`),ie=+(i===`right`),R=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:L},oe=A.useRef(null),se=Cr(a),ce=Cr(s),le=typeof a==`function`?0:a,ue=typeof s==`function`?0:s,de=[];p&&de.push(p),de.push(oo(e=>{let t=Qs(e,i,I),n=typeof se.current==`function`?se.current(t):se.current,r=typeof ce.current==`function`?ce.current(t):ce.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,ue,I,i]));let z=E===`none`&&T!==`shift`,fe=!z&&(u||O||T===`shift`),pe=T===`none`?null:lo({...ae,padding:{top:L.top+1+ne,right:L.right+1+R,bottom:L.bottom+1+re,left:L.left+1+ie},mainAxis:!O&&T===`flip`,crossAxis:E===`flip`&&`alignment`,fallbackAxisSideDirection:D}),me=z?null:so({...ae,rootBoundary:k,mainAxis:E!==`none`,crossAxis:fe,limiter:u||O?void 0:co(e=>{if(!oe.current)return{};let{width:t,height:n}=oe.current.getBoundingClientRect(),r=Jr(Wr(e.placement)),i=r===`y`?t:n,a=r===`y`?L.left+L.right:L.top+L.bottom;return{offset:i/2+a/2}})},[ae,u,O,k,L,E]);T===`shift`||E===`shift`||o===`center`?de.push(me,pe):de.push(pe,me),de.push(uo({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!F.current)return;let i=e.style;i.setProperty(Ys,`${t}px`),i.setProperty(Xs,`${n}px`);let a=tn(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Ks,`${u}px`),i.setProperty(qs,`${d}px`)}}),Vs(e=>({element:oe.current||Fr(e.elements.floating).createElement(`div`),padding:oe.current?d:0,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Wr(r),u=Gr(r),d=Jr(l)===`y`,f=oe.current,p=typeof a==`function`?a(Qs(e,i,I)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return fe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Js,d?`${m} ${h}`:`${h} ${m}`),{}}},Hs,b),H(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let he=A.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:ge,elements:_e,x:ve,y:ye,middlewareData:be,update:xe,placement:Se,context:Ce,isPositioned:we,floatingStyles:Te}=t({rootContext:h,open:m?g:void 0,placement:te,middleware:de,strategy:r,whileElementsMounted:m?void 0:(...e)=>qa(...e,he),nodeId:y,externalTree:S}),{sideX:B,sideY:Ee}=be.adaptiveOrigin||Us,De=we?r:`fixed`,Oe=A.useMemo(()=>{let e;return e=we?b?{position:De,[B]:ve,[Ee]:ye}:{...Te,position:De}:{position:De,top:0,left:0},e[Ys]=`100vw`,e[Xs]=`100vh`,we||(e.opacity=0),e},[b,De,B,ve,Ee,ye,Te,we]),ke=A.useRef(null);H(()=>{if(!g)return;let e=P.current,t=typeof e==`function`?e():e,n=(tc(t)?t.current:t)||null;n!==ke.current&&(ge.setPositionReference(n),ke.current=n)},[g,ge,N,P]),A.useEffect(()=>{if(!g)return;let e=P.current;typeof e!=`function`&&tc(e)&&e.current!==ke.current&&(ge.setPositionReference(e.current),ke.current=e.current)},[g,ge,N,P]),A.useEffect(()=>{if(m&&g&&_e.reference&&_e.floating)return qa(_e.reference,_e.floating,xe,he)},[m,g,_e,xe,he]);let Ae=Wr(Se),je=Zs(i,Ae,I),Me=Gr(Se)||`center`,Ne=!!be.hide?.referenceHidden;H(()=>{x&&g&&we&&Ae!==ee&&w(Ae)},[x,g,we,Ae,ee]);let Pe=A.useMemo(()=>({position:`absolute`,top:be.arrow?.y,left:be.arrow?.x}),[be.arrow]),Fe=be.arrow?.centerOffset!==0;return A.useMemo(()=>({positionerStyles:Oe,arrowStyles:Pe,arrowRef:oe,arrowUncentered:Fe,side:je,align:Me,physicalSide:Ae,anchorHidden:Ne,refs:ge,context:Ce,isPositioned:we,update:xe}),[Oe,Pe,oe,Fe,je,Me,Ae,Ne,ge,Ce,we,xe])}function tc(e){return e!=null&&`current`in e}function nc(e){return e===`starting`?Wi:kt}function rc(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Li(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},nc(r),i],stateAttributesMapping:Hn})}var ic=A.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Gi,style:g,..._}=e,v=Nt(),y=Ns(),b=v.useState(`open`),x=v.useState(`mounted`),S=v.useState(`trackCursorAxis`),C=v.useState(`disableHoverablePopup`),w=v.useState(`floatingRootContext`),T=v.useState(`instantType`),E=v.useState(`transitionStatus`),D=$s({anchor:i,positionMethod:a,floatingRootContext:w,mounted:x,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:y,collisionAvoidance:h,adaptiveOrigin:v.useState(`adaptiveOrigin`)}),O=rc(e,A.useMemo(()=>({open:b,side:D.side,align:D.align,anchorHidden:D.anchorHidden,instant:S===`none`?T:`tracking-cursor`}),[b,D.side,D.align,D.anchorHidden,S,T]),{styles:D.positionerStyles,transitionStatus:E,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!x,inert:!b||S===`both`||C});return(0,j.jsx)(Is.Provider,{value:D,children:O})}),ac=A.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Nt(),{side:s,align:c}=Ls(),l=o.useState(`open`),u=o.useState(`instantType`),d=o.useState(`transitionStatus`),f=o.useState(`popupProps`),p=o.useState(`floatingRootContext`),m=o.useState(`disabled`),h=o.useState(`closeDelay`);Mo({open:l,ref:o.context.popupRef,onComplete(){l&&o.context.onOpenChangeComplete?.(!0)}}),cs(p,{enabled:!m,closeDelay:h});let g=o.useStateSetter(`popupElement`);return Li(`div`,e,{state:{open:l,side:s,align:c,instant:u,transitionStatus:d},ref:[t,o.context.popupRef,g],props:[No,f,nc(d),a],stateAttributesMapping:Un})}),oc=function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=A.useMemo(()=>({open:t,close:n}),[t,n]);return(0,j.jsx)(Es.Provider,{value:t,children:(0,j.jsx)(pr,{delay:i,timeoutMs:r,children:e.children})})},sc=`diffs-container`,cc=(()=>{try{return!1}catch{return!1}})(),lc=/(?=^From [a-f0-9]+ .+$)/m,uc=/(?=^diff --git)/gm,dc=/(?<=\n)/,fc=/^(---|\+\+\+)\s+([^\t\r\n]+)/,pc=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,mc=`header-prefix`,hc=`header-filename-suffix`,gc=`header-metadata`,_c=`header-custom`,vc={dark:`pierre-dark`,light:`pierre-light`},yc=`data-theme-css`,bc=`data-unsafe-css`,xc=`data-diffs-scrollbar-measure`,Sc=`data-diffs-code-view-header`,Cc=`data-diffs-code-view-footer`,wc=`--diffs-scrollbar-gutter-measured`,Tc=1e5,Ec={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},Dc={...Ec,hunkLineCount:1},Oc={paddingTop:8,paddingBottom:8,gap:8},kc={omega:.015,positionEpsilon:.5,velocityEpsilon:.05},Ac=Object.freeze({fromStart:0,fromEnd:0}),jc={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Mc=Object.freeze([]),Nc={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},Pc=new Map,Fc=new Map,Ic=new Map,Lc=new Set;function Rc(e=vc){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}function zc(e,t=n()){return typeof t!=`string`&&t.isDisposed?!1:(typeof t==`string`?a(t):t.themeResolver).hasResolvedThemes(Rc(e))}var Bc;async function Vc(e){let t=n(e);d(t);try{if(t===`highlights`){let{HighlightsHighlighter:e}=await y(async()=>{let{HighlightsHighlighter:e}=await import(`./highlights-CzsfRyuJ.js`);return{HighlightsHighlighter:e}},__vite__mapDeps([0,1,2,3,4,5]));return new e}let{ShikiHighlighter:e}=await y(async()=>{let{ShikiHighlighter:e}=await import(`./shiki-7tdSK7dy.js`);return{ShikiHighlighter:e}},__vite__mapDeps([6,1,2,3,4,5,7]));return await e.create(t)}finally{s()}}async function Hc({themes:e,langs:t,preferredHighlighter:n}){Uc();let r=Bc??=Vc(c()??n),i;try{i=await r}catch(e){throw Bc===r&&(Bc=void 0),e}if(Bc===r&&(Bc=i),await Promise.all([i.themeResolver.resolveThemes(e),i.loadLanguages(t)]),i.isDisposed)throw new m;return i}function Uc(){Bc!=null&&!(`then`in Bc)&&Bc.isDisposed&&(Bc=void 0)}function Wc({theme:e,lang:t,langs:n}={}){Uc();let r=Bc;if(!(r==null||`then`in r||e!=null&&!zc(e,r)||(t!=null||n!=null)&&!r.hasLoadedLanguages([...t==null?[]:[t],...n??[]])))return r}async function Gc(e){await Hc(e)}var Kc=new Set,qc=null;function Jc(e){Kc.add(e),qc??=requestAnimationFrame(Xc)}function Yc(e){Kc.delete(e)&&Kc.size===0&&qc!=null&&(cancelAnimationFrame(qc),qc=null)}function Xc(e){let t=new Set(Kc);Kc.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}qc=Kc.size>0?requestAnimationFrame(Xc):null}function Zc(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function Qc(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function $c(e,t){let n=e?.theme??vc,r=t?.theme??vc,i=el(e),a=el(t);return Qc(n,r)&&Zc(e,t,[`theme`,`parseDiffOptions`])&&Zc(i,a)}function el(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function tl(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function nl({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function rl(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function il(){return i({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[u({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function al(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function ol(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var sl=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:`idle`};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener(`click`,this.handlePointerClick),this.pre?.removeEventListener(`pointerdown`,this.handlePointerDown),this.pre?.removeEventListener(`pointermove`,this.handlePointerMove),this.pre?.removeEventListener(`pointerleave`,this.handlePointerLeave),this.pre?.removeAttribute(`data-interactive-lines`),this.pre?.removeAttribute(`data-interactive-line-numbers`),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),Yc(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||tl(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||i)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||r||i)&&(this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode===`diff`&&e.type===`diff-line`)return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode===`file`&&e.type===`line`)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;t==null&&n==null&&r==null&&a==null&&i==null||this.options.onGutterUtilityClick!=null&&ol(e.composedPath())||(Dl(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e}))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(Dl(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;Dl(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null?Dl(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`):(this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility())};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();Dl(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);Dl(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=fl(i)&&this.hoveredLine?.lineElement===i.lineElement;dl(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),dl(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),fl(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(ml(i)&&p!=null){p(i);break}if(pl(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!fl(i))break;dl(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,Dl(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),Dl(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),Dl(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();ol(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}else if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners()}else this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:`coordinates-first`});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case`selecting`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case`pendingSingleLineUnselect`:{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:`coordinates-first`,requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;let n={lineNumber:t.lineNumber,side:t.eventSide};if(al(this.pointerSession.pending,n))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:`selecting`,pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case`pendingSingleLineUnselect`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case`selecting`:if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case`idle`:return;case`gutterSelecting`:case`selecting`:case`pendingSingleLineUnselect`:if(`pointerId`in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=l(il());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);ul(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){this.placeUtilityFromSelection()||(this.hoveredLine==null?this.hideUtility():this.showUtilityOnLine(this.hoveredLine))}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(_l(t));if(ul(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(ul(n)&&(!t||n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(ul(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&ol(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=_l(e);if(t&&ol(n))return;let r=vl(e);return r==null?this.pathFromAnnotationSlot(e):_l(r)}pathFromAnnotationSlot(e){let t=yl(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return _l(t);let n=xl(bl(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:_l(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=Sl(t)?t:Sl(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}tl(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,Jc(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{Yc(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!wl(this.renderedSelectedLinesState,n),i=!wl(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);hl(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=El(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=El(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e)}else if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:gl(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:gl(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Tl(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:Tl(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function cl({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:ll({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function ll({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw Error(`Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.`);return e??!1}function ul(e){return e!=null&&`kind`in e&&e.kind===`line`}function dl(e){return e!=null&&`kind`in e&&e.kind===`token`}function fl(e){return ul(e)||dl(e)}function pl(e){return`type`in e&&e.type===`line-info`}function ml(e){return`kind`in e&&e.kind===`merge-conflict-action`}function hl(e){return e===`current`||e===`incoming`||e===`both`}function gl(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function _l(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function vl(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function yl(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function bl(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function xl(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function Sl(e){return e!=null&&typeof e.elementFromPoint==`function`}function Cl(e,t){return e===t||tl(e??void 0,t??void 0)}function wl(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Cl(e?.range??null,t.range)}function Tl(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function El(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function Dl(e=`none`,t,...n){switch(e){case`none`:return;case`both`:break;case`click`:if(t!==`click`)return;break;case`move`:if(t!==`move`)return}console.log(...n)}var Ol=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),jl(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?Pl(t):Fl(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null)console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);else if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:kl(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:Al(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&Ml(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function kl(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function Al(e){return Math.max(Math.ceil(e),0)}function jl(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?Ml(e,{codeWidthChanged:!0,numberWidthChanged:!0}):Nl(e))}function Ml(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function Nl(e){e.codeElement.style.removeProperty(`--diffs-column-content-width`),e.codeElement.style.removeProperty(`--diffs-column-number-width`),e.codeElement.style.removeProperty(`--diffs-column-width`)}function Pl(e){e.codeElement.isConnected&&Nl(e)}function Fl(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function Il(e,t){let n=Array.isArray(e)?e:[e];return t==null?n.every(e=>e===`text`||e===`ansi`||Lc.has(e)):t.hasLoadedLanguages(n)}function Ll(e,t){return Qc(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Rl(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function zl(e){return i({tagName:`div`,children:[i({tagName:`div`,children:e.annotations?.map(e=>i({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Bl(e){switch(e){case`file`:return`diffs-icon-file-code`;case`change`:return`diffs-icon-symbol-modified`;case`new`:return`diffs-icon-symbol-added`;case`deleted`:return`diffs-icon-symbol-deleted`;case`rename-pure`:case`rename-changed`:return`diffs-icon-symbol-moved`}}function Vl({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,a={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return i({tagName:`div`,children:[t===`custom`?i({tagName:`slot`,properties:{name:_c}}):Hl({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[Ul(r)]],properties:a})}function Hl({name:e,prevName:t,iconType:n}){let r=[i({tagName:`slot`,properties:{name:mc}}),u({name:Bl(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push(i({tagName:`div`,children:[i({tagName:`bdi`,children:[v(t)]})],properties:{"data-prev-name":``}})),r.push(u({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push(i({tagName:`div`,children:[i({tagName:`bdi`,children:[v(e)]})],properties:{"data-title":``}})),r.push(i({tagName:`slot`,properties:{name:hc}})),i({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Ul(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push(i({tagName:`span`,children:[v(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push(i({tagName:`span`,children:[v(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push(i({tagName:`slot`,properties:{name:gc}})),i({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Wl(e){return i({tagName:`pre`,properties:Gl(e)})}function Gl({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var Kl=new Map,ql=0,Jl={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,odin:`odin`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,BUCK:`python`,BUILD:`python`,PACKAGE:`python`,WORKSPACE:`python`,Tiltfile:`python`,bazel:`python`,bxl:`python`,bzl:`python`,bzlmod:`python`,star:`python`,sky:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Yl(e){let t=Xl(e);if(t!=null)return t;let n=e.split(/[/\\]/).pop()??e;return n===e?`text`:Xl(n)??`text`}function Xl(e){if(Kl.has(e))return Kl.get(e)??`text`;if(Object.hasOwn(Jl,e))return Jl[e]??null;let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Kl.has(t[1]))return Kl.get(t[1])??`text`;if(Object.hasOwn(Jl,t[1]))return Jl[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Kl.has(n)?Kl.get(n)??`text`:Object.hasOwn(Jl,n)?Jl[n]??`text`:null}function Zl(){return ql}function Ql(){return Object.fromEntries(Kl)}function $l(e,{theme:t,preferredHighlighter:r}){return{langs:Array.isArray(e)?e:[e??`text`],themes:Rc(t),preferredHighlighter:n(r)}}function eu(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function tu(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function nu(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var ru=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,iu=/^0(?:\.0+)?%?$/;function au(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function ou(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function su(e){if(e==null)return null;let t=ou(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function cu(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||ru.test(t))return!0;let n=au(t);return n!=null&&iu.test(n)}function lu(e,t,n){if(t==null||n==null)return!1;let r=su(e),i=su(t),a=su(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var uu=new WeakMap;function du(e){let t=uu.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;fu(r,`editor.background`,i),fu(r,`editor.foreground`,a),fu(r,`sideBar.background`,o),fu(r,`sideBar.foreground`,s),fu(r,`input.background`,n[`input.background`]??o),fu(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),fu(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),fu(r,`gitDecoration.addedResourceForeground`,pu(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),fu(r,`gitDecoration.modifiedResourceForeground`,pu(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),fu(r,`gitDecoration.deletedResourceForeground`,pu(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(cu(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(cu(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(mu(l,o)||lu(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return uu.set(e,u),u}function fu(e,t,n){n!=null&&n!==``&&(e[t]=n)}function pu(...e){for(let t of e)if(t!=null&&t!==``)return t}function mu(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function hu({theme:e=vc,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=gu(i,t);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${nu(`global`)}fg:${a.fg};`,r+=`${nu(`global`)}bg:${a.bg};`,r+=_u(i,n)}else{let n=t.getTheme(e.dark),i=gu(n,t);r+=`${nu(`global`)}dark:${i.fg};`,r+=`${nu(`global`)}dark-bg:${i.bg};`,r+=_u(n,`dark`),n=t.getTheme(e.light),i=gu(n,t),r+=`${nu(`global`)}light:${i.fg};`,r+=`${nu(`global`)}light-bg:${i.bg};`,r+=_u(n,`light`)}return r}function gu(e,t){if(t.name===`highlights`&&e.zed?.cssVariables===!0){let e=nu(`token`);return{fg:`var(${e}foreground)`,bg:`var(${e}background)`}}return du(e)}function _u(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${nu(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${nu(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${nu(`global`)}${t}modified-color:${a};`),n}var vu=10,yu=13,bu=4,xu=40;function Su(e){let t=[0],n=e.indexOf(`\r`),r=e.indexOf(`
11
11
  `),i=0,a=0;for(;n!==-1||r!==-1;){let o;if(n!==-1&&(r===-1||n<r)?r===n+1?(o=r+1,n=e.indexOf(`\r`,o),r=e.indexOf(`
12
12
  `,o)):(o=n+1,n=e.indexOf(`\r`,o)):(o=r+1,r=e.indexOf(`
13
13
  `,o)),t.push(o),++a===bu){if(o-i<=xu){for(let n=o;n<e.length;n++){let r=e.charCodeAt(n);(r===vu||r===yu)&&(r===yu&&n+1<e.length&&e.charCodeAt(n+1)===vu&&n++,t.push(n+1))}return t}i=o,a=0}}return t}function Cu(e){let t=Su(e);return Array.from({length:t.length},(n,r)=>{let i=t[r],a=t[r+1]??e.length;return e.slice(i,a)})}function wu(e,t,n){return{lang:e,...typeof t==`string`?{theme:t}:{themes:t},defaultColor:!1,cssVariablePrefix:nu(`token`),tokenizeMaxLineLength:n,tokenizeTimeLimit:0}}var Tu={forcePlainText:!1};function Eu(e,t,{theme:n,tokenizeMaxLineLength:r,useTokenTransformer:i},{forcePlainText:a,lazyLineAST:o=!1,startingLine:s,totalLines:c,lines:l}=Tu){a?(s??=0,c??=1/0):(s=0,c=1/0);let u=s>0||c<1/0,d={lineInfo:[]},p=a?`text`:e.lang??Yl(e.name),m=typeof n==`string`?t.getTheme(n).type:void 0,h=hu({theme:n,highlighter:t});d.lineInfo=e=>({type:`context`,lineIndex:e-1+s,lineNumber:e+s});let g=f(t.codeToTokens(Du(u?Ou(l??Cu(e.contents),s,c):e.contents),wu(p,n,r)).tokens,{state:d,useTokenTransformer:i,lazyLineAST:o&&!a&&!i,cacheHtmlStyles:t.name===`highlights`}),v=u?Array(s):g;return u&&_(v,g),{code:v,themeStyles:h,baseThemeType:m}}function Du(e){return e.replace(/\r(?!\n)/g,`
@@ -1567,4 +1567,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
1567
1567
  display: none !important;
1568
1568
  }
1569
1569
  `;function pR(e,t,n){let r=e.shadowRoot;if(!r)return;let i=r.querySelector(`pre`);if(!i)return;for(let e of r.querySelectorAll(`[data-review-comment], [data-review-target], [data-review-rail]`))e.removeAttribute(`data-review-comment`),e.removeAttribute(`data-review-target`),e.removeAttribute(`data-review-rail`);if(t.length===0)return;let a=e=>t.some(t=>e>=t.start&&e<=t.end),o=e=>n.some(t=>e>=t.start&&e<=t.end);for(let e of Array.from(i.children)){if(!(e instanceof HTMLElement)||!e.hasAttribute(`data-code`)||e.hasAttribute(`data-deletions`))continue;let t=e.querySelector(`[data-gutter]`),n=e.querySelector(`[data-content]`);if(t&&n){for(let e=0;e<t.children.length&&e<n.children.length;e++){let r=t.children[e],i=n.children[e],s=r.getAttribute(`data-line-type`);if(s!==`change-addition`&&s!==`context`&&s!==`context-expanded`)continue;let c=r.getAttribute(`data-column-number`);if(!c)continue;let l=parseInt(c,10),u=s===`change-addition`&&a(l)?`data-review-comment`:o(l)?`data-review-target`:null;u&&(r.setAttribute(u,``),i.setAttribute(u,``))}gR(Array.from(t.children))}}}var mR=e=>e.hasAttribute(`data-review-target`)||e.hasAttribute(`data-review-comment`),hR=e=>e.hasAttribute(`data-column-number`)&&e.getAttribute(`data-line-type`)!==`change-deletion`;function gR(e){let t=null;for(let[n,r]of e.entries())if(mR(r)){for(let e of t??[])e.setAttribute(`data-review-rail`,``);r.setAttribute(`data-review-rail`,``),t=[]}else r.getAttribute(`data-gutter-buffer`)===`annotation`&&e[n-1]?.hasAttribute(`data-review-comment`)?(r.setAttribute(`data-review-rail`,``),t=[]):hR(r)?t=null:t?.push(r)}function _R(e){let t=(e??[]).flatMap(e=>e.metadata?.type===`review`?[e.metadata]:[]);return{blocks:t.map(e=>({start:e.startLine,end:e.endLine})),targets:t.map(e=>e.target)}}function vR({variant:e=`secondary`,onClick:t,disabled:n,title:r,children:i}){return(0,j.jsx)(`button`,{type:`button`,className:`btn btn-${e}`,onClick:t,disabled:n,title:r,children:i})}function yR(e,t,n){if(!e.isPartial){let r=t===`additions`?e.additionLines:e.deletionLines;return r.length?Math.min(Math.max(n,1),r.length):null}let r=null;for(let i of e.hunks){let e=t===`additions`?i.additionStart:i.deletionStart,a=t===`additions`?i.additionCount:i.deletionCount;if(!a)continue;let o=Math.min(Math.max(n,e),e+a-1);(r===null||Math.abs(o-n)<Math.abs(r-n))&&(r=o)}return r}var bR=(e,t,n,r)=>t===`additions`&&(e.annotations??[]).some(e=>e.metadata?.type===`review`&&n<=e.metadata.endLine&&r>=e.metadata.startLine),xR=e=>(e??``).replace(/\r?\n$/,``);function SR(e,t){let n=t===`deletions`?e.prevObjectId:e.newObjectId;return n&&!/^0+$/.test(n)?n:null}function CR(e,t,n,r,i=2){let a=t===`additions`?e.additionLines:e.deletionLines,o=[];if(e.isPartial)for(let s of e.hunks){let e=t===`additions`?s.additionStart:s.deletionStart,c=t===`additions`?s.additionCount:s.deletionCount,l=t===`additions`?s.additionLineIndex:s.deletionLineIndex;for(let t=0;t<c;t++){let s=e+t;s>=n-i&&s<=r+i&&o.push([s,xR(a[l+t])])}}else{let e=Math.max(1,n-i),t=Math.min(a.length,r+i);for(let n=e;n<=t;n++)o.push([n,xR(a[n-1])])}if(!o.length)return null;let s=[];for(let e of o){let t=s.at(-1);t&&t.at(-1)[0]===e[0]-1?t.push(e):s.push([e])}return s.map(e=>({lines:[e[0][0],e.at(-1)[0]],text:e.map(([,e])=>e).join(`
1570
- `)}))}var wR=({prefix:e,suffix:t})=>t?`${e} ${t}`:e;function TR({copy:e,initialText:t,onTextChange:n,onSubmit:r,onSend:i,inlineUnavailable:a,onCancel:o,submitting:s,error:c,syntax:l}){let[u,d]=(0,A.useState)(t),f=(0,A.useRef)(null);(0,A.useEffect)(()=>{f.current?.focus()},[]);let p=e=>{let t=u.trim();e&&t&&!s&&e(t)},m=a?void 0:r;return(0,j.jsxs)(`div`,{className:`comment-form`,onClick:e=>e.stopPropagation(),children:[(0,j.jsx)(`textarea`,{ref:f,value:u,onChange:e=>{d(e.target.value),n(e.target.value)},onKeyDown:t=>{e&&!u.trim()&&t.key===`c`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),navigator.clipboard.writeText(e)),t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),p(i?t.altKey?m:i:r)),t.key===`Escape`&&o()},placeholder:`Leave a review comment... (${i?`${qL} sends`:`${qL} to submit`})`,rows:3,disabled:s}),(0,j.jsxs)(`div`,{className:`comment-form-actions`,children:[(0,j.jsx)(`div`,{className:`comment-form-note`,children:a||(l===null?(0,j.jsx)(j.Fragment,{children:`Comment marker: none (file type not recognized)`}):`sections`in l?(0,j.jsxs)(j.Fragment,{children:[`Comment marker:`,` `,Object.entries(l.sections).map(([e,t],n)=>(0,j.jsxs)(A.Fragment,{children:[n>0&&`, `,(0,j.jsx)(`code`,{children:wR(t)}),` in `,e]},e))]}):l.prefix===``?(0,j.jsx)(j.Fragment,{children:`Comment marker: none (plain text)`}):(0,j.jsxs)(j.Fragment,{children:[`Comment marker: `,(0,j.jsx)(`code`,{children:wR(l)})]}))}),c&&(0,j.jsx)(`div`,{className:`comment-form-error`,children:c}),(0,j.jsxs)(`div`,{className:`comment-form-buttons`,children:[(0,j.jsx)(vR,{variant:`ghost`,onClick:o,disabled:s,children:`Cancel`}),i?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(vR,{disabled:!u.trim()||s||!m,onClick:()=>p(m),title:`Write the comment into the file as a review marker (${JL})`,children:`Comment`}),(0,j.jsx)(vR,{variant:`primary`,disabled:!u.trim()||s,onClick:()=>p(i),title:`Send the comment to the --send command (${qL})`,children:`Send`})]}):(0,j.jsx)(vR,{variant:`primary`,disabled:!u.trim()||s,onClick:()=>p(r),children:`Comment`})]})]})]})}function ER({text:e,closeOnClick:t,children:n}){return(0,j.jsxs)(Cs,{children:[(0,j.jsx)(js,{delay:150,closeOnClick:t,render:n}),(0,j.jsx)(Fs,{children:(0,j.jsx)(ic,{className:`tooltip-positioner`,side:`bottom`,sideOffset:6,children:(0,j.jsx)(ac,{className:`tooltip-popup`,children:e})})})]})}function DR(){return(0,j.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,j.jsx)(`path`,{fill:`currentColor`,d:`M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z`}),(0,j.jsx)(`path`,{fill:`currentColor`,d:`M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z`})]})}function OR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z`})})}function kR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z`})})}function AR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M8 12a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0-1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm5.657-8.157a.75.75 0 0 1 0 1.061l-1.061 1.06a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.06-1.06a.75.75 0 0 1 1.06 0Zm-9.193 9.193a.75.75 0 0 1 0 1.06l-1.06 1.061a.75.75 0 1 1-1.061-1.06l1.06-1.061a.75.75 0 0 1 1.061 0ZM8 0a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0V.75A.75.75 0 0 1 8 0ZM3 8a.75.75 0 0 1-.75.75H.75a.75.75 0 0 1 0-1.5h1.5A.75.75 0 0 1 3 8Zm13 0a.75.75 0 0 1-.75.75h-1.5a.75.75 0 0 1 0-1.5h1.5A.75.75 0 0 1 16 8Zm-8 5a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 8 13Zm3.536-1.464a.75.75 0 0 1 1.06 0l1.061 1.06a.75.75 0 0 1-1.06 1.061l-1.061-1.06a.75.75 0 0 1 0-1.061ZM2.343 2.343a.75.75 0 0 1 1.061 0l1.06 1.061a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-1.06-1.06a.75.75 0 0 1 0-1.06Z`})})}function jR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M9.598 1.591a.749.749 0 0 1 .785-.175 7.001 7.001 0 1 1-8.967 8.967.75.75 0 0 1 .961-.96 5.5 5.5 0 0 0 7.046-7.046.75.75 0 0 1 .175-.786Zm1.616 1.945a7 7 0 0 1-7.678 7.678 5.499 5.499 0 1 0 7.678-7.678Z`})})}function MR(){return(0,j.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,"aria-hidden":`true`,children:[(0,j.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,j.jsx)(`path`,{d:`M6.5 6a1.5 1.5 0 0 1 3 0c0 1-1.5 1.25-1.5 2.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,j.jsx)(`circle`,{cx:`8`,cy:`11`,r:`.75`,fill:`currentColor`})]})}function NR({fileDiff:e,isViewed:t,isStale:n,generated:r,collapsed:i,focused:a,showExpand:o,expandDisabledReason:s,expanded:c,onToggleCollapse:l,onToggleViewed:u,onToggleExpand:d}){let{additions:f,deletions:p}=uR(e),[m,h]=(0,A.useState)(!1);return(0,j.jsxs)(`div`,{className:`file-header`+(a?` focused`:``),onPointerDown:e=>{e.button===0&&!e.shiftKey&&window.getSelection()?.removeAllRanges()},onClick:()=>{let e=window.getSelection();(!e||e.isCollapsed)&&l()},children:[(0,j.jsx)(`span`,{className:`collapse-chevron`+(i?` collapsed`:``),children:`▶`}),(0,j.jsxs)(`span`,{className:`file-header-name`,children:[e.prevName!=null&&e.prevName!==e.name&&(0,j.jsxs)(`span`,{className:`file-header-prev-name`,children:[e.prevName,` → `]}),e.name]}),(0,j.jsx)(ER,{text:m?`Copied!`:`Copy file name to clipboard`,closeOnClick:!1,children:(0,j.jsx)(`button`,{type:`button`,className:`copy-name-button`+(m?` copied`:``),"aria-label":`Copy file name to clipboard`,onClick:t=>{t.stopPropagation(),navigator.clipboard.writeText(e.name).then(()=>{h(!0),setTimeout(()=>h(!1),2e3)})},children:(0,j.jsxs)(`span`,{className:`copy-icon-stack`,children:[(0,j.jsx)(DR,{}),(0,j.jsx)(OR,{})]})})}),r&&(0,j.jsx)(`span`,{className:`generated-label`,children:`Generated`}),o&&(0,j.jsx)(ER,{text:s??(c?`Collapse expanded lines`:`Expand all lines`),children:(0,j.jsx)(`button`,{type:`button`,className:`expand-all-button`+(c?` expanded`:``)+(s?` disabled`:``),"aria-label":c?`Collapse expanded lines`:`Expand all lines`,"aria-disabled":s!==null,onClick:e=>{e.stopPropagation(),!s&&d()},children:(0,j.jsx)(kR,{})})}),(0,j.jsx)(KR,{className:`file-header-stats`,additions:f,deletions:p}),(0,j.jsxs)(`button`,{type:`button`,className:`viewed-button`+(n?` stale`:``)+(t?` checked`:``),onClick:e=>{e.stopPropagation(),u()},children:[(0,j.jsx)(`input`,{type:`checkbox`,className:`viewed-checkbox`+(n?` stale`:``),checked:t,readOnly:!0,tabIndex:-1}),n?`Changed`:`Viewed`]})]})}function PR({open:e}){return(0,j.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:[(0,j.jsx)(`path`,{fill:`currentColor`,d:`M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25H4.5v-13H1.75a.25.25 0 0 0-.25.25ZM6 14.5h8.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H6Z`}),(0,j.jsx)(`path`,{fill:`currentColor`,d:e?`M11.28 5.22a.75.75 0 0 1 0 1.06L9.56 8l1.72 1.72a.75.75 0 1 1-1.06 1.06l-2.25-2.25a.75.75 0 0 1 0-1.06l2.25-2.25a.75.75 0 0 1 1.06 0Z`:`M8.72 5.22a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 1 1-1.06-1.06L10.44 8 8.72 6.28a.75.75 0 0 1 0-1.06Z`})]})}function FR({paths:e,gitStatus:t,viewed:n,focusedFile:r,onSelectFile:i}){let a=(0,A.useRef)(!1),o=(0,A.useRef)(i);o.current=i;let s=(0,A.useRef)(n),c=(0,A.useMemo)(()=>KD(e),[e]),{model:l}=GD({preparedInput:c,gitStatus:t,initialExpansion:`open`,flattenEmptyDirectories:!0,stickyFolders:!0,search:!0,density:`compact`,icons:aR,unsafeCSS:oR,renderRowDecoration:({item:e})=>e.kind===`file`&&s.current.has(e.path)?{icon:{name:`skepsis-check`,width:14,height:14},title:`Viewed`}:null,onSelectionChange:e=>{if(a.current||e.length!==1)return;let t=e[0];l.getItem(t)?.isDirectory()||o.current(t)}}),u=(0,A.useRef)(!0);return(0,A.useEffect)(()=>{u.current?u.current=!1:(l.resetPaths({preparedInput:c}),l.setGitStatus(t))},[l,c,t]),(0,A.useEffect)(()=>{s.current=n,l.setIcons(aR)},[l,n]),(0,A.useEffect)(()=>{if(r&&l.getItem(r)){a.current=!0;try{for(let e of l.getSelectedPaths())e!==r&&l.getItem(e)?.deselect();l.getItem(r)?.select()}finally{a.current=!1}l.scrollToPath(r,{focus:!1,offset:`nearest`})}},[l,r,e]),(0,j.jsx)(vv,{className:`file-tree`,model:l})}function IR(){return document.querySelector(`.file-tree`)?.shadowRoot?.querySelector(`input`)??null}function LR(){let e=IR();return e?(e.focus(),!0):!1}function RR({treeOpen:e,onToggleTree:t,command:n,fileHashes:r,viewed:i,onUnviewAll:a,resolvedTheme:o,onToggleTheme:s,onShowHelp:c}){let l=Object.keys(r).length,u=Object.entries(r).filter(([e,t])=>i[e]===t).length;if(l===0)return null;let d=o===`dark`?`light`:`dark`,f=e?`Hide file tree`:`Show file tree`;return(0,j.jsxs)(`div`,{className:`progress-bar`,children:[(0,j.jsx)(ER,{text:(0,j.jsxs)(j.Fragment,{children:[f,` `,(0,j.jsx)(`kbd`,{children:`b`})]}),children:(0,j.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":f,"aria-expanded":e,onClick:t,children:(0,j.jsx)(PR,{open:e})})}),(0,j.jsx)(`code`,{className:`diff-command`,title:n,children:n}),(0,j.jsx)(`div`,{className:`progress-track`,children:(0,j.jsx)(`div`,{className:`progress-fill`,style:{width:`${u/l*100}%`}})}),(0,j.jsxs)(`span`,{children:[u,`/`,l,` files viewed`]}),(0,j.jsx)(ER,{text:`Mark all files unviewed`,children:(0,j.jsx)(`button`,{type:`button`,className:`unview-all-button`+(u===0?` disabled`:``),"aria-disabled":u===0,onClick:()=>{u>0&&a()},children:`Clear`})}),(0,j.jsx)(ER,{text:(0,j.jsxs)(j.Fragment,{children:[`Switch to `,d,` mode `,(0,j.jsx)(`kbd`,{children:`t`})]}),children:(0,j.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`Switch to ${d} mode`,onClick:s,children:o===`light`?(0,j.jsx)(AR,{}):(0,j.jsx)(jR,{})})}),(0,j.jsx)(ER,{text:(0,j.jsxs)(j.Fragment,{children:[`Keyboard shortcuts `,(0,j.jsx)(`kbd`,{children:`?`})]}),children:(0,j.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,onClick:c,children:(0,j.jsx)(MR,{})})})]})}function zR({onClose:e,children:t}){let n=(0,A.useRef)(null);return(0,A.useEffect)(()=>n.current?.showModal(),[]),(0,j.jsx)(`dialog`,{ref:n,className:`help-modal`,onClose:e,onClick:e=>{e.target===e.currentTarget&&n.current?.close()},children:t})}var BR=[[`j / k`,`Next / previous line`],[`n / p`,`Next / previous file`],[`v`,`Toggle viewed`],[`e / E`,`Toggle collapse file / all files`],[`s`,`Toggle split mode (responsive / unified)`],[`t`,`Toggle light / dark`],[`b`,`Toggle file tree`],[KL,`Search files`],[`c`,`Comment on line`],[qL,`Send the comment to the --send command`,`send`],[JL,`Comment in the file (review marker)`,`send`],[`r`,`Refresh after the diff changes on disk`],[`Esc`,`Close / cancel`],[`?`,`Toggle this help`]];function VR({onClose:e,send:t}){return(0,j.jsxs)(zR,{onClose:e,children:[(0,j.jsx)(`h3`,{children:`Keyboard Shortcuts`}),(0,j.jsx)(`table`,{children:(0,j.jsx)(`tbody`,{children:BR.filter(([,,e])=>!e||t).map(([e,t])=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:e.split(` / `).map((e,t)=>(0,j.jsxs)(`span`,{children:[t>0&&` / `,(0,j.jsx)(`kbd`,{children:e})]},e))}),(0,j.jsx)(`td`,{children:t})]},e))})})]})}function HR({onClose:e,vcs:t}){return(0,j.jsxs)(zR,{onClose:e,children:[(0,j.jsxs)(`p`,{children:[`Comments work by inserting lines into the code. This can only work if the`,` `,t===`jj`?(0,j.jsxs)(j.Fragment,{children:[`revset includes `,(0,j.jsx)(`code`,{children:`@`})]}):`commit range includes the working copy`,`. Otherwise, the inserted lines will land in`,` `,t===`jj`?(0,j.jsx)(`code`,{children:`@`}):`the working copy`,` but not in the diff being viewed.`]}),t===`jj`?(0,j.jsxs)(`p`,{children:[`The easiest way to get a diff with comments enabled is to run with the`,` `,(0,j.jsx)(`code`,{children:`-f`}),` flag to get a diff that starts at some revision and ends at`,` `,(0,j.jsx)(`code`,{children:`@`}),`.`]}):(0,j.jsxs)(`p`,{children:[`The easiest way to get a diff with comments enabled is to run with `,(0,j.jsx)(`code`,{children:`-f`}),` `,`only (no `,(0,j.jsx)(`code`,{children:`-t`}),`), so the diff goes from a commit to the working tree.`]})]})}function UR({onLearnMore:e,vcs:t,send:n}){return(0,j.jsxs)(`div`,{className:`comments-disabled-banner`,children:[n?`Inline comments are off for this diff, but Send still works.`:t===`jj`?(0,j.jsxs)(j.Fragment,{children:[`Comments are disabled because the revset does not include `,(0,j.jsx)(`code`,{children:`@`}),`.`]}):`Comments are disabled because the commit range does not end at the working copy.`,` `,(0,j.jsx)(`a`,{href:`#`,onClick:t=>{t.preventDefault(),e()},children:`Learn more`})]})}var WR={added:`new in diff`,removed:`gone from diff`,base:`base changed`};function GR({changes:e,onRefresh:t}){let n=e?.length?e:null,r=0,i=0;for(let e of n??[])r+=e.additions,i+=e.deletions;return(0,j.jsxs)(`div`,{className:`diff-changed-toast`,role:`status`,children:[(0,j.jsxs)(`div`,{className:`diff-changed-row`,children:[(0,j.jsxs)(`span`,{className:`diff-changed-summary`,children:[`The diff changed on disk`,n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`diff-changed-count`,children:[n.length,` `,n.length===1?`file`:`files`]}),(0,j.jsx)(KR,{additions:r,deletions:i})]})]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-tinted`,onClick:t,children:[`Refresh `,(0,j.jsx)(`kbd`,{children:`r`})]})]}),n&&(0,j.jsx)(`ul`,{className:`diff-changed-files`,children:n.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`diff-changed-name`,children:e.name}),e.status!==`changed`&&(0,j.jsx)(`span`,{className:`diff-changed-status`,children:WR[e.status]}),(0,j.jsx)(KR,{additions:e.additions,deletions:e.deletions})]},e.name))})]})}function KR({additions:e,deletions:t,className:n}){return(0,j.jsxs)(`span`,{className:n?`line-counts ${n}`:`line-counts`,children:[e>0&&(0,j.jsxs)(`span`,{className:`stat-add`,children:[`+`,e]}),t>0&&(0,j.jsxs)(`span`,{className:`stat-del`,children:[`-`,t]})]})}var qR=[`responsive`,`unified`];function JR(e,t,n){let r=n[0]?.id??null;for(let i of n){let n=e.getTopForItem(i.id);if(n!=null){if(n<=t+4)r=i.id;else break}}return r}function YR(){let e=WL(),[t,n]=(0,A.useState)(`responsive`),r=t===`responsive`&&e?`split`:`unified`,{toast:i,showToast:a}=YL(),[o,s]=(0,A.useState)({}),[c,l]=(0,A.useState)(cR),u=(0,A.useCallback)(e=>{lR(e),l(e)},[]),d=(0,A.useCallback)(()=>u(!c),[u,c]),f=(0,A.useRef)(!1);(0,A.useEffect)(()=>{c&&f.current&&(f.current=!1,requestAnimationFrame(()=>LR()))},[c]);let[p,m]=(0,A.useState)({}),[h,g]=(0,A.useState)(null),[_,v]=(0,A.useState)([]),y=(0,A.useRef)(0),b=(0,A.useRef)(``),x=(0,A.useRef)(!1),S=N(),{data:C,error:w,errorUpdatedAt:T,isLoading:E}=gt({queryKey:[`diff`],queryFn:async()=>{let e=await HL(`/api/diff`);return await S.cancelQueries({queryKey:[`diff-hash`]}),S.setQueryData([`diff-hash`],{hash:e.patchHash}),e},refetchOnWindowFocus:!1,retry:!1}),{data:D}=gt({queryKey:[`diff-hash`],queryFn:()=>HL(`/api/diff-hash`),enabled:C?.poll===!0,refetchInterval:jL}),O=!!C&&!!D&&D.hash!==C.patchHash,k=(0,A.useCallback)(()=>S.invalidateQueries({queryKey:[`diff`]}),[S]),{data:M}=gt({queryKey:[`diff-preview`,D?.hash],queryFn:()=>HL(`/api/diff`),enabled:O,placeholderData:_e}),P=(0,A.useRef)(0);(0,A.useEffect)(()=>{w&&C&&T!==P.current&&(P.current=T,a(`Couldn't reload the diff: ${w.message}`,6e3))},[w,C,T,a]);let F=C?.repo,I=C?.revset;(0,A.useEffect)(()=>{F&&I&&(document.title=`skepsis | ${F} | ${I}`)},[F,I]),(0,A.useEffect)(()=>{if(!C)return;let e=!x.current;x.current=!0;let t=new Set(C.generated);s(n=>{let r=Object.entries(C.fileHashes).filter(([r,i])=>!(r in n)&&(t.has(r)||e&&C.viewed[r]===i));return r.length===0?n:{...n,...Object.fromEntries(r.map(([e])=>[e,!0]))}})},[C]);let{data:ee}=gt({queryKey:[`theme`],queryFn:()=>HL(`/api/theme`),initialData:{theme:NL}}),te=ee.theme,L=_t({mutationFn:e=>HL(`/api/theme`,{method:`POST`,body:{theme:e}}),onMutate:e=>S.setQueryData([`theme`],{theme:e})}).mutate,ne=(0,A.useCallback)(()=>{let e=S.getQueryData([`theme`])?.theme??`system`,t=!(e===`system`?IL():e===`dark`),n=t?`dark`:`light`,r=t===IL()?`system`:n;return L(r),{stored:r,resolved:n}},[S,L]),re=LL(),ie=te===`system`?re?`dark`:`light`:te;(0,A.useEffect)(()=>PL(te),[te]);let R=_t({mutationFn:({file:e,hash:t,mark:n})=>HL(`/api/viewed`,{method:n?`POST`:`DELETE`,body:{file:e,hash:t}}),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),ae=_t({mutationFn:e=>HL(`/api/viewed-all`,{method:`DELETE`,body:{files:e}}),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),oe=_t({mutationFn:e=>HL(`/api/comment`,{method:`POST`,body:e}),onSuccess:()=>g(null),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),se=_t({mutationFn:({quote:e,...t})=>HL(`/api/send`,{method:`POST`,body:t}),onSuccess:(e,{file:t,side:n,lines:r,quote:i,text:a})=>{g(null),t&&n&&r&&v(e=>[...e,{id:++y.current,file:t,side:n,lines:r,quote:i,text:a}])}}),ce=_t({mutationFn:({file:e,line:t})=>HL(`/api/comment`,{method:`DELETE`,body:{file:e,line:t}}),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),le=C?.patch,ue=(0,A.useRef)(new Map),{patchFiles:de,treePaths:z,treeStatus:fe}=(0,A.useMemo)(()=>{if(!le)return{patchFiles:[],treePaths:[],treeStatus:[]};let e=xI(Lf(le).flatMap(e=>e.files)).toSorted((e,t)=>iR(e.name,t.name)),t=e.flatMap(e=>{let t=rR[e.type];return t?[{path:e.name,status:t}]:[]}),n=e.map(e=>{let t=QL(e),n=ue.current.get(t.name);return n&&$L(n,t)?n:t});return ue.current=new Map(n.map(e=>[e.name,e])),{patchFiles:n,treePaths:e.map(e=>e.name),treeStatus:t}},[le]),pe=M?.patch,me=(0,A.useMemo)(()=>{if(pe===void 0)return null;let e=e=>xI(Lf(e).flatMap(e=>e.files));return QI(e(le??``),e(pe)).toSorted((e,t)=>iR(e.name,t.name))},[le,pe]),he=C?.expandable??!1,ge=(0,A.useCallback)(e=>{let t=new URLSearchParams({path:e.name});return e.prevName&&t.set(`oldPath`,e.prevName),S.fetchQuery({queryKey:[`file-contents`,e.name,C?.fileHashes[e.name]],queryFn:()=>HL(`/api/file-contents?${t}`),staleTime:1/0})},[S,C]),ve=(0,A.useRef)(ge);ve.current=ge;let ye=mt({queries:de.map(e=>{let t=C?.fileHashes[e.name],n=new URLSearchParams({path:e.name});return e.prevName&&n.set(`oldPath`,e.prevName),{queryKey:[`file-contents`,e.name,t],queryFn:()=>HL(`/api/file-contents?${n}`),enabled:he&&e.hunks.length>0&&(p[e.name]??!1),staleTime:1/0}})}),{contentsByFile:be,loadingContents:xe}=(0,A.useMemo)(()=>{let e=new Map,t=new Set;return de.forEach((n,r)=>{let i=ye[r];i?.data?e.set(n.name,i.data):i?.isFetching&&t.add(n.name)}),{contentsByFile:e,loadingContents:t}},[de,ye]),Se=(0,A.useRef)(new Map),Ce=(0,A.useMemo)(()=>de.map(e=>{if(!(p[e.name]??!1))return e;let t=be.get(e.name),n=Se.current.get(e.name);if(!t&&n&&xe.has(e.name))return n.diff;if(!t||t.oldContents==null&&t.newContents==null)return e;if(n&&n.old===t.oldContents&&n.new===t.newContents)return n.diff;let r={...QL(zp({name:e.prevName??e.name,contents:t.oldContents??``},{name:e.name,contents:t.newContents??``},{context:2**53-1})),prevObjectId:e.prevObjectId,newObjectId:e.newObjectId};return Se.current.set(e.name,{old:t.oldContents,new:t.newContents,diff:r}),r}),[de,be,xe,p]),we=(0,A.useMemo)(()=>{let e=new Map;for(let t of Ce){let n=[];for(let e of t.hunks)for(let t=0;t<e.additionCount;t++)n.push(e.additionStart+t);e.set(t.name,n)}return e},[Ce]),Te=(0,A.useCallback)((e,t,n,r,i)=>{let a=Ce.find(t=>t.name===e);a&&(oe.reset(),se.reset(),b.current=``,g(o=>({file:e,side:t,first:n,line:r,diff:a,text:i,opened:(o?.opened??0)+1})))},[Ce,oe,se]),B=(0,A.useMemo)(()=>{if(!h)return null;let{file:e,side:t,first:n,line:r,diff:i}=h,a=Ce.find(t=>t.name===e);if(!a)return null;if(a===i)return h;let o=hL(i,a,t,r),s=n===r?o:hL(i,a,t,n);return o===null||s===null?null:{...h,first:s,line:o,diff:a}},[h,Ce]),[Ee,De]=(0,A.useState)(null);h&&B!==h&&(g(B),!B&&b.current.trim()&&De({text:b.current})),(0,A.useEffect)(()=>{Ee&&a((0,j.jsxs)(j.Fragment,{children:[`Comment box closed: its line changed or left the diff`,(0,j.jsx)(vR,{onClick:()=>void navigator.clipboard.writeText(Ee.text),children:`Copy draft`})]}),15e3)},[Ee,a]),(0,A.useEffect)(()=>{h||(b.current=``)},[h]);let Oe=(0,A.useRef)(B);Oe.current=B;let[ke,Ae]=(0,A.useState)(null),je=(0,A.useRef)(ke);je.current=ke;let Me=(0,A.useMemo)(()=>{let e={...C?.viewed};if(R.isPending&&R.variables){let{file:t,hash:n,mark:r}=R.variables;r?e[t]=n:delete e[t]}if(ae.isPending&&ae.variables)for(let{file:t}of ae.variables)delete e[t];return e},[C,R.isPending,R.variables,ae.isPending,ae.variables]),Ne=(0,A.useMemo)(()=>{let e=new Set;if(!C)return e;for(let[t,n]of Object.entries(C.fileHashes))Me[t]===n&&e.add(t);return e},[C,Me]),Pe=C?.commentsEnabled??!1,Fe=C?.send??!1,[Ie,Le]=(0,A.useState)(!1),[Re,ze]=(0,A.useState)(!1),Be=(0,A.useRef)(null);(0,A.useEffect)(()=>{h||Be.current?.getInstance()?.setSelectedLines(null)},[h]);let Ve=(0,A.useRef)(0),[He,Ue]=(0,A.useState)(null),We=(0,A.useRef)(null),Ge=(0,A.useCallback)(e=>{We.current=e,Ue(e)},[]),Ke=(0,A.useRef)(!1),qe=(0,A.useRef)(void 0),Je=(0,A.useCallback)(()=>{Ke.current=!0,clearTimeout(qe.current),qe.current=setTimeout(()=>{Ke.current=!1},200)},[]),Ye=(0,A.useRef)([]),Xe=(0,A.useCallback)((e,t)=>{Ve.current=e,Ke.current?Je():Ge(JR(t,e,Ye.current))},[Ge,Je]),Ze=(0,A.useRef)(new Map),Qe=(0,A.useMemo)(()=>C?Ce.map((e,t)=>{let n=e.name,r=C.fileHashes[n]??``;e.cacheKey??=`${n}|${r}|${e===de[t]?`patch`:`full`}`;let i=C.commentSyntaxes[n],a=Pe?ZL(e,n,!i||!(`sections`in i)&&i.prefix===``):[],s=nR(e);s&&a.push({side:e.type===`deleted`?`deletions`:`additions`,lineNumber:0,metadata:{type:`notice`,message:s}});let c=[];for(let t of _){if(t.file!==n)continue;let r=yR(e,t.side,t.lines[1]);r!==null&&(a.push({side:t.side,lineNumber:r,metadata:{type:`sent`,sent:t}}),c.push(`${t.id}@${r}`))}let l=B?.file===n&&!B.text?.columns;l&&a.push({side:B.side,lineNumber:B.line,metadata:{type:`composing`,file:n}});let u=o[n]??!1,d=l?`${B.side}${B.line}`:-1,f=`${C.fileHashes[n]??``}|${d}|${c.join(`,`)}|${+!!u}`,p=Ze.current.get(n),m=!p||p.key!==f||p.fileDiff!==e,h=m?(p?.version??0)+1:p.version;return m&&Ze.current.set(n,{key:f,fileDiff:e,version:h}),{id:n,type:`diff`,fileDiff:e,annotations:a,collapsed:u,version:h}}):[],[Ce,de,C,B,_,o,Pe]);Ye.current=Qe;let $e=He!=null&&Qe.some(e=>e.id===He)?He:Qe[0]?.id??null,et=(0,A.useRef)(null),tt=(0,A.useCallback)(e=>{let t=Be.current?.getInstance()?.getTopForItem(e);t!=null&&t<=Ve.current+4&&(et.current=e)},[]),nt=(0,A.useRef)(null),rt=(0,A.useCallback)(e=>{let t=Be.current;if(!t)return;nt.current=e,Je(),t.scrollTo({type:`item`,id:e,align:`start`});let n=0,r=()=>{nt.current===e&&(nt.current=null)},i=()=>{if(nt.current!==e)return;let t=Be.current?.getInstance();if(!t||++n>8)return r();let a=t.getTopForItem(e);if(a==null)return r();Math.abs(a-t.getScrollTop())>1&&(Je(),Be.current?.scrollTo({type:`item`,id:e,align:`start`})),requestAnimationFrame(i)};requestAnimationFrame(i)},[Je]),V=(0,A.useCallback)(e=>{Ye.current.some(t=>t.id===e)&&(Ge(e),rt(e))},[Ge,rt]);(0,A.useLayoutEffect)(()=>{let e=et.current;e&&(et.current=null,Je(),Be.current?.scrollTo({type:`item`,id:e,align:`start`,behavior:`instant`}))},[Qe,Je]);let it=(0,A.useRef)(new Map);(0,A.useEffect)(()=>{for(let[e,t]of it.current)t.setEditorActiveLine(ke?.file===e?ke.line:null)},[ke]);let at=(0,A.useCallback)(e=>{if(e.type!==`diff`)return null;let t=e.id,n=C?.fileHashes[t],r=Me[t],i=n!=null&&r===n,a=r!=null&&n!=null&&r!==n,c=o[t]??!1,l=e.fileDiff.hunks.length>0,u=he?null:`Line expansion isn't available for this diff range`;return(0,j.jsx)(NR,{fileDiff:e.fileDiff,isViewed:i,isStale:a,generated:C?.generated.includes(t)??!1,collapsed:c,focused:t===$e,showExpand:l,expandDisabledReason:u,expanded:p[t]??!1,onToggleCollapse:()=>{tt(t),s(e=>({...e,[t]:!c}))},onToggleViewed:()=>{if(!n)return;let e=!i;tt(t),s(n=>({...n,[t]:e})),R.mutate({file:t,hash:n,mark:e})},onToggleExpand:()=>{tt(t);let e=!(p[t]??!1);m(n=>({...n,[t]:e})),e&&c&&s(e=>({...e,[t]:!1}))}})},[C,Me,o,he,p,R,tt,$e]),ot=(0,A.useCallback)(e=>{if(!B)return null;let{file:t,side:n,first:r,line:i,text:a}=B,o=a?.columns??null;return(0,j.jsx)(TR,{copy:a?.copy??null,initialText:b.current,onTextChange:e=>{b.current=e},onSubmit:e=>{let n=Oe.current?.diff,s=n&&aL(n,`additions`,i);s!==void 0&&oe.mutate({file:t,afterLine:i,lineText:s,text:e,lineCount:i-r+1,quote:o&&a?.quote||void 0})},onSend:C?.send?s=>se.mutate({file:t,side:n,lines:[r,i],columns:o,quote:o&&a?a.quote:null,code:e&&CR(e,n,r,i),blob:e&&SR(e,n),text:s}):void 0,inlineUnavailable:Pe?n===`deletions`?`Inline comments go on the new side of the diff`:null:`Inline comments need the diff to end at the working copy`,onCancel:()=>g(null),submitting:oe.isPending&&oe.variables?.file===t||se.isPending,error:oe.variables?.file===t&&oe.error?oe.error.message:se.error?.message??null,syntax:C?.commentSyntaxes[t]??null},B.opened)},[oe,se,C,B,Pe]),st=(0,A.useCallback)((e,t,n)=>{let r=e.metadata;if(!r)return null;if(r.type===`notice`)return(0,j.jsx)(`div`,{className:`file-notice`,children:r.message});let i=n.id;if(r.type===`review`)return(0,j.jsxs)(`div`,{className:`review-annotation`,children:[(0,j.jsx)(`span`,{className:`review-annotation-lines`,children:r.target.start===r.target.end?`Line ${r.target.start}`:`Lines ${r.target.start}–${r.target.end}`}),(0,j.jsx)(vR,{onClick:()=>ce.mutate({file:i,line:r.startLine}),children:`Resolve comment`})]});if(r.type===`sent`){let{id:e,quote:t,text:n}=r.sent;return(0,j.jsxs)(`div`,{className:`sent-comment`,children:[(0,j.jsxs)(`div`,{className:`sent-comment-head`,children:[(0,j.jsx)(`span`,{className:`sent-comment-label`,children:`Sent`}),t&&(0,j.jsx)(`span`,{className:`comment-quote`,children:FI(t,120)}),(0,j.jsx)(`button`,{type:`button`,className:`sent-comment-dismiss`,"aria-label":`Dismiss`,title:`Dismiss`,onClick:()=>v(t=>t.filter(t=>t.id!==e)),children:`×`})]}),(0,j.jsx)(`div`,{className:`sent-comment-text`,children:n})]})}return r.type===`composing`?ot(n.type===`diff`?n.fileDiff:null):null},[ce,ot]),ct=(0,A.useRef)(()=>{}),lt=e=>Fe||Pe&&e===`additions`;ct.current=(e,t)=>{let n=e.side??`additions`;if(!lt(n))return;let r=e.endSide!=null&&e.endSide!==n,i=r?e.end:Math.min(e.start,e.end),a=r?e.end:Math.max(e.start,e.end),o=r?e.endSide:n;bR(t,o,i,a)||Te(t.id,o,i,a)};let ut=(0,A.useRef)(new WeakMap),dt=e=>[...document.querySelectorAll(`diffs-container`)].find(t=>ut.current.get(t)===e),ft=e=>{if(e.button!==0)return;let t=e.composedPath(),n=e=>t.some(t=>t instanceof Element&&t.matches(e));if(n(`.comment-form, [data-gutter]`))return;let r=!b.current.trim(),i=SL([...document.querySelectorAll(`diffs-container`)]);if(!i){Oe.current&&r&&n(`[data-line]`)&&g(null);return}if(Oe.current&&!r)return;let a=ut.current.get(i.host),o=Qe.find(e=>e.id===a),s=o&&aL(o.fileDiff,i.side,i.last);if(!a||!o||s===void 0)return;let{side:c,first:l,last:u}=i;if(!lt(c))return;let d=[i.columns[0],Math.min(i.columns[1],s.length)],f=d[0]===0&&d[1]===s.length;!f&&l===u&&d[0]>=d[1]||bR(o,c,l,u)||(Te(a,c,l,u,{columns:f?null:d,quote:XL(o.fileDiff,c,l,u,d),copy:window.getSelection()?.toString()??``}),Be.current?.getInstance()?.setSelectedLines(f?{id:a,range:{start:l,end:u,side:c}}:null))},pt=(0,A.useRef)(()=>{});pt.current=e=>{ft(e),Oe.current?.text?.columns&&!vt.assignedSlot&&yt.current()};let ht=(0,A.useRef)(()=>{});ht.current=e=>{if(!(e.detail<3||!Oe.current?.text?.columns||b.current.trim())&&!e.composedPath().some(e=>e instanceof Element&&e.matches(`.comment-form`)))for(let e of document.querySelectorAll(`diffs-container`))e.shadowRoot&&EL(e.shadowRoot,kL)},(0,A.useEffect)(()=>{if(!Fe&&!Pe)return;let e=e=>ht.current(e),t=e=>pt.current(e);return document.addEventListener(`mousedown`,e,!0),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousedown`,e,!0),document.removeEventListener(`mouseup`,t)}},[Fe,Pe]);let[vt]=(0,A.useState)(()=>{let e=document.createElement(`div`);return e.slot=kL,e.className=`comment-inline`,e}),yt=(0,A.useRef)(()=>{});yt.current=()=>{let e=Oe.current,t=e?.text?.columns,n=e&&t?dt(e.file):void 0,r=n&&wL(n,e.side,e.first,e.line,t)||null;for(let e of document.querySelectorAll(`diffs-container`))e.shadowRoot&&e!==n&&EL(e.shadowRoot,kL);n?.shadowRoot&&r?(vt.parentElement!==n&&n.append(vt),TL(n.shadowRoot,r,kL)):vt.remove(),`highlights`in CSS&&(r?CSS.highlights.set(`comment-quote`,new Highlight(r)):CSS.highlights.delete(`comment-quote`))},(0,A.useLayoutEffect)(()=>yt.current(),[B]);let bt=(0,A.useMemo)(()=>({theme:OL,themeType:te,preferredHighlighter:AL,diffStyle:r,itemMetrics:{diffHeaderHeight:40,paddingBottom:0},diffIndicators:`classic`,hunkSeparators:`line-info-basic`,overflow:`wrap`,stickyHeaders:!0,layout:{paddingTop:0,paddingBottom:8,gap:12},enableGutterUtility:Pe||Fe,loadDiffFiles:he?async e=>{let t=await ve.current(e);return{oldFile:{name:e.prevName??e.name,contents:t.oldContents??``},newFile:{name:e.name,contents:t.newContents??``}}}:void 0,unsafeCSS:Fe?dR:dR+fR,onGutterUtilityClick:(e,t)=>ct.current(e,t.item),onPostRender:(e,t,n,r)=>{let i=r.item.id,a=it.current;if(n===`unmount`){a.get(i)===t&&a.delete(i),ut.current.delete(e);return}ut.current.set(e,i);for(let[e,n]of a)n===t&&e!==i&&a.delete(e);a.set(i,t);let o=je.current;t.setEditorActiveLine(o?.file===i?o.line:null),e.toggleAttribute(`data-file-notice`,r.item.type===`diff`&&nR(r.item.fileDiff)!=null);let{blocks:s,targets:c}=_R(r.item.annotations);pR(e,s,c),Oe.current?.file===i&&yt.current()}}),[te,r,Pe,Fe,he]);if((0,A.useEffect)(()=>{function e(){let e=Qe.findIndex(e=>e.id===We.current);return e<0?0:e}function t(e){let t=(Be.current?.getInstance())?.getRenderedItems().find(t=>t.id===e);return t?.type===`diff`?t.instance:void 0}function r(){return document.querySelector(`.file-header`)?.getBoundingClientRect().height??0}function i(e,n){let i=Be.current?.getInstance(),a=i?.getTopForItem(e),o=t(e)?.getLinePosition(n,`additions`);if(i==null||a==null||o==null)return!1;let s=a+o.top,c=Ve.current;return s>=c+r()&&s+o.height<=c+i.getHeight()}function c(e){return o[e]??!1?[]:we.get(e)??[]}function l(e,t,n){for(let r=e;r>=0&&r<Qe.length;r+=n?1:-1){let i=c(Qe[r].id),a=r===e?t:n?-1/0:1/0,o=n?i.find(e=>e>a):i.findLast(e=>e<a);if(o!=null)return{file:Qe[r].id,line:o}}}function p(e){let n=c(e),i=Be.current?.getInstance(),a=i?.getTopForItem(e),o=t(e);if(!n.length||i==null||a==null||o==null)return null;let s=Ve.current+r()-a,l=0,u=n.length-1,d=-1;for(;l<=u;){let e=l+u>>1,t=o.getLinePosition(n[e],`additions`);if(t==null)return null;t.top>=s?(d=e,u=e-1):l=e+1}return d>=0?n[d]:null}function m(t){if(t.key===`k`&&(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey){t.preventDefault(),LR()||(f.current=!0,u(!0));return}let r=t.composedPath()[0];if(!(r instanceof HTMLTextAreaElement||r instanceof HTMLInputElement)&&!(t.ctrlKey||t.metaKey||t.altKey))switch(t.key){case`n`:case`p`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=Be.current?.getInstance();if(!n)break;let r=e(),i;if(t.key===`n`){if(r===Qe.length-1)break;i=r+1}else{let e=Qe[r].id,t=n.getTopForItem(e)??0;i=nt.current!==e&&Ve.current>t+4?r:Math.max(r-1,0)}let a=Qe[i].id;Ge(a),rt(a);let o=we.get(a);Ae(o?.length?{file:a,line:o[0]}:null);break}case`j`:case`k`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=t.key===`j`,r=je.current,a;if(r&&i(r.file,r.line))a=l(Qe.findIndex(e=>e.id===r.file),r.line,n);else{let t=e(),r=Qe[t].id,i=p(r);a=i==null?l(t,1/0,n):{file:r,line:i}}if(!a)break;Ge(a.file),Ae(a),nt.current=null,Je(),Be.current?.scrollTo({type:`line`,id:a.file,lineNumber:a.line,side:`additions`,align:`nearest`,behavior:`instant`});break}case`c`:{if(!(Pe||Fe)||Ie||B)break;t.preventDefault();let e=je.current;if(!e||(o[e.file]??!1))break;let n=Qe.find(t=>t.id===e.file);if(n&&bR(n,`additions`,e.line,e.line))break;Te(e.file,`additions`,e.line,e.line);break}case`e`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=Qe[e()].id;tt(n),s(e=>({...e,[n]:!(e[n]??!1)}));break}case`v`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=Qe[e()].id,r=C?.fileHashes[n];if(!r)break;let i=Me[n]!==r;tt(n),s(e=>({...e,[n]:i})),R.mutate({file:n,hash:r,mark:i});break}case`?`:t.preventDefault(),Le(e=>!e);break;case`r`:if(Ie||!O)break;t.preventDefault(),k();break;case`Escape`:Ie?(t.preventDefault(),Le(!1)):B&&(t.preventDefault(),g(null));break;case`b`:if(Ie||B)break;t.preventDefault(),d();break;case`s`:if(Ie||B)break;t.preventDefault(),n(e=>{let t=qR[(qR.indexOf(e)+1)%qR.length];return a((0,j.jsxs)(j.Fragment,{children:[`Split mode: `,(0,j.jsx)(`code`,{children:t})]})),t});break;case`E`:{if(Ie||B)break;t.preventDefault();let n=Ce.some(e=>!(o[e.name]??!1));Qe.length>0&&tt(Qe[e()].id),s(Object.fromEntries(Ce.map(e=>[e.name,n])));break}case`t`:{if(Ie||B)break;t.preventDefault();let{stored:e,resolved:n}=ne();a((0,j.jsxs)(j.Fragment,{children:[`Theme: `,(0,j.jsx)(`code`,{children:n}),e===`system`?` (following system)`:null]}));break}}}function h(e){e.key===`Escape`&&e.composedPath()[0]===IR()&&document.querySelector(`.codeview-root`)?.focus({preventScroll:!0})}return window.addEventListener(`keydown`,h,!0),window.addEventListener(`keydown`,m),()=>{window.removeEventListener(`keydown`,h,!0),window.removeEventListener(`keydown`,m)}},[Ie,B,Ce,o,a,Qe,C,Me,R,tt,we,Pe,Te,Ge,Je,rt,u,d,ne,O,k,Fe,se]),VL(w))return(0,j.jsxs)(`div`,{className:`error-panel`,role:`alert`,children:[(0,j.jsx)(`h1`,{children:`No valid access token`}),(0,j.jsxs)(`p`,{children:[`Open the URL skepsis printed at startup, with the `,(0,j.jsx)(`code`,{children:`#token=`}),` fragment. Once a browser has opened it, the fragment can be left off for the rest of that run.`]})]});if(w&&!C)return(0,j.jsx)(`pre`,{style:{color:`red`,padding:20},children:String(w)});if(E||!C)return(0,j.jsx)(`div`,{className:`empty-diff`,children:`Loading...`});if(C.error)return(0,j.jsx)(`pre`,{style:{color:`red`,padding:20},children:C.error});if(!le)return(0,j.jsxs)(j.Fragment,{children:[O&&(0,j.jsx)(`div`,{className:`header-row diff-changed-standalone`,children:(0,j.jsx)(GR,{changes:me,onRefresh:k})}),(0,j.jsxs)(`div`,{className:`empty-diff`,children:[(0,j.jsx)(`code`,{children:C.revset}),` is empty`]})]});let{fileHashes:xt}=C;return(0,j.jsxs)(j.Fragment,{children:[!C.commentsEnabled&&(0,j.jsx)(UR,{vcs:C.vcs,send:C.send,onLearnMore:()=>ze(!0)}),(0,j.jsxs)(`div`,{className:`diff-container`,children:[(0,j.jsxs)(`div`,{className:`header-row`,children:[(0,j.jsx)(RR,{treeOpen:c,onToggleTree:d,command:C.revset,fileHashes:xt,viewed:Me,resolvedTheme:ie,onToggleTheme:ne,onShowHelp:()=>Le(!0),onUnviewAll:()=>{let e=Object.entries(Me).map(([e,t])=>({file:e,hash:t}));e.length!==0&&(s(t=>{let n={...t};for(let{file:t}of e)n[t]=!1;return n}),ae.mutate(e))}}),i&&(0,j.jsx)(`div`,{className:`toast`,style:{animationDuration:`${i.ms}ms`},children:i.content},i.key),O&&(0,j.jsx)(GR,{changes:me,onRefresh:k})]}),Ie&&(0,j.jsx)(VR,{send:C.send,onClose:()=>Le(!1)}),Re&&(0,j.jsx)(HR,{vcs:C.vcs,onClose:()=>ze(!1)}),(0,j.jsxs)(`div`,{className:`diff-body`,onPointerDownCapture:e=>{if(e.button!==0||!(e.target instanceof Element))return;let t=e.target.closest(`.codeview-root`);t&&!t.contains(document.activeElement)&&t.focus({preventScroll:!0})},children:[c&&(0,j.jsx)(FR,{paths:z,gitStatus:fe,viewed:Ne,focusedFile:$e,onSelectFile:V}),(0,j.jsx)(J_,{ref:Be,className:`codeview-root`,items:Qe,options:bt,onScroll:Xe,renderCustomHeader:at,renderAnnotation:st}),B?.text?.columns&&(0,Ki.createPortal)(ot(Qe.find(e=>e.id===B.file)?.fileDiff??null),vt)]})]})]})}var XR={workerFactory:()=>new qD,poolSize:2},ZR={theme:OL,preferredHighlighter:AL};function QR(){let e=(0,j.jsx)(oc,{children:(0,j.jsx)(YR,{})});return(0,j.jsx)(P,{client:DL,children:AL===`highlights`?e:(0,j.jsx)(U_,{poolOptions:XR,highlighterOptions:ZR,children:e})})}(0,D.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(QR,{}));export{Pc as a,Ic as i,nu as n,Lc as r,a_ as t};
1570
+ `)}))}var wR=({prefix:e,suffix:t})=>t?`${e} ${t}`:e;function TR({copy:e,initialText:t,onTextChange:n,onSubmit:r,onSend:i,inlineUnavailable:a,onCancel:o,submitting:s,error:c,syntax:l}){let[u,d]=(0,A.useState)(t),f=(0,A.useRef)(null);(0,A.useEffect)(()=>{f.current?.focus()},[]);let p=e=>{let t=u.trim();e&&t&&!s&&e(t)},m=a?void 0:r;return(0,j.jsxs)(`div`,{className:`comment-form`,onClick:e=>e.stopPropagation(),children:[(0,j.jsx)(`textarea`,{ref:f,value:u,onChange:e=>{d(e.target.value),n(e.target.value)},onKeyDown:t=>{e&&!u.trim()&&t.key===`c`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),navigator.clipboard.writeText(e)),t.key===`Enter`&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),p(i?t.altKey?m:i:r)),t.key===`Escape`&&o()},placeholder:`Leave a review comment... (${i?`${qL} sends`:`${qL} to submit`})`,rows:3,disabled:s}),(0,j.jsxs)(`div`,{className:`comment-form-actions`,children:[(0,j.jsx)(`div`,{className:`comment-form-note`,children:a||(l===null?(0,j.jsx)(j.Fragment,{children:`Comment marker: none (file type not recognized)`}):`sections`in l?(0,j.jsxs)(j.Fragment,{children:[`Comment marker:`,` `,Object.entries(l.sections).map(([e,t],n)=>(0,j.jsxs)(A.Fragment,{children:[n>0&&`, `,(0,j.jsx)(`code`,{children:wR(t)}),` in `,e]},e))]}):l.prefix===``?(0,j.jsx)(j.Fragment,{children:`Comment marker: none (plain text)`}):(0,j.jsxs)(j.Fragment,{children:[`Comment marker: `,(0,j.jsx)(`code`,{children:wR(l)})]}))}),c&&(0,j.jsx)(`div`,{className:`comment-form-error`,children:c}),(0,j.jsxs)(`div`,{className:`comment-form-buttons`,children:[(0,j.jsx)(vR,{variant:`ghost`,onClick:o,disabled:s,children:`Cancel`}),i?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(vR,{disabled:!u.trim()||s||!m,onClick:()=>p(m),title:`Write the comment into the file as a review marker (${JL})`,children:`Comment`}),(0,j.jsx)(vR,{variant:`primary`,disabled:!u.trim()||s,onClick:()=>p(i),title:`Send the comment to the --send command (${qL})`,children:`Send`})]}):(0,j.jsx)(vR,{variant:`primary`,disabled:!u.trim()||s,onClick:()=>p(r),children:`Comment`})]})]})]})}function ER({text:e,closeOnClick:t,children:n}){return(0,j.jsxs)(Cs,{children:[(0,j.jsx)(js,{delay:150,closeOnClick:t,render:n}),(0,j.jsx)(Fs,{children:(0,j.jsx)(ic,{className:`tooltip-positioner`,side:`bottom`,sideOffset:6,children:(0,j.jsx)(ac,{className:`tooltip-popup`,children:e})})})]})}function DR(){return(0,j.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:[(0,j.jsx)(`path`,{fill:`currentColor`,d:`M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z`}),(0,j.jsx)(`path`,{fill:`currentColor`,d:`M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z`})]})}function OR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z`})})}function kR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`14`,height:`14`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z`})})}function AR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M8 12a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0-1.5a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Zm5.657-8.157a.75.75 0 0 1 0 1.061l-1.061 1.06a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l1.06-1.06a.75.75 0 0 1 1.06 0Zm-9.193 9.193a.75.75 0 0 1 0 1.06l-1.06 1.061a.75.75 0 1 1-1.061-1.06l1.06-1.061a.75.75 0 0 1 1.061 0ZM8 0a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0V.75A.75.75 0 0 1 8 0ZM3 8a.75.75 0 0 1-.75.75H.75a.75.75 0 0 1 0-1.5h1.5A.75.75 0 0 1 3 8Zm13 0a.75.75 0 0 1-.75.75h-1.5a.75.75 0 0 1 0-1.5h1.5A.75.75 0 0 1 16 8Zm-8 5a.75.75 0 0 1 .75.75v1.5a.75.75 0 0 1-1.5 0v-1.5A.75.75 0 0 1 8 13Zm3.536-1.464a.75.75 0 0 1 1.06 0l1.061 1.06a.75.75 0 0 1-1.06 1.061l-1.061-1.06a.75.75 0 0 1 0-1.061ZM2.343 2.343a.75.75 0 0 1 1.061 0l1.06 1.061a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-1.06-1.06a.75.75 0 0 1 0-1.06Z`})})}function jR(){return(0,j.jsx)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,"aria-hidden":`true`,children:(0,j.jsx)(`path`,{fill:`currentColor`,d:`M9.598 1.591a.749.749 0 0 1 .785-.175 7.001 7.001 0 1 1-8.967 8.967.75.75 0 0 1 .961-.96 5.5 5.5 0 0 0 7.046-7.046.75.75 0 0 1 .175-.786Zm1.616 1.945a7 7 0 0 1-7.678 7.678 5.499 5.499 0 1 0 7.678-7.678Z`})})}function MR(){return(0,j.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`18`,height:`18`,"aria-hidden":`true`,children:[(0,j.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`}),(0,j.jsx)(`path`,{d:`M6.5 6a1.5 1.5 0 0 1 3 0c0 1-1.5 1.25-1.5 2.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,j.jsx)(`circle`,{cx:`8`,cy:`11`,r:`.75`,fill:`currentColor`})]})}function NR({fileDiff:e,isViewed:t,isStale:n,generated:r,collapsed:i,focused:a,showExpand:o,expandDisabledReason:s,expanded:c,onToggleCollapse:l,onToggleViewed:u,onToggleExpand:d}){let{additions:f,deletions:p}=uR(e),[m,h]=(0,A.useState)(!1);return(0,j.jsxs)(`div`,{className:`file-header`+(a?` focused`:``),onPointerDown:e=>{e.button===0&&!e.shiftKey&&window.getSelection()?.removeAllRanges()},onClick:()=>{let e=window.getSelection();(!e||e.isCollapsed)&&l()},children:[(0,j.jsx)(`span`,{className:`collapse-chevron`+(i?` collapsed`:``),children:`▶`}),(0,j.jsxs)(`span`,{className:`file-header-name`,children:[e.prevName!=null&&e.prevName!==e.name&&(0,j.jsxs)(`span`,{className:`file-header-prev-name`,children:[e.prevName,` → `]}),e.name]}),(0,j.jsx)(ER,{text:m?`Copied!`:`Copy file name to clipboard`,closeOnClick:!1,children:(0,j.jsx)(`button`,{type:`button`,className:`copy-name-button`+(m?` copied`:``),"aria-label":`Copy file name to clipboard`,onClick:t=>{t.stopPropagation(),navigator.clipboard.writeText(e.name).then(()=>{h(!0),setTimeout(()=>h(!1),2e3)})},children:(0,j.jsxs)(`span`,{className:`copy-icon-stack`,children:[(0,j.jsx)(DR,{}),(0,j.jsx)(OR,{})]})})}),r&&(0,j.jsx)(`span`,{className:`generated-label`,children:`Generated`}),o&&(0,j.jsx)(ER,{text:s??(c?`Collapse expanded lines`:`Expand all lines`),children:(0,j.jsx)(`button`,{type:`button`,className:`expand-all-button`+(c?` expanded`:``)+(s?` disabled`:``),"aria-label":c?`Collapse expanded lines`:`Expand all lines`,"aria-disabled":s!==null,onClick:e=>{e.stopPropagation(),!s&&d()},children:(0,j.jsx)(kR,{})})}),(0,j.jsx)(KR,{className:`file-header-stats`,additions:f,deletions:p}),(0,j.jsxs)(`button`,{type:`button`,className:`viewed-button`+(n?` stale`:``)+(t?` checked`:``),onClick:e=>{e.stopPropagation(),u()},children:[(0,j.jsx)(`input`,{type:`checkbox`,className:`viewed-checkbox`+(n?` stale`:``),checked:t,readOnly:!0,tabIndex:-1}),n?`Changed`:`Viewed`]})]})}function PR({open:e}){return(0,j.jsxs)(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`,children:[(0,j.jsx)(`path`,{fill:`currentColor`,d:`M1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0ZM1.5 1.75v12.5c0 .138.112.25.25.25H4.5v-13H1.75a.25.25 0 0 0-.25.25ZM6 14.5h8.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25H6Z`}),(0,j.jsx)(`path`,{fill:`currentColor`,d:e?`M11.28 5.22a.75.75 0 0 1 0 1.06L9.56 8l1.72 1.72a.75.75 0 1 1-1.06 1.06l-2.25-2.25a.75.75 0 0 1 0-1.06l2.25-2.25a.75.75 0 0 1 1.06 0Z`:`M8.72 5.22a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 1 1-1.06-1.06L10.44 8 8.72 6.28a.75.75 0 0 1 0-1.06Z`})]})}function FR({paths:e,gitStatus:t,viewed:n,focusedFile:r,onSelectFile:i}){let a=(0,A.useRef)(!1),o=(0,A.useRef)(i);o.current=i;let s=(0,A.useRef)(n),c=(0,A.useMemo)(()=>KD(e),[e]),{model:l}=GD({preparedInput:c,gitStatus:t,initialExpansion:`open`,flattenEmptyDirectories:!0,stickyFolders:!0,search:!0,density:`compact`,icons:aR,unsafeCSS:oR,renderRowDecoration:({item:e})=>e.kind===`file`&&s.current.has(e.path)?{icon:{name:`skepsis-check`,width:14,height:14},title:`Viewed`}:null,onSelectionChange:e=>{if(a.current||e.length!==1)return;let t=e[0];l.getItem(t)?.isDirectory()||o.current(t)}}),u=(0,A.useRef)(!0);return(0,A.useEffect)(()=>{u.current?u.current=!1:(l.resetPaths({preparedInput:c}),l.setGitStatus(t))},[l,c,t]),(0,A.useEffect)(()=>{s.current=n,l.setIcons(aR)},[l,n]),(0,A.useEffect)(()=>{if(r&&l.getItem(r)){a.current=!0;try{for(let e of l.getSelectedPaths())e!==r&&l.getItem(e)?.deselect();l.getItem(r)?.select()}finally{a.current=!1}l.scrollToPath(r,{focus:!1,offset:`nearest`})}},[l,r,e]),(0,j.jsx)(vv,{className:`file-tree`,model:l})}function IR(){return document.querySelector(`.file-tree`)?.shadowRoot?.querySelector(`input`)??null}function LR(){let e=IR();return e?(e.focus(),!0):!1}function RR({treeOpen:e,onToggleTree:t,command:n,fileHashes:r,viewed:i,onUnviewAll:a,resolvedTheme:o,onToggleTheme:s,onShowHelp:c}){let l=Object.keys(r).length,u=Object.entries(r).filter(([e,t])=>i[e]===t).length;if(l===0)return null;let d=o===`dark`?`light`:`dark`,f=e?`Hide file tree`:`Show file tree`;return(0,j.jsxs)(`div`,{className:`progress-bar`,children:[(0,j.jsx)(ER,{text:(0,j.jsxs)(j.Fragment,{children:[f,` `,(0,j.jsx)(`kbd`,{children:`b`})]}),children:(0,j.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":f,"aria-expanded":e,onClick:t,children:(0,j.jsx)(PR,{open:e})})}),(0,j.jsx)(`code`,{className:`diff-command`,title:n,children:n}),(0,j.jsx)(`div`,{className:`progress-track`,children:(0,j.jsx)(`div`,{className:`progress-fill`,style:{width:`${u/l*100}%`}})}),(0,j.jsxs)(`span`,{children:[u,`/`,l,` files viewed`]}),(0,j.jsx)(ER,{text:`Mark all files unviewed`,children:(0,j.jsx)(`button`,{type:`button`,className:`unview-all-button`+(u===0?` disabled`:``),"aria-disabled":u===0,onClick:()=>{u>0&&a()},children:`Clear`})}),(0,j.jsx)(ER,{text:(0,j.jsxs)(j.Fragment,{children:[`Switch to `,d,` mode `,(0,j.jsx)(`kbd`,{children:`t`})]}),children:(0,j.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`Switch to ${d} mode`,onClick:s,children:o===`light`?(0,j.jsx)(AR,{}):(0,j.jsx)(jR,{})})}),(0,j.jsx)(ER,{text:(0,j.jsxs)(j.Fragment,{children:[`Keyboard shortcuts `,(0,j.jsx)(`kbd`,{children:`?`})]}),children:(0,j.jsx)(`button`,{type:`button`,className:`icon-button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,onClick:c,children:(0,j.jsx)(MR,{})})})]})}function zR({onClose:e,children:t}){let n=(0,A.useRef)(null);return(0,A.useEffect)(()=>n.current?.showModal(),[]),(0,j.jsx)(`dialog`,{ref:n,className:`help-modal`,onClose:e,onClick:e=>{e.target===e.currentTarget&&n.current?.close()},children:t})}var BR=[[`j / k`,`Next / previous line`],[`n / p`,`Next / previous file`],[`v`,`Toggle viewed`],[`e / E`,`Toggle collapse file / all files`],[`s`,`Toggle split mode (responsive / unified)`],[`t`,`Toggle light / dark`],[`b`,`Toggle file tree`],[KL,`Search files`],[`c`,`Comment on line`],[qL,`Send the comment to the --send command`,`send`],[JL,`Comment in the file (review marker)`,`send`],[`r`,`Refresh after the diff changes on disk`],[`Esc`,`Close / cancel`],[`?`,`Toggle this help`]];function VR({onClose:e,send:t}){return(0,j.jsxs)(zR,{onClose:e,children:[(0,j.jsx)(`h3`,{children:`Keyboard Shortcuts`}),(0,j.jsx)(`table`,{children:(0,j.jsx)(`tbody`,{children:BR.filter(([,,e])=>!e||t).map(([e,t])=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:e.split(` / `).map((e,t)=>(0,j.jsxs)(`span`,{children:[t>0&&` / `,(0,j.jsx)(`kbd`,{children:e})]},e))}),(0,j.jsx)(`td`,{children:t})]},e))})})]})}function HR({onClose:e,vcs:t,interdiff:n}){return n?(0,j.jsxs)(zR,{onClose:e,children:[(0,j.jsxs)(`p`,{children:[`Comments work by inserting lines into files in `,(0,j.jsx)(`code`,{children:`@`}),`. An interdiff can include a `,(0,j.jsx)(`code`,{children:`JJ-COMMIT-DESCRIPTION`}),` pseudo-file with no matching file on disk, so comments are off for interdiffs, even ones that end at `,(0,j.jsx)(`code`,{children:`@`}),`.`]}),(0,j.jsxs)(`p`,{children:[`To comment on an interdiff, use Send, which pipes comments to the command given with `,(0,j.jsx)(`code`,{children:`--send`}),`.`]})]}):(0,j.jsxs)(zR,{onClose:e,children:[(0,j.jsxs)(`p`,{children:[`Comments work by inserting lines into the code. This can only work if the`,` `,t===`jj`?(0,j.jsxs)(j.Fragment,{children:[`revset includes `,(0,j.jsx)(`code`,{children:`@`})]}):`commit range includes the working copy`,`. Otherwise, the inserted lines will land in`,` `,t===`jj`?(0,j.jsx)(`code`,{children:`@`}):`the working copy`,` but not in the diff being viewed.`]}),t===`jj`?(0,j.jsxs)(`p`,{children:[`The easiest way to get a diff with comments enabled is to run with the`,` `,(0,j.jsx)(`code`,{children:`-f`}),` flag to get a diff that starts at some revision and ends at`,` `,(0,j.jsx)(`code`,{children:`@`}),`.`]}):(0,j.jsxs)(`p`,{children:[`The easiest way to get a diff with comments enabled is to run with `,(0,j.jsx)(`code`,{children:`-f`}),` `,`only (no `,(0,j.jsx)(`code`,{children:`-t`}),`), so the diff goes from a commit to the working tree.`]})]})}function UR({onLearnMore:e,vcs:t,send:n,interdiff:r}){return(0,j.jsxs)(`div`,{className:`comments-disabled-banner`,children:[n?`Inline comments are off for this diff, but Send still works.`:r?`Comments are disabled for interdiffs.`:t===`jj`?(0,j.jsxs)(j.Fragment,{children:[`Comments are disabled because the revset does not include `,(0,j.jsx)(`code`,{children:`@`}),`.`]}):`Comments are disabled because the commit range does not end at the working copy.`,` `,(0,j.jsx)(`a`,{href:`#`,onClick:t=>{t.preventDefault(),e()},children:`Learn more`})]})}var WR={added:`new in diff`,removed:`gone from diff`,base:`base changed`};function GR({changes:e,onRefresh:t}){let n=e?.length?e:null,r=0,i=0;for(let e of n??[])r+=e.additions,i+=e.deletions;return(0,j.jsxs)(`div`,{className:`diff-changed-toast`,role:`status`,children:[(0,j.jsxs)(`div`,{className:`diff-changed-row`,children:[(0,j.jsxs)(`span`,{className:`diff-changed-summary`,children:[`The diff changed on disk`,n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`diff-changed-count`,children:[n.length,` `,n.length===1?`file`:`files`]}),(0,j.jsx)(KR,{additions:r,deletions:i})]})]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-tinted`,onClick:t,children:[`Refresh `,(0,j.jsx)(`kbd`,{children:`r`})]})]}),n&&(0,j.jsx)(`ul`,{className:`diff-changed-files`,children:n.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`span`,{className:`diff-changed-name`,children:e.name}),e.status!==`changed`&&(0,j.jsx)(`span`,{className:`diff-changed-status`,children:WR[e.status]}),(0,j.jsx)(KR,{additions:e.additions,deletions:e.deletions})]},e.name))})]})}function KR({additions:e,deletions:t,className:n}){return(0,j.jsxs)(`span`,{className:n?`line-counts ${n}`:`line-counts`,children:[e>0&&(0,j.jsxs)(`span`,{className:`stat-add`,children:[`+`,e]}),t>0&&(0,j.jsxs)(`span`,{className:`stat-del`,children:[`-`,t]})]})}var qR=[`responsive`,`unified`];function JR(e,t,n){let r=n[0]?.id??null;for(let i of n){let n=e.getTopForItem(i.id);if(n!=null){if(n<=t+4)r=i.id;else break}}return r}function YR(){let e=WL(),[t,n]=(0,A.useState)(`responsive`),r=t===`responsive`&&e?`split`:`unified`,{toast:i,showToast:a}=YL(),[o,s]=(0,A.useState)({}),[c,l]=(0,A.useState)(cR),u=(0,A.useCallback)(e=>{lR(e),l(e)},[]),d=(0,A.useCallback)(()=>u(!c),[u,c]),f=(0,A.useRef)(!1);(0,A.useEffect)(()=>{c&&f.current&&(f.current=!1,requestAnimationFrame(()=>LR()))},[c]);let[p,m]=(0,A.useState)({}),[h,g]=(0,A.useState)(null),[_,v]=(0,A.useState)([]),y=(0,A.useRef)(0),b=(0,A.useRef)(``),x=(0,A.useRef)(!1),S=N(),{data:C,error:w,errorUpdatedAt:T,isLoading:E}=gt({queryKey:[`diff`],queryFn:async()=>{let e=await HL(`/api/diff`);return await S.cancelQueries({queryKey:[`diff-hash`]}),S.setQueryData([`diff-hash`],{hash:e.patchHash}),e},refetchOnWindowFocus:!1,retry:!1}),{data:D}=gt({queryKey:[`diff-hash`],queryFn:()=>HL(`/api/diff-hash`),enabled:C?.poll===!0,refetchInterval:jL}),O=!!C&&!!D&&D.hash!==C.patchHash,k=(0,A.useCallback)(()=>S.invalidateQueries({queryKey:[`diff`]}),[S]),{data:M}=gt({queryKey:[`diff-preview`,D?.hash],queryFn:()=>HL(`/api/diff`),enabled:O,placeholderData:_e}),P=(0,A.useRef)(0);(0,A.useEffect)(()=>{w&&C&&T!==P.current&&(P.current=T,a(`Couldn't reload the diff: ${w.message}`,6e3))},[w,C,T,a]);let F=C?.repo,I=C?.revset;(0,A.useEffect)(()=>{F&&I&&(document.title=`skepsis | ${F} | ${I}`)},[F,I]),(0,A.useEffect)(()=>{if(!C)return;let e=!x.current;x.current=!0;let t=new Set(C.generated);s(n=>{let r=Object.entries(C.fileHashes).filter(([r,i])=>!(r in n)&&(t.has(r)||e&&C.viewed[r]===i));return r.length===0?n:{...n,...Object.fromEntries(r.map(([e])=>[e,!0]))}})},[C]);let{data:ee}=gt({queryKey:[`theme`],queryFn:()=>HL(`/api/theme`),initialData:{theme:NL}}),te=ee.theme,L=_t({mutationFn:e=>HL(`/api/theme`,{method:`POST`,body:{theme:e}}),onMutate:e=>S.setQueryData([`theme`],{theme:e})}).mutate,ne=(0,A.useCallback)(()=>{let e=S.getQueryData([`theme`])?.theme??`system`,t=!(e===`system`?IL():e===`dark`),n=t?`dark`:`light`,r=t===IL()?`system`:n;return L(r),{stored:r,resolved:n}},[S,L]),re=LL(),ie=te===`system`?re?`dark`:`light`:te;(0,A.useEffect)(()=>PL(te),[te]);let R=_t({mutationFn:({file:e,hash:t,mark:n})=>HL(`/api/viewed`,{method:n?`POST`:`DELETE`,body:{file:e,hash:t}}),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),ae=_t({mutationFn:e=>HL(`/api/viewed-all`,{method:`DELETE`,body:{files:e}}),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),oe=_t({mutationFn:e=>HL(`/api/comment`,{method:`POST`,body:e}),onSuccess:()=>g(null),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),se=_t({mutationFn:({quote:e,...t})=>HL(`/api/send`,{method:`POST`,body:t}),onSuccess:(e,{file:t,side:n,lines:r,quote:i,text:a})=>{g(null),t&&n&&r&&v(e=>[...e,{id:++y.current,file:t,side:n,lines:r,quote:i,text:a}])}}),ce=_t({mutationFn:({file:e,line:t})=>HL(`/api/comment`,{method:`DELETE`,body:{file:e,line:t}}),onSettled:()=>S.invalidateQueries({queryKey:[`diff`]})}),le=C?.patch,ue=(0,A.useRef)(new Map),{patchFiles:de,treePaths:z,treeStatus:fe}=(0,A.useMemo)(()=>{if(!le)return{patchFiles:[],treePaths:[],treeStatus:[]};let e=xI(Lf(le).flatMap(e=>e.files)).toSorted((e,t)=>iR(e.name,t.name)),t=e.flatMap(e=>{let t=rR[e.type];return t?[{path:e.name,status:t}]:[]}),n=e.map(e=>{let t=QL(e),n=ue.current.get(t.name);return n&&$L(n,t)?n:t});return ue.current=new Map(n.map(e=>[e.name,e])),{patchFiles:n,treePaths:e.map(e=>e.name),treeStatus:t}},[le]),pe=M?.patch,me=(0,A.useMemo)(()=>{if(pe===void 0)return null;let e=e=>xI(Lf(e).flatMap(e=>e.files));return QI(e(le??``),e(pe)).toSorted((e,t)=>iR(e.name,t.name))},[le,pe]),he=C?.expandable??!1,ge=(0,A.useCallback)(e=>{let t=new URLSearchParams({path:e.name});return e.prevName&&t.set(`oldPath`,e.prevName),S.fetchQuery({queryKey:[`file-contents`,e.name,C?.fileHashes[e.name]],queryFn:()=>HL(`/api/file-contents?${t}`),staleTime:1/0})},[S,C]),ve=(0,A.useRef)(ge);ve.current=ge;let ye=mt({queries:de.map(e=>{let t=C?.fileHashes[e.name],n=new URLSearchParams({path:e.name});return e.prevName&&n.set(`oldPath`,e.prevName),{queryKey:[`file-contents`,e.name,t],queryFn:()=>HL(`/api/file-contents?${n}`),enabled:he&&e.hunks.length>0&&(p[e.name]??!1),staleTime:1/0}})}),{contentsByFile:be,loadingContents:xe}=(0,A.useMemo)(()=>{let e=new Map,t=new Set;return de.forEach((n,r)=>{let i=ye[r];i?.data?e.set(n.name,i.data):i?.isFetching&&t.add(n.name)}),{contentsByFile:e,loadingContents:t}},[de,ye]),Se=(0,A.useRef)(new Map),Ce=(0,A.useMemo)(()=>de.map(e=>{if(!(p[e.name]??!1))return e;let t=be.get(e.name),n=Se.current.get(e.name);if(!t&&n&&xe.has(e.name))return n.diff;if(!t||t.oldContents==null&&t.newContents==null)return e;if(n&&n.old===t.oldContents&&n.new===t.newContents)return n.diff;let r={...QL(zp({name:e.prevName??e.name,contents:t.oldContents??``},{name:e.name,contents:t.newContents??``},{context:2**53-1})),prevObjectId:e.prevObjectId,newObjectId:e.newObjectId};return Se.current.set(e.name,{old:t.oldContents,new:t.newContents,diff:r}),r}),[de,be,xe,p]),we=(0,A.useMemo)(()=>{let e=new Map;for(let t of Ce){let n=[];for(let e of t.hunks)for(let t=0;t<e.additionCount;t++)n.push(e.additionStart+t);e.set(t.name,n)}return e},[Ce]),Te=(0,A.useCallback)((e,t,n,r,i)=>{let a=Ce.find(t=>t.name===e);a&&(oe.reset(),se.reset(),b.current=``,g(o=>({file:e,side:t,first:n,line:r,diff:a,text:i,opened:(o?.opened??0)+1})))},[Ce,oe,se]),B=(0,A.useMemo)(()=>{if(!h)return null;let{file:e,side:t,first:n,line:r,diff:i}=h,a=Ce.find(t=>t.name===e);if(!a)return null;if(a===i)return h;let o=hL(i,a,t,r),s=n===r?o:hL(i,a,t,n);return o===null||s===null?null:{...h,first:s,line:o,diff:a}},[h,Ce]),[Ee,De]=(0,A.useState)(null);h&&B!==h&&(g(B),!B&&b.current.trim()&&De({text:b.current})),(0,A.useEffect)(()=>{Ee&&a((0,j.jsxs)(j.Fragment,{children:[`Comment box closed: its line changed or left the diff`,(0,j.jsx)(vR,{onClick:()=>void navigator.clipboard.writeText(Ee.text),children:`Copy draft`})]}),15e3)},[Ee,a]),(0,A.useEffect)(()=>{h||(b.current=``)},[h]);let Oe=(0,A.useRef)(B);Oe.current=B;let[ke,Ae]=(0,A.useState)(null),je=(0,A.useRef)(ke);je.current=ke;let Me=(0,A.useMemo)(()=>{let e={...C?.viewed};if(R.isPending&&R.variables){let{file:t,hash:n,mark:r}=R.variables;r?e[t]=n:delete e[t]}if(ae.isPending&&ae.variables)for(let{file:t}of ae.variables)delete e[t];return e},[C,R.isPending,R.variables,ae.isPending,ae.variables]),Ne=(0,A.useMemo)(()=>{let e=new Set;if(!C)return e;for(let[t,n]of Object.entries(C.fileHashes))Me[t]===n&&e.add(t);return e},[C,Me]),Pe=C?.commentsEnabled??!1,Fe=C?.send??!1,[Ie,Le]=(0,A.useState)(!1),[Re,ze]=(0,A.useState)(!1),Be=(0,A.useRef)(null);(0,A.useEffect)(()=>{h||Be.current?.getInstance()?.setSelectedLines(null)},[h]);let Ve=(0,A.useRef)(0),[He,Ue]=(0,A.useState)(null),We=(0,A.useRef)(null),Ge=(0,A.useCallback)(e=>{We.current=e,Ue(e)},[]),Ke=(0,A.useRef)(!1),qe=(0,A.useRef)(void 0),Je=(0,A.useCallback)(()=>{Ke.current=!0,clearTimeout(qe.current),qe.current=setTimeout(()=>{Ke.current=!1},200)},[]),Ye=(0,A.useRef)([]),Xe=(0,A.useCallback)((e,t)=>{Ve.current=e,Ke.current?Je():Ge(JR(t,e,Ye.current))},[Ge,Je]),Ze=(0,A.useRef)(new Map),Qe=(0,A.useMemo)(()=>C?Ce.map((e,t)=>{let n=e.name,r=C.fileHashes[n]??``;e.cacheKey??=`${n}|${r}|${e===de[t]?`patch`:`full`}`;let i=C.commentSyntaxes[n],a=Pe?ZL(e,n,!i||!(`sections`in i)&&i.prefix===``):[],s=nR(e);s&&a.push({side:e.type===`deleted`?`deletions`:`additions`,lineNumber:0,metadata:{type:`notice`,message:s}});let c=[];for(let t of _){if(t.file!==n)continue;let r=yR(e,t.side,t.lines[1]);r!==null&&(a.push({side:t.side,lineNumber:r,metadata:{type:`sent`,sent:t}}),c.push(`${t.id}@${r}`))}let l=B?.file===n&&!B.text?.columns;l&&a.push({side:B.side,lineNumber:B.line,metadata:{type:`composing`,file:n}});let u=o[n]??!1,d=l?`${B.side}${B.line}`:-1,f=`${C.fileHashes[n]??``}|${d}|${c.join(`,`)}|${+!!u}`,p=Ze.current.get(n),m=!p||p.key!==f||p.fileDiff!==e,h=m?(p?.version??0)+1:p.version;return m&&Ze.current.set(n,{key:f,fileDiff:e,version:h}),{id:n,type:`diff`,fileDiff:e,annotations:a,collapsed:u,version:h}}):[],[Ce,de,C,B,_,o,Pe]);Ye.current=Qe;let $e=He!=null&&Qe.some(e=>e.id===He)?He:Qe[0]?.id??null,et=(0,A.useRef)(null),tt=(0,A.useCallback)(e=>{let t=Be.current?.getInstance()?.getTopForItem(e);t!=null&&t<=Ve.current+4&&(et.current=e)},[]),nt=(0,A.useRef)(null),rt=(0,A.useCallback)(e=>{let t=Be.current;if(!t)return;nt.current=e,Je(),t.scrollTo({type:`item`,id:e,align:`start`});let n=0,r=()=>{nt.current===e&&(nt.current=null)},i=()=>{if(nt.current!==e)return;let t=Be.current?.getInstance();if(!t||++n>8)return r();let a=t.getTopForItem(e);if(a==null)return r();Math.abs(a-t.getScrollTop())>1&&(Je(),Be.current?.scrollTo({type:`item`,id:e,align:`start`})),requestAnimationFrame(i)};requestAnimationFrame(i)},[Je]),V=(0,A.useCallback)(e=>{Ye.current.some(t=>t.id===e)&&(Ge(e),rt(e))},[Ge,rt]);(0,A.useLayoutEffect)(()=>{let e=et.current;e&&(et.current=null,Je(),Be.current?.scrollTo({type:`item`,id:e,align:`start`,behavior:`instant`}))},[Qe,Je]);let it=(0,A.useRef)(new Map);(0,A.useEffect)(()=>{for(let[e,t]of it.current)t.setEditorActiveLine(ke?.file===e?ke.line:null)},[ke]);let at=(0,A.useCallback)(e=>{if(e.type!==`diff`)return null;let t=e.id,n=C?.fileHashes[t],r=Me[t],i=n!=null&&r===n,a=r!=null&&n!=null&&r!==n,c=o[t]??!1,l=e.fileDiff.hunks.length>0,u=he?null:C?.interdiff?`Line expansion isn't available for interdiffs`:`Line expansion isn't available for this diff range`;return(0,j.jsx)(NR,{fileDiff:e.fileDiff,isViewed:i,isStale:a,generated:C?.generated.includes(t)??!1,collapsed:c,focused:t===$e,showExpand:l,expandDisabledReason:u,expanded:p[t]??!1,onToggleCollapse:()=>{tt(t),s(e=>({...e,[t]:!c}))},onToggleViewed:()=>{if(!n)return;let e=!i;tt(t),s(n=>({...n,[t]:e})),R.mutate({file:t,hash:n,mark:e})},onToggleExpand:()=>{tt(t);let e=!(p[t]??!1);m(n=>({...n,[t]:e})),e&&c&&s(e=>({...e,[t]:!1}))}})},[C,Me,o,he,p,R,tt,$e]),ot=(0,A.useCallback)(e=>{if(!B)return null;let{file:t,side:n,first:r,line:i,text:a}=B,o=a?.columns??null;return(0,j.jsx)(TR,{copy:a?.copy??null,initialText:b.current,onTextChange:e=>{b.current=e},onSubmit:e=>{let n=Oe.current?.diff,s=n&&aL(n,`additions`,i);s!==void 0&&oe.mutate({file:t,afterLine:i,lineText:s,text:e,lineCount:i-r+1,quote:o&&a?.quote||void 0})},onSend:C?.send?s=>se.mutate({file:t,side:n,lines:[r,i],columns:o,quote:o&&a?a.quote:null,code:e&&CR(e,n,r,i),blob:e&&SR(e,n),text:s}):void 0,inlineUnavailable:Pe?n===`deletions`?`Inline comments go on the new side of the diff`:null:`Inline comments need the diff to end at the working copy`,onCancel:()=>g(null),submitting:oe.isPending&&oe.variables?.file===t||se.isPending,error:oe.variables?.file===t&&oe.error?oe.error.message:se.error?.message??null,syntax:C?.commentSyntaxes[t]??null},B.opened)},[oe,se,C,B,Pe]),st=(0,A.useCallback)((e,t,n)=>{let r=e.metadata;if(!r)return null;if(r.type===`notice`)return(0,j.jsx)(`div`,{className:`file-notice`,children:r.message});let i=n.id;if(r.type===`review`)return(0,j.jsxs)(`div`,{className:`review-annotation`,children:[(0,j.jsx)(`span`,{className:`review-annotation-lines`,children:r.target.start===r.target.end?`Line ${r.target.start}`:`Lines ${r.target.start}–${r.target.end}`}),(0,j.jsx)(vR,{onClick:()=>ce.mutate({file:i,line:r.startLine}),children:`Resolve comment`})]});if(r.type===`sent`){let{id:e,quote:t,text:n}=r.sent;return(0,j.jsxs)(`div`,{className:`sent-comment`,children:[(0,j.jsxs)(`div`,{className:`sent-comment-head`,children:[(0,j.jsx)(`span`,{className:`sent-comment-label`,children:`Sent`}),t&&(0,j.jsx)(`span`,{className:`comment-quote`,children:FI(t,120)}),(0,j.jsx)(`button`,{type:`button`,className:`sent-comment-dismiss`,"aria-label":`Dismiss`,title:`Dismiss`,onClick:()=>v(t=>t.filter(t=>t.id!==e)),children:`×`})]}),(0,j.jsx)(`div`,{className:`sent-comment-text`,children:n})]})}return r.type===`composing`?ot(n.type===`diff`?n.fileDiff:null):null},[ce,ot]),ct=(0,A.useRef)(()=>{}),lt=e=>Fe||Pe&&e===`additions`;ct.current=(e,t)=>{let n=e.side??`additions`;if(!lt(n))return;let r=e.endSide!=null&&e.endSide!==n,i=r?e.end:Math.min(e.start,e.end),a=r?e.end:Math.max(e.start,e.end),o=r?e.endSide:n;bR(t,o,i,a)||Te(t.id,o,i,a)};let ut=(0,A.useRef)(new WeakMap),dt=e=>[...document.querySelectorAll(`diffs-container`)].find(t=>ut.current.get(t)===e),ft=e=>{if(e.button!==0)return;let t=e.composedPath(),n=e=>t.some(t=>t instanceof Element&&t.matches(e));if(n(`.comment-form, [data-gutter]`))return;let r=!b.current.trim(),i=SL([...document.querySelectorAll(`diffs-container`)]);if(!i){Oe.current&&r&&n(`[data-line]`)&&g(null);return}if(Oe.current&&!r)return;let a=ut.current.get(i.host),o=Qe.find(e=>e.id===a),s=o&&aL(o.fileDiff,i.side,i.last);if(!a||!o||s===void 0)return;let{side:c,first:l,last:u}=i;if(!lt(c))return;let d=[i.columns[0],Math.min(i.columns[1],s.length)],f=d[0]===0&&d[1]===s.length;!f&&l===u&&d[0]>=d[1]||bR(o,c,l,u)||(Te(a,c,l,u,{columns:f?null:d,quote:XL(o.fileDiff,c,l,u,d),copy:window.getSelection()?.toString()??``}),Be.current?.getInstance()?.setSelectedLines(f?{id:a,range:{start:l,end:u,side:c}}:null))},pt=(0,A.useRef)(()=>{});pt.current=e=>{ft(e),Oe.current?.text?.columns&&!vt.assignedSlot&&yt.current()};let ht=(0,A.useRef)(()=>{});ht.current=e=>{if(!(e.detail<3||!Oe.current?.text?.columns||b.current.trim())&&!e.composedPath().some(e=>e instanceof Element&&e.matches(`.comment-form`)))for(let e of document.querySelectorAll(`diffs-container`))e.shadowRoot&&EL(e.shadowRoot,kL)},(0,A.useEffect)(()=>{if(!Fe&&!Pe)return;let e=e=>ht.current(e),t=e=>pt.current(e);return document.addEventListener(`mousedown`,e,!0),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousedown`,e,!0),document.removeEventListener(`mouseup`,t)}},[Fe,Pe]);let[vt]=(0,A.useState)(()=>{let e=document.createElement(`div`);return e.slot=kL,e.className=`comment-inline`,e}),yt=(0,A.useRef)(()=>{});yt.current=()=>{let e=Oe.current,t=e?.text?.columns,n=e&&t?dt(e.file):void 0,r=n&&wL(n,e.side,e.first,e.line,t)||null;for(let e of document.querySelectorAll(`diffs-container`))e.shadowRoot&&e!==n&&EL(e.shadowRoot,kL);n?.shadowRoot&&r?(vt.parentElement!==n&&n.append(vt),TL(n.shadowRoot,r,kL)):vt.remove(),`highlights`in CSS&&(r?CSS.highlights.set(`comment-quote`,new Highlight(r)):CSS.highlights.delete(`comment-quote`))},(0,A.useLayoutEffect)(()=>yt.current(),[B]);let bt=(0,A.useMemo)(()=>({theme:OL,themeType:te,preferredHighlighter:AL,diffStyle:r,itemMetrics:{diffHeaderHeight:40,paddingBottom:0},diffIndicators:`classic`,hunkSeparators:`line-info-basic`,overflow:`wrap`,stickyHeaders:!0,layout:{paddingTop:0,paddingBottom:8,gap:12},enableGutterUtility:Pe||Fe,loadDiffFiles:he?async e=>{let t=await ve.current(e);return{oldFile:{name:e.prevName??e.name,contents:t.oldContents??``},newFile:{name:e.name,contents:t.newContents??``}}}:void 0,unsafeCSS:Fe?dR:dR+fR,onGutterUtilityClick:(e,t)=>ct.current(e,t.item),onPostRender:(e,t,n,r)=>{let i=r.item.id,a=it.current;if(n===`unmount`){a.get(i)===t&&a.delete(i),ut.current.delete(e);return}ut.current.set(e,i);for(let[e,n]of a)n===t&&e!==i&&a.delete(e);a.set(i,t);let o=je.current;t.setEditorActiveLine(o?.file===i?o.line:null),e.toggleAttribute(`data-file-notice`,r.item.type===`diff`&&nR(r.item.fileDiff)!=null);let{blocks:s,targets:c}=_R(r.item.annotations);pR(e,s,c),Oe.current?.file===i&&yt.current()}}),[te,r,Pe,Fe,he]);if((0,A.useEffect)(()=>{function e(){let e=Qe.findIndex(e=>e.id===We.current);return e<0?0:e}function t(e){let t=(Be.current?.getInstance())?.getRenderedItems().find(t=>t.id===e);return t?.type===`diff`?t.instance:void 0}function r(){return document.querySelector(`.file-header`)?.getBoundingClientRect().height??0}function i(e,n){let i=Be.current?.getInstance(),a=i?.getTopForItem(e),o=t(e)?.getLinePosition(n,`additions`);if(i==null||a==null||o==null)return!1;let s=a+o.top,c=Ve.current;return s>=c+r()&&s+o.height<=c+i.getHeight()}function c(e){return o[e]??!1?[]:we.get(e)??[]}function l(e,t,n){for(let r=e;r>=0&&r<Qe.length;r+=n?1:-1){let i=c(Qe[r].id),a=r===e?t:n?-1/0:1/0,o=n?i.find(e=>e>a):i.findLast(e=>e<a);if(o!=null)return{file:Qe[r].id,line:o}}}function p(e){let n=c(e),i=Be.current?.getInstance(),a=i?.getTopForItem(e),o=t(e);if(!n.length||i==null||a==null||o==null)return null;let s=Ve.current+r()-a,l=0,u=n.length-1,d=-1;for(;l<=u;){let e=l+u>>1,t=o.getLinePosition(n[e],`additions`);if(t==null)return null;t.top>=s?(d=e,u=e-1):l=e+1}return d>=0?n[d]:null}function m(t){if(t.key===`k`&&(t.metaKey||t.ctrlKey)&&!t.altKey&&!t.shiftKey){t.preventDefault(),LR()||(f.current=!0,u(!0));return}let r=t.composedPath()[0];if(!(r instanceof HTMLTextAreaElement||r instanceof HTMLInputElement)&&!(t.ctrlKey||t.metaKey||t.altKey))switch(t.key){case`n`:case`p`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=Be.current?.getInstance();if(!n)break;let r=e(),i;if(t.key===`n`){if(r===Qe.length-1)break;i=r+1}else{let e=Qe[r].id,t=n.getTopForItem(e)??0;i=nt.current!==e&&Ve.current>t+4?r:Math.max(r-1,0)}let a=Qe[i].id;Ge(a),rt(a);let o=we.get(a);Ae(o?.length?{file:a,line:o[0]}:null);break}case`j`:case`k`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=t.key===`j`,r=je.current,a;if(r&&i(r.file,r.line))a=l(Qe.findIndex(e=>e.id===r.file),r.line,n);else{let t=e(),r=Qe[t].id,i=p(r);a=i==null?l(t,1/0,n):{file:r,line:i}}if(!a)break;Ge(a.file),Ae(a),nt.current=null,Je(),Be.current?.scrollTo({type:`line`,id:a.file,lineNumber:a.line,side:`additions`,align:`nearest`,behavior:`instant`});break}case`c`:{if(!(Pe||Fe)||Ie||B)break;t.preventDefault();let e=je.current;if(!e||(o[e.file]??!1))break;let n=Qe.find(t=>t.id===e.file);if(n&&bR(n,`additions`,e.line,e.line))break;Te(e.file,`additions`,e.line,e.line);break}case`e`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=Qe[e()].id;tt(n),s(e=>({...e,[n]:!(e[n]??!1)}));break}case`v`:{if(Ie||B||Qe.length===0)break;t.preventDefault();let n=Qe[e()].id,r=C?.fileHashes[n];if(!r)break;let i=Me[n]!==r;tt(n),s(e=>({...e,[n]:i})),R.mutate({file:n,hash:r,mark:i});break}case`?`:t.preventDefault(),Le(e=>!e);break;case`r`:if(Ie||!O)break;t.preventDefault(),k();break;case`Escape`:Ie?(t.preventDefault(),Le(!1)):B&&(t.preventDefault(),g(null));break;case`b`:if(Ie||B)break;t.preventDefault(),d();break;case`s`:if(Ie||B)break;t.preventDefault(),n(e=>{let t=qR[(qR.indexOf(e)+1)%qR.length];return a((0,j.jsxs)(j.Fragment,{children:[`Split mode: `,(0,j.jsx)(`code`,{children:t})]})),t});break;case`E`:{if(Ie||B)break;t.preventDefault();let n=Ce.some(e=>!(o[e.name]??!1));Qe.length>0&&tt(Qe[e()].id),s(Object.fromEntries(Ce.map(e=>[e.name,n])));break}case`t`:{if(Ie||B)break;t.preventDefault();let{stored:e,resolved:n}=ne();a((0,j.jsxs)(j.Fragment,{children:[`Theme: `,(0,j.jsx)(`code`,{children:n}),e===`system`?` (following system)`:null]}));break}}}function h(e){e.key===`Escape`&&e.composedPath()[0]===IR()&&document.querySelector(`.codeview-root`)?.focus({preventScroll:!0})}return window.addEventListener(`keydown`,h,!0),window.addEventListener(`keydown`,m),()=>{window.removeEventListener(`keydown`,h,!0),window.removeEventListener(`keydown`,m)}},[Ie,B,Ce,o,a,Qe,C,Me,R,tt,we,Pe,Te,Ge,Je,rt,u,d,ne,O,k,Fe,se]),VL(w))return(0,j.jsxs)(`div`,{className:`error-panel`,role:`alert`,children:[(0,j.jsx)(`h1`,{children:`No valid access token`}),(0,j.jsxs)(`p`,{children:[`Open the URL skepsis printed at startup, with the `,(0,j.jsx)(`code`,{children:`#token=`}),` fragment. Once a browser has opened it, the fragment can be left off for the rest of that run.`]})]});if(w&&!C)return(0,j.jsx)(`pre`,{style:{color:`red`,padding:20},children:String(w)});if(E||!C)return(0,j.jsx)(`div`,{className:`empty-diff`,children:`Loading...`});if(C.error)return(0,j.jsx)(`pre`,{style:{color:`red`,padding:20},children:C.error});if(!le)return(0,j.jsxs)(j.Fragment,{children:[O&&(0,j.jsx)(`div`,{className:`header-row diff-changed-standalone`,children:(0,j.jsx)(GR,{changes:me,onRefresh:k})}),(0,j.jsxs)(`div`,{className:`empty-diff`,children:[(0,j.jsx)(`code`,{children:C.revset}),` is empty`]})]});let{fileHashes:xt}=C;return(0,j.jsxs)(j.Fragment,{children:[!C.commentsEnabled&&(0,j.jsx)(UR,{vcs:C.vcs,send:C.send,interdiff:C.interdiff,onLearnMore:()=>ze(!0)}),(0,j.jsxs)(`div`,{className:`diff-container`,children:[(0,j.jsxs)(`div`,{className:`header-row`,children:[(0,j.jsx)(RR,{treeOpen:c,onToggleTree:d,command:C.revset,fileHashes:xt,viewed:Me,resolvedTheme:ie,onToggleTheme:ne,onShowHelp:()=>Le(!0),onUnviewAll:()=>{let e=Object.entries(Me).map(([e,t])=>({file:e,hash:t}));e.length!==0&&(s(t=>{let n={...t};for(let{file:t}of e)n[t]=!1;return n}),ae.mutate(e))}}),i&&(0,j.jsx)(`div`,{className:`toast`,style:{animationDuration:`${i.ms}ms`},children:i.content},i.key),O&&(0,j.jsx)(GR,{changes:me,onRefresh:k})]}),Ie&&(0,j.jsx)(VR,{send:C.send,onClose:()=>Le(!1)}),Re&&(0,j.jsx)(HR,{vcs:C.vcs,interdiff:C.interdiff,onClose:()=>ze(!1)}),(0,j.jsxs)(`div`,{className:`diff-body`,onPointerDownCapture:e=>{if(e.button!==0||!(e.target instanceof Element))return;let t=e.target.closest(`.codeview-root`);t&&!t.contains(document.activeElement)&&t.focus({preventScroll:!0})},children:[c&&(0,j.jsx)(FR,{paths:z,gitStatus:fe,viewed:Ne,focusedFile:$e,onSelectFile:V}),(0,j.jsx)(J_,{ref:Be,className:`codeview-root`,items:Qe,options:bt,onScroll:Xe,renderCustomHeader:at,renderAnnotation:st}),B?.text?.columns&&(0,Ki.createPortal)(ot(Qe.find(e=>e.id===B.file)?.fileDiff??null),vt)]})]})]})}var XR={workerFactory:()=>new qD,poolSize:2},ZR={theme:OL,preferredHighlighter:AL};function QR(){let e=(0,j.jsx)(oc,{children:(0,j.jsx)(YR,{})});return(0,j.jsx)(P,{client:DL,children:AL===`highlights`?e:(0,j.jsx)(U_,{poolOptions:XR,highlighterOptions:ZR,children:e})})}(0,D.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(QR,{}));export{Pc as a,Ic as i,nu as n,Lc as r,a_ as t};